fix more errors
This commit is contained in:
@@ -95,7 +95,7 @@ module.exports = function (api) {
|
|||||||
.test(/\.tsx?$/)
|
.test(/\.tsx?$/)
|
||||||
.use()
|
.use()
|
||||||
.loader('ts-loader')
|
.loader('ts-loader')
|
||||||
.options({ transpileOnly: true, appendTsSuffixTo: [/\.vue$/] })
|
.options({ transpileOnly: false, appendTsSuffixTo: [/\.vue$/] })
|
||||||
|
|
||||||
config.module
|
config.module
|
||||||
.rule('jsx')
|
.rule('jsx')
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { MarkType, NodeType } from 'prosemirror-model'
|
|
||||||
import { Plugin } from 'prosemirror-state'
|
import { Plugin } from 'prosemirror-state'
|
||||||
import { Editor } from './Editor'
|
import { Editor } from './Editor'
|
||||||
import { GlobalAttributes } from './types'
|
import { GlobalAttributes } from './types'
|
||||||
@@ -27,7 +26,6 @@ export interface ExtensionSpec<Options = {}, Commands = {}> {
|
|||||||
addCommands?: (this: {
|
addCommands?: (this: {
|
||||||
options: Options,
|
options: Options,
|
||||||
editor: Editor,
|
editor: Editor,
|
||||||
type: NodeType | MarkType,
|
|
||||||
}) => Commands,
|
}) => Commands,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +34,6 @@ export interface ExtensionSpec<Options = {}, Commands = {}> {
|
|||||||
addKeyboardShortcuts?: (this: {
|
addKeyboardShortcuts?: (this: {
|
||||||
options: Options,
|
options: Options,
|
||||||
editor: Editor,
|
editor: Editor,
|
||||||
type: NodeType | MarkType,
|
|
||||||
}) => {
|
}) => {
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
},
|
},
|
||||||
@@ -47,7 +44,6 @@ export interface ExtensionSpec<Options = {}, Commands = {}> {
|
|||||||
addInputRules?: (this: {
|
addInputRules?: (this: {
|
||||||
options: Options,
|
options: Options,
|
||||||
editor: Editor,
|
editor: Editor,
|
||||||
// type: NodeType | MarkType,
|
|
||||||
}) => any[],
|
}) => any[],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,7 +52,6 @@ export interface ExtensionSpec<Options = {}, Commands = {}> {
|
|||||||
addPasteRules?: (this: {
|
addPasteRules?: (this: {
|
||||||
options: Options,
|
options: Options,
|
||||||
editor: Editor,
|
editor: Editor,
|
||||||
type: NodeType | MarkType,
|
|
||||||
}) => any[],
|
}) => any[],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,7 +60,6 @@ export interface ExtensionSpec<Options = {}, Commands = {}> {
|
|||||||
addProseMirrorPlugins?: (this: {
|
addProseMirrorPlugins?: (this: {
|
||||||
options: Options,
|
options: Options,
|
||||||
editor: Editor,
|
editor: Editor,
|
||||||
type: NodeType | MarkType,
|
|
||||||
}) => Plugin[],
|
}) => Plugin[],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import {
|
|||||||
} from 'prosemirror-model'
|
} from 'prosemirror-model'
|
||||||
import { Plugin } from 'prosemirror-state'
|
import { Plugin } from 'prosemirror-state'
|
||||||
import { ExtensionSpec, defaultExtension } from './Extension'
|
import { ExtensionSpec, defaultExtension } from './Extension'
|
||||||
import { Attributes } from './types'
|
import { Attributes, Overwrite } from './types'
|
||||||
import { Editor } from './Editor'
|
import { Editor } from './Editor'
|
||||||
|
|
||||||
export interface MarkExtensionSpec<Options = {}, Commands = {}> extends ExtensionSpec<Options, Commands> {
|
export interface MarkExtensionSpec<Options = {}, Commands = {}> extends Overwrite<ExtensionSpec<Options, Commands>, {
|
||||||
/**
|
/**
|
||||||
* Inclusive
|
* Inclusive
|
||||||
*/
|
*/
|
||||||
@@ -104,7 +104,7 @@ export interface MarkExtensionSpec<Options = {}, Commands = {}> extends Extensio
|
|||||||
editor: Editor,
|
editor: Editor,
|
||||||
type: MarkType,
|
type: MarkType,
|
||||||
}) => Plugin[],
|
}) => Plugin[],
|
||||||
}
|
}> {}
|
||||||
|
|
||||||
export type MarkExtension = Required<Omit<MarkExtensionSpec, 'defaultOptions'> & {
|
export type MarkExtension = Required<Omit<MarkExtensionSpec, 'defaultOptions'> & {
|
||||||
type: string,
|
type: string,
|
||||||
@@ -122,7 +122,7 @@ const defaultMark: MarkExtension = {
|
|||||||
group: null,
|
group: null,
|
||||||
spanning: null,
|
spanning: null,
|
||||||
parseHTML: () => null,
|
parseHTML: () => null,
|
||||||
renderHTML: () => null,
|
renderHTML: () => '',
|
||||||
addAttributes: () => ({}),
|
addAttributes: () => ({}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import {
|
|||||||
} from 'prosemirror-model'
|
} from 'prosemirror-model'
|
||||||
import { Plugin } from 'prosemirror-state'
|
import { Plugin } from 'prosemirror-state'
|
||||||
import { ExtensionSpec, defaultExtension } from './Extension'
|
import { ExtensionSpec, defaultExtension } from './Extension'
|
||||||
import { Attributes } from './types'
|
import { Attributes, Overwrite } from './types'
|
||||||
import { Editor } from './Editor'
|
import { Editor } from './Editor'
|
||||||
|
|
||||||
export interface NodeExtensionSpec<Options = {}, Commands = {}> extends ExtensionSpec<Options, Commands> {
|
export interface NodeExtensionSpec<Options = {}, Commands = {}> extends Overwrite<ExtensionSpec<Options, Commands>, {
|
||||||
/**
|
/**
|
||||||
* TopNode
|
* TopNode
|
||||||
*/
|
*/
|
||||||
@@ -139,7 +139,7 @@ export interface NodeExtensionSpec<Options = {}, Commands = {}> extends Extensio
|
|||||||
editor: Editor,
|
editor: Editor,
|
||||||
type: NodeType,
|
type: NodeType,
|
||||||
}) => Plugin[],
|
}) => Plugin[],
|
||||||
}
|
}> {}
|
||||||
|
|
||||||
export type NodeExtension = Required<Omit<NodeExtensionSpec, 'defaultOptions'> & {
|
export type NodeExtension = Required<Omit<NodeExtensionSpec, 'defaultOptions'> & {
|
||||||
type: string,
|
type: string,
|
||||||
@@ -164,7 +164,7 @@ const defaultNode: NodeExtension = {
|
|||||||
defining: null,
|
defining: null,
|
||||||
isolating: null,
|
isolating: null,
|
||||||
parseHTML: () => null,
|
parseHTML: () => null,
|
||||||
renderHTML: () => null,
|
renderHTML: () => '',
|
||||||
addAttributes: () => ({}),
|
addAttributes: () => ({}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export type Attributes = {
|
|||||||
export type ExtensionAttribute = {
|
export type ExtensionAttribute = {
|
||||||
type: string,
|
type: string,
|
||||||
name: string,
|
name: string,
|
||||||
attribute: Attribute,
|
attribute: Required<Attribute>,
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GlobalAttributes = {
|
export type GlobalAttributes = {
|
||||||
@@ -33,3 +33,8 @@ export type PickValue<T, K extends keyof T> = T[K]
|
|||||||
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I)=>void)
|
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I)=>void)
|
||||||
? I
|
? I
|
||||||
: never
|
: never
|
||||||
|
|
||||||
|
export type Diff<T extends keyof any, U extends keyof any> =
|
||||||
|
({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]
|
||||||
|
|
||||||
|
export type Overwrite<T, U> = Pick<T, Diff<keyof T, keyof U>> & U;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export interface FocusOptions {
|
|||||||
nested: boolean,
|
nested: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
const Focus = createExtension({
|
const FocusClasses = createExtension({
|
||||||
defaultOptions: <FocusOptions>{
|
defaultOptions: <FocusOptions>{
|
||||||
className: 'has-focus',
|
className: 'has-focus',
|
||||||
nested: false,
|
nested: false,
|
||||||
@@ -47,10 +47,10 @@ const Focus = createExtension({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export default Focus
|
export default FocusClasses
|
||||||
|
|
||||||
declare module '@tiptap/core/src/Editor' {
|
declare module '@tiptap/core/src/Editor' {
|
||||||
interface AllExtensions {
|
interface AllExtensions {
|
||||||
Focus: typeof Focus,
|
FocusClasses: typeof FocusClasses,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"./shims/vue.d.ts"
|
"./shims/vue.d.ts"
|
||||||
],
|
],
|
||||||
|
"filesGlob": [
|
||||||
|
"packages/**/*.ts"
|
||||||
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
Reference in New Issue
Block a user