@novaprose/core 0.6.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.
- package/README.md +20 -4
- 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-7KQU7DD3.js +449 -0
- package/dist/a11ychecker-7KQU7DD3.js.map +1 -0
- package/dist/accordion-ui-FGN3I5UF.js +201 -0
- package/dist/accordion-ui-FGN3I5UF.js.map +1 -0
- package/dist/advcode-65Z2ELUB.js +51 -0
- package/dist/advcode-65Z2ELUB.js.map +1 -0
- package/dist/advcode-editor-WIOCY552.js +257 -0
- package/dist/advcode-editor-WIOCY552.js.map +1 -0
- package/dist/{advlist-K2U3VPH2.js → advlist-CEHE6YXS.js} +14 -20
- package/dist/advlist-CEHE6YXS.js.map +1 -0
- package/dist/advtable-ui-5CBOPTHW.js +364 -0
- package/dist/advtable-ui-5CBOPTHW.js.map +1 -0
- package/dist/ai-IRQYZHRK.js +1485 -0
- package/dist/ai-IRQYZHRK.js.map +1 -0
- package/dist/anchor-ui-NWIIRKGY.js +81 -0
- package/dist/anchor-ui-NWIIRKGY.js.map +1 -0
- package/dist/autocorrect-6GFLVDPC.js +851 -0
- package/dist/autocorrect-6GFLVDPC.js.map +1 -0
- package/dist/{autolink-XWDTLY37.js → autolink-N427KVQO.js} +13 -7
- package/dist/autolink-N427KVQO.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-MWNRUNU3.js → autosave-L7OZ3KLK.js} +9 -13
- package/dist/autosave-L7OZ3KLK.js.map +1 -0
- package/dist/casechange-5G6RAJ7K.js +201 -0
- package/dist/casechange-5G6RAJ7K.js.map +1 -0
- package/dist/{charmap-ADLYOIB3.js → charmap-5CBBDWOP.js} +9 -14
- package/dist/charmap-5CBBDWOP.js.map +1 -0
- package/dist/checklist-HM4VXZKY.js +189 -0
- package/dist/checklist-HM4VXZKY.js.map +1 -0
- package/dist/chunk-23ZLVT5D.js +163 -0
- package/dist/chunk-23ZLVT5D.js.map +1 -0
- package/dist/chunk-3BOK3S3T.js +26 -0
- package/dist/chunk-3BOK3S3T.js.map +1 -0
- package/dist/chunk-4I4AYH2K.js +101 -0
- package/dist/chunk-4I4AYH2K.js.map +1 -0
- package/dist/chunk-4VPDY3LF.js +27 -0
- 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-5VCESSQB.js +137 -0
- package/dist/chunk-5VCESSQB.js.map +1 -0
- package/dist/chunk-66INZHZ2.js +79 -0
- package/dist/chunk-66INZHZ2.js.map +1 -0
- package/dist/chunk-6LQM7G4V.js +159 -0
- package/dist/chunk-6LQM7G4V.js.map +1 -0
- package/dist/chunk-6YSQGFV7.js +893 -0
- package/dist/chunk-6YSQGFV7.js.map +1 -0
- package/dist/{chunk-GHEFKKRC.js → chunk-AC3YCAX4.js} +108 -29
- package/dist/chunk-AC3YCAX4.js.map +1 -0
- package/dist/{chunk-NPKAIW34.js → chunk-ADRPQLZ2.js} +50 -1
- package/dist/chunk-ADRPQLZ2.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-AQV6FIKK.js +259 -0
- package/dist/chunk-AQV6FIKK.js.map +1 -0
- package/dist/chunk-AUQSATWL.js +322 -0
- package/dist/chunk-AUQSATWL.js.map +1 -0
- package/dist/chunk-C326LHHU.js +143 -0
- package/dist/chunk-C326LHHU.js.map +1 -0
- package/dist/chunk-DEYYVZ7O.js +393 -0
- package/dist/chunk-DEYYVZ7O.js.map +1 -0
- package/dist/chunk-EOJ5XHKA.js +160 -0
- package/dist/chunk-EOJ5XHKA.js.map +1 -0
- package/dist/chunk-EXX2S352.js +3642 -0
- package/dist/chunk-EXX2S352.js.map +1 -0
- package/dist/chunk-FTEA6L2Q.js +47 -0
- package/dist/chunk-FTEA6L2Q.js.map +1 -0
- package/dist/chunk-G74HNSB6.js +9 -0
- package/dist/chunk-G74HNSB6.js.map +1 -0
- package/dist/chunk-GHVB6SV4.js +177 -0
- package/dist/chunk-GHVB6SV4.js.map +1 -0
- package/dist/chunk-GTLE2HEW.js +108 -0
- package/dist/chunk-GTLE2HEW.js.map +1 -0
- package/dist/chunk-GXXXLPDQ.js +67 -0
- package/dist/chunk-GXXXLPDQ.js.map +1 -0
- package/dist/chunk-HC6RMBAD.js +163 -0
- package/dist/chunk-HC6RMBAD.js.map +1 -0
- package/dist/chunk-HNEAVVBC.js +98 -0
- package/dist/chunk-HNEAVVBC.js.map +1 -0
- package/dist/chunk-I7Y4KSM2.js +165 -0
- package/dist/chunk-I7Y4KSM2.js.map +1 -0
- package/dist/chunk-IG2BL4ON.js +127 -0
- package/dist/chunk-IG2BL4ON.js.map +1 -0
- package/dist/chunk-J6W2CDRF.js +425 -0
- package/dist/chunk-J6W2CDRF.js.map +1 -0
- package/dist/chunk-LVEQBNLX.js +207 -0
- package/dist/chunk-LVEQBNLX.js.map +1 -0
- package/dist/chunk-MZGNOHSY.js +176 -0
- package/dist/chunk-MZGNOHSY.js.map +1 -0
- package/dist/chunk-N32H37AJ.js +373 -0
- package/dist/chunk-N32H37AJ.js.map +1 -0
- package/dist/chunk-NTGEKGXU.js +263 -0
- package/dist/chunk-NTGEKGXU.js.map +1 -0
- package/dist/chunk-OFHGXYG3.js +140 -0
- package/dist/chunk-OFHGXYG3.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-P2UU2NLT.js +1149 -0
- package/dist/chunk-P2UU2NLT.js.map +1 -0
- package/dist/{chunk-HZRIBOPW.js → chunk-QU3KXMYT.js} +45 -3
- package/dist/chunk-QU3KXMYT.js.map +1 -0
- package/dist/chunk-S2XZRKHA.js +29 -0
- package/dist/chunk-S2XZRKHA.js.map +1 -0
- package/dist/chunk-SCIRO4XK.js +144 -0
- package/dist/chunk-SCIRO4XK.js.map +1 -0
- package/dist/chunk-T3IRLTKK.js +158 -0
- package/dist/chunk-T3IRLTKK.js.map +1 -0
- package/dist/chunk-TABIUD2L.js +66 -0
- package/dist/chunk-TABIUD2L.js.map +1 -0
- package/dist/{chunk-7ON7PR5R.js → chunk-TAM2FHKG.js} +374 -52
- package/dist/chunk-TAM2FHKG.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-VK6YF2AA.js +359 -0
- package/dist/chunk-VK6YF2AA.js.map +1 -0
- package/dist/chunk-WAOU5NGN.js +430 -0
- package/dist/chunk-WAOU5NGN.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-YDF55N6Z.js +164 -0
- package/dist/chunk-YDF55N6Z.js.map +1 -0
- package/dist/chunk-YDPZCVXS.js +923 -0
- package/dist/chunk-YDPZCVXS.js.map +1 -0
- package/dist/chunk-YG5V7POU.js +137 -0
- package/dist/chunk-YG5V7POU.js.map +1 -0
- package/dist/chunk-YVSUR7E5.js +151 -0
- package/dist/chunk-YVSUR7E5.js.map +1 -0
- package/dist/codesample-GHWIC7PT.js +546 -0
- package/dist/codesample-GHWIC7PT.js.map +1 -0
- package/dist/{comments-panel-FYJE3U64.js → comments-panel-SOLBZ46Q.js} +12 -6
- package/dist/comments-panel-SOLBZ46Q.js.map +1 -0
- package/dist/{directionality-XOHJFSL6.js → directionality-EGQKGDZA.js} +16 -11
- package/dist/directionality-EGQKGDZA.js.map +1 -0
- package/dist/document-0ft41E6d.d.ts +39 -0
- package/dist/document-IQqDDT4v.d.cts +39 -0
- package/dist/docx.cjs +23518 -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 +1821 -0
- package/dist/docx.js.map +1 -0
- package/dist/draghandle-U6CYZHPA.js +389 -0
- package/dist/draghandle-U6CYZHPA.js.map +1 -0
- package/dist/editimage-5EWPSM22.js +683 -0
- package/dist/editimage-5EWPSM22.js.map +1 -0
- package/dist/editor-BCMxe1M4.d.cts +2888 -0
- package/dist/editor-Dmtwjw2u.d.ts +2888 -0
- package/dist/email-ELNMEQ6E.js +177 -0
- package/dist/email-ELNMEQ6E.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-TP4N4ZGY.js → emoticons-EGHNZKSA.js} +9 -14
- package/dist/emoticons-EGHNZKSA.js.map +1 -0
- package/dist/exportpdf-4P7X3NY2.js +91 -0
- package/dist/exportpdf-4P7X3NY2.js.map +1 -0
- package/dist/exportword-JFJ3KTYZ.js +16 -0
- package/dist/exportword-JFJ3KTYZ.js.map +1 -0
- package/dist/footnotes-ui-FV6QRGDA.js +449 -0
- package/dist/footnotes-ui-FV6QRGDA.js.map +1 -0
- package/dist/form-dialog-SNWFPM2K.js +379 -0
- package/dist/form-dialog-SNWFPM2K.js.map +1 -0
- package/dist/formatpainter-IEXX27OJ.js +209 -0
- package/dist/formatpainter-IEXX27OJ.js.map +1 -0
- package/dist/fullpagehtml-ui-RE4C2NO5.js +220 -0
- package/dist/fullpagehtml-ui-RE4C2NO5.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 +482 -0
- package/dist/html-rules.cjs.map +1 -0
- package/dist/html-rules.d.cts +89 -0
- package/dist/html-rules.d.ts +89 -0
- package/dist/html-rules.js +417 -0
- package/dist/html-rules.js.map +1 -0
- package/dist/i18n/de.cjs +670 -0
- package/dist/i18n/de.cjs.map +1 -0
- package/dist/i18n/de.d.cts +9 -0
- package/dist/i18n/de.d.ts +9 -0
- package/dist/i18n/de.js +649 -0
- package/dist/i18n/de.js.map +1 -0
- package/dist/i18n/es.cjs +670 -0
- package/dist/i18n/es.cjs.map +1 -0
- package/dist/i18n/es.d.cts +9 -0
- package/dist/i18n/es.d.ts +9 -0
- package/dist/i18n/es.js +649 -0
- package/dist/i18n/es.js.map +1 -0
- package/dist/i18n/fr.cjs +670 -0
- package/dist/i18n/fr.cjs.map +1 -0
- package/dist/i18n/fr.d.cts +9 -0
- package/dist/i18n/fr.d.ts +9 -0
- package/dist/i18n/fr.js +649 -0
- package/dist/i18n/fr.js.map +1 -0
- package/dist/i18n/it.cjs +670 -0
- package/dist/i18n/it.cjs.map +1 -0
- package/dist/i18n/it.d.cts +9 -0
- package/dist/i18n/it.d.ts +9 -0
- package/dist/i18n/it.js +649 -0
- package/dist/i18n/it.js.map +1 -0
- package/dist/i18n/pt-BR.cjs +670 -0
- package/dist/i18n/pt-BR.cjs.map +1 -0
- package/dist/i18n/pt-BR.d.cts +9 -0
- package/dist/i18n/pt-BR.d.ts +9 -0
- package/dist/i18n/pt-BR.js +649 -0
- package/dist/i18n/pt-BR.js.map +1 -0
- package/dist/i18n/ru.cjs +670 -0
- package/dist/i18n/ru.cjs.map +1 -0
- package/dist/i18n/ru.d.cts +10 -0
- package/dist/i18n/ru.d.ts +10 -0
- package/dist/i18n/ru.js +649 -0
- package/dist/i18n/ru.js.map +1 -0
- package/dist/importcss-JLNIRKGH.js +127 -0
- package/dist/importcss-JLNIRKGH.js.map +1 -0
- package/dist/importword-D7Z6RXGQ.js +73 -0
- package/dist/importword-D7Z6RXGQ.js.map +1 -0
- package/dist/index-CZ9yDvmQ.d.cts +235 -0
- package/dist/index-CZ9yDvmQ.d.ts +235 -0
- package/dist/index.cjs +29531 -10134
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +160 -1828
- package/dist/index.d.ts +160 -1828
- package/dist/index.js +212 -1480
- package/dist/index.js.map +1 -1
- package/dist/{insertdatetime-T4SEMQWP.js → insertdatetime-YW2VHYZH.js} +10 -16
- package/dist/insertdatetime-YW2VHYZH.js.map +1 -0
- package/dist/linkchecker-3S3MCPOS.js +287 -0
- package/dist/linkchecker-3S3MCPOS.js.map +1 -0
- package/dist/markdown-26O3N3T2.js +136 -0
- package/dist/markdown-26O3N3T2.js.map +1 -0
- package/dist/markdown.cjs +356 -0
- package/dist/markdown.cjs.map +1 -0
- package/dist/markdown.d.cts +25 -0
- package/dist/markdown.d.ts +25 -0
- package/dist/markdown.js +10 -0
- package/dist/markdown.js.map +1 -0
- package/dist/math-ui-RUTCHTRY.js +157 -0
- package/dist/math-ui-RUTCHTRY.js.map +1 -0
- package/dist/media-ui-36TE3CJD.js +123 -0
- package/dist/media-ui-36TE3CJD.js.map +1 -0
- package/dist/mediaembed-ui-ZNTGZ2SQ.js +207 -0
- package/dist/mediaembed-ui-ZNTGZ2SQ.js.map +1 -0
- package/dist/mentions-ui-O4IPWQT4.js +58 -0
- package/dist/mentions-ui-O4IPWQT4.js.map +1 -0
- package/dist/mergetags-ui-HS3Q2R36.js +73 -0
- package/dist/mergetags-ui-HS3Q2R36.js.map +1 -0
- package/dist/{nonbreaking-HG5HV6AL.js → nonbreaking-GYRUH4UO.js} +10 -9
- package/dist/nonbreaking-GYRUH4UO.js.map +1 -0
- package/dist/pagebreak-ui-I4ZPYK3U.js +50 -0
- package/dist/pagebreak-ui-I4ZPYK3U.js.map +1 -0
- package/dist/pageembed-ui-WOY6VWRJ.js +172 -0
- package/dist/pageembed-ui-WOY6VWRJ.js.map +1 -0
- package/dist/pagelayout-ui-Y2IM7FJQ.js +236 -0
- package/dist/pagelayout-ui-Y2IM7FJQ.js.map +1 -0
- package/dist/paste-office-3A6KWKCV.js +520 -0
- package/dist/paste-office-3A6KWKCV.js.map +1 -0
- package/dist/permanentpen-6D5LLKFX.js +206 -0
- package/dist/permanentpen-6D5LLKFX.js.map +1 -0
- package/dist/print-MZMLQIQX.js +178 -0
- package/dist/print-MZMLQIQX.js.map +1 -0
- package/dist/{quickbars-4NU4SIPL.js → quickbars-UZ2Q67TX.js} +24 -12
- package/dist/quickbars-UZ2Q67TX.js.map +1 -0
- package/dist/{revisionhistory-3YQPLPLM.js → revisionhistory-ACRB23HL.js} +48 -173
- package/dist/revisionhistory-ACRB23HL.js.map +1 -0
- package/dist/save-72ZLF6AO.js +120 -0
- package/dist/save-72ZLF6AO.js.map +1 -0
- package/dist/search-bar-HTZQNPD3.js +212 -0
- package/dist/search-bar-HTZQNPD3.js.map +1 -0
- package/dist/spellchecker-DJ7SP5JY.js +474 -0
- package/dist/spellchecker-DJ7SP5JY.js.map +1 -0
- package/dist/suggestions-panel-RJXC4LCM.js +596 -0
- package/dist/suggestions-panel-RJXC4LCM.js.map +1 -0
- package/dist/suggestions-ui-PODMNH7D.js +395 -0
- package/dist/suggestions-ui-PODMNH7D.js.map +1 -0
- package/dist/table-OBHE465Y.js +54 -0
- package/dist/table-OBHE465Y.js.map +1 -0
- package/dist/table-dialogs-UMIIZQYE.js +119 -0
- package/dist/table-dialogs-UMIIZQYE.js.map +1 -0
- package/dist/tableofcontents-ui-U2PYNPX6.js +167 -0
- package/dist/tableofcontents-ui-U2PYNPX6.js.map +1 -0
- package/dist/template-YYC2MGVH.js +278 -0
- package/dist/template-YYC2MGVH.js.map +1 -0
- package/dist/typography-EQUXUXIN.js +399 -0
- package/dist/typography-EQUXUXIN.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-RTAYJOGR.js → visualblocks-O5QW7ZDT.js} +10 -9
- package/dist/visualblocks-O5QW7ZDT.js.map +1 -0
- package/dist/visualchars-UQFRWQPE.js +134 -0
- package/dist/visualchars-UQFRWQPE.js.map +1 -0
- package/package.json +96 -6
- package/src/style.css +440 -508
- package/dist/advlist-K2U3VPH2.js.map +0 -1
- package/dist/autolink-XWDTLY37.js.map +0 -1
- package/dist/autoresize-UB3GOA6D.js.map +0 -1
- package/dist/autosave-MWNRUNU3.js.map +0 -1
- package/dist/charmap-ADLYOIB3.js.map +0 -1
- package/dist/chunk-435CRWKA.js +0 -983
- package/dist/chunk-435CRWKA.js.map +0 -1
- package/dist/chunk-46RIM5KP.js +0 -5949
- package/dist/chunk-46RIM5KP.js.map +0 -1
- package/dist/chunk-6RJENZXT.js +0 -104
- package/dist/chunk-6RJENZXT.js.map +0 -1
- package/dist/chunk-7ON7PR5R.js.map +0 -1
- package/dist/chunk-GHEFKKRC.js.map +0 -1
- package/dist/chunk-HPLT3XRZ.js.map +0 -1
- package/dist/chunk-HZRIBOPW.js.map +0 -1
- package/dist/chunk-NPKAIW34.js.map +0 -1
- package/dist/chunk-Z3ELZ77W.js.map +0 -1
- package/dist/comments-panel-FYJE3U64.js.map +0 -1
- package/dist/directionality-XOHJFSL6.js.map +0 -1
- package/dist/emoticons-TP4N4ZGY.js.map +0 -1
- package/dist/insertdatetime-T4SEMQWP.js.map +0 -1
- package/dist/nonbreaking-HG5HV6AL.js.map +0 -1
- package/dist/quickbars-4NU4SIPL.js.map +0 -1
- package/dist/revisionhistory-3YQPLPLM.js.map +0 -1
- package/dist/visualblocks-RTAYJOGR.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugins/accordion.ts","nova-raw-css:/home/runner/work/novaprose/novaprose/packages/core/src/plugins/accordion.css?raw"],"sourcesContent":["import type { DOMOutputSpec, Node as PMNode, NodeSpec, ResolvedPos } from 'prosemirror-model';\nimport { Plugin, PluginKey, TextSelection, type Transaction } from 'prosemirror-state';\nimport type { EditorView, NodeView } from 'prosemirror-view';\nimport type { Editor } from '../editor';\nimport { definePlugin } from '../plugins';\nimport { h, icon } from '../ui/dom';\nimport { icons } from '../ui/icons';\nimport css from './accordion.css?raw';\nimport { pickLabels } from './shared';\n\n/**\n * The accordion plugin: collapsible blocks with a title and content that folds away\n * (`<details><summary>`), as in TinyMCE (`accordion`) and Tiptap (Details). `plugins: ['accordion']`.\n *\n * Here are the nodes and their view in the editor with an arrow (needed from the first render); the button, commands and\n * keys are in the lazy part, accordion-ui.ts.\n */\n\n/** Labels (the lazy part takes them from here: translation keys are accordion.*). */\nexport const LABELS = {\n en: {\n accordion: 'Accordion',\n summary: 'Summary',\n expand: 'Expand',\n collapse: 'Collapse',\n },\n};\n\nexport type AccordionState = 'inherited' | 'collapsed' | 'expanded';\n\nexport interface AccordionOptions {\n /**\n * The state when HTML is loaded: as in the markup (`inherited`, default), all collapsed\n * (`collapsed`) or all expanded (`expanded`). Like `details_initial_state` in TinyMCE.\n */\n initialState?: AccordionState;\n /**\n * The `open` attribute in getHTML: as in the editor (`inherited`, default), always collapsed or\n * always expanded. Like `details_serialized_state` in TinyMCE.\n */\n serializedState?: AccordionState;\n}\n\nfunction accordionNodes(editor: Editor): Record<string, NodeSpec> {\n const options = (editor.options.pluginOptions?.accordion ?? {}) as AccordionOptions;\n const initial = options.initialState ?? 'inherited';\n const serialized = options.serializedState ?? 'inherited';\n return {\n details: {\n group: 'block',\n content: 'details_summary block+',\n defining: true,\n // JSON can bring anything: only an explicit false means collapsed.\n attrs: { open: { default: true } },\n parseDOM: [\n {\n tag: 'details',\n getAttrs: (dom) => ({\n open:\n initial === 'inherited'\n ? (dom as HTMLElement).hasAttribute('open')\n : initial === 'expanded',\n }),\n },\n ],\n toDOM: (node): DOMOutputSpec => {\n const open =\n serialized === 'inherited' ? node.attrs.open !== false : serialized === 'expanded';\n return ['details', open ? { open: '' } : {}, 0];\n },\n },\n details_summary: {\n content: 'inline*',\n defining: true,\n isolating: true,\n // Only as the title of a collapsible block; a <summary> anywhere else is just text.\n parseDOM: [{ tag: 'summary', context: 'details/' }],\n toDOM: (): DOMOutputSpec => ['summary', 0],\n },\n };\n}\n\nexport interface Found {\n node: PMNode;\n pos: number;\n}\n\n/** The innermost collapsible block around a position. */\nexport function detailsAround($pos: ResolvedPos): Found | null {\n for (let depth = $pos.depth; depth > 0; depth--) {\n const node = $pos.node(depth);\n if (node.type.name === 'details') return { node, pos: $pos.before(depth) };\n }\n return null;\n}\n\nexport const isOpen = (node: PMNode) => node.attrs.open !== false;\n\n/** The end of the title text (the cursor position after the last character). */\nexport const summaryEnd = (details: Found) =>\n details.pos + 2 + details.node.firstChild!.content.size;\n\n/** Collapsing or expanding is a view change, not an edit: it doesn't go into the undo history. */\nexport function setOpen(tr: Transaction, details: Found, open: boolean): Transaction {\n return tr.setNodeAttribute(details.pos, 'open', open).setMeta('addToHistory', false);\n}\n\n/** Rendering: the frame, the arrow button and the content (title + blocks). */\nclass DetailsView implements NodeView {\n dom: HTMLElement;\n contentDOM: HTMLElement;\n private readonly toggle: HTMLButtonElement;\n\n constructor(\n private node: PMNode,\n view: EditorView,\n getPos: () => number | undefined,\n private readonly labels: (typeof LABELS)['en'],\n ) {\n this.toggle = h('button', {\n type: 'button',\n className: 'nova-details-toggle',\n contentEditable: 'false',\n // Not in the Tab order (Tab leaves the editor); from the keyboard it is Ctrl/Cmd+Enter in the title.\n tabIndex: -1,\n }) as HTMLButtonElement;\n this.toggle.append(icon(icons.chevronDown));\n // The button doesn't take focus from the text.\n this.toggle.addEventListener('mousedown', (event) => event.preventDefault());\n this.toggle.addEventListener('click', () => {\n const pos = getPos();\n if (pos === undefined) return;\n const current = view.state.doc.nodeAt(pos);\n if (current?.type.name !== 'details') return;\n const details = { node: current, pos };\n const open = isOpen(current);\n const tr = setOpen(view.state.tr, details, !open);\n const { from } = view.state.selection;\n if (open && from > summaryEnd(details) && from < pos + current.nodeSize) {\n tr.setSelection(TextSelection.create(tr.doc, summaryEnd(details)));\n }\n view.dispatch(tr);\n });\n this.contentDOM = h('div', { className: 'nova-details-content' });\n this.dom = h('div', { className: 'nova-details' }, this.toggle, this.contentDOM);\n this.sync();\n }\n\n private sync(): void {\n const open = isOpen(this.node);\n this.dom.classList.toggle('nova-details-open', open);\n this.toggle.setAttribute('aria-expanded', String(open));\n this.toggle.setAttribute('aria-label', open ? this.labels.collapse : this.labels.expand);\n }\n\n update(node: PMNode): boolean {\n if (node.type !== this.node.type) return false;\n this.node = node;\n this.sync();\n return true;\n }\n\n stopEvent(event: Event): boolean {\n return event.target instanceof Node && this.toggle.contains(event.target);\n }\n\n ignoreMutation(mutation: MutationRecord | { type: 'selection'; target: Node }): boolean {\n return mutation.type !== 'selection' && !this.contentDOM.contains(mutation.target);\n }\n}\n\nexport default definePlugin({\n name: 'accordion',\n nodes: accordionNodes,\n prosemirrorPlugins: (editor) => {\n const labels = pickLabels(editor, 'accordion', LABELS);\n return [\n new Plugin({\n key: new PluginKey('nova-accordion'),\n props: {\n nodeViews: {\n details: (node, view, getPos) => new DetailsView(node, view, getPos, labels),\n },\n },\n }),\n ];\n },\n setup(editor) {\n editor.ui.addStyles('nova-accordion', css);\n // The prompt in an empty title goes through a CSS variable (it isn't in the document's HTML).\n const { summary } = pickLabels(editor, 'accordion', LABELS);\n editor.root.style.setProperty('--nova-summary-placeholder', JSON.stringify(summary));\n },\n load: () => import('./accordion-ui'),\n});\n",".nova-details{position:relative;margin:0 0 .75em;padding-block:6px;padding-inline:34px 12px;border:1px solid var(--nova-border);border-radius:var(--nova-radius-sm)}.nova-details-toggle{position:absolute;top:7px;inset-inline-start:6px;display:flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:0;border-radius:4px;background:none;color:var(--nova-muted);cursor:pointer}.nova-details-toggle:hover{background:var(--nova-hover);color:var(--nova-fg)}.nova-details-toggle:focus-visible{outline:2px solid var(--nova-accent);outline-offset:1px}.nova-details-toggle svg{width:16px;height:16px;transition:transform .12s ease}.nova-details:not(.nova-details-open)>.nova-details-toggle svg{transform:rotate(-90deg)}[dir=rtl] .nova-details:not(.nova-details-open)>.nova-details-toggle svg{transform:rotate(90deg)}.nova-details-content>summary{position:relative;display:block;margin:0;font-weight:600;cursor:text;list-style:none}.nova-details-content>summary::-webkit-details-marker{display:none}.nova-details-content>summary:has(>br.ProseMirror-trailingBreak:only-child):before{content:var(--nova-summary-placeholder, \"\");position:absolute;color:var(--nova-muted);font-weight:400;pointer-events:none}.nova-details-open>.nova-details-content>summary{margin-bottom:.4em}.nova-details:not(.nova-details-open)>.nova-details-content>:not(summary){display:none}.nova-details-content>:last-child{margin-bottom:0}.nova-details.ProseMirror-selectednode{outline:2px solid var(--nova-accent);outline-offset:2px}@media(prefers-reduced-motion:reduce){.nova-details-toggle svg{transition:none}}"],"mappings":";;;;;;;;;;;;;;;AACA,SAAS,QAAQ,WAAW,qBAAuC;;;ACDnE;;;ADmBO,IAAM,SAAS;AAAA,EACpB,IAAI;AAAA,IACF,WAAW;AAAA,IACX,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,UAAU;AAAA,EACZ;AACF;AAiBA,SAAS,eAAe,QAA0C;AAChE,QAAM,UAAW,OAAO,QAAQ,eAAe,aAAa,CAAC;AAC7D,QAAM,UAAU,QAAQ,gBAAgB;AACxC,QAAM,aAAa,QAAQ,mBAAmB;AAC9C,SAAO;AAAA,IACL,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS;AAAA,MACT,UAAU;AAAA;AAAA,MAEV,OAAO,EAAE,MAAM,EAAE,SAAS,KAAK,EAAE;AAAA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AK,KAAK;AACV,WAAO;AAAA,EACT;AAAA,EAEA,UAAU,OAAuB;AAC/B,WAAO,MAAM,kBAAkB,QAAQ,KAAK,OAAO,SAAS,MAAM,MAAM;AAAA,EAC1E;AAAA,EAEA,eAAe,UAAyE;AACtF,WAAO,SAAS,SAAS,eAAe,CAAC,KAAK,WAAW,SAAS,SAAS,MAAM;AAAA,EACnF;AACF;AAEA,IAAOA,qBAAQ,aAAa;AAAA,EAC1B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,oBAAoB,CAAC,WAAW;AAC9B,UAAM,SAAS,WAAW,QAAQ,aAAa,MAAM;AACrD,WAAO;AAAA,MACL,IAAI,OAAO;AAAA,QACT,KAAK,IAAI,UAAU,gBAAgB;AAAA,QACnC,OAAO;AAAA,UACL,WAAW;AAAA,YACT,SAAS,CAAC,MAAM,MAAM,WAAW,IAAI,YAAY,MAAM,MAAM,QAAQ,MAAM;AAAA,UAC7E;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EACA,MAAM,QAAQ;AACZ,WAAO,GAAG,UAAU,kBAAkB,iBAAG;AAEzC,UAAM,EAAE,QAAQ,IAAI,WAAW,QAAQ,aAAa,MAAM;AAC1D,WAAO,KAAK,MAAM,YAAY,8BAA8B,KAAK,UAAU,OAAO,CAAC;AAAA,EACrF;AAAA,EACA,MAAM,MAAM,OAAO,4BAAgB;AACrC,CAAC;","names":["accordion_default"]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// src/blocks.ts
|
|
2
|
+
import { Fragment } from "prosemirror-model";
|
|
3
|
+
import {
|
|
4
|
+
NodeSelection,
|
|
5
|
+
TextSelection
|
|
6
|
+
} from "prosemirror-state";
|
|
7
|
+
function blockUnitAt($pos) {
|
|
8
|
+
for (let depth = $pos.depth; depth > 0; depth--) {
|
|
9
|
+
const node = $pos.node(depth);
|
|
10
|
+
if (node.type.name === "list_item") return { node, pos: $pos.before(depth), depth };
|
|
11
|
+
}
|
|
12
|
+
if ($pos.depth === 0) {
|
|
13
|
+
const node = $pos.nodeAfter;
|
|
14
|
+
return node ? { node, pos: $pos.pos, depth: 1 } : null;
|
|
15
|
+
}
|
|
16
|
+
return { node: $pos.node(1), pos: $pos.before(1), depth: 1 };
|
|
17
|
+
}
|
|
18
|
+
function selectedBlockUnit(state) {
|
|
19
|
+
const { selection } = state;
|
|
20
|
+
if (selection instanceof NodeSelection) {
|
|
21
|
+
return { node: selection.node, pos: selection.from, depth: selection.$from.depth + 1 };
|
|
22
|
+
}
|
|
23
|
+
return selection instanceof TextSelection ? blockUnitAt(selection.$from) : null;
|
|
24
|
+
}
|
|
25
|
+
function unitRange(state) {
|
|
26
|
+
const unit = selectedBlockUnit(state);
|
|
27
|
+
if (!unit) return null;
|
|
28
|
+
const { selection } = state;
|
|
29
|
+
if (!(selection instanceof NodeSelection) && unit.node.type.spec.tableRole === "table") {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const $unit = state.doc.resolve(unit.pos);
|
|
33
|
+
const parent = $unit.parent;
|
|
34
|
+
const startIndex = $unit.index();
|
|
35
|
+
let endIndex = startIndex;
|
|
36
|
+
if (!selection.empty && !(selection instanceof NodeSelection)) {
|
|
37
|
+
const last = blockUnitAt(selection.$to);
|
|
38
|
+
if (last && last.depth === unit.depth) {
|
|
39
|
+
const $last = state.doc.resolve(last.pos);
|
|
40
|
+
if ($last.start() === $unit.start()) endIndex = Math.max(startIndex, $last.index());
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
let to = unit.pos;
|
|
44
|
+
for (let i = startIndex; i <= endIndex; i++) to += parent.child(i).nodeSize;
|
|
45
|
+
return { parent, startIndex, endIndex, from: unit.pos, to };
|
|
46
|
+
}
|
|
47
|
+
function shiftSelection(tr, state, shift) {
|
|
48
|
+
const { selection } = state;
|
|
49
|
+
tr.setSelection(
|
|
50
|
+
selection instanceof NodeSelection ? NodeSelection.create(tr.doc, selection.from + shift) : TextSelection.create(tr.doc, selection.anchor + shift, selection.head + shift)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function moveBlock(direction) {
|
|
54
|
+
return (state, dispatch) => {
|
|
55
|
+
const range = unitRange(state);
|
|
56
|
+
if (!range) return false;
|
|
57
|
+
const { parent, startIndex, endIndex, from, to } = range;
|
|
58
|
+
const siblingIndex = direction < 0 ? startIndex - 1 : endIndex + 1;
|
|
59
|
+
if (siblingIndex < 0 || siblingIndex >= parent.childCount) return false;
|
|
60
|
+
const sibling = parent.child(siblingIndex);
|
|
61
|
+
const units = [];
|
|
62
|
+
for (let i = startIndex; i <= endIndex; i++) units.push(parent.child(i));
|
|
63
|
+
const moved = Fragment.fromArray(units);
|
|
64
|
+
const swapped = direction < 0 ? moved.append(Fragment.from(sibling)) : Fragment.from(sibling).append(moved);
|
|
65
|
+
const first = Math.min(startIndex, siblingIndex);
|
|
66
|
+
const last = Math.max(endIndex, siblingIndex);
|
|
67
|
+
if (!parent.canReplace(first, last + 1, swapped)) return false;
|
|
68
|
+
if (dispatch) {
|
|
69
|
+
const tr = direction < 0 ? state.tr.replaceWith(from - sibling.nodeSize, to, swapped) : state.tr.replaceWith(from, to + sibling.nodeSize, swapped);
|
|
70
|
+
shiftSelection(tr, state, direction * sibling.nodeSize);
|
|
71
|
+
dispatch(tr.scrollIntoView());
|
|
72
|
+
}
|
|
73
|
+
return true;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
var duplicateBlock = (state, dispatch) => {
|
|
77
|
+
const unit = selectedBlockUnit(state);
|
|
78
|
+
if (!unit) return false;
|
|
79
|
+
if (unit.node.type.spec.tableRole === "table" && !(state.selection instanceof NodeSelection)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
const end = unit.pos + unit.node.nodeSize;
|
|
83
|
+
const $end = state.doc.resolve(end);
|
|
84
|
+
if (!$end.parent.canReplaceWith($end.index(), $end.index(), unit.node.type)) return false;
|
|
85
|
+
if (dispatch) {
|
|
86
|
+
const tr = state.tr.insert(end, unit.node);
|
|
87
|
+
tr.setSelection(NodeSelection.create(tr.doc, end));
|
|
88
|
+
dispatch(tr.scrollIntoView());
|
|
89
|
+
}
|
|
90
|
+
return true;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
blockUnitAt,
|
|
95
|
+
moveBlock,
|
|
96
|
+
duplicateBlock
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=chunk-HNEAVVBC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/blocks.ts"],"sourcesContent":["import { Fragment, type Node as PMNode, type ResolvedPos } from 'prosemirror-model';\nimport {\n NodeSelection,\n TextSelection,\n type Command,\n type EditorState,\n type Transaction,\n} from 'prosemirror-state';\n\n/**\n * Blocks as units of movement: Alt+Shift+↑/↓ and the drag handle (the draghandle plugin).\n * The unit is the innermost list item, otherwise a top-level block (a paragraph, a heading, a whole table\n * or quote, an image).\n */\nexport interface BlockUnit {\n node: PMNode;\n /** The position before the node. */\n pos: number;\n /** The node's depth (1 for a top-level block). */\n depth: number;\n}\n\n/** The unit around a position. A position between top-level blocks means the next block. */\nexport function blockUnitAt($pos: ResolvedPos): BlockUnit | null {\n for (let depth = $pos.depth; depth > 0; depth--) {\n const node = $pos.node(depth);\n if (node.type.name === 'list_item') return { node, pos: $pos.before(depth), depth };\n }\n if ($pos.depth === 0) {\n const node = $pos.nodeAfter;\n return node ? { node, pos: $pos.pos, depth: 1 } : null;\n }\n return { node: $pos.node(1), pos: $pos.before(1), depth: 1 };\n}\n\n/** A selected node is a unit by itself; otherwise the unit around the start of the selection. */\nexport function selectedBlockUnit(state: EditorState): BlockUnit | null {\n const { selection } = state;\n if (selection instanceof NodeSelection) {\n return { node: selection.node, pos: selection.from, depth: selection.$from.depth + 1 };\n }\n return selection instanceof TextSelection ? blockUnitAt(selection.$from) : null;\n}\n\ninterface UnitRange {\n parent: PMNode;\n startIndex: number;\n endIndex: number;\n from: number;\n to: number;\n}\n\n/** Adjacent units under the selection (a selection across several paragraphs moves them together). */\nfunction unitRange(state: EditorState): UnitRange | null {\n const unit = selectedBlockUnit(state);\n if (!unit) return null;\n const { selection } = state;\n // The cursor in a table cell: rows aren't blocks, and the whole table is moved with the handle.\n if (!(selection instanceof NodeSelection) && unit.node.type.spec.tableRole === 'table') {\n return null;\n }\n const $unit = state.doc.resolve(unit.pos);\n const parent = $unit.parent;\n const startIndex = $unit.index();\n let endIndex = startIndex;\n if (!selection.empty && !(selection instanceof NodeSelection)) {\n const last = blockUnitAt(selection.$to);\n if (last && last.depth === unit.depth) {\n const $last = state.doc.resolve(last.pos);\n if ($last.start() === $unit.start()) endIndex = Math.max(startIndex, $last.index());\n }\n }\n let to = unit.pos;\n for (let i = startIndex; i <= endIndex; i++) to += parent.child(i).nodeSize;\n return { parent, startIndex, endIndex, from: unit.pos, to };\n}\n\n/** The selection after a move: the same one, shifted along with the block. */\nfunction shiftSelection(tr: Transaction, state: EditorState, shift: number): void {\n const { selection } = state;\n tr.setSelection(\n selection instanceof NodeSelection\n ? NodeSelection.create(tr.doc, selection.from + shift)\n : TextSelection.create(tr.doc, selection.anchor + shift, selection.head + shift),\n );\n}\n\n/** Swaps the block (or the selected blocks) with the neighbor above (-1) or below (1). */\nexport function moveBlock(direction: -1 | 1): Command {\n return (state, dispatch) => {\n const range = unitRange(state);\n if (!range) return false;\n const { parent, startIndex, endIndex, from, to } = range;\n const siblingIndex = direction < 0 ? startIndex - 1 : endIndex + 1;\n if (siblingIndex < 0 || siblingIndex >= parent.childCount) return false;\n const sibling = parent.child(siblingIndex);\n const units: PMNode[] = [];\n for (let i = startIndex; i <= endIndex; i++) units.push(parent.child(i));\n const moved = Fragment.fromArray(units);\n const swapped =\n direction < 0 ? moved.append(Fragment.from(sibling)) : Fragment.from(sibling).append(moved);\n const first = Math.min(startIndex, siblingIndex);\n const last = Math.max(endIndex, siblingIndex);\n if (!parent.canReplace(first, last + 1, swapped)) return false;\n if (dispatch) {\n const tr =\n direction < 0\n ? state.tr.replaceWith(from - sibling.nodeSize, to, swapped)\n : state.tr.replaceWith(from, to + sibling.nodeSize, swapped);\n shiftSelection(tr, state, direction * sibling.nodeSize);\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\n\n/** A copy of the selected block right below it (the copy gets selected). */\nexport const duplicateBlock: Command = (state, dispatch) => {\n const unit = selectedBlockUnit(state);\n if (!unit) return false;\n // The cursor in a cell: a whole table can be copied only by selecting it (with the handle).\n if (unit.node.type.spec.tableRole === 'table' && !(state.selection instanceof NodeSelection)) {\n return false;\n }\n const end = unit.pos + unit.node.nodeSize;\n const $end = state.doc.resolve(end);\n if (!$end.parent.canReplaceWith($end.index(), $end.index(), unit.node.type)) return false;\n if (dispatch) {\n const tr = state.tr.insert(end, unit.node);\n tr.setSelection(NodeSelection.create(tr.doc, end));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n"],"mappings":";AAAA,SAAS,gBAAuD;AAChE;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AAgBA,SAAS,YAAY,MAAqC;AAC/D,WAAS,QAAQ,KAAK,OAAO,QAAQ,GAAG,SAAS;AAC/C,UAAM,OAAO,KAAK,KAAK,KAAK;AAC5B,QAAI,KAAK,KAAK,SAAS,YAAa,QAAO,EAAE,MAAM,KAAK,KAAK,OAAO,KAAK,GAAG,MAAM;AAAA,EACpF;AACA,MAAI,KAAK,UAAU,GAAG;AACpB,UAAM,OAAO,KAAK;AAClB,WAAO,OAAO,EAAE,MAAM,KAAK,KAAK,KAAK,OAAO,EAAE,IAAI;AAAA,EACpD;AACA,SAAO,EAAE,MAAM,KAAK,KAAK,CAAC,GAAG,KAAK,KAAK,OAAO,CAAC,GAAG,OAAO,EAAE;AAC7D;AAGO,SAAS,kBAAkB,OAAsC;AACtE,QAAM,EAAE,UAAU,IAAI;AACtB,MAAI,qBAAqB,eAAe;AACtC,WAAO,EAAE,MAAM,UAAU,MAAM,KAAK,UAAU,MAAM,OAAO,UAAU,MAAM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K,IAAI,EAAG,QAAO;AACpF,MAAI,UAAU;AACZ,UAAM,KAAK,MAAM,GAAG,OAAO,KAAK,KAAK,IAAI;AACzC,OAAG,aAAa,cAAc,OAAO,GAAG,KAAK,GAAG,CAAC;AACjD,aAAS,GAAG,eAAe,CAAC;AAAA,EAC9B;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import {
|
|
2
|
+
footnotes_default
|
|
3
|
+
} from "./chunk-T3IRLTKK.js";
|
|
4
|
+
import {
|
|
5
|
+
advtable_default
|
|
6
|
+
} from "./chunk-S2XZRKHA.js";
|
|
7
|
+
import {
|
|
8
|
+
mediaembed_default
|
|
9
|
+
} from "./chunk-LVEQBNLX.js";
|
|
10
|
+
import {
|
|
11
|
+
fullpagehtml_default
|
|
12
|
+
} from "./chunk-AQV6FIKK.js";
|
|
13
|
+
import {
|
|
14
|
+
pagelayout_default
|
|
15
|
+
} from "./chunk-OFHGXYG3.js";
|
|
16
|
+
import {
|
|
17
|
+
tableofcontents_default
|
|
18
|
+
} from "./chunk-YG5V7POU.js";
|
|
19
|
+
import {
|
|
20
|
+
mergetags_default
|
|
21
|
+
} from "./chunk-C326LHHU.js";
|
|
22
|
+
import {
|
|
23
|
+
comments_default
|
|
24
|
+
} from "./chunk-N32H37AJ.js";
|
|
25
|
+
import {
|
|
26
|
+
suggestions_default
|
|
27
|
+
} from "./chunk-P2UU2NLT.js";
|
|
28
|
+
import {
|
|
29
|
+
mentions_default
|
|
30
|
+
} from "./chunk-GXXXLPDQ.js";
|
|
31
|
+
import {
|
|
32
|
+
media_default
|
|
33
|
+
} from "./chunk-5VCESSQB.js";
|
|
34
|
+
import {
|
|
35
|
+
pageembed_default
|
|
36
|
+
} from "./chunk-NTGEKGXU.js";
|
|
37
|
+
import {
|
|
38
|
+
accordion_default
|
|
39
|
+
} from "./chunk-HC6RMBAD.js";
|
|
40
|
+
import {
|
|
41
|
+
math_default
|
|
42
|
+
} from "./chunk-EOJ5XHKA.js";
|
|
43
|
+
import {
|
|
44
|
+
ELEMENT_ID_RE
|
|
45
|
+
} from "./chunk-XR7CY4NI.js";
|
|
46
|
+
import {
|
|
47
|
+
definePlugin,
|
|
48
|
+
registerPlugin
|
|
49
|
+
} from "./chunk-V7WUHUHM.js";
|
|
50
|
+
|
|
51
|
+
// src/plugins/anchor.ts
|
|
52
|
+
var ID_RE = ELEMENT_ID_RE;
|
|
53
|
+
var anchor_default = definePlugin({
|
|
54
|
+
name: "anchor",
|
|
55
|
+
toolbar: "anchor",
|
|
56
|
+
nodes: {
|
|
57
|
+
anchor: {
|
|
58
|
+
group: "inline",
|
|
59
|
+
inline: true,
|
|
60
|
+
atom: true,
|
|
61
|
+
selectable: true,
|
|
62
|
+
attrs: { id: {} },
|
|
63
|
+
parseDOM: [
|
|
64
|
+
{
|
|
65
|
+
tag: "a[id]:not([href])",
|
|
66
|
+
getAttrs: (dom) => {
|
|
67
|
+
const id = dom.getAttribute("id") ?? "";
|
|
68
|
+
return ID_RE.test(id) ? { id } : false;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
tag: "a[name]:not([href])",
|
|
73
|
+
getAttrs: (dom) => {
|
|
74
|
+
const id = dom.getAttribute("name") ?? "";
|
|
75
|
+
return ID_RE.test(id) ? { id } : false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
// The document may come from JSON: the identifier is checked on output too.
|
|
80
|
+
toDOM: (node) => ["a", { id: ID_RE.test(node.attrs.id) ? node.attrs.id : null }]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
load: () => import("./anchor-ui-NWIIRKGY.js")
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// src/plugins/pagebreak.ts
|
|
87
|
+
var pagebreak_default = definePlugin({
|
|
88
|
+
name: "pagebreak",
|
|
89
|
+
toolbar: "pagebreak",
|
|
90
|
+
nodes: {
|
|
91
|
+
pagebreak: {
|
|
92
|
+
group: "block",
|
|
93
|
+
atom: true,
|
|
94
|
+
selectable: true,
|
|
95
|
+
parseDOM: [
|
|
96
|
+
{ tag: "div.nova-pagebreak" },
|
|
97
|
+
// A break from other editors and Word: an empty block with page-break-after / break-after.
|
|
98
|
+
{
|
|
99
|
+
tag: "div",
|
|
100
|
+
getAttrs: (dom) => {
|
|
101
|
+
const el = dom;
|
|
102
|
+
const breaks = el.style.breakAfter === "page" || el.style.pageBreakAfter === "always";
|
|
103
|
+
return breaks && !el.textContent?.trim() ? null : false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
toDOM: () => ["div", { class: "nova-pagebreak", style: "break-after: page;" }]
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
load: () => import("./pagebreak-ui-I4ZPYK3U.js")
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// src/plugins/index.ts
|
|
114
|
+
registerPlugin("insertdatetime", () => import("./insertdatetime-YW2VHYZH.js"));
|
|
115
|
+
registerPlugin("casechange", () => import("./casechange-5G6RAJ7K.js"));
|
|
116
|
+
registerPlugin("formatpainter", () => import("./formatpainter-IEXX27OJ.js"));
|
|
117
|
+
registerPlugin("permanentpen", () => import("./permanentpen-6D5LLKFX.js"));
|
|
118
|
+
registerPlugin("visualchars", () => import("./visualchars-UQFRWQPE.js"));
|
|
119
|
+
registerPlugin("save", () => import("./save-72ZLF6AO.js"));
|
|
120
|
+
registerPlugin("markdown", () => import("./markdown-26O3N3T2.js"));
|
|
121
|
+
registerPlugin("importcss", () => import("./importcss-JLNIRKGH.js"));
|
|
122
|
+
registerPlugin("template", () => import("./template-YYC2MGVH.js"));
|
|
123
|
+
registerPlugin("spellchecker", () => import("./spellchecker-DJ7SP5JY.js"));
|
|
124
|
+
registerPlugin("autocorrect", () => import("./autocorrect-6GFLVDPC.js"));
|
|
125
|
+
registerPlugin("typography", () => import("./typography-EQUXUXIN.js"));
|
|
126
|
+
registerPlugin("a11ychecker", () => import("./a11ychecker-7KQU7DD3.js"));
|
|
127
|
+
registerPlugin("linkchecker", () => import("./linkchecker-3S3MCPOS.js"));
|
|
128
|
+
registerPlugin("advcode", () => import("./advcode-65Z2ELUB.js"));
|
|
129
|
+
registerPlugin("editimage", () => import("./editimage-5EWPSM22.js"));
|
|
130
|
+
registerPlugin("email", () => import("./email-ELNMEQ6E.js"));
|
|
131
|
+
registerPlugin("quickbars", () => import("./quickbars-UZ2Q67TX.js"));
|
|
132
|
+
registerPlugin("charmap", () => import("./charmap-5CBBDWOP.js"));
|
|
133
|
+
registerPlugin("emoticons", () => import("./emoticons-EGHNZKSA.js"));
|
|
134
|
+
registerPlugin("nonbreaking", () => import("./nonbreaking-GYRUH4UO.js"));
|
|
135
|
+
registerPlugin("checklist", () => import("./checklist-HM4VXZKY.js"));
|
|
136
|
+
registerPlugin("codesample", () => import("./codesample-GHWIC7PT.js"));
|
|
137
|
+
registerPlugin("draghandle", () => import("./draghandle-U6CYZHPA.js"));
|
|
138
|
+
registerPlugin("autolink", () => import("./autolink-N427KVQO.js"));
|
|
139
|
+
registerPlugin("autosave", () => import("./autosave-L7OZ3KLK.js"));
|
|
140
|
+
registerPlugin("autoresize", () => import("./autoresize-YRZAVCNO.js"));
|
|
141
|
+
registerPlugin("visualblocks", () => import("./visualblocks-O5QW7ZDT.js"));
|
|
142
|
+
registerPlugin("exportword", () => import("./exportword-JFJ3KTYZ.js"));
|
|
143
|
+
registerPlugin("exportpdf", () => import("./exportpdf-4P7X3NY2.js"));
|
|
144
|
+
registerPlugin("importword", () => import("./importword-D7Z6RXGQ.js"));
|
|
145
|
+
registerPlugin("ai", () => import("./ai-IRQYZHRK.js"));
|
|
146
|
+
registerPlugin("anchor", anchor_default);
|
|
147
|
+
registerPlugin("accordion", accordion_default);
|
|
148
|
+
registerPlugin("tableofcontents", tableofcontents_default);
|
|
149
|
+
registerPlugin("math", math_default);
|
|
150
|
+
registerPlugin("pagebreak", pagebreak_default);
|
|
151
|
+
registerPlugin("pagelayout", pagelayout_default);
|
|
152
|
+
registerPlugin("footnotes", footnotes_default);
|
|
153
|
+
registerPlugin("media", media_default);
|
|
154
|
+
registerPlugin("pageembed", pageembed_default);
|
|
155
|
+
registerPlugin("advtable", advtable_default);
|
|
156
|
+
registerPlugin("mediaembed", mediaembed_default);
|
|
157
|
+
registerPlugin("fullpagehtml", fullpagehtml_default);
|
|
158
|
+
registerPlugin("comments", comments_default);
|
|
159
|
+
registerPlugin("mentions", mentions_default);
|
|
160
|
+
registerPlugin("mergetags", mergetags_default);
|
|
161
|
+
registerPlugin("suggestions", suggestions_default);
|
|
162
|
+
registerPlugin("directionality", () => import("./directionality-EGQKGDZA.js"));
|
|
163
|
+
registerPlugin("advlist", () => import("./advlist-CEHE6YXS.js"));
|
|
164
|
+
registerPlugin("revisionhistory", () => import("./revisionhistory-ACRB23HL.js"));
|
|
165
|
+
//# sourceMappingURL=chunk-I7Y4KSM2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugins/anchor.ts","../src/plugins/pagebreak.ts","../src/plugins/index.ts"],"sourcesContent":["import { ELEMENT_ID_RE } from '../element-id';\nimport { definePlugin } from '../plugins';\n\n/**\n * The anchor plugin: an anchor `<a id=\"…\"></a>` for links like `#section`. `plugins: ['anchor']`.\n * Here is the node (the schema is created together with the editor); the dialog and the button are in anchor-ui.ts.\n */\n\n/** A safe identifier: no spaces or quotes (the same check as for heading ids). */\nconst ID_RE = ELEMENT_ID_RE;\n\nexport default definePlugin({\n name: 'anchor',\n toolbar: 'anchor',\n nodes: {\n anchor: {\n group: 'inline',\n inline: true,\n atom: true,\n selectable: true,\n attrs: { id: {} },\n parseDOM: [\n {\n tag: 'a[id]:not([href])',\n getAttrs: (dom) => {\n const id = (dom as HTMLElement).getAttribute('id') ?? '';\n return ID_RE.test(id) ? { id } : false;\n },\n },\n {\n tag: 'a[name]:not([href])',\n getAttrs: (dom) => {\n const id = (dom as HTMLElement).getAttribute('name') ?? '';\n return ID_RE.test(id) ? { id } : false;\n },\n },\n ],\n // The document may come from JSON: the identifier is checked on output too.\n toDOM: (node) => ['a', { id: ID_RE.test(node.attrs.id as string) ? node.attrs.id : null }],\n },\n },\n load: () => import('./anchor-ui'),\n});\n","import { definePlugin } from '../plugins';\n\n/**\n * The pagebreak plugin: a page break for printing and PDF:\n * `<div class=\"nova-pagebreak\" style=\"break-after: page;\"></div>`. `plugins: ['pagebreak']`.\n * Here is the node (the schema is created together with the editor); the button is in pagebreak-ui.ts.\n */\n\nexport default definePlugin({\n name: 'pagebreak',\n toolbar: 'pagebreak',\n nodes: {\n pagebreak: {\n group: 'block',\n atom: true,\n selectable: true,\n parseDOM: [\n { tag: 'div.nova-pagebreak' },\n // A break from other editors and Word: an empty block with page-break-after / break-after.\n {\n tag: 'div',\n getAttrs: (dom) => {\n const el = dom as HTMLElement;\n const breaks = el.style.breakAfter === 'page' || el.style.pageBreakAfter === 'always';\n return breaks && !el.textContent?.trim() ? null : false;\n },\n },\n ],\n toDOM: () => ['div', { class: 'nova-pagebreak', style: 'break-after: page;' }],\n },\n },\n load: () => import('./pagebreak-ui'),\n});\n","import { registerPlugin } from '../plugins';\nimport accordion from './accordion';\nimport anchor from './anchor';\nimport math from './math';\nimport tableofcontents from './tableofcontents';\nimport comments from './comments';\nimport mentions from './mentions';\nimport mergetags from './mergetags';\nimport suggestions from './suggestions';\nimport media from './media';\nimport pageembed from './pageembed';\nimport advtable from './advtable';\nimport mediaembed from './mediaembed';\nimport fullpagehtml from './fullpagehtml';\nimport pagebreak from './pagebreak';\nimport pagelayout from './pagelayout';\nimport footnotes from './footnotes';\n\n/**\n * The catalog of built-in NovaProse plugins. Each one is attached by name (`plugins: ['insertdatetime']`)\n * and loads lazily, as a separate chunk, without growing the core.\n */\nregisterPlugin('insertdatetime', () => import('./insertdatetime'));\nregisterPlugin('casechange', () => import('./casechange'));\nregisterPlugin('formatpainter', () => import('./formatpainter'));\nregisterPlugin('permanentpen', () => import('./permanentpen'));\nregisterPlugin('visualchars', () => import('./visualchars'));\nregisterPlugin('save', () => import('./save'));\nregisterPlugin('markdown', () => import('./markdown'));\nregisterPlugin('importcss', () => import('./importcss'));\nregisterPlugin('template', () => import('./template'));\nregisterPlugin('spellchecker', () => import('./spellchecker'));\nregisterPlugin('autocorrect', () => import('./autocorrect'));\nregisterPlugin('typography', () => import('./typography'));\nregisterPlugin('a11ychecker', () => import('./a11ychecker'));\nregisterPlugin('linkchecker', () => import('./linkchecker'));\nregisterPlugin('advcode', () => import('./advcode'));\nregisterPlugin('editimage', () => import('./editimage'));\nregisterPlugin('email', () => import('./email'));\nregisterPlugin('quickbars', () => import('./quickbars'));\nregisterPlugin('charmap', () => import('./charmap'));\nregisterPlugin('emoticons', () => import('./emoticons'));\nregisterPlugin('nonbreaking', () => import('./nonbreaking'));\nregisterPlugin('checklist', () => import('./checklist'));\nregisterPlugin('codesample', () => import('./codesample'));\nregisterPlugin('draghandle', () => import('./draghandle'));\nregisterPlugin('autolink', () => import('./autolink'));\nregisterPlugin('autosave', () => import('./autosave'));\nregisterPlugin('autoresize', () => import('./autoresize'));\nregisterPlugin('visualblocks', () => import('./visualblocks'));\nregisterPlugin('exportword', () => import('./exportword'));\nregisterPlugin('exportpdf', () => import('./exportpdf'));\nregisterPlugin('importword', () => import('./importword'));\nregisterPlugin('ai', () => import('./ai'));\n\n// Plugins with document nodes: the schema is needed when the editor is created, so they aren't lazy.\nregisterPlugin('anchor', anchor);\n// Nodes right away, the interface and commands in the lazy part (NovaPlugin.load).\nregisterPlugin('accordion', accordion);\nregisterPlugin('tableofcontents', tableofcontents);\nregisterPlugin('math', math);\nregisterPlugin('pagebreak', pagebreak);\nregisterPlugin('pagelayout', pagelayout);\nregisterPlugin('footnotes', footnotes);\nregisterPlugin('media', media);\nregisterPlugin('pageembed', pageembed);\nregisterPlugin('advtable', advtable);\nregisterPlugin('mediaembed', mediaembed);\nregisterPlugin('fullpagehtml', fullpagehtml);\nregisterPlugin('comments', comments);\nregisterPlugin('mentions', mentions);\nregisterPlugin('mergetags', mergetags);\nregisterPlugin('suggestions', suggestions);\nregisterPlugin('directionality', () => import('./directionality'));\nregisterPlugin('advlist', () => import('./advlist'));\nregisterPlugin('revisionhistory', () => import('./revisionhistory'));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAM,QAAQ;AAEd,IAAO,iBAAQ,aAAa;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,OAAO,EAAE,IAAI,CAAC,EAAE;AAAA,MAChB,UAAU;AAAA,QACR;AAAA,UACE,KAAK;AAAA,UACL,UAAU,CAAC,QAAQ;AACjB,kBAAM,KAAM,IAAoB,aAAa,IAAI,KAAK;AACtD,mBAAO,MAAM,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI;AAAA,UACnC;AAAA,QACF;AAAA,QACA;AAAA,UACE,KAAK;AAAA,UACL,UAAU,CAAC,QAAQ;AACjB,kBAAM,KAAM,IAAoB,aAAa,MAAM,KAAK;AACxD,mBAAO,MAAM,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI;AAAA,UACnC;AAAA,QACF;AAAA,MACF;AAAA;AAAA,MAEA,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,MAAM,KAAK,KAAK,MAAM,EAAY,IAAI,KAAK,MAAM,KAAK,KAAK,CAAC;AAAA,IAC3F;AAAA,EACF;AAAA,EACA,MAAM,MAAM,OAAO,yBAAa;AAClC,CAAC;;;AClCD,IAAO,oBAAQ,aAAa;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,IACL,WAAW;AAAA,MACT,OAAO;AAAA,MACP,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,QACR,EAAE,KAA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unk-FTEA6L2Q.js";
|
|
4
|
+
import {
|
|
5
|
+
checkboxField,
|
|
6
|
+
textField
|
|
7
|
+
} from "./chunk-MZGNOHSY.js";
|
|
8
|
+
import {
|
|
9
|
+
getLinkAt,
|
|
10
|
+
markRange,
|
|
11
|
+
marksOf
|
|
12
|
+
} from "./chunk-AC3YCAX4.js";
|
|
13
|
+
import {
|
|
14
|
+
h
|
|
15
|
+
} from "./chunk-QU3KXMYT.js";
|
|
16
|
+
import {
|
|
17
|
+
isSafeLinkUrl
|
|
18
|
+
} from "./chunk-4VPDY3LF.js";
|
|
19
|
+
|
|
20
|
+
// src/link.ts
|
|
21
|
+
function normalizeUrl(input) {
|
|
22
|
+
const url = input.trim();
|
|
23
|
+
if (!url) return "";
|
|
24
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(url) || /^[/#?.]/.test(url)) return url;
|
|
25
|
+
if (/^[^\s@/]+@[^\s@/]+\.[^\s@/]+$/.test(url)) return `mailto:${url}`;
|
|
26
|
+
if (/^(www\.)?[^\s/]+\.[a-z]{2,}([/:?#].*)?$/i.test(url)) return `https://${url}`;
|
|
27
|
+
return url;
|
|
28
|
+
}
|
|
29
|
+
function linkTarget(state) {
|
|
30
|
+
const { from, to, empty, $from } = state.selection;
|
|
31
|
+
if (empty) return markRange(state, marksOf(state).link, $from.pos) ?? { from, to };
|
|
32
|
+
return { from, to };
|
|
33
|
+
}
|
|
34
|
+
function applyLink(attrs) {
|
|
35
|
+
return (state, dispatch) => {
|
|
36
|
+
const href = normalizeUrl(attrs.href);
|
|
37
|
+
if (!href || !isSafeLinkUrl(href)) return false;
|
|
38
|
+
if (!dispatch) return true;
|
|
39
|
+
const { from, to } = linkTarget(state);
|
|
40
|
+
const linkMark = marksOf(state).link.create({
|
|
41
|
+
href,
|
|
42
|
+
title: attrs.title || null,
|
|
43
|
+
target: attrs.target || null
|
|
44
|
+
});
|
|
45
|
+
const currentText = state.doc.textBetween(from, to);
|
|
46
|
+
const text = attrs.text?.trim() ? attrs.text : null;
|
|
47
|
+
const tr = state.tr;
|
|
48
|
+
if (from === to || text !== null && text !== currentText) {
|
|
49
|
+
const baseMarks = marksOf(state).link.removeFromSet(state.doc.resolve(from).marks());
|
|
50
|
+
const node = state.schema.text(text ?? (currentText || href), linkMark.addToSet(baseMarks));
|
|
51
|
+
tr.replaceWith(from, to, node);
|
|
52
|
+
} else {
|
|
53
|
+
tr.removeMark(from, to, marksOf(state).link).addMark(from, to, linkMark);
|
|
54
|
+
}
|
|
55
|
+
dispatch(tr.scrollIntoView());
|
|
56
|
+
return true;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function removeLink() {
|
|
60
|
+
return (state, dispatch) => {
|
|
61
|
+
const { from, to } = linkTarget(state);
|
|
62
|
+
if (from === to || !state.doc.rangeHasMark(from, to, marksOf(state).link)) return false;
|
|
63
|
+
dispatch?.(state.tr.removeMark(from, to, marksOf(state).link));
|
|
64
|
+
return true;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function openLinkDialog(editor) {
|
|
68
|
+
const { t } = editor.ui;
|
|
69
|
+
const state = editor.view.state;
|
|
70
|
+
const existing = getLinkAt(state);
|
|
71
|
+
const range = linkTarget(state);
|
|
72
|
+
const selectedText = state.doc.textBetween(range.from, range.to);
|
|
73
|
+
const canEditText = !selectedText.includes("\n") && state.selection.$from.sameParent(state.doc.resolve(range.to));
|
|
74
|
+
const url = textField({
|
|
75
|
+
label: t("link.url"),
|
|
76
|
+
type: "url",
|
|
77
|
+
value: existing?.href ?? "",
|
|
78
|
+
placeholder: "https://",
|
|
79
|
+
required: true
|
|
80
|
+
});
|
|
81
|
+
const text = textField({ label: t("link.text"), value: selectedText });
|
|
82
|
+
const title = textField({ label: t("link.tooltip"), value: existing?.title ?? "" });
|
|
83
|
+
const newTab = checkboxField(t("link.newTab"), existing?.target === "_blank");
|
|
84
|
+
attachFilePicker(editor, url, "file", (picked) => {
|
|
85
|
+
if (picked.text && !text.input.value.trim()) text.input.value = picked.text;
|
|
86
|
+
if (picked.title) title.input.value = picked.title;
|
|
87
|
+
});
|
|
88
|
+
const body = h(
|
|
89
|
+
"div",
|
|
90
|
+
{ className: "nova-form" },
|
|
91
|
+
url.el,
|
|
92
|
+
canEditText ? text.el : null,
|
|
93
|
+
title.el,
|
|
94
|
+
newTab.el
|
|
95
|
+
);
|
|
96
|
+
editor.ui.openDialog({
|
|
97
|
+
title: existing ? t("link.editTitle") : t("link.title"),
|
|
98
|
+
body,
|
|
99
|
+
submitLabel: existing ? t("dialog.save") : t("dialog.insert"),
|
|
100
|
+
initialFocus: url.input,
|
|
101
|
+
onSubmit: () => {
|
|
102
|
+
const href = normalizeUrl(url.input.value);
|
|
103
|
+
if (!href || !isSafeLinkUrl(href)) {
|
|
104
|
+
url.input.setAttribute("aria-invalid", "true");
|
|
105
|
+
url.input.focus();
|
|
106
|
+
return t("link.invalid");
|
|
107
|
+
}
|
|
108
|
+
editor.exec(
|
|
109
|
+
applyLink({
|
|
110
|
+
href,
|
|
111
|
+
...canEditText ? { text: text.input.value } : {},
|
|
112
|
+
title: title.input.value.trim() || null,
|
|
113
|
+
target: newTab.input.checked ? "_blank" : null
|
|
114
|
+
})
|
|
115
|
+
);
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
normalizeUrl,
|
|
123
|
+
applyLink,
|
|
124
|
+
removeLink,
|
|
125
|
+
openLinkDialog
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=chunk-IG2BL4ON.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/link.ts"],"sourcesContent":["import type { Command, EditorState } from 'prosemirror-state';\nimport { attachFilePicker } from './ui/file-picker';\nimport { getLinkAt, markRange } from './commands';\nimport type { Editor } from './editor';\nimport { marksOf } from './commands';\nimport { checkboxField, textField } from './ui/dialog';\nimport { h } from './ui/dom';\nimport { isSafeLinkUrl } from './url';\n\n/**\n * Turns user input into a URL: 'example.com' → 'https://example.com', 'a@b.com' → 'mailto:a@b.com'.\n * Relative paths and anchors are left alone.\n */\nexport function normalizeUrl(input: string): string {\n const url = input.trim();\n if (!url) return '';\n if (/^[a-z][a-z0-9+.-]*:/i.test(url) || /^[/#?.]/.test(url)) return url;\n if (/^[^\\s@/]+@[^\\s@/]+\\.[^\\s@/]+$/.test(url)) return `mailto:${url}`;\n if (/^(www\\.)?[^\\s/]+\\.[a-z]{2,}([/:?#].*)?$/i.test(url)) return `https://${url}`;\n return url;\n}\n\nexport interface LinkAttrs {\n href: string;\n text?: string;\n title?: string | null;\n target?: string | null;\n}\n\n/** The range a link applies to: the selection or the link under the cursor. */\nfunction linkTarget(state: EditorState): { from: number; to: number } {\n const { from, to, empty, $from } = state.selection;\n if (empty) return markRange(state, marksOf(state).link, $from.pos) ?? { from, to };\n return { from, to };\n}\n\n/**\n * Create or update a link. If `text` is given and differs from the current text, the text is\n * replaced and other marks (bold and so on) are kept.\n */\nexport function applyLink(attrs: LinkAttrs): Command {\n return (state, dispatch) => {\n const href = normalizeUrl(attrs.href);\n if (!href || !isSafeLinkUrl(href)) return false;\n if (!dispatch) return true;\n\n const { from, to } = linkTarget(state);\n const linkMark = marksOf(state).link.create({\n href,\n title: attrs.title || null,\n target: attrs.target || null,\n });\n const currentText = state.doc.textBetween(from, to);\n const text = attrs.text?.trim() ? attrs.text : null;\n const tr = state.tr;\n\n if (from === to || (text !== null && text !== currentText)) {\n const baseMarks = marksOf(state).link.removeFromSet(state.doc.resolve(from).marks());\n const node = state.schema.text(text ?? (currentText || href), linkMark.addToSet(baseMarks));\n tr.replaceWith(from, to, node);\n } else {\n tr.removeMark(from, to, marksOf(state).link).addMark(from, to, linkMark);\n }\n dispatch(tr.scrollIntoView());\n return true;\n };\n}\n\nexport function removeLink(): Command {\n return (state, dispatch) => {\n const { from, to } = linkTarget(state);\n if (from === to || !state.doc.rangeHasMark(from, to, marksOf(state).link)) return false;\n dispatch?.(state.tr.removeMark(from, to, marksOf(state).link));\n return true;\n };\n}\n\n/** The insert/edit link dialog. */\nexport function openLinkDialog(editor: Editor): void {\n const { t } = editor.ui;\n const state = editor.view.state;\n const existing = getLinkAt(state);\n const range = linkTarget(state);\n const selectedText = state.doc.textBetween(range.from, range.to);\n // The link text is editable only if the selection doesn't span several blocks/nodes.\n const canEditText =\n !selectedText.includes('\\n') && state.selection.$from.sameParent(state.doc.resolve(range.to));\n\n const url = textField({\n label: t('link.url'),\n type: 'url',\n value: existing?.href ?? '',\n placeholder: 'https://',\n required: true,\n });\n const text = textField({ label: t('link.text'), value: selectedText });\n const title = textField({ label: t('link.tooltip'), value: existing?.title ?? '' });\n const newTab = checkboxField(t('link.newTab'), existing?.target === '_blank');\n attachFilePicker(editor, url, 'file', (picked) => {\n if (picked.text && !text.input.value.trim()) text.input.value = picked.text;\n if (picked.title) title.input.value = picked.title;\n });\n\n const body = h(\n 'div',\n { className: 'nova-form' },\n url.el,\n canEditText ? text.el : null,\n title.el,\n newTab.el,\n );\n\n editor.ui.openDialog({\n title: existing ? t('link.editTitle') : t('link.title'),\n body,\n submitLabel: existing ? t('dialog.save') : t('dialog.insert'),\n initialFocus: url.input,\n onSubmit: () => {\n const href = normalizeUrl(url.input.value);\n if (!href || !isSafeLinkUrl(href)) {\n url.input.setAttribute('aria-invalid', 'true');\n url.input.focus();\n return t('link.invalid');\n }\n editor.exec(\n applyLink({\n href,\n ...(canEditText ? { text: text.input.value } : {}),\n title: title.input.value.trim() || null,\n target: newTab.input.checked ? '_blank' : null,\n }),\n );\n return true;\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAaO,SAAS,aAAa,OAAuB;AAClD,QAAM,MAAM,MAAM,KAAK;AACvB,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI,uBAAuB,KAAK,GAAG,KAAK,UAAU,KAAK,GAAG,EAAG,QAAO;AACpE,MAAI,gCAAgC,KAAK,GAAG,EAAG,QAAO,U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