From dfe03a76bc0eec931e8fbe0655b21fec7243e3d3 Mon Sep 17 00:00:00 2001 From: quank123wip Date: Tue, 26 Nov 2024 20:52:43 +0800 Subject: [PATCH] fix(crepe): ship automd with crepe and kit --- packages/crepe/src/core/crepe.ts | 2 ++ packages/kit/package.json | 9 +++++++++ packages/kit/src/plugin/automd.ts | 1 + pnpm-lock.yaml | 3 +++ 4 files changed, 15 insertions(+) create mode 100644 packages/kit/src/plugin/automd.ts diff --git a/packages/crepe/src/core/crepe.ts b/packages/crepe/src/core/crepe.ts index b61a68bcee79..ec4ab5eac958 100644 --- a/packages/crepe/src/core/crepe.ts +++ b/packages/crepe/src/core/crepe.ts @@ -3,6 +3,7 @@ import { Editor, defaultValueCtx, editorViewOptionsCtx, rootCtx } from '@milkdow import { commonmark } from '@milkdown/kit/preset/commonmark' import { gfm } from '@milkdown/kit/preset/gfm' +import { automd } from '@milkdown/kit/preset/automd' import { history } from '@milkdown/kit/plugin/history' import { indent, indentConfig } from '@milkdown/kit/plugin/indent' import { getMarkdown } from '@milkdown/kit/utils' @@ -61,6 +62,7 @@ export class Crepe { .use(trailing) .use(clipboard) .use(gfm) + .use(automd) const promiseList: Promise[] = [] diff --git a/packages/kit/package.json b/packages/kit/package.json index 7c045e575943..5756ea14d029 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -41,6 +41,7 @@ "./prose/tables/style/tables.css": "./src/prose/tables/style/tables.css", "./preset/commonmark": "./src/preset/commonmark.ts", "./preset/gfm": "./src/preset/gfm.ts", + "./plugin/automd": "./src/plugin/automd.ts", "./plugin/block": "./src/plugin/block.ts", "./plugin/clipboard": "./src/plugin/clipboard.ts", "./plugin/cursor": "./src/plugin/cursor.ts", @@ -151,6 +152,10 @@ "types": "./lib/preset/gfm.d.ts", "import": "./lib/preset/gfm.js" }, + "./plugin/automd": { + "types": "./lib/plugin/automd.d.ts", + "import": "./lib/plugin/automd.js" + }, "./plugin/block": { "types": "./lib/plugin/block.d.ts", "import": "./lib/plugin/block.js" @@ -285,6 +290,9 @@ "preset/gfm": [ "lib/preset/gfm.d.ts" ], + "plugin/automd": [ + "lib/plugin/automd.d.ts" + ], "plugin/block": [ "lib/plugin/block.d.ts" ], @@ -355,6 +363,7 @@ "@milkdown/components": "workspace:*", "@milkdown/core": "workspace:*", "@milkdown/ctx": "workspace:*", + "@milkdown/plugin-automd": "workspace:*", "@milkdown/plugin-block": "workspace:*", "@milkdown/plugin-clipboard": "workspace:*", "@milkdown/plugin-cursor": "workspace:*", diff --git a/packages/kit/src/plugin/automd.ts b/packages/kit/src/plugin/automd.ts new file mode 100644 index 000000000000..ab24035a732b --- /dev/null +++ b/packages/kit/src/plugin/automd.ts @@ -0,0 +1 @@ +export * from '@milkdown/plugin-automd' \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3b2cef29ad42..ed4059e745c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -471,6 +471,9 @@ importers: '@milkdown/ctx': specifier: workspace:* version: link:../ctx + '@milkdown/plugin-automd': + specifier: workspace:* + version: link:../plugins/plugin-automd '@milkdown/plugin-block': specifier: workspace:* version: link:../plugins/plugin-block