@templatical/editor 0.25.2 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatSidebar-JLsbPnsH.js → AiChatSidebar-c-3yyjN1.js} +8 -8
- package/dist/{AiFeatureMenu-BvA-lViN.js → AiFeatureMenu-B-COyG7k.js} +4 -4
- package/dist/{BlockIssueBadge-Cf0-GC3o.js → BlockIssueBadge-Buk3_6QF.js} +2 -2
- package/dist/{BlockPreviewCanvas-CnJIM5TO.js → BlockPreviewCanvas-CJPHGI93.js} +1 -1
- package/dist/{CloudEditor-Caq7z4-7.js → CloudEditor-BdSQ8hfv.js} +19 -19
- package/dist/{CollaboratorBar-BFz4LgA0.js → CollaboratorBar-mGoi6yye.js} +2 -2
- package/dist/{ColorPicker-B5xXWWX5.js → ColorPicker-ClETsjA3.js} +1 -1
- package/dist/{CommentsSidebar-CGihWwn9.js → CommentsSidebar-CdRCCSDD.js} +10 -10
- package/dist/{CountdownToolbar-DpNCZAUI.js → CountdownToolbar-CBE9wRaV.js} +2 -2
- package/dist/{DesignReferenceSidebar-CiIHHiil.js → DesignReferenceSidebar-CgYkySre.js} +6 -6
- package/dist/{IssuesPanel-CUkmAC_S.js → IssuesPanel-Do7RLXsP.js} +5 -5
- package/dist/{MergeTagModeToggle-C6nS3qri.js → MergeTagModeToggle-hAJgIKhw.js} +3 -3
- package/dist/{MergeTagSuggestion-98fAcuM-.js → MergeTagSuggestion-BJ43ihWR.js} +9 -9
- package/dist/{NumberWithSuffix-DB-1GNvx.js → NumberWithSuffix-D37ZWiZh.js} +1 -1
- package/dist/{ParagraphEditor-NgW-T9YV.js → ParagraphEditor-DBG63S70.js} +19 -19
- package/dist/{RichTextEditorContent-CN7OVR6u.js → RichTextEditorContent-fbYJXAio.js} +3 -3
- package/dist/{SaveBlockDialog-lgcmhAsO.js → SaveBlockDialog-Dq9UVihi.js} +6 -6
- package/dist/{SavedBlocksBrowserModal-3u247V2z.js → SavedBlocksBrowserModal-CtFG4zeV.js} +7 -7
- package/dist/{SavedBlocksPanels-Dh6dABJt.js → SavedBlocksPanels-DNVdso_W.js} +1 -1
- package/dist/{SavedBlocksPickBar-Bo82D3Qy.js → SavedBlocksPickBar-Cv4dIpP-.js} +2 -2
- package/dist/{SnapshotHistory-Dsb1i40w.js → SnapshotHistory-DsOtMHOV.js} +11 -11
- package/dist/{TemplateScoringPanel-Bzd_YSag.js → TemplateScoringPanel-BZUsb3FD.js} +10 -10
- package/dist/{TestEmailModal-DvqDTOcO.js → TestEmailModal-CIwqtGfr.js} +7 -7
- package/dist/{TestEmailPanel-BXoVnAqu.js → TestEmailPanel-l6LDmBGM.js} +1 -1
- package/dist/{TitleEditor-DWSi998C.js → TitleEditor-imoBUynh.js} +8 -8
- package/dist/{TplModal-DKn0h2qe.js → TplModal-DDDHcoir.js} +1 -1
- package/dist/{blockTypeIcons-DKlza6aR.js → blockTypeIcons-CfLN4A6t.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiChatSidebar-BY1Iy-e8.js → AiChatSidebar-BHqNxNcX.js} +35 -35
- package/dist/cdn/chunks/{AiChatSidebar-BY1Iy-e8.js.map → AiChatSidebar-BHqNxNcX.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-BS4Rek6j.js → AiFeatureMenu-D2AIDwEG.js} +11 -11
- package/dist/cdn/chunks/{AiFeatureMenu-BS4Rek6j.js.map → AiFeatureMenu-D2AIDwEG.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-BcIQUe_Q.js → BlockIssueBadge-BEEY9o2o.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-BcIQUe_Q.js.map → BlockIssueBadge-BEEY9o2o.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-oND1iXLL.js → BlockPreviewCanvas-DH5ULGkw.js} +22 -22
- package/dist/cdn/chunks/{BlockPreviewCanvas-oND1iXLL.js.map → BlockPreviewCanvas-DH5ULGkw.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-BaqiFbf0.js → CloudEditor-C0nB1JfD.js} +65 -65
- package/dist/cdn/chunks/{CloudEditor-BaqiFbf0.js.map → CloudEditor-C0nB1JfD.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-DF02nTwF.js → CollaboratorBar-f6Ni7KNH.js} +12 -12
- package/dist/cdn/chunks/{CollaboratorBar-DF02nTwF.js.map → CollaboratorBar-f6Ni7KNH.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-BXH44v2H.js → ColorPicker-W_UyiVGc.js} +131 -131
- package/dist/cdn/chunks/{ColorPicker-BXH44v2H.js.map → ColorPicker-W_UyiVGc.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-B9bWvvbl.js → CommentsSidebar-BLRZRSSC.js} +112 -112
- package/dist/cdn/chunks/{CommentsSidebar-B9bWvvbl.js.map → CommentsSidebar-BLRZRSSC.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-BTpRd0Hn.js → CountdownBlock-vLTkTI9e.js} +11 -11
- package/dist/cdn/chunks/{CountdownBlock-BTpRd0Hn.js.map → CountdownBlock-vLTkTI9e.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CW10rbWt.js → CountdownToolbar-DPjcgcVR.js} +41 -41
- package/dist/cdn/chunks/{CountdownToolbar-CW10rbWt.js.map → CountdownToolbar-DPjcgcVR.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-BXjH47QC.js → DesignReferenceSidebar-DBoEBKxQ.js} +28 -28
- package/dist/cdn/chunks/{DesignReferenceSidebar-BXjH47QC.js.map → DesignReferenceSidebar-DBoEBKxQ.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-DStHCHfr.js → IssuesPanel-DKTS4QVb.js} +32 -32
- package/dist/cdn/chunks/{IssuesPanel-DStHCHfr.js.map → IssuesPanel-DKTS4QVb.js.map} +1 -1
- package/dist/cdn/chunks/{LoadingTrack-DQowK3MV.js → LoadingTrack-C52ZGL5q.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-DQowK3MV.js.map → LoadingTrack-C52ZGL5q.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-BCmQg4Qe.js → MergeTagModeToggle-D8iKvz7v.js} +20 -20
- package/dist/cdn/chunks/{MergeTagModeToggle-BCmQg4Qe.js.map → MergeTagModeToggle-D8iKvz7v.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagSuggestion-BgExdloL.js → MergeTagSuggestion-Dn8dExNa.js} +18 -18
- package/dist/cdn/chunks/{MergeTagSuggestion-BgExdloL.js.map → MergeTagSuggestion-Dn8dExNa.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-BANVbpT0.js → NumberWithSuffix-BXrRdfq1.js} +22 -22
- package/dist/cdn/chunks/{NumberWithSuffix-BANVbpT0.js.map → NumberWithSuffix-BXrRdfq1.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DqilB4_f.js → ParagraphEditor-Cuc83Blj.js} +43 -43
- package/dist/cdn/chunks/{ParagraphEditor-DqilB4_f.js.map → ParagraphEditor-Cuc83Blj.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-BeJx4LVH.js → RichTextEditorContent-DtL49Jpo.js} +20 -20
- package/dist/cdn/chunks/{RichTextEditorContent-BeJx4LVH.js.map → RichTextEditorContent-DtL49Jpo.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-Dm31xRZy.js → SaveBlockDialog-B8KHhVkI.js} +43 -43
- package/dist/cdn/chunks/{SaveBlockDialog-Dm31xRZy.js.map → SaveBlockDialog-B8KHhVkI.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-Tp37b4y7.js → SavedBlocksBrowserModal-B-sjsIJv.js} +62 -62
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-Tp37b4y7.js.map → SavedBlocksBrowserModal-B-sjsIJv.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-ElerTTa_.js → SavedBlocksPanels-Bb-eDMAh.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPanels-ElerTTa_.js.map → SavedBlocksPanels-Bb-eDMAh.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-QHJ-Mjx0.js → SavedBlocksPickBar-GudFfXa4.js} +12 -12
- package/dist/cdn/chunks/{SavedBlocksPickBar-QHJ-Mjx0.js.map → SavedBlocksPickBar-GudFfXa4.js.map} +1 -1
- package/dist/cdn/chunks/{SnapshotHistory-jogWGLB-.js → SnapshotHistory-Srpzt2na.js} +26 -26
- package/dist/cdn/chunks/{SnapshotHistory-jogWGLB-.js.map → SnapshotHistory-Srpzt2na.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-B2XIOTl-.js → TemplateScoringPanel-NucRtAP0.js} +34 -34
- package/dist/cdn/chunks/{TemplateScoringPanel-B2XIOTl-.js.map → TemplateScoringPanel-NucRtAP0.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-BcPjQygV.js → TestEmailModal-DLeoJqaJ.js} +31 -31
- package/dist/cdn/chunks/{TestEmailModal-BcPjQygV.js.map → TestEmailModal-DLeoJqaJ.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-1zxRa00s.js → TestEmailPanel-Dr7Dkq2P.js} +3 -3
- package/dist/cdn/chunks/{TestEmailPanel-1zxRa00s.js.map → TestEmailPanel-Dr7Dkq2P.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DTrmublj.js → TitleEditor-DzYRr18C.js} +35 -35
- package/dist/cdn/chunks/{TitleEditor-DTrmublj.js.map → TitleEditor-DzYRr18C.js.map} +1 -1
- package/dist/cdn/chunks/{TplModal-By50gtwa.js → TplModal-byw7-3wg.js} +17 -17
- package/dist/cdn/chunks/{TplModal-By50gtwa.js.map → TplModal-byw7-3wg.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-BhFhHuFt.js → blockTypeIcons-FXlMM3PL.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-BhFhHuFt.js.map → blockTypeIcons-FXlMM3PL.js.map} +1 -1
- package/dist/cdn/chunks/{cloud-B0f7Ub8f.js → cloud-CuItCnN_.js} +3 -3
- package/dist/cdn/chunks/{cloud-B0f7Ub8f.js.map → cloud-CuItCnN_.js.map} +1 -1
- package/dist/cdn/chunks/{dist-H51neg3K.js → dist-B2HKGHnc.js} +3 -3
- package/dist/cdn/chunks/{dist-H51neg3K.js.map → dist-B2HKGHnc.js.map} +1 -1
- package/dist/cdn/chunks/{dist-B4VIlp1g.js → dist-C6z8AjBC.js} +2 -2
- package/dist/cdn/chunks/{dist-B4VIlp1g.js.map → dist-C6z8AjBC.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-Z4XXmbPC.js → draggable-DCs9qL-b.js} +2 -2
- package/dist/cdn/chunks/{draggable-Z4XXmbPC.js.map → draggable-DCs9qL-b.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-Dq0D79tq.js → extensions-B7laxHjs.js} +22 -22
- package/dist/cdn/chunks/{extensions-Dq0D79tq.js.map → extensions-B7laxHjs.js.map} +1 -1
- package/dist/cdn/chunks/{icons-C_kRN0_C.js → icons-CvYN6zrM.js} +8 -8
- package/dist/cdn/chunks/{icons-C_kRN0_C.js.map → icons-CvYN6zrM.js.map} +1 -1
- package/dist/cdn/chunks/{keys-DsoX52o_.js → keys-Cmc2Yl3D.js} +2 -2
- package/dist/cdn/chunks/{keys-DsoX52o_.js.map → keys-Cmc2Yl3D.js.map} +1 -1
- package/dist/cdn/chunks/{liquid.browser-DrGys_ek.js → liquid.browser-UlAOKBjI.js} +99 -91
- package/dist/cdn/chunks/liquid.browser-UlAOKBjI.js.map +1 -0
- package/dist/cdn/chunks/{src-Aea1Vl1H.js → src-BYKYmEOD.js} +7 -6
- package/dist/cdn/chunks/src-BYKYmEOD.js.map +1 -0
- package/dist/cdn/chunks/{src-_GNJgPcS.js → src-Bi-Qhtfs.js} +2 -2
- package/dist/cdn/chunks/{src-_GNJgPcS.js.map → src-Bi-Qhtfs.js.map} +1 -1
- package/dist/cdn/chunks/{src-CRvTVX4F.js → src-C0N74uvF.js} +201 -201
- package/dist/cdn/chunks/{src-CRvTVX4F.js.map → src-C0N74uvF.js.map} +1 -1
- package/dist/cdn/chunks/{src-CZjSXPYq.js → src-EKTTBQ0y.js} +3 -2
- package/dist/cdn/chunks/src-EKTTBQ0y.js.map +1 -0
- package/dist/cdn/chunks/{styles-znpPfrFd.js → styles-C7s-VtJi.js} +1112 -1094
- package/dist/cdn/chunks/styles-C7s-VtJi.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-C5vzWlHv.js → tiptap-C44S1Cmh.js} +3480 -2806
- package/dist/cdn/chunks/tiptap-C44S1Cmh.js.map +1 -0
- package/dist/cdn/chunks/{useAliveFlag-4IDYQRNu.js → useAliveFlag-Dxwgo6P4.js} +2 -2
- package/dist/cdn/chunks/{useAliveFlag-4IDYQRNu.js.map → useAliveFlag-Dxwgo6P4.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-D4JpHTPk.js → useCloudI18n-8wkJtuJD.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-D4JpHTPk.js.map → useCloudI18n-8wkJtuJD.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorCore-BMXBmdd8.js → useEditorCore-C_nUXiph.js} +268 -268
- package/dist/cdn/chunks/useEditorCore-C_nUXiph.js.map +1 -0
- package/dist/cdn/chunks/{useI18n-BvcEYzrI.js → useI18n-UMs0F71x.js} +3 -3
- package/dist/cdn/chunks/{useI18n-BvcEYzrI.js.map → useI18n-UMs0F71x.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-BSdxMUzg.js → useMergeTag-CPa_9VOq.js} +4 -4
- package/dist/cdn/chunks/{useMergeTag-BSdxMUzg.js.map → useMergeTag-CPa_9VOq.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-ig-71caO.js → usePopoverPosition-cf8Y-ynK.js} +3 -3
- package/dist/cdn/chunks/{usePopoverPosition-ig-71caO.js.map → usePopoverPosition-cf8Y-ynK.js.map} +1 -1
- package/dist/cdn/editor.js +47 -47
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-COV27dGb.js → check-On4TSac-.js} +1 -1
- package/dist/{chevron-down-vsU88vcr.js → chevron-down-69EiBGoB.js} +1 -1
- package/dist/{chevron-up-RrZ0Rjn9.js → chevron-up-Dh3MG1Dw.js} +1 -1
- package/dist/{circle-alert-B6GlHmmi.js → circle-alert-cilwzafX.js} +1 -1
- package/dist/{clock-egOt8zjQ.js → clock-Dt0APH92.js} +1 -1
- package/dist/{cloud-D-2StbvU.js → cloud-C7-FhzMc.js} +1 -1
- package/dist/{createLucideIcon-D6cqT5Pm.js → createLucideIcon-C8WzBYCv.js} +2 -2
- package/dist/dist-6YJAWMuf.js +5 -0
- package/dist/dist-8vlm9kfO.js +5 -0
- package/dist/{dist-DHwnYYx0.js → dist-BImfm-46.js} +2 -2
- package/dist/{dist-DzzTB4eE.js → dist-C08jiemd.js} +7 -7
- package/dist/{dist-CqV4XslQ.js → dist-C27SeFL5.js} +15 -15
- package/dist/{dist-MwT7T6Xp.js → dist-CYx-E82k.js} +2 -2
- package/dist/{dist-CHxPjcxA.js → dist-ChYLhoJ4.js} +2143 -1583
- package/dist/{dist-UkG5ZJ1P.js → dist-Cl8J0IES.js} +258 -172
- package/dist/{dist-CQ0fVBQ3.js → dist-D5zCZFdU.js} +2 -1
- package/dist/{dist-D4GoAr2g.js → dist-DMJRSouD.js} +464 -436
- package/dist/{dist-GUZZpDK3.js → dist-DfpeSdmE.js} +2 -2
- package/dist/{dist-Du95Y9M3.js → dist-M7m1lYRe.js} +47 -47
- package/dist/{dist-vpuiQ7_Q.js → dist-g6cbzhZW.js} +2 -2
- package/dist/{extensions-y6KjLr9t.js → extensions-CxwhoG8v.js} +16 -16
- package/dist/{image-up-CycES-MQ.js → image-up-Ceggh_R3.js} +1 -1
- package/dist/{info-BUdvm046.js → info-DO5odBcZ.js} +1 -1
- package/dist/{liquid.browser-Di5zMIEx.js → liquid.browser-B-rGrnrQ.js} +98 -90
- package/dist/{list-checks-BAeuuATD.js → list-checks-BSkPKbuI.js} +1 -1
- package/dist/{loader-circle-L5yuAx_j.js → loader-circle-bO7o7_HD.js} +1 -1
- package/dist/{message-circle-DRdaapVc.js → message-circle-BEkAk65X.js} +1 -1
- package/dist/{pencil-BfErVPf_.js → pencil-t6m0EtKL.js} +1 -1
- package/dist/{refresh-cw-D0PYatER.js → refresh-cw-CkOYVzK5.js} +1 -1
- package/dist/{scan-line-Byi3fJcr.js → scan-line-DwSVj25O.js} +1 -1
- package/dist/{send-DuyNexMY.js → send-CWsWN8PQ.js} +1 -1
- package/dist/{shield-check-BkkN_1qw.js → shield-check-qje8Kufw.js} +1 -1
- package/dist/{sparkles-DAw2sBXk.js → sparkles-DumaWRW-.js} +1 -1
- package/dist/{styles-BzwheHH_.js → styles-C_slTGwp.js} +446 -428
- package/dist/templatical-editor.js +9 -9
- package/dist/{text-align-start-Ba3xJKn6.js → text-align-start-Ir8Ah4mT.js} +1 -1
- package/dist/{trash-2-CapEBXBI.js → trash-2-CklAFCmO.js} +1 -1
- package/dist/{triangle-alert-52pdw8jI.js → triangle-alert-BBi4n93g.js} +1 -1
- package/dist/{upload-oAgigC31.js → upload-sVqqppuv.js} +1 -1
- package/dist/{useEditorCore-BhjEMSeE.js → useEditorCore-r4gWzCBA.js} +889 -889
- package/dist/{useMergeTag-DTSOQnyr.js → useMergeTag-C-_WxrgL.js} +1 -1
- package/dist/{x-DvBgbDuf.js → x-Mby7KlhS.js} +1 -1
- package/package.json +22 -22
- package/dist/cdn/chunks/liquid.browser-DrGys_ek.js.map +0 -1
- package/dist/cdn/chunks/src-Aea1Vl1H.js.map +0 -1
- package/dist/cdn/chunks/src-CZjSXPYq.js.map +0 -1
- package/dist/cdn/chunks/styles-znpPfrFd.js.map +0 -1
- package/dist/cdn/chunks/tiptap-C5vzWlHv.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-BMXBmdd8.js.map +0 -1
- package/dist/dist-B56SufAv.js +0 -5
- package/dist/dist-BQZkRg05.js +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Link as
|
|
3
|
-
import { Underline as
|
|
4
|
-
//#region ../../node_modules/.pnpm/@tiptap+core@3.
|
|
1
|
+
import { Bn as e, Bt as t, Cn as n, Dn as r, Gn as i, Hn as a, Ht as o, Jn as s, Kn as c, Ln as l, Mt as u, T as d, Un as f, Vn as p, Vt as m, Wn as h, Xn as g, Yn as _, Zn as v, f as y, fn as b, ft as ee, gn as x, it as te, jt as ne, m as S, mt as re, nt as ie, pn as C, pt as ae, qn as w, s as T, ut as oe, w as se, yn as ce, zn as E } from "./dist-ChYLhoJ4.js";
|
|
2
|
+
import { Link as le } from "./dist-M7m1lYRe.js";
|
|
3
|
+
import { Underline as ue } from "./dist-DfpeSdmE.js";
|
|
4
|
+
//#region ../../node_modules/.pnpm/@tiptap+core@3.30.1_@tiptap+pm@3.30.1/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js
|
|
5
5
|
var D = (e, t) => {
|
|
6
6
|
if (e === "slot") return 0;
|
|
7
7
|
if (e instanceof Function) return e(t);
|
|
@@ -12,21 +12,25 @@ var D = (e, t) => {
|
|
|
12
12
|
r,
|
|
13
13
|
n
|
|
14
14
|
];
|
|
15
|
-
},
|
|
16
|
-
let { state: n
|
|
17
|
-
if (!
|
|
18
|
-
let { $from:
|
|
19
|
-
if (
|
|
20
|
-
let
|
|
21
|
-
if (
|
|
22
|
-
let
|
|
23
|
-
if (
|
|
24
|
-
if (
|
|
25
|
-
let
|
|
26
|
-
if (
|
|
27
|
-
let
|
|
28
|
-
return
|
|
29
|
-
|
|
15
|
+
}, de = (e, t) => {
|
|
16
|
+
let { state: n } = e, { selection: r } = n;
|
|
17
|
+
if (!r.empty) return !1;
|
|
18
|
+
let { $from: i } = r;
|
|
19
|
+
if (i.parentOffset !== 0) return !1;
|
|
20
|
+
let a = i.depth - 1;
|
|
21
|
+
if (a < 0) return !1;
|
|
22
|
+
let o = i.node(a), s = i.index(a);
|
|
23
|
+
if (s === 0) return !1;
|
|
24
|
+
if (o.type === t) return e.commands.lift(t.name);
|
|
25
|
+
let c = o.child(s - 1);
|
|
26
|
+
if (c.type !== t || !c.lastChild?.isTextblock) return !1;
|
|
27
|
+
let l = i.before() - 1 - 1;
|
|
28
|
+
return e.commands.command(({ tr: e, dispatch: t }) => {
|
|
29
|
+
if (!t) return !0;
|
|
30
|
+
let n = i.parent.content, r = new v(n, 0, 0);
|
|
31
|
+
return e.replace(l, i.after(), r), e.setSelection(w.create(e.doc, l + n.size)), e.scrollIntoView(), t(e), !0;
|
|
32
|
+
});
|
|
33
|
+
}, fe = /^\s*>\s$/, pe = S.create({
|
|
30
34
|
name: "blockquote",
|
|
31
35
|
addOptions() {
|
|
32
36
|
return { HTMLAttributes: {} };
|
|
@@ -65,16 +69,16 @@ var D = (e, t) => {
|
|
|
65
69
|
addKeyboardShortcuts() {
|
|
66
70
|
return {
|
|
67
71
|
"Mod-Shift-b": () => this.editor.commands.toggleBlockquote(),
|
|
68
|
-
Backspace: () =>
|
|
72
|
+
Backspace: () => de(this.editor, this.type)
|
|
69
73
|
};
|
|
70
74
|
},
|
|
71
75
|
addInputRules() {
|
|
72
|
-
return [
|
|
73
|
-
find:
|
|
76
|
+
return [E({
|
|
77
|
+
find: fe,
|
|
74
78
|
type: this.type
|
|
75
79
|
})];
|
|
76
80
|
}
|
|
77
|
-
}),
|
|
81
|
+
}), me = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, he = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, ge = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, _e = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, ve = y.create({
|
|
78
82
|
name: "bold",
|
|
79
83
|
addOptions() {
|
|
80
84
|
return { HTMLAttributes: {} };
|
|
@@ -123,31 +127,31 @@ var D = (e, t) => {
|
|
|
123
127
|
};
|
|
124
128
|
},
|
|
125
129
|
addInputRules() {
|
|
126
|
-
return [
|
|
127
|
-
find:
|
|
130
|
+
return [b({
|
|
131
|
+
find: me,
|
|
128
132
|
type: this.type
|
|
129
|
-
}),
|
|
130
|
-
find:
|
|
133
|
+
}), b({
|
|
134
|
+
find: ge,
|
|
131
135
|
type: this.type
|
|
132
136
|
})];
|
|
133
137
|
},
|
|
134
138
|
addPasteRules() {
|
|
135
|
-
return [
|
|
136
|
-
find:
|
|
139
|
+
return [C({
|
|
140
|
+
find: he,
|
|
137
141
|
type: this.type
|
|
138
|
-
}),
|
|
139
|
-
find:
|
|
142
|
+
}), C({
|
|
143
|
+
find: _e,
|
|
140
144
|
type: this.type
|
|
141
145
|
})];
|
|
142
146
|
}
|
|
143
|
-
}),
|
|
147
|
+
}), ye = (e) => {
|
|
144
148
|
let t = /`([^`]+)`(?!`)$/.exec(e);
|
|
145
149
|
return !t || t.index > 0 && e[t.index - 1] === "`" ? null : {
|
|
146
150
|
index: t.index,
|
|
147
151
|
text: t[0],
|
|
148
152
|
replaceWith: t[1]
|
|
149
153
|
};
|
|
150
|
-
},
|
|
154
|
+
}, be = (e) => {
|
|
151
155
|
let t = /`([^`]+)`(?!`)/g, n = [], r;
|
|
152
156
|
for (; (r = t.exec(e)) !== null;) r.index > 0 && e[r.index - 1] === "`" || n.push({
|
|
153
157
|
index: r.index,
|
|
@@ -155,7 +159,7 @@ var D = (e, t) => {
|
|
|
155
159
|
replaceWith: r[1]
|
|
156
160
|
});
|
|
157
161
|
return n;
|
|
158
|
-
},
|
|
162
|
+
}, xe = y.create({
|
|
159
163
|
name: "code",
|
|
160
164
|
addOptions() {
|
|
161
165
|
return { HTMLAttributes: {} };
|
|
@@ -190,18 +194,18 @@ var D = (e, t) => {
|
|
|
190
194
|
return { "Mod-e": () => this.editor.commands.toggleCode() };
|
|
191
195
|
},
|
|
192
196
|
addInputRules() {
|
|
193
|
-
return [
|
|
194
|
-
find:
|
|
197
|
+
return [b({
|
|
198
|
+
find: ye,
|
|
195
199
|
type: this.type
|
|
196
200
|
})];
|
|
197
201
|
},
|
|
198
202
|
addPasteRules() {
|
|
199
|
-
return [
|
|
200
|
-
find:
|
|
203
|
+
return [C({
|
|
204
|
+
find: be,
|
|
201
205
|
type: this.type
|
|
202
206
|
})];
|
|
203
207
|
}
|
|
204
|
-
}), O = 4,
|
|
208
|
+
}), O = 4, Se = /^```([a-z]+)?[\s\n]$/, Ce = /^~~~([a-z]+)?[\s\n]$/, we = S.create({
|
|
205
209
|
name: "codeBlock",
|
|
206
210
|
addOptions() {
|
|
207
211
|
return {
|
|
@@ -321,29 +325,29 @@ var D = (e, t) => {
|
|
|
321
325
|
let a = r.before();
|
|
322
326
|
return a > 0 ? !1 : e.commands.insertDefaultBlock({ pos: a });
|
|
323
327
|
},
|
|
324
|
-
ArrowDown: ({ editor:
|
|
328
|
+
ArrowDown: ({ editor: e }) => {
|
|
325
329
|
if (!this.options.exitOnArrowDown) return !1;
|
|
326
|
-
let { state:
|
|
327
|
-
if (!
|
|
328
|
-
let
|
|
329
|
-
return
|
|
330
|
+
let { state: t } = e, { selection: n, doc: r } = t, { $from: i, empty: a } = n;
|
|
331
|
+
if (!a || i.parent.type !== this.type || i.parentOffset !== i.parent.nodeSize - 2) return !1;
|
|
332
|
+
let o = i.after();
|
|
333
|
+
return o === void 0 ? !1 : r.nodeAt(o) ? e.commands.command(({ tr: e }) => (e.setSelection(c.near(r.resolve(o))), !0)) : e.commands.exitCode();
|
|
330
334
|
}
|
|
331
335
|
};
|
|
332
336
|
},
|
|
333
337
|
addInputRules() {
|
|
334
|
-
return [
|
|
335
|
-
find:
|
|
338
|
+
return [l({
|
|
339
|
+
find: Se,
|
|
336
340
|
type: this.type,
|
|
337
341
|
getAttributes: (e) => ({ language: e[1] })
|
|
338
|
-
}),
|
|
339
|
-
find:
|
|
342
|
+
}), l({
|
|
343
|
+
find: Ce,
|
|
340
344
|
type: this.type,
|
|
341
345
|
getAttributes: (e) => ({ language: e[1] })
|
|
342
346
|
})];
|
|
343
347
|
},
|
|
344
348
|
addProseMirrorPlugins() {
|
|
345
|
-
return [new
|
|
346
|
-
key: new
|
|
349
|
+
return [new h({
|
|
350
|
+
key: new i("codeBlockVSCodeHandler"),
|
|
347
351
|
props: { handlePaste: (e, t) => {
|
|
348
352
|
if (!t.clipboardData || this.editor.isActive(this.type.name)) return !1;
|
|
349
353
|
let n = t.clipboardData.getData("text/plain"), r = t.clipboardData.getData("vscode-editor-data"), i = (r ? JSON.parse(r) : void 0)?.mode;
|
|
@@ -353,12 +357,12 @@ var D = (e, t) => {
|
|
|
353
357
|
} }
|
|
354
358
|
})];
|
|
355
359
|
}
|
|
356
|
-
}),
|
|
360
|
+
}), Te = S.create({
|
|
357
361
|
name: "doc",
|
|
358
362
|
topNode: !0,
|
|
359
363
|
content: "block+",
|
|
360
364
|
renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n\n") : ""
|
|
361
|
-
}),
|
|
365
|
+
}), Ee = S.create({
|
|
362
366
|
name: "hardBreak",
|
|
363
367
|
markdownTokenName: "br",
|
|
364
368
|
addOptions() {
|
|
@@ -402,7 +406,7 @@ var D = (e, t) => {
|
|
|
402
406
|
"Shift-Enter": () => this.editor.commands.setHardBreak()
|
|
403
407
|
};
|
|
404
408
|
}
|
|
405
|
-
}),
|
|
409
|
+
}), De = S.create({
|
|
406
410
|
name: "heading",
|
|
407
411
|
addOptions() {
|
|
408
412
|
return {
|
|
@@ -457,13 +461,13 @@ var D = (e, t) => {
|
|
|
457
461
|
}), {});
|
|
458
462
|
},
|
|
459
463
|
addInputRules() {
|
|
460
|
-
return this.options.levels.map((e) =>
|
|
464
|
+
return this.options.levels.map((e) => l({
|
|
461
465
|
find: RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),
|
|
462
466
|
type: this.type,
|
|
463
467
|
getAttributes: { level: e }
|
|
464
468
|
}));
|
|
465
469
|
}
|
|
466
|
-
}),
|
|
470
|
+
}), Oe = S.create({
|
|
467
471
|
name: "horizontalRule",
|
|
468
472
|
addOptions() {
|
|
469
473
|
return {
|
|
@@ -483,12 +487,12 @@ var D = (e, t) => {
|
|
|
483
487
|
renderMarkdown: () => "---",
|
|
484
488
|
addCommands() {
|
|
485
489
|
return { setHorizontalRule: () => ({ chain: e, state: t }) => {
|
|
486
|
-
if (!
|
|
490
|
+
if (!d(t, t.schema.nodes[this.name])) return !1;
|
|
487
491
|
let { selection: n } = t, { $to: r } = n, i = e();
|
|
488
|
-
return
|
|
492
|
+
return o(n) ? i.insertContentAt(r.pos, { type: this.name }) : i.insertContent({ type: this.name }), i.command(({ state: e, tr: t, dispatch: n }) => {
|
|
489
493
|
if (n) {
|
|
490
494
|
let { $to: n } = t.selection, r = n.end();
|
|
491
|
-
if (n.nodeAfter) n.nodeAfter.isTextblock ? t.setSelection(w.create(t.doc, n.pos + 1)) : n.nodeAfter.isBlock ? t.setSelection(
|
|
495
|
+
if (n.nodeAfter) n.nodeAfter.isTextblock ? t.setSelection(w.create(t.doc, n.pos + 1)) : n.nodeAfter.isBlock ? t.setSelection(f.create(t.doc, n.pos)) : t.setSelection(w.create(t.doc, n.pos));
|
|
492
496
|
else {
|
|
493
497
|
let i = (e.schema.nodes[this.options.nextNodeType] || n.parent.type.contentMatch.defaultType)?.create();
|
|
494
498
|
i && (t.insert(r, i), t.setSelection(w.create(t.doc, r + 1)));
|
|
@@ -500,12 +504,12 @@ var D = (e, t) => {
|
|
|
500
504
|
} };
|
|
501
505
|
},
|
|
502
506
|
addInputRules() {
|
|
503
|
-
return [
|
|
507
|
+
return [ce({
|
|
504
508
|
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
|
505
509
|
type: this.type
|
|
506
510
|
})];
|
|
507
511
|
}
|
|
508
|
-
}),
|
|
512
|
+
}), ke = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, Ae = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, je = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Me = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Ne = y.create({
|
|
509
513
|
name: "italic",
|
|
510
514
|
addOptions() {
|
|
511
515
|
return { HTMLAttributes: {} };
|
|
@@ -552,29 +556,29 @@ var D = (e, t) => {
|
|
|
552
556
|
};
|
|
553
557
|
},
|
|
554
558
|
addInputRules() {
|
|
555
|
-
return [
|
|
556
|
-
find:
|
|
559
|
+
return [b({
|
|
560
|
+
find: ke,
|
|
557
561
|
type: this.type
|
|
558
|
-
}),
|
|
559
|
-
find:
|
|
562
|
+
}), b({
|
|
563
|
+
find: je,
|
|
560
564
|
type: this.type
|
|
561
565
|
})];
|
|
562
566
|
},
|
|
563
567
|
addPasteRules() {
|
|
564
|
-
return [
|
|
565
|
-
find:
|
|
568
|
+
return [C({
|
|
569
|
+
find: Ae,
|
|
566
570
|
type: this.type
|
|
567
|
-
}),
|
|
568
|
-
find:
|
|
571
|
+
}), C({
|
|
572
|
+
find: Me,
|
|
569
573
|
type: this.type
|
|
570
574
|
})];
|
|
571
575
|
}
|
|
572
|
-
}),
|
|
573
|
-
for (var n in t)
|
|
576
|
+
}), Pe = Object.defineProperty, Fe = (e, t) => {
|
|
577
|
+
for (var n in t) Pe(e, n, {
|
|
574
578
|
get: t[n],
|
|
575
579
|
enumerable: !0
|
|
576
580
|
});
|
|
577
|
-
},
|
|
581
|
+
}, Ie = "listItem", Le = "textStyle", Re = /^\s*([-+*])\s$/, ze = S.create({
|
|
578
582
|
name: "bulletList",
|
|
579
583
|
addOptions() {
|
|
580
584
|
return {
|
|
@@ -606,26 +610,26 @@ var D = (e, t) => {
|
|
|
606
610
|
renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n") : "",
|
|
607
611
|
markdownOptions: { indentsContent: !0 },
|
|
608
612
|
addCommands() {
|
|
609
|
-
return { toggleBulletList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(
|
|
613
|
+
return { toggleBulletList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Ie, this.editor.getAttributes(Le)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
|
|
610
614
|
},
|
|
611
615
|
addKeyboardShortcuts() {
|
|
612
616
|
return { "Mod-Shift-8": () => this.editor.commands.toggleBulletList() };
|
|
613
617
|
},
|
|
614
618
|
addInputRules() {
|
|
615
|
-
let e =
|
|
616
|
-
find:
|
|
619
|
+
let e = E({
|
|
620
|
+
find: Re,
|
|
617
621
|
type: this.type
|
|
618
622
|
});
|
|
619
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (e =
|
|
620
|
-
find:
|
|
623
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (e = E({
|
|
624
|
+
find: Re,
|
|
621
625
|
type: this.type,
|
|
622
626
|
keepMarks: this.options.keepMarks,
|
|
623
627
|
keepAttributes: this.options.keepAttributes,
|
|
624
|
-
getAttributes: () => this.editor.getAttributes(
|
|
628
|
+
getAttributes: () => this.editor.getAttributes(Le),
|
|
625
629
|
editor: this.editor
|
|
626
630
|
})), [e];
|
|
627
631
|
}
|
|
628
|
-
}),
|
|
632
|
+
}), Be = (e, t, n) => {
|
|
629
633
|
let { selection: r } = e;
|
|
630
634
|
if (!r.empty) return null;
|
|
631
635
|
let { $from: i } = r;
|
|
@@ -656,24 +660,24 @@ var D = (e, t) => {
|
|
|
656
660
|
insertPos: i.after(a),
|
|
657
661
|
items: f
|
|
658
662
|
};
|
|
659
|
-
},
|
|
660
|
-
let
|
|
661
|
-
if (!
|
|
662
|
-
let { selection:
|
|
663
|
-
|
|
664
|
-
let
|
|
665
|
-
return
|
|
666
|
-
},
|
|
663
|
+
}, Ve = (e, t, n, r) => {
|
|
664
|
+
let i = Be(e, n, r);
|
|
665
|
+
if (!i) return !1;
|
|
666
|
+
let { selection: a } = e, { nestedList: o, nestedListPos: s, insertPos: c, items: l } = i, u = e.tr;
|
|
667
|
+
u.delete(s, s + o.nodeSize);
|
|
668
|
+
let d = u.mapping.map(c);
|
|
669
|
+
return u.insert(d, g.from(l)), u.setSelection(a.map(u.doc, u.mapping)), t && t(u), !0;
|
|
670
|
+
}, He = (e, t, n) => Ve(e.state, e.view.dispatch, t, n), Ue = (e, t) => T.create({
|
|
667
671
|
name: `${e}BranchingDeleteKeymap`,
|
|
668
672
|
priority: 101,
|
|
669
673
|
addKeyboardShortcuts() {
|
|
670
|
-
let n = () =>
|
|
674
|
+
let n = () => He(this.editor, e, t);
|
|
671
675
|
return {
|
|
672
676
|
Delete: n,
|
|
673
677
|
"Mod-Delete": n
|
|
674
678
|
};
|
|
675
679
|
}
|
|
676
|
-
}),
|
|
680
|
+
}), We = [
|
|
677
681
|
[1e3, "m"],
|
|
678
682
|
[900, "cm"],
|
|
679
683
|
[500, "d"],
|
|
@@ -687,20 +691,20 @@ var D = (e, t) => {
|
|
|
687
691
|
[5, "v"],
|
|
688
692
|
[4, "iv"],
|
|
689
693
|
[1, "i"]
|
|
690
|
-
], k = "abcdefghijklmnopqrstuvwxyz",
|
|
694
|
+
], k = "abcdefghijklmnopqrstuvwxyz", Ge = String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;
|
|
691
695
|
function A(e) {
|
|
692
696
|
let t = e, n = "";
|
|
693
|
-
for (let [e, r] of
|
|
697
|
+
for (let [e, r] of We) for (; t >= e;) n += r, t -= e;
|
|
694
698
|
return n;
|
|
695
699
|
}
|
|
696
|
-
function
|
|
700
|
+
function Ke(e) {
|
|
697
701
|
return A(e).toUpperCase();
|
|
698
702
|
}
|
|
699
|
-
function
|
|
703
|
+
function qe(e) {
|
|
700
704
|
let t = e.toLowerCase(), n = 0, r = 0;
|
|
701
705
|
for (; n < t.length;) {
|
|
702
706
|
let e = !1;
|
|
703
|
-
for (let [i, a] of
|
|
707
|
+
for (let [i, a] of We) if (t.startsWith(a, n)) {
|
|
704
708
|
r += i, n += a.length, e = !0;
|
|
705
709
|
break;
|
|
706
710
|
}
|
|
@@ -708,12 +712,12 @@ function Ge(e) {
|
|
|
708
712
|
}
|
|
709
713
|
return r;
|
|
710
714
|
}
|
|
711
|
-
function
|
|
715
|
+
function Je(e) {
|
|
712
716
|
if (!/^[ivxlcdmIVXLCDM]+$/.test(e)) return !1;
|
|
713
|
-
let t =
|
|
714
|
-
return t <= 0 ? !1 : (e === e.toLowerCase() ? A(t) :
|
|
717
|
+
let t = qe(e);
|
|
718
|
+
return t <= 0 ? !1 : (e === e.toLowerCase() ? A(t) : Ke(t)) === e;
|
|
715
719
|
}
|
|
716
|
-
function
|
|
720
|
+
function Ye(e) {
|
|
717
721
|
let t = e.toLowerCase();
|
|
718
722
|
if (t.length === 1) return t.charCodeAt(0) - 97 + 1;
|
|
719
723
|
if (t.length === 2) {
|
|
@@ -722,82 +726,82 @@ function qe(e) {
|
|
|
722
726
|
}
|
|
723
727
|
return 0;
|
|
724
728
|
}
|
|
725
|
-
function
|
|
729
|
+
function j(e) {
|
|
726
730
|
if (e <= 26) return k[e - 1];
|
|
727
731
|
let t = Math.floor((e - 1) / 26) - 1, n = (e - 1) % 26;
|
|
728
732
|
return t < 0 ? k[n] : k[t] + k[n];
|
|
729
733
|
}
|
|
730
|
-
function
|
|
734
|
+
function M(e) {
|
|
731
735
|
if (!(!e || /^\d+$/.test(e))) {
|
|
732
|
-
if (
|
|
736
|
+
if (Je(e)) return e === e.toLowerCase() ? "i" : "I";
|
|
733
737
|
if (/^[a-z]{1,2}$/.test(e)) return "a";
|
|
734
738
|
if (/^[A-Z]{1,2}$/.test(e)) return "A";
|
|
735
739
|
}
|
|
736
740
|
}
|
|
737
|
-
function
|
|
741
|
+
function Xe(e) {
|
|
738
742
|
if (/^\d+$/.test(e)) return parseInt(e, 10);
|
|
739
|
-
let t =
|
|
740
|
-
if (t === "i" || t === "I") return
|
|
743
|
+
let t = M(e);
|
|
744
|
+
if (t === "i" || t === "I") return qe(e);
|
|
741
745
|
if (t === "a" || t === "A") {
|
|
742
|
-
let t =
|
|
746
|
+
let t = Ye(e);
|
|
743
747
|
return t > 0 ? t : 1;
|
|
744
748
|
}
|
|
745
749
|
let n = parseInt(e, 10);
|
|
746
750
|
return Number.isNaN(n) ? 1 : n;
|
|
747
751
|
}
|
|
748
|
-
function
|
|
752
|
+
function Ze(e, t) {
|
|
749
753
|
if (e === "numeric") return String(t);
|
|
750
754
|
switch (e) {
|
|
751
|
-
case "a": return
|
|
752
|
-
case "A": return
|
|
755
|
+
case "a": return j(t);
|
|
756
|
+
case "A": return j(t).toUpperCase();
|
|
753
757
|
case "i": return A(t);
|
|
754
|
-
case "I": return
|
|
758
|
+
case "I": return Ke(t);
|
|
755
759
|
default: return String(t);
|
|
756
760
|
}
|
|
757
761
|
}
|
|
758
|
-
function
|
|
762
|
+
function Qe(e) {
|
|
759
763
|
if (e.length === 0) return !1;
|
|
760
|
-
let t =
|
|
764
|
+
let t = M(e[0]) ?? "numeric", n = Xe(e[0]);
|
|
761
765
|
if (n < 1) return !1;
|
|
762
766
|
for (let r = 0; r < e.length; r++) {
|
|
763
|
-
let i =
|
|
767
|
+
let i = Ze(t, n + r);
|
|
764
768
|
if (e[r] !== i) return !1;
|
|
765
769
|
}
|
|
766
770
|
return !0;
|
|
767
771
|
}
|
|
768
|
-
function
|
|
772
|
+
function $e(e) {
|
|
769
773
|
return {
|
|
770
|
-
type:
|
|
771
|
-
start:
|
|
774
|
+
type: M(e),
|
|
775
|
+
start: Xe(e)
|
|
772
776
|
};
|
|
773
777
|
}
|
|
774
|
-
function
|
|
775
|
-
let { type: t, start: n } =
|
|
778
|
+
function et(e) {
|
|
779
|
+
let { type: t, start: n } = $e(e), r = {};
|
|
776
780
|
return t && (r.type = t), n !== 1 && (r.start = n), r;
|
|
777
781
|
}
|
|
778
|
-
function
|
|
782
|
+
function tt(e, t, n = ". ") {
|
|
779
783
|
let r = t + 1;
|
|
780
784
|
if (!e || e === "1") return `${r}${n}`;
|
|
781
785
|
switch (e) {
|
|
782
|
-
case "a": return `${
|
|
783
|
-
case "A": return `${
|
|
786
|
+
case "a": return `${j(r)}${n}`;
|
|
787
|
+
case "A": return `${j(r).toUpperCase()}${n}`;
|
|
784
788
|
case "i": return `${A(r)}${n}`;
|
|
785
|
-
case "I": return `${
|
|
789
|
+
case "I": return `${Ke(r)}${n}`;
|
|
786
790
|
default: return `${r}${n}`;
|
|
787
791
|
}
|
|
788
792
|
}
|
|
789
|
-
function
|
|
793
|
+
function nt(e) {
|
|
790
794
|
let t = e.tokens?.[0];
|
|
791
795
|
return !!(e.text && e.tokens?.length === 1 && t?.type === "list" && t.ordered && t.raw === e.text);
|
|
792
796
|
}
|
|
793
|
-
function
|
|
797
|
+
function rt(e, t) {
|
|
794
798
|
return t.tokenizeInline ? t.parseInline(t.tokenizeInline(e)) : t.parseInline([{
|
|
795
799
|
type: "text",
|
|
796
800
|
raw: e,
|
|
797
801
|
text: e
|
|
798
802
|
}]);
|
|
799
803
|
}
|
|
800
|
-
var
|
|
804
|
+
var it = S.create({
|
|
801
805
|
name: "listItem",
|
|
802
806
|
addOptions() {
|
|
803
807
|
return {
|
|
@@ -823,11 +827,11 @@ var tt = S.create({
|
|
|
823
827
|
if (e.type !== "list_item") return [];
|
|
824
828
|
let n = t.parseBlockChildren ?? t.parseChildren, r = [];
|
|
825
829
|
if (e.tokens && e.tokens.length > 0) {
|
|
826
|
-
if (
|
|
830
|
+
if (nt(e)) return {
|
|
827
831
|
type: "listItem",
|
|
828
832
|
content: [{
|
|
829
833
|
type: "paragraph",
|
|
830
|
-
content:
|
|
834
|
+
content: rt(e.text || "", t)
|
|
831
835
|
}]
|
|
832
836
|
};
|
|
833
837
|
if (e.tokens.some((e) => e.type === "paragraph")) r = n(e.tokens);
|
|
@@ -852,16 +856,16 @@ var tt = S.create({
|
|
|
852
856
|
content: r
|
|
853
857
|
};
|
|
854
858
|
},
|
|
855
|
-
renderMarkdown: (e, t, n) =>
|
|
859
|
+
renderMarkdown: (e, t, n) => r(e, t, (e) => {
|
|
856
860
|
if (e.parentType === "bulletList") return "- ";
|
|
857
861
|
if (e.parentType === "orderedList") {
|
|
858
862
|
let t = e.meta?.parentAttrs?.start || 1;
|
|
859
|
-
return
|
|
863
|
+
return tt(e.meta?.parentAttrs?.type, t - 1 + (e.index || 0), ". ");
|
|
860
864
|
}
|
|
861
865
|
return "- ";
|
|
862
866
|
}, n),
|
|
863
867
|
addExtensions() {
|
|
864
|
-
return [
|
|
868
|
+
return [Ue(this.name, [this.options.bulletListTypeName, this.options.orderedListTypeName])];
|
|
865
869
|
},
|
|
866
870
|
addKeyboardShortcuts() {
|
|
867
871
|
return {
|
|
@@ -871,76 +875,92 @@ var tt = S.create({
|
|
|
871
875
|
};
|
|
872
876
|
}
|
|
873
877
|
});
|
|
874
|
-
|
|
875
|
-
findListItemPos: () =>
|
|
876
|
-
getNextListDepth: () =>
|
|
877
|
-
handleBackspace: () =>
|
|
878
|
-
handleDelete: () =>
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
878
|
+
Fe({}, {
|
|
879
|
+
findListItemPos: () => N,
|
|
880
|
+
getNextListDepth: () => P,
|
|
881
|
+
handleBackspace: () => F,
|
|
882
|
+
handleDelete: () => I,
|
|
883
|
+
handleTab: () => ct,
|
|
884
|
+
hasListBefore: () => at,
|
|
885
|
+
hasListItemAfter: () => lt,
|
|
886
|
+
hasListItemBefore: () => ut,
|
|
887
|
+
listItemHasSubList: () => dt,
|
|
888
|
+
nextListIsDeeper: () => ot,
|
|
889
|
+
nextListIsHigher: () => st
|
|
885
890
|
});
|
|
886
|
-
var
|
|
887
|
-
let { $from: n } = t.selection, r =
|
|
891
|
+
var N = (e, t) => {
|
|
892
|
+
let { $from: n } = t.selection, r = ee(e, t.schema), i = null, a = n.depth, o = n.pos, s = null;
|
|
888
893
|
for (; a > 0 && s === null;) i = n.node(a), i.type === r ? s = a : (--a, --o);
|
|
889
894
|
return s === null ? null : {
|
|
890
895
|
$pos: t.doc.resolve(o),
|
|
891
896
|
depth: s
|
|
892
897
|
};
|
|
893
|
-
},
|
|
894
|
-
let n =
|
|
898
|
+
}, P = (e, t) => {
|
|
899
|
+
let n = N(e, t);
|
|
895
900
|
if (!n) return !1;
|
|
896
|
-
let [, r] =
|
|
901
|
+
let [, r] = oe(t, e, n.$pos.pos + 4);
|
|
897
902
|
return r;
|
|
898
|
-
},
|
|
903
|
+
}, at = (e, t, n) => {
|
|
899
904
|
let { $anchor: r } = e.selection, i = Math.max(0, r.pos - 2), a = e.doc.resolve(i).node();
|
|
900
905
|
return !(!a || !n.includes(a.type.name));
|
|
901
|
-
},
|
|
906
|
+
}, F = (e, n, r) => {
|
|
902
907
|
if (e.commands.undoInputRule()) return !0;
|
|
903
908
|
if (e.state.selection.from !== e.state.selection.to) return !1;
|
|
904
|
-
if (!
|
|
905
|
-
let { $anchor:
|
|
906
|
-
r.node().descendants((e,
|
|
907
|
-
e.type.name ===
|
|
909
|
+
if (!t(e.state, n) && at(e.state, n, r)) {
|
|
910
|
+
let { $anchor: t } = e.state.selection, r = e.state.doc.resolve(t.before() - 1), i = [];
|
|
911
|
+
r.node().descendants((e, t) => {
|
|
912
|
+
e.type.name === n && i.push({
|
|
908
913
|
node: e,
|
|
909
|
-
pos:
|
|
914
|
+
pos: t
|
|
910
915
|
});
|
|
911
916
|
});
|
|
912
917
|
let a = i.at(-1);
|
|
913
918
|
if (!a) return !1;
|
|
914
919
|
let o = e.state.doc.resolve(r.start() + a.pos + 1);
|
|
915
920
|
return e.chain().cut({
|
|
916
|
-
from:
|
|
917
|
-
to:
|
|
921
|
+
from: t.start() - 1,
|
|
922
|
+
to: t.end() + 1
|
|
918
923
|
}, o.end()).joinForward().run();
|
|
919
924
|
}
|
|
920
|
-
|
|
921
|
-
}
|
|
922
|
-
|
|
925
|
+
if (!t(e.state, n) || !u(e.state)) return !1;
|
|
926
|
+
let { $from: i } = e.state.selection, a = i.depth - 1;
|
|
927
|
+
return i.node(a).type !== e.schema.nodes[n] || i.index(a) !== 0 ? !1 : e.chain().liftListItem(n).run();
|
|
928
|
+
}, ot = (e, t) => {
|
|
929
|
+
let n = P(e, t), r = N(e, t);
|
|
923
930
|
return !r || !n ? !1 : n > r.depth;
|
|
924
|
-
}, at = (e, t) => {
|
|
925
|
-
let n = I(e, t), r = F(e, t);
|
|
926
|
-
return !r || !n ? !1 : n < r.depth;
|
|
927
|
-
}, ot = (e, n) => {
|
|
928
|
-
if (!i(e.state, n) || !t(e.state, n)) return !1;
|
|
929
|
-
let { selection: r } = e.state, { $from: a, $to: o } = r;
|
|
930
|
-
return !r.empty && a.sameParent(o) ? !1 : it(n, e.state) ? e.chain().focus(e.state.selection.from + 4).lift(n).joinBackward().run() : at(n, e.state) ? e.chain().joinForward().joinBackward().run() : e.commands.joinItemForward();
|
|
931
931
|
}, st = (e, t) => {
|
|
932
|
+
let n = P(e, t), r = N(e, t);
|
|
933
|
+
return !r || !n ? !1 : n < r.depth;
|
|
934
|
+
}, I = (e, n) => {
|
|
935
|
+
if (!t(e.state, n) || !ne(e.state, n)) return !1;
|
|
936
|
+
let { selection: r } = e.state, { $from: i, $to: a } = r;
|
|
937
|
+
return !r.empty && i.sameParent(a) ? !1 : ot(n, e.state) ? e.chain().focus(e.state.selection.from + 4).lift(n).joinBackward().run() : st(n, e.state) ? e.chain().joinForward().joinBackward().run() : e.commands.joinItemForward();
|
|
938
|
+
}, ct = (e, n, r) => {
|
|
939
|
+
let { state: i } = e, { selection: a } = i;
|
|
940
|
+
if (!a.empty) return !1;
|
|
941
|
+
let { $from: o } = a;
|
|
942
|
+
if (o.parentOffset !== 0 || !o.parent.isTextblock || t(i, n)) return !1;
|
|
943
|
+
let s = ae(o);
|
|
944
|
+
if (!s || !r.includes(s.type.name)) return !1;
|
|
945
|
+
let c = s.lastChild;
|
|
946
|
+
if (!c || c.type.name !== n) return !1;
|
|
947
|
+
let l = o.parent;
|
|
948
|
+
if (!c.canReplace(c.childCount, c.childCount, g.from(l))) return !1;
|
|
949
|
+
let u = o.before(), d = o.after(), f = u - 2;
|
|
950
|
+
return e.commands.command(({ tr: e, dispatch: t }) => (t && (e.delete(u, d).insert(f, g.from(l)), e.setSelection(w.create(e.doc, f + 1)), e.scrollIntoView()), !0));
|
|
951
|
+
}, lt = (e, t) => {
|
|
932
952
|
let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - n.parentOffset - 2);
|
|
933
953
|
return r.index() !== r.parent.childCount - 1 && r.nodeAfter?.type.name === e;
|
|
934
|
-
},
|
|
954
|
+
}, ut = (e, t) => {
|
|
935
955
|
let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - 2);
|
|
936
956
|
return r.index() !== 0 && r.nodeBefore?.type.name === e;
|
|
937
|
-
},
|
|
957
|
+
}, dt = (e, t, n) => {
|
|
938
958
|
if (!n) return !1;
|
|
939
|
-
let r =
|
|
959
|
+
let r = ee(e, t.schema), i = !1;
|
|
940
960
|
return n.descendants((e) => {
|
|
941
961
|
e.type === r && (i = !0);
|
|
942
962
|
}), i;
|
|
943
|
-
},
|
|
963
|
+
}, ft = T.create({
|
|
944
964
|
name: "listKeymap",
|
|
945
965
|
addOptions() {
|
|
946
966
|
return { listTypes: [{
|
|
@@ -956,46 +976,51 @@ var F = (e, t) => {
|
|
|
956
976
|
Delete: ({ editor: e }) => {
|
|
957
977
|
let t = !1;
|
|
958
978
|
return this.options.listTypes.forEach(({ itemName: n }) => {
|
|
959
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
979
|
+
e.state.schema.nodes[n] !== void 0 && I(e, n) && (t = !0);
|
|
960
980
|
}), t;
|
|
961
981
|
},
|
|
962
982
|
"Mod-Delete": ({ editor: e }) => {
|
|
963
983
|
let t = !1;
|
|
964
984
|
return this.options.listTypes.forEach(({ itemName: n }) => {
|
|
965
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
985
|
+
e.state.schema.nodes[n] !== void 0 && I(e, n) && (t = !0);
|
|
966
986
|
}), t;
|
|
967
987
|
},
|
|
968
988
|
Backspace: ({ editor: e }) => {
|
|
969
989
|
let t = !1;
|
|
970
990
|
return this.options.listTypes.forEach(({ itemName: n, wrapperNames: r }) => {
|
|
971
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
991
|
+
e.state.schema.nodes[n] !== void 0 && F(e, n, r) && (t = !0);
|
|
972
992
|
}), t;
|
|
973
993
|
},
|
|
974
994
|
"Mod-Backspace": ({ editor: e }) => {
|
|
975
995
|
let t = !1;
|
|
976
996
|
return this.options.listTypes.forEach(({ itemName: n, wrapperNames: r }) => {
|
|
977
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
997
|
+
e.state.schema.nodes[n] !== void 0 && F(e, n, r) && (t = !0);
|
|
978
998
|
}), t;
|
|
999
|
+
},
|
|
1000
|
+
Tab: ({ editor: e }) => {
|
|
1001
|
+
for (let { itemName: t, wrapperNames: n } of this.options.listTypes) if (e.state.schema.nodes[t] !== void 0 && ct(e, t, n)) return !0;
|
|
1002
|
+
return !1;
|
|
979
1003
|
}
|
|
980
1004
|
};
|
|
981
1005
|
}
|
|
982
|
-
}), L = RegExp(`^(\\s*)(${
|
|
1006
|
+
}), L = RegExp(`^(\\s*)(${Ge})([.)])\\s+(.*)$`), pt = /^\s/, R = {
|
|
983
1007
|
heading: /^#{1,6}(?:\s|$)/,
|
|
984
1008
|
bulletItem: /^[-+*]\s+/,
|
|
985
1009
|
codeFence: /^(?:```|~~~)/,
|
|
1010
|
+
blockMath: /^\$\$/,
|
|
986
1011
|
thematicBreak: /^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/
|
|
987
1012
|
};
|
|
988
|
-
function
|
|
1013
|
+
function mt(e) {
|
|
989
1014
|
return L.test(e.trimStart());
|
|
990
1015
|
}
|
|
991
|
-
function
|
|
1016
|
+
function ht(e) {
|
|
992
1017
|
let t = e.trimStart();
|
|
993
|
-
return R.bulletItem.test(t) ||
|
|
1018
|
+
return R.bulletItem.test(t) || mt(t) || R.heading.test(t) || R.thematicBreak.test(t) && !t.startsWith("-") || /^>\s?/.test(t) || R.codeFence.test(t) || R.blockMath.test(t);
|
|
994
1019
|
}
|
|
995
|
-
function
|
|
1020
|
+
function gt(e) {
|
|
996
1021
|
return Object.values(R).some((t) => t.test(e));
|
|
997
1022
|
}
|
|
998
|
-
function
|
|
1023
|
+
function _t(e) {
|
|
999
1024
|
let t = [], n = [], r = !1;
|
|
1000
1025
|
return e.forEach((e) => {
|
|
1001
1026
|
if (r) {
|
|
@@ -1006,7 +1031,7 @@ function ht(e) {
|
|
|
1006
1031
|
r = !0, n.push(e);
|
|
1007
1032
|
return;
|
|
1008
1033
|
}
|
|
1009
|
-
if (t.length > 0 &&
|
|
1034
|
+
if (t.length > 0 && ht(e)) {
|
|
1010
1035
|
r = !0, n.push(e);
|
|
1011
1036
|
return;
|
|
1012
1037
|
}
|
|
@@ -1016,21 +1041,21 @@ function ht(e) {
|
|
|
1016
1041
|
blockLines: n
|
|
1017
1042
|
};
|
|
1018
1043
|
}
|
|
1019
|
-
function
|
|
1044
|
+
function vt(e) {
|
|
1020
1045
|
let t = [], n = 0, r = 0;
|
|
1021
1046
|
for (; n < e.length;) {
|
|
1022
1047
|
let i = e[n], a = i.match(L);
|
|
1023
1048
|
if (!a) break;
|
|
1024
|
-
let [, o, s, c, l] = a, u = o.length, d = parseInt(s, 10), f = isNaN(d) ?
|
|
1049
|
+
let [, o, s, c, l] = a, u = o.length, d = parseInt(s, 10), f = isNaN(d) ? M(s) : void 0, p = isNaN(d) ? Xe(s) : d, m = [l], h = n + 1, g = [i], _ = !1;
|
|
1025
1050
|
for (; h < e.length;) {
|
|
1026
1051
|
let t = e[h];
|
|
1027
1052
|
if (t.match(L)) break;
|
|
1028
1053
|
if (t.trim() === "") g.push(t), m.push(""), _ = !0, h += 1;
|
|
1029
|
-
else if (t.match(
|
|
1054
|
+
else if (t.match(pt)) {
|
|
1030
1055
|
let e = t.length - t.trimStart().length, n = u + s.length + 1;
|
|
1031
1056
|
g.push(t), m.push(t.slice(Math.min(e, n))), h += 1;
|
|
1032
1057
|
} else {
|
|
1033
|
-
if (_ ||
|
|
1058
|
+
if (_ || gt(t)) break;
|
|
1034
1059
|
g.push(t), m.push(t), h += 1;
|
|
1035
1060
|
}
|
|
1036
1061
|
}
|
|
@@ -1045,22 +1070,22 @@ function gt(e) {
|
|
|
1045
1070
|
}
|
|
1046
1071
|
return [t, r];
|
|
1047
1072
|
}
|
|
1048
|
-
var
|
|
1049
|
-
function
|
|
1073
|
+
var yt = RegExp(`^(${Ge})([.)])\\s+(.+)$`);
|
|
1074
|
+
function bt(e) {
|
|
1050
1075
|
let t = e.split("\n").filter((e) => e.trim().length > 0);
|
|
1051
1076
|
if (t.length === 0) return null;
|
|
1052
1077
|
let n = [];
|
|
1053
1078
|
for (let e of t) {
|
|
1054
|
-
let t = e.trim().match(
|
|
1079
|
+
let t = e.trim().match(yt);
|
|
1055
1080
|
if (!t) return null;
|
|
1056
1081
|
n.push({
|
|
1057
1082
|
marker: t[1],
|
|
1058
1083
|
content: t[3]
|
|
1059
1084
|
});
|
|
1060
1085
|
}
|
|
1061
|
-
return
|
|
1086
|
+
return Qe(n.map((e) => e.marker)) ? {
|
|
1062
1087
|
type: "orderedList",
|
|
1063
|
-
attrs:
|
|
1088
|
+
attrs: et(n[0].marker),
|
|
1064
1089
|
content: n.map((e) => ({
|
|
1065
1090
|
type: "listItem",
|
|
1066
1091
|
content: [{
|
|
@@ -1073,12 +1098,12 @@ function vt(e) {
|
|
|
1073
1098
|
}))
|
|
1074
1099
|
} : null;
|
|
1075
1100
|
}
|
|
1076
|
-
function
|
|
1101
|
+
function xt(e, t, n) {
|
|
1077
1102
|
let r = [], i = 0;
|
|
1078
1103
|
for (; i < e.length;) {
|
|
1079
1104
|
let a = e[i];
|
|
1080
1105
|
if (a.indent === t) {
|
|
1081
|
-
let { paragraphLines: o, blockLines: s } =
|
|
1106
|
+
let { paragraphLines: o, blockLines: s } = _t(a.contentLines), c = o.join("\n").trim(), l = [];
|
|
1082
1107
|
c && l.push({
|
|
1083
1108
|
type: "paragraph",
|
|
1084
1109
|
raw: c,
|
|
@@ -1092,7 +1117,7 @@ function yt(e, t, n) {
|
|
|
1092
1117
|
let d = i + 1, f = [];
|
|
1093
1118
|
for (; d < e.length && e[d].indent > t;) f.push(e[d]), d += 1;
|
|
1094
1119
|
if (f.length > 0) {
|
|
1095
|
-
let e =
|
|
1120
|
+
let e = xt(f, Math.min(...f.map((e) => e.indent)), n);
|
|
1096
1121
|
l.push({
|
|
1097
1122
|
type: "list",
|
|
1098
1123
|
ordered: !0,
|
|
@@ -1111,7 +1136,7 @@ function yt(e, t, n) {
|
|
|
1111
1136
|
}
|
|
1112
1137
|
return r;
|
|
1113
1138
|
}
|
|
1114
|
-
function
|
|
1139
|
+
function St(e, t) {
|
|
1115
1140
|
return e.map((e) => {
|
|
1116
1141
|
if (e.type !== "list_item") return t.parseChildren([e])[0];
|
|
1117
1142
|
let n = [];
|
|
@@ -1133,8 +1158,8 @@ function bt(e, t) {
|
|
|
1133
1158
|
};
|
|
1134
1159
|
});
|
|
1135
1160
|
}
|
|
1136
|
-
var
|
|
1137
|
-
function
|
|
1161
|
+
var Ct = "listItem", wt = "textStyle", Tt = /^(\d+)\.\s$/;
|
|
1162
|
+
function Et(e) {
|
|
1138
1163
|
let t = e.match(/list-style-type\s*:\s*([^;]+)/i);
|
|
1139
1164
|
if (!t) return null;
|
|
1140
1165
|
switch (t[1].trim().toLowerCase()) {
|
|
@@ -1147,7 +1172,7 @@ function wt(e) {
|
|
|
1147
1172
|
default: return null;
|
|
1148
1173
|
}
|
|
1149
1174
|
}
|
|
1150
|
-
var
|
|
1175
|
+
var Dt = S.create({
|
|
1151
1176
|
name: "orderedList",
|
|
1152
1177
|
addOptions() {
|
|
1153
1178
|
return {
|
|
@@ -1174,14 +1199,14 @@ var Tt = S.create({
|
|
|
1174
1199
|
if (t) return t;
|
|
1175
1200
|
let n = e.getAttribute("style");
|
|
1176
1201
|
if (n) {
|
|
1177
|
-
let e =
|
|
1202
|
+
let e = Et(n);
|
|
1178
1203
|
if (e) return e;
|
|
1179
1204
|
}
|
|
1180
1205
|
let r = e.querySelector("li");
|
|
1181
1206
|
if (r) {
|
|
1182
1207
|
let e = r.getAttribute("style");
|
|
1183
1208
|
if (e) {
|
|
1184
|
-
let t =
|
|
1209
|
+
let t = Et(e);
|
|
1185
1210
|
if (t) return t;
|
|
1186
1211
|
}
|
|
1187
1212
|
}
|
|
@@ -1204,7 +1229,7 @@ var Tt = S.create({
|
|
|
1204
1229
|
markdownTokenName: "list",
|
|
1205
1230
|
parseMarkdown: (e, t) => {
|
|
1206
1231
|
if (e.type !== "list" || !e.ordered) return [];
|
|
1207
|
-
let n = e.start || 1, r = e.typeMarker, i = e.items ?
|
|
1232
|
+
let n = e.start || 1, r = e.typeMarker, i = e.items ? St(e.items, t) : [], a = {};
|
|
1208
1233
|
return n !== 1 && (a.start = n), r && (a.type = r), Object.keys(a).length > 0 ? {
|
|
1209
1234
|
type: "orderedList",
|
|
1210
1235
|
attrs: a,
|
|
@@ -1220,9 +1245,9 @@ var Tt = S.create({
|
|
|
1220
1245
|
level: "block",
|
|
1221
1246
|
start: () => -1,
|
|
1222
1247
|
tokenize: (e, t, n) => {
|
|
1223
|
-
let r = e.split("\n"), [i, a] =
|
|
1248
|
+
let r = e.split("\n"), [i, a] = vt(r);
|
|
1224
1249
|
if (i.length === 0) return;
|
|
1225
|
-
let o =
|
|
1250
|
+
let o = xt(i, i[0].indent, n);
|
|
1226
1251
|
if (o.length !== 0) return {
|
|
1227
1252
|
type: "list",
|
|
1228
1253
|
ordered: !0,
|
|
@@ -1235,17 +1260,17 @@ var Tt = S.create({
|
|
|
1235
1260
|
},
|
|
1236
1261
|
markdownOptions: { indentsContent: !0 },
|
|
1237
1262
|
addCommands() {
|
|
1238
|
-
return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(
|
|
1263
|
+
return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Ct, this.editor.getAttributes(wt)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
|
|
1239
1264
|
},
|
|
1240
1265
|
addKeyboardShortcuts() {
|
|
1241
1266
|
return { "Mod-Shift-7": () => this.editor.commands.toggleOrderedList() };
|
|
1242
1267
|
},
|
|
1243
1268
|
addProseMirrorPlugins() {
|
|
1244
|
-
return [new
|
|
1269
|
+
return [new h({ props: { handlePaste: (e, t) => {
|
|
1245
1270
|
if ((t.clipboardData?.getData("text/html"))?.trim()) return !1;
|
|
1246
1271
|
let n = t.clipboardData?.getData("text/plain");
|
|
1247
1272
|
if (!n) return !1;
|
|
1248
|
-
let r =
|
|
1273
|
+
let r = bt(n);
|
|
1249
1274
|
if (!r) return !1;
|
|
1250
1275
|
try {
|
|
1251
1276
|
let t = e.state.schema.nodeFromJSON(r), n = e.state.tr.replaceSelectionWith(t);
|
|
@@ -1256,26 +1281,26 @@ var Tt = S.create({
|
|
|
1256
1281
|
} } })];
|
|
1257
1282
|
},
|
|
1258
1283
|
addInputRules() {
|
|
1259
|
-
let e = (e, t) => (!t.attrs.type || t.attrs.type === "1") && t.childCount + t.attrs.start === +e[1], t =
|
|
1260
|
-
find:
|
|
1284
|
+
let e = (e, t) => (!t.attrs.type || t.attrs.type === "1") && t.childCount + t.attrs.start === +e[1], t = E({
|
|
1285
|
+
find: Tt,
|
|
1261
1286
|
type: this.type,
|
|
1262
1287
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
1263
1288
|
joinPredicate: e
|
|
1264
1289
|
});
|
|
1265
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (t =
|
|
1266
|
-
find:
|
|
1290
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (t = E({
|
|
1291
|
+
find: Tt,
|
|
1267
1292
|
type: this.type,
|
|
1268
1293
|
keepMarks: this.options.keepMarks,
|
|
1269
1294
|
keepAttributes: this.options.keepAttributes,
|
|
1270
1295
|
getAttributes: (e) => ({
|
|
1271
1296
|
start: +e[1],
|
|
1272
|
-
...this.editor.getAttributes(
|
|
1297
|
+
...this.editor.getAttributes(wt)
|
|
1273
1298
|
}),
|
|
1274
1299
|
joinPredicate: e,
|
|
1275
1300
|
editor: this.editor
|
|
1276
1301
|
})), [t];
|
|
1277
1302
|
}
|
|
1278
|
-
}),
|
|
1303
|
+
}), Ot = /^\s*(\[([( |x])?\])\s$/, kt = "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0", At = (e, t, n) => (n?.checkboxLabel)?.call(n, e, t) || `Task item checkbox for ${e.textContent || "empty task item"}`, jt = S.create({
|
|
1279
1304
|
name: "taskItem",
|
|
1280
1305
|
addOptions() {
|
|
1281
1306
|
return {
|
|
@@ -1303,7 +1328,8 @@ var Tt = S.create({
|
|
|
1303
1328
|
parseHTML() {
|
|
1304
1329
|
return [{
|
|
1305
1330
|
tag: `li[data-type="${this.name}"]`,
|
|
1306
|
-
priority: 51
|
|
1331
|
+
priority: 51,
|
|
1332
|
+
contentElement: (e) => e.querySelector("div") ?? e
|
|
1307
1333
|
}];
|
|
1308
1334
|
},
|
|
1309
1335
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
@@ -1331,10 +1357,10 @@ var Tt = S.create({
|
|
|
1331
1357
|
},
|
|
1332
1358
|
renderMarkdown: (e, t) => {
|
|
1333
1359
|
let n = `- [${e.attrs?.checked ? "x" : " "}] `;
|
|
1334
|
-
return
|
|
1360
|
+
return r(e, t, n);
|
|
1335
1361
|
},
|
|
1336
1362
|
addExtensions() {
|
|
1337
|
-
return this.options.nested ? [
|
|
1363
|
+
return this.options.nested ? [Ue(this.name, [this.options.taskListTypeName])] : [];
|
|
1338
1364
|
},
|
|
1339
1365
|
addKeyboardShortcuts() {
|
|
1340
1366
|
let e = {
|
|
@@ -1348,9 +1374,11 @@ var Tt = S.create({
|
|
|
1348
1374
|
},
|
|
1349
1375
|
addNodeView() {
|
|
1350
1376
|
return ({ node: e, HTMLAttributes: t, getPos: n, editor: r }) => {
|
|
1351
|
-
let i = document.createElement("li"), a = document.createElement("label"), o = document.createElement("span"), s = document.createElement("input"), c = document.createElement("div")
|
|
1352
|
-
|
|
1353
|
-
|
|
1377
|
+
let i = document.createElement("li"), a = document.createElement("label"), o = document.createElement("span"), s = document.createElement("input"), c = document.createElement("div");
|
|
1378
|
+
o.style.cssText = kt;
|
|
1379
|
+
let l = (e) => {
|
|
1380
|
+
let t = At(e, e.attrs.checked, this.options.a11y);
|
|
1381
|
+
s.setAttribute("aria-label", t), o.textContent = t;
|
|
1354
1382
|
};
|
|
1355
1383
|
l(e), a.contentEditable = "false", s.type = "checkbox", s.addEventListener("mousedown", (e) => e.preventDefault()), s.addEventListener("change", (t) => {
|
|
1356
1384
|
if (!r.isEditable && !this.options.onReadOnlyChecked) {
|
|
@@ -1390,13 +1418,13 @@ var Tt = S.create({
|
|
|
1390
1418
|
};
|
|
1391
1419
|
},
|
|
1392
1420
|
addInputRules() {
|
|
1393
|
-
return [
|
|
1394
|
-
find:
|
|
1421
|
+
return [E({
|
|
1422
|
+
find: Ot,
|
|
1395
1423
|
type: this.type,
|
|
1396
1424
|
getAttributes: (e) => ({ checked: e[e.length - 1] === "x" })
|
|
1397
1425
|
})];
|
|
1398
1426
|
}
|
|
1399
|
-
}),
|
|
1427
|
+
}), Mt = S.create({
|
|
1400
1428
|
name: "taskList",
|
|
1401
1429
|
addOptions() {
|
|
1402
1430
|
return {
|
|
@@ -1430,9 +1458,9 @@ var Tt = S.create({
|
|
|
1430
1458
|
let t = e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;
|
|
1431
1459
|
return t === void 0 ? -1 : t;
|
|
1432
1460
|
},
|
|
1433
|
-
tokenize(e, t,
|
|
1434
|
-
let
|
|
1435
|
-
let t =
|
|
1461
|
+
tokenize(e, t, r) {
|
|
1462
|
+
let i = (e) => {
|
|
1463
|
+
let t = n(e, {
|
|
1436
1464
|
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
1437
1465
|
extractItemData: (e) => ({
|
|
1438
1466
|
indentLevel: e[1].length,
|
|
@@ -1446,21 +1474,21 @@ var Tt = S.create({
|
|
|
1446
1474
|
indentLevel: e.indentLevel,
|
|
1447
1475
|
checked: e.checked,
|
|
1448
1476
|
text: e.mainContent,
|
|
1449
|
-
tokens:
|
|
1477
|
+
tokens: r.inlineTokens(e.mainContent),
|
|
1450
1478
|
nestedTokens: t
|
|
1451
1479
|
}),
|
|
1452
|
-
customNestedParser:
|
|
1453
|
-
},
|
|
1480
|
+
customNestedParser: i
|
|
1481
|
+
}, r);
|
|
1454
1482
|
if (t) {
|
|
1455
|
-
let
|
|
1483
|
+
let n = {
|
|
1456
1484
|
type: "taskList",
|
|
1457
1485
|
raw: t.raw,
|
|
1458
1486
|
items: t.items
|
|
1459
1487
|
}, i = e.slice(t.raw.length);
|
|
1460
|
-
return i.trim() ? [
|
|
1488
|
+
return i.trim() ? [n, ...r.blockTokens(i)] : [n];
|
|
1461
1489
|
}
|
|
1462
|
-
return
|
|
1463
|
-
},
|
|
1490
|
+
return r.blockTokens(e);
|
|
1491
|
+
}, a = n(e, {
|
|
1464
1492
|
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
1465
1493
|
extractItemData: (e) => ({
|
|
1466
1494
|
indentLevel: e[1].length,
|
|
@@ -1474,15 +1502,15 @@ var Tt = S.create({
|
|
|
1474
1502
|
indentLevel: e.indentLevel,
|
|
1475
1503
|
checked: e.checked,
|
|
1476
1504
|
text: e.mainContent,
|
|
1477
|
-
tokens:
|
|
1505
|
+
tokens: r.inlineTokens(e.mainContent),
|
|
1478
1506
|
nestedTokens: t
|
|
1479
1507
|
}),
|
|
1480
|
-
customNestedParser:
|
|
1481
|
-
},
|
|
1482
|
-
if (
|
|
1508
|
+
customNestedParser: i
|
|
1509
|
+
}, r);
|
|
1510
|
+
if (a) return {
|
|
1483
1511
|
type: "taskList",
|
|
1484
|
-
raw:
|
|
1485
|
-
items:
|
|
1512
|
+
raw: a.raw,
|
|
1513
|
+
items: a.items
|
|
1486
1514
|
};
|
|
1487
1515
|
}
|
|
1488
1516
|
},
|
|
@@ -1494,16 +1522,16 @@ var Tt = S.create({
|
|
|
1494
1522
|
return { "Mod-Shift-9": () => this.editor.commands.toggleTaskList() };
|
|
1495
1523
|
}
|
|
1496
1524
|
});
|
|
1497
|
-
|
|
1525
|
+
T.create({
|
|
1498
1526
|
name: "listKit",
|
|
1499
1527
|
addExtensions() {
|
|
1500
1528
|
let e = [];
|
|
1501
|
-
return this.options.bulletList !== !1 && e.push(
|
|
1529
|
+
return this.options.bulletList !== !1 && e.push(ze.configure(this.options.bulletList)), this.options.listItem !== !1 && e.push(it.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(ft.configure(this.options.listKeymap)), this.options.orderedList !== !1 && e.push(Dt.configure(this.options.orderedList)), this.options.taskItem !== !1 && e.push(jt.configure(this.options.taskItem)), this.options.taskList !== !1 && e.push(Mt.configure(this.options.taskList)), e;
|
|
1502
1530
|
}
|
|
1503
1531
|
});
|
|
1504
1532
|
//#endregion
|
|
1505
|
-
//#region ../../node_modules/.pnpm/@tiptap+extension-paragraph@3.
|
|
1506
|
-
var z = " ", B = "\xA0",
|
|
1533
|
+
//#region ../../node_modules/.pnpm/@tiptap+extension-paragraph@3.30.1_@tiptap+core@3.30.1_@tiptap+pm@3.30.1_/node_modules/@tiptap/extension-paragraph/dist/index.js
|
|
1534
|
+
var z = " ", B = "\xA0", Nt = S.create({
|
|
1507
1535
|
name: "paragraph",
|
|
1508
1536
|
priority: 1e3,
|
|
1509
1537
|
addOptions() {
|
|
@@ -1542,7 +1570,7 @@ var z = " ", B = "\xA0", kt = S.create({
|
|
|
1542
1570
|
addKeyboardShortcuts() {
|
|
1543
1571
|
return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
|
|
1544
1572
|
}
|
|
1545
|
-
}),
|
|
1573
|
+
}), Pt = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, Ft = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, It = y.create({
|
|
1546
1574
|
name: "strike",
|
|
1547
1575
|
addOptions() {
|
|
1548
1576
|
return { HTMLAttributes: {} };
|
|
@@ -1580,18 +1608,18 @@ var z = " ", B = "\xA0", kt = S.create({
|
|
|
1580
1608
|
return { "Mod-Shift-s": () => this.editor.commands.toggleStrike() };
|
|
1581
1609
|
},
|
|
1582
1610
|
addInputRules() {
|
|
1583
|
-
return [
|
|
1584
|
-
find:
|
|
1611
|
+
return [b({
|
|
1612
|
+
find: Pt,
|
|
1585
1613
|
type: this.type
|
|
1586
1614
|
})];
|
|
1587
1615
|
},
|
|
1588
1616
|
addPasteRules() {
|
|
1589
|
-
return [
|
|
1590
|
-
find:
|
|
1617
|
+
return [C({
|
|
1618
|
+
find: Ft,
|
|
1591
1619
|
type: this.type
|
|
1592
1620
|
})];
|
|
1593
1621
|
}
|
|
1594
|
-
}),
|
|
1622
|
+
}), Lt = S.create({
|
|
1595
1623
|
name: "text",
|
|
1596
1624
|
group: "inline",
|
|
1597
1625
|
parseMarkdown: (e) => ({
|
|
@@ -1602,12 +1630,12 @@ var z = " ", B = "\xA0", kt = S.create({
|
|
|
1602
1630
|
});
|
|
1603
1631
|
//#endregion
|
|
1604
1632
|
//#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.3/node_modules/prosemirror-dropcursor/dist/index.js
|
|
1605
|
-
function
|
|
1606
|
-
return new
|
|
1607
|
-
return new
|
|
1633
|
+
function Rt(e = {}) {
|
|
1634
|
+
return new h({ view(t) {
|
|
1635
|
+
return new zt(t, e);
|
|
1608
1636
|
} });
|
|
1609
1637
|
}
|
|
1610
|
-
var
|
|
1638
|
+
var zt = class {
|
|
1611
1639
|
constructor(e, t) {
|
|
1612
1640
|
this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.lastDragEvent = null, this.width = t.width ?? 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = [
|
|
1613
1641
|
"dragover",
|
|
@@ -1683,14 +1711,14 @@ var Ft = class {
|
|
|
1683
1711
|
let t = this.editorView.posAtCoords({
|
|
1684
1712
|
left: e.clientX,
|
|
1685
1713
|
top: e.clientY
|
|
1686
|
-
}), n = t && t.inside >= 0 && this.editorView.state.doc.nodeAt(t.inside),
|
|
1687
|
-
if (!t ||
|
|
1688
|
-
let
|
|
1714
|
+
}), n = t && t.inside >= 0 && this.editorView.state.doc.nodeAt(t.inside), r = n && n.type.spec.disableDropCursor, i = typeof r == "function" ? r(this.editorView, t, e) : r;
|
|
1715
|
+
if (!t || i) return null;
|
|
1716
|
+
let a = t.pos;
|
|
1689
1717
|
if (this.editorView.dragging && this.editorView.dragging.slice) {
|
|
1690
|
-
let e =
|
|
1691
|
-
e != null && (
|
|
1718
|
+
let e = _(this.editorView.state.doc, a, this.editorView.dragging.slice);
|
|
1719
|
+
e != null && (a = e);
|
|
1692
1720
|
}
|
|
1693
|
-
return
|
|
1721
|
+
return a;
|
|
1694
1722
|
}
|
|
1695
1723
|
dragover(e) {
|
|
1696
1724
|
if (!this.editorView.editable) return;
|
|
@@ -1707,19 +1735,19 @@ var Ft = class {
|
|
|
1707
1735
|
dragleave(e) {
|
|
1708
1736
|
this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
|
|
1709
1737
|
}
|
|
1710
|
-
}, V = class
|
|
1738
|
+
}, V = class e extends c {
|
|
1711
1739
|
constructor(e) {
|
|
1712
1740
|
super(e, e);
|
|
1713
1741
|
}
|
|
1714
|
-
map(
|
|
1715
|
-
let
|
|
1716
|
-
return
|
|
1742
|
+
map(t, n) {
|
|
1743
|
+
let r = t.resolve(n.map(this.head));
|
|
1744
|
+
return e.valid(r) ? new e(r) : c.near(r);
|
|
1717
1745
|
}
|
|
1718
1746
|
content() {
|
|
1719
|
-
return
|
|
1747
|
+
return v.empty;
|
|
1720
1748
|
}
|
|
1721
|
-
eq(
|
|
1722
|
-
return
|
|
1749
|
+
eq(t) {
|
|
1750
|
+
return t instanceof e && t.head == this.head;
|
|
1723
1751
|
}
|
|
1724
1752
|
toJSON() {
|
|
1725
1753
|
return {
|
|
@@ -1727,70 +1755,70 @@ var Ft = class {
|
|
|
1727
1755
|
pos: this.head
|
|
1728
1756
|
};
|
|
1729
1757
|
}
|
|
1730
|
-
static fromJSON(
|
|
1758
|
+
static fromJSON(t, n) {
|
|
1731
1759
|
if (typeof n.pos != "number") throw RangeError("Invalid input for GapCursor.fromJSON");
|
|
1732
|
-
return new t
|
|
1760
|
+
return new e(t.resolve(n.pos));
|
|
1733
1761
|
}
|
|
1734
1762
|
getBookmark() {
|
|
1735
|
-
return new
|
|
1763
|
+
return new Bt(this.anchor);
|
|
1736
1764
|
}
|
|
1737
1765
|
static valid(e) {
|
|
1738
1766
|
let t = e.parent;
|
|
1739
|
-
if (t.inlineContent || !
|
|
1767
|
+
if (t.inlineContent || !Ht(e) || !Ut(e)) return !1;
|
|
1740
1768
|
let n = t.type.spec.allowGapCursor;
|
|
1741
1769
|
if (n != null) return n;
|
|
1742
1770
|
let r = t.contentMatchAt(e.index()).defaultType;
|
|
1743
1771
|
return r && r.isTextblock;
|
|
1744
1772
|
}
|
|
1745
|
-
static findGapCursorFrom(
|
|
1773
|
+
static findGapCursorFrom(t, n, r = !1) {
|
|
1746
1774
|
search: for (;;) {
|
|
1747
|
-
if (!r &&
|
|
1748
|
-
let i =
|
|
1749
|
-
for (let r =
|
|
1750
|
-
let o =
|
|
1751
|
-
if (n > 0 ?
|
|
1752
|
-
a = o.child(n > 0 ?
|
|
1775
|
+
if (!r && e.valid(t)) return t;
|
|
1776
|
+
let i = t.pos, a = null;
|
|
1777
|
+
for (let r = t.depth;; r--) {
|
|
1778
|
+
let o = t.node(r);
|
|
1779
|
+
if (n > 0 ? t.indexAfter(r) < o.childCount : t.index(r) > 0) {
|
|
1780
|
+
a = o.child(n > 0 ? t.indexAfter(r) : t.index(r) - 1);
|
|
1753
1781
|
break;
|
|
1754
1782
|
}
|
|
1755
1783
|
if (r == 0) return null;
|
|
1756
1784
|
i += n;
|
|
1757
|
-
let s =
|
|
1758
|
-
if (
|
|
1785
|
+
let s = t.doc.resolve(i);
|
|
1786
|
+
if (e.valid(s)) return s;
|
|
1759
1787
|
}
|
|
1760
1788
|
for (;;) {
|
|
1761
1789
|
let o = n > 0 ? a.firstChild : a.lastChild;
|
|
1762
1790
|
if (!o) {
|
|
1763
|
-
if (a.isAtom && !a.isText && !
|
|
1764
|
-
|
|
1791
|
+
if (a.isAtom && !a.isText && !f.isSelectable(a)) {
|
|
1792
|
+
t = t.doc.resolve(i + a.nodeSize * n), r = !1;
|
|
1765
1793
|
continue search;
|
|
1766
1794
|
}
|
|
1767
1795
|
break;
|
|
1768
1796
|
}
|
|
1769
1797
|
a = o, i += n;
|
|
1770
|
-
let s =
|
|
1771
|
-
if (
|
|
1798
|
+
let s = t.doc.resolve(i);
|
|
1799
|
+
if (e.valid(s)) return s;
|
|
1772
1800
|
}
|
|
1773
1801
|
return null;
|
|
1774
1802
|
}
|
|
1775
1803
|
}
|
|
1776
1804
|
};
|
|
1777
|
-
V.prototype.visible = !1, V.findFrom = V.findGapCursorFrom,
|
|
1778
|
-
var
|
|
1805
|
+
V.prototype.visible = !1, V.findFrom = V.findGapCursorFrom, c.jsonID("gapcursor", V);
|
|
1806
|
+
var Bt = class e {
|
|
1779
1807
|
constructor(e) {
|
|
1780
1808
|
this.pos = e;
|
|
1781
1809
|
}
|
|
1782
|
-
map(
|
|
1783
|
-
return new t
|
|
1810
|
+
map(t) {
|
|
1811
|
+
return new e(t.map(this.pos));
|
|
1784
1812
|
}
|
|
1785
|
-
resolve(
|
|
1786
|
-
let
|
|
1787
|
-
return V.valid(
|
|
1813
|
+
resolve(e) {
|
|
1814
|
+
let t = e.resolve(this.pos);
|
|
1815
|
+
return V.valid(t) ? new V(t) : c.near(t);
|
|
1788
1816
|
}
|
|
1789
1817
|
};
|
|
1790
|
-
function
|
|
1818
|
+
function Vt(e) {
|
|
1791
1819
|
return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
|
|
1792
1820
|
}
|
|
1793
|
-
function
|
|
1821
|
+
function Ht(e) {
|
|
1794
1822
|
for (let t = e.depth; t >= 0; t--) {
|
|
1795
1823
|
let n = e.index(t), r = e.node(t);
|
|
1796
1824
|
if (n == 0) {
|
|
@@ -1798,13 +1826,13 @@ function Rt(e) {
|
|
|
1798
1826
|
continue;
|
|
1799
1827
|
}
|
|
1800
1828
|
for (let e = r.child(n - 1);; e = e.lastChild) {
|
|
1801
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
1829
|
+
if (e.childCount == 0 && !e.inlineContent || Vt(e.type)) return !0;
|
|
1802
1830
|
if (e.inlineContent) return !1;
|
|
1803
1831
|
}
|
|
1804
1832
|
}
|
|
1805
1833
|
return !0;
|
|
1806
1834
|
}
|
|
1807
|
-
function
|
|
1835
|
+
function Ut(e) {
|
|
1808
1836
|
for (let t = e.depth; t >= 0; t--) {
|
|
1809
1837
|
let n = e.indexAfter(t), r = e.node(t);
|
|
1810
1838
|
if (n == r.childCount) {
|
|
@@ -1812,24 +1840,24 @@ function zt(e) {
|
|
|
1812
1840
|
continue;
|
|
1813
1841
|
}
|
|
1814
1842
|
for (let e = r.child(n);; e = e.firstChild) {
|
|
1815
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
1843
|
+
if (e.childCount == 0 && !e.inlineContent || Vt(e.type)) return !0;
|
|
1816
1844
|
if (e.inlineContent) return !1;
|
|
1817
1845
|
}
|
|
1818
1846
|
}
|
|
1819
1847
|
return !0;
|
|
1820
1848
|
}
|
|
1821
|
-
function
|
|
1822
|
-
return new
|
|
1823
|
-
decorations:
|
|
1849
|
+
function Wt() {
|
|
1850
|
+
return new h({ props: {
|
|
1851
|
+
decorations: Jt,
|
|
1824
1852
|
createSelectionBetween(e, t, n) {
|
|
1825
1853
|
return t.pos == n.pos && V.valid(n) ? new V(n) : null;
|
|
1826
1854
|
},
|
|
1827
|
-
handleClick:
|
|
1828
|
-
handleKeyDown:
|
|
1829
|
-
handleDOMEvents: { beforeinput:
|
|
1855
|
+
handleClick: Kt,
|
|
1856
|
+
handleKeyDown: Gt,
|
|
1857
|
+
handleDOMEvents: { beforeinput: qt }
|
|
1830
1858
|
} });
|
|
1831
1859
|
}
|
|
1832
|
-
var
|
|
1860
|
+
var Gt = e({
|
|
1833
1861
|
ArrowLeft: H("horiz", -1),
|
|
1834
1862
|
ArrowRight: H("horiz", 1),
|
|
1835
1863
|
ArrowUp: H("vert", -1),
|
|
@@ -1847,7 +1875,7 @@ function H(e, t) {
|
|
|
1847
1875
|
return c ? (r && r(e.tr.setSelection(new V(c))), !0) : !1;
|
|
1848
1876
|
};
|
|
1849
1877
|
}
|
|
1850
|
-
function
|
|
1878
|
+
function Kt(e, t, n) {
|
|
1851
1879
|
if (!e || !e.editable) return !1;
|
|
1852
1880
|
let r = e.state.doc.resolve(t);
|
|
1853
1881
|
if (!V.valid(r)) return !1;
|
|
@@ -1855,21 +1883,21 @@ function Ht(e, t, n) {
|
|
|
1855
1883
|
left: n.clientX,
|
|
1856
1884
|
top: n.clientY
|
|
1857
1885
|
});
|
|
1858
|
-
return i && i.inside > -1 &&
|
|
1886
|
+
return i && i.inside > -1 && f.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new V(r))), !0);
|
|
1859
1887
|
}
|
|
1860
|
-
function
|
|
1888
|
+
function qt(e, t) {
|
|
1861
1889
|
if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof V)) return !1;
|
|
1862
|
-
let { $from:
|
|
1863
|
-
if (!
|
|
1864
|
-
let
|
|
1865
|
-
for (let e =
|
|
1866
|
-
let
|
|
1867
|
-
return
|
|
1890
|
+
let { $from: n } = e.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);
|
|
1891
|
+
if (!r) return !1;
|
|
1892
|
+
let i = g.empty;
|
|
1893
|
+
for (let e = r.length - 1; e >= 0; e--) i = g.from(r[e].createAndFill(null, i));
|
|
1894
|
+
let a = e.state.tr.replace(n.pos, n.pos, new v(i, 0, 0));
|
|
1895
|
+
return a.setSelection(w.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
|
|
1868
1896
|
}
|
|
1869
|
-
function
|
|
1897
|
+
function Jt(e) {
|
|
1870
1898
|
if (!(e.selection instanceof V)) return null;
|
|
1871
1899
|
let t = document.createElement("div");
|
|
1872
|
-
return t.className = "ProseMirror-gapcursor",
|
|
1900
|
+
return t.className = "ProseMirror-gapcursor", a.create(e.doc, [p.widget(e.selection.head, t, { key: "gapcursor" })]);
|
|
1873
1901
|
}
|
|
1874
1902
|
//#endregion
|
|
1875
1903
|
//#region ../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
|
|
@@ -1879,7 +1907,7 @@ W.prototype.append = function(e) {
|
|
|
1879
1907
|
}, W.prototype.prepend = function(e) {
|
|
1880
1908
|
return e.length ? W.from(e).append(this) : this;
|
|
1881
1909
|
}, W.prototype.appendInner = function(e) {
|
|
1882
|
-
return new
|
|
1910
|
+
return new Xt(this, e);
|
|
1883
1911
|
}, W.prototype.slice = function(e, t) {
|
|
1884
1912
|
return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? W.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
|
|
1885
1913
|
}, W.prototype.get = function(e) {
|
|
@@ -1893,9 +1921,9 @@ W.prototype.append = function(e) {
|
|
|
1893
1921
|
return r.push(e(t, n));
|
|
1894
1922
|
}, t, n), r;
|
|
1895
1923
|
}, W.from = function(e) {
|
|
1896
|
-
return e instanceof W ? e : e && e.length ? new
|
|
1924
|
+
return e instanceof W ? e : e && e.length ? new Yt(e) : W.empty;
|
|
1897
1925
|
};
|
|
1898
|
-
var
|
|
1926
|
+
var Yt = /* @__PURE__ */ function(e) {
|
|
1899
1927
|
function t(t) {
|
|
1900
1928
|
e.call(this), this.values = t;
|
|
1901
1929
|
}
|
|
@@ -1924,8 +1952,8 @@ var Gt = /* @__PURE__ */ function(e) {
|
|
|
1924
1952
|
return 0;
|
|
1925
1953
|
}, Object.defineProperties(t.prototype, n), t;
|
|
1926
1954
|
}(W);
|
|
1927
|
-
W.empty = new
|
|
1928
|
-
var
|
|
1955
|
+
W.empty = new Yt([]);
|
|
1956
|
+
var Xt = /* @__PURE__ */ function(e) {
|
|
1929
1957
|
function t(t, n) {
|
|
1930
1958
|
e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
|
|
1931
1959
|
}
|
|
@@ -1952,7 +1980,7 @@ var Kt = /* @__PURE__ */ function(e) {
|
|
|
1952
1980
|
}, t.prototype.appendInner = function(e) {
|
|
1953
1981
|
return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
|
|
1954
1982
|
}, t;
|
|
1955
|
-
}(W),
|
|
1983
|
+
}(W), Zt = 500, G = class e {
|
|
1956
1984
|
constructor(e, t) {
|
|
1957
1985
|
this.items = e, this.eventCount = t;
|
|
1958
1986
|
}
|
|
@@ -1990,10 +2018,10 @@ var Kt = /* @__PURE__ */ function(e) {
|
|
|
1990
2018
|
(u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
|
|
1991
2019
|
}
|
|
1992
2020
|
let l = o - r.depth;
|
|
1993
|
-
return l >
|
|
2021
|
+
return l > $t && (s = Qt(s, l), o -= l), new e(s.append(a), o);
|
|
1994
2022
|
}
|
|
1995
2023
|
remapping(e, t) {
|
|
1996
|
-
let n = new
|
|
2024
|
+
let n = new s();
|
|
1997
2025
|
return this.items.forEach((t, r) => {
|
|
1998
2026
|
let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
|
|
1999
2027
|
n.appendMap(t.map, i);
|
|
@@ -2022,7 +2050,7 @@ var Kt = /* @__PURE__ */ function(e) {
|
|
|
2022
2050
|
let l = [];
|
|
2023
2051
|
for (let e = n; e < o; e++) l.push(new K(a.maps[e]));
|
|
2024
2052
|
let u = this.items.slice(0, i).append(l).append(r), d = new e(u, s);
|
|
2025
|
-
return d.emptyItemCount() >
|
|
2053
|
+
return d.emptyItemCount() > Zt && (d = d.compress(this.items.length - r.length)), d;
|
|
2026
2054
|
}
|
|
2027
2055
|
emptyItemCount() {
|
|
2028
2056
|
let e = 0;
|
|
@@ -2047,7 +2075,7 @@ var Kt = /* @__PURE__ */ function(e) {
|
|
|
2047
2075
|
}
|
|
2048
2076
|
};
|
|
2049
2077
|
G.empty = new G(W.empty, 0);
|
|
2050
|
-
function
|
|
2078
|
+
function Qt(e, t) {
|
|
2051
2079
|
let n;
|
|
2052
2080
|
return e.forEach((e, r) => {
|
|
2053
2081
|
if (e.selection && t-- == 0) return n = r, !1;
|
|
@@ -2067,21 +2095,21 @@ var K = class e {
|
|
|
2067
2095
|
constructor(e, t, n, r, i) {
|
|
2068
2096
|
this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
|
|
2069
2097
|
}
|
|
2070
|
-
},
|
|
2071
|
-
function
|
|
2098
|
+
}, $t = 20;
|
|
2099
|
+
function en(e, t, n, r) {
|
|
2072
2100
|
let i = n.getMeta(Z), a;
|
|
2073
2101
|
if (i) return i.historyState;
|
|
2074
|
-
n.getMeta(
|
|
2102
|
+
n.getMeta(on) && (e = new q(e.done, e.undone, null, 0, -1));
|
|
2075
2103
|
let o = n.getMeta("appendedTransaction");
|
|
2076
2104
|
if (n.steps.length == 0) return e;
|
|
2077
|
-
if (o && o.getMeta(Z)) return o.getMeta(Z).redo ? new q(e.done.addTransform(n, void 0, r, X(t)), e.undone,
|
|
2105
|
+
if (o && o.getMeta(Z)) return o.getMeta(Z).redo ? new q(e.done.addTransform(n, void 0, r, X(t)), e.undone, nn(n.mapping.maps), e.prevTime, e.prevComposition) : new q(e.done, e.undone.addTransform(n, void 0, r, X(t)), null, e.prevTime, e.prevComposition);
|
|
2078
2106
|
if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
2079
|
-
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !
|
|
2107
|
+
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !tn(n, e.prevRanges)), s = o ? J(e.prevRanges, n.mapping) : nn(n.mapping.maps);
|
|
2080
2108
|
return new q(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, X(t)), G.empty, s, n.time, i ?? e.prevComposition);
|
|
2081
2109
|
}
|
|
2082
2110
|
return (a = n.getMeta("rebased")) ? new q(e.done.rebased(n, a), e.undone.rebased(n, a), J(e.prevRanges, n.mapping), e.prevTime, e.prevComposition) : new q(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), J(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
|
|
2083
2111
|
}
|
|
2084
|
-
function
|
|
2112
|
+
function tn(e, t) {
|
|
2085
2113
|
if (!t) return !1;
|
|
2086
2114
|
if (!e.docChanged) return !0;
|
|
2087
2115
|
let n = !1;
|
|
@@ -2089,7 +2117,7 @@ function Zt(e, t) {
|
|
|
2089
2117
|
for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
|
|
2090
2118
|
}), n;
|
|
2091
2119
|
}
|
|
2092
|
-
function
|
|
2120
|
+
function nn(e) {
|
|
2093
2121
|
let t = [];
|
|
2094
2122
|
for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
|
|
2095
2123
|
return t;
|
|
@@ -2103,7 +2131,7 @@ function J(e, t) {
|
|
|
2103
2131
|
}
|
|
2104
2132
|
return n;
|
|
2105
2133
|
}
|
|
2106
|
-
function
|
|
2134
|
+
function rn(e, t, n) {
|
|
2107
2135
|
let r = X(t), i = Z.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
|
|
2108
2136
|
if (!a) return null;
|
|
2109
2137
|
let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new q(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
|
|
@@ -2112,11 +2140,11 @@ function $t(e, t, n) {
|
|
|
2112
2140
|
historyState: c
|
|
2113
2141
|
});
|
|
2114
2142
|
}
|
|
2115
|
-
var Y = !1,
|
|
2143
|
+
var Y = !1, an = null;
|
|
2116
2144
|
function X(e) {
|
|
2117
2145
|
let t = e.plugins;
|
|
2118
|
-
if (
|
|
2119
|
-
Y = !1,
|
|
2146
|
+
if (an != t) {
|
|
2147
|
+
Y = !1, an = t;
|
|
2120
2148
|
for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
|
|
2121
2149
|
Y = !0;
|
|
2122
2150
|
break;
|
|
@@ -2124,41 +2152,41 @@ function X(e) {
|
|
|
2124
2152
|
}
|
|
2125
2153
|
return Y;
|
|
2126
2154
|
}
|
|
2127
|
-
var Z = new
|
|
2128
|
-
function
|
|
2155
|
+
var Z = new i("history"), on = new i("closeHistory");
|
|
2156
|
+
function sn(e = {}) {
|
|
2129
2157
|
return e = {
|
|
2130
2158
|
depth: e.depth || 100,
|
|
2131
2159
|
newGroupDelay: e.newGroupDelay || 500
|
|
2132
|
-
}, new
|
|
2160
|
+
}, new h({
|
|
2133
2161
|
key: Z,
|
|
2134
2162
|
state: {
|
|
2135
2163
|
init() {
|
|
2136
2164
|
return new q(G.empty, G.empty, null, 0, -1);
|
|
2137
2165
|
},
|
|
2138
2166
|
apply(t, n, r) {
|
|
2139
|
-
return
|
|
2167
|
+
return en(n, r, t, e);
|
|
2140
2168
|
}
|
|
2141
2169
|
},
|
|
2142
2170
|
config: e,
|
|
2143
2171
|
props: { handleDOMEvents: { beforeinput(e, t) {
|
|
2144
|
-
let n = t.inputType, r = n == "historyUndo" ?
|
|
2172
|
+
let n = t.inputType, r = n == "historyUndo" ? ln : n == "historyRedo" ? un : null;
|
|
2145
2173
|
return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
|
|
2146
2174
|
} } }
|
|
2147
2175
|
});
|
|
2148
2176
|
}
|
|
2149
|
-
function
|
|
2177
|
+
function cn(e, t) {
|
|
2150
2178
|
return (n, r) => {
|
|
2151
2179
|
let i = Z.getState(n);
|
|
2152
2180
|
if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
|
|
2153
2181
|
if (r) {
|
|
2154
|
-
let a =
|
|
2182
|
+
let a = rn(i, n, e);
|
|
2155
2183
|
a && r(t ? a.scrollIntoView() : a);
|
|
2156
2184
|
}
|
|
2157
2185
|
return !0;
|
|
2158
2186
|
};
|
|
2159
2187
|
}
|
|
2160
|
-
var
|
|
2161
|
-
|
|
2188
|
+
var ln = cn(!1, !0), un = cn(!0, !0);
|
|
2189
|
+
T.create({
|
|
2162
2190
|
name: "characterCount",
|
|
2163
2191
|
addOptions() {
|
|
2164
2192
|
return {
|
|
@@ -2190,8 +2218,8 @@ b.create({
|
|
|
2190
2218
|
},
|
|
2191
2219
|
addProseMirrorPlugins() {
|
|
2192
2220
|
let e = !1;
|
|
2193
|
-
return [new
|
|
2194
|
-
key: new
|
|
2221
|
+
return [new h({
|
|
2222
|
+
key: new i("characterCount"),
|
|
2195
2223
|
appendTransaction: (t, n, r) => {
|
|
2196
2224
|
if (e) return;
|
|
2197
2225
|
let i = this.options.limit, a = this.options.autoTrim;
|
|
@@ -2220,7 +2248,7 @@ b.create({
|
|
|
2220
2248
|
})];
|
|
2221
2249
|
}
|
|
2222
2250
|
});
|
|
2223
|
-
var
|
|
2251
|
+
var dn = T.create({
|
|
2224
2252
|
name: "dropCursor",
|
|
2225
2253
|
addOptions() {
|
|
2226
2254
|
return {
|
|
@@ -2230,10 +2258,10 @@ var sn = b.create({
|
|
|
2230
2258
|
};
|
|
2231
2259
|
},
|
|
2232
2260
|
addProseMirrorPlugins() {
|
|
2233
|
-
return [
|
|
2261
|
+
return [Rt(this.options)];
|
|
2234
2262
|
}
|
|
2235
2263
|
});
|
|
2236
|
-
|
|
2264
|
+
T.create({
|
|
2237
2265
|
name: "focus",
|
|
2238
2266
|
addOptions() {
|
|
2239
2267
|
return {
|
|
@@ -2242,32 +2270,32 @@ b.create({
|
|
|
2242
2270
|
};
|
|
2243
2271
|
},
|
|
2244
2272
|
addProseMirrorPlugins() {
|
|
2245
|
-
return [new
|
|
2246
|
-
key: new
|
|
2273
|
+
return [new h({
|
|
2274
|
+
key: new i("focus"),
|
|
2247
2275
|
props: { decorations: ({ doc: e, selection: t }) => {
|
|
2248
|
-
let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t,
|
|
2249
|
-
if (!n || !r) return
|
|
2250
|
-
let
|
|
2276
|
+
let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, o = [];
|
|
2277
|
+
if (!n || !r) return a.create(e, []);
|
|
2278
|
+
let s = 0;
|
|
2251
2279
|
this.options.mode === "deepest" && e.descendants((e, t) => {
|
|
2252
2280
|
if (!e.isText) {
|
|
2253
2281
|
if (!(i >= t && i <= t + e.nodeSize - 1)) return !1;
|
|
2254
|
-
|
|
2282
|
+
s += 1;
|
|
2255
2283
|
}
|
|
2256
2284
|
});
|
|
2257
|
-
let
|
|
2285
|
+
let c = 0;
|
|
2258
2286
|
return e.descendants((e, t) => {
|
|
2259
2287
|
if (e.isText || !(i >= t && i <= t + e.nodeSize - 1)) return !1;
|
|
2260
|
-
if (
|
|
2261
|
-
|
|
2262
|
-
}),
|
|
2288
|
+
if (c += 1, this.options.mode === "deepest" && s - c > 0 || this.options.mode === "shallowest" && c > 1) return this.options.mode === "deepest";
|
|
2289
|
+
o.push(p.node(t, t + e.nodeSize, { class: this.options.className }));
|
|
2290
|
+
}), a.create(e, o);
|
|
2263
2291
|
} }
|
|
2264
2292
|
})];
|
|
2265
2293
|
}
|
|
2266
2294
|
});
|
|
2267
|
-
var
|
|
2295
|
+
var fn = T.create({
|
|
2268
2296
|
name: "gapCursor",
|
|
2269
2297
|
addProseMirrorPlugins() {
|
|
2270
|
-
return [
|
|
2298
|
+
return [Wt()];
|
|
2271
2299
|
},
|
|
2272
2300
|
extendNodeSchema(e) {
|
|
2273
2301
|
let t = {
|
|
@@ -2275,12 +2303,12 @@ var cn = b.create({
|
|
|
2275
2303
|
options: e.options,
|
|
2276
2304
|
storage: e.storage
|
|
2277
2305
|
};
|
|
2278
|
-
return { allowGapCursor:
|
|
2306
|
+
return { allowGapCursor: se(te(e, "allowGapCursor", t)) ?? null };
|
|
2279
2307
|
}
|
|
2280
|
-
}),
|
|
2281
|
-
function
|
|
2308
|
+
}), pn = "placeholder", mn = new i("tiptap__placeholder");
|
|
2309
|
+
function hn(e) {
|
|
2282
2310
|
let { editor: t, placeholder: n, dataAttribute: r, pos: i, node: a, isEmptyDoc: o, hasAnchor: s, classes: { emptyNode: c, emptyEditor: l } } = e, u = [c];
|
|
2283
|
-
return o && u.push(l),
|
|
2311
|
+
return o && u.push(l), p.node(i, i + a.nodeSize, {
|
|
2284
2312
|
class: u.join(" "),
|
|
2285
2313
|
[r]: typeof n == "function" ? n({
|
|
2286
2314
|
editor: t,
|
|
@@ -2290,41 +2318,41 @@ function dn(e) {
|
|
|
2290
2318
|
}) : n
|
|
2291
2319
|
});
|
|
2292
2320
|
}
|
|
2293
|
-
function
|
|
2321
|
+
function gn(e, t) {
|
|
2294
2322
|
return typeof e == "function" ? e(t) : e;
|
|
2295
2323
|
}
|
|
2296
|
-
function
|
|
2297
|
-
let { anchor:
|
|
2298
|
-
return r.nodesBetween(
|
|
2299
|
-
let
|
|
2300
|
-
return r.type.isTextblock && (
|
|
2324
|
+
function _n({ editor: e, options: t, dataAttribute: n, doc: r, selection: i, from: a, to: o }) {
|
|
2325
|
+
let { anchor: s } = i, c = [], l = e.isEmpty;
|
|
2326
|
+
return r.nodesBetween(a, o, (r, i) => {
|
|
2327
|
+
let a = s >= i && s <= i + r.nodeSize, o = !r.isLeaf && m(r);
|
|
2328
|
+
return r.type.isTextblock && (a || !t.showOnlyCurrent) && o && c.push(hn({
|
|
2301
2329
|
editor: e,
|
|
2302
|
-
isEmptyDoc:
|
|
2330
|
+
isEmptyDoc: l,
|
|
2303
2331
|
dataAttribute: n,
|
|
2304
|
-
hasAnchor:
|
|
2332
|
+
hasAnchor: a,
|
|
2305
2333
|
placeholder: t.placeholder,
|
|
2306
2334
|
classes: {
|
|
2307
2335
|
emptyEditor: t.emptyEditorClass,
|
|
2308
|
-
emptyNode:
|
|
2336
|
+
emptyNode: gn(t.emptyNodeClass, {
|
|
2309
2337
|
editor: e,
|
|
2310
2338
|
node: r,
|
|
2311
2339
|
pos: i,
|
|
2312
|
-
hasAnchor:
|
|
2340
|
+
hasAnchor: a
|
|
2313
2341
|
})
|
|
2314
2342
|
},
|
|
2315
2343
|
node: r,
|
|
2316
2344
|
pos: i
|
|
2317
2345
|
})), t.includeChildren;
|
|
2318
|
-
}),
|
|
2346
|
+
}), c;
|
|
2319
2347
|
}
|
|
2320
|
-
function
|
|
2348
|
+
function vn({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
2321
2349
|
if (!(e.isEditable || !t.showOnlyWhenEditable)) return null;
|
|
2322
2350
|
let { anchor: o } = i, s = [], c = e.isEmpty;
|
|
2323
2351
|
if (t.showOnlyCurrent && !t.includeChildren) {
|
|
2324
|
-
let i = r.resolve(o),
|
|
2325
|
-
if (
|
|
2326
|
-
let r = o >=
|
|
2327
|
-
s.push(
|
|
2352
|
+
let i = r.resolve(o), a = i.depth > 0 ? i.node(1) : i.nodeAfter, l = i.depth > 0 ? i.before(1) : o;
|
|
2353
|
+
if (a && a.type.isTextblock && m(a)) {
|
|
2354
|
+
let r = o >= l && o <= l + a.nodeSize;
|
|
2355
|
+
s.push(hn({
|
|
2328
2356
|
editor: e,
|
|
2329
2357
|
isEmptyDoc: c,
|
|
2330
2358
|
dataAttribute: n,
|
|
@@ -2332,18 +2360,18 @@ function mn({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
2332
2360
|
placeholder: t.placeholder,
|
|
2333
2361
|
classes: {
|
|
2334
2362
|
emptyEditor: t.emptyEditorClass,
|
|
2335
|
-
emptyNode:
|
|
2363
|
+
emptyNode: gn(t.emptyNodeClass, {
|
|
2336
2364
|
editor: e,
|
|
2337
|
-
node:
|
|
2338
|
-
pos:
|
|
2365
|
+
node: a,
|
|
2366
|
+
pos: l,
|
|
2339
2367
|
hasAnchor: r
|
|
2340
2368
|
})
|
|
2341
2369
|
},
|
|
2342
|
-
node:
|
|
2343
|
-
pos:
|
|
2370
|
+
node: a,
|
|
2371
|
+
pos: l
|
|
2344
2372
|
}));
|
|
2345
2373
|
}
|
|
2346
|
-
} else s.push(...
|
|
2374
|
+
} else s.push(..._n({
|
|
2347
2375
|
editor: e,
|
|
2348
2376
|
options: t,
|
|
2349
2377
|
dataAttribute: n,
|
|
@@ -2352,7 +2380,7 @@ function mn({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
2352
2380
|
from: 0,
|
|
2353
2381
|
to: r.content.size
|
|
2354
2382
|
}));
|
|
2355
|
-
return
|
|
2383
|
+
return a.create(r, s);
|
|
2356
2384
|
}
|
|
2357
2385
|
function Q(e, t) {
|
|
2358
2386
|
let n = e.resolve(t);
|
|
@@ -2380,7 +2408,7 @@ function $(e, t) {
|
|
|
2380
2408
|
to: Math.min(e.content.size, t.to - 1)
|
|
2381
2409
|
};
|
|
2382
2410
|
}
|
|
2383
|
-
function
|
|
2411
|
+
function yn(e, t, n) {
|
|
2384
2412
|
let r = [];
|
|
2385
2413
|
return e.forEach((e, i) => {
|
|
2386
2414
|
let a = i, o = a + e.nodeSize, s = a + 1, c = o + 1;
|
|
@@ -2390,7 +2418,7 @@ function hn(e, t, n) {
|
|
|
2390
2418
|
});
|
|
2391
2419
|
}), r;
|
|
2392
2420
|
}
|
|
2393
|
-
function
|
|
2421
|
+
function bn(e) {
|
|
2394
2422
|
if (e.length === 0) return [];
|
|
2395
2423
|
let t = [...e].sort((e, t) => e.from - t.from), n = [{ ...t[0] }];
|
|
2396
2424
|
for (let e = 1; e < t.length; e += 1) {
|
|
@@ -2399,31 +2427,31 @@ function gn(e) {
|
|
|
2399
2427
|
}
|
|
2400
2428
|
return n;
|
|
2401
2429
|
}
|
|
2402
|
-
function
|
|
2403
|
-
let n =
|
|
2430
|
+
function xn(e, t) {
|
|
2431
|
+
let n = yn(e, t.from, t.to);
|
|
2404
2432
|
return n.push($(e, Q(e, t.from))), t.to > t.from ? n.push($(e, Q(e, Math.min(t.to, e.content.size + 1) - 1))) : t.from < e.content.size + 1 && n.push($(e, Q(e, Math.min(t.from + 1, e.content.size)))), n;
|
|
2405
2433
|
}
|
|
2406
|
-
function
|
|
2434
|
+
function Sn(e, t, n) {
|
|
2407
2435
|
let r = [];
|
|
2408
2436
|
if (e.docChanged) {
|
|
2409
|
-
let t =
|
|
2410
|
-
for (let e of t) r.push(...
|
|
2437
|
+
let t = ie(e);
|
|
2438
|
+
for (let e of t) r.push(...xn(n.doc, e.newRange));
|
|
2411
2439
|
}
|
|
2412
|
-
return e.selectionSet && (r.push($(n.doc, Q(n.doc, e.mapping.map(t.selection.anchor)))), r.push($(n.doc, Q(n.doc, n.selection.anchor)))),
|
|
2440
|
+
return e.selectionSet && (r.push($(n.doc, Q(n.doc, e.mapping.map(t.selection.anchor)))), r.push($(n.doc, Q(n.doc, n.selection.anchor)))), bn(r);
|
|
2413
2441
|
}
|
|
2414
|
-
function
|
|
2442
|
+
function Cn(e, t, n) {
|
|
2415
2443
|
let r = Math.max(0, Math.min(e, n.content.size));
|
|
2416
2444
|
return {
|
|
2417
2445
|
from: r,
|
|
2418
2446
|
to: Math.max(r, Math.min(t, n.content.size))
|
|
2419
2447
|
};
|
|
2420
2448
|
}
|
|
2421
|
-
function
|
|
2449
|
+
function wn({ decorations: e, ranges: t, editor: n, options: r, dataAttribute: i, doc: a, selection: o }) {
|
|
2422
2450
|
let s = e;
|
|
2423
2451
|
for (let e of t) {
|
|
2424
|
-
let { from: t, to: c } =
|
|
2452
|
+
let { from: t, to: c } = Cn(e.from, e.to, a), l = s.find(t, c).filter((e) => e.from >= t && e.to <= c);
|
|
2425
2453
|
l.length && (s = s.remove(l));
|
|
2426
|
-
let u =
|
|
2454
|
+
let u = _n({
|
|
2427
2455
|
editor: n,
|
|
2428
2456
|
options: r,
|
|
2429
2457
|
dataAttribute: i,
|
|
@@ -2436,21 +2464,21 @@ function bn({ decorations: e, ranges: t, editor: n, options: r, dataAttribute: i
|
|
|
2436
2464
|
}
|
|
2437
2465
|
return s;
|
|
2438
2466
|
}
|
|
2439
|
-
function
|
|
2467
|
+
function Tn({ editor: e, options: t, dataAttribute: n }) {
|
|
2440
2468
|
return {
|
|
2441
2469
|
init(r, i) {
|
|
2442
|
-
return
|
|
2470
|
+
return vn({
|
|
2443
2471
|
editor: e,
|
|
2444
2472
|
options: t,
|
|
2445
2473
|
dataAttribute: n,
|
|
2446
2474
|
doc: i.doc,
|
|
2447
2475
|
selection: i.selection
|
|
2448
|
-
}) ??
|
|
2476
|
+
}) ?? a.empty;
|
|
2449
2477
|
},
|
|
2450
2478
|
apply(r, i, a, o) {
|
|
2451
|
-
return !r.docChanged && !r.selectionSet ? i :
|
|
2479
|
+
return !r.docChanged && !r.selectionSet ? i : wn({
|
|
2452
2480
|
decorations: i.map(r.mapping, r.doc),
|
|
2453
|
-
ranges:
|
|
2481
|
+
ranges: Sn(r, a, o),
|
|
2454
2482
|
editor: e,
|
|
2455
2483
|
options: t,
|
|
2456
2484
|
dataAttribute: n,
|
|
@@ -2460,34 +2488,34 @@ function xn({ editor: e, options: t, dataAttribute: n }) {
|
|
|
2460
2488
|
}
|
|
2461
2489
|
};
|
|
2462
2490
|
}
|
|
2463
|
-
function
|
|
2491
|
+
function En(e) {
|
|
2464
2492
|
return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
2465
2493
|
}
|
|
2466
|
-
function
|
|
2467
|
-
let n = t.dataAttribute ? `data-${
|
|
2468
|
-
return new
|
|
2469
|
-
key:
|
|
2470
|
-
...r ? {} : { state:
|
|
2494
|
+
function Dn({ editor: e, options: t }) {
|
|
2495
|
+
let n = t.dataAttribute ? `data-${En(t.dataAttribute)}` : `data-${pn}`, r = t.showOnlyCurrent && !t.includeChildren;
|
|
2496
|
+
return new h({
|
|
2497
|
+
key: mn,
|
|
2498
|
+
...r ? {} : { state: Tn({
|
|
2471
2499
|
editor: e,
|
|
2472
2500
|
options: t,
|
|
2473
2501
|
dataAttribute: n
|
|
2474
2502
|
}) },
|
|
2475
|
-
props: { decorations: r ? ({ doc: r, selection: i }) =>
|
|
2503
|
+
props: { decorations: r ? ({ doc: r, selection: i }) => vn({
|
|
2476
2504
|
editor: e,
|
|
2477
2505
|
options: t,
|
|
2478
2506
|
dataAttribute: n,
|
|
2479
2507
|
doc: r,
|
|
2480
2508
|
selection: i
|
|
2481
|
-
}) : (n) => t.showOnlyWhenEditable && !e.isEditable ?
|
|
2509
|
+
}) : (n) => t.showOnlyWhenEditable && !e.isEditable ? a.empty : mn.getState(n) ?? a.empty }
|
|
2482
2510
|
});
|
|
2483
2511
|
}
|
|
2484
|
-
|
|
2512
|
+
T.create({
|
|
2485
2513
|
name: "placeholder",
|
|
2486
2514
|
addOptions() {
|
|
2487
2515
|
return {
|
|
2488
2516
|
emptyEditorClass: "is-editor-empty",
|
|
2489
2517
|
emptyNodeClass: "is-empty",
|
|
2490
|
-
dataAttribute:
|
|
2518
|
+
dataAttribute: pn,
|
|
2491
2519
|
placeholder: "Write something …",
|
|
2492
2520
|
showOnlyWhenEditable: !0,
|
|
2493
2521
|
showOnlyCurrent: !0,
|
|
@@ -2495,45 +2523,45 @@ b.create({
|
|
|
2495
2523
|
};
|
|
2496
2524
|
},
|
|
2497
2525
|
addProseMirrorPlugins() {
|
|
2498
|
-
return [
|
|
2526
|
+
return [Dn({
|
|
2499
2527
|
editor: this.editor,
|
|
2500
2528
|
options: this.options
|
|
2501
2529
|
})];
|
|
2502
2530
|
}
|
|
2503
2531
|
});
|
|
2504
|
-
function
|
|
2505
|
-
return !e.selection.empty && !
|
|
2532
|
+
function On(e, t) {
|
|
2533
|
+
return !e.selection.empty && !o(e.selection) && t.isEditable;
|
|
2506
2534
|
}
|
|
2507
|
-
function
|
|
2508
|
-
return
|
|
2535
|
+
function kn(e, t) {
|
|
2536
|
+
return On(e, t) && !t.isFocused && !t.view.dragging;
|
|
2509
2537
|
}
|
|
2510
|
-
function
|
|
2538
|
+
function An() {
|
|
2511
2539
|
var e;
|
|
2512
2540
|
(e = window.getSelection()) == null || e.removeAllRanges();
|
|
2513
2541
|
}
|
|
2514
|
-
function
|
|
2542
|
+
function jn(e) {
|
|
2515
2543
|
e.focus();
|
|
2516
2544
|
}
|
|
2517
|
-
|
|
2545
|
+
T.create({
|
|
2518
2546
|
name: "selection",
|
|
2519
2547
|
addOptions() {
|
|
2520
2548
|
return { className: "selection" };
|
|
2521
2549
|
},
|
|
2522
2550
|
addProseMirrorPlugins() {
|
|
2523
2551
|
let { editor: e, options: t } = this;
|
|
2524
|
-
return [new
|
|
2525
|
-
key: new
|
|
2552
|
+
return [new h({
|
|
2553
|
+
key: new i("selection"),
|
|
2526
2554
|
props: {
|
|
2527
2555
|
decorations(n) {
|
|
2528
|
-
return
|
|
2556
|
+
return kn(n, e) ? a.create(n.doc, [p.inline(n.selection.from, n.selection.to, { class: t.className })]) : null;
|
|
2529
2557
|
},
|
|
2530
2558
|
handleDOMEvents: {
|
|
2531
2559
|
blur(t) {
|
|
2532
|
-
return
|
|
2560
|
+
return On(t.state, e) && An(), !1;
|
|
2533
2561
|
},
|
|
2534
2562
|
focus(t) {
|
|
2535
|
-
return
|
|
2536
|
-
!e.isDestroyed && t.hasFocus() &&
|
|
2563
|
+
return On(t.state, e) && requestAnimationFrame(() => {
|
|
2564
|
+
!e.isDestroyed && t.hasFocus() && jn(t);
|
|
2537
2565
|
}), !1;
|
|
2538
2566
|
}
|
|
2539
2567
|
}
|
|
@@ -2541,10 +2569,10 @@ b.create({
|
|
|
2541
2569
|
})];
|
|
2542
2570
|
}
|
|
2543
2571
|
});
|
|
2544
|
-
function
|
|
2572
|
+
function Mn({ types: e, node: t }) {
|
|
2545
2573
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
2546
2574
|
}
|
|
2547
|
-
var
|
|
2575
|
+
var Nn = T.create({
|
|
2548
2576
|
name: "trailingNode",
|
|
2549
2577
|
addOptions() {
|
|
2550
2578
|
return {
|
|
@@ -2553,8 +2581,8 @@ var kn = b.create({
|
|
|
2553
2581
|
};
|
|
2554
2582
|
},
|
|
2555
2583
|
addProseMirrorPlugins() {
|
|
2556
|
-
let e = new
|
|
2557
|
-
return [new
|
|
2584
|
+
let e = new i(this.name), t = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(t).includes(e.name));
|
|
2585
|
+
return [new h({
|
|
2558
2586
|
key: e,
|
|
2559
2587
|
appendTransaction: (n, r, i) => {
|
|
2560
2588
|
let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
|
|
@@ -2563,7 +2591,7 @@ var kn = b.create({
|
|
|
2563
2591
|
state: {
|
|
2564
2592
|
init: (e, t) => {
|
|
2565
2593
|
let r = t.tr.doc.lastChild;
|
|
2566
|
-
return !
|
|
2594
|
+
return !Mn({
|
|
2567
2595
|
node: r,
|
|
2568
2596
|
types: n
|
|
2569
2597
|
});
|
|
@@ -2571,7 +2599,7 @@ var kn = b.create({
|
|
|
2571
2599
|
apply: (e, t) => {
|
|
2572
2600
|
if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
|
|
2573
2601
|
let r = e.doc.lastChild;
|
|
2574
|
-
return !
|
|
2602
|
+
return !Mn({
|
|
2575
2603
|
node: r,
|
|
2576
2604
|
types: n
|
|
2577
2605
|
});
|
|
@@ -2579,7 +2607,7 @@ var kn = b.create({
|
|
|
2579
2607
|
}
|
|
2580
2608
|
})];
|
|
2581
2609
|
}
|
|
2582
|
-
}),
|
|
2610
|
+
}), Pn = T.create({
|
|
2583
2611
|
name: "undoRedo",
|
|
2584
2612
|
addOptions() {
|
|
2585
2613
|
return {
|
|
@@ -2589,12 +2617,12 @@ var kn = b.create({
|
|
|
2589
2617
|
},
|
|
2590
2618
|
addCommands() {
|
|
2591
2619
|
return {
|
|
2592
|
-
undo: () => ({ state: e, dispatch: t }) =>
|
|
2593
|
-
redo: () => ({ state: e, dispatch: t }) =>
|
|
2620
|
+
undo: () => ({ state: e, dispatch: t }) => ln(e, t),
|
|
2621
|
+
redo: () => ({ state: e, dispatch: t }) => un(e, t)
|
|
2594
2622
|
};
|
|
2595
2623
|
},
|
|
2596
2624
|
addProseMirrorPlugins() {
|
|
2597
|
-
return [
|
|
2625
|
+
return [sn(this.options)];
|
|
2598
2626
|
},
|
|
2599
2627
|
addKeyboardShortcuts() {
|
|
2600
2628
|
return {
|
|
@@ -2605,12 +2633,12 @@ var kn = b.create({
|
|
|
2605
2633
|
"Shift-Mod-я": () => this.editor.commands.redo()
|
|
2606
2634
|
};
|
|
2607
2635
|
}
|
|
2608
|
-
}),
|
|
2636
|
+
}), Fn = T.create({
|
|
2609
2637
|
name: "starterKit",
|
|
2610
2638
|
addExtensions() {
|
|
2611
2639
|
let e = [];
|
|
2612
|
-
return this.options.bold !== !1 && e.push(
|
|
2640
|
+
return this.options.bold !== !1 && e.push(ve.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(pe.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(ze.configure(this.options.bulletList)), this.options.code !== !1 && e.push(xe.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(we.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(Te.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(dn.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(fn.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && e.push(Ee.configure(this.options.hardBreak)), this.options.heading !== !1 && e.push(De.configure(this.options.heading)), this.options.undoRedo !== !1 && e.push(Pn.configure(this.options.undoRedo)), this.options.horizontalRule !== !1 && e.push(Oe.configure(this.options.horizontalRule)), this.options.italic !== !1 && e.push(Ne.configure(this.options.italic)), this.options.listItem !== !1 && e.push(it.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(ft.configure(this.options?.listKeymap)), this.options.link !== !1 && e.push(le.configure(this.options?.link)), this.options.orderedList !== !1 && e.push(Dt.configure(this.options.orderedList)), this.options.paragraph !== !1 && e.push(Nt.configure(this.options.paragraph)), this.options.strike !== !1 && e.push(It.configure(this.options.strike)), this.options.text !== !1 && e.push(Lt.configure(this.options.text)), this.options.underline !== !1 && e.push(ue.configure(this.options?.underline)), this.options.trailingNode !== !1 && e.push(Nn.configure(this.options?.trailingNode)), e;
|
|
2613
2641
|
}
|
|
2614
|
-
}),
|
|
2642
|
+
}), In = Fn;
|
|
2615
2643
|
//#endregion
|
|
2616
|
-
export {
|
|
2644
|
+
export { Fn as StarterKit, In as default };
|