extension name is required now

This commit is contained in:
Philipp Kühn
2020-12-02 09:44:46 +01:00
parent 143b309bdf
commit 88f89df479
13 changed files with 25 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ export interface ExtensionConfig<Options = any, Commands = {}> {
/**
* Name
*/
name?: string,
name: string,
/**
* Default options

View File

@@ -32,6 +32,8 @@ import * as wrapIn from '../commands/wrapIn'
import * as wrapInList from '../commands/wrapInList'
export const Commands = Extension.create({
name: 'commands',
addCommands() {
return {
...blur,

View File

@@ -2,6 +2,8 @@ import { Plugin, PluginKey } from 'prosemirror-state'
import { Extension } from '../Extension'
export const Editable = Extension.create({
name: 'editable',
addProseMirrorPlugins() {
return [
new Plugin({

View File

@@ -2,6 +2,8 @@ import { Plugin, PluginKey } from 'prosemirror-state'
import { Extension } from '../Extension'
export const FocusEvents = Extension.create({
name: 'focusEvents',
addProseMirrorPlugins() {
const { editor } = this

View File

@@ -13,6 +13,8 @@ import { undoInputRule } from 'prosemirror-inputrules'
import { Extension } from '../Extension'
export const Keymap = Extension.create({
name: 'keymap',
addKeyboardShortcuts() {
const handleBackspace = () => this.editor.commands.first(({ state, dispatch }) => [
() => undoInputRule(state, dispatch),

View File

@@ -18,6 +18,8 @@ const awarenessStatesToArray = (states: Map<number, { [key: string]: any }>) =>
}
const CollaborationCursor = Extension.create({
name: 'collaborationCursor',
defaultOptions: <CollaborationCursorOptions>{
provider: null,
user: {

View File

@@ -11,6 +11,8 @@ export interface CollaborationOptions {
}
const Collaboration = Extension.create({
name: 'collaboration',
defaultOptions: <CollaborationOptions>{
provider: null,
},

View File

@@ -8,6 +8,8 @@ export interface DropcursorOptions {
}
const Dropcursor = Extension.create({
name: 'dropCursor',
defaultOptions: <DropcursorOptions>{
color: 'black',
width: 1,

View File

@@ -8,6 +8,8 @@ export interface FocusOptions {
}
const FocusClasses = Extension.create({
name: 'focus',
defaultOptions: <FocusOptions>{
className: 'has-focus',
nested: false,

View File

@@ -6,6 +6,8 @@ type FontFamilyOptions = {
}
const FontFamily = Extension.create({
name: 'fontFamily',
defaultOptions: <FontFamilyOptions>{
types: ['textStyle'],
},

View File

@@ -2,6 +2,8 @@ import { Extension } from '@tiptap/core'
import { gapCursor } from 'prosemirror-gapcursor'
const Gapcursor = Extension.create({
name: 'gapCursor',
addProseMirrorPlugins() {
return [
gapCursor(),

View File

@@ -7,6 +7,8 @@ type TextAlignOptions = {
}
const TextAlign = Extension.create({
name: 'textAlign',
defaultOptions: <TextAlignOptions>{
types: ['heading', 'paragraph'],
alignments: ['left', 'center', 'right', 'justify'],

View File

@@ -21,6 +21,8 @@ export const raquo = new InputRule(/>>$/, '»')
export const multiplication = new InputRule(/\d+\s?([*x])\s?\d+$/, '×')
const Typography = Extension.create({
name: 'typography',
addInputRules() {
return [
emDash,