@lobehub/editor 4.29.2 → 5.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/codemirror/components/CopyButton.js +1 -1
- package/es/codemirror/components/LanguageSelect.js +1 -3
- package/es/codemirror/components/MoreOptions.js +1 -2
- package/es/codemirror/components/Toolbar.js +1 -2
- package/es/codemirror/components/style.js +1 -1
- package/es/codemirror/style.js +1 -1
- package/es/codemirror/theme.js +1 -1
- package/es/editor-kernel/react/useAnchor.js +1 -1
- package/es/plugins/auto-complete/react/ReactAutoCompletePlugin.js +1 -1
- package/es/plugins/auto-complete/react/style.js +1 -1
- package/es/plugins/block/react/ReactBlockPlugin.js +2 -4
- package/es/plugins/block/react/style.js +1 -1
- package/es/plugins/code/react/CodeReactPlugin.js +1 -1
- package/es/plugins/code/react/style.js +1 -1
- package/es/plugins/codeblock/react/ReactCodeblockPlugin.js +1 -1
- package/es/plugins/codeblock/react/style.js +1 -1
- package/es/plugins/codemirror-block/react/CodemirrorNode.js +1 -3
- package/es/plugins/codemirror-block/react/MermaidPreview.js +1 -2
- package/es/plugins/collapsible/react/ReactCollapsiblePlugin.js +1 -1
- package/es/plugins/collapsible/react/style.js +74 -64
- package/es/plugins/common/react/Placeholder/style.js +1 -1
- package/es/plugins/common/react/ReactPlainText.js +1 -1
- package/es/plugins/common/react/style.js +1 -1
- package/es/plugins/file/react/components/ReactFile.js +1 -1
- package/es/plugins/file/react/style.js +1 -1
- package/es/plugins/hr/react/components/HRNode.js +1 -1
- package/es/plugins/hr/react/style.js +1 -1
- package/es/plugins/image/react/components/Image.js +1 -3
- package/es/plugins/image/react/components/ImageEditPopover.js +1 -3
- package/es/plugins/image/react/components/LazyImage.js +1 -1
- package/es/plugins/image/react/components/ResizeHandle.js +1 -1
- package/es/plugins/image/react/components/style.js +1 -1
- package/es/plugins/image/react/style.js +1 -1
- package/es/plugins/link/react/ReactLinkPlugin.js +1 -1
- package/es/plugins/link/react/components/LinkEdit.js +1 -3
- package/es/plugins/link/react/components/LinkToolbar.js +1 -1
- package/es/plugins/link/react/style.js +1 -1
- package/es/plugins/link-highlight/react/ReactLinkHighlightPlugin.js +1 -1
- package/es/plugins/link-highlight/react/style.js +1 -1
- package/es/plugins/list/react/style.js +1 -1
- package/es/plugins/litexml/react/DiffNodeToolbar/index.js +1 -3
- package/es/plugins/litexml/react/DiffNodeToolbar/style.js +1 -1
- package/es/plugins/litexml/react/TableRowDiffToolbar.js +1 -3
- package/es/plugins/litexml/react/style.js +1 -1
- package/es/plugins/markdown/react/index.js +1 -1
- package/es/plugins/math/react/components/MathEditorContainer.js +1 -1
- package/es/plugins/math/react/components/MathEditorContent.js +1 -2
- package/es/plugins/math/react/components/Placeholder.js +1 -3
- package/es/plugins/math/react/style.js +1 -1
- package/es/plugins/mention/react/components/Mention.js +1 -1
- package/es/plugins/mention/react/style.js +1 -1
- package/es/plugins/slash/react/components/DefaultSlashMenu.js +1 -2
- package/es/plugins/slash/service/i-slash-service.d.ts +1 -1
- package/es/plugins/table/react/TableActionMenu/ActionMenu.js +1 -1
- package/es/plugins/table/react/TableActionMenu/index.js +1 -1
- package/es/plugins/table/react/TableActionMenu/style.js +1 -1
- package/es/plugins/table/react/TableColController.js +1 -1
- package/es/plugins/table/react/TableController/style.js +1 -1
- package/es/plugins/table/react/TableControllerButton.js +2 -2
- package/es/plugins/table/react/TableControllerMenu.js +2 -2
- package/es/plugins/table/react/TableHoverActions/index.js +1 -2
- package/es/plugins/table/react/TableHoverActions/style.js +1 -1
- package/es/plugins/table/react/TableResize/index.js +2 -2
- package/es/plugins/table/react/TableResize/style.js +1 -1
- package/es/plugins/table/react/TableRowController.js +1 -1
- package/es/plugins/table/react/index.js +1 -1
- package/es/plugins/table/react/style.js +1 -1
- package/es/plugins/toolbar/react/index.js +1 -2
- package/es/plugins/toolbar/react/style.js +1 -1
- package/es/react/ChatInput/ChatInput.js +1 -2
- package/es/react/ChatInput/style.js +1 -1
- package/es/react/ChatInput/type.d.ts +1 -1
- package/es/react/ChatInputActionBar/ChatInputActionBar.js +1 -2
- package/es/react/ChatInputActionBar/style.js +1 -1
- package/es/react/ChatInputActionBar/type.d.ts +1 -1
- package/es/react/ChatInputActions/ChatInputActions.js +1 -2
- package/es/react/ChatInputActions/components/ActionItem.js +1 -1
- package/es/react/ChatInputActions/components/ActionRender.js +1 -1
- package/es/react/ChatInputActions/components/CollapsedActions.js +1 -2
- package/es/react/ChatInputActions/style.js +1 -1
- package/es/react/ChatInputActions/type.d.ts +4 -4
- package/es/react/CodeLanguageSelect/CodeLanguageSelect.js +1 -3
- package/es/react/CodeLanguageSelect/style.js +1 -1
- package/es/react/CodeLanguageSelect/type.d.ts +1 -1
- package/es/react/FloatActions/FloatActions.js +1 -2
- package/es/react/FloatActions/components/ActionItem.js +1 -1
- package/es/react/FloatActions/components/ActionRender.js +1 -1
- package/es/react/FloatActions/components/CollapsedActions.js +1 -2
- package/es/react/FloatActions/style.js +1 -1
- package/es/react/FloatActions/type.d.ts +4 -4
- package/es/react/SendButton/SendButton.js +1 -2
- package/es/react/SendButton/components/SendIcon.js +1 -1
- package/es/react/SendButton/components/StopIcon.js +1 -1
- package/es/react/SendButton/style.js +1 -1
- package/es/react/SendButton/type.d.ts +1 -1
- package/es/renderer/LexicalDiff.js +1 -1
- package/es/renderer/LexicalRenderer.js +1 -1
- package/es/renderer/diff/compute.js +2 -2
- package/es/renderer/diff/style.js +1 -1
- package/es/renderer/engine/render-builtin-node.js +2 -2
- package/es/renderer/renderers/codeblock.js +1 -1
- package/es/renderer/renderers/horizontalrule.js +1 -1
- package/es/renderer/renderers/mermaid.js +1 -1
- package/es/renderer/style.js +1 -1
- package/package.json +3 -5
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { LANGUAGES } from "../constants.js";
|
|
3
3
|
import { styles } from "./style.js";
|
|
4
|
-
import { Select, Text } from "@lobehub/ui
|
|
4
|
+
import { Flexbox, MaterialFileTypeIcon, Select, Text, cx } from "@lobehub/ui";
|
|
5
5
|
import { useMemo } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { Flexbox, MaterialFileTypeIcon } from "@lobehub/ui";
|
|
8
|
-
import { cx } from "antd-style";
|
|
9
7
|
//#region src/codemirror/components/LanguageSelect.tsx
|
|
10
8
|
const LanguageSelect = ({ selectedLang, onLanguageChange, options, labels, className }) => {
|
|
11
9
|
const modes = options ?? LANGUAGES;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { ActionIcon, InputNumber, Switch, Text } from "@lobehub/ui
|
|
2
|
+
import { ActionIcon, Flexbox, InputNumber, Popover, Switch, Text } from "@lobehub/ui";
|
|
3
3
|
import { MoreHorizontalIcon } from "lucide-react";
|
|
4
4
|
import { useCallback } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { Flexbox, Popover } from "@lobehub/ui";
|
|
7
6
|
//#region src/codemirror/components/MoreOptions.tsx
|
|
8
7
|
const MoreOptions = ({ tabSize, onTabSizeChange, useTabs, onUseTabsChange, showLineNumbers, onShowLineNumbersChange, labels }) => {
|
|
9
8
|
const handleTabSizeChange = useCallback((value = 2) => {
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
import { CopyButton } from "./CopyButton.js";
|
|
3
3
|
import { LanguageSelect } from "./LanguageSelect.js";
|
|
4
4
|
import { MoreOptions } from "./MoreOptions.js";
|
|
5
|
-
import { ActionIcon } from "@lobehub/ui
|
|
5
|
+
import { ActionIcon, Flexbox } from "@lobehub/ui";
|
|
6
6
|
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { Flexbox } from "@lobehub/ui";
|
|
9
8
|
//#region src/codemirror/components/Toolbar.tsx
|
|
10
9
|
const Toolbar = ({ selectedLang, onLanguageChange, onCopy, tabSize, onTabSizeChange, useTabs, onUseTabsChange, showLineNumbers, onShowLineNumbersChange, onClick, expand, toggleExpand, labels, languageOptions, extra }) => {
|
|
11
10
|
return /* @__PURE__ */ jsxs(Flexbox, {
|
package/es/codemirror/style.js
CHANGED
package/es/codemirror/theme.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useLexicalComposerContext } from "./react-context.js";
|
|
3
|
-
import { useMemo } from "react";
|
|
4
3
|
import { LOBE_THEME_APP_ID } from "@lobehub/ui";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
5
|
//#region src/editor-kernel/react/useAnchor.ts
|
|
6
6
|
const useAnchor = () => {
|
|
7
7
|
const [editor] = useLexicalComposerContext();
|
|
@@ -3,8 +3,8 @@ import { createDebugLogger, init_debug } from "../../../utils/debug.js";
|
|
|
3
3
|
import { useLexicalComposerContext } from "../../../editor-kernel/react/react-context.js";
|
|
4
4
|
import { AutoCompletePlugin } from "../plugin/index.js";
|
|
5
5
|
import { styles } from "./style.js";
|
|
6
|
+
import { cx } from "@lobehub/ui";
|
|
6
7
|
import { useLayoutEffect, useRef } from "react";
|
|
7
|
-
import { cx } from "antd-style";
|
|
8
8
|
//#region src/plugins/auto-complete/react/ReactAutoCompletePlugin.tsx
|
|
9
9
|
init_debug();
|
|
10
10
|
const logger = createDebugLogger("react-plugin", "auto-complete");
|
|
@@ -10,12 +10,10 @@ import { createRuntimeContext } from "./core/runtime-context.js";
|
|
|
10
10
|
import { collectDragBlocks, getBlockMeasureRect, getTableBlockRect, isTableBlockElement } from "./drag/drag-utils.js";
|
|
11
11
|
import { startBlockDragSession } from "./drag/drag-session.js";
|
|
12
12
|
import { ANCHOR_PADDING_CSS_VAR, styles } from "./style.js";
|
|
13
|
-
import { Button } from "@lobehub/ui
|
|
13
|
+
import { Button, DropdownMenu, Icon, cx, useAppElement } from "@lobehub/ui";
|
|
14
14
|
import { GripVerticalIcon, PlusIcon } from "lucide-react";
|
|
15
15
|
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
16
16
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
-
import { DropdownMenu as DropdownMenu$1, Icon, useAppElement } from "@lobehub/ui";
|
|
18
|
-
import { cx } from "antd-style";
|
|
19
17
|
import { $findTableNode, $isTableSelection } from "@lexical/table";
|
|
20
18
|
import { $getNodeByKey, $getSelection, $isRangeSelection } from "lexical";
|
|
21
19
|
import { createPortal } from "react-dom";
|
|
@@ -634,7 +632,7 @@ const ReactBlockPlugin = (props) => {
|
|
|
634
632
|
title,
|
|
635
633
|
type: "text"
|
|
636
634
|
}, item.key);
|
|
637
|
-
}), /* @__PURE__ */ jsx(DropdownMenu
|
|
635
|
+
}), /* @__PURE__ */ jsx(DropdownMenu, {
|
|
638
636
|
items: dropdownItems,
|
|
639
637
|
onOpenChange: handleOperationMenuOpenChange,
|
|
640
638
|
open: operationMenuOpen && operationMenuContext?.blockId === menuContext.blockId,
|
|
@@ -3,8 +3,8 @@ import { useLexicalComposerContext } from "../../../editor-kernel/react/react-co
|
|
|
3
3
|
import { MarkdownPlugin } from "../../markdown/plugin/index.js";
|
|
4
4
|
import { CodePlugin } from "../plugin/index.js";
|
|
5
5
|
import { styles } from "./style.js";
|
|
6
|
+
import { cx } from "@lobehub/ui";
|
|
6
7
|
import { useLayoutEffect } from "react";
|
|
7
|
-
import { cx } from "antd-style";
|
|
8
8
|
//#region src/plugins/code/react/CodeReactPlugin.tsx
|
|
9
9
|
const ReactCodePlugin = ({ className, enableHotkey = true }) => {
|
|
10
10
|
const [editor] = useLexicalComposerContext();
|
|
@@ -3,8 +3,8 @@ import { useLexicalComposerContext } from "../../../editor-kernel/react/react-co
|
|
|
3
3
|
import { MarkdownPlugin } from "../../markdown/plugin/index.js";
|
|
4
4
|
import { CodeblockPlugin } from "../plugin/index.js";
|
|
5
5
|
import { styles } from "./style.js";
|
|
6
|
+
import { cx } from "@lobehub/ui";
|
|
6
7
|
import { useLayoutEffect } from "react";
|
|
7
|
-
import { cx } from "antd-style";
|
|
8
8
|
//#region src/plugins/codeblock/react/ReactCodeblockPlugin.tsx
|
|
9
9
|
const ReactCodeblockPlugin = ({ theme, shikiTheme }) => {
|
|
10
10
|
const [editor] = useLexicalComposerContext();
|
|
@@ -8,12 +8,10 @@ import { SELECT_AFTER_CODEMIRROR_COMMAND, SELECT_BEFORE_CODEMIRROR_COMMAND } fro
|
|
|
8
8
|
import { useLexicalNodeSelection } from "../../../editor-kernel/react/useLexicalNodeSelection.js";
|
|
9
9
|
import MermaidPreview from "./MermaidPreview.js";
|
|
10
10
|
import { useCodemirrorEditLock } from "./useCodemirrorEditLock.js";
|
|
11
|
-
import { ActionIcon } from "@lobehub/ui
|
|
11
|
+
import { ActionIcon, Block, cx } from "@lobehub/ui";
|
|
12
12
|
import { CodeXml, Eye } from "lucide-react";
|
|
13
13
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
import { Block } from "@lobehub/ui";
|
|
16
|
-
import { cx } from "antd-style";
|
|
17
15
|
import { debounce } from "es-toolkit/compat";
|
|
18
16
|
import { $getSelection, $setSelection, COMMAND_PRIORITY_CRITICAL, KEY_DOWN_COMMAND } from "lexical";
|
|
19
17
|
import { mergeRegister } from "@lexical/utils";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { Mermaid, cssVar } from "@lobehub/ui";
|
|
2
3
|
import { useEffect, useState } from "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { Mermaid } from "@lobehub/ui";
|
|
5
|
-
import { cssVar } from "antd-style";
|
|
6
5
|
//#region src/plugins/codemirror-block/react/MermaidPreview.tsx
|
|
7
6
|
const MermaidPreview = ({ code }) => {
|
|
8
7
|
const [error, setError] = useState(null);
|
|
@@ -3,8 +3,8 @@ import { useLexicalComposerContext } from "../../../editor-kernel/react/react-co
|
|
|
3
3
|
import { MarkdownPlugin } from "../../markdown/plugin/index.js";
|
|
4
4
|
import { CollapsiblePlugin } from "../plugin/index.js";
|
|
5
5
|
import { styles } from "./style.js";
|
|
6
|
+
import { cx } from "@lobehub/ui";
|
|
6
7
|
import { useLayoutEffect } from "react";
|
|
7
|
-
import { cx } from "antd-style";
|
|
8
8
|
//#region src/plugins/collapsible/react/ReactCollapsiblePlugin.tsx
|
|
9
9
|
const ReactCollapsiblePlugin = ({ className }) => {
|
|
10
10
|
const [editor] = useLexicalComposerContext();
|
|
@@ -1,67 +1,77 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createStaticStyles } from "@lobehub/ui";
|
|
2
2
|
//#region src/plugins/collapsible/react/style.ts
|
|
3
|
-
const styles = css`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
3
|
+
const styles = createStaticStyles(({ css }) => css`
|
|
4
|
+
position: relative;
|
|
5
|
+
|
|
6
|
+
margin-block: 12px;
|
|
7
|
+
margin-inline: 0;
|
|
8
|
+
padding-block: 14px;
|
|
9
|
+
padding-inline: 42px 16px;
|
|
10
|
+
border: 1px solid rgb(51 103 153 / 72%);
|
|
11
|
+
border-radius: 8px;
|
|
12
|
+
|
|
13
|
+
&[data-collapsible-collapsed='true'] {
|
|
14
|
+
padding-block: 10px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[data-collapsible-toggle='true'] {
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
|
|
20
|
+
position: absolute;
|
|
21
|
+
inset-block-start: 20px;
|
|
22
|
+
inset-inline-start: 16px;
|
|
23
|
+
|
|
24
|
+
width: 14px;
|
|
25
|
+
height: 14px;
|
|
26
|
+
padding: 0;
|
|
27
|
+
border: 0;
|
|
28
|
+
|
|
29
|
+
color: currentcolor;
|
|
30
|
+
|
|
31
|
+
background: transparent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&[data-collapsible-collapsed='true'] > [data-collapsible-toggle='true'] {
|
|
35
|
+
inset-block-start: 15px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-collapsible-toggle='true']::before {
|
|
39
|
+
content: '';
|
|
40
|
+
|
|
41
|
+
display: block;
|
|
42
|
+
|
|
43
|
+
width: 0;
|
|
44
|
+
height: 0;
|
|
45
|
+
margin-block: 3px 0;
|
|
46
|
+
margin-inline: 2px 0;
|
|
47
|
+
border-style: solid;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&[data-collapsible-collapsed='false'] > [data-collapsible-toggle='true']::before {
|
|
51
|
+
border-color: currentcolor transparent transparent;
|
|
52
|
+
border-width: 7px 5px 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&[data-collapsible-collapsed='true'] > [data-collapsible-toggle='true']::before {
|
|
56
|
+
border-color: transparent transparent transparent currentcolor;
|
|
57
|
+
border-width: 5px 0 5px 7px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[data-collapsible-content='true'] > *:first-child {
|
|
61
|
+
margin-block-start: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
[data-collapsible-content='true'] > *:last-child {
|
|
65
|
+
margin-block-end: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&[data-collapsible-collapsed='true'] > [data-collapsible-content='true'] > *:first-child {
|
|
69
|
+
margin-block-end: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&[data-collapsible-collapsed='true'] > [data-collapsible-content='true'] > *:not(:first-child) {
|
|
73
|
+
display: none !important;
|
|
74
|
+
}
|
|
75
|
+
`);
|
|
66
76
|
//#endregion
|
|
67
77
|
export { styles };
|
|
@@ -6,9 +6,9 @@ import { CommonPlugin } from "../plugin/index.js";
|
|
|
6
6
|
import { useDecorators } from "../../../editor-kernel/react/useDecorators.js";
|
|
7
7
|
import Placeholder from "./Placeholder/index.js";
|
|
8
8
|
import { styles, themeStyles } from "./style.js";
|
|
9
|
+
import { cx } from "@lobehub/ui";
|
|
9
10
|
import { Children, memo, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
10
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { cx } from "antd-style";
|
|
12
12
|
import { COMMAND_PRIORITY_EDITOR, KEY_DOWN_COMMAND } from "lexical";
|
|
13
13
|
//#region src/plugins/common/react/ReactPlainText.tsx
|
|
14
14
|
const ReactPlainText = memo(({ style, children, theme = {}, onChange, editable, className, variant, enableHotkey = true, enablePasteMarkdown = true, autoFormatMarkdown = true, markdownOption = true, pasteAsPlainText = false, pasteMarkdownAutoConvertThreshold, pasteVSCodeAsCodeBlock = true, onKeyDown, onFocus, onBlur, autoFocus, onPressEnter, onCompositionStart, onCompositionEnd, onContextMenu, onTextChange }) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useTranslation } from "../../../../editor-kernel/react/useTranslation.js";
|
|
2
2
|
import { useLexicalNodeSelection } from "../../../../editor-kernel/react/useLexicalNodeSelection.js";
|
|
3
|
+
import { Center, MaterialFileTypeIcon } from "@lobehub/ui";
|
|
3
4
|
import { useCallback, useEffect, useRef } from "react";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { Center, MaterialFileTypeIcon } from "@lobehub/ui";
|
|
6
6
|
import { CLICK_COMMAND, COMMAND_PRIORITY_LOW } from "lexical";
|
|
7
7
|
//#region src/plugins/file/react/components/ReactFile.tsx
|
|
8
8
|
const ReactFile = ({ className, editor, node }) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useLexicalNodeSelection } from "../../../../editor-kernel/react/useLexicalNodeSelection.js";
|
|
3
3
|
import { styles } from "../style.js";
|
|
4
|
+
import { cx } from "@lobehub/ui";
|
|
4
5
|
import { useEffect } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { cx } from "antd-style";
|
|
7
7
|
import { CLICK_COMMAND, COMMAND_PRIORITY_LOW } from "lexical";
|
|
8
8
|
import { mergeRegister } from "@lexical/utils";
|
|
9
9
|
//#region src/plugins/hr/react/components/HRNode.tsx
|
|
@@ -7,12 +7,10 @@ import BrokenImage from "./BrokenImage.js";
|
|
|
7
7
|
import ImageEditPopover from "./ImageEditPopover.js";
|
|
8
8
|
import LazyImage from "./LazyImage.js";
|
|
9
9
|
import { ResizeHandle } from "./ResizeHandle.js";
|
|
10
|
-
import { ActionIcon } from "@lobehub/ui
|
|
10
|
+
import { ActionIcon, Icon, cx, useImagePreview } from "@lobehub/ui";
|
|
11
11
|
import { LoaderCircleIcon, ZoomInIcon } from "lucide-react";
|
|
12
12
|
import { Suspense, memo, useCallback, useMemo, useRef, useState } from "react";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { Icon, useImagePreview } from "@lobehub/ui";
|
|
15
|
-
import { cx } from "antd-style";
|
|
16
14
|
import { COMMAND_PRIORITY_LOW, SELECTION_CHANGE_COMMAND } from "lexical";
|
|
17
15
|
//#region src/plugins/image/react/components/Image.tsx
|
|
18
16
|
function getResizedImageWidth(startWidth, deltaX, maxWidth) {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { useLexicalEditor } from "../../../../editor-kernel/react/useLexicalEditor.js";
|
|
2
2
|
import { useTranslation } from "../../../../editor-kernel/react/useTranslation.js";
|
|
3
3
|
import { useEditable } from "../../../../editor-kernel/react/useEditable.js";
|
|
4
|
-
import { Button, Input } from "@lobehub/ui
|
|
4
|
+
import { Button, Flexbox, Icon, Input, Popover, cssVar } from "@lobehub/ui";
|
|
5
5
|
import { LinkIcon, UploadIcon } from "lucide-react";
|
|
6
6
|
import { memo, useCallback, useRef, useState } from "react";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { Flexbox, Icon, Popover } from "@lobehub/ui";
|
|
9
|
-
import { cssVar } from "antd-style";
|
|
10
8
|
//#region src/plugins/image/react/components/ImageEditPopover.tsx
|
|
11
9
|
const ImageEditPopover = memo(({ children, node, handleUpload, onPickFile }) => {
|
|
12
10
|
const [open, setOpen] = useState(false);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { styles } from "./style.js";
|
|
2
2
|
import BrokenImage from "./BrokenImage.js";
|
|
3
3
|
import { useSuspenseImage } from "./useSupenseImage.js";
|
|
4
|
+
import { cx } from "@lobehub/ui";
|
|
4
5
|
import { useEffect, useState } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { cx } from "antd-style";
|
|
7
7
|
//#region src/plugins/image/react/components/LazyImage.tsx
|
|
8
8
|
function isSVG(src) {
|
|
9
9
|
return src.toLowerCase().endsWith(".svg");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styles } from "./style.js";
|
|
2
|
+
import { cx } from "@lobehub/ui";
|
|
2
3
|
import { useCallback, useRef } from "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { cx } from "antd-style";
|
|
5
5
|
//#region src/plugins/image/react/components/ResizeHandle.tsx
|
|
6
6
|
const ResizeHandle = ({ imageRef, isBlock, onResize, onResizeEnd, onResizeStart, position }) => {
|
|
7
7
|
const startWidthRef = useRef(0);
|
|
@@ -15,7 +15,7 @@ import LinkIframe from "./components/LinkIframe.js";
|
|
|
15
15
|
import LinkToolbar from "./components/LinkToolbar.js";
|
|
16
16
|
import SchemaLink from "./components/SchemaLink.js";
|
|
17
17
|
import { LinkReactRendererRegistry, splitReactSchemaRules } from "./renderer-registry.js";
|
|
18
|
-
import { toast } from "@lobehub/ui
|
|
18
|
+
import { toast } from "@lobehub/ui";
|
|
19
19
|
import { useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
20
20
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
21
|
//#region src/plugins/link/react/ReactLinkPlugin.tsx
|
|
@@ -4,12 +4,10 @@ import { UPDATE_LINK_TEXT_COMMAND } from "../../command/index.js";
|
|
|
4
4
|
import { EDIT_LINK_CARD_COMMAND } from "../../node/LinkCardNode.js";
|
|
5
5
|
import { cleanPosition, updatePosition } from "../../../../utils/updatePosition.js";
|
|
6
6
|
import { styles } from "../style.js";
|
|
7
|
-
import { Button, Input, Text } from "@lobehub/ui
|
|
7
|
+
import { Block, Button, Flexbox, Hotkey, Icon, Input, Text, cssVar } from "@lobehub/ui";
|
|
8
8
|
import { BaselineIcon, LinkIcon } from "lucide-react";
|
|
9
9
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { Block, Flexbox, Hotkey, Icon } from "@lobehub/ui";
|
|
12
|
-
import { cssVar } from "antd-style";
|
|
13
11
|
import { COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_NORMAL, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, createCommand } from "lexical";
|
|
14
12
|
import { mergeRegister } from "@lexical/utils";
|
|
15
13
|
//#region src/plugins/link/react/components/LinkEdit.tsx
|
|
@@ -8,10 +8,10 @@ import { useEditable } from "../../../../editor-kernel/react/useEditable.js";
|
|
|
8
8
|
import { cleanPosition, updatePosition } from "../../../../utils/updatePosition.js";
|
|
9
9
|
import { styles } from "../style.js";
|
|
10
10
|
import { $isLinkToolbarNode, convertLinkNodeByKeyToSchema, convertLinkToolbarNodeByKeyToLink, getLinkToolbarCapabilities, replaceNodeByKeyWithBlockCardNode, replaceNodeByKeyWithCardNode, replaceNodeByKeyWithIframeNode } from "../../conversion/index.js";
|
|
11
|
+
import { Flexbox, Icon } from "@lobehub/ui";
|
|
11
12
|
import { CopyIcon, EditIcon, ExternalLinkIcon, GalleryHorizontalEndIcon, LinkIcon, PanelTopOpenIcon, PanelsTopLeftIcon, UnlinkIcon } from "lucide-react";
|
|
12
13
|
import { memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
13
14
|
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
import { Flexbox, Icon } from "@lobehub/ui";
|
|
15
15
|
import { $getNodeByKey, $getSelection, $isRangeSelection, COMMAND_PRIORITY_NORMAL } from "lexical";
|
|
16
16
|
import { mergeRegister } from "@lexical/utils";
|
|
17
17
|
//#region src/plugins/link/react/components/LinkToolbar.tsx
|
|
@@ -2,8 +2,8 @@ import { useLexicalComposerContext } from "../../../editor-kernel/react/react-co
|
|
|
2
2
|
import { MarkdownPlugin } from "../../markdown/plugin/index.js";
|
|
3
3
|
import { LinkHighlightPlugin } from "../plugin/index.js";
|
|
4
4
|
import { styles } from "./style.js";
|
|
5
|
+
import { cx } from "@lobehub/ui";
|
|
5
6
|
import { useLayoutEffect } from "react";
|
|
6
|
-
import { cx } from "antd-style";
|
|
7
7
|
//#region src/plugins/link-highlight/react/ReactLinkHighlightPlugin.tsx
|
|
8
8
|
const ReactLinkHighlightPlugin = ({ className, enableHotkey = true, enablePasteAutoHighlight = true }) => {
|
|
9
9
|
const [editor] = useLexicalComposerContext();
|
|
@@ -2,11 +2,9 @@ import { LexicalPortalContainer } from "../../../../editor-kernel/react/PortalCo
|
|
|
2
2
|
import { LITEXML_DIFFNODE_COMMAND } from "../../command/symbols.js";
|
|
3
3
|
import { useTranslation } from "../../../../editor-kernel/react/useTranslation.js";
|
|
4
4
|
import { styles } from "./style.js";
|
|
5
|
-
import { ActionIcon } from "@lobehub/ui
|
|
5
|
+
import { ActionIcon, Block, useThemeMode } from "@lobehub/ui";
|
|
6
6
|
import { Check, X } from "lucide-react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { Block } from "@lobehub/ui";
|
|
9
|
-
import { useThemeMode } from "antd-style";
|
|
10
8
|
//#region src/plugins/litexml/react/DiffNodeToolbar/index.tsx
|
|
11
9
|
const ReactDiffNodeToolbar = ({ editor, node }) => {
|
|
12
10
|
const t = useTranslation();
|
|
@@ -2,12 +2,10 @@ import { $isTableRowDiffNode } from "../node/TableRowDiffNode.js";
|
|
|
2
2
|
import { LITEXML_DIFFNODE_COMMAND } from "../command/symbols.js";
|
|
3
3
|
import { useTranslation } from "../../../editor-kernel/react/useTranslation.js";
|
|
4
4
|
import { styles } from "./DiffNodeToolbar/style.js";
|
|
5
|
-
import { ActionIcon } from "@lobehub/ui
|
|
5
|
+
import { ActionIcon, Block, useThemeMode } from "@lobehub/ui";
|
|
6
6
|
import { Check, X } from "lucide-react";
|
|
7
7
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { Block } from "@lobehub/ui";
|
|
10
|
-
import { useThemeMode } from "antd-style";
|
|
11
9
|
import { $getNearestNodeFromDOMNode } from "lexical";
|
|
12
10
|
import { createPortal } from "react-dom";
|
|
13
11
|
//#region src/plugins/litexml/react/TableRowDiffToolbar.tsx
|
|
@@ -3,8 +3,8 @@ import { useLexicalComposerContext } from "../../../editor-kernel/react/react-co
|
|
|
3
3
|
import { INodePlugin } from "../../inode/plugin/index.js";
|
|
4
4
|
import { MarkdownPlugin } from "../plugin/index.js";
|
|
5
5
|
import { useTranslation } from "../../../editor-kernel/react/useTranslation.js";
|
|
6
|
-
import { useLayoutEffect } from "react";
|
|
7
6
|
import { toast } from "@lobehub/ui";
|
|
7
|
+
import { useLayoutEffect } from "react";
|
|
8
8
|
//#region src/plugins/markdown/react/index.tsx
|
|
9
9
|
const ReactMarkdownPlugin = () => {
|
|
10
10
|
const [editor] = useLexicalComposerContext();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { cleanPosition, updatePosition } from "../../../../utils/updatePosition.js";
|
|
2
2
|
import { styles } from "../style.js";
|
|
3
|
+
import { Flexbox, Popover } from "@lobehub/ui";
|
|
3
4
|
import { memo, useCallback, useEffect, useRef, useState } from "react";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { Flexbox, Popover } from "@lobehub/ui";
|
|
6
6
|
//#region src/plugins/math/react/components/MathEditorContainer.tsx
|
|
7
7
|
const MathEditorContainer = memo(({ children, isBlockMode, mathDOM, onFocus, prev }) => {
|
|
8
8
|
const anchorRef = useRef(null);
|