extension name is required now
This commit is contained in:
@@ -7,7 +7,7 @@ export interface ExtensionConfig<Options = any, Commands = {}> {
|
||||
/**
|
||||
* Name
|
||||
*/
|
||||
name?: string,
|
||||
name: string,
|
||||
|
||||
/**
|
||||
* Default options
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -18,6 +18,8 @@ const awarenessStatesToArray = (states: Map<number, { [key: string]: any }>) =>
|
||||
}
|
||||
|
||||
const CollaborationCursor = Extension.create({
|
||||
name: 'collaborationCursor',
|
||||
|
||||
defaultOptions: <CollaborationCursorOptions>{
|
||||
provider: null,
|
||||
user: {
|
||||
|
||||
@@ -11,6 +11,8 @@ export interface CollaborationOptions {
|
||||
}
|
||||
|
||||
const Collaboration = Extension.create({
|
||||
name: 'collaboration',
|
||||
|
||||
defaultOptions: <CollaborationOptions>{
|
||||
provider: null,
|
||||
},
|
||||
|
||||
@@ -8,6 +8,8 @@ export interface DropcursorOptions {
|
||||
}
|
||||
|
||||
const Dropcursor = Extension.create({
|
||||
name: 'dropCursor',
|
||||
|
||||
defaultOptions: <DropcursorOptions>{
|
||||
color: 'black',
|
||||
width: 1,
|
||||
|
||||
@@ -8,6 +8,8 @@ export interface FocusOptions {
|
||||
}
|
||||
|
||||
const FocusClasses = Extension.create({
|
||||
name: 'focus',
|
||||
|
||||
defaultOptions: <FocusOptions>{
|
||||
className: 'has-focus',
|
||||
nested: false,
|
||||
|
||||
@@ -6,6 +6,8 @@ type FontFamilyOptions = {
|
||||
}
|
||||
|
||||
const FontFamily = Extension.create({
|
||||
name: 'fontFamily',
|
||||
|
||||
defaultOptions: <FontFamilyOptions>{
|
||||
types: ['textStyle'],
|
||||
},
|
||||
|
||||
@@ -2,6 +2,8 @@ import { Extension } from '@tiptap/core'
|
||||
import { gapCursor } from 'prosemirror-gapcursor'
|
||||
|
||||
const Gapcursor = Extension.create({
|
||||
name: 'gapCursor',
|
||||
|
||||
addProseMirrorPlugins() {
|
||||
return [
|
||||
gapCursor(),
|
||||
|
||||
@@ -7,6 +7,8 @@ type TextAlignOptions = {
|
||||
}
|
||||
|
||||
const TextAlign = Extension.create({
|
||||
name: 'textAlign',
|
||||
|
||||
defaultOptions: <TextAlignOptions>{
|
||||
types: ['heading', 'paragraph'],
|
||||
alignments: ['left', 'center', 'right', 'justify'],
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user