@novaprose/core 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/README.md +15 -2
  2. package/dist/a11y.cjs +314 -0
  3. package/dist/a11y.cjs.map +1 -0
  4. package/dist/a11y.d.cts +51 -0
  5. package/dist/a11y.d.ts +51 -0
  6. package/dist/a11y.js +11 -0
  7. package/dist/a11y.js.map +1 -0
  8. package/dist/a11ychecker-7KQU7DD3.js +449 -0
  9. package/dist/a11ychecker-7KQU7DD3.js.map +1 -0
  10. package/dist/accordion-ui-FGN3I5UF.js +201 -0
  11. package/dist/accordion-ui-FGN3I5UF.js.map +1 -0
  12. package/dist/advcode-65Z2ELUB.js +51 -0
  13. package/dist/advcode-65Z2ELUB.js.map +1 -0
  14. package/dist/advcode-editor-WIOCY552.js +257 -0
  15. package/dist/advcode-editor-WIOCY552.js.map +1 -0
  16. package/dist/{advlist-5FNKPLUX.js → advlist-CEHE6YXS.js} +10 -7
  17. package/dist/advlist-CEHE6YXS.js.map +1 -0
  18. package/dist/advtable-ui-5CBOPTHW.js +364 -0
  19. package/dist/advtable-ui-5CBOPTHW.js.map +1 -0
  20. package/dist/ai-IRQYZHRK.js +1485 -0
  21. package/dist/ai-IRQYZHRK.js.map +1 -0
  22. package/dist/anchor-ui-NWIIRKGY.js +81 -0
  23. package/dist/anchor-ui-NWIIRKGY.js.map +1 -0
  24. package/dist/autocorrect-6GFLVDPC.js +851 -0
  25. package/dist/autocorrect-6GFLVDPC.js.map +1 -0
  26. package/dist/{autolink-45LTODWB.js → autolink-N427KVQO.js} +11 -8
  27. package/dist/autolink-N427KVQO.js.map +1 -0
  28. package/dist/{autoresize-UB3GOA6D.js → autoresize-YRZAVCNO.js} +2 -2
  29. package/dist/autoresize-YRZAVCNO.js.map +1 -0
  30. package/dist/{autosave-GMWJ5BPE.js → autosave-L7OZ3KLK.js} +7 -7
  31. package/dist/autosave-L7OZ3KLK.js.map +1 -0
  32. package/dist/casechange-5G6RAJ7K.js +201 -0
  33. package/dist/casechange-5G6RAJ7K.js.map +1 -0
  34. package/dist/{charmap-2GC7LF7G.js → charmap-5CBBDWOP.js} +7 -7
  35. package/dist/charmap-5CBBDWOP.js.map +1 -0
  36. package/dist/checklist-HM4VXZKY.js +189 -0
  37. package/dist/checklist-HM4VXZKY.js.map +1 -0
  38. package/dist/chunk-23ZLVT5D.js +163 -0
  39. package/dist/chunk-23ZLVT5D.js.map +1 -0
  40. package/dist/{chunk-ND2CWNVG.js → chunk-3BOK3S3T.js} +2 -27
  41. package/dist/chunk-3BOK3S3T.js.map +1 -0
  42. package/dist/chunk-4I4AYH2K.js +101 -0
  43. package/dist/chunk-4I4AYH2K.js.map +1 -0
  44. package/dist/{chunk-PVFKXRID.js → chunk-4VPDY3LF.js} +1 -1
  45. package/dist/chunk-4VPDY3LF.js.map +1 -0
  46. package/dist/chunk-53AY5NAF.js +214 -0
  47. package/dist/chunk-53AY5NAF.js.map +1 -0
  48. package/dist/chunk-5VCESSQB.js +137 -0
  49. package/dist/chunk-5VCESSQB.js.map +1 -0
  50. package/dist/chunk-66INZHZ2.js +79 -0
  51. package/dist/chunk-66INZHZ2.js.map +1 -0
  52. package/dist/chunk-6LQM7G4V.js +159 -0
  53. package/dist/chunk-6LQM7G4V.js.map +1 -0
  54. package/dist/chunk-6YSQGFV7.js +893 -0
  55. package/dist/chunk-6YSQGFV7.js.map +1 -0
  56. package/dist/{chunk-T3GY6IVK.js → chunk-AC3YCAX4.js} +71 -9
  57. package/dist/chunk-AC3YCAX4.js.map +1 -0
  58. package/dist/{chunk-5AW2HHG6.js → chunk-ADRPQLZ2.js} +47 -3
  59. package/dist/chunk-ADRPQLZ2.js.map +1 -0
  60. package/dist/chunk-ANE5ASXG.js +26 -0
  61. package/dist/chunk-ANE5ASXG.js.map +1 -0
  62. package/dist/{chunk-Z3ELZ77W.js → chunk-AP2PJFLB.js} +5 -2
  63. package/dist/chunk-AP2PJFLB.js.map +1 -0
  64. package/dist/chunk-AQV6FIKK.js +259 -0
  65. package/dist/chunk-AQV6FIKK.js.map +1 -0
  66. package/dist/chunk-AUQSATWL.js +322 -0
  67. package/dist/chunk-AUQSATWL.js.map +1 -0
  68. package/dist/chunk-C326LHHU.js +143 -0
  69. package/dist/chunk-C326LHHU.js.map +1 -0
  70. package/dist/{chunk-R2UMUCVI.js → chunk-DEYYVZ7O.js} +50 -8
  71. package/dist/chunk-DEYYVZ7O.js.map +1 -0
  72. package/dist/chunk-EOJ5XHKA.js +160 -0
  73. package/dist/chunk-EOJ5XHKA.js.map +1 -0
  74. package/dist/chunk-EXX2S352.js +3642 -0
  75. package/dist/chunk-EXX2S352.js.map +1 -0
  76. package/dist/chunk-FTEA6L2Q.js +47 -0
  77. package/dist/chunk-FTEA6L2Q.js.map +1 -0
  78. package/dist/chunk-G74HNSB6.js +9 -0
  79. package/dist/chunk-G74HNSB6.js.map +1 -0
  80. package/dist/{chunk-KWXFL4WS.js → chunk-GHVB6SV4.js} +8 -5
  81. package/dist/chunk-GHVB6SV4.js.map +1 -0
  82. package/dist/chunk-GTLE2HEW.js +108 -0
  83. package/dist/chunk-GTLE2HEW.js.map +1 -0
  84. package/dist/chunk-GXXXLPDQ.js +67 -0
  85. package/dist/chunk-GXXXLPDQ.js.map +1 -0
  86. package/dist/chunk-HC6RMBAD.js +163 -0
  87. package/dist/chunk-HC6RMBAD.js.map +1 -0
  88. package/dist/chunk-HNEAVVBC.js +98 -0
  89. package/dist/chunk-HNEAVVBC.js.map +1 -0
  90. package/dist/chunk-I7Y4KSM2.js +165 -0
  91. package/dist/chunk-I7Y4KSM2.js.map +1 -0
  92. package/dist/chunk-IG2BL4ON.js +127 -0
  93. package/dist/chunk-IG2BL4ON.js.map +1 -0
  94. package/dist/{chunk-KPE3QRPB.js → chunk-J6W2CDRF.js} +16 -315
  95. package/dist/chunk-J6W2CDRF.js.map +1 -0
  96. package/dist/chunk-LVEQBNLX.js +207 -0
  97. package/dist/chunk-LVEQBNLX.js.map +1 -0
  98. package/dist/chunk-MZGNOHSY.js +176 -0
  99. package/dist/chunk-MZGNOHSY.js.map +1 -0
  100. package/dist/chunk-N32H37AJ.js +373 -0
  101. package/dist/chunk-N32H37AJ.js.map +1 -0
  102. package/dist/chunk-NTGEKGXU.js +263 -0
  103. package/dist/chunk-NTGEKGXU.js.map +1 -0
  104. package/dist/chunk-OFHGXYG3.js +140 -0
  105. package/dist/chunk-OFHGXYG3.js.map +1 -0
  106. package/dist/chunk-OOVNE6MB.js +28 -0
  107. package/dist/chunk-OOVNE6MB.js.map +1 -0
  108. package/dist/chunk-OQMMHWMZ.js +7 -0
  109. package/dist/chunk-OQMMHWMZ.js.map +1 -0
  110. package/dist/chunk-P2UU2NLT.js +1149 -0
  111. package/dist/chunk-P2UU2NLT.js.map +1 -0
  112. package/dist/{chunk-JPJVTB45.js → chunk-QU3KXMYT.js} +8 -2
  113. package/dist/chunk-QU3KXMYT.js.map +1 -0
  114. package/dist/chunk-S2XZRKHA.js +29 -0
  115. package/dist/chunk-S2XZRKHA.js.map +1 -0
  116. package/dist/chunk-SCIRO4XK.js +144 -0
  117. package/dist/chunk-SCIRO4XK.js.map +1 -0
  118. package/dist/chunk-T3IRLTKK.js +158 -0
  119. package/dist/chunk-T3IRLTKK.js.map +1 -0
  120. package/dist/chunk-TABIUD2L.js +66 -0
  121. package/dist/chunk-TABIUD2L.js.map +1 -0
  122. package/dist/{chunk-FCMZ7TUQ.js → chunk-TAM2FHKG.js} +172 -43
  123. package/dist/chunk-TAM2FHKG.js.map +1 -0
  124. package/dist/chunk-UTMS2P2K.js +288 -0
  125. package/dist/chunk-UTMS2P2K.js.map +1 -0
  126. package/dist/{chunk-HPLT3XRZ.js → chunk-V7WUHUHM.js} +13 -1
  127. package/dist/chunk-V7WUHUHM.js.map +1 -0
  128. package/dist/{table-SSNABG5W.js → chunk-VK6YF2AA.js} +119 -61
  129. package/dist/chunk-VK6YF2AA.js.map +1 -0
  130. package/dist/chunk-WAOU5NGN.js +430 -0
  131. package/dist/chunk-WAOU5NGN.js.map +1 -0
  132. package/dist/chunk-XIH4SCO6.js +112 -0
  133. package/dist/chunk-XIH4SCO6.js.map +1 -0
  134. package/dist/chunk-XR7CY4NI.js +11 -0
  135. package/dist/chunk-XR7CY4NI.js.map +1 -0
  136. package/dist/chunk-YDF55N6Z.js +164 -0
  137. package/dist/chunk-YDF55N6Z.js.map +1 -0
  138. package/dist/chunk-YDPZCVXS.js +923 -0
  139. package/dist/chunk-YDPZCVXS.js.map +1 -0
  140. package/dist/chunk-YG5V7POU.js +137 -0
  141. package/dist/chunk-YG5V7POU.js.map +1 -0
  142. package/dist/chunk-YVSUR7E5.js +151 -0
  143. package/dist/chunk-YVSUR7E5.js.map +1 -0
  144. package/dist/codesample-GHWIC7PT.js +546 -0
  145. package/dist/codesample-GHWIC7PT.js.map +1 -0
  146. package/dist/{comments-panel-HXMWSRAW.js → comments-panel-SOLBZ46Q.js} +9 -5
  147. package/dist/comments-panel-SOLBZ46Q.js.map +1 -0
  148. package/dist/{directionality-5JLWQGP2.js → directionality-EGQKGDZA.js} +13 -10
  149. package/dist/directionality-EGQKGDZA.js.map +1 -0
  150. package/dist/document-0ft41E6d.d.ts +39 -0
  151. package/dist/document-IQqDDT4v.d.cts +39 -0
  152. package/dist/docx.cjs +23518 -0
  153. package/dist/docx.cjs.map +1 -0
  154. package/dist/docx.d.cts +83 -0
  155. package/dist/docx.d.ts +83 -0
  156. package/dist/docx.js +1821 -0
  157. package/dist/docx.js.map +1 -0
  158. package/dist/draghandle-U6CYZHPA.js +389 -0
  159. package/dist/draghandle-U6CYZHPA.js.map +1 -0
  160. package/dist/editimage-5EWPSM22.js +683 -0
  161. package/dist/editimage-5EWPSM22.js.map +1 -0
  162. package/dist/editor-BCMxe1M4.d.cts +2888 -0
  163. package/dist/editor-Dmtwjw2u.d.ts +2888 -0
  164. package/dist/email-ELNMEQ6E.js +177 -0
  165. package/dist/email-ELNMEQ6E.js.map +1 -0
  166. package/dist/email.cjs +588 -0
  167. package/dist/email.cjs.map +1 -0
  168. package/dist/email.d.cts +7 -0
  169. package/dist/email.d.ts +7 -0
  170. package/dist/email.js +21 -0
  171. package/dist/email.js.map +1 -0
  172. package/dist/{emoticons-ZD6ZRIWG.js → emoticons-EGHNZKSA.js} +7 -7
  173. package/dist/emoticons-EGHNZKSA.js.map +1 -0
  174. package/dist/exportpdf-4P7X3NY2.js +91 -0
  175. package/dist/exportpdf-4P7X3NY2.js.map +1 -0
  176. package/dist/exportword-JFJ3KTYZ.js +16 -0
  177. package/dist/exportword-JFJ3KTYZ.js.map +1 -0
  178. package/dist/footnotes-ui-FV6QRGDA.js +449 -0
  179. package/dist/footnotes-ui-FV6QRGDA.js.map +1 -0
  180. package/dist/form-dialog-SNWFPM2K.js +379 -0
  181. package/dist/form-dialog-SNWFPM2K.js.map +1 -0
  182. package/dist/formatpainter-IEXX27OJ.js +209 -0
  183. package/dist/formatpainter-IEXX27OJ.js.map +1 -0
  184. package/dist/fullpagehtml-ui-RE4C2NO5.js +220 -0
  185. package/dist/fullpagehtml-ui-RE4C2NO5.js.map +1 -0
  186. package/dist/html-rules-api-BLDDW9MO.d.cts +42 -0
  187. package/dist/html-rules-api-BLDDW9MO.d.ts +42 -0
  188. package/dist/html-rules.cjs +19 -17
  189. package/dist/html-rules.cjs.map +1 -1
  190. package/dist/html-rules.d.cts +37 -35
  191. package/dist/html-rules.d.ts +37 -35
  192. package/dist/html-rules.js +24 -20
  193. package/dist/html-rules.js.map +1 -1
  194. package/dist/i18n/de.cjs +346 -0
  195. package/dist/i18n/de.cjs.map +1 -1
  196. package/dist/i18n/de.d.cts +1 -1
  197. package/dist/i18n/de.d.ts +1 -1
  198. package/dist/i18n/de.js +346 -0
  199. package/dist/i18n/de.js.map +1 -1
  200. package/dist/i18n/es.cjs +346 -0
  201. package/dist/i18n/es.cjs.map +1 -1
  202. package/dist/i18n/es.d.cts +1 -1
  203. package/dist/i18n/es.d.ts +1 -1
  204. package/dist/i18n/es.js +346 -0
  205. package/dist/i18n/es.js.map +1 -1
  206. package/dist/i18n/fr.cjs +346 -0
  207. package/dist/i18n/fr.cjs.map +1 -1
  208. package/dist/i18n/fr.d.cts +1 -1
  209. package/dist/i18n/fr.d.ts +1 -1
  210. package/dist/i18n/fr.js +346 -0
  211. package/dist/i18n/fr.js.map +1 -1
  212. package/dist/i18n/it.cjs +346 -0
  213. package/dist/i18n/it.cjs.map +1 -1
  214. package/dist/i18n/it.d.cts +1 -1
  215. package/dist/i18n/it.d.ts +1 -1
  216. package/dist/i18n/it.js +346 -0
  217. package/dist/i18n/it.js.map +1 -1
  218. package/dist/i18n/pt-BR.cjs +346 -0
  219. package/dist/i18n/pt-BR.cjs.map +1 -1
  220. package/dist/i18n/pt-BR.d.cts +1 -1
  221. package/dist/i18n/pt-BR.d.ts +1 -1
  222. package/dist/i18n/pt-BR.js +346 -0
  223. package/dist/i18n/pt-BR.js.map +1 -1
  224. package/dist/i18n/ru.cjs +346 -0
  225. package/dist/i18n/ru.cjs.map +1 -1
  226. package/dist/i18n/ru.d.cts +3 -3
  227. package/dist/i18n/ru.d.ts +3 -3
  228. package/dist/i18n/ru.js +346 -0
  229. package/dist/i18n/ru.js.map +1 -1
  230. package/dist/importcss-JLNIRKGH.js +127 -0
  231. package/dist/importcss-JLNIRKGH.js.map +1 -0
  232. package/dist/importword-D7Z6RXGQ.js +73 -0
  233. package/dist/importword-D7Z6RXGQ.js.map +1 -0
  234. package/dist/{index-C603bU6r.d.ts → index-CZ9yDvmQ.d.cts} +36 -17
  235. package/dist/{index-C603bU6r.d.cts → index-CZ9yDvmQ.d.ts} +36 -17
  236. package/dist/index.cjs +28858 -10442
  237. package/dist/index.cjs.map +1 -1
  238. package/dist/index.d.cts +138 -64
  239. package/dist/index.d.ts +138 -64
  240. package/dist/index.js +199 -1411
  241. package/dist/index.js.map +1 -1
  242. package/dist/{insertdatetime-CRO7TJAQ.js → insertdatetime-YW2VHYZH.js} +7 -7
  243. package/dist/insertdatetime-YW2VHYZH.js.map +1 -0
  244. package/dist/linkchecker-3S3MCPOS.js +287 -0
  245. package/dist/linkchecker-3S3MCPOS.js.map +1 -0
  246. package/dist/markdown-26O3N3T2.js +136 -0
  247. package/dist/markdown-26O3N3T2.js.map +1 -0
  248. package/dist/markdown.cjs +94 -11
  249. package/dist/markdown.cjs.map +1 -1
  250. package/dist/markdown.d.cts +12 -10
  251. package/dist/markdown.d.ts +12 -10
  252. package/dist/markdown.js +4 -235
  253. package/dist/markdown.js.map +1 -1
  254. package/dist/math-ui-RUTCHTRY.js +157 -0
  255. package/dist/math-ui-RUTCHTRY.js.map +1 -0
  256. package/dist/media-ui-36TE3CJD.js +123 -0
  257. package/dist/media-ui-36TE3CJD.js.map +1 -0
  258. package/dist/mediaembed-ui-ZNTGZ2SQ.js +207 -0
  259. package/dist/mediaembed-ui-ZNTGZ2SQ.js.map +1 -0
  260. package/dist/mentions-ui-O4IPWQT4.js +58 -0
  261. package/dist/mentions-ui-O4IPWQT4.js.map +1 -0
  262. package/dist/mergetags-ui-HS3Q2R36.js +73 -0
  263. package/dist/mergetags-ui-HS3Q2R36.js.map +1 -0
  264. package/dist/{nonbreaking-66LFZV2W.js → nonbreaking-GYRUH4UO.js} +7 -7
  265. package/dist/nonbreaking-GYRUH4UO.js.map +1 -0
  266. package/dist/pagebreak-ui-I4ZPYK3U.js +50 -0
  267. package/dist/pagebreak-ui-I4ZPYK3U.js.map +1 -0
  268. package/dist/pageembed-ui-WOY6VWRJ.js +172 -0
  269. package/dist/pageembed-ui-WOY6VWRJ.js.map +1 -0
  270. package/dist/pagelayout-ui-Y2IM7FJQ.js +236 -0
  271. package/dist/pagelayout-ui-Y2IM7FJQ.js.map +1 -0
  272. package/dist/{paste-office-F3QW4WWO.js → paste-office-3A6KWKCV.js} +82 -2
  273. package/dist/paste-office-3A6KWKCV.js.map +1 -0
  274. package/dist/permanentpen-6D5LLKFX.js +206 -0
  275. package/dist/permanentpen-6D5LLKFX.js.map +1 -0
  276. package/dist/print-MZMLQIQX.js +178 -0
  277. package/dist/print-MZMLQIQX.js.map +1 -0
  278. package/dist/{quickbars-7E2QRS7J.js → quickbars-UZ2Q67TX.js} +20 -12
  279. package/dist/quickbars-UZ2Q67TX.js.map +1 -0
  280. package/dist/{revisionhistory-DXE7KU4R.js → revisionhistory-ACRB23HL.js} +42 -153
  281. package/dist/revisionhistory-ACRB23HL.js.map +1 -0
  282. package/dist/save-72ZLF6AO.js +120 -0
  283. package/dist/save-72ZLF6AO.js.map +1 -0
  284. package/dist/search-bar-HTZQNPD3.js +212 -0
  285. package/dist/search-bar-HTZQNPD3.js.map +1 -0
  286. package/dist/spellchecker-DJ7SP5JY.js +474 -0
  287. package/dist/spellchecker-DJ7SP5JY.js.map +1 -0
  288. package/dist/suggestions-panel-RJXC4LCM.js +596 -0
  289. package/dist/suggestions-panel-RJXC4LCM.js.map +1 -0
  290. package/dist/suggestions-ui-PODMNH7D.js +395 -0
  291. package/dist/suggestions-ui-PODMNH7D.js.map +1 -0
  292. package/dist/table-OBHE465Y.js +54 -0
  293. package/dist/table-OBHE465Y.js.map +1 -0
  294. package/dist/table-dialogs-UMIIZQYE.js +119 -0
  295. package/dist/table-dialogs-UMIIZQYE.js.map +1 -0
  296. package/dist/tableofcontents-ui-U2PYNPX6.js +167 -0
  297. package/dist/tableofcontents-ui-U2PYNPX6.js.map +1 -0
  298. package/dist/template-YYC2MGVH.js +278 -0
  299. package/dist/template-YYC2MGVH.js.map +1 -0
  300. package/dist/typography-EQUXUXIN.js +399 -0
  301. package/dist/typography-EQUXUXIN.js.map +1 -0
  302. package/dist/upload.cjs +160 -0
  303. package/dist/upload.cjs.map +1 -0
  304. package/dist/upload.d.cts +72 -0
  305. package/dist/upload.d.ts +72 -0
  306. package/dist/upload.js +132 -0
  307. package/dist/upload.js.map +1 -0
  308. package/dist/{visualblocks-6DLBXYOA.js → visualblocks-O5QW7ZDT.js} +7 -7
  309. package/dist/visualblocks-O5QW7ZDT.js.map +1 -0
  310. package/dist/visualchars-UQFRWQPE.js +134 -0
  311. package/dist/visualchars-UQFRWQPE.js.map +1 -0
  312. package/package.json +53 -3
  313. package/src/style.css +320 -544
  314. package/dist/advlist-5FNKPLUX.js.map +0 -1
  315. package/dist/autolink-45LTODWB.js.map +0 -1
  316. package/dist/autoresize-UB3GOA6D.js.map +0 -1
  317. package/dist/autosave-GMWJ5BPE.js.map +0 -1
  318. package/dist/charmap-2GC7LF7G.js.map +0 -1
  319. package/dist/chunk-5AW2HHG6.js.map +0 -1
  320. package/dist/chunk-DWZLSZDG.js +0 -5664
  321. package/dist/chunk-DWZLSZDG.js.map +0 -1
  322. package/dist/chunk-FCMZ7TUQ.js.map +0 -1
  323. package/dist/chunk-HPLT3XRZ.js.map +0 -1
  324. package/dist/chunk-JPJVTB45.js.map +0 -1
  325. package/dist/chunk-KPE3QRPB.js.map +0 -1
  326. package/dist/chunk-KWXFL4WS.js.map +0 -1
  327. package/dist/chunk-ND2CWNVG.js.map +0 -1
  328. package/dist/chunk-PVFKXRID.js.map +0 -1
  329. package/dist/chunk-R2UMUCVI.js.map +0 -1
  330. package/dist/chunk-T3GY6IVK.js.map +0 -1
  331. package/dist/chunk-Z3ELZ77W.js.map +0 -1
  332. package/dist/comments-panel-HXMWSRAW.js.map +0 -1
  333. package/dist/directionality-5JLWQGP2.js.map +0 -1
  334. package/dist/editor-CXkltf1R.d.ts +0 -1886
  335. package/dist/editor-CgSBFTke.d.cts +0 -1886
  336. package/dist/emoticons-ZD6ZRIWG.js.map +0 -1
  337. package/dist/form-dialog-QH6KAERD.js +0 -180
  338. package/dist/form-dialog-QH6KAERD.js.map +0 -1
  339. package/dist/html-rules-api-D3fKQi-R.d.cts +0 -40
  340. package/dist/html-rules-api-D3fKQi-R.d.ts +0 -40
  341. package/dist/insertdatetime-CRO7TJAQ.js.map +0 -1
  342. package/dist/nonbreaking-66LFZV2W.js.map +0 -1
  343. package/dist/paste-office-F3QW4WWO.js.map +0 -1
  344. package/dist/quickbars-7E2QRS7J.js.map +0 -1
  345. package/dist/revisionhistory-DXE7KU4R.js.map +0 -1
  346. package/dist/table-SSNABG5W.js.map +0 -1
  347. package/dist/visualblocks-6DLBXYOA.js.map +0 -1
@@ -0,0 +1,596 @@
1
+ import {
2
+ getComments
3
+ } from "./chunk-N32H37AJ.js";
4
+ import {
5
+ listSuggestions,
6
+ resolveSuggestions,
7
+ suggestionColor
8
+ } from "./chunk-P2UU2NLT.js";
9
+ import "./chunk-OQMMHWMZ.js";
10
+ import "./chunk-GXXXLPDQ.js";
11
+ import {
12
+ COMMENT_MAX_LENGTH,
13
+ newCommentId
14
+ } from "./chunk-AP2PJFLB.js";
15
+ import "./chunk-ADRPQLZ2.js";
16
+ import "./chunk-DEYYVZ7O.js";
17
+ import "./chunk-V7WUHUHM.js";
18
+ import {
19
+ activeElement,
20
+ h,
21
+ uniqueId
22
+ } from "./chunk-QU3KXMYT.js";
23
+
24
+ // src/plugins/suggestions-panel.ts
25
+ import { NodeSelection, Selection, TextSelection } from "prosemirror-state";
26
+
27
+ // nova-raw-css:/home/runner/work/novaprose/novaprose/packages/core/src/plugins/suggestions-panel.css?raw
28
+ var suggestions_panel_default = ".nova-sugg-panel{display:flex;flex-direction:column;gap:8px;font-size:13px}.nova-sugg-filter{display:flex;align-items:center;gap:8px;color:var(--nova-muted)}.nova-sugg-select{flex:1;min-width:0;height:30px}.nova-sugg-list{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.nova-sugg-empty{margin:8px 2px;color:var(--nova-muted);line-height:1.5}.nova-sugg-card{display:flex;flex-direction:column;gap:6px;padding:8px 10px;border:1px solid var(--nova-border);border-inline-start:3px solid color-mix(in srgb,var(--nova-suggestion, var(--nova-accent)),white var(--nova-suggestion-lift));border-radius:var(--nova-radius);background:var(--nova-surface)}.nova-sugg-card.is-active{border-color:color-mix(in srgb,var(--nova-suggestion, var(--nova-accent)),white var(--nova-suggestion-lift));box-shadow:var(--nova-shadow)}.nova-sugg-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px;color:var(--nova-muted);font-size:12px}.nova-sugg-dot{width:10px;height:10px;border-radius:999px;background:color-mix(in srgb,var(--nova-suggestion, var(--nova-accent)),white var(--nova-suggestion-lift))}.nova-sugg-author{color:var(--nova-fg);font-weight:600}.nova-sugg-summary{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 6px;padding:2px;border:0;border-radius:4px;background:none;color:var(--nova-fg);font:inherit;line-height:1.45;text-align:start;cursor:pointer}.nova-sugg-summary:hover{background:var(--nova-hover)}.nova-sugg-summary:focus-visible{outline:2px solid var(--nova-focus);outline-offset:1px}.nova-sugg-kind{color:var(--nova-muted)}.nova-sugg-text{overflow-wrap:anywhere;color:color-mix(in srgb,var(--nova-suggestion, var(--nova-accent)),white var(--nova-suggestion-lift))}ins.nova-sugg-text{text-decoration:underline 2px;text-underline-offset:3px}del.nova-sugg-text{text-decoration:line-through 2px}.nova-sugg-text.is-object{color:var(--nova-muted);font-style:italic}.nova-sugg-actions,.nova-sugg-bulk{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}.nova-sugg-card .nova-button{height:28px;padding:0 10px;font-size:12px}.nova-sugg-bulk{position:sticky;bottom:0;padding:8px 0 2px;background:var(--nova-toolbar-bg)}@media(pointer:coarse){.nova-sugg-card .nova-button{height:36px;padding:0 14px}}span.nova-sugg-text:not(.is-object){border-bottom:2px dotted currentColor}.nova-sugg-changes{flex-basis:100%;color:var(--nova-muted);font-size:12px}.nova-sugg-discussion{display:flex;flex-direction:column;gap:6px}.nova-sugg-replies{display:flex;flex-direction:column;gap:6px;margin:0;padding:0 0 0 8px;border-inline-start:2px solid var(--nova-border);list-style:none}.nova-sugg-reply-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px;color:var(--nova-muted);font-size:12px}.nova-sugg-reply-author{color:var(--nova-fg);font-weight:600}.nova-sugg-reply-text{margin:2px 0 0;overflow-wrap:anywhere;white-space:pre-wrap;line-height:1.45}.nova-sugg-reply-delete{margin-inline-start:auto;padding:2px 4px;border:0;border-radius:4px;background:none;color:var(--nova-muted);font:inherit;font-size:12px;cursor:pointer}.nova-sugg-reply-delete:hover{background:var(--nova-hover);color:var(--nova-fg)}.nova-sugg-reply-delete:focus-visible{outline:2px solid var(--nova-focus);outline-offset:1px}.nova-sugg-reply-open{align-self:flex-start}.nova-sugg-reply-box{display:flex;flex-direction:column;gap:6px}.nova-sugg-reply-input{box-sizing:border-box;width:100%;min-height:52px;resize:vertical;font:inherit}.nova-sugg-reply-actions{display:flex;justify-content:flex-end;gap:6px}";
29
+
30
+ // src/plugins/suggestions-panel.ts
31
+ var authorKey = (author) => author.id || author.name;
32
+ function suggestionCards(doc) {
33
+ const cards = [];
34
+ const byPart = /* @__PURE__ */ new Map();
35
+ for (const s of listSuggestions(doc)) {
36
+ const key = `${s.kind}:${s.id}`;
37
+ const known = byPart.get(key);
38
+ if (known) {
39
+ if (s.kind === "delete") known.removed += ` ${s.text}`;
40
+ else known.added += ` ${s.text}`;
41
+ if (known.nodes) known.nodes++;
42
+ if (known.marks) {
43
+ for (const name of s.added ?? [])
44
+ if (!known.marks.added.includes(name)) known.marks.added.push(name);
45
+ for (const name of s.removed ?? [])
46
+ if (!known.marks.removed.includes(name)) known.marks.removed.push(name);
47
+ }
48
+ known.to = Math.max(known.to, s.to);
49
+ continue;
50
+ }
51
+ const last = cards[cards.length - 1];
52
+ if (s.kind === "insert" && !s.node && !last?.node && last?.kind === "delete" && last.to === s.from && authorKey(last.author) === authorKey(s.author)) {
53
+ last.kind = "replace";
54
+ last.ids.push(s.id);
55
+ last.added = s.text;
56
+ last.to = s.to;
57
+ byPart.set(key, last);
58
+ continue;
59
+ }
60
+ const card = {
61
+ ids: [s.id],
62
+ kind: s.kind,
63
+ author: s.author,
64
+ time: s.time,
65
+ from: s.from,
66
+ to: s.to,
67
+ removed: s.kind === "delete" ? s.text : "",
68
+ added: s.kind === "delete" ? "" : s.text,
69
+ ...s.kind === "format" ? { marks: { added: [...s.added ?? []], removed: [...s.removed ?? []] } } : {},
70
+ ...s.kind === "block" ? { block: { before: s.before, after: blockNow(doc, s.from) } } : {},
71
+ ...s.node ? { node: s.node, nodes: 1 } : {},
72
+ ...s.depth ? { depth: s.depth } : {}
73
+ };
74
+ cards.push(card);
75
+ byPart.set(key, card);
76
+ }
77
+ return cards;
78
+ }
79
+ function blockNow(doc, pos) {
80
+ const node = doc.nodeAt(pos);
81
+ const attrs = {};
82
+ for (const [key, value] of Object.entries(node?.attrs ?? {})) {
83
+ if (key !== "suggestion" && (value === null || ["string", "number", "boolean"].includes(typeof value)))
84
+ attrs[key] = value;
85
+ }
86
+ return { type: node?.type.name ?? "", attrs };
87
+ }
88
+ var ALIGN_LABELS = {
89
+ left: "alignLeft",
90
+ center: "alignCenter",
91
+ right: "alignRight",
92
+ justify: "alignJustify"
93
+ };
94
+ var MARK_LABELS = {
95
+ bold: "bold",
96
+ italic: "italic",
97
+ underline: "underline",
98
+ strike: "strike",
99
+ code: "code",
100
+ subscript: "subscript",
101
+ superscript: "superscript",
102
+ link: "link",
103
+ color: "textColor",
104
+ background: "backgroundColor",
105
+ font_family: "fontFamily",
106
+ font_size: "fontSize",
107
+ span_class: "styles"
108
+ };
109
+ function excerpt(text, max = 140) {
110
+ const line = text.replace(/\s+/g, " ").trim();
111
+ return line.length > max ? `${line.slice(0, max - 1)}\u2026` : line;
112
+ }
113
+ function createSuggestionsPanel(editor, labels, canReview) {
114
+ editor.ui.addStyles("nova-suggestions-panel", suggestions_panel_default);
115
+ const lang = editor.options.language ?? "en";
116
+ const relative = new Intl.RelativeTimeFormat(lang, { numeric: "auto" });
117
+ const absolute = new Intl.DateTimeFormat(lang, { dateStyle: "medium", timeStyle: "short" });
118
+ const selectId = uniqueId("nova-sugg-author");
119
+ let shownAuthor = "";
120
+ const names = /* @__PURE__ */ new Map();
121
+ let cards = [];
122
+ const comments = getComments(editor);
123
+ const drafts = /* @__PURE__ */ new Map();
124
+ const offThreads = comments?.store.subscribe(() => render()) ?? (() => {
125
+ });
126
+ const select = h("select", { className: "nova-input nova-sugg-select", id: selectId });
127
+ select.addEventListener("change", () => {
128
+ shownAuthor = select.value;
129
+ render();
130
+ });
131
+ const list = h("ul", { className: "nova-sugg-list" });
132
+ const empty = h("p", { className: "nova-sugg-empty", hidden: true });
133
+ const acceptShown = h(
134
+ "button",
135
+ { type: "button", className: "nova-button", onClick: () => resolveShown("accept") },
136
+ labels.acceptShown
137
+ );
138
+ const rejectShown = h(
139
+ "button",
140
+ { type: "button", className: "nova-button", onClick: () => resolveShown("reject") },
141
+ labels.rejectShown
142
+ );
143
+ const el = h(
144
+ "div",
145
+ { className: "nova-sugg-panel" },
146
+ h(
147
+ "div",
148
+ { className: "nova-sugg-filter" },
149
+ h("label", { for: selectId }, labels.author),
150
+ select
151
+ ),
152
+ list,
153
+ empty,
154
+ canReview ? h("div", { className: "nova-sugg-bulk" }, acceptShown, rejectShown) : null
155
+ );
156
+ const nameOf = (author) => author.name || labels.guest;
157
+ const shown = () => shownAuthor ? cards.filter((card) => authorKey(card.author) === shownAuthor) : cards;
158
+ function when(time) {
159
+ if (!time) return null;
160
+ const seconds = Math.round((time - Date.now()) / 1e3);
161
+ const abs = Math.abs(seconds);
162
+ const text = abs < 45 ? relative.format(0, "second") : abs < 3600 ? relative.format(Math.round(seconds / 60), "minute") : abs < 86400 ? relative.format(Math.round(seconds / 3600), "hour") : abs < 86400 * 7 ? relative.format(Math.round(seconds / 86400), "day") : absolute.format(time);
163
+ return h(
164
+ "time",
165
+ { dateTime: new Date(time).toISOString(), title: absolute.format(time) },
166
+ text
167
+ );
168
+ }
169
+ function resolve(action, ids, count) {
170
+ if (!ids.length || !editor.isEditable()) return;
171
+ editor.view.dispatch(resolveSuggestions(editor.view.state, action, ids));
172
+ editor.ui.announce(
173
+ (action === "accept" ? labels.acceptedCount : labels.rejectedCount).replace(
174
+ "{count}",
175
+ String(count)
176
+ )
177
+ );
178
+ }
179
+ function resolveShown(action) {
180
+ const chosen = shown();
181
+ resolve(
182
+ action,
183
+ chosen.flatMap((card) => card.ids),
184
+ chosen.length
185
+ );
186
+ }
187
+ function goTo(card) {
188
+ const { state } = editor.view;
189
+ const to = Math.min(card.to, state.doc.content.size);
190
+ try {
191
+ const node = card.node ? state.doc.nodeAt(card.from) : null;
192
+ const selection = !card.node ? TextSelection.create(state.doc, card.from, to) : node?.isLeaf && NodeSelection.isSelectable(node) ? NodeSelection.create(state.doc, card.from) : Selection.near(state.doc.resolve(Math.min(card.from + 1, state.doc.content.size)));
193
+ editor.view.dispatch(state.tr.setSelection(selection).scrollIntoView());
194
+ } catch {
195
+ }
196
+ }
197
+ function blockName(block, count = 1) {
198
+ switch (block.type) {
199
+ case "paragraph":
200
+ return editor.ui.t("paragraph");
201
+ case "code_block":
202
+ return editor.ui.t("codeBlock");
203
+ case "heading": {
204
+ const level = Math.min(6, Math.max(1, Math.trunc(Number(block.attrs.level)) || 1));
205
+ return editor.ui.t(`h${level}`);
206
+ }
207
+ case "bullet_list":
208
+ return editor.ui.t("bulletList");
209
+ case "ordered_list":
210
+ return editor.ui.t("orderedList");
211
+ case "list_item":
212
+ return labels.nodeListItem;
213
+ case "blockquote":
214
+ return editor.ui.t("blockquote");
215
+ case "horizontal_rule":
216
+ return editor.ui.t("horizontalRule");
217
+ case "table":
218
+ return labels.nodeTable;
219
+ case "table_row":
220
+ return labels.nodeRow;
221
+ case "table_cell":
222
+ case "table_header":
223
+ return count > 1 ? labels.nodeColumn : labels.nodeCell;
224
+ case "image":
225
+ case "figure":
226
+ case "figure_image":
227
+ return labels.nodeImage;
228
+ default:
229
+ return labels.nonText;
230
+ }
231
+ }
232
+ function structureChange(card) {
233
+ const times = (card.depth ?? 1) > 1 ? ` \xD7${card.depth}` : "";
234
+ const sign = card.kind === "wrap" ? "+" : "\u2212";
235
+ const { doc } = editor.view.state;
236
+ if (card.node !== "list_item" || card.from > doc.content.size)
237
+ return `${sign}${blockName({ type: card.node ?? "", attrs: {} })}${times}`;
238
+ const $pos = doc.resolve(card.from);
239
+ if ($pos.depth >= 2 && $pos.node($pos.depth - 1).type.name === "list_item")
240
+ return `${editor.ui.t(card.kind === "wrap" ? "indent" : "outdent")}${times}`;
241
+ return `${sign}${blockName({ type: $pos.parent.type.name, attrs: {} })}${times}`;
242
+ }
243
+ function blockChanges({ before, after }) {
244
+ const out = [];
245
+ const value = (block, key) => block.attrs[key] ?? editor.view.state.schema.nodes[block.type]?.spec.attrs?.[key]?.default ?? null;
246
+ const differs = (key) => value(before, key) !== value(after, key);
247
+ if (before.type !== after.type || differs("level"))
248
+ out.push(`${blockName(before)} \u2192 ${blockName(after)}`);
249
+ if (differs("align"))
250
+ out.push(editor.ui.t(ALIGN_LABELS[String(after.attrs.align)] ?? "alignLeft"));
251
+ if (differs("indent"))
252
+ out.push(
253
+ editor.ui.t(
254
+ Number(after.attrs.indent) > Number(before.attrs.indent) ? "indent" : "outdent"
255
+ )
256
+ );
257
+ if (differs("lineHeight"))
258
+ out.push(`${editor.ui.t("lineHeight")}: ${after.attrs.lineHeight ?? editor.ui.t("default")}`);
259
+ if (differs("dir")) out.push(after.attrs.dir === "rtl" ? "RTL" : "LTR");
260
+ return out.length ? out : [blockName(after)];
261
+ }
262
+ function cardElement(card, active) {
263
+ const key = card.ids[0];
264
+ const summaryId = uniqueId("nova-sugg-summary");
265
+ const kind = {
266
+ insert: labels.kindInsert,
267
+ delete: labels.kindDelete,
268
+ replace: labels.kindReplace,
269
+ format: labels.kindFormat,
270
+ block: labels.kindFormat,
271
+ split: labels.kindSplit,
272
+ join: labels.kindJoin,
273
+ wrap: labels.kindFormat,
274
+ unwrap: labels.kindFormat
275
+ }[card.kind];
276
+ const text = (value, tag) => value.trim() ? h(tag, { className: "nova-sugg-text" }, excerpt(value)) : h("span", { className: "nova-sugg-text is-object" }, labels.nonText);
277
+ const markName = (name) => MARK_LABELS[name] ? editor.ui.t(MARK_LABELS[name]) : name;
278
+ const changes = card.marks ? h(
279
+ "span",
280
+ { className: "nova-sugg-changes" },
281
+ [
282
+ ...card.marks.added.map((name) => `+${markName(name)}`),
283
+ ...card.marks.removed.map((name) => `\u2212${markName(name)}`)
284
+ ].join(" ")
285
+ ) : card.block ? h("span", { className: "nova-sugg-changes" }, blockChanges(card.block).join(" \xB7 ")) : card.kind === "wrap" || card.kind === "unwrap" ? h("span", { className: "nova-sugg-changes" }, structureChange(card)) : card.node && (card.kind === "insert" || card.kind === "delete") ? h(
286
+ "span",
287
+ { className: "nova-sugg-changes" },
288
+ blockName({ type: card.node, attrs: {} }, card.nodes)
289
+ ) : null;
290
+ const nodeText = (value, tag) => card.node && !value.trim() ? null : text(value, tag);
291
+ const summary = h(
292
+ "button",
293
+ {
294
+ type: "button",
295
+ id: summaryId,
296
+ className: "nova-sugg-summary",
297
+ "data-key": key,
298
+ "data-action": "go",
299
+ onClick: () => goTo(card)
300
+ },
301
+ h("span", { className: "nova-sugg-kind" }, kind),
302
+ card.kind === "delete" || card.kind === "replace" ? nodeText(card.removed, "del") : null,
303
+ card.kind === "insert" || card.kind === "replace" ? nodeText(card.added, "ins") : null,
304
+ card.kind === "format" || card.kind === "block" || card.kind === "split" || card.kind === "join" || card.kind === "wrap" || card.kind === "unwrap" ? text(card.added, "span") : null,
305
+ changes
306
+ );
307
+ const editable = editor.isEditable();
308
+ const action = (name) => h(
309
+ "button",
310
+ {
311
+ type: "button",
312
+ className: `nova-button nova-sugg-${name}`,
313
+ "data-key": key,
314
+ "data-action": name,
315
+ "aria-describedby": summaryId,
316
+ disabled: !editable,
317
+ onClick: () => resolve(name, card.ids, 1)
318
+ },
319
+ name === "accept" ? labels.accept : labels.reject
320
+ );
321
+ const item = h(
322
+ "li",
323
+ {
324
+ className: `nova-sugg-card${active ? " is-active" : ""}`,
325
+ "aria-current": active ? "true" : null
326
+ },
327
+ h(
328
+ "div",
329
+ { className: "nova-sugg-head" },
330
+ h("span", { className: "nova-sugg-dot", "aria-hidden": "true" }),
331
+ h("span", { className: "nova-sugg-author" }, nameOf(card.author)),
332
+ when(card.time)
333
+ ),
334
+ summary,
335
+ discussion(card, key, summaryId),
336
+ canReview ? h("div", { className: "nova-sugg-actions" }, action("accept"), action("reject")) : null
337
+ );
338
+ item.style.setProperty("--nova-suggestion", suggestionColor(authorKey(card.author)));
339
+ return item;
340
+ }
341
+ function threadOf(card) {
342
+ return comments?.store.threads().find((thread) => thread.suggestion !== void 0 && card.ids.includes(thread.suggestion));
343
+ }
344
+ function focusControl(key, action) {
345
+ [...list.querySelectorAll("[data-action]")].find((el2) => el2.getAttribute("data-key") === key && el2.dataset.action === action)?.focus();
346
+ }
347
+ function discussion(card, key, summaryId) {
348
+ const c = comments;
349
+ if (!c) return null;
350
+ const thread = threadOf(card);
351
+ const replies = thread?.comments ?? [];
352
+ const replyList = replies.length ? h(
353
+ "ul",
354
+ { className: "nova-sugg-replies" },
355
+ ...replies.map((comment) => {
356
+ const textId = uniqueId("nova-sugg-reply");
357
+ return h(
358
+ "li",
359
+ { className: "nova-sugg-reply" },
360
+ h(
361
+ "div",
362
+ { className: "nova-sugg-reply-head" },
363
+ h(
364
+ "span",
365
+ { className: "nova-sugg-reply-author" },
366
+ comment.author.name || labels.guest
367
+ ),
368
+ when(comment.createdAt),
369
+ thread && c.canEdit(comment) ? h(
370
+ "button",
371
+ {
372
+ type: "button",
373
+ className: "nova-sugg-reply-delete",
374
+ "data-key": key + ":" + comment.id,
375
+ "data-action": "delete-reply",
376
+ "aria-describedby": textId,
377
+ onClick: () => {
378
+ if (thread.comments.length > 1)
379
+ c.store.deleteComment(thread.id, comment.id);
380
+ else c.store.deleteThread(thread.id);
381
+ focusControl(key, "reply");
382
+ }
383
+ },
384
+ c.labels.remove
385
+ ) : null
386
+ ),
387
+ h("p", { className: "nova-sugg-reply-text", id: textId }, comment.text)
388
+ );
389
+ })
390
+ ) : null;
391
+ const label = thread ? c.labels.reply : c.labels.comment;
392
+ const draft = drafts.get(key);
393
+ if (!draft) {
394
+ return h(
395
+ "div",
396
+ { className: "nova-sugg-discussion" },
397
+ replyList,
398
+ h(
399
+ "button",
400
+ {
401
+ type: "button",
402
+ className: "nova-button nova-sugg-reply-open",
403
+ "data-key": key,
404
+ "data-action": "reply",
405
+ "aria-describedby": summaryId,
406
+ onClick: () => {
407
+ drafts.set(key, { text: "", start: 0, end: 0 });
408
+ render();
409
+ focusControl(key, "draft");
410
+ }
411
+ },
412
+ label
413
+ )
414
+ );
415
+ }
416
+ const placeholder = thread ? c.labels.replyPlaceholder : c.labels.placeholder;
417
+ const input = h("textarea", {
418
+ className: "nova-input nova-sugg-reply-input",
419
+ rows: 2,
420
+ maxLength: COMMENT_MAX_LENGTH,
421
+ placeholder,
422
+ "aria-label": placeholder,
423
+ "aria-describedby": summaryId,
424
+ "data-key": key,
425
+ "data-action": "draft"
426
+ });
427
+ input.value = draft.text;
428
+ const remember = () => drafts.set(key, { text: input.value, start: input.selectionStart, end: input.selectionEnd });
429
+ input.addEventListener("input", remember);
430
+ input.addEventListener("select", remember);
431
+ input.addEventListener("keyup", remember);
432
+ const cancel = () => {
433
+ drafts.delete(key);
434
+ render();
435
+ focusControl(key, "reply");
436
+ };
437
+ const send = () => {
438
+ const text = input.value.trim().slice(0, COMMENT_MAX_LENGTH);
439
+ if (!text) return input.focus();
440
+ drafts.delete(key);
441
+ const current = threadOf(card);
442
+ if (current) c.reply(current.id, text);
443
+ else {
444
+ const now = Date.now();
445
+ c.store.createThread({
446
+ id: newCommentId("t"),
447
+ createdAt: now,
448
+ resolved: null,
449
+ suggestion: key,
450
+ comments: [{ id: newCommentId(), author: c.author, text, createdAt: now }]
451
+ });
452
+ }
453
+ render();
454
+ focusControl(key, "reply");
455
+ };
456
+ input.addEventListener("keydown", (event) => {
457
+ if (event.key === "Enter" && (event.ctrlKey || event.metaKey)) {
458
+ event.preventDefault();
459
+ send();
460
+ } else if (event.key === "Escape") {
461
+ event.preventDefault();
462
+ event.stopPropagation();
463
+ cancel();
464
+ }
465
+ });
466
+ return h(
467
+ "div",
468
+ { className: "nova-sugg-discussion" },
469
+ replyList,
470
+ h(
471
+ "div",
472
+ { className: "nova-sugg-reply-box" },
473
+ input,
474
+ h(
475
+ "div",
476
+ { className: "nova-sugg-reply-actions" },
477
+ h(
478
+ "button",
479
+ {
480
+ type: "button",
481
+ className: "nova-button",
482
+ "data-key": key,
483
+ "data-action": "cancel",
484
+ onClick: cancel
485
+ },
486
+ c.labels.cancel
487
+ ),
488
+ h(
489
+ "button",
490
+ {
491
+ type: "button",
492
+ className: "nova-button nova-button-primary",
493
+ "data-key": key,
494
+ "data-action": "send",
495
+ onClick: send
496
+ },
497
+ label
498
+ )
499
+ )
500
+ )
501
+ );
502
+ }
503
+ function renderFilter() {
504
+ const counts = /* @__PURE__ */ new Map();
505
+ for (const card of cards) {
506
+ const key = authorKey(card.author);
507
+ const entry = counts.get(key) ?? { name: nameOf(card.author), count: 0 };
508
+ entry.count++;
509
+ counts.set(key, entry);
510
+ names.set(key, entry.name);
511
+ }
512
+ if (shownAuthor && !counts.has(shownAuthor)) {
513
+ counts.set(shownAuthor, { name: names.get(shownAuthor) ?? "", count: 0 });
514
+ }
515
+ const options = [
516
+ h("option", { value: "" }, labels.allAuthors.replace("{count}", String(cards.length))),
517
+ ...[...counts].map(
518
+ ([key, { name, count }]) => h(
519
+ "option",
520
+ { value: key },
521
+ labels.authorCount.replace("{name}", name).replace("{count}", String(count))
522
+ )
523
+ )
524
+ ];
525
+ select.replaceChildren(...options);
526
+ select.value = shownAuthor;
527
+ }
528
+ function render() {
529
+ const focused = activeElement(el);
530
+ const focusKey = focused && el.contains(focused) ? focused.getAttribute("data-key") : null;
531
+ const focusAction = focused?.getAttribute("data-action") ?? null;
532
+ const oldKeys = [...list.querySelectorAll('[data-action="go"]')].map(
533
+ (b) => b.getAttribute("data-key")
534
+ );
535
+ cards = suggestionCards(editor.view.state.doc);
536
+ renderFilter();
537
+ const visible = shown();
538
+ const { from, to } = editor.view.state.selection;
539
+ list.replaceChildren(
540
+ ...visible.map(
541
+ (card) => cardElement(card, from <= card.to && to >= card.from && (from < card.to || to > card.from))
542
+ )
543
+ );
544
+ empty.hidden = visible.length > 0;
545
+ empty.textContent = shownAuthor ? labels.noneFrom.replace("{name}", names.get(shownAuthor) ?? "") : labels.none;
546
+ const editable = editor.isEditable();
547
+ acceptShown.disabled = rejectShown.disabled = !visible.length || !editable;
548
+ if ((focused === acceptShown || focused === rejectShown) && acceptShown.disabled) {
549
+ select.focus();
550
+ }
551
+ if (focusKey) {
552
+ const same = [...list.querySelectorAll("[data-action]")].find(
553
+ (b) => b.getAttribute("data-key") === focusKey && b.dataset.action === focusAction
554
+ );
555
+ if (same && !same.disabled) {
556
+ same.focus();
557
+ const draft = focusAction === "draft" ? drafts.get(focusKey) : void 0;
558
+ if (draft) same.setSelectionRange(draft.start, draft.end);
559
+ } else {
560
+ const index = oldKeys.indexOf(focusKey);
561
+ const buttons = [...list.querySelectorAll('[data-action="go"]')];
562
+ const next = buttons[Math.min(Math.max(index, 0), buttons.length - 1)];
563
+ if (next) next.focus();
564
+ else select.focus();
565
+ }
566
+ }
567
+ }
568
+ const offChange = editor.on("change", () => render());
569
+ const offSelection = editor.on("selectionChange", () => {
570
+ const { from, to } = editor.view.state.selection;
571
+ list.querySelectorAll(".nova-sugg-card").forEach((item, index) => {
572
+ const card = shown()[index];
573
+ const active = !!card && from <= card.to && to >= card.from && (from < card.to || to > card.from);
574
+ item.classList.toggle("is-active", active);
575
+ if (active) item.setAttribute("aria-current", "true");
576
+ else item.removeAttribute("aria-current");
577
+ });
578
+ });
579
+ const offEditable = editor.on("editableChange", () => render());
580
+ return {
581
+ el,
582
+ render,
583
+ destroy() {
584
+ offChange();
585
+ offSelection();
586
+ offEditable();
587
+ offThreads();
588
+ }
589
+ };
590
+ }
591
+ export {
592
+ authorKey,
593
+ createSuggestionsPanel,
594
+ suggestionCards
595
+ };
596
+ //# sourceMappingURL=suggestions-panel-RJXC4LCM.js.map