+
}
diff --git a/packages/client/src/layouts/app-router-header/wiki.tsx b/packages/client/src/layouts/app-router-header/wiki.tsx
index d0002c1a..2aed72d7 100644
--- a/packages/client/src/layouts/app-router-header/wiki.tsx
+++ b/packages/client/src/layouts/app-router-header/wiki.tsx
@@ -7,7 +7,7 @@ import { useStarWikisInOrganization } from 'data/star';
import { useWikiDetail } from 'data/wiki';
import Link from 'next/link';
import { useRouter } from 'next/router';
-import React from 'react';
+import React, { useCallback } from 'react';
import styles from './index.module.scss';
import { Placeholder } from './placeholder';
@@ -24,6 +24,58 @@ const WikiContent = () => {
} = useStarWikisInOrganization(query.organizationId);
const { data: currentWiki } = useWikiDetail(query.wikiId);
+ const renderNormalContent = useCallback(() => {
+ return (
+
+ {starWikis && starWikis.length ? (
+ starWikis.map((wiki) => {
+ return (
+
+ );
+ })
+ ) : (
+
+ )}
+
+ );
+ }, [refreshStarWikis, starWikis]);
+
return (
<>
{currentWiki && (
@@ -85,61 +137,7 @@ const WikiContent = () => {
loading={loading}
loadingContent={
}
error={error}
- normalContent={() => {
- return (
-
- {starWikis && starWikis.length ? (
- starWikis.map((wiki) => {
- return (
-
- );
- })
- ) : (
-
- )}
-
- );
- }}
+ normalContent={renderNormalContent}
/>
diff --git a/packages/client/src/layouts/app-single-column/index.tsx b/packages/client/src/layouts/app-single-column/index.tsx
index a36d37d3..702f6d2e 100644
--- a/packages/client/src/layouts/app-single-column/index.tsx
+++ b/packages/client/src/layouts/app-single-column/index.tsx
@@ -6,17 +6,17 @@ import styles from './index.module.scss';
const { Content } = SemiLayout;
+const style = {
+ padding: '16px 24px',
+ backgroundColor: 'var(--semi-color-bg-0)',
+};
+
export const AppSingleColumnLayout: React.FC = ({ children }) => {
return (
-
+
{children}
diff --git a/packages/client/src/layouts/double-column/index.tsx b/packages/client/src/layouts/double-column/index.tsx
index 56ec97d5..003a6a75 100644
--- a/packages/client/src/layouts/double-column/index.tsx
+++ b/packages/client/src/layouts/double-column/index.tsx
@@ -16,6 +16,8 @@ interface IProps {
rightNode: React.ReactNode;
}
+const style = { width: '100%', height: '100%' };
+
export const DoubleColumnLayout: React.FC = ({ leftNode, rightNode }) => {
const { minWidth, maxWidth, width, isCollapsed, updateWidth, toggleCollapsed } = useDragableWidth();
const debounceUpdate = useMemo(() => throttle(updateWidth, 200), [updateWidth]);
@@ -25,7 +27,7 @@ export const DoubleColumnLayout: React.FC = ({ leftNode, rightNode }) =>
-
+
: }
diff --git a/packages/client/src/layouts/public-double-column/index.tsx b/packages/client/src/layouts/public-double-column/index.tsx
index 95590546..6af27f26 100644
--- a/packages/client/src/layouts/public-double-column/index.tsx
+++ b/packages/client/src/layouts/public-double-column/index.tsx
@@ -15,6 +15,8 @@ interface IProps {
rightNode: React.ReactNode;
}
+const style = { width: '100%', height: '100%' };
+
export const PublicDoubleColumnLayout: React.FC = ({ leftNode, rightNode }) => {
const { minWidth, maxWidth, width, isCollapsed, updateWidth, toggleCollapsed } = useDragableWidth();
const debounceUpdate = useMemo(() => throttle(updateWidth, 200), [updateWidth]);
@@ -22,7 +24,7 @@ export const PublicDoubleColumnLayout: React.FC = ({ leftNode, rightNode
return (
-
+
: }
diff --git a/packages/client/src/layouts/single-column/index.tsx b/packages/client/src/layouts/single-column/index.tsx
index 4bf5b8d7..c6d13ece 100644
--- a/packages/client/src/layouts/single-column/index.tsx
+++ b/packages/client/src/layouts/single-column/index.tsx
@@ -6,17 +6,17 @@ import styles from './index.module.scss';
const { Content } = SemiLayout;
+const style = {
+ padding: '16px 24px',
+ backgroundColor: 'var(--semi-color-bg-0)',
+};
+
export const SingleColumnLayout: React.FC = ({ children }) => {
return (
-
+
{children}
diff --git a/packages/client/src/tiptap/core/bubble-menu/bubble-menu-plugin.tsx b/packages/client/src/tiptap/core/bubble-menu/bubble-menu-plugin.tsx
index eb3d9b34..ac23ca29 100644
--- a/packages/client/src/tiptap/core/bubble-menu/bubble-menu-plugin.tsx
+++ b/packages/client/src/tiptap/core/bubble-menu/bubble-menu-plugin.tsx
@@ -132,7 +132,10 @@ export class BubbleMenuView {
trigger: 'manual',
placement: 'top',
hideOnClick: 'toggle',
- ...Object.assign({ zIndex: 999 }, this.tippyOptions),
+ ...Object.assign(
+ { zIndex: 999, duration: 200, animation: 'shift-toward-subtle', moveTransition: 'transform 0.2s ease-in-out' },
+ this.tippyOptions
+ ),
});
// maybe we have to hide tippy on its own blur event as well
diff --git a/packages/client/src/tiptap/core/bubble-menu/index.tsx b/packages/client/src/tiptap/core/bubble-menu/index.tsx
index d03c7a44..9019196a 100644
--- a/packages/client/src/tiptap/core/bubble-menu/index.tsx
+++ b/packages/client/src/tiptap/core/bubble-menu/index.tsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useRef } from 'react';
+import React, { useEffect, useState } from 'react';
import { BubbleMenuPlugin, BubbleMenuPluginProps } from './bubble-menu-plugin';
@@ -9,11 +9,9 @@ export type BubbleMenuProps = Omit,
};
export const BubbleMenu: React.FC = (props) => {
- const $element = useRef(null);
+ const [element, setElement] = useState(null);
useEffect(() => {
- const element = $element.current;
-
if (!element) {
return;
}
@@ -46,10 +44,10 @@ export const BubbleMenu: React.FC = (props) => {
editor.registerPlugin(plugin);
return () => editor.unregisterPlugin(pluginKey);
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [props.editor]);
+ }, [props.editor, element]);
return (
-
+
{props.children}
);
diff --git a/packages/client/src/tiptap/core/menus/commands.tsx b/packages/client/src/tiptap/core/menus/commands.tsx
index 7e0fe448..1b005c87 100644
--- a/packages/client/src/tiptap/core/menus/commands.tsx
+++ b/packages/client/src/tiptap/core/menus/commands.tsx
@@ -63,7 +63,7 @@ export const COMMANDS: ICommand[] = [
label: '表格',
custom: (editor, runCommand) => (
(
{
const copyMe = useCallback(() => copyNode(DocumentReference.name, editor), [editor]);
const deleteMe = useCallback(() => deleteNode(DocumentReference.name, editor), [editor]);
+ const renderNormalContent = useCallback(
+ () => (
+ (
+ selectDoc(item)}
+ style={{ cursor: 'pointer' }}
+ main={
+
+
+
+
+
+ {item.title}
+
+
+ }
+ />
+ )}
+ />
+ ),
+ [selectDoc, tocs]
+ );
+
useEffect(() => {
if (defaultShowPicker && user && createUser === user.id) {
toggleVisible(true);
@@ -71,38 +101,7 @@ export const DocumentReferenceBubbleMenu = ({ editor }) => {
spacing={15}
visible={visible}
onVisibleChange={toggleVisible}
- content={
- (
- (
- selectDoc(item)}
- style={{ cursor: 'pointer' }}
- main={
-
-
-
-
-
- {item.title}
-
-
- }
- />
- )}
- />
- )}
- />
- }
+ content={}
trigger="click"
position="bottomLeft"
showArrow
diff --git a/packages/client/src/tiptap/core/menus/heading/index.tsx b/packages/client/src/tiptap/core/menus/heading/index.tsx
index b84240b1..cfb31a61 100644
--- a/packages/client/src/tiptap/core/menus/heading/index.tsx
+++ b/packages/client/src/tiptap/core/menus/heading/index.tsx
@@ -4,6 +4,14 @@ import { Editor } from 'tiptap/core';
import { Title } from 'tiptap/core/extensions/title';
import { useActive } from 'tiptap/core/hooks/use-active';
+const containerStyle = { width: 90, marginRight: 10 };
+const h1Style = { margin: 0, fontSize: '1.3em' };
+const h2Style = { margin: 0, fontSize: '1.1em' };
+const h3Style = { margin: 0, fontSize: '1.0em' };
+const h4Style = { margin: 0, fontSize: '0.9em' };
+const h5Style = { margin: 0, fontSize: '0.8em' };
+const h6Style = { margin: 0, fontSize: '0.8em' };
+
export const Heading: React.FC<{ editor: Editor }> = ({ editor }) => {
const isTitleActive = useActive(editor, Title.name);
const isH1 = useActive(editor, 'heading', { level: 1 });
@@ -12,6 +20,7 @@ export const Heading: React.FC<{ editor: Editor }> = ({ editor }) => {
const isH4 = useActive(editor, 'heading', { level: 4 });
const isH5 = useActive(editor, 'heading', { level: 5 });
const isH6 = useActive(editor, 'heading', { level: 6 });
+
const current = useMemo(() => {
if (isH1) return 1;
if (isH2) return 2;
@@ -34,25 +43,25 @@ export const Heading: React.FC<{ editor: Editor }> = ({ editor }) => {
);
return (
-