diff --git a/packages/client/package.json b/packages/client/package.json index a7d43d8f..fdf34b17 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -6,7 +6,7 @@ "prebuild": "rimraf .next", "build": "next build", "start": "cross-env NODE_ENV=production next start -p 5002", - "pm2": "pm2 start npm --name @think/client -- start" + "pm2": "pm2 start -i max npm --name @think/client -- start" }, "dependencies": { "@douyinfe/semi-icons": "^2.3.1", diff --git a/packages/client/src/components/icons/IconTableHeaderCell.tsx b/packages/client/src/components/icons/IconTableHeaderCell.tsx index a0e77475..3f146014 100644 --- a/packages/client/src/components/icons/IconTableHeaderCell.tsx +++ b/packages/client/src/components/icons/IconTableHeaderCell.tsx @@ -5,7 +5,7 @@ export const IconTableHeaderCell: React.FC<{ style?: React.CSSProperties }> = ({ + = + } diff --git a/packages/client/src/components/icons/IconTableHeaderRow.tsx b/packages/client/src/components/icons/IconTableHeaderRow.tsx index 557ba60d..d9211bfc 100644 --- a/packages/client/src/components/icons/IconTableHeaderRow.tsx +++ b/packages/client/src/components/icons/IconTableHeaderRow.tsx @@ -5,7 +5,7 @@ export const IconTableHeaderRow: React.FC<{ style?: React.CSSProperties }> = ({ + diff --git a/packages/client/src/components/tiptap/extensions/bulletList.ts b/packages/client/src/components/tiptap/extensions/bulletList.ts index 306d6e15..163a14fb 100644 --- a/packages/client/src/components/tiptap/extensions/bulletList.ts +++ b/packages/client/src/components/tiptap/extensions/bulletList.ts @@ -17,8 +17,4 @@ export const BulletList = BuiltInBulletList.extend({ }, }; }, - - addInputRules() { - return [listInputRule(/^\s*([-+*])\s([^\s[])$/, this.type)]; - }, }); diff --git a/packages/client/src/components/tiptap/menus/colorPicker/style.module.scss b/packages/client/src/components/tiptap/menus/colorPicker/style.module.scss index 09bb6f8f..33dd5719 100644 --- a/packages/client/src/components/tiptap/menus/colorPicker/style.module.scss +++ b/packages/client/src/components/tiptap/menus/colorPicker/style.module.scss @@ -11,11 +11,17 @@ width: 32px; height: 32px; cursor: pointer; + border-radius: 4px; + border: 1px solid transparent; &:nth-of-type(n + 8) { margin-top: 4px; } + &:hover { + border-color: rgb(193, 199, 208); + } + > span { display: block; width: 28px; diff --git a/packages/client/src/components/tiptap/menus/table.tsx b/packages/client/src/components/tiptap/menus/table.tsx index a6ab412a..81de92b9 100644 --- a/packages/client/src/components/tiptap/menus/table.tsx +++ b/packages/client/src/components/tiptap/menus/table.tsx @@ -26,7 +26,7 @@ export const TableBubbleMenu = ({ editor }) => { pluginKey="table-bubble-menu" shouldShow={() => editor.isActive(Table.name)} tippyOptions={{ - maxWidth: 456, + maxWidth: 486, placement: 'bottom', }} matchRenderContainer={(node: HTMLElement) => diff --git a/packages/client/src/components/tiptap/services/markdown/htmlToProsemirror/nodes/heading.ts b/packages/client/src/components/tiptap/services/markdown/htmlToProsemirror/nodes/heading.ts index aaa595e5..172122e5 100644 --- a/packages/client/src/components/tiptap/services/markdown/htmlToProsemirror/nodes/heading.ts +++ b/packages/client/src/components/tiptap/services/markdown/htmlToProsemirror/nodes/heading.ts @@ -4,11 +4,11 @@ export class Heading extends Node { getLevel() { const matches = this.DOMNode.nodeName.match(/^H([1-6])/); - return matches ? matches[1] : null; + return matches ? +matches[1] : null; } matching() { - return Boolean(this.getLevel()); + return this.DOMNode?.tagName?.startsWith('H') && Boolean(this.getLevel()); } data() { diff --git a/packages/client/src/components/tiptap/wrappers/codeBlock/index.module.scss b/packages/client/src/components/tiptap/wrappers/codeBlock/index.module.scss index ee2ce867..00f9ee1d 100644 --- a/packages/client/src/components/tiptap/wrappers/codeBlock/index.module.scss +++ b/packages/client/src/components/tiptap/wrappers/codeBlock/index.module.scss @@ -2,10 +2,11 @@ position: relative; .handleWrap { - position: absolute; - right: 0.5rem; - top: 0.5rem; - z-index: 100; + display: flex; + justify-content: space-between; + padding: 6px 8px; + background-color: var(--semi-color-fill-0); + border-bottom: 1px solid var(--semi-color-border); .selectorWrap { margin-right: 8px; diff --git a/packages/client/src/components/tiptap/wrappers/codeBlock/index.tsx b/packages/client/src/components/tiptap/wrappers/codeBlock/index.tsx index b0b4b245..a1b166c3 100644 --- a/packages/client/src/components/tiptap/wrappers/codeBlock/index.tsx +++ b/packages/client/src/components/tiptap/wrappers/codeBlock/index.tsx @@ -6,35 +6,29 @@ import { IconCopy } from '@douyinfe/semi-icons'; import { copy } from 'helpers/copy'; import styles from './index.module.scss'; -export const CodeBlockWrapper = ({ - editor, - node: { - attrs: { language: defaultLanguage }, - }, - updateAttributes, - extension, -}) => { +export const CodeBlockWrapper = ({ editor, node: { attrs }, updateAttributes, extension }) => { const isEditable = editor.isEditable; + const { language: defaultLanguage } = attrs; const $container = useRef(); return (
- {isEditable && ( - - )} +