@zero-library/common 2.2.3 → 2.2.5
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 +272 -88
- 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 +68 -36
- package/dist/index.d.ts +68 -36
- package/dist/index.esm.js +256 -76
- 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: [
|
|
@@ -1159,6 +1210,90 @@ var useRefState_default = (init) => {
|
|
|
1159
1210
|
const getState = () => stateRef.current;
|
|
1160
1211
|
return [state, setProxy, getState];
|
|
1161
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
|
+
};
|
|
1162
1297
|
var useSyncInput_default = (storeValue, setStoreValue) => {
|
|
1163
1298
|
const [inputValue, setInputValue] = useState(storeValue);
|
|
1164
1299
|
useEffect(() => {
|
|
@@ -1876,10 +2011,10 @@ var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumb
|
|
|
1876
2011
|
] }) })
|
|
1877
2012
|
] }) }) });
|
|
1878
2013
|
};
|
|
1879
|
-
var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue }) => {
|
|
2014
|
+
var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue, emptyProps }) => {
|
|
1880
2015
|
const Preview = useMemo(() => {
|
|
1881
2016
|
if (!fileUrl) {
|
|
1882
|
-
return /* @__PURE__ */ jsx(Empty, {});
|
|
2017
|
+
return /* @__PURE__ */ jsx(Empty, { ...emptyProps });
|
|
1883
2018
|
}
|
|
1884
2019
|
switch (suffix?.toUpperCase()) {
|
|
1885
2020
|
case "PNG":
|
|
@@ -1893,27 +2028,22 @@ var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue }
|
|
|
1893
2028
|
case "MP4":
|
|
1894
2029
|
return /* @__PURE__ */ jsx(VideoPlayer_default, { fileUrl });
|
|
1895
2030
|
case "MP3":
|
|
2031
|
+
case "WAV":
|
|
2032
|
+
case "M4A":
|
|
2033
|
+
case "ACC":
|
|
1896
2034
|
return /* @__PURE__ */ jsx(AudioPlayer_default, { fileUrl });
|
|
1897
2035
|
case "MD":
|
|
1898
2036
|
case "MARKDOWN":
|
|
1899
2037
|
return /* @__PURE__ */ jsx(MarkdownPreview_default, { fileUrl, searchValue });
|
|
2038
|
+
case "DOCX":
|
|
2039
|
+
return /* @__PURE__ */ jsx(DocxPreview_default, { fileUrl });
|
|
1900
2040
|
default:
|
|
1901
2041
|
return /* @__PURE__ */ jsx(Result, { subTitle: `\u6682\u4E0D\u652F\u6301 ${suffix || ""} \u6587\u4EF6\u7684\u9884\u89C8` });
|
|
1902
2042
|
}
|
|
1903
2043
|
}, [suffix, fileUrl, pdfParams]);
|
|
1904
2044
|
return /* @__PURE__ */ jsx(Flex, { justify: "center", align: "center", className: "height-full", children: Preview });
|
|
1905
2045
|
};
|
|
1906
|
-
var FilePreviewDrawer_default = ({
|
|
1907
|
-
open,
|
|
1908
|
-
fileUrl,
|
|
1909
|
-
suffix,
|
|
1910
|
-
title = "\u6587\u4EF6\u9884\u89C8",
|
|
1911
|
-
onClose,
|
|
1912
|
-
password,
|
|
1913
|
-
fileParams,
|
|
1914
|
-
pdfParams,
|
|
1915
|
-
onSetPassSuccess
|
|
1916
|
-
}) => {
|
|
2046
|
+
var FilePreviewDrawer_default = ({ open, title = "\u6587\u4EF6\u9884\u89C8", onClose, ...props }) => {
|
|
1917
2047
|
return /* @__PURE__ */ jsx(
|
|
1918
2048
|
Drawer,
|
|
1919
2049
|
{
|
|
@@ -1922,17 +2052,7 @@ var FilePreviewDrawer_default = ({
|
|
|
1922
2052
|
width: "100%",
|
|
1923
2053
|
open,
|
|
1924
2054
|
onClose,
|
|
1925
|
-
children: /* @__PURE__ */ jsx(
|
|
1926
|
-
FilePreview_default,
|
|
1927
|
-
{
|
|
1928
|
-
fileUrl,
|
|
1929
|
-
suffix,
|
|
1930
|
-
password,
|
|
1931
|
-
fileParams,
|
|
1932
|
-
pdfParams,
|
|
1933
|
-
onSetPassSuccess
|
|
1934
|
-
}
|
|
1935
|
-
)
|
|
2055
|
+
children: /* @__PURE__ */ jsx(FilePreview_default, { ...props })
|
|
1936
2056
|
}
|
|
1937
2057
|
);
|
|
1938
2058
|
};
|
|
@@ -1959,7 +2079,7 @@ var Iframe_default = forwardRef(({ defaultMainSource, id, src, className, onLoad
|
|
|
1959
2079
|
id,
|
|
1960
2080
|
ref,
|
|
1961
2081
|
src: finalSrc,
|
|
1962
|
-
className:
|
|
2082
|
+
className: classNames(styles_module_default2.iframe, className),
|
|
1963
2083
|
onLoad: onHandleLoad,
|
|
1964
2084
|
allow: "clipboard-write"
|
|
1965
2085
|
}
|
|
@@ -2233,7 +2353,7 @@ var ShortcutDisplay = ({ shortcuts }) => {
|
|
|
2233
2353
|
/* @__PURE__ */ jsx("kbd", { children: key })
|
|
2234
2354
|
] }, index)) });
|
|
2235
2355
|
};
|
|
2236
|
-
var
|
|
2356
|
+
var Button3 = React16.forwardRef(
|
|
2237
2357
|
({ className = "", children, tooltip, showTooltip = true, shortcutKeys, "aria-label": ariaLabel, ...props }, ref) => {
|
|
2238
2358
|
const isMac = React16.useMemo(() => typeof navigator !== "undefined" && navigator.platform.toLowerCase().includes("mac"), []);
|
|
2239
2359
|
const shortcuts = React16.useMemo(() => parseShortcutKeys(shortcutKeys, isMac), [shortcutKeys, isMac]);
|
|
@@ -2249,7 +2369,7 @@ var Button2 = React16.forwardRef(
|
|
|
2249
2369
|
] });
|
|
2250
2370
|
}
|
|
2251
2371
|
);
|
|
2252
|
-
|
|
2372
|
+
Button3.displayName = "Button";
|
|
2253
2373
|
var Spacer = React16.forwardRef(
|
|
2254
2374
|
({ orientation = "horizontal", size, className = "", style = {}, ...props }, ref) => {
|
|
2255
2375
|
const computedStyle = {
|
|
@@ -2707,14 +2827,14 @@ function useHeadingState(editor, level, disabled = false) {
|
|
|
2707
2827
|
const headingInSchema = isNodeInSchema("heading", editor);
|
|
2708
2828
|
const isDisabled = isHeadingButtonDisabled(editor, level, disabled);
|
|
2709
2829
|
const isActive = isHeadingActive(editor, level);
|
|
2710
|
-
const
|
|
2830
|
+
const Icon2 = headingIcons[level];
|
|
2711
2831
|
const shortcutKey = headingShortcutKeys[level];
|
|
2712
2832
|
const formattedName = getFormattedHeadingName(level);
|
|
2713
2833
|
return {
|
|
2714
2834
|
headingInSchema,
|
|
2715
2835
|
isDisabled,
|
|
2716
2836
|
isActive,
|
|
2717
|
-
Icon,
|
|
2837
|
+
Icon: Icon2,
|
|
2718
2838
|
shortcutKey,
|
|
2719
2839
|
formattedName
|
|
2720
2840
|
};
|
|
@@ -2722,7 +2842,7 @@ function useHeadingState(editor, level, disabled = false) {
|
|
|
2722
2842
|
var HeadingButton = React16.forwardRef(
|
|
2723
2843
|
({ editor: providedEditor, level, text, hideWhenUnavailable = false, className = "", disabled, onClick, children, ...buttonProps }, ref) => {
|
|
2724
2844
|
const editor = useTiptapEditor(providedEditor);
|
|
2725
|
-
const { headingInSchema, isDisabled, isActive, Icon, shortcutKey, formattedName } = useHeadingState(editor, level, disabled);
|
|
2845
|
+
const { headingInSchema, isDisabled, isActive, Icon: Icon2, shortcutKey, formattedName } = useHeadingState(editor, level, disabled);
|
|
2726
2846
|
const handleClick = React16.useCallback(
|
|
2727
2847
|
(e) => {
|
|
2728
2848
|
onClick?.(e);
|
|
@@ -2743,7 +2863,7 @@ var HeadingButton = React16.forwardRef(
|
|
|
2743
2863
|
return null;
|
|
2744
2864
|
}
|
|
2745
2865
|
return /* @__PURE__ */ jsx(
|
|
2746
|
-
|
|
2866
|
+
Button3,
|
|
2747
2867
|
{
|
|
2748
2868
|
type: "button",
|
|
2749
2869
|
className: className.trim(),
|
|
@@ -2761,7 +2881,7 @@ var HeadingButton = React16.forwardRef(
|
|
|
2761
2881
|
...buttonProps,
|
|
2762
2882
|
ref,
|
|
2763
2883
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2764
|
-
/* @__PURE__ */ jsx(
|
|
2884
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
2765
2885
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
2766
2886
|
] })
|
|
2767
2887
|
}
|
|
@@ -3022,7 +3142,7 @@ function HeadingDropdownMenu({
|
|
|
3022
3142
|
}
|
|
3023
3143
|
return /* @__PURE__ */ jsxs(DropdownMenu, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
3024
3144
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
3025
|
-
|
|
3145
|
+
Button3,
|
|
3026
3146
|
{
|
|
3027
3147
|
type: "button",
|
|
3028
3148
|
disabled: isDisabled,
|
|
@@ -3395,7 +3515,7 @@ var HighlightButton = React16.forwardRef(
|
|
|
3395
3515
|
return null;
|
|
3396
3516
|
}
|
|
3397
3517
|
return /* @__PURE__ */ jsx(
|
|
3398
|
-
|
|
3518
|
+
Button3,
|
|
3399
3519
|
{
|
|
3400
3520
|
type: "button",
|
|
3401
3521
|
className: className.trim(),
|
|
@@ -3448,7 +3568,7 @@ var DEFAULT_HIGHLIGHT_COLORS = [
|
|
|
3448
3568
|
}
|
|
3449
3569
|
];
|
|
3450
3570
|
var HighlighterButton = React16.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3451
|
-
|
|
3571
|
+
Button3,
|
|
3452
3572
|
{
|
|
3453
3573
|
type: "button",
|
|
3454
3574
|
className,
|
|
@@ -3501,7 +3621,7 @@ function HighlightContent({ editor: providedEditor, colors = DEFAULT_HIGHLIGHT_C
|
|
|
3501
3621
|
)) }),
|
|
3502
3622
|
/* @__PURE__ */ jsx(Separator, {}),
|
|
3503
3623
|
/* @__PURE__ */ jsx("div", { className: "tiptap-button-group", children: /* @__PURE__ */ jsx(
|
|
3504
|
-
|
|
3624
|
+
Button3,
|
|
3505
3625
|
{
|
|
3506
3626
|
onClick: removeHighlight,
|
|
3507
3627
|
"aria-label": "Remove highlight",
|
|
@@ -3679,7 +3799,7 @@ var useLinkHandler = (props) => {
|
|
|
3679
3799
|
};
|
|
3680
3800
|
};
|
|
3681
3801
|
var LinkButton = React16.forwardRef(({ className, children, ...props }, ref) => {
|
|
3682
|
-
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" }) });
|
|
3683
3803
|
});
|
|
3684
3804
|
var LinkContent = ({ editor: providedEditor }) => {
|
|
3685
3805
|
const editor = useTiptapEditor(providedEditor);
|
|
@@ -3710,11 +3830,11 @@ var LinkMain = ({ url, setUrl, setLink, removeLink, isActive }) => {
|
|
|
3710
3830
|
className: "tiptap-input tiptap-input-clamp"
|
|
3711
3831
|
}
|
|
3712
3832
|
),
|
|
3713
|
-
/* @__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" }) }) }),
|
|
3714
3834
|
/* @__PURE__ */ jsx(Separator, {}),
|
|
3715
3835
|
/* @__PURE__ */ jsxs("div", { className: "tiptap-button-group", "data-orientation": "horizontal", children: [
|
|
3716
|
-
/* @__PURE__ */ jsx(
|
|
3717
|
-
/* @__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" }) })
|
|
3718
3838
|
] })
|
|
3719
3839
|
] });
|
|
3720
3840
|
};
|
|
@@ -4041,7 +4161,7 @@ var ListButton = React16.forwardRef(
|
|
|
4041
4161
|
({ editor: providedEditor, type, hideWhenUnavailable = false, className = "", onClick, text, children, ...buttonProps }, ref) => {
|
|
4042
4162
|
const editor = useTiptapEditor(providedEditor);
|
|
4043
4163
|
const { listInSchema, listOption, isActive, shortcutKey } = useListState(editor, type);
|
|
4044
|
-
const
|
|
4164
|
+
const Icon2 = listOption?.icon || ListIcon;
|
|
4045
4165
|
const handleClick = React16.useCallback(
|
|
4046
4166
|
(e) => {
|
|
4047
4167
|
onClick?.(e);
|
|
@@ -4063,7 +4183,7 @@ var ListButton = React16.forwardRef(
|
|
|
4063
4183
|
return null;
|
|
4064
4184
|
}
|
|
4065
4185
|
return /* @__PURE__ */ jsx(
|
|
4066
|
-
|
|
4186
|
+
Button3,
|
|
4067
4187
|
{
|
|
4068
4188
|
type: "button",
|
|
4069
4189
|
className: className.trim(),
|
|
@@ -4079,7 +4199,7 @@ var ListButton = React16.forwardRef(
|
|
|
4079
4199
|
...buttonProps,
|
|
4080
4200
|
ref,
|
|
4081
4201
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4082
|
-
/* @__PURE__ */ jsx(
|
|
4202
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
4083
4203
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
4084
4204
|
] })
|
|
4085
4205
|
}
|
|
@@ -4160,7 +4280,7 @@ function ListDropdownMenu({
|
|
|
4160
4280
|
}
|
|
4161
4281
|
return /* @__PURE__ */ jsxs(DropdownMenu, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
4162
4282
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
4163
|
-
|
|
4283
|
+
Button3,
|
|
4164
4284
|
{
|
|
4165
4285
|
type: "button",
|
|
4166
4286
|
"data-style": "ghost",
|
|
@@ -4391,14 +4511,14 @@ function useMarkState(editor, type, disabled = false) {
|
|
|
4391
4511
|
const markInSchema = isMarkInSchema(type, editor);
|
|
4392
4512
|
const isDisabled = isMarkButtonDisabled(editor, type, disabled);
|
|
4393
4513
|
const isActive = isMarkActive(editor, type);
|
|
4394
|
-
const
|
|
4514
|
+
const Icon2 = markIcons[type];
|
|
4395
4515
|
const shortcutKey = markShortcutKeys[type];
|
|
4396
4516
|
const formattedName = getFormattedMarkName(type);
|
|
4397
4517
|
return {
|
|
4398
4518
|
markInSchema,
|
|
4399
4519
|
isDisabled,
|
|
4400
4520
|
isActive,
|
|
4401
|
-
Icon,
|
|
4521
|
+
Icon: Icon2,
|
|
4402
4522
|
shortcutKey,
|
|
4403
4523
|
formattedName
|
|
4404
4524
|
};
|
|
@@ -4406,7 +4526,7 @@ function useMarkState(editor, type, disabled = false) {
|
|
|
4406
4526
|
var MarkButton = React16.forwardRef(
|
|
4407
4527
|
({ editor: providedEditor, type, text, hideWhenUnavailable = false, className = "", disabled, onClick, children, ...buttonProps }, ref) => {
|
|
4408
4528
|
const editor = useTiptapEditor(providedEditor);
|
|
4409
|
-
const { markInSchema, isDisabled, isActive, Icon, shortcutKey, formattedName } = useMarkState(editor, type, disabled);
|
|
4529
|
+
const { markInSchema, isDisabled, isActive, Icon: Icon2, shortcutKey, formattedName } = useMarkState(editor, type, disabled);
|
|
4410
4530
|
const handleClick = React16.useCallback(
|
|
4411
4531
|
(e) => {
|
|
4412
4532
|
onClick?.(e);
|
|
@@ -4428,7 +4548,7 @@ var MarkButton = React16.forwardRef(
|
|
|
4428
4548
|
return null;
|
|
4429
4549
|
}
|
|
4430
4550
|
return /* @__PURE__ */ jsx(
|
|
4431
|
-
|
|
4551
|
+
Button3,
|
|
4432
4552
|
{
|
|
4433
4553
|
type: "button",
|
|
4434
4554
|
className: className.trim(),
|
|
@@ -4446,7 +4566,7 @@ var MarkButton = React16.forwardRef(
|
|
|
4446
4566
|
...buttonProps,
|
|
4447
4567
|
ref,
|
|
4448
4568
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4449
|
-
/* @__PURE__ */ jsx(
|
|
4569
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
4450
4570
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
4451
4571
|
] })
|
|
4452
4572
|
}
|
|
@@ -4597,7 +4717,7 @@ function useNodeState(editor, type, disabled = false, hideWhenUnavailable = fals
|
|
|
4597
4717
|
}
|
|
4598
4718
|
return false;
|
|
4599
4719
|
}, [editor, type, isDisabled]);
|
|
4600
|
-
const
|
|
4720
|
+
const Icon2 = nodeIcons[type];
|
|
4601
4721
|
const shortcutKey = nodeShortcutKeys[type];
|
|
4602
4722
|
const label = nodeLabels[type];
|
|
4603
4723
|
return {
|
|
@@ -4607,7 +4727,7 @@ function useNodeState(editor, type, disabled = false, hideWhenUnavailable = fals
|
|
|
4607
4727
|
isActive,
|
|
4608
4728
|
shouldShow,
|
|
4609
4729
|
handleToggle,
|
|
4610
|
-
Icon,
|
|
4730
|
+
Icon: Icon2,
|
|
4611
4731
|
shortcutKey,
|
|
4612
4732
|
label
|
|
4613
4733
|
};
|
|
@@ -4615,7 +4735,7 @@ function useNodeState(editor, type, disabled = false, hideWhenUnavailable = fals
|
|
|
4615
4735
|
var NodeButton = React16.forwardRef(
|
|
4616
4736
|
({ editor: providedEditor, type, text, hideWhenUnavailable = false, className = "", disabled, onClick, children, ...buttonProps }, ref) => {
|
|
4617
4737
|
const editor = useTiptapEditor(providedEditor);
|
|
4618
|
-
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);
|
|
4619
4739
|
const handleClick = React16.useCallback(
|
|
4620
4740
|
(e) => {
|
|
4621
4741
|
onClick?.(e);
|
|
@@ -4629,7 +4749,7 @@ var NodeButton = React16.forwardRef(
|
|
|
4629
4749
|
return null;
|
|
4630
4750
|
}
|
|
4631
4751
|
return /* @__PURE__ */ jsx(
|
|
4632
|
-
|
|
4752
|
+
Button3,
|
|
4633
4753
|
{
|
|
4634
4754
|
type: "button",
|
|
4635
4755
|
className: className.trim(),
|
|
@@ -4647,7 +4767,7 @@ var NodeButton = React16.forwardRef(
|
|
|
4647
4767
|
...buttonProps,
|
|
4648
4768
|
ref,
|
|
4649
4769
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4650
|
-
/* @__PURE__ */ jsx(
|
|
4770
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
4651
4771
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
4652
4772
|
] })
|
|
4653
4773
|
}
|
|
@@ -4709,7 +4829,7 @@ var QuoteButton = React16.forwardRef(
|
|
|
4709
4829
|
);
|
|
4710
4830
|
if (!shouldShow || !editor || !editor.isEditable) return null;
|
|
4711
4831
|
return /* @__PURE__ */ jsx(
|
|
4712
|
-
|
|
4832
|
+
Button3,
|
|
4713
4833
|
{
|
|
4714
4834
|
type: "button",
|
|
4715
4835
|
className: className.trim(),
|
|
@@ -4927,7 +5047,7 @@ function useTextAlign(editor, align, disabled = false, hideWhenUnavailable = fal
|
|
|
4927
5047
|
return setTextAlign(editor, align);
|
|
4928
5048
|
}, [alignAvailable, editor, isDisabled, align]);
|
|
4929
5049
|
const shouldShow = React16.useMemo(() => shouldShowTextAlignButton(editor, canAlign, hideWhenUnavailable), [editor, canAlign, hideWhenUnavailable]);
|
|
4930
|
-
const
|
|
5050
|
+
const Icon2 = textAlignIcons[align];
|
|
4931
5051
|
const shortcutKey = textAlignShortcutKeys[align];
|
|
4932
5052
|
const label = textAlignLabels[align];
|
|
4933
5053
|
return {
|
|
@@ -4937,7 +5057,7 @@ function useTextAlign(editor, align, disabled = false, hideWhenUnavailable = fal
|
|
|
4937
5057
|
isActive,
|
|
4938
5058
|
handleAlignment,
|
|
4939
5059
|
shouldShow,
|
|
4940
|
-
Icon,
|
|
5060
|
+
Icon: Icon2,
|
|
4941
5061
|
shortcutKey,
|
|
4942
5062
|
label
|
|
4943
5063
|
};
|
|
@@ -4945,7 +5065,7 @@ function useTextAlign(editor, align, disabled = false, hideWhenUnavailable = fal
|
|
|
4945
5065
|
var TextAlignButton = React16.forwardRef(
|
|
4946
5066
|
({ editor: providedEditor, align, text, hideWhenUnavailable = false, className = "", disabled, onClick, children, ...buttonProps }, ref) => {
|
|
4947
5067
|
const editor = useTiptapEditor(providedEditor);
|
|
4948
|
-
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);
|
|
4949
5069
|
const handleClick = React16.useCallback(
|
|
4950
5070
|
(e) => {
|
|
4951
5071
|
onClick?.(e);
|
|
@@ -4959,7 +5079,7 @@ var TextAlignButton = React16.forwardRef(
|
|
|
4959
5079
|
return null;
|
|
4960
5080
|
}
|
|
4961
5081
|
return /* @__PURE__ */ jsx(
|
|
4962
|
-
|
|
5082
|
+
Button3,
|
|
4963
5083
|
{
|
|
4964
5084
|
type: "button",
|
|
4965
5085
|
className: className.trim(),
|
|
@@ -4977,7 +5097,7 @@ var TextAlignButton = React16.forwardRef(
|
|
|
4977
5097
|
...buttonProps,
|
|
4978
5098
|
ref,
|
|
4979
5099
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4980
|
-
/* @__PURE__ */ jsx(
|
|
5100
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
4981
5101
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
4982
5102
|
] })
|
|
4983
5103
|
}
|
|
@@ -5041,14 +5161,14 @@ function useHistoryAction(editor, action, disabled = false) {
|
|
|
5041
5161
|
if (!editor || isDisabled) return;
|
|
5042
5162
|
executeHistoryAction(editor, action);
|
|
5043
5163
|
}, [editor, action, isDisabled]);
|
|
5044
|
-
const
|
|
5164
|
+
const Icon2 = historyIcons[action];
|
|
5045
5165
|
const actionLabel = historyActionLabels[action];
|
|
5046
5166
|
const shortcutKey = historyShortcutKeys[action];
|
|
5047
5167
|
return {
|
|
5048
5168
|
canExecute,
|
|
5049
5169
|
isDisabled,
|
|
5050
5170
|
handleAction,
|
|
5051
|
-
Icon,
|
|
5171
|
+
Icon: Icon2,
|
|
5052
5172
|
actionLabel,
|
|
5053
5173
|
shortcutKey
|
|
5054
5174
|
};
|
|
@@ -5056,7 +5176,7 @@ function useHistoryAction(editor, action, disabled = false) {
|
|
|
5056
5176
|
var UndoRedoButton = React16.forwardRef(
|
|
5057
5177
|
({ editor: providedEditor, action, text, className = "", disabled, onClick, children, ...buttonProps }, ref) => {
|
|
5058
5178
|
const editor = useTiptapEditor(providedEditor);
|
|
5059
|
-
const { isDisabled, handleAction, Icon, actionLabel, shortcutKey } = useHistoryAction(editor, action, disabled);
|
|
5179
|
+
const { isDisabled, handleAction, Icon: Icon2, actionLabel, shortcutKey } = useHistoryAction(editor, action, disabled);
|
|
5060
5180
|
const handleClick = React16.useCallback(
|
|
5061
5181
|
(e) => {
|
|
5062
5182
|
onClick?.(e);
|
|
@@ -5070,7 +5190,7 @@ var UndoRedoButton = React16.forwardRef(
|
|
|
5070
5190
|
return null;
|
|
5071
5191
|
}
|
|
5072
5192
|
return /* @__PURE__ */ jsx(
|
|
5073
|
-
|
|
5193
|
+
Button3,
|
|
5074
5194
|
{
|
|
5075
5195
|
ref,
|
|
5076
5196
|
type: "button",
|
|
@@ -5086,7 +5206,7 @@ var UndoRedoButton = React16.forwardRef(
|
|
|
5086
5206
|
onClick: handleClick,
|
|
5087
5207
|
...buttonProps,
|
|
5088
5208
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5089
|
-
/* @__PURE__ */ jsx(
|
|
5209
|
+
/* @__PURE__ */ jsx(Icon2, { className: "tiptap-button-icon" }),
|
|
5090
5210
|
text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
|
|
5091
5211
|
] })
|
|
5092
5212
|
}
|
|
@@ -5512,7 +5632,7 @@ var MainToolbarContent = ({
|
|
|
5512
5632
|
] });
|
|
5513
5633
|
};
|
|
5514
5634
|
var MobileToolbarContent = ({ type, onBack }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5515
|
-
/* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxs(
|
|
5635
|
+
/* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxs(Button3, { "data-style": "ghost", onClick: onBack, children: [
|
|
5516
5636
|
/* @__PURE__ */ jsx(ArrowLeftIcon, { className: "tiptap-button-icon" }),
|
|
5517
5637
|
type === "highlighter" ? /* @__PURE__ */ jsx(HighlighterIcon, { className: "tiptap-button-icon" }) : /* @__PURE__ */ jsx(LinkIcon, { className: "tiptap-button-icon" })
|
|
5518
5638
|
] }) }),
|
|
@@ -5711,7 +5831,7 @@ var MarkdownEditor_default = ({
|
|
|
5711
5831
|
const downloadFile2 = () => {
|
|
5712
5832
|
onDownloadFile?.(getMarkdown(), "docx");
|
|
5713
5833
|
};
|
|
5714
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
5834
|
+
return /* @__PURE__ */ jsx("div", { className: classNames("height-full", "editor-parent"), children: /* @__PURE__ */ jsxs(EditorContext.Provider, { value: { editor }, children: [
|
|
5715
5835
|
showToolbar && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5716
5836
|
/* @__PURE__ */ jsxs(Flex, { justify: "end", align: "center", children: [
|
|
5717
5837
|
NsToolBar({ isBubble: false }),
|
|
@@ -5727,7 +5847,7 @@ var MarkdownEditor_default = ({
|
|
|
5727
5847
|
{
|
|
5728
5848
|
editor,
|
|
5729
5849
|
role: "presentation",
|
|
5730
|
-
className:
|
|
5850
|
+
className: classNames("simple-editor-content ns-markdown", { "no-toolbar": !showToolbar })
|
|
5731
5851
|
}
|
|
5732
5852
|
) })
|
|
5733
5853
|
] }) });
|
|
@@ -5768,10 +5888,70 @@ function propsMerge(control, props) {
|
|
|
5768
5888
|
}
|
|
5769
5889
|
return null;
|
|
5770
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
|
+
};
|
|
5771
5951
|
var UserAvatar_default = ({ size, avatarSrc, userName }) => {
|
|
5772
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() });
|
|
5773
5953
|
};
|
|
5774
5954
|
|
|
5775
|
-
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, 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, useSyncInput_default as useSyncInput, useThrottle_default as useThrottle, useWebSocket_default as useWebSocket };
|
|
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 };
|
|
5776
5956
|
//# sourceMappingURL=index.esm.js.map
|
|
5777
5957
|
//# sourceMappingURL=index.esm.js.map
|