@cyberyozh/text-editor 0.1.6 → 0.1.8
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/dist/editor.css +46 -20
- package/dist/editor.css.map +1 -1
- package/dist/editor.js +483 -456
- package/dist/editor.js.map +1 -1
- package/dist/editor.mjs +481 -454
- package/dist/editor.mjs.map +1 -1
- package/dist/render.js +68 -29
- package/dist/render.js.map +1 -1
- package/dist/render.mjs +68 -29
- package/dist/render.mjs.map +1 -1
- package/dist/styles/index.css +46 -20
- package/package.json +5 -3
- package/src/editor/commands/items.ts +1 -1
- package/src/editor/components/common-modal/common-modal.css +2 -1
- package/src/editor/context/dialog-command.tsx +0 -2
- package/src/editor/controls/bubble-menu-content.tsx +6 -2
- package/src/editor/controls/commands-list.tsx +7 -0
- package/src/editor/dialogs/add-video-dialog/add-video-dialog.tsx +2 -5
- package/src/editor/dialogs/image-dialog/image-dialog.tsx +0 -1
- package/src/editor/editor.tsx +68 -44
- package/src/editor/handlers/dialog-handlers.ts +74 -62
- package/src/editor/handlers/index.ts +1 -2
- package/src/extensions/views/components/index.ts +1 -0
- package/src/extensions/views/components/table.tsx +48 -0
- package/src/render/static-renderer-config.tsx +16 -2
- package/src/styles/editor/base.css +7 -5
- package/src/styles/editor/states.css +4 -3
- package/src/styles/editor/typography.css +10 -2
- package/src/styles/editor/variables.css +1 -0
- package/src/styles/extensions/callout.css +5 -2
- package/src/styles/extensions/code-block.css +2 -1
- package/src/styles/extensions/commands-list.css +5 -1
- package/src/styles/extensions/custom-quote.css +5 -0
- package/src/styles/extensions/details.css +4 -4
- package/src/styles/extensions/myth-reality.css +3 -1
- package/src/styles/extensions/prompt.css +4 -1
- package/src/editor/handlers/create-image-upload-handler.ts +0 -24
package/dist/styles/index.css
CHANGED
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
/* src/editor/components/common-modal/common-modal.css */
|
|
82
82
|
.modal-overlay {
|
|
83
83
|
display: flex;
|
|
84
|
-
z-index:
|
|
84
|
+
z-index: 10001;
|
|
85
85
|
position: fixed;
|
|
86
86
|
top: 0;
|
|
87
87
|
right: 0;
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
.modal-content {
|
|
105
|
+
z-index: 10002;
|
|
105
106
|
position: relative;
|
|
106
107
|
width: 100%;
|
|
107
108
|
max-width: 500px;
|
|
@@ -879,6 +880,10 @@
|
|
|
879
880
|
border: none;
|
|
880
881
|
outline: none;
|
|
881
882
|
background: transparent;
|
|
883
|
+
font-weight: 500;
|
|
884
|
+
font-size: 18px;
|
|
885
|
+
line-height: 140%;
|
|
886
|
+
letter-spacing: -0.36px;
|
|
882
887
|
list-style: none;
|
|
883
888
|
cursor: pointer;
|
|
884
889
|
transition: all 150ms ease-in-out;
|
|
@@ -948,11 +953,13 @@
|
|
|
948
953
|
}
|
|
949
954
|
.myth-reality-block-content p:first-child {
|
|
950
955
|
margin-bottom: 8px;
|
|
951
|
-
font-weight: 600;
|
|
956
|
+
font-weight: 600 !important;
|
|
952
957
|
}
|
|
958
|
+
.myth-reality-block-content p,
|
|
953
959
|
.myth-reality-block-content ul p,
|
|
954
960
|
.myth-reality-block-content li p {
|
|
955
961
|
margin-bottom: 0;
|
|
962
|
+
font-weight: 400;
|
|
956
963
|
font-size: var(--tiptap-font-size);
|
|
957
964
|
}
|
|
958
965
|
|
|
@@ -985,6 +992,11 @@
|
|
|
985
992
|
flex-direction: column;
|
|
986
993
|
max-width: 700px;
|
|
987
994
|
margin: 0 auto 16px;
|
|
995
|
+
font-style: normal;
|
|
996
|
+
font-weight: 500;
|
|
997
|
+
font-size: 18px;
|
|
998
|
+
line-height: 140%;
|
|
999
|
+
letter-spacing: -0.36px;
|
|
988
1000
|
}
|
|
989
1001
|
[data-custom-quote-text] .is-empty::before {
|
|
990
1002
|
position: absolute;
|
|
@@ -1070,18 +1082,12 @@
|
|
|
1070
1082
|
}
|
|
1071
1083
|
.callout-node {
|
|
1072
1084
|
display: flex;
|
|
1085
|
+
align-items: baseline;
|
|
1073
1086
|
margin: 32px 0;
|
|
1074
1087
|
padding: 16px;
|
|
1075
1088
|
gap: 10px;
|
|
1076
1089
|
border-radius: 8px;
|
|
1077
1090
|
}
|
|
1078
|
-
.callout-node:has(.callout-content h2),
|
|
1079
|
-
.callout-node:has(.callout-content h3),
|
|
1080
|
-
.callout-node:has(.callout-content h4),
|
|
1081
|
-
.callout-node:has(.callout-content h5),
|
|
1082
|
-
.callout-node:has(.callout-content h6) {
|
|
1083
|
-
align-items: baseline;
|
|
1084
|
-
}
|
|
1085
1091
|
.callout-node p {
|
|
1086
1092
|
font-size: 16px;
|
|
1087
1093
|
line-height: 22px;
|
|
@@ -1134,6 +1140,8 @@
|
|
|
1134
1140
|
.callout-content-wrapper {
|
|
1135
1141
|
flex: 1;
|
|
1136
1142
|
min-width: 0;
|
|
1143
|
+
font-size: var(--tiptap-font-size);
|
|
1144
|
+
line-height: 1;
|
|
1137
1145
|
}
|
|
1138
1146
|
.callout-content {
|
|
1139
1147
|
color: inherit;
|
|
@@ -1226,6 +1234,7 @@
|
|
|
1226
1234
|
flex: 1;
|
|
1227
1235
|
max-width: 50%;
|
|
1228
1236
|
color: var(--tiptap-code-block-text);
|
|
1237
|
+
font-size: 14px;
|
|
1229
1238
|
font-family: var(--tiptap-code-block-font-family);
|
|
1230
1239
|
}
|
|
1231
1240
|
.tiptap-code-block-copy-button {
|
|
@@ -1305,8 +1314,11 @@
|
|
|
1305
1314
|
justify-content: space-between;
|
|
1306
1315
|
margin-bottom: 16px;
|
|
1307
1316
|
gap: 8px;
|
|
1317
|
+
font-style: normal;
|
|
1308
1318
|
font-weight: 600;
|
|
1309
|
-
font-size: var(--tiptap-
|
|
1319
|
+
font-size: var(--tiptap-font-size);
|
|
1320
|
+
line-height: 140%;
|
|
1321
|
+
letter-spacing: -0.36px;
|
|
1310
1322
|
}
|
|
1311
1323
|
.prompt-content-wrapper {
|
|
1312
1324
|
display: flex;
|
|
@@ -1416,9 +1428,12 @@
|
|
|
1416
1428
|
}
|
|
1417
1429
|
|
|
1418
1430
|
/* src/styles/extensions/commands-list.css */
|
|
1431
|
+
.react-renderer:has(.commands-list-container) {
|
|
1432
|
+
z-index: 10000;
|
|
1433
|
+
}
|
|
1419
1434
|
.commands-list-container {
|
|
1420
1435
|
display: flex;
|
|
1421
|
-
|
|
1436
|
+
position: relative;
|
|
1422
1437
|
flex-direction: column;
|
|
1423
1438
|
width: 280px;
|
|
1424
1439
|
max-height: 300px;
|
|
@@ -1500,6 +1515,7 @@
|
|
|
1500
1515
|
--tiptap-color-link: #0059df;
|
|
1501
1516
|
--tiptap-color-primary-error: #f04438;
|
|
1502
1517
|
--tiptap-color-border: #f2f4f7;
|
|
1518
|
+
--tiptap-color-bg-disabled: #f7f7f8;
|
|
1503
1519
|
--tiptap-color-divider: #aaabb7;
|
|
1504
1520
|
--tiptap-color-text-disabled: #aaabb7;
|
|
1505
1521
|
--tiptap-color-text-placeholder: #aaabb7;
|
|
@@ -1546,19 +1562,21 @@
|
|
|
1546
1562
|
.tiptap-content-wrapper {
|
|
1547
1563
|
position: relative;
|
|
1548
1564
|
margin: 0 !important;
|
|
1549
|
-
}
|
|
1550
|
-
.tiptap {
|
|
1551
1565
|
padding: var(--tiptap-spacing);
|
|
1552
1566
|
border: 1px solid var(--tiptap-color-border);
|
|
1553
1567
|
border-radius: var(--tiptap-radius);
|
|
1554
1568
|
font-size: var(--tiptap-font-size);
|
|
1555
1569
|
font-family: var(--tiptap-font-family);
|
|
1556
1570
|
}
|
|
1557
|
-
.tiptap:focus {
|
|
1571
|
+
.tiptap-content-wrapper:focus {
|
|
1558
1572
|
border-color: var(--tiptap-color-primary-light);
|
|
1559
1573
|
outline: none;
|
|
1560
1574
|
}
|
|
1561
|
-
.tiptap-content-wrapper
|
|
1575
|
+
.tiptap-content-wrapper .ProseMirror {
|
|
1576
|
+
border: none;
|
|
1577
|
+
outline: none;
|
|
1578
|
+
}
|
|
1579
|
+
.tiptap-content-wrapper.has-error {
|
|
1562
1580
|
border-color: var(--tiptap-color-primary-error);
|
|
1563
1581
|
}
|
|
1564
1582
|
.tiptap-error-message {
|
|
@@ -1583,10 +1601,10 @@
|
|
|
1583
1601
|
font-weight: 400;
|
|
1584
1602
|
font-size: var(--tiptap-font-size);
|
|
1585
1603
|
line-height: 140%;
|
|
1586
|
-
letter-spacing:
|
|
1604
|
+
letter-spacing: normal;
|
|
1587
1605
|
}
|
|
1588
1606
|
.tiptap > * {
|
|
1589
|
-
letter-spacing:
|
|
1607
|
+
letter-spacing: normal;
|
|
1590
1608
|
}
|
|
1591
1609
|
.tiptap p:not(:last-child),
|
|
1592
1610
|
.tiptap ul:not(:last-child),
|
|
@@ -1594,6 +1612,12 @@
|
|
|
1594
1612
|
.tiptap blockquote:not(:last-child) {
|
|
1595
1613
|
margin-bottom: var(--tiptap-spacing);
|
|
1596
1614
|
}
|
|
1615
|
+
.tiptap h1 {
|
|
1616
|
+
font-weight: 600;
|
|
1617
|
+
font-size: 40px;
|
|
1618
|
+
line-height: 110%;
|
|
1619
|
+
letter-spacing: 0;
|
|
1620
|
+
}
|
|
1597
1621
|
.tiptap h2 {
|
|
1598
1622
|
font-weight: 600;
|
|
1599
1623
|
font-size: 36px;
|
|
@@ -1645,6 +1669,7 @@
|
|
|
1645
1669
|
.tiptap ul,
|
|
1646
1670
|
.tiptap ol {
|
|
1647
1671
|
padding-left: 32px;
|
|
1672
|
+
font-size: var(--tiptap-font-size);
|
|
1648
1673
|
}
|
|
1649
1674
|
.tiptap ul:not(:last-child),
|
|
1650
1675
|
.tiptap ol:not(:last-child),
|
|
@@ -1890,12 +1915,13 @@
|
|
|
1890
1915
|
background-color: transparent;
|
|
1891
1916
|
}
|
|
1892
1917
|
.tiptap-content-wrapper.is-disabled {
|
|
1893
|
-
|
|
1918
|
+
padding: var(--tiptap-spacing);
|
|
1894
1919
|
cursor: not-allowed;
|
|
1920
|
+
opacity: 0.6;
|
|
1895
1921
|
pointer-events: none;
|
|
1896
1922
|
}
|
|
1897
|
-
.tiptap-content-wrapper.is-disabled
|
|
1898
|
-
background-color: var(--tiptap-color-
|
|
1923
|
+
.tiptap-content-wrapper.is-disabled {
|
|
1924
|
+
background-color: var(--tiptap-color-bg-disabled);
|
|
1899
1925
|
}
|
|
1900
1926
|
|
|
1901
1927
|
/* src/styles/editor/callout-menu.css */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyberyozh/text-editor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Rich text editor library based on Tiptap for CyberYozh",
|
|
5
5
|
"author": "CyberYozh",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,6 +42,10 @@
|
|
|
42
42
|
"release": "npm run build && changeset publish",
|
|
43
43
|
"release:complete": "git add . && git commit -m \"chore: release v$(node -p \"require('./package.json').version\")\" && npm run release && git push --follow-tags"
|
|
44
44
|
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
47
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
48
|
+
},
|
|
45
49
|
"dependencies": {
|
|
46
50
|
"@floating-ui/dom": "^1.7.4",
|
|
47
51
|
"@tiptap/core": "^3.10.6",
|
|
@@ -84,8 +88,6 @@
|
|
|
84
88
|
"devDependencies": {
|
|
85
89
|
"@changesets/cli": "^2.29.7",
|
|
86
90
|
"@types/node": "^20",
|
|
87
|
-
"@types/react": "^19",
|
|
88
|
-
"@types/react-dom": "^19",
|
|
89
91
|
"eslint": "^8",
|
|
90
92
|
"tsup": "^8.0.0",
|
|
91
93
|
"typescript": "^5"
|
|
@@ -68,7 +68,6 @@ export const BubbleMenuContent = ({ editor, onLinkClick }: Props) => {
|
|
|
68
68
|
} = useEditorState({
|
|
69
69
|
editor,
|
|
70
70
|
selector: (ctx) => {
|
|
71
|
-
if (!editor) return {};
|
|
72
71
|
return {
|
|
73
72
|
canUndo: ctx.editor.can().undo(),
|
|
74
73
|
canRedo: ctx.editor.can().redo(),
|
|
@@ -113,7 +112,12 @@ export const BubbleMenuContent = ({ editor, onLinkClick }: Props) => {
|
|
|
113
112
|
};
|
|
114
113
|
|
|
115
114
|
return (
|
|
116
|
-
<div
|
|
115
|
+
<div
|
|
116
|
+
className={`bubble-menu ${textColor || highlightColor ? "hide-text-selection" : ""}`}
|
|
117
|
+
onMouseDown={(e) => {
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
117
121
|
<div className="tiptap-controls-group">
|
|
118
122
|
<button
|
|
119
123
|
className="tiptap-control-button"
|
|
@@ -78,7 +78,10 @@ export const CommandsList = forwardRef<
|
|
|
78
78
|
if (item) {
|
|
79
79
|
if (item.dialogCommand) {
|
|
80
80
|
openDialogCommand(item.dialogCommand);
|
|
81
|
+
// Also call command to ensure menu closes
|
|
82
|
+
command(item);
|
|
81
83
|
} else {
|
|
84
|
+
console.log("open video");
|
|
82
85
|
command(item);
|
|
83
86
|
}
|
|
84
87
|
}
|
|
@@ -98,6 +101,10 @@ export const CommandsList = forwardRef<
|
|
|
98
101
|
<div
|
|
99
102
|
ref={listRef}
|
|
100
103
|
className="commands-list-container"
|
|
104
|
+
onMouseDown={(e) => {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
e.stopPropagation();
|
|
107
|
+
}}
|
|
101
108
|
>
|
|
102
109
|
{items.map((item, index) => (
|
|
103
110
|
<button
|
|
@@ -19,11 +19,7 @@ const SUPPORTED_PLATFORMS = {
|
|
|
19
19
|
[VideoHosting.VK]: "VK",
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
export const AddVideoDialog = ({
|
|
23
|
-
open,
|
|
24
|
-
onClose,
|
|
25
|
-
onVideoAdd,
|
|
26
|
-
}: AddVideoDialogProps) => {
|
|
22
|
+
export const AddVideoDialog = ({ open, onClose, onVideoAdd }: AddVideoDialogProps) => {
|
|
27
23
|
const translations = useTiptapTranslations();
|
|
28
24
|
const [url, setUrl] = useState("");
|
|
29
25
|
const [error, setError] = useState<string>("");
|
|
@@ -112,6 +108,7 @@ export const AddVideoDialog = ({
|
|
|
112
108
|
<input
|
|
113
109
|
ref={urlInputRef}
|
|
114
110
|
id="video-url"
|
|
111
|
+
autoComplete="off"
|
|
115
112
|
type="text"
|
|
116
113
|
className="video-dialog-input"
|
|
117
114
|
placeholder={translations.videoUpload.urlPlaceholder}
|
|
@@ -45,7 +45,6 @@ export const ImageDialog = ({
|
|
|
45
45
|
const [dragActive, setDragActive] = useState(false);
|
|
46
46
|
const inputRef = useRef<HTMLInputElement | null>(null);
|
|
47
47
|
|
|
48
|
-
// Resolve the image URL from fileId or use src directly
|
|
49
48
|
const resolvedInitialUrl = initialAttrs
|
|
50
49
|
? resolveImageSrc({ fileId: initialAttrs.fileId, src: initialAttrs.src }, { getImageById })
|
|
51
50
|
: "";
|
package/src/editor/editor.tsx
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import { ImageDialog, AddKatexDialog, AddLinkDialog, AddVideoDialog } from "./dialogs";
|
|
25
25
|
import { getEditorExtensions } from "../extensions/editor";
|
|
26
26
|
|
|
27
|
-
import type { FigureAttrs, ImageHandlers } from "../types/image-handler";
|
|
27
|
+
import type { FigureAttrs, ImageHandlers, TiptapImageAttrs } from "../types/image-handler";
|
|
28
28
|
import {
|
|
29
29
|
createHandleImageAdd,
|
|
30
30
|
createHandleImageEdit,
|
|
@@ -87,6 +87,7 @@ function TiptapContent({
|
|
|
87
87
|
attrs: FigureAttrs;
|
|
88
88
|
pos?: number;
|
|
89
89
|
} | null>(null);
|
|
90
|
+
const [savedDialogCursorPos, setSavedDialogCursorPos] = useState<number | undefined>(undefined);
|
|
90
91
|
const { activeDialog, closeDialogCommand, openDialogCommand } = useDialogCommand();
|
|
91
92
|
const translations = useTiptapTranslations();
|
|
92
93
|
|
|
@@ -141,19 +142,38 @@ function TiptapContent({
|
|
|
141
142
|
[lang]
|
|
142
143
|
);
|
|
143
144
|
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
if (activeDialog && editor && !editor.isDestroyed) {
|
|
147
|
+
const pos = editor.state.selection.from;
|
|
148
|
+
setSavedDialogCursorPos(pos);
|
|
149
|
+
}
|
|
150
|
+
}, [activeDialog, editor]);
|
|
151
|
+
|
|
144
152
|
const handleCloseDialog = () => {
|
|
145
153
|
setLinkDialogContext(null);
|
|
146
154
|
setKatexDialogContext(null);
|
|
147
155
|
setEditFigureContext(null);
|
|
156
|
+
setSavedDialogCursorPos(undefined);
|
|
148
157
|
closeDialogCommand();
|
|
149
158
|
};
|
|
150
159
|
|
|
151
|
-
|
|
160
|
+
// Create handlers with current savedDialogCursorPos by accessing state directly
|
|
161
|
+
const handleImageAdd = (attrs: TiptapImageAttrs) => {
|
|
162
|
+
createHandleImageAdd(editor, handleCloseDialog, savedDialogCursorPos)(attrs);
|
|
163
|
+
};
|
|
164
|
+
|
|
152
165
|
const handleImageEdit = createHandleImageEdit(editor, handleCloseDialog, editFigureContext?.pos);
|
|
153
|
-
|
|
154
|
-
const
|
|
166
|
+
|
|
167
|
+
const handleVideoAdd = (url: string) => {
|
|
168
|
+
createHandleVideoAdd(editor, handleCloseDialog, savedDialogCursorPos)(url);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const handleLinkAdd = (title: string, url: string) => {
|
|
172
|
+
createHandleLinkAdd(editor, handleCloseDialog, savedDialogCursorPos)(title, url);
|
|
173
|
+
};
|
|
174
|
+
|
|
155
175
|
const handleKatexAdd = (latex: string) => {
|
|
156
|
-
const katexHandler = createHandleKatexAdd(editor, handleCloseDialog);
|
|
176
|
+
const katexHandler = createHandleKatexAdd(editor, handleCloseDialog, savedDialogCursorPos);
|
|
157
177
|
katexHandler(latex, katexDialogContext?.pos);
|
|
158
178
|
};
|
|
159
179
|
|
|
@@ -165,8 +185,6 @@ function TiptapContent({
|
|
|
165
185
|
});
|
|
166
186
|
}, [content, editor]);
|
|
167
187
|
|
|
168
|
-
if (!editor) return null;
|
|
169
|
-
|
|
170
188
|
const shouldBubbleMenuShow = ({ state }: { state: EditorState }) => {
|
|
171
189
|
if (state.selection instanceof NodeSelection) {
|
|
172
190
|
return false;
|
|
@@ -183,11 +201,13 @@ function TiptapContent({
|
|
|
183
201
|
return true;
|
|
184
202
|
};
|
|
185
203
|
|
|
204
|
+
if (!editor) return null;
|
|
205
|
+
|
|
186
206
|
return (
|
|
187
207
|
<>
|
|
188
|
-
{
|
|
208
|
+
{<DragHandle editor={editor} />}
|
|
189
209
|
{isEditable && !isDisabled && <TableMenu editor={editor} />}
|
|
190
|
-
{!isDisabled && (
|
|
210
|
+
{isEditable && !isDisabled && (
|
|
191
211
|
<BubbleMenu
|
|
192
212
|
shouldShow={shouldBubbleMenuShow}
|
|
193
213
|
editor={editor}
|
|
@@ -210,44 +230,48 @@ function TiptapContent({
|
|
|
210
230
|
</div>
|
|
211
231
|
{!!error && <p className="tiptap-error-message">{error}</p>}
|
|
212
232
|
|
|
213
|
-
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
233
|
+
{isEditable && (
|
|
234
|
+
<>
|
|
235
|
+
{activeDialog === "image" && (
|
|
236
|
+
<ImageDialog
|
|
237
|
+
open={true}
|
|
238
|
+
onClose={handleCloseDialog}
|
|
239
|
+
onImageAdd={handleImageAdd}
|
|
240
|
+
onImageEdit={handleImageEdit}
|
|
241
|
+
uploadHandler={imageHandlers?.upload}
|
|
242
|
+
getImageById={imageHandlers?.getImage}
|
|
243
|
+
initialAttrs={editFigureContext?.attrs || undefined}
|
|
244
|
+
mode={editFigureContext ? "edit" : "add"}
|
|
245
|
+
/>
|
|
246
|
+
)}
|
|
225
247
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
248
|
+
{activeDialog === "link" && (
|
|
249
|
+
<AddLinkDialog
|
|
250
|
+
open={true}
|
|
251
|
+
onClose={handleCloseDialog}
|
|
252
|
+
onLinkAdd={handleLinkAdd}
|
|
253
|
+
initialTitle={linkDialogContext?.selectedText || ""}
|
|
254
|
+
initialUrl={linkDialogContext?.url || ""}
|
|
255
|
+
/>
|
|
256
|
+
)}
|
|
235
257
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
258
|
+
{activeDialog === "video" && (
|
|
259
|
+
<AddVideoDialog
|
|
260
|
+
open={true}
|
|
261
|
+
onClose={handleCloseDialog}
|
|
262
|
+
onVideoAdd={handleVideoAdd}
|
|
263
|
+
/>
|
|
264
|
+
)}
|
|
243
265
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
266
|
+
{activeDialog === "katex" && (
|
|
267
|
+
<AddKatexDialog
|
|
268
|
+
open={true}
|
|
269
|
+
onClose={handleCloseDialog}
|
|
270
|
+
onKatexAdd={handleKatexAdd}
|
|
271
|
+
initialContent={katexDialogContext?.latex || ""}
|
|
272
|
+
/>
|
|
273
|
+
)}
|
|
274
|
+
</>
|
|
251
275
|
)}
|
|
252
276
|
</>
|
|
253
277
|
);
|