Merge branch 'main' of https://github.com/ueberdosis/tiptap
This commit is contained in:
@@ -53,11 +53,13 @@ module.exports = {
|
|||||||
'max-len': 'off',
|
'max-len': 'off',
|
||||||
'vue/one-component-per-file': 'off',
|
'vue/one-component-per-file': 'off',
|
||||||
'vue/this-in-template': ['error', 'never'],
|
'vue/this-in-template': ['error', 'never'],
|
||||||
|
'vue/multi-word-component-names': 'off',
|
||||||
'vue/max-attributes-per-line': ['error', {
|
'vue/max-attributes-per-line': ['error', {
|
||||||
singleline: 3,
|
singleline: {
|
||||||
|
max: 3,
|
||||||
|
},
|
||||||
multiline: {
|
multiline: {
|
||||||
max: 1,
|
max: 1,
|
||||||
allowFirstLine: false,
|
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
'vue/singleline-html-element-content-newline': 'off',
|
'vue/singleline-html-element-content-newline': 'off',
|
||||||
|
|||||||
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v2.3.5
|
- uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v2.4.1
|
uses: actions/setup-node@v2.4.1
|
||||||
@@ -80,7 +80,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v2.3.5
|
- uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v2.4.1
|
uses: actions/setup-node@v2.4.1
|
||||||
@@ -136,7 +136,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v2.3.5
|
- uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v2.4.1
|
uses: actions/setup-node@v2.4.1
|
||||||
|
|||||||
@@ -16,22 +16,22 @@
|
|||||||
"y-indexeddb": "^9.0.6",
|
"y-indexeddb": "^9.0.6",
|
||||||
"y-webrtc": "^10.2.0",
|
"y-webrtc": "^10.2.0",
|
||||||
"y-websocket": "^1.3.17",
|
"y-websocket": "^1.3.17",
|
||||||
"yjs": "^13.5.16"
|
"yjs": "^13.5.18"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/uuid": "^8.3.1",
|
"@types/uuid": "^8.3.1",
|
||||||
"@vitejs/plugin-react-refresh": "^1.3.6",
|
"@vitejs/plugin-react-refresh": "^1.3.6",
|
||||||
"@vitejs/plugin-vue": "^1.9.3",
|
"@vitejs/plugin-vue": "^1.9.4",
|
||||||
"autoprefixer": "^10.3.7",
|
"autoprefixer": "^10.4.0",
|
||||||
"iframe-resizer": "^4.3.2",
|
"iframe-resizer": "^4.3.2",
|
||||||
"postcss": "^8.3.11",
|
"postcss": "^8.3.11",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"sass": "^1.43.3",
|
"sass": "^1.43.4",
|
||||||
"tailwindcss": "^2.2.17",
|
"tailwindcss": "^2.2.19",
|
||||||
"typescript": "^4.4.4",
|
"typescript": "^4.4.4",
|
||||||
"uuid": "^8.3.2",
|
"uuid": "^8.3.2",
|
||||||
"vite": "^2.6.10",
|
"vite": "^2.6.13",
|
||||||
"vite-plugin-checker": "^0.3.4",
|
"vite-plugin-checker": "^0.3.4",
|
||||||
"vue": "^3.0.5",
|
"vue": "^3.0.5",
|
||||||
"vue-router": "^4.0.11"
|
"vue-router": "^4.0.11"
|
||||||
|
|||||||
@@ -67,6 +67,10 @@ select {
|
|||||||
padding: 0.1rem 0.4rem;
|
padding: 0.1rem 0.4rem;
|
||||||
background: white;
|
background: white;
|
||||||
accent-color: black;
|
accent-color: black;
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
opacity: 0.3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ProseMirror:focus {
|
.ProseMirror:focus {
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ context('/src/Nodes/TaskList/Vue/', () => {
|
|||||||
it('should parse unordered lists correctly', () => {
|
it('should parse unordered lists correctly', () => {
|
||||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||||
editor.commands.setContent('<ul data-type="taskList"><li data-checked="true" data-type="taskItem"><p>Example Text</p></li></ul>')
|
editor.commands.setContent('<ul data-type="taskList"><li data-checked="true" data-type="taskItem"><p>Example Text</p></li></ul>')
|
||||||
expect(editor.getHTML()).to.eq('<ul data-type="taskList"><li data-checked="true" data-type="taskItem"><p>Example Text</p></li></ul>')
|
expect(editor.getHTML()).to.eq('<ul data-type="taskList"><li data-checked="true" data-type="taskItem"><label><input type="checkbox" checked="checked"><span></span></label><div><p>Example Text</p></div></li></ul>')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should parse unordered lists without paragraphs correctly', () => {
|
it('should parse unordered lists without paragraphs correctly', () => {
|
||||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||||
editor.commands.setContent('<ul data-type="taskList"><li data-checked="false" data-type="taskItem">Example Text</li></ul>')
|
editor.commands.setContent('<ul data-type="taskList"><li data-checked="false" data-type="taskItem">Example Text</li></ul>')
|
||||||
expect(editor.getHTML()).to.eq('<ul data-type="taskList"><li data-checked="false" data-type="taskItem"><p>Example Text</p></li></ul>')
|
expect(editor.getHTML()).to.eq('<ul data-type="taskList"><li data-checked="false" data-type="taskItem"><label><input type="checkbox"><span></span></label><div><p>Example Text</p></div></li></ul>')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,17 @@ CodeBlockLowlight.configure({
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### defaultLanguage
|
||||||
|
Define a default language instead of the automatic detection of lowlight.
|
||||||
|
|
||||||
|
Default: `null`
|
||||||
|
|
||||||
|
```js
|
||||||
|
CodeBlockLowlight.configure({
|
||||||
|
defaultLanguage: 'plaintext',
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
### setCodeBlock()
|
### setCodeBlock()
|
||||||
|
|||||||
24
package.json
24
package.json
@@ -24,11 +24,11 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@atomico/rollup-plugin-sizes": "^1.1.4",
|
"@atomico/rollup-plugin-sizes": "^1.1.4",
|
||||||
"@babel/core": "^7.15.8",
|
"@babel/core": "^7.16.0",
|
||||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
||||||
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
|
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
||||||
"@babel/preset-env": "^7.15.8",
|
"@babel/preset-env": "^7.16.0",
|
||||||
"@babel/preset-react": "^7.14.5",
|
"@babel/preset-react": "^7.16.0",
|
||||||
"@cypress/webpack-preprocessor": "^5.9.1",
|
"@cypress/webpack-preprocessor": "^5.9.1",
|
||||||
"@lerna/batch-packages": "^3.16.0",
|
"@lerna/batch-packages": "^3.16.0",
|
||||||
"@lerna/filter-packages": "^4.0.0",
|
"@lerna/filter-packages": "^4.0.0",
|
||||||
@@ -36,24 +36,24 @@
|
|||||||
"@rollup/plugin-babel": "^5.3.0",
|
"@rollup/plugin-babel": "^5.3.0",
|
||||||
"@rollup/plugin-commonjs": "^21.0.1",
|
"@rollup/plugin-commonjs": "^21.0.1",
|
||||||
"@rollup/plugin-node-resolve": "^13.0.6",
|
"@rollup/plugin-node-resolve": "^13.0.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.1.0",
|
"@typescript-eslint/eslint-plugin": "^5.3.0",
|
||||||
"@typescript-eslint/parser": "^5.1.0",
|
"@typescript-eslint/parser": "^5.3.0",
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.3",
|
||||||
"cypress": "^8.6.0",
|
"cypress": "^8.7.0",
|
||||||
"eslint": "^8.1.0",
|
"eslint": "^8.2.0",
|
||||||
"eslint-config-airbnb-base": "^14.2.0",
|
"eslint-config-airbnb-base": "^14.2.0",
|
||||||
"eslint-plugin-cypress": "^2.12.1",
|
"eslint-plugin-cypress": "^2.12.1",
|
||||||
"eslint-plugin-html": "^6.2.0",
|
"eslint-plugin-html": "^6.2.0",
|
||||||
"eslint-plugin-import": "^2.25.2",
|
"eslint-plugin-import": "^2.25.2",
|
||||||
"eslint-plugin-vue": "^7.20.0",
|
"eslint-plugin-vue": "^8.0.3",
|
||||||
"lerna": "^4.0.0",
|
"lerna": "^4.0.0",
|
||||||
"minimist": "^1.2.5",
|
"minimist": "^1.2.5",
|
||||||
"rollup": "^2.58.1",
|
"rollup": "^2.59.0",
|
||||||
"rollup-plugin-auto-external": "^2.0.0",
|
"rollup-plugin-auto-external": "^2.0.0",
|
||||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||||
"rollup-plugin-typescript2": "^0.30.0",
|
"rollup-plugin-typescript2": "^0.30.0",
|
||||||
"ts-loader": "^9.2.6",
|
"ts-loader": "^9.2.6",
|
||||||
"typescript": "^4.4.4",
|
"typescript": "^4.4.4",
|
||||||
"webpack": "^5.59.1"
|
"webpack": "^5.62.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,37 @@
|
|||||||
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.133](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.132...@tiptap/core@2.0.0-beta.133) (2021-11-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix a bug when parsing attributes if no parseHTML method is provided, fix [#2058](https://github.com/ueberdosis/tiptap/issues/2058) ([5da313a](https://github.com/ueberdosis/tiptap/commit/5da313a5480db011374ffd236159e2aedc011b97))
|
||||||
|
* Improve behavior when using insertContent ([#2147](https://github.com/ueberdosis/tiptap/issues/2147)) ([8fc915c](https://github.com/ueberdosis/tiptap/commit/8fc915cade394bff2015be1e1e2d7c008e8c908e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.132](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.131...@tiptap/core@2.0.0-beta.132) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/core
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.131](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.130...@tiptap/core@2.0.0-beta.131) (2021-11-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* improve JSONContent type to allow pure JSON content ([ce7f52a](https://github.com/ueberdosis/tiptap/commit/ce7f52a8f0c278ef39b25010950dd734bebd679b))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.130](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.129...@tiptap/core@2.0.0-beta.130) (2021-10-31)
|
# [2.0.0-beta.130](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.129...@tiptap/core@2.0.0-beta.130) (2021-10-31)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.130",
|
"version": "2.0.0-beta.133",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -28,16 +28,16 @@
|
|||||||
"@types/prosemirror-keymap": "^1.0.4",
|
"@types/prosemirror-keymap": "^1.0.4",
|
||||||
"@types/prosemirror-model": "^1.13.2",
|
"@types/prosemirror-model": "^1.13.2",
|
||||||
"@types/prosemirror-schema-list": "^1.0.3",
|
"@types/prosemirror-schema-list": "^1.0.3",
|
||||||
"@types/prosemirror-state": "^1.2.7",
|
"@types/prosemirror-state": "^1.2.8",
|
||||||
"@types/prosemirror-transform": "^1.1.4",
|
"@types/prosemirror-transform": "^1.1.4",
|
||||||
"@types/prosemirror-view": "^1.19.1",
|
"@types/prosemirror-view": "^1.19.1",
|
||||||
"prosemirror-commands": "^1.1.11",
|
"prosemirror-commands": "^1.1.12",
|
||||||
"prosemirror-keymap": "^1.1.3",
|
"prosemirror-keymap": "^1.1.5",
|
||||||
"prosemirror-model": "^1.15.0",
|
"prosemirror-model": "^1.15.0",
|
||||||
"prosemirror-schema-list": "^1.1.6",
|
"prosemirror-schema-list": "^1.1.6",
|
||||||
"prosemirror-state": "^1.3.4",
|
"prosemirror-state": "^1.3.4",
|
||||||
"prosemirror-transform": "^1.3.3",
|
"prosemirror-transform": "^1.3.3",
|
||||||
"prosemirror-view": "^1.20.3"
|
"prosemirror-view": "^1.22.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -45,15 +45,40 @@ export const insertContentAt: RawCommands['insertContentAt'] = (position, value,
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const { from, to } = typeof position === 'number'
|
let { from, to } = typeof position === 'number'
|
||||||
? { from: position, to: position }
|
? { from: position, to: position }
|
||||||
: position
|
: position
|
||||||
|
|
||||||
|
let isOnlyBlockContent = true
|
||||||
|
|
||||||
|
content.forEach(node => {
|
||||||
|
isOnlyBlockContent = isOnlyBlockContent
|
||||||
|
? node.isBlock
|
||||||
|
: false
|
||||||
|
})
|
||||||
|
|
||||||
|
// check if we can replace the wrapping node by
|
||||||
|
// the newly inserted content
|
||||||
|
// example:
|
||||||
|
// replace an empty paragraph by an inserted image
|
||||||
|
// instead of inserting the image below the paragraph
|
||||||
|
if (from === to && isOnlyBlockContent) {
|
||||||
|
const $from = tr.doc.resolve(from)
|
||||||
|
const isEmptyTextBlock = $from.parent.isTextblock
|
||||||
|
&& !$from.parent.type.spec.code
|
||||||
|
&& !$from.parent.textContent
|
||||||
|
|
||||||
|
if (isEmptyTextBlock) {
|
||||||
|
from -= 1
|
||||||
|
to += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tr.replaceWith(from, to, content)
|
tr.replaceWith(from, to, content)
|
||||||
|
|
||||||
// set cursor at end of inserted content
|
// set cursor at end of inserted content
|
||||||
if (options.updateSelection) {
|
if (options.updateSelection) {
|
||||||
selectionToInsertionEnd(tr, tr.steps.length - 1, 1)
|
selectionToInsertionEnd(tr, tr.steps.length - 1, -1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export interface EditorOptions {
|
|||||||
export type HTMLContent = string
|
export type HTMLContent = string
|
||||||
|
|
||||||
export type JSONContent = {
|
export type JSONContent = {
|
||||||
type: string,
|
type?: string,
|
||||||
attrs?: Record<string, any>,
|
attrs?: Record<string, any>,
|
||||||
content?: JSONContent[],
|
content?: JSONContent[],
|
||||||
marks?: {
|
marks?: {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ export default function fromString(value: any): any {
|
|||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value.match(/^\d*(\.\d+)?$/)) {
|
if (value.match(/^[+-]?(?:\d*\.)?\d+$/)) {
|
||||||
return Number(value)
|
return Number(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
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.46](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bubble-menu@2.0.0-beta.45...@tiptap/extension-bubble-menu@2.0.0-beta.46) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-bubble-menu
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.45](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bubble-menu@2.0.0-beta.44...@tiptap/extension-bubble-menu@2.0.0-beta.45) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-bubble-menu
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.44](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bubble-menu@2.0.0-beta.43...@tiptap/extension-bubble-menu@2.0.0-beta.44) (2021-10-31)
|
# [2.0.0-beta.44](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bubble-menu@2.0.0-beta.43...@tiptap/extension-bubble-menu@2.0.0-beta.44) (2021-10-31)
|
||||||
|
|
||||||
**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.44",
|
"version": "2.0.0-beta.46",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -25,8 +25,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"prosemirror-state": "^1.3.4",
|
"prosemirror-state": "^1.3.4",
|
||||||
"prosemirror-view": "^1.20.3",
|
"prosemirror-view": "^1.22.0",
|
||||||
"tippy.js": "^6.3.2"
|
"tippy.js": "^6.3.4"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -3,6 +3,25 @@
|
|||||||
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.52](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.51...@tiptap/extension-code-block-lowlight@2.0.0-beta.52) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-code-block-lowlight
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.51](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.50...@tiptap/extension-code-block-lowlight@2.0.0-beta.51) (2021-11-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add defaultLanguage option to CodeBlockLowlight extension, fix [#2121](https://github.com/ueberdosis/tiptap/issues/2121) ([0f94bcd](https://github.com/ueberdosis/tiptap/commit/0f94bcd591e98c0a767d0914b87a1efee8b002e0))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.50](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.49...@tiptap/extension-code-block-lowlight@2.0.0-beta.50) (2021-10-31)
|
# [2.0.0-beta.50](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.49...@tiptap/extension-code-block-lowlight@2.0.0-beta.50) (2021-10-31)
|
||||||
|
|
||||||
**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.50",
|
"version": "2.0.0-beta.52",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"lowlight": "^1.20.0",
|
"lowlight": "^1.20.0",
|
||||||
"prosemirror-model": "^1.15.0",
|
"prosemirror-model": "^1.15.0",
|
||||||
"prosemirror-state": "^1.3.4",
|
"prosemirror-state": "^1.3.4",
|
||||||
"prosemirror-view": "^1.20.3"
|
"prosemirror-view": "^1.22.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { LowlightPlugin } from './lowlight-plugin'
|
|||||||
|
|
||||||
export interface CodeBlockLowlightOptions extends CodeBlockOptions {
|
export interface CodeBlockLowlightOptions extends CodeBlockOptions {
|
||||||
lowlight: any,
|
lowlight: any,
|
||||||
|
defaultLanguage: string | null | undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CodeBlockLowlight = CodeBlock.extend<CodeBlockLowlightOptions>({
|
export const CodeBlockLowlight = CodeBlock.extend<CodeBlockLowlightOptions>({
|
||||||
@@ -11,6 +12,7 @@ export const CodeBlockLowlight = CodeBlock.extend<CodeBlockLowlightOptions>({
|
|||||||
return {
|
return {
|
||||||
...this.parent?.(),
|
...this.parent?.(),
|
||||||
lowlight,
|
lowlight,
|
||||||
|
defaultLanguage: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -20,6 +22,7 @@ export const CodeBlockLowlight = CodeBlock.extend<CodeBlockLowlightOptions>({
|
|||||||
LowlightPlugin({
|
LowlightPlugin({
|
||||||
name: this.name,
|
name: this.name,
|
||||||
lowlight: this.options.lowlight,
|
lowlight: this.options.lowlight,
|
||||||
|
defaultLanguage: this.options.defaultLanguage,
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,13 +30,19 @@ function getHighlightNodes(result: any) {
|
|||||||
return result.value || result.children || []
|
return result.value || result.children || []
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDecorations({ doc, name, lowlight }: { doc: ProsemirrorNode, name: string, lowlight: any }) {
|
function getDecorations({
|
||||||
|
doc,
|
||||||
|
name,
|
||||||
|
lowlight,
|
||||||
|
defaultLanguage,
|
||||||
|
}: { doc: ProsemirrorNode, name: string, lowlight: any, defaultLanguage: string | null | undefined }) {
|
||||||
const decorations: Decoration[] = []
|
const decorations: Decoration[] = []
|
||||||
|
|
||||||
findChildren(doc, node => node.type.name === name)
|
findChildren(doc, node => node.type.name === name)
|
||||||
.forEach(block => {
|
.forEach(block => {
|
||||||
let from = block.pos + 1
|
let from = block.pos + 1
|
||||||
const { language } = block.node.attrs
|
const language = block.node.attrs.language || defaultLanguage
|
||||||
|
console.log({ language, defaultLanguage })
|
||||||
const languages = lowlight.listLanguages()
|
const languages = lowlight.listLanguages()
|
||||||
const nodes = language && languages.includes(language)
|
const nodes = language && languages.includes(language)
|
||||||
? getHighlightNodes(lowlight.highlight(language, block.node.textContent))
|
? getHighlightNodes(lowlight.highlight(language, block.node.textContent))
|
||||||
@@ -60,12 +66,17 @@ function getDecorations({ doc, name, lowlight }: { doc: ProsemirrorNode, name: s
|
|||||||
return DecorationSet.create(doc, decorations)
|
return DecorationSet.create(doc, decorations)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function LowlightPlugin({ name, lowlight }: { name: string, lowlight: any }) {
|
export function LowlightPlugin({ name, lowlight, defaultLanguage }: { name: string, lowlight: any, defaultLanguage: string | null | undefined }) {
|
||||||
return new Plugin({
|
return new Plugin({
|
||||||
key: new PluginKey('lowlight'),
|
key: new PluginKey('lowlight'),
|
||||||
|
|
||||||
state: {
|
state: {
|
||||||
init: (_, { doc }) => getDecorations({ doc, name, lowlight }),
|
init: (_, { doc }) => getDecorations({
|
||||||
|
doc,
|
||||||
|
name,
|
||||||
|
lowlight,
|
||||||
|
defaultLanguage,
|
||||||
|
}),
|
||||||
apply: (transaction, decorationSet, oldState, newState) => {
|
apply: (transaction, decorationSet, oldState, newState) => {
|
||||||
const oldNodeName = oldState.selection.$head.parent.type.name
|
const oldNodeName = oldState.selection.$head.parent.type.name
|
||||||
const newNodeName = newState.selection.$head.parent.type.name
|
const newNodeName = newState.selection.$head.parent.type.name
|
||||||
@@ -97,7 +108,12 @@ export function LowlightPlugin({ name, lowlight }: { name: string, lowlight: any
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return getDecorations({ doc: transaction.doc, name, lowlight })
|
return getDecorations({
|
||||||
|
doc: transaction.doc,
|
||||||
|
name,
|
||||||
|
lowlight,
|
||||||
|
defaultLanguage,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return decorationSet.map(transaction.mapping, transaction.doc)
|
return decorationSet.map(transaction.mapping, transaction.doc)
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
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.40](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-floating-menu@2.0.0-beta.39...@tiptap/extension-floating-menu@2.0.0-beta.40) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-floating-menu
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.39](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-floating-menu@2.0.0-beta.38...@tiptap/extension-floating-menu@2.0.0-beta.39) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-floating-menu
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.38](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-floating-menu@2.0.0-beta.37...@tiptap/extension-floating-menu@2.0.0-beta.38) (2021-10-31)
|
# [2.0.0-beta.38](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-floating-menu@2.0.0-beta.37...@tiptap/extension-floating-menu@2.0.0-beta.38) (2021-10-31)
|
||||||
|
|
||||||
**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.38",
|
"version": "2.0.0-beta.40",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -25,8 +25,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"prosemirror-state": "^1.3.4",
|
"prosemirror-state": "^1.3.4",
|
||||||
"prosemirror-view": "^1.20.3",
|
"prosemirror-view": "^1.22.0",
|
||||||
"tippy.js": "^6.3.2"
|
"tippy.js": "^6.3.4"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
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.33](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-focus@2.0.0-beta.32...@tiptap/extension-focus@2.0.0-beta.33) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-focus
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.32](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-focus@2.0.0-beta.31...@tiptap/extension-focus@2.0.0-beta.32) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-focus
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.31](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-focus@2.0.0-beta.30...@tiptap/extension-focus@2.0.0-beta.31) (2021-10-31)
|
# [2.0.0-beta.31](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-focus@2.0.0-beta.30...@tiptap/extension-focus@2.0.0-beta.31) (2021-10-31)
|
||||||
|
|
||||||
**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.31",
|
"version": "2.0.0-beta.33",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"prosemirror-state": "^1.3.4",
|
"prosemirror-state": "^1.3.4",
|
||||||
"prosemirror-view": "^1.20.3"
|
"prosemirror-view": "^1.22.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
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.27](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-hard-break@2.0.0-beta.26...@tiptap/extension-hard-break@2.0.0-beta.27) (2021-11-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* prevent adding hard breaks in isolated nodes ([9247fcb](https://github.com/ueberdosis/tiptap/commit/9247fcb6cf20493d021664ddce95ad1c23c5a152))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.26](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-hard-break@2.0.0-beta.25...@tiptap/extension-hard-break@2.0.0-beta.26) (2021-10-31)
|
# [2.0.0-beta.26](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-hard-break@2.0.0-beta.25...@tiptap/extension-hard-break@2.0.0-beta.26) (2021-10-31)
|
||||||
|
|
||||||
**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.26",
|
"version": "2.0.0-beta.27",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
|||||||
@@ -57,10 +57,16 @@ export const HardBreak = Node.create<HardBreakOptions>({
|
|||||||
return commands.first([
|
return commands.first([
|
||||||
() => commands.exitCode(),
|
() => commands.exitCode(),
|
||||||
() => commands.command(() => {
|
() => commands.command(() => {
|
||||||
|
const { selection, storedMarks } = state
|
||||||
|
|
||||||
|
if (selection.$from.parent.type.spec.isolating) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
const { keepMarks } = this.options
|
const { keepMarks } = this.options
|
||||||
const { splittableMarks } = editor.extensionManager
|
const { splittableMarks } = editor.extensionManager
|
||||||
const marks = state.storedMarks
|
const marks = storedMarks
|
||||||
|| (state.selection.$to.parentOffset && state.selection.$from.marks())
|
|| (selection.$to.parentOffset && selection.$from.marks())
|
||||||
|
|
||||||
return chain()
|
return chain()
|
||||||
.insertContent({ type: this.name })
|
.insertContent({ type: this.name })
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
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.27](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-horizontal-rule@2.0.0-beta.26...@tiptap/extension-horizontal-rule@2.0.0-beta.27) (2021-11-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Improve behavior when using insertContent ([#2147](https://github.com/ueberdosis/tiptap/issues/2147)) ([8fc915c](https://github.com/ueberdosis/tiptap/commit/8fc915cade394bff2015be1e1e2d7c008e8c908e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.26](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-horizontal-rule@2.0.0-beta.25...@tiptap/extension-horizontal-rule@2.0.0-beta.26) (2021-10-31)
|
# [2.0.0-beta.26](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-horizontal-rule@2.0.0-beta.25...@tiptap/extension-horizontal-rule@2.0.0-beta.26) (2021-10-31)
|
||||||
|
|
||||||
**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.26",
|
"version": "2.0.0-beta.27",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
|
|||||||
@@ -45,35 +45,18 @@ export const HorizontalRule = Node.create<HorizontalRuleOptions>({
|
|||||||
return {
|
return {
|
||||||
setHorizontalRule: () => ({ chain }) => {
|
setHorizontalRule: () => ({ chain }) => {
|
||||||
return chain()
|
return chain()
|
||||||
// remove node before hr if it’s an empty text block
|
|
||||||
.command(({ tr, dispatch }) => {
|
|
||||||
const { selection } = tr
|
|
||||||
const { empty, $anchor } = selection
|
|
||||||
const isEmptyTextBlock = $anchor.parent.isTextblock
|
|
||||||
&& !$anchor.parent.type.spec.code
|
|
||||||
&& !$anchor.parent.textContent
|
|
||||||
|
|
||||||
if (!empty || !isEmptyTextBlock || !dispatch) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
const from = $anchor.before()
|
|
||||||
const to = $anchor.start()
|
|
||||||
|
|
||||||
tr.deleteRange(from, to)
|
|
||||||
tr.setSelection(TextSelection.create(tr.doc, from))
|
|
||||||
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
.insertContent({ type: this.name })
|
.insertContent({ type: this.name })
|
||||||
// add node after hr if it’s the end of the document
|
// set cursor after horizontal rule
|
||||||
.command(({ tr, dispatch }) => {
|
.command(({ tr, dispatch }) => {
|
||||||
if (dispatch) {
|
if (dispatch) {
|
||||||
const { parent, pos } = tr.selection.$from
|
const { parent, pos } = tr.selection.$from
|
||||||
const posAfter = pos + 1
|
const posAfter = pos + 1
|
||||||
const nodeAfter = tr.doc.nodeAt(posAfter)
|
const nodeAfter = tr.doc.nodeAt(posAfter)
|
||||||
|
|
||||||
if (!nodeAfter) {
|
if (nodeAfter) {
|
||||||
|
tr.setSelection(TextSelection.create(tr.doc, posAfter))
|
||||||
|
} else {
|
||||||
|
// add node after horizontal rule if it’s the end of the document
|
||||||
const node = parent.type.contentMatch.defaultType?.create()
|
const node = parent.type.contentMatch.defaultType?.create()
|
||||||
|
|
||||||
if (node) {
|
if (node) {
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
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.83](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-mention@2.0.0-beta.82...@tiptap/extension-mention@2.0.0-beta.83) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-mention
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.82](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-mention@2.0.0-beta.81...@tiptap/extension-mention@2.0.0-beta.82) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-mention
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.81](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-mention@2.0.0-beta.80...@tiptap/extension-mention@2.0.0-beta.81) (2021-10-31)
|
# [2.0.0-beta.81](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-mention@2.0.0-beta.80...@tiptap/extension-mention@2.0.0-beta.81) (2021-10-31)
|
||||||
|
|
||||||
**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.81",
|
"version": "2.0.0-beta.83",
|
||||||
"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.77",
|
"@tiptap/suggestion": "^2.0.0-beta.79",
|
||||||
"prosemirror-model": "^1.15.0",
|
"prosemirror-model": "^1.15.0",
|
||||||
"prosemirror-state": "^1.3.4"
|
"prosemirror-state": "^1.3.4"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
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.40](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-placeholder@2.0.0-beta.39...@tiptap/extension-placeholder@2.0.0-beta.40) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-placeholder
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.39](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-placeholder@2.0.0-beta.38...@tiptap/extension-placeholder@2.0.0-beta.39) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-placeholder
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.38](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-placeholder@2.0.0-beta.37...@tiptap/extension-placeholder@2.0.0-beta.38) (2021-10-31)
|
# [2.0.0-beta.38](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-placeholder@2.0.0-beta.37...@tiptap/extension-placeholder@2.0.0-beta.38) (2021-10-31)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-placeholder
|
**Note:** Version bump only for package @tiptap/extension-placeholder
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-placeholder",
|
"name": "@tiptap/extension-placeholder",
|
||||||
"description": "placeholder extension for tiptap",
|
"description": "placeholder extension for tiptap",
|
||||||
"version": "2.0.0-beta.38",
|
"version": "2.0.0-beta.40",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"prosemirror-model": "^1.15.0",
|
"prosemirror-model": "^1.15.0",
|
||||||
"prosemirror-state": "^1.3.4",
|
"prosemirror-state": "^1.3.4",
|
||||||
"prosemirror-view": "^1.20.3"
|
"prosemirror-view": "^1.22.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
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.39](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-table@2.0.0-beta.38...@tiptap/extension-table@2.0.0-beta.39) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-table
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.38](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-table@2.0.0-beta.37...@tiptap/extension-table@2.0.0-beta.38) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/extension-table
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.37](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-table@2.0.0-beta.36...@tiptap/extension-table@2.0.0-beta.37) (2021-10-31)
|
# [2.0.0-beta.37](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-table@2.0.0-beta.36...@tiptap/extension-table@2.0.0-beta.37) (2021-10-31)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-table
|
**Note:** Version bump only for package @tiptap/extension-table
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-table",
|
"name": "@tiptap/extension-table",
|
||||||
"description": "table extension for tiptap",
|
"description": "table extension for tiptap",
|
||||||
"version": "2.0.0-beta.37",
|
"version": "2.0.0-beta.39",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"prosemirror-tables": "^1.1.1",
|
"prosemirror-tables": "^1.1.1",
|
||||||
"prosemirror-view": "^1.20.3"
|
"prosemirror-view": "^1.22.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
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-task-item@2.0.0-beta.24...@tiptap/extension-task-item@2.0.0-beta.25) (2021-11-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add checkboxes to TaskItem HTML output, fix [#2037](https://github.com/ueberdosis/tiptap/issues/2037) ([c94d2b0](https://github.com/ueberdosis/tiptap/commit/c94d2b0517e62afea84cb9dd6999874abf0bf3cd))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.24](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-item@2.0.0-beta.23...@tiptap/extension-task-item@2.0.0-beta.24) (2021-10-31)
|
# [2.0.0-beta.24](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-item@2.0.0-beta.23...@tiptap/extension-task-item@2.0.0-beta.24) (2021-10-31)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/extension-task-item
|
**Note:** Version bump only for package @tiptap/extension-task-item
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/extension-task-item",
|
"name": "@tiptap/extension-task-item",
|
||||||
"description": "task item extension for tiptap",
|
"description": "task item 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",
|
||||||
|
|||||||
@@ -45,12 +45,32 @@ export const TaskItem = Node.create<TaskItemOptions>({
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
renderHTML({ HTMLAttributes }) {
|
renderHTML({ node, HTMLAttributes }) {
|
||||||
return ['li', mergeAttributes(
|
return [
|
||||||
|
'li',
|
||||||
|
mergeAttributes(
|
||||||
this.options.HTMLAttributes,
|
this.options.HTMLAttributes,
|
||||||
HTMLAttributes,
|
HTMLAttributes,
|
||||||
{ 'data-type': 'taskItem' },
|
{ 'data-type': 'taskItem' },
|
||||||
), 0]
|
),
|
||||||
|
[
|
||||||
|
'label',
|
||||||
|
[
|
||||||
|
'input',
|
||||||
|
{
|
||||||
|
type: 'checkbox',
|
||||||
|
checked: node.attrs.checked
|
||||||
|
? 'checked'
|
||||||
|
: null,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
['span'],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'div',
|
||||||
|
0,
|
||||||
|
],
|
||||||
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
addKeyboardShortcuts() {
|
addKeyboardShortcuts() {
|
||||||
|
|||||||
@@ -3,6 +3,30 @@
|
|||||||
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.132](https://github.com/ueberdosis/tiptap/compare/@tiptap/html@2.0.0-beta.131...@tiptap/html@2.0.0-beta.132) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.131](https://github.com/ueberdosis/tiptap/compare/@tiptap/html@2.0.0-beta.130...@tiptap/html@2.0.0-beta.131) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.130](https://github.com/ueberdosis/tiptap/compare/@tiptap/html@2.0.0-beta.129...@tiptap/html@2.0.0-beta.130) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.129](https://github.com/ueberdosis/tiptap/compare/@tiptap/html@2.0.0-beta.128...@tiptap/html@2.0.0-beta.129) (2021-10-31)
|
# [2.0.0-beta.129](https://github.com/ueberdosis/tiptap/compare/@tiptap/html@2.0.0-beta.128...@tiptap/html@2.0.0-beta.129) (2021-10-31)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/html
|
**Note:** Version bump only for package @tiptap/html
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/html",
|
"name": "@tiptap/html",
|
||||||
"description": "utility package to render tiptap JSON as HTML",
|
"description": "utility package to render tiptap JSON as HTML",
|
||||||
"version": "2.0.0-beta.129",
|
"version": "2.0.0-beta.132",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tiptap/core": "^2.0.0-beta.130",
|
"@tiptap/core": "^2.0.0-beta.133",
|
||||||
"hostic-dom": "^0.8.7",
|
"hostic-dom": "^0.8.7",
|
||||||
"prosemirror-model": "^1.15.0"
|
"prosemirror-model": "^1.15.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
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.89](https://github.com/ueberdosis/tiptap/compare/@tiptap/react@2.0.0-beta.88...@tiptap/react@2.0.0-beta.89) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/react
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.88](https://github.com/ueberdosis/tiptap/compare/@tiptap/react@2.0.0-beta.87...@tiptap/react@2.0.0-beta.88) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/react
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.87](https://github.com/ueberdosis/tiptap/compare/@tiptap/react@2.0.0-beta.86...@tiptap/react@2.0.0-beta.87) (2021-10-31)
|
# [2.0.0-beta.87](https://github.com/ueberdosis/tiptap/compare/@tiptap/react@2.0.0-beta.86...@tiptap/react@2.0.0-beta.87) (2021-10-31)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/react
|
**Note:** Version bump only for package @tiptap/react
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/react",
|
"name": "@tiptap/react",
|
||||||
"description": "React components for tiptap",
|
"description": "React components for tiptap",
|
||||||
"version": "2.0.0-beta.87",
|
"version": "2.0.0-beta.89",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -21,8 +21,8 @@
|
|||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^17.0.32",
|
"@types/react": "^17.0.34",
|
||||||
"@types/react-dom": "^17.0.10",
|
"@types/react-dom": "^17.0.11",
|
||||||
"react": "^17.0.0",
|
"react": "^17.0.0",
|
||||||
"react-dom": "^17.0.0"
|
"react-dom": "^17.0.0"
|
||||||
},
|
},
|
||||||
@@ -32,9 +32,9 @@
|
|||||||
"react-dom": "^17.0.0"
|
"react-dom": "^17.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tiptap/extension-bubble-menu": "^2.0.0-beta.44",
|
"@tiptap/extension-bubble-menu": "^2.0.0-beta.46",
|
||||||
"@tiptap/extension-floating-menu": "^2.0.0-beta.38",
|
"@tiptap/extension-floating-menu": "^2.0.0-beta.40",
|
||||||
"prosemirror-view": "^1.20.3"
|
"prosemirror-view": "^1.22.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -3,6 +3,30 @@
|
|||||||
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.135](https://github.com/ueberdosis/tiptap/compare/@tiptap/starter-kit@2.0.0-beta.134...@tiptap/starter-kit@2.0.0-beta.135) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/starter-kit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.134](https://github.com/ueberdosis/tiptap/compare/@tiptap/starter-kit@2.0.0-beta.133...@tiptap/starter-kit@2.0.0-beta.134) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/starter-kit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.133](https://github.com/ueberdosis/tiptap/compare/@tiptap/starter-kit@2.0.0-beta.132...@tiptap/starter-kit@2.0.0-beta.133) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/starter-kit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.132](https://github.com/ueberdosis/tiptap/compare/@tiptap/starter-kit@2.0.0-beta.131...@tiptap/starter-kit@2.0.0-beta.132) (2021-10-31)
|
# [2.0.0-beta.132](https://github.com/ueberdosis/tiptap/compare/@tiptap/starter-kit@2.0.0-beta.131...@tiptap/starter-kit@2.0.0-beta.132) (2021-10-31)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/starter-kit
|
**Note:** Version bump only for package @tiptap/starter-kit
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/starter-kit",
|
"name": "@tiptap/starter-kit",
|
||||||
"description": "starter kit for tiptap",
|
"description": "starter kit for tiptap",
|
||||||
"version": "2.0.0-beta.132",
|
"version": "2.0.0-beta.135",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tiptap/core": "^2.0.0-beta.130",
|
"@tiptap/core": "^2.0.0-beta.133",
|
||||||
"@tiptap/extension-blockquote": "^2.0.0-beta.21",
|
"@tiptap/extension-blockquote": "^2.0.0-beta.21",
|
||||||
"@tiptap/extension-bold": "^2.0.0-beta.21",
|
"@tiptap/extension-bold": "^2.0.0-beta.21",
|
||||||
"@tiptap/extension-bullet-list": "^2.0.0-beta.20",
|
"@tiptap/extension-bullet-list": "^2.0.0-beta.20",
|
||||||
@@ -30,10 +30,10 @@
|
|||||||
"@tiptap/extension-document": "^2.0.0-beta.13",
|
"@tiptap/extension-document": "^2.0.0-beta.13",
|
||||||
"@tiptap/extension-dropcursor": "^2.0.0-beta.21",
|
"@tiptap/extension-dropcursor": "^2.0.0-beta.21",
|
||||||
"@tiptap/extension-gapcursor": "^2.0.0-beta.30",
|
"@tiptap/extension-gapcursor": "^2.0.0-beta.30",
|
||||||
"@tiptap/extension-hard-break": "^2.0.0-beta.26",
|
"@tiptap/extension-hard-break": "^2.0.0-beta.27",
|
||||||
"@tiptap/extension-heading": "^2.0.0-beta.20",
|
"@tiptap/extension-heading": "^2.0.0-beta.20",
|
||||||
"@tiptap/extension-history": "^2.0.0-beta.18",
|
"@tiptap/extension-history": "^2.0.0-beta.18",
|
||||||
"@tiptap/extension-horizontal-rule": "^2.0.0-beta.26",
|
"@tiptap/extension-horizontal-rule": "^2.0.0-beta.27",
|
||||||
"@tiptap/extension-italic": "^2.0.0-beta.21",
|
"@tiptap/extension-italic": "^2.0.0-beta.21",
|
||||||
"@tiptap/extension-list-item": "^2.0.0-beta.16",
|
"@tiptap/extension-list-item": "^2.0.0-beta.16",
|
||||||
"@tiptap/extension-ordered-list": "^2.0.0-beta.21",
|
"@tiptap/extension-ordered-list": "^2.0.0-beta.21",
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
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.79](https://github.com/ueberdosis/tiptap/compare/@tiptap/suggestion@2.0.0-beta.78...@tiptap/suggestion@2.0.0-beta.79) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/suggestion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.78](https://github.com/ueberdosis/tiptap/compare/@tiptap/suggestion@2.0.0-beta.77...@tiptap/suggestion@2.0.0-beta.78) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/suggestion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.77](https://github.com/ueberdosis/tiptap/compare/@tiptap/suggestion@2.0.0-beta.76...@tiptap/suggestion@2.0.0-beta.77) (2021-10-31)
|
# [2.0.0-beta.77](https://github.com/ueberdosis/tiptap/compare/@tiptap/suggestion@2.0.0-beta.76...@tiptap/suggestion@2.0.0-beta.77) (2021-10-31)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/suggestion
|
**Note:** Version bump only for package @tiptap/suggestion
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/suggestion",
|
"name": "@tiptap/suggestion",
|
||||||
"description": "suggestion plugin for tiptap",
|
"description": "suggestion plugin for tiptap",
|
||||||
"version": "2.0.0-beta.77",
|
"version": "2.0.0-beta.79",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"prosemirror-model": "^1.15.0",
|
"prosemirror-model": "^1.15.0",
|
||||||
"prosemirror-state": "^1.3.4",
|
"prosemirror-state": "^1.3.4",
|
||||||
"prosemirror-view": "^1.20.3"
|
"prosemirror-view": "^1.22.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
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.64](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-2@2.0.0-beta.63...@tiptap/vue-2@2.0.0-beta.64) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/vue-2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.63](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-2@2.0.0-beta.62...@tiptap/vue-2@2.0.0-beta.63) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/vue-2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.62](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-2@2.0.0-beta.61...@tiptap/vue-2@2.0.0-beta.62) (2021-10-31)
|
# [2.0.0-beta.62](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-2@2.0.0-beta.61...@tiptap/vue-2@2.0.0-beta.62) (2021-10-31)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/vue-2
|
**Note:** Version bump only for package @tiptap/vue-2
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/vue-2",
|
"name": "@tiptap/vue-2",
|
||||||
"description": "Vue components for tiptap",
|
"description": "Vue components for tiptap",
|
||||||
"version": "2.0.0-beta.62",
|
"version": "2.0.0-beta.64",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -28,9 +28,9 @@
|
|||||||
"vue": "^2.6.0"
|
"vue": "^2.6.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tiptap/extension-bubble-menu": "^2.0.0-beta.44",
|
"@tiptap/extension-bubble-menu": "^2.0.0-beta.46",
|
||||||
"@tiptap/extension-floating-menu": "^2.0.0-beta.38",
|
"@tiptap/extension-floating-menu": "^2.0.0-beta.40",
|
||||||
"prosemirror-view": "^1.20.3"
|
"prosemirror-view": "^1.22.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
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.76](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-3@2.0.0-beta.75...@tiptap/vue-3@2.0.0-beta.76) (2021-11-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/vue-3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.0.0-beta.75](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-3@2.0.0-beta.74...@tiptap/vue-3@2.0.0-beta.75) (2021-11-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @tiptap/vue-3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [2.0.0-beta.74](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-3@2.0.0-beta.73...@tiptap/vue-3@2.0.0-beta.74) (2021-10-31)
|
# [2.0.0-beta.74](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-3@2.0.0-beta.73...@tiptap/vue-3@2.0.0-beta.74) (2021-10-31)
|
||||||
|
|
||||||
**Note:** Version bump only for package @tiptap/vue-3
|
**Note:** Version bump only for package @tiptap/vue-3
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tiptap/vue-3",
|
"name": "@tiptap/vue-3",
|
||||||
"description": "Vue components for tiptap",
|
"description": "Vue components for tiptap",
|
||||||
"version": "2.0.0-beta.74",
|
"version": "2.0.0-beta.76",
|
||||||
"homepage": "https://tiptap.dev",
|
"homepage": "https://tiptap.dev",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tiptap",
|
"tiptap",
|
||||||
@@ -28,10 +28,10 @@
|
|||||||
"vue": "^3.0.0"
|
"vue": "^3.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tiptap/extension-bubble-menu": "^2.0.0-beta.44",
|
"@tiptap/extension-bubble-menu": "^2.0.0-beta.46",
|
||||||
"@tiptap/extension-floating-menu": "^2.0.0-beta.38",
|
"@tiptap/extension-floating-menu": "^2.0.0-beta.40",
|
||||||
"prosemirror-state": "^1.3.4",
|
"prosemirror-state": "^1.3.4",
|
||||||
"prosemirror-view": "^1.20.3"
|
"prosemirror-view": "^1.22.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
import { onMounted, onBeforeUnmount, shallowRef } from 'vue'
|
import {
|
||||||
|
onMounted,
|
||||||
|
onBeforeUnmount,
|
||||||
|
shallowRef,
|
||||||
|
Ref,
|
||||||
|
} from 'vue'
|
||||||
import { EditorOptions } from '@tiptap/core'
|
import { EditorOptions } from '@tiptap/core'
|
||||||
import { Editor } from './Editor'
|
import { Editor } from './Editor'
|
||||||
|
|
||||||
export const useEditor = (options: Partial<EditorOptions> = {}) => {
|
// We set a custom return type. Otherwise TypeScript will throw TS4023. Not sure why.
|
||||||
const editor = shallowRef<Editor>()
|
export const useEditor = (options: Partial<EditorOptions> = {}): Ref<Editor> => {
|
||||||
|
const editor = shallowRef<Editor>() as Ref<Editor>
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
editor.value = new Editor(options)
|
editor.value = new Editor(options)
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ describe('fromString', () => {
|
|||||||
expect(value).to.eq('test')
|
expect(value).to.eq('test')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should return an empty string', () => {
|
||||||
|
const value = fromString('')
|
||||||
|
|
||||||
|
expect(value).to.eq('')
|
||||||
|
})
|
||||||
|
|
||||||
it('should convert to a number', () => {
|
it('should convert to a number', () => {
|
||||||
const value = fromString('1')
|
const value = fromString('1')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user