diff --git a/.changeset/orange-spoons-rescue.md b/.changeset/orange-spoons-rescue.md new file mode 100644 index 00000000000..3ab081e5a4c --- /dev/null +++ b/.changeset/orange-spoons-rescue.md @@ -0,0 +1,5 @@ +--- +'@tiptap/extension-text-style': minor +--- + +Add `toggleTextStyle` command and add typings for the commands parameters based on the installed extensions that include `textStyle` diff --git a/.changeset/smart-turtles-happen.md b/.changeset/smart-turtles-happen.md new file mode 100644 index 00000000000..b8976b6c88b --- /dev/null +++ b/.changeset/smart-turtles-happen.md @@ -0,0 +1,5 @@ +--- +'@tiptap/extension-background-color': patch +--- + +Adds a new extension, `extension-background-color` which can color the background of `textStyle`s diff --git a/.changeset/twelve-paws-work.md b/.changeset/twelve-paws-work.md new file mode 100644 index 00000000000..6168596d8ad --- /dev/null +++ b/.changeset/twelve-paws-work.md @@ -0,0 +1,5 @@ +--- +'@tiptap/extension-line-height': patch +--- + +This adds the `extension-line-height` package which controls the line-height of text like `font-size`, `font-family`, etc. diff --git a/demos/src/Commands/Cut/React/index.jsx b/demos/src/Commands/Cut/React/index.jsx index 84adce0f8af..67a5980a16d 100644 --- a/demos/src/Commands/Cut/React/index.jsx +++ b/demos/src/Commands/Cut/React/index.jsx @@ -1,8 +1,7 @@ import './styles.scss' -import { Color } from '@tiptap/extension-color' import ListItem from '@tiptap/extension-list-item' -import TextStyle from '@tiptap/extension-text-style' +import { Color, TextStyle } from '@tiptap/extension-text-style' import { EditorContent, useEditor } from '@tiptap/react' import StarterKit from '@tiptap/starter-kit' import React, { useCallback } from 'react' diff --git a/demos/src/Commands/InsertContent/React/index.jsx b/demos/src/Commands/InsertContent/React/index.jsx index 44d320aec92..2032f0fb226 100644 --- a/demos/src/Commands/InsertContent/React/index.jsx +++ b/demos/src/Commands/InsertContent/React/index.jsx @@ -1,10 +1,9 @@ import './styles.scss' -import { Color } from '@tiptap/extension-color' import { Image } from '@tiptap/extension-image' import Link from '@tiptap/extension-link' import ListItem from '@tiptap/extension-list-item' -import TextStyle from '@tiptap/extension-text-style' +import { Color, TextStyle } from '@tiptap/extension-text-style' import { EditorProvider, useCurrentEditor } from '@tiptap/react' import StarterKit from '@tiptap/starter-kit' import React, { useCallback } from 'react' diff --git a/demos/src/Commands/SetContent/React/index.jsx b/demos/src/Commands/SetContent/React/index.jsx index 854731e45af..2ce131d0668 100644 --- a/demos/src/Commands/SetContent/React/index.jsx +++ b/demos/src/Commands/SetContent/React/index.jsx @@ -1,9 +1,8 @@ import './styles.scss' -import { Color } from '@tiptap/extension-color' import ListItem from '@tiptap/extension-list-item' import Mentions from '@tiptap/extension-mention' -import TextStyle from '@tiptap/extension-text-style' +import { Color , TextStyle } from '@tiptap/extension-text-style' import { EditorProvider } from '@tiptap/react' import StarterKit from '@tiptap/starter-kit' import React from 'react' diff --git a/demos/src/Examples/Default/React/index.jsx b/demos/src/Examples/Default/React/index.jsx index 24194ee1c99..6f410db6fbc 100644 --- a/demos/src/Examples/Default/React/index.jsx +++ b/demos/src/Examples/Default/React/index.jsx @@ -1,8 +1,7 @@ import './styles.scss' -import { Color } from '@tiptap/extension-color' import ListItem from '@tiptap/extension-list-item' -import TextStyle from '@tiptap/extension-text-style' +import { Color , TextStyle } from '@tiptap/extension-text-style' import { EditorProvider, useCurrentEditor, useEditorState } from '@tiptap/react' import StarterKit from '@tiptap/starter-kit' import React from 'react' diff --git a/demos/src/Examples/Default/Svelte/index.svelte b/demos/src/Examples/Default/Svelte/index.svelte index 6e915f09d6e..a0cdc590ffa 100644 --- a/demos/src/Examples/Default/Svelte/index.svelte +++ b/demos/src/Examples/Default/Svelte/index.svelte @@ -1,9 +1,9 @@ + + diff --git a/demos/src/Extensions/Color/React/index.jsx b/demos/src/Extensions/Color/React/index.tsx similarity index 96% rename from demos/src/Extensions/Color/React/index.jsx rename to demos/src/Extensions/Color/React/index.tsx index e19b94f5c1f..5e94d9b9264 100644 --- a/demos/src/Extensions/Color/React/index.jsx +++ b/demos/src/Extensions/Color/React/index.tsx @@ -1,10 +1,9 @@ import './styles.scss' -import { Color } from '@tiptap/extension-color' import Document from '@tiptap/extension-document' import Paragraph from '@tiptap/extension-paragraph' import Text from '@tiptap/extension-text' -import TextStyle from '@tiptap/extension-text-style' +import { Color, TextStyle } from '@tiptap/extension-text-style' import { EditorContent, useEditor, useEditorState } from '@tiptap/react' import React from 'react' @@ -42,7 +41,7 @@ export default () => {
editor.chain().focus().setColor(event.target.value).run()} + onInput={event => editor.chain().focus().setColor(event.currentTarget.value).run()} value={editorState.color} data-testid="setColor" /> diff --git a/demos/src/Extensions/Color/Vue/index.vue b/demos/src/Extensions/Color/Vue/index.vue index 8146b4db7eb..98cd7d690a7 100644 --- a/demos/src/Extensions/Color/Vue/index.vue +++ b/demos/src/Extensions/Color/Vue/index.vue @@ -57,11 +57,10 @@ diff --git a/demos/src/Extensions/LineHeight/Vue/styles.scss b/demos/src/Extensions/LineHeight/Vue/styles.scss new file mode 100644 index 00000000000..0cfd55df4cb --- /dev/null +++ b/demos/src/Extensions/LineHeight/Vue/styles.scss @@ -0,0 +1,18 @@ +/* Basic editor styles */ +.tiptap { + line-height: 1.0; + :first-child { + margin-top: 0; + } + + img { + display: block; + height: auto; + margin: 1.5rem 0; + max-width: 100%; + + &.ProseMirror-selectednode { + outline: 3px solid var(--purple); + } + } +} diff --git a/demos/src/Marks/TextStyle/React/index.jsx b/demos/src/Marks/TextStyle/React/index.jsx index 55eb2836176..cb11138cfbe 100644 --- a/demos/src/Marks/TextStyle/React/index.jsx +++ b/demos/src/Marks/TextStyle/React/index.jsx @@ -1,12 +1,10 @@ import './styles.scss' import Bold from '@tiptap/extension-bold' -import { Color } from '@tiptap/extension-color' import Document from '@tiptap/extension-document' -import { FontFamily } from '@tiptap/extension-font-family' import Paragraph from '@tiptap/extension-paragraph' import Text from '@tiptap/extension-text' -import TextStyle from '@tiptap/extension-text-style' +import { Color , FontFamily , TextStyle } from '@tiptap/extension-text-style' import { EditorContent, useEditor } from '@tiptap/react' import React from 'react' diff --git a/demos/src/Marks/TextStyle/Vue/index.vue b/demos/src/Marks/TextStyle/Vue/index.vue index ae4bacbc9bd..3ea65c324ab 100644 --- a/demos/src/Marks/TextStyle/Vue/index.vue +++ b/demos/src/Marks/TextStyle/Vue/index.vue @@ -6,12 +6,10 @@