@templatical/editor 0.42.0 → 0.42.1
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/dist/{AiChatSidebar-DqSoJAXx.js → AiChatSidebar-DOCvzGBe.js} +7 -7
- package/dist/{AiFeatureMenu-CoBvE72q.js → AiFeatureMenu-CfijAx4G.js} +4 -4
- package/dist/{BlockIssueBadge-D8KsGWY6.js → BlockIssueBadge-BJ3A6mqh.js} +2 -2
- package/dist/{BlockPreviewCanvas-W6-MRpWz.js → BlockPreviewCanvas-DggfBaoJ.js} +2 -2
- package/dist/{CloudHeaderExtras-AbsNuL9T.js → CloudHeaderExtras-dFbdqBr5.js} +2 -2
- package/dist/{CloudPanels-BNL6rSeB.js → CloudPanels-DmMxhzzZ.js} +4 -4
- package/dist/{CollaboratorBar-DlZ-wOL_.js → CollaboratorBar-XXk1tOC5.js} +2 -2
- package/dist/{CommentsPanel-9k1q-79y.js → CommentsPanel-CGEhbjx0.js} +1 -1
- package/dist/{CommentsSidebar-Bc7nORmD.js → CommentsSidebar-CUpst9ou.js} +10 -10
- package/dist/{CountdownToolbar-Bnq25sR-.js → CountdownToolbar-B1a_UIuB.js} +3 -3
- package/dist/{DesignReferenceSidebar-Cl5eE8Kn.js → DesignReferenceSidebar-DkAmsBgM.js} +5 -5
- package/dist/{IssuesPanel-Dnns3O9z.js → IssuesPanel-lTpsCV4a.js} +5 -5
- package/dist/{LogicTagInsertButton-SI6irEtn.js → LogicTagInsertButton-B5YymR4U.js} +3 -3
- package/dist/{MediaEditModal-C-InB-H2.js → MediaEditModal-B1X8qtJb.js} +1 -1
- package/dist/{MediaPanels-CTosUpeo.js → MediaPanels-DO30L1KS.js} +1 -1
- package/dist/{MergeTagInput-BMQGNh1k.js → MergeTagInput-B0M_-X0K.js} +1 -1
- package/dist/{MergeTagModeToggle-Cm9s-w6o.js → MergeTagModeToggle-B-8W1tK7.js} +3 -3
- package/dist/{ParagraphEditor-CnBPQCVo.js → ParagraphEditor-BhhpXgoO.js} +20 -20
- package/dist/{RestoreVersionDialog-B13whpxH.js → RestoreVersionDialog-DE8aqmdi.js} +3 -3
- package/dist/{RichTextEditorContent-DOvhgc-7.js → RichTextEditorContent-AaLAArA0.js} +4 -4
- package/dist/{SaveBlockDialog-b5yrQfoN.js → SaveBlockDialog-BJ-hEwLv.js} +8 -8
- package/dist/{SavedBlocksBrowserModal-DpqK4Zqp.js → SavedBlocksBrowserModal-nLI8aAQ5.js} +9 -9
- package/dist/{SavedBlocksPanels-C2wURIlT.js → SavedBlocksPanels-RnzUMUJI.js} +1 -1
- package/dist/{SavedBlocksPickBar-Bx9_SXVA.js → SavedBlocksPickBar-D3QA3Tgy.js} +2 -2
- package/dist/{TemplateScoringPanel-Cs0TGtRF.js → TemplateScoringPanel-C6ellAcs.js} +11 -11
- package/dist/{TemplateSettings-Gn9ps1R6.js → TemplateSettings-C_0qK-zs.js} +5 -5
- package/dist/{TestEmailModal-DaIaklcg.js → TestEmailModal-CnyxLhWJ.js} +6 -6
- package/dist/{TestEmailPanel-CKSvzakC.js → TestEmailPanel-BRisIL4G.js} +1 -1
- package/dist/{TitleEditor-C66Jk73n.js → TitleEditor-lPITPzw6.js} +9 -9
- package/dist/{ToggleSwitch-BqttX9lY.js → ToggleSwitch-CtZ6adlX.js} +1 -1
- package/dist/{Toolbar-DVsKYQaC.js → Toolbar-B6dG5_IP.js} +20 -20
- package/dist/{TplModal-DRQln7xH.js → TplModal-BiAf7tWe.js} +1 -1
- package/dist/{VersionHistoryMenu-b0A8mS2_.js → VersionHistoryMenu-DdspCRSA.js} +5 -5
- package/dist/{VersionHistoryPanels-Df5WjNah.js → VersionHistoryPanels-C589Jm_B.js} +1 -1
- package/dist/{VersionPreviewBanner-xB9r83r0.js → VersionPreviewBanner-XUuLe36h.js} +1 -1
- package/dist/{WrapperBlock-B0cUORGz.js → WrapperBlock-CVQ4t1tY.js} +1 -1
- package/dist/{blockTypeIcons-DfQNZnl7.js → blockTypeIcons-Sg8SY1NQ.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiChatSidebar-DD17BwXn.js → AiChatSidebar-DiG-EQ-E.js} +4 -4
- package/dist/cdn/chunks/AiChatSidebar-DiG-EQ-E.js.map +1 -0
- package/dist/cdn/chunks/{AiFeatureMenu-Di381OsL.js → AiFeatureMenu-BXSPgOzA.js} +3 -3
- package/dist/cdn/chunks/AiFeatureMenu-BXSPgOzA.js.map +1 -0
- package/dist/cdn/chunks/{BlockIssueBadge-BR_N3nRh.js → BlockIssueBadge-ChQ0mPf5.js} +2 -2
- package/dist/cdn/chunks/BlockIssueBadge-ChQ0mPf5.js.map +1 -0
- package/dist/cdn/chunks/{BlockPreviewCanvas-BXpcAiiY.js → BlockPreviewCanvas-CMmv1FTA.js} +3 -3
- package/dist/cdn/chunks/BlockPreviewCanvas-CMmv1FTA.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-BEM2eWfF.js → CloudHeaderExtras-yvFz2_e-.js} +3 -3
- package/dist/cdn/chunks/CloudHeaderExtras-yvFz2_e-.js.map +1 -0
- package/dist/cdn/chunks/{CloudPanels-D7nK1-bm.js → CloudPanels-DpKck9Na.js} +4 -4
- package/dist/cdn/chunks/CloudPanels-DpKck9Na.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-D1SUwahw.js → CollaboratorBar-Clm1ZVXQ.js} +3 -3
- package/dist/cdn/chunks/CollaboratorBar-Clm1ZVXQ.js.map +1 -0
- package/dist/cdn/chunks/{CommentsPanel-qsLMAlJU.js → CommentsPanel-CjhxGMjL.js} +2 -2
- package/dist/cdn/chunks/CommentsPanel-CjhxGMjL.js.map +1 -0
- package/dist/cdn/chunks/{CommentsSidebar-CTwEE-s_.js → CommentsSidebar-D9bqMnlt.js} +2 -2
- package/dist/cdn/chunks/CommentsSidebar-D9bqMnlt.js.map +1 -0
- package/dist/cdn/chunks/CountdownBlock-sVDjKkRw.js.map +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BJTcnIQ-.js → CountdownToolbar-CIRx5w1U.js} +4 -4
- package/dist/cdn/chunks/CountdownToolbar-CIRx5w1U.js.map +1 -0
- package/dist/cdn/chunks/{DesignReferenceSidebar-Dl3eEGtS.js → DesignReferenceSidebar-C1-SbE_R.js} +2 -2
- package/dist/cdn/chunks/DesignReferenceSidebar-C1-SbE_R.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-L9Gq_T8n.js → IssuesPanel-qKY6UDd-.js} +2 -2
- package/dist/cdn/chunks/IssuesPanel-qKY6UDd-.js.map +1 -0
- package/dist/cdn/chunks/LoadingTrack-_7DH_5aw.js.map +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-3pIbVE9p.js → LogicTagInsertButton-CItDS_U1.js} +2 -2
- package/dist/cdn/chunks/LogicTagInsertButton-CItDS_U1.js.map +1 -0
- package/dist/cdn/chunks/{MediaEditModal-rTjYl-fV.js → MediaEditModal-CzUtXkpk.js} +2 -2
- package/dist/cdn/chunks/MediaEditModal-CzUtXkpk.js.map +1 -0
- package/dist/cdn/chunks/{MediaPanels-DMXRQVqg.js → MediaPanels-DOLsh7WC.js} +2 -2
- package/dist/cdn/chunks/MediaPanels-DOLsh7WC.js.map +1 -0
- package/dist/cdn/chunks/{MergeTagInput-JcBzr77a.js → MergeTagInput-B33u3nxj.js} +2 -2
- package/dist/cdn/chunks/MergeTagInput-B33u3nxj.js.map +1 -0
- package/dist/cdn/chunks/{MergeTagModeToggle-CYmueXS2.js → MergeTagModeToggle-Bz1CH3NT.js} +2 -2
- package/dist/cdn/chunks/MergeTagModeToggle-Bz1CH3NT.js.map +1 -0
- package/dist/cdn/chunks/{ParagraphEditor-DbjFDnYm.js → ParagraphEditor-J74SIn-m.js} +24 -24
- package/dist/cdn/chunks/ParagraphEditor-J74SIn-m.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog-pANCWcce.js → RestoreVersionDialog-CFE7jqDB.js} +3 -3
- package/dist/cdn/chunks/RestoreVersionDialog-CFE7jqDB.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-BtM1or8A.js → RichTextEditorContent-dOg1xFqv.js} +4 -4
- package/dist/cdn/chunks/RichTextEditorContent-dOg1xFqv.js.map +1 -0
- package/dist/cdn/chunks/{SaveBlockDialog-CGM3mrGj.js → SaveBlockDialog-DZOmDCC8.js} +6 -6
- package/dist/cdn/chunks/SaveBlockDialog-DZOmDCC8.js.map +1 -0
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-C6Z8AvtD.js → SavedBlocksBrowserModal-B43H5zKA.js} +6 -6
- package/dist/cdn/chunks/SavedBlocksBrowserModal-B43H5zKA.js.map +1 -0
- package/dist/cdn/chunks/{SavedBlocksPanels-DNwKmnhp.js → SavedBlocksPanels-uTSb2xO_.js} +2 -2
- package/dist/cdn/chunks/SavedBlocksPanels-uTSb2xO_.js.map +1 -0
- package/dist/cdn/chunks/{SavedBlocksPickBar-D2p1ufB4.js → SavedBlocksPickBar-BUvmGqHK.js} +3 -3
- package/dist/cdn/chunks/SavedBlocksPickBar-BUvmGqHK.js.map +1 -0
- package/dist/cdn/chunks/{TemplateScoringPanel-BDB4RErx.js → TemplateScoringPanel-ebsrVge3.js} +2 -2
- package/dist/cdn/chunks/TemplateScoringPanel-ebsrVge3.js.map +1 -0
- package/dist/cdn/chunks/{TemplateSettings-DVN1t3yF.js → TemplateSettings-BaEVdUTM.js} +4 -4
- package/dist/cdn/chunks/TemplateSettings-BaEVdUTM.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailModal-DZBCmBtT.js → TestEmailModal-ide7UP_H.js} +6 -6
- package/dist/cdn/chunks/TestEmailModal-ide7UP_H.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailPanel-1ibwYCUl.js → TestEmailPanel-Cqdsnufx.js} +2 -2
- package/dist/cdn/chunks/TestEmailPanel-Cqdsnufx.js.map +1 -0
- package/dist/cdn/chunks/{TitleEditor-BRl2qKbd.js → TitleEditor-CoFzxLPA.js} +8 -8
- package/dist/cdn/chunks/TitleEditor-CoFzxLPA.js.map +1 -0
- package/dist/cdn/chunks/{ToggleSwitch-niSL2uog.js → ToggleSwitch-D-8dCEbI.js} +2 -2
- package/dist/cdn/chunks/ToggleSwitch-D-8dCEbI.js.map +1 -0
- package/dist/cdn/chunks/{Toolbar-tTl0P-rr.js → Toolbar-BDzhrmGV.js} +32 -32
- package/dist/cdn/chunks/Toolbar-BDzhrmGV.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-C_eIPykE.js → TplModal-mLMmolQp.js} +2 -2
- package/dist/cdn/chunks/TplModal-mLMmolQp.js.map +1 -0
- package/dist/cdn/chunks/{VersionHistoryMenu-Ww57XAzj.js → VersionHistoryMenu-C_bBKOYU.js} +2 -2
- package/dist/cdn/chunks/VersionHistoryMenu-C_bBKOYU.js.map +1 -0
- package/dist/cdn/chunks/{VersionHistoryPanels-w0EG_qVW.js → VersionHistoryPanels-B9LwOKxm.js} +2 -2
- package/dist/cdn/chunks/VersionHistoryPanels-B9LwOKxm.js.map +1 -0
- package/dist/cdn/chunks/{VersionPreviewBanner-Bbd4C-AN.js → VersionPreviewBanner-CKyrcgxJ.js} +2 -2
- package/dist/cdn/chunks/VersionPreviewBanner-CKyrcgxJ.js.map +1 -0
- package/dist/cdn/chunks/{WrapperBlock-Ch4KeMIb.js → WrapperBlock-DI8vSvTO.js} +2 -2
- package/dist/cdn/chunks/WrapperBlock-DI8vSvTO.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-CyPXFh7L.js → blockTypeIcons-CdfCfqHE.js} +2 -2
- package/dist/cdn/chunks/blockTypeIcons-CdfCfqHE.js.map +1 -0
- package/dist/cdn/chunks/ca--zGWn9AU.js.map +1 -1
- package/dist/cdn/chunks/ca-BTf1Zbqb.js.map +1 -1
- package/dist/cdn/chunks/cloud-De-eh1u6.js.map +1 -1
- package/dist/cdn/chunks/createCloudRuntime-DsaUaWvr.js.map +1 -1
- package/dist/cdn/chunks/de-BRNLKcDl.js.map +1 -1
- package/dist/cdn/chunks/de-mMY5yQJu.js.map +1 -1
- package/dist/cdn/chunks/de-xzrh9PA3.js.map +1 -1
- package/dist/cdn/chunks/dist-BRZhN8qJ.js.map +1 -1
- package/dist/cdn/chunks/dist-CXB2_kBa.js.map +1 -1
- package/dist/cdn/chunks/draggable-IB4x6w2O.js.map +1 -1
- package/dist/cdn/chunks/{editor-modal-BdI0iA5r.js → editor-modal-CZQArGNj.js} +4 -4
- package/dist/cdn/chunks/editor-modal-CZQArGNj.js.map +1 -0
- package/dist/cdn/chunks/emojiData-6m0DBh7O.js.map +1 -1
- package/dist/cdn/chunks/en-9unxBjV8.js +2 -0
- package/dist/cdn/chunks/en-ChVeGQBY.js.map +1 -1
- package/dist/cdn/chunks/en-JJjqHMjy.js.map +1 -1
- package/dist/cdn/chunks/es-BIh8BxV9.js.map +1 -1
- package/dist/cdn/chunks/es-BT4LSpE2.js.map +1 -1
- package/dist/cdn/chunks/{extensions-DK_9-6Bd.js → extensions-Dy251lPd.js} +3 -3
- package/dist/cdn/chunks/extensions-Dy251lPd.js.map +1 -0
- package/dist/cdn/chunks/formatAbsoluteDateTime-DMmop3C-.js.map +1 -1
- package/dist/cdn/chunks/formatRelativeTime-CtUU-QZ8.js.map +1 -1
- package/dist/cdn/chunks/fr-C5VUZogP.js.map +1 -1
- package/dist/cdn/chunks/fr-CI7OJoql.js.map +1 -1
- package/dist/cdn/chunks/htmlparser-ClUZ6waR.js.map +1 -1
- package/dist/cdn/chunks/{icons-Bad3WZ3G.js → icons-CQnjugjy.js} +38 -38
- package/dist/cdn/chunks/icons-CQnjugjy.js.map +1 -0
- package/dist/cdn/chunks/ja-DhlWUfke.js.map +1 -1
- package/dist/cdn/chunks/ja-x5JYxaCW.js.map +1 -1
- package/dist/cdn/chunks/keys-DCWeHkSF.js.map +1 -1
- package/dist/cdn/chunks/liquid.browser-BypTT2oc.js.map +1 -1
- package/dist/cdn/chunks/logger-ByvdoAwq.js.map +1 -1
- package/dist/cdn/chunks/nl-D8y5OWGB.js.map +1 -1
- package/dist/cdn/chunks/nl-UXxFyXV6.js.map +1 -1
- package/dist/cdn/chunks/preRenderCustomBlocks-h4ZFBKbD.js.map +1 -1
- package/dist/cdn/chunks/pt-BR-CoCwRUi0.js.map +1 -1
- package/dist/cdn/chunks/pt-BR-DHm3SP6W.js.map +1 -1
- package/dist/cdn/chunks/pt-BR-DMCbUBvJ.js.map +1 -1
- package/dist/cdn/chunks/pusher-BbIHJKf3.js.map +1 -1
- package/dist/cdn/chunks/readableTextColor-f8Kykfnh.js.map +1 -1
- package/dist/cdn/chunks/socialIcons-ZOCwCCyn.js.map +1 -1
- package/dist/cdn/chunks/src-BR3I3gOW.js.map +1 -1
- package/dist/cdn/chunks/src-fZSLjhjy.js.map +1 -1
- package/dist/cdn/chunks/{src-BxoLKnkl.js → src-nhIF5-mf.js} +3 -3
- package/dist/cdn/chunks/src-nhIF5-mf.js.map +1 -0
- package/dist/cdn/chunks/styleConstants-C_YAPdQS.js.map +1 -1
- package/dist/cdn/chunks/templateSettingsFields-YCFVBVYh.js.map +1 -1
- package/dist/cdn/chunks/timeouts-DHPZQ0G3.js.map +1 -1
- package/dist/cdn/chunks/{tiptap-DhLuKyDc.js → tiptap-D1u8JIUW.js} +1916 -1917
- package/dist/cdn/chunks/tiptap-D1u8JIUW.js.map +1 -0
- package/dist/cdn/chunks/useAliveFlag-DAlQLbM2.js.map +1 -1
- package/dist/cdn/chunks/useCloudI18n-CrjWbpbu.js.map +1 -1
- package/dist/cdn/chunks/{useEditorCore-yd40TFKy.js → useEditorCore-D4kzTMtQ.js} +5 -5
- package/dist/cdn/chunks/useEditorCore-D4kzTMtQ.js.map +1 -0
- package/dist/cdn/chunks/useEditorRoot-CshefZLP.js.map +1 -1
- package/dist/cdn/chunks/useI18n-CyO_Nmca.js.map +1 -1
- package/dist/cdn/chunks/useLogicTag-J_i_hvZg.js.map +1 -1
- package/dist/cdn/chunks/useMergeTag-C5MyHYxJ.js.map +1 -1
- package/dist/cdn/chunks/usePopoverPosition-DGXjXKjM.js.map +1 -1
- package/dist/cdn/chunks/useScrollToBlock-DgHZJvID.js.map +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +495 -466
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-eqb2JhqU.js → check-BMx_TLAS.js} +1 -1
- package/dist/{chevron-down-Dkr-7Ywl.js → chevron-down-KZf5mh9_.js} +1 -1
- package/dist/{chevron-right-Bge4XF_B.js → chevron-right-BLZ60Vxw.js} +1 -1
- package/dist/{chevron-up-CQAyl0kC.js → chevron-up-B9ynB8eU.js} +1 -1
- package/dist/{circle-alert-CYgTHKWr.js → circle-alert-pjvFFDrF.js} +1 -1
- package/dist/{clock-BgSJZJP5.js → clock-CiiTBfF3.js} +1 -1
- package/dist/{copy-mw6PVnOJ.js → copy-BF0_pQjH.js} +1 -1
- package/dist/{createLucideIcon-BxY5yz5u.js → createLucideIcon-C2YOVVWx.js} +8 -8
- package/dist/{dist-CQSVro7b.js → dist-B0dkvy7z.js} +1 -1
- package/dist/{dist-BJM3eFyT.js → dist-BPWuzECC.js} +1 -1
- package/dist/{dist-EDkj3Ub1.js → dist-BUHovM4k.js} +1 -1
- package/dist/{dist-BmsLcnrO.js → dist-BwoEME8p.js} +1 -1
- package/dist/{dist-DerFNpDY.js → dist-C2Ge44fD.js} +760 -761
- package/dist/{dist-BdHF7nyq.js → dist-CIxmOOSG.js} +5 -5
- package/dist/{dist-wyXxj3R1.js → dist-CJ7RZARo.js} +1 -1
- package/dist/{dist-Bl4rxpX9.js → dist-CxmLZQso.js} +1 -1
- package/dist/{dist-DyrEOKEJ.js → dist-DRmafAUz.js} +1 -1
- package/dist/{dist-Djmzp6wi.js → dist-DdOAotfz.js} +1 -1
- package/dist/{dist-BxVnMgXZ.js → dist-W_ERo6c_.js} +1 -1
- package/dist/{dist-DQbOebGW.js → dist-p-LkiWIQ.js} +1 -1
- package/dist/{editor-modal-qzmEVcIk.js → editor-modal-99FB40dl.js} +16 -16
- package/dist/en-BvOjRLiw.js +2 -0
- package/dist/{extensions-DoT2-_pz.js → extensions-DqQXxrvP.js} +3 -3
- package/dist/{eye-DphkRtAD.js → eye-RdXYgrQZ.js} +1 -1
- package/dist/{image-up-Qi2BXD7T.js → image-up-BwdoReQt.js} +1 -1
- package/dist/{info-VSyAs02q.js → info-zFMSGrL1.js} +1 -1
- package/dist/{link-CNuozGqD.js → link-D7orqFBT.js} +1 -1
- package/dist/{list-BA0I5Wmu.js → list-BGt4Pgxc.js} +1 -1
- package/dist/{loader-circle-z5eeqasv.js → loader-circle-BVBgkRGz.js} +1 -1
- package/dist/{message-circle-BsQ9hEup.js → message-circle-D8YLsarv.js} +1 -1
- package/dist/{package-OkXfuRoO.js → package-CuFvk0L5.js} +1 -1
- package/dist/{pencil-DFVFA7Dj.js → pencil-DRYbmZW7.js} +1 -1
- package/dist/{plus-D8bkVjZ7.js → plus-Dv0b3kh0.js} +1 -1
- package/dist/{refresh-cw-DPB7YFuz.js → refresh-cw-gYTIS5bJ.js} +1 -1
- package/dist/{search-C-dCgqIa.js → search-D84_Ki_a.js} +1 -1
- package/dist/{send-Cm2fy2zm.js → send-Cn-8_H_U.js} +1 -1
- package/dist/{shield-check-COgBYFDF.js → shield-check-BOoVWJtD.js} +1 -1
- package/dist/{smartphone-v0u_MOEV.js → smartphone-4Ej3PBw5.js} +1 -1
- package/dist/{socialIcons-CACVa6m_.js → socialIcons-CzRJskEk.js} +1 -1
- package/dist/{sparkles-Ds0RF8Iu.js → sparkles-D3vnNe7O.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +404 -375
- package/dist/{text-align-start-DiavaIm6.js → text-align-start-Ci2h_Xly.js} +1 -1
- package/dist/{trash-DnOkfu2V.js → trash-wmi4UKvv.js} +1 -1
- package/dist/{triangle-alert-DGLAyXnh.js → triangle-alert-DJ0r2wmQ.js} +1 -1
- package/dist/{upload-BBDme2cy.js → upload-XMde-TXf.js} +1 -1
- package/dist/{useEditorCore-LyNoGs0m.js → useEditorCore-Dhit8Ygg.js} +11 -11
- package/dist/{useScrollToBlock-Dj4v3rxr.js → useScrollToBlock-B4F7KCrf.js} +1 -1
- package/dist/{x-3BHV3Q6K.js → x-BWrtpVl-.js} +1 -1
- package/package.json +10 -10
- package/dist/cdn/chunks/AiChatSidebar-DD17BwXn.js.map +0 -1
- package/dist/cdn/chunks/AiFeatureMenu-Di381OsL.js.map +0 -1
- package/dist/cdn/chunks/BlockIssueBadge-BR_N3nRh.js.map +0 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-BXpcAiiY.js.map +0 -1
- package/dist/cdn/chunks/CloudHeaderExtras-BEM2eWfF.js.map +0 -1
- package/dist/cdn/chunks/CloudPanels-D7nK1-bm.js.map +0 -1
- package/dist/cdn/chunks/CollaboratorBar-D1SUwahw.js.map +0 -1
- package/dist/cdn/chunks/CommentsPanel-qsLMAlJU.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-CTwEE-s_.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-BJTcnIQ-.js.map +0 -1
- package/dist/cdn/chunks/DesignReferenceSidebar-Dl3eEGtS.js.map +0 -1
- package/dist/cdn/chunks/IssuesPanel-L9Gq_T8n.js.map +0 -1
- package/dist/cdn/chunks/LogicTagInsertButton-3pIbVE9p.js.map +0 -1
- package/dist/cdn/chunks/MediaEditModal-rTjYl-fV.js.map +0 -1
- package/dist/cdn/chunks/MediaPanels-DMXRQVqg.js.map +0 -1
- package/dist/cdn/chunks/MergeTagInput-JcBzr77a.js.map +0 -1
- package/dist/cdn/chunks/MergeTagModeToggle-CYmueXS2.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-DbjFDnYm.js.map +0 -1
- package/dist/cdn/chunks/RestoreVersionDialog-pANCWcce.js.map +0 -1
- package/dist/cdn/chunks/RichTextEditorContent-BtM1or8A.js.map +0 -1
- package/dist/cdn/chunks/SaveBlockDialog-CGM3mrGj.js.map +0 -1
- package/dist/cdn/chunks/SavedBlocksBrowserModal-C6Z8AvtD.js.map +0 -1
- package/dist/cdn/chunks/SavedBlocksPanels-DNwKmnhp.js.map +0 -1
- package/dist/cdn/chunks/SavedBlocksPickBar-D2p1ufB4.js.map +0 -1
- package/dist/cdn/chunks/TemplateScoringPanel-BDB4RErx.js.map +0 -1
- package/dist/cdn/chunks/TemplateSettings-DVN1t3yF.js.map +0 -1
- package/dist/cdn/chunks/TestEmailModal-DZBCmBtT.js.map +0 -1
- package/dist/cdn/chunks/TestEmailPanel-1ibwYCUl.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-BRl2qKbd.js.map +0 -1
- package/dist/cdn/chunks/ToggleSwitch-niSL2uog.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-tTl0P-rr.js.map +0 -1
- package/dist/cdn/chunks/TplModal-C_eIPykE.js.map +0 -1
- package/dist/cdn/chunks/VersionHistoryMenu-Ww57XAzj.js.map +0 -1
- package/dist/cdn/chunks/VersionHistoryPanels-w0EG_qVW.js.map +0 -1
- package/dist/cdn/chunks/VersionPreviewBanner-Bbd4C-AN.js.map +0 -1
- package/dist/cdn/chunks/WrapperBlock-Ch4KeMIb.js.map +0 -1
- package/dist/cdn/chunks/blockTypeIcons-CyPXFh7L.js.map +0 -1
- package/dist/cdn/chunks/editor-modal-BdI0iA5r.js.map +0 -1
- package/dist/cdn/chunks/en-Cs-nw16K.js +0 -2
- package/dist/cdn/chunks/extensions-DK_9-6Bd.js.map +0 -1
- package/dist/cdn/chunks/icons-Bad3WZ3G.js.map +0 -1
- package/dist/cdn/chunks/src-BxoLKnkl.js.map +0 -1
- package/dist/cdn/chunks/tiptap-DhLuKyDc.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-yd40TFKy.js.map +0 -1
- package/dist/en-1tgLzB8q.js +0 -2
|
@@ -74,7 +74,7 @@ n.prototype = {
|
|
|
74
74
|
return new n(t);
|
|
75
75
|
};
|
|
76
76
|
//#endregion
|
|
77
|
-
//#region ../../node_modules/.pnpm/prosemirror-model@1.25.
|
|
77
|
+
//#region ../../node_modules/.pnpm/prosemirror-model@1.25.12/node_modules/prosemirror-model/dist/index.js
|
|
78
78
|
function r(e, t, n) {
|
|
79
79
|
for (let i = 0;; i++) {
|
|
80
80
|
if (i == e.childCount || i == t.childCount) return e.childCount == t.childCount ? null : n;
|
|
@@ -322,8 +322,7 @@ var d = class e {
|
|
|
322
322
|
if (!t) throw RangeError("Invalid input for Mark.fromJSON");
|
|
323
323
|
let n = e.marks[t.type];
|
|
324
324
|
if (!n) throw RangeError(`There is no mark type ${t.type} in this schema`);
|
|
325
|
-
|
|
326
|
-
return n.checkAttrs(r.attrs), r;
|
|
325
|
+
return n.create(t.attrs);
|
|
327
326
|
}
|
|
328
327
|
static sameSet(e, t) {
|
|
329
328
|
if (e == t) return !0;
|
|
@@ -749,11 +748,11 @@ var ie = class e {
|
|
|
749
748
|
return e.content.size ? this.canReplace(this.childCount, this.childCount, e.content) : this.type.compatibleContent(e.type);
|
|
750
749
|
}
|
|
751
750
|
check() {
|
|
752
|
-
this.type.checkContent(this.content), this.type.
|
|
751
|
+
this.type.checkContent(this.content), pe(this.type.attrs, this.attrs, "node", this.type.name);
|
|
753
752
|
let e = d.none;
|
|
754
753
|
for (let t = 0; t < this.marks.length; t++) {
|
|
755
754
|
let n = this.marks[t];
|
|
756
|
-
n.type.
|
|
755
|
+
pe(n.type.attrs, n.attrs, "mark", n.type.name), e = n.addToSet(e);
|
|
757
756
|
}
|
|
758
757
|
if (!d.sameSet(e, this.marks)) throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e) => e.type.name)}`);
|
|
759
758
|
this.content.forEach((e) => e.check());
|
|
@@ -777,8 +776,8 @@ var ie = class e {
|
|
|
777
776
|
if (typeof t.text != "string") throw RangeError("Invalid text node in JSON");
|
|
778
777
|
return e.text(t.text, n);
|
|
779
778
|
}
|
|
780
|
-
let r = s.fromJSON(e, t.content)
|
|
781
|
-
return
|
|
779
|
+
let r = s.fromJSON(e, t.content);
|
|
780
|
+
return e.nodeType(t.type).create(t.attrs, r, n);
|
|
782
781
|
}
|
|
783
782
|
};
|
|
784
783
|
ue.prototype.text = void 0;
|
|
@@ -820,17 +819,21 @@ function fe(e, t) {
|
|
|
820
819
|
for (let n = e.length - 1; n >= 0; n--) t = e[n].type.name + "(" + t + ")";
|
|
821
820
|
return t;
|
|
822
821
|
}
|
|
823
|
-
|
|
822
|
+
function pe(e, t, n, r) {
|
|
823
|
+
for (let i in t) if (!(i in e)) throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);
|
|
824
|
+
for (let n in e) e[n].validate && e[n].validate(t[n]);
|
|
825
|
+
}
|
|
826
|
+
var me = class e {
|
|
824
827
|
constructor(e) {
|
|
825
828
|
this.validEnd = e, this.next = [], this.wrapCache = [];
|
|
826
829
|
}
|
|
827
830
|
static parse(t, n) {
|
|
828
|
-
let r = new
|
|
831
|
+
let r = new he(t, n);
|
|
829
832
|
if (r.next == null) return e.empty;
|
|
830
|
-
let i =
|
|
833
|
+
let i = ge(r);
|
|
831
834
|
r.next && r.err("Unexpected trailing text");
|
|
832
|
-
let a =
|
|
833
|
-
return
|
|
835
|
+
let a = Ee(Ce(i));
|
|
836
|
+
return De(a, r), a;
|
|
834
837
|
}
|
|
835
838
|
matchType(e) {
|
|
836
839
|
for (let t = 0; t < this.next.length; t++) if (this.next[t].type == e) return this.next[t].next;
|
|
@@ -921,8 +924,8 @@ var pe = class e {
|
|
|
921
924
|
}).join("\n");
|
|
922
925
|
}
|
|
923
926
|
};
|
|
924
|
-
|
|
925
|
-
var
|
|
927
|
+
me.empty = new me(!0);
|
|
928
|
+
var he = class {
|
|
926
929
|
constructor(e, t) {
|
|
927
930
|
this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
|
|
928
931
|
}
|
|
@@ -936,28 +939,28 @@ var me = class {
|
|
|
936
939
|
throw SyntaxError(e + " (in content expression '" + this.string + "')");
|
|
937
940
|
}
|
|
938
941
|
};
|
|
939
|
-
function
|
|
942
|
+
function ge(e) {
|
|
940
943
|
let t = [];
|
|
941
944
|
do
|
|
942
|
-
t.push(
|
|
945
|
+
t.push(_e(e));
|
|
943
946
|
while (e.eat("|"));
|
|
944
947
|
return t.length == 1 ? t[0] : {
|
|
945
948
|
type: "choice",
|
|
946
949
|
exprs: t
|
|
947
950
|
};
|
|
948
951
|
}
|
|
949
|
-
function
|
|
952
|
+
function _e(e) {
|
|
950
953
|
let t = [];
|
|
951
954
|
do
|
|
952
|
-
t.push(
|
|
955
|
+
t.push(ve(e));
|
|
953
956
|
while (e.next && e.next != ")" && e.next != "|");
|
|
954
957
|
return t.length == 1 ? t[0] : {
|
|
955
958
|
type: "seq",
|
|
956
959
|
exprs: t
|
|
957
960
|
};
|
|
958
961
|
}
|
|
959
|
-
function
|
|
960
|
-
let t =
|
|
962
|
+
function ve(e) {
|
|
963
|
+
let t = Se(e);
|
|
961
964
|
for (;;) if (e.eat("+")) t = {
|
|
962
965
|
type: "plus",
|
|
963
966
|
expr: t
|
|
@@ -970,25 +973,25 @@ function _e(e) {
|
|
|
970
973
|
type: "opt",
|
|
971
974
|
expr: t
|
|
972
975
|
};
|
|
973
|
-
else if (e.eat("{")) t =
|
|
976
|
+
else if (e.eat("{")) t = be(e, t);
|
|
974
977
|
else break;
|
|
975
978
|
return t;
|
|
976
979
|
}
|
|
977
|
-
function
|
|
980
|
+
function ye(e) {
|
|
978
981
|
/\D/.test(e.next) && e.err("Expected number, got '" + e.next + "'");
|
|
979
982
|
let t = Number(e.next);
|
|
980
983
|
return e.pos++, t;
|
|
981
984
|
}
|
|
982
|
-
function
|
|
983
|
-
let n =
|
|
984
|
-
return e.eat(",") && (r = e.next == "}" ? -1 :
|
|
985
|
+
function be(e, t) {
|
|
986
|
+
let n = ye(e), r = n;
|
|
987
|
+
return e.eat(",") && (r = e.next == "}" ? -1 : ye(e)), e.eat("}") || e.err("Unclosed braced range"), {
|
|
985
988
|
type: "range",
|
|
986
989
|
min: n,
|
|
987
990
|
max: r,
|
|
988
991
|
expr: t
|
|
989
992
|
};
|
|
990
993
|
}
|
|
991
|
-
function
|
|
994
|
+
function xe(e, t) {
|
|
992
995
|
let n = e.nodeTypes, r = n[t];
|
|
993
996
|
if (r) return [r];
|
|
994
997
|
let i = [];
|
|
@@ -998,14 +1001,14 @@ function be(e, t) {
|
|
|
998
1001
|
}
|
|
999
1002
|
return i.length == 0 && e.err("No node type or group '" + t + "' found"), i;
|
|
1000
1003
|
}
|
|
1001
|
-
function
|
|
1004
|
+
function Se(e) {
|
|
1002
1005
|
if (e.eat("(")) {
|
|
1003
|
-
let t =
|
|
1006
|
+
let t = ge(e);
|
|
1004
1007
|
return e.eat(")") || e.err("Missing closing paren"), t;
|
|
1005
1008
|
}
|
|
1006
1009
|
if (/\W/.test(e.next)) e.err("Unexpected token '" + e.next + "'");
|
|
1007
1010
|
else {
|
|
1008
|
-
let t =
|
|
1011
|
+
let t = xe(e, e.next).map((t) => (e.inline == null ? e.inline = t.isInline : e.inline != t.isInline && e.err("Mixing inline and block content"), {
|
|
1009
1012
|
type: "name",
|
|
1010
1013
|
value: t
|
|
1011
1014
|
}));
|
|
@@ -1015,7 +1018,7 @@ function xe(e) {
|
|
|
1015
1018
|
};
|
|
1016
1019
|
}
|
|
1017
1020
|
}
|
|
1018
|
-
function
|
|
1021
|
+
function Ce(e) {
|
|
1019
1022
|
let t = [[]];
|
|
1020
1023
|
return i(a(e, 0), n()), t;
|
|
1021
1024
|
function n() {
|
|
@@ -1061,12 +1064,12 @@ function Se(e) {
|
|
|
1061
1064
|
else throw Error("Unknown expr type");
|
|
1062
1065
|
}
|
|
1063
1066
|
}
|
|
1064
|
-
function
|
|
1067
|
+
function we(e, t) {
|
|
1065
1068
|
return t - e;
|
|
1066
1069
|
}
|
|
1067
|
-
function
|
|
1070
|
+
function Te(e, t) {
|
|
1068
1071
|
let n = [];
|
|
1069
|
-
return r(t), n.sort(
|
|
1072
|
+
return r(t), n.sort(we);
|
|
1070
1073
|
function r(t) {
|
|
1071
1074
|
let i = e[t];
|
|
1072
1075
|
if (i.length == 1 && !i[0].term) return r(i[0].to);
|
|
@@ -1077,9 +1080,9 @@ function we(e, t) {
|
|
|
1077
1080
|
}
|
|
1078
1081
|
}
|
|
1079
1082
|
}
|
|
1080
|
-
function
|
|
1083
|
+
function Ee(e) {
|
|
1081
1084
|
let t = Object.create(null);
|
|
1082
|
-
return n(
|
|
1085
|
+
return n(Te(e, 0));
|
|
1083
1086
|
function n(r) {
|
|
1084
1087
|
let i = [];
|
|
1085
1088
|
r.forEach((t) => {
|
|
@@ -1087,14 +1090,14 @@ function Te(e) {
|
|
|
1087
1090
|
if (!t) return;
|
|
1088
1091
|
let r;
|
|
1089
1092
|
for (let e = 0; e < i.length; e++) i[e][0] == t && (r = i[e][1]);
|
|
1090
|
-
|
|
1093
|
+
Te(e, n).forEach((e) => {
|
|
1091
1094
|
r || i.push([t, r = []]), r.indexOf(e) == -1 && r.push(e);
|
|
1092
1095
|
});
|
|
1093
1096
|
});
|
|
1094
1097
|
});
|
|
1095
|
-
let a = t[r.join(",")] = new
|
|
1098
|
+
let a = t[r.join(",")] = new me(r.indexOf(e.length - 1) > -1);
|
|
1096
1099
|
for (let e = 0; e < i.length; e++) {
|
|
1097
|
-
let r = i[e][1].sort(
|
|
1100
|
+
let r = i[e][1].sort(we);
|
|
1098
1101
|
a.next.push({
|
|
1099
1102
|
type: i[e][0],
|
|
1100
1103
|
next: t[r.join(",")] || n(r)
|
|
@@ -1103,7 +1106,7 @@ function Te(e) {
|
|
|
1103
1106
|
return a;
|
|
1104
1107
|
}
|
|
1105
1108
|
}
|
|
1106
|
-
function
|
|
1109
|
+
function De(e, t) {
|
|
1107
1110
|
for (let n = 0, r = [e]; n < r.length; n++) {
|
|
1108
1111
|
let e = r[n], i = !e.validEnd, a = [];
|
|
1109
1112
|
for (let t = 0; t < e.next.length; t++) {
|
|
@@ -1113,7 +1116,7 @@ function Ee(e, t) {
|
|
|
1113
1116
|
i && t.err("Only non-generatable nodes (" + a.join(", ") + ") in a required position (see https://prosemirror.net/docs/guide/#generatable)");
|
|
1114
1117
|
}
|
|
1115
1118
|
}
|
|
1116
|
-
function
|
|
1119
|
+
function Oe(e) {
|
|
1117
1120
|
let t = Object.create(null);
|
|
1118
1121
|
for (let n in e) {
|
|
1119
1122
|
let r = e[n];
|
|
@@ -1122,23 +1125,18 @@ function De(e) {
|
|
|
1122
1125
|
}
|
|
1123
1126
|
return t;
|
|
1124
1127
|
}
|
|
1125
|
-
function
|
|
1128
|
+
function ke(e, t) {
|
|
1126
1129
|
let n = Object.create(null);
|
|
1127
1130
|
for (let r in e) {
|
|
1128
|
-
let i = t && t[r];
|
|
1129
|
-
if (
|
|
1130
|
-
|
|
1131
|
-
if (t.hasDefault) i = t.default;
|
|
1131
|
+
let i = e[r], a = t && t[r];
|
|
1132
|
+
if (a === void 0) {
|
|
1133
|
+
if (i.hasDefault) a = i.default;
|
|
1132
1134
|
else throw RangeError("No value supplied for attribute " + r);
|
|
1133
|
-
}
|
|
1134
|
-
n[r] =
|
|
1135
|
+
} else i.validate && i.validate(a);
|
|
1136
|
+
n[r] = a;
|
|
1135
1137
|
}
|
|
1136
1138
|
return n;
|
|
1137
1139
|
}
|
|
1138
|
-
function ke(e, t, n, r) {
|
|
1139
|
-
for (let i in t) if (!(i in e)) throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);
|
|
1140
|
-
for (let n in e) e[n].validate && e[n].validate(t[n]);
|
|
1141
|
-
}
|
|
1142
1140
|
function Ae(e, t) {
|
|
1143
1141
|
let n = Object.create(null);
|
|
1144
1142
|
if (t) for (let r in t) n[r] = new Ne(e, r, t[r]);
|
|
@@ -1146,7 +1144,7 @@ function Ae(e, t) {
|
|
|
1146
1144
|
}
|
|
1147
1145
|
var je = class e {
|
|
1148
1146
|
constructor(e, t, n) {
|
|
1149
|
-
this.name = e, this.schema = t, this.spec = n, this.markSet = null, this.groups = n.group ? n.group.split(" ") : [], this.attrs = Ae(e, n.attrs), this.defaultAttrs =
|
|
1147
|
+
this.name = e, this.schema = t, this.spec = n, this.markSet = null, this.groups = n.group ? n.group.split(" ") : [], this.attrs = Ae(e, n.attrs), this.defaultAttrs = Oe(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(n.inline || e == "text"), this.isText = e == "text";
|
|
1150
1148
|
}
|
|
1151
1149
|
get isInline() {
|
|
1152
1150
|
return !this.isBlock;
|
|
@@ -1155,7 +1153,7 @@ var je = class e {
|
|
|
1155
1153
|
return this.isBlock && this.inlineContent;
|
|
1156
1154
|
}
|
|
1157
1155
|
get isLeaf() {
|
|
1158
|
-
return this.contentMatch ==
|
|
1156
|
+
return this.contentMatch == me.empty;
|
|
1159
1157
|
}
|
|
1160
1158
|
get isAtom() {
|
|
1161
1159
|
return this.isLeaf || !!this.spec.atom;
|
|
@@ -1174,7 +1172,7 @@ var je = class e {
|
|
|
1174
1172
|
return this == e || this.contentMatch.compatible(e.contentMatch);
|
|
1175
1173
|
}
|
|
1176
1174
|
computeAttrs(e) {
|
|
1177
|
-
return !e && this.defaultAttrs ? this.defaultAttrs :
|
|
1175
|
+
return !e && this.defaultAttrs ? this.defaultAttrs : ke(this.attrs, e);
|
|
1178
1176
|
}
|
|
1179
1177
|
create(e = null, t, n) {
|
|
1180
1178
|
if (this.isText) throw Error("NodeType.create can't construct text nodes");
|
|
@@ -1201,9 +1199,7 @@ var je = class e {
|
|
|
1201
1199
|
checkContent(e) {
|
|
1202
1200
|
if (!this.validContent(e)) throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0, 50)}`);
|
|
1203
1201
|
}
|
|
1204
|
-
checkAttrs(e) {
|
|
1205
|
-
ke(this.attrs, e, "node", this.name);
|
|
1206
|
-
}
|
|
1202
|
+
checkAttrs(e) {}
|
|
1207
1203
|
allowsMarkType(e) {
|
|
1208
1204
|
return this.markSet == null || this.markSet.indexOf(e) > -1;
|
|
1209
1205
|
}
|
|
@@ -1245,11 +1241,11 @@ var Ne = class {
|
|
|
1245
1241
|
}, Pe = class e {
|
|
1246
1242
|
constructor(e, t, n, r) {
|
|
1247
1243
|
this.name = e, this.rank = t, this.schema = n, this.spec = r, this.attrs = Ae(e, r.attrs), this.excluded = null;
|
|
1248
|
-
let i =
|
|
1244
|
+
let i = Oe(this.attrs);
|
|
1249
1245
|
this.instance = i ? new d(this, i) : null;
|
|
1250
1246
|
}
|
|
1251
1247
|
create(e = null) {
|
|
1252
|
-
return !e && this.instance ? this.instance : new d(this,
|
|
1248
|
+
return !e && this.instance ? this.instance : new d(this, ke(this.attrs, e));
|
|
1253
1249
|
}
|
|
1254
1250
|
static compile(t, n) {
|
|
1255
1251
|
let r = Object.create(null), i = 0;
|
|
@@ -1262,9 +1258,6 @@ var Ne = class {
|
|
|
1262
1258
|
isInSet(e) {
|
|
1263
1259
|
for (let t = 0; t < e.length; t++) if (e[t].type == this) return e[t];
|
|
1264
1260
|
}
|
|
1265
|
-
checkAttrs(e) {
|
|
1266
|
-
ke(this.attrs, e, "mark", this.name);
|
|
1267
|
-
}
|
|
1268
1261
|
excludes(e) {
|
|
1269
1262
|
return this.excluded.indexOf(e) > -1;
|
|
1270
1263
|
}
|
|
@@ -1278,7 +1271,7 @@ var Ne = class {
|
|
|
1278
1271
|
for (let e in this.nodes) {
|
|
1279
1272
|
if (e in this.marks) throw RangeError(e + " can not be both a node and a mark");
|
|
1280
1273
|
let t = this.nodes[e], n = t.spec.content || "", i = t.spec.marks;
|
|
1281
|
-
if (t.contentMatch = r[n] || (r[n] =
|
|
1274
|
+
if (t.contentMatch = r[n] || (r[n] = me.parse(n, this.nodes)), t.inlineContent = t.contentMatch.inlineContent, t.spec.linebreakReplacement) {
|
|
1282
1275
|
if (this.linebreakReplacement) throw RangeError("Multiple linebreak nodes defined");
|
|
1283
1276
|
if (!t.isInline || !t.isLeaf) throw RangeError("Linebreak replacement nodes must be inline leaf nodes");
|
|
1284
1277
|
this.linebreakReplacement = t;
|
|
@@ -3927,7 +3920,7 @@ function Dr(e) {
|
|
|
3927
3920
|
};
|
|
3928
3921
|
}
|
|
3929
3922
|
//#endregion
|
|
3930
|
-
//#region ../../node_modules/.pnpm/prosemirror-view@1.42.
|
|
3923
|
+
//#region ../../node_modules/.pnpm/prosemirror-view@1.42.5/node_modules/prosemirror-view/dist/index.js
|
|
3931
3924
|
var M = function(e) {
|
|
3932
3925
|
for (var t = 0;; t++) if (e = e.previousSibling, !e) return t;
|
|
3933
3926
|
}, Or = function(e) {
|
|
@@ -5778,11 +5771,11 @@ function no(e, t) {
|
|
|
5778
5771
|
let t = n.nodes[r[e]];
|
|
5779
5772
|
if (!t || t.hasRequiredAttrs()) break;
|
|
5780
5773
|
try {
|
|
5781
|
-
t.
|
|
5774
|
+
i = s.from(t.create(r[e + 1], i));
|
|
5782
5775
|
} catch {
|
|
5783
5776
|
break;
|
|
5784
5777
|
}
|
|
5785
|
-
|
|
5778
|
+
a++, o++;
|
|
5786
5779
|
}
|
|
5787
5780
|
return new p(i, a, o);
|
|
5788
5781
|
}
|
|
@@ -6879,7 +6872,7 @@ function ws(e, t, n, r, i) {
|
|
|
6879
6872
|
t = o.before(s + 1), n = e.state.doc.resolve(n).after(s + 1);
|
|
6880
6873
|
let c = e.state.selection, l = xs(e, t, n, i), u = e.state.doc, d = u.slice(l.from, l.to), f, p;
|
|
6881
6874
|
e.input.lastKeyCode === 8 && Date.now() - 100 < e.input.lastKeyCodeTime ? (f = e.state.selection.to, p = "end") : (f = e.state.selection.from, p = "start"), e.input.lastKeyCode = null;
|
|
6882
|
-
let m =
|
|
6875
|
+
let m = As(d.content, l.doc.content, l.from, f, p);
|
|
6883
6876
|
if (m && e.input.domChangeCount++, (Zr && e.input.lastIOSEnter > Date.now() - 225 || $r) && i.some((e) => e.nodeType == 1 && !Cs.test(e.nodeName)) && (!m || m.endA >= m.endB) && e.someProp("handleKeyDown", (t) => t(e, Br(13, "Enter")))) {
|
|
6884
6877
|
e.input.lastIOSEnter = 0;
|
|
6885
6878
|
return;
|
|
@@ -6903,7 +6896,7 @@ function ws(e, t, n, r, i) {
|
|
|
6903
6896
|
}
|
|
6904
6897
|
e.state.selection.from < e.state.selection.to && m.start == m.endB && e.state.selection instanceof D && (m.start > e.state.selection.from && m.start <= e.state.selection.from + 2 && e.state.selection.from >= l.from ? m.start = e.state.selection.from : m.endA < e.state.selection.to && m.endA >= e.state.selection.to - 2 && e.state.selection.to <= l.to && (m.endB += e.state.selection.to - m.endA, m.endA = e.state.selection.to)), F && Jr <= 11 && m.endB == m.start + 1 && m.endA == m.start && m.start > l.from && l.doc.textBetween(m.start - l.from - 1, m.start - l.from + 1) == " \xA0" && (m.start--, m.endA--, m.endB--);
|
|
6905
6898
|
let h = l.doc.resolveNoCache(m.start - l.from), g = l.doc.resolveNoCache(m.endB - l.from), _ = u.resolve(m.start), ee = h.sameParent(g) && h.parent.inlineContent && _.end() >= m.endA;
|
|
6906
|
-
if ((Zr && e.input.lastIOSEnter > Date.now() - 225 && (!ee || i.some((e) => e.nodeName == "DIV" || e.nodeName == "P")) || !ee &&
|
|
6899
|
+
if ((Zr && e.input.lastIOSEnter > Date.now() - 225 && (!ee || i.some((e) => e.nodeName == "DIV" || e.nodeName == "P")) || !ee && Os(l.doc, h.pos, g.pos)) && e.someProp("handleKeyDown", (t) => t(e, Br(13, "Enter")))) {
|
|
6907
6900
|
e.input.lastIOSEnter = 0;
|
|
6908
6901
|
return;
|
|
6909
6902
|
}
|
|
@@ -6956,17 +6949,23 @@ function Es(e, t) {
|
|
|
6956
6949
|
};
|
|
6957
6950
|
}
|
|
6958
6951
|
function Ds(e, t, n, r, i) {
|
|
6959
|
-
if (n - t <= i.pos - r.pos ||
|
|
6952
|
+
if (n - t <= i.pos - r.pos || ks(r, !0, !1) < i.pos) return !1;
|
|
6960
6953
|
let a = e.resolve(t);
|
|
6961
6954
|
if (!r.parent.isTextblock) {
|
|
6962
6955
|
let e = a.nodeAfter;
|
|
6963
6956
|
return e != null && n == t + e.nodeSize;
|
|
6964
6957
|
}
|
|
6965
6958
|
if (a.parentOffset < a.parent.content.size || !a.parent.isTextblock) return !1;
|
|
6966
|
-
let o = e.resolve(
|
|
6967
|
-
return !o.parent.isTextblock || o.pos > n ||
|
|
6959
|
+
let o = e.resolve(ks(a, !0, !0));
|
|
6960
|
+
return !o.parent.isTextblock || o.pos > n || ks(o, !0, !1) < n ? !1 : r.parent.content.cut(r.parentOffset).eq(o.parent.content);
|
|
6968
6961
|
}
|
|
6969
6962
|
function Os(e, t, n) {
|
|
6963
|
+
let r = 0, i = 0;
|
|
6964
|
+
return e.nodesBetween(t, n, (e, a) => {
|
|
6965
|
+
e.isTextblock && a >= t && a < n ? r++ : (e.isText ? /\S/.test(e.text.slice(Math.max(0, t - a), Math.min(e.nodeSize, n - a))) : e.isLeaf) && i++;
|
|
6966
|
+
}), i == 0 && r == 1;
|
|
6967
|
+
}
|
|
6968
|
+
function ks(e, t, n) {
|
|
6970
6969
|
let r = e.depth, i = t ? e.end() : e.pos;
|
|
6971
6970
|
for (; r > 0 && (t || e.indexAfter(r) == e.node(r).childCount);) r--, i++, t = !1;
|
|
6972
6971
|
if (n) {
|
|
@@ -6975,7 +6974,7 @@ function Os(e, t, n) {
|
|
|
6975
6974
|
}
|
|
6976
6975
|
return i;
|
|
6977
6976
|
}
|
|
6978
|
-
function
|
|
6977
|
+
function As(e, t, n, r, i) {
|
|
6979
6978
|
let a = e.findDiffStart(t, n), o = n + e.size, s = n + t.size;
|
|
6980
6979
|
if (a == null) return null;
|
|
6981
6980
|
let { a: c, b: l } = e.findDiffEnd(t, o, s);
|
|
@@ -6996,9 +6995,9 @@ function ks(e, t, n, r, i) {
|
|
|
6996
6995
|
endB: l
|
|
6997
6996
|
};
|
|
6998
6997
|
}
|
|
6999
|
-
var
|
|
6998
|
+
var js = class {
|
|
7000
6999
|
constructor(e, t) {
|
|
7001
|
-
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new io(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(
|
|
7000
|
+
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new io(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Rs), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Ps(this), Ns(this), this.nodeViews = Is(this), this.docView = Vi(this.state.doc, Ms(this), ls(this), this.dom, this), this.domObserver = new ps(this, (e, t, n, r) => ws(this, e, t, n, r)), this.domObserver.start(), ao(this), this.updatePluginViews();
|
|
7002
7001
|
}
|
|
7003
7002
|
get composing() {
|
|
7004
7003
|
return this.input.composing;
|
|
@@ -7015,7 +7014,7 @@ var As = class {
|
|
|
7015
7014
|
update(e) {
|
|
7016
7015
|
e.handleDOMEvents != this._props.handleDOMEvents && co(this);
|
|
7017
7016
|
let t = this._props;
|
|
7018
|
-
this._props = e, e.plugins && (e.plugins.forEach(
|
|
7017
|
+
this._props = e, e.plugins && (e.plugins.forEach(Rs), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
|
|
7019
7018
|
}
|
|
7020
7019
|
setProps(e) {
|
|
7021
7020
|
let t = {};
|
|
@@ -7032,16 +7031,16 @@ var As = class {
|
|
|
7032
7031
|
e.storedMarks && this.composing && (No(this), i = !0), this.state = e;
|
|
7033
7032
|
let a = n.plugins != e.plugins || this._props.plugins != t.plugins;
|
|
7034
7033
|
if (a || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
|
|
7035
|
-
let e =
|
|
7036
|
-
|
|
7034
|
+
let e = Is(this);
|
|
7035
|
+
Ls(e, this.nodeViews) && (this.nodeViews = e, r = !0);
|
|
7037
7036
|
}
|
|
7038
|
-
(a || t.handleDOMEvents != this._props.handleDOMEvents) && co(this), this.editable =
|
|
7039
|
-
let o = ls(this), s =
|
|
7037
|
+
(a || t.handleDOMEvents != this._props.handleDOMEvents) && co(this), this.editable = Ps(this), Ns(this);
|
|
7038
|
+
let o = ls(this), s = Ms(this), c = n.plugins != e.plugins && !n.doc.eq(e.doc) ? "reset" : e.scrollToSelection > n.scrollToSelection ? "to selection" : "preserve", l = r || !this.docView.matchesNode(e.doc, s, o);
|
|
7040
7039
|
(l || !e.selection.eq(n.selection)) && (i = !0);
|
|
7041
7040
|
let u = c == "preserve" && i && this.dom.style.overflowAnchor == null && oi(this);
|
|
7042
7041
|
if (i) {
|
|
7043
7042
|
this.domObserver.stop();
|
|
7044
|
-
let t = l && (F || L) && !this.composing && !n.selection.empty && !e.selection.empty &&
|
|
7043
|
+
let t = l && (F || L) && !this.composing && !n.selection.empty && !e.selection.empty && Fs(n.selection, e.selection);
|
|
7045
7044
|
if (l) {
|
|
7046
7045
|
let n = L ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
7047
7046
|
this.composing && (this.input.compositionNode = Po(this)), (r || !this.docView.update(e.doc, s, o, this)) && (this.docView.updateOuterDeco(s), this.docView.destroy(), this.docView = Vi(e.doc, s, o, this.dom, this)), n && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (t = !0);
|
|
@@ -7180,17 +7179,17 @@ var As = class {
|
|
|
7180
7179
|
return this.root.getSelection();
|
|
7181
7180
|
}
|
|
7182
7181
|
};
|
|
7183
|
-
|
|
7182
|
+
js.prototype.dispatch = function(e) {
|
|
7184
7183
|
let t = this._props.dispatchTransaction;
|
|
7185
7184
|
t ? t.call(this, e) : this.updateState(this.state.apply(e));
|
|
7186
7185
|
};
|
|
7187
|
-
function
|
|
7186
|
+
function Ms(e) {
|
|
7188
7187
|
let t = Object.create(null);
|
|
7189
7188
|
return t.class = "ProseMirror", t.contenteditable = String(e.editable), e.someProp("attributes", (n) => {
|
|
7190
7189
|
if (typeof n == "function" && (n = n(e.state)), n) for (let e in n) e == "class" ? t.class += " " + n[e] : e == "style" ? t.style = (t.style ? t.style + ";" : "") + n[e] : !t[e] && e != "contenteditable" && e != "nodeName" && (t[e] = String(n[e]));
|
|
7191
7190
|
}), t.translate ||= "no", [W.node(0, e.state.doc.content.size, t)];
|
|
7192
7191
|
}
|
|
7193
|
-
function
|
|
7192
|
+
function Ns(e) {
|
|
7194
7193
|
if (e.markCursor) {
|
|
7195
7194
|
let t = document.createElement("img");
|
|
7196
7195
|
t.className = "ProseMirror-separator", t.setAttribute("mark-placeholder", "true"), t.setAttribute("alt", ""), e.cursorWrapper = {
|
|
@@ -7202,21 +7201,21 @@ function Ms(e) {
|
|
|
7202
7201
|
};
|
|
7203
7202
|
} else e.cursorWrapper = null;
|
|
7204
7203
|
}
|
|
7205
|
-
function
|
|
7204
|
+
function Ps(e) {
|
|
7206
7205
|
return !e.someProp("editable", (t) => t(e.state) === !1);
|
|
7207
7206
|
}
|
|
7208
|
-
function
|
|
7207
|
+
function Fs(e, t) {
|
|
7209
7208
|
let n = Math.min(e.$anchor.sharedDepth(e.head), t.$anchor.sharedDepth(t.head));
|
|
7210
7209
|
return e.$anchor.start(n) != t.$anchor.start(n);
|
|
7211
7210
|
}
|
|
7212
|
-
function
|
|
7211
|
+
function Is(e) {
|
|
7213
7212
|
let t = Object.create(null);
|
|
7214
7213
|
function n(e) {
|
|
7215
7214
|
for (let n in e) Object.prototype.hasOwnProperty.call(t, n) || (t[n] = e[n]);
|
|
7216
7215
|
}
|
|
7217
7216
|
return e.someProp("nodeViews", n), e.someProp("markViews", n), t;
|
|
7218
7217
|
}
|
|
7219
|
-
function
|
|
7218
|
+
function Ls(e, t) {
|
|
7220
7219
|
let n = 0, r = 0;
|
|
7221
7220
|
for (let r in e) {
|
|
7222
7221
|
if (e[r] != t[r]) return !0;
|
|
@@ -7225,10 +7224,10 @@ function Is(e, t) {
|
|
|
7225
7224
|
for (let e in t) r++;
|
|
7226
7225
|
return n != r;
|
|
7227
7226
|
}
|
|
7228
|
-
function
|
|
7227
|
+
function Rs(e) {
|
|
7229
7228
|
if (e.spec.state || e.spec.filterTransaction || e.spec.appendTransaction) throw RangeError("Plugins passed directly to the view must not have a state component");
|
|
7230
7229
|
}
|
|
7231
|
-
for (var
|
|
7230
|
+
for (var zs = {
|
|
7232
7231
|
8: "Backspace",
|
|
7233
7232
|
9: "Tab",
|
|
7234
7233
|
10: "Enter",
|
|
@@ -7281,7 +7280,7 @@ for (var Rs = {
|
|
|
7281
7280
|
220: "\\",
|
|
7282
7281
|
221: "]",
|
|
7283
7282
|
222: "'"
|
|
7284
|
-
},
|
|
7283
|
+
}, Bs = {
|
|
7285
7284
|
48: ")",
|
|
7286
7285
|
49: "!",
|
|
7287
7286
|
50: "@",
|
|
@@ -7306,18 +7305,18 @@ for (var Rs = {
|
|
|
7306
7305
|
220: "|",
|
|
7307
7306
|
221: "}",
|
|
7308
7307
|
222: "\""
|
|
7309
|
-
},
|
|
7310
|
-
for (var q = 1; q <= 24; q++)
|
|
7311
|
-
for (var q = 65; q <= 90; q++)
|
|
7312
|
-
for (var
|
|
7313
|
-
function
|
|
7314
|
-
var t = !(
|
|
7308
|
+
}, Vs = typeof navigator < "u" && /Mac/.test(navigator.platform), Hs = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent), q = 0; q < 10; q++) zs[48 + q] = zs[96 + q] = String(q);
|
|
7309
|
+
for (var q = 1; q <= 24; q++) zs[q + 111] = "F" + q;
|
|
7310
|
+
for (var q = 65; q <= 90; q++) zs[q] = String.fromCharCode(q + 32), Bs[q] = String.fromCharCode(q);
|
|
7311
|
+
for (var Us in zs) Bs.hasOwnProperty(Us) || (Bs[Us] = zs[Us]);
|
|
7312
|
+
function Ws(e) {
|
|
7313
|
+
var t = !(Vs && e.metaKey && e.shiftKey && !e.ctrlKey && !e.altKey || Hs && e.shiftKey && e.key && e.key.length == 1 || e.key == "Unidentified") && e.key || (e.shiftKey ? Bs : zs)[e.keyCode] || e.key || "Unidentified";
|
|
7315
7314
|
return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
|
|
7316
7315
|
}
|
|
7317
7316
|
//#endregion
|
|
7318
7317
|
//#region ../../node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.js
|
|
7319
|
-
var
|
|
7320
|
-
function
|
|
7318
|
+
var Gs = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), Ks = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
7319
|
+
function qs(e) {
|
|
7321
7320
|
let t = e.split(/-(?!$)/), n = t[t.length - 1];
|
|
7322
7321
|
n == "Space" && (n = " ");
|
|
7323
7322
|
let r, i, a, o;
|
|
@@ -7327,34 +7326,34 @@ function Ks(e) {
|
|
|
7327
7326
|
else if (/^a(lt)?$/i.test(n)) r = !0;
|
|
7328
7327
|
else if (/^(c|ctrl|control)$/i.test(n)) i = !0;
|
|
7329
7328
|
else if (/^s(hift)?$/i.test(n)) a = !0;
|
|
7330
|
-
else if (/^mod$/i.test(n))
|
|
7329
|
+
else if (/^mod$/i.test(n)) Gs ? o = !0 : i = !0;
|
|
7331
7330
|
else throw Error("Unrecognized modifier name: " + n);
|
|
7332
7331
|
}
|
|
7333
7332
|
return r && (n = "Alt-" + n), i && (n = "Ctrl-" + n), o && (n = "Meta-" + n), a && (n = "Shift-" + n), n;
|
|
7334
7333
|
}
|
|
7335
|
-
function
|
|
7334
|
+
function Js(e) {
|
|
7336
7335
|
let t = Object.create(null);
|
|
7337
|
-
for (let n in e) t[
|
|
7336
|
+
for (let n in e) t[qs(n)] = e[n];
|
|
7338
7337
|
return t;
|
|
7339
7338
|
}
|
|
7340
|
-
function
|
|
7339
|
+
function Ys(e, t, n = !0) {
|
|
7341
7340
|
return t.altKey && (e = "Alt-" + e), t.ctrlKey && (e = "Ctrl-" + e), t.metaKey && (e = "Meta-" + e), n && t.shiftKey && (e = "Shift-" + e), e;
|
|
7342
7341
|
}
|
|
7343
|
-
function Ys(e) {
|
|
7344
|
-
return new A({ props: { handleKeyDown: Xs(e) } });
|
|
7345
|
-
}
|
|
7346
7342
|
function Xs(e) {
|
|
7347
|
-
|
|
7343
|
+
return new A({ props: { handleKeyDown: Zs(e) } });
|
|
7344
|
+
}
|
|
7345
|
+
function Zs(e) {
|
|
7346
|
+
let t = Js(e);
|
|
7348
7347
|
return function(e, n) {
|
|
7349
|
-
let r =
|
|
7348
|
+
let r = Ws(n), i, a = t[Ys(r, n)];
|
|
7350
7349
|
if (a && a(e.state, e.dispatch, e)) return !0;
|
|
7351
7350
|
if (r.length == 1 && r != " ") {
|
|
7352
7351
|
if (n.shiftKey) {
|
|
7353
|
-
let i = t[
|
|
7352
|
+
let i = t[Ys(r, n, !1)];
|
|
7354
7353
|
if (i && i(e.state, e.dispatch, e)) return !0;
|
|
7355
7354
|
}
|
|
7356
|
-
if ((n.altKey || n.metaKey || n.ctrlKey) && !(
|
|
7357
|
-
let r = t[
|
|
7355
|
+
if ((n.altKey || n.metaKey || n.ctrlKey) && !(Ks && n.ctrlKey && n.altKey) && (i = zs[n.keyCode]) && i != r) {
|
|
7356
|
+
let r = t[Ys(i, n)];
|
|
7358
7357
|
if (r && r(e.state, e.dispatch, e)) return !0;
|
|
7359
7358
|
}
|
|
7360
7359
|
}
|
|
@@ -7363,7 +7362,7 @@ function Xs(e) {
|
|
|
7363
7362
|
}
|
|
7364
7363
|
//#endregion
|
|
7365
7364
|
//#region ../../node_modules/.pnpm/@tiptap+core@3.31.3_@tiptap+pm@3.31.3/node_modules/@tiptap/core/dist/index.js
|
|
7366
|
-
function
|
|
7365
|
+
function Qs(e) {
|
|
7367
7366
|
let { state: t, transaction: n } = e, { selection: r } = n, { doc: i } = n, { storedMarks: a } = n;
|
|
7368
7367
|
return {
|
|
7369
7368
|
...t,
|
|
@@ -7387,7 +7386,7 @@ function Zs(e) {
|
|
|
7387
7386
|
}
|
|
7388
7387
|
};
|
|
7389
7388
|
}
|
|
7390
|
-
var
|
|
7389
|
+
var $s = class e {
|
|
7391
7390
|
constructor(e) {
|
|
7392
7391
|
this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
|
|
7393
7392
|
}
|
|
@@ -7447,7 +7446,7 @@ var Qs = class e {
|
|
|
7447
7446
|
tr: e,
|
|
7448
7447
|
editor: r,
|
|
7449
7448
|
view: a,
|
|
7450
|
-
state:
|
|
7449
|
+
state: Qs({
|
|
7451
7450
|
state: i,
|
|
7452
7451
|
transaction: e
|
|
7453
7452
|
}),
|
|
@@ -7460,12 +7459,12 @@ var Qs = class e {
|
|
|
7460
7459
|
};
|
|
7461
7460
|
return o;
|
|
7462
7461
|
}
|
|
7463
|
-
},
|
|
7462
|
+
}, ec = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
|
|
7464
7463
|
if (!e.isDestroyed) {
|
|
7465
7464
|
var n;
|
|
7466
7465
|
t.dom.blur(), (n = window) == null || (n = n.getSelection()) == null || n.removeAllRanges();
|
|
7467
7466
|
}
|
|
7468
|
-
}), !0),
|
|
7467
|
+
}), !0), tc = (e = !0) => ({ commands: t }) => t.setContent("", { emitUpdate: e }), nc = () => ({ state: e, tr: t, dispatch: n }) => {
|
|
7469
7468
|
let { selection: r } = t, { ranges: i } = r;
|
|
7470
7469
|
return n && i.forEach(({ $from: n, $to: r }) => {
|
|
7471
7470
|
e.doc.nodesBetween(n.pos, r.pos, (e, n) => {
|
|
@@ -7480,12 +7479,12 @@ var Qs = class e {
|
|
|
7480
7479
|
(c || c === 0) && t.lift(s, c);
|
|
7481
7480
|
});
|
|
7482
7481
|
}), !0;
|
|
7483
|
-
},
|
|
7482
|
+
}, rc = (e) => (t) => e(t), ic = () => ({ state: e, dispatch: t }) => rr(e, t), ac = (e, t) => ({ editor: n, tr: r }) => {
|
|
7484
7483
|
let { state: i } = n, a = i.doc.slice(e.from, e.to);
|
|
7485
7484
|
r.deleteRange(e.from, e.to);
|
|
7486
7485
|
let o = r.mapping.map(t);
|
|
7487
7486
|
return r.insert(o, a.content), r.setSelection(new D(r.doc.resolve(Math.max(o - 1, 0)))), !0;
|
|
7488
|
-
},
|
|
7487
|
+
}, oc = () => ({ tr: e, dispatch: t }) => {
|
|
7489
7488
|
let { selection: n } = e, r = n.$anchor.node();
|
|
7490
7489
|
if (r.content.size > 0) return !1;
|
|
7491
7490
|
let i = e.selection.$anchor;
|
|
@@ -7505,7 +7504,7 @@ function J(e, t) {
|
|
|
7505
7504
|
}
|
|
7506
7505
|
return e;
|
|
7507
7506
|
}
|
|
7508
|
-
var
|
|
7507
|
+
var sc = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
7509
7508
|
let i = J(e, n.schema), a = t.selection.$anchor;
|
|
7510
7509
|
for (let e = a.depth; e > 0; --e) if (a.node(e).type === i) {
|
|
7511
7510
|
if (r) {
|
|
@@ -7515,41 +7514,41 @@ var oc = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
|
7515
7514
|
return !0;
|
|
7516
7515
|
}
|
|
7517
7516
|
return !1;
|
|
7518
|
-
},
|
|
7517
|
+
}, cc = (e) => ({ tr: t, dispatch: n }) => {
|
|
7519
7518
|
let { from: r, to: i } = e;
|
|
7520
7519
|
return n && t.delete(r, i), !0;
|
|
7521
|
-
},
|
|
7520
|
+
}, lc = (e) => e.content ? /^text(\*|\+)/.test(e.content) : !1, uc = (e, t, n) => {
|
|
7522
7521
|
if (!e.parent.isInline || n === "left" && e.pos > e.start() || n === "right" && e.pos < e.end()) return e.pos;
|
|
7523
7522
|
let r = t.nodes[e.parent.type.name].spec;
|
|
7524
|
-
return
|
|
7525
|
-
},
|
|
7526
|
-
from:
|
|
7527
|
-
to:
|
|
7528
|
-
}),
|
|
7523
|
+
return lc(r) ? n === "left" ? e.start() - 1 : e.end() + 1 : e.pos;
|
|
7524
|
+
}, dc = (e, t, n) => ({
|
|
7525
|
+
from: uc(e, n, "left"),
|
|
7526
|
+
to: uc(t, n, "right")
|
|
7527
|
+
}), fc = () => ({ state: e, dispatch: t }) => {
|
|
7529
7528
|
if (e.selection.empty) return !1;
|
|
7530
7529
|
if (t) {
|
|
7531
7530
|
let n = e.tr, { ranges: r } = e.selection, i = n.steps.length;
|
|
7532
7531
|
r.forEach((t) => {
|
|
7533
|
-
let r = n.mapping.slice(i), { from: a, to: o } =
|
|
7532
|
+
let r = n.mapping.slice(i), { from: a, to: o } = dc(n.doc.resolve(r.map(t.$from.pos)), n.doc.resolve(r.map(t.$to.pos)), e.schema);
|
|
7534
7533
|
n.deleteRange(a, o);
|
|
7535
7534
|
}), n.selection.empty || n.setSelection(D.near(n.doc.resolve(n.selection.from))), n.scrollIntoView(), t(n);
|
|
7536
7535
|
}
|
|
7537
7536
|
return !0;
|
|
7538
|
-
},
|
|
7539
|
-
function
|
|
7537
|
+
}, pc = () => ({ commands: e }) => e.keyboardShortcut("Enter"), mc = () => ({ state: e, dispatch: t }) => nr(e, t);
|
|
7538
|
+
function hc(e) {
|
|
7540
7539
|
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
7541
7540
|
}
|
|
7542
|
-
function
|
|
7541
|
+
function gc(e, t, n = { strict: !0 }) {
|
|
7543
7542
|
let r = Object.keys(t);
|
|
7544
|
-
return !r.length || r.every((r) => n.strict ? t[r] === e[r] :
|
|
7545
|
-
}
|
|
7546
|
-
function gc(e, t, n = {}) {
|
|
7547
|
-
return e.find((e) => e.type === t && hc(Object.fromEntries(Object.keys(n).map((t) => [t, e.attrs[t]])), n));
|
|
7543
|
+
return !r.length || r.every((r) => n.strict ? t[r] === e[r] : hc(t[r]) ? t[r].test(e[r]) : t[r] === e[r]);
|
|
7548
7544
|
}
|
|
7549
7545
|
function _c(e, t, n = {}) {
|
|
7550
|
-
return
|
|
7546
|
+
return e.find((e) => e.type === t && gc(Object.fromEntries(Object.keys(n).map((t) => [t, e.attrs[t]])), n));
|
|
7547
|
+
}
|
|
7548
|
+
function vc(e, t, n = {}) {
|
|
7549
|
+
return !!_c(e, t, n);
|
|
7551
7550
|
}
|
|
7552
|
-
function
|
|
7551
|
+
function yc(e, t, n) {
|
|
7553
7552
|
if (!e || !t) return;
|
|
7554
7553
|
let r = e.parent.childAfter(e.parentOffset);
|
|
7555
7554
|
if ((!r.node || !r.node.marks.some((e) => e.type === t)) && (r = e.parent.childBefore(e.parentOffset)), !r.node || !r.node.marks.some((e) => e.type === t)) return;
|
|
@@ -7557,10 +7556,10 @@ function vc(e, t, n) {
|
|
|
7557
7556
|
let e = r.node.marks.find((e) => e.type === t);
|
|
7558
7557
|
e && (n = e.attrs);
|
|
7559
7558
|
}
|
|
7560
|
-
if (!
|
|
7559
|
+
if (!_c([...r.node.marks], t, n)) return;
|
|
7561
7560
|
let i = r.index, a = e.start() + r.offset, o = i + 1, s = a + r.node.nodeSize;
|
|
7562
|
-
for (; i > 0 &&
|
|
7563
|
-
for (; o < e.parent.childCount &&
|
|
7561
|
+
for (; i > 0 && vc([...e.parent.child(i - 1).marks], t, n);) --i, a -= e.parent.child(i).nodeSize;
|
|
7562
|
+
for (; o < e.parent.childCount && vc([...e.parent.child(o).marks], t, n);) s += e.parent.child(o).nodeSize, o += 1;
|
|
7564
7563
|
return {
|
|
7565
7564
|
from: a,
|
|
7566
7565
|
to: s
|
|
@@ -7573,28 +7572,28 @@ function Y(e, t) {
|
|
|
7573
7572
|
}
|
|
7574
7573
|
return e;
|
|
7575
7574
|
}
|
|
7576
|
-
var
|
|
7575
|
+
var bc = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
7577
7576
|
let a = Y(e, r.schema), { doc: o, selection: s } = n, { $from: c, from: l, to: u } = s;
|
|
7578
7577
|
if (i) {
|
|
7579
|
-
let e =
|
|
7578
|
+
let e = yc(c, a, t);
|
|
7580
7579
|
if (e && e.from <= l && e.to >= u) {
|
|
7581
7580
|
let t = D.create(o, e.from, e.to);
|
|
7582
7581
|
n.setSelection(t);
|
|
7583
7582
|
}
|
|
7584
7583
|
}
|
|
7585
7584
|
return !0;
|
|
7586
|
-
},
|
|
7585
|
+
}, xc = (e) => (t) => {
|
|
7587
7586
|
let n = typeof e == "function" ? e(t) : e;
|
|
7588
7587
|
for (let e = 0; e < n.length; e += 1) if (n[e](t)) return !0;
|
|
7589
7588
|
return !1;
|
|
7590
7589
|
};
|
|
7591
|
-
function
|
|
7590
|
+
function Sc(e) {
|
|
7592
7591
|
return e instanceof D;
|
|
7593
7592
|
}
|
|
7594
7593
|
function X(e = 0, t = 0, n = 0) {
|
|
7595
7594
|
return Math.min(Math.max(e, t), n);
|
|
7596
7595
|
}
|
|
7597
|
-
function
|
|
7596
|
+
function Cc(e, t = null) {
|
|
7598
7597
|
if (!t) return null;
|
|
7599
7598
|
let n = E.atStart(e), r = E.atEnd(e);
|
|
7600
7599
|
if (t === "start" || t === !0) return n;
|
|
@@ -7602,10 +7601,10 @@ function Sc(e, t = null) {
|
|
|
7602
7601
|
let i = n.from, a = r.to;
|
|
7603
7602
|
return t === "all" ? D.create(e, X(0, i, a), X(e.content.size, i, a)) : D.create(e, X(t, i, a), X(t, i, a));
|
|
7604
7603
|
}
|
|
7605
|
-
function
|
|
7604
|
+
function wc() {
|
|
7606
7605
|
return ["Android"].includes(navigator.platform) || /android/i.test(navigator.userAgent);
|
|
7607
7606
|
}
|
|
7608
|
-
function
|
|
7607
|
+
function Tc() {
|
|
7609
7608
|
return [
|
|
7610
7609
|
"iPad Simulator",
|
|
7611
7610
|
"iPhone Simulator",
|
|
@@ -7615,16 +7614,16 @@ function wc() {
|
|
|
7615
7614
|
"iPod"
|
|
7616
7615
|
].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
7617
7616
|
}
|
|
7618
|
-
function
|
|
7617
|
+
function Ec() {
|
|
7619
7618
|
return typeof navigator < "u" && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
7620
7619
|
}
|
|
7621
|
-
var
|
|
7620
|
+
var Dc = (e = null, t = {}) => ({ editor: n, view: r, tr: i, dispatch: a }) => {
|
|
7622
7621
|
t = {
|
|
7623
7622
|
scrollIntoView: !0,
|
|
7624
7623
|
...t
|
|
7625
7624
|
};
|
|
7626
7625
|
let o = () => {
|
|
7627
|
-
(
|
|
7626
|
+
(Tc() || wc()) && r.dom.focus(), Ec() && !Tc() && !wc() && r.dom.focus({ preventScroll: !0 }), requestAnimationFrame(() => {
|
|
7628
7627
|
n.isDestroyed || (r.focus(), t?.scrollIntoView && n.commands.scrollIntoView());
|
|
7629
7628
|
});
|
|
7630
7629
|
};
|
|
@@ -7633,33 +7632,33 @@ var Ec = (e = null, t = {}) => ({ editor: n, view: r, tr: i, dispatch: a }) => {
|
|
|
7633
7632
|
} catch {
|
|
7634
7633
|
return !1;
|
|
7635
7634
|
}
|
|
7636
|
-
if (a && e === null && !
|
|
7637
|
-
let s =
|
|
7635
|
+
if (a && e === null && !Sc(n.state.selection)) return o(), !0;
|
|
7636
|
+
let s = Cc(i.doc, e) || n.state.selection, c = n.state.selection.eq(s);
|
|
7638
7637
|
return a && (c || i.setSelection(s), c && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
|
|
7639
|
-
},
|
|
7638
|
+
}, Oc = (e, t) => (n) => e.every((e, r) => t(e, {
|
|
7640
7639
|
...n,
|
|
7641
7640
|
index: r
|
|
7642
|
-
})),
|
|
7641
|
+
})), kc = (e, t) => ({ tr: n, commands: r }) => r.insertContentAt({
|
|
7643
7642
|
from: n.selection.from,
|
|
7644
7643
|
to: n.selection.to
|
|
7645
|
-
}, e, t),
|
|
7644
|
+
}, e, t), Ac = (e) => {
|
|
7646
7645
|
let t = e.childNodes;
|
|
7647
7646
|
for (let n = t.length - 1; n >= 0; --n) {
|
|
7648
7647
|
let r = t[n];
|
|
7649
|
-
r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 &&
|
|
7648
|
+
r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 && Ac(r);
|
|
7650
7649
|
}
|
|
7651
7650
|
return e;
|
|
7652
7651
|
};
|
|
7653
|
-
function
|
|
7652
|
+
function jc(e) {
|
|
7654
7653
|
if (typeof window > "u") throw Error("[tiptap error]: there is no window object available, so this function cannot be used");
|
|
7655
7654
|
let t = `<body>${e}</body>`, n = new window.DOMParser().parseFromString(t, "text/html").body;
|
|
7656
|
-
return
|
|
7655
|
+
return Ac(n);
|
|
7657
7656
|
}
|
|
7658
|
-
function
|
|
7657
|
+
function Mc(e) {
|
|
7659
7658
|
return typeof e?.nodesBetween == "function";
|
|
7660
7659
|
}
|
|
7661
|
-
function
|
|
7662
|
-
if (
|
|
7660
|
+
function Nc(e, t, n) {
|
|
7661
|
+
if (Mc(e)) return e;
|
|
7663
7662
|
let r = typeof e == "object" && !!e;
|
|
7664
7663
|
n = {
|
|
7665
7664
|
slice: !0,
|
|
@@ -7673,7 +7672,7 @@ function Mc(e, t, n) {
|
|
|
7673
7672
|
return n.errorOnInvalidContent && r.check(), r;
|
|
7674
7673
|
} catch (r) {
|
|
7675
7674
|
if (n.errorOnInvalidContent) throw Error("[tiptap error]: Invalid JSON content", { cause: r });
|
|
7676
|
-
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:", r),
|
|
7675
|
+
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:", r), Nc("", t, n);
|
|
7677
7676
|
}
|
|
7678
7677
|
if (i) {
|
|
7679
7678
|
if (n.errorOnInvalidContent) {
|
|
@@ -7689,17 +7688,17 @@ function Mc(e, t, n) {
|
|
|
7689
7688
|
}]
|
|
7690
7689
|
} })
|
|
7691
7690
|
});
|
|
7692
|
-
if (n.slice ? ze.fromSchema(a).parseSlice(
|
|
7691
|
+
if (n.slice ? ze.fromSchema(a).parseSlice(jc(e), n.parseOptions) : ze.fromSchema(a).parse(jc(e), n.parseOptions), n.errorOnInvalidContent && r) throw Error("[tiptap error]: Invalid HTML content", { cause: /* @__PURE__ */ Error(`Invalid element found: ${i}`) });
|
|
7693
7692
|
}
|
|
7694
7693
|
let r = ze.fromSchema(t);
|
|
7695
|
-
return n.slice ? r.parseSlice(
|
|
7694
|
+
return n.slice ? r.parseSlice(jc(e), n.parseOptions).content : r.parse(jc(e), n.parseOptions);
|
|
7696
7695
|
}
|
|
7697
|
-
return
|
|
7696
|
+
return Nc("", t, n);
|
|
7698
7697
|
}
|
|
7699
|
-
function
|
|
7698
|
+
function Pc(e) {
|
|
7700
7699
|
return !("type" in e);
|
|
7701
7700
|
}
|
|
7702
|
-
function
|
|
7701
|
+
function Fc(e, t, n) {
|
|
7703
7702
|
let r = e.steps.length - 1;
|
|
7704
7703
|
if (r < t) return;
|
|
7705
7704
|
let i = e.steps[r];
|
|
@@ -7709,7 +7708,7 @@ function Pc(e, t, n) {
|
|
|
7709
7708
|
o === 0 && (o = r);
|
|
7710
7709
|
}), e.setSelection(E.near(e.doc.resolve(o), n));
|
|
7711
7710
|
}
|
|
7712
|
-
var
|
|
7711
|
+
var Ic = (e, t, n) => ({ tr: r, dispatch: i, editor: a }) => {
|
|
7713
7712
|
if (i) {
|
|
7714
7713
|
n = {
|
|
7715
7714
|
parseOptions: a.options.parseOptions,
|
|
@@ -7731,7 +7730,7 @@ var Fc = (e, t, n) => ({ tr: r, dispatch: i, editor: a }) => {
|
|
|
7731
7730
|
...n.parseOptions
|
|
7732
7731
|
};
|
|
7733
7732
|
if (!n.errorOnInvalidContent && !a.options.enableContentCheck && a.options.emitContentError) try {
|
|
7734
|
-
|
|
7733
|
+
Nc(t, a.schema, {
|
|
7735
7734
|
parseOptions: c,
|
|
7736
7735
|
errorOnInvalidContent: !0
|
|
7737
7736
|
});
|
|
@@ -7739,7 +7738,7 @@ var Fc = (e, t, n) => ({ tr: r, dispatch: i, editor: a }) => {
|
|
|
7739
7738
|
o(e);
|
|
7740
7739
|
}
|
|
7741
7740
|
try {
|
|
7742
|
-
i =
|
|
7741
|
+
i = Nc(t, a.schema, {
|
|
7743
7742
|
parseOptions: c,
|
|
7744
7743
|
errorOnInvalidContent: n.errorOnInvalidContent ?? a.options.enableContentCheck
|
|
7745
7744
|
});
|
|
@@ -7752,7 +7751,7 @@ var Fc = (e, t, n) => ({ tr: r, dispatch: i, editor: a }) => {
|
|
|
7752
7751
|
} : {
|
|
7753
7752
|
from: e.from,
|
|
7754
7753
|
to: e.to
|
|
7755
|
-
}, d = !0, f = !0, p =
|
|
7754
|
+
}, d = !0, f = !0, p = Pc(i) ? i.content : [i];
|
|
7756
7755
|
if (p.forEach((e) => {
|
|
7757
7756
|
e.check(), d = d ? e.isText && e.marks.length === 0 : !1, f = f ? e.isBlock : !1;
|
|
7758
7757
|
}), l === u && f) {
|
|
@@ -7760,13 +7759,13 @@ var Fc = (e, t, n) => ({ tr: r, dispatch: i, editor: a }) => {
|
|
|
7760
7759
|
e.isTextblock && !e.type.spec.code && !e.childCount && (--l, u += 1);
|
|
7761
7760
|
}
|
|
7762
7761
|
let m;
|
|
7763
|
-
if (d) m = Array.isArray(t) ? t.map((e) => e.text || "").join("") :
|
|
7762
|
+
if (d) m = Array.isArray(t) ? t.map((e) => e.text || "").join("") : Mc(t) ? p.map((e) => e.text ?? "").join("") : typeof t == "object" && t && t.text ? t.text : t, r.insertText(m, l, u);
|
|
7764
7763
|
else {
|
|
7765
7764
|
m = s.from(p);
|
|
7766
7765
|
let e = r.doc.resolve(l), t = e.node(), n = e.parentOffset === 0, i = t.isText || t.isTextblock, a = t.content.size > 0;
|
|
7767
7766
|
n && i && a && f && (l = Math.max(0, l - 1)), r.replaceWith(l, u, p);
|
|
7768
7767
|
}
|
|
7769
|
-
n.updateSelection &&
|
|
7768
|
+
n.updateSelection && Fc(r, r.steps.length - 1, -1), n.applyInputRules && r.setMeta("applyInputRules", {
|
|
7770
7769
|
from: l,
|
|
7771
7770
|
text: m
|
|
7772
7771
|
}), n.applyPasteRules && r.setMeta("applyPasteRules", {
|
|
@@ -7776,43 +7775,43 @@ var Fc = (e, t, n) => ({ tr: r, dispatch: i, editor: a }) => {
|
|
|
7776
7775
|
}
|
|
7777
7776
|
return !0;
|
|
7778
7777
|
};
|
|
7779
|
-
function
|
|
7778
|
+
function Lc(e) {
|
|
7780
7779
|
for (let t = 0; t < e.edgeCount; t += 1) {
|
|
7781
7780
|
let { type: n } = e.edge(t);
|
|
7782
7781
|
if (n.isTextblock && !n.hasRequiredAttrs()) return n;
|
|
7783
7782
|
}
|
|
7784
7783
|
return null;
|
|
7785
7784
|
}
|
|
7786
|
-
var
|
|
7785
|
+
var Rc = (e = {}) => ({ tr: t, dispatch: n, editor: r }) => {
|
|
7787
7786
|
let { pos: i, attrs: a, content: o, updateSelection: s = !0 } = e, c;
|
|
7788
7787
|
c = typeof i == "number" ? t.doc.resolve(i) : i || t.selection.$from;
|
|
7789
|
-
let l =
|
|
7788
|
+
let l = Lc(c.parent.contentMatchAt(c.index()));
|
|
7790
7789
|
if (!l) return !1;
|
|
7791
7790
|
let u = Object.keys(l.spec.attrs || {}), d = a ? Object.fromEntries(Object.entries(a).filter(([e]) => u.includes(e))) : {}, f;
|
|
7792
7791
|
if (o) {
|
|
7793
|
-
let e =
|
|
7792
|
+
let e = Nc(o, r.schema);
|
|
7794
7793
|
f = l.createAndFill(d, e);
|
|
7795
7794
|
} else f = l.createAndFill(d);
|
|
7796
|
-
return f ? (n && (t.insert(c.pos, f), s &&
|
|
7797
|
-
},
|
|
7795
|
+
return f ? (n && (t.insert(c.pos, f), s && Fc(t, t.steps.length - 1, -1)), !0) : !1;
|
|
7796
|
+
}, zc = () => ({ state: e, dispatch: t }) => Zn(e, t), Bc = () => ({ state: e, dispatch: t }) => Qn(e, t), Vc = () => ({ state: e, dispatch: t }) => Bn(e, t), Hc = () => ({ state: e, dispatch: t }) => Jn(e, t), Uc = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
7798
7797
|
try {
|
|
7799
7798
|
let r = Kt(e.doc, e.selection.$from.pos, -1);
|
|
7800
7799
|
return r != null && (n.join(r, 2), t && t(n), !0);
|
|
7801
7800
|
} catch {
|
|
7802
7801
|
return !1;
|
|
7803
7802
|
}
|
|
7804
|
-
},
|
|
7803
|
+
}, Wc = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
7805
7804
|
try {
|
|
7806
7805
|
let r = Kt(e.doc, e.selection.$from.pos, 1);
|
|
7807
7806
|
return r != null && (n.join(r, 2), t && t(n), !0);
|
|
7808
7807
|
} catch {
|
|
7809
7808
|
return !1;
|
|
7810
7809
|
}
|
|
7811
|
-
},
|
|
7812
|
-
function
|
|
7810
|
+
}, Gc = () => ({ state: e, dispatch: t }) => Vn(e, t), Kc = () => ({ state: e, dispatch: t }) => Hn(e, t);
|
|
7811
|
+
function qc() {
|
|
7813
7812
|
return typeof navigator < "u" && /Mac/.test(navigator.platform);
|
|
7814
7813
|
}
|
|
7815
|
-
function
|
|
7814
|
+
function Jc(e) {
|
|
7816
7815
|
let t = e.split(/-(?!$)/), n = t[t.length - 1];
|
|
7817
7816
|
n === "Space" && (n = " ");
|
|
7818
7817
|
let r, i, a, o;
|
|
@@ -7822,13 +7821,13 @@ function qc(e) {
|
|
|
7822
7821
|
else if (/^a(lt)?$/i.test(n)) r = !0;
|
|
7823
7822
|
else if (/^(c|ctrl|control)$/i.test(n)) i = !0;
|
|
7824
7823
|
else if (/^s(hift)?$/i.test(n)) a = !0;
|
|
7825
|
-
else if (/^mod$/i.test(n))
|
|
7824
|
+
else if (/^mod$/i.test(n)) Tc() || qc() ? o = !0 : i = !0;
|
|
7826
7825
|
else throw Error(`Unrecognized modifier name: ${n}`);
|
|
7827
7826
|
}
|
|
7828
7827
|
return r && (n = `Alt-${n}`), i && (n = `Ctrl-${n}`), o && (n = `Meta-${n}`), a && (n = `Shift-${n}`), n;
|
|
7829
7828
|
}
|
|
7830
|
-
var
|
|
7831
|
-
let a =
|
|
7829
|
+
var Yc = (e) => ({ editor: t, view: n, tr: r, dispatch: i }) => {
|
|
7830
|
+
let a = Jc(e).split(/-(?!$)/), o = a.find((e) => ![
|
|
7832
7831
|
"Alt",
|
|
7833
7832
|
"Ctrl",
|
|
7834
7833
|
"Meta",
|
|
@@ -7849,7 +7848,7 @@ var Jc = (e) => ({ editor: t, view: n, tr: r, dispatch: i }) => {
|
|
|
7849
7848
|
t && i && r.maybeStep(t);
|
|
7850
7849
|
}), !0;
|
|
7851
7850
|
};
|
|
7852
|
-
function
|
|
7851
|
+
function Xc(e, t, n = {}) {
|
|
7853
7852
|
let { from: r, to: i, empty: a } = e.selection, o = t ? J(t, e.schema) : null, s = [];
|
|
7854
7853
|
e.doc.nodesBetween(r, i, (e, t) => {
|
|
7855
7854
|
if (e.isText) return;
|
|
@@ -7860,49 +7859,49 @@ function Yc(e, t, n = {}) {
|
|
|
7860
7859
|
to: a
|
|
7861
7860
|
});
|
|
7862
7861
|
});
|
|
7863
|
-
let c = i - r, l = s.filter((e) => !o || o.name === e.node.type.name).filter((e) =>
|
|
7862
|
+
let c = i - r, l = s.filter((e) => !o || o.name === e.node.type.name).filter((e) => gc(e.node.attrs, n, { strict: !1 }));
|
|
7864
7863
|
return a ? !!l.length : l.reduce((e, t) => e + t.to - t.from, 0) >= c;
|
|
7865
7864
|
}
|
|
7866
|
-
var
|
|
7867
|
-
function
|
|
7865
|
+
var Zc = (e, t = {}) => ({ state: n, dispatch: r }) => Xc(n, J(e, n.schema), t) ? $n(n, r) : !1, Qc = () => ({ state: e, dispatch: t }) => ir(e, t), $c = (e) => ({ state: t, dispatch: n }) => wr(J(e, t.schema))(t, n), el = () => ({ state: e, dispatch: t }) => er(e, t);
|
|
7866
|
+
function tl(e, t) {
|
|
7868
7867
|
return t.nodes[e] ? "node" : t.marks[e] ? "mark" : null;
|
|
7869
7868
|
}
|
|
7870
|
-
function
|
|
7869
|
+
function nl(e, t) {
|
|
7871
7870
|
let n = typeof t == "string" ? [t] : t;
|
|
7872
7871
|
return Object.keys(e).reduce((t, r) => (n.includes(r) || (t[r] = e[r]), t), {});
|
|
7873
7872
|
}
|
|
7874
|
-
var
|
|
7875
|
-
let a = null, o = null, s =
|
|
7873
|
+
var rl = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
7874
|
+
let a = null, o = null, s = tl(typeof e == "string" ? e : e.name, r.schema);
|
|
7876
7875
|
if (!s) return !1;
|
|
7877
7876
|
s === "node" && (a = J(e, r.schema)), s === "mark" && (o = Y(e, r.schema));
|
|
7878
7877
|
let c = !1;
|
|
7879
7878
|
return n.selection.ranges.forEach((e) => {
|
|
7880
7879
|
r.doc.nodesBetween(e.$from.pos, e.$to.pos, (e, r) => {
|
|
7881
|
-
a && a === e.type && (c = !0, i && n.setNodeMarkup(r, void 0,
|
|
7882
|
-
o === a.type && (c = !0, i && n.addMark(r, r + e.nodeSize, o.create(
|
|
7880
|
+
a && a === e.type && (c = !0, i && n.setNodeMarkup(r, void 0, nl(e.attrs, t))), o && e.marks.length && e.marks.forEach((a) => {
|
|
7881
|
+
o === a.type && (c = !0, i && n.addMark(r, r + e.nodeSize, o.create(nl(a.attrs, t))));
|
|
7883
7882
|
});
|
|
7884
7883
|
});
|
|
7885
7884
|
}), c;
|
|
7886
|
-
},
|
|
7885
|
+
}, il = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), al = () => ({ tr: e, dispatch: t }) => {
|
|
7887
7886
|
if (t) {
|
|
7888
7887
|
let t = new k(e.doc);
|
|
7889
7888
|
e.setSelection(t);
|
|
7890
7889
|
}
|
|
7891
7890
|
return !0;
|
|
7892
|
-
},
|
|
7893
|
-
function
|
|
7894
|
-
return
|
|
7891
|
+
}, ol = () => ({ state: e, dispatch: t }) => Gn(e, t), sl = () => ({ state: e, dispatch: t }) => Yn(e, t), cl = () => ({ state: e, dispatch: t }) => sr(e, t), ll = () => ({ state: e, dispatch: t }) => pr(e, t), ul = () => ({ state: e, dispatch: t }) => fr(e, t);
|
|
7892
|
+
function dl(e, t, n = {}, r = {}) {
|
|
7893
|
+
return Nc(e, t, {
|
|
7895
7894
|
slice: !1,
|
|
7896
7895
|
parseOptions: n,
|
|
7897
7896
|
errorOnInvalidContent: r.errorOnInvalidContent
|
|
7898
7897
|
});
|
|
7899
7898
|
}
|
|
7900
|
-
var
|
|
7899
|
+
var fl = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {} } = {}) => ({ editor: i, tr: a, dispatch: o, commands: s }) => {
|
|
7901
7900
|
let { doc: c } = a;
|
|
7902
7901
|
if (r.preserveWhitespace !== "full") {
|
|
7903
|
-
let s =
|
|
7902
|
+
let s = dl(e, i.schema, r, { errorOnInvalidContent: t ?? i.options.enableContentCheck });
|
|
7904
7903
|
if (o) {
|
|
7905
|
-
let e =
|
|
7904
|
+
let e = Pc(s) ? s.content : [s];
|
|
7906
7905
|
a.replaceWith(0, c.content.size, e).setMeta("preventUpdate", !n);
|
|
7907
7906
|
}
|
|
7908
7907
|
return !0;
|
|
@@ -7915,7 +7914,7 @@ var dl = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {
|
|
|
7915
7914
|
errorOnInvalidContent: t ?? i.options.enableContentCheck
|
|
7916
7915
|
});
|
|
7917
7916
|
};
|
|
7918
|
-
function
|
|
7917
|
+
function pl(e, t) {
|
|
7919
7918
|
let n = Y(t, e.schema), { from: r, to: i, empty: a } = e.selection, o = [];
|
|
7920
7919
|
a ? (e.storedMarks && o.push(...e.storedMarks), o.push(...e.selection.$head.marks())) : e.doc.nodesBetween(r, i, (e) => {
|
|
7921
7920
|
o.push(...e.marks);
|
|
@@ -7923,7 +7922,7 @@ function fl(e, t) {
|
|
|
7923
7922
|
let s = o.find((e) => e.type.name === n.name);
|
|
7924
7923
|
return s ? { ...s.attrs } : {};
|
|
7925
7924
|
}
|
|
7926
|
-
function
|
|
7925
|
+
function ml(e, t) {
|
|
7927
7926
|
let n = new gn(e);
|
|
7928
7927
|
return t.forEach((e) => {
|
|
7929
7928
|
e.steps.forEach((e) => {
|
|
@@ -7931,7 +7930,7 @@ function pl(e, t) {
|
|
|
7931
7930
|
});
|
|
7932
7931
|
}), n;
|
|
7933
7932
|
}
|
|
7934
|
-
function
|
|
7933
|
+
function hl(e, t) {
|
|
7935
7934
|
let n = [];
|
|
7936
7935
|
return e.descendants((e, r) => {
|
|
7937
7936
|
t(e) && n.push({
|
|
@@ -7940,7 +7939,7 @@ function ml(e, t) {
|
|
|
7940
7939
|
});
|
|
7941
7940
|
}), n;
|
|
7942
7941
|
}
|
|
7943
|
-
function
|
|
7942
|
+
function gl(e, t, n) {
|
|
7944
7943
|
let r = [];
|
|
7945
7944
|
return e.nodesBetween(t.from, t.to, (e, t) => {
|
|
7946
7945
|
n(e) && r.push({
|
|
@@ -7949,7 +7948,7 @@ function hl(e, t, n) {
|
|
|
7949
7948
|
});
|
|
7950
7949
|
}), r;
|
|
7951
7950
|
}
|
|
7952
|
-
function
|
|
7951
|
+
function _l(e, t) {
|
|
7953
7952
|
for (let n = e.depth; n > 0; --n) {
|
|
7954
7953
|
let r = e.node(n);
|
|
7955
7954
|
if (t(r)) return {
|
|
@@ -7960,8 +7959,8 @@ function gl(e, t) {
|
|
|
7960
7959
|
};
|
|
7961
7960
|
}
|
|
7962
7961
|
}
|
|
7963
|
-
function
|
|
7964
|
-
return (t) =>
|
|
7962
|
+
function vl(e) {
|
|
7963
|
+
return (t) => _l(t.$from, e);
|
|
7965
7964
|
}
|
|
7966
7965
|
function Z(e, t, n) {
|
|
7967
7966
|
return e.config[t] === void 0 && e.parent ? Z(e.parent, t, n) : typeof e.config[t] == "function" ? e.config[t].bind({
|
|
@@ -7969,38 +7968,38 @@ function Z(e, t, n) {
|
|
|
7969
7968
|
parent: e.parent ? Z(e.parent, t, n) : null
|
|
7970
7969
|
}) : e.config[t];
|
|
7971
7970
|
}
|
|
7972
|
-
function
|
|
7971
|
+
function yl(e) {
|
|
7973
7972
|
return e.map((e) => {
|
|
7974
7973
|
let t = Z(e, "addExtensions", {
|
|
7975
7974
|
name: e.name,
|
|
7976
7975
|
options: e.options,
|
|
7977
7976
|
storage: e.storage
|
|
7978
7977
|
});
|
|
7979
|
-
return t ? [e, ...
|
|
7978
|
+
return t ? [e, ...yl(t())] : e;
|
|
7980
7979
|
}).flat(10);
|
|
7981
7980
|
}
|
|
7982
|
-
function
|
|
7981
|
+
function bl(e, t) {
|
|
7983
7982
|
let n = $e.fromSchema(t).serializeFragment(e), r = document.implementation.createHTMLDocument().createElement("div");
|
|
7984
7983
|
return r.appendChild(n), r.innerHTML;
|
|
7985
7984
|
}
|
|
7986
|
-
function
|
|
7985
|
+
function xl(e) {
|
|
7987
7986
|
return typeof e == "function";
|
|
7988
7987
|
}
|
|
7989
7988
|
function Q(e, t = void 0, ...n) {
|
|
7990
|
-
return
|
|
7989
|
+
return xl(e) ? t ? e.bind(t)(...n) : e(...n) : e;
|
|
7991
7990
|
}
|
|
7992
|
-
function
|
|
7991
|
+
function Sl(e = {}) {
|
|
7993
7992
|
return Object.keys(e).length === 0 && e.constructor === Object;
|
|
7994
7993
|
}
|
|
7995
|
-
function
|
|
7994
|
+
function Cl(e) {
|
|
7996
7995
|
return {
|
|
7997
7996
|
baseExtensions: e.filter((e) => e.type === "extension"),
|
|
7998
7997
|
nodeExtensions: e.filter((e) => e.type === "node"),
|
|
7999
7998
|
markExtensions: e.filter((e) => e.type === "mark")
|
|
8000
7999
|
};
|
|
8001
8000
|
}
|
|
8002
|
-
function
|
|
8003
|
-
let t = [], { nodeExtensions: n, markExtensions: r } =
|
|
8001
|
+
function wl(e) {
|
|
8002
|
+
let t = [], { nodeExtensions: n, markExtensions: r } = Cl(e), i = [...n, ...r], a = {
|
|
8004
8003
|
default: null,
|
|
8005
8004
|
validate: void 0,
|
|
8006
8005
|
rendered: !0,
|
|
@@ -8052,7 +8051,7 @@ function Cl(e) {
|
|
|
8052
8051
|
});
|
|
8053
8052
|
}), t;
|
|
8054
8053
|
}
|
|
8055
|
-
function
|
|
8054
|
+
function Tl(e) {
|
|
8056
8055
|
let t = [], n = "", r = !1, i = !1, a = 0, o = e.length;
|
|
8057
8056
|
for (let s = 0; s < o; s += 1) {
|
|
8058
8057
|
let o = e[s];
|
|
@@ -8082,8 +8081,8 @@ function wl(e) {
|
|
|
8082
8081
|
}
|
|
8083
8082
|
return n && t.push(n), t;
|
|
8084
8083
|
}
|
|
8085
|
-
function
|
|
8086
|
-
let t = [], n =
|
|
8084
|
+
function El(e) {
|
|
8085
|
+
let t = [], n = Tl(e || ""), r = n.length;
|
|
8087
8086
|
for (let e = 0; e < r; e += 1) {
|
|
8088
8087
|
let r = n[e], i = r.indexOf(":");
|
|
8089
8088
|
if (i === -1) continue;
|
|
@@ -8092,7 +8091,7 @@ function Tl(e) {
|
|
|
8092
8091
|
}
|
|
8093
8092
|
return t;
|
|
8094
8093
|
}
|
|
8095
|
-
function
|
|
8094
|
+
function Dl(...e) {
|
|
8096
8095
|
return e.filter((e) => !!e).reduce((e, t) => {
|
|
8097
8096
|
let n = { ...e };
|
|
8098
8097
|
return Object.entries(t).forEach(([e, t]) => {
|
|
@@ -8113,26 +8112,26 @@ function El(...e) {
|
|
|
8113
8112
|
let r = t ? String(t).split(" ") : [], i = n[e] ? n[e].split(" ") : [], a = r.filter((e) => !i.includes(e));
|
|
8114
8113
|
n[e] = [...i, ...a].join(" ");
|
|
8115
8114
|
} else if (e === "style") {
|
|
8116
|
-
let r = new Map([...
|
|
8115
|
+
let r = new Map([...El(n[e]), ...El(t)]);
|
|
8117
8116
|
n[e] = Array.from(r.entries()).map(([e, t]) => `${e}: ${t}`).join("; ");
|
|
8118
8117
|
} else n[e] = t;
|
|
8119
8118
|
}), n;
|
|
8120
8119
|
}, {});
|
|
8121
8120
|
}
|
|
8122
|
-
function
|
|
8123
|
-
return t.filter((t) => t.type === e.type.name).filter((e) => e.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(e.attrs) || {} : { [t.name]: e.attrs[t.name] }).reduce((e, t) =>
|
|
8121
|
+
function Ol(e, t) {
|
|
8122
|
+
return t.filter((t) => t.type === e.type.name).filter((e) => e.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(e.attrs) || {} : { [t.name]: e.attrs[t.name] }).reduce((e, t) => Dl(e, t), {});
|
|
8124
8123
|
}
|
|
8125
|
-
function
|
|
8124
|
+
function kl(e) {
|
|
8126
8125
|
return typeof e == "string" ? e.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(e) : e === "true" || e !== "false" && e : e;
|
|
8127
8126
|
}
|
|
8128
|
-
function
|
|
8127
|
+
function Al(e, t) {
|
|
8129
8128
|
return "style" in e ? e : {
|
|
8130
8129
|
...e,
|
|
8131
8130
|
getAttrs: (n) => {
|
|
8132
8131
|
let r = e.getAttrs ? e.getAttrs(n) : e.attrs;
|
|
8133
8132
|
if (r === !1) return !1;
|
|
8134
8133
|
let i = t.reduce((e, t) => {
|
|
8135
|
-
let r = t.attribute.parseHTML ? t.attribute.parseHTML(n) :
|
|
8134
|
+
let r = t.attribute.parseHTML ? t.attribute.parseHTML(n) : kl(n.getAttribute(t.name));
|
|
8136
8135
|
return r == null ? e : {
|
|
8137
8136
|
...e,
|
|
8138
8137
|
[t.name]: r
|
|
@@ -8145,16 +8144,16 @@ function kl(e, t) {
|
|
|
8145
8144
|
}
|
|
8146
8145
|
};
|
|
8147
8146
|
}
|
|
8148
|
-
function Al(e) {
|
|
8149
|
-
return Object.fromEntries(Object.entries(e).filter(([e, t]) => e === "attrs" && xl(t) ? !1 : t != null));
|
|
8150
|
-
}
|
|
8151
8147
|
function jl(e) {
|
|
8148
|
+
return Object.fromEntries(Object.entries(e).filter(([e, t]) => e === "attrs" && Sl(t) ? !1 : t != null));
|
|
8149
|
+
}
|
|
8150
|
+
function Ml(e) {
|
|
8152
8151
|
var t, n;
|
|
8153
8152
|
let r = {};
|
|
8154
8153
|
return !(e != null && (t = e.attribute) != null && t.isRequired) && "default" in (e?.attribute || {}) && (r.default = e.attribute.default), (e == null || (n = e.attribute) == null ? void 0 : n.validate) !== void 0 && (r.validate = e.attribute.validate), [e.name, r];
|
|
8155
8154
|
}
|
|
8156
|
-
function
|
|
8157
|
-
let n =
|
|
8155
|
+
function Nl(e, t) {
|
|
8156
|
+
let n = wl(e), { nodeExtensions: r, markExtensions: i } = Cl(e), a = r.find((e) => Z(e, "topNode"))?.name;
|
|
8158
8157
|
return new Fe({
|
|
8159
8158
|
topNode: a,
|
|
8160
8159
|
nodes: Object.fromEntries(r.map((r) => {
|
|
@@ -8163,7 +8162,7 @@ function Ml(e, t) {
|
|
|
8163
8162
|
options: r.options,
|
|
8164
8163
|
storage: r.storage,
|
|
8165
8164
|
editor: t
|
|
8166
|
-
}, o =
|
|
8165
|
+
}, o = jl({
|
|
8167
8166
|
...e.reduce((e, t) => {
|
|
8168
8167
|
let n = Z(t, "extendNodeSchema", a);
|
|
8169
8168
|
return {
|
|
@@ -8183,13 +8182,13 @@ function Ml(e, t) {
|
|
|
8183
8182
|
linebreakReplacement: Q(Z(r, "linebreakReplacement", a)),
|
|
8184
8183
|
defining: Q(Z(r, "defining", a)),
|
|
8185
8184
|
isolating: Q(Z(r, "isolating", a)),
|
|
8186
|
-
attrs: Object.fromEntries(i.map(
|
|
8185
|
+
attrs: Object.fromEntries(i.map(Ml))
|
|
8187
8186
|
}), s = Q(Z(r, "parseHTML", a));
|
|
8188
|
-
s && (o.parseDOM = s.map((e) =>
|
|
8187
|
+
s && (o.parseDOM = s.map((e) => Al(e, i)));
|
|
8189
8188
|
let c = Z(r, "renderHTML", a);
|
|
8190
8189
|
c && (o.toDOM = (e) => c({
|
|
8191
8190
|
node: e,
|
|
8192
|
-
HTMLAttributes:
|
|
8191
|
+
HTMLAttributes: Ol(e, i)
|
|
8193
8192
|
}));
|
|
8194
8193
|
let l = Z(r, "renderText", a);
|
|
8195
8194
|
return l && (o.toText = l), [r.name, o];
|
|
@@ -8200,7 +8199,7 @@ function Ml(e, t) {
|
|
|
8200
8199
|
options: r.options,
|
|
8201
8200
|
storage: r.storage,
|
|
8202
8201
|
editor: t
|
|
8203
|
-
}, o =
|
|
8202
|
+
}, o = jl({
|
|
8204
8203
|
...e.reduce((e, t) => {
|
|
8205
8204
|
let n = Z(t, "extendMarkSchema", a);
|
|
8206
8205
|
return {
|
|
@@ -8213,43 +8212,43 @@ function Ml(e, t) {
|
|
|
8213
8212
|
group: Q(Z(r, "group", a)),
|
|
8214
8213
|
spanning: Q(Z(r, "spanning", a)),
|
|
8215
8214
|
code: Q(Z(r, "code", a)),
|
|
8216
|
-
attrs: Object.fromEntries(i.map(
|
|
8215
|
+
attrs: Object.fromEntries(i.map(Ml))
|
|
8217
8216
|
}), s = Q(Z(r, "parseHTML", a));
|
|
8218
|
-
s && (o.parseDOM = s.map((e) =>
|
|
8217
|
+
s && (o.parseDOM = s.map((e) => Al(e, i)));
|
|
8219
8218
|
let c = Z(r, "renderHTML", a);
|
|
8220
8219
|
return c && (o.toDOM = (e) => c({
|
|
8221
8220
|
mark: e,
|
|
8222
|
-
HTMLAttributes:
|
|
8221
|
+
HTMLAttributes: Ol(e, i)
|
|
8223
8222
|
})), [r.name, o];
|
|
8224
8223
|
}))
|
|
8225
8224
|
});
|
|
8226
8225
|
}
|
|
8227
|
-
function
|
|
8226
|
+
function Pl(e) {
|
|
8228
8227
|
let t = e.filter((t, n) => e.indexOf(t) !== n);
|
|
8229
8228
|
return Array.from(new Set(t));
|
|
8230
8229
|
}
|
|
8231
|
-
function
|
|
8230
|
+
function Fl(e) {
|
|
8232
8231
|
return e.sort((e, t) => {
|
|
8233
8232
|
let n = Z(e, "priority") || 100, r = Z(t, "priority") || 100;
|
|
8234
8233
|
return n > r ? -1 : +(n < r);
|
|
8235
8234
|
});
|
|
8236
8235
|
}
|
|
8237
|
-
function
|
|
8238
|
-
let t =
|
|
8236
|
+
function Il(e) {
|
|
8237
|
+
let t = Fl(yl(e)), n = Pl(t.map((e) => e.name));
|
|
8239
8238
|
return n.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e) => `'${e}'`).join(", ")}]. This can lead to issues.`), t;
|
|
8240
8239
|
}
|
|
8241
|
-
function Il(e, t) {
|
|
8242
|
-
return Ml(Fl(e), t);
|
|
8243
|
-
}
|
|
8244
8240
|
function Ll(e, t) {
|
|
8245
|
-
|
|
8246
|
-
return yl(ue.fromJSON(n, e).content, n);
|
|
8241
|
+
return Nl(Il(e), t);
|
|
8247
8242
|
}
|
|
8248
8243
|
function Rl(e, t) {
|
|
8249
|
-
let n =
|
|
8244
|
+
let n = Ll(t);
|
|
8245
|
+
return bl(ue.fromJSON(n, e).content, n);
|
|
8246
|
+
}
|
|
8247
|
+
function zl(e, t) {
|
|
8248
|
+
let n = Ll(t), r = jc(e);
|
|
8250
8249
|
return ze.fromSchema(n).parse(r).toJSON();
|
|
8251
8250
|
}
|
|
8252
|
-
function
|
|
8251
|
+
function Bl(e, t, n) {
|
|
8253
8252
|
let { from: r, to: i } = t, { blockSeparator: a = "\n\n", textSerializers: o = {} } = n || {}, s = "";
|
|
8254
8253
|
return e.nodesBetween(r, i, (e, n, c, l) => {
|
|
8255
8254
|
e.isBlock && n > r && (s += a);
|
|
@@ -8267,26 +8266,26 @@ function zl(e, t, n) {
|
|
|
8267
8266
|
}
|
|
8268
8267
|
}), s;
|
|
8269
8268
|
}
|
|
8270
|
-
function
|
|
8271
|
-
return
|
|
8269
|
+
function Vl(e, t) {
|
|
8270
|
+
return Bl(e, {
|
|
8272
8271
|
from: 0,
|
|
8273
8272
|
to: e.content.size
|
|
8274
8273
|
}, t);
|
|
8275
8274
|
}
|
|
8276
|
-
function
|
|
8275
|
+
function Hl(e) {
|
|
8277
8276
|
return Object.fromEntries(Object.entries(e.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText]));
|
|
8278
8277
|
}
|
|
8279
|
-
function
|
|
8280
|
-
let { blockSeparator: r = "\n\n", textSerializers: i = {} } = n || {}, a =
|
|
8281
|
-
return
|
|
8278
|
+
function Ul(e, t, n) {
|
|
8279
|
+
let { blockSeparator: r = "\n\n", textSerializers: i = {} } = n || {}, a = Ll(t);
|
|
8280
|
+
return Vl(ue.fromJSON(a, e), {
|
|
8282
8281
|
blockSeparator: r,
|
|
8283
8282
|
textSerializers: {
|
|
8284
|
-
...
|
|
8283
|
+
...Hl(a),
|
|
8285
8284
|
...i
|
|
8286
8285
|
}
|
|
8287
8286
|
});
|
|
8288
8287
|
}
|
|
8289
|
-
function
|
|
8288
|
+
function Wl(e, t) {
|
|
8290
8289
|
let n = J(t, e.schema), { from: r, to: i } = e.selection, a = [];
|
|
8291
8290
|
e.doc.nodesBetween(r, i, (e) => {
|
|
8292
8291
|
a.push(e);
|
|
@@ -8294,22 +8293,22 @@ function Ul(e, t) {
|
|
|
8294
8293
|
let o = a.reverse().find((e) => e.type.name === n.name);
|
|
8295
8294
|
return o ? { ...o.attrs } : {};
|
|
8296
8295
|
}
|
|
8297
|
-
function
|
|
8298
|
-
let n =
|
|
8299
|
-
return n === "node" ?
|
|
8296
|
+
function Gl(e, t) {
|
|
8297
|
+
let n = tl(typeof t == "string" ? t : t.name, e.schema);
|
|
8298
|
+
return n === "node" ? Wl(e, t) : n === "mark" ? pl(e, t) : {};
|
|
8300
8299
|
}
|
|
8301
|
-
function
|
|
8300
|
+
function Kl(e, t = JSON.stringify) {
|
|
8302
8301
|
let n = {};
|
|
8303
8302
|
return e.filter((e) => {
|
|
8304
8303
|
let r = t(e);
|
|
8305
8304
|
return Object.prototype.hasOwnProperty.call(n, r) ? !1 : n[r] = !0;
|
|
8306
8305
|
});
|
|
8307
8306
|
}
|
|
8308
|
-
function
|
|
8309
|
-
let t =
|
|
8307
|
+
function ql(e) {
|
|
8308
|
+
let t = Kl(e);
|
|
8310
8309
|
return t.length === 1 ? t : t.filter((e, n) => !t.filter((e, t) => t !== n).some((t) => e.oldRange.from >= t.oldRange.from && e.oldRange.to <= t.oldRange.to && e.newRange.from >= t.newRange.from && e.newRange.to <= t.newRange.to));
|
|
8311
8310
|
}
|
|
8312
|
-
function
|
|
8311
|
+
function Jl(e) {
|
|
8313
8312
|
let { mapping: t, steps: n } = e, r = [];
|
|
8314
8313
|
return t.maps.forEach((e, i) => {
|
|
8315
8314
|
let a = [];
|
|
@@ -8340,9 +8339,9 @@ function ql(e) {
|
|
|
8340
8339
|
}
|
|
8341
8340
|
});
|
|
8342
8341
|
});
|
|
8343
|
-
}),
|
|
8342
|
+
}), ql(r);
|
|
8344
8343
|
}
|
|
8345
|
-
function
|
|
8344
|
+
function Yl(e, t = 0) {
|
|
8346
8345
|
let n = e.type === e.type.schema.topNodeType ? 0 : 1, r = t, i = r + e.nodeSize, a = e.marks.map((e) => {
|
|
8347
8346
|
let t = { type: e.type.name };
|
|
8348
8347
|
return Object.keys(e.attrs).length && (t.attrs = { ...e.attrs }), t;
|
|
@@ -8353,13 +8352,13 @@ function Jl(e, t = 0) {
|
|
|
8353
8352
|
};
|
|
8354
8353
|
return Object.keys(o).length && (s.attrs = o), a.length && (s.marks = a), e.content.childCount && (s.content = [], e.forEach((e, r) => {
|
|
8355
8354
|
var i;
|
|
8356
|
-
(i = s.content) == null || i.push(
|
|
8355
|
+
(i = s.content) == null || i.push(Yl(e, t + r + n));
|
|
8357
8356
|
})), e.text && (s.text = e.text), s;
|
|
8358
8357
|
}
|
|
8359
|
-
function
|
|
8358
|
+
function Xl(e, t, n) {
|
|
8360
8359
|
let r = [];
|
|
8361
8360
|
return e === t ? n.resolve(e).marks().forEach((t) => {
|
|
8362
|
-
let i =
|
|
8361
|
+
let i = yc(n.resolve(e), t.type);
|
|
8363
8362
|
i && r.push({
|
|
8364
8363
|
mark: t,
|
|
8365
8364
|
...i
|
|
@@ -8372,29 +8371,29 @@ function Yl(e, t, n) {
|
|
|
8372
8371
|
})));
|
|
8373
8372
|
}), r;
|
|
8374
8373
|
}
|
|
8375
|
-
var
|
|
8374
|
+
var Zl = (e, t, n, r = 20) => {
|
|
8376
8375
|
let i = e.doc.resolve(n), a = r, o = null;
|
|
8377
8376
|
for (; a > 0 && o === null;) {
|
|
8378
8377
|
let e = i.node(a);
|
|
8379
8378
|
e?.type.name === t ? o = e : --a;
|
|
8380
8379
|
}
|
|
8381
8380
|
return [o, a];
|
|
8382
|
-
},
|
|
8381
|
+
}, Ql = (e) => {
|
|
8383
8382
|
let t = e.depth - 1;
|
|
8384
8383
|
if (t < 0) return null;
|
|
8385
8384
|
let n = e.index(t);
|
|
8386
8385
|
return n === 0 ? null : e.node(t).child(n - 1);
|
|
8387
8386
|
};
|
|
8388
|
-
function
|
|
8387
|
+
function $l(e, t) {
|
|
8389
8388
|
return t.nodes[e] || t.marks[e] || null;
|
|
8390
8389
|
}
|
|
8391
|
-
function
|
|
8390
|
+
function eu(e, t, n) {
|
|
8392
8391
|
return Object.fromEntries(Object.entries(n).filter(([n]) => {
|
|
8393
8392
|
let r = e.find((e) => e.type === t && e.name === n);
|
|
8394
8393
|
return r ? r.attribute.keepOnSplit : !1;
|
|
8395
8394
|
}));
|
|
8396
8395
|
}
|
|
8397
|
-
var
|
|
8396
|
+
var tu = (e, t = 500) => {
|
|
8398
8397
|
let n = "", r = e.parentOffset;
|
|
8399
8398
|
return e.parent.nodesBetween(Math.max(0, r - t), r, (e, t, i, a) => {
|
|
8400
8399
|
var o;
|
|
@@ -8407,9 +8406,9 @@ var eu = (e, t = 500) => {
|
|
|
8407
8406
|
n += e.isAtom && !e.isText ? s : s.slice(0, Math.max(0, r - t));
|
|
8408
8407
|
}), n;
|
|
8409
8408
|
};
|
|
8410
|
-
function
|
|
8409
|
+
function nu(e, t, n = {}) {
|
|
8411
8410
|
let { empty: r, ranges: i } = e.selection, a = t ? Y(t, e.schema) : null;
|
|
8412
|
-
if (r) return !!(e.storedMarks || e.selection.$from.marks()).filter((e) => !a || a.name === e.type.name).find((e) =>
|
|
8411
|
+
if (r) return !!(e.storedMarks || e.selection.$from.marks()).filter((e) => !a || a.name === e.type.name).find((e) => gc(e.attrs, n, { strict: !1 }));
|
|
8413
8412
|
let o = 0, s = [];
|
|
8414
8413
|
if (i.forEach(({ $from: t, $to: n }) => {
|
|
8415
8414
|
let r = t.pos, i = n.pos;
|
|
@@ -8424,32 +8423,32 @@ function tu(e, t, n = {}) {
|
|
|
8424
8423
|
})));
|
|
8425
8424
|
});
|
|
8426
8425
|
}), o === 0) return !1;
|
|
8427
|
-
let c = s.filter((e) => !a || a.name === e.mark.type.name).filter((e) =>
|
|
8426
|
+
let c = s.filter((e) => !a || a.name === e.mark.type.name).filter((e) => gc(e.mark.attrs, n, { strict: !1 })).reduce((e, t) => e + t.to - t.from, 0), l = s.filter((e) => !a || e.mark.type !== a && e.mark.type.excludes(a)).reduce((e, t) => e + t.to - t.from, 0);
|
|
8428
8427
|
return (c > 0 ? c + l : c) >= o;
|
|
8429
8428
|
}
|
|
8430
|
-
function
|
|
8431
|
-
if (!t) return
|
|
8432
|
-
let r =
|
|
8433
|
-
return r === "node" ?
|
|
8429
|
+
function ru(e, t, n = {}) {
|
|
8430
|
+
if (!t) return Xc(e, null, n) || nu(e, null, n);
|
|
8431
|
+
let r = tl(t, e.schema);
|
|
8432
|
+
return r === "node" ? Xc(e, t, n) : r === "mark" && nu(e, t, n);
|
|
8434
8433
|
}
|
|
8435
|
-
var
|
|
8434
|
+
var iu = (e, t) => {
|
|
8436
8435
|
let { $from: n, $to: r, $anchor: i } = e.selection;
|
|
8437
8436
|
if (t) {
|
|
8438
|
-
let n =
|
|
8437
|
+
let n = vl((e) => e.type.name === t)(e.selection);
|
|
8439
8438
|
if (!n) return !1;
|
|
8440
8439
|
let r = e.doc.resolve(n.pos + 1);
|
|
8441
8440
|
return i.pos + 1 === r.end();
|
|
8442
8441
|
}
|
|
8443
8442
|
return !(r.parentOffset < r.parent.nodeSize - 2 || n.pos !== r.pos);
|
|
8444
|
-
},
|
|
8443
|
+
}, au = (e) => {
|
|
8445
8444
|
let { $from: t, $to: n } = e.selection;
|
|
8446
8445
|
return !(t.parentOffset > 0 || t.pos !== n.pos);
|
|
8447
8446
|
};
|
|
8448
|
-
function
|
|
8447
|
+
function ou(e, t) {
|
|
8449
8448
|
return Array.isArray(t) ? t.some((t) => (typeof t == "string" ? t : t.name) === e.name) : t;
|
|
8450
8449
|
}
|
|
8451
|
-
function
|
|
8452
|
-
let { nodeExtensions: n } =
|
|
8450
|
+
function su(e, t) {
|
|
8451
|
+
let { nodeExtensions: n } = Cl(t), r = n.find((t) => t.name === e);
|
|
8453
8452
|
if (!r) return !1;
|
|
8454
8453
|
let i = Q(Z(r, "group", {
|
|
8455
8454
|
name: r.name,
|
|
@@ -8458,7 +8457,7 @@ function ou(e, t) {
|
|
|
8458
8457
|
}));
|
|
8459
8458
|
return typeof i == "string" && i.split(" ").includes("list");
|
|
8460
8459
|
}
|
|
8461
|
-
function
|
|
8460
|
+
function cu(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
8462
8461
|
if (n) {
|
|
8463
8462
|
if (e.type.name === "hardBreak") return !0;
|
|
8464
8463
|
if (e.isText) return !/\S/.test(e.text ?? "");
|
|
@@ -8469,7 +8468,7 @@ function su(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
|
8469
8468
|
if (t) {
|
|
8470
8469
|
let r = !0;
|
|
8471
8470
|
return e.content.forEach((e) => {
|
|
8472
|
-
r !== !1 && (
|
|
8471
|
+
r !== !1 && (cu(e, {
|
|
8473
8472
|
ignoreWhitespace: n,
|
|
8474
8473
|
checkChildren: t
|
|
8475
8474
|
}) || (r = !1));
|
|
@@ -8477,98 +8476,98 @@ function su(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
|
8477
8476
|
}
|
|
8478
8477
|
return !1;
|
|
8479
8478
|
}
|
|
8480
|
-
function
|
|
8479
|
+
function lu(e) {
|
|
8481
8480
|
return e instanceof O;
|
|
8482
8481
|
}
|
|
8483
|
-
function
|
|
8482
|
+
function uu({ selection: e, pos: t, nodeSize: n, selectedOnTextSelection: r = !1 }) {
|
|
8484
8483
|
let { from: i, to: a } = e;
|
|
8485
|
-
return !!(i <= t && a >= t + n || r &&
|
|
8484
|
+
return !!(i <= t && a >= t + n || r && Sc(e) && i > t && a < t + n);
|
|
8486
8485
|
}
|
|
8487
|
-
function
|
|
8486
|
+
function du(e) {
|
|
8488
8487
|
if (typeof e != "object" || !e) return !1;
|
|
8489
8488
|
let t = e;
|
|
8490
8489
|
return typeof t.apply == "function" && typeof t.getMap == "function" && typeof t.invert == "function" && typeof t.map == "function" && typeof t.merge == "function" && typeof t.toJSON == "function";
|
|
8491
8490
|
}
|
|
8492
|
-
function
|
|
8491
|
+
function fu(e) {
|
|
8493
8492
|
if (typeof e != "object" || !e) return !1;
|
|
8494
8493
|
let t = e;
|
|
8495
|
-
if (!
|
|
8494
|
+
if (!du(t)) return !1;
|
|
8496
8495
|
let n = t.toJSON();
|
|
8497
8496
|
return !(typeof n != "object" || !n || n.stepType !== "addMark");
|
|
8498
8497
|
}
|
|
8499
|
-
function
|
|
8498
|
+
function pu(e) {
|
|
8500
8499
|
if (typeof e != "object" || !e) return !1;
|
|
8501
8500
|
let t = e;
|
|
8502
|
-
if (!
|
|
8501
|
+
if (!du(t)) return !1;
|
|
8503
8502
|
let n = t.toJSON();
|
|
8504
8503
|
return !(typeof n != "object" || !n || n.stepType !== "addNodeMark");
|
|
8505
8504
|
}
|
|
8506
|
-
function
|
|
8505
|
+
function mu(e) {
|
|
8507
8506
|
if (typeof e != "object" || !e) return !1;
|
|
8508
8507
|
let t = e;
|
|
8509
|
-
if (!
|
|
8508
|
+
if (!du(t)) return !1;
|
|
8510
8509
|
let n = t.toJSON();
|
|
8511
8510
|
return !(typeof n != "object" || !n || n.stepType !== "attr");
|
|
8512
8511
|
}
|
|
8513
|
-
function
|
|
8512
|
+
function hu(e) {
|
|
8514
8513
|
return typeof e != "object" || !e ? !1 : "forEachCell" in e && typeof e.forEachCell == "function";
|
|
8515
8514
|
}
|
|
8516
|
-
function
|
|
8515
|
+
function gu(e) {
|
|
8517
8516
|
if (typeof e != "object" || !e) return !1;
|
|
8518
8517
|
let t = e;
|
|
8519
|
-
if (!
|
|
8518
|
+
if (!du(t)) return !1;
|
|
8520
8519
|
let n = t.toJSON();
|
|
8521
8520
|
return !(typeof n != "object" || !n || n.stepType !== "docAttr");
|
|
8522
8521
|
}
|
|
8523
|
-
function
|
|
8522
|
+
function _u(e) {
|
|
8524
8523
|
if (typeof e != "object" || !e) return !1;
|
|
8525
8524
|
let t = e;
|
|
8526
8525
|
return !(!Array.isArray(t.content) || typeof t.size != "number" || typeof t.nodesBetween != "function" || typeof t.descendants != "function" || typeof t.textBetween != "function" || typeof t.append != "function" || typeof t.cut != "function" || typeof t.eq != "function" || typeof t.child != "function" || typeof t.forEach != "function");
|
|
8527
8526
|
}
|
|
8528
|
-
function
|
|
8527
|
+
function vu(e) {
|
|
8529
8528
|
return typeof e != "object" || !e ? !1 : "node" in e && e.node != null;
|
|
8530
8529
|
}
|
|
8531
|
-
function
|
|
8530
|
+
function yu(e) {
|
|
8532
8531
|
if (typeof e != "object" || !e) return !1;
|
|
8533
8532
|
let t = e;
|
|
8534
|
-
if (!
|
|
8533
|
+
if (!du(t)) return !1;
|
|
8535
8534
|
let n = t.toJSON();
|
|
8536
8535
|
return !(typeof n != "object" || !n || n.stepType !== "removeMark");
|
|
8537
8536
|
}
|
|
8538
|
-
function
|
|
8537
|
+
function bu(e) {
|
|
8539
8538
|
if (typeof e != "object" || !e) return !1;
|
|
8540
8539
|
let t = e;
|
|
8541
|
-
if (!
|
|
8540
|
+
if (!du(t)) return !1;
|
|
8542
8541
|
let n = t.toJSON();
|
|
8543
8542
|
return !(typeof n != "object" || !n || n.stepType !== "removeNodeMark");
|
|
8544
8543
|
}
|
|
8545
|
-
function
|
|
8544
|
+
function xu(e) {
|
|
8546
8545
|
if (typeof e != "object" || !e) return !1;
|
|
8547
8546
|
let t = e;
|
|
8548
|
-
if (!
|
|
8547
|
+
if (!du(t)) return !1;
|
|
8549
8548
|
let n = t.toJSON();
|
|
8550
8549
|
return !(typeof n != "object" || !n || n.stepType !== "replaceAround");
|
|
8551
8550
|
}
|
|
8552
|
-
function
|
|
8551
|
+
function Su(e) {
|
|
8553
8552
|
if (typeof e != "object" || !e) return !1;
|
|
8554
8553
|
let t = e;
|
|
8555
|
-
if (!
|
|
8554
|
+
if (!du(t)) return !1;
|
|
8556
8555
|
let n = t.toJSON();
|
|
8557
8556
|
return !(typeof n != "object" || !n || n.stepType !== "replace");
|
|
8558
8557
|
}
|
|
8559
|
-
function
|
|
8558
|
+
function Cu(e) {
|
|
8560
8559
|
if (typeof e != "object" || !e) return !1;
|
|
8561
8560
|
let t = e, n = Number.isInteger(t.openStart) && t.openStart >= 0, r = Number.isInteger(t.openEnd) && t.openEnd >= 0, i = typeof t.size == "number" && typeof t.eq == "function" && typeof t.toJSON == "function";
|
|
8562
8561
|
if (!n || !r || !i) return !1;
|
|
8563
8562
|
let a = t.content;
|
|
8564
|
-
return !(typeof a != "object" || !a || !
|
|
8563
|
+
return !(typeof a != "object" || !a || !_u(a));
|
|
8565
8564
|
}
|
|
8566
|
-
function
|
|
8565
|
+
function wu(e) {
|
|
8567
8566
|
if (typeof e != "object" || !e) return !1;
|
|
8568
8567
|
let t = e, n = t.doc !== null && typeof t.doc == "object" && t.failed === null, r = typeof t.failed == "string" && t.doc === null;
|
|
8569
8568
|
return !(!n && !r);
|
|
8570
8569
|
}
|
|
8571
|
-
var
|
|
8570
|
+
var Tu = class e {
|
|
8572
8571
|
constructor(e) {
|
|
8573
8572
|
this.position = e;
|
|
8574
8573
|
}
|
|
@@ -8579,17 +8578,17 @@ var wu = class e {
|
|
|
8579
8578
|
return { position: this.position };
|
|
8580
8579
|
}
|
|
8581
8580
|
};
|
|
8582
|
-
function
|
|
8581
|
+
function Eu(e, t) {
|
|
8583
8582
|
let n = t.mapping.mapResult(e.position);
|
|
8584
8583
|
return {
|
|
8585
|
-
position: new
|
|
8584
|
+
position: new Tu(n.pos),
|
|
8586
8585
|
mapResult: n
|
|
8587
8586
|
};
|
|
8588
8587
|
}
|
|
8589
|
-
function
|
|
8590
|
-
return new
|
|
8588
|
+
function Du(e) {
|
|
8589
|
+
return new Tu(e);
|
|
8591
8590
|
}
|
|
8592
|
-
function
|
|
8591
|
+
function Ou(e, t, n) {
|
|
8593
8592
|
let r = e.state.doc.content.size, i = X(t, 0, r), a = X(n, 0, r), o = e.coordsAtPos(i), s = e.coordsAtPos(a, -1), c = Math.min(o.top, s.top), l = Math.max(o.bottom, s.bottom), u = Math.min(o.left, s.left), d = Math.max(o.right, s.right), f = {
|
|
8594
8593
|
top: c,
|
|
8595
8594
|
bottom: l,
|
|
@@ -8605,7 +8604,7 @@ function Du(e, t, n) {
|
|
|
8605
8604
|
toJSON: () => f
|
|
8606
8605
|
};
|
|
8607
8606
|
}
|
|
8608
|
-
function
|
|
8607
|
+
function ku({ json: e, validMarks: t, validNodes: n, options: r, rewrittenContent: i = [] }) {
|
|
8609
8608
|
return e.marks && Array.isArray(e.marks) && (e.marks = e.marks.filter((e) => {
|
|
8610
8609
|
if (e == null) return !1;
|
|
8611
8610
|
let n = typeof e == "string" ? e : e.type;
|
|
@@ -8613,7 +8612,7 @@ function Ou({ json: e, validMarks: t, validNodes: n, options: r, rewrittenConten
|
|
|
8613
8612
|
original: JSON.parse(JSON.stringify(e)),
|
|
8614
8613
|
unsupported: n
|
|
8615
8614
|
}), !1);
|
|
8616
|
-
})), e.content && Array.isArray(e.content) && (e.content = e.content.map((e) => e == null ? null :
|
|
8615
|
+
})), e.content && Array.isArray(e.content) && (e.content = e.content.map((e) => e == null ? null : ku({
|
|
8617
8616
|
json: e,
|
|
8618
8617
|
validMarks: t,
|
|
8619
8618
|
validNodes: n,
|
|
@@ -8633,17 +8632,17 @@ function Ou({ json: e, validMarks: t, validNodes: n, options: r, rewrittenConten
|
|
|
8633
8632
|
rewrittenContent: i
|
|
8634
8633
|
};
|
|
8635
8634
|
}
|
|
8636
|
-
function
|
|
8637
|
-
return
|
|
8635
|
+
function Au(e, t, n) {
|
|
8636
|
+
return ku({
|
|
8638
8637
|
json: e,
|
|
8639
8638
|
validNodes: new Set(Object.keys(t.nodes)),
|
|
8640
8639
|
validMarks: new Set(Object.keys(t.marks)),
|
|
8641
8640
|
options: n
|
|
8642
8641
|
});
|
|
8643
8642
|
}
|
|
8644
|
-
function
|
|
8643
|
+
function ju(e, t, n) {
|
|
8645
8644
|
let { selection: r } = t, i = null;
|
|
8646
|
-
if (
|
|
8645
|
+
if (Sc(r) && (i = r.$cursor), i) {
|
|
8647
8646
|
let t = e.storedMarks ?? i.marks();
|
|
8648
8647
|
return i.parent.type.allowsMarkType(n) && (!!n.isInSet(t) || !t.some((e) => e.type.excludes(n)));
|
|
8649
8648
|
}
|
|
@@ -8660,11 +8659,11 @@ function Au(e, t, n) {
|
|
|
8660
8659
|
}), i;
|
|
8661
8660
|
});
|
|
8662
8661
|
}
|
|
8663
|
-
var
|
|
8662
|
+
var Mu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8664
8663
|
let { selection: a } = n, { empty: o, ranges: s } = a, c = Y(e, r.schema);
|
|
8665
8664
|
if (i) {
|
|
8666
8665
|
if (o) {
|
|
8667
|
-
let e =
|
|
8666
|
+
let e = pl(r, c);
|
|
8668
8667
|
n.addStoredMark(c.create({
|
|
8669
8668
|
...e,
|
|
8670
8669
|
...t
|
|
@@ -8682,8 +8681,8 @@ var ju = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
8682
8681
|
});
|
|
8683
8682
|
});
|
|
8684
8683
|
}
|
|
8685
|
-
return
|
|
8686
|
-
},
|
|
8684
|
+
return ju(r, n, c);
|
|
8685
|
+
}, Nu = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), Pu = (e, t = {}) => ({ state: n, dispatch: r, chain: i }) => {
|
|
8687
8686
|
let a = J(e, n.schema), o;
|
|
8688
8687
|
return n.selection.$anchor.sameParent(n.selection.$head) && (o = n.selection.$anchor.parent.attrs), a.isTextblock ? i().command(({ commands: e }) => hr(a, {
|
|
8689
8688
|
...o,
|
|
@@ -8692,13 +8691,13 @@ var ju = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
8692
8691
|
...o,
|
|
8693
8692
|
...t
|
|
8694
8693
|
})(e, r)).run() : (console.warn("[tiptap warn]: Currently \"setNode()\" only supports text block nodes."), !1);
|
|
8695
|
-
},
|
|
8694
|
+
}, Fu = (e) => ({ tr: t, dispatch: n }) => {
|
|
8696
8695
|
if (n) {
|
|
8697
8696
|
let { doc: n } = t, r = X(e, 0, n.content.size), i = O.create(n, r);
|
|
8698
8697
|
t.setSelection(i);
|
|
8699
8698
|
}
|
|
8700
8699
|
return !0;
|
|
8701
|
-
},
|
|
8700
|
+
}, Iu = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8702
8701
|
let { selection: a } = r, o, s;
|
|
8703
8702
|
return typeof t == "number" ? (o = t, s = t) : t && "from" in t && "to" in t ? (o = t.from, s = t.to) : (o = a.from, s = a.to), i && n.doc.nodesBetween(o, s, (t, r) => {
|
|
8704
8703
|
t.isText || n.setNodeMarkup(r, void 0, {
|
|
@@ -8706,7 +8705,7 @@ var ju = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
8706
8705
|
dir: e
|
|
8707
8706
|
});
|
|
8708
8707
|
}), !0;
|
|
8709
|
-
},
|
|
8708
|
+
}, Lu = (e) => ({ tr: t, dispatch: n }) => {
|
|
8710
8709
|
if (n) {
|
|
8711
8710
|
let { doc: n } = t, { from: r, to: i } = typeof e == "number" ? {
|
|
8712
8711
|
from: e,
|
|
@@ -8715,19 +8714,19 @@ var ju = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
8715
8714
|
t.setSelection(l);
|
|
8716
8715
|
}
|
|
8717
8716
|
return !0;
|
|
8718
|
-
},
|
|
8719
|
-
function
|
|
8717
|
+
}, Ru = (e) => ({ state: t, dispatch: n }) => Dr(J(e, t.schema))(t, n);
|
|
8718
|
+
function zu(e, t) {
|
|
8720
8719
|
let n = e.storedMarks || e.selection.$to.parentOffset && e.selection.$from.marks();
|
|
8721
8720
|
if (n) {
|
|
8722
8721
|
let r = n.filter((e) => t?.includes(e.type.name));
|
|
8723
8722
|
e.tr.ensureMarks(r);
|
|
8724
8723
|
}
|
|
8725
8724
|
}
|
|
8726
|
-
var
|
|
8727
|
-
let { selection: a, doc: o } = t, { $from: s, $to: c } = a, l = i.extensionManager.attributes, u =
|
|
8728
|
-
if (a instanceof O && a.node.isBlock) return !s.parentOffset || !Vt(o, s.pos) ? !1 : (r && (e &&
|
|
8725
|
+
var Bu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor: i }) => {
|
|
8726
|
+
let { selection: a, doc: o } = t, { $from: s, $to: c } = a, l = i.extensionManager.attributes, u = eu(l, s.node().type.name, s.node().attrs);
|
|
8727
|
+
if (a instanceof O && a.node.isBlock) return !s.parentOffset || !Vt(o, s.pos) ? !1 : (r && (e && zu(n, i.extensionManager.splittableMarks), t.split(s.pos).scrollIntoView()), !0);
|
|
8729
8728
|
if (!s.parent.isBlock) return !1;
|
|
8730
|
-
let d = c.parentOffset === c.parent.content.size, f = s.depth === 0 ? void 0 :
|
|
8729
|
+
let d = c.parentOffset === c.parent.content.size, f = s.depth === 0 ? void 0 : Lc(s.node(-1).contentMatchAt(s.indexAfter(-1))), p = d && f ? [{
|
|
8731
8730
|
type: f,
|
|
8732
8731
|
attrs: u
|
|
8733
8732
|
}] : void 0, m = Vt(t.doc, t.mapping.map(s.pos), 1, p);
|
|
@@ -8739,10 +8738,10 @@ var zu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8739
8738
|
let e = t.mapping.map(s.before()), n = t.doc.resolve(e);
|
|
8740
8739
|
s.node(-1).canReplaceWith(n.index(), n.index() + 1, f) && t.setNodeMarkup(t.mapping.map(s.before()), f);
|
|
8741
8740
|
}
|
|
8742
|
-
e &&
|
|
8741
|
+
e && zu(n, i.extensionManager.splittableMarks), t.scrollIntoView();
|
|
8743
8742
|
}
|
|
8744
8743
|
return m;
|
|
8745
|
-
},
|
|
8744
|
+
}, Vu = (e, t = {}) => ({ tr: n, state: r, dispatch: i, editor: a }) => {
|
|
8746
8745
|
let o = J(e, r.schema), { $from: c, $to: l } = r.selection, u = r.selection.node;
|
|
8747
8746
|
if (u && u.isBlock || c.depth < 2 || !c.sameParent(l)) return !1;
|
|
8748
8747
|
let d = c.node(-1);
|
|
@@ -8754,7 +8753,7 @@ var zu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8754
8753
|
let e = s.empty, r = c.index(-1) ? 1 : c.index(-2) ? 2 : 3;
|
|
8755
8754
|
for (let t = c.depth - r; t >= c.depth - 3; --t) e = s.from(c.node(t).copy(e));
|
|
8756
8755
|
let i = c.indexAfter(-1) < c.node(-2).childCount ? 1 : c.indexAfter(-2) < c.node(-3).childCount ? 2 : 3, a = {
|
|
8757
|
-
|
|
8756
|
+
...eu(f, c.node().type.name, c.node().attrs),
|
|
8758
8757
|
...t
|
|
8759
8758
|
}, l = o.contentMatch.defaultType?.createAndFill(a) || void 0;
|
|
8760
8759
|
e = e.append(s.from(o.createAndFill(null, l) || void 0));
|
|
@@ -8769,10 +8768,10 @@ var zu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8769
8768
|
return !0;
|
|
8770
8769
|
}
|
|
8771
8770
|
let m = l.pos === c.end() ? d.contentMatchAt(0).defaultType : null, h = {
|
|
8772
|
-
|
|
8771
|
+
...eu(f, d.type.name, d.attrs),
|
|
8773
8772
|
...t
|
|
8774
8773
|
}, g = {
|
|
8775
|
-
|
|
8774
|
+
...eu(f, c.node().type.name, c.node().attrs),
|
|
8776
8775
|
...t
|
|
8777
8776
|
};
|
|
8778
8777
|
n.delete(c.pos, l.pos);
|
|
@@ -8795,65 +8794,65 @@ var zu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8795
8794
|
}
|
|
8796
8795
|
return !0;
|
|
8797
8796
|
};
|
|
8798
|
-
function
|
|
8797
|
+
function Hu(e) {
|
|
8799
8798
|
return !e || e === "1" ? null : e;
|
|
8800
8799
|
}
|
|
8801
|
-
function
|
|
8802
|
-
return
|
|
8800
|
+
function Uu(e, t) {
|
|
8801
|
+
return Hu(e) === Hu(t);
|
|
8803
8802
|
}
|
|
8804
|
-
var
|
|
8805
|
-
let n =
|
|
8803
|
+
var Wu = (e, t) => {
|
|
8804
|
+
let n = vl((e) => e.type === t)(e.selection);
|
|
8806
8805
|
if (!n) return !0;
|
|
8807
8806
|
let r = e.doc.resolve(Math.max(0, n.pos - 1)).before(n.depth);
|
|
8808
8807
|
if (r === void 0) return !0;
|
|
8809
8808
|
let i = e.doc.nodeAt(r);
|
|
8810
|
-
return !(n.node.type === i?.type && Ut(e.doc, n.pos)) || !
|
|
8811
|
-
},
|
|
8812
|
-
let n =
|
|
8809
|
+
return !(n.node.type === i?.type && Ut(e.doc, n.pos)) || !Uu(n.node.attrs.type, i?.attrs.type) || e.join(n.pos), !0;
|
|
8810
|
+
}, Gu = (e, t) => {
|
|
8811
|
+
let n = vl((e) => e.type === t)(e.selection);
|
|
8813
8812
|
if (!n) return !0;
|
|
8814
8813
|
let r = e.doc.resolve(n.start).after(n.depth);
|
|
8815
8814
|
if (r === void 0) return !0;
|
|
8816
8815
|
let i = e.doc.nodeAt(r);
|
|
8817
|
-
return !(n.node.type === i?.type && Ut(e.doc, r)) || !
|
|
8816
|
+
return !(n.node.type === i?.type && Ut(e.doc, r)) || !Uu(n.node.attrs.type, i?.attrs.type) || e.join(r), !0;
|
|
8818
8817
|
};
|
|
8819
|
-
function
|
|
8818
|
+
function Ku(e) {
|
|
8820
8819
|
let t = e.doc, n = t.firstChild;
|
|
8821
8820
|
if (!n) return null;
|
|
8822
8821
|
let r = t.resolve(1), i = t.resolve(n.nodeSize - 1);
|
|
8823
8822
|
return D.between(r, i);
|
|
8824
8823
|
}
|
|
8825
|
-
var
|
|
8824
|
+
var qu = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain: c, commands: l, can: u }) => {
|
|
8826
8825
|
let { extensions: d, splittableMarks: f } = i.extensionManager, p = J(e, o.schema), m = J(t, o.schema), { selection: h, storedMarks: g } = o, { $from: _, $to: ee } = h, v = _.blockRange(ee), y = g || h.$to.parentOffset && h.$from.marks();
|
|
8827
8826
|
if (!v) return !1;
|
|
8828
|
-
let b =
|
|
8827
|
+
let b = vl((e) => su(e.type.name, d))(h), x = h.from === 0 && h.to === o.doc.content.size, te = o.doc.content.content, ne = te.length === 1 ? te[0] : null, re = x && ne && su(ne.type.name, d) ? {
|
|
8829
8828
|
node: ne,
|
|
8830
8829
|
pos: 0,
|
|
8831
8830
|
depth: 0
|
|
8832
8831
|
} : null, ie = b ?? re, ae = !!b && v.depth >= 1 && v.depth - b.depth <= 1, oe = !!re;
|
|
8833
8832
|
if ((ae || oe) && ie) {
|
|
8834
8833
|
if (ie.node.type === p) return x && oe ? c().command(({ tr: e, dispatch: t }) => {
|
|
8835
|
-
let n =
|
|
8834
|
+
let n = Ku(e);
|
|
8836
8835
|
return n ? (e.setSelection(n), t && t(e), !0) : !1;
|
|
8837
8836
|
}).liftListItem(m).run() : l.liftListItem(m);
|
|
8838
|
-
if (
|
|
8837
|
+
if (su(ie.node.type.name, d) && p.validContent(ie.node.content)) return c().command(() => (a.setNodeMarkup(ie.pos, p), !0)).command(() => Wu(a, p)).command(() => Gu(a, p)).run();
|
|
8839
8838
|
}
|
|
8840
|
-
return !n || !y || !s ? c().command(() => u().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() =>
|
|
8839
|
+
return !n || !y || !s ? c().command(() => u().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() => Wu(a, p)).command(() => Gu(a, p)).run() : c().command(() => {
|
|
8841
8840
|
let e = u().wrapInList(p, r), t = y.filter((e) => f.includes(e.type.name));
|
|
8842
8841
|
return a.ensureMarks(t), e ? !0 : l.clearNodes();
|
|
8843
|
-
}).wrapInList(p, r).command(() =>
|
|
8844
|
-
},
|
|
8842
|
+
}).wrapInList(p, r).command(() => Wu(a, p)).command(() => Gu(a, p)).run();
|
|
8843
|
+
}, Ju = (e, t = {}, n = {}) => ({ state: r, commands: i }) => {
|
|
8845
8844
|
let { extendEmptyMarkRange: a = !1 } = n, o = Y(e, r.schema);
|
|
8846
|
-
return
|
|
8847
|
-
},
|
|
8848
|
-
let a = J(e, r.schema), o = J(t, r.schema), s =
|
|
8845
|
+
return nu(r, o, t) ? i.unsetMark(o, { extendEmptyMarkRange: a }) : i.setMark(o, t);
|
|
8846
|
+
}, Yu = (e, t, n = {}) => ({ state: r, commands: i }) => {
|
|
8847
|
+
let a = J(e, r.schema), o = J(t, r.schema), s = Xc(r, a, n), c;
|
|
8849
8848
|
return r.selection.$anchor.sameParent(r.selection.$head) && (c = r.selection.$anchor.parent.attrs), s ? i.setNode(o, c) : i.setNode(a, {
|
|
8850
8849
|
...c,
|
|
8851
8850
|
...n
|
|
8852
8851
|
});
|
|
8853
|
-
},
|
|
8852
|
+
}, Xu = (e, t = {}) => ({ state: n, commands: r }) => {
|
|
8854
8853
|
let i = J(e, n.schema);
|
|
8855
|
-
return
|
|
8856
|
-
},
|
|
8854
|
+
return Xc(n, i, t) ? r.lift(i) : r.wrapIn(i, t);
|
|
8855
|
+
}, Zu = () => ({ state: e, dispatch: t }) => {
|
|
8857
8856
|
let n = e.plugins;
|
|
8858
8857
|
for (let r = 0; r < n.length; r += 1) {
|
|
8859
8858
|
let i = n[r], a;
|
|
@@ -8870,7 +8869,7 @@ var Ku = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
|
|
|
8870
8869
|
}
|
|
8871
8870
|
}
|
|
8872
8871
|
return !1;
|
|
8873
|
-
},
|
|
8872
|
+
}, Qu = (e = {}) => ({ tr: t, dispatch: n, editor: r }) => {
|
|
8874
8873
|
let { ignoreClearable: i = !1 } = e, { selection: a } = t, { empty: o, ranges: s } = a;
|
|
8875
8874
|
if (o) return !0;
|
|
8876
8875
|
let { nonClearableMarks: c } = r.extensionManager;
|
|
@@ -8881,25 +8880,25 @@ var Ku = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
|
|
|
8881
8880
|
});
|
|
8882
8881
|
}
|
|
8883
8882
|
return !0;
|
|
8884
|
-
},
|
|
8883
|
+
}, $u = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8885
8884
|
let { extendEmptyMarkRange: a = !1 } = t, { selection: o } = n, s = Y(e, r.schema), { $from: c, empty: l, ranges: u } = o;
|
|
8886
8885
|
if (!i) return !0;
|
|
8887
8886
|
if (l && a) {
|
|
8888
|
-
let { from: e, to: t } = o, r =
|
|
8887
|
+
let { from: e, to: t } = o, r = yc(c, s, c.marks().find((e) => e.type === s)?.attrs);
|
|
8889
8888
|
r && (e = r.from, t = r.to), n.removeMark(e, t, s);
|
|
8890
8889
|
} else u.forEach((e) => {
|
|
8891
8890
|
n.removeMark(e.$from.pos, e.$to.pos, s);
|
|
8892
8891
|
});
|
|
8893
8892
|
return n.removeStoredMark(s), !0;
|
|
8894
|
-
},
|
|
8893
|
+
}, ed = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
8895
8894
|
let { selection: i } = n, a, o;
|
|
8896
8895
|
return typeof e == "number" ? (a = e, o = e) : e && "from" in e && "to" in e ? (a = e.from, o = e.to) : (a = i.from, o = i.to), r && t.doc.nodesBetween(a, o, (e, n) => {
|
|
8897
8896
|
if (e.isText) return;
|
|
8898
8897
|
let r = { ...e.attrs };
|
|
8899
8898
|
delete r.dir, t.setNodeMarkup(n, void 0, r);
|
|
8900
8899
|
}), !0;
|
|
8901
|
-
},
|
|
8902
|
-
let a = null, o = null, s =
|
|
8900
|
+
}, td = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8901
|
+
let a = null, o = null, s = tl(typeof e == "string" ? e : e.name, r.schema);
|
|
8903
8902
|
if (!s) return !1;
|
|
8904
8903
|
s === "node" && (a = J(e, r.schema)), s === "mark" && (o = Y(e, r.schema));
|
|
8905
8904
|
let c = !1;
|
|
@@ -8930,86 +8929,86 @@ var Ku = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
|
|
|
8930
8929
|
}));
|
|
8931
8930
|
}));
|
|
8932
8931
|
}), c;
|
|
8933
|
-
},
|
|
8932
|
+
}, nd = new j("__tiptap_decorations__"), rd = (e) => ({ tr: t, dispatch: n }) => (n && t.setMeta(nd, {
|
|
8934
8933
|
type: "force",
|
|
8935
8934
|
name: e
|
|
8936
|
-
}), !0),
|
|
8937
|
-
blur: () =>
|
|
8938
|
-
clearContent: () =>
|
|
8939
|
-
clearNodes: () =>
|
|
8940
|
-
command: () =>
|
|
8941
|
-
createParagraphNear: () =>
|
|
8942
|
-
cut: () =>
|
|
8943
|
-
deleteCurrentNode: () =>
|
|
8944
|
-
deleteNode: () =>
|
|
8945
|
-
deleteRange: () =>
|
|
8946
|
-
deleteSelection: () =>
|
|
8947
|
-
enter: () =>
|
|
8948
|
-
exitCode: () =>
|
|
8949
|
-
extendMarkRange: () =>
|
|
8950
|
-
first: () =>
|
|
8951
|
-
focus: () =>
|
|
8952
|
-
forEach: () =>
|
|
8953
|
-
insertContent: () =>
|
|
8954
|
-
insertContentAt: () =>
|
|
8955
|
-
insertDefaultBlock: () =>
|
|
8956
|
-
joinBackward: () =>
|
|
8957
|
-
joinDown: () =>
|
|
8958
|
-
joinForward: () =>
|
|
8959
|
-
joinItemBackward: () =>
|
|
8960
|
-
joinItemForward: () =>
|
|
8961
|
-
joinTextblockBackward: () =>
|
|
8962
|
-
joinTextblockForward: () =>
|
|
8963
|
-
joinUp: () =>
|
|
8964
|
-
keyboardShortcut: () =>
|
|
8965
|
-
lift: () =>
|
|
8966
|
-
liftEmptyBlock: () =>
|
|
8967
|
-
liftListItem: () =>
|
|
8968
|
-
newlineInCode: () =>
|
|
8969
|
-
resetAttributes: () =>
|
|
8970
|
-
scrollIntoView: () =>
|
|
8971
|
-
selectAll: () =>
|
|
8972
|
-
selectNodeBackward: () =>
|
|
8973
|
-
selectNodeForward: () =>
|
|
8974
|
-
selectParentNode: () =>
|
|
8975
|
-
selectTextblockEnd: () =>
|
|
8976
|
-
selectTextblockStart: () =>
|
|
8977
|
-
setContent: () =>
|
|
8978
|
-
setMark: () =>
|
|
8979
|
-
setMeta: () =>
|
|
8980
|
-
setNode: () =>
|
|
8981
|
-
setNodeSelection: () =>
|
|
8982
|
-
setTextDirection: () =>
|
|
8983
|
-
setTextSelection: () =>
|
|
8984
|
-
sinkListItem: () =>
|
|
8985
|
-
splitBlock: () =>
|
|
8986
|
-
splitListItem: () =>
|
|
8987
|
-
toggleList: () =>
|
|
8988
|
-
toggleMark: () =>
|
|
8989
|
-
toggleNode: () =>
|
|
8990
|
-
toggleWrap: () =>
|
|
8991
|
-
undoInputRule: () =>
|
|
8992
|
-
unsetAllMarks: () =>
|
|
8993
|
-
unsetMark: () =>
|
|
8994
|
-
unsetTextDirection: () =>
|
|
8995
|
-
updateAttributes: () =>
|
|
8996
|
-
updateDecorations: () =>
|
|
8997
|
-
wrapIn: () =>
|
|
8998
|
-
wrapInList: () =>
|
|
8999
|
-
}),
|
|
9000
|
-
function
|
|
9001
|
-
|
|
8935
|
+
}), !0), id = (e, t = {}) => ({ state: n, dispatch: r }) => mr(J(e, n.schema), t)(n, r), ad = (e, t = {}) => ({ state: n, dispatch: r }) => xr(J(e, n.schema), t)(n, r), od = /* @__PURE__ */ t({
|
|
8936
|
+
blur: () => ec,
|
|
8937
|
+
clearContent: () => tc,
|
|
8938
|
+
clearNodes: () => nc,
|
|
8939
|
+
command: () => rc,
|
|
8940
|
+
createParagraphNear: () => ic,
|
|
8941
|
+
cut: () => ac,
|
|
8942
|
+
deleteCurrentNode: () => oc,
|
|
8943
|
+
deleteNode: () => sc,
|
|
8944
|
+
deleteRange: () => cc,
|
|
8945
|
+
deleteSelection: () => fc,
|
|
8946
|
+
enter: () => pc,
|
|
8947
|
+
exitCode: () => mc,
|
|
8948
|
+
extendMarkRange: () => bc,
|
|
8949
|
+
first: () => xc,
|
|
8950
|
+
focus: () => Dc,
|
|
8951
|
+
forEach: () => Oc,
|
|
8952
|
+
insertContent: () => kc,
|
|
8953
|
+
insertContentAt: () => Ic,
|
|
8954
|
+
insertDefaultBlock: () => Rc,
|
|
8955
|
+
joinBackward: () => Vc,
|
|
8956
|
+
joinDown: () => Bc,
|
|
8957
|
+
joinForward: () => Hc,
|
|
8958
|
+
joinItemBackward: () => Uc,
|
|
8959
|
+
joinItemForward: () => Wc,
|
|
8960
|
+
joinTextblockBackward: () => Gc,
|
|
8961
|
+
joinTextblockForward: () => Kc,
|
|
8962
|
+
joinUp: () => zc,
|
|
8963
|
+
keyboardShortcut: () => Yc,
|
|
8964
|
+
lift: () => Zc,
|
|
8965
|
+
liftEmptyBlock: () => Qc,
|
|
8966
|
+
liftListItem: () => $c,
|
|
8967
|
+
newlineInCode: () => el,
|
|
8968
|
+
resetAttributes: () => rl,
|
|
8969
|
+
scrollIntoView: () => il,
|
|
8970
|
+
selectAll: () => al,
|
|
8971
|
+
selectNodeBackward: () => ol,
|
|
8972
|
+
selectNodeForward: () => sl,
|
|
8973
|
+
selectParentNode: () => cl,
|
|
8974
|
+
selectTextblockEnd: () => ll,
|
|
8975
|
+
selectTextblockStart: () => ul,
|
|
8976
|
+
setContent: () => fl,
|
|
8977
|
+
setMark: () => Mu,
|
|
8978
|
+
setMeta: () => Nu,
|
|
8979
|
+
setNode: () => Pu,
|
|
8980
|
+
setNodeSelection: () => Fu,
|
|
8981
|
+
setTextDirection: () => Iu,
|
|
8982
|
+
setTextSelection: () => Lu,
|
|
8983
|
+
sinkListItem: () => Ru,
|
|
8984
|
+
splitBlock: () => Bu,
|
|
8985
|
+
splitListItem: () => Vu,
|
|
8986
|
+
toggleList: () => qu,
|
|
8987
|
+
toggleMark: () => Ju,
|
|
8988
|
+
toggleNode: () => Yu,
|
|
8989
|
+
toggleWrap: () => Xu,
|
|
8990
|
+
undoInputRule: () => Zu,
|
|
8991
|
+
unsetAllMarks: () => Qu,
|
|
8992
|
+
unsetMark: () => $u,
|
|
8993
|
+
unsetTextDirection: () => ed,
|
|
8994
|
+
updateAttributes: () => td,
|
|
8995
|
+
updateDecorations: () => rd,
|
|
8996
|
+
wrapIn: () => id,
|
|
8997
|
+
wrapInList: () => ad
|
|
8998
|
+
}), sd = /* @__PURE__ */ new WeakMap();
|
|
8999
|
+
function cd(e, t) {
|
|
9000
|
+
sd.set(e, (sd.get(e) ?? 0) + 1);
|
|
9002
9001
|
try {
|
|
9003
9002
|
return t();
|
|
9004
9003
|
} finally {
|
|
9005
|
-
let t = (
|
|
9006
|
-
t > 0 ?
|
|
9004
|
+
let t = (sd.get(e) ?? 1) - 1;
|
|
9005
|
+
t > 0 ? sd.set(e, t) : sd.delete(e);
|
|
9007
9006
|
}
|
|
9008
9007
|
}
|
|
9009
|
-
function
|
|
9010
|
-
return
|
|
9008
|
+
function ld(e) {
|
|
9009
|
+
return sd.has(e);
|
|
9011
9010
|
}
|
|
9012
|
-
var
|
|
9011
|
+
var ud = class {
|
|
9013
9012
|
constructor() {
|
|
9014
9013
|
this.callbacks = {};
|
|
9015
9014
|
}
|
|
@@ -9033,44 +9032,44 @@ var ld = class {
|
|
|
9033
9032
|
removeAllListeners() {
|
|
9034
9033
|
this.callbacks = {};
|
|
9035
9034
|
}
|
|
9036
|
-
},
|
|
9037
|
-
function
|
|
9035
|
+
}, dd = typeof process < "u" && process.env.NODE_ENV !== "production";
|
|
9036
|
+
function fd(e) {
|
|
9038
9037
|
return e.kind === "widget";
|
|
9039
9038
|
}
|
|
9040
|
-
function
|
|
9039
|
+
function pd(e, t) {
|
|
9041
9040
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
9042
|
-
for (let i of e) i.kind === "widget" &&
|
|
9041
|
+
for (let i of e) i.kind === "widget" && fd(i) && r.add(i.key), n.push(i.toPMDecoration(t));
|
|
9043
9042
|
return {
|
|
9044
9043
|
decorations: n,
|
|
9045
9044
|
widgetKeys: r
|
|
9046
9045
|
};
|
|
9047
9046
|
}
|
|
9048
|
-
function
|
|
9049
|
-
let { decorations: r, widgetKeys: i } =
|
|
9047
|
+
function md(e, t, n) {
|
|
9048
|
+
let { decorations: r, widgetKeys: i } = pd(t, n);
|
|
9050
9049
|
return {
|
|
9051
9050
|
set: G.create(e, r),
|
|
9052
9051
|
widgetKeys: i
|
|
9053
9052
|
};
|
|
9054
9053
|
}
|
|
9055
|
-
function
|
|
9054
|
+
function hd({ position: e, from: t, to: n, docSize: r }) {
|
|
9056
9055
|
return e < t ? !1 : e < n || e === n && n === r;
|
|
9057
9056
|
}
|
|
9058
|
-
function
|
|
9059
|
-
return e.filter((e) =>
|
|
9057
|
+
function gd({ decorations: e, from: t, to: n, docSize: r, extensionName: i, warnedExtensions: a }) {
|
|
9058
|
+
return e.filter((e) => hd({
|
|
9060
9059
|
position: e.anchor,
|
|
9061
9060
|
from: t,
|
|
9062
9061
|
to: n,
|
|
9063
9062
|
docSize: r
|
|
9064
9063
|
}) ? !0 : (e.anchor === n || a.has(i) || (a.add(i), console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)), !1));
|
|
9065
9064
|
}
|
|
9066
|
-
function
|
|
9065
|
+
function _d(e) {
|
|
9067
9066
|
let t = e.spec?.key;
|
|
9068
9067
|
return typeof t == "string" ? t : void 0;
|
|
9069
9068
|
}
|
|
9070
|
-
function
|
|
9069
|
+
function vd(e) {
|
|
9071
9070
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
9072
9071
|
for (let r of e.find()) {
|
|
9073
|
-
let e =
|
|
9072
|
+
let e = _d(r);
|
|
9074
9073
|
if (!e) continue;
|
|
9075
9074
|
let i = r.spec.extensionName ?? "unknown", a = t.get(e) ?? /* @__PURE__ */ new Set();
|
|
9076
9075
|
a.add(i), t.set(e, a), n.set(e, (n.get(e) ?? 0) + 1);
|
|
@@ -9080,18 +9079,18 @@ function _d(e) {
|
|
|
9080
9079
|
extensions: t
|
|
9081
9080
|
})).filter(({ key: e }) => (n.get(e) ?? 0) > 1);
|
|
9082
9081
|
}
|
|
9083
|
-
function
|
|
9082
|
+
function yd(e) {
|
|
9084
9083
|
return e.jsonID === "attr";
|
|
9085
9084
|
}
|
|
9086
|
-
function
|
|
9085
|
+
function bd(e) {
|
|
9087
9086
|
let t = !1;
|
|
9088
9087
|
if (e.getMap().forEach(() => {
|
|
9089
9088
|
t = !0;
|
|
9090
|
-
}), t ||
|
|
9089
|
+
}), t || yd(e)) return !0;
|
|
9091
9090
|
let n = e;
|
|
9092
9091
|
return typeof n.from == "number" && typeof n.to == "number";
|
|
9093
9092
|
}
|
|
9094
|
-
function
|
|
9093
|
+
function xd(e, t) {
|
|
9095
9094
|
let n = null, r = 0, i = 0;
|
|
9096
9095
|
for (let a = 0; a < e.childCount && !(i > t.to); a += 1) {
|
|
9097
9096
|
let o = i + e.child(a).nodeSize;
|
|
@@ -9102,11 +9101,11 @@ function bd(e, t) {
|
|
|
9102
9101
|
to: r
|
|
9103
9102
|
};
|
|
9104
9103
|
}
|
|
9105
|
-
function
|
|
9106
|
-
if (e.steps.some((e) => !
|
|
9107
|
-
let n =
|
|
9104
|
+
function Sd(e, t) {
|
|
9105
|
+
if (e.steps.some((e) => !bd(e))) return { type: "full" };
|
|
9106
|
+
let n = Jl(e).map(({ newRange: e }) => e);
|
|
9108
9107
|
e.steps.forEach((t, r) => {
|
|
9109
|
-
if (!
|
|
9108
|
+
if (!yd(t)) return;
|
|
9110
9109
|
let i = e.mapping.slice(r);
|
|
9111
9110
|
n.push({
|
|
9112
9111
|
from: i.map(t.pos, -1),
|
|
@@ -9115,7 +9114,7 @@ function xd(e, t) {
|
|
|
9115
9114
|
});
|
|
9116
9115
|
let r = [];
|
|
9117
9116
|
for (let e of n) {
|
|
9118
|
-
let n =
|
|
9117
|
+
let n = xd(t, e);
|
|
9119
9118
|
n && r.push(n);
|
|
9120
9119
|
}
|
|
9121
9120
|
r.sort((e, t) => e.from - t.from);
|
|
@@ -9129,29 +9128,29 @@ function xd(e, t) {
|
|
|
9129
9128
|
ranges: i
|
|
9130
9129
|
};
|
|
9131
9130
|
}
|
|
9132
|
-
function
|
|
9131
|
+
function Cd(e, t, n, r) {
|
|
9133
9132
|
return e.map(t, n, { onRemove: (e) => {
|
|
9134
9133
|
let t = e?.key;
|
|
9135
9134
|
typeof t == "string" && r.delete(t);
|
|
9136
9135
|
} });
|
|
9137
9136
|
}
|
|
9138
|
-
function
|
|
9137
|
+
function wd(e, t, n) {
|
|
9139
9138
|
let r = t.decorationSetsByExtension[e] ?? G.empty, i = new Set(t.widgetKeysByExtension[e] ?? []);
|
|
9140
9139
|
return {
|
|
9141
|
-
set:
|
|
9140
|
+
set: Cd(r, n.mapping, n.doc, i),
|
|
9142
9141
|
widgetKeys: i
|
|
9143
9142
|
};
|
|
9144
9143
|
}
|
|
9145
|
-
function
|
|
9144
|
+
function Td(e, t) {
|
|
9146
9145
|
let n = Object.values(t).flatMap((e) => e.find());
|
|
9147
9146
|
return G.create(e, n);
|
|
9148
9147
|
}
|
|
9149
|
-
function
|
|
9148
|
+
function Ed(e) {
|
|
9150
9149
|
let t = /* @__PURE__ */ new Set();
|
|
9151
9150
|
for (let n of Object.values(e)) for (let e of n) t.add(e);
|
|
9152
9151
|
return t;
|
|
9153
9152
|
}
|
|
9154
|
-
function
|
|
9153
|
+
function Dd(e, t) {
|
|
9155
9154
|
switch (t.update ?? "document") {
|
|
9156
9155
|
case "document":
|
|
9157
9156
|
if (t.createInRange) throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);
|
|
@@ -9166,26 +9165,26 @@ function Ed(e, t) {
|
|
|
9166
9165
|
default: throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`);
|
|
9167
9166
|
}
|
|
9168
9167
|
}
|
|
9169
|
-
function
|
|
9168
|
+
function Od(e, t, n) {
|
|
9170
9169
|
return n ? !0 : e.update === "manual" ? !1 : e.shouldUpdate ? e.shouldUpdate(t) : t.tr.docChanged;
|
|
9171
9170
|
}
|
|
9172
|
-
var
|
|
9173
|
-
function
|
|
9171
|
+
var kd = /* @__PURE__ */ new Set();
|
|
9172
|
+
function Ad(e) {
|
|
9174
9173
|
var t;
|
|
9175
|
-
return ((t = e.extensionManager) == null || (t = t.decorationManager) == null ? void 0 : t.liveWidgetKeys()) ??
|
|
9174
|
+
return ((t = e.extensionManager) == null || (t = t.decorationManager) == null ? void 0 : t.liveWidgetKeys()) ?? kd;
|
|
9176
9175
|
}
|
|
9177
|
-
var
|
|
9176
|
+
var jd = class {
|
|
9178
9177
|
constructor(e) {
|
|
9179
9178
|
this.warnedWidgetKeys = /* @__PURE__ */ new Set(), this.warnedOutOfRangeExtensions = /* @__PURE__ */ new Set(), this.handleBeforeTransaction = ({ nextState: e }) => {
|
|
9180
|
-
let t =
|
|
9179
|
+
let t = nd.getState(e);
|
|
9181
9180
|
t && this.warnDuplicateWidgetKeys(t);
|
|
9182
|
-
}, this.editor = e.editor, this.entries = this.resolveEntries(e.entries), this.entries.forEach(({ name: e, spec: t }) =>
|
|
9181
|
+
}, this.editor = e.editor, this.entries = this.resolveEntries(e.entries), this.entries.forEach(({ name: e, spec: t }) => Dd(e, t)), this.plugin = this.entries.length > 0 ? this.createPlugin() : null, this.editor.on("beforeTransaction", this.handleBeforeTransaction);
|
|
9183
9182
|
}
|
|
9184
9183
|
destroy() {
|
|
9185
9184
|
this.editor.off("beforeTransaction", this.handleBeforeTransaction);
|
|
9186
9185
|
}
|
|
9187
9186
|
liveWidgetKeys() {
|
|
9188
|
-
return
|
|
9187
|
+
return nd.getState(this.editor.state)?.widgetKeys ?? kd;
|
|
9189
9188
|
}
|
|
9190
9189
|
get mountedView() {
|
|
9191
9190
|
return this.editor.isDestroyed ? null : this.editor.view;
|
|
@@ -9204,7 +9203,7 @@ var Ad = class {
|
|
|
9204
9203
|
createPlugin() {
|
|
9205
9204
|
let { editor: e, entries: t } = this;
|
|
9206
9205
|
return new A({
|
|
9207
|
-
key:
|
|
9206
|
+
key: nd,
|
|
9208
9207
|
state: {
|
|
9209
9208
|
init: (e, n) => {
|
|
9210
9209
|
let r = {}, i = {};
|
|
@@ -9216,22 +9215,22 @@ var Ad = class {
|
|
|
9216
9215
|
decorationSetsByExtension: r,
|
|
9217
9216
|
widgetKeysByExtension: i,
|
|
9218
9217
|
mergedDecorationSet: this.buildMergedSet(n.doc, r),
|
|
9219
|
-
widgetKeys:
|
|
9218
|
+
widgetKeys: Ed(i)
|
|
9220
9219
|
};
|
|
9221
9220
|
return this.warnDuplicateWidgetKeys(a), a;
|
|
9222
9221
|
},
|
|
9223
9222
|
apply: (n, r, i, a) => {
|
|
9224
|
-
let o = n.getMeta(
|
|
9225
|
-
return
|
|
9223
|
+
let o = n.getMeta(nd), s = o?.type === "force" && !o.name, c = o?.type === "force" ? o.name : void 0, l = {}, u = {}, d = /* @__PURE__ */ new Set();
|
|
9224
|
+
return cd(e, () => {
|
|
9226
9225
|
for (let { name: o, spec: f } of t) {
|
|
9227
9226
|
let t = s || c === o;
|
|
9228
|
-
if (!
|
|
9227
|
+
if (!Od(f, {
|
|
9229
9228
|
editor: e,
|
|
9230
9229
|
tr: n,
|
|
9231
9230
|
oldState: i,
|
|
9232
9231
|
newState: a
|
|
9233
9232
|
}, t)) {
|
|
9234
|
-
let e =
|
|
9233
|
+
let e = wd(o, r, n);
|
|
9235
9234
|
l[o] = e.set, u[o] = e.widgetKeys;
|
|
9236
9235
|
} else if (f.update === "changedRanges" && n.docChanged && !t) {
|
|
9237
9236
|
let e = this.applyChangedRangesRecompute(o, f, r, n, a);
|
|
@@ -9251,34 +9250,34 @@ var Ad = class {
|
|
|
9251
9250
|
decorationSetsByExtension: l,
|
|
9252
9251
|
recomputedNames: d
|
|
9253
9252
|
}),
|
|
9254
|
-
widgetKeys:
|
|
9253
|
+
widgetKeys: Ed(u)
|
|
9255
9254
|
};
|
|
9256
9255
|
}
|
|
9257
9256
|
},
|
|
9258
9257
|
props: { decorations(e) {
|
|
9259
|
-
return
|
|
9258
|
+
return nd.getState(e)?.mergedDecorationSet ?? G.empty;
|
|
9260
9259
|
} }
|
|
9261
9260
|
});
|
|
9262
9261
|
}
|
|
9263
9262
|
applyChangedRangesRecompute(e, t, n, r, i) {
|
|
9264
|
-
let a =
|
|
9263
|
+
let a = Sd(r, i.doc);
|
|
9265
9264
|
return a.type === "full" ? this.buildFullSet(e, t, i) : this.rebuildRanges(e, t, n, r, i, a.ranges);
|
|
9266
9265
|
}
|
|
9267
9266
|
rebuildRanges(e, t, n, r, i, a) {
|
|
9268
|
-
let o = n.decorationSetsByExtension[e] ?? G.empty, s = new Set(n.widgetKeysByExtension[e] ?? []), c =
|
|
9267
|
+
let o = n.decorationSetsByExtension[e] ?? G.empty, s = new Set(n.widgetKeysByExtension[e] ?? []), c = Cd(o, r.mapping, r.doc, s), l = i.doc.content.size;
|
|
9269
9268
|
for (let { from: n, to: r } of a) {
|
|
9270
|
-
let a = c.find(n, r).filter((e) =>
|
|
9269
|
+
let a = c.find(n, r).filter((e) => hd({
|
|
9271
9270
|
position: e.from,
|
|
9272
9271
|
from: n,
|
|
9273
9272
|
to: r,
|
|
9274
9273
|
docSize: l
|
|
9275
9274
|
}));
|
|
9276
9275
|
for (let e of a) {
|
|
9277
|
-
let t =
|
|
9276
|
+
let t = _d(e);
|
|
9278
9277
|
t && s.delete(t);
|
|
9279
9278
|
}
|
|
9280
9279
|
c = c.remove(a);
|
|
9281
|
-
let { decorations: o, widgetKeys: u } =
|
|
9280
|
+
let { decorations: o, widgetKeys: u } = pd(gd({
|
|
9282
9281
|
decorations: this.runCreate(e, "createInRange", () => t.createInRange({
|
|
9283
9282
|
editor: this.editor,
|
|
9284
9283
|
state: i,
|
|
@@ -9306,7 +9305,7 @@ var Ad = class {
|
|
|
9306
9305
|
state: n,
|
|
9307
9306
|
view: this.mountedView
|
|
9308
9307
|
}));
|
|
9309
|
-
return
|
|
9308
|
+
return md(n.doc, r, e);
|
|
9310
9309
|
}
|
|
9311
9310
|
runCreate(e, t, n) {
|
|
9312
9311
|
try {
|
|
@@ -9316,12 +9315,12 @@ var Ad = class {
|
|
|
9316
9315
|
}
|
|
9317
9316
|
}
|
|
9318
9317
|
warnDuplicateWidgetKeys(e) {
|
|
9319
|
-
if (!
|
|
9318
|
+
if (!dd) return;
|
|
9320
9319
|
if (e.widgetKeys.size === 0) {
|
|
9321
9320
|
this.warnedWidgetKeys.clear();
|
|
9322
9321
|
return;
|
|
9323
9322
|
}
|
|
9324
|
-
let t =
|
|
9323
|
+
let t = vd(e.mergedDecorationSet), n = new Set(t.map(({ key: e }) => e));
|
|
9325
9324
|
for (let { key: e, extensions: n } of t) {
|
|
9326
9325
|
if (this.warnedWidgetKeys.has(e)) continue;
|
|
9327
9326
|
let t = Array.from(n).map((e) => `"${e}"`).join(", ");
|
|
@@ -9331,19 +9330,19 @@ var Ad = class {
|
|
|
9331
9330
|
}
|
|
9332
9331
|
buildMergedSet(e, t) {
|
|
9333
9332
|
let n = Object.keys(t);
|
|
9334
|
-
return n.length === 1 ? t[n[0]] :
|
|
9333
|
+
return n.length === 1 ? t[n[0]] : Td(e, t);
|
|
9335
9334
|
}
|
|
9336
9335
|
mergeAfterApply({ entries: e, previous: t, tr: n, decorationSetsByExtension: r, recomputedNames: i }) {
|
|
9337
|
-
return e.length === 1 ? r[e[0].name] : i.size === 0 ? t.mergedDecorationSet.map(n.mapping, n.doc) :
|
|
9336
|
+
return e.length === 1 ? r[e[0].name] : i.size === 0 ? t.mergedDecorationSet.map(n.mapping, n.doc) : Td(n.doc, r);
|
|
9338
9337
|
}
|
|
9339
9338
|
};
|
|
9340
|
-
function
|
|
9339
|
+
function Md(e, t) {
|
|
9341
9340
|
if (e === t) return !0;
|
|
9342
9341
|
if (!e || !t) return !1;
|
|
9343
9342
|
let n = Object.keys(e), r = Object.keys(t);
|
|
9344
9343
|
return n.length === r.length && n.every((n) => Object.prototype.hasOwnProperty.call(t, n) && Object.is(e[n], t[n]));
|
|
9345
9344
|
}
|
|
9346
|
-
function
|
|
9345
|
+
function Nd(e, t) {
|
|
9347
9346
|
let { selection: n } = e, { $from: r } = n;
|
|
9348
9347
|
if (n instanceof O) {
|
|
9349
9348
|
let e = r.index();
|
|
@@ -9357,16 +9356,16 @@ function Md(e, t) {
|
|
|
9357
9356
|
}
|
|
9358
9357
|
return !1;
|
|
9359
9358
|
}
|
|
9360
|
-
function
|
|
9359
|
+
function Pd(e, t, n) {
|
|
9361
9360
|
let r = document.querySelector(`style[data-tiptap-style${n ? `-${n}` : ""}]`);
|
|
9362
9361
|
if (r !== null) return r;
|
|
9363
9362
|
let i = document.createElement("style");
|
|
9364
9363
|
return t && i.setAttribute("nonce", t), i.setAttribute(`data-tiptap-style${n ? `-${n}` : ""}`, ""), i.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(i), i;
|
|
9365
9364
|
}
|
|
9366
|
-
function
|
|
9365
|
+
function Fd(e) {
|
|
9367
9366
|
return e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
9368
9367
|
}
|
|
9369
|
-
function
|
|
9368
|
+
function Id(e, t) {
|
|
9370
9369
|
let n = e.getAttribute("style");
|
|
9371
9370
|
if (!n) return null;
|
|
9372
9371
|
let r = n.split(";").map((e) => e.trim()).filter(Boolean), i = t.toLowerCase();
|
|
@@ -9376,66 +9375,66 @@ function Fd(e, t) {
|
|
|
9376
9375
|
}
|
|
9377
9376
|
return null;
|
|
9378
9377
|
}
|
|
9379
|
-
function
|
|
9378
|
+
function Ld(e) {
|
|
9380
9379
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/&/g, "&");
|
|
9381
9380
|
}
|
|
9382
|
-
function
|
|
9381
|
+
function Rd(e) {
|
|
9383
9382
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
9384
9383
|
}
|
|
9385
|
-
function
|
|
9384
|
+
function zd() {
|
|
9386
9385
|
return typeof navigator < "u" && /Firefox/.test(navigator.userAgent);
|
|
9387
9386
|
}
|
|
9388
|
-
function zd(e) {
|
|
9389
|
-
return typeof e == "number";
|
|
9390
|
-
}
|
|
9391
9387
|
function Bd(e) {
|
|
9392
|
-
return
|
|
9388
|
+
return typeof e == "number";
|
|
9393
9389
|
}
|
|
9394
9390
|
function Vd(e) {
|
|
9395
|
-
return
|
|
9391
|
+
return Object.prototype.toString.call(e).slice(8, -1);
|
|
9396
9392
|
}
|
|
9397
9393
|
function Hd(e) {
|
|
9398
|
-
return
|
|
9394
|
+
return Vd(e) === "Object" && e.constructor === Object && Object.getPrototypeOf(e) === Object.prototype;
|
|
9399
9395
|
}
|
|
9400
9396
|
function Ud(e) {
|
|
9401
|
-
return
|
|
9397
|
+
return typeof e == "string";
|
|
9402
9398
|
}
|
|
9403
9399
|
function Wd(e) {
|
|
9404
|
-
return
|
|
9400
|
+
return /\s/.test(e);
|
|
9405
9401
|
}
|
|
9406
9402
|
function Gd(e) {
|
|
9403
|
+
return /^[a-zA-Z]$/.test(e);
|
|
9404
|
+
}
|
|
9405
|
+
function Kd(e) {
|
|
9407
9406
|
return /^\w$/.test(e);
|
|
9408
9407
|
}
|
|
9409
|
-
function
|
|
9410
|
-
for (; t < e.length &&
|
|
9408
|
+
function qd(e, t) {
|
|
9409
|
+
for (; t < e.length && Wd(e[t]);) t += 1;
|
|
9411
9410
|
return t;
|
|
9412
9411
|
}
|
|
9413
|
-
function
|
|
9414
|
-
for (; t < e.length && !
|
|
9412
|
+
function Jd(e, t) {
|
|
9413
|
+
for (; t < e.length && !Wd(e[t]);) t += 1;
|
|
9415
9414
|
return t;
|
|
9416
9415
|
}
|
|
9417
|
-
function
|
|
9418
|
-
for (; t < e.length && (
|
|
9416
|
+
function Yd(e, t, n) {
|
|
9417
|
+
for (; t < e.length && (Kd(e[t]) || n && e[t] === "-");) t += 1;
|
|
9419
9418
|
return t;
|
|
9420
9419
|
}
|
|
9421
|
-
function
|
|
9422
|
-
let n = e[t], r = t + 1, i =
|
|
9423
|
-
return i === r ? { nextIndex:
|
|
9420
|
+
function Xd(e, t) {
|
|
9421
|
+
let n = e[t], r = t + 1, i = Yd(e, r, !0);
|
|
9422
|
+
return i === r ? { nextIndex: Jd(e, i) } : {
|
|
9424
9423
|
token: {
|
|
9425
9424
|
type: n === "." ? "class" : "id",
|
|
9426
9425
|
name: e.slice(r, i)
|
|
9427
9426
|
},
|
|
9428
|
-
nextIndex:
|
|
9427
|
+
nextIndex: Jd(e, i)
|
|
9429
9428
|
};
|
|
9430
9429
|
}
|
|
9431
|
-
function
|
|
9430
|
+
function Zd(e, t) {
|
|
9432
9431
|
let n = e.indexOf(e[t], t + 1);
|
|
9433
|
-
return { nextIndex:
|
|
9432
|
+
return { nextIndex: Jd(e, n === -1 ? t : n + 1) };
|
|
9434
9433
|
}
|
|
9435
|
-
function
|
|
9436
|
-
let i = r ?
|
|
9434
|
+
function Qd(e, t, n, r) {
|
|
9435
|
+
let i = r ? qd(e, n) : n;
|
|
9437
9436
|
if (e[i] !== "=") return;
|
|
9438
|
-
i = r ?
|
|
9437
|
+
i = r ? qd(e, i + 1) : i + 1;
|
|
9439
9438
|
let a = e[i];
|
|
9440
9439
|
if (a !== "\"" && a !== "'") return;
|
|
9441
9440
|
let o = e.indexOf(a, i + 1);
|
|
@@ -9445,34 +9444,34 @@ function Zd(e, t, n, r) {
|
|
|
9445
9444
|
name: t,
|
|
9446
9445
|
value: e.slice(i + 1, o)
|
|
9447
9446
|
},
|
|
9448
|
-
nextIndex:
|
|
9447
|
+
nextIndex: Jd(e, o + 1)
|
|
9449
9448
|
};
|
|
9450
9449
|
}
|
|
9451
|
-
function
|
|
9452
|
-
let r = n === "pandoc", i =
|
|
9450
|
+
function $d(e, t, n) {
|
|
9451
|
+
let r = n === "pandoc", i = Yd(e, t + 1, r), a = e.slice(t, i), o = Qd(e, a, i, r);
|
|
9453
9452
|
if (o) return o;
|
|
9454
|
-
let s = i === e.length ||
|
|
9453
|
+
let s = i === e.length || Wd(e[i]);
|
|
9455
9454
|
return {
|
|
9456
9455
|
token: r && s ? {
|
|
9457
9456
|
type: "boolean",
|
|
9458
9457
|
name: a
|
|
9459
9458
|
} : void 0,
|
|
9460
|
-
nextIndex: n === "shortcode" ?
|
|
9459
|
+
nextIndex: n === "shortcode" ? Jd(e, i) : i
|
|
9461
9460
|
};
|
|
9462
9461
|
}
|
|
9463
|
-
function
|
|
9462
|
+
function ef(e, t, n) {
|
|
9464
9463
|
let r = e[t];
|
|
9465
|
-
return n === "pandoc" && (r === "." || r === "#") ?
|
|
9464
|
+
return n === "pandoc" && (r === "." || r === "#") ? Xd(e, t) : r === "\"" || r === "'" ? Zd(e, t) : (n === "pandoc" ? Gd(r) : Kd(r)) ? $d(e, t, n) : { nextIndex: Jd(e, t) };
|
|
9466
9465
|
}
|
|
9467
|
-
function
|
|
9466
|
+
function tf(e, t) {
|
|
9468
9467
|
let n = [], r = 0;
|
|
9469
|
-
for (; r < e.length && (r =
|
|
9470
|
-
let i =
|
|
9468
|
+
for (; r < e.length && (r = qd(e, r), !(r >= e.length));) {
|
|
9469
|
+
let i = ef(e, r, t);
|
|
9471
9470
|
i.token && n.push(i.token), r = i.nextIndex;
|
|
9472
9471
|
}
|
|
9473
9472
|
return n;
|
|
9474
9473
|
}
|
|
9475
|
-
function
|
|
9474
|
+
function nf(e) {
|
|
9476
9475
|
let t = {}, n = e.filter((e) => e.type === "class").map((e) => e.name), r = e.find((e) => e.type === "id");
|
|
9477
9476
|
return n.length > 0 && (t.class = n.join(" ")), r && (t.id = r.name), e.forEach((e) => {
|
|
9478
9477
|
e.type === "keyValue" && (t[e.name] = e.value);
|
|
@@ -9480,18 +9479,18 @@ function tf(e) {
|
|
|
9480
9479
|
e.type === "boolean" && (t[e.name] = !0);
|
|
9481
9480
|
}), t;
|
|
9482
9481
|
}
|
|
9483
|
-
function nf(e) {
|
|
9484
|
-
return e?.trim() ? tf(ef(e, "pandoc")) : {};
|
|
9485
|
-
}
|
|
9486
9482
|
function rf(e) {
|
|
9483
|
+
return e?.trim() ? nf(tf(e, "pandoc")) : {};
|
|
9484
|
+
}
|
|
9485
|
+
function af(e) {
|
|
9487
9486
|
if (!e || Object.keys(e).length === 0) return "";
|
|
9488
9487
|
let t = [];
|
|
9489
9488
|
return e.class && String(e.class).split(/\s+/).filter(Boolean).forEach((e) => t.push(`.${e}`)), e.id && t.push(`#${e.id}`), Object.entries(e).forEach(([e, n]) => {
|
|
9490
9489
|
e !== "class" && e !== "id" && (n === !0 ? t.push(e) : n !== !1 && n != null && t.push(`${e}="${String(n)}"`));
|
|
9491
9490
|
}), t.join(" ");
|
|
9492
9491
|
}
|
|
9493
|
-
function
|
|
9494
|
-
let { nodeName: t, name: n, parseAttributes: r =
|
|
9492
|
+
function of(e) {
|
|
9493
|
+
let { nodeName: t, name: n, parseAttributes: r = rf, serializeAttributes: i = af, defaultAttributes: a = {}, requiredAttributes: o = [], allowedAttributes: s } = e, c = n || t, l = (e) => {
|
|
9495
9494
|
if (!s) return e;
|
|
9496
9495
|
let t = {};
|
|
9497
9496
|
return s.forEach((n) => {
|
|
@@ -9530,8 +9529,8 @@ function af(e) {
|
|
|
9530
9529
|
}
|
|
9531
9530
|
};
|
|
9532
9531
|
}
|
|
9533
|
-
function
|
|
9534
|
-
let { nodeName: t, name: n, getContent: r, parseAttributes: i =
|
|
9532
|
+
function sf(e) {
|
|
9533
|
+
let { nodeName: t, name: n, getContent: r, parseAttributes: i = rf, serializeAttributes: a = af, defaultAttributes: o = {}, content: s = "block", allowedAttributes: c } = e, l = n || t, u = (e) => {
|
|
9535
9534
|
if (!c) return e;
|
|
9536
9535
|
let t = {};
|
|
9537
9536
|
return c.forEach((n) => {
|
|
@@ -9603,17 +9602,17 @@ function of(e) {
|
|
|
9603
9602
|
}
|
|
9604
9603
|
};
|
|
9605
9604
|
}
|
|
9606
|
-
function
|
|
9605
|
+
function cf(e) {
|
|
9607
9606
|
let t = {};
|
|
9608
|
-
return
|
|
9607
|
+
return tf(e, "shortcode").forEach((e) => {
|
|
9609
9608
|
e.type === "keyValue" && (t[e.name] = e.value);
|
|
9610
9609
|
}), t;
|
|
9611
9610
|
}
|
|
9612
|
-
function
|
|
9611
|
+
function lf(e) {
|
|
9613
9612
|
return Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => `${e}="${t}"`).join(" ");
|
|
9614
9613
|
}
|
|
9615
|
-
function
|
|
9616
|
-
let { nodeName: t, name: n, getContent: r, parseAttributes: i =
|
|
9614
|
+
function uf(e) {
|
|
9615
|
+
let { nodeName: t, name: n, getContent: r, parseAttributes: i = cf, serializeAttributes: a = lf, defaultAttributes: o = {}, selfClosing: s = !1, allowedAttributes: c } = e, l = n || t, u = (e) => {
|
|
9617
9616
|
if (!c) return e;
|
|
9618
9617
|
let t = {};
|
|
9619
9618
|
return c.forEach((n) => {
|
|
@@ -9670,7 +9669,7 @@ function lf(e) {
|
|
|
9670
9669
|
}
|
|
9671
9670
|
};
|
|
9672
9671
|
}
|
|
9673
|
-
function
|
|
9672
|
+
function df(e, t, n) {
|
|
9674
9673
|
let r = e.split("\n"), i = [], a = "", o = 0, s = t.baseIndentSize || 2;
|
|
9675
9674
|
for (; o < r.length;) {
|
|
9676
9675
|
let e = r[o], u = e.match(t.itemPattern);
|
|
@@ -9714,13 +9713,13 @@ function uf(e, t, n) {
|
|
|
9714
9713
|
raw: a
|
|
9715
9714
|
};
|
|
9716
9715
|
}
|
|
9717
|
-
var
|
|
9718
|
-
function
|
|
9716
|
+
var ff = 4;
|
|
9717
|
+
function pf(e) {
|
|
9719
9718
|
let t = 0;
|
|
9720
|
-
for (let n of e) t = n === " " ? t +
|
|
9719
|
+
for (let n of e) t = n === " " ? t + ff - t % ff : t + 1;
|
|
9721
9720
|
return t;
|
|
9722
9721
|
}
|
|
9723
|
-
function
|
|
9722
|
+
function mf(e, t, n, r, i) {
|
|
9724
9723
|
if (!e || !Array.isArray(e.content)) return "";
|
|
9725
9724
|
let a = typeof n == "function" ? n(r) : n, [o, ...s] = e.content, c = `${a}${t.renderChildren([o])}`;
|
|
9726
9725
|
return s && s.length > 0 && s.forEach((e, n) => {
|
|
@@ -9728,40 +9727,40 @@ function pf(e, t, n, r, i) {
|
|
|
9728
9727
|
if (r != null) {
|
|
9729
9728
|
let n = (e) => {
|
|
9730
9729
|
if (!i?.alignNestedToPrefix) return t.indent(e);
|
|
9731
|
-
let n = t.indent(""), r =
|
|
9732
|
-
return (
|
|
9730
|
+
let n = t.indent(""), r = pf(a);
|
|
9731
|
+
return (pf(n) >= r ? n : " ".repeat(r)) + e;
|
|
9733
9732
|
}, o = r.split("\n").map((e) => n(e || "")).join("\n");
|
|
9734
9733
|
c += e.type === "paragraph" ? `\n\n${o}` : `\n${o}`;
|
|
9735
9734
|
}
|
|
9736
9735
|
}), c;
|
|
9737
9736
|
}
|
|
9738
|
-
var
|
|
9739
|
-
createAtomBlockMarkdownSpec: () =>
|
|
9740
|
-
createBlockMarkdownSpec: () =>
|
|
9741
|
-
createInlineMarkdownSpec: () =>
|
|
9742
|
-
parseAttributes: () =>
|
|
9743
|
-
parseIndentedBlocks: () =>
|
|
9744
|
-
renderNestedMarkdownContent: () =>
|
|
9745
|
-
serializeAttributes: () =>
|
|
9737
|
+
var hf = /* @__PURE__ */ t({
|
|
9738
|
+
createAtomBlockMarkdownSpec: () => of,
|
|
9739
|
+
createBlockMarkdownSpec: () => sf,
|
|
9740
|
+
createInlineMarkdownSpec: () => uf,
|
|
9741
|
+
parseAttributes: () => rf,
|
|
9742
|
+
parseIndentedBlocks: () => df,
|
|
9743
|
+
renderNestedMarkdownContent: () => mf,
|
|
9744
|
+
serializeAttributes: () => af
|
|
9746
9745
|
});
|
|
9747
|
-
function
|
|
9746
|
+
function gf(e) {
|
|
9748
9747
|
return typeof e.type == "string" ? e.type : e.type.name;
|
|
9749
9748
|
}
|
|
9750
|
-
function
|
|
9749
|
+
function _f(e, t) {
|
|
9751
9750
|
if (e.length !== t.length) return !1;
|
|
9752
9751
|
let n = Array.from({ length: t.length }, () => !1);
|
|
9753
9752
|
return e.every((e) => {
|
|
9754
|
-
let r =
|
|
9753
|
+
let r = gf(e), i = t.findIndex((t, i) => !n[i] && r === gf(t) && Md(e.attrs, t.attrs));
|
|
9755
9754
|
return i !== -1 && (n[i] = !0, !0);
|
|
9756
9755
|
});
|
|
9757
9756
|
}
|
|
9758
|
-
function
|
|
9757
|
+
function vf(e, t) {
|
|
9759
9758
|
let n = { ...e };
|
|
9760
|
-
return
|
|
9761
|
-
|
|
9759
|
+
return Hd(e) && Hd(t) && Object.keys(t).forEach((r) => {
|
|
9760
|
+
Hd(t[r]) && Hd(e[r]) ? n[r] = vf(e[r], t[r]) : n[r] = t[r];
|
|
9762
9761
|
}), n;
|
|
9763
9762
|
}
|
|
9764
|
-
function
|
|
9763
|
+
function yf(e, t, n = {}) {
|
|
9765
9764
|
let { state: r } = t, { doc: i, tr: a } = r, o = e;
|
|
9766
9765
|
i.descendants((t, r) => {
|
|
9767
9766
|
let i = a.mapping.map(r), s = a.mapping.map(r) + t.nodeSize, c = null;
|
|
@@ -9781,7 +9780,7 @@ function vf(e, t, n = {}) {
|
|
|
9781
9780
|
}
|
|
9782
9781
|
}), a.docChanged && t.view.dispatch(a);
|
|
9783
9782
|
}
|
|
9784
|
-
var
|
|
9783
|
+
var bf = class {
|
|
9785
9784
|
constructor(e, t, n) {
|
|
9786
9785
|
this.component = e, this.editor = t.editor, this.options = { ...n }, this.mark = t.mark, this.HTMLAttributes = t.HTMLAttributes;
|
|
9787
9786
|
}
|
|
@@ -9792,44 +9791,44 @@ var yf = class {
|
|
|
9792
9791
|
return null;
|
|
9793
9792
|
}
|
|
9794
9793
|
updateAttributes(e, t) {
|
|
9795
|
-
|
|
9794
|
+
yf(t || this.mark, this.editor, e);
|
|
9796
9795
|
}
|
|
9797
9796
|
ignoreMutation(e) {
|
|
9798
|
-
return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : e.type === "selection" || this.contentDOM.contains(e.target) && e.type === "childList" && (
|
|
9797
|
+
return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : e.type === "selection" || this.contentDOM.contains(e.target) && e.type === "childList" && (Tc() || wc()) && this.editor.isFocused && [...Array.from(e.addedNodes), ...Array.from(e.removedNodes)].every((e) => e.isContentEditable) ? !1 : this.contentDOM === e.target && e.type === "attributes" || !this.contentDOM.contains(e.target);
|
|
9799
9798
|
}
|
|
9800
|
-
},
|
|
9799
|
+
}, xf = class {
|
|
9801
9800
|
constructor(e) {
|
|
9802
9801
|
this.find = e.find, this.handler = e.handler, this.undoable = e.undoable ?? !0;
|
|
9803
9802
|
}
|
|
9804
|
-
},
|
|
9805
|
-
if (
|
|
9803
|
+
}, Sf = (e, t) => {
|
|
9804
|
+
if (hc(t)) return t.exec(e);
|
|
9806
9805
|
let n = t(e);
|
|
9807
9806
|
if (!n) return null;
|
|
9808
9807
|
let r = [n.text];
|
|
9809
9808
|
return r.index = n.index, r.input = e, r.data = n.data, n.replaceWith && (n.text.includes(n.replaceWith) || console.warn("[tiptap warn]: \"inputRuleMatch.replaceWith\" must be part of \"inputRuleMatch.text\"."), r.push(n.replaceWith)), r;
|
|
9810
9809
|
};
|
|
9811
|
-
function
|
|
9810
|
+
function Cf(e) {
|
|
9812
9811
|
let { editor: t, from: n, to: r, text: i, rules: a, plugin: o } = e, { view: s } = t;
|
|
9813
9812
|
if (s.composing) return !1;
|
|
9814
9813
|
let c = s.state.doc.resolve(n);
|
|
9815
9814
|
if (c.parent.type.spec.code || (c.nodeBefore || c.nodeAfter)?.marks.find((e) => e.type.spec.code)) return !1;
|
|
9816
|
-
let l = !1, u =
|
|
9815
|
+
let l = !1, u = tu(c) + i;
|
|
9817
9816
|
return a.forEach((e) => {
|
|
9818
9817
|
if (l) return;
|
|
9819
|
-
let a =
|
|
9818
|
+
let a = Sf(u, e.find);
|
|
9820
9819
|
if (!a) return;
|
|
9821
9820
|
let d = a[0].length - i.length;
|
|
9822
9821
|
if (d > 0) {
|
|
9823
9822
|
let e = c.parentOffset - d;
|
|
9824
9823
|
if (e < 0 || c.parent.textBetween(e, c.parentOffset) !== a[0].slice(0, d)) return;
|
|
9825
9824
|
}
|
|
9826
|
-
let f = s.state.tr, p =
|
|
9825
|
+
let f = s.state.tr, p = Qs({
|
|
9827
9826
|
state: s.state,
|
|
9828
9827
|
transaction: f
|
|
9829
9828
|
}), m = {
|
|
9830
9829
|
from: n - (a[0].length - i.length),
|
|
9831
9830
|
to: r
|
|
9832
|
-
}, { commands: h, chain: g, can: _ } = new
|
|
9831
|
+
}, { commands: h, chain: g, can: _ } = new $s({
|
|
9833
9832
|
editor: t,
|
|
9834
9833
|
state: p
|
|
9835
9834
|
});
|
|
@@ -9848,7 +9847,7 @@ function Sf(e) {
|
|
|
9848
9847
|
}), s.dispatch(f), l = !0);
|
|
9849
9848
|
}), l;
|
|
9850
9849
|
}
|
|
9851
|
-
function
|
|
9850
|
+
function wf(e) {
|
|
9852
9851
|
let { editor: t, rules: n } = e, r = new A({
|
|
9853
9852
|
state: {
|
|
9854
9853
|
init() {
|
|
@@ -9860,9 +9859,9 @@ function Cf(e) {
|
|
|
9860
9859
|
let c = e.getMeta("applyInputRules");
|
|
9861
9860
|
return c && setTimeout(() => {
|
|
9862
9861
|
let { text: e } = c;
|
|
9863
|
-
e = typeof e == "string" ? e :
|
|
9862
|
+
e = typeof e == "string" ? e : bl(s.from(e), a.schema);
|
|
9864
9863
|
let { from: i } = c, o = i + e.length;
|
|
9865
|
-
|
|
9864
|
+
Cf({
|
|
9866
9865
|
editor: t,
|
|
9867
9866
|
from: i,
|
|
9868
9867
|
to: o,
|
|
@@ -9875,7 +9874,7 @@ function Cf(e) {
|
|
|
9875
9874
|
},
|
|
9876
9875
|
props: {
|
|
9877
9876
|
handleTextInput(e, i, a, o) {
|
|
9878
|
-
return
|
|
9877
|
+
return Cf({
|
|
9879
9878
|
editor: t,
|
|
9880
9879
|
from: i,
|
|
9881
9880
|
to: a,
|
|
@@ -9886,7 +9885,7 @@ function Cf(e) {
|
|
|
9886
9885
|
},
|
|
9887
9886
|
handleDOMEvents: { compositionend: (e) => (setTimeout(() => {
|
|
9888
9887
|
let { $cursor: i } = e.state.selection;
|
|
9889
|
-
i &&
|
|
9888
|
+
i && Cf({
|
|
9890
9889
|
editor: t,
|
|
9891
9890
|
from: i.pos,
|
|
9892
9891
|
to: i.pos,
|
|
@@ -9898,7 +9897,7 @@ function Cf(e) {
|
|
|
9898
9897
|
handleKeyDown(e, i) {
|
|
9899
9898
|
if (i.key !== "Enter") return !1;
|
|
9900
9899
|
let { $cursor: a } = e.state.selection;
|
|
9901
|
-
return a ?
|
|
9900
|
+
return a ? Cf({
|
|
9902
9901
|
editor: t,
|
|
9903
9902
|
from: a.pos,
|
|
9904
9903
|
to: a.pos,
|
|
@@ -9912,7 +9911,7 @@ function Cf(e) {
|
|
|
9912
9911
|
});
|
|
9913
9912
|
return r;
|
|
9914
9913
|
}
|
|
9915
|
-
var
|
|
9914
|
+
var Tf = class {
|
|
9916
9915
|
constructor(e = {}) {
|
|
9917
9916
|
this.type = "extendable", this.parent = null, this.child = null, this.name = "", this.config = { name: this.name }, this.config = {
|
|
9918
9917
|
...this.config,
|
|
@@ -9931,7 +9930,7 @@ var wf = class {
|
|
|
9931
9930
|
configure(e = {}) {
|
|
9932
9931
|
let t = this.extend({
|
|
9933
9932
|
...this.config,
|
|
9934
|
-
addOptions: () =>
|
|
9933
|
+
addOptions: () => vf(this.options, e)
|
|
9935
9934
|
});
|
|
9936
9935
|
return t.name = this.name, t.parent = this.parent, this.child = null, t;
|
|
9937
9936
|
}
|
|
@@ -9942,7 +9941,7 @@ var wf = class {
|
|
|
9942
9941
|
});
|
|
9943
9942
|
return t.parent = this, this.child = t, t.name = "name" in e ? e.name : t.parent.name, t;
|
|
9944
9943
|
}
|
|
9945
|
-
},
|
|
9944
|
+
}, Ef = class e extends Tf {
|
|
9946
9945
|
constructor(...e) {
|
|
9947
9946
|
super(...e), this.type = "mark";
|
|
9948
9947
|
}
|
|
@@ -9967,20 +9966,20 @@ var wf = class {
|
|
|
9967
9966
|
let t = typeof e == "function" ? e() : e;
|
|
9968
9967
|
return super.extend(t);
|
|
9969
9968
|
}
|
|
9970
|
-
},
|
|
9969
|
+
}, Df = class {
|
|
9971
9970
|
constructor(e) {
|
|
9972
9971
|
this.find = e.find, this.handler = e.handler;
|
|
9973
9972
|
}
|
|
9974
|
-
},
|
|
9975
|
-
if (
|
|
9973
|
+
}, Of = (e, t, n) => {
|
|
9974
|
+
if (hc(t)) return [...e.matchAll(t)];
|
|
9976
9975
|
let r = t(e, n);
|
|
9977
9976
|
return r ? r.map((t) => {
|
|
9978
9977
|
let n = [t.text];
|
|
9979
9978
|
return n.index = t.index, n.input = e, n.data = t.data, t.replaceWith && (t.text.includes(t.replaceWith) || console.warn("[tiptap warn]: \"pasteRuleMatch.replaceWith\" must be part of \"pasteRuleMatch.text\"."), n.push(t.replaceWith)), n;
|
|
9980
9979
|
}) : [];
|
|
9981
9980
|
};
|
|
9982
|
-
function
|
|
9983
|
-
let { editor: t, state: n, from: r, to: i, rule: a, pasteEvent: o, dropEvent: s } = e, { commands: c, chain: l, can: u } = new
|
|
9981
|
+
function kf(e) {
|
|
9982
|
+
let { editor: t, state: n, from: r, to: i, rule: a, pasteEvent: o, dropEvent: s } = e, { commands: c, chain: l, can: u } = new $s({
|
|
9984
9983
|
editor: t,
|
|
9985
9984
|
state: n
|
|
9986
9985
|
}), d = [];
|
|
@@ -9988,7 +9987,7 @@ function Of(e) {
|
|
|
9988
9987
|
var f;
|
|
9989
9988
|
if ((f = e.type) != null && (f = f.spec) != null && f.code || !(e.isText || e.isTextblock || e.isInline)) return;
|
|
9990
9989
|
let p = e.content?.size ?? e.nodeSize ?? 0, m = Math.max(r, t), h = Math.min(i, t + p);
|
|
9991
|
-
m >= h ||
|
|
9990
|
+
m >= h || Of(e.isText ? e.text || "" : e.textBetween(m - t, h - t, void 0, ""), a.find, o).forEach((e) => {
|
|
9992
9991
|
if (e.index === void 0) return;
|
|
9993
9992
|
let t = m + e.index + 1, r = t + e[0].length, i = {
|
|
9994
9993
|
from: n.tr.mapping.map(t),
|
|
@@ -10007,12 +10006,12 @@ function Of(e) {
|
|
|
10007
10006
|
});
|
|
10008
10007
|
}), d.every((e) => e !== null);
|
|
10009
10008
|
}
|
|
10010
|
-
var
|
|
10009
|
+
var Af = null, jf = (e) => {
|
|
10011
10010
|
var t;
|
|
10012
10011
|
let n = new ClipboardEvent("paste", { clipboardData: new DataTransfer() });
|
|
10013
10012
|
return (t = n.clipboardData) == null || t.setData("text/html", e), n;
|
|
10014
10013
|
};
|
|
10015
|
-
function
|
|
10014
|
+
function Mf(e) {
|
|
10016
10015
|
let { editor: t, rules: n } = e, r = null, i = !1, a = !1, o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, c;
|
|
10017
10016
|
try {
|
|
10018
10017
|
c = typeof DragEvent < "u" ? new DragEvent("drop") : null;
|
|
@@ -10020,11 +10019,11 @@ function jf(e) {
|
|
|
10020
10019
|
c = null;
|
|
10021
10020
|
}
|
|
10022
10021
|
let l = ({ state: e, from: n, to: r, rule: i, pasteEvt: a }) => {
|
|
10023
|
-
let s = e.tr, l =
|
|
10022
|
+
let s = e.tr, l = Qs({
|
|
10024
10023
|
state: e,
|
|
10025
10024
|
transaction: s
|
|
10026
10025
|
});
|
|
10027
|
-
if (
|
|
10026
|
+
if (kf({
|
|
10028
10027
|
editor: t,
|
|
10029
10028
|
state: l,
|
|
10030
10029
|
from: Math.max(n - 1, 0),
|
|
@@ -10044,9 +10043,9 @@ function jf(e) {
|
|
|
10044
10043
|
return n.map((e) => new A({
|
|
10045
10044
|
view(e) {
|
|
10046
10045
|
let n = (n) => {
|
|
10047
|
-
r = e.dom.parentElement?.contains(n.target) ? e.dom.parentElement : null, r && (
|
|
10046
|
+
r = e.dom.parentElement?.contains(n.target) ? e.dom.parentElement : null, r && (Af = t);
|
|
10048
10047
|
}, i = () => {
|
|
10049
|
-
|
|
10048
|
+
Af &&= null;
|
|
10050
10049
|
};
|
|
10051
10050
|
return window.addEventListener("dragstart", n), window.addEventListener("dragend", i), { destroy() {
|
|
10052
10051
|
window.removeEventListener("dragstart", n), window.removeEventListener("dragend", i);
|
|
@@ -10055,7 +10054,7 @@ function jf(e) {
|
|
|
10055
10054
|
props: { handleDOMEvents: {
|
|
10056
10055
|
drop: (e, t) => {
|
|
10057
10056
|
if (a = r === e.dom.parentElement, c = t, !a) {
|
|
10058
|
-
let e =
|
|
10057
|
+
let e = Af;
|
|
10059
10058
|
e?.isEditable && setTimeout(() => {
|
|
10060
10059
|
let t = e.state.selection;
|
|
10061
10060
|
t && e.commands.deleteRange({
|
|
@@ -10076,8 +10075,8 @@ function jf(e) {
|
|
|
10076
10075
|
if (!u && !d && !p) return;
|
|
10077
10076
|
if (p) {
|
|
10078
10077
|
let { text: t } = f;
|
|
10079
|
-
t = typeof t == "string" ? t :
|
|
10080
|
-
let { from: n } = f, i = n + t.length, a =
|
|
10078
|
+
t = typeof t == "string" ? t : bl(s.from(t), r.schema);
|
|
10079
|
+
let { from: n } = f, i = n + t.length, a = jf(t);
|
|
10081
10080
|
return l({
|
|
10082
10081
|
rule: e,
|
|
10083
10082
|
state: r,
|
|
@@ -10087,7 +10086,7 @@ function jf(e) {
|
|
|
10087
10086
|
});
|
|
10088
10087
|
}
|
|
10089
10088
|
let m = n.doc.content.findDiffStart(r.doc.content), h = n.doc.content.findDiffEnd(r.doc.content);
|
|
10090
|
-
if (
|
|
10089
|
+
if (Bd(m) && h && m !== h.b) return l({
|
|
10091
10090
|
rule: e,
|
|
10092
10091
|
state: r,
|
|
10093
10092
|
from: m,
|
|
@@ -10097,9 +10096,9 @@ function jf(e) {
|
|
|
10097
10096
|
}
|
|
10098
10097
|
}));
|
|
10099
10098
|
}
|
|
10100
|
-
var
|
|
10099
|
+
var Nf = class {
|
|
10101
10100
|
constructor(e, t) {
|
|
10102
|
-
this.splittableMarks = [], this.nonClearableMarks = [], this.decorationManager = null, this.editor = t, this.baseExtensions = e, this.extensions =
|
|
10101
|
+
this.splittableMarks = [], this.nonClearableMarks = [], this.decorationManager = null, this.editor = t, this.baseExtensions = e, this.extensions = Il(e), this.schema = Nl(this.extensions, t), this.setupExtensions();
|
|
10103
10102
|
}
|
|
10104
10103
|
get commands() {
|
|
10105
10104
|
return this.extensions.reduce((e, t) => {
|
|
@@ -10108,7 +10107,7 @@ var Mf = class {
|
|
|
10108
10107
|
options: t.options,
|
|
10109
10108
|
storage: this.editor.extensionStorage[t.name],
|
|
10110
10109
|
editor: this.editor,
|
|
10111
|
-
type:
|
|
10110
|
+
type: $l(t.name, this.schema)
|
|
10112
10111
|
});
|
|
10113
10112
|
return n ? {
|
|
10114
10113
|
...e,
|
|
@@ -10117,15 +10116,15 @@ var Mf = class {
|
|
|
10117
10116
|
}, {});
|
|
10118
10117
|
}
|
|
10119
10118
|
get plugins() {
|
|
10120
|
-
let { editor: e } = this, t =
|
|
10119
|
+
let { editor: e } = this, t = Fl([...this.extensions].reverse()).flatMap((t) => {
|
|
10121
10120
|
let n = {
|
|
10122
10121
|
name: t.name,
|
|
10123
10122
|
options: t.options,
|
|
10124
10123
|
storage: this.editor.extensionStorage[t.name],
|
|
10125
10124
|
editor: e,
|
|
10126
|
-
type:
|
|
10125
|
+
type: $l(t.name, this.schema)
|
|
10127
10126
|
}, r = [], i = Z(t, "addKeyboardShortcuts", n), a = {};
|
|
10128
|
-
if (t.type === "mark" && Z(t, "exitable", n) && (a.ArrowRight = () =>
|
|
10127
|
+
if (t.type === "mark" && Z(t, "exitable", n) && (a.ArrowRight = () => Ef.handleExit({
|
|
10129
10128
|
editor: e,
|
|
10130
10129
|
mark: t
|
|
10131
10130
|
})), i) {
|
|
@@ -10135,13 +10134,13 @@ var Mf = class {
|
|
|
10135
10134
|
...t
|
|
10136
10135
|
};
|
|
10137
10136
|
}
|
|
10138
|
-
let o =
|
|
10137
|
+
let o = Xs(a);
|
|
10139
10138
|
r.push(o);
|
|
10140
10139
|
let s = Z(t, "addInputRules", n);
|
|
10141
|
-
if (
|
|
10140
|
+
if (ou(t, e.options.enableInputRules) && s) {
|
|
10142
10141
|
let t = s();
|
|
10143
10142
|
if (t && t.length) {
|
|
10144
|
-
let n =
|
|
10143
|
+
let n = wf({
|
|
10145
10144
|
editor: e,
|
|
10146
10145
|
rules: t
|
|
10147
10146
|
}), i = Array.isArray(n) ? n : [n];
|
|
@@ -10149,10 +10148,10 @@ var Mf = class {
|
|
|
10149
10148
|
}
|
|
10150
10149
|
}
|
|
10151
10150
|
let c = Z(t, "addPasteRules", n);
|
|
10152
|
-
if (
|
|
10151
|
+
if (ou(t, e.options.enablePasteRules) && c) {
|
|
10153
10152
|
let t = c();
|
|
10154
10153
|
if (t && t.length) {
|
|
10155
|
-
let n =
|
|
10154
|
+
let n = Mf({
|
|
10156
10155
|
editor: e,
|
|
10157
10156
|
rules: t
|
|
10158
10157
|
});
|
|
@@ -10179,22 +10178,22 @@ var Mf = class {
|
|
|
10179
10178
|
options: e.options,
|
|
10180
10179
|
storage: this.editor.extensionStorage[e.name],
|
|
10181
10180
|
editor: t,
|
|
10182
|
-
type:
|
|
10181
|
+
type: $l(e.name, this.schema)
|
|
10183
10182
|
});
|
|
10184
10183
|
r && n.push({
|
|
10185
10184
|
name: e.name,
|
|
10186
10185
|
addDecorations: r
|
|
10187
10186
|
});
|
|
10188
|
-
}), this.decorationManager = new
|
|
10187
|
+
}), this.decorationManager = new jd({
|
|
10189
10188
|
editor: t,
|
|
10190
10189
|
entries: n
|
|
10191
10190
|
}), this.decorationManager.plugin;
|
|
10192
10191
|
}
|
|
10193
10192
|
get attributes() {
|
|
10194
|
-
return
|
|
10193
|
+
return wl(this.extensions);
|
|
10195
10194
|
}
|
|
10196
10195
|
get nodeViews() {
|
|
10197
|
-
let { editor: e } = this, { nodeExtensions: t } =
|
|
10196
|
+
let { editor: e } = this, { nodeExtensions: t } = Cl(this.extensions);
|
|
10198
10197
|
return Object.fromEntries(t.filter((e) => !!Z(e, "addNodeView")).map((t) => {
|
|
10199
10198
|
let n = this.attributes.filter((e) => e.type === t.name), r = Z(t, "addNodeView", {
|
|
10200
10199
|
name: t.name,
|
|
@@ -10206,7 +10205,7 @@ var Mf = class {
|
|
|
10206
10205
|
if (!r) return [];
|
|
10207
10206
|
let i = r();
|
|
10208
10207
|
return i ? [t.name, (r, a, o, s, c) => {
|
|
10209
|
-
let l =
|
|
10208
|
+
let l = Ol(r, n);
|
|
10210
10209
|
return i({
|
|
10211
10210
|
node: r,
|
|
10212
10211
|
view: a,
|
|
@@ -10222,13 +10221,13 @@ var Mf = class {
|
|
|
10222
10221
|
}
|
|
10223
10222
|
dispatchTransaction(e) {
|
|
10224
10223
|
let { editor: t } = this;
|
|
10225
|
-
return
|
|
10224
|
+
return Fl([...this.extensions].reverse()).reduceRight((e, n) => {
|
|
10226
10225
|
let r = {
|
|
10227
10226
|
name: n.name,
|
|
10228
10227
|
options: n.options,
|
|
10229
10228
|
storage: this.editor.extensionStorage[n.name],
|
|
10230
10229
|
editor: t,
|
|
10231
|
-
type:
|
|
10230
|
+
type: $l(n.name, this.schema)
|
|
10232
10231
|
}, i = Z(n, "dispatchTransaction", r);
|
|
10233
10232
|
return i ? (t) => {
|
|
10234
10233
|
i.call(r, {
|
|
@@ -10240,13 +10239,13 @@ var Mf = class {
|
|
|
10240
10239
|
}
|
|
10241
10240
|
transformPastedHTML(e) {
|
|
10242
10241
|
let { editor: t } = this;
|
|
10243
|
-
return
|
|
10242
|
+
return Fl([...this.extensions]).reduce((e, n) => {
|
|
10244
10243
|
let r = {
|
|
10245
10244
|
name: n.name,
|
|
10246
10245
|
options: n.options,
|
|
10247
10246
|
storage: this.editor.extensionStorage[n.name],
|
|
10248
10247
|
editor: t,
|
|
10249
|
-
type:
|
|
10248
|
+
type: $l(n.name, this.schema)
|
|
10250
10249
|
}, i = Z(n, "transformPastedHTML", r);
|
|
10251
10250
|
return i ? (t, n) => {
|
|
10252
10251
|
let a = e(t, n);
|
|
@@ -10255,7 +10254,7 @@ var Mf = class {
|
|
|
10255
10254
|
}, e || ((e) => e));
|
|
10256
10255
|
}
|
|
10257
10256
|
get markViews() {
|
|
10258
|
-
let { editor: e } = this, { markExtensions: t } =
|
|
10257
|
+
let { editor: e } = this, { markExtensions: t } = Cl(this.extensions);
|
|
10259
10258
|
return Object.fromEntries(t.filter((e) => !!Z(e, "addMarkView")).map((t) => {
|
|
10260
10259
|
let n = this.attributes.filter((e) => e.type === t.name), r = Z(t, "addMarkView", {
|
|
10261
10260
|
name: t.name,
|
|
@@ -10265,7 +10264,7 @@ var Mf = class {
|
|
|
10265
10264
|
type: Y(t.name, this.schema)
|
|
10266
10265
|
});
|
|
10267
10266
|
return r ? [t.name, (i, a, o) => {
|
|
10268
|
-
let s =
|
|
10267
|
+
let s = Ol(i, n);
|
|
10269
10268
|
return r()({
|
|
10270
10269
|
mark: i,
|
|
10271
10270
|
view: a,
|
|
@@ -10274,7 +10273,7 @@ var Mf = class {
|
|
|
10274
10273
|
extension: t,
|
|
10275
10274
|
HTMLAttributes: s,
|
|
10276
10275
|
updateAttributes: (t) => {
|
|
10277
|
-
|
|
10276
|
+
yf(i, e, t);
|
|
10278
10277
|
}
|
|
10279
10278
|
});
|
|
10280
10279
|
}] : [];
|
|
@@ -10298,7 +10297,7 @@ var Mf = class {
|
|
|
10298
10297
|
options: e.options,
|
|
10299
10298
|
storage: this.editor.extensionStorage[e.name],
|
|
10300
10299
|
editor: this.editor,
|
|
10301
|
-
type:
|
|
10300
|
+
type: $l(e.name, this.schema)
|
|
10302
10301
|
};
|
|
10303
10302
|
e.type === "mark" && ((Q(Z(e, "keepOnSplit", t)) ?? !0) && this.splittableMarks.push(e.name), (Q(Z(e, "clearable", t)) ?? !0) || this.nonClearableMarks.push(e.name));
|
|
10304
10303
|
let n = Z(e, "onBeforeCreate", t), r = Z(e, "onCreate", t), i = Z(e, "onUpdate", t), a = Z(e, "onSelectionUpdate", t), o = Z(e, "onTransaction", t), s = Z(e, "onFocus", t), c = Z(e, "onBlur", t), l = Z(e, "onDestroy", t);
|
|
@@ -10306,8 +10305,8 @@ var Mf = class {
|
|
|
10306
10305
|
});
|
|
10307
10306
|
}
|
|
10308
10307
|
};
|
|
10309
|
-
|
|
10310
|
-
var $ = class e extends
|
|
10308
|
+
Nf.resolve = Il, Nf.sort = Fl, Nf.flatten = yl;
|
|
10309
|
+
var $ = class e extends Tf {
|
|
10311
10310
|
constructor(...e) {
|
|
10312
10311
|
super(...e), this.type = "extension";
|
|
10313
10312
|
}
|
|
@@ -10322,7 +10321,7 @@ var $ = class e extends wf {
|
|
|
10322
10321
|
let t = typeof e == "function" ? e() : e;
|
|
10323
10322
|
return super.extend(t);
|
|
10324
10323
|
}
|
|
10325
|
-
},
|
|
10324
|
+
}, Pf = $.create({
|
|
10326
10325
|
name: "clipboardTextSerializer",
|
|
10327
10326
|
addOptions() {
|
|
10328
10327
|
return { blockSeparator: void 0 };
|
|
@@ -10331,31 +10330,31 @@ var $ = class e extends wf {
|
|
|
10331
10330
|
return [new A({
|
|
10332
10331
|
key: new j("clipboardTextSerializer"),
|
|
10333
10332
|
props: { clipboardTextSerializer: () => {
|
|
10334
|
-
let { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: i } = t, a =
|
|
10333
|
+
let { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: i } = t, a = Hl(n), { blockSeparator: o } = this.options, s = {
|
|
10335
10334
|
...o === void 0 ? {} : { blockSeparator: o },
|
|
10336
10335
|
textSerializers: a
|
|
10337
10336
|
};
|
|
10338
|
-
return [...i.ranges].sort((e, t) => e.$from.pos - t.$from.pos).map(({ $from: e, $to: t }) =>
|
|
10337
|
+
return [...i.ranges].sort((e, t) => e.$from.pos - t.$from.pos).map(({ $from: e, $to: t }) => Bl(r, {
|
|
10339
10338
|
from: e.pos,
|
|
10340
10339
|
to: t.pos
|
|
10341
10340
|
}, s)).join(o ?? "\n\n");
|
|
10342
10341
|
} }
|
|
10343
10342
|
})];
|
|
10344
10343
|
}
|
|
10345
|
-
}),
|
|
10344
|
+
}), Ff = $.create({
|
|
10346
10345
|
name: "commands",
|
|
10347
10346
|
addCommands() {
|
|
10348
|
-
return { ...
|
|
10347
|
+
return { ...od };
|
|
10349
10348
|
}
|
|
10350
|
-
}),
|
|
10349
|
+
}), If = $.create({
|
|
10351
10350
|
name: "delete",
|
|
10352
10351
|
onUpdate({ transaction: e, appendedTransactions: t }) {
|
|
10353
10352
|
var n;
|
|
10354
10353
|
let r = () => {
|
|
10355
10354
|
var n, r;
|
|
10356
10355
|
if (((n = this.editor.options.coreExtensionOptions) == null || (n = n.delete) == null || (r = n.filterTransaction) == null ? void 0 : r.call(n, e)) ?? e.getMeta("y-sync$")) return;
|
|
10357
|
-
let i =
|
|
10358
|
-
|
|
10356
|
+
let i = ml(e.before, [e, ...t]);
|
|
10357
|
+
Jl(i).forEach((t) => {
|
|
10359
10358
|
i.mapping.mapResult(t.oldRange.from).deletedAfter && i.mapping.mapResult(t.oldRange.to).deletedBefore && i.before.nodesBetween(t.oldRange.from, t.oldRange.to, (n, r) => {
|
|
10360
10359
|
let a = r + n.nodeSize - 2, o = t.oldRange.from <= r && a <= t.oldRange.to;
|
|
10361
10360
|
this.editor.emit("delete", {
|
|
@@ -10401,7 +10400,7 @@ var $ = class e extends wf {
|
|
|
10401
10400
|
};
|
|
10402
10401
|
((n = this.editor.options.coreExtensionOptions) == null || (n = n.delete) == null ? void 0 : n.async) ?? !0 ? setTimeout(r, 0) : r();
|
|
10403
10402
|
}
|
|
10404
|
-
}),
|
|
10403
|
+
}), Lf = $.create({
|
|
10405
10404
|
name: "drop",
|
|
10406
10405
|
addProseMirrorPlugins() {
|
|
10407
10406
|
return [new A({
|
|
@@ -10416,7 +10415,7 @@ var $ = class e extends wf {
|
|
|
10416
10415
|
} }
|
|
10417
10416
|
})];
|
|
10418
10417
|
}
|
|
10419
|
-
}),
|
|
10418
|
+
}), Rf = $.create({
|
|
10420
10419
|
name: "editable",
|
|
10421
10420
|
addProseMirrorPlugins() {
|
|
10422
10421
|
return [new A({
|
|
@@ -10424,12 +10423,12 @@ var $ = class e extends wf {
|
|
|
10424
10423
|
props: { editable: () => this.editor.options.editable }
|
|
10425
10424
|
})];
|
|
10426
10425
|
}
|
|
10427
|
-
}),
|
|
10426
|
+
}), zf = new j("focusEvents"), Bf = $.create({
|
|
10428
10427
|
name: "focusEvents",
|
|
10429
10428
|
addProseMirrorPlugins() {
|
|
10430
10429
|
let { editor: e } = this;
|
|
10431
10430
|
return [new A({
|
|
10432
|
-
key:
|
|
10431
|
+
key: zf,
|
|
10433
10432
|
props: { handleDOMEvents: {
|
|
10434
10433
|
focus: (t, n) => {
|
|
10435
10434
|
e.isFocused = !0;
|
|
@@ -10444,7 +10443,7 @@ var $ = class e extends wf {
|
|
|
10444
10443
|
} }
|
|
10445
10444
|
})];
|
|
10446
10445
|
}
|
|
10447
|
-
}),
|
|
10446
|
+
}), Vf = $.create({
|
|
10448
10447
|
name: "keymap",
|
|
10449
10448
|
addKeyboardShortcuts() {
|
|
10450
10449
|
let e = () => this.editor.commands.first(({ commands: e }) => [
|
|
@@ -10486,7 +10485,7 @@ var $ = class e extends wf {
|
|
|
10486
10485
|
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
|
|
10487
10486
|
"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
|
|
10488
10487
|
};
|
|
10489
|
-
return
|
|
10488
|
+
return Tc() || qc() ? i : r;
|
|
10490
10489
|
},
|
|
10491
10490
|
addProseMirrorPlugins() {
|
|
10492
10491
|
return [new A({
|
|
@@ -10496,11 +10495,11 @@ var $ = class e extends wf {
|
|
|
10496
10495
|
let r = e.some((e) => e.docChanged) && !t.doc.eq(n.doc), i = e.some((e) => e.getMeta("preventClearDocument"));
|
|
10497
10496
|
if (!r || i) return;
|
|
10498
10497
|
let { empty: a, from: o, to: s } = t.selection, c = E.atStart(t.doc).from, l = E.atEnd(t.doc).to;
|
|
10499
|
-
if (a || o !== c || s !== l || !
|
|
10500
|
-
let u = n.tr, d =
|
|
10498
|
+
if (a || o !== c || s !== l || !cu(n.doc)) return;
|
|
10499
|
+
let u = n.tr, d = Qs({
|
|
10501
10500
|
state: n,
|
|
10502
10501
|
transaction: u
|
|
10503
|
-
}), { commands: f } = new
|
|
10502
|
+
}), { commands: f } = new $s({
|
|
10504
10503
|
editor: this.editor,
|
|
10505
10504
|
state: d
|
|
10506
10505
|
});
|
|
@@ -10508,7 +10507,7 @@ var $ = class e extends wf {
|
|
|
10508
10507
|
}
|
|
10509
10508
|
})];
|
|
10510
10509
|
}
|
|
10511
|
-
}),
|
|
10510
|
+
}), Hf = $.create({
|
|
10512
10511
|
name: "paste",
|
|
10513
10512
|
addProseMirrorPlugins() {
|
|
10514
10513
|
return [new A({
|
|
@@ -10522,7 +10521,7 @@ var $ = class e extends wf {
|
|
|
10522
10521
|
} }
|
|
10523
10522
|
})];
|
|
10524
10523
|
}
|
|
10525
|
-
}),
|
|
10524
|
+
}), Uf = $.create({
|
|
10526
10525
|
name: "tabindex",
|
|
10527
10526
|
addOptions() {
|
|
10528
10527
|
return { value: void 0 };
|
|
@@ -10533,14 +10532,14 @@ var $ = class e extends wf {
|
|
|
10533
10532
|
props: { attributes: () => !this.editor.isEditable && this.options.value === void 0 ? {} : { tabindex: this.options.value ?? "0" } }
|
|
10534
10533
|
})];
|
|
10535
10534
|
}
|
|
10536
|
-
}),
|
|
10535
|
+
}), Wf = $.create({
|
|
10537
10536
|
name: "textDirection",
|
|
10538
10537
|
addOptions() {
|
|
10539
10538
|
return { direction: void 0 };
|
|
10540
10539
|
},
|
|
10541
10540
|
addGlobalAttributes() {
|
|
10542
10541
|
if (!this.options.direction) return [];
|
|
10543
|
-
let { nodeExtensions: e } =
|
|
10542
|
+
let { nodeExtensions: e } = Cl(this.extensions);
|
|
10544
10543
|
return [{
|
|
10545
10544
|
types: e.filter((e) => e.name !== "text").map((e) => e.name),
|
|
10546
10545
|
attributes: { dir: {
|
|
@@ -10562,22 +10561,22 @@ var $ = class e extends wf {
|
|
|
10562
10561
|
} }
|
|
10563
10562
|
})];
|
|
10564
10563
|
}
|
|
10565
|
-
}),
|
|
10566
|
-
ClipboardTextSerializer: () =>
|
|
10567
|
-
Commands: () =>
|
|
10568
|
-
Delete: () =>
|
|
10569
|
-
Drop: () =>
|
|
10570
|
-
Editable: () =>
|
|
10571
|
-
FocusEvents: () =>
|
|
10572
|
-
Keymap: () =>
|
|
10573
|
-
Paste: () =>
|
|
10574
|
-
Tabindex: () =>
|
|
10575
|
-
TextDirection: () =>
|
|
10576
|
-
focusEventsPluginKey: () =>
|
|
10577
|
-
}),
|
|
10578
|
-
function
|
|
10579
|
-
if (
|
|
10580
|
-
|
|
10564
|
+
}), Gf = /* @__PURE__ */ t({
|
|
10565
|
+
ClipboardTextSerializer: () => Pf,
|
|
10566
|
+
Commands: () => Ff,
|
|
10567
|
+
Delete: () => If,
|
|
10568
|
+
Drop: () => Lf,
|
|
10569
|
+
Editable: () => Rf,
|
|
10570
|
+
FocusEvents: () => Bf,
|
|
10571
|
+
Keymap: () => Vf,
|
|
10572
|
+
Paste: () => Hf,
|
|
10573
|
+
Tabindex: () => Uf,
|
|
10574
|
+
TextDirection: () => Wf,
|
|
10575
|
+
focusEventsPluginKey: () => zf
|
|
10576
|
+
}), Kf = !1;
|
|
10577
|
+
function qf(e) {
|
|
10578
|
+
if (Kf) return;
|
|
10579
|
+
Kf = !0;
|
|
10581
10580
|
let t;
|
|
10582
10581
|
try {
|
|
10583
10582
|
t = w.fromJSON(e, {
|
|
@@ -10589,7 +10588,7 @@ function Kf(e) {
|
|
|
10589
10588
|
}
|
|
10590
10589
|
t instanceof s || console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.");
|
|
10591
10590
|
}
|
|
10592
|
-
var
|
|
10591
|
+
var Jf = class e {
|
|
10593
10592
|
get name() {
|
|
10594
10593
|
return this.node.type.name;
|
|
10595
10594
|
}
|
|
@@ -10711,7 +10710,7 @@ var qf = class e {
|
|
|
10711
10710
|
...e
|
|
10712
10711
|
}), this.editor.view.dispatch(t);
|
|
10713
10712
|
}
|
|
10714
|
-
},
|
|
10713
|
+
}, Yf = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}", Xf = class extends ud {
|
|
10715
10714
|
constructor(e = {}) {
|
|
10716
10715
|
super(), this.css = null, this.className = "tiptap", this.editorView = null, this.isFocused = !1, this.destroyed = !1, this.isInitialized = !1, this.extensionStorage = {}, this.instanceId = Math.random().toString(36).slice(2, 9), this.hasWarnedStaleDecorationRead = !1, this.options = {
|
|
10717
10716
|
element: typeof document < "u" ? document.createElement("div") : null,
|
|
@@ -10748,19 +10747,19 @@ var qf = class e {
|
|
|
10748
10747
|
onDelete: () => null,
|
|
10749
10748
|
enableExtensionDispatchTransaction: !0
|
|
10750
10749
|
}, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.utils = {
|
|
10751
|
-
getUpdatedPosition:
|
|
10752
|
-
createMappablePosition:
|
|
10750
|
+
getUpdatedPosition: Eu,
|
|
10751
|
+
createMappablePosition: Du
|
|
10753
10752
|
}, this.setOptions(e), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("mount", this.options.onMount), this.on("unmount", this.options.onUnmount), this.on("contentError", this.options.onContentError), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: e, slice: t, moved: n }) => this.options.onDrop(e, t, n)), this.on("paste", ({ event: e, slice: t }) => this.options.onPaste(e, t)), this.on("delete", this.options.onDelete);
|
|
10754
10753
|
let t = this.createDoc();
|
|
10755
10754
|
if (!this.editorState) {
|
|
10756
|
-
let e =
|
|
10755
|
+
let e = Cc(t, this.options.autofocus);
|
|
10757
10756
|
this.editorState = Pn.create({
|
|
10758
10757
|
doc: t,
|
|
10759
10758
|
schema: this.schema,
|
|
10760
10759
|
selection: e || void 0
|
|
10761
10760
|
});
|
|
10762
10761
|
}
|
|
10763
|
-
|
|
10762
|
+
qf(this.schema), this.options.element && this.mount(this.options.element);
|
|
10764
10763
|
}
|
|
10765
10764
|
mount(e) {
|
|
10766
10765
|
if (typeof document > "u") throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");
|
|
@@ -10788,13 +10787,13 @@ var qf = class e {
|
|
|
10788
10787
|
return this.commandManager.commands;
|
|
10789
10788
|
}
|
|
10790
10789
|
chain() {
|
|
10791
|
-
return this.commandManager ? this.commandManager.chain() :
|
|
10790
|
+
return this.commandManager ? this.commandManager.chain() : $s.createFakeChain();
|
|
10792
10791
|
}
|
|
10793
10792
|
can() {
|
|
10794
|
-
return this.commandManager ? this.commandManager.can() :
|
|
10793
|
+
return this.commandManager ? this.commandManager.can() : $s.createFallbackCan();
|
|
10795
10794
|
}
|
|
10796
10795
|
injectCSS() {
|
|
10797
|
-
this.options.injectCSS && typeof document < "u" && (this.css =
|
|
10796
|
+
this.options.injectCSS && typeof document < "u" && (this.css = Pd(Yf, this.options.injectNonce));
|
|
10798
10797
|
}
|
|
10799
10798
|
setOptions(e = {}) {
|
|
10800
10799
|
this.options = {
|
|
@@ -10833,10 +10832,10 @@ var qf = class e {
|
|
|
10833
10832
|
} });
|
|
10834
10833
|
}
|
|
10835
10834
|
get state() {
|
|
10836
|
-
return
|
|
10835
|
+
return dd && !this.hasWarnedStaleDecorationRead && ld(this) && (this.hasWarnedStaleDecorationRead = !0, console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")), this.editorView && (this.editorState = this.view.state), this.editorState;
|
|
10837
10836
|
}
|
|
10838
10837
|
registerPlugin(e, t) {
|
|
10839
|
-
let n =
|
|
10838
|
+
let n = xl(t) ? t(e, [...this.state.plugins]) : [...this.state.plugins, e], r = this.state.reconfigure({ plugins: n });
|
|
10840
10839
|
return this.view.updateState(r), r;
|
|
10841
10840
|
}
|
|
10842
10841
|
unregisterPlugin(e) {
|
|
@@ -10852,25 +10851,25 @@ var qf = class e {
|
|
|
10852
10851
|
createExtensionManager() {
|
|
10853
10852
|
var e, t;
|
|
10854
10853
|
let n = [...this.options.enableCoreExtensions ? [
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
zf,
|
|
10854
|
+
Rf,
|
|
10855
|
+
Pf.configure({ blockSeparator: (e = this.options.coreExtensionOptions) == null || (e = e.clipboardTextSerializer) == null ? void 0 : e.blockSeparator }),
|
|
10856
|
+
Ff,
|
|
10859
10857
|
Bf,
|
|
10860
|
-
Hf.configure({ value: (t = this.options.coreExtensionOptions) == null || (t = t.tabindex) == null ? void 0 : t.value }),
|
|
10861
|
-
If,
|
|
10862
10858
|
Vf,
|
|
10863
|
-
|
|
10864
|
-
|
|
10859
|
+
Uf.configure({ value: (t = this.options.coreExtensionOptions) == null || (t = t.tabindex) == null ? void 0 : t.value }),
|
|
10860
|
+
Lf,
|
|
10861
|
+
Hf,
|
|
10862
|
+
If,
|
|
10863
|
+
Wf.configure({ direction: this.options.textDirection })
|
|
10865
10864
|
].filter((e) => typeof this.options.enableCoreExtensions != "object" || this.options.enableCoreExtensions[e.name] !== !1) : [], ...this.options.extensions].filter((e) => [
|
|
10866
10865
|
"extension",
|
|
10867
10866
|
"node",
|
|
10868
10867
|
"mark"
|
|
10869
10868
|
].includes(e?.type));
|
|
10870
|
-
this.extensionManager = new
|
|
10869
|
+
this.extensionManager = new Nf(n, this);
|
|
10871
10870
|
}
|
|
10872
10871
|
createCommandManager() {
|
|
10873
|
-
this.commandManager = new
|
|
10872
|
+
this.commandManager = new $s({ editor: this });
|
|
10874
10873
|
}
|
|
10875
10874
|
createSchema() {
|
|
10876
10875
|
this.schema = this.extensionManager.schema;
|
|
@@ -10878,14 +10877,14 @@ var qf = class e {
|
|
|
10878
10877
|
createDoc() {
|
|
10879
10878
|
let e;
|
|
10880
10879
|
try {
|
|
10881
|
-
e =
|
|
10880
|
+
e = dl(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
|
|
10882
10881
|
} catch (e) {
|
|
10883
10882
|
if (!(e instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(e.message)) throw e;
|
|
10884
|
-
let t =
|
|
10883
|
+
let t = dl(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
|
|
10885
10884
|
return this.editorState = Pn.create({
|
|
10886
10885
|
doc: t,
|
|
10887
10886
|
schema: this.schema,
|
|
10888
|
-
selection:
|
|
10887
|
+
selection: Cc(t, this.options.autofocus) || void 0
|
|
10889
10888
|
}), this.emit("contentError", {
|
|
10890
10889
|
editor: this,
|
|
10891
10890
|
error: e,
|
|
@@ -10898,7 +10897,7 @@ var qf = class e {
|
|
|
10898
10897
|
}
|
|
10899
10898
|
createView(e) {
|
|
10900
10899
|
let { editorProps: t, enableExtensionDispatchTransaction: n } = this.options, r = t.dispatchTransaction || this.dispatchTransaction.bind(this), i = n ? this.extensionManager.dispatchTransaction(r) : r, a = t.transformPastedHTML, o = this.extensionManager.transformPastedHTML(a);
|
|
10901
|
-
this.editorView = new
|
|
10900
|
+
this.editorView = new js(e, {
|
|
10902
10901
|
...t,
|
|
10903
10902
|
attributes: {
|
|
10904
10903
|
role: "textbox",
|
|
@@ -10969,30 +10968,30 @@ var qf = class e {
|
|
|
10969
10968
|
});
|
|
10970
10969
|
}
|
|
10971
10970
|
getAttributes(e) {
|
|
10972
|
-
return
|
|
10971
|
+
return Gl(this.state, e);
|
|
10973
10972
|
}
|
|
10974
10973
|
isActive(e, t) {
|
|
10975
10974
|
let n = typeof e == "string" ? e : null, r = typeof e == "string" ? t : e;
|
|
10976
|
-
return
|
|
10975
|
+
return ru(this.state, n, r);
|
|
10977
10976
|
}
|
|
10978
10977
|
getJSON() {
|
|
10979
10978
|
return this.state.doc.toJSON();
|
|
10980
10979
|
}
|
|
10981
10980
|
getHTML() {
|
|
10982
|
-
return
|
|
10981
|
+
return bl(this.state.doc.content, this.schema);
|
|
10983
10982
|
}
|
|
10984
10983
|
getText(e) {
|
|
10985
10984
|
let { blockSeparator: t = "\n\n", textSerializers: n = {} } = e || {};
|
|
10986
|
-
return
|
|
10985
|
+
return Vl(this.state.doc, {
|
|
10987
10986
|
blockSeparator: t,
|
|
10988
10987
|
textSerializers: {
|
|
10989
|
-
...
|
|
10988
|
+
...Hl(this.schema),
|
|
10990
10989
|
...n
|
|
10991
10990
|
}
|
|
10992
10991
|
});
|
|
10993
10992
|
}
|
|
10994
10993
|
get isEmpty() {
|
|
10995
|
-
return
|
|
10994
|
+
return cu(this.state.doc);
|
|
10996
10995
|
}
|
|
10997
10996
|
destroy() {
|
|
10998
10997
|
this.destroyed || (this.destroyed = !0, this.emit("destroy"), this.unmount(), this.removeAllListeners(), this.extensionManager.destroy(), this.extensionManager = null, this.schema = null, this.commandManager = null, this.extensionStorage = {});
|
|
@@ -11008,23 +11007,23 @@ var qf = class e {
|
|
|
11008
11007
|
}
|
|
11009
11008
|
$pos(e) {
|
|
11010
11009
|
let t = this.state.doc.resolve(e), n = e > 0 && t.nodeAfter && !t.nodeAfter.isText && t.nodeAfter.isAtom ? t.nodeAfter : null;
|
|
11011
|
-
return new
|
|
11010
|
+
return new Jf(t, this, !1, n);
|
|
11012
11011
|
}
|
|
11013
11012
|
get $doc() {
|
|
11014
11013
|
return this.$pos(0);
|
|
11015
11014
|
}
|
|
11016
|
-
},
|
|
11015
|
+
}, Zf = class {
|
|
11017
11016
|
static Inline(e, t, n = {}, r) {
|
|
11018
|
-
return new
|
|
11017
|
+
return new Qf(e, t, n, r);
|
|
11019
11018
|
}
|
|
11020
11019
|
static Node(e, t, n = {}, r) {
|
|
11021
|
-
return new
|
|
11020
|
+
return new $f(e, t, n, r);
|
|
11022
11021
|
}
|
|
11023
11022
|
static Widget(e, t, n) {
|
|
11024
11023
|
let { key: r, ...i } = n;
|
|
11025
|
-
return new
|
|
11024
|
+
return new ep(e, t, r, i);
|
|
11026
11025
|
}
|
|
11027
|
-
},
|
|
11026
|
+
}, Qf = class extends Zf {
|
|
11028
11027
|
constructor(e, t, n = {}, r) {
|
|
11029
11028
|
super(), this.kind = "inline", this.from = e, this.to = t, this.attrs = n, this.spec = r;
|
|
11030
11029
|
}
|
|
@@ -11038,7 +11037,7 @@ var qf = class e {
|
|
|
11038
11037
|
} : this.spec;
|
|
11039
11038
|
return W.inline(this.from, this.to, this.attrs, t);
|
|
11040
11039
|
}
|
|
11041
|
-
},
|
|
11040
|
+
}, $f = class extends Zf {
|
|
11042
11041
|
constructor(e, t, n = {}, r) {
|
|
11043
11042
|
super(), this.kind = "node", this.from = e, this.to = t, this.attrs = n, this.spec = r;
|
|
11044
11043
|
}
|
|
@@ -11052,7 +11051,7 @@ var qf = class e {
|
|
|
11052
11051
|
} : this.spec;
|
|
11053
11052
|
return W.node(this.from, this.to, this.attrs, t);
|
|
11054
11053
|
}
|
|
11055
|
-
},
|
|
11054
|
+
}, ep = class extends Zf {
|
|
11056
11055
|
constructor(e, t, n, r) {
|
|
11057
11056
|
super(), this.kind = "widget", this.pos = e, this.render = t, this.key = n, this.spec = r;
|
|
11058
11057
|
}
|
|
@@ -11071,7 +11070,7 @@ var qf = class e {
|
|
|
11071
11070
|
return W.widget(this.pos, this.render, t);
|
|
11072
11071
|
}
|
|
11073
11072
|
};
|
|
11074
|
-
function
|
|
11073
|
+
function tp(e, t) {
|
|
11075
11074
|
let n = e, r = n[t];
|
|
11076
11075
|
if (!r) {
|
|
11077
11076
|
r = {
|
|
@@ -11087,7 +11086,7 @@ function ep(e, t) {
|
|
|
11087
11086
|
}
|
|
11088
11087
|
return r;
|
|
11089
11088
|
}
|
|
11090
|
-
function
|
|
11089
|
+
function np(e) {
|
|
11091
11090
|
e.flushScheduled = !1;
|
|
11092
11091
|
for (let [t, n] of e.pendingProps) {
|
|
11093
11092
|
let r = e.renderers.get(t);
|
|
@@ -11095,13 +11094,13 @@ function tp(e) {
|
|
|
11095
11094
|
}
|
|
11096
11095
|
e.pendingProps.clear();
|
|
11097
11096
|
}
|
|
11098
|
-
function
|
|
11099
|
-
let { editor: t, pos: n, key: r, props: i, cacheKey: a, context: o, create: s, materialize: c, side: l, relaxedSide: u, marks: d, stopEvent: f, ignoreSelection: p, destroy: m } = e, h =
|
|
11097
|
+
function rp(e) {
|
|
11098
|
+
let { editor: t, pos: n, key: r, props: i, cacheKey: a, context: o, create: s, materialize: c, side: l, relaxedSide: u, marks: d, stopEvent: f, ignoreSelection: p, destroy: m } = e, h = tp(t, a);
|
|
11100
11099
|
if (h.renderers.has(r)) {
|
|
11101
11100
|
let e = h.pendingProps.get(r) ?? h.props.get(r);
|
|
11102
|
-
(!e || !
|
|
11101
|
+
(!e || !Md(e, i)) && (h.pendingProps.set(r, i), h.flushScheduled || (h.flushScheduled = !0, queueMicrotask(() => np(h))));
|
|
11103
11102
|
}
|
|
11104
|
-
return
|
|
11103
|
+
return Zf.Widget(n, (e, t) => {
|
|
11105
11104
|
let n = {
|
|
11106
11105
|
...i,
|
|
11107
11106
|
...o(t)
|
|
@@ -11115,7 +11114,7 @@ function np(e) {
|
|
|
11115
11114
|
stopEvent: f,
|
|
11116
11115
|
ignoreSelection: p,
|
|
11117
11116
|
destroy: (e) => {
|
|
11118
|
-
if (!
|
|
11117
|
+
if (!Ad(t).has(r)) try {
|
|
11119
11118
|
var n;
|
|
11120
11119
|
(n = h.renderers.get(r)) == null || n.destroy(), h.renderers.delete(r), h.props.delete(r), h.pendingProps.delete(r);
|
|
11121
11120
|
} finally {
|
|
@@ -11124,8 +11123,8 @@ function np(e) {
|
|
|
11124
11123
|
}
|
|
11125
11124
|
});
|
|
11126
11125
|
}
|
|
11127
|
-
function
|
|
11128
|
-
return new
|
|
11126
|
+
function ip(e) {
|
|
11127
|
+
return new xf({
|
|
11129
11128
|
find: e.find,
|
|
11130
11129
|
handler: ({ state: t, range: n, match: r }) => {
|
|
11131
11130
|
let i = Q(e.getAttributes, void 0, r);
|
|
@@ -11133,7 +11132,7 @@ function rp(e) {
|
|
|
11133
11132
|
let { tr: a } = t, o = r[r.length - 1], s = r[0];
|
|
11134
11133
|
if (o) {
|
|
11135
11134
|
let r = s.search(/\S/), c = n.from + s.indexOf(o), l = c + o.length;
|
|
11136
|
-
if (
|
|
11135
|
+
if (Xl(n.from, n.to, t.doc).filter((t) => t.mark.type.excluded.find((n) => n === e.type && n !== t.mark.type)).filter((e) => e.to > c).length) return null;
|
|
11137
11136
|
l < n.to && a.delete(l, n.to), c > n.from && a.delete(n.from + r, c);
|
|
11138
11137
|
let u = n.from + r + o.length;
|
|
11139
11138
|
a.addMark(n.from + r, u, e.type.create(i || {})), a.removeStoredMark(e.type);
|
|
@@ -11142,8 +11141,8 @@ function rp(e) {
|
|
|
11142
11141
|
undoable: e.undoable
|
|
11143
11142
|
});
|
|
11144
11143
|
}
|
|
11145
|
-
function
|
|
11146
|
-
return new
|
|
11144
|
+
function ap(e) {
|
|
11145
|
+
return new xf({
|
|
11147
11146
|
find: e.find,
|
|
11148
11147
|
handler: ({ state: t, range: n, match: r }) => {
|
|
11149
11148
|
let i = Q(e.getAttributes, void 0, r) || {}, { tr: a } = t, o = n.from, s = n.to, c = e.type.create(i);
|
|
@@ -11161,8 +11160,8 @@ function ip(e) {
|
|
|
11161
11160
|
undoable: e.undoable
|
|
11162
11161
|
});
|
|
11163
11162
|
}
|
|
11164
|
-
function
|
|
11165
|
-
return new
|
|
11163
|
+
function op(e) {
|
|
11164
|
+
return new xf({
|
|
11166
11165
|
find: e.find,
|
|
11167
11166
|
handler: ({ state: t, range: n, match: r }) => {
|
|
11168
11167
|
let i = t.doc.resolve(n.from), a = Q(e.getAttributes, void 0, r) || {};
|
|
@@ -11172,8 +11171,8 @@ function ap(e) {
|
|
|
11172
11171
|
undoable: e.undoable
|
|
11173
11172
|
});
|
|
11174
11173
|
}
|
|
11175
|
-
function
|
|
11176
|
-
return new
|
|
11174
|
+
function sp(e) {
|
|
11175
|
+
return new xf({
|
|
11177
11176
|
find: e.find,
|
|
11178
11177
|
handler: ({ state: t, range: n, match: r }) => {
|
|
11179
11178
|
let i = e.replace, a = n.from, o = n.to;
|
|
@@ -11188,8 +11187,8 @@ function op(e) {
|
|
|
11188
11187
|
undoable: e.undoable
|
|
11189
11188
|
});
|
|
11190
11189
|
}
|
|
11191
|
-
function
|
|
11192
|
-
return new
|
|
11190
|
+
function cp(e) {
|
|
11191
|
+
return new xf({
|
|
11193
11192
|
find: e.find,
|
|
11194
11193
|
handler: ({ state: t, range: n, match: r, chain: i }) => {
|
|
11195
11194
|
let a = Q(e.getAttributes, void 0, r) || {}, o = t.tr.delete(n.from, n.to), s = o.doc.resolve(n.from).blockRange(), c = s && jt(s, e.type, a);
|
|
@@ -11211,49 +11210,49 @@ function sp(e) {
|
|
|
11211
11210
|
undoable: e.undoable
|
|
11212
11211
|
});
|
|
11213
11212
|
}
|
|
11214
|
-
var
|
|
11215
|
-
function up(e) {
|
|
11216
|
-
let t = e;
|
|
11217
|
-
return cp.add(t), t;
|
|
11218
|
-
}
|
|
11213
|
+
var lp = /* @__PURE__ */ new WeakSet(), up = /* @__PURE__ */ new WeakSet();
|
|
11219
11214
|
function dp(e) {
|
|
11220
|
-
|
|
11215
|
+
let t = e;
|
|
11216
|
+
return lp.add(t), t;
|
|
11221
11217
|
}
|
|
11222
11218
|
function fp(e) {
|
|
11223
|
-
return
|
|
11219
|
+
return Array.isArray(e) && lp.has(e);
|
|
11224
11220
|
}
|
|
11225
11221
|
function pp(e) {
|
|
11226
|
-
return
|
|
11222
|
+
return e.flatMap((e) => e == null ? [] : Array.isArray(e) && up.has(e) && !fp(e) ? pp(e) : [e]);
|
|
11227
11223
|
}
|
|
11228
|
-
function mp(e
|
|
11224
|
+
function mp(e) {
|
|
11225
|
+
return up.add(e.children), e.children;
|
|
11226
|
+
}
|
|
11227
|
+
function hp(e, t) {
|
|
11229
11228
|
if (e === "slot") return 0;
|
|
11230
11229
|
if (e instanceof Function) {
|
|
11231
11230
|
let n = e(t);
|
|
11232
|
-
return Array.isArray(n) && !
|
|
11231
|
+
return Array.isArray(n) && !fp(n) && !up.has(n) ? dp(n) : n;
|
|
11233
11232
|
}
|
|
11234
11233
|
let { children: n, ...r } = t ?? {};
|
|
11235
11234
|
if (e === "svg") throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");
|
|
11236
11235
|
if (Array.isArray(n)) {
|
|
11237
|
-
if (
|
|
11236
|
+
if (fp(n)) return dp([
|
|
11238
11237
|
e,
|
|
11239
11238
|
r,
|
|
11240
11239
|
n
|
|
11241
11240
|
]);
|
|
11242
|
-
if (n.length === 0) return
|
|
11243
|
-
let t =
|
|
11244
|
-
return t.length === 0 ?
|
|
11241
|
+
if (n.length === 0) return dp([e, r]);
|
|
11242
|
+
let t = pp(n);
|
|
11243
|
+
return t.length === 0 ? dp([e, r]) : dp([
|
|
11245
11244
|
e,
|
|
11246
11245
|
r,
|
|
11247
11246
|
...t
|
|
11248
11247
|
]);
|
|
11249
11248
|
}
|
|
11250
|
-
return
|
|
11249
|
+
return dp(n == null ? [e, r] : [
|
|
11251
11250
|
e,
|
|
11252
11251
|
r,
|
|
11253
11252
|
n
|
|
11254
11253
|
]);
|
|
11255
11254
|
}
|
|
11256
|
-
var
|
|
11255
|
+
var gp = (e, t) => hp(e, t), _p = (e) => "touches" in e, vp = class {
|
|
11257
11256
|
constructor(e) {
|
|
11258
11257
|
var t;
|
|
11259
11258
|
this.directions = [
|
|
@@ -11343,7 +11342,7 @@ var hp = (e, t) => mp(e, t), gp = (e) => "touches" in e, _p = class {
|
|
|
11343
11342
|
e ? (this.element.style.width = `${e}px`, this.initialWidth = e) : this.initialWidth = this.element.offsetWidth, t ? (this.element.style.height = `${t}px`, this.initialHeight = t) : this.initialHeight = this.element.offsetHeight, this.initialWidth > 0 && this.initialHeight > 0 && (this.aspectRatio = this.initialWidth / this.initialHeight);
|
|
11344
11343
|
}
|
|
11345
11344
|
handleResizeStart(e, t) {
|
|
11346
|
-
e.preventDefault(), e.stopPropagation(), this.isResizing = !0, this.activeHandle = t,
|
|
11345
|
+
e.preventDefault(), e.stopPropagation(), this.isResizing = !0, this.activeHandle = t, _p(e) ? (this.startX = e.touches[0].clientX, this.startY = e.touches[0].clientY) : (this.startX = e.clientX, this.startY = e.clientY), this.startWidth = this.element.offsetWidth, this.startHeight = this.element.offsetHeight, this.startWidth > 0 && this.startHeight > 0 && (this.aspectRatio = this.startWidth / this.startHeight), this.getPos(), this.container.dataset.resizeState = "true", this.classNames.resizing && this.container.classList.add(this.classNames.resizing), document.addEventListener("mousemove", this.handleMouseMove), document.addEventListener("touchmove", this.handleTouchMove), document.addEventListener("mouseup", this.handleMouseUp), document.addEventListener("keydown", this.handleKeyDown), document.addEventListener("keyup", this.handleKeyUp);
|
|
11347
11346
|
}
|
|
11348
11347
|
handleResize(e, t) {
|
|
11349
11348
|
if (!this.activeHandle) return;
|
|
@@ -11383,7 +11382,7 @@ var hp = (e, t) => mp(e, t), gp = (e) => "touches" in e, _p = class {
|
|
|
11383
11382
|
height: e / this.aspectRatio
|
|
11384
11383
|
};
|
|
11385
11384
|
}
|
|
11386
|
-
},
|
|
11385
|
+
}, yp = vp, bp = class e extends Tf {
|
|
11387
11386
|
constructor(...e) {
|
|
11388
11387
|
super(...e), this.type = "node";
|
|
11389
11388
|
}
|
|
@@ -11398,7 +11397,7 @@ var hp = (e, t) => mp(e, t), gp = (e) => "touches" in e, _p = class {
|
|
|
11398
11397
|
let t = typeof e == "function" ? e() : e;
|
|
11399
11398
|
return super.extend(t);
|
|
11400
11399
|
}
|
|
11401
|
-
},
|
|
11400
|
+
}, xp = class {
|
|
11402
11401
|
constructor(e, t, n) {
|
|
11403
11402
|
this.isDragging = !1, this.component = e, this.editor = t.editor, this.options = {
|
|
11404
11403
|
stopEvent: null,
|
|
@@ -11475,7 +11474,7 @@ var hp = (e, t) => mp(e, t), gp = (e) => "touches" in e, _p = class {
|
|
|
11475
11474
|
return !(o || r || i || l || u || d || f && c);
|
|
11476
11475
|
}
|
|
11477
11476
|
ignoreMutation(e) {
|
|
11478
|
-
return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : this.node.isLeaf || this.node.isAtom ? !0 : e.type === "selection" || this.contentDOM.contains(e.target) && e.type === "childList" && (
|
|
11477
|
+
return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : this.node.isLeaf || this.node.isAtom ? !0 : e.type === "selection" || this.contentDOM.contains(e.target) && e.type === "childList" && (Tc() || wc()) && this.editor.isFocused && [...Array.from(e.addedNodes), ...Array.from(e.removedNodes)].every((e) => e.isContentEditable) ? !1 : this.contentDOM === e.target && e.type === "attributes" || !this.contentDOM.contains(e.target);
|
|
11479
11478
|
}
|
|
11480
11479
|
updateAttributes(e) {
|
|
11481
11480
|
this.editor.commands.command(({ tr: t }) => {
|
|
@@ -11496,8 +11495,8 @@ var hp = (e, t) => mp(e, t), gp = (e) => "touches" in e, _p = class {
|
|
|
11496
11495
|
});
|
|
11497
11496
|
}
|
|
11498
11497
|
};
|
|
11499
|
-
function
|
|
11500
|
-
return new
|
|
11498
|
+
function Sp(e) {
|
|
11499
|
+
return new Df({
|
|
11501
11500
|
find: e.find,
|
|
11502
11501
|
handler: ({ state: t, range: n, match: r, pasteEvent: i }) => {
|
|
11503
11502
|
let a = Q(e.getAttributes, void 0, r, i);
|
|
@@ -11505,14 +11504,14 @@ function xp(e) {
|
|
|
11505
11504
|
let { tr: o } = t, s = r[r.length - 1], c = r[0], l = n.to;
|
|
11506
11505
|
if (s) {
|
|
11507
11506
|
let i = c.search(/\S/), u = n.from + c.indexOf(s), d = u + s.length;
|
|
11508
|
-
if (
|
|
11507
|
+
if (Xl(n.from, n.to, t.doc).filter((t) => t.mark.type.excluded.find((n) => n === e.type && n !== t.mark.type)).filter((e) => e.to > u).length) return null;
|
|
11509
11508
|
d < n.to && o.delete(d, n.to), u > n.from && o.delete(n.from + i, u), l = n.from + i + s.length, o.addMark(n.from + i, l, e.type.create(a || {})), r.index !== void 0 && r.input !== void 0 && r.index + r[0].length >= r.input.length || o.removeStoredMark(e.type);
|
|
11510
11509
|
}
|
|
11511
11510
|
}
|
|
11512
11511
|
});
|
|
11513
11512
|
}
|
|
11514
|
-
function
|
|
11515
|
-
return new
|
|
11513
|
+
function Cp(e) {
|
|
11514
|
+
return new Df({
|
|
11516
11515
|
find: e.find,
|
|
11517
11516
|
handler({ match: t, chain: n, range: r, pasteEvent: i }) {
|
|
11518
11517
|
let a = Q(e.getAttributes, void 0, t, i), o = Q(e.getContent, void 0, a);
|
|
@@ -11525,8 +11524,8 @@ function Sp(e) {
|
|
|
11525
11524
|
}
|
|
11526
11525
|
});
|
|
11527
11526
|
}
|
|
11528
|
-
function
|
|
11529
|
-
return new
|
|
11527
|
+
function wp(e) {
|
|
11528
|
+
return new Df({
|
|
11530
11529
|
find: e.find,
|
|
11531
11530
|
handler: ({ state: t, range: n, match: r }) => {
|
|
11532
11531
|
let i = e.replace, a = n.from, o = n.to;
|
|
@@ -11540,7 +11539,7 @@ function Cp(e) {
|
|
|
11540
11539
|
}
|
|
11541
11540
|
});
|
|
11542
11541
|
}
|
|
11543
|
-
var
|
|
11542
|
+
var Tp = class {
|
|
11544
11543
|
constructor(e) {
|
|
11545
11544
|
this.transaction = e, this.currentStep = this.transaction.steps.length;
|
|
11546
11545
|
}
|
|
@@ -11556,4 +11555,4 @@ var wp = class {
|
|
|
11556
11555
|
}
|
|
11557
11556
|
};
|
|
11558
11557
|
//#endregion
|
|
11559
|
-
export {
|
|
11558
|
+
export { Ul as $, yu as $t, Qs as A, Au as An, wc as At, jc as B, Zs as Bn, Xc as Bt, Md as C, df as Cn, tu as Ct, od as D, mf as Dn, Al as Dt, ml as E, Kl as En, gp as Et, Pd as F, sp as Fn, zd as Ft, gl as G, j as Gn, Hd as Gt, Fd as H, G as Hn, lu as Ht, rp as I, wp as In, xl as It, _l as J, _t as Jn, mu as Jt, Pl as K, E as Kn, fu as Kt, Ld as L, op as Ln, su as Lt, uf as M, af as Mn, au as Mt, Du as N, Fl as Nn, Sl as Nt, of as O, Il as On, wf as Ot, Nc as P, Cl as Pn, ou as Pt, zl as Q, vu as Qt, Lc as R, yf as Rn, qc as Rt, ep as S, rf as Sn, Bl as St, Nd as T, Ou as Tn, Eu as Tt, Gf as U, O as Un, uu as Ut, Rd as V, W as Vn, cu as Vt, hl as W, A as Wn, Bd as Wt, kl as X, s as Xn, gu as Xt, yl as Y, Yt as Yn, hu as Yt, Rl as Z, p as Zn, _u as Zt, xp as _, vf as _n, $l as _t, Xf as a, wu as an, bl as at, yp as b, Cp as bn, Id as bt, mp as c, Ud as cn, Y as ct, Tu as d, Ad as dn, Wl as dt, bu as en, Gl as et, Ef as f, ip as fn, J as ft, Jf as g, Dl as gn, Nl as gt, $f as h, _f as hn, Ll as ht, jd as i, du as in, Z as it, dl as j, Fc as jn, iu as jt, sf as k, Cc as kn, ru as kt, Qf as l, Sc as ln, Xl as lt, bp as m, hf as mn, Ol as mt, nd as n, Su as nn, Jl as nt, Tf as o, hc as on, pl as ot, bf as p, Sp as pn, Ql as pt, vl as q, D as qn, pu as qt, Zf as r, Cu as rn, Yl as rt, $ as s, Ec as sn, yc as st, $s as t, xu as tn, wl as tt, xf as u, Tc as un, Zl as ut, Df as v, X as vn, tl as vt, Q as w, Mf as wn, Hl as wt, Tp as x, gc as xn, Vl as xt, vp as y, ap as yn, eu as yt, nl as z, cp as zn, nu as zt };
|