@novaprose/core 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/dist/a11y.cjs +314 -0
- package/dist/a11y.cjs.map +1 -0
- package/dist/a11y.d.cts +51 -0
- package/dist/a11y.d.ts +51 -0
- package/dist/a11y.js +11 -0
- package/dist/a11y.js.map +1 -0
- package/dist/a11ychecker-6ES3UMU3.js +449 -0
- package/dist/a11ychecker-6ES3UMU3.js.map +1 -0
- package/dist/accordion-ui-B4I2FJXE.js +201 -0
- package/dist/accordion-ui-B4I2FJXE.js.map +1 -0
- package/dist/advcode-7S6N64C7.js +51 -0
- package/dist/advcode-7S6N64C7.js.map +1 -0
- package/dist/advcode-editor-ENCPFVLO.js +257 -0
- package/dist/advcode-editor-ENCPFVLO.js.map +1 -0
- package/dist/{advlist-5FNKPLUX.js → advlist-FEDGNLMQ.js} +10 -7
- package/dist/advlist-FEDGNLMQ.js.map +1 -0
- package/dist/advtable-ui-JAVJY4L4.js +364 -0
- package/dist/advtable-ui-JAVJY4L4.js.map +1 -0
- package/dist/ai-5KM776QW.js +1485 -0
- package/dist/ai-5KM776QW.js.map +1 -0
- package/dist/anchor-ui-VPKNKZ7J.js +81 -0
- package/dist/anchor-ui-VPKNKZ7J.js.map +1 -0
- package/dist/autocorrect-5QLICCRN.js +851 -0
- package/dist/autocorrect-5QLICCRN.js.map +1 -0
- package/dist/{autolink-45LTODWB.js → autolink-ZYIPRXBA.js} +11 -8
- package/dist/autolink-ZYIPRXBA.js.map +1 -0
- package/dist/{autoresize-UB3GOA6D.js → autoresize-YRZAVCNO.js} +2 -2
- package/dist/autoresize-YRZAVCNO.js.map +1 -0
- package/dist/{autosave-GMWJ5BPE.js → autosave-IC7YYG44.js} +7 -7
- package/dist/autosave-IC7YYG44.js.map +1 -0
- package/dist/casechange-R7IO2APS.js +201 -0
- package/dist/casechange-R7IO2APS.js.map +1 -0
- package/dist/{charmap-2GC7LF7G.js → charmap-CARYZFKD.js} +7 -7
- package/dist/charmap-CARYZFKD.js.map +1 -0
- package/dist/checklist-7E47QW6L.js +189 -0
- package/dist/checklist-7E47QW6L.js.map +1 -0
- package/dist/chunk-23ZLVT5D.js +163 -0
- package/dist/chunk-23ZLVT5D.js.map +1 -0
- package/dist/{chunk-ND2CWNVG.js → chunk-3BOK3S3T.js} +2 -27
- package/dist/chunk-3BOK3S3T.js.map +1 -0
- package/dist/chunk-3KBQEAX2.js +926 -0
- package/dist/chunk-3KBQEAX2.js.map +1 -0
- package/dist/chunk-3NNILZVB.js +259 -0
- package/dist/chunk-3NNILZVB.js.map +1 -0
- package/dist/{chunk-PVFKXRID.js → chunk-4VPDY3LF.js} +1 -1
- package/dist/chunk-4VPDY3LF.js.map +1 -0
- package/dist/chunk-53AY5NAF.js +214 -0
- package/dist/chunk-53AY5NAF.js.map +1 -0
- package/dist/{chunk-5AW2HHG6.js → chunk-5KERLFDD.js} +50 -3
- package/dist/chunk-5KERLFDD.js.map +1 -0
- package/dist/{chunk-FCMZ7TUQ.js → chunk-6BJEOL5V.js} +296 -43
- package/dist/chunk-6BJEOL5V.js.map +1 -0
- package/dist/chunk-6LQM7G4V.js +159 -0
- package/dist/chunk-6LQM7G4V.js.map +1 -0
- package/dist/chunk-AB67XUSR.js +178 -0
- package/dist/chunk-AB67XUSR.js.map +1 -0
- package/dist/chunk-ANE5ASXG.js +26 -0
- package/dist/chunk-ANE5ASXG.js.map +1 -0
- package/dist/{chunk-Z3ELZ77W.js → chunk-AP2PJFLB.js} +5 -2
- package/dist/chunk-AP2PJFLB.js.map +1 -0
- package/dist/chunk-ARBKIZZU.js +137 -0
- package/dist/chunk-ARBKIZZU.js.map +1 -0
- package/dist/chunk-AUQSATWL.js +322 -0
- package/dist/chunk-AUQSATWL.js.map +1 -0
- package/dist/chunk-BMCH63QN.js +165 -0
- package/dist/chunk-BMCH63QN.js.map +1 -0
- package/dist/chunk-BUABAYZL.js +160 -0
- package/dist/chunk-BUABAYZL.js.map +1 -0
- package/dist/chunk-DCMPJ25E.js +140 -0
- package/dist/chunk-DCMPJ25E.js.map +1 -0
- package/dist/chunk-DV7TGRU6.js +47 -0
- package/dist/chunk-DV7TGRU6.js.map +1 -0
- package/dist/chunk-F2WT77ZG.js +163 -0
- package/dist/chunk-F2WT77ZG.js.map +1 -0
- package/dist/chunk-FNJ7AEJK.js +955 -0
- package/dist/chunk-FNJ7AEJK.js.map +1 -0
- package/dist/chunk-G74HNSB6.js +9 -0
- package/dist/chunk-G74HNSB6.js.map +1 -0
- package/dist/chunk-GTLE2HEW.js +108 -0
- package/dist/chunk-GTLE2HEW.js.map +1 -0
- package/dist/chunk-GUZCRDK6.js +143 -0
- package/dist/chunk-GUZCRDK6.js.map +1 -0
- package/dist/chunk-HNEAVVBC.js +98 -0
- package/dist/chunk-HNEAVVBC.js.map +1 -0
- package/dist/chunk-HSVNJGK3.js +1149 -0
- package/dist/chunk-HSVNJGK3.js.map +1 -0
- package/dist/chunk-IFSD6O5M.js +29 -0
- package/dist/chunk-IFSD6O5M.js.map +1 -0
- package/dist/{table-SSNABG5W.js → chunk-IO5PU52K.js} +119 -61
- package/dist/chunk-IO5PU52K.js.map +1 -0
- package/dist/chunk-K4LFGNS7.js +137 -0
- package/dist/chunk-K4LFGNS7.js.map +1 -0
- package/dist/chunk-KGEHUWGL.js +79 -0
- package/dist/chunk-KGEHUWGL.js.map +1 -0
- package/dist/chunk-KW6ATQPN.js +151 -0
- package/dist/chunk-KW6ATQPN.js.map +1 -0
- package/dist/chunk-NX3KWIP5.js +207 -0
- package/dist/chunk-NX3KWIP5.js.map +1 -0
- package/dist/chunk-OOVNE6MB.js +28 -0
- package/dist/chunk-OOVNE6MB.js.map +1 -0
- package/dist/chunk-OQMMHWMZ.js +7 -0
- package/dist/chunk-OQMMHWMZ.js.map +1 -0
- package/dist/{chunk-JPJVTB45.js → chunk-QU3KXMYT.js} +8 -2
- package/dist/chunk-QU3KXMYT.js.map +1 -0
- package/dist/chunk-QWT56RVG.js +158 -0
- package/dist/chunk-QWT56RVG.js.map +1 -0
- package/dist/chunk-RJ7T56OH.js +3787 -0
- package/dist/chunk-RJ7T56OH.js.map +1 -0
- package/dist/{chunk-KWXFL4WS.js → chunk-RPHA4HRX.js} +8 -5
- package/dist/chunk-RPHA4HRX.js.map +1 -0
- package/dist/chunk-S4DCQA74.js +66 -0
- package/dist/chunk-S4DCQA74.js.map +1 -0
- package/dist/chunk-SCIRO4XK.js +144 -0
- package/dist/chunk-SCIRO4XK.js.map +1 -0
- package/dist/chunk-SNVYHGGO.js +127 -0
- package/dist/chunk-SNVYHGGO.js.map +1 -0
- package/dist/chunk-T4543CB2.js +67 -0
- package/dist/chunk-T4543CB2.js.map +1 -0
- package/dist/{chunk-T3GY6IVK.js → chunk-UHUOAQA6.js} +71 -9
- package/dist/chunk-UHUOAQA6.js.map +1 -0
- package/dist/chunk-UTMS2P2K.js +288 -0
- package/dist/chunk-UTMS2P2K.js.map +1 -0
- package/dist/{chunk-HPLT3XRZ.js → chunk-V7WUHUHM.js} +13 -1
- package/dist/chunk-V7WUHUHM.js.map +1 -0
- package/dist/chunk-WAOU5NGN.js +430 -0
- package/dist/chunk-WAOU5NGN.js.map +1 -0
- package/dist/{chunk-R2UMUCVI.js → chunk-XCXJD5DO.js} +53 -8
- package/dist/chunk-XCXJD5DO.js.map +1 -0
- package/dist/chunk-XIH4SCO6.js +112 -0
- package/dist/chunk-XIH4SCO6.js.map +1 -0
- package/dist/chunk-XR7CY4NI.js +11 -0
- package/dist/chunk-XR7CY4NI.js.map +1 -0
- package/dist/chunk-Y2OXWCM7.js +263 -0
- package/dist/chunk-Y2OXWCM7.js.map +1 -0
- package/dist/chunk-YDF55N6Z.js +164 -0
- package/dist/chunk-YDF55N6Z.js.map +1 -0
- package/dist/chunk-YOTA26H7.js +373 -0
- package/dist/chunk-YOTA26H7.js.map +1 -0
- package/dist/chunk-YP7N47QR.js +101 -0
- package/dist/chunk-YP7N47QR.js.map +1 -0
- package/dist/{chunk-KPE3QRPB.js → chunk-YYCDRUE2.js} +16 -315
- package/dist/chunk-YYCDRUE2.js.map +1 -0
- package/dist/codesample-FOWXMCTC.js +546 -0
- package/dist/codesample-FOWXMCTC.js.map +1 -0
- package/dist/{comments-panel-HXMWSRAW.js → comments-panel-SOLBZ46Q.js} +9 -5
- package/dist/comments-panel-SOLBZ46Q.js.map +1 -0
- package/dist/{directionality-5JLWQGP2.js → directionality-BXWXNPRZ.js} +13 -10
- package/dist/directionality-BXWXNPRZ.js.map +1 -0
- package/dist/document-B0hLRhuH.d.cts +39 -0
- package/dist/document-Dh-jz1SK.d.ts +39 -0
- package/dist/docx.cjs +23575 -0
- package/dist/docx.cjs.map +1 -0
- package/dist/docx.d.cts +83 -0
- package/dist/docx.d.ts +83 -0
- package/dist/docx.js +1826 -0
- package/dist/docx.js.map +1 -0
- package/dist/draghandle-3IBHVHDE.js +389 -0
- package/dist/draghandle-3IBHVHDE.js.map +1 -0
- package/dist/editimage-GTLFGHYU.js +683 -0
- package/dist/editimage-GTLFGHYU.js.map +1 -0
- package/dist/editor-DnAN9aPd.d.ts +2948 -0
- package/dist/editor-S8w_w5W0.d.cts +2948 -0
- package/dist/email-FDSENENR.js +177 -0
- package/dist/email-FDSENENR.js.map +1 -0
- package/dist/email.cjs +588 -0
- package/dist/email.cjs.map +1 -0
- package/dist/email.d.cts +7 -0
- package/dist/email.d.ts +7 -0
- package/dist/email.js +21 -0
- package/dist/email.js.map +1 -0
- package/dist/{emoticons-ZD6ZRIWG.js → emoticons-SHYSAEID.js} +7 -7
- package/dist/emoticons-SHYSAEID.js.map +1 -0
- package/dist/exportpdf-TEBDQZSN.js +91 -0
- package/dist/exportpdf-TEBDQZSN.js.map +1 -0
- package/dist/exportword-BGH2CZXO.js +16 -0
- package/dist/exportword-BGH2CZXO.js.map +1 -0
- package/dist/footnotes-ui-KPKFDSN7.js +449 -0
- package/dist/footnotes-ui-KPKFDSN7.js.map +1 -0
- package/dist/form-dialog-SNWFPM2K.js +379 -0
- package/dist/form-dialog-SNWFPM2K.js.map +1 -0
- package/dist/formatpainter-CB4ZTKR5.js +209 -0
- package/dist/formatpainter-CB4ZTKR5.js.map +1 -0
- package/dist/fullpagehtml-ui-JPGRMXHD.js +220 -0
- package/dist/fullpagehtml-ui-JPGRMXHD.js.map +1 -0
- package/dist/html-rules-api-BLDDW9MO.d.cts +42 -0
- package/dist/html-rules-api-BLDDW9MO.d.ts +42 -0
- package/dist/html-rules.cjs +21 -19
- package/dist/html-rules.cjs.map +1 -1
- package/dist/html-rules.d.cts +37 -35
- package/dist/html-rules.d.ts +37 -35
- package/dist/html-rules.js +26 -22
- package/dist/html-rules.js.map +1 -1
- package/dist/i18n/de.cjs +349 -0
- package/dist/i18n/de.cjs.map +1 -1
- package/dist/i18n/de.d.cts +1 -1
- package/dist/i18n/de.d.ts +1 -1
- package/dist/i18n/de.js +349 -0
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/es.cjs +349 -0
- package/dist/i18n/es.cjs.map +1 -1
- package/dist/i18n/es.d.cts +1 -1
- package/dist/i18n/es.d.ts +1 -1
- package/dist/i18n/es.js +349 -0
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.cjs +349 -0
- package/dist/i18n/fr.cjs.map +1 -1
- package/dist/i18n/fr.d.cts +1 -1
- package/dist/i18n/fr.d.ts +1 -1
- package/dist/i18n/fr.js +349 -0
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/it.cjs +349 -0
- package/dist/i18n/it.cjs.map +1 -1
- package/dist/i18n/it.d.cts +1 -1
- package/dist/i18n/it.d.ts +1 -1
- package/dist/i18n/it.js +349 -0
- package/dist/i18n/it.js.map +1 -1
- package/dist/i18n/pt-BR.cjs +349 -0
- package/dist/i18n/pt-BR.cjs.map +1 -1
- package/dist/i18n/pt-BR.d.cts +1 -1
- package/dist/i18n/pt-BR.d.ts +1 -1
- package/dist/i18n/pt-BR.js +349 -0
- package/dist/i18n/pt-BR.js.map +1 -1
- package/dist/i18n/ru.cjs +349 -0
- package/dist/i18n/ru.cjs.map +1 -1
- package/dist/i18n/ru.d.cts +3 -3
- package/dist/i18n/ru.d.ts +3 -3
- package/dist/i18n/ru.js +349 -0
- package/dist/i18n/ru.js.map +1 -1
- package/dist/importcss-JLNIRKGH.js +127 -0
- package/dist/importcss-JLNIRKGH.js.map +1 -0
- package/dist/importword-ZOWLUWSN.js +73 -0
- package/dist/importword-ZOWLUWSN.js.map +1 -0
- package/dist/{index-C603bU6r.d.ts → index-Pb2r0V-S.d.cts} +39 -17
- package/dist/{index-C603bU6r.d.cts → index-Pb2r0V-S.d.ts} +39 -17
- package/dist/index.cjs +29422 -10640
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +139 -64
- package/dist/index.d.ts +139 -64
- package/dist/index.js +204 -1412
- package/dist/index.js.map +1 -1
- package/dist/{insertdatetime-CRO7TJAQ.js → insertdatetime-BXQ3XXPH.js} +7 -7
- package/dist/insertdatetime-BXQ3XXPH.js.map +1 -0
- package/dist/linkchecker-JASSETVI.js +287 -0
- package/dist/linkchecker-JASSETVI.js.map +1 -0
- package/dist/markdown-OTLTCK26.js +136 -0
- package/dist/markdown-OTLTCK26.js.map +1 -0
- package/dist/markdown.cjs +94 -11
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +12 -10
- package/dist/markdown.d.ts +12 -10
- package/dist/markdown.js +4 -235
- package/dist/markdown.js.map +1 -1
- package/dist/math-ui-TY4VZF7Q.js +157 -0
- package/dist/math-ui-TY4VZF7Q.js.map +1 -0
- package/dist/media-ui-IXN4ENVF.js +123 -0
- package/dist/media-ui-IXN4ENVF.js.map +1 -0
- package/dist/mediaembed-ui-ODX5ECXC.js +207 -0
- package/dist/mediaembed-ui-ODX5ECXC.js.map +1 -0
- package/dist/mentions-ui-55GCKC6F.js +58 -0
- package/dist/mentions-ui-55GCKC6F.js.map +1 -0
- package/dist/mergetags-ui-6T7Z7MAZ.js +73 -0
- package/dist/mergetags-ui-6T7Z7MAZ.js.map +1 -0
- package/dist/{nonbreaking-66LFZV2W.js → nonbreaking-PONHSOMJ.js} +7 -7
- package/dist/nonbreaking-PONHSOMJ.js.map +1 -0
- package/dist/pagebreak-ui-AKAW7M5I.js +50 -0
- package/dist/pagebreak-ui-AKAW7M5I.js.map +1 -0
- package/dist/pageembed-ui-GUNPKMBR.js +172 -0
- package/dist/pageembed-ui-GUNPKMBR.js.map +1 -0
- package/dist/pagelayout-ui-JSFVEMHS.js +236 -0
- package/dist/pagelayout-ui-JSFVEMHS.js.map +1 -0
- package/dist/{paste-office-F3QW4WWO.js → paste-office-TORLAZ5L.js} +94 -4
- package/dist/paste-office-TORLAZ5L.js.map +1 -0
- package/dist/permanentpen-EACURV5U.js +206 -0
- package/dist/permanentpen-EACURV5U.js.map +1 -0
- package/dist/print-4XJCOANX.js +178 -0
- package/dist/print-4XJCOANX.js.map +1 -0
- package/dist/{quickbars-7E2QRS7J.js → quickbars-BT5PETRX.js} +20 -12
- package/dist/quickbars-BT5PETRX.js.map +1 -0
- package/dist/{revisionhistory-DXE7KU4R.js → revisionhistory-3FKLMJHJ.js} +42 -153
- package/dist/revisionhistory-3FKLMJHJ.js.map +1 -0
- package/dist/save-ZHFXH222.js +120 -0
- package/dist/save-ZHFXH222.js.map +1 -0
- package/dist/search-bar-6MVRMTK6.js +212 -0
- package/dist/search-bar-6MVRMTK6.js.map +1 -0
- package/dist/spellchecker-JJKA6B4R.js +474 -0
- package/dist/spellchecker-JJKA6B4R.js.map +1 -0
- package/dist/suggestions-panel-X37NFLXE.js +596 -0
- package/dist/suggestions-panel-X37NFLXE.js.map +1 -0
- package/dist/suggestions-ui-WN7QNYHB.js +395 -0
- package/dist/suggestions-ui-WN7QNYHB.js.map +1 -0
- package/dist/table-PEF56QG5.js +54 -0
- package/dist/table-PEF56QG5.js.map +1 -0
- package/dist/table-dialogs-QS3VFZD2.js +119 -0
- package/dist/table-dialogs-QS3VFZD2.js.map +1 -0
- package/dist/tableofcontents-ui-U7EV3UU7.js +167 -0
- package/dist/tableofcontents-ui-U7EV3UU7.js.map +1 -0
- package/dist/template-ZRTKIP2J.js +278 -0
- package/dist/template-ZRTKIP2J.js.map +1 -0
- package/dist/typography-S7RO54DB.js +399 -0
- package/dist/typography-S7RO54DB.js.map +1 -0
- package/dist/upload.cjs +160 -0
- package/dist/upload.cjs.map +1 -0
- package/dist/upload.d.cts +72 -0
- package/dist/upload.d.ts +72 -0
- package/dist/upload.js +132 -0
- package/dist/upload.js.map +1 -0
- package/dist/{visualblocks-6DLBXYOA.js → visualblocks-KJYRHF2L.js} +7 -7
- package/dist/visualblocks-KJYRHF2L.js.map +1 -0
- package/dist/visualchars-TDLZKFXD.js +134 -0
- package/dist/visualchars-TDLZKFXD.js.map +1 -0
- package/package.json +53 -3
- package/src/style.css +376 -550
- package/dist/advlist-5FNKPLUX.js.map +0 -1
- package/dist/autolink-45LTODWB.js.map +0 -1
- package/dist/autoresize-UB3GOA6D.js.map +0 -1
- package/dist/autosave-GMWJ5BPE.js.map +0 -1
- package/dist/charmap-2GC7LF7G.js.map +0 -1
- package/dist/chunk-5AW2HHG6.js.map +0 -1
- package/dist/chunk-DWZLSZDG.js +0 -5664
- package/dist/chunk-DWZLSZDG.js.map +0 -1
- package/dist/chunk-FCMZ7TUQ.js.map +0 -1
- package/dist/chunk-HPLT3XRZ.js.map +0 -1
- package/dist/chunk-JPJVTB45.js.map +0 -1
- package/dist/chunk-KPE3QRPB.js.map +0 -1
- package/dist/chunk-KWXFL4WS.js.map +0 -1
- package/dist/chunk-ND2CWNVG.js.map +0 -1
- package/dist/chunk-PVFKXRID.js.map +0 -1
- package/dist/chunk-R2UMUCVI.js.map +0 -1
- package/dist/chunk-T3GY6IVK.js.map +0 -1
- package/dist/chunk-Z3ELZ77W.js.map +0 -1
- package/dist/comments-panel-HXMWSRAW.js.map +0 -1
- package/dist/directionality-5JLWQGP2.js.map +0 -1
- package/dist/editor-CXkltf1R.d.ts +0 -1886
- package/dist/editor-CgSBFTke.d.cts +0 -1886
- package/dist/emoticons-ZD6ZRIWG.js.map +0 -1
- package/dist/form-dialog-QH6KAERD.js +0 -180
- package/dist/form-dialog-QH6KAERD.js.map +0 -1
- package/dist/html-rules-api-D3fKQi-R.d.cts +0 -40
- package/dist/html-rules-api-D3fKQi-R.d.ts +0 -40
- package/dist/insertdatetime-CRO7TJAQ.js.map +0 -1
- package/dist/nonbreaking-66LFZV2W.js.map +0 -1
- package/dist/paste-office-F3QW4WWO.js.map +0 -1
- package/dist/quickbars-7E2QRS7J.js.map +0 -1
- package/dist/revisionhistory-DXE7KU4R.js.map +0 -1
- package/dist/table-SSNABG5W.js.map +0 -1
- package/dist/visualblocks-6DLBXYOA.js.map +0 -1
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import {
|
|
2
|
+
REMOTE_CHANGE_META
|
|
3
|
+
} from "./chunk-RJ7T56OH.js";
|
|
4
|
+
import "./chunk-YP7N47QR.js";
|
|
5
|
+
import "./chunk-KW6ATQPN.js";
|
|
6
|
+
import "./chunk-KGEHUWGL.js";
|
|
7
|
+
import "./chunk-GTLE2HEW.js";
|
|
8
|
+
import "./chunk-6LQM7G4V.js";
|
|
9
|
+
import "./chunk-FNJ7AEJK.js";
|
|
10
|
+
import "./chunk-SNVYHGGO.js";
|
|
11
|
+
import "./chunk-YYCDRUE2.js";
|
|
12
|
+
import "./chunk-RPHA4HRX.js";
|
|
13
|
+
import "./chunk-ANE5ASXG.js";
|
|
14
|
+
import "./chunk-23ZLVT5D.js";
|
|
15
|
+
import "./chunk-DV7TGRU6.js";
|
|
16
|
+
import "./chunk-AB67XUSR.js";
|
|
17
|
+
import {
|
|
18
|
+
footnoteId
|
|
19
|
+
} from "./chunk-QWT56RVG.js";
|
|
20
|
+
import "./chunk-3KBQEAX2.js";
|
|
21
|
+
import "./chunk-53AY5NAF.js";
|
|
22
|
+
import "./chunk-OQMMHWMZ.js";
|
|
23
|
+
import "./chunk-UHUOAQA6.js";
|
|
24
|
+
import "./chunk-HNEAVVBC.js";
|
|
25
|
+
import "./chunk-6BJEOL5V.js";
|
|
26
|
+
import "./chunk-XR7CY4NI.js";
|
|
27
|
+
import {
|
|
28
|
+
icons
|
|
29
|
+
} from "./chunk-5KERLFDD.js";
|
|
30
|
+
import {
|
|
31
|
+
pickLabels
|
|
32
|
+
} from "./chunk-XCXJD5DO.js";
|
|
33
|
+
import {
|
|
34
|
+
definePlugin
|
|
35
|
+
} from "./chunk-V7WUHUHM.js";
|
|
36
|
+
import "./chunk-QU3KXMYT.js";
|
|
37
|
+
import "./chunk-G74HNSB6.js";
|
|
38
|
+
import "./chunk-OOVNE6MB.js";
|
|
39
|
+
import "./chunk-3BOK3S3T.js";
|
|
40
|
+
import "./chunk-YDF55N6Z.js";
|
|
41
|
+
import "./chunk-4VPDY3LF.js";
|
|
42
|
+
|
|
43
|
+
// src/plugins/footnotes-ui.ts
|
|
44
|
+
import { Fragment, Slice } from "prosemirror-model";
|
|
45
|
+
import {
|
|
46
|
+
NodeSelection,
|
|
47
|
+
Plugin,
|
|
48
|
+
PluginKey,
|
|
49
|
+
TextSelection
|
|
50
|
+
} from "prosemirror-state";
|
|
51
|
+
var LABELS = {
|
|
52
|
+
en: {
|
|
53
|
+
insert: "Insert footnote",
|
|
54
|
+
update: "Update footnotes"
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var syncKey = new PluginKey("nova-footnotes-sync");
|
|
58
|
+
var FOCUS_NOTE = "nova:footnote-focus";
|
|
59
|
+
var FOOTNOTE_NODES = /* @__PURE__ */ new Set(["footnote_ref", "footnote", "footnotes"]);
|
|
60
|
+
function scan(doc) {
|
|
61
|
+
const refs = [];
|
|
62
|
+
const sections = [];
|
|
63
|
+
doc.descendants((node, pos) => {
|
|
64
|
+
if (node.type.name === "footnotes") {
|
|
65
|
+
sections.push({ pos, node });
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if (node.isTextblock && !node.type.validContent(node.content)) return false;
|
|
69
|
+
if (node.type.name === "footnote_ref") refs.push({ pos, node });
|
|
70
|
+
return true;
|
|
71
|
+
});
|
|
72
|
+
return { refs, sections };
|
|
73
|
+
}
|
|
74
|
+
var warned = false;
|
|
75
|
+
function safeSync(state, focusId) {
|
|
76
|
+
try {
|
|
77
|
+
return syncFootnotes(state, focusId);
|
|
78
|
+
} catch (error) {
|
|
79
|
+
if (!warned) {
|
|
80
|
+
warned = true;
|
|
81
|
+
console.warn("[nova] footnotes: could not bring them in step", error);
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function hasFootnotes(doc) {
|
|
87
|
+
let found = false;
|
|
88
|
+
doc.descendants((node) => {
|
|
89
|
+
if (FOOTNOTE_NODES.has(node.type.name)) found = true;
|
|
90
|
+
return !found;
|
|
91
|
+
});
|
|
92
|
+
return found;
|
|
93
|
+
}
|
|
94
|
+
var touchedCache = /* @__PURE__ */ new WeakMap();
|
|
95
|
+
function touchesFootnotes(tr) {
|
|
96
|
+
const cached = touchedCache.get(tr);
|
|
97
|
+
if (cached !== void 0) return cached;
|
|
98
|
+
let touched = false;
|
|
99
|
+
const check = (doc, from, to) => {
|
|
100
|
+
if (touched || from >= to) return;
|
|
101
|
+
doc.nodesBetween(from, to, (node, pos) => {
|
|
102
|
+
if (FOOTNOTE_NODES.has(node.type.name)) {
|
|
103
|
+
const end = pos + node.nodeSize;
|
|
104
|
+
if (pos >= from && pos < to || end > from && end <= to) touched = true;
|
|
105
|
+
}
|
|
106
|
+
return !touched;
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
tr.steps.forEach((step, index) => {
|
|
110
|
+
step.getMap().forEach((oldStart, oldEnd, newStart, newEnd) => {
|
|
111
|
+
check(tr.docs[index], oldStart, oldEnd);
|
|
112
|
+
check(tr.docs[index + 1] ?? tr.doc, newStart, newEnd);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
touchedCache.set(tr, touched);
|
|
116
|
+
return touched;
|
|
117
|
+
}
|
|
118
|
+
function freshId(used) {
|
|
119
|
+
let id = "";
|
|
120
|
+
do
|
|
121
|
+
id = Math.random().toString(36).slice(2, 10);
|
|
122
|
+
while (!id || used.has(id));
|
|
123
|
+
used.add(id);
|
|
124
|
+
return id;
|
|
125
|
+
}
|
|
126
|
+
function collectNotes(state, sections) {
|
|
127
|
+
const breakType = state.schema.nodes.hard_break;
|
|
128
|
+
const separator = breakType ? Fragment.from(breakType.create()) : Fragment.empty;
|
|
129
|
+
const head = state.selection.head;
|
|
130
|
+
const notes = /* @__PURE__ */ new Map();
|
|
131
|
+
const children = [];
|
|
132
|
+
let cursor = null;
|
|
133
|
+
for (const section of sections) {
|
|
134
|
+
let previous = null;
|
|
135
|
+
let lead = null;
|
|
136
|
+
let leadCursor = null;
|
|
137
|
+
section.node.forEach((node, offset) => {
|
|
138
|
+
const child = { pos: section.pos + 1 + offset, node };
|
|
139
|
+
children.push(child);
|
|
140
|
+
const inside = head > child.pos && head < child.pos + node.nodeSize;
|
|
141
|
+
const at = head - child.pos - 1;
|
|
142
|
+
const id = footnoteId(node.attrs.id);
|
|
143
|
+
if (id && !notes.has(id)) {
|
|
144
|
+
const note = { id, content: node.content, from: child };
|
|
145
|
+
let shift = 0;
|
|
146
|
+
if (lead?.size) {
|
|
147
|
+
shift = lead.size + separator.size;
|
|
148
|
+
note.content = lead.append(separator).append(node.content);
|
|
149
|
+
note.from = null;
|
|
150
|
+
}
|
|
151
|
+
if (leadCursor) cursor = { child: leadCursor.child, id, offset: leadCursor.offset };
|
|
152
|
+
if (inside) cursor = { child, id, offset: shift + at };
|
|
153
|
+
lead = null;
|
|
154
|
+
leadCursor = null;
|
|
155
|
+
notes.set(id, note);
|
|
156
|
+
previous = note;
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (!previous) {
|
|
160
|
+
const base2 = lead?.size ? lead.size + (node.content.size ? separator.size : 0) : 0;
|
|
161
|
+
if (inside) leadCursor = { child, offset: base2 + at };
|
|
162
|
+
lead = lead?.size ? node.content.size ? lead.append(separator) : lead : Fragment.empty;
|
|
163
|
+
lead = lead.append(node.content);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const target = previous;
|
|
167
|
+
const base = target.content.size + (node.content.size ? separator.size : 0);
|
|
168
|
+
if (node.content.size) {
|
|
169
|
+
target.content = target.content.append(separator).append(node.content);
|
|
170
|
+
target.from = null;
|
|
171
|
+
}
|
|
172
|
+
if (inside) cursor = { child, id: target.id, offset: base + at };
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
return { notes, children, cursor };
|
|
176
|
+
}
|
|
177
|
+
function increasing(values) {
|
|
178
|
+
const tails = [];
|
|
179
|
+
const previous = values.map(() => -1);
|
|
180
|
+
values.forEach((value, index) => {
|
|
181
|
+
let low = 0;
|
|
182
|
+
let high = tails.length;
|
|
183
|
+
while (low < high) {
|
|
184
|
+
const middle = low + high >> 1;
|
|
185
|
+
if (values[tails[middle]] < value) low = middle + 1;
|
|
186
|
+
else high = middle;
|
|
187
|
+
}
|
|
188
|
+
if (low > 0) previous[index] = tails[low - 1];
|
|
189
|
+
tails[low] = index;
|
|
190
|
+
});
|
|
191
|
+
const out = [];
|
|
192
|
+
for (let index = tails.length ? tails[tails.length - 1] : -1; index >= 0; ) {
|
|
193
|
+
out.push(index);
|
|
194
|
+
index = previous[index];
|
|
195
|
+
}
|
|
196
|
+
return out.reverse();
|
|
197
|
+
}
|
|
198
|
+
function patchSection(tr, section, wanted, children, noteType) {
|
|
199
|
+
const order = new Map(wanted.map((note, index) => [note, index]));
|
|
200
|
+
const present = wanted.filter((note) => note.from).sort((a, b) => a.from.pos - b.from.pos);
|
|
201
|
+
const keep = new Set(increasing(present.map((note) => order.get(note))).map((i) => present[i]));
|
|
202
|
+
let at = tr.mapping.map(section.pos + 1);
|
|
203
|
+
for (const note of wanted) {
|
|
204
|
+
if (keep.has(note)) {
|
|
205
|
+
at = tr.mapping.map(note.from.pos) + note.from.node.nodeSize;
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
const node = noteType.create({ id: note.id }, note.content);
|
|
209
|
+
tr.insert(at, node);
|
|
210
|
+
at += node.nodeSize;
|
|
211
|
+
}
|
|
212
|
+
const staying = new Set([...keep].map((note) => note.from));
|
|
213
|
+
for (let index = children.length - 1; index >= 0; index--) {
|
|
214
|
+
const child = children[index];
|
|
215
|
+
if (staying.has(child)) continue;
|
|
216
|
+
tr.delete(tr.mapping.map(child.pos), tr.mapping.map(child.pos + child.node.nodeSize, -1));
|
|
217
|
+
}
|
|
218
|
+
return staying;
|
|
219
|
+
}
|
|
220
|
+
function placeCursor(tr, id, offset) {
|
|
221
|
+
const section = tr.doc.lastChild;
|
|
222
|
+
if (!section || section.type.name !== "footnotes") return;
|
|
223
|
+
let pos = tr.doc.content.size - section.nodeSize + 1;
|
|
224
|
+
section.forEach((note) => {
|
|
225
|
+
if (footnoteId(note.attrs.id) === id) {
|
|
226
|
+
const inNote2 = Math.max(0, Math.min(offset, note.content.size));
|
|
227
|
+
tr.setSelection(TextSelection.create(tr.doc, pos + 1 + inNote2));
|
|
228
|
+
}
|
|
229
|
+
pos += note.nodeSize;
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
function syncFootnotes(state, focusId) {
|
|
233
|
+
const { schema } = state;
|
|
234
|
+
const refType = schema.nodes.footnote_ref;
|
|
235
|
+
const sectionType = schema.nodes.footnotes;
|
|
236
|
+
const noteType = schema.nodes.footnote;
|
|
237
|
+
if (!refType || !sectionType || !noteType) return null;
|
|
238
|
+
const { refs, sections } = scan(state.doc);
|
|
239
|
+
const { notes, children, cursor } = collectNotes(state, sections);
|
|
240
|
+
const tr = state.tr;
|
|
241
|
+
const used = new Set(notes.keys());
|
|
242
|
+
for (const { node } of refs) used.add(footnoteId(node.attrs.id));
|
|
243
|
+
const seen = /* @__PURE__ */ new Set();
|
|
244
|
+
const wanted = [];
|
|
245
|
+
refs.forEach(({ pos, node }, index) => {
|
|
246
|
+
const original = footnoteId(node.attrs.id);
|
|
247
|
+
const note = notes.get(original);
|
|
248
|
+
const id = original && !seen.has(original) ? original : freshId(used);
|
|
249
|
+
seen.add(id);
|
|
250
|
+
if (node.attrs.id !== id) tr.setNodeAttribute(pos, "id", id);
|
|
251
|
+
if (node.attrs.number !== index + 1) tr.setNodeAttribute(pos, "number", index + 1);
|
|
252
|
+
wanted.push(
|
|
253
|
+
id === original && note ? note : { id, content: note?.content ?? Fragment.empty, from: null }
|
|
254
|
+
);
|
|
255
|
+
});
|
|
256
|
+
let staying = /* @__PURE__ */ new Set();
|
|
257
|
+
const last = sections[sections.length - 1];
|
|
258
|
+
const atEnd = sections.length === 1 && last && last.pos + last.node.nodeSize === state.doc.content.size;
|
|
259
|
+
if (wanted.length && atEnd) {
|
|
260
|
+
staying = patchSection(tr, last, wanted, children, noteType);
|
|
261
|
+
} else if (wanted.length || sections.length) {
|
|
262
|
+
for (const { pos, node } of [...sections].reverse()) {
|
|
263
|
+
const from = tr.mapping.map(pos);
|
|
264
|
+
const to = tr.mapping.map(pos + node.nodeSize);
|
|
265
|
+
if (tr.doc.childCount === 1 && !wanted.length) {
|
|
266
|
+
tr.replaceWith(from, to, schema.nodes.paragraph.create());
|
|
267
|
+
} else tr.delete(from, to);
|
|
268
|
+
}
|
|
269
|
+
if (wanted.length) {
|
|
270
|
+
const notesNodes = wanted.map((note) => noteType.create({ id: note.id }, note.content));
|
|
271
|
+
tr.insert(tr.doc.content.size, sectionType.create(null, notesNodes));
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (focusId) placeCursor(tr, focusId, 0);
|
|
275
|
+
else if (cursor && !staying.has(cursor.child)) placeCursor(tr, cursor.id, cursor.offset);
|
|
276
|
+
return tr.docChanged || tr.selectionSet ? tr : null;
|
|
277
|
+
}
|
|
278
|
+
function inNote(state) {
|
|
279
|
+
const { $from } = state.selection;
|
|
280
|
+
for (let depth = $from.depth; depth > 0; depth--) {
|
|
281
|
+
if ($from.node(depth).type.name === "footnote") return true;
|
|
282
|
+
}
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
var insertFootnote = (state, dispatch) => {
|
|
286
|
+
const refType = state.schema.nodes.footnote_ref;
|
|
287
|
+
if (!refType) return false;
|
|
288
|
+
const { $to } = state.selection;
|
|
289
|
+
if (!$to.parent.inlineContent) return false;
|
|
290
|
+
if (!$to.parent.type.validContent($to.parent.content)) return false;
|
|
291
|
+
if (!$to.parent.canReplaceWith($to.index(), $to.index(), refType)) return false;
|
|
292
|
+
if (inNote(state)) return false;
|
|
293
|
+
if (dispatch) {
|
|
294
|
+
const { refs, sections } = scan(state.doc);
|
|
295
|
+
const used = new Set(refs.map(({ node }) => footnoteId(node.attrs.id)));
|
|
296
|
+
for (const { node } of sections) node.forEach((note) => used.add(footnoteId(note.attrs.id)));
|
|
297
|
+
const id = freshId(used);
|
|
298
|
+
dispatch(
|
|
299
|
+
state.tr.insert($to.pos, refType.create({ id, number: 1 })).setMeta(FOCUS_NOTE, id).scrollIntoView()
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
return true;
|
|
303
|
+
};
|
|
304
|
+
var updateFootnotes = (state, dispatch) => {
|
|
305
|
+
const tr = safeSync(state);
|
|
306
|
+
if (tr && dispatch) dispatch(tr);
|
|
307
|
+
return true;
|
|
308
|
+
};
|
|
309
|
+
function pastedIntoNote(slice, view) {
|
|
310
|
+
const { $from } = view.state.selection;
|
|
311
|
+
if ($from.parent.type.name !== "footnote") return slice;
|
|
312
|
+
const breakType = view.state.schema.nodes.hard_break;
|
|
313
|
+
const inline = [];
|
|
314
|
+
let lines = 0;
|
|
315
|
+
const take = (node) => {
|
|
316
|
+
if (node.type.name !== "footnote_ref") inline.push(node);
|
|
317
|
+
};
|
|
318
|
+
slice.content.descendants((node) => {
|
|
319
|
+
if (node.isInline) {
|
|
320
|
+
take(node);
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
if (!node.isTextblock) return true;
|
|
324
|
+
if (lines++ && breakType) inline.push(breakType.create());
|
|
325
|
+
node.forEach(take);
|
|
326
|
+
return false;
|
|
327
|
+
});
|
|
328
|
+
return new Slice(Fragment.from(inline), 0, 0);
|
|
329
|
+
}
|
|
330
|
+
function noteKeys(view, event) {
|
|
331
|
+
if (!view.editable || event.isComposing || event.keyCode === 229) return false;
|
|
332
|
+
if (event.altKey || event.ctrlKey || event.metaKey) return false;
|
|
333
|
+
const { state } = view;
|
|
334
|
+
const { $from, $to, empty } = state.selection;
|
|
335
|
+
if ($from.parent.type.name !== "footnote" || !$from.sameParent($to)) return false;
|
|
336
|
+
let handled = false;
|
|
337
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
338
|
+
const breakType = state.schema.nodes.hard_break;
|
|
339
|
+
if (breakType)
|
|
340
|
+
view.dispatch(state.tr.replaceSelectionWith(breakType.create()).scrollIntoView());
|
|
341
|
+
handled = true;
|
|
342
|
+
} else if (event.key === "Backspace" && empty && $from.parentOffset === 0) {
|
|
343
|
+
handled = true;
|
|
344
|
+
} else if (event.key === "Delete" && empty && $from.parentOffset === $from.parent.content.size) {
|
|
345
|
+
handled = true;
|
|
346
|
+
}
|
|
347
|
+
if (handled) event.preventDefault();
|
|
348
|
+
return handled;
|
|
349
|
+
}
|
|
350
|
+
function jumpTo(editor, target, id) {
|
|
351
|
+
const { state } = editor.view;
|
|
352
|
+
let found = null;
|
|
353
|
+
state.doc.descendants((node, pos) => {
|
|
354
|
+
if (found !== null) return false;
|
|
355
|
+
const type = target === "ref" ? "footnote_ref" : "footnote";
|
|
356
|
+
if (node.type.name === type && footnoteId(node.attrs.id) === id) found = pos;
|
|
357
|
+
return true;
|
|
358
|
+
});
|
|
359
|
+
if (found === null) return false;
|
|
360
|
+
const selection = target === "ref" ? NodeSelection.create(state.doc, found) : TextSelection.create(state.doc, found + 1);
|
|
361
|
+
editor.view.dispatch(state.tr.setSelection(selection).scrollIntoView());
|
|
362
|
+
editor.focus();
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
var footnotes_ui_default = definePlugin({
|
|
366
|
+
name: "footnotes-ui",
|
|
367
|
+
requires: ["footnotes"],
|
|
368
|
+
toolbar: "footnotes",
|
|
369
|
+
prosemirrorPlugins: (editor) => [
|
|
370
|
+
new Plugin({
|
|
371
|
+
key: syncKey,
|
|
372
|
+
state: {
|
|
373
|
+
init: (_config, state) => ({ has: hasFootnotes(state.doc), dirty: false }),
|
|
374
|
+
apply(tr, value, _old, state) {
|
|
375
|
+
if (!tr.docChanged) return value;
|
|
376
|
+
const touched = touchesFootnotes(tr);
|
|
377
|
+
return {
|
|
378
|
+
has: touched ? hasFootnotes(state.doc) : value.has,
|
|
379
|
+
dirty: tr.getMeta(REMOTE_CHANGE_META) ? value.dirty || touched : false
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
appendTransaction(transactions, oldState, state) {
|
|
384
|
+
const local = transactions.filter((tr) => tr.docChanged && !tr.getMeta(REMOTE_CHANGE_META));
|
|
385
|
+
if (!local.length) return null;
|
|
386
|
+
const focus = local.map((tr) => tr.getMeta(FOCUS_NOTE)).find(Boolean);
|
|
387
|
+
const needed = !!focus || !!syncKey.getState(oldState)?.dirty || local.some(touchesFootnotes) || // Text typed after the section: the section moves back to the end.
|
|
388
|
+
!!syncKey.getState(state)?.has && state.doc.lastChild?.type.name !== "footnotes";
|
|
389
|
+
return needed ? safeSync(state, focus) : null;
|
|
390
|
+
},
|
|
391
|
+
props: {
|
|
392
|
+
transformPasted: pastedIntoNote,
|
|
393
|
+
handleDOMEvents: {
|
|
394
|
+
keydown: noteKeys,
|
|
395
|
+
click: (_view, event) => {
|
|
396
|
+
const target = event.target;
|
|
397
|
+
const back = target?.closest?.("a.mce-footnotes-backlink");
|
|
398
|
+
if (back) {
|
|
399
|
+
event.preventDefault();
|
|
400
|
+
const id = footnoteId(back.getAttribute("href")?.replace(/^#footnote-ref-/, ""));
|
|
401
|
+
return jumpTo(editor, "ref", id);
|
|
402
|
+
}
|
|
403
|
+
const ref = target?.closest?.("sup.mce-footnote");
|
|
404
|
+
if (ref) {
|
|
405
|
+
event.preventDefault();
|
|
406
|
+
const id = footnoteId(
|
|
407
|
+
ref.querySelector("a")?.getAttribute("href")?.replace(/^#footnote-/, "")
|
|
408
|
+
);
|
|
409
|
+
return jumpTo(editor, "note", id);
|
|
410
|
+
}
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
})
|
|
416
|
+
],
|
|
417
|
+
setup(editor) {
|
|
418
|
+
const labels = pickLabels(editor, "footnotes", LABELS);
|
|
419
|
+
const isEnabled = (e) => e.isEditable() && e.isAllowed("footnotes");
|
|
420
|
+
editor.ui.registry.addButton("footnotes", {
|
|
421
|
+
icon: icons.footnote,
|
|
422
|
+
tooltip: labels.insert,
|
|
423
|
+
isEnabled: (e) => isEnabled(e) && e.can(insertFootnote),
|
|
424
|
+
onAction: (e) => e.exec(insertFootnote)
|
|
425
|
+
});
|
|
426
|
+
editor.ui.registry.addMenuItem("footnotes", {
|
|
427
|
+
text: labels.insert,
|
|
428
|
+
icon: icons.footnote,
|
|
429
|
+
isEnabled: (e) => isEnabled(e) && e.can(insertFootnote),
|
|
430
|
+
onAction: (e) => e.exec(insertFootnote)
|
|
431
|
+
});
|
|
432
|
+
editor.ui.registry.addButton("footnotesupdate", {
|
|
433
|
+
icon: icons.footnotesUpdate,
|
|
434
|
+
tooltip: labels.update,
|
|
435
|
+
isEnabled,
|
|
436
|
+
onAction: (e) => e.exec(updateFootnotes)
|
|
437
|
+
});
|
|
438
|
+
const tr = safeSync(editor.view.state);
|
|
439
|
+
if (tr) editor.view.dispatch(tr.setMeta("addToHistory", false));
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
export {
|
|
443
|
+
LABELS,
|
|
444
|
+
footnotes_ui_default as default,
|
|
445
|
+
insertFootnote,
|
|
446
|
+
syncFootnotes,
|
|
447
|
+
updateFootnotes
|
|
448
|
+
};
|
|
449
|
+
//# sourceMappingURL=footnotes-ui-KPKFDSN7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugins/footnotes-ui.ts"],"sourcesContent":["import { Fragment, Slice, type Node as PMNode, type NodeType } from 'prosemirror-model';\nimport {\n NodeSelection,\n Plugin,\n PluginKey,\n TextSelection,\n type Command,\n type EditorState,\n type Transaction,\n} from 'prosemirror-state';\nimport type { EditorView } from 'prosemirror-view';\nimport { REMOTE_CHANGE_META, type Editor } from '../editor';\nimport { definePlugin } from '../plugins';\nimport { icons } from '../ui/icons';\nimport { footnoteId } from './footnotes';\nimport { pickLabels } from './shared';\n\n/**\n * The footnotes plugin's behavior: \"Insert footnote\" puts a reference at the cursor and the cursor into\n * its note; after every change to footnotes the references are numbered in order of appearance and the\n * section at the end holds exactly their notes, in that order. A deleted reference takes its note along,\n * a copied one gets its own note (a copy of the text), and the section goes away with the last footnote.\n *\n * Changes are as small as they can be: inserting a footnote inserts one note and deleting one deletes\n * one, so a co-author typing in another note keeps every letter. A note split by a paste (or by Enter\n * where the key doesn't reach us) is joined back with a line break: no text is dropped.\n */\n\nexport const LABELS = {\n en: {\n insert: 'Insert footnote',\n update: 'Update footnotes',\n },\n};\n\ninterface SyncState {\n /** Whether the document has footnotes (counted again only after changes to them). */\n has: boolean;\n /** A co-author changed footnotes: the next change made here brings them in step. */\n dirty: boolean;\n}\n\nconst syncKey = new PluginKey<SyncState>('nova-footnotes-sync');\n/** Transaction meta: the id of a new footnote whose note gets the cursor. */\nconst FOCUS_NOTE = 'nova:footnote-focus';\nconst FOOTNOTE_NODES = new Set(['footnote_ref', 'footnote', 'footnotes']);\n\ninterface Found {\n pos: number;\n node: PMNode;\n}\n\nfunction scan(doc: PMNode): { refs: Found[]; sections: Found[] } {\n const refs: Found[] = [];\n const sections: Found[] = [];\n doc.descendants((node, pos) => {\n if (node.type.name === 'footnotes') {\n sections.push({ pos, node });\n return false;\n }\n // A paragraph with content it can't hold (JSON from elsewhere, a code block with a reference in\n // it): its references are left alone, a change there would throw.\n if (node.isTextblock && !node.type.validContent(node.content)) return false;\n if (node.type.name === 'footnote_ref') refs.push({ pos, node });\n return true;\n });\n return { refs, sections };\n}\n\nlet warned = false;\n\n/** syncFootnotes that never breaks the change it follows: a document it can't fix stays as it is. */\nfunction safeSync(state: EditorState, focusId?: string): Transaction | null {\n try {\n return syncFootnotes(state, focusId);\n } catch (error) {\n if (!warned) {\n warned = true;\n console.warn('[nova] footnotes: could not bring them in step', error);\n }\n return null;\n }\n}\n\nfunction hasFootnotes(doc: PMNode): boolean {\n let found = false;\n doc.descendants((node) => {\n if (FOOTNOTE_NODES.has(node.type.name)) found = true;\n return !found;\n });\n return found;\n}\n\nconst touchedCache = new WeakMap<Transaction, boolean>();\n\n/**\n * Whether a transaction added, removed, cut or joined footnote nodes. Typing inside a note or anywhere\n * else doesn't count, so most keystrokes cost nothing here.\n */\nfunction touchesFootnotes(tr: Transaction): boolean {\n const cached = touchedCache.get(tr);\n if (cached !== undefined) return cached;\n let touched = false;\n const check = (doc: PMNode, from: number, to: number) => {\n if (touched || from >= to) return;\n doc.nodesBetween(from, to, (node, pos) => {\n if (FOOTNOTE_NODES.has(node.type.name)) {\n const end = pos + node.nodeSize;\n // Its start or its end is in the range: the node itself comes, goes or is cut.\n if ((pos >= from && pos < to) || (end > from && end <= to)) touched = true;\n }\n return !touched;\n });\n };\n tr.steps.forEach((step, index) => {\n step.getMap().forEach((oldStart, oldEnd, newStart, newEnd) => {\n check(tr.docs[index]!, oldStart, oldEnd);\n check(tr.docs[index + 1] ?? tr.doc, newStart, newEnd);\n });\n });\n touchedCache.set(tr, touched);\n return touched;\n}\n\n/** A new footnote id, not used yet. */\nfunction freshId(used: Set<string>): string {\n let id = '';\n do id = Math.random().toString(36).slice(2, 10);\n while (!id || used.has(id));\n used.add(id);\n return id;\n}\n\n/** A note as it will be: its id, its content and the node it comes from while that stays as it is. */\ninterface Note {\n id: string;\n content: Fragment;\n from: Found | null;\n}\n\n/** Where the cursor goes back to: the note node it was in, the note it belongs to and the offset there. */\ninterface CursorSpot {\n child: Found;\n id: string;\n offset: number;\n}\n\n/**\n * The notes of the sections by id (the first note with an id wins). A stray piece — a note without an\n * id or with an id taken already, left by a paste or a split — joins the note before it after a line\n * break (or the next note, when it comes first), so its text stays.\n */\nfunction collectNotes(\n state: EditorState,\n sections: Found[],\n): { notes: Map<string, Note>; children: Found[]; cursor: CursorSpot | null } {\n const breakType = state.schema.nodes.hard_break;\n const separator = breakType ? Fragment.from(breakType.create()) : Fragment.empty;\n const head = state.selection.head;\n const notes = new Map<string, Note>();\n const children: Found[] = [];\n let cursor: CursorSpot | null = null;\n for (const section of sections) {\n let previous: Note | null = null;\n // Stray pieces before the section's first note: they go to the start of that note.\n let lead: Fragment | null = null;\n let leadCursor: { child: Found; offset: number } | null = null;\n section.node.forEach((node, offset) => {\n const child: Found = { pos: section.pos + 1 + offset, node };\n children.push(child);\n const inside = head > child.pos && head < child.pos + node.nodeSize;\n const at = head - child.pos - 1;\n const id = footnoteId(node.attrs.id);\n if (id && !notes.has(id)) {\n const note: Note = { id, content: node.content, from: child };\n let shift = 0;\n if (lead?.size) {\n shift = lead.size + separator.size;\n note.content = lead.append(separator).append(node.content);\n note.from = null;\n }\n if (leadCursor) cursor = { child: leadCursor.child, id, offset: leadCursor.offset };\n if (inside) cursor = { child, id, offset: shift + at };\n lead = null;\n leadCursor = null;\n notes.set(id, note);\n previous = note;\n return;\n }\n if (!previous) {\n const base = lead?.size ? lead.size + (node.content.size ? separator.size : 0) : 0;\n if (inside) leadCursor = { child, offset: base + at };\n lead = lead?.size ? (node.content.size ? lead.append(separator) : lead) : Fragment.empty;\n lead = lead.append(node.content);\n return;\n }\n const target: Note = previous;\n const base = target.content.size + (node.content.size ? separator.size : 0);\n if (node.content.size) {\n target.content = target.content.append(separator).append(node.content);\n target.from = null;\n }\n if (inside) cursor = { child, id: target.id, offset: base + at };\n });\n }\n return { notes, children, cursor };\n}\n\n/** Indexes (into `values`) of a longest increasing run, not necessarily adjacent. */\nfunction increasing(values: number[]): number[] {\n const tails: number[] = [];\n const previous: number[] = values.map(() => -1);\n values.forEach((value, index) => {\n let low = 0;\n let high = tails.length;\n while (low < high) {\n const middle = (low + high) >> 1;\n if (values[tails[middle]!]! < value) low = middle + 1;\n else high = middle;\n }\n if (low > 0) previous[index] = tails[low - 1]!;\n tails[low] = index;\n });\n const out: number[] = [];\n for (let index = tails.length ? tails[tails.length - 1]! : -1; index >= 0;) {\n out.push(index);\n index = previous[index]!;\n }\n return out.reverse();\n}\n\n/**\n * The one section at the end, put in step by inserting and deleting single notes: the notes that are\n * wanted, unchanged and already in order stay as they are. Returns the note nodes that stayed.\n */\nfunction patchSection(\n tr: Transaction,\n section: Found,\n wanted: Note[],\n children: Found[],\n noteType: NodeType,\n): Set<Found> {\n const order = new Map(wanted.map((note, index) => [note, index]));\n const present = wanted.filter((note) => note.from).sort((a, b) => a.from!.pos - b.from!.pos);\n const keep = new Set(increasing(present.map((note) => order.get(note)!)).map((i) => present[i]!));\n // Inserts first, so the section always has a note (its content can't be empty).\n let at = tr.mapping.map(section.pos + 1);\n for (const note of wanted) {\n if (keep.has(note)) {\n at = tr.mapping.map(note.from!.pos) + note.from!.node.nodeSize;\n continue;\n }\n const node = noteType.create({ id: note.id }, note.content);\n tr.insert(at, node);\n at += node.nodeSize;\n }\n const staying = new Set([...keep].map((note) => note.from!));\n for (let index = children.length - 1; index >= 0; index--) {\n const child = children[index]!;\n if (staying.has(child)) continue;\n // The end sticks to the left: a note inserted right after this one is not deleted with it.\n tr.delete(tr.mapping.map(child.pos), tr.mapping.map(child.pos + child.node.nodeSize, -1));\n }\n return staying;\n}\n\n/** The cursor into a note of the section at the end. */\nfunction placeCursor(tr: Transaction, id: string, offset: number): void {\n const section = tr.doc.lastChild;\n if (!section || section.type.name !== 'footnotes') return;\n let pos = tr.doc.content.size - section.nodeSize + 1;\n section.forEach((note) => {\n if (footnoteId(note.attrs.id) === id) {\n const inNote = Math.max(0, Math.min(offset, note.content.size));\n tr.setSelection(TextSelection.create(tr.doc, pos + 1 + inNote));\n }\n pos += note.nodeSize;\n });\n}\n\n/** Brings references and notes in step; null when they already are. */\nexport function syncFootnotes(state: EditorState, focusId?: string): Transaction | null {\n const { schema } = state;\n const refType = schema.nodes.footnote_ref;\n const sectionType = schema.nodes.footnotes;\n const noteType = schema.nodes.footnote;\n if (!refType || !sectionType || !noteType) return null;\n const { refs, sections } = scan(state.doc);\n const { notes, children, cursor } = collectNotes(state, sections);\n const tr = state.tr;\n\n // References: numbered in order. A copy (its id seen before) or one without an id gets a new id\n // and a note of its own with a copy of the text.\n const used = new Set<string>(notes.keys());\n for (const { node } of refs) used.add(footnoteId(node.attrs.id));\n const seen = new Set<string>();\n const wanted: Note[] = [];\n refs.forEach(({ pos, node }, index) => {\n const original = footnoteId(node.attrs.id);\n const note = notes.get(original);\n const id = original && !seen.has(original) ? original : freshId(used);\n seen.add(id);\n // Attribute steps: the reference stays the same node (a selection on it too).\n if (node.attrs.id !== id) tr.setNodeAttribute(pos, 'id', id);\n if (node.attrs.number !== index + 1) tr.setNodeAttribute(pos, 'number', index + 1);\n wanted.push(\n id === original && note ? note : { id, content: note?.content ?? Fragment.empty, from: null },\n );\n });\n\n let staying = new Set<Found>();\n const last = sections[sections.length - 1];\n const atEnd =\n sections.length === 1 && last && last.pos + last.node.nodeSize === state.doc.content.size;\n if (wanted.length && atEnd) {\n staying = patchSection(tr, last, wanted, children, noteType);\n } else if (wanted.length || sections.length) {\n // Several sections, or text after the section: one section at the end, built anew.\n for (const { pos, node } of [...sections].reverse()) {\n const from = tr.mapping.map(pos);\n const to = tr.mapping.map(pos + node.nodeSize);\n // The document can't be left empty.\n if (tr.doc.childCount === 1 && !wanted.length) {\n tr.replaceWith(from, to, schema.nodes.paragraph!.create());\n } else tr.delete(from, to);\n }\n if (wanted.length) {\n const notesNodes = wanted.map((note) => noteType.create({ id: note.id }, note.content));\n tr.insert(tr.doc.content.size, sectionType.create(null, notesNodes));\n }\n }\n\n // The cursor stays in its note, or goes into a new one.\n if (focusId) placeCursor(tr, focusId, 0);\n else if (cursor && !staying.has(cursor.child)) placeCursor(tr, cursor.id, cursor.offset);\n return tr.docChanged || tr.selectionSet ? tr : null;\n}\n\n/** Where the cursor is inside a note, if it is. */\nfunction inNote(state: EditorState): boolean {\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth--) {\n if ($from.node(depth).type.name === 'footnote') return true;\n }\n return false;\n}\n\n/** Inserts a reference after the selection; its note is created and gets the cursor. */\nexport const insertFootnote: Command = (state, dispatch) => {\n const refType = state.schema.nodes.footnote_ref;\n if (!refType) return false;\n const { $to } = state.selection;\n if (!$to.parent.inlineContent) return false;\n // A paragraph with content it can't hold (JSON from elsewhere) can't be asked what fits in it.\n if (!$to.parent.type.validContent($to.parent.content)) return false;\n if (!$to.parent.canReplaceWith($to.index(), $to.index(), refType)) return false;\n // Not inside a note: a footnote of a footnote has nowhere to go.\n if (inNote(state)) return false;\n if (dispatch) {\n const { refs, sections } = scan(state.doc);\n const used = new Set(refs.map(({ node }) => footnoteId(node.attrs.id)));\n for (const { node } of sections) node.forEach((note) => used.add(footnoteId(note.attrs.id)));\n const id = freshId(used);\n dispatch(\n state.tr\n .insert($to.pos, refType.create({ id, number: 1 }))\n .setMeta(FOCUS_NOTE, id)\n .scrollIntoView(),\n );\n }\n return true;\n};\n\n/** Numbers and notes brought in step now (they are kept in step after every change anyway). */\nexport const updateFootnotes: Command = (state, dispatch) => {\n const tr = safeSync(state);\n if (tr && dispatch) dispatch(tr);\n return true;\n};\n\n/**\n * Keys in a note: Enter is a line break (a note is one paragraph), Backspace at its start and Delete at\n * its end don't join it with the next note. On keydown, so this comes before the editor's keymap.\n */\n/**\n * Pasted into a note: paragraphs become lines of the note (a note is one paragraph; otherwise the paste\n * would carry the rest of the note out into the text). Footnote references don't go into notes.\n */\nfunction pastedIntoNote(slice: Slice, view: EditorView): Slice {\n const { $from } = view.state.selection;\n if ($from.parent.type.name !== 'footnote') return slice;\n const breakType = view.state.schema.nodes.hard_break;\n const inline: PMNode[] = [];\n let lines = 0;\n const take = (node: PMNode) => {\n if (node.type.name !== 'footnote_ref') inline.push(node);\n };\n slice.content.descendants((node) => {\n if (node.isInline) {\n take(node);\n return false;\n }\n if (!node.isTextblock) return true;\n if (lines++ && breakType) inline.push(breakType.create());\n node.forEach(take);\n return false;\n });\n return new Slice(Fragment.from(inline), 0, 0);\n}\n\nfunction noteKeys(view: EditorView, event: KeyboardEvent): boolean {\n if (!view.editable || event.isComposing || event.keyCode === 229) return false;\n if (event.altKey || event.ctrlKey || event.metaKey) return false;\n const { state } = view;\n const { $from, $to, empty } = state.selection;\n if ($from.parent.type.name !== 'footnote' || !$from.sameParent($to)) return false;\n let handled = false;\n if (event.key === 'Enter' && !event.shiftKey) {\n const breakType = state.schema.nodes.hard_break;\n if (breakType)\n view.dispatch(state.tr.replaceSelectionWith(breakType.create()).scrollIntoView());\n handled = true;\n } else if (event.key === 'Backspace' && empty && $from.parentOffset === 0) {\n handled = true;\n } else if (event.key === 'Delete' && empty && $from.parentOffset === $from.parent.content.size) {\n handled = true;\n }\n if (handled) event.preventDefault();\n return handled;\n}\n\n/** The reference of a note, or the note of a reference: where a click on it leads. */\nfunction jumpTo(editor: Editor, target: 'ref' | 'note', id: string): boolean {\n const { state } = editor.view;\n let found: number | null = null;\n state.doc.descendants((node, pos) => {\n if (found !== null) return false;\n const type = target === 'ref' ? 'footnote_ref' : 'footnote';\n if (node.type.name === type && footnoteId(node.attrs.id) === id) found = pos;\n return true;\n });\n if (found === null) return false;\n const selection =\n target === 'ref'\n ? NodeSelection.create(state.doc, found)\n : TextSelection.create(state.doc, found + 1);\n editor.view.dispatch(state.tr.setSelection(selection).scrollIntoView());\n editor.focus();\n return true;\n}\n\nexport default definePlugin({\n name: 'footnotes-ui',\n requires: ['footnotes'],\n toolbar: 'footnotes',\n prosemirrorPlugins: (editor) => [\n new Plugin<SyncState>({\n key: syncKey,\n state: {\n init: (_config, state) => ({ has: hasFootnotes(state.doc), dirty: false }),\n apply(tr, value, _old, state) {\n if (!tr.docChanged) return value;\n const touched = touchesFootnotes(tr);\n return {\n has: touched ? hasFootnotes(state.doc) : value.has,\n dirty: tr.getMeta(REMOTE_CHANGE_META) ? value.dirty || touched : false,\n };\n },\n },\n appendTransaction(transactions, oldState, state) {\n // A co-author's change was put in step on their side; if not (two people at once), the next\n // change made here does it.\n const local = transactions.filter((tr) => tr.docChanged && !tr.getMeta(REMOTE_CHANGE_META));\n if (!local.length) return null;\n const focus = local.map((tr) => tr.getMeta(FOCUS_NOTE) as string | undefined).find(Boolean);\n const needed =\n !!focus ||\n !!syncKey.getState(oldState)?.dirty ||\n local.some(touchesFootnotes) ||\n // Text typed after the section: the section moves back to the end.\n (!!syncKey.getState(state)?.has && state.doc.lastChild?.type.name !== 'footnotes');\n return needed ? safeSync(state, focus) : null;\n },\n props: {\n transformPasted: pastedIntoNote,\n handleDOMEvents: {\n keydown: noteKeys,\n click: (_view, event) => {\n const target = event.target as HTMLElement | null;\n const back = target?.closest?.('a.mce-footnotes-backlink');\n if (back) {\n event.preventDefault();\n const id = footnoteId(back.getAttribute('href')?.replace(/^#footnote-ref-/, ''));\n return jumpTo(editor, 'ref', id);\n }\n const ref = target?.closest?.('sup.mce-footnote');\n if (ref) {\n event.preventDefault();\n const id = footnoteId(\n ref\n .querySelector('a')\n ?.getAttribute('href')\n ?.replace(/^#footnote-/, ''),\n );\n return jumpTo(editor, 'note', id);\n }\n return false;\n },\n },\n },\n }),\n ],\n setup(editor) {\n const labels = pickLabels(editor, 'footnotes', LABELS);\n const isEnabled = (e: Editor) => e.isEditable() && e.isAllowed('footnotes');\n editor.ui.registry.addButton('footnotes', {\n icon: icons.footnote,\n tooltip: labels.insert,\n isEnabled: (e) => isEnabled(e) && e.can(insertFootnote),\n onAction: (e) => e.exec(insertFootnote),\n });\n editor.ui.registry.addMenuItem('footnotes', {\n text: labels.insert,\n icon: icons.footnote,\n isEnabled: (e) => isEnabled(e) && e.can(insertFootnote),\n onAction: (e) => e.exec(insertFootnote),\n });\n editor.ui.registry.addButton('footnotesupdate', {\n icon: icons.footnotesUpdate,\n tooltip: labels.update,\n isEnabled,\n onAction: (e) => e.exec(updateFootnotes),\n });\n // Footnotes loaded with the content (before this part) get their numbers and notes in step.\n const tr = safeSync(editor.view.state);\n if (tr) editor.view.dispatch(tr.setMeta('addToHistory', false));\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,UAAU,aAAiD;AACpE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAmBA,IAAM,SAAS;AAAA,EACpB,IAAI;AAAA,IACF,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AACF;AASA,IAAM,UAAU,IAAI,UAAqB,qBAAqB;AAE9D,IAAM,aAAa;AACnB,IAAM,iBAAiB,oBAAI,IAAI,CAAC,gBAAgB,YAAY,WAAW,CAAC;AAOxE,SAAS,KAAK,KAAmD;AAC/D,QAAM,OAAgB,CAAC;AACvB,QAAM,WAAoB,CAAC;AAC3B,MAAI,YAAY,CAAC,MAAM,QAAQ;AAC7B,QAAI,KAAK,KAAK,SAAS,aAAa;AAClC,eAAS,KAAK,EAAE,KAAK,KAAK,CAAC;AAC3B,aAAO;AAAA,IACT;AAGA,QAAI,KAAK,eAAe,CAAC,KAAK,KAAK,aAAa,KAAK,OAAO,EAAG,QAAO;AACtE,QAAI,KAAK,KAAK,SAAS,eAAgB,MAAK,KAAK,EAAE,KAAK,KAAK,CAAC;AAC9D,WAAO;AAAA,EACT,CAAC;AACD,SAAO,EAAE,MAAM,SAAS;AAC1B;AAEA,IAAI,SAAS;AAGb,SAAS,SAAS,OAAoB,SAAsC;AAC1E,MAAI;AACF,WAAO,cAAc,OAAO,OAAO;AAAA,EACrC,SAAS,OAAO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