@milkdown/crepe 7.5.7 → 7.5.9
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/{index-HAz9lsCD.js → index-3mj4YaCA.js} +3 -6
- package/lib/cjs/index-3mj4YaCA.js.map +1 -0
- package/lib/cjs/{index-wORIFtqa.js → index-A8IrOmzS.js} +33 -12
- package/lib/cjs/index-A8IrOmzS.js.map +1 -0
- package/lib/cjs/{index-z6pe2alg.js → index-AlHHvSR_.js} +1 -1
- package/lib/cjs/index-AlHHvSR_.js.map +1 -0
- package/lib/cjs/{index-YoPS8A3_.js → index-BIXWL4Or.js} +2 -2
- package/lib/cjs/index-BIXWL4Or.js.map +1 -0
- package/lib/cjs/{index-uleaJDBC.js → index-BuSAwj4j.js} +1 -1
- package/lib/cjs/index-BuSAwj4j.js.map +1 -0
- package/lib/cjs/{index-vNNxr8yy.js → index-By3ewOiO.js} +173 -139
- package/lib/cjs/index-By3ewOiO.js.map +1 -0
- package/lib/cjs/{index-MLK151KV.js → index-CtNE-wHT.js} +6 -4
- package/lib/cjs/index-CtNE-wHT.js.map +1 -0
- package/lib/cjs/{index-KeJUBENN.js → index-DmOOfQPi.js} +2 -2
- package/lib/cjs/index-DmOOfQPi.js.map +1 -0
- package/lib/cjs/index-Dt55rF23.js +35 -0
- package/lib/cjs/index-Dt55rF23.js.map +1 -0
- package/lib/cjs/{index-rFFAL9YA.js → index-Dub20F3z.js} +15 -17
- package/lib/cjs/index-Dub20F3z.js.map +1 -0
- package/lib/cjs/index.js +11 -13
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/todoList-V4JWO5-M.js +675 -0
- package/lib/cjs/todoList-V4JWO5-M.js.map +1 -0
- package/lib/esm/{index-HHuxH8Dm.js → index-6VoEpEnX.js} +2 -2
- package/lib/esm/index-6VoEpEnX.js.map +1 -0
- package/lib/esm/{index-I5dm1KsK.js → index-BB3Rq6BU.js} +3 -6
- package/lib/esm/index-BB3Rq6BU.js.map +1 -0
- package/lib/esm/{index-uThMsyF6.js → index-BDGHz9p-.js} +2 -2
- package/lib/esm/index-BDGHz9p-.js.map +1 -0
- package/lib/esm/{index-X2mjLDJS.js → index-BEWessT5.js} +6 -4
- package/lib/esm/index-BEWessT5.js.map +1 -0
- package/lib/esm/{index-6JoGWH2I.js → index-CxJ9fxJm.js} +1 -1
- package/lib/esm/index-CxJ9fxJm.js.map +1 -0
- package/lib/esm/{index-Jvxff1vU.js → index-D6fLMv29.js} +1 -1
- package/lib/esm/index-D6fLMv29.js.map +1 -0
- package/lib/esm/{index-CMGDOz11.js → index-DOrkOhki.js} +15 -17
- package/lib/esm/index-DOrkOhki.js.map +1 -0
- package/lib/esm/index-DlX33Dj0.js +33 -0
- package/lib/esm/index-DlX33Dj0.js.map +1 -0
- package/lib/esm/{index-eZXAY3yz.js → index-kGl7HgN2.js} +33 -12
- package/lib/esm/index-kGl7HgN2.js.map +1 -0
- package/lib/esm/{index-sE0tYrbc.js → index-zKiGjwHz.js} +173 -139
- package/lib/esm/index-zKiGjwHz.js.map +1 -0
- package/lib/esm/index.js +11 -13
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/todoList-CAbx4396.js +638 -0
- package/lib/esm/todoList-CAbx4396.js.map +1 -0
- package/lib/theme/_internal/classic-common.css +44 -19
- package/lib/theme/common/block-edit.css +12 -3
- package/lib/theme/common/code-mirror.css +1 -1
- package/lib/theme/common/cursor.css +7 -3
- package/lib/theme/common/image-block.css +28 -7
- package/lib/theme/common/link-tooltip.css +1 -0
- package/lib/theme/common/placeholder.css +5 -1
- package/lib/theme/common/prosemirror.css +1 -1
- package/lib/theme/common/style.css +10 -10
- package/lib/theme/common/table.css +17 -15
- package/lib/theme/common/toolbar.css +7 -3
- package/lib/theme/crepe/style.css +22 -20
- package/lib/theme/crepe-dark/style.css +25 -23
- package/lib/theme/frame/style.css +23 -20
- package/lib/theme/frame-dark/style.css +23 -20
- package/lib/theme/nord/style.css +25 -22
- package/lib/theme/nord-dark/style.css +23 -20
- package/lib/types/core/crepe.d.ts.map +1 -1
- package/lib/types/core/slice.d.ts +1 -1
- package/lib/types/core/slice.d.ts.map +1 -1
- package/lib/types/feature/block-edit/handle/component.d.ts +3 -3
- package/lib/types/feature/block-edit/handle/component.d.ts.map +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 +1 -1
- package/lib/types/feature/block-edit/menu/component.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/config.d.ts +2 -7
- package/lib/types/feature/block-edit/menu/config.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/group-builder.d.ts +4 -4
- package/lib/types/feature/block-edit/menu/group-builder.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/index.d.ts +2 -2
- package/lib/types/feature/block-edit/menu/index.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/utils.d.ts.map +1 -1
- 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 +1 -0
- package/lib/types/feature/image-block/index.d.ts.map +1 -1
- package/lib/types/feature/index.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 +2 -2
- package/lib/types/feature/placeholder/index.d.ts.map +1 -1
- 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 +1 -1
- 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/alignCenter.d.ts.map +1 -1
- package/lib/types/icons/alignLeft.d.ts.map +1 -1
- package/lib/types/icons/alignRight.d.ts.map +1 -1
- package/lib/types/icons/bold.d.ts.map +1 -1
- package/lib/types/icons/bullet.d.ts.map +1 -1
- package/lib/types/icons/bulletList.d.ts.map +1 -1
- package/lib/types/icons/caption.d.ts.map +1 -1
- package/lib/types/icons/checkBoxChecked.d.ts.map +1 -1
- package/lib/types/icons/checkBoxUnchecked.d.ts.map +1 -1
- package/lib/types/icons/chevronDown.d.ts.map +1 -1
- package/lib/types/icons/clear.d.ts.map +1 -1
- package/lib/types/icons/code.d.ts.map +1 -1
- package/lib/types/icons/confirm.d.ts.map +1 -1
- package/lib/types/icons/divider.d.ts.map +1 -1
- package/lib/types/icons/dragHandle.d.ts.map +1 -1
- package/lib/types/icons/edit.d.ts.map +1 -1
- package/lib/types/icons/h1.d.ts.map +1 -1
- package/lib/types/icons/h2.d.ts.map +1 -1
- package/lib/types/icons/h3.d.ts.map +1 -1
- package/lib/types/icons/h4.d.ts.map +1 -1
- package/lib/types/icons/h5.d.ts.map +1 -1
- package/lib/types/icons/h6.d.ts.map +1 -1
- package/lib/types/icons/image.d.ts.map +1 -1
- package/lib/types/icons/italic.d.ts.map +1 -1
- package/lib/types/icons/link.d.ts.map +1 -1
- package/lib/types/icons/menu.d.ts.map +1 -1
- package/lib/types/icons/orderedList.d.ts.map +1 -1
- package/lib/types/icons/plus.d.ts.map +1 -1
- package/lib/types/icons/quote.d.ts.map +1 -1
- package/lib/types/icons/remove.d.ts.map +1 -1
- package/lib/types/icons/search.d.ts.map +1 -1
- package/lib/types/icons/strikethrough.d.ts.map +1 -1
- package/lib/types/icons/table.d.ts.map +1 -1
- package/lib/types/icons/text.d.ts.map +1 -1
- package/lib/types/icons/todoList.d.ts.map +1 -1
- package/lib/types/utils/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/core/crepe.ts +18 -12
- package/src/feature/block-edit/handle/component.ts +9 -6
- package/src/feature/block-edit/handle/index.ts +14 -11
- package/src/feature/block-edit/index.ts +6 -3
- package/src/feature/block-edit/menu/component.ts +138 -117
- package/src/feature/block-edit/menu/config.ts +42 -23
- package/src/feature/block-edit/menu/group-builder.ts +2 -3
- package/src/feature/block-edit/menu/index.ts +25 -15
- package/src/feature/block-edit/menu/utils.ts +45 -25
- package/src/feature/code-mirror/index.ts +18 -10
- package/src/feature/cursor/index.ts +4 -1
- package/src/feature/image-block/index.ts +23 -8
- package/src/feature/index.ts +5 -1
- package/src/feature/link-tooltip/index.ts +10 -3
- package/src/feature/list-item/index.ts +25 -8
- package/src/feature/placeholder/index.ts +19 -18
- package/src/feature/shared.ts +4 -1
- package/src/feature/table/index.ts +37 -29
- package/src/feature/toolbar/component.ts +40 -10
- package/src/feature/toolbar/index.ts +15 -9
- package/src/icons/alignCenter.ts +9 -2
- package/src/icons/alignLeft.ts +9 -2
- package/src/icons/alignRight.ts +9 -2
- package/src/icons/bold.ts +9 -2
- package/src/icons/bullet.ts +8 -3
- package/src/icons/bulletList.ts +10 -3
- package/src/icons/caption.ts +10 -2
- package/src/icons/checkBoxChecked.ts +10 -3
- package/src/icons/checkBoxUnchecked.ts +10 -3
- package/src/icons/chevronDown.ts +13 -2
- package/src/icons/clear.ts +10 -3
- package/src/icons/code.ts +10 -3
- package/src/icons/confirm.ts +11 -2
- package/src/icons/divider.ts +12 -3
- package/src/icons/dragHandle.ts +9 -2
- package/src/icons/edit.ts +10 -3
- package/src/icons/h1.ts +10 -3
- package/src/icons/h2.ts +10 -3
- package/src/icons/h3.ts +10 -3
- package/src/icons/h4.ts +10 -3
- package/src/icons/h5.ts +10 -3
- package/src/icons/h6.ts +10 -3
- package/src/icons/image.ts +10 -3
- package/src/icons/italic.ts +9 -2
- package/src/icons/link.ts +9 -2
- package/src/icons/menu.ts +10 -3
- package/src/icons/orderedList.ts +10 -3
- package/src/icons/plus.ts +10 -3
- package/src/icons/quote.ts +10 -3
- package/src/icons/remove.ts +9 -2
- package/src/icons/search.ts +13 -2
- package/src/icons/strikethrough.ts +9 -2
- package/src/icons/table.ts +10 -3
- package/src/icons/text.ts +10 -3
- package/src/icons/todoList.ts +9 -2
- package/src/theme/_internal/classic-common.css +39 -14
- package/src/theme/common/block-edit.css +12 -3
- package/src/theme/common/code-mirror.css +1 -1
- package/src/theme/common/cursor.css +7 -3
- package/src/theme/common/image-block.css +28 -7
- package/src/theme/common/link-tooltip.css +1 -0
- package/src/theme/common/placeholder.css +5 -1
- package/src/theme/common/prosemirror.css +1 -1
- package/src/theme/common/style.css +10 -10
- package/src/theme/common/table.css +17 -14
- package/src/theme/common/toolbar.css +7 -3
- package/src/theme/crepe/style.css +22 -20
- package/src/theme/crepe-dark/style.css +25 -23
- package/src/theme/frame/style.css +23 -20
- package/src/theme/frame-dark/style.css +23 -20
- package/src/theme/nord/style.css +25 -22
- package/src/theme/nord-dark/style.css +23 -20
- package/src/utils/index.ts +4 -1
- package/lib/cjs/index-9Lsv_-NW.js +0 -28
- package/lib/cjs/index-9Lsv_-NW.js.map +0 -1
- package/lib/cjs/index-HAz9lsCD.js.map +0 -1
- package/lib/cjs/index-KeJUBENN.js.map +0 -1
- package/lib/cjs/index-MLK151KV.js.map +0 -1
- package/lib/cjs/index-YoPS8A3_.js.map +0 -1
- package/lib/cjs/index-rFFAL9YA.js.map +0 -1
- package/lib/cjs/index-uleaJDBC.js.map +0 -1
- package/lib/cjs/index-vNNxr8yy.js.map +0 -1
- package/lib/cjs/index-wORIFtqa.js.map +0 -1
- package/lib/cjs/index-z6pe2alg.js.map +0 -1
- package/lib/cjs/todoList-Qb2JsRGC.js +0 -419
- package/lib/cjs/todoList-Qb2JsRGC.js.map +0 -1
- package/lib/esm/index-6JoGWH2I.js.map +0 -1
- package/lib/esm/index-CMGDOz11.js.map +0 -1
- package/lib/esm/index-HHuxH8Dm.js.map +0 -1
- package/lib/esm/index-I5dm1KsK.js.map +0 -1
- package/lib/esm/index-J3c6JQEf.js +0 -26
- package/lib/esm/index-J3c6JQEf.js.map +0 -1
- package/lib/esm/index-Jvxff1vU.js.map +0 -1
- package/lib/esm/index-X2mjLDJS.js.map +0 -1
- package/lib/esm/index-eZXAY3yz.js.map +0 -1
- package/lib/esm/index-sE0tYrbc.js.map +0 -1
- package/lib/esm/index-uThMsyF6.js.map +0 -1
- package/lib/esm/todoList-eAxCDaQj.js +0 -382
- package/lib/esm/todoList-eAxCDaQj.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/icons/code.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/icons/code.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAkBpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../../src/icons/confirm.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../../src/icons/confirm.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,KAoBvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../../src/icons/divider.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../../src/icons/divider.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,KAoBvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dragHandle.d.ts","sourceRoot":"","sources":["../../../src/icons/dragHandle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"dragHandle.d.ts","sourceRoot":"","sources":["../../../src/icons/dragHandle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,KAW1B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/icons/edit.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/icons/edit.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAkBpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"h1.d.ts","sourceRoot":"","sources":["../../../src/icons/h1.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"h1.d.ts","sourceRoot":"","sources":["../../../src/icons/h1.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAkBlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"h2.d.ts","sourceRoot":"","sources":["../../../src/icons/h2.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"h2.d.ts","sourceRoot":"","sources":["../../../src/icons/h2.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAkBlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"h3.d.ts","sourceRoot":"","sources":["../../../src/icons/h3.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"h3.d.ts","sourceRoot":"","sources":["../../../src/icons/h3.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAkBlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"h4.d.ts","sourceRoot":"","sources":["../../../src/icons/h4.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"h4.d.ts","sourceRoot":"","sources":["../../../src/icons/h4.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAkBlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"h5.d.ts","sourceRoot":"","sources":["../../../src/icons/h5.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"h5.d.ts","sourceRoot":"","sources":["../../../src/icons/h5.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAkBlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"h6.d.ts","sourceRoot":"","sources":["../../../src/icons/h6.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"h6.d.ts","sourceRoot":"","sources":["../../../src/icons/h6.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,KAkBlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/icons/image.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/icons/image.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,KAkBrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"italic.d.ts","sourceRoot":"","sources":["../../../src/icons/italic.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"italic.d.ts","sourceRoot":"","sources":["../../../src/icons/italic.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,KAWtB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/icons/link.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/icons/link.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAWpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/icons/menu.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/icons/menu.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAkBpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderedList.d.ts","sourceRoot":"","sources":["../../../src/icons/orderedList.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"orderedList.d.ts","sourceRoot":"","sources":["../../../src/icons/orderedList.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,KAkB3B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plus.d.ts","sourceRoot":"","sources":["../../../src/icons/plus.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"plus.d.ts","sourceRoot":"","sources":["../../../src/icons/plus.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAkBpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../../src/icons/quote.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../../src/icons/quote.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,KAkBrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/icons/remove.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/icons/remove.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,KAWtB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/icons/search.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/icons/search.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,KAetB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strikethrough.d.ts","sourceRoot":"","sources":["../../../src/icons/strikethrough.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"strikethrough.d.ts","sourceRoot":"","sources":["../../../src/icons/strikethrough.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,KAW7B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/icons/table.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/icons/table.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,KAkBrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/icons/text.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/icons/text.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAkBpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"todoList.d.ts","sourceRoot":"","sources":["../../../src/icons/todoList.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"todoList.d.ts","sourceRoot":"","sources":["../../../src/icons/todoList.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,KAWxB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,CAC5B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,wBAAwB,QAIlC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milkdown/crepe",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.5.
|
|
4
|
+
"version": "7.5.9",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"codemirror": "^6.0.1",
|
|
47
47
|
"nanoid": "^5.0.0",
|
|
48
48
|
"tslib": "^2.5.0",
|
|
49
|
-
"@milkdown/kit": "7.5.
|
|
49
|
+
"@milkdown/kit": "7.5.9"
|
|
50
50
|
},
|
|
51
51
|
"nx": {
|
|
52
52
|
"targets": {
|
package/src/core/crepe.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { DefaultValue } from '@milkdown/kit/core'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Editor,
|
|
4
|
+
defaultValueCtx,
|
|
5
|
+
editorViewOptionsCtx,
|
|
6
|
+
rootCtx,
|
|
7
|
+
} from '@milkdown/kit/core'
|
|
3
8
|
|
|
4
9
|
import { commonmark } from '@milkdown/kit/preset/commonmark'
|
|
5
10
|
import { gfm } from '@milkdown/kit/preset/gfm'
|
|
@@ -33,15 +38,16 @@ export class Crepe {
|
|
|
33
38
|
featureConfigs = {},
|
|
34
39
|
defaultValue = '',
|
|
35
40
|
}: CrepeConfig) {
|
|
36
|
-
const enabledFeatures = Object
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
+
const enabledFeatures = Object.entries({
|
|
42
|
+
...defaultFeatures,
|
|
43
|
+
...features,
|
|
44
|
+
})
|
|
41
45
|
.filter(([, enabled]) => enabled)
|
|
42
46
|
.map(([feature]) => feature as CrepeFeature)
|
|
43
47
|
|
|
44
|
-
this.#rootElement =
|
|
48
|
+
this.#rootElement =
|
|
49
|
+
(typeof root === 'string' ? document.querySelector(root) : root) ??
|
|
50
|
+
document.body
|
|
45
51
|
this.#editor = Editor.make()
|
|
46
52
|
.config(configureFeatures(enabledFeatures))
|
|
47
53
|
.config((ctx) => {
|
|
@@ -50,7 +56,7 @@ export class Crepe {
|
|
|
50
56
|
ctx.set(editorViewOptionsCtx, {
|
|
51
57
|
editable: () => this.#editable,
|
|
52
58
|
})
|
|
53
|
-
ctx.update(indentConfig.key, value => ({
|
|
59
|
+
ctx.update(indentConfig.key, (value) => ({
|
|
54
60
|
...value,
|
|
55
61
|
size: 4,
|
|
56
62
|
}))
|
|
@@ -65,10 +71,10 @@ export class Crepe {
|
|
|
65
71
|
const promiseList: Promise<unknown>[] = []
|
|
66
72
|
|
|
67
73
|
enabledFeatures.forEach((feature) => {
|
|
68
|
-
const config = (featureConfigs as Partial<Record<CrepeFeature, never>>)[
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
)
|
|
74
|
+
const config = (featureConfigs as Partial<Record<CrepeFeature, never>>)[
|
|
75
|
+
feature
|
|
76
|
+
]
|
|
77
|
+
promiseList.push(loadFeature(feature, this.#editor, config))
|
|
72
78
|
})
|
|
73
79
|
|
|
74
80
|
this.#initPromise = Promise.all(promiseList)
|
|
@@ -5,8 +5,8 @@ import type { Icon } from '../../shared'
|
|
|
5
5
|
export interface BlockHandleProps {
|
|
6
6
|
show: boolean
|
|
7
7
|
onAdd: () => void
|
|
8
|
-
addIcon
|
|
9
|
-
handleIcon
|
|
8
|
+
addIcon?: Icon
|
|
9
|
+
handleIcon?: Icon
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const blockHandleComponent: Component<BlockHandleProps> = ({
|
|
@@ -31,12 +31,15 @@ const blockHandleComponent: Component<BlockHandleProps> = ({
|
|
|
31
31
|
}
|
|
32
32
|
return html`
|
|
33
33
|
<host>
|
|
34
|
-
<div
|
|
34
|
+
<div
|
|
35
|
+
ref=${ref}
|
|
36
|
+
onmousedown=${onMouseDown}
|
|
37
|
+
onmouseup=${onMouseUp}
|
|
38
|
+
class="operation-item"
|
|
39
|
+
>
|
|
35
40
|
${addIcon?.() || plusIcon}
|
|
36
41
|
</div>
|
|
37
|
-
<div class="operation-item">
|
|
38
|
-
${handleIcon?.() || menuIcon}
|
|
39
|
-
</div>
|
|
42
|
+
<div class="operation-item">${handleIcon?.() || menuIcon}</div>
|
|
40
43
|
</host>
|
|
41
44
|
`
|
|
42
45
|
}
|
|
@@ -29,8 +29,7 @@ export class BlockHandleView implements PluginView {
|
|
|
29
29
|
content,
|
|
30
30
|
getOffset: () => 16,
|
|
31
31
|
getPlacement: ({ active, blockDom }) => {
|
|
32
|
-
if (active.node.type.name === 'heading')
|
|
33
|
-
return 'left'
|
|
32
|
+
if (active.node.type.name === 'heading') return 'left'
|
|
34
33
|
|
|
35
34
|
let totalDescendant = 0
|
|
36
35
|
active.node.descendants((node) => {
|
|
@@ -44,7 +43,9 @@ export class BlockHandleView implements PluginView {
|
|
|
44
43
|
const paddingBottom = Number.parseInt(style.paddingBottom, 10) || 0
|
|
45
44
|
const height = domRect.height - paddingTop - paddingBottom
|
|
46
45
|
const handleHeight = handleRect.height
|
|
47
|
-
return totalDescendant > 2 || handleHeight < height
|
|
46
|
+
return totalDescendant > 2 || handleHeight < height
|
|
47
|
+
? 'left-start'
|
|
48
|
+
: 'left'
|
|
48
49
|
},
|
|
49
50
|
})
|
|
50
51
|
this.update()
|
|
@@ -62,13 +63,11 @@ export class BlockHandleView implements PluginView {
|
|
|
62
63
|
onAdd = () => {
|
|
63
64
|
const ctx = this.#ctx
|
|
64
65
|
const view = ctx.get(editorViewCtx)
|
|
65
|
-
if (!view.hasFocus())
|
|
66
|
-
view.focus()
|
|
66
|
+
if (!view.hasFocus()) view.focus()
|
|
67
67
|
|
|
68
68
|
const { state, dispatch } = view
|
|
69
69
|
const active = this.#provider.active
|
|
70
|
-
if (!active)
|
|
71
|
-
return
|
|
70
|
+
if (!active) return
|
|
72
71
|
|
|
73
72
|
const $pos = active.$pos
|
|
74
73
|
const pos = $pos.pos + active.node.nodeSize
|
|
@@ -82,12 +81,16 @@ export class BlockHandleView implements PluginView {
|
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
defIfNotExists('milkdown-block-handle', BlockHandleElement)
|
|
85
|
-
export function configureBlockHandle(
|
|
84
|
+
export function configureBlockHandle(
|
|
85
|
+
ctx: Ctx,
|
|
86
|
+
config?: BlockEditFeatureConfig
|
|
87
|
+
) {
|
|
86
88
|
ctx.set(blockConfig.key, {
|
|
87
89
|
filterNodes: (pos) => {
|
|
88
|
-
const filter = findParent(node =>
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
const filter = findParent((node) =>
|
|
91
|
+
['table', 'blockquote'].includes(node.type.name)
|
|
92
|
+
)(pos)
|
|
93
|
+
if (filter) return false
|
|
91
94
|
|
|
92
95
|
return true
|
|
93
96
|
},
|
|
@@ -48,10 +48,13 @@ interface BlockEditConfig {
|
|
|
48
48
|
|
|
49
49
|
export type BlockEditFeatureConfig = Partial<BlockEditConfig>
|
|
50
50
|
|
|
51
|
-
export const defineFeature: DefineFeature<BlockEditFeatureConfig> = (
|
|
51
|
+
export const defineFeature: DefineFeature<BlockEditFeatureConfig> = (
|
|
52
|
+
editor,
|
|
53
|
+
config
|
|
54
|
+
) => {
|
|
52
55
|
editor
|
|
53
|
-
.config(ctx => configureBlockHandle(ctx, config))
|
|
54
|
-
.config(ctx => configureMenu(ctx, config))
|
|
56
|
+
.config((ctx) => configureBlockHandle(ctx, config))
|
|
57
|
+
.config((ctx) => configureMenu(ctx, config))
|
|
55
58
|
.use(menuAPI)
|
|
56
59
|
.use(block)
|
|
57
60
|
.use(menu)
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { Component } from 'atomico'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
c,
|
|
4
|
+
html,
|
|
5
|
+
useCallback,
|
|
6
|
+
useEffect,
|
|
7
|
+
useHost,
|
|
8
|
+
useMemo,
|
|
9
|
+
useRef,
|
|
10
|
+
useState,
|
|
11
|
+
} from 'atomico'
|
|
3
12
|
import type { Ctx } from '@milkdown/kit/ctx'
|
|
4
13
|
import type { BlockEditFeatureConfig } from '../index'
|
|
5
14
|
import { getGroups } from './config'
|
|
@@ -30,8 +39,7 @@ export const menuComponent: Component<MenuProps> = ({
|
|
|
30
39
|
|
|
31
40
|
const onMouseMove = useCallback((e: MouseEvent) => {
|
|
32
41
|
const prevPos = prevMousePosition.current
|
|
33
|
-
if (!prevPos)
|
|
34
|
-
return
|
|
42
|
+
if (!prevPos) return
|
|
35
43
|
|
|
36
44
|
const { x, y } = e
|
|
37
45
|
prevPos.x = x
|
|
@@ -39,113 +47,122 @@ export const menuComponent: Component<MenuProps> = ({
|
|
|
39
47
|
}, [])
|
|
40
48
|
|
|
41
49
|
useEffect(() => {
|
|
42
|
-
if (size === 0 && show)
|
|
43
|
-
|
|
50
|
+
if (size === 0 && show) hide?.()
|
|
51
|
+
else if (hoverIndex >= size) setHoverIndex(0)
|
|
44
52
|
}, [size, show])
|
|
45
53
|
|
|
46
|
-
const onHover = useCallback(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
const onHover = useCallback(
|
|
55
|
+
(
|
|
56
|
+
index: number | ((prev: number) => number),
|
|
57
|
+
after?: (index: number) => void
|
|
58
|
+
) => {
|
|
59
|
+
setHoverIndex((prev) => {
|
|
60
|
+
const next = typeof index === 'function' ? index(prev) : index
|
|
61
|
+
|
|
62
|
+
after?.(next)
|
|
63
|
+
return next
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
[]
|
|
67
|
+
)
|
|
57
68
|
|
|
58
69
|
const scrollToIndex = useCallback((index: number) => {
|
|
59
|
-
const target = host
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
const target = host.current.querySelector<HTMLElement>(
|
|
71
|
+
`[data-index="${index}"]`
|
|
72
|
+
)
|
|
62
73
|
const scrollRoot = host.current.querySelector<HTMLElement>('.menu-groups')
|
|
63
74
|
|
|
64
|
-
if (!target || !scrollRoot)
|
|
65
|
-
return
|
|
75
|
+
if (!target || !scrollRoot) return
|
|
66
76
|
|
|
67
77
|
scrollRoot.scrollTop = target.offsetTop - scrollRoot.offsetTop
|
|
68
78
|
}, [])
|
|
69
79
|
|
|
70
|
-
const runByIndex = useCallback(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
item.onRun(ctx)
|
|
80
|
+
const runByIndex = useCallback(
|
|
81
|
+
(index: number) => {
|
|
82
|
+
const item = groups.flatMap((group) => group.items).at(index)
|
|
83
|
+
if (item && ctx) item.onRun(ctx)
|
|
74
84
|
|
|
75
|
-
hide?.()
|
|
76
|
-
}, [groups])
|
|
77
|
-
|
|
78
|
-
const onKeydown = useCallback((e: KeyboardEvent) => {
|
|
79
|
-
if (e.key === 'Escape') {
|
|
80
|
-
e.preventDefault()
|
|
81
85
|
hide?.()
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return index
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
86
|
+
},
|
|
87
|
+
[groups]
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
const onKeydown = useCallback(
|
|
91
|
+
(e: KeyboardEvent) => {
|
|
92
|
+
if (e.key === 'Escape') {
|
|
93
|
+
e.preventDefault()
|
|
94
|
+
hide?.()
|
|
95
|
+
return
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (e.key === 'ArrowDown') {
|
|
99
|
+
e.preventDefault()
|
|
100
|
+
return onHover(
|
|
101
|
+
(index) => (index < size - 1 ? index + 1 : index),
|
|
102
|
+
scrollToIndex
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (e.key === 'ArrowUp') {
|
|
107
|
+
e.preventDefault()
|
|
108
|
+
return onHover(
|
|
109
|
+
(index) => (index <= 0 ? index : index - 1),
|
|
110
|
+
scrollToIndex
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (e.key === 'ArrowLeft') {
|
|
115
|
+
e.preventDefault()
|
|
116
|
+
return onHover((index) => {
|
|
117
|
+
const group = groups.find(
|
|
118
|
+
(group) => group.range[0] <= index && group.range[1] > index
|
|
119
|
+
)
|
|
120
|
+
if (!group) return index
|
|
121
|
+
|
|
122
|
+
const prevGroup = groups[groups.indexOf(group) - 1]
|
|
123
|
+
if (!prevGroup) return index
|
|
124
|
+
|
|
125
|
+
return prevGroup.range[1] - 1
|
|
126
|
+
}, scrollToIndex)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (e.key === 'ArrowRight') {
|
|
130
|
+
e.preventDefault()
|
|
131
|
+
return onHover((index) => {
|
|
132
|
+
const group = groups.find(
|
|
133
|
+
(group) => group.range[0] <= index && group.range[1] > index
|
|
134
|
+
)
|
|
135
|
+
if (!group) return index
|
|
136
|
+
|
|
137
|
+
const nextGroup = groups[groups.indexOf(group) + 1]
|
|
138
|
+
if (!nextGroup) return index
|
|
139
|
+
|
|
140
|
+
return nextGroup.range[0]
|
|
141
|
+
}, scrollToIndex)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (e.key === 'Enter') {
|
|
145
|
+
e.preventDefault()
|
|
146
|
+
runByIndex(hoverIndex)
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
[hide, groups, hoverIndex]
|
|
150
|
+
)
|
|
130
151
|
|
|
131
152
|
const onMouseEnter = useCallback((index: number) => {
|
|
132
153
|
return (e: MouseEvent) => {
|
|
133
154
|
const prevPos = prevMousePosition.current
|
|
134
|
-
if (!prevPos)
|
|
135
|
-
return
|
|
155
|
+
if (!prevPos) return
|
|
136
156
|
|
|
137
157
|
const { x, y } = e
|
|
138
|
-
if (x === prevPos.x && y === prevPos.y)
|
|
139
|
-
return
|
|
158
|
+
if (x === prevPos.x && y === prevPos.y) return
|
|
140
159
|
|
|
141
160
|
onHover(index)
|
|
142
161
|
}
|
|
143
162
|
}, [])
|
|
144
163
|
|
|
145
164
|
useEffect(() => {
|
|
146
|
-
if (show)
|
|
147
|
-
root.addEventListener('keydown', onKeydown, { capture: true })
|
|
148
|
-
|
|
165
|
+
if (show) root.addEventListener('keydown', onKeydown, { capture: true })
|
|
149
166
|
else root.removeEventListener('keydown', onKeydown, { capture: true })
|
|
150
167
|
|
|
151
168
|
return () => {
|
|
@@ -157,14 +174,19 @@ export const menuComponent: Component<MenuProps> = ({
|
|
|
157
174
|
<host onmousedown=${(e: MouseEvent) => e.preventDefault()}>
|
|
158
175
|
<nav class="tab-group">
|
|
159
176
|
<ul>
|
|
160
|
-
${groups.map(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
177
|
+
${groups.map(
|
|
178
|
+
(group) =>
|
|
179
|
+
html`<li
|
|
180
|
+
key=${group.key}
|
|
181
|
+
onmousedown=${() => onHover(group.range[0], scrollToIndex)}
|
|
182
|
+
class=${hoverIndex >= group.range[0] &&
|
|
183
|
+
hoverIndex < group.range[1]
|
|
184
|
+
? 'selected'
|
|
185
|
+
: ''}
|
|
186
|
+
>
|
|
187
|
+
${group.label}
|
|
188
|
+
</li>`
|
|
189
|
+
)}
|
|
168
190
|
</ul>
|
|
169
191
|
</nav>
|
|
170
192
|
<div class="menu-groups" onmousemove=${onMouseMove}>
|
|
@@ -173,29 +195,28 @@ export const menuComponent: Component<MenuProps> = ({
|
|
|
173
195
|
<div key=${group.key} class="menu-group">
|
|
174
196
|
<h6>${group.label}</h6>
|
|
175
197
|
<ul>
|
|
176
|
-
${group.items.map(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
.current
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
</li>`,
|
|
198
|
+
${group.items.map(
|
|
199
|
+
(item) =>
|
|
200
|
+
html`<li
|
|
201
|
+
key=${item.key}
|
|
202
|
+
data-index=${item.index}
|
|
203
|
+
class=${hoverIndex === item.index ? 'hover' : ''}
|
|
204
|
+
onmouseenter=${onMouseEnter(item.index)}
|
|
205
|
+
onmousedown=${() => {
|
|
206
|
+
host.current
|
|
207
|
+
.querySelector(`[data-index="${item.index}"]`)
|
|
208
|
+
?.classList.add('active')
|
|
209
|
+
}}
|
|
210
|
+
onmouseup=${() => {
|
|
211
|
+
host.current
|
|
212
|
+
.querySelector(`[data-index="${item.index}"]`)
|
|
213
|
+
?.classList.remove('active')
|
|
214
|
+
runByIndex(item.index)
|
|
215
|
+
}}
|
|
216
|
+
>
|
|
217
|
+
${item.icon}
|
|
218
|
+
<span>${item.label}</span>
|
|
219
|
+
</li>`
|
|
199
220
|
)}
|
|
200
221
|
</ul>
|
|
201
222
|
</div>
|