@milkdown/crepe 7.4.0 → 7.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/clsx-dASsG01A.js +6 -0
- package/lib/cjs/clsx-dASsG01A.js.map +1 -0
- package/lib/cjs/{index-5PcT4iSf.js → index--2zEz40J.js} +8 -22
- package/lib/cjs/{index-5PcT4iSf.js.map → index--2zEz40J.js.map} +1 -1
- package/lib/cjs/{index-lrFGGa_l.js → index-5n9R-QCl.js} +5 -19
- package/lib/cjs/{index-lrFGGa_l.js.map → index-5n9R-QCl.js.map} +1 -1
- package/lib/cjs/{index-SxWWV8XD.js → index-HEdBw63r.js} +8 -22
- package/lib/cjs/{index-SxWWV8XD.js.map → index-HEdBw63r.js.map} +1 -1
- package/lib/cjs/{index-vlxA_KJ8.js → index-Hlt9dRH5.js} +5 -19
- package/lib/cjs/{index-vlxA_KJ8.js.map → index-Hlt9dRH5.js.map} +1 -1
- package/lib/cjs/{index-TEjdwq--.js → index-KCW2CzRk.js} +8 -22
- package/lib/{esm/index-DoEghZHy.js.map → cjs/index-KCW2CzRk.js.map} +1 -1
- package/lib/cjs/{index-qRg5-QJH.js → index-KSZhahYb.js} +6 -20
- package/lib/cjs/{index-qRg5-QJH.js.map → index-KSZhahYb.js.map} +1 -1
- package/lib/cjs/index-N1cRxqdw.js +39 -0
- package/lib/cjs/index-N1cRxqdw.js.map +1 -0
- package/lib/cjs/{index-fkT0ywfA.js → index-NNo_VSEA.js} +5 -19
- package/lib/cjs/{index-fkT0ywfA.js.map → index-NNo_VSEA.js.map} +1 -1
- package/lib/cjs/{index-OtaMLv5l.js → index-O1bDbloo.js} +5 -19
- package/lib/cjs/{index-OtaMLv5l.js.map → index-O1bDbloo.js.map} +1 -1
- package/lib/cjs/{index-mJ47ZWO2.js → index-OPh9naof.js} +8 -22
- package/lib/cjs/{index-mJ47ZWO2.js.map → index-OPh9naof.js.map} +1 -1
- package/lib/cjs/{index-OA_u95ey.js → index-PAhfZtcH.js} +5 -19
- package/lib/cjs/{index-OA_u95ey.js.map → index-PAhfZtcH.js.map} +1 -1
- package/lib/cjs/{index-zBr61zy6.js → index-PeRHVz4A.js} +5 -19
- package/lib/{esm/index-6P9Xk934.js.map → cjs/index-PeRHVz4A.js.map} +1 -1
- package/lib/cjs/{index-llNS_EuP.js → index-U7GWrg-w.js} +26 -470
- package/lib/cjs/index-U7GWrg-w.js.map +1 -0
- package/lib/cjs/{index-wXLifZgm.js → index-UTb0Az5e.js} +2 -2
- package/lib/cjs/{index-wXLifZgm.js.map → index-UTb0Az5e.js.map} +1 -1
- package/lib/cjs/{index-t_GA5F26.js → index-UnEAyH8X.js} +5 -19
- package/lib/cjs/{index-t_GA5F26.js.map → index-UnEAyH8X.js.map} +1 -1
- package/lib/cjs/{index-i0_v2uVp.js → index-VCkq0ru1.js} +5 -19
- package/lib/{esm/index-4QzlLVWs.js.map → cjs/index-VCkq0ru1.js.map} +1 -1
- package/lib/cjs/{index-OIQn1x0L.js → index-WQl7Du53.js} +4 -18
- package/lib/cjs/index-WQl7Du53.js.map +1 -0
- package/lib/cjs/{index-GEIgbcVc.js → index-ahL5MvrQ.js} +28 -42
- package/lib/cjs/{index-GEIgbcVc.js.map → index-ahL5MvrQ.js.map} +1 -1
- package/lib/cjs/{index-tbEq3xma.js → index-bpgWLeRY.js} +5 -19
- package/lib/cjs/{index-tbEq3xma.js.map → index-bpgWLeRY.js.map} +1 -1
- package/lib/cjs/index-dEVmN_aj.js +26 -0
- package/lib/cjs/index-dEVmN_aj.js.map +1 -0
- package/lib/cjs/{index-w9buMrFW.js → index-fZupvR_f.js} +8 -22
- package/lib/{esm/index-hQaRWeq1.js.map → cjs/index-fZupvR_f.js.map} +1 -1
- package/lib/cjs/{index-ortUqbAp.js → index-gSM-jgti.js} +5 -19
- package/lib/{esm/index-oMy83ynO.js.map → cjs/index-gSM-jgti.js.map} +1 -1
- package/lib/cjs/{index-LdEYPSZc.js → index-jlPr_A_N.js} +5 -19
- package/lib/cjs/{index-LdEYPSZc.js.map → index-jlPr_A_N.js.map} +1 -1
- package/lib/cjs/index-ocxd4A-M.js +675 -0
- package/lib/cjs/index-ocxd4A-M.js.map +1 -0
- package/lib/cjs/{index-xqKfEyRA.js → index-rFFAL9YA.js} +14 -17
- package/lib/cjs/index-rFFAL9YA.js.map +1 -0
- package/lib/cjs/index-tlx25I_m.js +36 -0
- package/lib/cjs/index-tlx25I_m.js.map +1 -0
- package/lib/cjs/index-tqAbVyds.js +28 -0
- package/lib/cjs/index-tqAbVyds.js.map +1 -0
- package/lib/cjs/index-udZSknd8.js +167 -0
- package/lib/cjs/index-udZSknd8.js.map +1 -0
- package/lib/cjs/index-uleaJDBC.js +19 -0
- package/lib/cjs/index-uleaJDBC.js.map +1 -0
- package/lib/cjs/{index-de3dfsQr.js → index-urB-WDqA.js} +7 -21
- package/lib/cjs/{index-de3dfsQr.js.map → index-urB-WDqA.js.map} +1 -1
- package/lib/cjs/{index-78P4PeZ9.js → index-xWgWtxUR.js} +6 -20
- package/lib/cjs/{index-78P4PeZ9.js.map → index-xWgWtxUR.js.map} +1 -1
- package/lib/cjs/index-z6pe2alg.js.map +1 -1
- package/lib/cjs/index.js +150 -13
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/todoList-YYRQo7wG.js +404 -0
- package/lib/cjs/todoList-YYRQo7wG.js.map +1 -0
- package/lib/esm/clsx-RxCLxYpD.js +4 -0
- package/lib/esm/clsx-RxCLxYpD.js.map +1 -0
- package/lib/esm/{index-a-SAfeeT.js → index-1NetiFdJ.js} +8 -22
- package/lib/esm/{index-a-SAfeeT.js.map → index-1NetiFdJ.js.map} +1 -1
- package/lib/esm/{index-NmjiRA0M.js → index-2I_xbjAZ.js} +28 -42
- package/lib/esm/{index-NmjiRA0M.js.map → index-2I_xbjAZ.js.map} +1 -1
- package/lib/esm/{index-Grquo08f.js → index-2huXYfuJ.js} +8 -22
- package/lib/esm/{index-Grquo08f.js.map → index-2huXYfuJ.js.map} +1 -1
- package/lib/esm/{index-U8q-F7hU.js → index-4x6_TVZv.js} +5 -19
- package/lib/esm/{index-U8q-F7hU.js.map → index-4x6_TVZv.js.map} +1 -1
- package/lib/esm/index-6JoGWH2I.js +17 -0
- package/lib/esm/index-6JoGWH2I.js.map +1 -0
- package/lib/esm/{index-x-zW6gKj.js → index-A-dNwMMf.js} +2 -2
- package/lib/esm/{index-x-zW6gKj.js.map → index-A-dNwMMf.js.map} +1 -1
- package/lib/esm/{index-oMy83ynO.js → index-AV99ipmP.js} +5 -19
- package/lib/{cjs/index-ortUqbAp.js.map → esm/index-AV99ipmP.js.map} +1 -1
- package/lib/esm/{index-VyZguCIt.js → index-CMGDOz11.js} +10 -13
- package/lib/esm/index-CMGDOz11.js.map +1 -0
- package/lib/esm/index-HlPKwzLC.js +34 -0
- package/lib/esm/index-HlPKwzLC.js.map +1 -0
- package/lib/esm/index-Jvxff1vU.js.map +1 -1
- package/lib/esm/{index-vwrMVELn.js → index-PC2bahtq.js} +5 -19
- package/lib/esm/{index-vwrMVELn.js.map → index-PC2bahtq.js.map} +1 -1
- package/lib/esm/{index-UBeneu17.js → index-QBYz82jZ.js} +5 -19
- package/lib/esm/{index-UBeneu17.js.map → index-QBYz82jZ.js.map} +1 -1
- package/lib/esm/{index-bsED907r.js → index-W1pAMr_8.js} +6 -20
- package/lib/esm/{index-bsED907r.js.map → index-W1pAMr_8.js.map} +1 -1
- package/lib/esm/{index-q-qE7-96.js → index-Xzdc2jbA.js} +25 -469
- package/lib/esm/index-Xzdc2jbA.js.map +1 -0
- package/lib/esm/{index-A9zdyi2L.js → index-ZAtZWqJQ.js} +5 -19
- package/lib/esm/{index-A9zdyi2L.js.map → index-ZAtZWqJQ.js.map} +1 -1
- package/lib/esm/index-_A9vu1ED.js +673 -0
- package/lib/esm/index-_A9vu1ED.js.map +1 -0
- package/lib/esm/{index-U71v7KdA.js → index-bnSKBrbD.js} +5 -19
- package/lib/esm/{index-U71v7KdA.js.map → index-bnSKBrbD.js.map} +1 -1
- package/lib/esm/index-fVrfHXda.js +24 -0
- package/lib/esm/index-fVrfHXda.js.map +1 -0
- package/lib/esm/{index-PkBZpDL4.js → index-ftnOhuRS.js} +4 -18
- package/lib/esm/index-ftnOhuRS.js.map +1 -0
- package/lib/esm/{index-4oMdufW4.js → index-iQPB0Rdl.js} +6 -20
- package/lib/esm/{index-4oMdufW4.js.map → index-iQPB0Rdl.js.map} +1 -1
- package/lib/esm/{index-0khVa44f.js → index-kPj3-TKp.js} +5 -19
- package/lib/esm/{index-0khVa44f.js.map → index-kPj3-TKp.js.map} +1 -1
- package/lib/esm/{index-hQaRWeq1.js → index-kgOR7SZ6.js} +8 -22
- package/lib/{cjs/index-w9buMrFW.js.map → esm/index-kgOR7SZ6.js.map} +1 -1
- package/lib/esm/index-lm00PM0y.js +165 -0
- package/lib/esm/index-lm00PM0y.js.map +1 -0
- package/lib/esm/{index-4QzlLVWs.js → index-m49Bj3q7.js} +5 -19
- package/lib/{cjs/index-i0_v2uVp.js.map → esm/index-m49Bj3q7.js.map} +1 -1
- package/lib/esm/index-ohmbt6Ys.js +37 -0
- package/lib/esm/index-ohmbt6Ys.js.map +1 -0
- package/lib/esm/{index-DoEghZHy.js → index-sWVjGw-3.js} +8 -22
- package/lib/esm/index-sWVjGw-3.js.map +1 -0
- package/lib/esm/{index-L7VXk-jT.js → index-twh8lL5o.js} +5 -19
- package/lib/esm/{index-L7VXk-jT.js.map → index-twh8lL5o.js.map} +1 -1
- package/lib/esm/{index-6P9Xk934.js → index-v02MCz4_.js} +5 -19
- package/lib/{cjs/index-zBr61zy6.js.map → esm/index-v02MCz4_.js.map} +1 -1
- package/lib/esm/index-v3rvbocl.js +26 -0
- package/lib/esm/index-v3rvbocl.js.map +1 -0
- package/lib/esm/{index-7BVeXLQZ.js → index-wEXT8mbN.js} +5 -19
- package/lib/esm/{index-7BVeXLQZ.js.map → index-wEXT8mbN.js.map} +1 -1
- package/lib/esm/{index-rwcSpYkt.js → index-wFIac5Kw.js} +7 -21
- package/lib/esm/{index-rwcSpYkt.js.map → index-wFIac5Kw.js.map} +1 -1
- package/lib/esm/{index-bVubJ6Rv.js → index-wg94ewRo.js} +8 -22
- package/lib/esm/{index-bVubJ6Rv.js.map → index-wg94ewRo.js.map} +1 -1
- package/lib/esm/index.js +152 -11
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/todoList-9QsDDcmB.js +368 -0
- package/lib/esm/todoList-9QsDDcmB.js.map +1 -0
- package/lib/theme/_internal/classic-common.css +3 -2
- package/lib/theme/common/block-edit.css +3 -1
- package/lib/theme/common/code-mirror.css +15 -0
- package/lib/theme/common/cursor.css +1 -1
- package/lib/theme/common/image-block.css +2 -0
- package/lib/theme/common/link-tooltip.css +10 -13
- package/lib/theme/common/list-item.css +16 -1
- package/lib/theme/common/prosemirror.css +1 -1
- package/lib/theme/common/style.css +1 -0
- package/lib/theme/common/table.css +217 -0
- package/lib/theme/common/toolbar.css +11 -4
- package/lib/theme/{classic-dark → crepe-dark}/style.css +2 -2
- package/lib/theme/frame/style.css +28 -0
- package/lib/theme/frame-dark/style.css +28 -0
- package/lib/theme/nord/style.css +28 -0
- package/lib/theme/nord-dark/style.css +28 -0
- package/lib/types/core/crepe.d.ts +5 -3
- package/lib/types/core/crepe.d.ts.map +1 -1
- package/lib/types/core/slice.d.ts +2 -2
- package/lib/types/core/slice.d.ts.map +1 -1
- package/lib/types/feature/block-edit/handle/component.d.ts +3 -0
- package/lib/types/feature/block-edit/handle/component.d.ts.map +1 -1
- package/lib/types/feature/block-edit/handle/index.d.ts +5 -4
- package/lib/types/feature/block-edit/handle/index.d.ts.map +1 -1
- package/lib/types/feature/block-edit/index.d.ts +43 -2
- package/lib/types/feature/block-edit/index.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/component.d.ts +3 -1
- package/lib/types/feature/block-edit/menu/component.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/config.d.ts +3 -12
- package/lib/types/feature/block-edit/menu/config.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/group-builder.d.ts +29 -0
- package/lib/types/feature/block-edit/menu/group-builder.d.ts.map +1 -0
- package/lib/types/feature/block-edit/menu/index.d.ts +5 -4
- package/lib/types/feature/block-edit/menu/index.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/utils.d.ts +28 -0
- package/lib/types/feature/block-edit/menu/utils.d.ts.map +1 -0
- package/lib/types/feature/code-mirror/index.d.ts +9 -1
- package/lib/types/feature/code-mirror/index.d.ts.map +1 -1
- package/lib/types/feature/cursor/index.d.ts +1 -1
- package/lib/types/feature/cursor/index.d.ts.map +1 -1
- package/lib/types/feature/image-block/index.d.ts +19 -2
- package/lib/types/feature/image-block/index.d.ts.map +1 -1
- package/lib/types/feature/index.d.ts +17 -2
- package/lib/types/feature/index.d.ts.map +1 -1
- package/lib/types/feature/link-tooltip/index.d.ts +12 -2
- package/lib/types/feature/link-tooltip/index.d.ts.map +1 -1
- package/lib/types/feature/list-item/index.d.ts +8 -2
- package/lib/types/feature/list-item/index.d.ts.map +1 -1
- package/lib/types/feature/placeholder/index.d.ts +2 -2
- package/lib/types/feature/placeholder/index.d.ts.map +1 -1
- package/lib/types/feature/shared.d.ts +3 -1
- package/lib/types/feature/shared.d.ts.map +1 -1
- package/lib/types/feature/table/index.d.ts +16 -0
- package/lib/types/feature/table/index.d.ts.map +1 -0
- package/lib/types/feature/toolbar/component.d.ts +3 -1
- package/lib/types/feature/toolbar/component.d.ts.map +1 -1
- package/lib/types/feature/toolbar/index.d.ts +11 -2
- package/lib/types/feature/toolbar/index.d.ts.map +1 -1
- package/lib/types/icons/alignCenter.d.ts +2 -0
- package/lib/types/icons/alignCenter.d.ts.map +1 -0
- package/lib/types/icons/alignLeft.d.ts +2 -0
- package/lib/types/icons/alignLeft.d.ts.map +1 -0
- package/lib/types/icons/alignRight.d.ts +2 -0
- package/lib/types/icons/alignRight.d.ts.map +1 -0
- package/lib/types/icons/bold.d.ts +2 -0
- package/lib/types/icons/bold.d.ts.map +1 -0
- package/lib/types/{feature/list-item/consts.d.ts → icons/bullet.d.ts} +1 -1
- package/lib/types/icons/bullet.d.ts.map +1 -0
- package/lib/types/icons/bulletList.d.ts +2 -0
- package/lib/types/icons/bulletList.d.ts.map +1 -0
- package/lib/types/icons/caption.d.ts +2 -0
- package/lib/types/icons/caption.d.ts.map +1 -0
- package/lib/types/icons/checkBoxChecked.d.ts +2 -0
- package/lib/types/icons/checkBoxChecked.d.ts.map +1 -0
- package/lib/types/icons/checkBoxUnchecked.d.ts +2 -0
- package/lib/types/icons/checkBoxUnchecked.d.ts.map +1 -0
- package/lib/types/icons/chevronDown.d.ts +2 -0
- package/lib/types/icons/chevronDown.d.ts.map +1 -0
- package/lib/types/icons/clear.d.ts +2 -0
- package/lib/types/icons/clear.d.ts.map +1 -0
- package/lib/types/icons/code.d.ts +2 -0
- package/lib/types/icons/code.d.ts.map +1 -0
- package/lib/types/icons/confirm.d.ts +2 -0
- package/lib/types/icons/confirm.d.ts.map +1 -0
- package/lib/types/icons/divider.d.ts +2 -0
- package/lib/types/icons/divider.d.ts.map +1 -0
- package/lib/types/icons/dragHandle.d.ts +2 -0
- package/lib/types/icons/dragHandle.d.ts.map +1 -0
- package/lib/types/icons/edit.d.ts +2 -0
- package/lib/types/icons/edit.d.ts.map +1 -0
- package/lib/types/icons/h1.d.ts +2 -0
- package/lib/types/icons/h1.d.ts.map +1 -0
- package/lib/types/icons/h2.d.ts +2 -0
- package/lib/types/icons/h2.d.ts.map +1 -0
- package/lib/types/icons/h3.d.ts +2 -0
- package/lib/types/icons/h3.d.ts.map +1 -0
- package/lib/types/icons/h4.d.ts +2 -0
- package/lib/types/icons/h4.d.ts.map +1 -0
- package/lib/types/icons/h5.d.ts +2 -0
- package/lib/types/icons/h5.d.ts.map +1 -0
- package/lib/types/icons/h6.d.ts +2 -0
- package/lib/types/icons/h6.d.ts.map +1 -0
- package/lib/types/icons/image.d.ts +2 -0
- package/lib/types/icons/image.d.ts.map +1 -0
- package/lib/types/icons/index.d.ts +36 -0
- package/lib/types/icons/index.d.ts.map +1 -0
- package/lib/types/icons/italic.d.ts +2 -0
- package/lib/types/icons/italic.d.ts.map +1 -0
- package/lib/types/icons/link.d.ts +2 -0
- package/lib/types/icons/link.d.ts.map +1 -0
- package/lib/types/icons/menu.d.ts +2 -0
- package/lib/types/icons/menu.d.ts.map +1 -0
- package/lib/types/icons/orderedList.d.ts +2 -0
- package/lib/types/icons/orderedList.d.ts.map +1 -0
- package/lib/types/icons/plus.d.ts +2 -0
- package/lib/types/icons/plus.d.ts.map +1 -0
- package/lib/types/icons/quote.d.ts +2 -0
- package/lib/types/icons/quote.d.ts.map +1 -0
- package/lib/types/icons/remove.d.ts +2 -0
- package/lib/types/icons/remove.d.ts.map +1 -0
- package/lib/types/icons/search.d.ts +2 -0
- package/lib/types/icons/search.d.ts.map +1 -0
- package/lib/types/icons/strikethrough.d.ts +2 -0
- package/lib/types/icons/strikethrough.d.ts.map +1 -0
- package/lib/types/icons/table.d.ts +2 -0
- package/lib/types/icons/table.d.ts.map +1 -0
- package/lib/types/icons/text.d.ts +2 -0
- package/lib/types/icons/text.d.ts.map +1 -0
- package/lib/types/icons/todoList.d.ts +2 -0
- package/lib/types/icons/todoList.d.ts.map +1 -0
- package/lib/types/utils/index.d.ts +1 -1
- package/lib/types/utils/index.d.ts.map +1 -1
- package/package.json +9 -23
- package/src/core/crepe.ts +15 -9
- package/src/core/slice.ts +2 -2
- package/src/feature/block-edit/handle/component.ts +13 -29
- package/src/feature/block-edit/handle/index.ts +16 -17
- package/src/feature/block-edit/index.ts +50 -5
- package/src/feature/block-edit/menu/component.ts +6 -7
- package/src/feature/block-edit/menu/config.ts +203 -274
- package/src/feature/block-edit/menu/group-builder.ts +50 -0
- package/src/feature/block-edit/menu/index.ts +11 -8
- package/src/feature/block-edit/menu/utils.ts +89 -0
- package/src/feature/code-mirror/index.ts +27 -19
- package/src/feature/cursor/index.ts +3 -4
- package/src/feature/image-block/index.ts +34 -41
- package/src/feature/index.ts +23 -3
- package/src/feature/link-tooltip/index.ts +23 -10
- package/src/feature/list-item/index.ts +21 -9
- package/src/feature/placeholder/index.ts +11 -6
- package/src/feature/shared.ts +4 -1
- package/src/feature/table/index.ts +54 -0
- package/src/feature/toolbar/component.ts +29 -11
- package/src/feature/toolbar/index.ts +21 -9
- package/src/icons/alignCenter.ts +7 -0
- package/src/icons/alignLeft.ts +7 -0
- package/src/icons/alignRight.ts +7 -0
- package/src/icons/bold.ts +7 -0
- package/src/{feature/list-item/consts.ts → icons/bullet.ts} +3 -3
- package/src/icons/bulletList.ts +14 -0
- package/src/icons/caption.ts +7 -0
- package/src/icons/checkBoxChecked.ts +14 -0
- package/src/icons/checkBoxUnchecked.ts +14 -0
- package/src/icons/chevronDown.ts +7 -0
- package/src/icons/clear.ts +14 -0
- package/src/icons/code.ts +14 -0
- package/src/icons/confirm.ts +14 -0
- package/src/icons/divider.ts +14 -0
- package/src/icons/dragHandle.ts +7 -0
- package/src/icons/edit.ts +14 -0
- package/src/icons/h1.ts +14 -0
- package/src/icons/h2.ts +14 -0
- package/src/icons/h3.ts +14 -0
- package/src/icons/h4.ts +14 -0
- package/src/icons/h5.ts +14 -0
- package/src/icons/h6.ts +14 -0
- package/src/icons/image.ts +14 -0
- package/src/icons/index.ts +35 -0
- package/src/icons/italic.ts +7 -0
- package/src/icons/link.ts +7 -0
- package/src/icons/menu.ts +14 -0
- package/src/icons/orderedList.ts +14 -0
- package/src/icons/plus.ts +14 -0
- package/src/icons/quote.ts +14 -0
- package/src/icons/remove.ts +7 -0
- package/src/icons/search.ts +7 -0
- package/src/icons/strikethrough.ts +7 -0
- package/src/icons/table.ts +14 -0
- package/src/icons/text.ts +14 -0
- package/src/icons/todoList.ts +7 -0
- package/src/theme/_internal/classic-common.css +3 -2
- package/src/theme/common/block-edit.css +3 -1
- package/src/theme/common/code-mirror.css +13 -0
- package/src/theme/common/cursor.css +1 -1
- package/src/theme/common/image-block.css +2 -0
- package/src/theme/common/link-tooltip.css +11 -14
- package/src/theme/common/list-item.css +9 -0
- package/src/theme/common/prosemirror.css +1 -1
- package/src/theme/common/style.css +1 -0
- package/src/theme/common/table.css +204 -0
- package/src/theme/common/toolbar.css +14 -4
- package/src/theme/{classic-dark → crepe-dark}/style.css +2 -2
- package/src/theme/frame/style.css +28 -0
- package/src/theme/frame-dark/style.css +28 -0
- package/src/theme/nord/style.css +28 -0
- package/src/theme/nord-dark/style.css +28 -0
- package/src/utils/index.ts +1 -1
- package/lib/cjs/_view-TbSIR42F.js +0 -27
- package/lib/cjs/_view-TbSIR42F.js.map +0 -1
- package/lib/cjs/clsx-7JLENl8W.js +0 -62
- package/lib/cjs/clsx-7JLENl8W.js.map +0 -1
- package/lib/cjs/composed-offset-position.browser.min-FwypoGc1.js +0 -1138
- package/lib/cjs/composed-offset-position.browser.min-FwypoGc1.js.map +0 -1
- package/lib/cjs/helper-OEW-2Vxr.js +0 -9
- package/lib/cjs/helper-OEW-2Vxr.js.map +0 -1
- package/lib/cjs/index-2oxl5Zo4.js +0 -551
- package/lib/cjs/index-2oxl5Zo4.js.map +0 -1
- package/lib/cjs/index-GKolgvC5.js +0 -505
- package/lib/cjs/index-GKolgvC5.js.map +0 -1
- package/lib/cjs/index-JAqL0ybh.js +0 -55
- package/lib/cjs/index-JAqL0ybh.js.map +0 -1
- package/lib/cjs/index-Ne_pk53w.js +0 -178
- package/lib/cjs/index-Ne_pk53w.js.map +0 -1
- package/lib/cjs/index-O3vRXWIP.js +0 -199
- package/lib/cjs/index-O3vRXWIP.js.map +0 -1
- package/lib/cjs/index-OIQn1x0L.js.map +0 -1
- package/lib/cjs/index-PF7s7DOo.js +0 -386
- package/lib/cjs/index-PF7s7DOo.js.map +0 -1
- package/lib/cjs/index-TEjdwq--.js.map +0 -1
- package/lib/cjs/index-kNI3S3lF.js +0 -22477
- package/lib/cjs/index-kNI3S3lF.js.map +0 -1
- package/lib/cjs/index-kvO8ReCY.js +0 -1960
- package/lib/cjs/index-kvO8ReCY.js.map +0 -1
- package/lib/cjs/index-llNS_EuP.js.map +0 -1
- package/lib/cjs/index-xqKfEyRA.js.map +0 -1
- package/lib/cjs/meta-q8q9fHyr.js +0 -14
- package/lib/cjs/meta-q8q9fHyr.js.map +0 -1
- package/lib/cjs/schema-7d3meDfB.js +0 -74
- package/lib/cjs/schema-7d3meDfB.js.map +0 -1
- package/lib/cjs/tooltip-plugin-Mk9fRTxI.js +0 -200
- package/lib/cjs/tooltip-plugin-Mk9fRTxI.js.map +0 -1
- package/lib/esm/_view-JjtfhQ8k.js +0 -25
- package/lib/esm/_view-JjtfhQ8k.js.map +0 -1
- package/lib/esm/clsx-R7WFaNKL.js +0 -52
- package/lib/esm/clsx-R7WFaNKL.js.map +0 -1
- package/lib/esm/composed-offset-position.browser.min-Tnm31e-m.js +0 -1132
- package/lib/esm/composed-offset-position.browser.min-Tnm31e-m.js.map +0 -1
- package/lib/esm/helper-iYEjPbOY.js +0 -7
- package/lib/esm/helper-iYEjPbOY.js.map +0 -1
- package/lib/esm/index-218OjRxG.js +0 -549
- package/lib/esm/index-218OjRxG.js.map +0 -1
- package/lib/esm/index-AHPvVH4H.js +0 -197
- package/lib/esm/index-AHPvVH4H.js.map +0 -1
- package/lib/esm/index-Bg5GFp0g.js +0 -384
- package/lib/esm/index-Bg5GFp0g.js.map +0 -1
- package/lib/esm/index-JkHHp3K-.js +0 -22445
- package/lib/esm/index-JkHHp3K-.js.map +0 -1
- package/lib/esm/index-PkBZpDL4.js.map +0 -1
- package/lib/esm/index-TNMG6UrN.js +0 -53
- package/lib/esm/index-TNMG6UrN.js.map +0 -1
- package/lib/esm/index-VyZguCIt.js.map +0 -1
- package/lib/esm/index-h1arGiXv.js +0 -1958
- package/lib/esm/index-h1arGiXv.js.map +0 -1
- package/lib/esm/index-pHsvfB_I.js +0 -503
- package/lib/esm/index-pHsvfB_I.js.map +0 -1
- package/lib/esm/index-q-qE7-96.js.map +0 -1
- package/lib/esm/index-u8tWJbca.js +0 -176
- package/lib/esm/index-u8tWJbca.js.map +0 -1
- package/lib/esm/meta-3ZYGAGrY.js +0 -12
- package/lib/esm/meta-3ZYGAGrY.js.map +0 -1
- package/lib/esm/schema-hVsy-vme.js +0 -71
- package/lib/esm/schema-hVsy-vme.js.map +0 -1
- package/lib/esm/tooltip-plugin-vZefVSGL.js +0 -194
- package/lib/esm/tooltip-plugin-vZefVSGL.js.map +0 -1
- package/lib/types/feature/block-edit/menu/icons.d.ts +0 -14
- package/lib/types/feature/block-edit/menu/icons.d.ts.map +0 -1
- package/lib/types/feature/link-tooltip/consts.d.ts +0 -5
- package/lib/types/feature/link-tooltip/consts.d.ts.map +0 -1
- package/lib/types/feature/list-item/consts.d.ts.map +0 -1
- package/lib/types/feature/toolbar/consts.d.ts +0 -5
- package/lib/types/feature/toolbar/consts.d.ts.map +0 -1
- package/src/feature/block-edit/menu/icons.ts +0 -170
- package/src/feature/link-tooltip/consts.ts +0 -46
- package/src/feature/toolbar/consts.ts +0 -25
- /package/lib/theme/{classic → crepe}/style.css +0 -0
- /package/src/theme/{classic → crepe}/style.css +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulletList.d.ts","sourceRoot":"","sources":["../../../src/icons/bulletList.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,KAW1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caption.d.ts","sourceRoot":"","sources":["../../../src/icons/caption.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,KAIvB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkBoxChecked.d.ts","sourceRoot":"","sources":["../../../src/icons/checkBoxChecked.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,KAW/B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkBoxUnchecked.d.ts","sourceRoot":"","sources":["../../../src/icons/checkBoxUnchecked.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,KAWjC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chevronDown.d.ts","sourceRoot":"","sources":["../../../src/icons/chevronDown.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,KAI3B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear.d.ts","sourceRoot":"","sources":["../../../src/icons/clear.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,KAWrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/icons/code.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAWpB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../../src/icons/confirm.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,KAWvB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../../src/icons/divider.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,KAWvB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dragHandle.d.ts","sourceRoot":"","sources":["../../../src/icons/dragHandle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,KAI1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/icons/edit.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAWpB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"h1.d.ts","sourceRoot":"","sources":["../../../src/icons/h1.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAWlB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"h2.d.ts","sourceRoot":"","sources":["../../../src/icons/h2.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAWlB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"h3.d.ts","sourceRoot":"","sources":["../../../src/icons/h3.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAWlB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"h4.d.ts","sourceRoot":"","sources":["../../../src/icons/h4.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAWlB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"h5.d.ts","sourceRoot":"","sources":["../../../src/icons/h5.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAWlB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"h6.d.ts","sourceRoot":"","sources":["../../../src/icons/h6.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAWlB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/icons/image.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,KAWrB,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export * from './alignCenter';
|
|
2
|
+
export * from './alignLeft';
|
|
3
|
+
export * from './alignRight';
|
|
4
|
+
export * from './bold';
|
|
5
|
+
export * from './bullet';
|
|
6
|
+
export * from './bulletList';
|
|
7
|
+
export * from './caption';
|
|
8
|
+
export * from './checkBoxChecked';
|
|
9
|
+
export * from './checkBoxUnchecked';
|
|
10
|
+
export * from './chevronDown';
|
|
11
|
+
export * from './clear';
|
|
12
|
+
export * from './code';
|
|
13
|
+
export * from './confirm';
|
|
14
|
+
export * from './divider';
|
|
15
|
+
export * from './dragHandle';
|
|
16
|
+
export * from './edit';
|
|
17
|
+
export * from './h1';
|
|
18
|
+
export * from './h2';
|
|
19
|
+
export * from './h3';
|
|
20
|
+
export * from './h4';
|
|
21
|
+
export * from './h5';
|
|
22
|
+
export * from './h6';
|
|
23
|
+
export * from './image';
|
|
24
|
+
export * from './italic';
|
|
25
|
+
export * from './link';
|
|
26
|
+
export * from './menu';
|
|
27
|
+
export * from './orderedList';
|
|
28
|
+
export * from './plus';
|
|
29
|
+
export * from './quote';
|
|
30
|
+
export * from './remove';
|
|
31
|
+
export * from './search';
|
|
32
|
+
export * from './strikethrough';
|
|
33
|
+
export * from './table';
|
|
34
|
+
export * from './text';
|
|
35
|
+
export * from './todoList';
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,MAAM,CAAA;AACpB,cAAc,MAAM,CAAA;AACpB,cAAc,MAAM,CAAA;AACpB,cAAc,MAAM,CAAA;AACpB,cAAc,MAAM,CAAA;AACpB,cAAc,MAAM,CAAA;AACpB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"italic.d.ts","sourceRoot":"","sources":["../../../src/icons/italic.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,KAItB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/icons/link.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAIpB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/icons/menu.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAWpB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orderedList.d.ts","sourceRoot":"","sources":["../../../src/icons/orderedList.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,KAW3B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plus.d.ts","sourceRoot":"","sources":["../../../src/icons/plus.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAWpB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../../src/icons/quote.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,KAWrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/icons/remove.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,KAItB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/icons/search.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,KAItB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strikethrough.d.ts","sourceRoot":"","sources":["../../../src/icons/strikethrough.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,KAI7B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/icons/table.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,KAWrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/icons/text.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAWpB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"todoList.d.ts","sourceRoot":"","sources":["../../../src/icons/todoList.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,KAIxB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Selection } from '@milkdown/prose/state';
|
|
1
|
+
import type { Selection } from '@milkdown/kit/prose/state';
|
|
2
2
|
export declare function isInCodeBlock(selection: Selection): boolean;
|
|
3
3
|
export declare function isInList(selection: Selection): boolean;
|
|
4
4
|
export declare function defIfNotExists(tagName: string, element: CustomElementConstructor): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,WAGjD;AAED,wBAAgB,QAAQ,CAAC,SAAS,EAAE,SAAS,WAG5C;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,QAGhF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milkdown/crepe",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.5.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -23,7 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"./theme/common/*": "./lib/theme/common/*",
|
|
25
25
|
"./theme/classic.css": "./lib/theme/classic/style.css",
|
|
26
|
-
"./theme/classic-dark.css": "./lib/theme/classic-dark/style.css"
|
|
26
|
+
"./theme/classic-dark.css": "./lib/theme/classic-dark/style.css",
|
|
27
|
+
"./theme/nord.css": "./lib/theme/nord/style.css",
|
|
28
|
+
"./theme/nord-dark.css": "./lib/theme/nord-dark/style.css",
|
|
29
|
+
"./theme/frame.css": "./lib/theme/frame/style.css",
|
|
30
|
+
"./theme/frame-dark.css": "./lib/theme/frame-dark/style.css"
|
|
27
31
|
},
|
|
28
32
|
"main": "./lib/esm/index.js",
|
|
29
33
|
"files": [
|
|
@@ -44,19 +48,7 @@
|
|
|
44
48
|
"codemirror": "^6.0.1",
|
|
45
49
|
"nanoid": "^5.0.0",
|
|
46
50
|
"tslib": "^2.5.0",
|
|
47
|
-
"@milkdown/
|
|
48
|
-
"@milkdown/core": "7.4.0",
|
|
49
|
-
"@milkdown/ctx": "7.4.0",
|
|
50
|
-
"@milkdown/plugin-block": "7.4.0",
|
|
51
|
-
"@milkdown/plugin-clipboard": "7.4.0",
|
|
52
|
-
"@milkdown/plugin-cursor": "7.4.0",
|
|
53
|
-
"@milkdown/plugin-history": "7.4.0",
|
|
54
|
-
"@milkdown/plugin-indent": "7.4.0",
|
|
55
|
-
"@milkdown/plugin-slash": "7.4.0",
|
|
56
|
-
"@milkdown/plugin-tooltip": "7.4.0",
|
|
57
|
-
"@milkdown/preset-commonmark": "7.4.0",
|
|
58
|
-
"@milkdown/prose": "7.4.0",
|
|
59
|
-
"@milkdown/utils": "7.4.0"
|
|
51
|
+
"@milkdown/kit": "7.5.0"
|
|
60
52
|
},
|
|
61
53
|
"nx": {
|
|
62
54
|
"targets": {
|
|
@@ -65,19 +57,13 @@
|
|
|
65
57
|
"{projectRoot}/lib"
|
|
66
58
|
],
|
|
67
59
|
"dependsOn": [
|
|
68
|
-
|
|
69
|
-
"target": "build",
|
|
70
|
-
"projects": "dependencies"
|
|
71
|
-
}
|
|
60
|
+
"build"
|
|
72
61
|
]
|
|
73
62
|
},
|
|
74
63
|
"tsc": {
|
|
75
64
|
"outputs": [],
|
|
76
65
|
"dependsOn": [
|
|
77
|
-
|
|
78
|
-
"target": "build",
|
|
79
|
-
"projects": "dependencies"
|
|
80
|
-
}
|
|
66
|
+
"build"
|
|
81
67
|
]
|
|
82
68
|
}
|
|
83
69
|
}
|
package/src/core/crepe.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import type { DefaultValue } from '@milkdown/core'
|
|
2
|
-
import { Editor, defaultValueCtx, editorViewOptionsCtx, rootCtx } from '@milkdown/core'
|
|
1
|
+
import type { DefaultValue } from '@milkdown/kit/core'
|
|
2
|
+
import { Editor, defaultValueCtx, editorViewOptionsCtx, rootCtx } from '@milkdown/kit/core'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { getMarkdown } from '@milkdown/utils'
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
4
|
+
import { commonmark } from '@milkdown/kit/preset/commonmark'
|
|
5
|
+
import { gfm } from '@milkdown/kit/preset/gfm'
|
|
6
|
+
import { history } from '@milkdown/kit/plugin/history'
|
|
7
|
+
import { indent, indentConfig } from '@milkdown/kit/plugin/indent'
|
|
8
|
+
import { getMarkdown } from '@milkdown/kit/utils'
|
|
9
|
+
import { clipboard } from '@milkdown/kit/plugin/clipboard'
|
|
10
|
+
import { trailing } from '@milkdown/kit/plugin/trailing'
|
|
11
|
+
|
|
12
|
+
import type { CrepeFeatureConfig } from '../feature'
|
|
13
|
+
import { CrepeFeature, defaultFeatures, loadFeature } from '../feature'
|
|
11
14
|
import { configureFeatures } from './slice'
|
|
12
15
|
|
|
13
16
|
export interface CrepeConfig {
|
|
@@ -18,6 +21,7 @@ export interface CrepeConfig {
|
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
export class Crepe {
|
|
24
|
+
static Feature = CrepeFeature
|
|
21
25
|
readonly #editor: Editor
|
|
22
26
|
readonly #initPromise: Promise<unknown>
|
|
23
27
|
readonly #rootElement: Node
|
|
@@ -54,7 +58,9 @@ export class Crepe {
|
|
|
54
58
|
.use(commonmark)
|
|
55
59
|
.use(history)
|
|
56
60
|
.use(indent)
|
|
61
|
+
.use(trailing)
|
|
57
62
|
.use(clipboard)
|
|
63
|
+
.use(gfm)
|
|
58
64
|
|
|
59
65
|
const promiseList: Promise<unknown>[] = []
|
|
60
66
|
|
package/src/core/slice.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Ctx } from '@milkdown/ctx'
|
|
2
|
-
import { createSlice } from '@milkdown/ctx'
|
|
1
|
+
import type { Ctx } from '@milkdown/kit/ctx'
|
|
2
|
+
import { createSlice } from '@milkdown/kit/ctx'
|
|
3
3
|
import type { CrepeFeature } from '../feature'
|
|
4
4
|
|
|
5
5
|
export const FeaturesCtx = createSlice([] as CrepeFeature[], 'FeaturesCtx')
|
|
@@ -1,37 +1,19 @@
|
|
|
1
1
|
import { type Component, c, html, useEffect, useRef } from 'atomico'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
5
|
-
<g clip-path="url(#clip0_971_7680)">
|
|
6
|
-
<path d="M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z" fill="#817567"/>
|
|
7
|
-
</g>
|
|
8
|
-
<defs>
|
|
9
|
-
<clipPath id="clip0_971_7680">
|
|
10
|
-
<rect width="24" height="24" fill="white"/>
|
|
11
|
-
</clipPath>
|
|
12
|
-
</defs>
|
|
13
|
-
</svg>
|
|
14
|
-
`
|
|
15
|
-
|
|
16
|
-
const plusIcon = html`
|
|
17
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
18
|
-
<g clip-path="url(#clip0_971_7676)">
|
|
19
|
-
<path d="M18 13H13V18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18V13H6C5.45 13 5 12.55 5 12C5 11.45 5.45 11 6 11H11V6C11 5.45 11.45 5 12 5C12.55 5 13 5.45 13 6V11H18C18.55 11 19 11.45 19 12C19 12.55 18.55 13 18 13Z" fill="#817567"/>
|
|
20
|
-
</g>
|
|
21
|
-
<defs>
|
|
22
|
-
<clipPath id="clip0_971_7676">
|
|
23
|
-
<rect width="24" height="24" fill="white"/>
|
|
24
|
-
</clipPath>
|
|
25
|
-
</defs>
|
|
26
|
-
</svg>
|
|
27
|
-
`
|
|
2
|
+
import { menuIcon, plusIcon } from '../../../icons'
|
|
3
|
+
import type { Icon } from '../../shared'
|
|
28
4
|
|
|
29
5
|
export interface BlockHandleProps {
|
|
30
6
|
show: boolean
|
|
31
7
|
onAdd: () => void
|
|
8
|
+
addIcon: Icon
|
|
9
|
+
handleIcon: Icon
|
|
32
10
|
}
|
|
33
11
|
|
|
34
|
-
const blockHandleComponent: Component<BlockHandleProps> = ({
|
|
12
|
+
const blockHandleComponent: Component<BlockHandleProps> = ({
|
|
13
|
+
onAdd,
|
|
14
|
+
addIcon,
|
|
15
|
+
handleIcon,
|
|
16
|
+
}) => {
|
|
35
17
|
const ref = useRef<HTMLDivElement>()
|
|
36
18
|
useEffect(() => {
|
|
37
19
|
ref.current?.classList.remove('active')
|
|
@@ -50,10 +32,10 @@ const blockHandleComponent: Component<BlockHandleProps> = ({ onAdd }) => {
|
|
|
50
32
|
return html`
|
|
51
33
|
<host>
|
|
52
34
|
<div ref=${ref} onmousedown=${onMouseDown} onmouseup=${onMouseUp} class="operation-item">
|
|
53
|
-
${plusIcon}
|
|
35
|
+
${addIcon?.() || plusIcon}
|
|
54
36
|
</div>
|
|
55
37
|
<div class="operation-item">
|
|
56
|
-
${menuIcon}
|
|
38
|
+
${handleIcon?.() || menuIcon}
|
|
57
39
|
</div>
|
|
58
40
|
</host>
|
|
59
41
|
`
|
|
@@ -62,6 +44,8 @@ const blockHandleComponent: Component<BlockHandleProps> = ({ onAdd }) => {
|
|
|
62
44
|
blockHandleComponent.props = {
|
|
63
45
|
show: Boolean,
|
|
64
46
|
onAdd: Function,
|
|
47
|
+
addIcon: Function,
|
|
48
|
+
handleIcon: Function,
|
|
65
49
|
}
|
|
66
50
|
|
|
67
51
|
export const BlockHandleElement = c(blockHandleComponent)
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type { PluginView } from '@milkdown/prose/state'
|
|
2
|
-
import { TextSelection } from '@milkdown/prose/state'
|
|
3
|
-
import { BlockProvider, block } from '@milkdown/plugin
|
|
4
|
-
import type { Ctx } from '@milkdown/ctx'
|
|
1
|
+
import type { PluginView } from '@milkdown/kit/prose/state'
|
|
2
|
+
import { TextSelection } from '@milkdown/kit/prose/state'
|
|
3
|
+
import { BlockProvider, block } from '@milkdown/kit/plugin/block'
|
|
4
|
+
import type { Ctx } from '@milkdown/kit/ctx'
|
|
5
5
|
import type { AtomicoThis } from 'atomico/types/dom'
|
|
6
|
-
import { editorViewCtx } from '@milkdown/core'
|
|
7
|
-
import { paragraphSchema } from '@milkdown/preset
|
|
6
|
+
import { editorViewCtx } from '@milkdown/kit/core'
|
|
7
|
+
import { paragraphSchema } from '@milkdown/kit/preset/commonmark'
|
|
8
8
|
import { menuAPI } from '../menu'
|
|
9
9
|
import { defIfNotExists } from '../../../utils'
|
|
10
|
+
import type { BlockEditFeatureConfig } from '../index'
|
|
10
11
|
import type { BlockHandleProps } from './component'
|
|
11
12
|
import { BlockHandleElement } from './component'
|
|
12
13
|
|
|
@@ -15,11 +16,13 @@ export class BlockHandleView implements PluginView {
|
|
|
15
16
|
#provider: BlockProvider
|
|
16
17
|
readonly #ctx: Ctx
|
|
17
18
|
|
|
18
|
-
constructor(ctx: Ctx) {
|
|
19
|
+
constructor(ctx: Ctx, config?: BlockEditFeatureConfig) {
|
|
19
20
|
this.#ctx = ctx
|
|
20
21
|
const content = new BlockHandleElement()
|
|
21
22
|
this.#content = content
|
|
22
23
|
this.#content.onAdd = this.onAdd
|
|
24
|
+
this.#content.addIcon = config?.handleAddIcon
|
|
25
|
+
this.#content.handleIcon = config?.handleDragIcon
|
|
23
26
|
this.#provider = new BlockProvider({
|
|
24
27
|
ctx,
|
|
25
28
|
content,
|
|
@@ -63,14 +66,10 @@ export class BlockHandleView implements PluginView {
|
|
|
63
66
|
if (!active)
|
|
64
67
|
return
|
|
65
68
|
|
|
66
|
-
const pos = active.$pos
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const offset
|
|
71
|
-
= ['blockquote'].includes(pos.parent.type.name) ? 1 : isNoneTextBlock ? 1 : 2
|
|
72
|
-
let tr = state.tr.insert(side, paragraphSchema.type(ctx).create())
|
|
73
|
-
tr = tr.setSelection(TextSelection.create(tr.doc, side + offset))
|
|
69
|
+
const $pos = active.$pos
|
|
70
|
+
const pos = $pos.pos + active.node.nodeSize
|
|
71
|
+
let tr = state.tr.insert(pos, paragraphSchema.type(ctx).create())
|
|
72
|
+
tr = tr.setSelection(TextSelection.near(tr.doc.resolve(pos)))
|
|
74
73
|
dispatch(tr.scrollIntoView())
|
|
75
74
|
|
|
76
75
|
this.#provider.hide()
|
|
@@ -79,8 +78,8 @@ export class BlockHandleView implements PluginView {
|
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
defIfNotExists('milkdown-block-handle', BlockHandleElement)
|
|
82
|
-
export function configureBlockHandle(ctx: Ctx) {
|
|
81
|
+
export function configureBlockHandle(ctx: Ctx, config?: BlockEditFeatureConfig) {
|
|
83
82
|
ctx.set(block.key, {
|
|
84
|
-
view: () => new BlockHandleView(ctx),
|
|
83
|
+
view: () => new BlockHandleView(ctx, config),
|
|
85
84
|
})
|
|
86
85
|
}
|
|
@@ -1,12 +1,57 @@
|
|
|
1
|
-
import { block } from '@milkdown/plugin
|
|
2
|
-
import type { DefineFeature } from '../shared'
|
|
1
|
+
import { block } from '@milkdown/kit/plugin/block'
|
|
2
|
+
import type { DefineFeature, Icon } from '../shared'
|
|
3
3
|
import { configureBlockHandle } from './handle'
|
|
4
4
|
import { configureMenu, menu, menuAPI } from './menu'
|
|
5
|
+
import type { GroupBuilder } from './menu/group-builder'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
interface BlockEditConfig {
|
|
8
|
+
handleAddIcon: Icon
|
|
9
|
+
handleDragIcon: Icon
|
|
10
|
+
buildMenu: (builder: GroupBuilder) => void
|
|
11
|
+
|
|
12
|
+
slashMenuTextGroupLabel: string
|
|
13
|
+
slashMenuTextIcon: Icon
|
|
14
|
+
slashMenuTextLabel: string
|
|
15
|
+
slashMenuH1Icon: Icon
|
|
16
|
+
slashMenuH1Label: string
|
|
17
|
+
slashMenuH2Icon: Icon
|
|
18
|
+
slashMenuH2Label: string
|
|
19
|
+
slashMenuH3Icon: Icon
|
|
20
|
+
slashMenuH3Label: string
|
|
21
|
+
slashMenuH4Icon: Icon
|
|
22
|
+
slashMenuH4Label: string
|
|
23
|
+
slashMenuH5Icon: Icon
|
|
24
|
+
slashMenuH5Label: string
|
|
25
|
+
slashMenuH6Icon: Icon
|
|
26
|
+
slashMenuH6Label: string
|
|
27
|
+
slashMenuQuoteIcon: Icon
|
|
28
|
+
slashMenuQuoteLabel: string
|
|
29
|
+
slashMenuDividerIcon: Icon
|
|
30
|
+
slashMenuDividerLabel: string
|
|
31
|
+
|
|
32
|
+
slashMenuListGroupLabel: string
|
|
33
|
+
slashMenuBulletListIcon: Icon
|
|
34
|
+
slashMenuBulletListLabel: string
|
|
35
|
+
slashMenuOrderedListIcon: Icon
|
|
36
|
+
slashMenuOrderedListLabel: string
|
|
37
|
+
slashMenuTaskListIcon: Icon
|
|
38
|
+
slashMenuTaskListLabel: string
|
|
39
|
+
|
|
40
|
+
slashMenuAdvancedGroupLabel: string
|
|
41
|
+
slashMenuImageIcon: Icon
|
|
42
|
+
slashMenuImageLabel: string
|
|
43
|
+
slashMenuCodeBlockIcon: Icon
|
|
44
|
+
slashMenuCodeBlockLabel: string
|
|
45
|
+
slashMenuTableIcon: Icon
|
|
46
|
+
slashMenuTableLabel: string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type BlockEditFeatureConfig = Partial<BlockEditConfig>
|
|
50
|
+
|
|
51
|
+
export const defineFeature: DefineFeature<BlockEditFeatureConfig> = (editor, config) => {
|
|
7
52
|
editor
|
|
8
|
-
.config(configureBlockHandle)
|
|
9
|
-
.config(configureMenu)
|
|
53
|
+
.config(ctx => configureBlockHandle(ctx, config))
|
|
54
|
+
.config(ctx => configureMenu(ctx, config))
|
|
10
55
|
.use(menuAPI)
|
|
11
56
|
.use(block)
|
|
12
57
|
.use(menu)
|