Skip to content

Commit

Permalink
Merge branch 'develop' into no-op-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbch authored Aug 7, 2024
2 parents 8df9ca6 + 535dccc commit 85ffe8c
Show file tree
Hide file tree
Showing 132 changed files with 1,147 additions and 453 deletions.
5 changes: 0 additions & 5 deletions .changeset/cuddly-pants-destroy.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/early-singers-begin.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/real-kiwis-double.md

This file was deleted.

12 changes: 0 additions & 12 deletions .changeset/smooth-rice-obey.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wet-terms-fetch.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wise-beers-reflect.md

This file was deleted.

6 changes: 6 additions & 0 deletions demos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 2.4.2

### Patch Changes

- d6e56c4: declare lowlight to be a peer dep of extension-code-block-lowlight, update usage to v3

## 2.4.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion demos/includeDependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ highlight.js/lib/languages/xml
highlight.js/lib/core
linkifyjs
lowlight
lowlight/lib/core
prosemirror-commands
prosemirror-dropcursor
prosemirror-gapcursor
Expand All @@ -21,6 +20,7 @@ prosemirror-view
react
react-dom
react-dom/client
use-sync-external-store/shim/with-selector
shiki
simplify-js
tippy.js
Expand Down
8 changes: 4 additions & 4 deletions demos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tiptap-demos",
"version": "2.4.1",
"version": "2.4.2",
"private": true,
"type": "module",
"scripts": {
Expand All @@ -14,13 +14,13 @@
"@lexical/react": "^0.11.1",
"d3": "^7.3.0",
"fast-glob": "^3.2.11",
"highlight.js": "^11.6.0",
"highlight.js": "^11.10.0",
"lexical": "^0.11.1",
"lowlight": "^2.7.0",
"lowlight": "^3.1.0",
"remixicon": "^2.5.0",
"shiki": "^1.10.3",
"simplify-js": "^1.2.4",
"y-prosemirror": "^1.2.9",
"y-prosemirror": "^1.2.11",
"y-webrtc": "^10.3.0",
"yjs": "^13.6.18"
},
Expand Down
14 changes: 12 additions & 2 deletions demos/setup/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ form {
font-size: 0.75rem;
gap: 0.25rem;
line-height: 1.15;
min-height: 1.75rem;
padding: 0.25rem 0.5rem;
padding: 0.3rem 0.5rem;

&.purple-spinner,
&.error {
Expand All @@ -215,6 +214,17 @@ form {
width: 100%;
}

.badge {
background-color: var(--gray-1);
border: 1px solid var(--gray-3);
border-radius: 2rem;
color: var(--gray-5);
font-size: 0.625rem;
font-weight: 700;
line-height: 1;
padding: 0.25rem 0.5rem;
}

&.purple-spinner {
background-color: var(--purple-light);

Expand Down
25 changes: 13 additions & 12 deletions demos/src/Examples/CodeBlockLanguage/React/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// load specific languages only
// import { lowlight } from 'lowlight/lib/core'
// import javascript from 'highlight.js/lib/languages/javascript'
// lowlight.registerLanguage('javascript', javascript)
import './styles.scss'

import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
Expand All @@ -13,16 +9,21 @@ import css from 'highlight.js/lib/languages/css'
import js from 'highlight.js/lib/languages/javascript'
import ts from 'highlight.js/lib/languages/typescript'
import html from 'highlight.js/lib/languages/xml'
// load all highlight.js languages
import { lowlight } from 'lowlight'
// load all languages with "all" or common languages with "common"
import { all, createLowlight } from 'lowlight'
import React from 'react'

import CodeBlockComponent from './CodeBlockComponent.jsx'
// eslint-disable-next-line
import CodeBlockComponent from './CodeBlockComponent'

lowlight.registerLanguage('html', html)
lowlight.registerLanguage('css', css)
lowlight.registerLanguage('js', js)
lowlight.registerLanguage('ts', ts)
// create a lowlight instance
const lowlight = createLowlight(all)

// you can also register individual languages
lowlight.register('html', html)
lowlight.register('css', css)
lowlight.register('js', js)
lowlight.register('ts', ts)

const MenuBar = ({ editor }) => {
if (!editor) {
Expand Down Expand Up @@ -56,7 +57,7 @@ export default () => {
],
content: `
<p>
Thats a boring paragraph followed by a fenced code block:
That's a boring paragraph followed by a fenced code block:
</p>
<pre><code class="language-javascript">for (var i=1; i <= 20; i++)
{
Expand Down
21 changes: 10 additions & 11 deletions demos/src/Examples/CodeBlockLanguage/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,19 @@ import css from 'highlight.js/lib/languages/css'
import js from 'highlight.js/lib/languages/javascript'
import ts from 'highlight.js/lib/languages/typescript'
import html from 'highlight.js/lib/languages/xml'
// load all highlight.js languages
import { lowlight } from 'lowlight'
// load all languages with "all" or common languages with "common"
import { all, createLowlight } from 'lowlight'
import CodeBlockComponent from './CodeBlockComponent.vue'
lowlight.registerLanguage('html', html)
lowlight.registerLanguage('css', css)
lowlight.registerLanguage('js', js)
lowlight.registerLanguage('ts', ts)
// create a lowlight instance
const lowlight = createLowlight(all)
// load specific languages only
// import { lowlight } from 'lowlight/lib/core'
// import javascript from 'highlight.js/lib/languages/javascript'
// lowlight.registerLanguage('javascript', javascript)
// you can also register languages
lowlight.register('html', html)
lowlight.register('css', css)
lowlight.register('js', js)
lowlight.register('ts', ts)
export default {
components: {
Expand Down Expand Up @@ -63,7 +62,7 @@ export default {
],
content: `
<p>
Thats a boring paragraph followed by a fenced code block:
That's a boring paragraph followed by a fenced code block:
</p>
<pre><code class="language-javascript">for (var i=1; i <= 20; i++)
{
Expand Down
16 changes: 9 additions & 7 deletions demos/src/Experiments/All/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ import TextAlign from '@tiptap/extension-text-align'
import TextStyle from '@tiptap/extension-text-style'
import Underline from '@tiptap/extension-underline'
import { Editor, EditorContent } from '@tiptap/vue-3'
import { lowlight } from 'lowlight'
import { all, createLowlight } from 'lowlight'
const lowlight = createLowlight(all)
export default {
components: {
Expand Down Expand Up @@ -182,14 +184,14 @@ export default {
</p>
<ul>
<li>
Thats a bullet list with one …
That's a bullet list with one …
</li>
<li>
… or two list items.
</li>
</ul>
<p>
Isnt that great? And all of that is editable. But wait, theres more. Lets try a code block:
Isn't that great? And all of that is editable. But wait, there's more. Let's try a code block:
</p>
<pre><code class="language-javascript">for (var i=1; i <= 20; i++)
{
Expand All @@ -203,20 +205,20 @@ export default {
console.log(i);
}</code></pre>
<p>
I know, I know, this is impressive. Its only the tip of the iceberg though. Give it a try and click a little bit around. Don’t forget to check the other examples too.
I know, I know, this is impressive. It's only the tip of the iceberg though. Give it a try and click a little bit around. Don’t forget to check the other examples too.
</p>
<blockquote>
Wow, thats amazing. Good work, boy! 👏
Wow, that's amazing. Good work, boy! 👏
<br />
— Mom
</blockquote>
<h2>Text align</h2>
<p style="text-align: center">first paragraph</p>
<p style="text-align: right">second paragraph</p>
<h2>Color</h2>
<p><span style="color: #958DF1">Oh, for some reason thats purple.</span></p>
<p><span style="color: #958DF1">Oh, for some reason that's purple.</span></p>
<h2>Highlight</h2>
<p>This isnt highlighted.</s></p>
<p>This isn't highlighted.</s></p>
<p><mark>But that one is.</mark></p>
<p><mark style="background-color: red;">And this is highlighted too, but in a different color.</mark></p>
<p><mark data-color="#ffa8a8">And this one has a data attribute.</mark></p>
Expand Down
33 changes: 22 additions & 11 deletions demos/src/Nodes/CodeBlockLowlight/React/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// load specific languages only
// import { lowlight } from 'lowlight/lib/core'
// import javascript from 'highlight.js/lib/languages/javascript'
// lowlight.registerLanguage('javascript', javascript)
import './styles.scss'

import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
Expand All @@ -13,14 +9,29 @@ import css from 'highlight.js/lib/languages/css'
import js from 'highlight.js/lib/languages/javascript'
import ts from 'highlight.js/lib/languages/typescript'
import html from 'highlight.js/lib/languages/xml'
// load all highlight.js languages
import { lowlight } from 'lowlight'
// load all languages with "all" or common languages with "common"
import { all, createLowlight } from 'lowlight'
import React from 'react'

lowlight.registerLanguage('html', html)
lowlight.registerLanguage('css', css)
lowlight.registerLanguage('js', js)
lowlight.registerLanguage('ts', ts)
// create a lowlight instance with all languages loaded
const lowlight = createLowlight(all)

// This is only an example, all supported languages are already loaded above
// but you can also register only specific languages to reduce bundle-size
lowlight.register('html', html)
lowlight.register('css', css)
lowlight.register('js', js)
lowlight.register('ts', ts)

/**
* Lowlight version 2.x had a different API
* import { lowlight } from 'lowlight'
*
* lowlight.registerLanguage('html', html)
* lowlight.registerLanguage('css', css)
* lowlight.registerLanguage('js', js)
* lowlight.registerLanguage('ts', ts)
*/

export default () => {
const editor = useEditor({
Expand All @@ -34,7 +45,7 @@ export default () => {
],
content: `
<p>
Thats a boring paragraph followed by a fenced code block:
That's a boring paragraph followed by a fenced code block:
</p>
<pre><code class="language-javascript">for (var i=1; i <= 20; i++)
{
Expand Down
18 changes: 11 additions & 7 deletions demos/src/Nodes/CodeBlockLowlight/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ import css from 'highlight.js/lib/languages/css'
import js from 'highlight.js/lib/languages/javascript'
import ts from 'highlight.js/lib/languages/typescript'
import html from 'highlight.js/lib/languages/xml'
// load all highlight.js languages
import { lowlight } from 'lowlight'
// load all languages with "all" or common languages with "common"
import { all, createLowlight } from 'lowlight'
lowlight.registerLanguage('html', html)
lowlight.registerLanguage('css', css)
lowlight.registerLanguage('js', js)
lowlight.registerLanguage('ts', ts)
// create a lowlight instance
const lowlight = createLowlight(all)
// you can also register languages
lowlight.register('html', html)
lowlight.register('css', css)
lowlight.register('js', js)
lowlight.register('ts', ts)
export default {
components: {
Expand All @@ -56,7 +60,7 @@ export default {
],
content: `
<p>
Thats a boring paragraph followed by a fenced code block:
That's a boring paragraph followed by a fenced code block:
</p>
<pre><code class="language-javascript">for (var i=1; i <= 20; i++)
{
Expand Down
Loading

0 comments on commit 85ffe8c

Please sign in to comment.