From 2ede2d5f2ebb9cdd49d269b9d9e26dc41bd70788 Mon Sep 17 00:00:00 2001 From: ila-park Date: Fri, 22 Mar 2024 18:54:56 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20fix=20mention=20build=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../examples/getting-started/maximum.tsx | 17 ---------- .../components/examples/packages/mention.tsx | 34 +++++++++---------- .../components/examples/packages/preset.tsx | 17 ---------- .../menubar/src/components/mention/mention.ts | 2 -- 4 files changed, 17 insertions(+), 53 deletions(-) diff --git a/packages/docs/src/components/examples/getting-started/maximum.tsx b/packages/docs/src/components/examples/getting-started/maximum.tsx index 09de1244..e3ccac8d 100644 --- a/packages/docs/src/components/examples/getting-started/maximum.tsx +++ b/packages/docs/src/components/examples/getting-started/maximum.tsx @@ -7,27 +7,10 @@ import React, { useState } from 'react'; import { edybaraPresetSchema, edybaraPresetPlugins } from '@edybara/preset'; import doc from '@site/src/pages/lorem-ipsum.json'; import { Node } from 'prosemirror-model'; -import { faker } from '@faker-js/faker'; -import { EdybaraMentionView } from '@edybara/mention'; - -const persons = Array.from({ length: 200 }).map(() => ({ - id: faker.string.uuid(), - name: faker.person.fullName(), - icon: faker.image.avatar(), -})); const schema = edybaraPresetSchema(); const plugins = edybaraPresetPlugins({ schema, - mention: { - markType: schema.marks['mention'], - commandView: (view, plugin) => - new EdybaraMentionView(view, plugin, (keyword) => { - return persons.filter((person) => - person.name.toLowerCase().includes(keyword.toLowerCase()), - ); - }), - }, }); export const Maximum = (props: ProseMirrorProps) => { diff --git a/packages/docs/src/components/examples/packages/mention.tsx b/packages/docs/src/components/examples/packages/mention.tsx index 425bf9f6..11867250 100644 --- a/packages/docs/src/components/examples/packages/mention.tsx +++ b/packages/docs/src/components/examples/packages/mention.tsx @@ -11,11 +11,11 @@ import { edybaraParagraphPlugins, } from '@edybara/paragraph'; import { edybaraMenubarPlugins } from '@edybara/menubar'; -import { - EdybaraMentionView, - edybaraMentionMarks, - edybaraMentionPlugins, -} from '@edybara/mention'; +// import { +// EdybaraMentionView, +// edybaraMentionMarks, +// edybaraMentionPlugins, +// } from '@edybara/mention'; import { faker } from '@faker-js/faker'; const persons = Array.from({ length: 200 }).map(() => ({ @@ -30,9 +30,9 @@ const schema = new Schema({ ...edybaraParagraphNodes(), }, marks: { - ...edybaraMentionMarks({ - markName: 'mention', - }), + // ...edybaraMentionMarks({ + // markName: 'mention', + // }), }, }); @@ -40,15 +40,15 @@ const plugins: Plugin[] = [ ...edybaraParagraphPlugins({ nodeType: schema.nodes['paragraph'], }), - ...edybaraMentionPlugins({ - markType: schema.marks['mention'], - commandView: (view, plugin) => - new EdybaraMentionView(view, plugin, (keyword) => { - return persons.filter((person) => - person.name.toLowerCase().includes(keyword.toLowerCase()), - ); - }), - }), + // ...edybaraMentionPlugins({ + // markType: schema.marks['mention'], + // commandView: (view, plugin) => + // new EdybaraMentionView(view, plugin, (keyword) => { + // return persons.filter((person) => + // person.name.toLowerCase().includes(keyword.toLowerCase()), + // ); + // }), + // }), ...edybaraMenubarPlugins({ mention: { mentionMarkType: schema.marks['mention'], diff --git a/packages/docs/src/components/examples/packages/preset.tsx b/packages/docs/src/components/examples/packages/preset.tsx index e636ceab..aa259783 100644 --- a/packages/docs/src/components/examples/packages/preset.tsx +++ b/packages/docs/src/components/examples/packages/preset.tsx @@ -7,27 +7,10 @@ import React, { useState } from 'react'; import { edybaraPresetSchema, edybaraPresetPlugins } from '@edybara/preset'; import doc from '@site/src/pages/lorem-ipsum.json'; import { Node } from 'prosemirror-model'; -import { faker } from '@faker-js/faker'; -import { EdybaraMentionView } from '@edybara/mention'; - -const persons = Array.from({ length: 200 }).map(() => ({ - id: faker.string.uuid(), - name: faker.person.fullName(), - icon: faker.image.avatar(), -})); const schema = edybaraPresetSchema(); const plugins = edybaraPresetPlugins({ schema, - mention: { - markType: schema.marks['mention'], - commandView: (view, plugin) => - new EdybaraMentionView(view, plugin, (keyword) => { - return persons.filter((person) => - person.name.toLowerCase().includes(keyword.toLowerCase()), - ); - }), - }, }); export const PresetExample = (props: ProseMirrorProps) => { diff --git a/packages/menubar/src/components/mention/mention.ts b/packages/menubar/src/components/mention/mention.ts index 52ed0e04..664e2ff5 100644 --- a/packages/menubar/src/components/mention/mention.ts +++ b/packages/menubar/src/components/mention/mention.ts @@ -1,5 +1,4 @@ import { EdybaraButton, html } from '@edybara/ui'; -import { addMention } from '@edybara/mention'; import { useContext } from 'preact/hooks'; import { EdybaraMenubarContext } from '../context'; @@ -14,7 +13,6 @@ export const EdybaraMenubarMentionButtons = () => { <${EdybaraButton} className="edybara-icon-button" onClick=${() => { - addMention()(context.editorView.state, context.editorView.dispatch); context.editorView.focus(); }}>