@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,158 @@
1
+ import {
2
+ definePlugin
3
+ } from "./chunk-V7WUHUHM.js";
4
+
5
+ // src/plugins/footnotes.ts
6
+ import { Plugin, PluginKey } from "prosemirror-state";
7
+
8
+ // nova-raw-css:/home/runner/work/novaprose/novaprose/packages/core/src/plugins/footnotes.css?raw
9
+ var footnotes_default = ".nova-prosemirror sup.mce-footnote a{text-decoration:none}.nova-prosemirror .mce-footnotes{margin-top:2em;font-size:.9em}.nova-prosemirror .mce-footnotes hr{width:30%;margin:0 0 .5em;border:0;border-top:1px solid var(--nova-border)}.nova-prosemirror .mce-footnotes-backlink{margin-inline-end:.35em;text-decoration:none;cursor:pointer;user-select:none}@media print{.nova-prosemirror .mce-footnotes{break-inside:avoid}.nova-prosemirror .mce-footnotes-backlink{display:none}}";
10
+
11
+ // src/plugins/footnotes.ts
12
+ function footnoteId(value) {
13
+ const id = typeof value === "string" || typeof value === "number" ? String(value) : "";
14
+ return /^[\w-]{1,64}$/.test(id) ? id : "";
15
+ }
16
+ function footnoteNumber(value) {
17
+ const number = Math.trunc(Number(value));
18
+ return Number.isFinite(number) && number > 0 ? number : 1;
19
+ }
20
+ var idAfter = (value, prefix) => value?.startsWith(prefix) ? footnoteId(value.slice(prefix.length)) : "";
21
+ var footnoteNodes = {
22
+ footnote_ref: {
23
+ inline: true,
24
+ group: "inline",
25
+ atom: true,
26
+ selectable: true,
27
+ draggable: true,
28
+ attrs: { id: { default: "" }, number: { default: 1 } },
29
+ parseDOM: [
30
+ {
31
+ tag: "sup.mce-footnote",
32
+ priority: 60,
33
+ getAttrs: (dom) => {
34
+ const link = dom.querySelector("a");
35
+ const id = idAfter(link?.getAttribute("href"), "#footnote-") || idAfter(link?.getAttribute("id"), "footnote-ref-");
36
+ return { id, number: footnoteNumber((link ?? dom).textContent) };
37
+ }
38
+ }
39
+ ],
40
+ toDOM: (node) => {
41
+ const id = footnoteId(node.attrs.id);
42
+ return [
43
+ "sup",
44
+ { class: "mce-footnote" },
45
+ [
46
+ "a",
47
+ { href: `#footnote-${id}`, id: `footnote-ref-${id}`, role: "doc-noteref" },
48
+ String(footnoteNumber(node.attrs.number))
49
+ ]
50
+ ];
51
+ },
52
+ leafText: (node) => `[${footnoteNumber(node.attrs.number)}]`
53
+ },
54
+ footnotes: {
55
+ group: "block",
56
+ content: "footnote+",
57
+ isolating: true,
58
+ // Delete at the end of the text before it must not select (and then delete) every note at once.
59
+ selectable: false,
60
+ parseDOM: [
61
+ {
62
+ tag: "div.mce-footnotes",
63
+ priority: 60,
64
+ contentElement: (dom) => dom.querySelector("ol, ul") ?? dom
65
+ }
66
+ ],
67
+ toDOM: () => [
68
+ "div",
69
+ { class: "mce-footnotes", role: "doc-endnotes" },
70
+ ["hr"],
71
+ ["ol", 0]
72
+ ]
73
+ },
74
+ footnote: {
75
+ content: "inline*",
76
+ defining: true,
77
+ attrs: { id: { default: "" } },
78
+ parseDOM: [
79
+ // The back link is drawn from the note's id, not read as text.
80
+ { tag: "a.mce-footnotes-backlink", priority: 60, ignore: true },
81
+ {
82
+ tag: "li",
83
+ context: "footnotes/",
84
+ priority: 60,
85
+ getAttrs: (dom) => ({ id: idAfter(dom.getAttribute("id"), "footnote-") })
86
+ }
87
+ ],
88
+ toDOM: (node) => {
89
+ const id = footnoteId(node.attrs.id);
90
+ return [
91
+ "li",
92
+ { id: `footnote-${id}` },
93
+ [
94
+ "a",
95
+ { class: "mce-footnotes-backlink", href: `#footnote-ref-${id}`, role: "doc-backlink" },
96
+ "^"
97
+ ],
98
+ ["span", { class: "mce-footnote-text" }, 0]
99
+ ];
100
+ }
101
+ }
102
+ };
103
+ var FootnotesView = class {
104
+ dom;
105
+ contentDOM;
106
+ constructor() {
107
+ this.dom = document.createElement("div");
108
+ this.dom.className = "mce-footnotes";
109
+ this.dom.setAttribute("role", "doc-endnotes");
110
+ const hr = document.createElement("hr");
111
+ hr.contentEditable = "false";
112
+ this.contentDOM = document.createElement("ol");
113
+ this.dom.append(hr, this.contentDOM);
114
+ }
115
+ };
116
+ var FootnoteView = class {
117
+ dom;
118
+ contentDOM;
119
+ constructor(node) {
120
+ const id = footnoteId(node.attrs.id);
121
+ this.dom = document.createElement("li");
122
+ this.dom.id = `footnote-${id}`;
123
+ const back = document.createElement("a");
124
+ back.className = "mce-footnotes-backlink";
125
+ back.href = `#footnote-ref-${id}`;
126
+ back.setAttribute("role", "doc-backlink");
127
+ back.contentEditable = "false";
128
+ back.textContent = "^";
129
+ this.contentDOM = document.createElement("span");
130
+ this.contentDOM.className = "mce-footnote-text";
131
+ this.dom.append(back, this.contentDOM);
132
+ }
133
+ };
134
+ var footnotes_default2 = definePlugin({
135
+ name: "footnotes",
136
+ nodes: footnoteNodes,
137
+ prosemirrorPlugins: () => [
138
+ new Plugin({
139
+ key: new PluginKey("nova-footnotes-view"),
140
+ props: {
141
+ nodeViews: {
142
+ footnotes: () => new FootnotesView(),
143
+ footnote: (node) => new FootnoteView(node)
144
+ }
145
+ }
146
+ })
147
+ ],
148
+ setup(editor) {
149
+ editor.ui.addStyles("nova-footnotes", footnotes_default);
150
+ },
151
+ load: () => import("./footnotes-ui-FV6QRGDA.js")
152
+ });
153
+
154
+ export {
155
+ footnoteId,
156
+ footnotes_default2 as footnotes_default
157
+ };
158
+ //# sourceMappingURL=chunk-T3IRLTKK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugins/footnotes.ts","nova-raw-css:/home/runner/work/novaprose/novaprose/packages/core/src/plugins/footnotes.css?raw"],"sourcesContent":["import type { DOMOutputSpec, Node as PMNode, NodeSpec } from 'prosemirror-model';\nimport { Plugin, PluginKey } from 'prosemirror-state';\nimport type { NodeView } from 'prosemirror-view';\nimport { definePlugin } from '../plugins';\nimport css from './footnotes.css?raw';\n\n/**\n * The footnotes plugin (named as in TinyMCE): a numbered reference in the text, the notes in one\n * section at the end of the document. The HTML uses TinyMCE's classes, so footnotes written there load\n * as they are:\n *\n * <sup class=\"mce-footnote\"><a href=\"#footnote-ID\" id=\"footnote-ref-ID\" role=\"doc-noteref\">1</a></sup>\n * <div class=\"mce-footnotes\" role=\"doc-endnotes\"><hr><ol>\n * <li id=\"footnote-ID\"><a class=\"mce-footnotes-backlink\" href=\"#footnote-ref-ID\"\n * role=\"doc-backlink\">^</a><span class=\"mce-footnote-text\">The note</span></li>\n * </ol></div>\n *\n * This part is the schema and how the document is drawn (first load). Inserting, numbering and keeping\n * references and notes in step are in footnotes-ui.ts.\n */\n\n/** A footnote id: letters, digits, `-` and `_`. Anything else from HTML or JSON becomes empty. */\nexport function footnoteId(value: unknown): string {\n const id = typeof value === 'string' || typeof value === 'number' ? String(value) : '';\n return /^[\\w-]{1,64}$/.test(id) ? id : '';\n}\n\n/** A footnote number: a whole number from 1. */\nexport function footnoteNumber(value: unknown): number {\n const number = Math.trunc(Number(value));\n return Number.isFinite(number) && number > 0 ? number : 1;\n}\n\n/** The id at the end of `#footnote-ID` or `footnote-ref-ID`. */\nconst idAfter = (value: string | null | undefined, prefix: string) =>\n value?.startsWith(prefix) ? footnoteId(value.slice(prefix.length)) : '';\n\nexport const footnoteNodes: Record<string, NodeSpec> = {\n footnote_ref: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n draggable: true,\n attrs: { id: { default: '' }, number: { default: 1 } },\n parseDOM: [\n {\n tag: 'sup.mce-footnote',\n priority: 60,\n getAttrs: (dom) => {\n const link = (dom as HTMLElement).querySelector('a');\n const id =\n idAfter(link?.getAttribute('href'), '#footnote-') ||\n idAfter(link?.getAttribute('id'), 'footnote-ref-');\n return { id, number: footnoteNumber((link ?? dom).textContent) };\n },\n },\n ],\n toDOM: (node): DOMOutputSpec => {\n const id = footnoteId(node.attrs.id);\n return [\n 'sup',\n { class: 'mce-footnote' },\n [\n 'a',\n { href: `#footnote-${id}`, id: `footnote-ref-${id}`, role: 'doc-noteref' },\n String(footnoteNumber(node.attrs.number)),\n ],\n ];\n },\n leafText: (node) => `[${footnoteNumber(node.attrs.number)}]`,\n },\n footnotes: {\n group: 'block',\n content: 'footnote+',\n isolating: true,\n // Delete at the end of the text before it must not select (and then delete) every note at once.\n selectable: false,\n parseDOM: [\n {\n tag: 'div.mce-footnotes',\n priority: 60,\n contentElement: (dom) =>\n (dom as HTMLElement).querySelector('ol, ul') ?? (dom as HTMLElement),\n },\n ],\n toDOM: (): DOMOutputSpec => [\n 'div',\n { class: 'mce-footnotes', role: 'doc-endnotes' },\n ['hr'],\n ['ol', 0],\n ],\n },\n footnote: {\n content: 'inline*',\n defining: true,\n attrs: { id: { default: '' } },\n parseDOM: [\n // The back link is drawn from the note's id, not read as text.\n { tag: 'a.mce-footnotes-backlink', priority: 60, ignore: true },\n {\n tag: 'li',\n context: 'footnotes/',\n priority: 60,\n getAttrs: (dom) => ({ id: idAfter((dom as HTMLElement).getAttribute('id'), 'footnote-') }),\n },\n ],\n toDOM: (node): DOMOutputSpec => {\n const id = footnoteId(node.attrs.id);\n return [\n 'li',\n { id: `footnote-${id}` },\n [\n 'a',\n { class: 'mce-footnotes-backlink', href: `#footnote-ref-${id}`, role: 'doc-backlink' },\n '^',\n ],\n ['span', { class: 'mce-footnote-text' }, 0],\n ];\n },\n },\n};\n\n/** In the editor the back link and the divider are not text you can type into. */\nclass FootnotesView implements NodeView {\n dom: HTMLElement;\n contentDOM: HTMLElement;\n constructor() {\n this.dom = document.createElement('div');\n this.dom.className = 'mce-footnotes';\n this.dom.setAttribute('role', 'doc-endnotes');\n const hr = document.createElement('hr');\n hr.contentEditable = 'false';\n this.contentDOM = document.createElement('ol');\n this.dom.append(hr, this.contentDOM);\n }\n}\n\nclass FootnoteView implements NodeView {\n dom: HTMLElement;\n contentDOM: HTMLElement;\n constructor(node: PMNode) {\n const id = footnoteId(node.attrs.id);\n this.dom = document.createElement('li');\n this.dom.id = `footnote-${id}`;\n const back = document.createElement('a');\n back.className = 'mce-footnotes-backlink';\n back.href = `#footnote-ref-${id}`;\n back.setAttribute('role', 'doc-backlink');\n back.contentEditable = 'false';\n back.textContent = '^';\n this.contentDOM = document.createElement('span');\n this.contentDOM.className = 'mce-footnote-text';\n this.dom.append(back, this.contentDOM);\n }\n}\n\nexport default definePlugin({\n name: 'footnotes',\n nodes: footnoteNodes,\n prosemirrorPlugins: () => [\n new Plugin({\n key: new PluginKey('nova-footnotes-view'),\n props: {\n nodeViews: {\n footnotes: () => new FootnotesView(),\n footnote: (node) => new FootnoteView(node),\n },\n },\n }),\n ],\n setup(editor) {\n editor.ui.addStyles('nova-footnotes', css);\n },\n load: () => import('./footnotes-ui'),\n});\n",".nova-prosemirror sup.mce-footnote a{text-decoration:none}.nova-prosemirror .mce-footnotes{margin-top:2em;font-size:.9em}.nova-prosemirror .mce-footnotes hr{width:30%;margin:0 0 .5em;border:0;border-top:1px solid var(--nova-border)}.nova-prosemirror .mce-footnotes-backlink{margin-inline-end:.35em;text-decoration:none;cursor:pointer;user-select:none}@media print{.nova-prosemirror .mce-footnotes{break-inside:avoid}.nova-prosemirror .mce-footnotes-backlink{display:none}}"],"mappings":"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","names":["footnotes_default"]}
@@ -0,0 +1,66 @@
1
+ import {
2
+ pickLabels
3
+ } from "./chunk-DEYYVZ7O.js";
4
+ import {
5
+ definePlugin
6
+ } from "./chunk-V7WUHUHM.js";
7
+ import {
8
+ h
9
+ } from "./chunk-QU3KXMYT.js";
10
+
11
+ // src/plugins/exportword.ts
12
+ var LABELS = {
13
+ en: { export: "Export to Word", failed: "Could not create the Word file" }
14
+ };
15
+ var WORD_ICON = (arrow) => `<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="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/>${arrow}</svg>`;
16
+ var icon = WORD_ICON('<path d="M12 18v-6"/><path d="m9 15 3-3 3 3"/>');
17
+ function download(bytes, filename, type) {
18
+ const url = URL.createObjectURL(new Blob([bytes], { type }));
19
+ const link = h("a", { href: url, download: filename });
20
+ link.style.display = "none";
21
+ document.body.append(link);
22
+ link.click();
23
+ link.remove();
24
+ setTimeout(() => URL.revokeObjectURL(url), 6e4);
25
+ }
26
+ var exportword_default = definePlugin({
27
+ name: "exportword",
28
+ toolbar: "exportword",
29
+ setup(editor) {
30
+ const labels = pickLabels(editor, "exportword", LABELS);
31
+ const options = editor.options.pluginOptions?.exportword ?? {};
32
+ const run = async () => {
33
+ try {
34
+ const { exportDocx } = await import("./docx.js");
35
+ const bytes = await exportDocx(editor, { font: options.font, fontSize: options.fontSize });
36
+ const name = (options.filename || "document.docx").replace(/[\\/:*?"<>|]/g, "_");
37
+ download(
38
+ bytes,
39
+ name.toLowerCase().endsWith(".docx") ? name : `${name}.docx`,
40
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
41
+ );
42
+ } catch (error) {
43
+ console.error("[nova] exportword:", error);
44
+ editor.ui.notify({ text: labels.failed, type: "error" });
45
+ }
46
+ };
47
+ editor.ui.registry.addButton("exportword", {
48
+ icon,
49
+ tooltip: labels.export,
50
+ onAction: () => void run()
51
+ });
52
+ editor.ui.registry.addMenuItem("exportword", {
53
+ icon,
54
+ text: labels.export,
55
+ onAction: () => void run()
56
+ });
57
+ }
58
+ });
59
+
60
+ export {
61
+ LABELS,
62
+ WORD_ICON,
63
+ download,
64
+ exportword_default
65
+ };
66
+ //# sourceMappingURL=chunk-TABIUD2L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugins/exportword.ts"],"sourcesContent":["import { definePlugin } from '../plugins';\nimport { h } from '../ui/dom';\nimport { pickLabels } from './shared';\n\n/**\n * The exportword plugin: the \"Export to Word\" button and menu item download the document as a .docx file\n * (the sheet and margins come from page mode). `plugins: ['exportword']`. The export itself is @novaprose/core/docx,\n * loaded on the first click.\n */\n\nexport const LABELS = {\n en: { export: 'Export to Word', failed: 'Could not create the Word file' },\n};\n\nexport interface ExportWordOptions {\n /** The file name (document.docx by default). */\n filename?: string;\n /** Text font in Word (Calibri by default) and size in points (12). */\n font?: string;\n fontSize?: number;\n}\n\nexport const WORD_ICON = (arrow: string) =>\n `<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=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"/><path d=\"M14 2v6h6\"/>${arrow}</svg>`;\n\nconst icon = WORD_ICON('<path d=\"M12 18v-6\"/><path d=\"m9 15 3-3 3 3\"/>');\n\n/** Downloads bytes as a file. */\nexport function download(bytes: Uint8Array, filename: string, type: string): void {\n const url = URL.createObjectURL(new Blob([bytes as BlobPart], { type }));\n const link = h('a', { href: url, download: filename });\n link.style.display = 'none';\n document.body.append(link);\n link.click();\n link.remove();\n setTimeout(() => URL.revokeObjectURL(url), 60_000);\n}\n\nexport default definePlugin({\n name: 'exportword',\n toolbar: 'exportword',\n setup(editor) {\n const labels = pickLabels(editor, 'exportword', LABELS);\n const options = (editor.options.pluginOptions?.exportword ?? {}) as ExportWordOptions;\n const run = async () => {\n try {\n const { exportDocx } = await import('../docx');\n const bytes = await exportDocx(editor, { font: options.font, fontSize: options.fontSize });\n const name = (options.filename || 'document.docx').replace(/[\\\\/:*?\"<>|]/g, '_');\n download(\n bytes,\n name.toLowerCase().endsWith('.docx') ? name : `${name}.docx`,\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n );\n } catch (error) {\n console.error('[nova] exportword:', error);\n editor.ui.notify({ text: labels.failed, type: 'error' });\n }\n };\n editor.ui.registry.addButton('exportword', {\n icon,\n tooltip: labels.export,\n onAction: () => void run(),\n });\n editor.ui.registry.addMenuItem('exportword', {\n icon,\n text: labels.export,\n onAction: () => void run(),\n });\n },\n});\n"],"mappings":";;;;;;;;;;;AAUO,IAAM,SAAS;AAAA,EACpB,IAAI,EAAE,QAAQ,kBAAkB,QAAQ,iCAAiC;AAC3E;AAUO,IAAM,YAAY,CAAC,UACxB,mQAAmQ,KAAK;AAE1Q,IAAM,OAAO,UAAU,gDAAgD;AAGhE,SAAS,SAAS,OAAmB,UAAkB,MAAoB;AAChF,QAAM,MAAM,IAAI,gBAAgB,IAAI,KAAK,CAAC,KAAiB,GAAG,EAAE,KAAK,CAAC,CAAC;AACvE,QAAM,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,UAAU,SAAS,CAAC;AACrD,OAAK,MAAM,UAAU;AACrB,WAAS,KAAK,OAAO,IAAI;AACzB,OAAK,MAAM;AACX,OAAK,OAAO;AACZ,aAAW,MAAM,IAAI,gBAAgB,GAAG,GAAG,GAAM;AACnD;AAEA,IAAO,qBAAQ,aAAa;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM,QAAQ;AACZ,UAAM,SAAS,WAAW,QAAQ,cAAc,MAAM;AACtD,UAAM,UAAW,OAAO,QAAQ,eAAe,cAAc,CAAC;AAC9D,UAAM,MAAM,YAAY;AACtB,UAAI;AACF,cAAM,EAAE,WAAW,IAAI,MAAM,OAAO,WAAS;AAC7C,cAAM,QAAQ,MAAM,WAAW,QAAQ,EAAE,MAAM,QAAQ,MAAM,UAAU,QAAQ,SAAS,CAAC;AACzF,cAAM,QAAQ,QAAQ,YAAY,iBAAiB,QAAQ,iBAAiB,GAAG;AAC/E;AAAA,UACE;AAAA,UACA,KAAK,YAAY,EAAE,SAAS,OAAO,IAAI,OAAO,GAAG,IAAI;AAAA,UACrD;AAAA,QACF;AAAA,MACF,SAAS,OAAO;AACd,gBAAQ,MAAM,sBAAsB,KAAK;AACzC,eAAO,GAAG,OAAO,EAAE,MAAM,OAAO,QAAQ,MAAM,QAAQ,CAAC;AAAA,MACzD;AAAA,IACF;AACA,WAAO,GAAG,SAAS,UAAU,cAAc;AAAA,MACzC;AAAA,MACA,SAAS,OAAO;AAAA,MAChB,UAAU,MAAM,KAAK,IAAI;AAAA,IAC3B,CAAC;AACD,WAAO,GAAG,SAAS,YAAY,cAAc;AAAA,MAC3C;AAAA,MACA,MAAM,OAAO;AAAA,MACb,UAAU,MAAM,KAAK,IAAI;AAAA,IAC3B,CAAC;AAAA,EACH;AACF,CAAC;","names":[]}
@@ -1,7 +1,13 @@
1
+ import {
2
+ elementId
3
+ } from "./chunk-XR7CY4NI.js";
4
+ import {
5
+ codeLanguage
6
+ } from "./chunk-G74HNSB6.js";
1
7
  import {
2
8
  isSafeImageUrl,
3
9
  isSafeLinkUrl
4
- } from "./chunk-PVFKXRID.js";
10
+ } from "./chunk-4VPDY3LF.js";
5
11
 
6
12
  // src/table-nodes.ts
7
13
  function getCellAttrs(dom, extra) {
@@ -78,7 +84,10 @@ function isInTable(state) {
78
84
  }
79
85
 
80
86
  // src/schema.ts
81
- import { Schema } from "prosemirror-model";
87
+ import {
88
+ Fragment,
89
+ Schema
90
+ } from "prosemirror-model";
82
91
  var ALIGNMENTS = ["left", "center", "right", "justify"];
83
92
  var 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;
84
93
  var LENGTH_RE = /^\d{1,4}(\.\d{1,3})?(px|pt|em|rem|%)$/;
@@ -97,7 +106,7 @@ function normalizeColor(value) {
97
106
  return v;
98
107
  }
99
108
  var cssValue = {
100
- color: (v) => typeof v === "string" && COLOR_RE.test(v.trim()) && // Не цвета, а «по умолчанию»: transparent (Google Docs), windowtext и auto (Word).
109
+ color: (v) => typeof v === "string" && COLOR_RE.test(v.trim()) && // Not colors but "default": transparent (Google Docs), windowtext and auto (Word).
101
110
  !/^(inherit|initial|unset|currentcolor|transparent|windowtext|window|auto|none)$/i.test(
102
111
  v.trim()
103
112
  ) ? normalizeColor(v) : null,
@@ -217,7 +226,7 @@ function buildTableNodes(allow) {
217
226
  tableGroup: "block",
218
227
  cellContent: "block+",
219
228
  cellAttributes: {
220
- // Стиль ячейки из списка (tableCellClassList) — рамки, отступы задаёт CSS сайта.
229
+ // A cell style from the list (tableCellClassList): the site's CSS sets borders and padding.
221
230
  class: {
222
231
  default: null,
223
232
  getFromDOM: (dom) => readClass(dom, allow),
@@ -228,7 +237,7 @@ function buildTableNodes(allow) {
228
237
  },
229
238
  background: {
230
239
  default: null,
231
- // Фон заранее перенесён в data-атрибут (parser.ts → preprocessDOM); style — запасной путь.
240
+ // The background was moved into a data attribute beforehand (parser.ts → preprocessDOM); style is the fallback.
232
241
  getFromDOM: (dom) => cssValue.color(
233
242
  dom.getAttribute("data-nova-cell-bg") ?? dom.style?.backgroundColor
234
243
  ),
@@ -255,7 +264,7 @@ function buildTableNodes(allow) {
255
264
  specs.table.attrs = {
256
265
  width: { default: null },
257
266
  align: { default: null },
258
- // Стиль таблицы из списка (tableClassList): «с рамками», «раскладка без рамок»…
267
+ // A table style from the list (tableClassList): "with borders", "layout without borders"…
259
268
  class: { default: null }
260
269
  };
261
270
  specs.table.parseDOM = [
@@ -300,6 +309,60 @@ function buildTableNodes(allow) {
300
309
  }
301
310
  var NO_CLASSES = () => false;
302
311
  var CLASS_TOKEN = /^-?[_a-zA-Z][\w-]*$/;
312
+ var LANGUAGE_CLASS = /(?:^|\s)lang(?:uage)?-(\S+)/;
313
+ function readCodeLanguage(pre) {
314
+ for (const el of [pre.querySelector("code"), pre]) {
315
+ if (!el) continue;
316
+ const value = codeLanguage(LANGUAGE_CLASS.exec(el.getAttribute("class") ?? "")?.[1]) ?? codeLanguage(el.getAttribute("data-language"));
317
+ if (value) return value;
318
+ }
319
+ return null;
320
+ }
321
+ var PRE_BLOCKS = /^(?:P|DIV|H[1-6]|LI|UL|OL|DL|DT|DD|TABLE|TR|BLOCKQUOTE|PRE|SECTION|ARTICLE|HEADER|FOOTER)$/;
322
+ function preText(pre) {
323
+ let out = "";
324
+ let pendingLine = false;
325
+ const add = (text) => {
326
+ if (!text) return;
327
+ if (pendingLine) out += "\n";
328
+ pendingLine = false;
329
+ out += text;
330
+ };
331
+ const walk = (node) => {
332
+ for (const child of node.childNodes) {
333
+ if (child.nodeType === 3) add(child.data);
334
+ else if (child.nodeType === 1) {
335
+ const tag = child.tagName;
336
+ if (tag === "BR") {
337
+ pendingLine = false;
338
+ out += "\n";
339
+ } else if (PRE_BLOCKS.test(tag)) {
340
+ if (out && (pendingLine || !out.endsWith("\n"))) out += "\n";
341
+ pendingLine = false;
342
+ walk(child);
343
+ pendingLine = true;
344
+ } else walk(child);
345
+ }
346
+ }
347
+ };
348
+ walk(pre);
349
+ return out;
350
+ }
351
+ function isChecklistElement(dom) {
352
+ return dom.getAttribute("data-type") === "taskList" || dom.classList.contains("tox-checklist") || dom.classList.contains("contains-task-list");
353
+ }
354
+ function readChecked(dom) {
355
+ const list = dom.parentElement;
356
+ if (!list || !isChecklistElement(list)) return null;
357
+ const data = dom.getAttribute("data-checked");
358
+ if (data === "true" || data === "false") return data === "true";
359
+ if (dom.classList.contains("tox-checklist--checked")) return true;
360
+ const box = [...dom.querySelectorAll('input[type="checkbox"]')].find(
361
+ (el) => el.closest("li") === dom
362
+ );
363
+ if (box) return box.hasAttribute("checked");
364
+ return false;
365
+ }
303
366
  function headingLevel(value) {
304
367
  const level = Math.trunc(Number(value));
305
368
  return level >= 1 && level <= 6 ? level : 1;
@@ -339,19 +402,25 @@ var buildNodes = (allow, rtl = false) => ({
339
402
  group: "block",
340
403
  content: "inline*",
341
404
  defining: true,
342
- attrs: { level: { default: 1 }, ...blockStyleSpec, ...classSpec },
405
+ // id is for links to a section (table of contents, #anchor); checked both when parsing and on output.
406
+ attrs: { level: { default: 1 }, id: { default: null }, ...blockStyleSpec, ...classSpec },
343
407
  parseDOM: [1, 2, 3, 4, 5, 6].map((level) => ({
344
408
  tag: `h${level}`,
345
409
  getAttrs: (dom) => ({
346
410
  level,
411
+ id: elementId(dom.getAttribute("id")),
347
412
  ...readBlockStyle(dom, rtl),
348
413
  class: readClass(dom, allow)
349
414
  })
350
415
  })),
351
416
  toDOM: (node) => [
352
- // Уровень мог прийти из JSON чем угодно — в имя тега попадает только 1–6.
417
+ // The level could come from JSON as anything: only 1–6 gets into the tag name.
353
418
  `h${headingLevel(node.attrs.level)}`,
354
- { ...classAttr(node.attrs.class), ...blockStyleAttrs(node.attrs, rtl) },
419
+ {
420
+ ...elementId(node.attrs.id) ? { id: node.attrs.id } : {},
421
+ ...classAttr(node.attrs.class),
422
+ ...blockStyleAttrs(node.attrs, rtl)
423
+ },
355
424
  0
356
425
  ]
357
426
  },
@@ -384,35 +453,39 @@ var buildNodes = (allow, rtl = false) => ({
384
453
  {
385
454
  tag: "pre",
386
455
  preserveWhitespace: "full",
387
- getAttrs: (dom) => {
388
- const code = dom.querySelector("code");
389
- const match = code?.className.match(/language-([\w-]+)/);
390
- return { language: match?.[1] ?? null };
456
+ getAttrs: (dom) => ({ language: readCodeLanguage(dom) }),
457
+ // The text, read as it is (see preText).
458
+ getContent: (dom, schema2) => {
459
+ const text = preText(dom);
460
+ return text ? Fragment.from(schema2.text(text)) : Fragment.empty;
391
461
  }
392
462
  }
393
463
  ],
394
- toDOM: (node) => [
395
- "pre",
396
- ["code", node.attrs.language ? { class: `language-${node.attrs.language}` } : {}, 0]
397
- ]
464
+ toDOM: (node) => {
465
+ const language = codeLanguage(node.attrs.language);
466
+ return ["pre", ["code", language ? { class: `language-${language}` } : {}, 0]];
467
+ }
398
468
  },
469
+ // A checklist is a bulleted list with the checklist flag (items with checked): all the list mechanics
470
+ // (Enter, Tab, indents, paste, Markdown) work without a second list type. The HTML is Tiptap's
471
+ // (data-type="taskList"/"taskItem", data-checked); parsing understands TinyMCE and GitHub too.
399
472
  bullet_list: {
400
473
  group: "block",
401
474
  content: "list_item+",
402
- attrs: { listStyle: { default: null } },
475
+ attrs: { listStyle: { default: null }, checklist: { default: false } },
403
476
  parseDOM: [
404
477
  {
405
478
  tag: "ul",
406
- getAttrs: (dom) => ({
407
- listStyle: readListStyle(dom, BULLET_STYLES, "disc")
408
- })
479
+ getAttrs: (dom) => {
480
+ const checklist = isChecklistElement(dom);
481
+ return {
482
+ listStyle: checklist ? null : readListStyle(dom, BULLET_STYLES, "disc"),
483
+ checklist
484
+ };
485
+ }
409
486
  }
410
487
  ],
411
- toDOM: (node) => [
412
- "ul",
413
- listStyleAttrs(node.attrs.listStyle, BULLET_STYLES),
414
- 0
415
- ]
488
+ toDOM: (node) => node.attrs.checklist === true ? ["ul", { "data-type": "taskList" }, 0] : ["ul", listStyleAttrs(node.attrs.listStyle, BULLET_STYLES), 0]
416
489
  },
417
490
  ordered_list: {
418
491
  group: "block",
@@ -442,14 +515,16 @@ var buildNodes = (allow, rtl = false) => ({
442
515
  list_item: {
443
516
  content: "paragraph block*",
444
517
  defining: true,
445
- parseDOM: [{ tag: "li" }],
446
- toDOM: () => ["li", 0]
518
+ // checked: null is a regular item; true/false is a checklist item (checked / not).
519
+ attrs: { checked: { default: null } },
520
+ parseDOM: [{ tag: "li", getAttrs: (dom) => ({ checked: readChecked(dom) }) }],
521
+ toDOM: (node) => typeof node.attrs.checked === "boolean" ? ["li", { "data-type": "taskItem", "data-checked": String(node.attrs.checked) }, 0] : ["li", 0]
447
522
  },
448
523
  text: { group: "inline" },
449
524
  /**
450
- * Картинка с подписью: <figure><img><figcaption>…</figcaption></figure> — как в HTML, два блока
451
- * внутри. Поэтому подпись нельзя превратить в заголовок или список (схема не пустит другой блок
452
- * в figure) — картинка не потеряется. Атрибуты картинки — у figure_image, выравнивание — у figure.
525
+ * An image with a caption: <figure><img><figcaption>…</figcaption></figure>, as in HTML — two
526
+ * blocks inside. So the caption can't become a heading or a list (the schema won't let another
527
+ * block into figure) and the image is never lost. Image attributes live on figure_image, alignment on figure.
453
528
  */
454
529
  figure: {
455
530
  group: "block",
@@ -475,12 +550,12 @@ var buildNodes = (allow, rtl = false) => ({
475
550
  return ["figure", { ...classAttr(node.attrs.class), ...style ? { style } : {} }, 0];
476
551
  }
477
552
  },
478
- /** Картинка внутри figure (блочная, в отличие от картинки в строке). */
553
+ /** An image inside figure (a block, unlike an image in a line). */
479
554
  figure_image: {
480
555
  atom: true,
481
556
  selectable: false,
482
557
  attrs: {
483
- // Значение по умолчанию нужно ProseMirror, чтобы обязательный узел можно было достроить.
558
+ // ProseMirror needs a default value so that a required node can be filled in.
484
559
  src: { default: "" },
485
560
  alt: { default: null },
486
561
  title: { default: null },
@@ -514,7 +589,9 @@ var buildNodes = (allow, rtl = false) => ({
514
589
  "img",
515
590
  {
516
591
  src,
517
- ...alt ? { alt } : {},
592
+ // alt="" (a decorative image) is kept: screen readers skip such an image instead of
593
+ // reading its file name. No alt at all means it was never given.
594
+ ...alt === null || alt === void 0 ? {} : { alt: String(alt) },
518
595
  ...title ? { title } : {},
519
596
  ...width ? { width: String(width) } : {},
520
597
  ...height ? { height: String(height) } : {}
@@ -569,7 +646,9 @@ var buildNodes = (allow, rtl = false) => ({
569
646
  {
570
647
  src,
571
648
  ...classAttr(node.attrs.class),
572
- ...alt ? { alt } : {},
649
+ // alt="" (a decorative image) is kept: screen readers skip such an image instead of
650
+ // reading its file name. No alt at all means it was never given.
651
+ ...alt === null || alt === void 0 ? {} : { alt: String(alt) },
573
652
  ...title ? { title } : {},
574
653
  ...width ? { width: String(width) } : {},
575
654
  ...height ? { height: String(height) } : {},
@@ -623,7 +702,7 @@ var buildMarks = (allow) => ({
623
702
  bold: {
624
703
  parseDOM: [
625
704
  { tag: "strong" },
626
- // <b style="font-weight: normal"> встречается при вставке из Google Docs — это не жирный.
705
+ // <b style="font-weight: normal"> shows up in content pasted from Google Docs: that is not bold.
627
706
  {
628
707
  tag: "b",
629
708
  getAttrs: (dom) => dom.style?.fontWeight !== "normal" && null
@@ -653,12 +732,14 @@ var buildMarks = (allow) => ({
653
732
  toDOM: () => ["s", 0]
654
733
  },
655
734
  code: {
735
+ // Code: typing rules (-- → —, ... → …) and autocorrect leave it as typed.
736
+ code: true,
656
737
  parseDOM: [{ tag: "code" }],
657
738
  toDOM: () => ["code", 0]
658
739
  },
659
740
  subscript: {
660
741
  excludes: "superscript",
661
- // vertical-align — так нижний индекс передают Google Docs и Word.
742
+ // vertical-align: the way Google Docs and Word pass subscript.
662
743
  parseDOM: [{ tag: "sub" }, { style: "vertical-align=sub" }],
663
744
  toDOM: () => ["sub", 0]
664
745
  },
@@ -667,7 +748,7 @@ var buildMarks = (allow) => ({
667
748
  parseDOM: [{ tag: "sup" }, { style: "vertical-align=super" }],
668
749
  toDOM: () => ["sup", 0]
669
750
  },
670
- // ---------- текстовые стили (PRD §4.2): <span style="…"> как у TinyMCE ----------
751
+ // ---------- text styles: <span style="…"> as in TinyMCE ----------
671
752
  color: {
672
753
  attrs: { value: {} },
673
754
  parseDOM: [
@@ -697,13 +778,13 @@ var buildMarks = (allow) => ({
697
778
  parseDOM: [{ style: "font-size", getAttrs: (v) => styleAttr(cssValue.length(v)) }],
698
779
  toDOM: (mark) => styleSpan("font-size", cssValue.length(mark.attrs.value))
699
780
  },
700
- /** <span class="…"> — инлайн-стиль из style_formats. Только разрешённые классы. */
781
+ /** <span class="…"> — an inline style from style_formats. Allowed classes only. */
701
782
  span_class: {
702
783
  attrs: { class: {} },
703
784
  parseDOM: [
704
785
  {
705
786
  tag: "span[class]",
706
- // Не «съедает» span: его style-атрибуты разбирают марки цвета и шрифта.
787
+ // Doesn't "consume" the span: the color and font marks parse its style attributes.
707
788
  consuming: false,
708
789
  getAttrs: (dom) => {
709
790
  const value = readClass(dom, allow);
@@ -722,11 +803,49 @@ function styleSpan(property, value) {
722
803
  return value ? ["span", { style: `${property}: ${value};` }, 0] : ["span", 0];
723
804
  }
724
805
  var schema = new Schema({ nodes, marks });
806
+ function withAttribute(name, attr, spec) {
807
+ const toDOM = spec.toDOM;
808
+ return {
809
+ ...spec,
810
+ attrs: { ...spec.attrs, [name]: { default: attr.default } },
811
+ parseDOM: spec.parseDOM?.map((rule) => {
812
+ if (!rule.tag) return rule;
813
+ const getAttrs = rule.getAttrs;
814
+ return {
815
+ ...rule,
816
+ getAttrs: (dom) => {
817
+ const base = getAttrs ? getAttrs(dom) : rule.attrs ?? null;
818
+ if (base === false) return false;
819
+ const value = attr.parse(dom);
820
+ return value == null ? base : { ...base, [name]: value };
821
+ }
822
+ };
823
+ }),
824
+ ...toDOM ? {
825
+ toDOM: (node) => {
826
+ const out = toDOM(node);
827
+ const extra = attr.render(node.attrs[name]);
828
+ if (!Array.isArray(out) || typeof out[0] !== "string" || !Object.keys(extra).length)
829
+ return out;
830
+ const second = out[1];
831
+ const hasAttrs = !!second && typeof second === "object" && !Array.isArray(second) && second.nodeType === void 0;
832
+ return [
833
+ out[0],
834
+ { ...hasAttrs ? second : {}, ...extra },
835
+ ...out.slice(hasAttrs ? 2 : 1)
836
+ ];
837
+ }
838
+ } : {}
839
+ };
840
+ }
841
+ var holdsText = (spec) => /\b(inline|text)\b/.test(spec.content ?? "");
725
842
  function createSchema(extensions = {}, classFilter, htmlRules, direction = "ltr") {
726
843
  const rtl = direction === "rtl";
727
844
  const extraNodes = Object.entries(extensions.nodes ?? {});
728
845
  const extraMarks = Object.entries(extensions.marks ?? {});
729
- if (!extraNodes.length && !extraMarks.length && !classFilter && !htmlRules && !rtl) return schema;
846
+ const attributes = Object.entries(extensions.attributes ?? {});
847
+ if (!extraNodes.length && !extraMarks.length && !attributes.length && !classFilter && !htmlRules && !rtl)
848
+ return schema;
730
849
  let baseNodes = classFilter || rtl ? buildNodes(classFilter ?? NO_CLASSES, rtl) : nodes;
731
850
  let baseMarks = classFilter ? buildMarks(classFilter) : marks;
732
851
  const ref = {};
@@ -742,8 +861,18 @@ function createSchema(extensions = {}, classFilter, htmlRules, direction = "ltr"
742
861
  for (const [name] of extraMarks) {
743
862
  if (name in marks) throw new Error(`[nova] mark "${name}" already exists in the base schema`);
744
863
  }
864
+ let allNodes = { ...baseNodes, ...Object.fromEntries(extraNodes) };
865
+ const gets = (attr, node, spec) => attr.nodes === "all" ? node !== "doc" && node !== "text" : attr.nodes === "textblock" ? holdsText(spec) : attr.nodes.includes(node);
866
+ for (const [name, attr] of attributes) {
867
+ allNodes = Object.fromEntries(
868
+ Object.entries(allNodes).map(([node, spec]) => [
869
+ node,
870
+ gets(attr, node, spec) && !spec.attrs?.[name] ? withAttribute(name, attr, spec) : spec
871
+ ])
872
+ );
873
+ }
745
874
  ref.schema = new Schema({
746
- nodes: { ...baseNodes, ...Object.fromEntries(extraNodes) },
875
+ nodes: allNodes,
747
876
  marks: { ...baseMarks, ...Object.fromEntries(extraMarks) }
748
877
  });
749
878
  return ref.schema;
@@ -761,4 +890,4 @@ export {
761
890
  schema,
762
891
  createSchema
763
892
  };
764
- //# sourceMappingURL=chunk-FCMZ7TUQ.js.map
893
+ //# sourceMappingURL=chunk-TAM2FHKG.js.map