From 6632bd2406e2e8c93756847dbe7b973fccfb0792 Mon Sep 17 00:00:00 2001 From: MrWangJustToDo <2711470541@qq.com> Date: Fri, 22 Mar 2024 00:28:51 +0800 Subject: [PATCH] improve component api --- packages/lowlight/src/index.ts | 2 ++ packages/vue/src/components/DiffView.tsx | 2 +- ui/react-example/src/Example.tsx | 16 +++++++--------- ui/react-example/src/worker.ts | 2 +- ui/vue-example/src/App.vue | 21 ++++++++++++++------- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/packages/lowlight/src/index.ts b/packages/lowlight/src/index.ts index db50300..410a0a9 100644 --- a/packages/lowlight/src/index.ts +++ b/packages/lowlight/src/index.ts @@ -124,4 +124,6 @@ Object.defineProperty(instance, "processAST", { }, }); +export { processAST } from "./processAST"; + export const highlighter: Highlighter = instance as Highlighter; diff --git a/packages/vue/src/components/DiffView.tsx b/packages/vue/src/components/DiffView.tsx index 823f410..364dbb2 100644 --- a/packages/vue/src/components/DiffView.tsx +++ b/packages/vue/src/components/DiffView.tsx @@ -185,7 +185,7 @@ export const DiffView = defineComponent< onUnmounted(() => diffFile.value._destroy?.()); - options.expose({ getDiffView: () => diffFile.value }); + options.expose({ getDiffFileInstance: () => diffFile.value }); return () => { if (!diffFile.value) return null; diff --git a/ui/react-example/src/Example.tsx b/ui/react-example/src/Example.tsx index cb1d46c..defc5f7 100644 --- a/ui/react-example/src/Example.tsx +++ b/ui/react-example/src/Example.tsx @@ -161,10 +161,10 @@ export function Example() {