From d8e82959ec828c5b40c8785088ea759d362dc9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Tue, 27 Oct 2020 21:38:29 +0100 Subject: [PATCH 001/113] add some random image --- docs/src/demos/Extensions/Image/index.vue | 2 +- docs/src/layouts/App/base.scss | 5 +++++ packages/extension-image/index.ts | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/src/demos/Extensions/Image/index.vue b/docs/src/demos/Extensions/Image/index.vue index 52615a3b4..699814693 100644 --- a/docs/src/demos/Extensions/Image/index.vue +++ b/docs/src/demos/Extensions/Image/index.vue @@ -33,7 +33,7 @@ export default { ], content: `

This is basic example of implementing images. Try to drop new images here. Reordering also works.

- + `, }) }, diff --git a/docs/src/layouts/App/base.scss b/docs/src/layouts/App/base.scss index 95b824ad9..39e5629b7 100644 --- a/docs/src/layouts/App/base.scss +++ b/docs/src/layouts/App/base.scss @@ -109,6 +109,11 @@ code { } } + img { + width: 100%; + height: auto; + } + hr { margin: 1rem 0; } diff --git a/packages/extension-image/index.ts b/packages/extension-image/index.ts index 605a4b52c..73264e60f 100644 --- a/packages/extension-image/index.ts +++ b/packages/extension-image/index.ts @@ -10,6 +10,8 @@ const Image = createNode({ group: 'inline', + draggable: true, + addAttributes() { return { src: { From a731ff8ea2b42453ab6a39d02bfd3b4ca54b0b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Tue, 27 Oct 2020 22:35:31 +0100 Subject: [PATCH 002/113] refactoring --- docs/src/demos/Extensions/Image/index.vue | 11 ++++ docs/src/layouts/App/base.scss | 2 +- packages/extension-image/index.ts | 71 +++-------------------- 3 files changed, 19 insertions(+), 65 deletions(-) diff --git a/docs/src/demos/Extensions/Image/index.vue b/docs/src/demos/Extensions/Image/index.vue index 699814693..f390a7ac5 100644 --- a/docs/src/demos/Extensions/Image/index.vue +++ b/docs/src/demos/Extensions/Image/index.vue @@ -1,5 +1,8 @@ @@ -23,6 +26,14 @@ export default { } }, + methods: { + addImage() { + const url = window.prompt('URL') + + this.editor.chain().focus().image({ src: url }).run() + }, + }, + mounted() { this.editor = new Editor({ extensions: [ diff --git a/docs/src/layouts/App/base.scss b/docs/src/layouts/App/base.scss index 39e5629b7..2efeb9e11 100644 --- a/docs/src/layouts/App/base.scss +++ b/docs/src/layouts/App/base.scss @@ -110,7 +110,7 @@ code { } img { - width: 100%; + max-width: 100%; height: auto; } diff --git a/packages/extension-image/index.ts b/packages/extension-image/index.ts index 73264e60f..424cffc5f 100644 --- a/packages/extension-image/index.ts +++ b/packages/extension-image/index.ts @@ -1,7 +1,6 @@ import { Command, createNode, nodeInputRule } from '@tiptap/core' -import { Plugin } from 'prosemirror-state' -const IMAGE_INPUT_REGEX = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/ +export const inputRegex = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/ const Image = createNode({ name: 'image', @@ -40,13 +39,11 @@ const Image = createNode({ addCommands() { return { - image: (attrs: any): Command => ({ tr }) => { + image: (options: { src: string, alt?: string, title?: string }): Command => ({ tr }) => { const { selection } = tr - console.log({ selection }) - // const position = selection.$cursor ? selection.$cursor.pos : selection.$to.pos - const position = selection.$anchor ? selection.$anchor.pos : selection.$to.pos - const node = this.type.create(attrs) - tr.insert(position, node) + const node = this.type.create(options) + + tr.replaceRangeWith(selection.from, selection.to, node) return true }, @@ -55,64 +52,10 @@ const Image = createNode({ addInputRules() { return [ - nodeInputRule(IMAGE_INPUT_REGEX, this.type, match => { + nodeInputRule(inputRegex, this.type, match => { const [, alt, src, title] = match - return { - src, - alt, - title, - } - }), - ] - }, - addProseMirrorPlugins() { - return [ - new Plugin({ - props: { - handleDOMEvents: { - drop(view, event) { - const hasFiles = event.dataTransfer - && event.dataTransfer.files - && event.dataTransfer.files.length - - if (!hasFiles) { - return false - } - - const images = Array - // @ts-ignore - .from(event.dataTransfer.files) - .filter(file => (/image/i).test(file.type)) - - if (images.length === 0) { - return false - } - - event.preventDefault() - - const { schema } = view.state - const coordinates = view.posAtCoords({ left: event.clientX, top: event.clientY }) - - images.forEach(image => { - const reader = new FileReader() - - reader.onload = readerEvent => { - const node = schema.nodes.image.create({ - // @ts-ignore - src: readerEvent.target.result, - }) - // @ts-ignore - const transaction = view.state.tr.insert(coordinates.pos, node) - view.dispatch(transaction) - } - reader.readAsDataURL(image) - }) - - return true - }, - }, - }, + return { src, alt, title } }), ] }, From 2c787625d3d19512da52b26985d4f9cb6eb563e9 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 27 Oct 2020 22:40:07 +0100 Subject: [PATCH 003/113] code style --- packages/extension-strike/index.ts | 3 +-- packages/extension-underline/index.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/extension-strike/index.ts b/packages/extension-strike/index.ts index caedb10ac..1e31a8a01 100644 --- a/packages/extension-strike/index.ts +++ b/packages/extension-strike/index.ts @@ -20,8 +20,7 @@ const Strike = createMark({ tag: 'strike', }, { - style: 'text-decoration', - getAttrs: node => (node === 'line-through' ? {} : false), + style: 'text-decoration=line-through', }, ] }, diff --git a/packages/extension-underline/index.ts b/packages/extension-underline/index.ts index a9eeba867..91d342c69 100644 --- a/packages/extension-underline/index.ts +++ b/packages/extension-underline/index.ts @@ -9,8 +9,7 @@ const Underline = createMark({ tag: 'u', }, { - style: 'text-decoration', - getAttrs: node => (node === 'underline' ? {} : false), + style: 'text-decoration=underline', }, ] }, From bfb52ebfa637071e385491745e0156648839847b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Tue, 27 Oct 2020 22:41:19 +0100 Subject: [PATCH 004/113] update image content --- docs/src/demos/Extensions/Image/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/demos/Extensions/Image/index.vue b/docs/src/demos/Extensions/Image/index.vue index f390a7ac5..1808e6faa 100644 --- a/docs/src/demos/Extensions/Image/index.vue +++ b/docs/src/demos/Extensions/Image/index.vue @@ -43,8 +43,9 @@ export default { Image(), ], content: ` -

This is basic example of implementing images. Try to drop new images here. Reordering also works.

+

This is a basic example of implementing images. Drag to re-order.

+ `, }) }, From 9c8cb574fb437cb047a993a5819a7648d9f6be37 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 27 Oct 2020 22:43:38 +0100 Subject: [PATCH 005/113] add new extension links to the overview --- docs/src/docPages/api/extensions.md | 2 ++ docs/src/docPages/api/extensions/text-align.md | 2 +- docs/src/links.yaml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/src/docPages/api/extensions.md b/docs/src/docPages/api/extensions.md index c7dfc51ba..fb64e40f7 100644 --- a/docs/src/docPages/api/extensions.md +++ b/docs/src/docPages/api/extensions.md @@ -26,6 +26,7 @@ You don’t have to use it, but we prepared a `@tiptap/vue-starter-kit` which in | [Heading](/api/extensions/heading) | Yes | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-heading/) | | [History](/api/extensions/history) | Yes | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-history/) | | [HorizontalRule](/api/extensions/horizontal-rule) | Yes | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-horizontal-rule/) | +| [Image](/api/extensions/image) | – | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-image/) | | [Italic](/api/extensions/italic) | Yes | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-italic/) | | [Link](/api/extensions/link) | – | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-link/) | | [ListItem](/api/extensions/list-item) | Yes | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-list-item/) | @@ -33,6 +34,7 @@ You don’t have to use it, but we prepared a `@tiptap/vue-starter-kit` which in | [Paragraph](/api/extensions/paragraph) | Yes | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-paragraph/) | | [Strike](/api/extensions/strike) | Yes | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-strike/) | | [Text](/api/extensions/text) | Yes | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-text/) | +| [TextAlign](/api/extensions/text-align) | – | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-text-align/) | | [Underline](/api/extensions/underline) | – | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-underline/) | diff --git a/docs/src/docPages/api/extensions/text-align.md b/docs/src/docPages/api/extensions/text-align.md index fdb3680af..4ebd9d234 100644 --- a/docs/src/docPages/api/extensions/text-align.md +++ b/docs/src/docPages/api/extensions/text-align.md @@ -1,4 +1,4 @@ -# Text Align +# TextAlign ## Installation ```bash diff --git a/docs/src/links.yaml b/docs/src/links.yaml index 1b6e7e8d2..7ca0c43c6 100644 --- a/docs/src/links.yaml +++ b/docs/src/links.yaml @@ -164,7 +164,7 @@ # draft: true - title: Text link: /api/extensions/text - - title: Text Align + - title: TextAlign link: /api/extensions/text-align draft: true # - title: TodoItem From af74a87820a7be8c9e1d2cd51aa1080677eeab37 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 27 Oct 2020 23:04:18 +0100 Subject: [PATCH 006/113] add note regarding vue 3 to the upgrade guide --- docs/src/docPages/overview/upgrade-guide.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/src/docPages/overview/upgrade-guide.md b/docs/src/docPages/overview/upgrade-guide.md index e996d06c9..b787f3001 100644 --- a/docs/src/docPages/overview/upgrade-guide.md +++ b/docs/src/docPages/overview/upgrade-guide.md @@ -14,6 +14,9 @@ Yes, it’s tedious work to upgrade your favorite text editor to a new API, but ## Upgrading from 1.x to 2.x The new API will look pretty familiar too you, but there are a ton of changes though. To make the upgrade a little bit easier, here is everything you need to know: +### Upgrade to Vue.js 3 +… + ### Explicitly register the Document, Text and Paragraph extensions Tiptap 1 tried to hide a few required extensions from you with the default setting `useBuiltInExtensions: true`. That setting has been removed and you’re required to import all extensions. Be sure to explicitly import at least the [Document](/api/extensions/document), [Paragraph](/api/extensions/paragraph) and [Text](/api/extensions/text) extensions. From 079c39a7d0ebca72e25f82bec5f480ebcf930a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Tue, 27 Oct 2020 23:16:45 +0100 Subject: [PATCH 007/113] refactor splitblock command --- packages/core/src/extensions/splitBlock.ts | 74 ++++++++++++++-------- 1 file changed, 48 insertions(+), 26 deletions(-) diff --git a/packages/core/src/extensions/splitBlock.ts b/packages/core/src/extensions/splitBlock.ts index b82be5e54..37aaa7da2 100644 --- a/packages/core/src/extensions/splitBlock.ts +++ b/packages/core/src/extensions/splitBlock.ts @@ -1,12 +1,8 @@ -// import { -// baseKeymap, chainCommands, newlineInCode, createParagraphNear, liftEmptyBlock, splitBlock, -// } from 'prosemirror-commands' import { canSplit } from 'prosemirror-transform' import { ContentMatch, Fragment } from 'prosemirror-model' import { NodeSelection, TextSelection } from 'prosemirror-state' import { Command } from '../Editor' import { createExtension } from '../Extension' -// import getNodeType from '../utils/getNodeType' function defaultBlockAt(match: ContentMatch) { for (let i = 0; i < match.edgeCount; i + 1) { @@ -20,41 +16,67 @@ function defaultBlockAt(match: ContentMatch) { export const SplitBlock = createExtension({ addCommands() { return { - splitBlock: (copyAttributes = false): Command => ({ state, dispatch }) => { - // const type = getNodeType(typeOrName, state.schema) + splitBlock: (copyAttributes = false): Command => ({ tr, dispatch }) => { + const { selection, doc } = tr + const { $from, $to } = selection + + if (selection instanceof NodeSelection && selection.node.isBlock) { + if (!$from.parentOffset || !canSplit(doc, $from.pos)) { + return false + } + + if (dispatch) { + dispatch(tr.split($from.pos).scrollIntoView()) + } - const { $from, $to } = state.selection - if (state.selection instanceof NodeSelection && state.selection.node.isBlock) { - if (!$from.parentOffset || !canSplit(state.doc, $from.pos)) return false - if (dispatch) dispatch(state.tr.split($from.pos).scrollIntoView()) return true } - if (!$from.parent.isBlock) return false + if (!$from.parent.isBlock) { + return false + } if (dispatch) { const atEnd = $to.parentOffset === $to.parent.content.size - const { tr } = state - if (state.selection instanceof TextSelection) tr.deleteSelection() - const deflt = $from.depth === 0 ? null : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1))) - let types = atEnd && deflt ? [{ type: deflt, attrs: copyAttributes ? $from.node().attrs : {} }] : null - // let types = atEnd && deflt ? [{ type: deflt }] : null - // @ts-ignore + + if (selection instanceof TextSelection) { + tr.deleteSelection() + } + + const deflt = $from.depth === 0 + ? undefined + : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1))) + + let types = atEnd && deflt + ? [{ type: deflt, attrs: copyAttributes ? $from.node().attrs : {} }] + : undefined + let can = canSplit(tr.doc, tr.mapping.map($from.pos), 1, types) - // @ts-ignore - if (!types && !can && canSplit(tr.doc, tr.mapping.map($from.pos), 1, deflt && [{ type: deflt }])) { - // @ts-ignore - types = [{ type: deflt, attrs: copyAttributes ? $from.node().attrs : {} }] - // types = [{ type: deflt }] + + if ( + !types + && !can + && canSplit(tr.doc, tr.mapping.map($from.pos), 1, deflt ? [{ type: deflt }] : undefined) + ) { can = true + types = deflt + ? [{ type: deflt, attrs: copyAttributes ? $from.node().attrs : {} }] + : undefined } + if (can) { - // @ts-ignore tr.split(tr.mapping.map($from.pos), 1, types) - if (!atEnd && !$from.parentOffset && $from.parent.type !== deflt - // @ts-ignore - && $from.node(-1).canReplace($from.index(-1), $from.indexAfter(-1), Fragment.from(deflt.create(), $from.parent))) { tr.setNodeMarkup(tr.mapping.map($from.before()), deflt) } + + if ( + !atEnd + && !$from.parentOffset + && $from.parent.type !== deflt + && $from.node(-1).canReplace($from.index(-1), $from.indexAfter(-1), Fragment.from(deflt?.create())) + ) { + tr.setNodeMarkup(tr.mapping.map($from.before()), deflt || undefined) + } } + dispatch(tr.scrollIntoView()) } From 4a78ad15231b954c15de15ff2cc1e95094a3780f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Wed, 28 Oct 2020 08:53:03 +0100 Subject: [PATCH 008/113] smaller images --- docs/src/demos/Extensions/Image/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/demos/Extensions/Image/index.vue b/docs/src/demos/Extensions/Image/index.vue index 1808e6faa..b44f48028 100644 --- a/docs/src/demos/Extensions/Image/index.vue +++ b/docs/src/demos/Extensions/Image/index.vue @@ -44,8 +44,8 @@ export default { ], content: `

This is a basic example of implementing images. Drag to re-order.

- - + + `, }) }, From 8c3a2b7d1c3b656c1cf8636a9e1295dd4e0ab9d3 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 28 Oct 2020 15:25:06 +0100 Subject: [PATCH 009/113] rename table of contents to keep the search results clean --- docs/src/docPages/api/commands.md | 2 +- docs/src/docPages/api/editor.md | 2 +- docs/src/docPages/api/events.md | 2 +- docs/src/docPages/api/extensions.md | 2 +- docs/src/docPages/api/keyboard-shortcuts.md | 2 +- docs/src/docPages/api/schema.md | 2 +- docs/src/docPages/guide/build-your-editor.md | 2 +- docs/src/docPages/guide/collaborative-editing.md | 2 +- docs/src/docPages/guide/configuration.md | 2 +- docs/src/docPages/guide/custom-extensions.md | 4 ++-- docs/src/docPages/guide/custom-styling.md | 2 +- docs/src/docPages/guide/getting-started.md | 2 +- docs/src/docPages/guide/store-content.md | 2 +- docs/src/docPages/overview/contributing.md | 2 +- docs/src/docPages/overview/installation.md | 2 +- docs/src/docPages/overview/upgrade-guide.md | 2 +- docs/src/templates/DocPage/style.scss | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/src/docPages/api/commands.md b/docs/src/docPages/api/commands.md index 3192ed56d..80dd59c97 100644 --- a/docs/src/docPages/api/commands.md +++ b/docs/src/docPages/api/commands.md @@ -1,6 +1,6 @@ # Commands -## Table of Contents +## toc ## Introduction The editor provides a ton of commands to programmtically add or change content or alter the selection. If you want to build your own editor you definitely want to learn more about them. diff --git a/docs/src/docPages/api/editor.md b/docs/src/docPages/api/editor.md index 1e0f0c730..42422893f 100644 --- a/docs/src/docPages/api/editor.md +++ b/docs/src/docPages/api/editor.md @@ -1,6 +1,6 @@ # Editor -## Table of Contents +## toc ## Introduction This class is a central building block of tiptap. It does most of the heavy lifting of creating a working [ProseMirror](https://ProseMirror.net/) editor such as creating the [`EditorView`](https://ProseMirror.net/docs/ref/#view.EditorView), setting the initial [`EditorState`](https://ProseMirror.net/docs/ref/#state.Editor_State) and so on. diff --git a/docs/src/docPages/api/events.md b/docs/src/docPages/api/events.md index 45a6bb3c0..afd01daac 100644 --- a/docs/src/docPages/api/events.md +++ b/docs/src/docPages/api/events.md @@ -1,6 +1,6 @@ # Events -## Table of Contents +## toc ## Introduction The editor fires a few different events that you can hook into. There are two ways to register event listeners: diff --git a/docs/src/docPages/api/extensions.md b/docs/src/docPages/api/extensions.md index fb64e40f7..b06f53731 100644 --- a/docs/src/docPages/api/extensions.md +++ b/docs/src/docPages/api/extensions.md @@ -1,6 +1,6 @@ # Extensions -## Table of Contents +## toc ## Introduction Extensions are the way to add functionality to tiptap. By default tiptap comes bare, without any of them, but we have a long list of extensions that are ready to be used with tiptap. diff --git a/docs/src/docPages/api/keyboard-shortcuts.md b/docs/src/docPages/api/keyboard-shortcuts.md index 39ff02980..bb0eee9b4 100644 --- a/docs/src/docPages/api/keyboard-shortcuts.md +++ b/docs/src/docPages/api/keyboard-shortcuts.md @@ -1,6 +1,6 @@ # Keyboard Shortcuts -## Table of Contents +## toc ## Introduction Keyboard shortcuts may be strings like `'Shift-Control-Enter'`. Keys are based on the strings that can appear in `event.key`, concatenated with a `-`. There is a little tool called [keycode.info](https://keycode.info/), which shows the `event.key` interactively. diff --git a/docs/src/docPages/api/schema.md b/docs/src/docPages/api/schema.md index 37a4b3fc5..a0bc6b8bd 100644 --- a/docs/src/docPages/api/schema.md +++ b/docs/src/docPages/api/schema.md @@ -1,6 +1,6 @@ # Schema -## Table of Contents +## toc ## Introduction Unlike many other editors, tiptap is based on a [schema](https://prosemirror.net/docs/guide/#schema) that defines how your content is structured. That enables you to define the kind of nodes that may occur in the document, its attributes and the way they can be nested. diff --git a/docs/src/docPages/guide/build-your-editor.md b/docs/src/docPages/guide/build-your-editor.md index 0d0474785..f688551a2 100644 --- a/docs/src/docPages/guide/build-your-editor.md +++ b/docs/src/docPages/guide/build-your-editor.md @@ -1,6 +1,6 @@ # Build your editor -## Table of Contents +## toc ## Introduction In its simplest version tiptap comes very raw. There is no menu, no buttons, no styling. That’s intended. See tiptap as your building blocks to build exactly the editor you would like to have. diff --git a/docs/src/docPages/guide/collaborative-editing.md b/docs/src/docPages/guide/collaborative-editing.md index 9bbe3895c..284ee2368 100644 --- a/docs/src/docPages/guide/collaborative-editing.md +++ b/docs/src/docPages/guide/collaborative-editing.md @@ -1,6 +1,6 @@ # Collaborative editing -## Table of Contents +## toc ## Introduction diff --git a/docs/src/docPages/guide/configuration.md b/docs/src/docPages/guide/configuration.md index 0b9539e7f..ee58cfc99 100644 --- a/docs/src/docPages/guide/configuration.md +++ b/docs/src/docPages/guide/configuration.md @@ -1,6 +1,6 @@ # Configuration -## Table of Contents +## toc ## Introduction tiptap is all about customization. There are a ton of options to configure the behavior and functionality of the editor. Most of those settings can be set before creating the Editor. Give tiptap a JSON with all the settings you would like to overwrite. diff --git a/docs/src/docPages/guide/custom-extensions.md b/docs/src/docPages/guide/custom-extensions.md index 0e6d430ae..d03ede31d 100644 --- a/docs/src/docPages/guide/custom-extensions.md +++ b/docs/src/docPages/guide/custom-extensions.md @@ -1,6 +1,6 @@ -# Custom Extensions +# Custom extensions -## Table of Contents +## toc ## Introduction One of the strength of tiptap is it’s extendability. You don’t depend on the provided extensions, it’s intended to extend the editor to your liking. With custom extensions you can add new content types and new functionalities, on top of what already exists or on top of that. diff --git a/docs/src/docPages/guide/custom-styling.md b/docs/src/docPages/guide/custom-styling.md index b3c53c02d..0a759ae45 100644 --- a/docs/src/docPages/guide/custom-styling.md +++ b/docs/src/docPages/guide/custom-styling.md @@ -1,6 +1,6 @@ # Custom styling -## Table of Contents +## toc ## Introduction Tiptap is renderless, that doesn’t mean there is no styling provided. You can decided how your editor should look like. diff --git a/docs/src/docPages/guide/getting-started.md b/docs/src/docPages/guide/getting-started.md index fbfac4ad5..62e6ab187 100644 --- a/docs/src/docPages/guide/getting-started.md +++ b/docs/src/docPages/guide/getting-started.md @@ -1,6 +1,6 @@ # Getting started -## Table of Contents +## toc ## Introduction tiptap is framework-agnostic and works with Vue.js and React. It even works with plain JavaScript, if that’s your thing. To keep everything as small as possible, we put the code to use tiptap with those frameworks in different packages. diff --git a/docs/src/docPages/guide/store-content.md b/docs/src/docPages/guide/store-content.md index d69d267fa..72c8b0778 100644 --- a/docs/src/docPages/guide/store-content.md +++ b/docs/src/docPages/guide/store-content.md @@ -1,6 +1,6 @@ # Store content -## Table of Contents +## toc ## Introduction You can store your content as a JSON object or as a good old HTML string. Both work fine. And of course, you can pass both formats to the editor to restore your content. diff --git a/docs/src/docPages/overview/contributing.md b/docs/src/docPages/overview/contributing.md index 1f024d29e..e52253972 100644 --- a/docs/src/docPages/overview/contributing.md +++ b/docs/src/docPages/overview/contributing.md @@ -1,6 +1,6 @@ # Contributing -## Table of Contents +## toc ## Introduction Tiptap would be nothing without its lively community. Contributions have always been and will always be welcome. Here is a little bit you should know, before you send your contribution: diff --git a/docs/src/docPages/overview/installation.md b/docs/src/docPages/overview/installation.md index 57fc588cc..b3331e6cd 100644 --- a/docs/src/docPages/overview/installation.md +++ b/docs/src/docPages/overview/installation.md @@ -1,6 +1,6 @@ # Installation -## Table of Contents +## toc ## Introduction You’re free to use tiptap with the framework of your choice. Depending on what you want to do, there are a few different ways to install tiptap in your project. Choose the way that fits your workflow. diff --git a/docs/src/docPages/overview/upgrade-guide.md b/docs/src/docPages/overview/upgrade-guide.md index b787f3001..4bdf8d084 100644 --- a/docs/src/docPages/overview/upgrade-guide.md +++ b/docs/src/docPages/overview/upgrade-guide.md @@ -1,6 +1,6 @@ # Upgrade Guide -## Table of Contents +## toc ## Reasons to upgrade to tiptap 2.x Yes, it’s tedious work to upgrade your favorite text editor to a new API, but we made sure you’ve got enough reasons to upgrade to the newest version diff --git a/docs/src/templates/DocPage/style.scss b/docs/src/templates/DocPage/style.scss index b08a90f8a..ab7f0b456 100644 --- a/docs/src/templates/DocPage/style.scss +++ b/docs/src/templates/DocPage/style.scss @@ -95,7 +95,7 @@ text-decoration: underline; } - #table-of-contents { + #toc { display: none; & + ul { From 3518943e62b60343765e23254c77e413cc206f6e Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 28 Oct 2020 16:32:06 +0100 Subject: [PATCH 010/113] update content --- docs/src/demos/Examples/Links/index.vue | 10 +- docs/src/docPages/api/keyboard-shortcuts.md | 130 +++++++------- .../docPages/guide/build-custom-extensions.md | 161 ++++++++++++++++++ ...d-your-editor.md => create-your-editor.md} | 0 docs/src/docPages/guide/custom-extensions.md | 142 --------------- docs/src/docPages/guide/custom-styling.md | 26 ++- docs/src/docPages/overview/upgrade-guide.md | 66 +++---- docs/src/links.yaml | 8 +- packages/extension-blockquote/index.ts | 2 +- 9 files changed, 288 insertions(+), 257 deletions(-) create mode 100644 docs/src/docPages/guide/build-custom-extensions.md rename docs/src/docPages/guide/{build-your-editor.md => create-your-editor.md} (100%) delete mode 100644 docs/src/docPages/guide/custom-extensions.md diff --git a/docs/src/demos/Examples/Links/index.vue b/docs/src/demos/Examples/Links/index.vue index e3240fc78..0bdfe621b 100644 --- a/docs/src/demos/Examples/Links/index.vue +++ b/docs/src/demos/Examples/Links/index.vue @@ -11,13 +11,19 @@ diff --git a/packages/html/getHtmlFromFragment.ts b/packages/html/getHtmlFromFragment.ts index 644c9ab67..d1f8aa5c5 100644 --- a/packages/html/getHtmlFromFragment.ts +++ b/packages/html/getHtmlFromFragment.ts @@ -1,15 +1,13 @@ import { Node, DOMSerializer, Schema } from 'prosemirror-model' - -import { JSDOM } from 'jsdom' +// @ts-ignore +import { createHTMLDocument } from 'hostic-dom' export default function getHtmlFromFragment(doc: Node, schema: Schema): string { - const fragment = DOMSerializer + return DOMSerializer .fromSchema(schema) - .serializeFragment(doc.content) - - const temporaryDocument = new JSDOM('').window.document - const container = temporaryDocument.createElement('div') - container.appendChild(fragment) - - return container.innerHTML + .serializeFragment(doc.content, { + document: createHTMLDocument(), + }) + // @ts-ignore + .render() } diff --git a/packages/html/index.ts b/packages/html/index.ts index c64156bb9..56e8c07b6 100644 --- a/packages/html/index.ts +++ b/packages/html/index.ts @@ -2,7 +2,7 @@ import { Extensions, getSchema } from '@tiptap/core' import { Node } from 'prosemirror-model' import getHtmlFromFragment from './getHtmlFromFragment' -export default function generateHtml(doc: object, extensions: Extensions): string { +export function generateHtml(doc: object, extensions: Extensions): string { const schema = getSchema(extensions) const contentNode = Node.fromJSON(schema, doc) diff --git a/packages/html/package.json b/packages/html/package.json index 404f86c43..ddf655a3b 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -9,7 +9,7 @@ "dependencies": { "@tiptap/core": "2.x", "@types/jsdom": "^16.2.4", - "jsdom": "^16.4.0", + "hostic-dom": "^0.8.5", "prosemirror-model": "^1.12.0" } } diff --git a/tests/cypress/integration/core/generateHtml.spec.ts b/tests/cypress/integration/core/generateHtml.spec.ts new file mode 100644 index 000000000..8ffc178c0 --- /dev/null +++ b/tests/cypress/integration/core/generateHtml.spec.ts @@ -0,0 +1,29 @@ +/// + +import generateHtml from '@tiptap/html' +import Document from '@tiptap/extension-document' +import Paragraph from '@tiptap/extension-paragraph' +import Text from '@tiptap/extension-text' + +describe('generateHtml', () => { + it('generate HTML from JSON without an editor instance', () => { + const json = { + type: 'document', + content: [{ + type: 'paragraph', + content: [{ + type: 'text', + text: 'Example Text', + }], + }], + } + + const html = generateHtml(json, [ + Document(), + Paragraph(), + Text(), + ]) + + expect(html).to.eq('

Example Text

') + }) +}) diff --git a/yarn.lock b/yarn.lock index 6c86bc703..5eb812c97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2847,11 +2847,6 @@ JSONStream@^1.0.4, JSONStream@^1.3.4: jsonparse "^1.2.0" through ">=2.2.7 <3" -abab@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" - integrity sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q== - abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -2870,24 +2865,11 @@ acorn-dynamic-import@^4.0.0: resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== -acorn-globals@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" - integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== - dependencies: - acorn "^7.1.1" - acorn-walk "^7.1.1" - acorn-jsx@^5.0.1, acorn-jsx@^5.2.0: version "5.3.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== -acorn-walk@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" - integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== - acorn@^6.1.1, acorn@^6.4.1: version "6.4.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" @@ -3564,11 +3546,6 @@ brotli-size@^4.0.0: dependencies: duplexer "0.1.1" -browser-process-hrtime@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" - integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== - browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" @@ -4769,7 +4746,7 @@ css-what@2.1: resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== -css-what@^3.2.1: +css-what@^3.2.1, css-what@^3.4.2: version "3.4.2" resolved "https://registry.yarnpkg.com/css-what/-/css-what-3.4.2.tgz#ea7026fcb01777edbde52124e21f327e7ae950e4" integrity sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ== @@ -4864,23 +4841,6 @@ csso@^4.0.2: dependencies: css-tree "1.0.0-alpha.39" -cssom@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" - integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== - -cssom@~0.3.6: - version "0.3.8" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" - integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== - -cssstyle@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" - integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== - dependencies: - cssom "~0.3.6" - csstype@^3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.4.tgz#b156d7be03b84ff425c9a0a4b1e5f4da9c5ca888" @@ -4965,15 +4925,6 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-urls@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" - integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== - dependencies: - abab "^2.0.3" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" - date-fns@^1.27.2: version "1.30.1" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" @@ -5040,11 +4991,6 @@ decamelize@^1.1.0, decamelize@^1.1.2, decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= -decimal.js@^10.2.0: - version "10.2.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" - integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== - decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -5134,7 +5080,7 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -deep-is@^0.1.3, deep-is@~0.1.3: +deep-is@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= @@ -5348,13 +5294,6 @@ domelementtype@^2.0.1: resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.0.2.tgz#f3b6e549201e46f588b59463dd77187131fe6971" integrity sha512-wFwTwCVebUrMgGeAwRL/NhZtHAUyT9n9yg4IMDwf10+6iCMxSkVq9MGCVEH+QZWo1nNidy8kNvwmv4zWHDTqvA== -domexception@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" - integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== - dependencies: - webidl-conversions "^5.0.0" - domhandler@^2.3.0: version "2.4.2" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" @@ -5709,18 +5648,6 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escodegen@^1.14.1: - version "1.14.3" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" - integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== - dependencies: - esprima "^4.0.1" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - eslint-config-airbnb-base@^14.2.0: version "14.2.0" resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.0.tgz#fe89c24b3f9dc8008c9c0d0d88c28f95ed65e9c4" @@ -5883,7 +5810,7 @@ espree@^7.3.0: acorn-jsx "^5.2.0" eslint-visitor-keys "^1.3.0" -esprima@^4.0.0, esprima@^4.0.1, esprima@~4.0.0: +esprima@^4.0.0, esprima@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -5902,7 +5829,7 @@ esrecurse@^4.1.0, esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.1.1: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -6225,7 +6152,7 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: +fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= @@ -7407,6 +7334,14 @@ hosted-git-info@^2.1.4, hosted-git-info@^2.7.1: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== +hostic-dom@^0.8.5: + version "0.8.5" + resolved "https://registry.yarnpkg.com/hostic-dom/-/hostic-dom-0.8.5.tgz#500de796842454a745ce160d9cb0483c82643e28" + integrity sha512-0H5DTaE2/u3pSM5bPf7CaS9SunFASc0zlmw1R6hk0i6ozalRl0ePnAhm4YUYRG6pDbg0BYqCbjgwuFWOc3SskA== + dependencies: + css-what "^3.4.2" + he "^1.2.0" + hsl-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/hsl-regex/-/hsl-regex-1.0.0.tgz#d49330c789ed819e276a4c0d272dffa30b18fe6e" @@ -7422,13 +7357,6 @@ html-comment-regex@^1.1.0: resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7" integrity sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ== -html-encoding-sniffer@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" - integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== - dependencies: - whatwg-encoding "^1.0.5" - html-entities@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.3.1.tgz#fb9a1a4b5b14c5daba82d3e34c6ae4fe701a0e44" @@ -7889,11 +7817,6 @@ invariant@^2.2.4: dependencies: loose-envify "^1.0.0" -ip-regex@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" - integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= - ip@1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" @@ -8212,11 +8135,6 @@ is-png@^1.0.0: resolved "https://registry.yarnpkg.com/is-png/-/is-png-1.1.0.tgz#d574b12bf275c0350455570b0e5b57ab062077ce" integrity sha1-1XSxK/J1wDUEVVcLDltXqwYgd84= -is-potential-custom-element-name@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397" - integrity sha1-DFLlS8yjkbssSUsh6GJtczbG45c= - is-promise@^2.1.0: version "2.2.2" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" @@ -8432,38 +8350,6 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= -jsdom@^16.4.0: - version "16.4.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.4.0.tgz#36005bde2d136f73eee1a830c6d45e55408edddb" - integrity sha512-lYMm3wYdgPhrl7pDcRmvzPhhrGVBeVhPIqeHjzeiHN3DFmD1RBpbExbi8vU7BJdH8VAZYovR8DMt0PNNDM7k8w== - dependencies: - abab "^2.0.3" - acorn "^7.1.1" - acorn-globals "^6.0.0" - cssom "^0.4.4" - cssstyle "^2.2.0" - data-urls "^2.0.0" - decimal.js "^10.2.0" - domexception "^2.0.1" - escodegen "^1.14.1" - html-encoding-sniffer "^2.0.1" - is-potential-custom-element-name "^1.0.0" - nwsapi "^2.2.0" - parse5 "5.1.1" - request "^2.88.2" - request-promise-native "^1.0.8" - saxes "^5.0.0" - symbol-tree "^3.2.4" - tough-cookie "^3.0.1" - w3c-hr-time "^1.0.2" - w3c-xmlserializer "^2.0.0" - webidl-conversions "^6.1.0" - whatwg-encoding "^1.0.5" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" - ws "^7.2.3" - xml-name-validator "^3.0.0" - jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -8674,14 +8560,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - lib0@^0.2.12, lib0@^0.2.28, lib0@^0.2.32, lib0@^0.2.33: version "0.2.34" resolved "https://registry.yarnpkg.com/lib0/-/lib0-0.2.34.tgz#c4479f5f2083894687fcfa9d0b9d9935e35ea008" @@ -10047,11 +9925,6 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -nwsapi@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" - integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== - oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" @@ -10183,18 +10056,6 @@ optimize-css-assets-webpack-plugin@^5.0.1: cssnano "^4.1.10" last-call-webpack-plugin "^3.0.0" -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - optionator@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" @@ -10548,11 +10409,6 @@ parse-url@^5.0.0: parse-path "^4.0.0" protocols "^1.4.0" -parse5@5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" - integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== - parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -11204,11 +11060,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -12084,23 +11935,7 @@ request-progress@^3.0.0: dependencies: throttleit "^1.0.0" -request-promise-core@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" - integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== - dependencies: - lodash "^4.17.19" - -request-promise-native@^1.0.8: - version "1.0.9" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" - integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== - dependencies: - request-promise-core "1.1.4" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - -request@^2.83.0, request@^2.87.0, request@^2.88.0, request@^2.88.2: +request@^2.83.0, request@^2.87.0, request@^2.88.0: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== @@ -12446,13 +12281,6 @@ sax@~1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -saxes@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" - integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== - dependencies: - xmlchars "^2.2.0" - scheduler@^0.20.1: version "0.20.1" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.1.tgz#da0b907e24026b01181ecbc75efdc7f27b5a000c" @@ -13077,11 +12905,6 @@ stdout-stream@^1.4.0: dependencies: readable-stream "^2.0.1" -stealthy-require@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= - stream-browserify@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" @@ -13410,11 +13233,6 @@ symbol-observable@^1.1.0: resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== -symbol-tree@^3.2.4: - version "3.2.4" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" - integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== - table@^5.2.3: version "5.4.6" resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" @@ -13713,7 +13531,7 @@ toposort@^1.0.0: resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029" integrity sha1-LmhELZ9k7HILjMieZEOsbKqVACk= -tough-cookie@^2.3.3, tough-cookie@~2.5.0: +tough-cookie@~2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== @@ -13721,15 +13539,6 @@ tough-cookie@^2.3.3, tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" -tough-cookie@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2" - integrity sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg== - dependencies: - ip-regex "^2.1.0" - psl "^1.1.28" - punycode "^2.1.1" - tr46@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" @@ -13737,13 +13546,6 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" -tr46@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.0.2.tgz#03273586def1595ae08fedb38d7733cee91d2479" - integrity sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg== - dependencies: - punycode "^2.1.1" - trim-lines@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-1.1.3.tgz#839514be82428fd9e7ec89e35081afe8f6f93115" @@ -13860,13 +13662,6 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - type-fest@^0.13.1: version "0.13.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" @@ -14563,25 +14358,11 @@ vue@^2.6.10, vue@^2.6.12: resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.12.tgz#f5ebd4fa6bd2869403e29a896aed4904456c9123" integrity sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg== -w3c-hr-time@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" - integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== - dependencies: - browser-process-hrtime "^1.0.0" - w3c-keyname@^2.2.0: version "2.2.4" resolved "https://registry.yarnpkg.com/w3c-keyname/-/w3c-keyname-2.2.4.tgz#4ade6916f6290224cdbd1db8ac49eab03d0eef6b" integrity sha512-tOhfEwEzFLJzf6d1ZPkYfGj+FWhIpBux9ppoP3rlclw3Z0BZv3N7b7030Z1kYth+6rDuAsXUFr+d0VE6Ed1ikw== -w3c-xmlserializer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" - integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== - dependencies: - xml-name-validator "^3.0.0" - walkes@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/walkes/-/walkes-0.2.1.tgz#7eca144fe67ed32782fffe6e8e95fb4481864796" @@ -14617,16 +14398,6 @@ webidl-conversions@^4.0.2: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== -webidl-conversions@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" - integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== - -webidl-conversions@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" - integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== - webpack-chain@^5.2.0: version "5.2.4" resolved "https://registry.yarnpkg.com/webpack-chain/-/webpack-chain-5.2.4.tgz#cc3665a296a6edcda738324599103ac6e215dda3" @@ -14722,18 +14493,6 @@ websocket-extensions@>=0.1.1: resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== -whatwg-encoding@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" - integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== - dependencies: - iconv-lite "0.4.24" - -whatwg-mimetype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" - integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== - whatwg-url@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" @@ -14743,15 +14502,6 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" -whatwg-url@^8.0.0: - version "8.4.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.4.0.tgz#50fb9615b05469591d2b2bd6dfaed2942ed72837" - integrity sha512-vwTUFf6V4zhcPkWp/4CQPr1TW9Ml6SF4lVyaIMBdJw5i6qUUJ1QWM4Z6YYVkfka0OUIzVo/0aNtGVGk256IKWw== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^2.0.2" - webidl-conversions "^6.1.0" - which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" @@ -14797,7 +14547,7 @@ windows-release@^3.1.0: dependencies: execa "^1.0.0" -word-wrap@^1.2.3, word-wrap@~1.2.3: +word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== @@ -14894,7 +14644,7 @@ write@1.0.3: dependencies: mkdirp "^0.5.1" -ws@^7.2.0, ws@^7.2.3: +ws@^7.2.0: version "7.3.1" resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== @@ -14909,16 +14659,6 @@ xdg-basedir@^4.0.0: resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== -xml-name-validator@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== - -xmlchars@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" - integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== - xss@^1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/xss/-/xss-1.0.8.tgz#32feb87feb74b3dcd3d404b7a68ababf10700535" From 4dad818f7dfbb6ce867f1c1cb7cd4be4b5005668 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 28 Oct 2020 17:20:38 +0100 Subject: [PATCH 016/113] rename HTML function names --- docs/src/demos/Api/Schema/GenerateHtml/index.vue | 8 ++++---- packages/core/index.ts | 4 ++-- packages/core/src/Editor.ts | 4 ++-- .../core/src/utils/{generateHtml.ts => generateHTML.ts} | 6 +++--- .../{getHtmlFromFragment.ts => getHTMLFromFragment.ts} | 2 +- packages/html/example.js | 4 ++-- .../{getHtmlFromFragment.ts => getHTMLFromFragment.ts} | 2 +- packages/html/index.ts | 6 +++--- .../core/{generateHtml.spec.ts => generateHTML.spec.ts} | 6 +++--- 9 files changed, 21 insertions(+), 21 deletions(-) rename packages/core/src/utils/{generateHtml.ts => generateHTML.ts} (57%) rename packages/core/src/utils/{getHtmlFromFragment.ts => getHTMLFromFragment.ts} (85%) rename packages/html/{getHtmlFromFragment.ts => getHTMLFromFragment.ts} (82%) rename tests/cypress/integration/core/{generateHtml.spec.ts => generateHTML.spec.ts} (82%) diff --git a/docs/src/demos/Api/Schema/GenerateHtml/index.vue b/docs/src/demos/Api/Schema/GenerateHtml/index.vue index 81295caac..e0e9226d6 100644 --- a/docs/src/demos/Api/Schema/GenerateHtml/index.vue +++ b/docs/src/demos/Api/Schema/GenerateHtml/index.vue @@ -6,8 +6,8 @@ diff --git a/docs/src/docPages/api/schema.md b/docs/src/docPages/api/schema.md index a0bc6b8bd..6db220209 100644 --- a/docs/src/docPages/api/schema.md +++ b/docs/src/docPages/api/schema.md @@ -126,15 +126,13 @@ const schema = getSchema([ ## Generate HTML from ProseMirror JSON -If you need to render the content on the server side, e. g. for a blog post that was written with tiptap, you’ll probably need a way to do just that without an actual editor instance. +If you need to render the content on the server side, for example to render a blog post which was written with tiptap, you’ll probably need a way to do just that without an actual editor instance. That’s what `generateHTML()` is for. It’s a utility function that renders HTML without an actual editor instance. -That’s what `generategetHTML()` is for. It’s a utility function that renders HTML without an actual editor instance. - -:::warning Work in progress -Currently, that works only in the browser (client side), but we plan to bring this to Node.js (to use it on the server side). +:::info Browser-only rendering +Import a lightweight implementation from `@tiptap/core` if you’re using the function in a browser context only. ::: - + ### Converting JSON<>HTML with PHP From 86c528830cdb922efff161201de2f3e733182be1 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 28 Oct 2020 18:05:20 +0100 Subject: [PATCH 018/113] add premium hints everywhere, add premium flags to the navigation, add a license page --- .../Examples/CollaborativeEditing/index.vue | 2 +- .../CollaborationCursor/index.spec.js | 5 + .../Extensions/CollaborationCursor/index.vue | 91 +++++++++++++++++++ .../api/extensions/collaboration-cursor.md | 33 +++++++ .../docPages/api/extensions/collaboration.md | 4 +- .../examples/collaborative-editing.md | 5 + .../docPages/guide/collaborative-editing.md | 5 +- docs/src/docPages/tiptap-pro.md | 3 + docs/src/layouts/App/index.vue | 4 +- docs/src/layouts/App/style.scss | 11 +++ docs/src/links.yaml | 11 ++- docs/src/templates/DocPage/style.scss | 6 +- 12 files changed, 168 insertions(+), 12 deletions(-) create mode 100644 docs/src/demos/Extensions/CollaborationCursor/index.spec.js create mode 100644 docs/src/demos/Extensions/CollaborationCursor/index.vue create mode 100644 docs/src/docPages/tiptap-pro.md diff --git a/docs/src/demos/Examples/CollaborativeEditing/index.vue b/docs/src/demos/Examples/CollaborativeEditing/index.vue index e4f7fe0cb..db76709ff 100644 --- a/docs/src/demos/Examples/CollaborativeEditing/index.vue +++ b/docs/src/demos/Examples/CollaborativeEditing/index.vue @@ -197,7 +197,7 @@ export default { /* This renders the username above the caret */ .collaboration-cursor__label { position: absolute; - top: -1.6em; + top: -1.4em; left: -1px; font-size: 13px; font-style: normal; diff --git a/docs/src/demos/Extensions/CollaborationCursor/index.spec.js b/docs/src/demos/Extensions/CollaborationCursor/index.spec.js new file mode 100644 index 000000000..cb36824e0 --- /dev/null +++ b/docs/src/demos/Extensions/CollaborationCursor/index.spec.js @@ -0,0 +1,5 @@ +context('/api/extensions/collaboration', () => { + before(() => { + cy.visit('/api/extensions/collaboration') + }) +}) diff --git a/docs/src/demos/Extensions/CollaborationCursor/index.vue b/docs/src/demos/Extensions/CollaborationCursor/index.vue new file mode 100644 index 000000000..bf290cb14 --- /dev/null +++ b/docs/src/demos/Extensions/CollaborationCursor/index.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/docs/src/docPages/api/extensions/collaboration-cursor.md b/docs/src/docPages/api/extensions/collaboration-cursor.md index 7f003c1aa..cf8b74d0a 100644 --- a/docs/src/docPages/api/extensions/collaboration-cursor.md +++ b/docs/src/docPages/api/extensions/collaboration-cursor.md @@ -1,2 +1,35 @@ # Collaboration Cursor +:::premium Premium Extension +Using this in production requires a **tiptap pro** license. [Read more](/tiptap-pro) +::: + +## Installation +```bash +# With npm +npm install @tiptap/extension-collaboration-cursor + +# Or: With Yarn +yarn add @tiptap/extension-collaboration-cursor +``` + +## Settings +| Option | Type | Default | Description | +| -------- | ---- | ------- | ----------- | +| provider | | | | +| type | | | | + +## Commands +*None* + +## Keyboard shortcuts +*None* + +## Source code +[packages/extension-collaboration-cursor/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-collaboration-cursor/) + +## Usage +:::warning Public +The content of this editor is shared with other users. +::: + diff --git a/docs/src/docPages/api/extensions/collaboration.md b/docs/src/docPages/api/extensions/collaboration.md index c19acbb79..16f00fd67 100644 --- a/docs/src/docPages/api/extensions/collaboration.md +++ b/docs/src/docPages/api/extensions/collaboration.md @@ -1,8 +1,8 @@ # Collaboration The Collaboration extension enables you to collaborate with others on one document. The implementation is based on [Y.js by Kevin Jahns](https://github.com/yjs/yjs), which is the coolest thing to [integrate collaborative editing](/guide/collaborative-editing) in your project. -:::pro Premium Extension -Using this in production requires a **tiptap pro** license. [Read more](/license) +:::premium Premium Extension +Using this in production requires a **tiptap pro** license. [Read more](/tiptap-pro) ::: ## Installation diff --git a/docs/src/docPages/examples/collaborative-editing.md b/docs/src/docPages/examples/collaborative-editing.md index c085612e3..e77555535 100644 --- a/docs/src/docPages/examples/collaborative-editing.md +++ b/docs/src/docPages/examples/collaborative-editing.md @@ -1,4 +1,9 @@ # Collaborative editing + +:::premium Requires Premium Extensions +Using this example in production requires a **tiptap pro** license. [Read more](/tiptap-pro) +::: + This example shows how you can use tiptap to let different users collaboratively work on the same text in real-time. It connects client with WebRTC and merges changes to the document (no matter where they come from) with the awesome library [Y.js](https://github.com/yjs/yjs) by Kevin Jahns. Be aware that in a real-world scenario you would probably add a server, which is also able to merge changes with Y.js. diff --git a/docs/src/docPages/guide/collaborative-editing.md b/docs/src/docPages/guide/collaborative-editing.md index 284ee2368..053334b6a 100644 --- a/docs/src/docPages/guide/collaborative-editing.md +++ b/docs/src/docPages/guide/collaborative-editing.md @@ -1,9 +1,12 @@ # Collaborative editing +:::premium Requires Premium Extensions +Using the collaborative editing in production requires a **tiptap pro** license. [Read more](/tiptap-pro) +::: + ## toc ## Introduction - Collaborative editing allows multiple users to work on the same text document in real-time. It’s a complex topic that you should be aware before adding it blindly to you app. No worries though, here is everything you need to know. ## Configure collaboration diff --git a/docs/src/docPages/tiptap-pro.md b/docs/src/docPages/tiptap-pro.md new file mode 100644 index 000000000..391c3559e --- /dev/null +++ b/docs/src/docPages/tiptap-pro.md @@ -0,0 +1,3 @@ +# tiptap pro + +[Sponsor us on GitHub](https://github.com/sponsors/ueberdosis) diff --git a/docs/src/layouts/App/index.vue b/docs/src/layouts/App/index.vue index eb5132d65..11b6f281b 100644 --- a/docs/src/layouts/App/index.vue +++ b/docs/src/layouts/App/index.vue @@ -149,13 +149,13 @@