Merge branch 'main' of github.com:ueberdosis/tiptap-next into main

This commit is contained in:
Hans Pagel 2020-11-12 10:04:05 +01:00
commit 86c7f752f1
19 changed files with 179 additions and 25 deletions

View File

@ -148,6 +148,8 @@ jobs:
- name: Try to build the packages - name: Try to build the packages
id: build-packages id: build-packages
run: yarn build:ci run: yarn build:ci
env:
NODE_OPTIONS: --max_old_space_size=8192
- name: Send Slack notifications - name: Send Slack notifications
uses: act10ns/slack@v1 uses: act10ns/slack@v1

View File

@ -0,0 +1,24 @@
<template>
<div>
<full-editor v-model="content" />
<div>
{{ content }}
</div>
</div>
</template>
<script>
import { FullEditor } from '@tiptap/vue'
export default {
components: {
FullEditor,
},
data() {
return {
content: '<p>full editor</p>',
}
},
}
</script>

View File

@ -0,0 +1,3 @@
# Full Editor
<demo name="Examples/FullEditor" />

View File

@ -13,7 +13,7 @@ import { Editor } from '@tiptap/core'
import { defaultExtensions } from '@tiptap/starter-kit' import { defaultExtensions } from '@tiptap/starter-kit'
new Editor({ new Editor({
element: document.getElementsByClassName('element'), element: document.querySelector('.element'),
extensions: defaultExtensions(), extensions: defaultExtensions(),
content: '<p>Hey there!</p>', content: '<p>Hey there!</p>',
autoFocus: true, autoFocus: true,

View File

@ -54,6 +54,8 @@
"levenary": "^1.1.1", "levenary": "^1.1.1",
"minimist": "^1.2.5", "minimist": "^1.2.5",
"rollup": "^2.33.1", "rollup": "^2.33.1",
"rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.29.0", "rollup-plugin-typescript2": "^0.29.0",
"rollup-plugin-vue": "5", "rollup-plugin-vue": "5",

View File

@ -19,6 +19,7 @@
"prosemirror-schema-list": "^1.1.4", "prosemirror-schema-list": "^1.1.4",
"prosemirror-state": "^1.3.3", "prosemirror-state": "^1.3.3",
"prosemirror-tables": "^1.1.1", "prosemirror-tables": "^1.1.1",
"prosemirror-transform": "^1.2.8",
"prosemirror-utils": "^1.0.0-0", "prosemirror-utils": "^1.0.0-0",
"prosemirror-view": "^1.16.1" "prosemirror-view": "^1.16.1"
} }

View File

@ -12,5 +12,8 @@
], ],
"peerDependencies": { "peerDependencies": {
"@tiptap/core": "2.x" "@tiptap/core": "2.x"
},
"dependencies": {
"prosemirror-inputrules": "^1.1.3"
} }
} }

View File

@ -12,5 +12,8 @@
], ],
"peerDependencies": { "peerDependencies": {
"@tiptap/core": "2.x" "@tiptap/core": "2.x"
},
"dependencies": {
"prosemirror-inputrules": "^1.1.3"
} }
} }

View File

@ -12,5 +12,8 @@
], ],
"peerDependencies": { "peerDependencies": {
"@tiptap/core": "2.x" "@tiptap/core": "2.x"
},
"dependencies": {
"prosemirror-inputrules": "^1.1.3"
} }
} }

View File

@ -11,7 +11,10 @@
"dist" "dist"
], ],
"peerDependencies": { "peerDependencies": {
"@tiptap/core": "2.x", "@tiptap/core": "2.x"
"prosemirror-state": "^1.3.3" },
"dependencies": {
"prosemirror-state": "^1.3.3",
"prosemirror-view": "^1.16.1"
} }
} }

View File

@ -12,5 +12,9 @@
], ],
"peerDependencies": { "peerDependencies": {
"@tiptap/core": "2.x" "@tiptap/core": "2.x"
},
"dependencies": {
"@types/prosemirror-inputrules": "^1.0.3",
"prosemirror-inputrules": "^1.1.3"
} }
} }

View File

@ -12,5 +12,8 @@
], ],
"peerDependencies": { "peerDependencies": {
"@tiptap/core": "2.x" "@tiptap/core": "2.x"
},
"dependencies": {
"prosemirror-state": "^1.3.3"
} }
} }

View File

@ -12,5 +12,8 @@
], ],
"peerDependencies": { "peerDependencies": {
"@tiptap/core": "2.x" "@tiptap/core": "2.x"
},
"dependencies": {
"prosemirror-inputrules": "^1.1.3"
} }
} }

View File

@ -12,5 +12,8 @@
], ],
"peerDependencies": { "peerDependencies": {
"@tiptap/core": "2.x" "@tiptap/core": "2.x"
},
"dependencies": {
"prosemirror-inputrules": "^1.1.3"
} }
} }

View File

@ -15,6 +15,7 @@
"vue": "2.x" "vue": "2.x"
}, },
"dependencies": { "dependencies": {
"prosemirror-view": "^1.16.1" "prosemirror-view": "^1.16.1",
"@tiptap/starter-kit": "1.x"
} }
} }

View File

@ -0,0 +1,45 @@
<template>
<div>
<editor-content :editor="editor" />
</div>
</template>
<script>
import { Editor } from '@tiptap/core'
import { defaultExtensions } from '@tiptap/starter-kit'
import EditorContent from './EditorContent.ts'
export default {
components: {
EditorContent,
},
props: {
value: {
type: [String, Object],
default: '',
},
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
extensions: defaultExtensions(),
content: this.value,
})
this.editor.on('update', () => {
this.$emit('input', this.editor.getHTML())
})
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>

View File

@ -1,3 +1,4 @@
export * from '@tiptap/core' export * from '@tiptap/core'
export { default as VueRenderer } from './VueRenderer' export { default as VueRenderer } from './VueRenderer'
export { default as EditorContent } from './components/EditorContent' export { default as EditorContent } from './components/EditorContent'
export { default as FullEditor } from './components/FullEditor.vue'

View File

@ -3,6 +3,7 @@ import minimist from 'minimist'
import { getPackages } from '@lerna/project' import { getPackages } from '@lerna/project'
import filterPackages from '@lerna/filter-packages' import filterPackages from '@lerna/filter-packages'
import batchPackages from '@lerna/batch-packages' import batchPackages from '@lerna/batch-packages'
import sourcemaps from 'rollup-plugin-sourcemaps'
import typescript from 'rollup-plugin-typescript2' import typescript from 'rollup-plugin-typescript2'
import resolve from '@rollup/plugin-node-resolve' import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs' import commonjs from '@rollup/plugin-commonjs'
@ -10,6 +11,7 @@ import vuePlugin from 'rollup-plugin-vue'
import babel from '@rollup/plugin-babel' import babel from '@rollup/plugin-babel'
import { terser } from 'rollup-plugin-terser' import { terser } from 'rollup-plugin-terser'
import sizes from '@atomico/rollup-plugin-sizes' import sizes from '@atomico/rollup-plugin-sizes'
import autoExternal from 'rollup-plugin-auto-external'
async function getSortedPackages(scope, ignore) { async function getSortedPackages(scope, ignore) {
const packages = await getPackages(__dirname) const packages = await getPackages(__dirname)
@ -44,11 +46,13 @@ async function build(commandLineArgs) {
} = pkg.toJSON() } = pkg.toJSON()
const basePlugins = [ const basePlugins = [
sourcemaps(),
resolve(), resolve(),
commonjs(), commonjs(),
vuePlugin(), vuePlugin(),
babel({ babel({
babelHelpers: 'bundled', babelHelpers: 'bundled',
exclude: 'node_modules/**',
}), }),
sizes(), sizes(),
] ]
@ -76,12 +80,10 @@ async function build(commandLineArgs) {
sourcemap: true, sourcemap: true,
}, },
], ],
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.devDependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
],
plugins: [ plugins: [
autoExternal({
packagePath: path.join(basePath, 'package.json'),
}),
...basePlugins, ...basePlugins,
typescript({ typescript({
tsconfigOverride: { tsconfigOverride: {

View File

@ -2103,7 +2103,7 @@
is-module "^1.0.0" is-module "^1.0.0"
resolve "^1.17.0" resolve "^1.17.0"
"@rollup/pluginutils@^3.1.0": "@rollup/pluginutils@^3.0.9", "@rollup/pluginutils@^3.1.0":
version "3.1.0" version "3.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
@ -3292,9 +3292,9 @@ balanced-match@^1.0.0:
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
base64-js@^1.0.2, base64-js@^1.3.1: base64-js@^1.0.2, base64-js@^1.3.1:
version "1.5.0" version "1.5.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.0.tgz#2d03045876d9e2b68a7a0f87d6bd163595e3b6af" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
integrity sha512-Jrdy04F2EKcNggUDfubMUPNAZg2vMquLQSm8sKLYJvz40ClFL1S8GKyDshGkNsbNNE5Z+fQavzU7nSK1I9JUGA== integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
base@^0.11.1: base@^0.11.1:
version "0.11.2" version "0.11.2"
@ -3675,6 +3675,13 @@ builtins@^1.0.3:
resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88"
integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og= integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og=
builtins@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/builtins/-/builtins-2.0.1.tgz#42a4d6fe38973a7c185b435970d13e5e70f70f3c"
integrity sha512-XkkVe5QAb6guWPXTzpSrYpSlN3nqEmrrE2TkAr/tp7idSF6+MONh9WvKrAuR3HiKLvoSgmbs8l1U9IPmMrIoLw==
dependencies:
semver "^6.0.0"
byline@^5.0.0: byline@^5.0.0:
version "5.0.0" version "5.0.0"
resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1"
@ -5344,7 +5351,7 @@ domutils@^1.5.1, domutils@^1.7.0:
dom-serializer "0" dom-serializer "0"
domelementtype "1" domelementtype "1"
domutils@^2.0.0: domutils@^2.0.0, domutils@^2.4.2:
version "2.4.2" version "2.4.2"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.4.2.tgz#7ee5be261944e1ad487d9aa0616720010123922b" resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.4.2.tgz#7ee5be261944e1ad487d9aa0616720010123922b"
integrity sha512-NKbgaM8ZJOecTZsIzW5gSuplsX2IWW2mIK7xVr8hTQF2v1CJWTmLZ1HOCh5sH+IzVPAGE5IucooOkvwBRAdowA== integrity sha512-NKbgaM8ZJOecTZsIzW5gSuplsX2IWW2mIK7xVr8hTQF2v1CJWTmLZ1HOCh5sH+IzVPAGE5IucooOkvwBRAdowA==
@ -5454,9 +5461,9 @@ ee-first@1.1.1:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
electron-to-chromium@^1.3.591: electron-to-chromium@^1.3.591:
version "1.3.592" version "1.3.593"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.592.tgz#4621521b223bf6e5469373528321e185d3c24670" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.593.tgz#947ccf6dc8e013e2b053d2463ecd1043c164fcef"
integrity sha512-kGNowksvqQiPb1pUSQKpd8JFoGPLxYOwduNRCqCxGh/2Q1qE2JdmwouCW41lUzDxOb/2RIV4lR0tVIfboWlO9A== integrity sha512-GvO7G1ZxvffnMvPCr4A7+iQPVuvpyqMrx2VWSERAjG+pHK6tmO9XqYdBfMIq9corRyi4bNImSDEiDvIoDb8HrA==
elegant-spinner@^1.0.1: elegant-spinner@^1.0.1:
version "1.0.1" version "1.0.1"
@ -5696,11 +5703,11 @@ eslint-plugin-cypress@^2.11.2:
globals "^11.12.0" globals "^11.12.0"
eslint-plugin-html@^6.1.0: eslint-plugin-html@^6.1.0:
version "6.1.0" version "6.1.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-html/-/eslint-plugin-html-6.1.0.tgz#0e0d4845d4b3eb6e199652385e272f7b722673db" resolved "https://registry.yarnpkg.com/eslint-plugin-html/-/eslint-plugin-html-6.1.1.tgz#95aee151900b9bb2da5fa017b45cc64456a0a74e"
integrity sha512-xcqithhnjUxoEDRL0hYci4RSS8EZ1NGr3/H8x3BxJvxgbu4R3YaEUea9i93j95NuAgoAbOUfNmybta8fqi4UbA== integrity sha512-JSe3ZDb7feKMnQM27XWGeoIjvP4oWQMJD9GZ6wW67J7/plVL87NK72RBwlvfc3tTZiYUchHhxAwtgEd1GdofDA==
dependencies: dependencies:
htmlparser2 "^4.1.0" htmlparser2 "^5.0.1"
eslint-plugin-import@^2.22.1: eslint-plugin-import@^2.22.1:
version "2.22.1" version "2.22.1"
@ -7442,6 +7449,16 @@ htmlparser2@^4.1.0:
domutils "^2.0.0" domutils "^2.0.0"
entities "^2.0.0" entities "^2.0.0"
htmlparser2@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-5.0.1.tgz#7daa6fc3e35d6107ac95a4fc08781f091664f6e7"
integrity sha512-vKZZra6CSe9qsJzh0BjBGXo8dvzNsq/oGvsjfRdOrrryfeD9UOBEEQdeoqCRmKZchF5h2zOBMQ6YuQ0uRUmdbQ==
dependencies:
domelementtype "^2.0.1"
domhandler "^3.3.0"
domutils "^2.4.2"
entities "^2.0.0"
http-cache-semantics@3.8.1, http-cache-semantics@^3.8.1: http-cache-semantics@3.8.1, http-cache-semantics@^3.8.1:
version "3.8.1" version "3.8.1"
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2"
@ -11185,7 +11202,7 @@ prosemirror-tables@^1.1.1:
prosemirror-transform "^1.2.1" prosemirror-transform "^1.2.1"
prosemirror-view "^1.13.3" prosemirror-view "^1.13.3"
prosemirror-transform@^1.0.0, prosemirror-transform@^1.1.0, prosemirror-transform@^1.2.1: prosemirror-transform@^1.0.0, prosemirror-transform@^1.1.0, prosemirror-transform@^1.2.1, prosemirror-transform@^1.2.8:
version "1.2.8" version "1.2.8"
resolved "https://registry.yarnpkg.com/prosemirror-transform/-/prosemirror-transform-1.2.8.tgz#4b86544fa43637fe381549fb7b019f4fb71fe65c" resolved "https://registry.yarnpkg.com/prosemirror-transform/-/prosemirror-transform-1.2.8.tgz#4b86544fa43637fe381549fb7b019f4fb71fe65c"
integrity sha512-hKqceqv9ZmMQXNQkhFjr0KFGPvkhygaWND+uIM0GxRpALrKfxP97SsgHTBs3OpJhDmh5N+mB4D/CksB291Eavg== integrity sha512-hKqceqv9ZmMQXNQkhFjr0KFGPvkhygaWND+uIM0GxRpALrKfxP97SsgHTBs3OpJhDmh5N+mB4D/CksB291Eavg==
@ -12118,6 +12135,24 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
hash-base "^3.0.0" hash-base "^3.0.0"
inherits "^2.0.1" inherits "^2.0.1"
rollup-plugin-auto-external@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-auto-external/-/rollup-plugin-auto-external-2.0.0.tgz#98fd137d66c1cbe0f4e245b31560a72dbde896aa"
integrity sha512-HQM3ZkZYfSam1uoZtAB9sK26EiAsfs1phrkf91c/YX+S07wugyRXSigBxrIwiLr5EPPilKYmoMxsrnlGBsXnuQ==
dependencies:
builtins "^2.0.0"
read-pkg "^3.0.0"
safe-resolve "^1.0.0"
semver "^5.5.0"
rollup-plugin-sourcemaps@^0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed"
integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==
dependencies:
"@rollup/pluginutils" "^3.0.9"
source-map-resolve "^0.6.0"
rollup-plugin-terser@^7.0.2: rollup-plugin-terser@^7.0.2:
version "7.0.2" version "7.0.2"
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d"
@ -12214,6 +12249,11 @@ safe-regex@^1.1.0:
dependencies: dependencies:
ret "~0.1.10" ret "~0.1.10"
safe-resolve@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/safe-resolve/-/safe-resolve-1.0.0.tgz#fe34f8d29d7a3becfd249d0aa8a799b5c3cf6559"
integrity sha1-/jT40p16O+z9JJ0KqKeZtcPPZVk=
"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@^2.1.2, safer-buffer@~2.1.0: "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@^2.1.2, safer-buffer@~2.1.0:
version "2.1.2" version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
@ -12240,9 +12280,9 @@ sass-graph@2.2.5:
yargs "^13.3.2" yargs "^13.3.2"
sass-loader@^10.0.3: sass-loader@^10.0.3:
version "10.0.5" version "10.1.0"
resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-10.0.5.tgz#f53505b5ddbedf43797470ceb34066ded82bb769" resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-10.1.0.tgz#1727fcc0c32ab3eb197cda61d78adf4e9174a4b3"
integrity sha512-2LqoNPtKkZq/XbXNQ4C64GFEleSEHKv6NPSI+bMC/l+jpEXGJhiRYkAQToO24MR7NU4JRY2RpLpJ/gjo2Uf13w== integrity sha512-ZCKAlczLBbFd3aGAhowpYEy69Te3Z68cg8bnHHl6WnSCvnKpbM6pQrz957HWMa8LKVuhnD9uMplmMAHwGQtHeg==
dependencies: dependencies:
klona "^2.0.4" klona "^2.0.4"
loader-utils "^2.0.0" loader-utils "^2.0.0"
@ -12720,6 +12760,14 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2:
source-map-url "^0.4.0" source-map-url "^0.4.0"
urix "^0.1.0" urix "^0.1.0"
source-map-resolve@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2"
integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==
dependencies:
atob "^2.1.2"
decode-uri-component "^0.2.0"
source-map-support@~0.5.12, source-map-support@~0.5.19: source-map-support@~0.5.12, source-map-support@~0.5.19:
version "0.5.19" version "0.5.19"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"