From 18aa2b7b81f85155af4c7a60a8343c84de48e41a Mon Sep 17 00:00:00 2001 From: Rob Ellison Date: Mon, 13 Nov 2023 15:30:51 +0000 Subject: [PATCH] feat: editor updates --- components/editor/index.js | 2 +- package-lock.json | 16 +++++++++------- package.json | 2 +- pages/test/index.js | 7 ++++++- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/components/editor/index.js b/components/editor/index.js index fd38860d..608600a1 100644 --- a/components/editor/index.js +++ b/components/editor/index.js @@ -159,7 +159,7 @@ function Editor({ markdown: initialMarkdown, context }) { onChange={editorCallback} markdown={markdown} plugins={[ - // catchAllPlugin(), + catchAllPlugin(), codeBlockPlugin({ codeBlockEditorDescriptors: [PlainTextCodeEditorDescriptor] }), diffSourcePlugin({ diffMarkdown: initialMarkdown, viewMode: 'source' }), headingsPlugin(), diff --git a/package-lock.json b/package-lock.json index b5baaeb2..7ddd9d30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@mdx-js/loader": "^2.3.0", "@mdx-js/mdx": "^2.3.0", "@mdx-js/react": "^2.3.0", - "@mdxeditor/editor": "^1.5.0", + "@mdxeditor/editor": "^1.8.1", "@mui/icons-material": "^5.11.11", "@mui/material": "^5.11.7", "@mui/utils": "^5.13.1", @@ -1448,9 +1448,9 @@ } }, "node_modules/@mdxeditor/editor": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@mdxeditor/editor/-/editor-1.5.0.tgz", - "integrity": "sha512-e17OEozztxxXeLwEbvj8DAxPvDA9x+9UXjjwWTQgv058wfLWolOtxuy5OXJwMi0AF6Thx6r9b4JLRcooXMS5mw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@mdxeditor/editor/-/editor-1.8.1.tgz", + "integrity": "sha512-TV5EYptJIRvsESAYRRsaL2MzV7FEEABqiwt973W+zqluQCMF9bVV6sZhYWBfr3d4LRJZNboFY8mjorNS0BsIMA==", "dependencies": { "@codemirror/lang-markdown": "^6.2.1", "@codemirror/merge": "^6.1.3", @@ -1487,6 +1487,7 @@ "mdast-util-from-markdown": "^1.3.0", "mdast-util-frontmatter": "1.0.1", "mdast-util-gfm-table": "^1.0.7", + "mdast-util-gfm-task-list-item": "1.0.2", "mdast-util-mdx": "2.0.1", "mdast-util-mdx-jsx": "^2.1.4", "mdast-util-to-hast": "^12.3.0", @@ -1494,6 +1495,7 @@ "micromark-extension-directive": "2.2.0", "micromark-extension-frontmatter": "1.1.0", "micromark-extension-gfm-table": "^1.0.6", + "micromark-extension-gfm-task-list-item": "1.0.5", "micromark-extension-mdxjs": "1.0.1", "react-hook-form": "^7.44.2", "unidiff": "^1.0.2" @@ -12943,9 +12945,9 @@ } }, "node_modules/micromark-extension-gfm-task-list-item": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.4.tgz", - "integrity": "sha512-9XlIUUVnYXHsFF2HZ9jby4h3npfX10S1coXTnV035QGPgrtNYQq3J6IfIvcCIUAJrrqBVi5BqA/LmaOMJqPwMQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.5.tgz", + "integrity": "sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ==", "dependencies": { "micromark-factory-space": "^1.0.0", "micromark-util-character": "^1.0.0", diff --git a/package.json b/package.json index b2802f52..31a3eb45 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@mdx-js/loader": "^2.3.0", "@mdx-js/mdx": "^2.3.0", "@mdx-js/react": "^2.3.0", - "@mdxeditor/editor": "^1.5.0", + "@mdxeditor/editor": "^1.8.1", "@mui/icons-material": "^5.11.11", "@mui/material": "^5.11.7", "@mui/utils": "^5.13.1", diff --git a/pages/test/index.js b/pages/test/index.js index 7e40b180..5d474369 100644 --- a/pages/test/index.js +++ b/pages/test/index.js @@ -2,9 +2,14 @@ // import type { CodeBlockEditorDescriptor } from '@mdxeditor/editor'; import Editor from '@/components/editor' import { useState, useEffect } from "react"; +import dynamic from 'next/dynamic' export default function Page() { - const [markdown, setMarkdown] = useState('hellotest'); + const mkdown = `hello +test +more +` + const [markdown, setMarkdown] = useState(mkdown);