Merge branch 'lowlight-types' of github.com:tarngerine/tiptap into tarngerine-lowlight-types
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
"@hocuspocus/provider": "^1.0.0-alpha.29",
|
"@hocuspocus/provider": "^1.0.0-alpha.29",
|
||||||
"d3": "^7.3.0",
|
"d3": "^7.3.0",
|
||||||
"fast-glob": "^3.2.11",
|
"fast-glob": "^3.2.11",
|
||||||
|
"highlight.js": "^11.6.0",
|
||||||
"lowlight": "^2.7.0",
|
"lowlight": "^2.7.0",
|
||||||
"remixicon": "^2.5.0",
|
"remixicon": "^2.5.0",
|
||||||
"shiki": "^0.10.0",
|
"shiki": "^0.10.0",
|
||||||
|
|||||||
@@ -9,12 +9,21 @@ import Document from '@tiptap/extension-document'
|
|||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import { EditorContent, ReactNodeViewRenderer, useEditor } from '@tiptap/react'
|
import { EditorContent, ReactNodeViewRenderer, useEditor } from '@tiptap/react'
|
||||||
|
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
|
// load all highlight.js languages
|
||||||
import { lowlight } from 'lowlight'
|
import { lowlight } from 'lowlight'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import CodeBlockComponent from './CodeBlockComponent'
|
import CodeBlockComponent from './CodeBlockComponent'
|
||||||
|
|
||||||
|
lowlight.registerLanguage('html', html)
|
||||||
|
lowlight.registerLanguage('css', css)
|
||||||
|
lowlight.registerLanguage('js', js)
|
||||||
|
lowlight.registerLanguage('ts', ts)
|
||||||
|
|
||||||
const MenuBar = ({ editor }) => {
|
const MenuBar = ({ editor }) => {
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -13,11 +13,20 @@ import Document from '@tiptap/extension-document'
|
|||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import { Editor, EditorContent, VueNodeViewRenderer } from '@tiptap/vue-3'
|
import { Editor, EditorContent, VueNodeViewRenderer } from '@tiptap/vue-3'
|
||||||
|
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
|
// load all highlight.js languages
|
||||||
import { lowlight } from 'lowlight'
|
import { lowlight } from 'lowlight'
|
||||||
|
|
||||||
import CodeBlockComponent from './CodeBlockComponent.vue'
|
import CodeBlockComponent from './CodeBlockComponent.vue'
|
||||||
|
|
||||||
|
lowlight.registerLanguage('html', html)
|
||||||
|
lowlight.registerLanguage('css', css)
|
||||||
|
lowlight.registerLanguage('js', js)
|
||||||
|
lowlight.registerLanguage('ts', ts)
|
||||||
|
|
||||||
// load specific languages only
|
// load specific languages only
|
||||||
// import { lowlight } from 'lowlight/lib/core'
|
// import { lowlight } from 'lowlight/lib/core'
|
||||||
// import javascript from 'highlight.js/lib/languages/javascript'
|
// import javascript from 'highlight.js/lib/languages/javascript'
|
||||||
|
|||||||
@@ -9,10 +9,19 @@ import Document from '@tiptap/extension-document'
|
|||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import { EditorContent, useEditor } from '@tiptap/react'
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
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
|
// load all highlight.js languages
|
||||||
import { lowlight } from 'lowlight'
|
import { lowlight } from 'lowlight'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
|
lowlight.registerLanguage('html', html)
|
||||||
|
lowlight.registerLanguage('css', css)
|
||||||
|
lowlight.registerLanguage('js', js)
|
||||||
|
lowlight.registerLanguage('ts', ts)
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
extensions: [
|
extensions: [
|
||||||
|
|||||||
@@ -17,13 +17,17 @@ import Document from '@tiptap/extension-document'
|
|||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
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
|
// load all highlight.js languages
|
||||||
import { lowlight } from 'lowlight'
|
import { lowlight } from 'lowlight'
|
||||||
|
|
||||||
// load specific languages only
|
lowlight.registerLanguage('html', html)
|
||||||
// import { lowlight } from 'lowlight/lib/core'
|
lowlight.registerLanguage('css', css)
|
||||||
// import javascript from 'highlight.js/lib/languages/javascript'
|
lowlight.registerLanguage('js', js)
|
||||||
// lowlight.registerLanguage('javascript', javascript)
|
lowlight.registerLanguage('ts', ts)
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
8707
package-lock.json
generated
8707
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -21,12 +21,10 @@
|
|||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "^2.0.0-beta.1",
|
"@tiptap/core": "^2.0.0-beta.1"
|
||||||
"lowlight": ">=1.20.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tiptap/extension-code-block": "^2.0.0-beta.42",
|
"@tiptap/extension-code-block": "^2.0.0-beta.42",
|
||||||
"@types/lowlight": "^0.0.3",
|
|
||||||
"prosemirror-model": "1.18.1",
|
"prosemirror-model": "1.18.1",
|
||||||
"prosemirror-state": "1.4.1",
|
"prosemirror-state": "1.4.1",
|
||||||
"prosemirror-view": "1.26.2"
|
"prosemirror-view": "1.26.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user