diff --git a/playground/.env.exmaple b/playground/.env.exmaple index 4ec909f..5550a70 100644 --- a/playground/.env.exmaple +++ b/playground/.env.exmaple @@ -1 +1 @@ -GIPHY_API_KEY= +VITE_GIPHY_API_KEY= diff --git a/playground/src/App.tsx b/playground/src/App.tsx index 0a18318..3ad80ea 100644 --- a/playground/src/App.tsx +++ b/playground/src/App.tsx @@ -122,9 +122,9 @@ const extensions = [ return Promise.resolve(f) }, }), - // ImageGif.configure({ - // GIPHY_API_KEY: '', - // }), + ImageGif.configure({ + GIPHY_API_KEY: import.meta.env.VITE_GIPHY_API_KEY as string, + }), Blockquote, SlashCommand, HorizontalRule, diff --git a/playground/vite.config.ts b/playground/vite.config.ts index d029ee7..567261a 100644 --- a/playground/vite.config.ts +++ b/playground/vite.config.ts @@ -45,5 +45,11 @@ export default defineConfig(({ mode }) => { esbuild: { sourcemap: isDev, }, + server: { + port: 8000, + }, + preview: { + port: 8000, + }, } }) diff --git a/src/extensions/BaseKit.ts b/src/extensions/BaseKit.ts index 4264b16..8e851b0 100644 --- a/src/extensions/BaseKit.ts +++ b/src/extensions/BaseKit.ts @@ -161,7 +161,7 @@ export const BaseKit = Extension.create({ extensions.push( Placeholder.configure({ placeholder: ({ node, pos, editor }) => { - if (node?.type?.name === 'columns') { + if (node?.type?.name === 'columns' || node?.content?.size !== 0) { return '' } diff --git a/src/extensions/Katex/Katex.ts b/src/extensions/Katex/Katex.ts index bfa90fe..71f845c 100644 --- a/src/extensions/Katex/Katex.ts +++ b/src/extensions/Katex/Katex.ts @@ -1,7 +1,7 @@ import { Node, mergeAttributes, nodeInputRule } from '@tiptap/core' import { ReactNodeViewRenderer } from '@tiptap/react' -import { KatexWrapper } from '@/extensions/Katex/components/KatexWrapper' import KatexActiveButton from '@/extensions/Katex/components/KatexActiveButton' +import { KatexWrapper } from '@/extensions/Katex/components/KatexWrapper' export interface IKatexAttrs { text?: string @@ -28,10 +28,11 @@ declare module '@tiptap/core' { export const Katex = Node.create({ name: 'katex', - group: 'block', - selectable: true, - atom: true, + group: 'inline', + inline: true, + defining: true, draggable: true, + selectable: true, addOptions() { return { diff --git a/src/extensions/Katex/components/KatexWrapper.tsx b/src/extensions/Katex/components/KatexWrapper.tsx index 2329a54..7b824cb 100644 --- a/src/extensions/Katex/components/KatexWrapper.tsx +++ b/src/extensions/Katex/components/KatexWrapper.tsx @@ -40,12 +40,13 @@ export function KatexWrapper({ node }: any) { return ( -
{content}
+ {content}
) }