@zero-library/common 3.0.0 → 3.0.2

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.esm.js CHANGED
@@ -1,13 +1,14 @@
1
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
- import { MessageOutlined, BookOutlined, EditOutlined, DeleteOutlined, CloseOutlined, MinusCircleOutlined, PlusCircleOutlined, RedoOutlined, FileUnknownOutlined, FileZipOutlined, FileMarkdownOutlined, FileGifOutlined, FileImageOutlined, FileJpgOutlined, NotificationOutlined, VideoCameraOutlined, FilePptOutlined, FileExcelOutlined, FileWordOutlined, FilePdfOutlined, FileTextOutlined, ColumnWidthOutlined } from '@ant-design/icons';
3
- import { Spin, Input, Typography, Tooltip as Tooltip$1, Button, Flex, Form, Card, List, Space, Popconfirm, Empty, Modal, message, Alert, Skeleton, Result, Splitter, Image as Image$1, Drawer, Avatar, notification } from 'antd';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { MessageOutlined, BookOutlined, EditOutlined, DeleteOutlined, CloseOutlined, MinusCircleOutlined, PlusCircleOutlined, RedoOutlined, FileUnknownOutlined, FileZipOutlined, FileMarkdownOutlined, FileGifOutlined, FileImageOutlined, FileJpgOutlined, NotificationOutlined, VideoCameraOutlined, FilePptOutlined, FileExcelOutlined, FileWordOutlined, FilePdfOutlined, FileTextOutlined, ColumnWidthOutlined, LeftOutlined, RightOutlined, MinusOutlined, PlusOutlined } from '@ant-design/icons';
3
+ import { Typography, Spin, Input, Tooltip as Tooltip$1, Button, Flex, Form, Card, List, Space, Popconfirm, Empty, Modal, message, Alert, Skeleton, Result, Splitter, Image as Image$1, Drawer, Avatar, notification } from 'antd';
4
4
  import classNames2 from 'classnames';
5
5
  import { renderAsync } from 'docx-preview';
6
- import * as React from 'react';
7
- import React__default, { forwardRef, useState, useMemo, useEffect, useRef, useCallback, createContext, isValidElement, version, cloneElement, memo, useImperativeHandle, useContext, Fragment as Fragment$1, lazy, Suspense } from 'react';
6
+ import * as React3 from 'react';
7
+ import React3__default, { useRef, useState, useEffect, forwardRef, useMemo, useCallback, createContext, isValidElement, version, cloneElement, memo, useImperativeHandle, useContext, Fragment as Fragment$1, lazy, Suspense } from 'react';
8
8
  import AES from 'crypto-js/aes';
9
9
  import encUtf8 from 'crypto-js/enc-utf8';
10
10
  import { convert } from 'html-to-text';
11
+ import { jsonrepair } from 'jsonrepair';
11
12
  import MarkdownIt from 'markdown-it';
12
13
  import markdownItDefList from 'markdown-it-deflist';
13
14
  import { full } from 'markdown-it-emoji';
@@ -20,7 +21,6 @@ import relativeTime from 'dayjs/plugin/relativeTime';
20
21
  import axios from 'axios';
21
22
  import markdownItKatex from '@traptitech/markdown-it-katex';
22
23
  import parse from 'html-react-parser';
23
- import { jsonrepair } from 'jsonrepair';
24
24
  import 'katex/dist/katex.min.css';
25
25
  import { useVirtualizer } from '@tanstack/react-virtual';
26
26
  import { Worker, Viewer, PasswordStatus } from '@react-pdf-viewer/core';
@@ -32,6 +32,9 @@ import zh_CN from '@react-pdf-viewer/locales/lib/zh_CN.json';
32
32
  import '@react-pdf-viewer/page-navigation/lib/styles/index.css';
33
33
  import '@react-pdf-viewer/thumbnail/lib/styles/index.css';
34
34
  import '@react-pdf-viewer/zoom/lib/styles/index.css';
35
+ import Editor, { loader } from '@monaco-editor/react';
36
+ import * as monaco from 'monaco-editor';
37
+ import * as pdfjsLib from 'pdfjs-dist-v5/legacy/build/pdf.mjs';
35
38
  import microApp from '@micro-zoe/micro-app';
36
39
  import jsxCustomEvent from '@micro-zoe/micro-app/polyfill/jsx-custom-event';
37
40
  import { mergeAttributes, useEditor, EditorContext, EditorContent, isNodeSelection, posToDOMRect, useCurrentEditor, useEditorState, isTextSelection } from '@tiptap/react';
@@ -82,7 +85,14 @@ var styles_module_default = {
82
85
  nsPreviewAudio: "styles_module_nsPreviewAudio",
83
86
  nsPreviewDocx: "styles_module_nsPreviewDocx",
84
87
  docxToolbar: "styles_module_docxToolbar",
85
- docxContent: "styles_module_docxContent"
88
+ docxContent: "styles_module_docxContent",
89
+ stateBody: "styles_module_stateBody",
90
+ pdfContainer: "styles_module_pdfContainer",
91
+ floatingToolbar: "styles_module_floatingToolbar",
92
+ divider: "styles_module_divider",
93
+ pdfBody: "styles_module_pdfBody",
94
+ pdfDocument: "styles_module_pdfDocument",
95
+ pdfPage: "styles_module_pdfPage"
86
96
  };
87
97
  var AudioPlayer_default = ({ fileUrl }) => {
88
98
  return /* @__PURE__ */ jsxs("audio", { controls: true, className: styles_module_default.nsPreviewAudio, children: [
@@ -870,6 +880,21 @@ var findTreeNodesByIds = (tree, ids, formatFn, options = {}) => {
870
880
  dfs(tree);
871
881
  return result;
872
882
  };
883
+ function safeParseJson(raw, options = {}) {
884
+ const shouldRepair = options.repair ?? false;
885
+ const fallbackMode = options.fallback ?? "raw";
886
+ const getFallbackValue = () => fallbackMode === "raw" ? raw : null;
887
+ try {
888
+ return JSON.parse(raw);
889
+ } catch {
890
+ if (!shouldRepair) return getFallbackValue();
891
+ }
892
+ try {
893
+ return JSON.parse(jsonrepair(raw));
894
+ } catch {
895
+ return getFallbackValue();
896
+ }
897
+ }
873
898
  dayjs.extend(relativeTime);
874
899
  var DEFAULT_DATE_TIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
875
900
  var DEFAULT_DATE_FORMAT = "YYYY-MM-DD";
@@ -1351,15 +1376,15 @@ var baseComponentMap = {
1351
1376
  };
1352
1377
  var lazyCache = /* @__PURE__ */ new Map();
1353
1378
  var LazyComponent_default = ({ type, customComponents, unknownContent, ...rest }) => {
1354
- const loader = customComponents?.[type] || baseComponentMap[type];
1379
+ const loader2 = customComponents?.[type] || baseComponentMap[type];
1355
1380
  const LazyComponent = useMemo(() => {
1356
- if (!loader) return null;
1381
+ if (!loader2) return null;
1357
1382
  const cached = lazyCache.get(type);
1358
1383
  if (cached) return cached;
1359
- const component = lazy(loader);
1384
+ const component = lazy(loader2);
1360
1385
  lazyCache.set(type, component);
1361
1386
  return component;
1362
- }, [loader]);
1387
+ }, [loader2]);
1363
1388
  if (!LazyComponent) return unknownContent || /* @__PURE__ */ jsx(Alert, { title: `\u672A\u77E5\u7C7B\u578B\uFF1A${type}`, type: "warning" });
1364
1389
  return /* @__PURE__ */ jsx(
1365
1390
  Suspense,
@@ -1375,19 +1400,6 @@ md.renderer.rules.link_open = function(tokens, idx, options, env, self) {
1375
1400
  token.attrPush(["target", "_blank"]);
1376
1401
  return self.renderToken(tokens, idx, options);
1377
1402
  };
1378
- function parseData(raw) {
1379
- let obj = {};
1380
- try {
1381
- obj = JSON.parse(raw);
1382
- } catch {
1383
- try {
1384
- obj = JSON.parse(jsonrepair(raw));
1385
- } catch {
1386
- obj = { _raw: raw };
1387
- }
1388
- }
1389
- return obj;
1390
- }
1391
1403
  function highlightKeywords(html, keywords) {
1392
1404
  const escaped = keywords.map((k) => k.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
1393
1405
  const regex = new RegExp(`(${escaped.join("|")})`, "gi");
@@ -1479,7 +1491,7 @@ var RenderMarkdown_default = ({ content = "", searchValue, customComponents, ...
1479
1491
  let data = {};
1480
1492
  if (/^__ALERT_DATA_\d+__$/.test(dataAttr)) {
1481
1493
  const raw = placeholders.get(dataAttr) ?? "";
1482
- data = parseData(raw);
1494
+ data = safeParseJson(raw, { repair: true, fallback: "null" }) ?? { _raw: raw };
1483
1495
  }
1484
1496
  return /* @__PURE__ */ jsx(LazyComponent_default, { customComponents, type, data, loading, ...rest }, `${type}${lazyIndex}`);
1485
1497
  }
@@ -2620,6 +2632,533 @@ var FilePreview_default = ({ suffix, fileUrl, pdfParams, password, searchValue,
2620
2632
  }, [suffix, fileUrl, pdfParams]);
2621
2633
  return /* @__PURE__ */ jsx(Flex, { justify: "center", align: "center", className: "height-full", children: Preview });
2622
2634
  };
2635
+ loader.config({ monaco });
2636
+ var getLanguage = (suffix) => {
2637
+ switch (suffix.toLowerCase()) {
2638
+ case "ts":
2639
+ case "tsx":
2640
+ return "typescript";
2641
+ case "js":
2642
+ case "jsx":
2643
+ return "javascript";
2644
+ case "json":
2645
+ return "json";
2646
+ case "css":
2647
+ return "css";
2648
+ case "less":
2649
+ return "less";
2650
+ case "scss":
2651
+ return "scss";
2652
+ case "html":
2653
+ case "htm":
2654
+ return "html";
2655
+ case "xml":
2656
+ return "xml";
2657
+ case "py":
2658
+ return "python";
2659
+ case "java":
2660
+ return "java";
2661
+ case "go":
2662
+ return "go";
2663
+ case "yaml":
2664
+ case "yml":
2665
+ return "yaml";
2666
+ case "md":
2667
+ case "markdown":
2668
+ return "markdown";
2669
+ default:
2670
+ return "plaintext";
2671
+ }
2672
+ };
2673
+ var CodePreview = ({ fileUrl, suffix }) => {
2674
+ const [content, setContent] = useState("");
2675
+ const [error, setError] = useState("");
2676
+ const [loading, setLoading] = useState(false);
2677
+ const fetchContent = async (signal) => {
2678
+ const headers = {
2679
+ "Content-Type": "application/json"
2680
+ };
2681
+ const res = await fetch(fileUrl, { headers, signal });
2682
+ if (res.status !== 200) {
2683
+ throw new Error(`\u8BF7\u6C42\u5931\u8D25\uFF0C\u72B6\u6001\u7801: ${res.status}`);
2684
+ }
2685
+ const buffer = await res.arrayBuffer();
2686
+ let text = "";
2687
+ try {
2688
+ const decoder = new TextDecoder("utf-8", { fatal: true });
2689
+ text = decoder.decode(buffer);
2690
+ } catch (e) {
2691
+ const gbkDecoder = new TextDecoder("gbk");
2692
+ text = gbkDecoder.decode(buffer);
2693
+ }
2694
+ setContent(text);
2695
+ };
2696
+ useEffect(() => {
2697
+ const controller = new AbortController();
2698
+ const init = async () => {
2699
+ setContent("");
2700
+ setError("");
2701
+ if (fileUrl) {
2702
+ try {
2703
+ setLoading(true);
2704
+ await fetchContent(controller.signal);
2705
+ } catch (error2) {
2706
+ if (!controller.signal.aborted) {
2707
+ setError("\u52A0\u8F7D\u6587\u4EF6\u5931\u8D25");
2708
+ }
2709
+ } finally {
2710
+ if (!controller.signal.aborted) {
2711
+ setLoading(false);
2712
+ }
2713
+ }
2714
+ }
2715
+ };
2716
+ init();
2717
+ return () => {
2718
+ controller.abort();
2719
+ };
2720
+ }, [fileUrl]);
2721
+ if (error) {
2722
+ return /* @__PURE__ */ jsx(Result, { status: "error", title: error });
2723
+ }
2724
+ return /* @__PURE__ */ jsx("div", { style: { height: "100%", width: "100%", position: "relative" }, children: loading ? /* @__PURE__ */ jsx("div", { style: { position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)" }, children: /* @__PURE__ */ jsx(Spin, {}) }) : /* @__PURE__ */ jsx(
2725
+ Editor,
2726
+ {
2727
+ height: "100%",
2728
+ defaultLanguage: getLanguage(suffix || ""),
2729
+ value: content,
2730
+ options: {
2731
+ readOnly: true,
2732
+ minimap: { enabled: false },
2733
+ lineNumbers: "on",
2734
+ wordWrap: "on",
2735
+ fontSize: 14,
2736
+ unicodeHighlight: {
2737
+ invisibleCharacters: false,
2738
+ ambiguousCharacters: false
2739
+ }
2740
+ }
2741
+ }
2742
+ ) });
2743
+ };
2744
+ var CodePreview_default = CodePreview;
2745
+ var { Text } = Typography;
2746
+ pdfjsLib.GlobalWorkerOptions.workerSrc = new URL("./pdf.worker.min.mjs", import.meta.url).toString();
2747
+ var MIN_SCALE = 0.6;
2748
+ var MAX_SCALE = 1.5;
2749
+ var SCALE_STEP = 0.1;
2750
+ var PdfPage = React3__default.memo(({ pdf, pageNumber, scale, scrollContainerRef, defaultSize }) => {
2751
+ const canvasRef = useRef(null);
2752
+ const containerRef = useRef(null);
2753
+ const [loading, setLoading] = useState(false);
2754
+ const renderTaskRef = useRef(null);
2755
+ const [dimensions, setDimensions] = useState(null);
2756
+ const [shouldRender2, setShouldRender] = useState(false);
2757
+ useEffect(() => {
2758
+ const el = containerRef.current;
2759
+ if (!el) return;
2760
+ const renderObserver = new IntersectionObserver(
2761
+ ([entry]) => {
2762
+ setShouldRender(entry.isIntersecting);
2763
+ },
2764
+ {
2765
+ root: scrollContainerRef.current,
2766
+ rootMargin: "100% 0px"
2767
+ }
2768
+ );
2769
+ renderObserver.observe(el);
2770
+ return () => {
2771
+ renderObserver.disconnect();
2772
+ };
2773
+ }, [scrollContainerRef]);
2774
+ useEffect(() => {
2775
+ setDimensions(null);
2776
+ }, [scale]);
2777
+ useEffect(() => {
2778
+ if (!shouldRender2 || !pdf || !canvasRef.current) return;
2779
+ const render = async () => {
2780
+ if (renderTaskRef.current) {
2781
+ renderTaskRef.current.cancel();
2782
+ }
2783
+ try {
2784
+ setLoading(true);
2785
+ const page = await pdf.getPage(pageNumber);
2786
+ const dpr = window.devicePixelRatio || 1;
2787
+ const viewport = page.getViewport({ scale });
2788
+ const nextDimensions = { width: viewport.width, height: viewport.height };
2789
+ setDimensions(nextDimensions);
2790
+ const canvas = canvasRef.current;
2791
+ if (!canvas) return;
2792
+ const ctx = canvas.getContext("2d");
2793
+ if (!ctx) return;
2794
+ canvas.width = Math.floor(viewport.width * dpr);
2795
+ canvas.height = Math.floor(viewport.height * dpr);
2796
+ canvas.style.width = `${viewport.width}px`;
2797
+ canvas.style.height = `${viewport.height}px`;
2798
+ const renderTask = page.render({
2799
+ canvasContext: ctx,
2800
+ viewport,
2801
+ transform: [dpr, 0, 0, dpr, 0, 0]
2802
+ });
2803
+ renderTaskRef.current = renderTask;
2804
+ await renderTask.promise;
2805
+ setLoading(false);
2806
+ } catch (error) {
2807
+ if (error.name !== "RenderingCancelledException") {
2808
+ console.error(`Error rendering page ${pageNumber}:`, error);
2809
+ }
2810
+ setLoading(false);
2811
+ }
2812
+ };
2813
+ render();
2814
+ return () => {
2815
+ if (renderTaskRef.current) {
2816
+ renderTaskRef.current.cancel();
2817
+ }
2818
+ };
2819
+ }, [shouldRender2, pdf, pageNumber, scale]);
2820
+ const width = dimensions?.width || defaultSize?.width || "100%";
2821
+ const height = dimensions?.height || defaultSize?.height || 800;
2822
+ return /* @__PURE__ */ jsx(
2823
+ "div",
2824
+ {
2825
+ ref: containerRef,
2826
+ className: styles_module_default.pdfPage,
2827
+ id: `pdf-page-${pageNumber}`,
2828
+ style: {
2829
+ width,
2830
+ height,
2831
+ position: "relative"
2832
+ },
2833
+ children: shouldRender2 && /* @__PURE__ */ jsxs(Fragment, { children: [
2834
+ /* @__PURE__ */ jsx("canvas", { ref: canvasRef, style: { display: "block" } }),
2835
+ loading && /* @__PURE__ */ jsx(
2836
+ "div",
2837
+ {
2838
+ style: {
2839
+ position: "absolute",
2840
+ top: 0,
2841
+ left: 0,
2842
+ right: 0,
2843
+ bottom: 0,
2844
+ display: "flex",
2845
+ alignItems: "center",
2846
+ justifyContent: "center",
2847
+ background: "rgba(255,255,255,0.8)"
2848
+ },
2849
+ children: /* @__PURE__ */ jsx(Spin, {})
2850
+ }
2851
+ )
2852
+ ] })
2853
+ }
2854
+ );
2855
+ });
2856
+ var DocumentPreview = ({ fileUrl, previewEnabled = true }) => {
2857
+ const [loading, setLoading] = useState(false);
2858
+ const [pdf, setPdf] = useState(null);
2859
+ const [numPages, setNumPages] = useState(0);
2860
+ const [pageNumber, setPageNumber] = useState(1);
2861
+ const [scale, setScale] = useState(1);
2862
+ const [error, setError] = useState(null);
2863
+ const containerRef = useRef(null);
2864
+ const pdfLoadingTaskRef = useRef(null);
2865
+ const [defaultSize, setDefaultSize] = useState(void 0);
2866
+ useEffect(() => {
2867
+ let aborted = false;
2868
+ const load = async () => {
2869
+ if (pdfLoadingTaskRef.current) {
2870
+ try {
2871
+ pdfLoadingTaskRef.current.destroy();
2872
+ } catch (e) {
2873
+ }
2874
+ pdfLoadingTaskRef.current = null;
2875
+ }
2876
+ setError(null);
2877
+ setPdf(null);
2878
+ setNumPages(0);
2879
+ setPageNumber(1);
2880
+ setDefaultSize(void 0);
2881
+ if (!previewEnabled || !fileUrl) {
2882
+ return;
2883
+ }
2884
+ setLoading(true);
2885
+ try {
2886
+ const loadingTask = pdfjsLib.getDocument({
2887
+ url: fileUrl,
2888
+ disableFontFace: true,
2889
+ // 强制将所有字体转换为路径绘制,解决浏览器字体加载拦截/失败导致的文字空白问题
2890
+ disableAutoFetch: true,
2891
+ disableStream: true,
2892
+ rangeChunkSize: 1024 * 512
2893
+ });
2894
+ pdfLoadingTaskRef.current = loadingTask;
2895
+ const doc = await loadingTask.promise;
2896
+ if (aborted) return;
2897
+ setPdf(doc);
2898
+ setNumPages(doc.numPages);
2899
+ setPageNumber(1);
2900
+ if (containerRef.current) {
2901
+ containerRef.current.scrollTop = 0;
2902
+ }
2903
+ try {
2904
+ const page1 = await doc.getPage(1);
2905
+ const viewport = page1.getViewport({ scale: 1 });
2906
+ if (!aborted) {
2907
+ setDefaultSize({ width: viewport.width, height: viewport.height });
2908
+ }
2909
+ } catch (e) {
2910
+ console.warn("Failed to get page 1 size", e);
2911
+ }
2912
+ } catch (e) {
2913
+ if (aborted) return;
2914
+ const message3 = e?.message;
2915
+ if (typeof message3 === "string" && message3.includes("cancelled")) ; else if (typeof message3 === "string" && message3.includes("(903)")) {
2916
+ setError("\u9884\u89C8\u6587\u4EF6\u6B63\u5728\u751F\u6210\u4E2D...");
2917
+ } else {
2918
+ setError(message3 || "PDF \u52A0\u8F7D\u5931\u8D25");
2919
+ }
2920
+ } finally {
2921
+ if (!aborted) {
2922
+ setLoading(false);
2923
+ }
2924
+ }
2925
+ };
2926
+ load();
2927
+ return () => {
2928
+ aborted = true;
2929
+ if (pdfLoadingTaskRef.current) {
2930
+ try {
2931
+ pdfLoadingTaskRef.current.destroy();
2932
+ } catch (e) {
2933
+ }
2934
+ pdfLoadingTaskRef.current = null;
2935
+ }
2936
+ };
2937
+ }, [fileUrl, previewEnabled]);
2938
+ useEffect(() => {
2939
+ const container = containerRef.current;
2940
+ if (!container || numPages === 0) return;
2941
+ let rafId = 0;
2942
+ const onScroll = () => {
2943
+ if (rafId) return;
2944
+ rafId = window.requestAnimationFrame(() => {
2945
+ rafId = 0;
2946
+ const { scrollTop, clientHeight, scrollHeight } = container;
2947
+ if (scrollTop <= 10) {
2948
+ setPageNumber(1);
2949
+ return;
2950
+ }
2951
+ if (scrollTop + clientHeight >= scrollHeight - 10) {
2952
+ setPageNumber(numPages);
2953
+ return;
2954
+ }
2955
+ const containerRect = container.getBoundingClientRect();
2956
+ const centerY = containerRect.top + clientHeight / 2;
2957
+ let closestPage = 1;
2958
+ let closestDistance = Number.POSITIVE_INFINITY;
2959
+ for (let i = 1; i <= numPages; i++) {
2960
+ const el = window.document.getElementById(`pdf-page-${i}`);
2961
+ if (!el) continue;
2962
+ const rect = el.getBoundingClientRect();
2963
+ const pageCenter = rect.top + rect.height / 2;
2964
+ const distance = Math.abs(pageCenter - centerY);
2965
+ if (distance < closestDistance) {
2966
+ closestDistance = distance;
2967
+ closestPage = i;
2968
+ }
2969
+ }
2970
+ setPageNumber(closestPage);
2971
+ });
2972
+ };
2973
+ container.addEventListener("scroll", onScroll, { passive: true });
2974
+ return () => {
2975
+ if (rafId) window.cancelAnimationFrame(rafId);
2976
+ container.removeEventListener("scroll", onScroll);
2977
+ };
2978
+ }, [numPages]);
2979
+ const scrollToPage = (pageNum) => {
2980
+ const container = containerRef.current;
2981
+ const el = window.document.getElementById(`pdf-page-${pageNum}`);
2982
+ if (container && el) {
2983
+ el.scrollIntoView({ behavior: "smooth" });
2984
+ setPageNumber(pageNum);
2985
+ }
2986
+ };
2987
+ const onPrev = () => {
2988
+ scrollToPage(Math.max(1, pageNumber - 1));
2989
+ };
2990
+ const onNext = () => {
2991
+ scrollToPage(Math.min(numPages, pageNumber + 1));
2992
+ };
2993
+ const onZoomOut = () => {
2994
+ setScale((s) => Math.max(MIN_SCALE, parseFloat((s - SCALE_STEP).toFixed(2))));
2995
+ };
2996
+ const onZoomIn = () => {
2997
+ setScale((s) => Math.min(MAX_SCALE, parseFloat((s + SCALE_STEP).toFixed(2))));
2998
+ };
2999
+ const currentDefaultSize = useMemo(() => {
3000
+ if (!defaultSize) return void 0;
3001
+ return {
3002
+ width: defaultSize.width * scale,
3003
+ height: defaultSize.height * scale
3004
+ };
3005
+ }, [defaultSize, scale]);
3006
+ const toolbar = /* @__PURE__ */ jsxs("div", { className: styles_module_default.floatingToolbar, children: [
3007
+ /* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(LeftOutlined, {}), size: "small", onClick: onPrev, disabled: pageNumber <= 1 }),
3008
+ /* @__PURE__ */ jsxs(Text, { children: [
3009
+ Math.min(pageNumber, numPages),
3010
+ " / ",
3011
+ numPages || 0
3012
+ ] }),
3013
+ /* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(RightOutlined, {}), size: "small", onClick: onNext, disabled: pageNumber >= numPages || numPages === 0 }),
3014
+ /* @__PURE__ */ jsx("div", { className: styles_module_default.divider }),
3015
+ /* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(MinusOutlined, {}), size: "small", onClick: onZoomOut, disabled: scale <= MIN_SCALE }),
3016
+ /* @__PURE__ */ jsxs(Text, { children: [
3017
+ Math.round(scale * 100),
3018
+ "%"
3019
+ ] }),
3020
+ /* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(PlusOutlined, {}), size: "small", onClick: onZoomIn, disabled: scale >= MAX_SCALE })
3021
+ ] });
3022
+ if (!previewEnabled) {
3023
+ return /* @__PURE__ */ jsx(Flex, { className: styles_module_default.stateBody, children: "\u5173\u95ED\u9884\u89C8" });
3024
+ }
3025
+ return /* @__PURE__ */ jsxs("div", { className: styles_module_default.pdfContainer, children: [
3026
+ toolbar,
3027
+ /* @__PURE__ */ jsx("div", { className: styles_module_default.pdfBody, ref: containerRef, children: /* @__PURE__ */ jsx("div", { className: classNames2(styles_module_default.pdfDocument, "width-full"), children: loading && !pdf ? /* @__PURE__ */ jsx(Spin, { spinning: true }) : error ? /* @__PURE__ */ jsx(Flex, { className: styles_module_default.stateBody, children: error }) : Array.from({ length: numPages }, (_, i) => /* @__PURE__ */ jsx(PdfPage, { pdf, pageNumber: i + 1, scale, scrollContainerRef: containerRef, defaultSize: currentDefaultSize }, i + 1)) }) })
3028
+ ] });
3029
+ };
3030
+ var DocumentPreview_default = DocumentPreview;
3031
+ var HtmlPreview = ({ fileUrl }) => {
3032
+ const [content, setContent] = useState("");
3033
+ const [error, setError] = useState("");
3034
+ const [loading, setLoading] = useState(false);
3035
+ const fetchHtml = async (signal) => {
3036
+ const headers = {
3037
+ "Content-Type": "application/json"
3038
+ };
3039
+ const res = await fetch(fileUrl, {
3040
+ headers,
3041
+ signal
3042
+ });
3043
+ if (res.status !== 200) {
3044
+ throw new Error(`\u8BF7\u6C42\u5931\u8D25\uFF0C\u72B6\u6001\u7801: ${res.status}`);
3045
+ }
3046
+ const buffer = await res.arrayBuffer();
3047
+ let htmlText = "";
3048
+ try {
3049
+ const decoder = new TextDecoder("utf-8", { fatal: true });
3050
+ htmlText = decoder.decode(buffer);
3051
+ } catch (e) {
3052
+ const gbkDecoder = new TextDecoder("gbk");
3053
+ htmlText = gbkDecoder.decode(buffer);
3054
+ }
3055
+ if (!htmlText) {
3056
+ throw new Error("\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A");
3057
+ }
3058
+ setContent(htmlText);
3059
+ };
3060
+ useEffect(() => {
3061
+ const controller = new AbortController();
3062
+ const init = async () => {
3063
+ setContent("");
3064
+ setError("");
3065
+ if (fileUrl) {
3066
+ try {
3067
+ setLoading(true);
3068
+ await fetchHtml(controller.signal);
3069
+ } catch (error2) {
3070
+ if (!controller.signal.aborted) {
3071
+ setError("\u52A0\u8F7D\u6216\u89E3\u6790 HTML \u5931\u8D25");
3072
+ }
3073
+ } finally {
3074
+ if (!controller.signal.aborted) {
3075
+ setLoading(false);
3076
+ }
3077
+ }
3078
+ }
3079
+ };
3080
+ init();
3081
+ return () => {
3082
+ controller.abort();
3083
+ };
3084
+ }, [fileUrl]);
3085
+ return error ? /* @__PURE__ */ jsx(Result, { status: "error", title: error }) : /* @__PURE__ */ jsx("div", { style: { height: "100%", width: "100%", position: "relative" }, children: loading ? /* @__PURE__ */ jsx("div", { style: { position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)" }, children: /* @__PURE__ */ jsx(Spin, {}) }) : content ? /* @__PURE__ */ jsx(
3086
+ "iframe",
3087
+ {
3088
+ srcDoc: content,
3089
+ style: { width: "100%", height: "100%", border: "none" },
3090
+ sandbox: "allow-scripts allow-same-origin allow-popups allow-forms",
3091
+ title: "HTML Preview"
3092
+ }
3093
+ ) : null });
3094
+ };
3095
+ var HtmlPreview_default = HtmlPreview;
3096
+ var luyaFilePreview_default = ({ suffix, fileUrl, emptyProps, fileName }) => {
3097
+ const extension = suffix ? suffix : getFileSuffixName(fileName || "");
3098
+ const Preview = useMemo(() => {
3099
+ if (!fileUrl) {
3100
+ return /* @__PURE__ */ jsx(Empty, { ...emptyProps });
3101
+ }
3102
+ switch (extension?.toUpperCase()) {
3103
+ case "PNG":
3104
+ case "JPG":
3105
+ case "JPEG":
3106
+ case "GIF":
3107
+ case "BMP":
3108
+ case "WEBP":
3109
+ case "SVG":
3110
+ case "ICO":
3111
+ case "TIFF":
3112
+ return /* @__PURE__ */ jsx(Image$1, { classNames: { root: styles_module_default.nsPreviewImage }, src: fileUrl, alt: "\u9884\u89C8\u56FE\u7247" });
3113
+ case "DOC":
3114
+ case "DOCX":
3115
+ case "PDF":
3116
+ case "XLS":
3117
+ case "XLSX":
3118
+ case "PPT":
3119
+ case "PPTX":
3120
+ case "CSV":
3121
+ return /* @__PURE__ */ jsx(DocumentPreview_default, { fileUrl });
3122
+ case "MP4":
3123
+ return /* @__PURE__ */ jsx(VideoPlayer_default, { fileUrl });
3124
+ case "MP3":
3125
+ case "WAV":
3126
+ case "M4A":
3127
+ case "AAC":
3128
+ case "ACC":
3129
+ return /* @__PURE__ */ jsx(AudioPlayer_default, { fileUrl });
3130
+ case "HTML":
3131
+ case "HTM":
3132
+ return /* @__PURE__ */ jsx(HtmlPreview_default, { fileUrl });
3133
+ case "MD":
3134
+ case "MARKDOWN":
3135
+ return /* @__PURE__ */ jsx(MarkdownPreview_default, { fileUrl });
3136
+ case "TS":
3137
+ case "TSX":
3138
+ case "JS":
3139
+ case "JSX":
3140
+ case "JSON":
3141
+ case "CSS":
3142
+ case "LESS":
3143
+ case "SCSS":
3144
+ case "XML":
3145
+ case "PY":
3146
+ case "JAVA":
3147
+ case "GO":
3148
+ case "YAML":
3149
+ case "YML":
3150
+ case "ENV":
3151
+ case "CONF":
3152
+ case "CONFIG":
3153
+ return /* @__PURE__ */ jsx(CodePreview_default, { fileUrl, suffix: extension });
3154
+ case "TXT":
3155
+ return /* @__PURE__ */ jsx(MarkdownPreview_default, { fileUrl, asPlainText: true });
3156
+ default:
3157
+ return /* @__PURE__ */ jsx(Result, { subTitle: `\u6682\u4E0D\u652F\u6301 ${suffix || ""} \u6587\u4EF6\u7684\u9884\u89C8` });
3158
+ }
3159
+ }, [suffix, fileUrl, fileName]);
3160
+ return /* @__PURE__ */ jsx(Flex, { justify: "center", align: "center", className: "height-full", children: Preview });
3161
+ };
2623
3162
  var FilePreviewDrawer_default = ({ open, title = "\u6587\u4EF6\u9884\u89C8", onClose, ...props }) => {
2624
3163
  return /* @__PURE__ */ jsx(
2625
3164
  Drawer,
@@ -3467,7 +4006,7 @@ var styles_module_default6 = {
3467
4006
  annotationItemSelected: "styles_module_annotationItemSelected"
3468
4007
  };
3469
4008
  var { TextArea: TextArea2 } = Input;
3470
- var { Text } = Typography;
4009
+ var { Text: Text2 } = Typography;
3471
4010
  var AnnotationSidebar_default = ({
3472
4011
  disabled,
3473
4012
  annotations,
@@ -3540,8 +4079,8 @@ var AnnotationSidebar_default = ({
3540
4079
  },
3541
4080
  children: /* @__PURE__ */ jsxs(Flex, { vertical: true, gap: 8, flex: 1, children: [
3542
4081
  /* @__PURE__ */ jsxs(Flex, { gap: 8, justify: "space-between", className: styles_module_default6.annotationMeta, children: [
3543
- /* @__PURE__ */ jsx(Text, { strong: true, type: "secondary", children: annotation["user-name"] }),
3544
- /* @__PURE__ */ jsx(Text, { type: "secondary", children: formatDate(annotation["update-time"]) })
4082
+ /* @__PURE__ */ jsx(Text2, { strong: true, type: "secondary", children: annotation["user-name"] }),
4083
+ /* @__PURE__ */ jsx(Text2, { type: "secondary", children: formatDate(annotation["update-time"]) })
3545
4084
  ] }),
3546
4085
  !disabled && (editingId === annotation[ANNOTATION_ATTRS[0]] ? /* @__PURE__ */ jsxs(Flex, { vertical: true, children: [
3547
4086
  /* @__PURE__ */ jsx(Form, { form, children: /* @__PURE__ */ jsx(
@@ -3560,7 +4099,7 @@ var AnnotationSidebar_default = ({
3560
4099
  /* @__PURE__ */ jsx(Button, { size: "small", onClick: handleCancelEdit, children: "\u53D6\u6D88" })
3561
4100
  ] })
3562
4101
  ] }) : /* @__PURE__ */ jsxs(Flex, { gap: 8, vertical: true, children: [
3563
- /* @__PURE__ */ jsx(Text, { children: annotation.content }),
4102
+ /* @__PURE__ */ jsx(Text2, { children: annotation.content }),
3564
4103
  selectedAnnotationId === annotation[ANNOTATION_ATTRS[0]] && /* @__PURE__ */ jsxs(Space, { children: [
3565
4104
  /* @__PURE__ */ jsx(
3566
4105
  Button,
@@ -3600,7 +4139,7 @@ var AnnotationSidebar_default = ({
3600
4139
  }
3601
4140
  return createPortal(sidebarContent, container);
3602
4141
  };
3603
- var createHtmlMark = (markName, ATTRS, classNames8) => {
4142
+ var createHtmlMark = (markName, ATTRS, classNames9) => {
3604
4143
  return Mark.create({
3605
4144
  name: markName,
3606
4145
  priority: 1e3,
@@ -3629,7 +4168,7 @@ var createHtmlMark = (markName, ATTRS, classNames8) => {
3629
4168
  return [
3630
4169
  "div",
3631
4170
  mergeAttributes$1(attrs, {
3632
- class: classNames8
4171
+ class: classNames9
3633
4172
  }),
3634
4173
  0
3635
4174
  ];
@@ -4148,7 +4687,7 @@ var styles_module_default7 = {
4148
4687
  collectionItem: "styles_module_collectionItem",
4149
4688
  collectionItemSelected: "styles_module_collectionItemSelected"
4150
4689
  };
4151
- var { Text: Text2 } = Typography;
4690
+ var { Text: Text3 } = Typography;
4152
4691
  var collectionSidebar_default = ({
4153
4692
  disabled,
4154
4693
  collections,
@@ -4214,11 +4753,11 @@ var collectionSidebar_default = ({
4214
4753
  },
4215
4754
  children: /* @__PURE__ */ jsxs(Flex, { vertical: true, gap: 8, flex: 1, children: [
4216
4755
  /* @__PURE__ */ jsxs(Flex, { gap: 8, justify: "space-between", className: styles_module_default7.collectionMeta, children: [
4217
- /* @__PURE__ */ jsx(Text2, { strong: true, type: "secondary", children: collection["user-name"] }),
4218
- /* @__PURE__ */ jsx(Text2, { type: "secondary", children: formatDate(collection["update-time"]) })
4756
+ /* @__PURE__ */ jsx(Text3, { strong: true, type: "secondary", children: collection["user-name"] }),
4757
+ /* @__PURE__ */ jsx(Text3, { type: "secondary", children: formatDate(collection["update-time"]) })
4219
4758
  ] }),
4220
4759
  /* @__PURE__ */ jsxs(Flex, { gap: 8, vertical: true, children: [
4221
- /* @__PURE__ */ jsx(Text2, { children: collection.text }),
4760
+ /* @__PURE__ */ jsx(Text3, { children: collection.text }),
4222
4761
  !disabled && selectedCollectionId === collection[COLLECTION_ATTRS[0]] && /* @__PURE__ */ jsx(Space, { children: /* @__PURE__ */ jsx(
4223
4762
  Popconfirm,
4224
4763
  {
@@ -4458,7 +4997,7 @@ var ShortcutDisplay = ({
4458
4997
  /* @__PURE__ */ jsx("kbd", { children: key })
4459
4998
  ] }, index)) });
4460
4999
  };
4461
- var Button6 = forwardRef(
5000
+ var Button7 = forwardRef(
4462
5001
  ({
4463
5002
  className,
4464
5003
  children,
@@ -4502,7 +5041,7 @@ var Button6 = forwardRef(
4502
5041
  ] });
4503
5042
  }
4504
5043
  );
4505
- Button6.displayName = "Button";
5044
+ Button7.displayName = "Button";
4506
5045
  var ButtonGroup = forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => {
4507
5046
  return /* @__PURE__ */ jsx(
4508
5047
  "div",
@@ -4838,7 +5377,7 @@ var BlockquoteButton = forwardRef(
4838
5377
  return null;
4839
5378
  }
4840
5379
  return /* @__PURE__ */ jsx(
4841
- Button6,
5380
+ Button7,
4842
5381
  {
4843
5382
  type: "button",
4844
5383
  "data-style": "ghost",
@@ -5064,7 +5603,7 @@ var CodeBlockButton = forwardRef(
5064
5603
  return null;
5065
5604
  }
5066
5605
  return /* @__PURE__ */ jsx(
5067
- Button6,
5606
+ Button7,
5068
5607
  {
5069
5608
  type: "button",
5070
5609
  "data-style": "ghost",
@@ -5430,7 +5969,7 @@ var ColorHighlightButton = forwardRef(
5430
5969
  return null;
5431
5970
  }
5432
5971
  return /* @__PURE__ */ jsx(
5433
- Button6,
5972
+ Button7,
5434
5973
  {
5435
5974
  type: "button",
5436
5975
  "data-style": "ghost",
@@ -5665,7 +6204,7 @@ function useColorHighlight(config) {
5665
6204
  };
5666
6205
  }
5667
6206
  var ColorHighlightPopoverButton = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
5668
- Button6,
6207
+ Button7,
5669
6208
  {
5670
6209
  type: "button",
5671
6210
  className,
@@ -5734,7 +6273,7 @@ function ColorHighlightPopoverContent({
5734
6273
  )) }),
5735
6274
  /* @__PURE__ */ jsx(Separator, {}),
5736
6275
  /* @__PURE__ */ jsx(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx(
5737
- Button6,
6276
+ Button7,
5738
6277
  {
5739
6278
  onClick: handleRemoveHighlight,
5740
6279
  "aria-label": "\u79FB\u9664\u80CC\u666F",
@@ -5858,7 +6397,7 @@ var HeadingButton = forwardRef(
5858
6397
  return null;
5859
6398
  }
5860
6399
  return /* @__PURE__ */ jsx(
5861
- Button6,
6400
+ Button7,
5862
6401
  {
5863
6402
  type: "button",
5864
6403
  "data-style": "ghost",
@@ -6287,7 +6826,7 @@ var HeadingDropdownMenu = forwardRef(
6287
6826
  }
6288
6827
  return /* @__PURE__ */ jsxs(DropdownMenu, { modal: true, open: isOpen, onOpenChange: handleOpenChange, children: [
6289
6828
  /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
6290
- Button6,
6829
+ Button7,
6291
6830
  {
6292
6831
  type: "button",
6293
6832
  "data-style": "ghost",
@@ -6505,7 +7044,7 @@ function InputGroup({
6505
7044
  var LinkButton = forwardRef(
6506
7045
  ({ className, children, ...props }, ref) => {
6507
7046
  return /* @__PURE__ */ jsx(
6508
- Button6,
7047
+ Button7,
6509
7048
  {
6510
7049
  type: "button",
6511
7050
  className,
@@ -6565,7 +7104,7 @@ var LinkMain = ({
6565
7104
  }
6566
7105
  ) }),
6567
7106
  /* @__PURE__ */ jsx(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx(
6568
- Button6,
7107
+ Button7,
6569
7108
  {
6570
7109
  type: "button",
6571
7110
  onClick: setLink,
@@ -6578,7 +7117,7 @@ var LinkMain = ({
6578
7117
  /* @__PURE__ */ jsx(Separator, {}),
6579
7118
  /* @__PURE__ */ jsxs(ButtonGroup, { orientation: "horizontal", children: [
6580
7119
  /* @__PURE__ */ jsx(
6581
- Button6,
7120
+ Button7,
6582
7121
  {
6583
7122
  type: "button",
6584
7123
  onClick: openLink,
@@ -6589,7 +7128,7 @@ var LinkMain = ({
6589
7128
  }
6590
7129
  ),
6591
7130
  /* @__PURE__ */ jsx(
6592
- Button6,
7131
+ Button7,
6593
7132
  {
6594
7133
  type: "button",
6595
7134
  onClick: removeLink,
@@ -6871,7 +7410,7 @@ var ListButton = forwardRef(
6871
7410
  return null;
6872
7411
  }
6873
7412
  return /* @__PURE__ */ jsx(
6874
- Button6,
7413
+ Button7,
6875
7414
  {
6876
7415
  type: "button",
6877
7416
  "data-style": "ghost",
@@ -7376,7 +7915,7 @@ function ListDropdownMenu({
7376
7915
  }
7377
7916
  return /* @__PURE__ */ jsxs(DropdownMenu, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
7378
7917
  /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
7379
- Button6,
7918
+ Button7,
7380
7919
  {
7381
7920
  type: "button",
7382
7921
  "data-style": "ghost",
@@ -7450,7 +7989,7 @@ var MarkButton = forwardRef(
7450
7989
  return null;
7451
7990
  }
7452
7991
  return /* @__PURE__ */ jsx(
7453
- Button6,
7992
+ Button7,
7454
7993
  {
7455
7994
  type: "button",
7456
7995
  disabled: !canToggle3,
@@ -7845,7 +8384,7 @@ var TextAlignButton = forwardRef(
7845
8384
  }
7846
8385
  const RenderIcon = CustomIcon ?? Icon;
7847
8386
  return /* @__PURE__ */ jsx(
7848
- Button6,
8387
+ Button7,
7849
8388
  {
7850
8389
  type: "button",
7851
8390
  disabled: !canAlign,
@@ -8180,7 +8719,7 @@ var UndoRedoButton = forwardRef(
8180
8719
  return null;
8181
8720
  }
8182
8721
  return /* @__PURE__ */ jsx(
8183
- Button6,
8722
+ Button7,
8184
8723
  {
8185
8724
  type: "button",
8186
8725
  disabled: !canExecute,
@@ -8351,17 +8890,17 @@ var ArrowLeftIcon = memo(({ className, ...props }) => {
8351
8890
  });
8352
8891
  ArrowLeftIcon.displayName = "ArrowLeftIcon";
8353
8892
  function useSelect(editor, disabled = false, hideWhenUnavailable = false) {
8354
- const selectionAvailable = React__default.useMemo(() => hasSelection(editor), [editor?.state.selection]);
8355
- const blockMathSelected = React__default.useMemo(() => selectionHasBlockMath(editor), [editor?.state.selection]);
8356
- const isDisabled = React__default.useMemo(() => !selectionAvailable || disabled, [selectionAvailable, disabled]);
8357
- const shouldShow = React__default.useMemo(() => {
8893
+ const selectionAvailable = React3__default.useMemo(() => hasSelection(editor), [editor?.state.selection]);
8894
+ const blockMathSelected = React3__default.useMemo(() => selectionHasBlockMath(editor), [editor?.state.selection]);
8895
+ const isDisabled = React3__default.useMemo(() => !selectionAvailable || disabled, [selectionAvailable, disabled]);
8896
+ const shouldShow = React3__default.useMemo(() => {
8358
8897
  if (!editor?.isEditable) return false;
8359
8898
  if (hideWhenUnavailable && !selectionAvailable) return false;
8360
8899
  if (blockMathSelected) return false;
8361
8900
  return true;
8362
8901
  }, [editor, hideWhenUnavailable, selectionAvailable, blockMathSelected]);
8363
- const getText = React__default.useCallback(() => getSelectedText(editor), [editor]);
8364
- const getMarkdown = React__default.useCallback(() => getSelectedMarkdown(editor), [editor]);
8902
+ const getText = React3__default.useCallback(() => getSelectedText(editor), [editor]);
8903
+ const getMarkdown = React3__default.useCallback(() => getSelectedMarkdown(editor), [editor]);
8365
8904
  return {
8366
8905
  isDisabled,
8367
8906
  shouldShow,
@@ -8369,11 +8908,11 @@ function useSelect(editor, disabled = false, hideWhenUnavailable = false) {
8369
8908
  getMarkdown
8370
8909
  };
8371
8910
  }
8372
- var SelectButton = React__default.forwardRef(
8911
+ var SelectButton = React3__default.forwardRef(
8373
8912
  ({ editor: providedEditor, disabled = false, hideWhenUnavailable = false, onClick, children, icon, tooltip, ...buttonProps }, ref) => {
8374
8913
  const { editor } = useTiptapEditor(providedEditor);
8375
8914
  const { isDisabled, shouldShow, getText, getMarkdown } = useSelect(editor, disabled, hideWhenUnavailable);
8376
- const handleClick = React__default.useCallback(
8915
+ const handleClick = React3__default.useCallback(
8377
8916
  (e) => {
8378
8917
  if (e.defaultPrevented || isDisabled || !editor) return;
8379
8918
  const selectedText = getText();
@@ -8565,7 +9104,7 @@ function useCursorVisibility({ editor, overlayHeight = 0 }) {
8565
9104
  }, [editor, overlayHeight, windowHeight, rect.height]);
8566
9105
  return rect;
8567
9106
  }
8568
- var QuoteIcon = React.memo(({ ...props }) => {
9107
+ var QuoteIcon = React3.memo(({ ...props }) => {
8569
9108
  return /* @__PURE__ */ jsx("span", { className: "anticon", children: /* @__PURE__ */ jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 1024 1024", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx(
8570
9109
  "path",
8571
9110
  {
@@ -8638,7 +9177,7 @@ var MainToolbarContent = ({
8638
9177
  ] });
8639
9178
  };
8640
9179
  var MobileToolbarContent = ({ type, onBack }) => /* @__PURE__ */ jsxs(Fragment, { children: [
8641
- /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxs(Button6, { "data-style": "ghost", onClick: onBack, children: [
9180
+ /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxs(Button7, { "data-style": "ghost", onClick: onBack, children: [
8642
9181
  /* @__PURE__ */ jsx(ArrowLeftIcon, { className: "tiptap-button-icon" }),
8643
9182
  type === "highlighter" ? /* @__PURE__ */ jsx(HighlighterIcon, { className: "tiptap-button-icon" }) : /* @__PURE__ */ jsx(LinkIcon, { className: "tiptap-button-icon" })
8644
9183
  ] }) }),
@@ -9247,7 +9786,7 @@ var MarkDrawing_default = ({ children, detections, originalSize, scopeRender })
9247
9786
  const top = y1 * scaleY;
9248
9787
  const width = (x2 - x1) * scaleX;
9249
9788
  const height = (y2 - y1) * scaleY;
9250
- return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
9789
+ return /* @__PURE__ */ jsxs(React3__default.Fragment, { children: [
9251
9790
  /* @__PURE__ */ jsx(
9252
9791
  "div",
9253
9792
  {
@@ -9315,6 +9854,6 @@ var UserAvatar_default = ({ size, avatarSrc, userName }) => {
9315
9854
  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() });
9316
9855
  };
9317
9856
 
9318
- 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, MarkDrawing_default as MarkDrawing, MarkdownEditor_default as MarkdownEditor, MarkdownPreview_default as MarkdownPreview, MicroApp_default as MicroApp, Drawer_default as MicroAppDrawer, Window_default as MicroAppWindow, MultiEmailValidator, PdfImagePreview_default as PdfImagePreview, 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, findTreeNodesByIds, formatDate, formatNumberWithCommas, formatSize, genNonDuplicateID, generateRandomNumbers, getAllUrlParams, getDeviceId, getEndOfTimestamp, getFileName, getFileSuffixName, getRowSpanCount, getStartOfTimestamp, getTimestamp, getWebSocketUrl, htmlToMarkdown, htmlToText, 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, markdownToText, minus, objToOptions, plus, precision, processItemList, propsMerge, setInterval2 as setInterval, setUrlMainSource, shouldRender, times, toFixed, transform, transforms, useAsyncQueue_default as useAsyncQueue, 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 };
9857
+ 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, luyaFilePreview_default as LuyaFilePreview, MarkDrawing_default as MarkDrawing, MarkdownEditor_default as MarkdownEditor, MarkdownPreview_default as MarkdownPreview, MicroApp_default as MicroApp, Drawer_default as MicroAppDrawer, Window_default as MicroAppWindow, MultiEmailValidator, PdfImagePreview_default as PdfImagePreview, 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, findTreeNodesByIds, formatDate, formatNumberWithCommas, formatSize, genNonDuplicateID, generateRandomNumbers, getAllUrlParams, getDeviceId, getEndOfTimestamp, getFileName, getFileSuffixName, getRowSpanCount, getStartOfTimestamp, getTimestamp, getWebSocketUrl, htmlToMarkdown, htmlToText, 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, markdownToText, minus, objToOptions, plus, precision, processItemList, propsMerge, safeParseJson, setInterval2 as setInterval, setUrlMainSource, shouldRender, times, toFixed, transform, transforms, useAsyncQueue_default as useAsyncQueue, 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 };
9319
9858
  //# sourceMappingURL=index.esm.js.map
9320
9859
  //# sourceMappingURL=index.esm.js.map