@novaprose/core 0.8.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 (236) hide show
  1. package/dist/{a11ychecker-7KQU7DD3.js → a11ychecker-6ES3UMU3.js} +8 -8
  2. package/dist/{accordion-ui-FGN3I5UF.js → accordion-ui-B4I2FJXE.js} +4 -4
  3. package/dist/{advcode-65Z2ELUB.js → advcode-7S6N64C7.js} +4 -4
  4. package/dist/{advcode-editor-WIOCY552.js → advcode-editor-ENCPFVLO.js} +2 -2
  5. package/dist/{advlist-CEHE6YXS.js → advlist-FEDGNLMQ.js} +4 -4
  6. package/dist/{advtable-ui-5CBOPTHW.js → advtable-ui-JAVJY4L4.js} +8 -8
  7. package/dist/{ai-IRQYZHRK.js → ai-5KM776QW.js} +3 -3
  8. package/dist/{anchor-ui-NWIIRKGY.js → anchor-ui-VPKNKZ7J.js} +4 -4
  9. package/dist/{autocorrect-6GFLVDPC.js → autocorrect-5QLICCRN.js} +2 -2
  10. package/dist/{autolink-N427KVQO.js → autolink-ZYIPRXBA.js} +3 -3
  11. package/dist/{autosave-L7OZ3KLK.js → autosave-IC7YYG44.js} +3 -3
  12. package/dist/{casechange-5G6RAJ7K.js → casechange-R7IO2APS.js} +3 -3
  13. package/dist/{charmap-5CBBDWOP.js → charmap-CARYZFKD.js} +3 -3
  14. package/dist/{checklist-HM4VXZKY.js → checklist-7E47QW6L.js} +5 -5
  15. package/dist/{chunk-YDPZCVXS.js → chunk-3KBQEAX2.js} +6 -3
  16. package/dist/chunk-3KBQEAX2.js.map +1 -0
  17. package/dist/{chunk-AQV6FIKK.js → chunk-3NNILZVB.js} +3 -3
  18. package/dist/{chunk-ADRPQLZ2.js → chunk-5KERLFDD.js} +4 -1
  19. package/dist/chunk-5KERLFDD.js.map +1 -0
  20. package/dist/{chunk-TAM2FHKG.js → chunk-6BJEOL5V.js} +125 -1
  21. package/dist/chunk-6BJEOL5V.js.map +1 -0
  22. package/dist/{chunk-MZGNOHSY.js → chunk-AB67XUSR.js} +5 -3
  23. package/dist/{chunk-MZGNOHSY.js.map → chunk-AB67XUSR.js.map} +1 -1
  24. package/dist/{chunk-5VCESSQB.js → chunk-ARBKIZZU.js} +3 -3
  25. package/dist/{chunk-I7Y4KSM2.js → chunk-BMCH63QN.js} +50 -50
  26. package/dist/{chunk-EOJ5XHKA.js → chunk-BUABAYZL.js} +3 -3
  27. package/dist/{chunk-OFHGXYG3.js → chunk-DCMPJ25E.js} +2 -2
  28. package/dist/{chunk-FTEA6L2Q.js → chunk-DV7TGRU6.js} +2 -2
  29. package/dist/{chunk-HC6RMBAD.js → chunk-F2WT77ZG.js} +4 -4
  30. package/dist/{chunk-6YSQGFV7.js → chunk-FNJ7AEJK.js} +72 -10
  31. package/dist/chunk-FNJ7AEJK.js.map +1 -0
  32. package/dist/{chunk-C326LHHU.js → chunk-GUZCRDK6.js} +3 -3
  33. package/dist/{chunk-P2UU2NLT.js → chunk-HSVNJGK3.js} +3 -3
  34. package/dist/{chunk-S2XZRKHA.js → chunk-IFSD6O5M.js} +2 -2
  35. package/dist/{chunk-VK6YF2AA.js → chunk-IO5PU52K.js} +2 -2
  36. package/dist/{chunk-YG5V7POU.js → chunk-K4LFGNS7.js} +3 -3
  37. package/dist/{chunk-66INZHZ2.js → chunk-KGEHUWGL.js} +2 -2
  38. package/dist/{chunk-YVSUR7E5.js → chunk-KW6ATQPN.js} +4 -4
  39. package/dist/{chunk-LVEQBNLX.js → chunk-NX3KWIP5.js} +2 -2
  40. package/dist/{chunk-T3IRLTKK.js → chunk-QWT56RVG.js} +2 -2
  41. package/dist/{chunk-EXX2S352.js → chunk-RJ7T56OH.js} +184 -39
  42. package/dist/chunk-RJ7T56OH.js.map +1 -0
  43. package/dist/{chunk-GHVB6SV4.js → chunk-RPHA4HRX.js} +4 -4
  44. package/dist/{chunk-TABIUD2L.js → chunk-S4DCQA74.js} +2 -2
  45. package/dist/{chunk-IG2BL4ON.js → chunk-SNVYHGGO.js} +5 -5
  46. package/dist/{chunk-IG2BL4ON.js.map → chunk-SNVYHGGO.js.map} +1 -1
  47. package/dist/{chunk-GXXXLPDQ.js → chunk-T4543CB2.js} +2 -2
  48. package/dist/{chunk-AC3YCAX4.js → chunk-UHUOAQA6.js} +2 -2
  49. package/dist/{chunk-DEYYVZ7O.js → chunk-XCXJD5DO.js} +4 -1
  50. package/dist/chunk-XCXJD5DO.js.map +1 -0
  51. package/dist/{chunk-NTGEKGXU.js → chunk-Y2OXWCM7.js} +3 -3
  52. package/dist/{chunk-N32H37AJ.js → chunk-YOTA26H7.js} +4 -4
  53. package/dist/{chunk-4I4AYH2K.js → chunk-YP7N47QR.js} +2 -2
  54. package/dist/{chunk-J6W2CDRF.js → chunk-YYCDRUE2.js} +5 -5
  55. package/dist/{codesample-GHWIC7PT.js → codesample-FOWXMCTC.js} +5 -5
  56. package/dist/{directionality-EGQKGDZA.js → directionality-BXWXNPRZ.js} +5 -5
  57. package/dist/{document-IQqDDT4v.d.cts → document-B0hLRhuH.d.cts} +1 -1
  58. package/dist/{document-0ft41E6d.d.ts → document-Dh-jz1SK.d.ts} +1 -1
  59. package/dist/docx.cjs +64 -7
  60. package/dist/docx.cjs.map +1 -1
  61. package/dist/docx.d.cts +1 -1
  62. package/dist/docx.d.ts +1 -1
  63. package/dist/docx.js +26 -21
  64. package/dist/docx.js.map +1 -1
  65. package/dist/{draghandle-U6CYZHPA.js → draghandle-3IBHVHDE.js} +4 -4
  66. package/dist/{editimage-5EWPSM22.js → editimage-GTLFGHYU.js} +8 -8
  67. package/dist/{editor-Dmtwjw2u.d.ts → editor-DnAN9aPd.d.ts} +64 -4
  68. package/dist/{editor-BCMxe1M4.d.cts → editor-S8w_w5W0.d.cts} +64 -4
  69. package/dist/{email-ELNMEQ6E.js → email-FDSENENR.js} +2 -2
  70. package/dist/email.d.cts +2 -2
  71. package/dist/email.d.ts +2 -2
  72. package/dist/{emoticons-EGHNZKSA.js → emoticons-SHYSAEID.js} +3 -3
  73. package/dist/{exportpdf-4P7X3NY2.js → exportpdf-TEBDQZSN.js} +4 -4
  74. package/dist/{exportword-JFJ3KTYZ.js → exportword-BGH2CZXO.js} +3 -3
  75. package/dist/{footnotes-ui-FV6QRGDA.js → footnotes-ui-KPKFDSN7.js} +17 -17
  76. package/dist/{formatpainter-IEXX27OJ.js → formatpainter-CB4ZTKR5.js} +3 -3
  77. package/dist/{fullpagehtml-ui-RE4C2NO5.js → fullpagehtml-ui-JPGRMXHD.js} +4 -4
  78. package/dist/html-rules.cjs +2 -2
  79. package/dist/html-rules.cjs.map +1 -1
  80. package/dist/html-rules.js +2 -2
  81. package/dist/html-rules.js.map +1 -1
  82. package/dist/i18n/de.cjs +3 -0
  83. package/dist/i18n/de.cjs.map +1 -1
  84. package/dist/i18n/de.js +3 -0
  85. package/dist/i18n/de.js.map +1 -1
  86. package/dist/i18n/es.cjs +3 -0
  87. package/dist/i18n/es.cjs.map +1 -1
  88. package/dist/i18n/es.js +3 -0
  89. package/dist/i18n/es.js.map +1 -1
  90. package/dist/i18n/fr.cjs +3 -0
  91. package/dist/i18n/fr.cjs.map +1 -1
  92. package/dist/i18n/fr.js +3 -0
  93. package/dist/i18n/fr.js.map +1 -1
  94. package/dist/i18n/it.cjs +3 -0
  95. package/dist/i18n/it.cjs.map +1 -1
  96. package/dist/i18n/it.js +3 -0
  97. package/dist/i18n/it.js.map +1 -1
  98. package/dist/i18n/pt-BR.cjs +3 -0
  99. package/dist/i18n/pt-BR.cjs.map +1 -1
  100. package/dist/i18n/pt-BR.js +3 -0
  101. package/dist/i18n/pt-BR.js.map +1 -1
  102. package/dist/i18n/ru.cjs +3 -0
  103. package/dist/i18n/ru.cjs.map +1 -1
  104. package/dist/i18n/ru.js +3 -0
  105. package/dist/i18n/ru.js.map +1 -1
  106. package/dist/{importword-D7Z6RXGQ.js → importword-ZOWLUWSN.js} +3 -3
  107. package/dist/{index-CZ9yDvmQ.d.ts → index-Pb2r0V-S.d.cts} +3 -0
  108. package/dist/{index-CZ9yDvmQ.d.cts → index-Pb2r0V-S.d.ts} +3 -0
  109. package/dist/index.cjs +544 -178
  110. package/dist/index.cjs.map +1 -1
  111. package/dist/index.d.cts +5 -4
  112. package/dist/index.d.ts +5 -4
  113. package/dist/index.js +35 -31
  114. package/dist/index.js.map +1 -1
  115. package/dist/{insertdatetime-YW2VHYZH.js → insertdatetime-BXQ3XXPH.js} +3 -3
  116. package/dist/{linkchecker-3S3MCPOS.js → linkchecker-JASSETVI.js} +9 -9
  117. package/dist/{markdown-26O3N3T2.js → markdown-OTLTCK26.js} +4 -4
  118. package/dist/markdown.d.cts +1 -1
  119. package/dist/markdown.d.ts +1 -1
  120. package/dist/{math-ui-RUTCHTRY.js → math-ui-TY4VZF7Q.js} +6 -6
  121. package/dist/{media-ui-36TE3CJD.js → media-ui-IXN4ENVF.js} +8 -8
  122. package/dist/{mediaembed-ui-ZNTGZ2SQ.js → mediaembed-ui-ODX5ECXC.js} +6 -6
  123. package/dist/{mentions-ui-O4IPWQT4.js → mentions-ui-55GCKC6F.js} +3 -3
  124. package/dist/{mergetags-ui-HS3Q2R36.js → mergetags-ui-6T7Z7MAZ.js} +4 -4
  125. package/dist/{nonbreaking-GYRUH4UO.js → nonbreaking-PONHSOMJ.js} +3 -3
  126. package/dist/{pagebreak-ui-I4ZPYK3U.js → pagebreak-ui-AKAW7M5I.js} +5 -5
  127. package/dist/{pageembed-ui-WOY6VWRJ.js → pageembed-ui-GUNPKMBR.js} +5 -5
  128. package/dist/{pagelayout-ui-Y2IM7FJQ.js → pagelayout-ui-JSFVEMHS.js} +3 -3
  129. package/dist/{paste-office-3A6KWKCV.js → paste-office-TORLAZ5L.js} +13 -3
  130. package/dist/paste-office-TORLAZ5L.js.map +1 -0
  131. package/dist/{permanentpen-6D5LLKFX.js → permanentpen-EACURV5U.js} +11 -11
  132. package/dist/{print-MZMLQIQX.js → print-4XJCOANX.js} +2 -2
  133. package/dist/{quickbars-UZ2Q67TX.js → quickbars-BT5PETRX.js} +9 -9
  134. package/dist/{revisionhistory-ACRB23HL.js → revisionhistory-3FKLMJHJ.js} +16 -16
  135. package/dist/{save-72ZLF6AO.js → save-ZHFXH222.js} +3 -3
  136. package/dist/{search-bar-HTZQNPD3.js → search-bar-6MVRMTK6.js} +4 -4
  137. package/dist/search-bar-6MVRMTK6.js.map +1 -0
  138. package/dist/{spellchecker-DJ7SP5JY.js → spellchecker-JJKA6B4R.js} +2 -2
  139. package/dist/{suggestions-panel-RJXC4LCM.js → suggestions-panel-X37NFLXE.js} +6 -6
  140. package/dist/{suggestions-ui-PODMNH7D.js → suggestions-ui-WN7QNYHB.js} +7 -7
  141. package/dist/{table-OBHE465Y.js → table-PEF56QG5.js} +5 -5
  142. package/dist/{table-dialogs-UMIIZQYE.js → table-dialogs-QS3VFZD2.js} +6 -6
  143. package/dist/{tableofcontents-ui-U2PYNPX6.js → tableofcontents-ui-U7EV3UU7.js} +6 -6
  144. package/dist/{template-YYC2MGVH.js → template-ZRTKIP2J.js} +16 -16
  145. package/dist/{typography-EQUXUXIN.js → typography-S7RO54DB.js} +2 -2
  146. package/dist/upload.d.cts +1 -1
  147. package/dist/upload.d.ts +1 -1
  148. package/dist/{visualblocks-O5QW7ZDT.js → visualblocks-KJYRHF2L.js} +3 -3
  149. package/dist/{visualchars-UQFRWQPE.js → visualchars-TDLZKFXD.js} +3 -3
  150. package/package.json +1 -1
  151. package/src/style.css +56 -6
  152. package/dist/chunk-6YSQGFV7.js.map +0 -1
  153. package/dist/chunk-ADRPQLZ2.js.map +0 -1
  154. package/dist/chunk-DEYYVZ7O.js.map +0 -1
  155. package/dist/chunk-EXX2S352.js.map +0 -1
  156. package/dist/chunk-TAM2FHKG.js.map +0 -1
  157. package/dist/chunk-YDPZCVXS.js.map +0 -1
  158. package/dist/paste-office-3A6KWKCV.js.map +0 -1
  159. package/dist/search-bar-HTZQNPD3.js.map +0 -1
  160. /package/dist/{a11ychecker-7KQU7DD3.js.map → a11ychecker-6ES3UMU3.js.map} +0 -0
  161. /package/dist/{accordion-ui-FGN3I5UF.js.map → accordion-ui-B4I2FJXE.js.map} +0 -0
  162. /package/dist/{advcode-65Z2ELUB.js.map → advcode-7S6N64C7.js.map} +0 -0
  163. /package/dist/{advcode-editor-WIOCY552.js.map → advcode-editor-ENCPFVLO.js.map} +0 -0
  164. /package/dist/{advlist-CEHE6YXS.js.map → advlist-FEDGNLMQ.js.map} +0 -0
  165. /package/dist/{advtable-ui-5CBOPTHW.js.map → advtable-ui-JAVJY4L4.js.map} +0 -0
  166. /package/dist/{ai-IRQYZHRK.js.map → ai-5KM776QW.js.map} +0 -0
  167. /package/dist/{anchor-ui-NWIIRKGY.js.map → anchor-ui-VPKNKZ7J.js.map} +0 -0
  168. /package/dist/{autocorrect-6GFLVDPC.js.map → autocorrect-5QLICCRN.js.map} +0 -0
  169. /package/dist/{autolink-N427KVQO.js.map → autolink-ZYIPRXBA.js.map} +0 -0
  170. /package/dist/{autosave-L7OZ3KLK.js.map → autosave-IC7YYG44.js.map} +0 -0
  171. /package/dist/{casechange-5G6RAJ7K.js.map → casechange-R7IO2APS.js.map} +0 -0
  172. /package/dist/{charmap-5CBBDWOP.js.map → charmap-CARYZFKD.js.map} +0 -0
  173. /package/dist/{checklist-HM4VXZKY.js.map → checklist-7E47QW6L.js.map} +0 -0
  174. /package/dist/{chunk-AQV6FIKK.js.map → chunk-3NNILZVB.js.map} +0 -0
  175. /package/dist/{chunk-5VCESSQB.js.map → chunk-ARBKIZZU.js.map} +0 -0
  176. /package/dist/{chunk-I7Y4KSM2.js.map → chunk-BMCH63QN.js.map} +0 -0
  177. /package/dist/{chunk-EOJ5XHKA.js.map → chunk-BUABAYZL.js.map} +0 -0
  178. /package/dist/{chunk-OFHGXYG3.js.map → chunk-DCMPJ25E.js.map} +0 -0
  179. /package/dist/{chunk-FTEA6L2Q.js.map → chunk-DV7TGRU6.js.map} +0 -0
  180. /package/dist/{chunk-HC6RMBAD.js.map → chunk-F2WT77ZG.js.map} +0 -0
  181. /package/dist/{chunk-C326LHHU.js.map → chunk-GUZCRDK6.js.map} +0 -0
  182. /package/dist/{chunk-P2UU2NLT.js.map → chunk-HSVNJGK3.js.map} +0 -0
  183. /package/dist/{chunk-S2XZRKHA.js.map → chunk-IFSD6O5M.js.map} +0 -0
  184. /package/dist/{chunk-VK6YF2AA.js.map → chunk-IO5PU52K.js.map} +0 -0
  185. /package/dist/{chunk-YG5V7POU.js.map → chunk-K4LFGNS7.js.map} +0 -0
  186. /package/dist/{chunk-66INZHZ2.js.map → chunk-KGEHUWGL.js.map} +0 -0
  187. /package/dist/{chunk-YVSUR7E5.js.map → chunk-KW6ATQPN.js.map} +0 -0
  188. /package/dist/{chunk-LVEQBNLX.js.map → chunk-NX3KWIP5.js.map} +0 -0
  189. /package/dist/{chunk-T3IRLTKK.js.map → chunk-QWT56RVG.js.map} +0 -0
  190. /package/dist/{chunk-GHVB6SV4.js.map → chunk-RPHA4HRX.js.map} +0 -0
  191. /package/dist/{chunk-TABIUD2L.js.map → chunk-S4DCQA74.js.map} +0 -0
  192. /package/dist/{chunk-GXXXLPDQ.js.map → chunk-T4543CB2.js.map} +0 -0
  193. /package/dist/{chunk-AC3YCAX4.js.map → chunk-UHUOAQA6.js.map} +0 -0
  194. /package/dist/{chunk-NTGEKGXU.js.map → chunk-Y2OXWCM7.js.map} +0 -0
  195. /package/dist/{chunk-N32H37AJ.js.map → chunk-YOTA26H7.js.map} +0 -0
  196. /package/dist/{chunk-4I4AYH2K.js.map → chunk-YP7N47QR.js.map} +0 -0
  197. /package/dist/{chunk-J6W2CDRF.js.map → chunk-YYCDRUE2.js.map} +0 -0
  198. /package/dist/{codesample-GHWIC7PT.js.map → codesample-FOWXMCTC.js.map} +0 -0
  199. /package/dist/{directionality-EGQKGDZA.js.map → directionality-BXWXNPRZ.js.map} +0 -0
  200. /package/dist/{draghandle-U6CYZHPA.js.map → draghandle-3IBHVHDE.js.map} +0 -0
  201. /package/dist/{editimage-5EWPSM22.js.map → editimage-GTLFGHYU.js.map} +0 -0
  202. /package/dist/{email-ELNMEQ6E.js.map → email-FDSENENR.js.map} +0 -0
  203. /package/dist/{emoticons-EGHNZKSA.js.map → emoticons-SHYSAEID.js.map} +0 -0
  204. /package/dist/{exportpdf-4P7X3NY2.js.map → exportpdf-TEBDQZSN.js.map} +0 -0
  205. /package/dist/{exportword-JFJ3KTYZ.js.map → exportword-BGH2CZXO.js.map} +0 -0
  206. /package/dist/{footnotes-ui-FV6QRGDA.js.map → footnotes-ui-KPKFDSN7.js.map} +0 -0
  207. /package/dist/{formatpainter-IEXX27OJ.js.map → formatpainter-CB4ZTKR5.js.map} +0 -0
  208. /package/dist/{fullpagehtml-ui-RE4C2NO5.js.map → fullpagehtml-ui-JPGRMXHD.js.map} +0 -0
  209. /package/dist/{importword-D7Z6RXGQ.js.map → importword-ZOWLUWSN.js.map} +0 -0
  210. /package/dist/{insertdatetime-YW2VHYZH.js.map → insertdatetime-BXQ3XXPH.js.map} +0 -0
  211. /package/dist/{linkchecker-3S3MCPOS.js.map → linkchecker-JASSETVI.js.map} +0 -0
  212. /package/dist/{markdown-26O3N3T2.js.map → markdown-OTLTCK26.js.map} +0 -0
  213. /package/dist/{math-ui-RUTCHTRY.js.map → math-ui-TY4VZF7Q.js.map} +0 -0
  214. /package/dist/{media-ui-36TE3CJD.js.map → media-ui-IXN4ENVF.js.map} +0 -0
  215. /package/dist/{mediaembed-ui-ZNTGZ2SQ.js.map → mediaembed-ui-ODX5ECXC.js.map} +0 -0
  216. /package/dist/{mentions-ui-O4IPWQT4.js.map → mentions-ui-55GCKC6F.js.map} +0 -0
  217. /package/dist/{mergetags-ui-HS3Q2R36.js.map → mergetags-ui-6T7Z7MAZ.js.map} +0 -0
  218. /package/dist/{nonbreaking-GYRUH4UO.js.map → nonbreaking-PONHSOMJ.js.map} +0 -0
  219. /package/dist/{pagebreak-ui-I4ZPYK3U.js.map → pagebreak-ui-AKAW7M5I.js.map} +0 -0
  220. /package/dist/{pageembed-ui-WOY6VWRJ.js.map → pageembed-ui-GUNPKMBR.js.map} +0 -0
  221. /package/dist/{pagelayout-ui-Y2IM7FJQ.js.map → pagelayout-ui-JSFVEMHS.js.map} +0 -0
  222. /package/dist/{permanentpen-6D5LLKFX.js.map → permanentpen-EACURV5U.js.map} +0 -0
  223. /package/dist/{print-MZMLQIQX.js.map → print-4XJCOANX.js.map} +0 -0
  224. /package/dist/{quickbars-UZ2Q67TX.js.map → quickbars-BT5PETRX.js.map} +0 -0
  225. /package/dist/{revisionhistory-ACRB23HL.js.map → revisionhistory-3FKLMJHJ.js.map} +0 -0
  226. /package/dist/{save-72ZLF6AO.js.map → save-ZHFXH222.js.map} +0 -0
  227. /package/dist/{spellchecker-DJ7SP5JY.js.map → spellchecker-JJKA6B4R.js.map} +0 -0
  228. /package/dist/{suggestions-panel-RJXC4LCM.js.map → suggestions-panel-X37NFLXE.js.map} +0 -0
  229. /package/dist/{suggestions-ui-PODMNH7D.js.map → suggestions-ui-WN7QNYHB.js.map} +0 -0
  230. /package/dist/{table-OBHE465Y.js.map → table-PEF56QG5.js.map} +0 -0
  231. /package/dist/{table-dialogs-UMIIZQYE.js.map → table-dialogs-QS3VFZD2.js.map} +0 -0
  232. /package/dist/{tableofcontents-ui-U2PYNPX6.js.map → tableofcontents-ui-U7EV3UU7.js.map} +0 -0
  233. /package/dist/{template-YYC2MGVH.js.map → template-ZRTKIP2J.js.map} +0 -0
  234. /package/dist/{typography-EQUXUXIN.js.map → typography-S7RO54DB.js.map} +0 -0
  235. /package/dist/{visualblocks-O5QW7ZDT.js.map → visualblocks-KJYRHF2L.js.map} +0 -0
  236. /package/dist/{visualchars-UQFRWQPE.js.map → visualchars-TDLZKFXD.js.map} +0 -0
package/dist/index.cjs CHANGED
@@ -383,6 +383,9 @@ var init_icons = __esm({
383
383
  lineHeight: svg(
384
384
  '<path d="M15 14H9" /><path d="M21 21H3" /><path d="M21 3H3" /><path d="m8 16 3.453-7.648a.6.6 0 011.094.001L16 16" />'
385
385
  ),
386
+ language: svg(
387
+ '<path d="m5 8 6 6" /><path d="m4 14 6-6 2-3" /><path d="M2 5h12" /><path d="M7 2h1" /><path d="m22 22-5-10-5 10" /><path d="M14 18h6" />'
388
+ ),
386
389
  upload: svg(
387
390
  '<path d="M12 3v12" /><path d="m17 8-5-5-5 5" /><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />'
388
391
  ),
@@ -564,6 +567,9 @@ var init_en = __esm({
564
567
  fontFamily: "Font",
565
568
  fontSize: "Font size",
566
569
  lineHeight: "Line height",
570
+ language: "Language",
571
+ "language.default": "Default language",
572
+ "language.field": "Language of the selected text",
567
573
  default: "Default",
568
574
  textColor: "Text color",
569
575
  backgroundColor: "Highlight color",
@@ -1364,7 +1370,9 @@ function textField(options2) {
1364
1370
  className: "nova-input",
1365
1371
  value: options2.value ?? "",
1366
1372
  placeholder: options2.placeholder,
1367
- required: options2.required ?? false,
1373
+ // aria-required, not required: an empty native required field is :invalid from the start, and
1374
+ // VoiceOver says "invalid data" before anything was typed. The dialog checks the value itself.
1375
+ ...options2.required ? { "aria-required": "true" } : {},
1368
1376
  autocomplete: options2.autocomplete ?? "off",
1369
1377
  spellcheck: "false",
1370
1378
  "aria-describedby": hintId
@@ -1658,6 +1666,105 @@ var init_code_language = __esm({
1658
1666
  }
1659
1667
  });
1660
1668
 
1669
+ // src/language.ts
1670
+ function languageTag(value) {
1671
+ if (typeof value !== "string") return null;
1672
+ const tag2 = value.trim();
1673
+ if (tag2.length > 35 || !TAG.test(tag2)) return null;
1674
+ try {
1675
+ return Intl.getCanonicalLocales(tag2)[0] ?? null;
1676
+ } catch {
1677
+ return null;
1678
+ }
1679
+ }
1680
+ function languageName(code, uiLanguage = "en") {
1681
+ try {
1682
+ return new Intl.DisplayNames([uiLanguage, "en"], { type: "language" }).of(code) ?? code;
1683
+ } catch {
1684
+ return code;
1685
+ }
1686
+ }
1687
+ function contentLanguages(configured, uiLanguage = "en") {
1688
+ const list = configured ?? DEFAULT_CONTENT_LANGS.map((code) => ({ code }));
1689
+ const out = [];
1690
+ for (const entry of list) {
1691
+ const code = languageTag(entry?.code);
1692
+ if (!code || out.some((o) => o.code === code)) continue;
1693
+ const title = typeof entry.title === "string" && entry.title.trim() ? entry.title.trim() : languageName(code, uiLanguage);
1694
+ out.push({ code, title });
1695
+ }
1696
+ if (!configured) out.sort((a, b) => a.title.localeCompare(b.title, uiLanguage));
1697
+ return out;
1698
+ }
1699
+ function getTextLanguage(state) {
1700
+ const type = state.schema.marks.language;
1701
+ if (!type) return null;
1702
+ const { $from, empty } = state.selection;
1703
+ const marks3 = empty ? state.storedMarks ?? $from.marks() : $from.nodeAfter?.marks ?? $from.marks();
1704
+ return languageTag(type.isInSet(marks3)?.attrs.lang);
1705
+ }
1706
+ function setTextLanguage(lang2) {
1707
+ return (state, dispatch) => {
1708
+ const type = state.schema.marks.language;
1709
+ const tag2 = lang2 === null ? null : languageTag(lang2);
1710
+ if (!type || lang2 !== null && !tag2) return false;
1711
+ const { selection } = state;
1712
+ let applies = false;
1713
+ if (selection.empty) applies = selection.$from.parent.type.allowsMarkType(type);
1714
+ else
1715
+ for (const { $from, $to } of selection.ranges)
1716
+ state.doc.nodesBetween($from.pos, $to.pos, (node, _pos, parent) => {
1717
+ if (applies) return false;
1718
+ if (node.isInline && parent?.type.allowsMarkType(type)) applies = true;
1719
+ return true;
1720
+ });
1721
+ if (!applies) return false;
1722
+ if (!dispatch) return true;
1723
+ const tr = state.tr;
1724
+ if (selection.empty) {
1725
+ tr.removeStoredMark(type);
1726
+ if (tag2) tr.addStoredMark(type.create({ lang: tag2 }));
1727
+ } else {
1728
+ for (const { $from, $to } of selection.ranges) {
1729
+ tr.removeMark($from.pos, $to.pos, type);
1730
+ if (tag2) tr.addMark($from.pos, $to.pos, type.create({ lang: tag2 }));
1731
+ }
1732
+ }
1733
+ dispatch(tr.scrollIntoView());
1734
+ return true;
1735
+ };
1736
+ }
1737
+ var DEFAULT_CONTENT_LANGS, TAG, primaryLanguage;
1738
+ var init_language = __esm({
1739
+ "src/language.ts"() {
1740
+ "use strict";
1741
+ DEFAULT_CONTENT_LANGS = [
1742
+ "ar",
1743
+ "de",
1744
+ "el",
1745
+ "en",
1746
+ "es",
1747
+ "fr",
1748
+ "he",
1749
+ "hi",
1750
+ "it",
1751
+ "ja",
1752
+ "ko",
1753
+ "la",
1754
+ "nl",
1755
+ "pl",
1756
+ "pt",
1757
+ "ru",
1758
+ "sv",
1759
+ "tr",
1760
+ "uk",
1761
+ "zh"
1762
+ ];
1763
+ TAG = /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8})*$/;
1764
+ primaryLanguage = (tag2) => tag2.split("-")[0].toLowerCase();
1765
+ }
1766
+ });
1767
+
1661
1768
  // src/schema.ts
1662
1769
  function normalizeColor(value) {
1663
1770
  const v = value.trim().toLowerCase();
@@ -1984,6 +2091,7 @@ var init_schema = __esm({
1984
2091
  init_url();
1985
2092
  init_code_language();
1986
2093
  init_element_id();
2094
+ init_language();
1987
2095
  ALIGNMENTS = ["left", "center", "right", "justify"];
1988
2096
  COLOR_RE = /^(#[0-9a-f]{3,8}|rgba?\(\s*[\d.]+%?\s*,\s*[\d.]+%?\s*,\s*[\d.]+%?\s*(,\s*[\d.]+%?\s*)?\)|[a-z]{3,20})$/i;
1989
2097
  LENGTH_RE = /^\d{1,4}(\.\d{1,3})?(px|pt|em|rem|%)$/;
@@ -2327,6 +2435,31 @@ var init_schema = __esm({
2327
2435
  });
2328
2436
  nodes = buildNodes(NO_CLASSES);
2329
2437
  buildMarks = (allow) => ({
2438
+ /**
2439
+ * <span lang="…"> — a passage in another language (WCAG 3.1.2): screen readers read it with that
2440
+ * language's voice. Any element's lang reaches its text: <p lang="fr"> stays a paragraph and its
2441
+ * text is marked. The rule doesn't consume the element, so its own rules still apply.
2442
+ */
2443
+ language: {
2444
+ // A JSON document can leave it out: no language, a plain span.
2445
+ attrs: { lang: { default: null } },
2446
+ parseDOM: [
2447
+ {
2448
+ tag: "[lang]",
2449
+ // Before the rules of em, strong, a…: they consume their element.
2450
+ priority: 60,
2451
+ consuming: false,
2452
+ getAttrs: (dom) => {
2453
+ const lang2 = languageTag(dom.getAttribute("lang"));
2454
+ return lang2 ? { lang: lang2 } : false;
2455
+ }
2456
+ }
2457
+ ],
2458
+ toDOM: (mark) => {
2459
+ const lang2 = languageTag(mark.attrs.lang);
2460
+ return lang2 ? ["span", { lang: lang2 }, 0] : ["span", 0];
2461
+ }
2462
+ },
2330
2463
  link: {
2331
2464
  attrs: { href: {}, title: { default: null }, target: { default: null } },
2332
2465
  inclusive: false,
@@ -10094,6 +10227,112 @@ var init_footnotes = __esm({
10094
10227
  }
10095
10228
  });
10096
10229
 
10230
+ // src/sticky-header.ts
10231
+ function stickyHeader(header, content) {
10232
+ let measured = null;
10233
+ const cover = () => {
10234
+ if (measured !== null) return measured;
10235
+ measured = 0;
10236
+ queueMicrotask(() => measured = null);
10237
+ if (content.scrollHeight > content.clientHeight + 1) return measured;
10238
+ const style2 = getComputedStyle(header);
10239
+ if (style2.position === "sticky" && style2.display !== "none")
10240
+ measured = header.offsetHeight + (parseFloat(style2.top) || 0);
10241
+ return measured;
10242
+ };
10243
+ const uncover = (view) => {
10244
+ if (!cover() || !view.hasFocus()) return;
10245
+ const box2 = header.getBoundingClientRect();
10246
+ let caret;
10247
+ try {
10248
+ caret = view.coordsAtPos(view.state.selection.head);
10249
+ } catch {
10250
+ return;
10251
+ }
10252
+ if (caret.bottom <= box2.top || caret.top >= box2.bottom) return;
10253
+ scrollerOf(header).scrollBy(0, caret.top - box2.bottom - 5);
10254
+ };
10255
+ const reveal = (view) => {
10256
+ if (!view.dom.getClientRects().length) return;
10257
+ let rect;
10258
+ try {
10259
+ rect = view.coordsAtPos(view.state.selection.head);
10260
+ } catch {
10261
+ return;
10262
+ }
10263
+ if (content.scrollHeight > content.clientHeight + 1) {
10264
+ const box2 = content.getBoundingClientRect();
10265
+ if (rect.top < box2.top + 5) content.scrollTop -= box2.top + 5 - rect.top;
10266
+ else if (rect.bottom > box2.bottom - 5) content.scrollTop += rect.bottom - box2.bottom + 5;
10267
+ rect = view.coordsAtPos(view.state.selection.head);
10268
+ }
10269
+ const scroller = scrollerOf(content);
10270
+ const area = scroller instanceof HTMLElement ? scroller.getBoundingClientRect() : { top: 0, bottom: scroller.innerHeight };
10271
+ const top = area.top + cover() + 5;
10272
+ const bottom = area.bottom - 5;
10273
+ if (rect.top < top) scroller.scrollBy(0, rect.top - top);
10274
+ else if (rect.bottom > bottom) scroller.scrollBy(0, rect.bottom - bottom);
10275
+ };
10276
+ const plugin = new import_prosemirror_state25.Plugin({
10277
+ key: scrolls,
10278
+ // Counts the requests to scroll to the selection (tr.scrollIntoView()).
10279
+ state: {
10280
+ init: () => 0,
10281
+ apply: (tr, count) => tr.scrolledIntoView ? count + 1 : count
10282
+ },
10283
+ view: () => {
10284
+ let frame = 0;
10285
+ return {
10286
+ update(view, prev) {
10287
+ if (scrolls.getState(view.state) !== scrolls.getState(prev) && !view.hasFocus())
10288
+ reveal(view);
10289
+ if (view.state.selection.eq(prev.selection)) return;
10290
+ cancelAnimationFrame(frame);
10291
+ frame = requestAnimationFrame(() => uncover(view));
10292
+ },
10293
+ destroy: () => cancelAnimationFrame(frame)
10294
+ };
10295
+ }
10296
+ });
10297
+ return {
10298
+ plugin,
10299
+ props: {
10300
+ scrollThreshold: {
10301
+ left: 0,
10302
+ right: 0,
10303
+ bottom: 0,
10304
+ get top() {
10305
+ return cover();
10306
+ }
10307
+ },
10308
+ scrollMargin: {
10309
+ left: 5,
10310
+ right: 5,
10311
+ bottom: 5,
10312
+ get top() {
10313
+ return cover() + 5;
10314
+ }
10315
+ }
10316
+ }
10317
+ };
10318
+ }
10319
+ function scrollerOf(el) {
10320
+ for (let parent = el.parentElement; parent; parent = parent.parentElement) {
10321
+ const { overflowY } = getComputedStyle(parent);
10322
+ if (/auto|scroll|overlay/.test(overflowY) && parent.scrollHeight > parent.clientHeight + 1)
10323
+ return parent;
10324
+ }
10325
+ return el.ownerDocument.defaultView ?? window;
10326
+ }
10327
+ var import_prosemirror_state25, scrolls;
10328
+ var init_sticky_header = __esm({
10329
+ "src/sticky-header.ts"() {
10330
+ "use strict";
10331
+ import_prosemirror_state25 = require("prosemirror-state");
10332
+ scrolls = new import_prosemirror_state25.PluginKey("nova-scroll-requests");
10333
+ }
10334
+ });
10335
+
10097
10336
  // src/formats.ts
10098
10337
  function warnOnce(message) {
10099
10338
  if (warned2.has(message)) return;
@@ -10146,7 +10385,7 @@ function selectedNodes(state, tags2) {
10146
10385
  const out = [];
10147
10386
  const matches2 = (node) => tags2.some((tag2) => BLOCK_TAGS[tag2](node));
10148
10387
  const { selection } = state;
10149
- if (selection instanceof import_prosemirror_state25.NodeSelection && matches2(selection.node)) {
10388
+ if (selection instanceof import_prosemirror_state26.NodeSelection && matches2(selection.node)) {
10150
10389
  return [{ node: selection.node, pos: selection.from }];
10151
10390
  }
10152
10391
  const { $from, from, to } = selection;
@@ -10285,8 +10524,8 @@ function applySpec(state, tr, spec) {
10285
10524
  class: withClasses(node.attrs.class, classes2)
10286
10525
  });
10287
10526
  }
10288
- if (state.selection instanceof import_prosemirror_state25.NodeSelection)
10289
- tr.setSelection(import_prosemirror_state25.NodeSelection.create(tr.doc, state.selection.from));
10527
+ if (state.selection instanceof import_prosemirror_state26.NodeSelection)
10528
+ tr.setSelection(import_prosemirror_state26.NodeSelection.create(tr.doc, state.selection.from));
10290
10529
  return true;
10291
10530
  }
10292
10531
  if (spec.inline) {
@@ -10345,8 +10584,8 @@ function removeSpec(state, tr, spec) {
10345
10584
  class: withoutClasses(node.attrs.class, classes2)
10346
10585
  });
10347
10586
  }
10348
- if (state.selection instanceof import_prosemirror_state25.NodeSelection)
10349
- tr.setSelection(import_prosemirror_state25.NodeSelection.create(tr.doc, state.selection.from));
10587
+ if (state.selection instanceof import_prosemirror_state26.NodeSelection)
10588
+ tr.setSelection(import_prosemirror_state26.NodeSelection.create(tr.doc, state.selection.from));
10350
10589
  return;
10351
10590
  }
10352
10591
  if (spec.inline) {
@@ -10377,11 +10616,11 @@ function removeSpec(state, tr, spec) {
10377
10616
  }
10378
10617
  }
10379
10618
  }
10380
- var import_prosemirror_state25, import_prosemirror_commands2, INLINE_MARKS, INLINE_STYLES, BLOCK_TAGS, warned2, hasClasses, withClasses, withoutClasses, selectorTags, Formatter;
10619
+ var import_prosemirror_state26, import_prosemirror_commands2, INLINE_MARKS, INLINE_STYLES, BLOCK_TAGS, warned2, hasClasses, withClasses, withoutClasses, selectorTags, Formatter;
10381
10620
  var init_formats = __esm({
10382
10621
  "src/formats.ts"() {
10383
10622
  "use strict";
10384
- import_prosemirror_state25 = require("prosemirror-state");
10623
+ import_prosemirror_state26 = require("prosemirror-state");
10385
10624
  import_prosemirror_commands2 = require("prosemirror-commands");
10386
10625
  init_commands();
10387
10626
  init_schema();
@@ -10803,8 +11042,8 @@ function dataImageSrcs(doc, type) {
10803
11042
  return srcs;
10804
11043
  }
10805
11044
  function embeddedImageUploadPlugin(editor) {
10806
- return new import_prosemirror_state26.Plugin({
10807
- key: new import_prosemirror_state26.PluginKey("nova-embedded-image-upload"),
11045
+ return new import_prosemirror_state27.Plugin({
11046
+ key: new import_prosemirror_state27.PluginKey("nova-embedded-image-upload"),
10808
11047
  appendTransaction(transactions, oldState, newState) {
10809
11048
  if (!editor.options.uploadImage) return null;
10810
11049
  const fromUser = transactions.some(
@@ -10821,8 +11060,8 @@ function embeddedImageUploadPlugin(editor) {
10821
11060
  });
10822
11061
  }
10823
11062
  function imageDropPastePlugin(editor) {
10824
- return new import_prosemirror_state26.Plugin({
10825
- key: new import_prosemirror_state26.PluginKey("nova-image-drop-paste"),
11063
+ return new import_prosemirror_state27.Plugin({
11064
+ key: new import_prosemirror_state27.PluginKey("nova-image-drop-paste"),
10826
11065
  props: {
10827
11066
  handlePaste(_view, event) {
10828
11067
  if (!editor.isAllowed("image")) return false;
@@ -10916,7 +11155,7 @@ function getSelectedImage(state) {
10916
11155
  const { selection } = state;
10917
11156
  const nodes3 = nodesOf(state);
10918
11157
  const result = (node, pos) => node.type === nodes3.figure ? { node, pos, attrs: { ...node.firstChild?.attrs, align: node.attrs.align } } : { node, pos, attrs: node.attrs };
10919
- if (selection instanceof import_prosemirror_state26.NodeSelection && (selection.node.type === nodes3.image || selection.node.type === nodes3.figure)) {
11158
+ if (selection instanceof import_prosemirror_state27.NodeSelection && (selection.node.type === nodes3.image || selection.node.type === nodes3.figure)) {
10920
11159
  return result(selection.node, selection.from);
10921
11160
  }
10922
11161
  const { $from } = selection;
@@ -10946,7 +11185,7 @@ function setImageAttrs(attrs) {
10946
11185
  }
10947
11186
  } else {
10948
11187
  tr.setNodeMarkup(image.pos, void 0, { ...image.node.attrs, ...attrs });
10949
- tr.setSelection(import_prosemirror_state26.NodeSelection.create(tr.doc, image.pos));
11188
+ tr.setSelection(import_prosemirror_state27.NodeSelection.create(tr.doc, image.pos));
10950
11189
  }
10951
11190
  dispatch(tr);
10952
11191
  }
@@ -10991,12 +11230,12 @@ function openImageAltDialog(editor) {
10991
11230
  }
10992
11231
  });
10993
11232
  }
10994
- var import_prosemirror_state26, IMAGE_TYPES, UPLOAD_RETRY_DELAYS, UnsafeUploadUrl, DATA_IMAGE, IMAGE_ATTRS, pick, toggleImageCaption, exitImageCaption;
11233
+ var import_prosemirror_state27, IMAGE_TYPES, UPLOAD_RETRY_DELAYS, UnsafeUploadUrl, DATA_IMAGE, IMAGE_ATTRS, pick, toggleImageCaption, exitImageCaption;
10995
11234
  var init_image = __esm({
10996
11235
  "src/image.ts"() {
10997
11236
  "use strict";
10998
11237
  init_file_picker();
10999
- import_prosemirror_state26 = require("prosemirror-state");
11238
+ import_prosemirror_state27 = require("prosemirror-state");
11000
11239
  init_commands();
11001
11240
  init_commands();
11002
11241
  init_dialog();
@@ -11023,7 +11262,7 @@ var init_image = __esm({
11023
11262
  const caption = node.child(1);
11024
11263
  if (caption.content.size) blocks.push(nodes3.paragraph.create(null, caption.content));
11025
11264
  tr.replaceWith(pos, pos + node.nodeSize, blocks);
11026
- tr.setSelection(import_prosemirror_state26.NodeSelection.create(tr.doc, pos + 1));
11265
+ tr.setSelection(import_prosemirror_state27.NodeSelection.create(tr.doc, pos + 1));
11027
11266
  dispatch(tr.scrollIntoView());
11028
11267
  return true;
11029
11268
  }
@@ -11037,11 +11276,11 @@ var init_image = __esm({
11037
11276
  const CAPTION = 3;
11038
11277
  if ($pos.parent.childCount === 1) {
11039
11278
  tr.replaceWith(blockStart2, blockEnd, figure);
11040
- tr.setSelection(import_prosemirror_state26.TextSelection.create(tr.doc, blockStart2 + CAPTION));
11279
+ tr.setSelection(import_prosemirror_state27.TextSelection.create(tr.doc, blockStart2 + CAPTION));
11041
11280
  } else {
11042
11281
  tr.insert(blockEnd, figure);
11043
11282
  tr.delete(pos, pos + node.nodeSize);
11044
- tr.setSelection(import_prosemirror_state26.TextSelection.create(tr.doc, tr.mapping.map(blockEnd, -1) + CAPTION));
11283
+ tr.setSelection(import_prosemirror_state27.TextSelection.create(tr.doc, tr.mapping.map(blockEnd, -1) + CAPTION));
11045
11284
  }
11046
11285
  dispatch(tr.scrollIntoView());
11047
11286
  return true;
@@ -11052,7 +11291,7 @@ var init_image = __esm({
11052
11291
  if (dispatch) {
11053
11292
  const after = $from.after($from.depth - 1);
11054
11293
  const tr = state.tr.insert(after, nodesOf(state).paragraph.create());
11055
- tr.setSelection(import_prosemirror_state26.TextSelection.create(tr.doc, after + 1));
11294
+ tr.setSelection(import_prosemirror_state27.TextSelection.create(tr.doc, after + 1));
11056
11295
  dispatch(tr.scrollIntoView());
11057
11296
  }
11058
11297
  return true;
@@ -11073,7 +11312,7 @@ function browserCaret(view) {
11073
11312
  }
11074
11313
  function firstClickPlugin() {
11075
11314
  let focusedOnMouseDown = true;
11076
- return new import_prosemirror_state27.Plugin({
11315
+ return new import_prosemirror_state28.Plugin({
11077
11316
  props: {
11078
11317
  handleDOMEvents: {
11079
11318
  mousedown(view) {
@@ -11091,7 +11330,7 @@ function firstClickPlugin() {
11091
11330
  const $pos = doc.resolve(pos);
11092
11331
  const caret = browserCaret(view);
11093
11332
  if (caret !== null && doc.resolve(caret).parent === $pos.parent) return false;
11094
- const selection = import_prosemirror_state27.Selection.near($pos);
11333
+ const selection = import_prosemirror_state28.Selection.near($pos);
11095
11334
  if (!view.state.selection.eq(selection))
11096
11335
  view.dispatch(view.state.tr.setSelection(selection).setMeta("pointer", true));
11097
11336
  view.focus();
@@ -11100,11 +11339,11 @@ function firstClickPlugin() {
11100
11339
  }
11101
11340
  });
11102
11341
  }
11103
- var import_prosemirror_state27;
11342
+ var import_prosemirror_state28;
11104
11343
  var init_first_click = __esm({
11105
11344
  "src/first-click.ts"() {
11106
11345
  "use strict";
11107
- import_prosemirror_state27 = require("prosemirror-state");
11346
+ import_prosemirror_state28 = require("prosemirror-state");
11108
11347
  }
11109
11348
  });
11110
11349
 
@@ -11149,7 +11388,7 @@ function describeTyped(before, after, t) {
11149
11388
  return changed < 0 ? null : t(now[changed]);
11150
11389
  }
11151
11390
  function announcePlugin(t, say) {
11152
- return new import_prosemirror_state28.Plugin({
11391
+ return new import_prosemirror_state29.Plugin({
11153
11392
  key: announceKey,
11154
11393
  state: {
11155
11394
  init: () => null,
@@ -11171,13 +11410,13 @@ function announcePlugin(t, say) {
11171
11410
  })
11172
11411
  });
11173
11412
  }
11174
- var import_prosemirror_state28, announceKey, TOGGLES, BLOCK_TYPES, ALIGNMENTS2;
11413
+ var import_prosemirror_state29, announceKey, TOGGLES, BLOCK_TYPES, ALIGNMENTS2;
11175
11414
  var init_announce = __esm({
11176
11415
  "src/announce.ts"() {
11177
11416
  "use strict";
11178
- import_prosemirror_state28 = require("prosemirror-state");
11417
+ import_prosemirror_state29 = require("prosemirror-state");
11179
11418
  init_commands();
11180
- announceKey = new import_prosemirror_state28.PluginKey("nova-announce");
11419
+ announceKey = new import_prosemirror_state29.PluginKey("nova-announce");
11181
11420
  TOGGLES = /* @__PURE__ */ new Set([
11182
11421
  "bold",
11183
11422
  "italic",
@@ -11373,10 +11612,10 @@ function textPatternsPlugin(editor, patterns, lookup) {
11373
11612
  const tr = view.state.tr.delete(start + contentEnd, start + text2.length).delete(start + inner, start + contentStart);
11374
11613
  const from = start + inner;
11375
11614
  const to = from + (contentEnd - contentStart);
11376
- view.dispatch(tr.setSelection(import_prosemirror_state29.TextSelection.create(tr.doc, from, to)));
11615
+ view.dispatch(tr.setSelection(import_prosemirror_state30.TextSelection.create(tr.doc, from, to)));
11377
11616
  run(editor, pattern);
11378
11617
  const { state } = view;
11379
- view.dispatch(state.tr.setSelection(import_prosemirror_state29.TextSelection.create(state.doc, state.selection.to)));
11618
+ view.dispatch(state.tr.setSelection(import_prosemirror_state30.TextSelection.create(state.doc, state.selection.to)));
11380
11619
  view.dispatch(view.state.tr.setStoredMarks([]));
11381
11620
  return "inline";
11382
11621
  }
@@ -11389,7 +11628,7 @@ function textPatternsPlugin(editor, patterns, lookup) {
11389
11628
  }
11390
11629
  return null;
11391
11630
  };
11392
- return new import_prosemirror_state29.Plugin({
11631
+ return new import_prosemirror_state30.Plugin({
11393
11632
  props: {
11394
11633
  handleTextInput(view, from, to, text2) {
11395
11634
  if (text2 !== " " || from !== to) return false;
@@ -11406,11 +11645,11 @@ function textPatternsPlugin(editor, patterns, lookup) {
11406
11645
  }
11407
11646
  });
11408
11647
  }
11409
- var import_prosemirror_state29, FORMATS;
11648
+ var import_prosemirror_state30, FORMATS;
11410
11649
  var init_text_patterns = __esm({
11411
11650
  "src/text-patterns.ts"() {
11412
11651
  "use strict";
11413
- import_prosemirror_state29 = require("prosemirror-state");
11652
+ import_prosemirror_state30 = require("prosemirror-state");
11414
11653
  FORMATS = {
11415
11654
  bold: "bold",
11416
11655
  italic: "italic",
@@ -11592,7 +11831,7 @@ function openLinkDialog(editor) {
11592
11831
  if (!href2 || !isSafeLinkUrl(href2)) {
11593
11832
  url.input.setAttribute("aria-invalid", "true");
11594
11833
  url.input.focus();
11595
- return t("link.invalid");
11834
+ return url.input.value.trim() ? t("link.invalid") : t("dialog.required");
11596
11835
  }
11597
11836
  editor.exec(
11598
11837
  applyLink({
@@ -11734,6 +11973,7 @@ function cleanPastedHTML(html2, styles = "clean") {
11734
11973
  root.append(template.content);
11735
11974
  inlineClassStyles(root);
11736
11975
  removeJunk(root);
11976
+ if (source !== "web") dropDocumentLanguage(root);
11737
11977
  if (source === "word") convertWordLists(root);
11738
11978
  if (source === "google-docs") unwrapGoogleDocsWrapper(root);
11739
11979
  normalizeLists(root);
@@ -11825,6 +12065,16 @@ function removeJunk(root) {
11825
12065
  '[style*="mso-element:footnote-list"], [style*="mso-element:comment-list"], [style*="mso-element:endnote-list"]'
11826
12066
  ).forEach((el) => el.remove());
11827
12067
  }
12068
+ function dropDocumentLanguage(root) {
12069
+ const tagged = [...root.querySelectorAll("[lang]")];
12070
+ if (!tagged.length) return;
12071
+ const primary = (el) => (el.getAttribute("lang") ?? "").split("-")[0].toLowerCase();
12072
+ const amount = /* @__PURE__ */ new Map();
12073
+ for (const el of tagged)
12074
+ amount.set(primary(el), (amount.get(primary(el)) ?? 0) + (el.textContent?.length ?? 0));
12075
+ const main = [...amount].sort((a, b) => b[1] - a[1])[0][0];
12076
+ for (const el of tagged) if (primary(el) === main) el.removeAttribute("lang");
12077
+ }
11828
12078
  function readWordListItem(el) {
11829
12079
  const css = el.getAttribute("style") ?? "";
11830
12080
  const match = css.match(/mso-list:\s*(l\d+)\s+level(\d+)/i);
@@ -12078,11 +12328,10 @@ function stripLayoutAttributes(root) {
12078
12328
  function unwrapMeaningless(root) {
12079
12329
  for (const el of [...root.querySelectorAll("span, font")].reverse()) {
12080
12330
  if (!root.contains(el)) continue;
12081
- const hasFormatting = el.hasAttribute("style") || el.tagName === "FONT" && el.hasAttribute("color");
12331
+ const hasFormatting = el.hasAttribute("style") || el.hasAttribute("lang") || el.tagName === "FONT" && el.hasAttribute("color");
12082
12332
  if (!hasFormatting) unwrap(el);
12083
12333
  }
12084
12334
  root.querySelectorAll("[class]").forEach((el) => el.removeAttribute("class"));
12085
- root.querySelectorAll("[lang]").forEach((el) => el.removeAttribute("lang"));
12086
12335
  root.querySelectorAll("[dir]").forEach((el) => {
12087
12336
  if (!/^rtl$/i.test(el.getAttribute("dir") ?? "")) el.removeAttribute("dir");
12088
12337
  });
@@ -12193,9 +12442,29 @@ function htmlToPlainText(html2) {
12193
12442
  template.content.childNodes.forEach(walk);
12194
12443
  return out.split("\n").map((line) => line.trim()).join("\n").replace(/\n{3,}/g, "\n\n").trim();
12195
12444
  }
12445
+ function textLanguage(editor) {
12446
+ return languageTag(editor.options.contentLanguage) ?? languageTag(editor.root.parentElement?.closest("[lang]")?.getAttribute("lang"));
12447
+ }
12448
+ function withoutTextLanguage(html2, lang2) {
12449
+ if (!lang2 || !/\slang\s*=/i.test(html2)) return html2;
12450
+ const template = document.createElement("template");
12451
+ template.innerHTML = html2;
12452
+ let changed = false;
12453
+ for (const el of template.content.querySelectorAll("[lang]")) {
12454
+ const tag2 = languageTag(el.getAttribute("lang"));
12455
+ if (tag2 && primaryLanguage(tag2) === primaryLanguage(lang2)) {
12456
+ el.removeAttribute("lang");
12457
+ changed = true;
12458
+ }
12459
+ }
12460
+ if (!changed) return html2;
12461
+ const container = document.createElement("div");
12462
+ container.append(template.content);
12463
+ return container.innerHTML;
12464
+ }
12196
12465
  function pastePlugin(editor) {
12197
12466
  let reentrant = false;
12198
- return new import_prosemirror_state30.Plugin({
12467
+ return new import_prosemirror_state31.Plugin({
12199
12468
  key,
12200
12469
  props: {
12201
12470
  /**
@@ -12215,6 +12484,7 @@ function pastePlugin(editor) {
12215
12484
  const { pastePreprocess, pastePostprocess, pasteStyles } = editor.options;
12216
12485
  let result = pastePreprocess ? pastePreprocess(html2, editor) : html2;
12217
12486
  if (cleaner) result = cleaner.cleanPastedHTML(result, pasteStyles ?? "clean");
12487
+ result = withoutTextLanguage(result, textLanguage(editor));
12218
12488
  if (pastePostprocess) {
12219
12489
  const template = document.createElement("template");
12220
12490
  template.innerHTML = result;
@@ -12310,16 +12580,17 @@ function pasteFromCodeEditor(view, event, editor, pasteText) {
12310
12580
  );
12311
12581
  return true;
12312
12582
  }
12313
- var import_prosemirror_model8, import_prosemirror_state30, cleaner, loading3, key, VSCODE_DATA, VSCODE_LANGUAGES;
12583
+ var import_prosemirror_model8, import_prosemirror_state31, cleaner, loading3, key, VSCODE_DATA, VSCODE_LANGUAGES;
12314
12584
  var init_paste = __esm({
12315
12585
  "src/paste.ts"() {
12316
12586
  "use strict";
12317
12587
  import_prosemirror_model8 = require("prosemirror-model");
12318
- import_prosemirror_state30 = require("prosemirror-state");
12588
+ import_prosemirror_state31 = require("prosemirror-state");
12319
12589
  init_code_language();
12590
+ init_language();
12320
12591
  cleaner = null;
12321
12592
  loading3 = null;
12322
- key = new import_prosemirror_state30.PluginKey("nova-paste");
12593
+ key = new import_prosemirror_state31.PluginKey("nova-paste");
12323
12594
  VSCODE_DATA = "vscode-editor-data";
12324
12595
  VSCODE_LANGUAGES = {
12325
12596
  shellscript: "bash",
@@ -12383,7 +12654,7 @@ function flattenTable(fragment) {
12383
12654
  return out;
12384
12655
  }
12385
12656
  function contentRulesPlugin(rules) {
12386
- return new import_prosemirror_state31.Plugin({
12657
+ return new import_prosemirror_state32.Plugin({
12387
12658
  key: key2,
12388
12659
  appendTransaction(transactions, oldState, newState) {
12389
12660
  if (!transactions.some((tr2) => tr2.docChanged)) return null;
@@ -12414,12 +12685,12 @@ function contentRulesPlugin(rules) {
12414
12685
  }
12415
12686
  });
12416
12687
  }
12417
- var import_prosemirror_model9, import_prosemirror_state31, ALIASES, KNOWN_TAGS, REQUIREMENTS, ContentRules, key2;
12688
+ var import_prosemirror_model9, import_prosemirror_state32, ALIASES, KNOWN_TAGS, REQUIREMENTS, ContentRules, key2;
12418
12689
  var init_content_rules = __esm({
12419
12690
  "src/content-rules.ts"() {
12420
12691
  "use strict";
12421
12692
  import_prosemirror_model9 = require("prosemirror-model");
12422
- import_prosemirror_state31 = require("prosemirror-state");
12693
+ import_prosemirror_state32 = require("prosemirror-state");
12423
12694
  ALIASES = {
12424
12695
  b: "strong",
12425
12696
  i: "em",
@@ -12474,6 +12745,7 @@ var init_content_rules = __esm({
12474
12745
  code: ["code"],
12475
12746
  subscript: ["sub"],
12476
12747
  superscript: ["sup"],
12748
+ language: ["span"],
12477
12749
  link: ["a"],
12478
12750
  unlink: ["a"],
12479
12751
  quicklink: ["a"],
@@ -12583,6 +12855,8 @@ var init_content_rules = __esm({
12583
12855
  return this.isTagAllowed("span") && this.isStyleAllowed("font-family");
12584
12856
  case "font_size":
12585
12857
  return this.isTagAllowed("span") && this.isStyleAllowed("font-size");
12858
+ case "language":
12859
+ return this.isTagAllowed("span");
12586
12860
  default:
12587
12861
  return true;
12588
12862
  }
@@ -12698,7 +12972,7 @@ var init_content_rules = __esm({
12698
12972
  );
12699
12973
  }
12700
12974
  };
12701
- key2 = new import_prosemirror_state31.PluginKey("nova-content-rules");
12975
+ key2 = new import_prosemirror_state32.PluginKey("nova-content-rules");
12702
12976
  }
12703
12977
  });
12704
12978
 
@@ -13238,7 +13512,7 @@ var init_menubar = __esm({
13238
13512
  },
13239
13513
  format: {
13240
13514
  title: "menu.format",
13241
- items: "bold italic underline strikethrough superscript subscript inlinecode | paragraph h1 h2 h3 blockquote codeblock | alignleft aligncenter alignright alignjustify | lowercase uppercase titlecase | formatpainter permanentpen configurepermanentpen | removeformat"
13515
+ items: "bold italic underline strikethrough superscript subscript inlinecode | paragraph h1 h2 h3 blockquote codeblock | alignleft aligncenter alignright alignjustify | lowercase uppercase titlecase | formatpainter permanentpen configurepermanentpen | language | removeformat"
13242
13516
  },
13243
13517
  table: {
13244
13518
  title: "menu.table",
@@ -13505,7 +13779,7 @@ function registerMenuItems(editor) {
13505
13779
  text: t("selectAll"),
13506
13780
  shortcut: "Mod-a",
13507
13781
  onAction: (e) => {
13508
- e.view.dispatch(e.view.state.tr.setSelection(new import_prosemirror_state32.AllSelection(e.view.state.doc)));
13782
+ e.view.dispatch(e.view.state.tr.setSelection(new import_prosemirror_state33.AllSelection(e.view.state.doc)));
13509
13783
  e.focus();
13510
13784
  }
13511
13785
  });
@@ -13522,11 +13796,11 @@ function registerMenuItems(editor) {
13522
13796
  onAction: (e) => openInsertTableDialog(e)
13523
13797
  });
13524
13798
  }
13525
- var import_prosemirror_state32;
13799
+ var import_prosemirror_state33;
13526
13800
  var init_menu_items = __esm({
13527
13801
  "src/ui/menu-items.ts"() {
13528
13802
  "use strict";
13529
- import_prosemirror_state32 = require("prosemirror-state");
13803
+ import_prosemirror_state33 = require("prosemirror-state");
13530
13804
  init_tables();
13531
13805
  init_dialog();
13532
13806
  init_dom();
@@ -13603,7 +13877,7 @@ var init_chain = __esm({
13603
13877
 
13604
13878
  // src/selection.ts
13605
13879
  function bookmarksPlugin() {
13606
- return new import_prosemirror_state33.Plugin({
13880
+ return new import_prosemirror_state34.Plugin({
13607
13881
  key: bookmarksKey,
13608
13882
  state: {
13609
13883
  init: () => /* @__PURE__ */ new Map(),
@@ -13642,7 +13916,7 @@ function createSelection(editor) {
13642
13916
  },
13643
13917
  setRange(from, to = from) {
13644
13918
  const { state, dispatch } = view();
13645
- const selection = import_prosemirror_state33.TextSelection.between(
13919
+ const selection = import_prosemirror_state34.TextSelection.between(
13646
13920
  state.doc.resolve(clamp(from)),
13647
13921
  state.doc.resolve(clamp(to))
13648
13922
  );
@@ -13655,7 +13929,7 @@ function createSelection(editor) {
13655
13929
  },
13656
13930
  selectAll() {
13657
13931
  const { state, dispatch } = view();
13658
- dispatch(state.tr.setSelection(new import_prosemirror_state33.AllSelection(state.doc)));
13932
+ dispatch(state.tr.setSelection(new import_prosemirror_state34.AllSelection(state.doc)));
13659
13933
  },
13660
13934
  getHTML() {
13661
13935
  const { selection } = view().state;
@@ -13669,7 +13943,7 @@ function createSelection(editor) {
13669
13943
  getNode() {
13670
13944
  const v = view();
13671
13945
  const { selection } = v.state;
13672
- if (selection instanceof import_prosemirror_state33.NodeSelection) {
13946
+ if (selection instanceof import_prosemirror_state34.NodeSelection) {
13673
13947
  const dom = v.nodeDOM(selection.from);
13674
13948
  if (dom instanceof HTMLElement) return dom;
13675
13949
  }
@@ -13695,8 +13969,8 @@ function createSelection(editor) {
13695
13969
  if (!found || found.isText) continue;
13696
13970
  const dom = v.nodeDOM(at);
13697
13971
  if (dom !== node && !(found.isLeaf && dom instanceof Node && dom.contains(node))) continue;
13698
- if (found.isLeaf || !content && import_prosemirror_state33.NodeSelection.isSelectable(found))
13699
- v.dispatch(v.state.tr.setSelection(import_prosemirror_state33.NodeSelection.create(doc, at)));
13972
+ if (found.isLeaf || !content && import_prosemirror_state34.NodeSelection.isSelectable(found))
13973
+ v.dispatch(v.state.tr.setSelection(import_prosemirror_state34.NodeSelection.create(doc, at)));
13700
13974
  else api.setRange(at + 1, at + found.nodeSize - 1);
13701
13975
  return;
13702
13976
  }
@@ -13771,14 +14045,14 @@ function createSelection(editor) {
13771
14045
  };
13772
14046
  return api;
13773
14047
  }
13774
- var import_prosemirror_state33, MAX_BOOKMARKS, bookmarksKey, nextBookmark;
14048
+ var import_prosemirror_state34, MAX_BOOKMARKS, bookmarksKey, nextBookmark;
13775
14049
  var init_selection = __esm({
13776
14050
  "src/selection.ts"() {
13777
14051
  "use strict";
13778
- import_prosemirror_state33 = require("prosemirror-state");
14052
+ import_prosemirror_state34 = require("prosemirror-state");
13779
14053
  init_document();
13780
14054
  MAX_BOOKMARKS = 200;
13781
- bookmarksKey = new import_prosemirror_state33.PluginKey("nova-bookmarks");
14055
+ bookmarksKey = new import_prosemirror_state34.PluginKey("nova-bookmarks");
13782
14056
  nextBookmark = 1;
13783
14057
  }
13784
14058
  });
@@ -13817,7 +14091,7 @@ function indexFrom(matches2, pos) {
13817
14091
  return i < 0 ? 0 : i;
13818
14092
  }
13819
14093
  function searchPlugin() {
13820
- return new import_prosemirror_state34.Plugin({
14094
+ return new import_prosemirror_state35.Plugin({
13821
14095
  key: searchKey,
13822
14096
  state: {
13823
14097
  init: () => EMPTY,
@@ -13864,7 +14138,7 @@ function setSearch(options2) {
13864
14138
  };
13865
14139
  }
13866
14140
  function gotoMatch(tr, match, index) {
13867
- return tr.setMeta(searchKey, { type: "goto", index }).setSelection(import_prosemirror_state34.TextSelection.create(tr.doc, match.from, match.to)).scrollIntoView();
14141
+ return tr.setMeta(searchKey, { type: "goto", index }).setSelection(import_prosemirror_state35.TextSelection.create(tr.doc, match.from, match.to)).scrollIntoView();
13868
14142
  }
13869
14143
  function findNext(dir2 = 1) {
13870
14144
  return (state, dispatch) => {
@@ -13887,7 +14161,7 @@ function replaceCurrent(replacement) {
13887
14161
  if (replacement) tr.replaceWith(match.from, match.to, state.schema.text(replacement, marks3));
13888
14162
  else tr.delete(match.from, match.to);
13889
14163
  const after = tr.mapping.map(match.to);
13890
- dispatch(tr.setSelection(import_prosemirror_state34.TextSelection.create(tr.doc, after)).scrollIntoView());
14164
+ dispatch(tr.setSelection(import_prosemirror_state35.TextSelection.create(tr.doc, after)).scrollIntoView());
13891
14165
  }
13892
14166
  return true;
13893
14167
  };
@@ -13909,15 +14183,15 @@ function replaceAll(replacement) {
13909
14183
  return true;
13910
14184
  };
13911
14185
  }
13912
- var import_prosemirror_state34, import_prosemirror_view3, MAX_MATCHES, LEAF, searchKey, EMPTY, clearSearch;
14186
+ var import_prosemirror_state35, import_prosemirror_view3, MAX_MATCHES, LEAF, searchKey, EMPTY, clearSearch;
13913
14187
  var init_search = __esm({
13914
14188
  "src/search.ts"() {
13915
14189
  "use strict";
13916
- import_prosemirror_state34 = require("prosemirror-state");
14190
+ import_prosemirror_state35 = require("prosemirror-state");
13917
14191
  import_prosemirror_view3 = require("prosemirror-view");
13918
14192
  MAX_MATCHES = 1e4;
13919
14193
  LEAF = "\uFFFC";
13920
- searchKey = new import_prosemirror_state34.PluginKey("nova-search");
14194
+ searchKey = new import_prosemirror_state35.PluginKey("nova-search");
13921
14195
  EMPTY = {
13922
14196
  query: "",
13923
14197
  caseSensitive: false,
@@ -14656,6 +14930,39 @@ function registerBuiltins(editor) {
14656
14930
  ];
14657
14931
  }
14658
14932
  });
14933
+ const languages = () => contentLanguages(editor.options.contentLangs, editor.options.language);
14934
+ if (languages().length) {
14935
+ const canMark = (e) => e.can(setTextLanguage("en"));
14936
+ registry2.addMenuButton("language", {
14937
+ icon: icons.language,
14938
+ tooltip: t("language"),
14939
+ isEnabled: canMark,
14940
+ items: (e) => {
14941
+ const value = getTextLanguage(e.view.state);
14942
+ return [
14943
+ {
14944
+ id: "default",
14945
+ label: t("language.default"),
14946
+ active: value === null,
14947
+ onSelect: () => e.exec(setTextLanguage(null))
14948
+ },
14949
+ { type: "separator" },
14950
+ ...languages().map(({ code, title }) => ({
14951
+ id: code,
14952
+ label: title,
14953
+ active: value === code,
14954
+ onSelect: () => e.exec(setTextLanguage(code))
14955
+ }))
14956
+ ];
14957
+ }
14958
+ });
14959
+ registry2.addMenuItem("language", {
14960
+ text: `${t("language")}\u2026`,
14961
+ icon: icons.language,
14962
+ isEnabled: canMark,
14963
+ onAction: (e) => void chooseLanguage(e)
14964
+ });
14965
+ }
14659
14966
  const colorButton = (name, mark, svg5, label) => registry2.addPanelButton(name, {
14660
14967
  icon: svg5,
14661
14968
  tooltip: t(label),
@@ -14833,6 +15140,31 @@ function registerBuiltins(editor) {
14833
15140
  }
14834
15141
  });
14835
15142
  }
15143
+ async function chooseLanguage(editor) {
15144
+ const t = editor.ui.t;
15145
+ const current = getTextLanguage(editor.view.state);
15146
+ const list = contentLanguages(editor.options.contentLangs, editor.options.language);
15147
+ if (current && !list.some((l) => l.code === current))
15148
+ list.unshift({ code: current, title: languageName(current, editor.options.language) });
15149
+ const data = await editor.ui.dialog({
15150
+ title: t("language"),
15151
+ submitLabel: t("dialog.save"),
15152
+ initialData: { lang: current ?? "" },
15153
+ fields: [
15154
+ {
15155
+ type: "select",
15156
+ name: "lang",
15157
+ label: t("language.field"),
15158
+ options: [
15159
+ { value: "", label: t("language.default") },
15160
+ ...list.map(({ code, title }) => ({ value: code, label: title }))
15161
+ ]
15162
+ }
15163
+ ]
15164
+ });
15165
+ if (!data) return;
15166
+ editor.exec(setTextLanguage(String(data.lang ?? "") || null));
15167
+ }
14836
15168
  var defaultFontFamilies, defaultFontSizes, defaultLineHeights, SHORTCUTS2, GENERIC_FONTS, sameFont;
14837
15169
  var init_builtins = __esm({
14838
15170
  "src/ui/builtins.ts"() {
@@ -14841,6 +15173,7 @@ var init_builtins = __esm({
14841
15173
  init_image();
14842
15174
  init_link();
14843
15175
  init_styles();
15176
+ init_language();
14844
15177
  init_color_panel();
14845
15178
  init_table_ui();
14846
15179
  init_views();
@@ -15017,8 +15350,8 @@ function addLinkNote(editor, provider) {
15017
15350
  return () => set.delete(provider);
15018
15351
  }
15019
15352
  function linkBubblePlugin(editor) {
15020
- return new import_prosemirror_state35.Plugin({
15021
- key: new import_prosemirror_state35.PluginKey("nova-link-bubble"),
15353
+ return new import_prosemirror_state36.Plugin({
15354
+ key: new import_prosemirror_state36.PluginKey("nova-link-bubble"),
15022
15355
  view(view) {
15023
15356
  const { t } = editor.ui;
15024
15357
  const anchor = h("a", {
@@ -15128,11 +15461,11 @@ function linkBubblePlugin(editor) {
15128
15461
  }
15129
15462
  });
15130
15463
  }
15131
- var import_prosemirror_state35, noteProviders;
15464
+ var import_prosemirror_state36, noteProviders;
15132
15465
  var init_link_bubble = __esm({
15133
15466
  "src/ui/link-bubble.ts"() {
15134
15467
  "use strict";
15135
- import_prosemirror_state35 = require("prosemirror-state");
15468
+ import_prosemirror_state36 = require("prosemirror-state");
15136
15469
  init_commands();
15137
15470
  init_link();
15138
15471
  init_commands();
@@ -15509,8 +15842,8 @@ var init_toolbar = __esm({
15509
15842
 
15510
15843
  // src/ui/context-toolbar.ts
15511
15844
  function contextToolbarPlugin(editor) {
15512
- return new import_prosemirror_state36.Plugin({
15513
- key: new import_prosemirror_state36.PluginKey("nova-context-toolbar"),
15845
+ return new import_prosemirror_state37.Plugin({
15846
+ key: new import_prosemirror_state37.PluginKey("nova-context-toolbar"),
15514
15847
  view(view) {
15515
15848
  const container = h("div", {
15516
15849
  className: "nova-bubble nova-context-toolbar",
@@ -15546,7 +15879,7 @@ function contextToolbarPlugin(editor) {
15546
15879
  };
15547
15880
  const anchorRect = (spec) => {
15548
15881
  const { selection } = view.state;
15549
- if ((spec.position ?? "node") === "node" && selection instanceof import_prosemirror_state36.NodeSelection) {
15882
+ if ((spec.position ?? "node") === "node" && selection instanceof import_prosemirror_state37.NodeSelection) {
15550
15883
  const dom = view.nodeDOM(selection.from);
15551
15884
  return dom?.getBoundingClientRect() ?? null;
15552
15885
  }
@@ -15658,11 +15991,11 @@ function focusContextToolbar(editor) {
15658
15991
  button?.focus();
15659
15992
  return !!button;
15660
15993
  }
15661
- var import_prosemirror_state36;
15994
+ var import_prosemirror_state37;
15662
15995
  var init_context_toolbar = __esm({
15663
15996
  "src/ui/context-toolbar.ts"() {
15664
15997
  "use strict";
15665
- import_prosemirror_state36 = require("prosemirror-state");
15998
+ import_prosemirror_state37 = require("prosemirror-state");
15666
15999
  init_dom();
15667
16000
  init_popover();
15668
16001
  init_toolbar();
@@ -15670,11 +16003,11 @@ var init_context_toolbar = __esm({
15670
16003
  });
15671
16004
 
15672
16005
  // src/ui/image-view.ts
15673
- var import_prosemirror_state37, MIN_WIDTH, ImageView;
16006
+ var import_prosemirror_state38, MIN_WIDTH, ImageView;
15674
16007
  var init_image_view = __esm({
15675
16008
  "src/ui/image-view.ts"() {
15676
16009
  "use strict";
15677
- import_prosemirror_state37 = require("prosemirror-state");
16010
+ import_prosemirror_state38 = require("prosemirror-state");
15678
16011
  init_schema();
15679
16012
  init_url();
15680
16013
  MIN_WIDTH = 24;
@@ -15777,7 +16110,7 @@ var init_image_view = __esm({
15777
16110
  width,
15778
16111
  height: Math.round(width * ratio)
15779
16112
  });
15780
- tr.setSelection(import_prosemirror_state37.NodeSelection.create(tr.doc, pos));
16113
+ tr.setSelection(import_prosemirror_state38.NodeSelection.create(tr.doc, pos));
15781
16114
  this.view.dispatch(tr);
15782
16115
  };
15783
16116
  handle.addEventListener("pointermove", onMove);
@@ -15908,8 +16241,8 @@ function autocompleterPlugin(editor) {
15908
16241
  renderItems(view);
15909
16242
  });
15910
16243
  };
15911
- return new import_prosemirror_state38.Plugin({
15912
- key: new import_prosemirror_state38.PluginKey("nova-autocompleter"),
16244
+ return new import_prosemirror_state39.Plugin({
16245
+ key: new import_prosemirror_state39.PluginKey("nova-autocompleter"),
15913
16246
  view(view) {
15914
16247
  list = h("div", {
15915
16248
  className: "nova-popover nova-ac",
@@ -15956,11 +16289,11 @@ function autocompleterPlugin(editor) {
15956
16289
  }
15957
16290
  });
15958
16291
  }
15959
- var import_prosemirror_state38, MAX_QUERY;
16292
+ var import_prosemirror_state39, MAX_QUERY;
15960
16293
  var init_autocompleter = __esm({
15961
16294
  "src/ui/autocompleter.ts"() {
15962
16295
  "use strict";
15963
- import_prosemirror_state38 = require("prosemirror-state");
16296
+ import_prosemirror_state39 = require("prosemirror-state");
15964
16297
  init_dom();
15965
16298
  init_popover();
15966
16299
  MAX_QUERY = 30;
@@ -17283,11 +17616,19 @@ function createResizeHandle(editor, host, both) {
17283
17616
  role: "separator",
17284
17617
  tabIndex: 0,
17285
17618
  "aria-orientation": "horizontal",
17286
- "aria-label": editor.ui.t("status.resize")
17619
+ "aria-label": editor.ui.t("status.resize"),
17620
+ "aria-valuemin": String(MIN_HEIGHT)
17287
17621
  });
17288
17622
  handle.append(icon(both ? icons.resizeHandleBoth : icons.resizeHandle));
17289
17623
  root.dataset.resize = both ? "both" : "vertical";
17290
17624
  host.append(handle);
17625
+ const sayHeight = () => {
17626
+ const height = Math.max(MIN_HEIGHT, root.offsetHeight);
17627
+ handle.setAttribute("aria-valuenow", String(height));
17628
+ handle.setAttribute("aria-valuemax", String(Math.max(MAX_HEIGHT, height)));
17629
+ };
17630
+ sayHeight();
17631
+ handle.addEventListener("focus", sayHeight);
17291
17632
  const setSize = (height, width) => {
17292
17633
  root.style.boxSizing = "border-box";
17293
17634
  root.style.height = `${Math.max(MIN_HEIGHT, Math.round(height))}px`;
@@ -17295,7 +17636,7 @@ function createResizeHandle(editor, host, both) {
17295
17636
  const max = root.parentElement?.clientWidth || Infinity;
17296
17637
  root.style.width = `${Math.min(max, Math.max(MIN_WIDTH2, Math.round(width)))}px`;
17297
17638
  }
17298
- handle.setAttribute("aria-valuenow", String(root.offsetHeight));
17639
+ sayHeight();
17299
17640
  };
17300
17641
  let start = null;
17301
17642
  const onDown = (event) => {
@@ -17337,7 +17678,7 @@ function createResizeHandle(editor, host, both) {
17337
17678
  delete root.dataset.resize;
17338
17679
  };
17339
17680
  }
17340
- var TAGS, MARK_TAGS, CJK, LETTER, WORD, MIN_HEIGHT, MIN_WIDTH2, KEY_STEP;
17681
+ var TAGS, MARK_TAGS, CJK, LETTER, WORD, MIN_HEIGHT, MIN_WIDTH2, KEY_STEP, MAX_HEIGHT;
17341
17682
  var init_statusbar = __esm({
17342
17683
  "src/ui/statusbar.ts"() {
17343
17684
  "use strict";
@@ -17372,6 +17713,7 @@ var init_statusbar = __esm({
17372
17713
  MIN_HEIGHT = 100;
17373
17714
  MIN_WIDTH2 = 200;
17374
17715
  KEY_STEP = 20;
17716
+ MAX_HEIGHT = 4e3;
17375
17717
  }
17376
17718
  });
17377
17719
 
@@ -17380,7 +17722,7 @@ var search_bar_exports = {};
17380
17722
  __export(search_bar_exports, {
17381
17723
  createSearchBar: () => createSearchBar
17382
17724
  });
17383
- function createSearchBar(editor, before) {
17725
+ function createSearchBar(editor, place) {
17384
17726
  const { t } = editor.ui;
17385
17727
  const findId = uniqueId("nova-find");
17386
17728
  const replaceId = uniqueId("nova-replace");
@@ -17481,7 +17823,7 @@ function createSearchBar(editor, before) {
17481
17823
  ),
17482
17824
  h("div", { className: "nova-search-row" }, replaceInput, replaceOne, replaceAllBtn)
17483
17825
  );
17484
- before.parentElement.insertBefore(bar, before);
17826
+ place(bar);
17485
17827
  let timer = null;
17486
17828
  const run2 = () => {
17487
17829
  if (timer) clearTimeout(timer);
@@ -17626,10 +17968,12 @@ function parseContent(schema2, content, page) {
17626
17968
  function createEditor(options2) {
17627
17969
  return new Editor(options2);
17628
17970
  }
17629
- var import_prosemirror_dropcursor, import_prosemirror_gapcursor, import_prosemirror_history3, import_prosemirror_keymap8, import_prosemirror_model13, import_prosemirror_state39, import_prosemirror_view4, REMOTE_CHANGE_META, API_CHANGE_META, INSERT_BLOCK_TAGS, contentScopeId, unknownCommands, Editor, wholePages;
17971
+ var import_prosemirror_dropcursor, import_prosemirror_gapcursor, import_prosemirror_history3, import_prosemirror_keymap8, import_prosemirror_model13, import_prosemirror_state40, import_prosemirror_view4, REMOTE_CHANGE_META, API_CHANGE_META, INSERT_BLOCK_TAGS, contentScopeId, unknownCommands, Editor, wholePages;
17630
17972
  var init_editor = __esm({
17631
17973
  "src/editor.ts"() {
17632
17974
  "use strict";
17975
+ init_language();
17976
+ init_sticky_header();
17633
17977
  init_formats();
17634
17978
  init_content_css();
17635
17979
  import_prosemirror_dropcursor = require("prosemirror-dropcursor");
@@ -17637,7 +17981,7 @@ var init_editor = __esm({
17637
17981
  import_prosemirror_history3 = require("prosemirror-history");
17638
17982
  import_prosemirror_keymap8 = require("prosemirror-keymap");
17639
17983
  import_prosemirror_model13 = require("prosemirror-model");
17640
- import_prosemirror_state39 = require("prosemirror-state");
17984
+ import_prosemirror_state40 = require("prosemirror-state");
17641
17985
  import_prosemirror_view4 = require("prosemirror-view");
17642
17986
  init_commands();
17643
17987
  init_i18n();
@@ -17736,6 +18080,9 @@ var init_editor = __esm({
17736
18080
  header.append(menubarHost, toolbarHost);
17737
18081
  this.root.append(header, contentHost, statusbarHost);
17738
18082
  this.toolbarHost = toolbarHost;
18083
+ const stickyOffset = Number(options2.toolbarStickyOffset);
18084
+ if (Number.isFinite(stickyOffset) && stickyOffset > 0)
18085
+ this.root.style.setProperty("--nova-sticky-offset", `${Math.min(stickyOffset, 1e3)}px`);
17739
18086
  this.mode = options2.mode ?? "classic";
17740
18087
  this.root.classList.add(`nova-mode-${this.mode}`);
17741
18088
  const distractionFree = this.mode === "distraction-free";
@@ -17812,6 +18159,7 @@ var init_editor = __esm({
17812
18159
  if (page) pages.set(this, page);
17813
18160
  const initialDoc = parseContent(this.schema, options2.content ?? "", page);
17814
18161
  const tablesAnchor = searchPlugin();
18162
+ const sticky = stickyHeader(header, contentHost);
17815
18163
  const initialPlugins = [
17816
18164
  // First: while the list is open, Enter/Tab/arrows belong to the autocompleter, not the keymap.
17817
18165
  autocompleterPlugin(this),
@@ -17845,11 +18193,13 @@ var init_editor = __esm({
17845
18193
  firstClickPlugin(),
17846
18194
  // editor.selection's bookmarks move along with the changes.
17847
18195
  bookmarksPlugin(),
18196
+ // The line with the caret is never left under the sticky header.
18197
+ sticky.plugin,
17848
18198
  ...pluginPm,
17849
18199
  ...options2.prosemirrorPlugins ?? []
17850
18200
  ];
17851
18201
  keepPluginViews(initialPlugins);
17852
- const state = import_prosemirror_state39.EditorState.create({
18202
+ const state = import_prosemirror_state40.EditorState.create({
17853
18203
  doc: this.contentRules ? this.contentRules.normalizeDoc(initialDoc) : initialDoc,
17854
18204
  plugins: initialPlugins
17855
18205
  });
@@ -17857,14 +18207,17 @@ var init_editor = __esm({
17857
18207
  this.disabled = options2.disabled ?? false;
17858
18208
  this.pasteAsText = options2.pasteAsText ?? false;
17859
18209
  const handleTransaction = this.handleTransaction.bind(this);
18210
+ const contentLanguage = languageTag(options2.contentLanguage);
17860
18211
  this.view = new import_prosemirror_view4.EditorView(contentHost, {
17861
18212
  state,
17862
18213
  editable: () => this.isEditable(),
18214
+ ...sticky.props,
17863
18215
  attributes: {
17864
18216
  class: "nova-prosemirror",
17865
18217
  role: "textbox",
17866
18218
  "aria-multiline": "true",
17867
18219
  "aria-label": this.ui.t("editor.label"),
18220
+ ...contentLanguage ? { lang: contentLanguage } : {},
17868
18221
  // The visible placeholder is CSS generated content with empty alternative text (style.css);
17869
18222
  // screen readers get it as aria-placeholder, not as text inside the document.
17870
18223
  ...options2.placeholder ? { "data-placeholder": options2.placeholder, "aria-placeholder": options2.placeholder } : {}
@@ -17989,7 +18342,7 @@ var init_editor = __esm({
17989
18342
  const nodeViews = Object.fromEntries(
17990
18343
  Object.entries(plugin.nodeViews).map(([name, factory]) => [name, factory(this)])
17991
18344
  );
17992
- pm.push(new import_prosemirror_state39.Plugin({ props: { nodeViews } }));
18345
+ pm.push(new import_prosemirror_state40.Plugin({ props: { nodeViews } }));
17993
18346
  }
17994
18347
  return pm;
17995
18348
  } catch (error) {
@@ -18215,7 +18568,11 @@ var init_editor = __esm({
18215
18568
  this.searchBarLoad ??= Promise.resolve().then(() => (init_search_bar(), search_bar_exports)).then(
18216
18569
  ({ createSearchBar: createSearchBar2 }) => {
18217
18570
  if (this.destroyed) return null;
18218
- this.searchBar = createSearchBar2(this, this.contentHost);
18571
+ const header = this.toolbarHost.parentElement;
18572
+ this.searchBar = createSearchBar2(
18573
+ this,
18574
+ (bar) => header ? header.append(bar) : this.contentHost.before(bar)
18575
+ );
18219
18576
  return this.searchBar;
18220
18577
  },
18221
18578
  (error) => {
@@ -18489,7 +18846,7 @@ function placeCursor(tr, id, offset) {
18489
18846
  section.forEach((note) => {
18490
18847
  if (footnoteId(note.attrs.id) === id) {
18491
18848
  const inNote2 = Math.max(0, Math.min(offset, note.content.size));
18492
- tr.setSelection(import_prosemirror_state40.TextSelection.create(tr.doc, pos + 1 + inNote2));
18849
+ tr.setSelection(import_prosemirror_state41.TextSelection.create(tr.doc, pos + 1 + inNote2));
18493
18850
  }
18494
18851
  pos += note.nodeSize;
18495
18852
  });
@@ -18598,17 +18955,17 @@ function jumpTo(editor, target, id) {
18598
18955
  return true;
18599
18956
  });
18600
18957
  if (found === null) return false;
18601
- const selection = target === "ref" ? import_prosemirror_state40.NodeSelection.create(state.doc, found) : import_prosemirror_state40.TextSelection.create(state.doc, found + 1);
18958
+ const selection = target === "ref" ? import_prosemirror_state41.NodeSelection.create(state.doc, found) : import_prosemirror_state41.TextSelection.create(state.doc, found + 1);
18602
18959
  editor.view.dispatch(state.tr.setSelection(selection).scrollIntoView());
18603
18960
  editor.focus();
18604
18961
  return true;
18605
18962
  }
18606
- var import_prosemirror_model14, import_prosemirror_state40, LABELS18, syncKey, FOCUS_NOTE, FOOTNOTE_NODES, warned5, touchedCache, insertFootnote, updateFootnotes, footnotes_ui_default;
18963
+ var import_prosemirror_model14, import_prosemirror_state41, LABELS18, syncKey, FOCUS_NOTE, FOOTNOTE_NODES, warned5, touchedCache, insertFootnote, updateFootnotes, footnotes_ui_default;
18607
18964
  var init_footnotes_ui = __esm({
18608
18965
  "src/plugins/footnotes-ui.ts"() {
18609
18966
  "use strict";
18610
18967
  import_prosemirror_model14 = require("prosemirror-model");
18611
- import_prosemirror_state40 = require("prosemirror-state");
18968
+ import_prosemirror_state41 = require("prosemirror-state");
18612
18969
  init_editor();
18613
18970
  init_plugins();
18614
18971
  init_icons();
@@ -18620,7 +18977,7 @@ var init_footnotes_ui = __esm({
18620
18977
  update: "Update footnotes"
18621
18978
  }
18622
18979
  };
18623
- syncKey = new import_prosemirror_state40.PluginKey("nova-footnotes-sync");
18980
+ syncKey = new import_prosemirror_state41.PluginKey("nova-footnotes-sync");
18624
18981
  FOCUS_NOTE = "nova:footnote-focus";
18625
18982
  FOOTNOTE_NODES = /* @__PURE__ */ new Set(["footnote_ref", "footnote", "footnotes"]);
18626
18983
  warned5 = false;
@@ -18654,7 +19011,7 @@ var init_footnotes_ui = __esm({
18654
19011
  requires: ["footnotes"],
18655
19012
  toolbar: "footnotes",
18656
19013
  prosemirrorPlugins: (editor) => [
18657
- new import_prosemirror_state40.Plugin({
19014
+ new import_prosemirror_state41.Plugin({
18658
19015
  key: syncKey,
18659
19016
  state: {
18660
19017
  init: (_config, state) => ({ has: hasFootnotes(state.doc), dirty: false }),
@@ -18738,11 +19095,11 @@ function footnoteNumber(value) {
18738
19095
  const number = Math.trunc(Number(value));
18739
19096
  return Number.isFinite(number) && number > 0 ? number : 1;
18740
19097
  }
18741
- var import_prosemirror_state41, idAfter, footnoteNodes, FootnotesView, FootnoteView, footnotes_default2;
19098
+ var import_prosemirror_state42, idAfter, footnoteNodes, FootnotesView, FootnoteView, footnotes_default2;
18742
19099
  var init_footnotes2 = __esm({
18743
19100
  "src/plugins/footnotes.ts"() {
18744
19101
  "use strict";
18745
- import_prosemirror_state41 = require("prosemirror-state");
19102
+ import_prosemirror_state42 = require("prosemirror-state");
18746
19103
  init_plugins();
18747
19104
  init_footnotes();
18748
19105
  idAfter = (value, prefix) => value?.startsWith(prefix) ? footnoteId(value.slice(prefix.length)) : "";
@@ -18863,8 +19220,8 @@ var init_footnotes2 = __esm({
18863
19220
  name: "footnotes",
18864
19221
  nodes: footnoteNodes,
18865
19222
  prosemirrorPlugins: () => [
18866
- new import_prosemirror_state41.Plugin({
18867
- key: new import_prosemirror_state41.PluginKey("nova-footnotes-view"),
19223
+ new import_prosemirror_state42.Plugin({
19224
+ key: new import_prosemirror_state42.PluginKey("nova-footnotes-view"),
18868
19225
  props: {
18869
19226
  nodeViews: {
18870
19227
  footnotes: () => new FootnotesView(),
@@ -19031,15 +19388,15 @@ function changeCase(state, kind, options2 = {}) {
19031
19388
  if (!selection.empty) {
19032
19389
  tr.setSelection(selection.map(tr.doc, tr.mapping));
19033
19390
  } else if (tr.doc.content.size === state.doc.content.size) {
19034
- tr.setSelection(import_prosemirror_state42.TextSelection.create(tr.doc, selection.from));
19391
+ tr.setSelection(import_prosemirror_state43.TextSelection.create(tr.doc, selection.from));
19035
19392
  }
19036
19393
  return tr.scrollIntoView();
19037
19394
  }
19038
- var import_prosemirror_state42, LABELS20, ENGLISH_MINORS, WORD_CHAR, CASES, MENU_ITEMS, casechange_default;
19395
+ var import_prosemirror_state43, LABELS20, ENGLISH_MINORS, WORD_CHAR, CASES, MENU_ITEMS, casechange_default;
19039
19396
  var init_casechange = __esm({
19040
19397
  "src/plugins/casechange.ts"() {
19041
19398
  "use strict";
19042
- import_prosemirror_state42 = require("prosemirror-state");
19399
+ import_prosemirror_state43 = require("prosemirror-state");
19043
19400
  init_plugins();
19044
19401
  init_icons();
19045
19402
  init_shared();
@@ -19464,12 +19821,12 @@ async function configure(editor) {
19464
19821
  if (pen.active) applyToCursor(editor);
19465
19822
  editor.focus();
19466
19823
  }
19467
- var import_prosemirror_model15, import_prosemirror_state43, LABELS22, DEFAULT_PEN, PEN_MARKS, pens, permanentpen_default;
19824
+ var import_prosemirror_model15, import_prosemirror_state44, LABELS22, DEFAULT_PEN, PEN_MARKS, pens, permanentpen_default;
19468
19825
  var init_permanentpen = __esm({
19469
19826
  "src/plugins/permanentpen.ts"() {
19470
19827
  "use strict";
19471
19828
  import_prosemirror_model15 = require("prosemirror-model");
19472
- import_prosemirror_state43 = require("prosemirror-state");
19829
+ import_prosemirror_state44 = require("prosemirror-state");
19473
19830
  init_plugins();
19474
19831
  init_builtins();
19475
19832
  init_icons();
@@ -19499,7 +19856,7 @@ var init_permanentpen = __esm({
19499
19856
  name: "permanentpen",
19500
19857
  toolbar: "permanentpen",
19501
19858
  prosemirrorPlugins: (editor) => [
19502
- new import_prosemirror_state43.Plugin({
19859
+ new import_prosemirror_state44.Plugin({
19503
19860
  // While the pen is on, the marks for typing at the cursor are the pen's (after Enter, a click,
19504
19861
  // arrows): typed and composed (IME) text both take stored marks.
19505
19862
  appendTransaction(_transactions, _old, state) {
@@ -19583,7 +19940,7 @@ function changedRanges(tr) {
19583
19940
  return ranges;
19584
19941
  }
19585
19942
  function visualCharsPlugin(initial) {
19586
- return new import_prosemirror_state44.Plugin({
19943
+ return new import_prosemirror_state45.Plugin({
19587
19944
  key: visualCharsKey,
19588
19945
  state: {
19589
19946
  init: (_config, state) => ({
@@ -19614,11 +19971,11 @@ function visualCharsPlugin(initial) {
19614
19971
  }
19615
19972
  });
19616
19973
  }
19617
- var import_prosemirror_state44, import_prosemirror_view5, LABELS23, KINDS, PATTERN, visualCharsKey, isOn, visualchars_default2;
19974
+ var import_prosemirror_state45, import_prosemirror_view5, LABELS23, KINDS, PATTERN, visualCharsKey, isOn, visualchars_default2;
19618
19975
  var init_visualchars2 = __esm({
19619
19976
  "src/plugins/visualchars.ts"() {
19620
19977
  "use strict";
19621
- import_prosemirror_state44 = require("prosemirror-state");
19978
+ import_prosemirror_state45 = require("prosemirror-state");
19622
19979
  import_prosemirror_view5 = require("prosemirror-view");
19623
19980
  init_plugins();
19624
19981
  init_icons();
@@ -19642,7 +19999,7 @@ var init_visualchars2 = __esm({
19642
19999
  // zero-width no-break space
19643
20000
  };
19644
20001
  PATTERN = /[\u00a0\u202f\u2007\u00ad\u200b\u2060\ufeff]/g;
19645
- visualCharsKey = new import_prosemirror_state44.PluginKey("nova-visualchars");
20002
+ visualCharsKey = new import_prosemirror_state45.PluginKey("nova-visualchars");
19646
20003
  isOn = (editor) => !!visualCharsKey.getState(editor.view.state)?.on;
19647
20004
  visualchars_default2 = definePlugin({
19648
20005
  name: "visualchars",
@@ -20145,11 +20502,11 @@ function offerPlainText(editor, text2) {
20145
20502
  });
20146
20503
  }, 0);
20147
20504
  }
20148
- var import_prosemirror_state45, LABELS25, BLOCK_SIGNS, INLINE_SIGNS, NOT_MARKDOWN, enabled, markdown_default;
20505
+ var import_prosemirror_state46, LABELS25, BLOCK_SIGNS, INLINE_SIGNS, NOT_MARKDOWN, enabled, markdown_default;
20149
20506
  var init_markdown2 = __esm({
20150
20507
  "src/plugins/markdown.ts"() {
20151
20508
  "use strict";
20152
- import_prosemirror_state45 = require("prosemirror-state");
20509
+ import_prosemirror_state46 = require("prosemirror-state");
20153
20510
  init_markdown();
20154
20511
  init_parser();
20155
20512
  init_plugins();
@@ -20193,7 +20550,7 @@ var init_markdown2 = __esm({
20193
20550
  markdown_default = definePlugin({
20194
20551
  name: "markdown",
20195
20552
  prosemirrorPlugins: (editor) => [
20196
- new import_prosemirror_state45.Plugin({
20553
+ new import_prosemirror_state46.Plugin({
20197
20554
  props: {
20198
20555
  // Plain text pastes (no HTML on the clipboard). `plain`: Ctrl/Cmd+Shift+V.
20199
20556
  clipboardTextParser(text2, $context, plain2, view) {
@@ -20848,7 +21205,7 @@ function createChecker(editor) {
20848
21205
  return true;
20849
21206
  }
20850
21207
  editor.view.dispatch(
20851
- state.tr.setSelection(import_prosemirror_state46.TextSelection.create(state.doc, target.from, target.to)).scrollIntoView()
21208
+ state.tr.setSelection(import_prosemirror_state47.TextSelection.create(state.doc, target.from, target.to)).scrollIntoView()
20852
21209
  );
20853
21210
  checker.openBubble(target.from, target.to, true);
20854
21211
  return true;
@@ -20867,7 +21224,7 @@ function createChecker(editor) {
20867
21224
  const replace = (value) => {
20868
21225
  const { state } = view;
20869
21226
  const tr = state.tr.insertText(value, problem2.from, problem2.to);
20870
- tr.setSelection(import_prosemirror_state46.TextSelection.create(tr.doc, problem2.from + value.length));
21227
+ tr.setSelection(import_prosemirror_state47.TextSelection.create(tr.doc, problem2.from + value.length));
20871
21228
  done(tr.scrollIntoView());
20872
21229
  };
20873
21230
  const ignore = (all) => {
@@ -20950,12 +21307,12 @@ function createChecker(editor) {
20950
21307
  };
20951
21308
  return checker;
20952
21309
  }
20953
- var import_prosemirror_keymap11, import_prosemirror_state46, import_prosemirror_view6, LABELS27, ICON6, BATCH_CHARS, spellKey, checkers, spellchecker_default2;
21310
+ var import_prosemirror_keymap11, import_prosemirror_state47, import_prosemirror_view6, LABELS27, ICON6, BATCH_CHARS, spellKey, checkers, spellchecker_default2;
20954
21311
  var init_spellchecker2 = __esm({
20955
21312
  "src/plugins/spellchecker.ts"() {
20956
21313
  "use strict";
20957
21314
  import_prosemirror_keymap11 = require("prosemirror-keymap");
20958
- import_prosemirror_state46 = require("prosemirror-state");
21315
+ import_prosemirror_state47 = require("prosemirror-state");
20959
21316
  import_prosemirror_view6 = require("prosemirror-view");
20960
21317
  init_plugins();
20961
21318
  init_dom();
@@ -20980,7 +21337,7 @@ var init_spellchecker2 = __esm({
20980
21337
  };
20981
21338
  ICON6 = '<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 16 6-12 6 12"/><path d="M8 12h8"/><path d="m16 20 2 2 4-4"/></svg>';
20982
21339
  BATCH_CHARS = 6e3;
20983
- spellKey = new import_prosemirror_state46.PluginKey("nova-spellchecker");
21340
+ spellKey = new import_prosemirror_state47.PluginKey("nova-spellchecker");
20984
21341
  checkers = /* @__PURE__ */ new WeakMap();
20985
21342
  spellchecker_default2 = definePlugin({
20986
21343
  name: "spellchecker",
@@ -20989,7 +21346,7 @@ var init_spellchecker2 = __esm({
20989
21346
  const checker = checkers.get(editor) ?? createChecker(editor);
20990
21347
  checkers.set(editor, checker);
20991
21348
  return [
20992
- new import_prosemirror_state46.Plugin({
21349
+ new import_prosemirror_state47.Plugin({
20993
21350
  key: spellKey,
20994
21351
  state: {
20995
21352
  init: () => import_prosemirror_view6.DecorationSet.empty,
@@ -21765,7 +22122,7 @@ function createAutocorrect(editor) {
21765
22122
  console.error("[novaprose] autocorrect onCorrect failed", error);
21766
22123
  }
21767
22124
  };
21768
- const plugin = new import_prosemirror_state47.Plugin({
22125
+ const plugin = new import_prosemirror_state48.Plugin({
21769
22126
  key: key3,
21770
22127
  state: {
21771
22128
  init: () => null,
@@ -21870,12 +22227,12 @@ function save2(settings) {
21870
22227
  } catch {
21871
22228
  }
21872
22229
  }
21873
- var import_prosemirror_history4, import_prosemirror_state47, import_prosemirror_view7, LABELS28, key3, STORAGE, leafText, CONTEXT, ENDS_WORD, ICON7, editors, autocorrect_default2;
22230
+ var import_prosemirror_history4, import_prosemirror_state48, import_prosemirror_view7, LABELS28, key3, STORAGE, leafText, CONTEXT, ENDS_WORD, ICON7, editors, autocorrect_default2;
21874
22231
  var init_autocorrect2 = __esm({
21875
22232
  "src/plugins/autocorrect.ts"() {
21876
22233
  "use strict";
21877
22234
  import_prosemirror_history4 = require("prosemirror-history");
21878
- import_prosemirror_state47 = require("prosemirror-state");
22235
+ import_prosemirror_state48 = require("prosemirror-state");
21879
22236
  import_prosemirror_view7 = require("prosemirror-view");
21880
22237
  init_plugins();
21881
22238
  init_autocorrect();
@@ -21890,7 +22247,7 @@ var init_autocorrect2 = __esm({
21890
22247
  reverted: "{word} put back"
21891
22248
  }
21892
22249
  };
21893
- key3 = new import_prosemirror_state47.PluginKey("nova-autocorrect");
22250
+ key3 = new import_prosemirror_state48.PluginKey("nova-autocorrect");
21894
22251
  STORAGE = "novaprose-autocorrect";
21895
22252
  leafText = (node) => node.type.name === "hard_break" ? "\n" : "\uFFFC";
21896
22253
  CONTEXT = 400;
@@ -22820,7 +23177,7 @@ function createPanel(editor, labels, options2) {
22820
23177
  const { state } = editor.view;
22821
23178
  if (issue.to > state.doc.content.size) return;
22822
23179
  const node = state.doc.nodeAt(issue.from);
22823
- const selection = node && node.isAtom && issue.from + node.nodeSize === issue.to ? import_prosemirror_state48.NodeSelection.create(state.doc, issue.from) : import_prosemirror_state48.TextSelection.between(state.doc.resolve(issue.from), state.doc.resolve(issue.to));
23180
+ const selection = node && node.isAtom && issue.from + node.nodeSize === issue.to ? import_prosemirror_state49.NodeSelection.create(state.doc, issue.from) : import_prosemirror_state49.TextSelection.between(state.doc.resolve(issue.from), state.doc.resolve(issue.to));
22824
23181
  editor.view.dispatch(state.tr.setSelection(selection).scrollIntoView());
22825
23182
  setHighlight(editor, { from: issue.from, to: issue.to });
22826
23183
  }
@@ -22953,11 +23310,11 @@ function createPanel(editor, labels, options2) {
22953
23310
  }
22954
23311
  };
22955
23312
  }
22956
- var import_prosemirror_state48, import_prosemirror_view8, LABELS30, ICON9, PANEL2, IMAGE_RULES, BULLET_PREFIX, NUMBER_PREFIX, highlightKey, a11ychecker_default2;
23313
+ var import_prosemirror_state49, import_prosemirror_view8, LABELS30, ICON9, PANEL2, IMAGE_RULES, BULLET_PREFIX, NUMBER_PREFIX, highlightKey, a11ychecker_default2;
22957
23314
  var init_a11ychecker2 = __esm({
22958
23315
  "src/plugins/a11ychecker.ts"() {
22959
23316
  "use strict";
22960
- import_prosemirror_state48 = require("prosemirror-state");
23317
+ import_prosemirror_state49 = require("prosemirror-state");
22961
23318
  import_prosemirror_view8 = require("prosemirror-view");
22962
23319
  init_a11y();
22963
23320
  init_link();
@@ -23013,12 +23370,12 @@ var init_a11ychecker2 = __esm({
23013
23370
  IMAGE_RULES = /* @__PURE__ */ new Set(["I1", "I2", "I3", "I4"]);
23014
23371
  BULLET_PREFIX = /^\s*[•◦▪▫‣⁃●○■□–—*-]\s+/;
23015
23372
  NUMBER_PREFIX = /^\s*(\d{1,3})[.)]\s+/;
23016
- highlightKey = new import_prosemirror_state48.PluginKey("nova-a11y-highlight");
23373
+ highlightKey = new import_prosemirror_state49.PluginKey("nova-a11y-highlight");
23017
23374
  a11ychecker_default2 = definePlugin({
23018
23375
  name: "a11ychecker",
23019
23376
  toolbar: "a11ycheck",
23020
23377
  prosemirrorPlugins: () => [
23021
- new import_prosemirror_state48.Plugin({
23378
+ new import_prosemirror_state49.Plugin({
23022
23379
  key: highlightKey,
23023
23380
  state: {
23024
23381
  init: () => null,
@@ -23271,11 +23628,11 @@ function createChecker2(editor) {
23271
23628
  };
23272
23629
  return checker;
23273
23630
  }
23274
- var import_prosemirror_state49, import_prosemirror_view9, LABELS31, ICON10, BATCH, KEEP, MAX, linkKey, checkers2, linkchecker_default2;
23631
+ var import_prosemirror_state50, import_prosemirror_view9, LABELS31, ICON10, BATCH, KEEP, MAX, linkKey, checkers2, linkchecker_default2;
23275
23632
  var init_linkchecker2 = __esm({
23276
23633
  "src/plugins/linkchecker.ts"() {
23277
23634
  "use strict";
23278
- import_prosemirror_state49 = require("prosemirror-state");
23635
+ import_prosemirror_state50 = require("prosemirror-state");
23279
23636
  import_prosemirror_view9 = require("prosemirror-view");
23280
23637
  init_plugins();
23281
23638
  init_link_bubble();
@@ -23293,7 +23650,7 @@ var init_linkchecker2 = __esm({
23293
23650
  BATCH = 50;
23294
23651
  KEEP = 10 * 60 * 1e3;
23295
23652
  MAX = 500;
23296
- linkKey = new import_prosemirror_state49.PluginKey("nova-linkchecker");
23653
+ linkKey = new import_prosemirror_state50.PluginKey("nova-linkchecker");
23297
23654
  checkers2 = /* @__PURE__ */ new WeakMap();
23298
23655
  linkchecker_default2 = definePlugin({
23299
23656
  name: "linkchecker",
@@ -23302,7 +23659,7 @@ var init_linkchecker2 = __esm({
23302
23659
  const checker = checkers2.get(editor) ?? createChecker2(editor);
23303
23660
  checkers2.set(editor, checker);
23304
23661
  return [
23305
- new import_prosemirror_state49.Plugin({
23662
+ new import_prosemirror_state50.Plugin({
23306
23663
  key: linkKey,
23307
23664
  state: {
23308
23665
  init: () => import_prosemirror_view9.DecorationSet.empty,
@@ -23515,7 +23872,7 @@ function openCodeEditor(editor, labels) {
23515
23872
  extensions: [
23516
23873
  import_codemirror.basicSetup,
23517
23874
  (0, import_lang_html.html)(),
23518
- (0, import_language.syntaxHighlighting)(highlight),
23875
+ (0, import_language5.syntaxHighlighting)(highlight),
23519
23876
  theme,
23520
23877
  wrap.of(wrapOn ? import_view.EditorView.lineWrapping : []),
23521
23878
  import_view.EditorView.contentAttributes.of({ "aria-label": t("sourceCode") }),
@@ -23609,12 +23966,12 @@ function openCodeEditor(editor, labels) {
23609
23966
  effects: import_view.EditorView.scrollIntoView(view.state.selection.main.head, { y: "center" })
23610
23967
  });
23611
23968
  }
23612
- var import_lang_html, import_language, import_search3, import_state, import_view, import_highlight, import_codemirror, svg3, SMALLER, LARGER, WRAP, highlight, theme, lastSize, lastWrap, clampSize;
23969
+ var import_lang_html, import_language5, import_search3, import_state, import_view, import_highlight, import_codemirror, svg3, SMALLER, LARGER, WRAP, highlight, theme, lastSize, lastWrap, clampSize;
23613
23970
  var init_advcode_editor = __esm({
23614
23971
  "src/plugins/advcode-editor.ts"() {
23615
23972
  "use strict";
23616
23973
  import_lang_html = require("@codemirror/lang-html");
23617
- import_language = require("@codemirror/language");
23974
+ import_language5 = require("@codemirror/language");
23618
23975
  import_search3 = require("@codemirror/search");
23619
23976
  import_state = require("@codemirror/state");
23620
23977
  import_view = require("@codemirror/view");
@@ -23634,7 +23991,7 @@ var init_advcode_editor = __esm({
23634
23991
  WRAP = svg3(
23635
23992
  '<path d="M4 6h16"/><path d="M4 12h13a3 3 0 0 1 0 6h-5"/><path d="m14 16-2 2 2 2"/><path d="M4 18h4"/>'
23636
23993
  );
23637
- highlight = import_language.HighlightStyle.define([
23994
+ highlight = import_language5.HighlightStyle.define([
23638
23995
  { tag: [import_highlight.tags.tagName, import_highlight.tags.keyword], color: "var(--nova-code-keyword)" },
23639
23996
  { tag: [import_highlight.tags.attributeName, import_highlight.tags.propertyName], color: "var(--nova-code-attr)" },
23640
23997
  { tag: [import_highlight.tags.attributeValue, import_highlight.tags.string], color: "var(--nova-code-string)" },
@@ -23997,7 +24354,7 @@ function setAttrs(editor, pos, attrs, history2, select) {
23997
24354
  if (!node) return;
23998
24355
  const tr = state.tr.setNodeMarkup(pos, void 0, { ...node.attrs, ...attrs });
23999
24356
  if (select && node.type === nodesOf(state).image)
24000
- tr.setSelection(import_prosemirror_state50.NodeSelection.create(tr.doc, pos));
24357
+ tr.setSelection(import_prosemirror_state51.NodeSelection.create(tr.doc, pos));
24001
24358
  if (history2) (0, import_prosemirror_history5.closeHistory)(tr);
24002
24359
  else tr.setMeta("addToHistory", false);
24003
24360
  editor.view.dispatch(tr);
@@ -24323,12 +24680,12 @@ function openEditDialog(editor, labels, bitmap, onApply) {
24323
24680
  });
24324
24681
  fill();
24325
24682
  }
24326
- var import_prosemirror_history5, import_prosemirror_state50, LABELS33, svg4, ICONS, EDITABLE, UnreadableImage, UnsupportedImage, isBlob, editimage_default2;
24683
+ var import_prosemirror_history5, import_prosemirror_state51, LABELS33, svg4, ICONS, EDITABLE, UnreadableImage, UnsupportedImage, isBlob, editimage_default2;
24327
24684
  var init_editimage2 = __esm({
24328
24685
  "src/plugins/editimage.ts"() {
24329
24686
  "use strict";
24330
24687
  import_prosemirror_history5 = require("prosemirror-history");
24331
- import_prosemirror_state50 = require("prosemirror-state");
24688
+ import_prosemirror_state51 = require("prosemirror-state");
24332
24689
  init_commands();
24333
24690
  init_image();
24334
24691
  init_plugins();
@@ -25053,7 +25410,7 @@ __export(quickbars_exports, {
25053
25410
  });
25054
25411
  function hasTextSelection(editor) {
25055
25412
  const { selection } = editor.view.state;
25056
- if (!(selection instanceof import_prosemirror_state51.TextSelection) || selection.empty) return false;
25413
+ if (!(selection instanceof import_prosemirror_state52.TextSelection) || selection.empty) return false;
25057
25414
  if (selection.$from.parent.type.spec.code) return false;
25058
25415
  return editor.view.state.doc.textBetween(selection.from, selection.to).trim().length > 0;
25059
25416
  }
@@ -25073,11 +25430,11 @@ function pickImage(editor) {
25073
25430
  });
25074
25431
  input.click();
25075
25432
  }
25076
- var import_prosemirror_state51, DEFAULT_SELECTION, DEFAULT_INSERT, quickbars_default;
25433
+ var import_prosemirror_state52, DEFAULT_SELECTION, DEFAULT_INSERT, quickbars_default;
25077
25434
  var init_quickbars = __esm({
25078
25435
  "src/plugins/quickbars.ts"() {
25079
25436
  "use strict";
25080
- import_prosemirror_state51 = require("prosemirror-state");
25437
+ import_prosemirror_state52 = require("prosemirror-state");
25081
25438
  init_image();
25082
25439
  init_link();
25083
25440
  init_plugins();
@@ -25643,7 +26000,7 @@ function checklistInputRule() {
25643
26000
  });
25644
26001
  }
25645
26002
  function checkboxes(editor, label) {
25646
- const key5 = new import_prosemirror_state52.PluginKey("nova-checklist");
26003
+ const key5 = new import_prosemirror_state53.PluginKey("nova-checklist");
25647
26004
  const build = (doc) => {
25648
26005
  const decorations = [];
25649
26006
  doc.descendants((node, pos) => {
@@ -25683,7 +26040,7 @@ function checkboxes(editor, label) {
25683
26040
  });
25684
26041
  return box2;
25685
26042
  };
25686
- return new import_prosemirror_state52.Plugin({
26043
+ return new import_prosemirror_state53.Plugin({
25687
26044
  key: key5,
25688
26045
  state: {
25689
26046
  init: (_, state) => build(state.doc),
@@ -25692,14 +26049,14 @@ function checkboxes(editor, label) {
25692
26049
  props: { decorations: (state) => key5.getState(state) }
25693
26050
  });
25694
26051
  }
25695
- var import_prosemirror_inputrules3, import_prosemirror_keymap13, import_prosemirror_schema_list4, import_prosemirror_state52, import_prosemirror_transform3, import_prosemirror_view10, LABELS38, SHORTCUT2, toggleChecklist, toggleChecklistItem, checklist_default2;
26052
+ var import_prosemirror_inputrules3, import_prosemirror_keymap13, import_prosemirror_schema_list4, import_prosemirror_state53, import_prosemirror_transform3, import_prosemirror_view10, LABELS38, SHORTCUT2, toggleChecklist, toggleChecklistItem, checklist_default2;
25696
26053
  var init_checklist2 = __esm({
25697
26054
  "src/plugins/checklist.ts"() {
25698
26055
  "use strict";
25699
26056
  import_prosemirror_inputrules3 = require("prosemirror-inputrules");
25700
26057
  import_prosemirror_keymap13 = require("prosemirror-keymap");
25701
26058
  import_prosemirror_schema_list4 = require("prosemirror-schema-list");
25702
- import_prosemirror_state52 = require("prosemirror-state");
26059
+ import_prosemirror_state53 = require("prosemirror-state");
25703
26060
  import_prosemirror_transform3 = require("prosemirror-transform");
25704
26061
  import_prosemirror_view10 = require("prosemirror-view");
25705
26062
  init_commands();
@@ -26105,7 +26462,7 @@ function highlightPlugin(highlighter, languages) {
26105
26462
  });
26106
26463
  return { set, deferred };
26107
26464
  };
26108
- return new import_prosemirror_state53.Plugin({
26465
+ return new import_prosemirror_state54.Plugin({
26109
26466
  key: key4,
26110
26467
  highlighter,
26111
26468
  state: {
@@ -26158,7 +26515,7 @@ function insertBlock(state, block) {
26158
26515
  if (node === block) end = pos + node.nodeSize - 1;
26159
26516
  return end < 0;
26160
26517
  });
26161
- if (end >= 0) tr.setSelection(import_prosemirror_state53.TextSelection.create(tr.doc, end));
26518
+ if (end >= 0) tr.setSelection(import_prosemirror_state54.TextSelection.create(tr.doc, end));
26162
26519
  return tr;
26163
26520
  }
26164
26521
  async function codeDialog(editor, languages, memory) {
@@ -26202,7 +26559,7 @@ async function codeDialog(editor, languages, memory) {
26202
26559
  let tr;
26203
26560
  if (target) {
26204
26561
  tr = next.tr.replaceWith(target.pos, target.pos + target.node.nodeSize, node);
26205
- tr.setSelection(import_prosemirror_state53.TextSelection.create(tr.doc, target.pos + 1 + code.length));
26562
+ tr.setSelection(import_prosemirror_state54.TextSelection.create(tr.doc, target.pos + 1 + code.length));
26206
26563
  } else {
26207
26564
  tr = insertBlock(next, node);
26208
26565
  }
@@ -26212,11 +26569,11 @@ async function codeDialog(editor, languages, memory) {
26212
26569
  function options(editor) {
26213
26570
  return editor.options.pluginOptions?.codesample ?? {};
26214
26571
  }
26215
- var import_prosemirror_state53, import_prosemirror_view11, LABELS39, SYNC_LIMIT, DEFER_DELAY, key4, codesample_default2;
26572
+ var import_prosemirror_state54, import_prosemirror_view11, LABELS39, SYNC_LIMIT, DEFER_DELAY, key4, codesample_default2;
26216
26573
  var init_codesample2 = __esm({
26217
26574
  "src/plugins/codesample.ts"() {
26218
26575
  "use strict";
26219
- import_prosemirror_state53 = require("prosemirror-state");
26576
+ import_prosemirror_state54 = require("prosemirror-state");
26220
26577
  import_prosemirror_view11 = require("prosemirror-view");
26221
26578
  init_code_language();
26222
26579
  init_plugins();
@@ -26238,7 +26595,7 @@ var init_codesample2 = __esm({
26238
26595
  };
26239
26596
  SYNC_LIMIT = 2e4;
26240
26597
  DEFER_DELAY = 300;
26241
- key4 = new import_prosemirror_state53.PluginKey("nova-codesample");
26598
+ key4 = new import_prosemirror_state54.PluginKey("nova-codesample");
26242
26599
  codesample_default2 = definePlugin({
26243
26600
  name: "codesample",
26244
26601
  toolbar: "codesample",
@@ -26433,13 +26790,13 @@ function moveBlockTo(state, source, target, copy = false) {
26433
26790
  inserted = insertBlock2(tr, pos, node, source.list);
26434
26791
  if (inserted === null) return null;
26435
26792
  }
26436
- tr.setSelection(import_prosemirror_state54.NodeSelection.create(tr.doc, inserted));
26793
+ tr.setSelection(import_prosemirror_state55.NodeSelection.create(tr.doc, inserted));
26437
26794
  return tr.setMeta("uiEvent", "drop").scrollIntoView();
26438
26795
  }
26439
26796
  function handlePlugin(editor, labels) {
26440
26797
  let source = null;
26441
- return new import_prosemirror_state54.Plugin({
26442
- key: new import_prosemirror_state54.PluginKey("nova-draghandle"),
26798
+ return new import_prosemirror_state55.Plugin({
26799
+ key: new import_prosemirror_state55.PluginKey("nova-draghandle"),
26443
26800
  props: {
26444
26801
  handleDrop(view, event, _slice, moved) {
26445
26802
  if (!source) return false;
@@ -26551,7 +26908,7 @@ function handlePlugin(editor, labels) {
26551
26908
  pos: unit.pos,
26552
26909
  list: unit.node.type.name === "list_item" ? $pos.parent : null
26553
26910
  };
26554
- const selection = import_prosemirror_state54.NodeSelection.create(view.state.doc, unit.pos);
26911
+ const selection = import_prosemirror_state55.NodeSelection.create(view.state.doc, unit.pos);
26555
26912
  view.dispatch(view.state.tr.setSelection(selection));
26556
26913
  const slice = selection.content();
26557
26914
  const box2 = document.createElement("div");
@@ -26582,7 +26939,7 @@ function handlePlugin(editor, labels) {
26582
26939
  };
26583
26940
  const openMenu = () => {
26584
26941
  if (!unit) return;
26585
- view.dispatch(view.state.tr.setSelection(import_prosemirror_state54.NodeSelection.create(view.state.doc, unit.pos)));
26942
+ view.dispatch(view.state.tr.setSelection(import_prosemirror_state55.NodeSelection.create(view.state.doc, unit.pos)));
26586
26943
  view.focus();
26587
26944
  const run2 = (command) => () => {
26588
26945
  editor.exec(command);
@@ -26654,12 +27011,12 @@ function handlePlugin(editor, labels) {
26654
27011
  }
26655
27012
  });
26656
27013
  }
26657
- var import_prosemirror_model17, import_prosemirror_state54, import_prosemirror_transform4, LABELS40, HANDLE_WIDTH, HANDLE_HEIGHT, GAP2, deleteBlock, draghandle_default2;
27014
+ var import_prosemirror_model17, import_prosemirror_state55, import_prosemirror_transform4, LABELS40, HANDLE_WIDTH, HANDLE_HEIGHT, GAP2, deleteBlock, draghandle_default2;
26658
27015
  var init_draghandle2 = __esm({
26659
27016
  "src/plugins/draghandle.ts"() {
26660
27017
  "use strict";
26661
27018
  import_prosemirror_model17 = require("prosemirror-model");
26662
- import_prosemirror_state54 = require("prosemirror-state");
27019
+ import_prosemirror_state55 = require("prosemirror-state");
26663
27020
  import_prosemirror_transform4 = require("prosemirror-transform");
26664
27021
  init_blocks();
26665
27022
  init_plugins();
@@ -26680,7 +27037,7 @@ var init_draghandle2 = __esm({
26680
27037
  HANDLE_HEIGHT = 24;
26681
27038
  GAP2 = 4;
26682
27039
  deleteBlock = (state, dispatch) => {
26683
- if (!(state.selection instanceof import_prosemirror_state54.NodeSelection)) return false;
27040
+ if (!(state.selection instanceof import_prosemirror_state55.NodeSelection)) return false;
26684
27041
  dispatch?.(state.tr.deleteSelection().scrollIntoView());
26685
27042
  return true;
26686
27043
  };
@@ -26722,12 +27079,12 @@ function linkifyBefore(state, tr, end) {
26722
27079
  tr.addMark(from, to, link.create({ href: href2 }));
26723
27080
  return true;
26724
27081
  }
26725
- var import_prosemirror_inputrules4, import_prosemirror_state55, URL_AT_END, SINGLE_URL, autolink_default;
27082
+ var import_prosemirror_inputrules4, import_prosemirror_state56, URL_AT_END, SINGLE_URL, autolink_default;
26726
27083
  var init_autolink = __esm({
26727
27084
  "src/plugins/autolink.ts"() {
26728
27085
  "use strict";
26729
27086
  import_prosemirror_inputrules4 = require("prosemirror-inputrules");
26730
- import_prosemirror_state55 = require("prosemirror-state");
27087
+ import_prosemirror_state56 = require("prosemirror-state");
26731
27088
  init_commands();
26732
27089
  init_plugins();
26733
27090
  init_url();
@@ -26748,7 +27105,7 @@ var init_autolink = __esm({
26748
27105
  })
26749
27106
  ]
26750
27107
  }),
26751
- new import_prosemirror_state55.Plugin({
27108
+ new import_prosemirror_state56.Plugin({
26752
27109
  /**
26753
27110
  * Enter after an address. The core keymap handles Enter before plugins, so we look
26754
27111
  * at the result: the cursor is at the start of a new block, and the previous block ends with an address.
@@ -26757,14 +27114,14 @@ var init_autolink = __esm({
26757
27114
  if (!editor.isAllowed("link") || !transactions.some((tr2) => tr2.docChanged)) return null;
26758
27115
  const { $from, empty } = state.selection;
26759
27116
  if (!empty || $from.parentOffset !== 0 || $from.depth < 1) return null;
26760
- const prev = import_prosemirror_state55.Selection.findFrom(state.doc.resolve($from.before()), -1, true);
27117
+ const prev = import_prosemirror_state56.Selection.findFrom(state.doc.resolve($from.before()), -1, true);
26761
27118
  if (!prev || !prev.empty || prev.$from.parentOffset !== prev.$from.parent.content.size)
26762
27119
  return null;
26763
27120
  const tr = state.tr;
26764
27121
  return linkifyBefore(state, tr, prev.from) ? tr : null;
26765
27122
  }
26766
27123
  }),
26767
- new import_prosemirror_state55.Plugin({
27124
+ new import_prosemirror_state56.Plugin({
26768
27125
  props: {
26769
27126
  handlePaste(view, event) {
26770
27127
  const { state } = view;
@@ -27379,6 +27736,7 @@ var init_export = __esm({
27379
27736
  "use strict";
27380
27737
  init_pagelayout2();
27381
27738
  init_suggestions();
27739
+ init_language();
27382
27740
  init_url();
27383
27741
  init_xml();
27384
27742
  init_zip();
@@ -27482,6 +27840,7 @@ var init_export = __esm({
27482
27840
  let underline = false;
27483
27841
  let shade = "";
27484
27842
  let vertical = "";
27843
+ let lang2 = "";
27485
27844
  for (const mark of marks3) {
27486
27845
  const name = mark.type.name;
27487
27846
  if (name === "link") style2 = "Hyperlink";
@@ -27491,6 +27850,7 @@ var init_export = __esm({
27491
27850
  else if (name === "strike") strike = true;
27492
27851
  else if (name === "subscript") vertical = "subscript";
27493
27852
  else if (name === "superscript") vertical = "superscript";
27853
+ else if (name === "language") lang2 = languageTag(mark.attrs.lang) ?? lang2;
27494
27854
  else if (name === "code") {
27495
27855
  fonts = "Consolas";
27496
27856
  shade ||= "F3F4F6";
@@ -27502,7 +27862,8 @@ var init_export = __esm({
27502
27862
  if (sz) size = `<w:sz w:val="${sz}"/><w:szCs w:val="${sz}"/>`;
27503
27863
  }
27504
27864
  }
27505
- const props = (style2 ? `<w:rStyle w:val="${style2}"/>` : "") + (fonts ? `<w:rFonts w:ascii="${escapeXml(fonts)}" w:hAnsi="${escapeXml(fonts)}" w:cs="${escapeXml(fonts)}" w:eastAsia="${escapeXml(fonts)}"/>` : "") + (bold ? "<w:b/><w:bCs/>" : "") + (italic ? "<w:i/><w:iCs/>" : "") + (strike ? "<w:strike/>" : "") + (color2 ? `<w:color w:val="${color2}"/>` : "") + size + (underline ? '<w:u w:val="single"/>' : "") + (shade ? `<w:shd w:val="clear" w:color="auto" w:fill="${shade}"/>` : "") + (vertical ? `<w:vertAlign w:val="${vertical}"/>` : "");
27865
+ const props = (style2 ? `<w:rStyle w:val="${style2}"/>` : "") + (fonts ? `<w:rFonts w:ascii="${escapeXml(fonts)}" w:hAnsi="${escapeXml(fonts)}" w:cs="${escapeXml(fonts)}" w:eastAsia="${escapeXml(fonts)}"/>` : "") + (bold ? "<w:b/><w:bCs/>" : "") + (italic ? "<w:i/><w:iCs/>" : "") + (strike ? "<w:strike/>" : "") + (color2 ? `<w:color w:val="${color2}"/>` : "") + size + (underline ? '<w:u w:val="single"/>' : "") + (shade ? `<w:shd w:val="clear" w:color="auto" w:fill="${shade}"/>` : "") + (vertical ? `<w:vertAlign w:val="${vertical}"/>` : "") + // A passage in another language: Word checks its spelling and reads it in that language.
27866
+ (lang2 ? `<w:lang w:val="${lang2}"/>` : "");
27506
27867
  return props;
27507
27868
  }
27508
27869
  /** Text as runs: a line break is w:br, a tab is w:tab. */
@@ -29595,7 +29956,7 @@ async function runEdit(editor, instruction, author, signal, {
29595
29956
  return result;
29596
29957
  }
29597
29958
  function contextPlugin() {
29598
- return new import_prosemirror_state56.Plugin({
29959
+ return new import_prosemirror_state57.Plugin({
29599
29960
  key: contextKey,
29600
29961
  state: {
29601
29962
  init: () => false,
@@ -29924,7 +30285,7 @@ function createChatPanel(editor, labels, author) {
29924
30285
  const state = editor.view.state;
29925
30286
  let pos = state.selection.to;
29926
30287
  if (!state.doc.resolve(pos).parent.isTextblock) {
29927
- const near = import_prosemirror_state56.Selection.findFrom(state.doc.resolve(pos), 1, true) ?? import_prosemirror_state56.Selection.findFrom(state.doc.resolve(pos), -1, true);
30288
+ const near = import_prosemirror_state57.Selection.findFrom(state.doc.resolve(pos), 1, true) ?? import_prosemirror_state57.Selection.findFrom(state.doc.resolve(pos), -1, true);
29928
30289
  if (!near) return;
29929
30290
  pos = near.from;
29930
30291
  }
@@ -29969,7 +30330,7 @@ function createChatPanel(editor, labels, author) {
29969
30330
  const first = listSuggestions(doc).find((s) => ids.includes(s.id));
29970
30331
  if (!first) return;
29971
30332
  editor.view.dispatch(
29972
- editor.view.state.tr.setSelection(import_prosemirror_state56.TextSelection.create(doc, first.from, first.to)).scrollIntoView()
30333
+ editor.view.state.tr.setSelection(import_prosemirror_state57.TextSelection.create(doc, first.from, first.to)).scrollIntoView()
29973
30334
  );
29974
30335
  editor.focus();
29975
30336
  }
@@ -30029,18 +30390,18 @@ function createChatPanel(editor, labels, author) {
30029
30390
  }
30030
30391
  };
30031
30392
  }
30032
- var import_prosemirror_state56, import_prosemirror_transform5, import_prosemirror_view12, contextKey, ASK_SUGGESTIONS, EDIT_SUGGESTIONS, HISTORY;
30393
+ var import_prosemirror_state57, import_prosemirror_transform5, import_prosemirror_view12, contextKey, ASK_SUGGESTIONS, EDIT_SUGGESTIONS, HISTORY;
30033
30394
  var init_ai_chat = __esm({
30034
30395
  "src/plugins/ai-chat.ts"() {
30035
30396
  "use strict";
30036
- import_prosemirror_state56 = require("prosemirror-state");
30397
+ import_prosemirror_state57 = require("prosemirror-state");
30037
30398
  import_prosemirror_transform5 = require("prosemirror-transform");
30038
30399
  import_prosemirror_view12 = require("prosemirror-view");
30039
30400
  init_dom();
30040
30401
  init_ai_core();
30041
30402
  init_ai_edit();
30042
30403
  init_suggestions();
30043
- contextKey = new import_prosemirror_state56.PluginKey("nova-ai-context");
30404
+ contextKey = new import_prosemirror_state57.PluginKey("nova-ai-context");
30044
30405
  ASK_SUGGESTIONS = ["askSummarize", "askKeyPoints", "askTitle", "askUnclear"];
30045
30406
  EDIT_SUGGESTIONS = ["fix", "improve", "formal", "simplify", "shorter"];
30046
30407
  HISTORY = 2e4;
@@ -30118,7 +30479,7 @@ function autocompletePlugin(editor, settings) {
30118
30479
  if (failureKind(error) === "failed") console.warn("[nova] ai autocomplete:", error);
30119
30480
  });
30120
30481
  };
30121
- return new import_prosemirror_state57.Plugin({
30482
+ return new import_prosemirror_state58.Plugin({
30122
30483
  key: ghostKey,
30123
30484
  state: {
30124
30485
  init: () => null,
@@ -30219,15 +30580,15 @@ function autocompletePlugin(editor, settings) {
30219
30580
  function stopAutocomplete(view) {
30220
30581
  hide(view);
30221
30582
  }
30222
- var import_prosemirror_state57, import_prosemirror_view13, ghostKey, MIN_TEXT, MAX_LENGTH;
30583
+ var import_prosemirror_state58, import_prosemirror_view13, ghostKey, MIN_TEXT, MAX_LENGTH;
30223
30584
  var init_ai_complete = __esm({
30224
30585
  "src/plugins/ai-complete.ts"() {
30225
30586
  "use strict";
30226
- import_prosemirror_state57 = require("prosemirror-state");
30587
+ import_prosemirror_state58 = require("prosemirror-state");
30227
30588
  import_prosemirror_view13 = require("prosemirror-view");
30228
30589
  init_dom();
30229
30590
  init_ai_core();
30230
- ghostKey = new import_prosemirror_state57.PluginKey("nova-ai-ghost");
30591
+ ghostKey = new import_prosemirror_state58.PluginKey("nova-ai-ghost");
30231
30592
  MIN_TEXT = 4;
30232
30593
  MAX_LENGTH = 200;
30233
30594
  }
@@ -30910,7 +31271,7 @@ function openHistory(editor, options2) {
30910
31271
  };
30911
31272
  const showDoc = (doc) => {
30912
31273
  selectedDoc = doc;
30913
- const state = import_prosemirror_state58.EditorState.create({ doc });
31274
+ const state = import_prosemirror_state59.EditorState.create({ doc });
30914
31275
  const decorations = decorationsFor(doc);
30915
31276
  if (preview) {
30916
31277
  preview.setProps({ state, decorations: () => decorations });
@@ -31062,14 +31423,14 @@ function openHistory(editor, options2) {
31062
31423
  });
31063
31424
  return { close, element: view };
31064
31425
  }
31065
- var import_prosemirror_model20, import_prosemirror_history6, import_prosemirror_state58, import_prosemirror_view14, LABELS49, ICON18, serializer2, revisionhistory_default2;
31426
+ var import_prosemirror_model20, import_prosemirror_history6, import_prosemirror_state59, import_prosemirror_view14, LABELS49, ICON18, serializer2, revisionhistory_default2;
31066
31427
  var init_revisionhistory2 = __esm({
31067
31428
  "src/plugins/revisionhistory.ts"() {
31068
31429
  "use strict";
31069
31430
  init_icons();
31070
31431
  import_prosemirror_model20 = require("prosemirror-model");
31071
31432
  import_prosemirror_history6 = require("prosemirror-history");
31072
- import_prosemirror_state58 = require("prosemirror-state");
31433
+ import_prosemirror_state59 = require("prosemirror-state");
31073
31434
  import_prosemirror_view14 = require("prosemirror-view");
31074
31435
  init_editor();
31075
31436
  init_plugins();
@@ -31247,6 +31608,7 @@ __export(src_exports, {
31247
31608
  getSearchState: () => getSearchState,
31248
31609
  getSelectedImage: () => getSelectedImage,
31249
31610
  getStyle: () => getStyle,
31611
+ getTextLanguage: () => getTextLanguage,
31250
31612
  hasHeaderColumn: () => hasHeaderColumn,
31251
31613
  hasHeaderRow: () => hasHeaderRow,
31252
31614
  hasLanguage: () => hasLanguage,
@@ -31296,6 +31658,7 @@ __export(src_exports, {
31296
31658
  setSearch: () => setSearch,
31297
31659
  setStyle: () => setStyle,
31298
31660
  setSuggesting: () => setSuggesting,
31661
+ setTextLanguage: () => setTextLanguage,
31299
31662
  suggestionsResult: () => suggestionsResult,
31300
31663
  tableCommands: () => tableCommands,
31301
31664
  toggleFullscreen: () => toggleFullscreen,
@@ -31425,6 +31788,7 @@ init_parser();
31425
31788
  init_commands();
31426
31789
  init_commands();
31427
31790
  init_styles();
31791
+ init_language();
31428
31792
  init_link();
31429
31793
  init_image();
31430
31794
  init_i18n();
@@ -31487,6 +31851,7 @@ init_serializer();
31487
31851
  getSearchState,
31488
31852
  getSelectedImage,
31489
31853
  getStyle,
31854
+ getTextLanguage,
31490
31855
  hasHeaderColumn,
31491
31856
  hasHeaderRow,
31492
31857
  hasLanguage,
@@ -31536,6 +31901,7 @@ init_serializer();
31536
31901
  setSearch,
31537
31902
  setStyle,
31538
31903
  setSuggesting,
31904
+ setTextLanguage,
31539
31905
  suggestionsResult,
31540
31906
  tableCommands,
31541
31907
  toggleFullscreen,