mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 17:43:49 +08:00
Merge branch 'main' of github.com:ueberdosis/tiptap
This commit is contained in:
commit
bb56d98982
@ -18,6 +18,7 @@
|
|||||||
border: 1px solid #000;
|
border: 1px solid #000;
|
||||||
border-radius: 0.4rem;
|
border-radius: 0.4rem;
|
||||||
padding: 0.1rem 0.3rem;
|
padding: 0.1rem 0.3rem;
|
||||||
|
box-decoration-break: clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
.character-count {
|
.character-count {
|
||||||
|
@ -118,6 +118,7 @@ export default {
|
|||||||
border: 1px solid #000;
|
border: 1px solid #000;
|
||||||
border-radius: 0.4rem;
|
border-radius: 0.4rem;
|
||||||
padding: 0.1rem 0.3rem;
|
padding: 0.1rem 0.3rem;
|
||||||
|
box-decoration-break: clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
.character-count {
|
.character-count {
|
||||||
|
@ -59,20 +59,22 @@ declare module '@tiptap/core' {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CollaborationAnnotation = Extension.create({
|
export const CollaborationAnnotation = Extension.create<AnnotationOptions>({
|
||||||
name: 'annotation',
|
name: 'annotation',
|
||||||
|
|
||||||
priority: 1000,
|
priority: 1000,
|
||||||
|
|
||||||
defaultOptions: <AnnotationOptions>{
|
addOptions() {
|
||||||
HTMLAttributes: {
|
return {
|
||||||
class: 'annotation',
|
HTMLAttributes: {
|
||||||
},
|
class: 'annotation',
|
||||||
onUpdate: decorations => decorations,
|
},
|
||||||
document: null,
|
onUpdate: decorations => decorations,
|
||||||
field: 'annotations',
|
document: null,
|
||||||
map: null,
|
field: 'annotations',
|
||||||
instance: '',
|
map: null,
|
||||||
|
instance: '',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onCreate() {
|
onCreate() {
|
||||||
|
@ -2,16 +2,17 @@ import { Extension } from '@tiptap/core'
|
|||||||
import Suggestion from '@tiptap/suggestion'
|
import Suggestion from '@tiptap/suggestion'
|
||||||
|
|
||||||
export default Extension.create({
|
export default Extension.create({
|
||||||
name: 'mention',
|
name: 'commands',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
suggestion: {
|
return {
|
||||||
char: '/',
|
suggestion: {
|
||||||
startOfLine: false,
|
char: '/',
|
||||||
command: ({ editor, range, props }) => {
|
command: ({ editor, range, props }) => {
|
||||||
props.command({ editor, range })
|
props.command({ editor, range })
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addProseMirrorPlugins() {
|
addProseMirrorPlugins() {
|
||||||
|
@ -54,5 +54,6 @@ export default {
|
|||||||
border: 1px solid #000;
|
border: 1px solid #000;
|
||||||
border-radius: 0.4rem;
|
border-radius: 0.4rem;
|
||||||
padding: 0.1rem 0.3rem;
|
padding: 0.1rem 0.3rem;
|
||||||
|
box-decoration-break: clone;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -17,8 +17,10 @@ export default Node.create<DetailsSummaryOptions>({
|
|||||||
|
|
||||||
isolating: true,
|
isolating: true,
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
parseHTML() {
|
parseHTML() {
|
||||||
|
@ -34,8 +34,10 @@ export default Node.create<DetailsOptions>({
|
|||||||
|
|
||||||
// defining: true,
|
// defining: true,
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
parseHTML() {
|
parseHTML() {
|
||||||
|
@ -18,18 +18,20 @@ declare module '@tiptap/core' {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Node.create({
|
export default Node.create<IframeOptions>({
|
||||||
name: 'iframe',
|
name: 'iframe',
|
||||||
|
|
||||||
group: 'block',
|
group: 'block',
|
||||||
|
|
||||||
atom: true,
|
atom: true,
|
||||||
|
|
||||||
defaultOptions: <IframeOptions>{
|
addOptions() {
|
||||||
allowFullscreen: true,
|
return {
|
||||||
HTMLAttributes: {
|
allowFullscreen: true,
|
||||||
class: 'iframe-wrapper',
|
HTMLAttributes: {
|
||||||
},
|
class: 'iframe-wrapper',
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addAttributes() {
|
addAttributes() {
|
||||||
|
@ -41,8 +41,10 @@ export const inputRegex = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/
|
|||||||
export const Figure = Node.create<FigureOptions>({
|
export const Figure = Node.create<FigureOptions>({
|
||||||
name: 'figure',
|
name: 'figure',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
group: 'block',
|
group: 'block',
|
||||||
|
@ -3,8 +3,10 @@ import { Node, mergeAttributes } from '@tiptap/core'
|
|||||||
export const Figcaption = Node.create({
|
export const Figcaption = Node.create({
|
||||||
name: 'figcaption',
|
name: 'figcaption',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
content: 'inline*',
|
content: 'inline*',
|
||||||
|
@ -4,8 +4,10 @@ import { Plugin } from 'prosemirror-state'
|
|||||||
export const Figure = Node.create({
|
export const Figure = Node.create({
|
||||||
name: 'figure',
|
name: 'figure',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
group: 'block',
|
group: 'block',
|
||||||
|
@ -39,11 +39,13 @@ export interface LinterOptions {
|
|||||||
plugins: Array<typeof LinterPlugin>,
|
plugins: Array<typeof LinterPlugin>,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Linter = Extension.create({
|
export const Linter = Extension.create<LinterOptions>({
|
||||||
name: 'linter',
|
name: 'linter',
|
||||||
|
|
||||||
defaultOptions: <LinterOptions>{
|
addOptions() {
|
||||||
plugins: [],
|
return {
|
||||||
|
plugins: [],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addProseMirrorPlugins() {
|
addProseMirrorPlugins() {
|
||||||
|
@ -20,11 +20,13 @@ export interface TrailingNodeOptions {
|
|||||||
export const TrailingNode = Extension.create<TrailingNodeOptions>({
|
export const TrailingNode = Extension.create<TrailingNodeOptions>({
|
||||||
name: 'trailingNode',
|
name: 'trailingNode',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
node: 'paragraph',
|
return {
|
||||||
notAfter: [
|
node: 'paragraph',
|
||||||
'paragraph',
|
notAfter: [
|
||||||
],
|
'paragraph',
|
||||||
|
],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addProseMirrorPlugins() {
|
addProseMirrorPlugins() {
|
||||||
|
@ -63,5 +63,6 @@ export default {
|
|||||||
border: 1px solid #000;
|
border: 1px solid #000;
|
||||||
border-radius: 0.4rem;
|
border-radius: 0.4rem;
|
||||||
padding: 0.1rem 0.3rem;
|
padding: 0.1rem 0.3rem;
|
||||||
|
box-decoration-break: clone;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -71,9 +71,11 @@ All settings can be configured through the extension anyway, but if you want to
|
|||||||
import Heading from '@tiptap/extension-heading'
|
import Heading from '@tiptap/extension-heading'
|
||||||
|
|
||||||
const CustomHeading = Heading.extend({
|
const CustomHeading = Heading.extend({
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
...Heading.options,
|
return {
|
||||||
levels: [1, 2, 3],
|
...this.parent?.(),
|
||||||
|
levels: [1, 2, 3],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
@ -35,7 +35,7 @@ Okay, you’ve got your menu. But how do you wire things up?
|
|||||||
You’ve got the editor running already and want to add your first button. You need a `<button>` HTML tag with a click handler. Depending on your setup, that can look like the following example:
|
You’ve got the editor running already and want to add your first button. You need a `<button>` HTML tag with a click handler. Depending on your setup, that can look like the following example:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<button onclick="editor.chain().toggleBold().focus().run()">
|
<button onclick="editor.chain().focus().toggleBold().run()">
|
||||||
Bold
|
Bold
|
||||||
</button>
|
</button>
|
||||||
```
|
```
|
||||||
@ -63,7 +63,7 @@ You have already seen the `focus()` command in the above example. When you click
|
|||||||
The editor provides an `isActive()` method to check if something is applied to the selected text already. In Vue.js you can toggle a CSS class with help of that function like that:
|
The editor provides an `isActive()` method to check if something is applied to the selected text already. In Vue.js you can toggle a CSS class with help of that function like that:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<button :class="{ 'is-active': editor.isActive('bold') }" @click="editor.chain().toggleBold().focus().run()">
|
<button :class="{ 'is-active': editor.isActive('bold') }" @click="editor.chain().focus().toggleBold().run()">
|
||||||
Bold
|
Bold
|
||||||
</button>
|
</button>
|
||||||
```
|
```
|
||||||
|
@ -26,8 +26,10 @@ export interface CustomExtensionOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const CustomExtension = Extension.create<CustomExtensionOptions>({
|
const CustomExtension = Extension.create<CustomExtensionOptions>({
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
awesomeness: 100,
|
return {
|
||||||
|
awesomeness: 100,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
@ -103,7 +103,7 @@ import { Node } from '@tiptap/core'
|
|||||||
|
|
||||||
const CustomExtension = Node.create({
|
const CustomExtension = Node.create({
|
||||||
name: 'custom_extension',
|
name: 'custom_extension',
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
…
|
…
|
||||||
},
|
},
|
||||||
addAttributes() {
|
addAttributes() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.129](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.128...@tiptap/core@2.0.0-beta.129) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/core
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.128](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.127...@tiptap/core@2.0.0-beta.128) (2021-10-25)
|
# [2.0.0-beta.128](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.127...@tiptap/core@2.0.0-beta.128) (2021-10-25)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/core",
|
"name": "@tiptap/core",
|
||||||
"description": "headless rich text editor",
|
"description": "headless rich text editor",
|
||||||
"version": "2.0.0-beta.128",
|
"version": "2.0.0-beta.129",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -36,13 +36,21 @@ declare module '@tiptap/core' {
|
|||||||
*/
|
*/
|
||||||
defaultOptions?: Options,
|
defaultOptions?: Options,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default Options
|
||||||
|
*/
|
||||||
|
addOptions?: (this: {
|
||||||
|
name: string,
|
||||||
|
parent: Exclude<ParentConfig<ExtensionConfig<Options, Storage>>['addOptions'], undefined>,
|
||||||
|
}) => Options,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Storage
|
* Default Storage
|
||||||
*/
|
*/
|
||||||
addStorage?: (this: {
|
addStorage?: (this: {
|
||||||
name: string,
|
name: string,
|
||||||
options: Options,
|
options: Options,
|
||||||
parent: ParentConfig<ExtensionConfig<Options, Storage>>['addGlobalAttributes'],
|
parent: Exclude<ParentConfig<ExtensionConfig<Options, Storage>>['addStorage'], undefined>,
|
||||||
}) => Storage,
|
}) => Storage,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -278,7 +286,24 @@ export class Extension<Options = any, Storage = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.name = this.config.name
|
this.name = this.config.name
|
||||||
|
|
||||||
|
if (config.defaultOptions) {
|
||||||
|
console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: remove `addOptions` fallback
|
||||||
this.options = this.config.defaultOptions
|
this.options = this.config.defaultOptions
|
||||||
|
|
||||||
|
if (this.config.addOptions) {
|
||||||
|
this.options = callOrReturn(getExtensionField<AnyConfig['addOptions']>(
|
||||||
|
this,
|
||||||
|
'addOptions',
|
||||||
|
{
|
||||||
|
name: this.name,
|
||||||
|
},
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
this.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
this.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
||||||
this,
|
this,
|
||||||
'addStorage',
|
'addStorage',
|
||||||
@ -286,7 +311,7 @@ export class Extension<Options = any, Storage = any> {
|
|||||||
name: this.name,
|
name: this.name,
|
||||||
options: this.options,
|
options: this.options,
|
||||||
},
|
},
|
||||||
))
|
)) || {}
|
||||||
}
|
}
|
||||||
|
|
||||||
static create<O = any, S = any>(config: Partial<ExtensionConfig<O, S>> = {}) {
|
static create<O = any, S = any>(config: Partial<ExtensionConfig<O, S>> = {}) {
|
||||||
@ -323,10 +348,25 @@ export class Extension<Options = any, Storage = any> {
|
|||||||
? extendedConfig.name
|
? extendedConfig.name
|
||||||
: extension.parent.name
|
: extension.parent.name
|
||||||
|
|
||||||
|
if (extendedConfig.defaultOptions) {
|
||||||
|
console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: remove `addOptions` fallback
|
||||||
extension.options = extendedConfig.defaultOptions
|
extension.options = extendedConfig.defaultOptions
|
||||||
? extendedConfig.defaultOptions
|
? extendedConfig.defaultOptions
|
||||||
: extension.parent.options
|
: extension.parent.options
|
||||||
|
|
||||||
|
if (extendedConfig.addOptions) {
|
||||||
|
extension.options = callOrReturn(getExtensionField<AnyConfig['addOptions']>(
|
||||||
|
extension,
|
||||||
|
'addOptions',
|
||||||
|
{
|
||||||
|
name: extension.name,
|
||||||
|
},
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
extension.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
extension.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
||||||
extension,
|
extension,
|
||||||
'addStorage',
|
'addStorage',
|
||||||
|
@ -42,13 +42,21 @@ declare module '@tiptap/core' {
|
|||||||
*/
|
*/
|
||||||
defaultOptions?: Options,
|
defaultOptions?: Options,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default Options
|
||||||
|
*/
|
||||||
|
addOptions?: (this: {
|
||||||
|
name: string,
|
||||||
|
parent: Exclude<ParentConfig<MarkConfig<Options, Storage>>['addOptions'], undefined>,
|
||||||
|
}) => Options,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Storage
|
* Default Storage
|
||||||
*/
|
*/
|
||||||
addStorage?: (this: {
|
addStorage?: (this: {
|
||||||
name: string,
|
name: string,
|
||||||
options: Options,
|
options: Options,
|
||||||
parent: ParentConfig<MarkConfig<Options, Storage>>['addGlobalAttributes'],
|
parent: Exclude<ParentConfig<MarkConfig<Options, Storage>>['addStorage'], undefined>,
|
||||||
}) => Storage,
|
}) => Storage,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -392,7 +400,24 @@ export class Mark<Options = any, Storage = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.name = this.config.name
|
this.name = this.config.name
|
||||||
|
|
||||||
|
if (config.defaultOptions) {
|
||||||
|
console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: remove `addOptions` fallback
|
||||||
this.options = this.config.defaultOptions
|
this.options = this.config.defaultOptions
|
||||||
|
|
||||||
|
if (this.config.addOptions) {
|
||||||
|
this.options = callOrReturn(getExtensionField<AnyConfig['addOptions']>(
|
||||||
|
this,
|
||||||
|
'addOptions',
|
||||||
|
{
|
||||||
|
name: this.name,
|
||||||
|
},
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
this.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
this.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
||||||
this,
|
this,
|
||||||
'addStorage',
|
'addStorage',
|
||||||
@ -400,7 +425,7 @@ export class Mark<Options = any, Storage = any> {
|
|||||||
name: this.name,
|
name: this.name,
|
||||||
options: this.options,
|
options: this.options,
|
||||||
},
|
},
|
||||||
))
|
)) || {}
|
||||||
}
|
}
|
||||||
|
|
||||||
static create<O = any, S = any>(config: Partial<MarkConfig<O, S>> = {}) {
|
static create<O = any, S = any>(config: Partial<MarkConfig<O, S>> = {}) {
|
||||||
@ -437,10 +462,25 @@ export class Mark<Options = any, Storage = any> {
|
|||||||
? extendedConfig.name
|
? extendedConfig.name
|
||||||
: extension.parent.name
|
: extension.parent.name
|
||||||
|
|
||||||
|
if (extendedConfig.defaultOptions) {
|
||||||
|
console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: remove `addOptions` fallback
|
||||||
extension.options = extendedConfig.defaultOptions
|
extension.options = extendedConfig.defaultOptions
|
||||||
? extendedConfig.defaultOptions
|
? extendedConfig.defaultOptions
|
||||||
: extension.parent.options
|
: extension.parent.options
|
||||||
|
|
||||||
|
if (extendedConfig.addOptions) {
|
||||||
|
extension.options = callOrReturn(getExtensionField<AnyConfig['addOptions']>(
|
||||||
|
extension,
|
||||||
|
'addOptions',
|
||||||
|
{
|
||||||
|
name: extension.name,
|
||||||
|
},
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
extension.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
extension.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
||||||
extension,
|
extension,
|
||||||
'addStorage',
|
'addStorage',
|
||||||
|
@ -42,13 +42,21 @@ declare module '@tiptap/core' {
|
|||||||
*/
|
*/
|
||||||
defaultOptions?: Options,
|
defaultOptions?: Options,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default Options
|
||||||
|
*/
|
||||||
|
addOptions?: (this: {
|
||||||
|
name: string,
|
||||||
|
parent: Exclude<ParentConfig<NodeConfig<Options, Storage>>['addOptions'], undefined>,
|
||||||
|
}) => Options,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Storage
|
* Default Storage
|
||||||
*/
|
*/
|
||||||
addStorage?: (this: {
|
addStorage?: (this: {
|
||||||
name: string,
|
name: string,
|
||||||
options: Options,
|
options: Options,
|
||||||
parent: ParentConfig<NodeConfig<Options, Storage>>['addGlobalAttributes'],
|
parent: Exclude<ParentConfig<NodeConfig<Options, Storage>>['addStorage'], undefined>,
|
||||||
}) => Storage,
|
}) => Storage,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -472,7 +480,24 @@ export class Node<Options = any, Storage = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.name = this.config.name
|
this.name = this.config.name
|
||||||
|
|
||||||
|
if (config.defaultOptions) {
|
||||||
|
console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: remove `addOptions` fallback
|
||||||
this.options = this.config.defaultOptions
|
this.options = this.config.defaultOptions
|
||||||
|
|
||||||
|
if (this.config.addOptions) {
|
||||||
|
this.options = callOrReturn(getExtensionField<AnyConfig['addOptions']>(
|
||||||
|
this,
|
||||||
|
'addOptions',
|
||||||
|
{
|
||||||
|
name: this.name,
|
||||||
|
},
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
this.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
this.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
||||||
this,
|
this,
|
||||||
'addStorage',
|
'addStorage',
|
||||||
@ -480,7 +505,7 @@ export class Node<Options = any, Storage = any> {
|
|||||||
name: this.name,
|
name: this.name,
|
||||||
options: this.options,
|
options: this.options,
|
||||||
},
|
},
|
||||||
))
|
)) || {}
|
||||||
}
|
}
|
||||||
|
|
||||||
static create<O = any, S = any>(config: Partial<NodeConfig<O, S>> = {}) {
|
static create<O = any, S = any>(config: Partial<NodeConfig<O, S>> = {}) {
|
||||||
@ -517,10 +542,25 @@ export class Node<Options = any, Storage = any> {
|
|||||||
? extendedConfig.name
|
? extendedConfig.name
|
||||||
: extension.parent.name
|
: extension.parent.name
|
||||||
|
|
||||||
|
if (extendedConfig.defaultOptions) {
|
||||||
|
console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: remove `addOptions` fallback
|
||||||
extension.options = extendedConfig.defaultOptions
|
extension.options = extendedConfig.defaultOptions
|
||||||
? extendedConfig.defaultOptions
|
? extendedConfig.defaultOptions
|
||||||
: extension.parent.options
|
: extension.parent.options
|
||||||
|
|
||||||
|
if (extendedConfig.addOptions) {
|
||||||
|
extension.options = callOrReturn(getExtensionField<AnyConfig['addOptions']>(
|
||||||
|
extension,
|
||||||
|
'addOptions',
|
||||||
|
{
|
||||||
|
name: extension.name,
|
||||||
|
},
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
extension.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
extension.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
|
||||||
extension,
|
extension,
|
||||||
'addStorage',
|
'addStorage',
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.20](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-blockquote@2.0.0-beta.19...@tiptap/extension-blockquote@2.0.0-beta.20) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-blockquote
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-blockquote@2.0.0-beta.18...@tiptap/extension-blockquote@2.0.0-beta.19) (2021-10-14)
|
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-blockquote@2.0.0-beta.18...@tiptap/extension-blockquote@2.0.0-beta.19) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-blockquote
|
**Note:** Version bump only for package @tiptap/extension-blockquote
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-blockquote",
|
"name": "@tiptap/extension-blockquote",
|
||||||
"description": "blockquote extension for tiptap",
|
"description": "blockquote extension for tiptap",
|
||||||
"version": "2.0.0-beta.19",
|
"version": "2.0.0-beta.20",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -29,8 +29,10 @@ export const Blockquote = Node.create<BlockquoteOptions>({
|
|||||||
|
|
||||||
name: 'blockquote',
|
name: 'blockquote',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
content: 'block*',
|
content: 'block*',
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.20](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bold@2.0.0-beta.19...@tiptap/extension-bold@2.0.0-beta.20) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-bold
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bold@2.0.0-beta.18...@tiptap/extension-bold@2.0.0-beta.19) (2021-10-14)
|
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bold@2.0.0-beta.18...@tiptap/extension-bold@2.0.0-beta.19) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-bold
|
**Note:** Version bump only for package @tiptap/extension-bold
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-bold",
|
"name": "@tiptap/extension-bold",
|
||||||
"description": "bold extension for tiptap",
|
"description": "bold extension for tiptap",
|
||||||
"version": "2.0.0-beta.19",
|
"version": "2.0.0-beta.20",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -36,8 +36,10 @@ export const underscorePasteRegex = /(?:^|\s)((?:__)((?:[^__]+))(?:__))/g
|
|||||||
export const Bold = Mark.create<BoldOptions>({
|
export const Bold = Mark.create<BoldOptions>({
|
||||||
name: 'bold',
|
name: 'bold',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
parseHTML() {
|
parseHTML() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.43](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bubble-menu@2.0.0-beta.42...@tiptap/extension-bubble-menu@2.0.0-beta.43) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-bubble-menu
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.42](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bubble-menu@2.0.0-beta.41...@tiptap/extension-bubble-menu@2.0.0-beta.42) (2021-10-14)
|
# [2.0.0-beta.42](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bubble-menu@2.0.0-beta.41...@tiptap/extension-bubble-menu@2.0.0-beta.42) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-bubble-menu
|
**Note:** Version bump only for package @tiptap/extension-bubble-menu
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-bubble-menu",
|
"name": "@tiptap/extension-bubble-menu",
|
||||||
"description": "bubble-menu extension for tiptap",
|
"description": "bubble-menu extension for tiptap",
|
||||||
"version": "2.0.0-beta.42",
|
"version": "2.0.0-beta.43",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -8,11 +8,13 @@ export type BubbleMenuOptions = Omit<BubbleMenuPluginProps, 'editor' | 'element'
|
|||||||
export const BubbleMenu = Extension.create<BubbleMenuOptions>({
|
export const BubbleMenu = Extension.create<BubbleMenuOptions>({
|
||||||
name: 'bubbleMenu',
|
name: 'bubbleMenu',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
element: null,
|
return {
|
||||||
tippyOptions: {},
|
element: null,
|
||||||
pluginKey: 'bubbleMenu',
|
tippyOptions: {},
|
||||||
shouldShow: null,
|
pluginKey: 'bubbleMenu',
|
||||||
|
shouldShow: null,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addProseMirrorPlugins() {
|
addProseMirrorPlugins() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bullet-list@2.0.0-beta.18...@tiptap/extension-bullet-list@2.0.0-beta.19) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-bullet-list
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.18](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bullet-list@2.0.0-beta.17...@tiptap/extension-bullet-list@2.0.0-beta.18) (2021-10-14)
|
# [2.0.0-beta.18](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bullet-list@2.0.0-beta.17...@tiptap/extension-bullet-list@2.0.0-beta.18) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-bullet-list
|
**Note:** Version bump only for package @tiptap/extension-bullet-list
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-bullet-list",
|
"name": "@tiptap/extension-bullet-list",
|
||||||
"description": "bullet list extension for tiptap",
|
"description": "bullet list extension for tiptap",
|
||||||
"version": "2.0.0-beta.18",
|
"version": "2.0.0-beta.19",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -20,8 +20,10 @@ export const inputRegex = /^\s*([-+*])\s$/
|
|||||||
export const BulletList = Node.create<BulletListOptions>({
|
export const BulletList = Node.create<BulletListOptions>({
|
||||||
name: 'bulletList',
|
name: 'bulletList',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
group: 'block list',
|
group: 'block list',
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.14](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-character-count@2.0.0-beta.13...@tiptap/extension-character-count@2.0.0-beta.14) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-character-count
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.13](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-character-count@2.0.0-beta.12...@tiptap/extension-character-count@2.0.0-beta.13) (2021-07-26)
|
# [2.0.0-beta.13](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-character-count@2.0.0-beta.12...@tiptap/extension-character-count@2.0.0-beta.13) (2021-07-26)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-character-count
|
**Note:** Version bump only for package @tiptap/extension-character-count
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-character-count",
|
"name": "@tiptap/extension-character-count",
|
||||||
"description": "font family extension for tiptap",
|
"description": "font family extension for tiptap",
|
||||||
"version": "2.0.0-beta.13",
|
"version": "2.0.0-beta.14",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -10,8 +10,10 @@ export interface CharacterCountOptions {
|
|||||||
export const CharacterCount = Extension.create<CharacterCountOptions>({
|
export const CharacterCount = Extension.create<CharacterCountOptions>({
|
||||||
name: 'characterCount',
|
name: 'characterCount',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
limit: 0,
|
return {
|
||||||
|
limit: 0,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addProseMirrorPlugins() {
|
addProseMirrorPlugins() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.49](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.48...@tiptap/extension-code-block-lowlight@2.0.0-beta.49) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-code-block-lowlight
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.48](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.47...@tiptap/extension-code-block-lowlight@2.0.0-beta.48) (2021-10-25)
|
# [2.0.0-beta.48](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.47...@tiptap/extension-code-block-lowlight@2.0.0-beta.48) (2021-10-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-code-block-lowlight
|
**Note:** Version bump only for package @tiptap/extension-code-block-lowlight
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-code-block-lowlight",
|
"name": "@tiptap/extension-code-block-lowlight",
|
||||||
"description": "code block extension for tiptap",
|
"description": "code block extension for tiptap",
|
||||||
"version": "2.0.0-beta.48",
|
"version": "2.0.0-beta.49",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@ -24,7 +24,7 @@
|
|||||||
"@tiptap/core": "^2.0.0-beta.1"
|
"@tiptap/core": "^2.0.0-beta.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tiptap/extension-code-block": "^2.0.0-beta.24",
|
"@tiptap/extension-code-block": "^2.0.0-beta.25",
|
||||||
"@types/lowlight": "^0.0.3",
|
"@types/lowlight": "^0.0.3",
|
||||||
"lowlight": "^1.20.0",
|
"lowlight": "^1.20.0",
|
||||||
"prosemirror-model": "^1.15.0",
|
"prosemirror-model": "^1.15.0",
|
||||||
|
@ -7,9 +7,11 @@ export interface CodeBlockLowlightOptions extends CodeBlockOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const CodeBlockLowlight = CodeBlock.extend<CodeBlockLowlightOptions>({
|
export const CodeBlockLowlight = CodeBlock.extend<CodeBlockLowlightOptions>({
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
...CodeBlock.options,
|
return {
|
||||||
lowlight,
|
...this.parent?.(),
|
||||||
|
lowlight,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addProseMirrorPlugins() {
|
addProseMirrorPlugins() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.25](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block@2.0.0-beta.24...@tiptap/extension-code-block@2.0.0-beta.25) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-code-block
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.24](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block@2.0.0-beta.23...@tiptap/extension-code-block@2.0.0-beta.24) (2021-10-14)
|
# [2.0.0-beta.24](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block@2.0.0-beta.23...@tiptap/extension-code-block@2.0.0-beta.24) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-code-block
|
**Note:** Version bump only for package @tiptap/extension-code-block
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-code-block",
|
"name": "@tiptap/extension-code-block",
|
||||||
"description": "code block extension for tiptap",
|
"description": "code block extension for tiptap",
|
||||||
"version": "2.0.0-beta.24",
|
"version": "2.0.0-beta.25",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -27,9 +27,11 @@ export const tildeInputRegex = /^~~~(?<language>[a-z]*)?[\s\n]$/
|
|||||||
export const CodeBlock = Node.create<CodeBlockOptions>({
|
export const CodeBlock = Node.create<CodeBlockOptions>({
|
||||||
name: 'codeBlock',
|
name: 'codeBlock',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
languageClassPrefix: 'language-',
|
return {
|
||||||
HTMLAttributes: {},
|
languageClassPrefix: 'language-',
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
content: 'text*',
|
content: 'text*',
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.21](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code@2.0.0-beta.20...@tiptap/extension-code@2.0.0-beta.21) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-code
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.20](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code@2.0.0-beta.19...@tiptap/extension-code@2.0.0-beta.20) (2021-10-14)
|
# [2.0.0-beta.20](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code@2.0.0-beta.19...@tiptap/extension-code@2.0.0-beta.20) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-code
|
**Note:** Version bump only for package @tiptap/extension-code
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-code",
|
"name": "@tiptap/extension-code",
|
||||||
"description": "code extension for tiptap",
|
"description": "code extension for tiptap",
|
||||||
"version": "2.0.0-beta.20",
|
"version": "2.0.0-beta.21",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -34,8 +34,10 @@ export const pasteRegex = /(?:^|\s)((?:`)((?:[^`]+))(?:`))/g
|
|||||||
export const Code = Mark.create<CodeOptions>({
|
export const Code = Mark.create<CodeOptions>({
|
||||||
name: 'code',
|
name: 'code',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
excludes: '_',
|
excludes: '_',
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.26](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-collaboration-cursor@2.0.0-beta.25...@tiptap/extension-collaboration-cursor@2.0.0-beta.26) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-collaboration-cursor
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.25](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-collaboration-cursor@2.0.0-beta.24...@tiptap/extension-collaboration-cursor@2.0.0-beta.25) (2021-10-14)
|
# [2.0.0-beta.25](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-collaboration-cursor@2.0.0-beta.24...@tiptap/extension-collaboration-cursor@2.0.0-beta.25) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-collaboration-cursor
|
**Note:** Version bump only for package @tiptap/extension-collaboration-cursor
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-collaboration-cursor",
|
"name": "@tiptap/extension-collaboration-cursor",
|
||||||
"description": "collaboration cursor extension for tiptap",
|
"description": "collaboration cursor extension for tiptap",
|
||||||
"version": "2.0.0-beta.25",
|
"version": "2.0.0-beta.26",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -31,26 +31,28 @@ const awarenessStatesToArray = (states: Map<number, Record<string, any>>) => {
|
|||||||
export const CollaborationCursor = Extension.create<CollaborationCursorOptions>({
|
export const CollaborationCursor = Extension.create<CollaborationCursorOptions>({
|
||||||
name: 'collaborationCursor',
|
name: 'collaborationCursor',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
provider: null,
|
return {
|
||||||
user: {
|
provider: null,
|
||||||
name: null,
|
user: {
|
||||||
color: null,
|
name: null,
|
||||||
},
|
color: null,
|
||||||
render: user => {
|
},
|
||||||
const cursor = document.createElement('span')
|
render: user => {
|
||||||
cursor.classList.add('collaboration-cursor__caret')
|
const cursor = document.createElement('span')
|
||||||
cursor.setAttribute('style', `border-color: ${user.color}`)
|
cursor.classList.add('collaboration-cursor__caret')
|
||||||
|
cursor.setAttribute('style', `border-color: ${user.color}`)
|
||||||
|
|
||||||
const label = document.createElement('div')
|
const label = document.createElement('div')
|
||||||
label.classList.add('collaboration-cursor__label')
|
label.classList.add('collaboration-cursor__label')
|
||||||
label.setAttribute('style', `background-color: ${user.color}`)
|
label.setAttribute('style', `background-color: ${user.color}`)
|
||||||
label.insertBefore(document.createTextNode(user.name), null)
|
label.insertBefore(document.createTextNode(user.name), null)
|
||||||
cursor.insertBefore(label, null)
|
cursor.insertBefore(label, null)
|
||||||
|
|
||||||
return cursor
|
return cursor
|
||||||
},
|
},
|
||||||
onUpdate: () => null,
|
onUpdate: () => null,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addCommands() {
|
addCommands() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.26](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-collaboration@2.0.0-beta.25...@tiptap/extension-collaboration@2.0.0-beta.26) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-collaboration
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.25](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-collaboration@2.0.0-beta.24...@tiptap/extension-collaboration@2.0.0-beta.25) (2021-10-14)
|
# [2.0.0-beta.25](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-collaboration@2.0.0-beta.24...@tiptap/extension-collaboration@2.0.0-beta.25) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-collaboration
|
**Note:** Version bump only for package @tiptap/extension-collaboration
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-collaboration",
|
"name": "@tiptap/extension-collaboration",
|
||||||
"description": "collaboration extension for tiptap",
|
"description": "collaboration extension for tiptap",
|
||||||
"version": "2.0.0-beta.25",
|
"version": "2.0.0-beta.26",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -43,10 +43,12 @@ export const Collaboration = Extension.create<CollaborationOptions>({
|
|||||||
|
|
||||||
priority: 1000,
|
priority: 1000,
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
document: null,
|
return {
|
||||||
field: 'default',
|
document: null,
|
||||||
fragment: null,
|
field: 'default',
|
||||||
|
fragment: null,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onCreate() {
|
onCreate() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.4](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-color@2.0.0-beta.3...@tiptap/extension-color@2.0.0-beta.4) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-color
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.3](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-color@2.0.0-beta.2...@tiptap/extension-color@2.0.0-beta.3) (2021-09-08)
|
# [2.0.0-beta.3](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-color@2.0.0-beta.2...@tiptap/extension-color@2.0.0-beta.3) (2021-09-08)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-color",
|
"name": "@tiptap/extension-color",
|
||||||
"description": "text color extension for tiptap",
|
"description": "text color extension for tiptap",
|
||||||
"version": "2.0.0-beta.3",
|
"version": "2.0.0-beta.4",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -23,8 +23,10 @@ declare module '@tiptap/core' {
|
|||||||
export const Color = Extension.create<ColorOptions>({
|
export const Color = Extension.create<ColorOptions>({
|
||||||
name: 'color',
|
name: 'color',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
types: ['textStyle'],
|
return {
|
||||||
|
types: ['textStyle'],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addGlobalAttributes() {
|
addGlobalAttributes() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.20](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-dropcursor@2.0.0-beta.19...@tiptap/extension-dropcursor@2.0.0-beta.20) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-dropcursor
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-dropcursor@2.0.0-beta.18...@tiptap/extension-dropcursor@2.0.0-beta.19) (2021-08-26)
|
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-dropcursor@2.0.0-beta.18...@tiptap/extension-dropcursor@2.0.0-beta.19) (2021-08-26)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-dropcursor
|
**Note:** Version bump only for package @tiptap/extension-dropcursor
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-dropcursor",
|
"name": "@tiptap/extension-dropcursor",
|
||||||
"description": "dropcursor extension for tiptap",
|
"description": "dropcursor extension for tiptap",
|
||||||
"version": "2.0.0-beta.19",
|
"version": "2.0.0-beta.20",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -10,10 +10,12 @@ export interface DropcursorOptions {
|
|||||||
export const Dropcursor = Extension.create<DropcursorOptions>({
|
export const Dropcursor = Extension.create<DropcursorOptions>({
|
||||||
name: 'dropCursor',
|
name: 'dropCursor',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
color: 'currentColor',
|
return {
|
||||||
width: 1,
|
color: 'currentColor',
|
||||||
class: null,
|
width: 1,
|
||||||
|
class: null,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addProseMirrorPlugins() {
|
addProseMirrorPlugins() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.37](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-floating-menu@2.0.0-beta.36...@tiptap/extension-floating-menu@2.0.0-beta.37) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-floating-menu
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.36](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-floating-menu@2.0.0-beta.35...@tiptap/extension-floating-menu@2.0.0-beta.36) (2021-10-14)
|
# [2.0.0-beta.36](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-floating-menu@2.0.0-beta.35...@tiptap/extension-floating-menu@2.0.0-beta.36) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-floating-menu
|
**Note:** Version bump only for package @tiptap/extension-floating-menu
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-floating-menu",
|
"name": "@tiptap/extension-floating-menu",
|
||||||
"description": "floating-menu extension for tiptap",
|
"description": "floating-menu extension for tiptap",
|
||||||
"version": "2.0.0-beta.36",
|
"version": "2.0.0-beta.37",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -8,11 +8,13 @@ export type FloatingMenuOptions = Omit<FloatingMenuPluginProps, 'editor' | 'elem
|
|||||||
export const FloatingMenu = Extension.create<FloatingMenuOptions>({
|
export const FloatingMenu = Extension.create<FloatingMenuOptions>({
|
||||||
name: 'floatingMenu',
|
name: 'floatingMenu',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
element: null,
|
return {
|
||||||
tippyOptions: {},
|
element: null,
|
||||||
pluginKey: 'floatingMenu',
|
tippyOptions: {},
|
||||||
shouldShow: null,
|
pluginKey: 'floatingMenu',
|
||||||
|
shouldShow: null,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addProseMirrorPlugins() {
|
addProseMirrorPlugins() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.30](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-focus@2.0.0-beta.29...@tiptap/extension-focus@2.0.0-beta.30) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-focus
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.29](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-focus@2.0.0-beta.28...@tiptap/extension-focus@2.0.0-beta.29) (2021-10-14)
|
# [2.0.0-beta.29](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-focus@2.0.0-beta.28...@tiptap/extension-focus@2.0.0-beta.29) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-focus
|
**Note:** Version bump only for package @tiptap/extension-focus
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-focus",
|
"name": "@tiptap/extension-focus",
|
||||||
"description": "focus extension for tiptap",
|
"description": "focus extension for tiptap",
|
||||||
"version": "2.0.0-beta.29",
|
"version": "2.0.0-beta.30",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -10,9 +10,11 @@ export interface FocusOptions {
|
|||||||
export const FocusClasses = Extension.create<FocusOptions>({
|
export const FocusClasses = Extension.create<FocusOptions>({
|
||||||
name: 'focus',
|
name: 'focus',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
className: 'has-focus',
|
return {
|
||||||
mode: 'all',
|
className: 'has-focus',
|
||||||
|
mode: 'all',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addProseMirrorPlugins() {
|
addProseMirrorPlugins() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.16](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-font-family@2.0.0-beta.15...@tiptap/extension-font-family@2.0.0-beta.16) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-font-family
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.15](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-font-family@2.0.0-beta.14...@tiptap/extension-font-family@2.0.0-beta.15) (2021-09-08)
|
# [2.0.0-beta.15](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-font-family@2.0.0-beta.14...@tiptap/extension-font-family@2.0.0-beta.15) (2021-09-08)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-font-family",
|
"name": "@tiptap/extension-font-family",
|
||||||
"description": "font family extension for tiptap",
|
"description": "font family extension for tiptap",
|
||||||
"version": "2.0.0-beta.15",
|
"version": "2.0.0-beta.16",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -23,8 +23,10 @@ declare module '@tiptap/core' {
|
|||||||
export const FontFamily = Extension.create<FontFamilyOptions>({
|
export const FontFamily = Extension.create<FontFamilyOptions>({
|
||||||
name: 'fontFamily',
|
name: 'fontFamily',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
types: ['textStyle'],
|
return {
|
||||||
|
types: ['textStyle'],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addGlobalAttributes() {
|
addGlobalAttributes() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.29](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-gapcursor@2.0.0-beta.28...@tiptap/extension-gapcursor@2.0.0-beta.29) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-gapcursor
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.28](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-gapcursor@2.0.0-beta.27...@tiptap/extension-gapcursor@2.0.0-beta.28) (2021-10-22)
|
# [2.0.0-beta.28](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-gapcursor@2.0.0-beta.27...@tiptap/extension-gapcursor@2.0.0-beta.28) (2021-10-22)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-gapcursor",
|
"name": "@tiptap/extension-gapcursor",
|
||||||
"description": "gapcursor extension for tiptap",
|
"description": "gapcursor extension for tiptap",
|
||||||
"version": "2.0.0-beta.28",
|
"version": "2.0.0-beta.29",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.25](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-hard-break@2.0.0-beta.24...@tiptap/extension-hard-break@2.0.0-beta.25) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-hard-break
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.24](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-hard-break@2.0.0-beta.23...@tiptap/extension-hard-break@2.0.0-beta.24) (2021-10-14)
|
# [2.0.0-beta.24](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-hard-break@2.0.0-beta.23...@tiptap/extension-hard-break@2.0.0-beta.24) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-hard-break
|
**Note:** Version bump only for package @tiptap/extension-hard-break
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-hard-break",
|
"name": "@tiptap/extension-hard-break",
|
||||||
"description": "hard break extension for tiptap",
|
"description": "hard break extension for tiptap",
|
||||||
"version": "2.0.0-beta.24",
|
"version": "2.0.0-beta.25",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -19,9 +19,11 @@ declare module '@tiptap/core' {
|
|||||||
export const HardBreak = Node.create<HardBreakOptions>({
|
export const HardBreak = Node.create<HardBreakOptions>({
|
||||||
name: 'hardBreak',
|
name: 'hardBreak',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
keepMarks: true,
|
return {
|
||||||
HTMLAttributes: {},
|
keepMarks: true,
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
inline: true,
|
inline: true,
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-heading@2.0.0-beta.18...@tiptap/extension-heading@2.0.0-beta.19) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-heading
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.18](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-heading@2.0.0-beta.17...@tiptap/extension-heading@2.0.0-beta.18) (2021-10-14)
|
# [2.0.0-beta.18](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-heading@2.0.0-beta.17...@tiptap/extension-heading@2.0.0-beta.18) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-heading
|
**Note:** Version bump only for package @tiptap/extension-heading
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-heading",
|
"name": "@tiptap/extension-heading",
|
||||||
"description": "heading extension for tiptap",
|
"description": "heading extension for tiptap",
|
||||||
"version": "2.0.0-beta.18",
|
"version": "2.0.0-beta.19",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -25,9 +25,11 @@ declare module '@tiptap/core' {
|
|||||||
export const Heading = Node.create<HeadingOptions>({
|
export const Heading = Node.create<HeadingOptions>({
|
||||||
name: 'heading',
|
name: 'heading',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
levels: [1, 2, 3, 4, 5, 6],
|
return {
|
||||||
HTMLAttributes: {},
|
levels: [1, 2, 3, 4, 5, 6],
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
content: 'inline*',
|
content: 'inline*',
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.26](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-highlight@2.0.0-beta.25...@tiptap/extension-highlight@2.0.0-beta.26) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-highlight
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.25](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-highlight@2.0.0-beta.24...@tiptap/extension-highlight@2.0.0-beta.25) (2021-10-14)
|
# [2.0.0-beta.25](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-highlight@2.0.0-beta.24...@tiptap/extension-highlight@2.0.0-beta.25) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-highlight
|
**Note:** Version bump only for package @tiptap/extension-highlight
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-highlight",
|
"name": "@tiptap/extension-highlight",
|
||||||
"description": "highlight extension for tiptap",
|
"description": "highlight extension for tiptap",
|
||||||
"version": "2.0.0-beta.25",
|
"version": "2.0.0-beta.26",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -35,9 +35,11 @@ export const pasteRegex = /(?:^|\s)((?:==)((?:[^~]+))(?:==))/g
|
|||||||
export const Highlight = Mark.create<HighlightOptions>({
|
export const Highlight = Mark.create<HighlightOptions>({
|
||||||
name: 'highlight',
|
name: 'highlight',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
multicolor: false,
|
return {
|
||||||
HTMLAttributes: {},
|
multicolor: false,
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addAttributes() {
|
addAttributes() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.17](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-beta.16...@tiptap/extension-history@2.0.0-beta.17) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-history
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.16](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-beta.15...@tiptap/extension-history@2.0.0-beta.16) (2021-08-20)
|
# [2.0.0-beta.16](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-beta.15...@tiptap/extension-history@2.0.0-beta.16) (2021-08-20)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-history
|
**Note:** Version bump only for package @tiptap/extension-history
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-history",
|
"name": "@tiptap/extension-history",
|
||||||
"description": "history extension for tiptap",
|
"description": "history extension for tiptap",
|
||||||
"version": "2.0.0-beta.16",
|
"version": "2.0.0-beta.17",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -24,9 +24,11 @@ declare module '@tiptap/core' {
|
|||||||
export const History = Extension.create<HistoryOptions>({
|
export const History = Extension.create<HistoryOptions>({
|
||||||
name: 'history',
|
name: 'history',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
depth: 100,
|
return {
|
||||||
newGroupDelay: 500,
|
depth: 100,
|
||||||
|
newGroupDelay: 500,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addCommands() {
|
addCommands() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.25](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-horizontal-rule@2.0.0-beta.24...@tiptap/extension-horizontal-rule@2.0.0-beta.25) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-horizontal-rule
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.24](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-horizontal-rule@2.0.0-beta.23...@tiptap/extension-horizontal-rule@2.0.0-beta.24) (2021-10-14)
|
# [2.0.0-beta.24](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-horizontal-rule@2.0.0-beta.23...@tiptap/extension-horizontal-rule@2.0.0-beta.24) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-horizontal-rule
|
**Note:** Version bump only for package @tiptap/extension-horizontal-rule
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-horizontal-rule",
|
"name": "@tiptap/extension-horizontal-rule",
|
||||||
"description": "horizontal rule extension for tiptap",
|
"description": "horizontal rule extension for tiptap",
|
||||||
"version": "2.0.0-beta.24",
|
"version": "2.0.0-beta.25",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -23,8 +23,10 @@ declare module '@tiptap/core' {
|
|||||||
export const HorizontalRule = Node.create<HorizontalRuleOptions>({
|
export const HorizontalRule = Node.create<HorizontalRuleOptions>({
|
||||||
name: 'horizontalRule',
|
name: 'horizontalRule',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
group: 'block',
|
group: 'block',
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.20](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-image@2.0.0-beta.19...@tiptap/extension-image@2.0.0-beta.20) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-image
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-image@2.0.0-beta.18...@tiptap/extension-image@2.0.0-beta.19) (2021-10-14)
|
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-image@2.0.0-beta.18...@tiptap/extension-image@2.0.0-beta.19) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-image
|
**Note:** Version bump only for package @tiptap/extension-image
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-image",
|
"name": "@tiptap/extension-image",
|
||||||
"description": "image extension for tiptap",
|
"description": "image extension for tiptap",
|
||||||
"version": "2.0.0-beta.19",
|
"version": "2.0.0-beta.20",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -25,9 +25,11 @@ export const inputRegex = /(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/
|
|||||||
export const Image = Node.create<ImageOptions>({
|
export const Image = Node.create<ImageOptions>({
|
||||||
name: 'image',
|
name: 'image',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
inline: false,
|
return {
|
||||||
HTMLAttributes: {},
|
inline: false,
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
inline() {
|
inline() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.20](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-italic@2.0.0-beta.19...@tiptap/extension-italic@2.0.0-beta.20) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-italic
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-italic@2.0.0-beta.18...@tiptap/extension-italic@2.0.0-beta.19) (2021-10-14)
|
# [2.0.0-beta.19](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-italic@2.0.0-beta.18...@tiptap/extension-italic@2.0.0-beta.19) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-italic
|
**Note:** Version bump only for package @tiptap/extension-italic
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-italic",
|
"name": "@tiptap/extension-italic",
|
||||||
"description": "italic extension for tiptap",
|
"description": "italic extension for tiptap",
|
||||||
"version": "2.0.0-beta.19",
|
"version": "2.0.0-beta.20",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -36,8 +36,10 @@ export const underscorePasteRegex = /(?:^|\s)((?:_)((?:[^_]+))(?:_))/g
|
|||||||
export const Italic = Mark.create<ItalicOptions>({
|
export const Italic = Mark.create<ItalicOptions>({
|
||||||
name: 'italic',
|
name: 'italic',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
parseHTML() {
|
parseHTML() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.24](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-link@2.0.0-beta.23...@tiptap/extension-link@2.0.0-beta.24) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-link
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.23](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-link@2.0.0-beta.22...@tiptap/extension-link@2.0.0-beta.23) (2021-10-14)
|
# [2.0.0-beta.23](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-link@2.0.0-beta.22...@tiptap/extension-link@2.0.0-beta.23) (2021-10-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-link
|
**Note:** Version bump only for package @tiptap/extension-link
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-link",
|
"name": "@tiptap/extension-link",
|
||||||
"description": "link extension for tiptap",
|
"description": "link extension for tiptap",
|
||||||
"version": "2.0.0-beta.23",
|
"version": "2.0.0-beta.24",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -47,13 +47,15 @@ export const Link = Mark.create<LinkOptions>({
|
|||||||
|
|
||||||
inclusive: false,
|
inclusive: false,
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
openOnClick: true,
|
return {
|
||||||
linkOnPaste: true,
|
openOnClick: true,
|
||||||
HTMLAttributes: {
|
linkOnPaste: true,
|
||||||
target: '_blank',
|
HTMLAttributes: {
|
||||||
rel: 'noopener noreferrer nofollow',
|
target: '_blank',
|
||||||
},
|
rel: 'noopener noreferrer nofollow',
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addAttributes() {
|
addAttributes() {
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.15](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-list-item@2.0.0-beta.14...@tiptap/extension-list-item@2.0.0-beta.15) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-list-item
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.14](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-list-item@2.0.0-beta.13...@tiptap/extension-list-item@2.0.0-beta.14) (2021-07-26)
|
# [2.0.0-beta.14](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-list-item@2.0.0-beta.13...@tiptap/extension-list-item@2.0.0-beta.14) (2021-07-26)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-list-item
|
**Note:** Version bump only for package @tiptap/extension-list-item
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-list-item",
|
"name": "@tiptap/extension-list-item",
|
||||||
"description": "list item extension for tiptap",
|
"description": "list item extension for tiptap",
|
||||||
"version": "2.0.0-beta.14",
|
"version": "2.0.0-beta.15",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
@ -7,8 +7,10 @@ export interface ListItemOptions {
|
|||||||
export const ListItem = Node.create<ListItemOptions>({
|
export const ListItem = Node.create<ListItemOptions>({
|
||||||
name: 'listItem',
|
name: 'listItem',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
|
HTMLAttributes: {},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
content: 'paragraph block*',
|
content: 'paragraph block*',
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.0.0-beta.80](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-mention@2.0.0-beta.79...@tiptap/extension-mention@2.0.0-beta.80) (2021-10-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-mention
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.79](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-mention@2.0.0-beta.78...@tiptap/extension-mention@2.0.0-beta.79) (2021-10-25)
|
# [2.0.0-beta.79](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-mention@2.0.0-beta.78...@tiptap/extension-mention@2.0.0-beta.79) (2021-10-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-mention
|
**Note:** Version bump only for package @tiptap/extension-mention
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-mention",
|
"name": "@tiptap/extension-mention",
|
||||||
"description": "mention extension for tiptap",
|
"description": "mention extension for tiptap",
|
||||||
"version": "2.0.0-beta.79",
|
"version": "2.0.0-beta.80",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@ -24,7 +24,7 @@
|
|||||||
"@tiptap/core": "^2.0.0-beta.1"
|
"@tiptap/core": "^2.0.0-beta.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tiptap/suggestion": "^2.0.0-beta.75",
|
"@tiptap/suggestion": "^2.0.0-beta.76",
|
||||||
"prosemirror-model": "^1.15.0",
|
"prosemirror-model": "^1.15.0",
|
||||||
"prosemirror-state": "^1.3.4"
|
"prosemirror-state": "^1.3.4"
|
||||||
},
|
},
|
||||||
|
@ -17,47 +17,49 @@ export const MentionPluginKey = new PluginKey('mention')
|
|||||||
export const Mention = Node.create<MentionOptions>({
|
export const Mention = Node.create<MentionOptions>({
|
||||||
name: 'mention',
|
name: 'mention',
|
||||||
|
|
||||||
defaultOptions: {
|
addOptions() {
|
||||||
HTMLAttributes: {},
|
return {
|
||||||
renderLabel({ options, node }) {
|
HTMLAttributes: {},
|
||||||
return `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
|
renderLabel({ options, node }) {
|
||||||
},
|
return `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
|
||||||
suggestion: {
|
|
||||||
char: '@',
|
|
||||||
pluginKey: MentionPluginKey,
|
|
||||||
command: ({ editor, range, props }) => {
|
|
||||||
// increase range.to by one when the next node is of type "text"
|
|
||||||
// and starts with a space character
|
|
||||||
const nodeAfter = editor.view.state.selection.$to.nodeAfter
|
|
||||||
const overrideSpace = nodeAfter?.text?.startsWith(' ')
|
|
||||||
|
|
||||||
if (overrideSpace) {
|
|
||||||
range.to += 1
|
|
||||||
}
|
|
||||||
|
|
||||||
editor
|
|
||||||
.chain()
|
|
||||||
.focus()
|
|
||||||
.insertContentAt(range, [
|
|
||||||
{
|
|
||||||
type: 'mention',
|
|
||||||
attrs: props,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'text',
|
|
||||||
text: ' ',
|
|
||||||
},
|
|
||||||
])
|
|
||||||
.run()
|
|
||||||
},
|
},
|
||||||
allow: ({ editor, range }) => {
|
suggestion: {
|
||||||
const $from = editor.state.doc.resolve(range.from)
|
char: '@',
|
||||||
const type = editor.schema.nodes.mention
|
pluginKey: MentionPluginKey,
|
||||||
const allow = !!$from.parent.type.contentMatch.matchType(type)
|
command: ({ editor, range, props }) => {
|
||||||
|
// increase range.to by one when the next node is of type "text"
|
||||||
|
// and starts with a space character
|
||||||
|
const nodeAfter = editor.view.state.selection.$to.nodeAfter
|
||||||
|
const overrideSpace = nodeAfter?.text?.startsWith(' ')
|
||||||
|
|
||||||
return allow
|
if (overrideSpace) {
|
||||||
|
range.to += 1
|
||||||
|
}
|
||||||
|
|
||||||
|
editor
|
||||||
|
.chain()
|
||||||
|
.focus()
|
||||||
|
.insertContentAt(range, [
|
||||||
|
{
|
||||||
|
type: this.name,
|
||||||
|
attrs: props,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'text',
|
||||||
|
text: ' ',
|
||||||
|
},
|
||||||
|
])
|
||||||
|
.run()
|
||||||
|
},
|
||||||
|
allow: ({ editor, range }) => {
|
||||||
|
const $from = editor.state.doc.resolve(range.from)
|
||||||
|
const type = editor.schema.nodes[this.name]
|
||||||
|
const allow = !!$from.parent.type.contentMatch.matchType(type)
|
||||||
|
|
||||||
|
return allow
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
group: 'inline',
|
group: 'inline',
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user