Skip to content

Commit

Permalink
fix: upgrade tiptap
Browse files Browse the repository at this point in the history
  • Loading branch information
imfelixng committed Apr 7, 2024
1 parent 9fb92e6 commit 3c60276
Show file tree
Hide file tree
Showing 6 changed files with 2,374 additions and 1,120 deletions.
16 changes: 15 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
module.exports = {
stories: ['../stories/**/*.stories.@(ts|tsx|js|jsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-webpack5-compiler-babel'
],

// https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration
typescript: {
check: true, // type-check stories during Storybook build
},

framework: {
name: '@storybook/react-webpack5',
options: {}
},

docs: {
autodocs: true
}
};
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"devDependencies": {
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"typescript": "^4",
"vite": "latest",
"vite-preset-react": "latest",
"typescript": "^4"
"vite-preset-react": "latest"
}
}
6 changes: 3 additions & 3 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,9 @@ browserslist@^4.17.5:
picocolors "^1.0.0"

caniuse-lite@^1.0.30001286:
version "1.0.30001300"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001300.tgz#11ab6c57d3eb6f964cba950401fd00a146786468"
integrity sha512-cVjiJHWGcNlJi8TZVKNMnvMid3Z3TTdDHmLDzlOdIiZq138Exvo0G+G0wTdVYolxKb4AYwC+38pxodiInVtJSA==
version "1.0.30001606"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001606.tgz"
integrity sha512-LPbwnW4vfpJId225pwjZJOgX1m9sGfbw/RKJvw/t0QhYOOaTXHvkjVGFGPpvwEzufrjvTlsULnVTxdy4/6cqkg==

chalk@^2.0.0:
version "2.4.2"
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
"scripts": {
"analyze": "size-limit --why",
"build": "dts build",
"build-storybook": "build-storybook",
"build-storybook": "storybook build",
"lint": "dts lint",
"prepare": "dts build",
"size": "size-limit",
"start": "dts watch",
"storybook": "start-storybook -p 6006",
"storybook": "storybook dev -p 6006",
"test": "dts test --passWithNoTests"
},
"jest": {
Expand Down Expand Up @@ -66,10 +66,10 @@
"@size-limit/esbuild-why": "^11.1.2",
"@size-limit/preset-small-lib": "^11.1.2",
"@storybook/addon-essentials": "^8.0.6",
"@storybook/addon-info": "^5.3.21",
"@storybook/addon-links": "^8.0.6",
"@storybook/addons": "^7.6.17",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/react": "^8.0.6",
"@storybook/react-webpack5": "^8.0.6",
"@tsconfig/create-react-app": "^2.0.4",
"@tsconfig/recommended": "^1.0.6",
"@types/react": "^18.2.74",
Expand All @@ -88,6 +88,7 @@
"react-is": "^18.2.0",
"rollup-plugin-postcss": "^4.0.2",
"sass": "^1.74.1",
"storybook": "^8.0.6",
"tslib": "^2.6.2",
"typescript": "^5.1.6"
},
Expand All @@ -101,6 +102,7 @@
"@tiptap/extension-task-list": "^2.2.6",
"@tiptap/extension-text-align": "^2.2.6",
"@tiptap/extension-underline": "^2.2.6",
"@tiptap/pm": "^2.2.6",
"@tiptap/react": "^2.2.6",
"@tiptap/starter-kit": "^2.2.6",
"@tiptap/suggestion": "^2.2.6",
Expand Down
4 changes: 2 additions & 2 deletions src/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import TextAlignExt from '@tiptap/extension-text-align';
import TaskListExt from '@tiptap/extension-task-list';
import TaskItemExt from '@tiptap/extension-task-item';
import CodeBlockLowlightExt from '@tiptap/extension-code-block-lowlight';
import lowlight from 'lowlight';
import { common, createLowlight } from 'lowlight';

import { BubbleMenuBox, FixedMenuBox } from './menus';
import { CommandMenuExt, CommandSuggestion } from './extensions';
Expand Down Expand Up @@ -38,7 +38,7 @@ export const WebEditor = ({
SubscriptExt,
SuperscriptExt,
TaskListExt,
CodeBlockLowlightExt.configure({ lowlight }),
CodeBlockLowlightExt.configure({ lowlight: createLowlight(common) }),
TaskItemExt.configure({ nested: true }),
TextAlignExt.configure({ types: ['heading', 'paragraph'] }),
PlaceholderExt.configure({
Expand Down
Loading

0 comments on commit 3c60276

Please sign in to comment.