Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@
"@tiptap/extension-bullet-list": "^2.2.1",
"@tiptap/extension-code": "^2.2.1",
"@tiptap/extension-code-block": "^2.2.1",
"@tiptap/extension-color": "^2.1.16",
"@tiptap/extension-color": "^2.2.1",
"@tiptap/extension-document": "^2.2.1",
"@tiptap/extension-dropcursor": "^2.2.4",
"@tiptap/extension-hard-break": "^2.3.1",
"@tiptap/extension-heading": "^2.2.1",
"@tiptap/extension-highlight": "^2.1.16",
"@tiptap/extension-highlight": "^2.2.1",
"@tiptap/extension-history": "^2.2.1",
"@tiptap/extension-horizontal-rule": "^2.2.1",
"@tiptap/extension-image": "^2.2.1",
Expand All @@ -224,13 +224,13 @@
"@tiptap/extension-ordered-list": "^2.2.1",
"@tiptap/extension-placeholder": "^2.2.1",
"@tiptap/extension-strike": "^2.2.1",
"@tiptap/extension-task-item": "^2.1.16",
"@tiptap/extension-task-list": "^2.1.16",
"@tiptap/extension-text-style": "^2.1.16",
"@tiptap/extension-underline": "^2.1.16",
"@tiptap/pm": "^2.1.16",
"@tiptap/react": "^2.1.16",
"@tiptap/starter-kit": "^2.1.16",
"@tiptap/extension-task-item": "^2.2.1",
"@tiptap/extension-task-list": "^2.2.1",
"@tiptap/extension-text-style": "^2.2.1",
"@tiptap/extension-underline": "^2.2.1",
"@tiptap/pm": "^2.2.1",
"@tiptap/react": "^2.2.1",
"@tiptap/starter-kit": "^2.2.1",
"lodash": "^4.17.21",
"react-dom": "^18.2.0"
}
Expand Down
6 changes: 5 additions & 1 deletion src/webEditorUtils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export * from './useTenTap';
export { useTenTap, sendMessage } from './useTenTap';
export type {
sendMessage as SendMessage,
useTenTap as UseTenTap,
} from './useTenTap';
export { default as BridgeExtension } from '../bridges/base';
export { BlockquoteBridge } from '../bridges/blockquote';
export { BoldBridge } from '../bridges/bold';
Expand Down
12 changes: 6 additions & 6 deletions src/webEditorUtils/useTenTap.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import debounce from 'lodash/debounce';
import { useEffect, useMemo } from 'react';
import { useEditor } from '@tiptap/react';
import { Editor } from '@tiptap/core';
import { useEditor, UseEditorOptions } from '@tiptap/react';
import { Editor, Extension } from '@tiptap/core';
import { type EditorMessage, EditorMessageType } from '../types/Messaging';
import { type BridgeState } from '../types/EditorBridge';
import type BridgeExtension from '../bridges/base';
Expand All @@ -27,7 +27,7 @@ export const sendMessage = (message: EditorMessage) => {
};

interface useTenTapArgs {
tiptapOptions?: any;
tiptapOptions?: UseEditorOptions;
bridges?: BridgeExtension[];
}

Expand Down Expand Up @@ -56,11 +56,11 @@ export const useTenTap = (options?: useTenTapArgs) => {
.filter(filterExists)
.flat();

const tiptapOptionsWithExtensions = {
const tiptapOptionsWithExtensions: UseEditorOptions = {
...tiptapOptions,
extensions: [
...(!window.disableColorHighlight ? [blueBackgroundPlugin] : []),
...extensions,
...(extensions.filter(Boolean) as Extension[]),
...(tiptapOptions.extensions || []),
],
};
Expand Down Expand Up @@ -97,7 +97,7 @@ export const useTenTap = (options?: useTenTapArgs) => {
},
onSelectionUpdate: (onUpdate) => sendStateUpdate(onUpdate.editor),
onTransaction: (onUpdate) => sendStateUpdate(onUpdate.editor),
editable: window.editable,
editable: !!window.editable,
...tiptapOptionsWithExtensions,
});

Expand Down
Loading