refactor: recreate extension exports

This commit is contained in:
Florian Wiech 2020-12-07 21:32:50 +01:00
parent 11de3a287f
commit 4142637921
No known key found for this signature in database
GPG Key ID: 8FF63E63E36FD096
62 changed files with 186 additions and 93 deletions

View File

@ -9,7 +9,7 @@ export interface BlockquoteOptions {
export const inputRegex = /^\s*>\s$/gm
const Blockquote = Node.create({
export const Blockquote = Node.create({
name: 'blockquote',
defaultOptions: <BlockquoteOptions>{
@ -68,8 +68,6 @@ const Blockquote = Node.create({
},
})
export default Blockquote
declare module '@tiptap/core' {
interface AllExtensions {
Blockquote: typeof Blockquote,

View File

@ -0,0 +1,5 @@
import { Blockquote } from './blockquote'
export * from './blockquote'
export default Blockquote

View File

@ -17,7 +17,7 @@ export const starPasteRegex = /(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/gm
export const underscoreInputRegex = /(?:^|\s)((?:__)((?:[^__]+))(?:__))$/gm
export const underscorePasteRegex = /(?:^|\s)((?:__)((?:[^__]+))(?:__))/gm
const Bold = Mark.create({
export const Bold = Mark.create({
name: 'bold',
defaultOptions: <BoldOptions>{
@ -88,8 +88,6 @@ const Bold = Mark.create({
},
})
export default Bold
declare module '@tiptap/core' {
interface AllExtensions {
Bold: typeof Bold,

View File

@ -0,0 +1,5 @@
import { Bold } from './bold'
export * from './bold'
export default Bold

View File

@ -9,7 +9,7 @@ export interface BulletListOptions {
export const inputRegex = /^\s*([-+*])\s$/
const BulletList = Node.create({
export const BulletList = Node.create({
name: 'bulletList',
defaultOptions: <BulletListOptions>{
@ -54,8 +54,6 @@ const BulletList = Node.create({
},
})
export default BulletList
declare module '@tiptap/core' {
interface AllExtensions {
BulletList: typeof BulletList,

View File

@ -0,0 +1,5 @@
import { BulletList } from './bullet-list'
export * from './bullet-list'
export default BulletList

View File

@ -11,7 +11,7 @@ export interface CodeBlockOptions {
export const backtickInputRegex = /^```(?<language>[a-z]*)? $/
export const tildeInputRegex = /^~~~(?<language>[a-z]*)? $/
const CodeBlock = Node.create({
export const CodeBlock = Node.create({
name: 'codeBlock',
defaultOptions: <CodeBlockOptions>{
@ -103,8 +103,6 @@ const CodeBlock = Node.create({
},
})
export default CodeBlock
declare module '@tiptap/core' {
interface AllExtensions {
CodeBlock: typeof CodeBlock,

View File

@ -0,0 +1,5 @@
import { CodeBlock } from './code-block'
export * from './code-block'
export default CodeBlock

View File

@ -15,7 +15,7 @@ export interface CodeOptions {
export const inputRegex = /(?:^|\s)((?:`)((?:[^`]+))(?:`))$/gm
export const pasteRegex = /(?:^|\s)((?:`)((?:[^`]+))(?:`))/gm
const Code = Mark.create({
export const Code = Mark.create({
name: 'code',
defaultOptions: <CodeOptions>{
@ -76,8 +76,6 @@ const Code = Mark.create({
},
})
export default Code
declare module '@tiptap/core' {
interface AllExtensions {
Code: typeof Code,

View File

@ -0,0 +1,5 @@
import { Code } from './code'
export * from './code'
export default Code

View File

@ -17,7 +17,7 @@ const awarenessStatesToArray = (states: Map<number, { [key: string]: any }>) =>
})
}
const CollaborationCursor = Extension.create({
export const CollaborationCursor = Extension.create({
name: 'collaborationCursor',
defaultOptions: <CollaborationCursorOptions>{
@ -88,8 +88,6 @@ const CollaborationCursor = Extension.create({
},
})
export default CollaborationCursor
declare module '@tiptap/core' {
interface AllExtensions {
CollaborationCursor: typeof CollaborationCursor,

View File

@ -0,0 +1,5 @@
import { CollaborationCursor } from './collaboration-cursor'
export * from './collaboration-cursor'
export default CollaborationCursor

View File

@ -10,7 +10,7 @@ export interface CollaborationOptions {
provider: any,
}
const Collaboration = Extension.create({
export const Collaboration = Extension.create({
name: 'collaboration',
defaultOptions: <CollaborationOptions>{
@ -60,8 +60,6 @@ const Collaboration = Extension.create({
},
})
export default Collaboration
declare module '@tiptap/core' {
interface AllExtensions {
Collaboration: typeof Collaboration,

View File

@ -0,0 +1,5 @@
import { Collaboration } from './collaboration'
export * from './collaboration'
export default Collaboration

View File

@ -1,13 +1,11 @@
import { Node } from '@tiptap/core'
const Document = Node.create({
export const Document = Node.create({
name: 'document',
topNode: true,
content: 'block+',
})
export default Document
declare module '@tiptap/core' {
interface AllExtensions {
Document: typeof Document,

View File

@ -0,0 +1,5 @@
import { Document } from './document'
export * from './document'
export default Document

View File

@ -7,7 +7,7 @@ export interface DropcursorOptions {
class: string | null,
}
const Dropcursor = Extension.create({
export const Dropcursor = Extension.create({
name: 'dropCursor',
defaultOptions: <DropcursorOptions>{
@ -23,8 +23,6 @@ const Dropcursor = Extension.create({
},
})
export default Dropcursor
declare module '@tiptap/core' {
interface AllExtensions {
Dropcursor: typeof Dropcursor,

View File

@ -0,0 +1,5 @@
import { Dropcursor } from './dropcursor'
export * from './dropcursor'
export default Dropcursor

View File

@ -7,7 +7,7 @@ export interface FocusOptions {
nested: boolean,
}
const FocusClasses = Extension.create({
export const FocusClasses = Extension.create({
name: 'focus',
defaultOptions: <FocusOptions>{
@ -50,8 +50,6 @@ const FocusClasses = Extension.create({
},
})
export default FocusClasses
declare module '@tiptap/core' {
interface AllExtensions {
FocusClasses: typeof FocusClasses,

View File

@ -0,0 +1,5 @@
import { FocusClasses } from './focus'
export * from './focus'
export default FocusClasses

View File

@ -5,7 +5,7 @@ type FontFamilyOptions = {
types: string[],
}
const FontFamily = Extension.create({
export const FontFamily = Extension.create({
name: 'fontFamily',
defaultOptions: <FontFamilyOptions>{
@ -60,8 +60,6 @@ const FontFamily = Extension.create({
},
})
export default FontFamily
declare module '@tiptap/core' {
interface AllExtensions {
FontFamily: typeof FontFamily,

View File

@ -0,0 +1,5 @@
import { FontFamily } from './font-family'
export * from './font-family'
export default FontFamily

View File

@ -1,7 +1,7 @@
import { Extension } from '@tiptap/core'
import { gapCursor } from 'prosemirror-gapcursor'
const Gapcursor = Extension.create({
export const Gapcursor = Extension.create({
name: 'gapCursor',
addProseMirrorPlugins() {
@ -11,8 +11,6 @@ const Gapcursor = Extension.create({
},
})
export default Gapcursor
declare module '@tiptap/core' {
interface AllExtensions {
Gapcursor: typeof Gapcursor,

View File

@ -0,0 +1,5 @@
import { Gapcursor } from './gapcursor'
export * from './gapcursor'
export default Gapcursor

View File

@ -7,7 +7,7 @@ export interface HardBreakOptions {
},
}
const HardBreak = Node.create({
export const HardBreak = Node.create({
name: 'hardBreak',
defaultOptions: <HardBreakOptions>{
@ -59,8 +59,6 @@ const HardBreak = Node.create({
},
})
export default HardBreak
declare module '@tiptap/core' {
interface AllExtensions {
HardBreak: typeof HardBreak,

View File

@ -0,0 +1,5 @@
import { HardBreak } from './hard-break'
export * from './hard-break'
export default HardBreak

View File

@ -10,7 +10,7 @@ export interface HeadingOptions {
},
}
const Heading = Node.create({
export const Heading = Node.create({
name: 'heading',
defaultOptions: <HeadingOptions>{
@ -91,8 +91,6 @@ const Heading = Node.create({
},
})
export default Heading
declare module '@tiptap/core' {
interface AllExtensions {
Heading: typeof Heading,

View File

@ -0,0 +1,5 @@
import { Heading } from './heading'
export * from './heading'
export default Heading

View File

@ -16,7 +16,7 @@ export interface HighlightOptions {
export const inputRegex = /(?:^|\s)((?:==)((?:[^~]+))(?:==))$/gm
export const pasteRegex = /(?:^|\s)((?:==)((?:[^~]+))(?:==))/gm
const Highlight = Mark.create({
export const Highlight = Mark.create({
name: 'highlight',
defaultOptions: <HighlightOptions>{
@ -105,8 +105,6 @@ const Highlight = Mark.create({
},
})
export default Highlight
declare module '@tiptap/core' {
interface AllExtensions {
Highlight: typeof Highlight,

View File

@ -0,0 +1,5 @@
import { Highlight } from './highlight'
export * from './highlight'
export default Highlight

View File

@ -6,7 +6,7 @@ export interface HistoryOptions {
newGroupDelay: number,
}
const History = Extension.create({
export const History = Extension.create({
name: 'history',
defaultOptions: <HistoryOptions>{
@ -46,8 +46,6 @@ const History = Extension.create({
},
})
export default History
declare module '@tiptap/core' {
interface AllExtensions {
History: typeof History,

View File

@ -0,0 +1,5 @@
import { History } from './history'
export * from './history'
export default History

View File

@ -11,7 +11,7 @@ export interface HorizontalRuleOptions {
},
}
const HorizontalRule = Node.create({
export const HorizontalRule = Node.create({
name: 'horizontalRule',
defaultOptions: <HorizontalRuleOptions>{
@ -52,8 +52,6 @@ const HorizontalRule = Node.create({
},
})
export default HorizontalRule
declare module '@tiptap/core' {
interface AllExtensions {
HorizontalRule: typeof HorizontalRule,

View File

@ -0,0 +1,5 @@
import { HorizontalRule } from './horizontal-rule'
export * from './horizontal-rule'
export default HorizontalRule

View File

@ -14,7 +14,7 @@ export interface ImageOptions {
export const inputRegex = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/
const Image = Node.create({
export const Image = Node.create({
name: 'image',
defaultOptions: <ImageOptions>{
@ -87,8 +87,6 @@ const Image = Node.create({
},
})
export default Image
declare module '@tiptap/core' {
interface AllExtensions {
Image: typeof Image,

View File

@ -0,0 +1,5 @@
import { Image } from './image'
export * from './image'
export default Image

View File

@ -0,0 +1,5 @@
import { Italic } from './italic'
export * from './italic'
export default Italic

View File

@ -17,7 +17,7 @@ export const starPasteRegex = /(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/gm
export const underscoreInputRegex = /(?:^|\s)((?:_)((?:[^_]+))(?:_))$/gm
export const underscorePasteRegex = /(?:^|\s)((?:_)((?:[^_]+))(?:_))/gm
const Italic = Mark.create({
export const Italic = Mark.create({
name: 'italic',
defaultOptions: <ItalicOptions>{
@ -87,8 +87,6 @@ const Italic = Mark.create({
},
})
export default Italic
declare module '@tiptap/core' {
interface AllExtensions {
Italic: typeof Italic,

View File

@ -0,0 +1,5 @@
import { Link } from './link'
export * from './link'
export default Link

View File

@ -16,7 +16,7 @@ export interface LinkOptions {
export const pasteRegex = /https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi
export const pasteRegexWithBrackets = /(?:\()https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/()]*)(?:\))/gi
const Link = Mark.create({
export const Link = Mark.create({
name: 'link',
inclusive: false,
@ -106,8 +106,6 @@ const Link = Mark.create({
},
})
export default Link
declare module '@tiptap/core' {
interface AllExtensions {
Link: typeof Link,

View File

@ -0,0 +1,5 @@
import { ListItem } from './list-item'
export * from './list-item'
export default ListItem

View File

@ -6,7 +6,7 @@ export interface ListItemOptions {
},
}
const ListItem = Node.create({
export const ListItem = Node.create({
name: 'listItem',
defaultOptions: <ListItemOptions>{
@ -38,8 +38,6 @@ const ListItem = Node.create({
},
})
export default ListItem
declare module '@tiptap/core' {
interface AllExtensions {
ListItem: typeof ListItem,

View File

@ -0,0 +1,5 @@
import { OrderedList } from './ordered-list'
export * from './ordered-list'
export default OrderedList

View File

@ -9,7 +9,7 @@ export interface OrderedListOptions {
export const inputRegex = /^(\d+)\.\s$/
const OrderedList = Node.create({
export const OrderedList = Node.create({
name: 'orderedList',
defaultOptions: <OrderedListOptions>{
@ -78,8 +78,6 @@ const OrderedList = Node.create({
},
})
export default OrderedList
declare module '@tiptap/core' {
interface AllExtensions {
OrderedList: typeof OrderedList,

View File

@ -0,0 +1,5 @@
import { Paragraph } from './paragraph'
export * from './paragraph'
export default Paragraph

View File

@ -6,7 +6,7 @@ export interface ParagraphOptions {
},
}
const Paragraph = Node.create({
export const Paragraph = Node.create({
name: 'paragraph',
defaultOptions: <ParagraphOptions>{
@ -45,8 +45,6 @@ const Paragraph = Node.create({
},
})
export default Paragraph
declare module '@tiptap/core' {
interface AllExtensions {
Paragraph: typeof Paragraph,

View File

@ -0,0 +1,5 @@
import { Strike } from './strike'
export * from './strike'
export default Strike

View File

@ -15,7 +15,7 @@ export interface StrikeOptions {
export const inputRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm
export const pasteRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/gm
const Strike = Mark.create({
export const Strike = Mark.create({
name: 'strike',
defaultOptions: <StrikeOptions>{
@ -85,8 +85,6 @@ const Strike = Mark.create({
},
})
export default Strike
declare module '@tiptap/core' {
interface AllExtensions {
Strike: typeof Strike,

View File

@ -0,0 +1,5 @@
import { TaskItem } from './task-item'
export * from './task-item'
export default TaskItem

View File

@ -10,7 +10,7 @@ export interface TaskItemOptions {
export const inputRegex = /^\s*(\[([ |x])\])\s$/
const TaskItem = Node.create({
export const TaskItem = Node.create({
name: 'taskItem',
defaultOptions: <TaskItemOptions>{
@ -139,8 +139,6 @@ const TaskItem = Node.create({
},
})
export default TaskItem
declare module '@tiptap/core' {
interface AllExtensions {
TaskItem: typeof TaskItem,

View File

@ -0,0 +1,5 @@
import { TaskList } from './task-list'
export * from './task-list'
export default TaskList

View File

@ -6,7 +6,7 @@ export interface TaskListOptions {
},
}
const TaskList = Node.create({
export const TaskList = Node.create({
name: 'taskList',
defaultOptions: <TaskListOptions>{
@ -48,8 +48,6 @@ const TaskList = Node.create({
},
})
export default TaskList
declare module '@tiptap/core' {
interface AllExtensions {
TaskList: typeof TaskList,

View File

@ -0,0 +1,5 @@
import { TextAlign } from './text-align'
export * from './text-align'
export default TextAlign

View File

@ -6,7 +6,7 @@ type TextAlignOptions = {
defaultAlignment: string,
}
const TextAlign = Extension.create({
export const TextAlign = Extension.create({
name: 'textAlign',
defaultOptions: <TextAlignOptions>{
@ -71,8 +71,6 @@ const TextAlign = Extension.create({
},
})
export default TextAlign
declare module '@tiptap/core' {
interface AllExtensions {
TextAlign: typeof TextAlign,

View File

@ -0,0 +1,5 @@
import { TextStyle } from './text-style'
export * from './text-style'
export default TextStyle

View File

@ -11,7 +11,7 @@ export interface TextStyleOptions {
},
}
const TextStyle = Mark.create({
export const TextStyle = Mark.create({
name: 'textStyle',
defaultOptions: <TextStyleOptions>{
@ -59,8 +59,6 @@ const TextStyle = Mark.create({
})
export default TextStyle
declare module '@tiptap/core' {
interface AllExtensions {
TextStyle: typeof TextStyle,

View File

@ -0,0 +1,5 @@
import { Text } from './text'
export * from './text'
export default Text

View File

@ -1,12 +1,10 @@
import { Node } from '@tiptap/core'
const Text = Node.create({
export const Text = Node.create({
name: 'text',
group: 'inline',
})
export default Text
declare module '@tiptap/core' {
interface AllExtensions {
Text: typeof Text,

View File

@ -0,0 +1,5 @@
import { Typography } from './typography'
export * from './typography'
export default Typography

View File

@ -20,7 +20,7 @@ export const laquo = new InputRule(/<<$/, '«')
export const raquo = new InputRule(/>>$/, '»')
export const multiplication = new InputRule(/\d+\s?([*x])\s?\d+$/, '×')
const Typography = Extension.create({
export const Typography = Extension.create({
name: 'typography',
addInputRules() {
@ -45,8 +45,6 @@ const Typography = Extension.create({
},
})
export default Typography
declare module '@tiptap/core' {
interface AllExtensions {
Typography: typeof Typography,

View File

@ -0,0 +1,5 @@
import { Underline } from './underline'
export * from './underline'
export default Underline

View File

@ -6,7 +6,7 @@ export interface UnderlineOptions {
},
}
const Underline = Mark.create({
export const Underline = Mark.create({
name: 'underline',
defaultOptions: <UnderlineOptions>{
@ -58,8 +58,6 @@ const Underline = Mark.create({
},
})
export default Underline
declare module '@tiptap/core' {
interface AllExtensions {
Underline: typeof Underline,