@zero-library/common 2.2.2 → 2.2.4
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/index.cjs.js +270 -98
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +14 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +82 -37
- package/dist/index.d.ts +82 -37
- package/dist/index.esm.js +254 -85
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { FileUnknownOutlined, FileZipOutlined, FileMarkdownOutlined, FileGifOutlined, FileImageOutlined, FileJpgOutlined, NotificationOutlined, VideoCameraOutlined, FilePptOutlined, FileExcelOutlined, FileWordOutlined, FilePdfOutlined, FileTextOutlined } from '@ant-design/icons';
|
|
2
|
+
import Icon, { MinusCircleOutlined, PlusCircleOutlined, RedoOutlined, FileUnknownOutlined, FileZipOutlined, FileMarkdownOutlined, FileGifOutlined, FileImageOutlined, FileJpgOutlined, NotificationOutlined, VideoCameraOutlined, FilePptOutlined, FileExcelOutlined, FileWordOutlined, FilePdfOutlined, FileTextOutlined, AudioMutedOutlined, AudioOutlined } from '@ant-design/icons';
|
|
3
|
+
import { Spin, Flex, Button, Result, message, notification, Modal, Splitter, Empty, Image, Drawer, Tag, Avatar, Alert, Form, Input } from 'antd';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { renderAsync } from 'docx-preview';
|
|
3
6
|
import * as React16 from 'react';
|
|
4
|
-
import { forwardRef, useState, useMemo, useEffect, lazy, Suspense,
|
|
5
|
-
import { Spin, Result, message, notification, Modal, Splitter, Empty, Image, Flex, Drawer, Tag, Avatar, Alert, Form, Input, Button } from 'antd';
|
|
7
|
+
import { forwardRef, useState, useMemo, useEffect, useRef, lazy, Suspense, createContext, useCallback, useContext } from 'react';
|
|
6
8
|
import parse from 'html-react-parser';
|
|
7
9
|
import { jsonrepair } from 'jsonrepair';
|
|
8
10
|
import markdownit from 'markdown-it';
|
|
@@ -21,7 +23,6 @@ import relativeTime from 'dayjs/plugin/relativeTime';
|
|
|
21
23
|
import axios from 'axios';
|
|
22
24
|
import '@react-pdf-viewer/thumbnail/lib/styles/index.css';
|
|
23
25
|
import '@react-pdf-viewer/zoom/lib/styles/index.css';
|
|
24
|
-
import classNames2 from 'classnames';
|
|
25
26
|
import { getMarkRange, Extension, isNodeSelection, useCurrentEditor, useEditor, EditorContext, BubbleMenu, EditorContent } from '@tiptap/react';
|
|
26
27
|
import { Markdown } from 'tiptap-markdown';
|
|
27
28
|
import { Highlight } from '@tiptap/extension-highlight';
|
|
@@ -50,7 +51,10 @@ var styles_module_default = {
|
|
|
50
51
|
nsPreviewPdf: "styles_module_nsPreviewPdf",
|
|
51
52
|
pdfToolbar: "styles_module_pdfToolbar",
|
|
52
53
|
nsPreviewVideo: "styles_module_nsPreviewVideo",
|
|
53
|
-
nsPreviewAudio: "styles_module_nsPreviewAudio"
|
|
54
|
+
nsPreviewAudio: "styles_module_nsPreviewAudio",
|
|
55
|
+
nsPreviewDocx: "styles_module_nsPreviewDocx",
|
|
56
|
+
docxToolbar: "styles_module_docxToolbar",
|
|
57
|
+
docxContent: "styles_module_docxContent"
|
|
54
58
|
};
|
|
55
59
|
var AudioPlayer_default = ({ fileUrl }) => {
|
|
56
60
|
return /* @__PURE__ */ jsxs("audio", { controls: true, className: styles_module_default.nsPreviewAudio, children: [
|
|
@@ -58,9 +62,51 @@ var AudioPlayer_default = ({ fileUrl }) => {
|
|
|
58
62
|
"\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 audio \u6807\u7B7E\u3002"
|
|
59
63
|
] });
|
|
60
64
|
};
|
|
65
|
+
var DocxPreview_default = ({ fileUrl, scale = 1 }) => {
|
|
66
|
+
const containerRef = useRef(null);
|
|
67
|
+
const [zoomRatio, setZoomRatio] = useState(scale);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (!fileUrl || !containerRef.current) return;
|
|
70
|
+
containerRef.current.innerHTML = "";
|
|
71
|
+
fetch(fileUrl).then((res) => res.arrayBuffer()).then(
|
|
72
|
+
(arrayBuffer) => renderAsync(arrayBuffer, containerRef.current, null, {
|
|
73
|
+
breakPages: true,
|
|
74
|
+
renderHeaders: true,
|
|
75
|
+
renderFooters: true,
|
|
76
|
+
ignoreWidth: false,
|
|
77
|
+
ignoreHeight: false
|
|
78
|
+
})
|
|
79
|
+
).catch((err) => {
|
|
80
|
+
console.error("docx-preview \u6E32\u67D3\u5931\u8D25:", err);
|
|
81
|
+
if (containerRef.current) containerRef.current.innerHTML = '<p class="text-center">\u6587\u6863\u52A0\u8F7D\u5931\u8D25</p>';
|
|
82
|
+
});
|
|
83
|
+
}, [fileUrl]);
|
|
84
|
+
const zoomIn = () => setZoomRatio((z) => Math.min(z + 0.1, 3));
|
|
85
|
+
const zoomOut = () => setZoomRatio((z) => Math.max(z - 0.1, 0.3));
|
|
86
|
+
const resetZoom = () => {
|
|
87
|
+
setZoomRatio(1);
|
|
88
|
+
};
|
|
89
|
+
return /* @__PURE__ */ jsxs("div", { className: classNames(styles_module_default.nsPreviewDocx, "height-full"), children: [
|
|
90
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 6, align: "center", className: styles_module_default.docxToolbar, children: [
|
|
91
|
+
/* @__PURE__ */ jsx(Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsx(MinusCircleOutlined, {}), title: "\u7F29\u5C0F" }),
|
|
92
|
+
/* @__PURE__ */ jsx(Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsx(PlusCircleOutlined, {}), title: "\u653E\u5927" }),
|
|
93
|
+
/* @__PURE__ */ jsx(Button, { onClick: resetZoom, icon: /* @__PURE__ */ jsx(RedoOutlined, {}), title: "\u8FD8\u539F" })
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ jsx("div", { className: classNames(styles_module_default.docxContent, "height-full", "scroll-fade-in"), children: /* @__PURE__ */ jsx(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
ref: containerRef,
|
|
99
|
+
style: {
|
|
100
|
+
transform: `scale(${zoomRatio})`,
|
|
101
|
+
transformOrigin: "top center"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
) })
|
|
105
|
+
] });
|
|
106
|
+
};
|
|
61
107
|
var FileIcon_default = ({ suffix, fontSize = 22 }) => {
|
|
62
108
|
const styles = { fontSize, color: "var(--ant-color-primary)" };
|
|
63
|
-
const
|
|
109
|
+
const Icon2 = useMemo(() => {
|
|
64
110
|
switch (suffix?.toUpperCase()) {
|
|
65
111
|
case "TXT":
|
|
66
112
|
return /* @__PURE__ */ jsx(FileTextOutlined, {});
|
|
@@ -76,10 +122,15 @@ var FileIcon_default = ({ suffix, fontSize = 22 }) => {
|
|
|
76
122
|
return /* @__PURE__ */ jsx(FilePptOutlined, {});
|
|
77
123
|
case "MP4":
|
|
78
124
|
case "MOV":
|
|
125
|
+
case "MKV":
|
|
79
126
|
case "AVI":
|
|
80
127
|
case "FLV":
|
|
81
128
|
return /* @__PURE__ */ jsx(VideoCameraOutlined, {});
|
|
82
129
|
case "MP3":
|
|
130
|
+
case "WAV":
|
|
131
|
+
case "M4A":
|
|
132
|
+
case "ACC":
|
|
133
|
+
case "WMA":
|
|
83
134
|
return /* @__PURE__ */ jsx(NotificationOutlined, {});
|
|
84
135
|
case "JPG":
|
|
85
136
|
case "JPEG":
|
|
@@ -102,7 +153,7 @@ var FileIcon_default = ({ suffix, fontSize = 22 }) => {
|
|
|
102
153
|
return /* @__PURE__ */ jsx(FileUnknownOutlined, {});
|
|
103
154
|
}
|
|
104
155
|
}, [suffix]);
|
|
105
|
-
return /* @__PURE__ */ jsx("span", { style: styles, children:
|
|
156
|
+
return /* @__PURE__ */ jsx("span", { style: styles, children: Icon2 });
|
|
106
157
|
};
|
|
107
158
|
var VideoPlayer_default = ({ fileUrl }) => {
|
|
108
159
|
return /* @__PURE__ */ jsxs("video", { controls: true, className: styles_module_default.nsPreviewVideo, children: [
|
|
@@ -1116,17 +1167,6 @@ function aesDecrypt(data, key) {
|
|
|
1116
1167
|
return null;
|
|
1117
1168
|
}
|
|
1118
1169
|
}
|
|
1119
|
-
var formatKB = (kbNum) => {
|
|
1120
|
-
if (!isNumber(kbNum)) return kbNum;
|
|
1121
|
-
const units = ["KB", "MB", "GB", "TB"];
|
|
1122
|
-
let size = kbNum;
|
|
1123
|
-
let index = 0;
|
|
1124
|
-
while (size >= 1024 && index < units.length - 1) {
|
|
1125
|
-
size /= 1024;
|
|
1126
|
-
index++;
|
|
1127
|
-
}
|
|
1128
|
-
return `${size.toFixed(2)} ${units[index]}`;
|
|
1129
|
-
};
|
|
1130
1170
|
function formatSize(value, options = {}) {
|
|
1131
1171
|
if (isNullOrUnDef(value) || !isNumberNoNaN(Number(value))) return value;
|
|
1132
1172
|
const UNIT_LIST = ["B", "KB", "MB", "GB", "TB", "PB"];
|
|
@@ -1170,6 +1210,90 @@ var useRefState_default = (init) => {
|
|
|
1170
1210
|
const getState = () => stateRef.current;
|
|
1171
1211
|
return [state, setProxy, getState];
|
|
1172
1212
|
};
|
|
1213
|
+
var useSpeech_default = ({ onResult, lang = "zh-CN" }) => {
|
|
1214
|
+
const [permission, setPermission] = useState("prompt");
|
|
1215
|
+
const [isRecording, setIsRecording] = useState(false);
|
|
1216
|
+
const recognitionRef = useRef(null);
|
|
1217
|
+
useEffect(() => {
|
|
1218
|
+
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
1219
|
+
if (!SpeechRecognition) {
|
|
1220
|
+
setPermission("unsupported");
|
|
1221
|
+
return;
|
|
1222
|
+
}
|
|
1223
|
+
const recognition = new SpeechRecognition();
|
|
1224
|
+
recognition.continuous = true;
|
|
1225
|
+
recognition.interimResults = false;
|
|
1226
|
+
recognition.lang = lang;
|
|
1227
|
+
recognition.onresult = (event) => {
|
|
1228
|
+
let transcript = "";
|
|
1229
|
+
for (let i = event.resultIndex; i < event.results.length; i++) {
|
|
1230
|
+
transcript += event.results[i][0].transcript;
|
|
1231
|
+
}
|
|
1232
|
+
onResult?.(transcript.trim());
|
|
1233
|
+
};
|
|
1234
|
+
recognition.onend = () => {
|
|
1235
|
+
setIsRecording(false);
|
|
1236
|
+
};
|
|
1237
|
+
recognition.onerror = (error) => {
|
|
1238
|
+
setIsRecording(false);
|
|
1239
|
+
console.error("Speech recognition error:", error);
|
|
1240
|
+
};
|
|
1241
|
+
recognitionRef.current = recognition;
|
|
1242
|
+
return () => {
|
|
1243
|
+
recognition.stop?.();
|
|
1244
|
+
recognition.onresult = null;
|
|
1245
|
+
recognition.onend = null;
|
|
1246
|
+
recognition.onerror = null;
|
|
1247
|
+
};
|
|
1248
|
+
}, [lang, onResult]);
|
|
1249
|
+
useEffect(() => {
|
|
1250
|
+
if (!navigator.permissions) return;
|
|
1251
|
+
navigator.permissions.query({ name: "microphone" }).then((status) => {
|
|
1252
|
+
setPermission(status.state);
|
|
1253
|
+
status.onchange = () => setPermission(status.state);
|
|
1254
|
+
});
|
|
1255
|
+
}, []);
|
|
1256
|
+
const requestPermission = useCallback(async () => {
|
|
1257
|
+
try {
|
|
1258
|
+
await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
1259
|
+
setPermission("granted");
|
|
1260
|
+
} catch {
|
|
1261
|
+
setPermission("denied");
|
|
1262
|
+
}
|
|
1263
|
+
}, []);
|
|
1264
|
+
const start = useCallback(() => {
|
|
1265
|
+
if (permission === "prompt") {
|
|
1266
|
+
requestPermission();
|
|
1267
|
+
return;
|
|
1268
|
+
}
|
|
1269
|
+
if (permission !== "granted") return;
|
|
1270
|
+
if (!isRecording) {
|
|
1271
|
+
recognitionRef.current?.start();
|
|
1272
|
+
setIsRecording(true);
|
|
1273
|
+
}
|
|
1274
|
+
}, [permission, isRecording, requestPermission]);
|
|
1275
|
+
const stop = useCallback(() => {
|
|
1276
|
+
try {
|
|
1277
|
+
recognitionRef.current?.stop();
|
|
1278
|
+
} finally {
|
|
1279
|
+
setIsRecording(false);
|
|
1280
|
+
}
|
|
1281
|
+
}, []);
|
|
1282
|
+
return {
|
|
1283
|
+
/**
|
|
1284
|
+
* 权限状态
|
|
1285
|
+
*/
|
|
1286
|
+
permission,
|
|
1287
|
+
/**
|
|
1288
|
+
* 录音状态
|
|
1289
|
+
*/
|
|
1290
|
+
isRecording,
|
|
1291
|
+
/** 开始语音识别 */
|
|
1292
|
+
start,
|
|
1293
|
+
/** 停止语音识别 */
|
|
1294
|
+
stop
|
|
1295
|
+
};
|
|
1296
|
+
};
|
|
1173
1297
|
var useSyncInput_default = (storeValue, setStoreValue) => {
|
|
1174
1298
|
const [inputValue, setInputValue] = useState(storeValue);
|
|
1175
1299
|
useEffect(() => {
|
|
@@ -1904,27 +2028,22 @@ var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue }
|
|
|
1904
2028
|
case "MP4":
|
|
1905
2029
|
return /* @__PURE__ */ jsx(VideoPlayer_default, { fileUrl });
|
|
1906
2030
|
case "MP3":
|
|
2031
|
+
case "WAV":
|
|
2032
|
+
case "M4A":
|
|
2033
|
+
case "ACC":
|
|
1907
2034
|
return /* @__PURE__ */ jsx(AudioPlayer_default, { fileUrl });
|
|
1908
2035
|
case "MD":
|
|
1909
2036
|
case "MARKDOWN":
|
|
1910
2037
|
return /* @__PURE__ */ jsx(MarkdownPreview_default, { fileUrl, searchValue });
|
|
2038
|
+
case "DOCX":
|
|
2039
|
+
return /* @__PURE__ */ jsx(DocxPreview_default, { fileUrl });
|
|
1911
2040
|
default:
|
|
1912
2041
|
return /* @__PURE__ */ jsx(Result, { subTitle: `\u6682\u4E0D\u652F\u6301 ${suffix || ""} \u6587\u4EF6\u7684\u9884\u89C8` });
|
|
1913
2042
|
}
|
|
1914
2043
|
}, [suffix, fileUrl, pdfParams]);
|
|
1915
2044
|
return /* @__PURE__ */ jsx(Flex, { justify: "center", align: "center", className: "height-full", children: Preview });
|
|
1916
2045
|
};
|
|
1917
|
-
var FilePreviewDrawer_default = ({
|
|
1918
|
-
open,
|
|
1919
|
-
fileUrl,
|
|
1920
|
-
suffix,
|
|
1921
|
-
title = "\u6587\u4EF6\u9884\u89C8",
|
|
1922
|
-
onClose,
|
|
1923
|
-
password,
|
|
1924
|
-
fileParams,
|
|
1925
|
-
pdfParams,
|
|
1926
|
-
onSetPassSuccess
|
|
1927
|
-
}) => {
|
|
2046
|
+
var FilePreviewDrawer_default = ({ open, title = "\u6587\u4EF6\u9884\u89C8", onClose, ...props }) => {
|
|
1928
2047
|
return /* @__PURE__ */ jsx(
|
|
1929
2048
|
Drawer,
|
|
1930
2049
|
{
|
|
@@ -1933,17 +2052,7 @@ var FilePreviewDrawer_default = ({
|
|
|
1933
2052
|
width: "100%",
|
|
1934
2053
|
open,
|
|
1935
2054
|
onClose,
|
|
1936
|
-
children: /* @__PURE__ */ jsx(
|
|
1937
|
-
FilePreview_default,
|
|
1938
|
-
{
|
|
1939
|
-
fileUrl,
|
|
1940
|
-
suffix,
|
|
1941
|
-
password,
|
|
1942
|
-
fileParams,
|
|
1943
|
-
pdfParams,
|
|
1944
|
-
onSetPassSuccess
|
|
1945
|
-
}
|
|
1946
|
-
)
|
|
2055
|
+
children: /* @__PURE__ */ jsx(FilePreview_default, { ...props })
|
|
1947
2056
|
}
|
|
1948
2057
|
);
|
|
1949
2058
|
};
|
|
@@ -1970,7 +2079,7 @@ var Iframe_default = forwardRef(({ defaultMainSource, id, src, className, onLoad
|
|
|
1970
2079
|
id,
|
|
1971
2080
|
ref,
|
|
1972
2081
|
src: finalSrc,
|
|
1973
|
-
className:
|
|
2082
|
+
className: classNames(styles_module_default2.iframe, className),
|
|
1974
2083
|
onLoad: onHandleLoad,
|
|
1975
2084
|
allow: "clipboard-write"
|
|
1976
2085
|
}
|
|
@@ -2244,7 +2353,7 @@ var ShortcutDisplay = ({ shortcuts }) => {
|
|
|
2244
2353
|
/* @__PURE__ */ jsx("kbd", { children: key })
|
|
2245
2354
|
] }, index)) });
|
|
2246
2355
|
};
|
|
2247
|
-
var
|
|
2356
|
+
var Button3 = React16.forwardRef(
|
|
2248
2357
|
({ className = "", children, tooltip, showTooltip = true, shortcutKeys, "aria-label": ariaLabel, ...props }, ref) => {
|
|
2249
2358
|
const isMac = React16.useMemo(() => typeof navigator !== "undefined" && navigator.platform.toLowerCase().includes("mac"), []);
|
|
2250
2359
|
const shortcuts = React16.useMemo(() => parseShortcutKeys(shortcutKeys, isMac), [shortcutKeys, isMac]);
|
|
@@ -2260,7 +2369,7 @@ var Button2 = React16.forwardRef(
|
|
|
2260
2369
|
] });
|
|
2261
2370
|
}
|
|
2262
2371
|
);
|
|
2263
|
-
|
|
2372
|
+
Button3.displayName = "Button";
|
|
2264
2373
|
var Spacer = React16.forwardRef(
|
|
2265
2374
|
({ orientation = "horizontal", size, className = "", style = {}, ...props }, ref) => {
|
|
2266
2375
|
const computedStyle = {
|
|
@@ -2718,14 +2827,14 @@ function useHeadingState(editor, level, disabled = false) {
|
|
|
2718
2827
|
const headingInSchema = isNodeInSchema("heading", editor);
|
|
2719
2828
|
const isDisabled = isHeadingButtonDisabled(editor, level, disabled);
|
|
2720
2829
|
const isActive = isHeadingActive(editor, level);
|
|
2721
|
-
const
|
|
2830
|
+
const Icon2 = headingIcons[level];
|
|
2722
2831
|
const shortcutKey = headingShortcutKeys[level];
|
|
2723
2832
|
const formattedName = getFormattedHeadingName(level);
|
|
2724
2833
|
return {
|
|
2725
2834
|
headingInSchema,
|
|
2726
2835
|
isDisabled,
|
|
2727
2836
|
isActive,
|
|
2728
|
-
Icon,
|
|
2837
|
+
Icon: Icon2,
|
|
2729
2838
|
shortcutKey,
|
|
2730
2839
|
formattedName
|
|
2731
2840
|
};
|
|
@@ -2733,7 +2842,7 @@ function useHeadingState(editor, level, disabled = false) {
|
|
|
2733
2842
|
var HeadingButton = React16.forwardRef(
|
|
2734
2843
|
({ editor: providedEditor, level, text, hideWhenUnavailable = false, className = "", disabled, onClick, children, ...buttonProps }, ref) => {
|
|
2735
2844
|
const editor = useTiptapEditor(providedEditor);
|
|
2736
|
-
const { headingInSchema, isDisabled, isActive, Icon, shortcutKey, formattedName } = useHeadingState(editor, level, disabled);
|
|
2845
|
+
const { headingInSchema, isDisabled, isActive, Icon: Icon2, shortcutKey, formattedName } = useHeadingState(editor, level, disabled);
|
|
2737
2846
|
const handleClick = React16.useCallback(
|
|
2738
2847
|
(e) => {
|
|
2739
2848
|
onClick?.(e);
|
|
@@ -2754,7 +2863,7 @@ var HeadingButton = React16.forwardRef(
|
|
|
2754
2863
|
return null;
|
|
2755
2864
|
}
|
|
2756
2865
|
return /* @__PURE__ */ jsx(
|
|
2757
|
-
|
|
2866
|
+
Button3,
|
|
2758
2867
|
{
|
|
2759
2868
|
type: "button",
|
|
2760
2869
|
className: className.trim(),
|
|
@@ -2772,7 +2881,7 @@ var HeadingButton = React16.forwardRef(
|
|
|
2772
2881
|
...buttonProps,
|
|
2773
2882
|
ref,
|
|
2774
2883
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2775
|
-
/* @__PURE__ */ jsx(
|
|
2884
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
2776
2885
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
2777
2886
|
] })
|
|
2778
2887
|
}
|
|
@@ -3033,7 +3142,7 @@ function HeadingDropdownMenu({
|
|
|
3033
3142
|
}
|
|
3034
3143
|
return /* @__PURE__ */ jsxs(DropdownMenu, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
3035
3144
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
3036
|
-
|
|
3145
|
+
Button3,
|
|
3037
3146
|
{
|
|
3038
3147
|
type: "button",
|
|
3039
3148
|
disabled: isDisabled,
|
|
@@ -3406,7 +3515,7 @@ var HighlightButton = React16.forwardRef(
|
|
|
3406
3515
|
return null;
|
|
3407
3516
|
}
|
|
3408
3517
|
return /* @__PURE__ */ jsx(
|
|
3409
|
-
|
|
3518
|
+
Button3,
|
|
3410
3519
|
{
|
|
3411
3520
|
type: "button",
|
|
3412
3521
|
className: className.trim(),
|
|
@@ -3459,7 +3568,7 @@ var DEFAULT_HIGHLIGHT_COLORS = [
|
|
|
3459
3568
|
}
|
|
3460
3569
|
];
|
|
3461
3570
|
var HighlighterButton = React16.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3462
|
-
|
|
3571
|
+
Button3,
|
|
3463
3572
|
{
|
|
3464
3573
|
type: "button",
|
|
3465
3574
|
className,
|
|
@@ -3512,7 +3621,7 @@ function HighlightContent({ editor: providedEditor, colors = DEFAULT_HIGHLIGHT_C
|
|
|
3512
3621
|
)) }),
|
|
3513
3622
|
/* @__PURE__ */ jsx(Separator, {}),
|
|
3514
3623
|
/* @__PURE__ */ jsx("div", { className: "tiptap-button-group", children: /* @__PURE__ */ jsx(
|
|
3515
|
-
|
|
3624
|
+
Button3,
|
|
3516
3625
|
{
|
|
3517
3626
|
onClick: removeHighlight,
|
|
3518
3627
|
"aria-label": "Remove highlight",
|
|
@@ -3690,7 +3799,7 @@ var useLinkHandler = (props) => {
|
|
|
3690
3799
|
};
|
|
3691
3800
|
};
|
|
3692
3801
|
var LinkButton = React16.forwardRef(({ className, children, ...props }, ref) => {
|
|
3693
|
-
return /* @__PURE__ */ jsx(
|
|
3802
|
+
return /* @__PURE__ */ jsx(Button3, { type: "button", className, "data-style": "ghost", role: "button", tabIndex: -1, "aria-label": "Link", tooltip: "\u94FE\u63A5", ref, ...props, children: children || /* @__PURE__ */ jsx(LinkIcon, { className: "tiptap-button-icon" }) });
|
|
3694
3803
|
});
|
|
3695
3804
|
var LinkContent = ({ editor: providedEditor }) => {
|
|
3696
3805
|
const editor = useTiptapEditor(providedEditor);
|
|
@@ -3721,11 +3830,11 @@ var LinkMain = ({ url, setUrl, setLink, removeLink, isActive }) => {
|
|
|
3721
3830
|
className: "tiptap-input tiptap-input-clamp"
|
|
3722
3831
|
}
|
|
3723
3832
|
),
|
|
3724
|
-
/* @__PURE__ */ jsx("div", { className: "tiptap-button-group", "data-orientation": "horizontal", children: /* @__PURE__ */ jsx(
|
|
3833
|
+
/* @__PURE__ */ jsx("div", { className: "tiptap-button-group", "data-orientation": "horizontal", children: /* @__PURE__ */ jsx(Button3, { type: "button", onClick: setLink, title: "\u786E\u8BA4", disabled: !url && !isActive, "data-style": "ghost", children: /* @__PURE__ */ jsx(CornerDownLeftIcon, { className: "tiptap-button-icon" }) }) }),
|
|
3725
3834
|
/* @__PURE__ */ jsx(Separator, {}),
|
|
3726
3835
|
/* @__PURE__ */ jsxs("div", { className: "tiptap-button-group", "data-orientation": "horizontal", children: [
|
|
3727
|
-
/* @__PURE__ */ jsx(
|
|
3728
|
-
/* @__PURE__ */ jsx(
|
|
3836
|
+
/* @__PURE__ */ jsx(Button3, { type: "button", onClick: () => window.open(url, "_blank"), title: "\u65B0\u7A97\u53E3\u6253\u5F00", disabled: !url && !isActive, "data-style": "ghost", children: /* @__PURE__ */ jsx(ExternalLinkIcon, { className: "tiptap-button-icon" }) }),
|
|
3837
|
+
/* @__PURE__ */ jsx(Button3, { type: "button", onClick: removeLink, title: "\u5220\u9664\u94FE\u63A5", disabled: !url && !isActive, "data-style": "ghost", children: /* @__PURE__ */ jsx(TrashIcon, { className: "tiptap-button-icon" }) })
|
|
3729
3838
|
] })
|
|
3730
3839
|
] });
|
|
3731
3840
|
};
|
|
@@ -4052,7 +4161,7 @@ var ListButton = React16.forwardRef(
|
|
|
4052
4161
|
({ editor: providedEditor, type, hideWhenUnavailable = false, className = "", onClick, text, children, ...buttonProps }, ref) => {
|
|
4053
4162
|
const editor = useTiptapEditor(providedEditor);
|
|
4054
4163
|
const { listInSchema, listOption, isActive, shortcutKey } = useListState(editor, type);
|
|
4055
|
-
const
|
|
4164
|
+
const Icon2 = listOption?.icon || ListIcon;
|
|
4056
4165
|
const handleClick = React16.useCallback(
|
|
4057
4166
|
(e) => {
|
|
4058
4167
|
onClick?.(e);
|
|
@@ -4074,7 +4183,7 @@ var ListButton = React16.forwardRef(
|
|
|
4074
4183
|
return null;
|
|
4075
4184
|
}
|
|
4076
4185
|
return /* @__PURE__ */ jsx(
|
|
4077
|
-
|
|
4186
|
+
Button3,
|
|
4078
4187
|
{
|
|
4079
4188
|
type: "button",
|
|
4080
4189
|
className: className.trim(),
|
|
@@ -4090,7 +4199,7 @@ var ListButton = React16.forwardRef(
|
|
|
4090
4199
|
...buttonProps,
|
|
4091
4200
|
ref,
|
|
4092
4201
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4093
|
-
/* @__PURE__ */ jsx(
|
|
4202
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
4094
4203
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
4095
4204
|
] })
|
|
4096
4205
|
}
|
|
@@ -4171,7 +4280,7 @@ function ListDropdownMenu({
|
|
|
4171
4280
|
}
|
|
4172
4281
|
return /* @__PURE__ */ jsxs(DropdownMenu, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
4173
4282
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
4174
|
-
|
|
4283
|
+
Button3,
|
|
4175
4284
|
{
|
|
4176
4285
|
type: "button",
|
|
4177
4286
|
"data-style": "ghost",
|
|
@@ -4402,14 +4511,14 @@ function useMarkState(editor, type, disabled = false) {
|
|
|
4402
4511
|
const markInSchema = isMarkInSchema(type, editor);
|
|
4403
4512
|
const isDisabled = isMarkButtonDisabled(editor, type, disabled);
|
|
4404
4513
|
const isActive = isMarkActive(editor, type);
|
|
4405
|
-
const
|
|
4514
|
+
const Icon2 = markIcons[type];
|
|
4406
4515
|
const shortcutKey = markShortcutKeys[type];
|
|
4407
4516
|
const formattedName = getFormattedMarkName(type);
|
|
4408
4517
|
return {
|
|
4409
4518
|
markInSchema,
|
|
4410
4519
|
isDisabled,
|
|
4411
4520
|
isActive,
|
|
4412
|
-
Icon,
|
|
4521
|
+
Icon: Icon2,
|
|
4413
4522
|
shortcutKey,
|
|
4414
4523
|
formattedName
|
|
4415
4524
|
};
|
|
@@ -4417,7 +4526,7 @@ function useMarkState(editor, type, disabled = false) {
|
|
|
4417
4526
|
var MarkButton = React16.forwardRef(
|
|
4418
4527
|
({ editor: providedEditor, type, text, hideWhenUnavailable = false, className = "", disabled, onClick, children, ...buttonProps }, ref) => {
|
|
4419
4528
|
const editor = useTiptapEditor(providedEditor);
|
|
4420
|
-
const { markInSchema, isDisabled, isActive, Icon, shortcutKey, formattedName } = useMarkState(editor, type, disabled);
|
|
4529
|
+
const { markInSchema, isDisabled, isActive, Icon: Icon2, shortcutKey, formattedName } = useMarkState(editor, type, disabled);
|
|
4421
4530
|
const handleClick = React16.useCallback(
|
|
4422
4531
|
(e) => {
|
|
4423
4532
|
onClick?.(e);
|
|
@@ -4439,7 +4548,7 @@ var MarkButton = React16.forwardRef(
|
|
|
4439
4548
|
return null;
|
|
4440
4549
|
}
|
|
4441
4550
|
return /* @__PURE__ */ jsx(
|
|
4442
|
-
|
|
4551
|
+
Button3,
|
|
4443
4552
|
{
|
|
4444
4553
|
type: "button",
|
|
4445
4554
|
className: className.trim(),
|
|
@@ -4457,7 +4566,7 @@ var MarkButton = React16.forwardRef(
|
|
|
4457
4566
|
...buttonProps,
|
|
4458
4567
|
ref,
|
|
4459
4568
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4460
|
-
/* @__PURE__ */ jsx(
|
|
4569
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
4461
4570
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
4462
4571
|
] })
|
|
4463
4572
|
}
|
|
@@ -4608,7 +4717,7 @@ function useNodeState(editor, type, disabled = false, hideWhenUnavailable = fals
|
|
|
4608
4717
|
}
|
|
4609
4718
|
return false;
|
|
4610
4719
|
}, [editor, type, isDisabled]);
|
|
4611
|
-
const
|
|
4720
|
+
const Icon2 = nodeIcons[type];
|
|
4612
4721
|
const shortcutKey = nodeShortcutKeys[type];
|
|
4613
4722
|
const label = nodeLabels[type];
|
|
4614
4723
|
return {
|
|
@@ -4618,7 +4727,7 @@ function useNodeState(editor, type, disabled = false, hideWhenUnavailable = fals
|
|
|
4618
4727
|
isActive,
|
|
4619
4728
|
shouldShow,
|
|
4620
4729
|
handleToggle,
|
|
4621
|
-
Icon,
|
|
4730
|
+
Icon: Icon2,
|
|
4622
4731
|
shortcutKey,
|
|
4623
4732
|
label
|
|
4624
4733
|
};
|
|
@@ -4626,7 +4735,7 @@ function useNodeState(editor, type, disabled = false, hideWhenUnavailable = fals
|
|
|
4626
4735
|
var NodeButton = React16.forwardRef(
|
|
4627
4736
|
({ editor: providedEditor, type, text, hideWhenUnavailable = false, className = "", disabled, onClick, children, ...buttonProps }, ref) => {
|
|
4628
4737
|
const editor = useTiptapEditor(providedEditor);
|
|
4629
|
-
const { isDisabled, isActive, shouldShow, handleToggle, Icon, shortcutKey, label } = useNodeState(editor, type, disabled, hideWhenUnavailable);
|
|
4738
|
+
const { isDisabled, isActive, shouldShow, handleToggle, Icon: Icon2, shortcutKey, label } = useNodeState(editor, type, disabled, hideWhenUnavailable);
|
|
4630
4739
|
const handleClick = React16.useCallback(
|
|
4631
4740
|
(e) => {
|
|
4632
4741
|
onClick?.(e);
|
|
@@ -4640,7 +4749,7 @@ var NodeButton = React16.forwardRef(
|
|
|
4640
4749
|
return null;
|
|
4641
4750
|
}
|
|
4642
4751
|
return /* @__PURE__ */ jsx(
|
|
4643
|
-
|
|
4752
|
+
Button3,
|
|
4644
4753
|
{
|
|
4645
4754
|
type: "button",
|
|
4646
4755
|
className: className.trim(),
|
|
@@ -4658,7 +4767,7 @@ var NodeButton = React16.forwardRef(
|
|
|
4658
4767
|
...buttonProps,
|
|
4659
4768
|
ref,
|
|
4660
4769
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4661
|
-
/* @__PURE__ */ jsx(
|
|
4770
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
4662
4771
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
4663
4772
|
] })
|
|
4664
4773
|
}
|
|
@@ -4720,7 +4829,7 @@ var QuoteButton = React16.forwardRef(
|
|
|
4720
4829
|
);
|
|
4721
4830
|
if (!shouldShow || !editor || !editor.isEditable) return null;
|
|
4722
4831
|
return /* @__PURE__ */ jsx(
|
|
4723
|
-
|
|
4832
|
+
Button3,
|
|
4724
4833
|
{
|
|
4725
4834
|
type: "button",
|
|
4726
4835
|
className: className.trim(),
|
|
@@ -4938,7 +5047,7 @@ function useTextAlign(editor, align, disabled = false, hideWhenUnavailable = fal
|
|
|
4938
5047
|
return setTextAlign(editor, align);
|
|
4939
5048
|
}, [alignAvailable, editor, isDisabled, align]);
|
|
4940
5049
|
const shouldShow = React16.useMemo(() => shouldShowTextAlignButton(editor, canAlign, hideWhenUnavailable), [editor, canAlign, hideWhenUnavailable]);
|
|
4941
|
-
const
|
|
5050
|
+
const Icon2 = textAlignIcons[align];
|
|
4942
5051
|
const shortcutKey = textAlignShortcutKeys[align];
|
|
4943
5052
|
const label = textAlignLabels[align];
|
|
4944
5053
|
return {
|
|
@@ -4948,7 +5057,7 @@ function useTextAlign(editor, align, disabled = false, hideWhenUnavailable = fal
|
|
|
4948
5057
|
isActive,
|
|
4949
5058
|
handleAlignment,
|
|
4950
5059
|
shouldShow,
|
|
4951
|
-
Icon,
|
|
5060
|
+
Icon: Icon2,
|
|
4952
5061
|
shortcutKey,
|
|
4953
5062
|
label
|
|
4954
5063
|
};
|
|
@@ -4956,7 +5065,7 @@ function useTextAlign(editor, align, disabled = false, hideWhenUnavailable = fal
|
|
|
4956
5065
|
var TextAlignButton = React16.forwardRef(
|
|
4957
5066
|
({ editor: providedEditor, align, text, hideWhenUnavailable = false, className = "", disabled, onClick, children, ...buttonProps }, ref) => {
|
|
4958
5067
|
const editor = useTiptapEditor(providedEditor);
|
|
4959
|
-
const { isDisabled, isActive, handleAlignment, shouldShow, Icon, shortcutKey, label } = useTextAlign(editor, align, disabled, hideWhenUnavailable);
|
|
5068
|
+
const { isDisabled, isActive, handleAlignment, shouldShow, Icon: Icon2, shortcutKey, label } = useTextAlign(editor, align, disabled, hideWhenUnavailable);
|
|
4960
5069
|
const handleClick = React16.useCallback(
|
|
4961
5070
|
(e) => {
|
|
4962
5071
|
onClick?.(e);
|
|
@@ -4970,7 +5079,7 @@ var TextAlignButton = React16.forwardRef(
|
|
|
4970
5079
|
return null;
|
|
4971
5080
|
}
|
|
4972
5081
|
return /* @__PURE__ */ jsx(
|
|
4973
|
-
|
|
5082
|
+
Button3,
|
|
4974
5083
|
{
|
|
4975
5084
|
type: "button",
|
|
4976
5085
|
className: className.trim(),
|
|
@@ -4988,7 +5097,7 @@ var TextAlignButton = React16.forwardRef(
|
|
|
4988
5097
|
...buttonProps,
|
|
4989
5098
|
ref,
|
|
4990
5099
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4991
|
-
/* @__PURE__ */ jsx(
|
|
5100
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
4992
5101
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
4993
5102
|
] })
|
|
4994
5103
|
}
|
|
@@ -5052,14 +5161,14 @@ function useHistoryAction(editor, action, disabled = false) {
|
|
|
5052
5161
|
if (!editor || isDisabled) return;
|
|
5053
5162
|
executeHistoryAction(editor, action);
|
|
5054
5163
|
}, [editor, action, isDisabled]);
|
|
5055
|
-
const
|
|
5164
|
+
const Icon2 = historyIcons[action];
|
|
5056
5165
|
const actionLabel = historyActionLabels[action];
|
|
5057
5166
|
const shortcutKey = historyShortcutKeys[action];
|
|
5058
5167
|
return {
|
|
5059
5168
|
canExecute,
|
|
5060
5169
|
isDisabled,
|
|
5061
5170
|
handleAction,
|
|
5062
|
-
Icon,
|
|
5171
|
+
Icon: Icon2,
|
|
5063
5172
|
actionLabel,
|
|
5064
5173
|
shortcutKey
|
|
5065
5174
|
};
|
|
@@ -5067,7 +5176,7 @@ function useHistoryAction(editor, action, disabled = false) {
|
|
|
5067
5176
|
var UndoRedoButton = React16.forwardRef(
|
|
5068
5177
|
({ editor: providedEditor, action, text, className = "", disabled, onClick, children, ...buttonProps }, ref) => {
|
|
5069
5178
|
const editor = useTiptapEditor(providedEditor);
|
|
5070
|
-
const { isDisabled, handleAction, Icon, actionLabel, shortcutKey } = useHistoryAction(editor, action, disabled);
|
|
5179
|
+
const { isDisabled, handleAction, Icon: Icon2, actionLabel, shortcutKey } = useHistoryAction(editor, action, disabled);
|
|
5071
5180
|
const handleClick = React16.useCallback(
|
|
5072
5181
|
(e) => {
|
|
5073
5182
|
onClick?.(e);
|
|
@@ -5081,7 +5190,7 @@ var UndoRedoButton = React16.forwardRef(
|
|
|
5081
5190
|
return null;
|
|
5082
5191
|
}
|
|
5083
5192
|
return /* @__PURE__ */ jsx(
|
|
5084
|
-
|
|
5193
|
+
Button3,
|
|
5085
5194
|
{
|
|
5086
5195
|
ref,
|
|
5087
5196
|
type: "button",
|
|
@@ -5097,7 +5206,7 @@ var UndoRedoButton = React16.forwardRef(
|
|
|
5097
5206
|
onClick: handleClick,
|
|
5098
5207
|
...buttonProps,
|
|
5099
5208
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5100
|
-
/* @__PURE__ */ jsx(
|
|
5209
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
5101
5210
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
5102
5211
|
] })
|
|
5103
5212
|
}
|
|
@@ -5523,7 +5632,7 @@ var MainToolbarContent = ({
|
|
|
5523
5632
|
] });
|
|
5524
5633
|
};
|
|
5525
5634
|
var MobileToolbarContent = ({ type, onBack }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5526
|
-
/* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxs(
|
|
5635
|
+
/* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxs(Button3, { "data-style": "ghost", onClick: onBack, children: [
|
|
5527
5636
|
/* @__PURE__ */ jsx(ArrowLeftIcon, { className: "tiptap-button-icon" }),
|
|
5528
5637
|
type === "highlighter" ? /* @__PURE__ */ jsx(HighlighterIcon, { className: "tiptap-button-icon" }) : /* @__PURE__ */ jsx(LinkIcon, { className: "tiptap-button-icon" })
|
|
5529
5638
|
] }) }),
|
|
@@ -5722,7 +5831,7 @@ var MarkdownEditor_default = ({
|
|
|
5722
5831
|
const downloadFile2 = () => {
|
|
5723
5832
|
onDownloadFile?.(getMarkdown(), "docx");
|
|
5724
5833
|
};
|
|
5725
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
5834
|
+
return /* @__PURE__ */ jsx("div", { className: classNames("height-full", "editor-parent"), children: /* @__PURE__ */ jsxs(EditorContext.Provider, { value: { editor }, children: [
|
|
5726
5835
|
showToolbar && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5727
5836
|
/* @__PURE__ */ jsxs(Flex, { justify: "end", align: "center", children: [
|
|
5728
5837
|
NsToolBar({ isBubble: false }),
|
|
@@ -5738,7 +5847,7 @@ var MarkdownEditor_default = ({
|
|
|
5738
5847
|
{
|
|
5739
5848
|
editor,
|
|
5740
5849
|
role: "presentation",
|
|
5741
|
-
className:
|
|
5850
|
+
className: classNames("simple-editor-content ns-markdown", { "no-toolbar": !showToolbar })
|
|
5742
5851
|
}
|
|
5743
5852
|
) })
|
|
5744
5853
|
] }) });
|
|
@@ -5779,10 +5888,70 @@ function propsMerge(control, props) {
|
|
|
5779
5888
|
}
|
|
5780
5889
|
return null;
|
|
5781
5890
|
}
|
|
5891
|
+
var SpeechLoading_default = () => /* @__PURE__ */ jsxs("svg", { color: "currentColor", viewBox: "0 0 1000 1000", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
5892
|
+
/* @__PURE__ */ jsxs("rect", { fill: "currentColor", rx: "70", ry: "70", height: "250", width: "140", x: "0", y: "375", children: [
|
|
5893
|
+
/* @__PURE__ */ jsx("animate", { attributeName: "height", values: "250; 500; 250", keyTimes: "0; 0.5; 1", dur: "0.8s", begin: "0s", repeatCount: "indefinite" }),
|
|
5894
|
+
/* @__PURE__ */ jsx("animate", { attributeName: "y", values: "375; 250; 375", keyTimes: "0; 0.5; 1", dur: "0.8s", begin: "0s", repeatCount: "indefinite" })
|
|
5895
|
+
] }),
|
|
5896
|
+
/* @__PURE__ */ jsxs("rect", { fill: "currentColor", rx: "70", ry: "70", height: "250", width: "140", x: "286.66666666666663", y: "375", children: [
|
|
5897
|
+
/* @__PURE__ */ jsx("animate", { attributeName: "height", values: "250; 500; 250", keyTimes: "0; 0.5; 1", dur: "0.8s", begin: "0.2s", repeatCount: "indefinite" }),
|
|
5898
|
+
/* @__PURE__ */ jsx("animate", { attributeName: "y", values: "375; 250; 375", keyTimes: "0; 0.5; 1", dur: "0.8s", begin: "0.2s", repeatCount: "indefinite" })
|
|
5899
|
+
] }),
|
|
5900
|
+
/* @__PURE__ */ jsxs("rect", { fill: "currentColor", rx: "70", ry: "70", height: "250", width: "140", x: "573.3333333333333", y: "375", children: [
|
|
5901
|
+
/* @__PURE__ */ jsx("animate", { attributeName: "height", values: "250; 500; 250", keyTimes: "0; 0.5; 1", dur: "0.8s", begin: "0.4s", repeatCount: "indefinite" }),
|
|
5902
|
+
/* @__PURE__ */ jsx("animate", { attributeName: "y", values: "375; 250; 375", keyTimes: "0; 0.5; 1", dur: "0.8s", begin: "0.4s", repeatCount: "indefinite" })
|
|
5903
|
+
] }),
|
|
5904
|
+
/* @__PURE__ */ jsxs("rect", { fill: "currentColor", rx: "70", ry: "70", height: "250", width: "140", x: "859.9999999999999", y: "375", children: [
|
|
5905
|
+
/* @__PURE__ */ jsx(
|
|
5906
|
+
"animate",
|
|
5907
|
+
{
|
|
5908
|
+
attributeName: "height",
|
|
5909
|
+
values: "250; 500; 250",
|
|
5910
|
+
keyTimes: "0; 0.5; 1",
|
|
5911
|
+
dur: "0.8s",
|
|
5912
|
+
begin: "0.6000000000000001s",
|
|
5913
|
+
repeatCount: "indefinite"
|
|
5914
|
+
}
|
|
5915
|
+
),
|
|
5916
|
+
/* @__PURE__ */ jsx(
|
|
5917
|
+
"animate",
|
|
5918
|
+
{
|
|
5919
|
+
attributeName: "y",
|
|
5920
|
+
values: "375; 250; 375",
|
|
5921
|
+
keyTimes: "0; 0.5; 1",
|
|
5922
|
+
dur: "0.8s",
|
|
5923
|
+
begin: "0.6000000000000001s",
|
|
5924
|
+
repeatCount: "indefinite"
|
|
5925
|
+
}
|
|
5926
|
+
)
|
|
5927
|
+
] })
|
|
5928
|
+
] });
|
|
5929
|
+
var SpeechButton_default = (props) => {
|
|
5930
|
+
const { permission, isRecording, start, stop } = useSpeech_default(props);
|
|
5931
|
+
const disabled = permission === "denied" || permission === "unsupported";
|
|
5932
|
+
const handleClick = () => {
|
|
5933
|
+
if (isRecording) {
|
|
5934
|
+
stop();
|
|
5935
|
+
} else {
|
|
5936
|
+
start();
|
|
5937
|
+
}
|
|
5938
|
+
};
|
|
5939
|
+
return /* @__PURE__ */ jsx(
|
|
5940
|
+
Button,
|
|
5941
|
+
{
|
|
5942
|
+
title: permission === "unsupported" ? "\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u8BED\u97F3\u8BC6\u522B" : permission === "denied" ? "\u9EA6\u514B\u98CE\u6743\u9650\u5DF2\u62D2\u7EDD" : isRecording ? "\u505C\u6B62\u5F55\u97F3" : "\u70B9\u51FB\u5F00\u59CB\u5F55\u97F3",
|
|
5943
|
+
disabled,
|
|
5944
|
+
color: "primary",
|
|
5945
|
+
variant: "text",
|
|
5946
|
+
icon: isRecording ? /* @__PURE__ */ jsx(Icon, { style: { width: 16 }, component: SpeechLoading_default }) : disabled ? /* @__PURE__ */ jsx(AudioMutedOutlined, {}) : /* @__PURE__ */ jsx(AudioOutlined, {}),
|
|
5947
|
+
onClick: handleClick
|
|
5948
|
+
}
|
|
5949
|
+
);
|
|
5950
|
+
};
|
|
5782
5951
|
var UserAvatar_default = ({ size, avatarSrc, userName }) => {
|
|
5783
5952
|
return avatarSrc ? /* @__PURE__ */ jsx(Avatar, { size, src: avatarSrc }) : /* @__PURE__ */ jsx(Avatar, { size, className: "cursor-pointer", style: { backgroundColor: "var(--ant-color-primary)" }, children: userName?.slice(0, 1)?.toLocaleUpperCase() });
|
|
5784
5953
|
};
|
|
5785
5954
|
|
|
5786
|
-
export { AudioPlayer_default as AudioPlayer, BusinessCode, DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, DEFAULT_YEAR_MONTH_DAY_FORMAT, DEFAULT_YEAR_MONTH_FORMAT, FileIcon_default as FileIcon, FilePreview_default as FilePreview, FilePreviewDrawer_default as FilePreviewDrawer, HttpStatus, Iframe_default as Iframe, LazyComponent_default as LazyComponent, MarkdownEditor_default as MarkdownEditor, MarkdownPreview_default as MarkdownPreview, MultiEmailValidator, PdfPreview_default as PdfPreview, PhoneOrMobileValidator, RegBankCardNo, RegDetailAddress, RegEmail, RegFixedTelePhone, RegIdentityCardNo, RegMobile, RegNumNo, RegPassword, RegSmsCode, RegTaxNo, RegTelePhone, RenderMarkdown_default as RenderMarkdown, RenderWrapper_default as RenderWrapper, ThanNumLengthValidator, ThanNumValidator, UserAvatar_default as UserAvatar, VideoPlayer_default as VideoPlayer, absVal, addUrlLastSlash, aesDecrypt, aesEncrypt, arrToObj, buildUrlParams, cachedMessage, calculate, compareNum, convertCurrency, convertNewlineToBr, copyText, createRequest, createSecureManager, createTokenManager, decimalPlaces, deepCopy, deepEqual, deepMerge, dividedBy, downloadFile, emit, emitToChild, executeScript, formatDate,
|
|
5955
|
+
export { AudioPlayer_default as AudioPlayer, BusinessCode, DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, DEFAULT_YEAR_MONTH_DAY_FORMAT, DEFAULT_YEAR_MONTH_FORMAT, DocxPreview_default as DocxPreview, FileIcon_default as FileIcon, FilePreview_default as FilePreview, FilePreviewDrawer_default as FilePreviewDrawer, HttpStatus, Iframe_default as Iframe, LazyComponent_default as LazyComponent, MarkdownEditor_default as MarkdownEditor, MarkdownPreview_default as MarkdownPreview, MultiEmailValidator, PdfPreview_default as PdfPreview, PhoneOrMobileValidator, RegBankCardNo, RegDetailAddress, RegEmail, RegFixedTelePhone, RegIdentityCardNo, RegMobile, RegNumNo, RegPassword, RegSmsCode, RegTaxNo, RegTelePhone, RenderMarkdown_default as RenderMarkdown, RenderWrapper_default as RenderWrapper, SpeechButton_default as SpeechButton, ThanNumLengthValidator, ThanNumValidator, UserAvatar_default as UserAvatar, VideoPlayer_default as VideoPlayer, absVal, addUrlLastSlash, aesDecrypt, aesEncrypt, arrToObj, buildUrlParams, cachedMessage, calculate, compareNum, convertCurrency, convertNewlineToBr, copyText, createRequest, createSecureManager, createTokenManager, decimalPlaces, deepCopy, deepEqual, deepMerge, dividedBy, downloadFile, emit, emitToChild, executeScript, formatDate, formatNumberWithCommas, formatSize, genNonDuplicateID, generateRandomNumbers, getAllUrlParams, getDeviceId, getEndOfTimestamp, getFileName, getFileSuffixName, getRowSpanCount, getStartOfTimestamp, getTimestamp, getWebSocketUrl, importThirdPartyFile, is, isArray, isBlob, isBoolean, isDate, isDef, isElement, isEmpty, isEmptyObj, isExpire, isExternal, isFunction, isInteger, isJson, isLocalhost, isMap, isNegative, isNull, isNullOrUnDef, isNumber, isNumberNoNaN, isObject, isPromise, isReferenceType, isRegExp, isScriptSafe, isSet, isString, isUnDef, isWindow, minus, objToOptions, plus, precision, processItemList, propsMerge, setInterval2 as setInterval, setUrlMainSource, shouldRender, times, toFixed, transform, transforms, useAutoRefresh_default as useAutoRefresh, useCountDown_default as useCountDown, useCreateValtioContext_default as useCreateValtioContext, useDebounce_default as useDebounce, useDeepEffect_default as useDeepEffect, useIframeRelayBridge_default as useIframeRelayBridge, useRefState_default as useRefState, useSpeech_default as useSpeech, useSyncInput_default as useSyncInput, useThrottle_default as useThrottle, useWebSocket_default as useWebSocket };
|
|
5787
5956
|
//# sourceMappingURL=index.esm.js.map
|
|
5788
5957
|
//# sourceMappingURL=index.esm.js.map
|