@milkdown/crepe 7.8.0 → 7.9.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/confirm-CNveM9QH.js +26 -0
- package/lib/cjs/confirm-CNveM9QH.js.map +1 -0
- package/lib/cjs/edit-BUtBJHpV.js +24 -0
- package/lib/cjs/edit-BUtBJHpV.js.map +1 -0
- package/lib/cjs/functions-BAY51plB.js +39 -0
- package/lib/cjs/functions-BAY51plB.js.map +1 -0
- package/lib/cjs/image-BXLkOVnO.js +24 -0
- package/lib/cjs/image-BXLkOVnO.js.map +1 -0
- package/lib/cjs/{index-DAiGM2G1.js → index-B7gqgc1H.js} +484 -204
- package/lib/cjs/index-B7gqgc1H.js.map +1 -0
- package/lib/cjs/{index-Dub20F3z.js → index-B91KhPew.js} +4 -4
- package/lib/cjs/index-B91KhPew.js.map +1 -0
- package/lib/cjs/{index-nrFkJeLW.js → index-BsrJn8Jp.js} +22 -7
- package/lib/cjs/index-BsrJn8Jp.js.map +1 -0
- package/lib/cjs/{index-BReSN-JQ.js → index-C2CAbC2F.js} +2 -2
- package/lib/cjs/{index-BReSN-JQ.js.map → index-C2CAbC2F.js.map} +1 -1
- package/lib/cjs/{index-CGies6Iv.js → index-CnyNb_OH.js} +45 -45
- package/lib/cjs/index-CnyNb_OH.js.map +1 -0
- package/lib/cjs/{index-CJdEvN3_.js → index-CoTb-QdE.js} +123 -105
- package/lib/cjs/index-CoTb-QdE.js.map +1 -0
- package/lib/cjs/index-DEs_IHHy.js +91 -0
- package/lib/cjs/index-DEs_IHHy.js.map +1 -0
- package/lib/cjs/index-DGAwtnNK.js +349 -0
- package/lib/cjs/index-DGAwtnNK.js.map +1 -0
- package/lib/cjs/index-DLIudQKW.js +126 -0
- package/lib/cjs/index-DLIudQKW.js.map +1 -0
- package/lib/cjs/index-Dw6lXgs6.js +81 -0
- package/lib/cjs/index-Dw6lXgs6.js.map +1 -0
- package/lib/cjs/{index-AlHHvSR_.js → index-xbwf60wt.js} +1 -6
- package/lib/cjs/{index-AlHHvSR_.js.map → index-xbwf60wt.js.map} +1 -1
- package/lib/cjs/{index-CvmlYYXX.js → index-xbxqAqH2.js} +21 -7
- package/lib/cjs/index-xbxqAqH2.js.map +1 -0
- package/lib/cjs/index.js +6 -6
- package/lib/cjs/plus-XLomtlXf.js +24 -0
- package/lib/cjs/plus-XLomtlXf.js.map +1 -0
- package/lib/cjs/remove-Ba-ypwBf.js +17 -0
- package/lib/cjs/remove-Ba-ypwBf.js.map +1 -0
- package/lib/esm/confirm-DtE-HkVd.js +24 -0
- package/lib/esm/confirm-DtE-HkVd.js.map +1 -0
- package/lib/esm/edit-D--t_JAb.js +22 -0
- package/lib/esm/edit-D--t_JAb.js.map +1 -0
- package/lib/esm/functions-DlJPkGmE.js +36 -0
- package/lib/esm/functions-DlJPkGmE.js.map +1 -0
- package/lib/esm/image-DoB1o1sl.js +22 -0
- package/lib/esm/image-DoB1o1sl.js.map +1 -0
- package/lib/esm/index-BAQT-9au.js +347 -0
- package/lib/esm/index-BAQT-9au.js.map +1 -0
- package/lib/esm/{index-DOrkOhki.js → index-BCvtgOeI.js} +4 -4
- package/lib/esm/index-BCvtgOeI.js.map +1 -0
- package/lib/esm/{index-x2oo_GmY.js → index-BDZ_pnSv.js} +122 -104
- package/lib/esm/index-BDZ_pnSv.js.map +1 -0
- package/lib/esm/{index-D6fLMv29.js → index-BPG8iO8t.js} +2 -6
- package/lib/esm/{index-D6fLMv29.js.map → index-BPG8iO8t.js.map} +1 -1
- package/lib/esm/{index-DcRgwPLd.js → index-BUBXHhHG.js} +18 -3
- package/lib/esm/index-BUBXHhHG.js.map +1 -0
- package/lib/esm/{index-CsYl2WR5.js → index-Bvz1Yyiz.js} +2 -2
- package/lib/esm/{index-CsYl2WR5.js.map → index-Bvz1Yyiz.js.map} +1 -1
- package/lib/esm/index-C1aVAv1l.js +124 -0
- package/lib/esm/index-C1aVAv1l.js.map +1 -0
- package/lib/esm/{index-CEOsxgzJ.js → index-CM4urRY9.js} +470 -190
- package/lib/esm/index-CM4urRY9.js.map +1 -0
- package/lib/esm/{index-BFsG6770.js → index-ChR5Qhyf.js} +17 -3
- package/lib/esm/index-ChR5Qhyf.js.map +1 -0
- package/lib/esm/index-CwMVnVeI.js +89 -0
- package/lib/esm/index-CwMVnVeI.js.map +1 -0
- package/lib/esm/{index-BwTxn2hs.js → index-Dc_wWopW.js} +46 -46
- package/lib/esm/index-Dc_wWopW.js.map +1 -0
- package/lib/esm/index-E8UgFLeN.js +79 -0
- package/lib/esm/index-E8UgFLeN.js.map +1 -0
- package/lib/esm/index.js +6 -6
- package/lib/esm/plus-lrX0Q75O.js +22 -0
- package/lib/esm/plus-lrX0Q75O.js.map +1 -0
- package/lib/esm/remove-D3g0Cd6_.js +15 -0
- package/lib/esm/remove-D3g0Cd6_.js.map +1 -0
- package/lib/theme/_internal/classic-common.css +6 -0
- package/lib/theme/common/block-edit.css +23 -23
- package/lib/theme/common/code-mirror.css +43 -44
- package/lib/theme/common/image-block.css +79 -81
- package/lib/theme/common/latex.css +6 -6
- package/lib/theme/common/link-tooltip.css +21 -21
- package/lib/theme/common/list-item.css +11 -10
- package/lib/theme/common/table.css +39 -39
- package/lib/theme/common/toolbar.css +8 -8
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/core/crepe.d.ts +6 -6
- package/lib/types/core/crepe.d.ts.map +1 -1
- package/lib/types/core/slice.d.ts.map +1 -1
- package/lib/types/feature/block-edit/handle/component.d.ts +4 -8
- package/lib/types/feature/block-edit/handle/component.d.ts.map +1 -1
- package/lib/types/feature/block-edit/handle/index.d.ts +1 -1
- package/lib/types/feature/block-edit/handle/index.d.ts.map +1 -1
- package/lib/types/feature/block-edit/index.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/component.d.ts +8 -11
- package/lib/types/feature/block-edit/menu/component.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/config.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/index.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/utils.d.ts +2 -3
- package/lib/types/feature/block-edit/menu/utils.d.ts.map +1 -1
- package/lib/types/feature/code-mirror/index.d.ts +3 -4
- package/lib/types/feature/code-mirror/index.d.ts.map +1 -1
- package/lib/types/feature/cursor/index.d.ts.map +1 -1
- package/lib/types/feature/image-block/index.d.ts.map +1 -1
- package/lib/types/feature/index.d.ts +4 -4
- package/lib/types/feature/index.d.ts.map +1 -1
- package/lib/types/feature/latex/index.d.ts.map +1 -1
- package/lib/types/feature/latex/inline-tooltip/component.d.ts +6 -10
- package/lib/types/feature/latex/inline-tooltip/component.d.ts.map +1 -1
- package/lib/types/feature/latex/inline-tooltip/view.d.ts.map +1 -1
- package/lib/types/feature/latex/input-rule.d.ts.map +1 -1
- package/lib/types/feature/latex/remark.d.ts.map +1 -1
- package/lib/types/feature/link-tooltip/index.d.ts.map +1 -1
- package/lib/types/feature/list-item/index.d.ts.map +1 -1
- package/lib/types/feature/placeholder/index.d.ts.map +1 -1
- package/lib/types/feature/shared.d.ts +1 -2
- package/lib/types/feature/shared.d.ts.map +1 -1
- package/lib/types/feature/table/index.d.ts.map +1 -1
- package/lib/types/feature/toolbar/component.d.ts +9 -12
- package/lib/types/feature/toolbar/component.d.ts.map +1 -1
- package/lib/types/feature/toolbar/index.d.ts.map +1 -1
- package/lib/types/icons/align-center.d.ts +1 -1
- package/lib/types/icons/align-center.d.ts.map +1 -1
- package/lib/types/icons/align-left.d.ts +1 -1
- package/lib/types/icons/align-left.d.ts.map +1 -1
- package/lib/types/icons/align-right.d.ts +1 -1
- package/lib/types/icons/align-right.d.ts.map +1 -1
- package/lib/types/icons/bold.d.ts +1 -1
- package/lib/types/icons/bold.d.ts.map +1 -1
- package/lib/types/icons/bullet-list.d.ts +1 -1
- package/lib/types/icons/bullet-list.d.ts.map +1 -1
- package/lib/types/icons/bullet.d.ts +1 -1
- package/lib/types/icons/bullet.d.ts.map +1 -1
- package/lib/types/icons/caption.d.ts +1 -1
- package/lib/types/icons/caption.d.ts.map +1 -1
- package/lib/types/icons/check-box-checked.d.ts +1 -1
- package/lib/types/icons/check-box-checked.d.ts.map +1 -1
- package/lib/types/icons/check-box-unchecked.d.ts +1 -1
- package/lib/types/icons/check-box-unchecked.d.ts.map +1 -1
- package/lib/types/icons/chevron-down.d.ts +1 -1
- package/lib/types/icons/chevron-down.d.ts.map +1 -1
- package/lib/types/icons/clear.d.ts +1 -1
- package/lib/types/icons/clear.d.ts.map +1 -1
- package/lib/types/icons/code.d.ts +1 -1
- package/lib/types/icons/code.d.ts.map +1 -1
- package/lib/types/icons/confirm.d.ts +1 -1
- package/lib/types/icons/confirm.d.ts.map +1 -1
- package/lib/types/icons/copy.d.ts +1 -1
- package/lib/types/icons/copy.d.ts.map +1 -1
- package/lib/types/icons/divider.d.ts +1 -1
- package/lib/types/icons/divider.d.ts.map +1 -1
- package/lib/types/icons/drag-handle.d.ts +1 -1
- package/lib/types/icons/drag-handle.d.ts.map +1 -1
- package/lib/types/icons/edit.d.ts +1 -1
- package/lib/types/icons/edit.d.ts.map +1 -1
- package/lib/types/icons/functions.d.ts +1 -1
- package/lib/types/icons/functions.d.ts.map +1 -1
- package/lib/types/icons/h1.d.ts +1 -1
- package/lib/types/icons/h1.d.ts.map +1 -1
- package/lib/types/icons/h2.d.ts +1 -1
- package/lib/types/icons/h2.d.ts.map +1 -1
- package/lib/types/icons/h3.d.ts +1 -1
- package/lib/types/icons/h3.d.ts.map +1 -1
- package/lib/types/icons/h4.d.ts +1 -1
- package/lib/types/icons/h4.d.ts.map +1 -1
- package/lib/types/icons/h5.d.ts +1 -1
- package/lib/types/icons/h5.d.ts.map +1 -1
- package/lib/types/icons/h6.d.ts +1 -1
- package/lib/types/icons/h6.d.ts.map +1 -1
- package/lib/types/icons/image.d.ts +1 -1
- package/lib/types/icons/image.d.ts.map +1 -1
- package/lib/types/icons/italic.d.ts +1 -1
- package/lib/types/icons/italic.d.ts.map +1 -1
- package/lib/types/icons/link.d.ts +1 -1
- package/lib/types/icons/link.d.ts.map +1 -1
- package/lib/types/icons/menu.d.ts +1 -1
- package/lib/types/icons/menu.d.ts.map +1 -1
- package/lib/types/icons/ordered-list.d.ts +1 -1
- package/lib/types/icons/ordered-list.d.ts.map +1 -1
- package/lib/types/icons/plus.d.ts +1 -1
- package/lib/types/icons/plus.d.ts.map +1 -1
- package/lib/types/icons/quote.d.ts +1 -1
- package/lib/types/icons/quote.d.ts.map +1 -1
- package/lib/types/icons/remove.d.ts +1 -1
- package/lib/types/icons/remove.d.ts.map +1 -1
- package/lib/types/icons/search.d.ts +1 -1
- package/lib/types/icons/search.d.ts.map +1 -1
- package/lib/types/icons/strikethrough.d.ts +1 -1
- package/lib/types/icons/strikethrough.d.ts.map +1 -1
- package/lib/types/icons/table.d.ts +1 -1
- package/lib/types/icons/table.d.ts.map +1 -1
- package/lib/types/icons/text.d.ts +1 -1
- package/lib/types/icons/text.d.ts.map +1 -1
- package/lib/types/icons/todo-list.d.ts +1 -1
- package/lib/types/icons/todo-list.d.ts.map +1 -1
- package/lib/types/icons/visibility-off.d.ts +1 -1
- package/lib/types/icons/visibility-off.d.ts.map +1 -1
- package/package.json +4 -26
- package/src/core/crepe.ts +13 -12
- package/src/core/slice.ts +2 -0
- package/src/feature/block-edit/handle/component.tsx +60 -0
- package/src/feature/block-edit/handle/index.ts +22 -14
- package/src/feature/block-edit/index.ts +3 -1
- package/src/feature/block-edit/menu/component.tsx +237 -0
- package/src/feature/block-edit/menu/config.ts +6 -3
- package/src/feature/block-edit/menu/index.ts +38 -18
- package/src/feature/block-edit/menu/utils.ts +3 -3
- package/src/feature/code-mirror/index.ts +20 -20
- package/src/feature/cursor/index.ts +1 -1
- package/src/feature/image-block/index.ts +3 -1
- package/src/feature/index.ts +5 -4
- package/src/feature/latex/index.ts +8 -8
- package/src/feature/latex/inline-tooltip/component.tsx +57 -0
- package/src/feature/latex/inline-tooltip/view.ts +30 -17
- package/src/feature/latex/input-rule.ts +4 -3
- package/src/feature/latex/remark.ts +3 -2
- package/src/feature/link-tooltip/index.ts +3 -1
- package/src/feature/list-item/index.ts +8 -16
- package/src/feature/placeholder/index.ts +6 -3
- package/src/feature/shared.ts +1 -2
- package/src/feature/table/index.ts +2 -0
- package/src/feature/toolbar/component.tsx +256 -0
- package/src/feature/toolbar/index.ts +34 -17
- package/src/icons/align-center.ts +1 -3
- package/src/icons/align-left.ts +1 -3
- package/src/icons/align-right.ts +1 -3
- package/src/icons/bold.ts +1 -3
- package/src/icons/bullet-list.ts +1 -3
- package/src/icons/bullet.ts +1 -3
- package/src/icons/caption.ts +1 -3
- package/src/icons/check-box-checked.ts +1 -3
- package/src/icons/check-box-unchecked.ts +1 -3
- package/src/icons/chevron-down.ts +1 -3
- package/src/icons/clear.ts +1 -3
- package/src/icons/code.ts +1 -3
- package/src/icons/confirm.ts +1 -3
- package/src/icons/copy.ts +1 -3
- package/src/icons/divider.ts +1 -3
- package/src/icons/drag-handle.ts +1 -3
- package/src/icons/edit.ts +1 -3
- package/src/icons/functions.ts +1 -3
- package/src/icons/h1.ts +1 -3
- package/src/icons/h2.ts +1 -3
- package/src/icons/h3.ts +1 -3
- package/src/icons/h4.ts +1 -3
- package/src/icons/h5.ts +1 -3
- package/src/icons/h6.ts +1 -3
- package/src/icons/image.ts +1 -3
- package/src/icons/italic.ts +1 -3
- package/src/icons/link.ts +1 -3
- package/src/icons/menu.ts +1 -3
- package/src/icons/ordered-list.ts +1 -3
- package/src/icons/plus.ts +1 -3
- package/src/icons/quote.ts +1 -3
- package/src/icons/remove.ts +1 -3
- package/src/icons/search.ts +1 -3
- package/src/icons/strikethrough.ts +1 -3
- package/src/icons/table.ts +1 -3
- package/src/icons/text.ts +1 -3
- package/src/icons/todo-list.ts +1 -3
- package/src/icons/visibility-off.ts +1 -3
- package/src/theme/_internal/classic-common.css +6 -0
- package/src/theme/common/block-edit.css +2 -2
- package/src/theme/common/code-mirror.css +5 -6
- package/src/theme/common/image-block.css +9 -11
- package/src/theme/common/latex.css +1 -1
- package/src/theme/common/link-tooltip.css +2 -2
- package/src/theme/common/list-item.css +3 -2
- package/src/theme/common/table.css +2 -2
- package/src/theme/common/toolbar.css +1 -1
- package/lib/cjs/functions-Dk90yOUc.js +0 -690
- package/lib/cjs/functions-Dk90yOUc.js.map +0 -1
- package/lib/cjs/index-CGies6Iv.js.map +0 -1
- package/lib/cjs/index-CJdEvN3_.js.map +0 -1
- package/lib/cjs/index-CvmlYYXX.js.map +0 -1
- package/lib/cjs/index-D3lu92SA.js +0 -39
- package/lib/cjs/index-D3lu92SA.js.map +0 -1
- package/lib/cjs/index-DAiGM2G1.js.map +0 -1
- package/lib/cjs/index-DKY_Kri2.js +0 -272
- package/lib/cjs/index-DKY_Kri2.js.map +0 -1
- package/lib/cjs/index-DQll67YS.js +0 -65
- package/lib/cjs/index-DQll67YS.js.map +0 -1
- package/lib/cjs/index-Dub20F3z.js.map +0 -1
- package/lib/cjs/index-hPk2gbSt.js +0 -35
- package/lib/cjs/index-hPk2gbSt.js.map +0 -1
- package/lib/cjs/index-nrFkJeLW.js.map +0 -1
- package/lib/esm/functions-Bsik6ikd.js +0 -652
- package/lib/esm/functions-Bsik6ikd.js.map +0 -1
- package/lib/esm/index-B3KiKTSt.js +0 -63
- package/lib/esm/index-B3KiKTSt.js.map +0 -1
- package/lib/esm/index-BFsG6770.js.map +0 -1
- package/lib/esm/index-BwTxn2hs.js.map +0 -1
- package/lib/esm/index-CBrOT1fW.js +0 -37
- package/lib/esm/index-CBrOT1fW.js.map +0 -1
- package/lib/esm/index-CEOsxgzJ.js.map +0 -1
- package/lib/esm/index-Cuk7cL-r.js +0 -33
- package/lib/esm/index-Cuk7cL-r.js.map +0 -1
- package/lib/esm/index-DOrkOhki.js.map +0 -1
- package/lib/esm/index-DcRgwPLd.js.map +0 -1
- package/lib/esm/index-H9uklzH0.js +0 -270
- package/lib/esm/index-H9uklzH0.js.map +0 -1
- package/lib/esm/index-x2oo_GmY.js.map +0 -1
- package/src/feature/block-edit/handle/component.ts +0 -54
- package/src/feature/block-edit/menu/component.ts +0 -241
- package/src/feature/latex/inline-tooltip/component.ts +0 -38
- package/src/feature/toolbar/component.ts +0 -236
|
@@ -1,25 +1,303 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var block = require('@milkdown/kit/plugin/block');
|
|
4
|
-
var state = require('@milkdown/kit/prose/state');
|
|
5
4
|
var core = require('@milkdown/kit/core');
|
|
6
5
|
var commonmark = require('@milkdown/kit/preset/commonmark');
|
|
7
6
|
var prose = require('@milkdown/kit/prose');
|
|
7
|
+
var state = require('@milkdown/kit/prose/state');
|
|
8
|
+
var vue = require('vue');
|
|
9
|
+
var plus = require('./plus-XLomtlXf.js');
|
|
8
10
|
var slash = require('@milkdown/kit/plugin/slash');
|
|
9
11
|
var utils = require('@milkdown/kit/utils');
|
|
10
|
-
var index$1 = require('./index-
|
|
11
|
-
var
|
|
12
|
+
var index$1 = require('./index-xbwf60wt.js');
|
|
13
|
+
var component = require('@milkdown/kit/component');
|
|
12
14
|
var imageBlock = require('@milkdown/kit/component/image-block');
|
|
13
15
|
var gfm = require('@milkdown/kit/preset/gfm');
|
|
14
|
-
var index = require('./index-
|
|
15
|
-
var functions = require('./functions-
|
|
16
|
+
var index = require('./index-CnyNb_OH.js');
|
|
17
|
+
var functions = require('./functions-BAY51plB.js');
|
|
18
|
+
var image = require('./image-BXLkOVnO.js');
|
|
16
19
|
var transform = require('@milkdown/kit/prose/transform');
|
|
20
|
+
require('@milkdown/kit/plugin/clipboard');
|
|
17
21
|
require('@milkdown/kit/plugin/history');
|
|
18
22
|
require('@milkdown/kit/plugin/indent');
|
|
19
|
-
require('@milkdown/kit/plugin/
|
|
23
|
+
require('@milkdown/kit/plugin/listener');
|
|
20
24
|
require('@milkdown/kit/plugin/trailing');
|
|
21
25
|
require('@milkdown/kit/ctx');
|
|
22
|
-
|
|
26
|
+
|
|
27
|
+
const bulletListIcon = `
|
|
28
|
+
<svg
|
|
29
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
30
|
+
width="24"
|
|
31
|
+
height="24"
|
|
32
|
+
viewBox="0 0 24 24"
|
|
33
|
+
>
|
|
34
|
+
<g clip-path="url(#clip0_977_8070)">
|
|
35
|
+
<path
|
|
36
|
+
d="M4 10.5C3.17 10.5 2.5 11.17 2.5 12C2.5 12.83 3.17 13.5 4 13.5C4.83 13.5 5.5 12.83 5.5 12C5.5 11.17 4.83 10.5 4 10.5ZM4 4.5C3.17 4.5 2.5 5.17 2.5 6C2.5 6.83 3.17 7.5 4 7.5C4.83 7.5 5.5 6.83 5.5 6C5.5 5.17 4.83 4.5 4 4.5ZM4 16.5C3.17 16.5 2.5 17.18 2.5 18C2.5 18.82 3.18 19.5 4 19.5C4.82 19.5 5.5 18.82 5.5 18C5.5 17.18 4.83 16.5 4 16.5ZM8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19ZM8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13ZM7 6C7 6.55 7.45 7 8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6Z"
|
|
37
|
+
/>
|
|
38
|
+
</g>
|
|
39
|
+
<defs>
|
|
40
|
+
<clipPath id="clip0_977_8070">
|
|
41
|
+
<rect width="24" height="24" />
|
|
42
|
+
</clipPath>
|
|
43
|
+
</defs>
|
|
44
|
+
</svg>
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
const dividerIcon = `
|
|
48
|
+
<svg
|
|
49
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
50
|
+
width="24"
|
|
51
|
+
height="24"
|
|
52
|
+
viewBox="0 0 24 24"
|
|
53
|
+
>
|
|
54
|
+
<g clip-path="url(#clip0_977_7900)">
|
|
55
|
+
<path
|
|
56
|
+
fill-rule="evenodd"
|
|
57
|
+
clip-rule="evenodd"
|
|
58
|
+
d="M19 13H5C4.45 13 4 12.55 4 12C4 11.45 4.45 11 5 11H19C19.55 11 20 11.45 20 12C20 12.55 19.55 13 19 13Z"
|
|
59
|
+
/>
|
|
60
|
+
</g>
|
|
61
|
+
<defs>
|
|
62
|
+
<clipPath id="clip0_977_7900">
|
|
63
|
+
<rect width="24" height="24" />
|
|
64
|
+
</clipPath>
|
|
65
|
+
</defs>
|
|
66
|
+
</svg>
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
const h1Icon = `
|
|
70
|
+
<svg
|
|
71
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
72
|
+
width="24"
|
|
73
|
+
height="24"
|
|
74
|
+
viewBox="0 0 24 24"
|
|
75
|
+
>
|
|
76
|
+
<g clip-path="url(#clip0_992_5553)">
|
|
77
|
+
<path
|
|
78
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM12 17H14V7H10V9H12V17Z"
|
|
79
|
+
/>
|
|
80
|
+
</g>
|
|
81
|
+
<defs>
|
|
82
|
+
<clipPath id="clip0_992_5553">
|
|
83
|
+
<rect width="24" height="24" />
|
|
84
|
+
</clipPath>
|
|
85
|
+
</defs>
|
|
86
|
+
</svg>
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
const h2Icon = `
|
|
90
|
+
<svg
|
|
91
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
92
|
+
width="24"
|
|
93
|
+
height="24"
|
|
94
|
+
viewBox="0 0 24 24"
|
|
95
|
+
>
|
|
96
|
+
<g clip-path="url(#clip0_992_5559)">
|
|
97
|
+
<path
|
|
98
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15H11V13H13C14.1 13 15 12.11 15 11V9C15 7.89 14.1 7 13 7H9V9H13V11H11C9.9 11 9 11.89 9 13V17H15V15Z"
|
|
99
|
+
/>
|
|
100
|
+
</g>
|
|
101
|
+
<defs>
|
|
102
|
+
<clipPath id="clip0_992_5559">
|
|
103
|
+
<rect width="24" height="24" />
|
|
104
|
+
</clipPath>
|
|
105
|
+
</defs>
|
|
106
|
+
</svg>
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
const h3Icon = `
|
|
110
|
+
<svg
|
|
111
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
112
|
+
width="24"
|
|
113
|
+
height="24"
|
|
114
|
+
viewBox="0 0 24 24"
|
|
115
|
+
>
|
|
116
|
+
<g clip-path="url(#clip0_992_5565)">
|
|
117
|
+
<path
|
|
118
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13.5C15 12.67 14.33 12 13.5 12C14.33 12 15 11.33 15 10.5V9C15 7.89 14.1 7 13 7H9V9H13V11H11V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"
|
|
119
|
+
/>
|
|
120
|
+
</g>
|
|
121
|
+
<defs>
|
|
122
|
+
<clipPath id="clip0_992_5565">
|
|
123
|
+
<rect width="24" height="24" />
|
|
124
|
+
</clipPath>
|
|
125
|
+
</defs>
|
|
126
|
+
</svg>
|
|
127
|
+
`;
|
|
128
|
+
|
|
129
|
+
const h4Icon = `
|
|
130
|
+
<svg
|
|
131
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
132
|
+
width="24"
|
|
133
|
+
height="24"
|
|
134
|
+
viewBox="0 0 24 24"
|
|
135
|
+
>
|
|
136
|
+
<g clip-path="url(#clip0_977_7757)">
|
|
137
|
+
<path
|
|
138
|
+
d="M19.04 3H5.04004C3.94004 3 3.04004 3.9 3.04004 5V19C3.04004 20.1 3.94004 21 5.04004 21H19.04C20.14 21 21.04 20.1 21.04 19V5C21.04 3.9 20.14 3 19.04 3ZM19.04 19H5.04004V5H19.04V19ZM13.04 17H15.04V7H13.04V11H11.04V7H9.04004V13H13.04V17Z"
|
|
139
|
+
/>
|
|
140
|
+
</g>
|
|
141
|
+
<defs>
|
|
142
|
+
<clipPath id="clip0_977_7757">
|
|
143
|
+
<rect width="24" height="24" />
|
|
144
|
+
</clipPath>
|
|
145
|
+
</defs>
|
|
146
|
+
</svg>
|
|
147
|
+
`;
|
|
148
|
+
|
|
149
|
+
const h5Icon = `
|
|
150
|
+
<svg
|
|
151
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
152
|
+
width="24"
|
|
153
|
+
height="24"
|
|
154
|
+
viewBox="0 0 24 24"
|
|
155
|
+
>
|
|
156
|
+
<g clip-path="url(#clip0_977_7760)">
|
|
157
|
+
<path
|
|
158
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H9V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"
|
|
159
|
+
/>
|
|
160
|
+
</g>
|
|
161
|
+
<defs>
|
|
162
|
+
<clipPath id="clip0_977_7760">
|
|
163
|
+
<rect width="24" height="24" />
|
|
164
|
+
</clipPath>
|
|
165
|
+
</defs>
|
|
166
|
+
</svg>
|
|
167
|
+
`;
|
|
168
|
+
|
|
169
|
+
const h6Icon = `
|
|
170
|
+
<svg
|
|
171
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
172
|
+
width="24"
|
|
173
|
+
height="24"
|
|
174
|
+
viewBox="0 0 24 24"
|
|
175
|
+
>
|
|
176
|
+
<g clip-path="url(#clip0_977_7763)">
|
|
177
|
+
<path
|
|
178
|
+
d="M11 17H13C14.1 17 15 16.11 15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H11C9.9 7 9 7.89 9 9V15C9 16.11 9.9 17 11 17ZM11 13H13V15H11V13ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19Z"
|
|
179
|
+
/>
|
|
180
|
+
</g>
|
|
181
|
+
<defs>
|
|
182
|
+
<clipPath id="clip0_977_7763">
|
|
183
|
+
<rect width="24" height="24" />
|
|
184
|
+
</clipPath>
|
|
185
|
+
</defs>
|
|
186
|
+
</svg>
|
|
187
|
+
`;
|
|
188
|
+
|
|
189
|
+
const menuIcon = `
|
|
190
|
+
<svg
|
|
191
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
192
|
+
width="24"
|
|
193
|
+
height="24"
|
|
194
|
+
viewBox="0 0 24 24"
|
|
195
|
+
>
|
|
196
|
+
<g clip-path="url(#clip0_971_7680)">
|
|
197
|
+
<path
|
|
198
|
+
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"
|
|
199
|
+
/>
|
|
200
|
+
</g>
|
|
201
|
+
<defs>
|
|
202
|
+
<clipPath id="clip0_971_7680">
|
|
203
|
+
<rect width="24" height="24" />
|
|
204
|
+
</clipPath>
|
|
205
|
+
</defs>
|
|
206
|
+
</svg>
|
|
207
|
+
`;
|
|
208
|
+
|
|
209
|
+
const orderedListIcon = `
|
|
210
|
+
<svg
|
|
211
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
212
|
+
width="24"
|
|
213
|
+
height="24"
|
|
214
|
+
viewBox="0 0 24 24"
|
|
215
|
+
>
|
|
216
|
+
<g clip-path="url(#clip0_977_8067)">
|
|
217
|
+
<path
|
|
218
|
+
d="M8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6C7 6.55 7.45 7 8 7ZM20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17ZM20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11ZM4.5 16H2.5C2.22 16 2 16.22 2 16.5C2 16.78 2.22 17 2.5 17H4V17.5H3.5C3.22 17.5 3 17.72 3 18C3 18.28 3.22 18.5 3.5 18.5H4V19H2.5C2.22 19 2 19.22 2 19.5C2 19.78 2.22 20 2.5 20H4.5C4.78 20 5 19.78 5 19.5V16.5C5 16.22 4.78 16 4.5 16ZM2.5 5H3V7.5C3 7.78 3.22 8 3.5 8C3.78 8 4 7.78 4 7.5V4.5C4 4.22 3.78 4 3.5 4H2.5C2.22 4 2 4.22 2 4.5C2 4.78 2.22 5 2.5 5ZM4.5 10H2.5C2.22 10 2 10.22 2 10.5C2 10.78 2.22 11 2.5 11H3.8L2.12 12.96C2.04 13.05 2 13.17 2 13.28V13.5C2 13.78 2.22 14 2.5 14H4.5C4.78 14 5 13.78 5 13.5C5 13.22 4.78 13 4.5 13H3.2L4.88 11.04C4.96 10.95 5 10.83 5 10.72V10.5C5 10.22 4.78 10 4.5 10Z"
|
|
219
|
+
/>
|
|
220
|
+
</g>
|
|
221
|
+
<defs>
|
|
222
|
+
<clipPath id="clip0_977_8067">
|
|
223
|
+
<rect width="24" height="24" />
|
|
224
|
+
</clipPath>
|
|
225
|
+
</defs>
|
|
226
|
+
</svg>
|
|
227
|
+
`;
|
|
228
|
+
|
|
229
|
+
const quoteIcon = `
|
|
230
|
+
<svg
|
|
231
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
232
|
+
width="24"
|
|
233
|
+
height="24"
|
|
234
|
+
viewBox="0 0 24 24"
|
|
235
|
+
>
|
|
236
|
+
<g clip-path="url(#clip0_977_7897)">
|
|
237
|
+
<path
|
|
238
|
+
d="M7.17 17C7.68 17 8.15 16.71 8.37 16.26L9.79 13.42C9.93 13.14 10 12.84 10 12.53V8C10 7.45 9.55 7 9 7H5C4.45 7 4 7.45 4 8V12C4 12.55 4.45 13 5 13H7L5.97 15.06C5.52 15.95 6.17 17 7.17 17ZM17.17 17C17.68 17 18.15 16.71 18.37 16.26L19.79 13.42C19.93 13.14 20 12.84 20 12.53V8C20 7.45 19.55 7 19 7H15C14.45 7 14 7.45 14 8V12C14 12.55 14.45 13 15 13H17L15.97 15.06C15.52 15.95 16.17 17 17.17 17Z"
|
|
239
|
+
/>
|
|
240
|
+
</g>
|
|
241
|
+
<defs>
|
|
242
|
+
<clipPath id="clip0_977_7897">
|
|
243
|
+
<rect width="24" height="24" />
|
|
244
|
+
</clipPath>
|
|
245
|
+
</defs>
|
|
246
|
+
</svg>
|
|
247
|
+
`;
|
|
248
|
+
|
|
249
|
+
const tableIcon = `
|
|
250
|
+
<svg
|
|
251
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
252
|
+
width="24"
|
|
253
|
+
height="24"
|
|
254
|
+
viewBox="0 0 24 24"
|
|
255
|
+
>
|
|
256
|
+
<g clip-path="url(#clip0_977_8078)">
|
|
257
|
+
<path
|
|
258
|
+
d="M20 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H20C21.1 21 22 20.1 22 19V5C22 3.9 21.1 3 20 3ZM20 5V8H5V5H20ZM15 19H10V10H15V19ZM5 10H8V19H5V10ZM17 19V10H20V19H17Z"
|
|
259
|
+
/>
|
|
260
|
+
</g>
|
|
261
|
+
<defs>
|
|
262
|
+
<clipPath id="clip0_977_8078">
|
|
263
|
+
<rect width="24" height="24" />
|
|
264
|
+
</clipPath>
|
|
265
|
+
</defs>
|
|
266
|
+
</svg>
|
|
267
|
+
`;
|
|
268
|
+
|
|
269
|
+
const textIcon = `
|
|
270
|
+
<svg
|
|
271
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
272
|
+
width="24"
|
|
273
|
+
height="24"
|
|
274
|
+
viewBox="0 0 24 24"
|
|
275
|
+
>
|
|
276
|
+
<g clip-path="url(#clip0_992_5547)">
|
|
277
|
+
<path
|
|
278
|
+
d="M5 5.5C5 6.33 5.67 7 6.5 7H10.5V17.5C10.5 18.33 11.17 19 12 19C12.83 19 13.5 18.33 13.5 17.5V7H17.5C18.33 7 19 6.33 19 5.5C19 4.67 18.33 4 17.5 4H6.5C5.67 4 5 4.67 5 5.5Z"
|
|
279
|
+
/>
|
|
280
|
+
</g>
|
|
281
|
+
<defs>
|
|
282
|
+
<clipPath id="clip0_992_5547">
|
|
283
|
+
<rect width="24" height="24" />
|
|
284
|
+
</clipPath>
|
|
285
|
+
</defs>
|
|
286
|
+
</svg>
|
|
287
|
+
`;
|
|
288
|
+
|
|
289
|
+
const todoListIcon = `
|
|
290
|
+
<svg
|
|
291
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
292
|
+
width="24"
|
|
293
|
+
height="24"
|
|
294
|
+
viewBox="0 0 24 24"
|
|
295
|
+
>
|
|
296
|
+
<path
|
|
297
|
+
d="M5.66936 16.3389L9.39244 12.6158C9.54115 12.4671 9.71679 12.3937 9.91936 12.3957C10.1219 12.3976 10.2975 12.4761 10.4463 12.6312C10.5847 12.7823 10.654 12.9585 10.654 13.1599C10.654 13.3613 10.5847 13.5363 10.4463 13.6851L6.32704 17.8197C6.14627 18.0004 5.93538 18.0908 5.69436 18.0908C5.45333 18.0908 5.24243 18.0004 5.06166 17.8197L3.01744 15.7754C2.87899 15.637 2.81136 15.4629 2.81456 15.2533C2.81776 15.0437 2.88859 14.8697 3.02706 14.7312C3.16551 14.5928 3.34008 14.5235 3.55076 14.5235C3.76144 14.5235 3.93494 14.5928 4.07126 14.7312L5.66936 16.3389ZM5.66936 8.72359L9.39244 5.00049C9.54115 4.85177 9.71679 4.77838 9.91936 4.78031C10.1219 4.78223 10.2975 4.86075 10.4463 5.01586C10.5847 5.16691 10.654 5.34314 10.654 5.54454C10.654 5.74592 10.5847 5.92097 10.4463 6.06969L6.32704 10.2043C6.14627 10.3851 5.93538 10.4755 5.69436 10.4755C5.45333 10.4755 5.24243 10.3851 5.06166 10.2043L3.01744 8.16009C2.87899 8.02162 2.81136 7.84759 2.81456 7.63799C2.81776 7.42837 2.88859 7.25433 3.02706 7.11586C3.16551 6.97741 3.34008 6.90819 3.55076 6.90819C3.76144 6.90819 3.93494 6.97741 4.07126 7.11586L5.66936 8.72359ZM13.7597 16.5581C13.5472 16.5581 13.3691 16.4862 13.2253 16.3424C13.0816 16.1986 13.0097 16.0204 13.0097 15.8078C13.0097 15.5952 13.0816 15.4171 13.2253 15.2735C13.3691 15.13 13.5472 15.0582 13.7597 15.0582H20.7597C20.9722 15.0582 21.1503 15.1301 21.2941 15.2739C21.4378 15.4177 21.5097 15.5959 21.5097 15.8085C21.5097 16.0211 21.4378 16.1992 21.2941 16.3427C21.1503 16.4863 20.9722 16.5581 20.7597 16.5581H13.7597ZM13.7597 8.94276C13.5472 8.94276 13.3691 8.87085 13.2253 8.72704C13.0816 8.58324 13.0097 8.40504 13.0097 8.19244C13.0097 7.97985 13.0816 7.80177 13.2253 7.65819C13.3691 7.5146 13.5472 7.44281 13.7597 7.44281H20.7597C20.9722 7.44281 21.1503 7.51471 21.2941 7.65851C21.4378 7.80233 21.5097 7.98053 21.5097 8.19311C21.5097 8.40571 21.4378 8.5838 21.2941 8.72739C21.1503 8.87097 20.9722 8.94276 20.7597 8.94276H13.7597Z"
|
|
298
|
+
/>
|
|
299
|
+
</svg>
|
|
300
|
+
`;
|
|
23
301
|
|
|
24
302
|
var __typeError$2 = (msg) => {
|
|
25
303
|
throw TypeError(msg);
|
|
@@ -132,7 +410,7 @@ function getGroups(filter, config, ctx) {
|
|
|
132
410
|
const groupBuilder = new GroupBuilder();
|
|
133
411
|
groupBuilder.addGroup("text", (_a = config == null ? void 0 : config.slashMenuTextGroupLabel) != null ? _a : "Text").addItem("text", {
|
|
134
412
|
label: (_b = config == null ? void 0 : config.slashMenuTextGroupLabel) != null ? _b : "Text",
|
|
135
|
-
icon: (_d = (_c = config == null ? void 0 : config.slashMenuTextIcon) == null ? void 0 : _c.call(config)) != null ? _d :
|
|
413
|
+
icon: (_d = (_c = config == null ? void 0 : config.slashMenuTextIcon) == null ? void 0 : _c.call(config)) != null ? _d : textIcon,
|
|
136
414
|
onRun: (ctx2) => {
|
|
137
415
|
const view = ctx2.get(core.editorViewCtx);
|
|
138
416
|
const { dispatch, state } = view;
|
|
@@ -141,7 +419,7 @@ function getGroups(filter, config, ctx) {
|
|
|
141
419
|
}
|
|
142
420
|
}).addItem("h1", {
|
|
143
421
|
label: (_e = config == null ? void 0 : config.slashMenuH1Label) != null ? _e : "Heading 1",
|
|
144
|
-
icon: (_g = (_f = config == null ? void 0 : config.slashMenuH1Icon) == null ? void 0 : _f.call(config)) != null ? _g :
|
|
422
|
+
icon: (_g = (_f = config == null ? void 0 : config.slashMenuH1Icon) == null ? void 0 : _f.call(config)) != null ? _g : h1Icon,
|
|
145
423
|
onRun: (ctx2) => {
|
|
146
424
|
const view = ctx2.get(core.editorViewCtx);
|
|
147
425
|
const { dispatch, state } = view;
|
|
@@ -152,7 +430,7 @@ function getGroups(filter, config, ctx) {
|
|
|
152
430
|
}
|
|
153
431
|
}).addItem("h2", {
|
|
154
432
|
label: (_h = config == null ? void 0 : config.slashMenuH2Label) != null ? _h : "Heading 2",
|
|
155
|
-
icon: (_j = (_i = config == null ? void 0 : config.slashMenuH2Icon) == null ? void 0 : _i.call(config)) != null ? _j :
|
|
433
|
+
icon: (_j = (_i = config == null ? void 0 : config.slashMenuH2Icon) == null ? void 0 : _i.call(config)) != null ? _j : h2Icon,
|
|
156
434
|
onRun: (ctx2) => {
|
|
157
435
|
const view = ctx2.get(core.editorViewCtx);
|
|
158
436
|
const { dispatch, state } = view;
|
|
@@ -163,7 +441,7 @@ function getGroups(filter, config, ctx) {
|
|
|
163
441
|
}
|
|
164
442
|
}).addItem("h3", {
|
|
165
443
|
label: (_k = config == null ? void 0 : config.slashMenuH3Label) != null ? _k : "Heading 3",
|
|
166
|
-
icon: (_m = (_l = config == null ? void 0 : config.slashMenuH3Icon) == null ? void 0 : _l.call(config)) != null ? _m :
|
|
444
|
+
icon: (_m = (_l = config == null ? void 0 : config.slashMenuH3Icon) == null ? void 0 : _l.call(config)) != null ? _m : h3Icon,
|
|
167
445
|
onRun: (ctx2) => {
|
|
168
446
|
const view = ctx2.get(core.editorViewCtx);
|
|
169
447
|
const { dispatch, state } = view;
|
|
@@ -174,7 +452,7 @@ function getGroups(filter, config, ctx) {
|
|
|
174
452
|
}
|
|
175
453
|
}).addItem("h4", {
|
|
176
454
|
label: (_n = config == null ? void 0 : config.slashMenuH4Label) != null ? _n : "Heading 4",
|
|
177
|
-
icon: (_p = (_o = config == null ? void 0 : config.slashMenuH4Icon) == null ? void 0 : _o.call(config)) != null ? _p :
|
|
455
|
+
icon: (_p = (_o = config == null ? void 0 : config.slashMenuH4Icon) == null ? void 0 : _o.call(config)) != null ? _p : h4Icon,
|
|
178
456
|
onRun: (ctx2) => {
|
|
179
457
|
const view = ctx2.get(core.editorViewCtx);
|
|
180
458
|
const { dispatch, state } = view;
|
|
@@ -185,7 +463,7 @@ function getGroups(filter, config, ctx) {
|
|
|
185
463
|
}
|
|
186
464
|
}).addItem("h5", {
|
|
187
465
|
label: (_q = config == null ? void 0 : config.slashMenuH5Label) != null ? _q : "Heading 5",
|
|
188
|
-
icon: (_s = (_r = config == null ? void 0 : config.slashMenuH5Icon) == null ? void 0 : _r.call(config)) != null ? _s :
|
|
466
|
+
icon: (_s = (_r = config == null ? void 0 : config.slashMenuH5Icon) == null ? void 0 : _r.call(config)) != null ? _s : h5Icon,
|
|
189
467
|
onRun: (ctx2) => {
|
|
190
468
|
const view = ctx2.get(core.editorViewCtx);
|
|
191
469
|
const { dispatch, state } = view;
|
|
@@ -196,7 +474,7 @@ function getGroups(filter, config, ctx) {
|
|
|
196
474
|
}
|
|
197
475
|
}).addItem("h6", {
|
|
198
476
|
label: (_t = config == null ? void 0 : config.slashMenuH6Label) != null ? _t : "Heading 6",
|
|
199
|
-
icon: (_v = (_u = config == null ? void 0 : config.slashMenuH6Icon) == null ? void 0 : _u.call(config)) != null ? _v :
|
|
477
|
+
icon: (_v = (_u = config == null ? void 0 : config.slashMenuH6Icon) == null ? void 0 : _u.call(config)) != null ? _v : h6Icon,
|
|
200
478
|
onRun: (ctx2) => {
|
|
201
479
|
const view = ctx2.get(core.editorViewCtx);
|
|
202
480
|
const { dispatch, state } = view;
|
|
@@ -207,7 +485,7 @@ function getGroups(filter, config, ctx) {
|
|
|
207
485
|
}
|
|
208
486
|
}).addItem("quote", {
|
|
209
487
|
label: (_w = config == null ? void 0 : config.slashMenuQuoteLabel) != null ? _w : "Quote",
|
|
210
|
-
icon: (_y = (_x = config == null ? void 0 : config.slashMenuQuoteIcon) == null ? void 0 : _x.call(config)) != null ? _y :
|
|
488
|
+
icon: (_y = (_x = config == null ? void 0 : config.slashMenuQuoteIcon) == null ? void 0 : _x.call(config)) != null ? _y : quoteIcon,
|
|
211
489
|
onRun: (ctx2) => {
|
|
212
490
|
const view = ctx2.get(core.editorViewCtx);
|
|
213
491
|
const { dispatch, state } = view;
|
|
@@ -218,7 +496,7 @@ function getGroups(filter, config, ctx) {
|
|
|
218
496
|
}
|
|
219
497
|
}).addItem("divider", {
|
|
220
498
|
label: (_z = config == null ? void 0 : config.slashMenuDividerLabel) != null ? _z : "Divider",
|
|
221
|
-
icon: (_B = (_A = config == null ? void 0 : config.slashMenuDividerIcon) == null ? void 0 : _A.call(config)) != null ? _B :
|
|
499
|
+
icon: (_B = (_A = config == null ? void 0 : config.slashMenuDividerIcon) == null ? void 0 : _A.call(config)) != null ? _B : dividerIcon,
|
|
222
500
|
onRun: (ctx2) => {
|
|
223
501
|
const view = ctx2.get(core.editorViewCtx);
|
|
224
502
|
const { dispatch, state } = view;
|
|
@@ -228,7 +506,7 @@ function getGroups(filter, config, ctx) {
|
|
|
228
506
|
});
|
|
229
507
|
groupBuilder.addGroup("list", (_C = config == null ? void 0 : config.slashMenuListGroupLabel) != null ? _C : "List").addItem("bullet-list", {
|
|
230
508
|
label: (_D = config == null ? void 0 : config.slashMenuBulletListLabel) != null ? _D : "Bullet List",
|
|
231
|
-
icon: (_F = (_E = config == null ? void 0 : config.slashMenuBulletListIcon) == null ? void 0 : _E.call(config)) != null ? _F :
|
|
509
|
+
icon: (_F = (_E = config == null ? void 0 : config.slashMenuBulletListIcon) == null ? void 0 : _E.call(config)) != null ? _F : bulletListIcon,
|
|
232
510
|
onRun: (ctx2) => {
|
|
233
511
|
const view = ctx2.get(core.editorViewCtx);
|
|
234
512
|
const { dispatch, state } = view;
|
|
@@ -239,7 +517,7 @@ function getGroups(filter, config, ctx) {
|
|
|
239
517
|
}
|
|
240
518
|
}).addItem("ordered-list", {
|
|
241
519
|
label: (_G = config == null ? void 0 : config.slashMenuOrderedListLabel) != null ? _G : "Ordered List",
|
|
242
|
-
icon: (_I = (_H = config == null ? void 0 : config.slashMenuOrderedListIcon) == null ? void 0 : _H.call(config)) != null ? _I :
|
|
520
|
+
icon: (_I = (_H = config == null ? void 0 : config.slashMenuOrderedListIcon) == null ? void 0 : _H.call(config)) != null ? _I : orderedListIcon,
|
|
243
521
|
onRun: (ctx2) => {
|
|
244
522
|
const view = ctx2.get(core.editorViewCtx);
|
|
245
523
|
const { dispatch, state } = view;
|
|
@@ -250,7 +528,7 @@ function getGroups(filter, config, ctx) {
|
|
|
250
528
|
}
|
|
251
529
|
}).addItem("todo-list", {
|
|
252
530
|
label: (_J = config == null ? void 0 : config.slashMenuTaskListLabel) != null ? _J : "Todo List",
|
|
253
|
-
icon: (_L = (_K = config == null ? void 0 : config.slashMenuTaskListIcon) == null ? void 0 : _K.call(config)) != null ? _L :
|
|
531
|
+
icon: (_L = (_K = config == null ? void 0 : config.slashMenuTaskListIcon) == null ? void 0 : _K.call(config)) != null ? _L : todoListIcon,
|
|
254
532
|
onRun: (ctx2) => {
|
|
255
533
|
const view = ctx2.get(core.editorViewCtx);
|
|
256
534
|
const { dispatch, state } = view;
|
|
@@ -268,7 +546,7 @@ function getGroups(filter, config, ctx) {
|
|
|
268
546
|
if (isImageBlockEnabled) {
|
|
269
547
|
advancedGroup.addItem("image", {
|
|
270
548
|
label: (_N = config == null ? void 0 : config.slashMenuImageLabel) != null ? _N : "Image",
|
|
271
|
-
icon: (_P = (_O = config == null ? void 0 : config.slashMenuImageIcon) == null ? void 0 : _O.call(config)) != null ? _P :
|
|
549
|
+
icon: (_P = (_O = config == null ? void 0 : config.slashMenuImageIcon) == null ? void 0 : _O.call(config)) != null ? _P : image.imageIcon,
|
|
272
550
|
onRun: (ctx2) => {
|
|
273
551
|
const view = ctx2.get(core.editorViewCtx);
|
|
274
552
|
const { dispatch, state } = view;
|
|
@@ -290,7 +568,7 @@ function getGroups(filter, config, ctx) {
|
|
|
290
568
|
if (isTableEnabled) {
|
|
291
569
|
advancedGroup.addItem("table", {
|
|
292
570
|
label: (_T = config == null ? void 0 : config.slashMenuTableLabel) != null ? _T : "Table",
|
|
293
|
-
icon: (_V = (_U = config == null ? void 0 : config.slashMenuTableIcon) == null ? void 0 : _U.call(config)) != null ? _V :
|
|
571
|
+
icon: (_V = (_U = config == null ? void 0 : config.slashMenuTableIcon) == null ? void 0 : _U.call(config)) != null ? _V : tableIcon,
|
|
294
572
|
onRun: (ctx2) => {
|
|
295
573
|
const view = ctx2.get(core.editorViewCtx);
|
|
296
574
|
const { dispatch, state: state$1 } = view;
|
|
@@ -357,60 +635,65 @@ function getGroups(filter, config, ctx) {
|
|
|
357
635
|
};
|
|
358
636
|
}
|
|
359
637
|
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
config
|
|
366
|
-
}) => {
|
|
367
|
-
const { groups, size } = atomico.useMemo(
|
|
368
|
-
() => getGroups(filter, config, ctx),
|
|
369
|
-
[filter]
|
|
370
|
-
);
|
|
371
|
-
const host = atomico.useHost();
|
|
372
|
-
const [hoverIndex, setHoverIndex] = atomico.useState(0);
|
|
373
|
-
const root = atomico.useMemo(() => host.current.getRootNode(), [host]);
|
|
374
|
-
const prevMousePosition = atomico.useRef({ x: -999, y: -999 });
|
|
375
|
-
const onMouseMove = atomico.useCallback((e) => {
|
|
376
|
-
const prevPos = prevMousePosition.current;
|
|
377
|
-
if (!prevPos) return;
|
|
378
|
-
const { x, y } = e;
|
|
379
|
-
prevPos.x = x;
|
|
380
|
-
prevPos.y = y;
|
|
381
|
-
}, []);
|
|
382
|
-
atomico.useEffect(() => {
|
|
383
|
-
if (size === 0 && show) hide == null ? void 0 : hide();
|
|
384
|
-
else if (hoverIndex >= size) setHoverIndex(0);
|
|
385
|
-
}, [size, show]);
|
|
386
|
-
const onHover = atomico.useCallback(
|
|
387
|
-
(index, after) => {
|
|
388
|
-
setHoverIndex((prev) => {
|
|
389
|
-
const next = typeof index === "function" ? index(prev) : index;
|
|
390
|
-
after == null ? void 0 : after(next);
|
|
391
|
-
return next;
|
|
392
|
-
});
|
|
638
|
+
const Menu = vue.defineComponent({
|
|
639
|
+
props: {
|
|
640
|
+
ctx: {
|
|
641
|
+
type: Object,
|
|
642
|
+
required: true
|
|
393
643
|
},
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
const target = host.current.querySelector(
|
|
398
|
-
`[data-index="${index}"]`
|
|
399
|
-
);
|
|
400
|
-
const scrollRoot = host.current.querySelector(".menu-groups");
|
|
401
|
-
if (!target || !scrollRoot) return;
|
|
402
|
-
scrollRoot.scrollTop = target.offsetTop - scrollRoot.offsetTop;
|
|
403
|
-
}, []);
|
|
404
|
-
const runByIndex = atomico.useCallback(
|
|
405
|
-
(index) => {
|
|
406
|
-
const item = groups.flatMap((group) => group.items).at(index);
|
|
407
|
-
if (item && ctx) item.onRun(ctx);
|
|
408
|
-
hide == null ? void 0 : hide();
|
|
644
|
+
show: {
|
|
645
|
+
type: Object,
|
|
646
|
+
required: true
|
|
409
647
|
},
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
648
|
+
filter: {
|
|
649
|
+
type: Object,
|
|
650
|
+
required: true
|
|
651
|
+
},
|
|
652
|
+
hide: {
|
|
653
|
+
type: Function,
|
|
654
|
+
required: true
|
|
655
|
+
},
|
|
656
|
+
config: {
|
|
657
|
+
type: Object,
|
|
658
|
+
required: false
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
setup({ ctx, show, filter, hide, config }) {
|
|
662
|
+
const host = vue.ref();
|
|
663
|
+
const groupInfo = vue.computed(() => getGroups(filter.value, config, ctx));
|
|
664
|
+
const hoverIndex = vue.ref(0);
|
|
665
|
+
const prevMousePosition = vue.ref({ x: -999, y: -999 });
|
|
666
|
+
const onPointerMove = (e) => {
|
|
667
|
+
const { x, y } = e;
|
|
668
|
+
prevMousePosition.value = { x, y };
|
|
669
|
+
};
|
|
670
|
+
vue.watch([groupInfo, show], () => {
|
|
671
|
+
const { size } = groupInfo.value;
|
|
672
|
+
if (size === 0 && show.value) hide();
|
|
673
|
+
else if (hoverIndex.value >= size) hoverIndex.value = 0;
|
|
674
|
+
});
|
|
675
|
+
const onHover = (index, after) => {
|
|
676
|
+
const prevHoverIndex = hoverIndex.value;
|
|
677
|
+
const next = typeof index === "function" ? index(prevHoverIndex) : index;
|
|
678
|
+
after == null ? void 0 : after(next);
|
|
679
|
+
hoverIndex.value = next;
|
|
680
|
+
};
|
|
681
|
+
const scrollToIndex = (index) => {
|
|
682
|
+
var _a, _b;
|
|
683
|
+
const target = (_a = host.value) == null ? void 0 : _a.querySelector(
|
|
684
|
+
`[data-index="${index}"]`
|
|
685
|
+
);
|
|
686
|
+
const scrollRoot = (_b = host.value) == null ? void 0 : _b.querySelector(".menu-groups");
|
|
687
|
+
if (!target || !scrollRoot) return;
|
|
688
|
+
scrollRoot.scrollTop = target.offsetTop - scrollRoot.offsetTop;
|
|
689
|
+
};
|
|
690
|
+
const runByIndex = (index) => {
|
|
691
|
+
const item = groupInfo.value.groups.flatMap((group) => group.items).at(index);
|
|
692
|
+
if (item && ctx) item.onRun(ctx);
|
|
693
|
+
hide();
|
|
694
|
+
};
|
|
695
|
+
const onKeydown = (e) => {
|
|
696
|
+
const { size, groups } = groupInfo.value;
|
|
414
697
|
if (e.key === "Escape") {
|
|
415
698
|
e.preventDefault();
|
|
416
699
|
hide == null ? void 0 : hide();
|
|
@@ -456,84 +739,59 @@ const menuComponent = ({
|
|
|
456
739
|
}
|
|
457
740
|
if (e.key === "Enter") {
|
|
458
741
|
e.preventDefault();
|
|
459
|
-
runByIndex(hoverIndex);
|
|
742
|
+
runByIndex(hoverIndex.value);
|
|
460
743
|
}
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
const onMouseEnter = atomico.useCallback((index) => {
|
|
465
|
-
return (e) => {
|
|
466
|
-
const prevPos = prevMousePosition.current;
|
|
744
|
+
};
|
|
745
|
+
const getOnPointerEnter = (index) => (e) => {
|
|
746
|
+
const prevPos = prevMousePosition.value;
|
|
467
747
|
if (!prevPos) return;
|
|
468
748
|
const { x, y } = e;
|
|
469
749
|
if (x === prevPos.x && y === prevPos.y) return;
|
|
470
750
|
onHover(index);
|
|
471
751
|
};
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
752
|
+
vue.watchEffect(() => {
|
|
753
|
+
const isShown = show.value;
|
|
754
|
+
if (isShown) {
|
|
755
|
+
window.addEventListener("keydown", onKeydown, { capture: true });
|
|
756
|
+
} else {
|
|
757
|
+
window.removeEventListener("keydown", onKeydown, { capture: true });
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
vue.onUnmounted(() => {
|
|
761
|
+
window.removeEventListener("keydown", onKeydown, { capture: true });
|
|
762
|
+
});
|
|
476
763
|
return () => {
|
|
477
|
-
|
|
764
|
+
return /* @__PURE__ */ vue.h("div", { ref: host, onPointerdown: (e) => e.preventDefault() }, /* @__PURE__ */ vue.h("nav", { class: "tab-group" }, /* @__PURE__ */ vue.h("ul", null, groupInfo.value.groups.map((group) => /* @__PURE__ */ vue.h(
|
|
765
|
+
"li",
|
|
766
|
+
{
|
|
767
|
+
key: group.key,
|
|
768
|
+
onPointerdown: () => onHover(group.range[0], scrollToIndex),
|
|
769
|
+
class: hoverIndex.value >= group.range[0] && hoverIndex.value < group.range[1] ? "selected" : ""
|
|
770
|
+
},
|
|
771
|
+
group.label
|
|
772
|
+
)))), /* @__PURE__ */ vue.h("div", { class: "menu-groups", onPointermove: onPointerMove }, groupInfo.value.groups.map((group) => /* @__PURE__ */ vue.h("div", { key: group.key, class: "menu-group" }, /* @__PURE__ */ vue.h("h6", null, group.label), /* @__PURE__ */ vue.h("ul", null, group.items.map((item) => /* @__PURE__ */ vue.h(
|
|
773
|
+
"li",
|
|
774
|
+
{
|
|
775
|
+
key: item.key,
|
|
776
|
+
"data-index": item.index,
|
|
777
|
+
class: hoverIndex.value === item.index ? "hover" : "",
|
|
778
|
+
onPointerenter: getOnPointerEnter(item.index),
|
|
779
|
+
onPointerdown: () => {
|
|
780
|
+
var _a, _b;
|
|
781
|
+
(_b = (_a = host.value) == null ? void 0 : _a.querySelector(`[data-index="${item.index}"]`)) == null ? void 0 : _b.classList.add("active");
|
|
782
|
+
},
|
|
783
|
+
onPointerup: () => {
|
|
784
|
+
var _a, _b;
|
|
785
|
+
(_b = (_a = host.value) == null ? void 0 : _a.querySelector(`[data-index="${item.index}"]`)) == null ? void 0 : _b.classList.remove("active");
|
|
786
|
+
runByIndex(item.index);
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
/* @__PURE__ */ vue.h(component.Icon, { icon: item.icon }),
|
|
790
|
+
/* @__PURE__ */ vue.h("span", null, item.label)
|
|
791
|
+
)))))));
|
|
478
792
|
};
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
<host onmousedown=${(e) => e.preventDefault()}>
|
|
482
|
-
<nav class="tab-group">
|
|
483
|
-
<ul>
|
|
484
|
-
${groups.map(
|
|
485
|
-
(group) => atomico.html`<li
|
|
486
|
-
key=${group.key}
|
|
487
|
-
onmousedown=${() => onHover(group.range[0], scrollToIndex)}
|
|
488
|
-
class=${hoverIndex >= group.range[0] && hoverIndex < group.range[1] ? "selected" : ""}
|
|
489
|
-
>
|
|
490
|
-
${group.label}
|
|
491
|
-
</li>`
|
|
492
|
-
)}
|
|
493
|
-
</ul>
|
|
494
|
-
</nav>
|
|
495
|
-
<div class="menu-groups" onmousemove=${onMouseMove}>
|
|
496
|
-
${groups.map((group) => {
|
|
497
|
-
return atomico.html`
|
|
498
|
-
<div key=${group.key} class="menu-group">
|
|
499
|
-
<h6>${group.label}</h6>
|
|
500
|
-
<ul>
|
|
501
|
-
${group.items.map(
|
|
502
|
-
(item) => atomico.html`<li
|
|
503
|
-
key=${item.key}
|
|
504
|
-
data-index=${item.index}
|
|
505
|
-
class=${hoverIndex === item.index ? "hover" : ""}
|
|
506
|
-
onmouseenter=${onMouseEnter(item.index)}
|
|
507
|
-
onmousedown=${() => {
|
|
508
|
-
var _a;
|
|
509
|
-
(_a = host.current.querySelector(`[data-index="${item.index}"]`)) == null ? void 0 : _a.classList.add("active");
|
|
510
|
-
}}
|
|
511
|
-
onmouseup=${() => {
|
|
512
|
-
var _a;
|
|
513
|
-
(_a = host.current.querySelector(`[data-index="${item.index}"]`)) == null ? void 0 : _a.classList.remove("active");
|
|
514
|
-
runByIndex(item.index);
|
|
515
|
-
}}
|
|
516
|
-
>
|
|
517
|
-
${item.icon}
|
|
518
|
-
<span>${item.label}</span>
|
|
519
|
-
</li>`
|
|
520
|
-
)}
|
|
521
|
-
</ul>
|
|
522
|
-
</div>
|
|
523
|
-
`;
|
|
524
|
-
})}
|
|
525
|
-
</div>
|
|
526
|
-
</host>
|
|
527
|
-
`;
|
|
528
|
-
};
|
|
529
|
-
menuComponent.props = {
|
|
530
|
-
ctx: Object,
|
|
531
|
-
config: Object,
|
|
532
|
-
show: Boolean,
|
|
533
|
-
filter: String,
|
|
534
|
-
hide: Function
|
|
535
|
-
};
|
|
536
|
-
const MenuElement = atomico.c(menuComponent);
|
|
793
|
+
}
|
|
794
|
+
});
|
|
537
795
|
|
|
538
796
|
var __typeError$1 = (msg) => {
|
|
539
797
|
throw TypeError(msg);
|
|
@@ -542,7 +800,7 @@ var __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1("Ca
|
|
|
542
800
|
var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
543
801
|
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
544
802
|
var __privateSet$1 = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
545
|
-
var _content$1, _slashProvider, _programmaticallyPos;
|
|
803
|
+
var _content$1, _app$1, _filter, _slashProvider, _programmaticallyPos;
|
|
546
804
|
const menu = slash.slashFactory("CREPE_MENU");
|
|
547
805
|
const menuAPI = utils.$ctx(
|
|
548
806
|
{
|
|
@@ -553,7 +811,6 @@ const menuAPI = utils.$ctx(
|
|
|
553
811
|
},
|
|
554
812
|
"menuAPICtx"
|
|
555
813
|
);
|
|
556
|
-
index$1.defIfNotExists("milkdown-slash-menu", MenuElement);
|
|
557
814
|
function configureMenu(ctx, config) {
|
|
558
815
|
ctx.set(menu.key, {
|
|
559
816
|
view: (view) => new MenuView(ctx, view, config)
|
|
@@ -562,6 +819,8 @@ function configureMenu(ctx, config) {
|
|
|
562
819
|
class MenuView {
|
|
563
820
|
constructor(ctx, view, config) {
|
|
564
821
|
__privateAdd$1(this, _content$1);
|
|
822
|
+
__privateAdd$1(this, _app$1);
|
|
823
|
+
__privateAdd$1(this, _filter);
|
|
565
824
|
__privateAdd$1(this, _slashProvider);
|
|
566
825
|
__privateAdd$1(this, _programmaticallyPos, null);
|
|
567
826
|
this.update = (view) => {
|
|
@@ -569,7 +828,7 @@ class MenuView {
|
|
|
569
828
|
};
|
|
570
829
|
this.show = (pos) => {
|
|
571
830
|
__privateSet$1(this, _programmaticallyPos, pos);
|
|
572
|
-
__privateGet$1(this,
|
|
831
|
+
__privateGet$1(this, _filter).value = "";
|
|
573
832
|
__privateGet$1(this, _slashProvider).show();
|
|
574
833
|
};
|
|
575
834
|
this.hide = () => {
|
|
@@ -578,12 +837,25 @@ class MenuView {
|
|
|
578
837
|
};
|
|
579
838
|
this.destroy = () => {
|
|
580
839
|
__privateGet$1(this, _slashProvider).destroy();
|
|
840
|
+
__privateGet$1(this, _app$1).unmount();
|
|
581
841
|
__privateGet$1(this, _content$1).remove();
|
|
582
842
|
};
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
843
|
+
const content = document.createElement("div");
|
|
844
|
+
content.classList.add("milkdown-slash-menu");
|
|
845
|
+
const show = vue.ref(false);
|
|
846
|
+
const filter = vue.ref("");
|
|
847
|
+
__privateSet$1(this, _filter, filter);
|
|
848
|
+
const hide = this.hide;
|
|
849
|
+
const app = vue.createApp(Menu, {
|
|
850
|
+
ctx,
|
|
851
|
+
config,
|
|
852
|
+
show,
|
|
853
|
+
filter,
|
|
854
|
+
hide
|
|
855
|
+
});
|
|
856
|
+
__privateSet$1(this, _app$1, app);
|
|
857
|
+
app.mount(content);
|
|
858
|
+
__privateSet$1(this, _content$1, content);
|
|
587
859
|
const self = this;
|
|
588
860
|
__privateSet$1(this, _slashProvider, new slash.SlashProvider({
|
|
589
861
|
content: __privateGet$1(this, _content$1),
|
|
@@ -600,7 +872,7 @@ class MenuView {
|
|
|
600
872
|
return false;
|
|
601
873
|
}
|
|
602
874
|
const pos = __privateGet$1(self, _programmaticallyPos);
|
|
603
|
-
|
|
875
|
+
filter.value = currentText.startsWith("/") ? currentText.slice(1) : currentText;
|
|
604
876
|
if (typeof pos === "number") {
|
|
605
877
|
if (view2.state.doc.resolve(pos).node() !== view2.state.doc.resolve(view2.state.selection.from).node()) {
|
|
606
878
|
__privateSet$1(self, _programmaticallyPos, null);
|
|
@@ -614,10 +886,10 @@ class MenuView {
|
|
|
614
886
|
offset: 10
|
|
615
887
|
}));
|
|
616
888
|
__privateGet$1(this, _slashProvider).onShow = () => {
|
|
617
|
-
|
|
889
|
+
show.value = true;
|
|
618
890
|
};
|
|
619
891
|
__privateGet$1(this, _slashProvider).onHide = () => {
|
|
620
|
-
|
|
892
|
+
show.value = false;
|
|
621
893
|
};
|
|
622
894
|
this.update(view);
|
|
623
895
|
ctx.set(menuAPI.key, {
|
|
@@ -627,6 +899,8 @@ class MenuView {
|
|
|
627
899
|
}
|
|
628
900
|
}
|
|
629
901
|
_content$1 = new WeakMap();
|
|
902
|
+
_app$1 = new WeakMap();
|
|
903
|
+
_filter = new WeakMap();
|
|
630
904
|
_slashProvider = new WeakMap();
|
|
631
905
|
_programmaticallyPos = new WeakMap();
|
|
632
906
|
function isSelectionAtEndOfNode(selection) {
|
|
@@ -637,50 +911,48 @@ function isSelectionAtEndOfNode(selection) {
|
|
|
637
911
|
return offset === parent.content.size;
|
|
638
912
|
}
|
|
639
913
|
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
};
|
|
683
|
-
const BlockHandleElement = atomico.c(blockHandleComponent);
|
|
914
|
+
const BlockHandle = vue.defineComponent({
|
|
915
|
+
props: {
|
|
916
|
+
onAdd: {
|
|
917
|
+
type: Function,
|
|
918
|
+
required: true
|
|
919
|
+
},
|
|
920
|
+
addIcon: {
|
|
921
|
+
type: Function,
|
|
922
|
+
required: true
|
|
923
|
+
},
|
|
924
|
+
handleIcon: {
|
|
925
|
+
type: Function,
|
|
926
|
+
required: true
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
setup(props) {
|
|
930
|
+
const addButton = vue.ref();
|
|
931
|
+
return () => {
|
|
932
|
+
return /* @__PURE__ */ vue.h(vue.Fragment, null, /* @__PURE__ */ vue.h(
|
|
933
|
+
"div",
|
|
934
|
+
{
|
|
935
|
+
ref: addButton,
|
|
936
|
+
class: "operation-item",
|
|
937
|
+
onPointerdown: (e) => {
|
|
938
|
+
var _a;
|
|
939
|
+
e.preventDefault();
|
|
940
|
+
e.stopPropagation();
|
|
941
|
+
(_a = addButton.value) == null ? void 0 : _a.classList.add("active");
|
|
942
|
+
},
|
|
943
|
+
onPointerup: (e) => {
|
|
944
|
+
var _a;
|
|
945
|
+
e.preventDefault();
|
|
946
|
+
e.stopPropagation();
|
|
947
|
+
(_a = addButton.value) == null ? void 0 : _a.classList.remove("active");
|
|
948
|
+
props.onAdd();
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
/* @__PURE__ */ vue.h(component.Icon, { icon: props.addIcon() })
|
|
952
|
+
), /* @__PURE__ */ vue.h("div", { class: "operation-item" }, /* @__PURE__ */ vue.h(component.Icon, { icon: props.handleIcon() })));
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
});
|
|
684
956
|
|
|
685
957
|
var __typeError = (msg) => {
|
|
686
958
|
throw TypeError(msg);
|
|
@@ -689,11 +961,12 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
689
961
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
690
962
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
691
963
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
692
|
-
var _content, _provider, _ctx;
|
|
964
|
+
var _content, _provider, _app, _ctx;
|
|
693
965
|
class BlockHandleView {
|
|
694
966
|
constructor(ctx, config) {
|
|
695
967
|
__privateAdd(this, _content);
|
|
696
968
|
__privateAdd(this, _provider);
|
|
969
|
+
__privateAdd(this, _app);
|
|
697
970
|
__privateAdd(this, _ctx);
|
|
698
971
|
this.update = () => {
|
|
699
972
|
__privateGet(this, _provider).update();
|
|
@@ -701,6 +974,7 @@ class BlockHandleView {
|
|
|
701
974
|
this.destroy = () => {
|
|
702
975
|
__privateGet(this, _provider).destroy();
|
|
703
976
|
__privateGet(this, _content).remove();
|
|
977
|
+
__privateGet(this, _app).unmount();
|
|
704
978
|
};
|
|
705
979
|
this.onAdd = () => {
|
|
706
980
|
const ctx = __privateGet(this, _ctx);
|
|
@@ -717,12 +991,18 @@ class BlockHandleView {
|
|
|
717
991
|
__privateGet(this, _provider).hide();
|
|
718
992
|
ctx.get(menuAPI.key).show(tr.selection.from);
|
|
719
993
|
};
|
|
994
|
+
var _a, _b;
|
|
720
995
|
__privateSet(this, _ctx, ctx);
|
|
721
|
-
const content =
|
|
996
|
+
const content = document.createElement("div");
|
|
997
|
+
content.classList.add("milkdown-block-handle");
|
|
998
|
+
const app = vue.createApp(BlockHandle, {
|
|
999
|
+
onAdd: this.onAdd,
|
|
1000
|
+
addIcon: (_a = config == null ? void 0 : config.handleAddIcon) != null ? _a : () => plus.plusIcon,
|
|
1001
|
+
handleIcon: (_b = config == null ? void 0 : config.handleDragIcon) != null ? _b : () => menuIcon
|
|
1002
|
+
});
|
|
1003
|
+
app.mount(content);
|
|
1004
|
+
__privateSet(this, _app, app);
|
|
722
1005
|
__privateSet(this, _content, content);
|
|
723
|
-
__privateGet(this, _content).onAdd = this.onAdd;
|
|
724
|
-
__privateGet(this, _content).addIcon = config == null ? void 0 : config.handleAddIcon;
|
|
725
|
-
__privateGet(this, _content).handleIcon = config == null ? void 0 : config.handleDragIcon;
|
|
726
1006
|
__privateSet(this, _provider, new block.BlockProvider({
|
|
727
1007
|
ctx,
|
|
728
1008
|
content,
|
|
@@ -749,8 +1029,8 @@ class BlockHandleView {
|
|
|
749
1029
|
}
|
|
750
1030
|
_content = new WeakMap();
|
|
751
1031
|
_provider = new WeakMap();
|
|
1032
|
+
_app = new WeakMap();
|
|
752
1033
|
_ctx = new WeakMap();
|
|
753
|
-
index$1.defIfNotExists("milkdown-block-handle", BlockHandleElement);
|
|
754
1034
|
function configureBlockHandle(ctx, config) {
|
|
755
1035
|
ctx.set(block.blockConfig.key, {
|
|
756
1036
|
filterNodes: (pos) => {
|
|
@@ -771,4 +1051,4 @@ const defineFeature = (editor, config) => {
|
|
|
771
1051
|
};
|
|
772
1052
|
|
|
773
1053
|
exports.defineFeature = defineFeature;
|
|
774
|
-
//# sourceMappingURL=index-
|
|
1054
|
+
//# sourceMappingURL=index-B7gqgc1H.js.map
|