refactor: Use named exports instead of default exports (#2238)
* use named exports instead of default exports * fix tests Co-authored-by: Philipp Kühn <philippkuehn@MacBook-Pro-von-Philipp.local>
This commit is contained in:
@@ -12,7 +12,7 @@ type AutolinkOptions = {
|
||||
type: MarkType,
|
||||
}
|
||||
|
||||
export default function autolink(options: AutolinkOptions): Plugin {
|
||||
export function autolink(options: AutolinkOptions): Plugin {
|
||||
return new Plugin({
|
||||
key: new PluginKey('autolink'),
|
||||
appendTransaction: (transactions, oldState, newState) => {
|
||||
|
||||
@@ -6,7 +6,7 @@ type ClickHandlerOptions = {
|
||||
type: MarkType,
|
||||
}
|
||||
|
||||
export default function clickHandler(options: ClickHandlerOptions): Plugin {
|
||||
export function clickHandler(options: ClickHandlerOptions): Plugin {
|
||||
return new Plugin({
|
||||
key: new PluginKey('handleClickLink'),
|
||||
props: {
|
||||
|
||||
@@ -8,7 +8,7 @@ type PasteHandlerOptions = {
|
||||
type: MarkType,
|
||||
}
|
||||
|
||||
export default function pasteHandler(options: PasteHandlerOptions): Plugin {
|
||||
export function pasteHandler(options: PasteHandlerOptions): Plugin {
|
||||
return new Plugin({
|
||||
key: new PluginKey('handlePasteLink'),
|
||||
props: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Mark, markPasteRule, mergeAttributes } from '@tiptap/core'
|
||||
import { find } from 'linkifyjs'
|
||||
import autolink from './helpers/autolink'
|
||||
import clickHandler from './helpers/clickHandler'
|
||||
import pasteHandler from './helpers/pasteHandler'
|
||||
import { autolink } from './helpers/autolink'
|
||||
import { clickHandler } from './helpers/clickHandler'
|
||||
import { pasteHandler } from './helpers/pasteHandler'
|
||||
|
||||
export interface LinkOptions {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user