tiptap-markdown-react 1.0.0 → 1.2.0
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/README.md +12 -20
- package/dist/{ReportContent-w08GFm8v.js → ReportContent-B7okwVW0.js} +14 -12
- package/dist/{ReportContent-w08GFm8v.js.map → ReportContent-B7okwVW0.js.map} +1 -1
- package/dist/ReportContentWithCharts-DHdD1BaH.js +1322 -0
- package/dist/ReportContentWithCharts-DHdD1BaH.js.map +1 -0
- package/dist/components/ContentOutline.d.ts +10 -0
- package/dist/components/ContentOutline.dom.test.d.ts +1 -0
- package/dist/components/EditorToc.d.ts +13 -0
- package/dist/components/MarkdownPreview.d.ts +7 -2
- package/dist/components/MarkdownPreview.toc.dom.test.d.ts +1 -0
- package/dist/components/MarkdownWysiwygEditor.d.ts +10 -2
- package/dist/components/ReaderReportContent.d.ts +16 -0
- package/dist/components/ReportContentInteractive.d.ts +6 -1
- package/dist/components/ReportContentWithCharts.d.ts +6 -1
- package/dist/{extractToc-Cr470fBy.js → extractToc-B50WvHao.js} +2 -2
- package/dist/{extractToc-Cr470fBy.js.map → extractToc-B50WvHao.js.map} +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +377 -979
- package/dist/index.js.map +1 -1
- package/dist/reader.d.ts +1 -1
- package/dist/reader.js +5 -5
- package/dist/server.js +4 -4
- package/dist/style-inline.css +486 -537
- package/dist/style.css +486 -537
- package/dist/toc/readTocItems.d.ts +4 -0
- package/package.json +1 -1
- package/dist/components/TocPanel.d.ts +0 -21
- package/dist/scrollToTocHeading-kPgsn3cu.js +0 -496
- package/dist/scrollToTocHeading-kPgsn3cu.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Markdown, MarkdownManager } from "@tiptap/markdown";
|
|
3
|
-
import {
|
|
4
|
-
import { C, a,
|
|
3
|
+
import { g as getLocaleBundle, d as renderOrUpdateChart, e as destroyChart, u as useIsMobile, E as EditorToc, h as sameTocItems$1 } from "./ReportContentWithCharts-DHdD1BaH.js";
|
|
4
|
+
import { C, a, b, c, f, m, r, s } from "./ReportContentWithCharts-DHdD1BaH.js";
|
|
5
5
|
import { jsx, jsxs, Fragment as Fragment$2 } from "react/jsx-runtime";
|
|
6
6
|
import CodeBlockLowlight from "@tiptap/extension-code-block-lowlight";
|
|
7
7
|
import FindAndReplace, { FindAndReplacePluginKey, createSearchRegex } from "@tiptap/extension-find-and-replace";
|
|
@@ -14,10 +14,10 @@ import { NodeViewWrapper, ReactNodeViewRenderer, useEditorState, ReactRenderer,
|
|
|
14
14
|
import { Extension, Node as Node$1, mergeAttributes } from "@tiptap/core";
|
|
15
15
|
import { createPortal } from "react-dom";
|
|
16
16
|
import { useState, useEffect, useCallback, useRef, useMemo, useSyncExternalStore, useLayoutEffect, forwardRef, useId, useImperativeHandle, Fragment as Fragment$1, useContext, createContext } from "react";
|
|
17
|
-
import { e as enrichMarkdownCitations, c as styles$
|
|
18
|
-
import { R
|
|
19
|
-
import { C as CitationRef, i as mergeCommentIntervals, h as mapCommentAnchors, n as normalizeImageAlign, p as prepareChartMarkdown, j as reportChart, f as CommentMark, b as baseExtensions, l as lowlight, m as makeTocGetId, k as parseCodeTokenAsChartOrCodeBlock, o as imageMarkdownTokenizer, q as imageParseMarkdown, t as imageRenderMarkdown, u as imageNodeHtml, v as imageFigureParseRule, w as imageCaptionAttribute, x as imageAlignAttribute, y as normalizeImageCaption, a as pureCodeBlock, c as pureImage, z as renderMathInto, A as readCurrentNumberingFormat, B as subscribeMathClick, D as applyNumberingFormat, N as NUMBERING_FORMAT_IDS, E as NUMBERING_FORMAT_LABELS, F as NUMBERING_FORMAT_PREVIEWS, d as pureChart } from "./extractToc-
|
|
20
|
-
import { P, g, e, s as s3 } from "./extractToc-
|
|
17
|
+
import { e as enrichMarkdownCitations, c as styles$d } from "./ReportContent-B7okwVW0.js";
|
|
18
|
+
import { R, a as a2, b as b2, s as s2 } from "./ReportContent-B7okwVW0.js";
|
|
19
|
+
import { C as CitationRef, i as mergeCommentIntervals, h as mapCommentAnchors, n as normalizeImageAlign, p as prepareChartMarkdown, j as reportChart, f as CommentMark, b as baseExtensions, l as lowlight, m as makeTocGetId, k as parseCodeTokenAsChartOrCodeBlock, o as imageMarkdownTokenizer, q as imageParseMarkdown, t as imageRenderMarkdown, u as imageNodeHtml, v as imageFigureParseRule, w as imageCaptionAttribute, x as imageAlignAttribute, y as normalizeImageCaption, a as pureCodeBlock, c as pureImage, z as renderMathInto, A as readCurrentNumberingFormat, B as subscribeMathClick, D as applyNumberingFormat, N as NUMBERING_FORMAT_IDS, E as NUMBERING_FORMAT_LABELS, F as NUMBERING_FORMAT_PREVIEWS, d as pureChart } from "./extractToc-B50WvHao.js";
|
|
20
|
+
import { P, g, e, s as s3 } from "./extractToc-B50WvHao.js";
|
|
21
21
|
import { Slice, Fragment } from "@tiptap/pm/model";
|
|
22
22
|
import { PluginKey, Plugin, Selection, TextSelection, NodeSelection } from "@tiptap/pm/state";
|
|
23
23
|
import { DecorationSet, Decoration } from "@tiptap/pm/view";
|
|
@@ -177,8 +177,8 @@ function commentAnchorPlugin(options = {}) {
|
|
|
177
177
|
state: {
|
|
178
178
|
init: () => ({ activeCommentId: null }),
|
|
179
179
|
apply: (tr, value) => {
|
|
180
|
-
const
|
|
181
|
-
return
|
|
180
|
+
const active = tr.getMeta(COMMENT_ACTIVE_META);
|
|
181
|
+
return active !== void 0 ? { activeCommentId: active } : value;
|
|
182
182
|
}
|
|
183
183
|
},
|
|
184
184
|
props: {
|
|
@@ -270,7 +270,7 @@ function applyCommentAnchorsToEditor(editor, comments) {
|
|
|
270
270
|
const intervals = comments.length > 0 ? mergeCommentIntervals(
|
|
271
271
|
mapCommentAnchors(
|
|
272
272
|
editor.state.doc,
|
|
273
|
-
comments.map((
|
|
273
|
+
comments.map((c2) => ({ commentId: c2.commentId, segments: c2.segments }))
|
|
274
274
|
).map((r2) => ({ commentId: r2.commentId, ranges: r2.ranges }))
|
|
275
275
|
) : [];
|
|
276
276
|
const chain = editor.chain().clearCommentAnchors();
|
|
@@ -333,8 +333,8 @@ function focusComment(editor, commentId) {
|
|
|
333
333
|
function nextComment(editor, dir = "next") {
|
|
334
334
|
const ids = collectCommentIds(editor);
|
|
335
335
|
if (ids.length === 0) return null;
|
|
336
|
-
const
|
|
337
|
-
const current =
|
|
336
|
+
const active = getActive(editor);
|
|
337
|
+
const current = active ? ids.indexOf(active) : -1;
|
|
338
338
|
const nextIdx = dir === "next" ? (current + 1) % ids.length : (current - 1 + ids.length) % ids.length;
|
|
339
339
|
const target = ids[nextIdx];
|
|
340
340
|
focusComment(editor, target);
|
|
@@ -659,493 +659,6 @@ const KeyboardIcon = (p) => /* @__PURE__ */ jsxs(Svg, { ...p, children: [
|
|
|
659
659
|
/* @__PURE__ */ jsx("path", { d: "M18 12h.01" }),
|
|
660
660
|
/* @__PURE__ */ jsx("path", { d: "M7 16h10" })
|
|
661
661
|
] });
|
|
662
|
-
const defaultChartLabels = {
|
|
663
|
-
tabLabel: (chartType, index) => `${chartType} ${index + 1}`,
|
|
664
|
-
done: "Done",
|
|
665
|
-
cancel: "Cancel",
|
|
666
|
-
configLabel: "Chart config (JSON)",
|
|
667
|
-
tableLabel: "Data table (Markdown)",
|
|
668
|
-
editTitle: "Edit chart"
|
|
669
|
-
};
|
|
670
|
-
const defaultToolbarLabels = {
|
|
671
|
-
undo: "Undo",
|
|
672
|
-
redo: "Redo",
|
|
673
|
-
style: "Style",
|
|
674
|
-
normalText: "Normal text",
|
|
675
|
-
headingLabel: (level) => `Heading ${level}`,
|
|
676
|
-
fontSize: "Font size",
|
|
677
|
-
fontSizeDefault: "Default",
|
|
678
|
-
bold: "Bold",
|
|
679
|
-
italic: "Italic",
|
|
680
|
-
underline: "Underline",
|
|
681
|
-
strike: "Strikethrough",
|
|
682
|
-
code: "Inline code",
|
|
683
|
-
textColor: "Text color",
|
|
684
|
-
highlight: "Highlight",
|
|
685
|
-
colorNone: "None",
|
|
686
|
-
colorTheme: "THEME",
|
|
687
|
-
scriptMenu: "Superscript / Subscript",
|
|
688
|
-
scriptNormal: "Normal",
|
|
689
|
-
superscript: "Superscript",
|
|
690
|
-
subscript: "Subscript",
|
|
691
|
-
link: "Link",
|
|
692
|
-
align: "Alignment",
|
|
693
|
-
alignLeft: "Align left",
|
|
694
|
-
alignCenter: "Align center",
|
|
695
|
-
alignRight: "Align right",
|
|
696
|
-
alignJustify: "Justify",
|
|
697
|
-
indent: "Indent",
|
|
698
|
-
indentIncrease: "Increase indent",
|
|
699
|
-
indentDecrease: "Decrease indent",
|
|
700
|
-
lineHeight: "Line height",
|
|
701
|
-
lineHeightDefault: "Default",
|
|
702
|
-
linkPrompt: "Enter URL",
|
|
703
|
-
linkApply: "Apply link",
|
|
704
|
-
linkOpen: "Open in new window",
|
|
705
|
-
linkRemove: "Remove link",
|
|
706
|
-
linkInvalid: "The editor rejected this address",
|
|
707
|
-
image: "Image",
|
|
708
|
-
imageUploadFailed: "Image upload failed",
|
|
709
|
-
imageAlign: "Image alignment",
|
|
710
|
-
imageAlignLeft: "Align left",
|
|
711
|
-
imageAlignCenter: "Align center",
|
|
712
|
-
imageAlignRight: "Align right",
|
|
713
|
-
imageCaption: "Caption",
|
|
714
|
-
imageCaptionPlaceholder: "Add a caption…",
|
|
715
|
-
importMarkdownFailed: "Markdown import failed",
|
|
716
|
-
importDocument: "Import",
|
|
717
|
-
importDocumentHint: "Import a file",
|
|
718
|
-
importDocumentOther: "Document",
|
|
719
|
-
importDocumentBusy: "Importing…",
|
|
720
|
-
importDocumentUploading: (percent) => `Uploading ${percent}%`,
|
|
721
|
-
importDocumentConverting: "Converting…",
|
|
722
|
-
importDocumentFailed: "Import failed",
|
|
723
|
-
blockquote: "Blockquote",
|
|
724
|
-
details: "Toggle",
|
|
725
|
-
bulletList: "Bullet list",
|
|
726
|
-
orderedList: "Ordered list",
|
|
727
|
-
numberingFormat: "Numbering format",
|
|
728
|
-
taskList: "Task list",
|
|
729
|
-
more: "More",
|
|
730
|
-
search: "Find & replace",
|
|
731
|
-
codeBlock: "Code block",
|
|
732
|
-
hr: "Divider",
|
|
733
|
-
importMarkdown: "Markdown",
|
|
734
|
-
tableInsert: "Insert table",
|
|
735
|
-
tableRowMenu: "Row actions",
|
|
736
|
-
tableColumnMenu: "Column actions",
|
|
737
|
-
tableClearContent: "Clear content",
|
|
738
|
-
tableResetCellStyles: "Reset cell styles",
|
|
739
|
-
tableAppendRow: "Add row",
|
|
740
|
-
tableAppendColumn: "Add column",
|
|
741
|
-
tableSizeSelected: (cols, rows) => `${cols} × ${rows}`,
|
|
742
|
-
tableAddColumnBefore: "Add column before",
|
|
743
|
-
tableAddColumnAfter: "Add column after",
|
|
744
|
-
tableDeleteColumn: "Delete column",
|
|
745
|
-
tableAddRowBefore: "Add row before",
|
|
746
|
-
tableAddRowAfter: "Add row after",
|
|
747
|
-
tableDeleteRow: "Delete row",
|
|
748
|
-
tableAddColumnBeforeN: (n) => `Add ${n} columns before`,
|
|
749
|
-
tableAddColumnAfterN: (n) => `Add ${n} columns after`,
|
|
750
|
-
tableDeleteColumnN: (n) => `Delete ${n} columns`,
|
|
751
|
-
tableAddRowBeforeN: (n) => `Add ${n} rows before`,
|
|
752
|
-
tableAddRowAfterN: (n) => `Add ${n} rows after`,
|
|
753
|
-
tableDeleteRowN: (n) => `Delete ${n} rows`,
|
|
754
|
-
tableDeleteTable: "Delete table",
|
|
755
|
-
inlineMath: "Inline equation",
|
|
756
|
-
blockMath: "Block equation",
|
|
757
|
-
mathPlaceholder: "E = mc^2",
|
|
758
|
-
mathDone: "Done",
|
|
759
|
-
mathCancel: "Cancel",
|
|
760
|
-
mathNewInline: "New equation",
|
|
761
|
-
mathNewBlock: "Add a TeX equation"
|
|
762
|
-
};
|
|
763
|
-
const defaultBlockDragLabels = {
|
|
764
|
-
dragHandle: "Drag to move",
|
|
765
|
-
menuLabel: "Block actions",
|
|
766
|
-
turnInto: "Turn into",
|
|
767
|
-
paragraph: "Normal text",
|
|
768
|
-
headingLabel: (level) => `Heading ${level}`,
|
|
769
|
-
bulletList: "Bullet list",
|
|
770
|
-
orderedList: "Ordered list",
|
|
771
|
-
taskList: "Task list",
|
|
772
|
-
blockquote: "Blockquote",
|
|
773
|
-
codeBlock: "Code block",
|
|
774
|
-
copy: "Copy",
|
|
775
|
-
duplicate: "Duplicate",
|
|
776
|
-
resetFormatting: "Reset formatting",
|
|
777
|
-
downloadImage: "Download image",
|
|
778
|
-
delete: "Delete"
|
|
779
|
-
};
|
|
780
|
-
const defaultSlashMenuLabels = {
|
|
781
|
-
menuLabel: "Insert block",
|
|
782
|
-
groupText: "Text",
|
|
783
|
-
groupList: "Lists",
|
|
784
|
-
groupAdvanced: "Advanced",
|
|
785
|
-
normalText: "Normal text",
|
|
786
|
-
headingLabel: (level) => `Heading ${level}`,
|
|
787
|
-
bulletList: "Bullet list",
|
|
788
|
-
orderedList: "Ordered list",
|
|
789
|
-
taskList: "Task list",
|
|
790
|
-
blockquote: "Blockquote",
|
|
791
|
-
details: "Toggle",
|
|
792
|
-
codeBlock: "Code block",
|
|
793
|
-
divider: "Divider",
|
|
794
|
-
table: "Table",
|
|
795
|
-
inlineMath: "Inline equation",
|
|
796
|
-
blockMath: "Block equation"
|
|
797
|
-
};
|
|
798
|
-
const defaultShortcutLabels = {
|
|
799
|
-
panelTitle: "Shortcuts",
|
|
800
|
-
close: "Close",
|
|
801
|
-
colFormat: "Format",
|
|
802
|
-
colShortcut: "Shortcut",
|
|
803
|
-
colMarkdown: "Markdown",
|
|
804
|
-
formatGroup: "Formatting",
|
|
805
|
-
insertGroup: "Insert",
|
|
806
|
-
editGroup: "Editing",
|
|
807
|
-
bold: "Bold",
|
|
808
|
-
italic: "Italic",
|
|
809
|
-
strike: "Strikethrough",
|
|
810
|
-
underline: "Underline",
|
|
811
|
-
inlineCode: "Inline code",
|
|
812
|
-
highlight: "Highlight",
|
|
813
|
-
headingLabel: (level) => `Heading ${level}`,
|
|
814
|
-
paragraph: "Normal text",
|
|
815
|
-
blockquote: "Blockquote",
|
|
816
|
-
bulletList: "Bullet list",
|
|
817
|
-
orderedList: "Ordered list",
|
|
818
|
-
taskList: "Task list",
|
|
819
|
-
codeBlock: "Code block",
|
|
820
|
-
divider: "Divider",
|
|
821
|
-
undo: "Undo",
|
|
822
|
-
redo: "Redo",
|
|
823
|
-
hardBreak: "Hard break",
|
|
824
|
-
findReplace: "Find & replace",
|
|
825
|
-
alignLeft: "Align left",
|
|
826
|
-
alignCenter: "Align center",
|
|
827
|
-
alignRight: "Align right",
|
|
828
|
-
alignJustify: "Justify",
|
|
829
|
-
imageUpload: "Upload image",
|
|
830
|
-
smartQuote: "Smart quotes",
|
|
831
|
-
ellipsis: "Ellipsis",
|
|
832
|
-
emDash: "Em dash",
|
|
833
|
-
emoji: "Emoji"
|
|
834
|
-
};
|
|
835
|
-
const defaultCharacterCountLabels = {
|
|
836
|
-
label: "Document statistics",
|
|
837
|
-
characters: (count) => `${count} ${count === 1 ? "character" : "characters"}`,
|
|
838
|
-
words: (count) => `${count} ${count === 1 ? "word" : "words"}`
|
|
839
|
-
};
|
|
840
|
-
const defaultEmojiSuggestionLabels = {
|
|
841
|
-
menuLabel: "Emoji"
|
|
842
|
-
};
|
|
843
|
-
const defaultLinkPopoverLabels = {
|
|
844
|
-
field: "Enter URL",
|
|
845
|
-
apply: "Apply link",
|
|
846
|
-
open: "Open in new window",
|
|
847
|
-
remove: "Remove link",
|
|
848
|
-
invalid: "The editor rejected this address"
|
|
849
|
-
};
|
|
850
|
-
const defaultColorPaletteLabels = {
|
|
851
|
-
none: "None",
|
|
852
|
-
theme: "THEME"
|
|
853
|
-
};
|
|
854
|
-
const defaultTocLabels = {
|
|
855
|
-
title: "Contents",
|
|
856
|
-
expand: "Expand",
|
|
857
|
-
collapse: "Collapse"
|
|
858
|
-
};
|
|
859
|
-
const defaultCodeBlockLabels = {
|
|
860
|
-
autoDetect: "Auto-detect",
|
|
861
|
-
delete: "Delete code block",
|
|
862
|
-
copy: "Copy code",
|
|
863
|
-
expand: "Expand code",
|
|
864
|
-
collapse: "Collapse code",
|
|
865
|
-
language: "Code language"
|
|
866
|
-
};
|
|
867
|
-
const defaultFindLabels = {
|
|
868
|
-
find: "Find",
|
|
869
|
-
replace: "Replace with",
|
|
870
|
-
next: "Next match",
|
|
871
|
-
previous: "Previous match",
|
|
872
|
-
replaceOne: "Replace",
|
|
873
|
-
replaceAll: "Replace all",
|
|
874
|
-
close: "Close",
|
|
875
|
-
caseSensitive: "Match case",
|
|
876
|
-
wholeWord: "Whole word",
|
|
877
|
-
useRegex: "Use regular expression",
|
|
878
|
-
counter: (current, total) => `${current} / ${total}`,
|
|
879
|
-
invalidRegex: "Invalid pattern",
|
|
880
|
-
readOnly: "Read-only"
|
|
881
|
-
};
|
|
882
|
-
const defaultImageUploadLabels = {
|
|
883
|
-
dropzoneClick: "Click to upload",
|
|
884
|
-
dropzoneRest: " or drag and drop",
|
|
885
|
-
dropzoneLimits: (limit, maxSizeMb) => {
|
|
886
|
-
const count = `Maximum ${limit} file${limit === 1 ? "" : "s"}`;
|
|
887
|
-
return maxSizeMb == null ? `${count}.` : `${count}, ${maxSizeMb}MB each.`;
|
|
888
|
-
},
|
|
889
|
-
uploadingCount: (count) => `Uploading ${count} files`,
|
|
890
|
-
clearAll: "Clear all",
|
|
891
|
-
remove: "Remove",
|
|
892
|
-
failed: "Upload failed",
|
|
893
|
-
fallbackAlt: "image"
|
|
894
|
-
};
|
|
895
|
-
const zh = {
|
|
896
|
-
toolbar: {
|
|
897
|
-
undo: "撤销",
|
|
898
|
-
redo: "重做",
|
|
899
|
-
style: "样式",
|
|
900
|
-
normalText: "正文",
|
|
901
|
-
headingLabel: (level) => `标题 ${level}`,
|
|
902
|
-
fontSize: "字号",
|
|
903
|
-
fontSizeDefault: "默认",
|
|
904
|
-
bold: "加粗",
|
|
905
|
-
italic: "斜体",
|
|
906
|
-
underline: "下划线",
|
|
907
|
-
strike: "删除线",
|
|
908
|
-
code: "行内代码",
|
|
909
|
-
textColor: "文字颜色",
|
|
910
|
-
highlight: "高亮",
|
|
911
|
-
colorNone: "无",
|
|
912
|
-
colorTheme: "主题色",
|
|
913
|
-
scriptMenu: "上标 / 下标",
|
|
914
|
-
scriptNormal: "常规",
|
|
915
|
-
superscript: "上标",
|
|
916
|
-
subscript: "下标",
|
|
917
|
-
link: "链接",
|
|
918
|
-
align: "对齐",
|
|
919
|
-
alignLeft: "左对齐",
|
|
920
|
-
alignCenter: "居中",
|
|
921
|
-
alignRight: "右对齐",
|
|
922
|
-
alignJustify: "两端对齐",
|
|
923
|
-
indent: "缩进",
|
|
924
|
-
indentIncrease: "增加缩进",
|
|
925
|
-
indentDecrease: "减少缩进",
|
|
926
|
-
lineHeight: "行高",
|
|
927
|
-
lineHeightDefault: "默认",
|
|
928
|
-
linkPrompt: "输入链接地址",
|
|
929
|
-
linkApply: "应用链接",
|
|
930
|
-
linkOpen: "在新窗口打开",
|
|
931
|
-
linkRemove: "移除链接",
|
|
932
|
-
linkInvalid: "编辑器不接受这个地址",
|
|
933
|
-
image: "图片",
|
|
934
|
-
imageUploadFailed: "图片上传失败",
|
|
935
|
-
imageAlign: "图片对齐",
|
|
936
|
-
imageAlignLeft: "左对齐",
|
|
937
|
-
imageAlignCenter: "居中",
|
|
938
|
-
imageAlignRight: "右对齐",
|
|
939
|
-
imageCaption: "图片描述",
|
|
940
|
-
imageCaptionPlaceholder: "添加描述…",
|
|
941
|
-
importMarkdownFailed: "Markdown 导入失败",
|
|
942
|
-
importDocument: "导入",
|
|
943
|
-
importDocumentHint: "导入文件",
|
|
944
|
-
importDocumentOther: "文档",
|
|
945
|
-
importDocumentBusy: "正在导入…",
|
|
946
|
-
importDocumentUploading: (percent) => `上传中 ${percent}%`,
|
|
947
|
-
importDocumentConverting: "正在转换…",
|
|
948
|
-
importDocumentFailed: "导入失败",
|
|
949
|
-
blockquote: "引用",
|
|
950
|
-
details: "折叠块",
|
|
951
|
-
bulletList: "无序列表",
|
|
952
|
-
orderedList: "有序列表",
|
|
953
|
-
numberingFormat: "编号格式",
|
|
954
|
-
taskList: "任务列表",
|
|
955
|
-
more: "更多",
|
|
956
|
-
search: "查找替换",
|
|
957
|
-
codeBlock: "代码块",
|
|
958
|
-
hr: "分隔线",
|
|
959
|
-
importMarkdown: "Markdown",
|
|
960
|
-
tableInsert: "插入表格",
|
|
961
|
-
tableRowMenu: "行操作",
|
|
962
|
-
tableColumnMenu: "列操作",
|
|
963
|
-
tableClearContent: "清空内容",
|
|
964
|
-
tableResetCellStyles: "重置单元格样式",
|
|
965
|
-
tableAppendRow: "添加行",
|
|
966
|
-
tableAppendColumn: "添加列",
|
|
967
|
-
tableSizeSelected: (cols, rows) => `${cols} × ${rows}`,
|
|
968
|
-
tableAddColumnBefore: "在左侧插入列",
|
|
969
|
-
tableAddColumnAfter: "在右侧插入列",
|
|
970
|
-
tableDeleteColumn: "删除列",
|
|
971
|
-
tableAddRowBefore: "在上方插入行",
|
|
972
|
-
tableAddRowAfter: "在下方插入行",
|
|
973
|
-
tableDeleteRow: "删除行",
|
|
974
|
-
tableAddColumnBeforeN: (n) => `在左侧插入 ${n} 列`,
|
|
975
|
-
tableAddColumnAfterN: (n) => `在右侧插入 ${n} 列`,
|
|
976
|
-
tableDeleteColumnN: (n) => `删除 ${n} 列`,
|
|
977
|
-
tableAddRowBeforeN: (n) => `在上方插入 ${n} 行`,
|
|
978
|
-
tableAddRowAfterN: (n) => `在下方插入 ${n} 行`,
|
|
979
|
-
tableDeleteRowN: (n) => `删除 ${n} 行`,
|
|
980
|
-
tableDeleteTable: "删除表格",
|
|
981
|
-
inlineMath: "行内公式",
|
|
982
|
-
blockMath: "块级公式",
|
|
983
|
-
mathPlaceholder: "E = mc^2",
|
|
984
|
-
mathDone: "完成",
|
|
985
|
-
mathCancel: "取消",
|
|
986
|
-
mathNewInline: "新建公式",
|
|
987
|
-
mathNewBlock: "插入 TeX 公式"
|
|
988
|
-
},
|
|
989
|
-
slashMenu: {
|
|
990
|
-
menuLabel: "插入块",
|
|
991
|
-
groupText: "文本",
|
|
992
|
-
groupList: "列表",
|
|
993
|
-
groupAdvanced: "高级",
|
|
994
|
-
normalText: "正文",
|
|
995
|
-
headingLabel: (level) => `标题 ${level}`,
|
|
996
|
-
bulletList: "无序列表",
|
|
997
|
-
orderedList: "有序列表",
|
|
998
|
-
taskList: "任务列表",
|
|
999
|
-
blockquote: "引用",
|
|
1000
|
-
details: "折叠块",
|
|
1001
|
-
codeBlock: "代码块",
|
|
1002
|
-
divider: "分隔线",
|
|
1003
|
-
table: "表格",
|
|
1004
|
-
inlineMath: "行内公式",
|
|
1005
|
-
blockMath: "块级公式"
|
|
1006
|
-
},
|
|
1007
|
-
chart: {
|
|
1008
|
-
tabLabel: (chartType, index) => `${chartType} ${index + 1}`,
|
|
1009
|
-
done: "完成",
|
|
1010
|
-
cancel: "取消",
|
|
1011
|
-
configLabel: "图表配置(JSON)",
|
|
1012
|
-
tableLabel: "数据表(Markdown)",
|
|
1013
|
-
editTitle: "编辑图表"
|
|
1014
|
-
},
|
|
1015
|
-
blockDrag: {
|
|
1016
|
-
dragHandle: "拖动以移动",
|
|
1017
|
-
menuLabel: "块操作",
|
|
1018
|
-
turnInto: "转换成",
|
|
1019
|
-
paragraph: "正文",
|
|
1020
|
-
headingLabel: (level) => `标题 ${level}`,
|
|
1021
|
-
bulletList: "无序列表",
|
|
1022
|
-
orderedList: "有序列表",
|
|
1023
|
-
taskList: "任务列表",
|
|
1024
|
-
blockquote: "引用",
|
|
1025
|
-
codeBlock: "代码块",
|
|
1026
|
-
copy: "复制",
|
|
1027
|
-
duplicate: "再制一份",
|
|
1028
|
-
resetFormatting: "清除格式",
|
|
1029
|
-
downloadImage: "下载图片",
|
|
1030
|
-
delete: "删除"
|
|
1031
|
-
},
|
|
1032
|
-
shortcut: {
|
|
1033
|
-
panelTitle: "快捷键",
|
|
1034
|
-
close: "关闭",
|
|
1035
|
-
colFormat: "格式",
|
|
1036
|
-
colShortcut: "快捷键",
|
|
1037
|
-
colMarkdown: "Markdown",
|
|
1038
|
-
formatGroup: "格式",
|
|
1039
|
-
insertGroup: "插入",
|
|
1040
|
-
editGroup: "编辑",
|
|
1041
|
-
bold: "加粗",
|
|
1042
|
-
italic: "斜体",
|
|
1043
|
-
strike: "删除线",
|
|
1044
|
-
underline: "下划线",
|
|
1045
|
-
inlineCode: "行内代码",
|
|
1046
|
-
highlight: "高亮",
|
|
1047
|
-
headingLabel: (level) => `标题 ${level}`,
|
|
1048
|
-
paragraph: "正文",
|
|
1049
|
-
blockquote: "引用",
|
|
1050
|
-
bulletList: "无序列表",
|
|
1051
|
-
orderedList: "有序列表",
|
|
1052
|
-
taskList: "任务列表",
|
|
1053
|
-
codeBlock: "代码块",
|
|
1054
|
-
divider: "分隔线",
|
|
1055
|
-
undo: "撤销",
|
|
1056
|
-
redo: "重做",
|
|
1057
|
-
hardBreak: "硬换行",
|
|
1058
|
-
findReplace: "查找替换",
|
|
1059
|
-
alignLeft: "左对齐",
|
|
1060
|
-
alignCenter: "居中",
|
|
1061
|
-
alignRight: "右对齐",
|
|
1062
|
-
alignJustify: "两端对齐",
|
|
1063
|
-
imageUpload: "上传图片",
|
|
1064
|
-
smartQuote: "智能引号",
|
|
1065
|
-
ellipsis: "省略号",
|
|
1066
|
-
emDash: "破折号",
|
|
1067
|
-
emoji: "表情"
|
|
1068
|
-
},
|
|
1069
|
-
characterCount: {
|
|
1070
|
-
label: "字数统计",
|
|
1071
|
-
characters: (count) => `${count} 字符`,
|
|
1072
|
-
words: (count) => `${count} 词`
|
|
1073
|
-
},
|
|
1074
|
-
emoji: {
|
|
1075
|
-
menuLabel: "表情"
|
|
1076
|
-
},
|
|
1077
|
-
link: {
|
|
1078
|
-
field: "输入链接地址",
|
|
1079
|
-
apply: "应用链接",
|
|
1080
|
-
open: "在新窗口打开",
|
|
1081
|
-
remove: "移除链接",
|
|
1082
|
-
invalid: "编辑器不接受这个地址"
|
|
1083
|
-
},
|
|
1084
|
-
palette: {
|
|
1085
|
-
none: "无",
|
|
1086
|
-
theme: "主题色"
|
|
1087
|
-
},
|
|
1088
|
-
toc: {
|
|
1089
|
-
title: "目录",
|
|
1090
|
-
expand: "展开",
|
|
1091
|
-
collapse: "收起"
|
|
1092
|
-
},
|
|
1093
|
-
codeBlock: {
|
|
1094
|
-
autoDetect: "自动识别",
|
|
1095
|
-
delete: "删除代码块",
|
|
1096
|
-
copy: "复制代码",
|
|
1097
|
-
expand: "展开代码",
|
|
1098
|
-
collapse: "收起代码",
|
|
1099
|
-
language: "代码语言"
|
|
1100
|
-
},
|
|
1101
|
-
find: {
|
|
1102
|
-
find: "查找",
|
|
1103
|
-
replace: "替换为",
|
|
1104
|
-
next: "下一处",
|
|
1105
|
-
previous: "上一处",
|
|
1106
|
-
replaceOne: "替换",
|
|
1107
|
-
replaceAll: "全部替换",
|
|
1108
|
-
close: "关闭",
|
|
1109
|
-
caseSensitive: "区分大小写",
|
|
1110
|
-
wholeWord: "全词匹配",
|
|
1111
|
-
useRegex: "正则表达式",
|
|
1112
|
-
counter: (current, total) => `${current} / ${total}`,
|
|
1113
|
-
invalidRegex: "正则无效",
|
|
1114
|
-
readOnly: "只读"
|
|
1115
|
-
},
|
|
1116
|
-
imageUpload: {
|
|
1117
|
-
dropzoneClick: "点击上传",
|
|
1118
|
-
dropzoneRest: ",或拖拽到此处",
|
|
1119
|
-
dropzoneLimits: (limit, maxSizeMb) => {
|
|
1120
|
-
const count = `最多 ${limit} 个文件`;
|
|
1121
|
-
return maxSizeMb == null ? `${count}。` : `${count},每个 ${maxSizeMb}MB。`;
|
|
1122
|
-
},
|
|
1123
|
-
uploadingCount: (count) => `正在上传 ${count} 个文件`,
|
|
1124
|
-
clearAll: "全部清除",
|
|
1125
|
-
remove: "移除",
|
|
1126
|
-
failed: "上传失败",
|
|
1127
|
-
fallbackAlt: "图片"
|
|
1128
|
-
}
|
|
1129
|
-
};
|
|
1130
|
-
const en = {
|
|
1131
|
-
toolbar: defaultToolbarLabels,
|
|
1132
|
-
slashMenu: defaultSlashMenuLabels,
|
|
1133
|
-
chart: defaultChartLabels,
|
|
1134
|
-
blockDrag: defaultBlockDragLabels,
|
|
1135
|
-
shortcut: defaultShortcutLabels,
|
|
1136
|
-
characterCount: defaultCharacterCountLabels,
|
|
1137
|
-
emoji: defaultEmojiSuggestionLabels,
|
|
1138
|
-
link: defaultLinkPopoverLabels,
|
|
1139
|
-
palette: defaultColorPaletteLabels,
|
|
1140
|
-
toc: defaultTocLabels,
|
|
1141
|
-
codeBlock: defaultCodeBlockLabels,
|
|
1142
|
-
find: defaultFindLabels,
|
|
1143
|
-
imageUpload: defaultImageUploadLabels
|
|
1144
|
-
};
|
|
1145
|
-
const bundles = { en, zh };
|
|
1146
|
-
function getLocaleBundle(locale = "en") {
|
|
1147
|
-
return bundles[locale] ?? en;
|
|
1148
|
-
}
|
|
1149
662
|
const bar$1 = "_bar_1h61e_3";
|
|
1150
663
|
const row$1 = "_row_1h61e_25";
|
|
1151
664
|
const field$1 = "_field_1h61e_43";
|
|
@@ -1159,7 +672,7 @@ const toggleOn = "_toggleOn_1h61e_135";
|
|
|
1159
672
|
const iconGroup = "_iconGroup_1h61e_29";
|
|
1160
673
|
const spacer = "_spacer_1h61e_150";
|
|
1161
674
|
const readOnly = "_readOnly_1h61e_155";
|
|
1162
|
-
const styles$
|
|
675
|
+
const styles$c = {
|
|
1163
676
|
bar: bar$1,
|
|
1164
677
|
row: row$1,
|
|
1165
678
|
field: field$1,
|
|
@@ -1283,11 +796,11 @@ function FindReplaceBar({
|
|
|
1283
796
|
});
|
|
1284
797
|
};
|
|
1285
798
|
if (!hasExtension) return null;
|
|
1286
|
-
const toggleClass = (on) => `${styles$
|
|
799
|
+
const toggleClass = (on) => `${styles$c.btn} ${styles$c.toggle}${on ? ` ${styles$c.toggleOn}` : ""}`;
|
|
1287
800
|
return /* @__PURE__ */ jsxs(
|
|
1288
801
|
"div",
|
|
1289
802
|
{
|
|
1290
|
-
className: className ? `${styles$
|
|
803
|
+
className: className ? `${styles$c.bar} ${className}` : styles$c.bar,
|
|
1291
804
|
style,
|
|
1292
805
|
"data-find-bar": "",
|
|
1293
806
|
role: "dialog",
|
|
@@ -1300,14 +813,14 @@ function FindReplaceBar({
|
|
|
1300
813
|
onClose();
|
|
1301
814
|
},
|
|
1302
815
|
children: [
|
|
1303
|
-
/* @__PURE__ */ jsxs("div", { className: styles$
|
|
1304
|
-
/* @__PURE__ */ jsxs("span", { className: styles$
|
|
1305
|
-
/* @__PURE__ */ jsx(SearchIcon, { size: 14, className: styles$
|
|
816
|
+
/* @__PURE__ */ jsxs("div", { className: styles$c.row, children: [
|
|
817
|
+
/* @__PURE__ */ jsxs("span", { className: styles$c.field, children: [
|
|
818
|
+
/* @__PURE__ */ jsx(SearchIcon, { size: 14, className: styles$c.fieldIcon }),
|
|
1306
819
|
/* @__PURE__ */ jsx(
|
|
1307
820
|
"input",
|
|
1308
821
|
{
|
|
1309
822
|
ref: inputRef,
|
|
1310
|
-
className: styles$
|
|
823
|
+
className: styles$c.input,
|
|
1311
824
|
"data-find-field": "search",
|
|
1312
825
|
value: term,
|
|
1313
826
|
onChange: (e2) => setTerm(e2.target.value),
|
|
@@ -1321,7 +834,7 @@ function FindReplaceBar({
|
|
|
1321
834
|
/* @__PURE__ */ jsx(
|
|
1322
835
|
"span",
|
|
1323
836
|
{
|
|
1324
|
-
className: `${styles$
|
|
837
|
+
className: `${styles$c.counter}${invalidPattern ? ` ${styles$c.counterInvalid}` : ""}`,
|
|
1325
838
|
"data-find-counter": "",
|
|
1326
839
|
"aria-live": "polite",
|
|
1327
840
|
title: invalidPattern ? t.invalidRegex : void 0,
|
|
@@ -1357,13 +870,13 @@ function FindReplaceBar({
|
|
|
1357
870
|
children: "ab"
|
|
1358
871
|
}
|
|
1359
872
|
),
|
|
1360
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
1361
|
-
/* @__PURE__ */ jsxs("span", { className: styles$
|
|
873
|
+
/* @__PURE__ */ jsx("span", { className: styles$c.spacer }),
|
|
874
|
+
/* @__PURE__ */ jsxs("span", { className: styles$c.iconGroup, children: [
|
|
1362
875
|
/* @__PURE__ */ jsx(
|
|
1363
876
|
"button",
|
|
1364
877
|
{
|
|
1365
878
|
type: "button",
|
|
1366
|
-
className: styles$
|
|
879
|
+
className: styles$c.btn,
|
|
1367
880
|
"data-find-action": "previous",
|
|
1368
881
|
title: t.previous,
|
|
1369
882
|
"aria-label": t.previous,
|
|
@@ -1377,7 +890,7 @@ function FindReplaceBar({
|
|
|
1377
890
|
"button",
|
|
1378
891
|
{
|
|
1379
892
|
type: "button",
|
|
1380
|
-
className: styles$
|
|
893
|
+
className: styles$c.btn,
|
|
1381
894
|
"data-find-action": "next",
|
|
1382
895
|
title: t.next,
|
|
1383
896
|
"aria-label": t.next,
|
|
@@ -1391,7 +904,7 @@ function FindReplaceBar({
|
|
|
1391
904
|
"button",
|
|
1392
905
|
{
|
|
1393
906
|
type: "button",
|
|
1394
|
-
className: styles$
|
|
907
|
+
className: styles$c.btn,
|
|
1395
908
|
"data-find-action": "close",
|
|
1396
909
|
title: t.close,
|
|
1397
910
|
"aria-label": t.close,
|
|
@@ -1401,11 +914,11 @@ function FindReplaceBar({
|
|
|
1401
914
|
)
|
|
1402
915
|
] })
|
|
1403
916
|
] }),
|
|
1404
|
-
editor.isEditable ? /* @__PURE__ */ jsxs("div", { className: styles$
|
|
1405
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
917
|
+
editor.isEditable ? /* @__PURE__ */ jsxs("div", { className: styles$c.row, children: [
|
|
918
|
+
/* @__PURE__ */ jsx("span", { className: styles$c.field, children: /* @__PURE__ */ jsx(
|
|
1406
919
|
"input",
|
|
1407
920
|
{
|
|
1408
|
-
className: styles$
|
|
921
|
+
className: styles$c.input,
|
|
1409
922
|
"data-find-field": "replace",
|
|
1410
923
|
value: replaceTerm,
|
|
1411
924
|
onChange: (e2) => setReplaceTerm(e2.target.value),
|
|
@@ -1415,12 +928,12 @@ function FindReplaceBar({
|
|
|
1415
928
|
spellCheck: false
|
|
1416
929
|
}
|
|
1417
930
|
) }),
|
|
1418
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
931
|
+
/* @__PURE__ */ jsx("span", { className: styles$c.spacer }),
|
|
1419
932
|
/* @__PURE__ */ jsx(
|
|
1420
933
|
"button",
|
|
1421
934
|
{
|
|
1422
935
|
type: "button",
|
|
1423
|
-
className: styles$
|
|
936
|
+
className: styles$c.btn,
|
|
1424
937
|
"data-find-action": "replace",
|
|
1425
938
|
title: t.replaceOne,
|
|
1426
939
|
"aria-label": t.replaceOne,
|
|
@@ -1434,7 +947,7 @@ function FindReplaceBar({
|
|
|
1434
947
|
"button",
|
|
1435
948
|
{
|
|
1436
949
|
type: "button",
|
|
1437
|
-
className: styles$
|
|
950
|
+
className: styles$c.btn,
|
|
1438
951
|
"data-find-action": "replace-all",
|
|
1439
952
|
title: t.replaceAll,
|
|
1440
953
|
"aria-label": t.replaceAll,
|
|
@@ -1444,7 +957,7 @@ function FindReplaceBar({
|
|
|
1444
957
|
children: /* @__PURE__ */ jsx(ReplaceAllIcon, { size: 16 })
|
|
1445
958
|
}
|
|
1446
959
|
)
|
|
1447
|
-
] }) : /* @__PURE__ */ jsx("div", { className: styles$
|
|
960
|
+
] }) : /* @__PURE__ */ jsx("div", { className: styles$c.row, children: /* @__PURE__ */ jsx("span", { className: styles$c.readOnly, children: t.readOnly }) })
|
|
1448
961
|
]
|
|
1449
962
|
}
|
|
1450
963
|
);
|
|
@@ -1603,7 +1116,7 @@ const textMain = "_textMain_1k6n1_100";
|
|
|
1603
1116
|
const textEm = "_textEm_1k6n1_107";
|
|
1604
1117
|
const subtext = "_subtext_1k6n1_112";
|
|
1605
1118
|
const previews = "_previews_1k6n1_121";
|
|
1606
|
-
const header$
|
|
1119
|
+
const header$1 = "_header_1k6n1_127";
|
|
1607
1120
|
const clearAll = "_clearAll_1k6n1_139";
|
|
1608
1121
|
const preview = "_preview_1k6n1_121";
|
|
1609
1122
|
const progress = "_progress_1k6n1_161";
|
|
@@ -1615,7 +1128,7 @@ const fileName = "_fileName_1k6n1_205";
|
|
|
1615
1128
|
const actions = "_actions_1k6n1_215";
|
|
1616
1129
|
const progressText = "_progressText_1k6n1_222";
|
|
1617
1130
|
const remove = "_remove_1k6n1_228";
|
|
1618
|
-
const styles$
|
|
1131
|
+
const styles$b = {
|
|
1619
1132
|
wrap,
|
|
1620
1133
|
dropzone,
|
|
1621
1134
|
dragActive,
|
|
@@ -1629,7 +1142,7 @@ const styles$c = {
|
|
|
1629
1142
|
textEm,
|
|
1630
1143
|
subtext,
|
|
1631
1144
|
previews,
|
|
1632
|
-
header: header$
|
|
1145
|
+
header: header$1,
|
|
1633
1146
|
clearAll,
|
|
1634
1147
|
preview,
|
|
1635
1148
|
progress,
|
|
@@ -1790,14 +1303,14 @@ function ImageUploadView(props) {
|
|
|
1790
1303
|
const hasFiles = items.length > 0;
|
|
1791
1304
|
const maxSizeMb = maxSize > 0 ? toMb(maxSize) : null;
|
|
1792
1305
|
const dropzoneClass = [
|
|
1793
|
-
styles$
|
|
1794
|
-
dragActive2 ? styles$
|
|
1795
|
-
dragOver2 ? styles$
|
|
1306
|
+
styles$b.dropzone,
|
|
1307
|
+
dragActive2 ? styles$b.dragActive : "",
|
|
1308
|
+
dragOver2 ? styles$b.dragOver : ""
|
|
1796
1309
|
].filter(Boolean).join(" ");
|
|
1797
1310
|
return /* @__PURE__ */ jsxs(
|
|
1798
1311
|
NodeViewWrapper,
|
|
1799
1312
|
{
|
|
1800
|
-
className: styles$
|
|
1313
|
+
className: styles$b.wrap,
|
|
1801
1314
|
"data-image-upload": "",
|
|
1802
1315
|
tabIndex: editable ? 0 : void 0,
|
|
1803
1316
|
onClick: openPicker,
|
|
@@ -1829,28 +1342,28 @@ function ImageUploadView(props) {
|
|
|
1829
1342
|
},
|
|
1830
1343
|
onDrop,
|
|
1831
1344
|
children: [
|
|
1832
|
-
/* @__PURE__ */ jsxs("span", { className: styles$
|
|
1345
|
+
/* @__PURE__ */ jsxs("span", { className: styles$b.fileShape, "aria-hidden": true, children: [
|
|
1833
1346
|
/* @__PURE__ */ jsx(FileDocIcon, {}),
|
|
1834
1347
|
/* @__PURE__ */ jsx(FileCornerIcon, {}),
|
|
1835
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
1348
|
+
/* @__PURE__ */ jsx("span", { className: styles$b.fileBadge, children: /* @__PURE__ */ jsx(CloudUploadIcon, {}) })
|
|
1836
1349
|
] }),
|
|
1837
|
-
/* @__PURE__ */ jsxs("span", { className: styles$
|
|
1838
|
-
/* @__PURE__ */ jsxs("span", { className: styles$
|
|
1839
|
-
/* @__PURE__ */ jsx("em", { className: styles$
|
|
1350
|
+
/* @__PURE__ */ jsxs("span", { className: styles$b.text, children: [
|
|
1351
|
+
/* @__PURE__ */ jsxs("span", { className: styles$b.textMain, children: [
|
|
1352
|
+
/* @__PURE__ */ jsx("em", { className: styles$b.textEm, children: labels.dropzoneClick }),
|
|
1840
1353
|
labels.dropzoneRest
|
|
1841
1354
|
] }),
|
|
1842
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
1355
|
+
/* @__PURE__ */ jsx("span", { className: styles$b.subtext, children: labels.dropzoneLimits(limit, maxSizeMb) })
|
|
1843
1356
|
] })
|
|
1844
1357
|
]
|
|
1845
1358
|
}
|
|
1846
|
-
) : /* @__PURE__ */ jsxs("div", { className: styles$
|
|
1847
|
-
items.length > 1 && /* @__PURE__ */ jsxs("div", { className: styles$
|
|
1359
|
+
) : /* @__PURE__ */ jsxs("div", { className: styles$b.previews, "data-image-upload-list": "", children: [
|
|
1360
|
+
items.length > 1 && /* @__PURE__ */ jsxs("div", { className: styles$b.header, children: [
|
|
1848
1361
|
/* @__PURE__ */ jsx("span", { children: labels.uploadingCount(items.length) }),
|
|
1849
1362
|
/* @__PURE__ */ jsx(
|
|
1850
1363
|
"button",
|
|
1851
1364
|
{
|
|
1852
1365
|
type: "button",
|
|
1853
|
-
className: styles$
|
|
1366
|
+
className: styles$b.clearAll,
|
|
1854
1367
|
onClick: (e2) => {
|
|
1855
1368
|
e2.stopPropagation();
|
|
1856
1369
|
clearAll2();
|
|
@@ -1862,27 +1375,27 @@ function ImageUploadView(props) {
|
|
|
1862
1375
|
items.map((it) => /* @__PURE__ */ jsxs(
|
|
1863
1376
|
"div",
|
|
1864
1377
|
{
|
|
1865
|
-
className: styles$
|
|
1378
|
+
className: styles$b.preview,
|
|
1866
1379
|
"data-image-upload-item": "",
|
|
1867
1380
|
children: [
|
|
1868
1381
|
it.status === "uploading" && /* @__PURE__ */ jsx(
|
|
1869
1382
|
"div",
|
|
1870
1383
|
{
|
|
1871
|
-
className: styles$
|
|
1384
|
+
className: styles$b.progress,
|
|
1872
1385
|
style: { width: `${it.progress}%` },
|
|
1873
1386
|
"aria-hidden": true
|
|
1874
1387
|
}
|
|
1875
1388
|
),
|
|
1876
|
-
/* @__PURE__ */ jsxs("div", { className: styles$
|
|
1877
|
-
/* @__PURE__ */ jsxs("span", { className: styles$
|
|
1878
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
1879
|
-
/* @__PURE__ */ jsxs("span", { className: styles$
|
|
1880
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
1881
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
1389
|
+
/* @__PURE__ */ jsxs("div", { className: styles$b.previewContent, children: [
|
|
1390
|
+
/* @__PURE__ */ jsxs("span", { className: styles$b.fileInfo, children: [
|
|
1391
|
+
/* @__PURE__ */ jsx("span", { className: styles$b.fileIcon, "aria-hidden": true, children: /* @__PURE__ */ jsx(CloudUploadIcon, {}) }),
|
|
1392
|
+
/* @__PURE__ */ jsxs("span", { className: styles$b.details, children: [
|
|
1393
|
+
/* @__PURE__ */ jsx("span", { className: styles$b.fileName, children: it.file.name }),
|
|
1394
|
+
/* @__PURE__ */ jsx("span", { className: styles$b.subtext, children: it.status === "error" ? labels.failed : formatFileSize(it.file.size) })
|
|
1882
1395
|
] })
|
|
1883
1396
|
] }),
|
|
1884
|
-
/* @__PURE__ */ jsxs("span", { className: styles$
|
|
1885
|
-
it.status === "uploading" && /* @__PURE__ */ jsxs("span", { className: styles$
|
|
1397
|
+
/* @__PURE__ */ jsxs("span", { className: styles$b.actions, children: [
|
|
1398
|
+
it.status === "uploading" && /* @__PURE__ */ jsxs("span", { className: styles$b.progressText, children: [
|
|
1886
1399
|
Math.round(it.progress),
|
|
1887
1400
|
"%"
|
|
1888
1401
|
] }),
|
|
@@ -1890,7 +1403,7 @@ function ImageUploadView(props) {
|
|
|
1890
1403
|
"button",
|
|
1891
1404
|
{
|
|
1892
1405
|
type: "button",
|
|
1893
|
-
className: styles$
|
|
1406
|
+
className: styles$b.remove,
|
|
1894
1407
|
"data-image-upload-remove": "",
|
|
1895
1408
|
title: labels.remove,
|
|
1896
1409
|
"aria-label": labels.remove,
|
|
@@ -1949,7 +1462,7 @@ function FileDocIcon() {
|
|
|
1949
1462
|
viewBox: "0 0 43 57",
|
|
1950
1463
|
fill: "none",
|
|
1951
1464
|
"aria-hidden": true,
|
|
1952
|
-
className: styles$
|
|
1465
|
+
className: styles$b.fileShapeDoc,
|
|
1953
1466
|
children: /* @__PURE__ */ jsx(
|
|
1954
1467
|
"path",
|
|
1955
1468
|
{
|
|
@@ -1972,7 +1485,7 @@ function FileCornerIcon() {
|
|
|
1972
1485
|
viewBox: "0 0 10 10",
|
|
1973
1486
|
fill: "currentColor",
|
|
1974
1487
|
"aria-hidden": true,
|
|
1975
|
-
className: styles$
|
|
1488
|
+
className: styles$b.fileShapeCorner,
|
|
1976
1489
|
children: /* @__PURE__ */ jsx("path", { d: "M0 0.75H0.343146C1.40401 0.75 2.42143 1.17143 3.17157 1.92157L8.82843 7.57843C9.57857 8.32857 10 9.34599 10 10.4069V10.75H4C1.79086 10.75 0 8.95914 0 6.75V0.75Z" })
|
|
1977
1490
|
}
|
|
1978
1491
|
);
|
|
@@ -2103,7 +1616,7 @@ const tab = "_tab_xhti8_32";
|
|
|
2103
1616
|
const tabActive = "_tabActive_xhti8_40";
|
|
2104
1617
|
const cell = "_cell_xhti8_71";
|
|
2105
1618
|
const cellActive = "_cellActive_xhti8_72";
|
|
2106
|
-
const styles$
|
|
1619
|
+
const styles$a = {
|
|
2107
1620
|
popupHost: popupHost$1,
|
|
2108
1621
|
panel: panel$1,
|
|
2109
1622
|
menu: menu$3,
|
|
@@ -2243,13 +1756,13 @@ const EmojiSuggestionPopup = forwardRef(function EmojiSuggestionPopup2({ items,
|
|
|
2243
1756
|
[visible, index, command]
|
|
2244
1757
|
);
|
|
2245
1758
|
if (!visible.length) return null;
|
|
2246
|
-
return /* @__PURE__ */ jsxs("div", { className: styles$
|
|
1759
|
+
return /* @__PURE__ */ jsxs("div", { className: styles$a.panel, children: [
|
|
2247
1760
|
/* @__PURE__ */ jsx(
|
|
2248
1761
|
"div",
|
|
2249
1762
|
{
|
|
2250
1763
|
id: gridId,
|
|
2251
1764
|
ref: menuRef,
|
|
2252
|
-
className: styles$
|
|
1765
|
+
className: styles$a.menu,
|
|
2253
1766
|
role: "listbox",
|
|
2254
1767
|
"aria-label": menuLabel,
|
|
2255
1768
|
children: visible.map((item2, i) => {
|
|
@@ -2265,7 +1778,7 @@ const EmojiSuggestionPopup = forwardRef(function EmojiSuggestionPopup2({ items,
|
|
|
2265
1778
|
"aria-label": shortcode,
|
|
2266
1779
|
"aria-selected": i === index,
|
|
2267
1780
|
title: shortcode,
|
|
2268
|
-
className: i === index ? styles$
|
|
1781
|
+
className: i === index ? styles$a.cellActive : styles$a.cell,
|
|
2269
1782
|
tabIndex: -1,
|
|
2270
1783
|
onMouseEnter: () => setIndex(i),
|
|
2271
1784
|
onMouseDown: (event) => {
|
|
@@ -2279,7 +1792,7 @@ const EmojiSuggestionPopup = forwardRef(function EmojiSuggestionPopup2({ items,
|
|
|
2279
1792
|
})
|
|
2280
1793
|
}
|
|
2281
1794
|
),
|
|
2282
|
-
browsing ? /* @__PURE__ */ jsx("div", { className: styles$
|
|
1795
|
+
browsing ? /* @__PURE__ */ jsx("div", { className: styles$a.tabs, role: "tablist", "aria-label": menuLabel, children: categories.map((category) => {
|
|
2283
1796
|
const selected = category.id === activeId;
|
|
2284
1797
|
return /* @__PURE__ */ jsx(
|
|
2285
1798
|
"button",
|
|
@@ -2290,7 +1803,7 @@ const EmojiSuggestionPopup = forwardRef(function EmojiSuggestionPopup2({ items,
|
|
|
2290
1803
|
"aria-controls": gridId,
|
|
2291
1804
|
"aria-label": category.label,
|
|
2292
1805
|
title: category.label,
|
|
2293
|
-
className: selected ? styles$
|
|
1806
|
+
className: selected ? styles$a.tabActive : styles$a.tab,
|
|
2294
1807
|
tabIndex: -1,
|
|
2295
1808
|
onMouseDown: (event) => {
|
|
2296
1809
|
event.preventDefault();
|
|
@@ -2337,7 +1850,7 @@ function configureEmojiSuggestion(extension, enabled) {
|
|
|
2337
1850
|
menuLabel: getEditorBundle(props.editor).emoji.menuLabel,
|
|
2338
1851
|
command: props.command
|
|
2339
1852
|
},
|
|
2340
|
-
className: styles$
|
|
1853
|
+
className: styles$a.popupHost
|
|
2341
1854
|
});
|
|
2342
1855
|
copyThemeVars(props.editor.view.dom, renderer.element);
|
|
2343
1856
|
unmountPopup = props.mount(renderer.element);
|
|
@@ -2379,15 +1892,15 @@ function countWords(text2) {
|
|
|
2379
1892
|
const popupHost = "_popupHost_1noza_11";
|
|
2380
1893
|
const menu$2 = "_menu_1noza_1";
|
|
2381
1894
|
const groupLabel$1 = "_groupLabel_1noza_43";
|
|
2382
|
-
const item$
|
|
1895
|
+
const item$1 = "_item_1noza_53";
|
|
2383
1896
|
const itemActive$1 = "_itemActive_1noza_54";
|
|
2384
1897
|
const itemIcon$1 = "_itemIcon_1noza_79";
|
|
2385
1898
|
const itemTitle = "_itemTitle_1noza_102";
|
|
2386
|
-
const styles$
|
|
1899
|
+
const styles$9 = {
|
|
2387
1900
|
popupHost,
|
|
2388
1901
|
menu: menu$2,
|
|
2389
1902
|
groupLabel: groupLabel$1,
|
|
2390
|
-
item: item$
|
|
1903
|
+
item: item$1,
|
|
2391
1904
|
itemActive: itemActive$1,
|
|
2392
1905
|
itemIcon: itemIcon$1,
|
|
2393
1906
|
itemTitle
|
|
@@ -2584,11 +2097,11 @@ const SlashMenuPopup = forwardRef(function SlashMenuPopup2({ items, query, menuL
|
|
|
2584
2097
|
);
|
|
2585
2098
|
if (!items.length) return null;
|
|
2586
2099
|
let optionIndex = -1;
|
|
2587
|
-
return /* @__PURE__ */ jsx("div", { className: styles$
|
|
2100
|
+
return /* @__PURE__ */ jsx("div", { className: styles$9.menu, role: "listbox", "aria-label": menuLabel, children: withGroupHeaders(items).map(([header2, item2]) => {
|
|
2588
2101
|
optionIndex += 1;
|
|
2589
2102
|
const i = optionIndex;
|
|
2590
2103
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2591
|
-
header2 !== null ? /* @__PURE__ */ jsx("div", { className: styles$
|
|
2104
|
+
header2 !== null ? /* @__PURE__ */ jsx("div", { className: styles$9.groupLabel, "aria-hidden": "true", children: header2 }) : null,
|
|
2592
2105
|
/* @__PURE__ */ jsxs(
|
|
2593
2106
|
"button",
|
|
2594
2107
|
{
|
|
@@ -2596,7 +2109,7 @@ const SlashMenuPopup = forwardRef(function SlashMenuPopup2({ items, query, menuL
|
|
|
2596
2109
|
role: "option",
|
|
2597
2110
|
"aria-selected": i === index,
|
|
2598
2111
|
title: item2.title,
|
|
2599
|
-
className: i === index ? styles$
|
|
2112
|
+
className: i === index ? styles$9.itemActive : styles$9.item,
|
|
2600
2113
|
tabIndex: -1,
|
|
2601
2114
|
onMouseEnter: () => setIndex(i),
|
|
2602
2115
|
onMouseDown: (e2) => {
|
|
@@ -2604,8 +2117,8 @@ const SlashMenuPopup = forwardRef(function SlashMenuPopup2({ items, query, menuL
|
|
|
2604
2117
|
command(item2);
|
|
2605
2118
|
},
|
|
2606
2119
|
children: [
|
|
2607
|
-
item2.icon != null ? /* @__PURE__ */ jsx("span", { className: styles$
|
|
2608
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
2120
|
+
item2.icon != null ? /* @__PURE__ */ jsx("span", { className: styles$9.itemIcon, "aria-hidden": "true", children: item2.icon }) : /* @__PURE__ */ jsx("span", { className: styles$9.itemIcon, "aria-hidden": "true" }),
|
|
2121
|
+
/* @__PURE__ */ jsx("span", { className: styles$9.itemTitle, children: item2.title })
|
|
2609
2122
|
]
|
|
2610
2123
|
}
|
|
2611
2124
|
)
|
|
@@ -2657,7 +2170,7 @@ const SlashMenu = Extension.create({
|
|
|
2657
2170
|
menuLabel: getEditorBundle(props.editor).slashMenu.menuLabel,
|
|
2658
2171
|
command: props.command
|
|
2659
2172
|
},
|
|
2660
|
-
className: styles$
|
|
2173
|
+
className: styles$9.popupHost
|
|
2661
2174
|
}
|
|
2662
2175
|
);
|
|
2663
2176
|
const pmStyle = getComputedStyle(props.editor.view.dom);
|
|
@@ -2710,7 +2223,7 @@ const rowKeys = "_rowKeys_ljnq6_127";
|
|
|
2710
2223
|
const rowMd = "_rowMd_ljnq6_128";
|
|
2711
2224
|
const keycap = "_keycap_ljnq6_138";
|
|
2712
2225
|
const none = "_none_ljnq6_163";
|
|
2713
|
-
const styles$
|
|
2226
|
+
const styles$8 = {
|
|
2714
2227
|
drawer,
|
|
2715
2228
|
closeBtn,
|
|
2716
2229
|
head,
|
|
@@ -2814,7 +2327,7 @@ function ShortcutPanel({
|
|
|
2814
2327
|
return /* @__PURE__ */ jsxs(
|
|
2815
2328
|
"aside",
|
|
2816
2329
|
{
|
|
2817
|
-
className: styles$
|
|
2330
|
+
className: styles$8.drawer,
|
|
2818
2331
|
role: "dialog",
|
|
2819
2332
|
"aria-modal": "false",
|
|
2820
2333
|
"aria-label": t.panelTitle,
|
|
@@ -2823,27 +2336,27 @@ function ShortcutPanel({
|
|
|
2823
2336
|
"button",
|
|
2824
2337
|
{
|
|
2825
2338
|
type: "button",
|
|
2826
|
-
className: styles$
|
|
2339
|
+
className: styles$8.closeBtn,
|
|
2827
2340
|
title: t.close,
|
|
2828
2341
|
"aria-label": t.close,
|
|
2829
2342
|
onClick: onClose,
|
|
2830
2343
|
children: /* @__PURE__ */ jsx(XIcon, { size: 16 })
|
|
2831
2344
|
}
|
|
2832
2345
|
),
|
|
2833
|
-
/* @__PURE__ */ jsxs("div", { className: styles$
|
|
2834
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
2835
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
2836
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
2346
|
+
/* @__PURE__ */ jsxs("div", { className: styles$8.head, children: [
|
|
2347
|
+
/* @__PURE__ */ jsx("span", { className: styles$8.colFormat, children: t.colFormat }),
|
|
2348
|
+
/* @__PURE__ */ jsx("span", { className: styles$8.colShortcut, children: t.colShortcut }),
|
|
2349
|
+
/* @__PURE__ */ jsx("span", { className: styles$8.colMarkdown, children: t.colMarkdown })
|
|
2837
2350
|
] }),
|
|
2838
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
2839
|
-
/* @__PURE__ */ jsx("h3", { className: styles$
|
|
2840
|
-
group2.entries.map((entry) => /* @__PURE__ */ jsxs("div", { className: styles$
|
|
2841
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
2842
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
2843
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
2844
|
-
/* @__PURE__ */ jsx("kbd", { className: styles$
|
|
2845
|
-
entry.markdown.terminator ? /* @__PURE__ */ jsx("kbd", { className: styles$
|
|
2846
|
-
] }) : /* @__PURE__ */ jsx("span", { className: styles$
|
|
2351
|
+
/* @__PURE__ */ jsx("div", { className: styles$8.body, children: groups.map((group2) => /* @__PURE__ */ jsxs("section", { className: styles$8.group, children: [
|
|
2352
|
+
/* @__PURE__ */ jsx("h3", { className: styles$8.groupTitle, children: group2.title }),
|
|
2353
|
+
group2.entries.map((entry) => /* @__PURE__ */ jsxs("div", { className: styles$8.row, children: [
|
|
2354
|
+
/* @__PURE__ */ jsx("span", { className: styles$8.rowLabel, children: entry.label }),
|
|
2355
|
+
/* @__PURE__ */ jsx("span", { className: styles$8.rowKeys, children: entry.keys ? entry.keys.map((key, i) => /* @__PURE__ */ jsx("kbd", { className: styles$8.keycap, children: keycapText(key, mac) }, i)) : /* @__PURE__ */ jsx("span", { className: styles$8.none, children: "—" }) }),
|
|
2356
|
+
/* @__PURE__ */ jsx("span", { className: styles$8.rowMd, children: entry.markdown ? /* @__PURE__ */ jsxs(Fragment$2, { children: [
|
|
2357
|
+
/* @__PURE__ */ jsx("kbd", { className: styles$8.keycap, children: entry.markdown.marker }),
|
|
2358
|
+
entry.markdown.terminator ? /* @__PURE__ */ jsx("kbd", { className: styles$8.keycap, children: entry.markdown.terminator }) : null
|
|
2359
|
+
] }) : /* @__PURE__ */ jsx("span", { className: styles$8.none, children: "—" }) })
|
|
2847
2360
|
] }, entry.id))
|
|
2848
2361
|
] }, group2.id)) })
|
|
2849
2362
|
]
|
|
@@ -3019,7 +2532,7 @@ function ChartView({
|
|
|
3019
2532
|
}) {
|
|
3020
2533
|
const canvasRef = useRef(null);
|
|
3021
2534
|
const chartRef = useRef(null);
|
|
3022
|
-
const [
|
|
2535
|
+
const [active, setActive2] = useState(0);
|
|
3023
2536
|
const labels = useEditorBundle(editor).chart;
|
|
3024
2537
|
const payload = useMemo(
|
|
3025
2538
|
() => ({
|
|
@@ -3031,7 +2544,7 @@ function ChartView({
|
|
|
3031
2544
|
);
|
|
3032
2545
|
const theme = extension.options.chartTheme ?? null;
|
|
3033
2546
|
const configs = payload.config;
|
|
3034
|
-
const safeIndex = Math.min(
|
|
2547
|
+
const safeIndex = Math.min(active, Math.max(0, configs.length - 1));
|
|
3035
2548
|
const config = configs[safeIndex];
|
|
3036
2549
|
const height = (config == null ? void 0 : config.height) ?? 320;
|
|
3037
2550
|
const canSelect = Boolean(editor == null ? void 0 : editor.isEditable);
|
|
@@ -3087,7 +2600,7 @@ function ChartView({
|
|
|
3087
2600
|
children: [
|
|
3088
2601
|
(config == null ? void 0 : config.title) ? /* @__PURE__ */ jsx("div", { className: "tmr-chart-title", children: config.title }) : null,
|
|
3089
2602
|
(config == null ? void 0 : config.dataTime) ? /* @__PURE__ */ jsx("div", { className: "tmr-chart-time", children: config.dataTime }) : null,
|
|
3090
|
-
configs.length > 1 ? /* @__PURE__ */ jsx("div", { className: "tmr-chart-tabs", role: "tablist", children: configs.map((
|
|
2603
|
+
configs.length > 1 ? /* @__PURE__ */ jsx("div", { className: "tmr-chart-tabs", role: "tablist", children: configs.map((c2, i) => /* @__PURE__ */ jsx(
|
|
3091
2604
|
"button",
|
|
3092
2605
|
{
|
|
3093
2606
|
type: "button",
|
|
@@ -3100,9 +2613,9 @@ function ChartView({
|
|
|
3100
2613
|
e2.stopPropagation();
|
|
3101
2614
|
setActive2(i);
|
|
3102
2615
|
},
|
|
3103
|
-
children: tabLabel(
|
|
2616
|
+
children: tabLabel(c2.chartType, c2.title, i, labels.tabLabel)
|
|
3104
2617
|
},
|
|
3105
|
-
`${
|
|
2618
|
+
`${c2.chartType}-${i}`
|
|
3106
2619
|
)) }) : null,
|
|
3107
2620
|
/* @__PURE__ */ jsx("div", { className: "tmr-chart-canvas-host", style: { height }, children: /* @__PURE__ */ jsx("canvas", { ref: canvasRef }) })
|
|
3108
2621
|
]
|
|
@@ -3125,7 +2638,7 @@ function createChart(options = {}) {
|
|
|
3125
2638
|
});
|
|
3126
2639
|
}
|
|
3127
2640
|
const wrapper = "_wrapper_k8th1_2";
|
|
3128
|
-
const header
|
|
2641
|
+
const header = "_header_k8th1_18";
|
|
3129
2642
|
const langTrigger = "_langTrigger_k8th1_28";
|
|
3130
2643
|
const langChevron = "_langChevron_k8th1_50";
|
|
3131
2644
|
const readonlyHeader = "_readonlyHeader_k8th1_56";
|
|
@@ -3143,9 +2656,9 @@ const gutterLine = "_gutterLine_k8th1_184";
|
|
|
3143
2656
|
const readonlyActions = "_readonlyActions_k8th1_188";
|
|
3144
2657
|
const actionBtn = "_actionBtn_k8th1_194";
|
|
3145
2658
|
const langBraces = "_langBraces_k8th1_213";
|
|
3146
|
-
const styles$
|
|
2659
|
+
const styles$7 = {
|
|
3147
2660
|
wrapper,
|
|
3148
|
-
header
|
|
2661
|
+
header,
|
|
3149
2662
|
langTrigger,
|
|
3150
2663
|
langChevron,
|
|
3151
2664
|
readonlyHeader,
|
|
@@ -3238,29 +2751,29 @@ function CodeBlockView({
|
|
|
3238
2751
|
ta.remove();
|
|
3239
2752
|
};
|
|
3240
2753
|
const wrapperClass = [
|
|
3241
|
-
styles$
|
|
3242
|
-
readonly2 ? styles$
|
|
3243
|
-
folded2 ? styles$
|
|
2754
|
+
styles$7.wrapper,
|
|
2755
|
+
readonly2 ? styles$7.readonly : "",
|
|
2756
|
+
folded2 ? styles$7.folded : ""
|
|
3244
2757
|
].filter(Boolean).join(" ");
|
|
3245
2758
|
return /* @__PURE__ */ jsxs(NodeViewWrapper, { className: wrapperClass, children: [
|
|
3246
|
-
editable ? /* @__PURE__ */ jsxs("div", { className: styles$
|
|
2759
|
+
editable ? /* @__PURE__ */ jsxs("div", { className: styles$7.header, contentEditable: false, children: [
|
|
3247
2760
|
/* @__PURE__ */ jsxs(DropdownMenu.Root, { children: [
|
|
3248
2761
|
/* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
3249
2762
|
"button",
|
|
3250
2763
|
{
|
|
3251
2764
|
type: "button",
|
|
3252
|
-
className: styles$
|
|
2765
|
+
className: styles$7.langTrigger,
|
|
3253
2766
|
"aria-label": labels.language,
|
|
3254
2767
|
children: [
|
|
3255
2768
|
/* @__PURE__ */ jsx("span", { children: currentLabel }),
|
|
3256
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 14, className: styles$
|
|
2769
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 14, className: styles$7.langChevron })
|
|
3257
2770
|
]
|
|
3258
2771
|
}
|
|
3259
2772
|
) }),
|
|
3260
2773
|
/* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(
|
|
3261
2774
|
DropdownMenu.Content,
|
|
3262
2775
|
{
|
|
3263
|
-
className: styles$
|
|
2776
|
+
className: styles$7.langMenu,
|
|
3264
2777
|
sideOffset: 4,
|
|
3265
2778
|
align: "end",
|
|
3266
2779
|
children: LANGUAGES.map((l) => {
|
|
@@ -3269,10 +2782,10 @@ function CodeBlockView({
|
|
|
3269
2782
|
return /* @__PURE__ */ jsxs(
|
|
3270
2783
|
DropdownMenu.Item,
|
|
3271
2784
|
{
|
|
3272
|
-
className: `${styles$
|
|
2785
|
+
className: `${styles$7.langItem}${selected ? ` ${styles$7.langItemSelected}` : ""}`,
|
|
3273
2786
|
onSelect: () => updateAttributes({ language: l.value }),
|
|
3274
2787
|
children: [
|
|
3275
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
2788
|
+
/* @__PURE__ */ jsx("span", { className: styles$7.langItemCheck, children: selected ? /* @__PURE__ */ jsx(CheckIcon, { size: 14 }) : null }),
|
|
3276
2789
|
optionLabel
|
|
3277
2790
|
]
|
|
3278
2791
|
},
|
|
@@ -3286,7 +2799,7 @@ function CodeBlockView({
|
|
|
3286
2799
|
"button",
|
|
3287
2800
|
{
|
|
3288
2801
|
type: "button",
|
|
3289
|
-
className: styles$
|
|
2802
|
+
className: styles$7.deleteBtn,
|
|
3290
2803
|
title: labels.delete,
|
|
3291
2804
|
"aria-label": labels.delete,
|
|
3292
2805
|
onClick: () => deleteNode(),
|
|
@@ -3295,17 +2808,17 @@ function CodeBlockView({
|
|
|
3295
2808
|
)
|
|
3296
2809
|
] }) : (
|
|
3297
2810
|
// 只读头部:左侧语言标签,右侧复制 + 展开收起(展开后按钮保留,供收回)
|
|
3298
|
-
/* @__PURE__ */ jsxs("div", { className: styles$
|
|
3299
|
-
/* @__PURE__ */ jsxs("span", { className: styles$
|
|
3300
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
2811
|
+
/* @__PURE__ */ jsxs("div", { className: styles$7.readonlyHeader, contentEditable: false, children: [
|
|
2812
|
+
/* @__PURE__ */ jsxs("span", { className: styles$7.langBadge, children: [
|
|
2813
|
+
/* @__PURE__ */ jsx("span", { className: styles$7.langBraces, children: "{}" }),
|
|
3301
2814
|
currentLabel
|
|
3302
2815
|
] }),
|
|
3303
|
-
/* @__PURE__ */ jsxs("span", { className: styles$
|
|
2816
|
+
/* @__PURE__ */ jsxs("span", { className: styles$7.readonlyActions, children: [
|
|
3304
2817
|
/* @__PURE__ */ jsx(
|
|
3305
2818
|
"button",
|
|
3306
2819
|
{
|
|
3307
2820
|
type: "button",
|
|
3308
|
-
className: styles$
|
|
2821
|
+
className: styles$7.actionBtn,
|
|
3309
2822
|
onClick: handleCopy,
|
|
3310
2823
|
"aria-label": labels.copy,
|
|
3311
2824
|
title: labels.copy,
|
|
@@ -3316,7 +2829,7 @@ function CodeBlockView({
|
|
|
3316
2829
|
"button",
|
|
3317
2830
|
{
|
|
3318
2831
|
type: "button",
|
|
3319
|
-
className: styles$
|
|
2832
|
+
className: styles$7.actionBtn,
|
|
3320
2833
|
onClick: () => setFolded((v) => !v),
|
|
3321
2834
|
"aria-label": folded2 ? labels.expand : labels.collapse,
|
|
3322
2835
|
title: folded2 ? labels.expand : labels.collapse,
|
|
@@ -3327,14 +2840,14 @@ function CodeBlockView({
|
|
|
3327
2840
|
] })
|
|
3328
2841
|
] })
|
|
3329
2842
|
),
|
|
3330
|
-
/* @__PURE__ */ jsxs("pre", { ref: preRef, className: styles$
|
|
2843
|
+
/* @__PURE__ */ jsxs("pre", { ref: preRef, className: styles$7.pre, children: [
|
|
3331
2844
|
readonly2 ? /* @__PURE__ */ jsx(
|
|
3332
2845
|
"span",
|
|
3333
2846
|
{
|
|
3334
|
-
className: styles$
|
|
2847
|
+
className: styles$7.gutter,
|
|
3335
2848
|
contentEditable: false,
|
|
3336
2849
|
"aria-hidden": "true",
|
|
3337
|
-
children: Array.from({ length: lineCount }, (_, i) => /* @__PURE__ */ jsx("span", { className: styles$
|
|
2850
|
+
children: Array.from({ length: lineCount }, (_, i) => /* @__PURE__ */ jsx("span", { className: styles$7.gutterLine, children: i + 1 }, i))
|
|
3338
2851
|
}
|
|
3339
2852
|
) : null,
|
|
3340
2853
|
/* @__PURE__ */ jsx(NodeViewContent, { as: "code" })
|
|
@@ -3532,8 +3045,8 @@ function deleteBlock(editor, pos) {
|
|
|
3532
3045
|
const parent = $pos.parent;
|
|
3533
3046
|
if ((node.type.name === "listItem" || node.type.name === "taskItem") && parent.childCount === 1) {
|
|
3534
3047
|
from = pos - $pos.parentOffset - 1;
|
|
3535
|
-
const
|
|
3536
|
-
if (
|
|
3048
|
+
const list = editor.state.doc.nodeAt(from);
|
|
3049
|
+
if (list) to = from + list.nodeSize;
|
|
3537
3050
|
}
|
|
3538
3051
|
if (from <= 0 && to >= editor.state.doc.content.size) {
|
|
3539
3052
|
return editor.chain().insertContentAt(
|
|
@@ -3767,11 +3280,11 @@ const grip = "_grip_5edcs_50";
|
|
|
3767
3280
|
const menu$1 = "_menu_5edcs_61";
|
|
3768
3281
|
const groupLabel = "_groupLabel_5edcs_84";
|
|
3769
3282
|
const divider$3 = "_divider_5edcs_94";
|
|
3770
|
-
const item
|
|
3283
|
+
const item = "_item_5edcs_100";
|
|
3771
3284
|
const itemActive = "_itemActive_5edcs_118";
|
|
3772
3285
|
const itemDanger = "_itemDanger_5edcs_123";
|
|
3773
3286
|
const itemIcon = "_itemIcon_5edcs_132";
|
|
3774
|
-
const styles$
|
|
3287
|
+
const styles$6 = {
|
|
3775
3288
|
cluster,
|
|
3776
3289
|
clusterOnTable,
|
|
3777
3290
|
button,
|
|
@@ -3779,7 +3292,7 @@ const styles$7 = {
|
|
|
3779
3292
|
menu: menu$1,
|
|
3780
3293
|
groupLabel,
|
|
3781
3294
|
divider: divider$3,
|
|
3782
|
-
item
|
|
3295
|
+
item,
|
|
3783
3296
|
itemActive,
|
|
3784
3297
|
itemDanger,
|
|
3785
3298
|
itemIcon
|
|
@@ -3799,10 +3312,10 @@ const THEME_VARS = [
|
|
|
3799
3312
|
"--tmr-danger",
|
|
3800
3313
|
"--tmr-code-bg"
|
|
3801
3314
|
];
|
|
3802
|
-
function lockDragHandle(editor,
|
|
3315
|
+
function lockDragHandle(editor, locked) {
|
|
3803
3316
|
if (editor.isDestroyed) return;
|
|
3804
3317
|
editor.view.dispatch(
|
|
3805
|
-
editor.state.tr.setMeta("lockDragHandle",
|
|
3318
|
+
editor.state.tr.setMeta("lockDragHandle", locked).setMeta("addToHistory", false)
|
|
3806
3319
|
);
|
|
3807
3320
|
}
|
|
3808
3321
|
async function copyMarkdown(markdown) {
|
|
@@ -3964,14 +3477,14 @@ function BlockDragHandle({ editor }) {
|
|
|
3964
3477
|
children: /* @__PURE__ */ jsx(
|
|
3965
3478
|
"div",
|
|
3966
3479
|
{
|
|
3967
|
-
className: `${styles$
|
|
3480
|
+
className: `${styles$6.cluster} ${(target == null ? void 0 : target.node.type.name) === "table" ? styles$6.clusterOnTable : ""}`,
|
|
3968
3481
|
"data-block-drag": "",
|
|
3969
3482
|
children: /* @__PURE__ */ jsx(
|
|
3970
3483
|
"div",
|
|
3971
3484
|
{
|
|
3972
3485
|
role: "button",
|
|
3973
3486
|
tabIndex: 0,
|
|
3974
|
-
className: `${styles$
|
|
3487
|
+
className: `${styles$6.button} ${styles$6.grip}`,
|
|
3975
3488
|
"data-block-drag-grip": "",
|
|
3976
3489
|
title: t.dragHandle,
|
|
3977
3490
|
"aria-label": t.dragHandle,
|
|
@@ -4003,7 +3516,7 @@ function BlockDragHandle({ editor }) {
|
|
|
4003
3516
|
"div",
|
|
4004
3517
|
{
|
|
4005
3518
|
ref: menuRef,
|
|
4006
|
-
className: styles$
|
|
3519
|
+
className: styles$6.menu,
|
|
4007
3520
|
"data-block-drag-menu": "",
|
|
4008
3521
|
role: "menu",
|
|
4009
3522
|
"aria-label": t.menuLabel,
|
|
@@ -4011,37 +3524,37 @@ function BlockDragHandle({ editor }) {
|
|
|
4011
3524
|
onMouseDown: (event) => event.stopPropagation(),
|
|
4012
3525
|
children: [
|
|
4013
3526
|
showTurn ? /* @__PURE__ */ jsxs(Fragment$2, { children: [
|
|
4014
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
3527
|
+
/* @__PURE__ */ jsx("div", { className: styles$6.groupLabel, children: t.turnInto }),
|
|
4015
3528
|
TURN_INTO_KINDS.map((kind) => /* @__PURE__ */ jsxs(
|
|
4016
3529
|
"button",
|
|
4017
3530
|
{
|
|
4018
3531
|
type: "button",
|
|
4019
3532
|
role: "menuitem",
|
|
4020
|
-
className: kind === activeKind ? `${styles$
|
|
3533
|
+
className: kind === activeKind ? `${styles$6.item} ${styles$6.itemActive}` : styles$6.item,
|
|
4021
3534
|
"data-block-drag-action": kind,
|
|
4022
3535
|
onClick: () => run(() => turnBlockInto(editor, menu2.pos, kind)),
|
|
4023
3536
|
children: [
|
|
4024
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
3537
|
+
/* @__PURE__ */ jsx("span", { className: styles$6.itemIcon, "aria-hidden": true, children: TURN_ICON[kind] }),
|
|
4025
3538
|
/* @__PURE__ */ jsx("span", { children: turnLabel(kind) })
|
|
4026
3539
|
]
|
|
4027
3540
|
},
|
|
4028
3541
|
kind
|
|
4029
3542
|
)),
|
|
4030
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
3543
|
+
/* @__PURE__ */ jsx("div", { className: styles$6.divider })
|
|
4031
3544
|
] }) : null,
|
|
4032
3545
|
/* @__PURE__ */ jsxs(
|
|
4033
3546
|
"button",
|
|
4034
3547
|
{
|
|
4035
3548
|
type: "button",
|
|
4036
3549
|
role: "menuitem",
|
|
4037
|
-
className: styles$
|
|
3550
|
+
className: styles$6.item,
|
|
4038
3551
|
"data-block-drag-action": "copy",
|
|
4039
3552
|
onClick: () => run(() => {
|
|
4040
3553
|
const markdown = blockMarkdown(editor, menu2.pos);
|
|
4041
3554
|
if (markdown != null) void copyMarkdown(markdown);
|
|
4042
3555
|
}),
|
|
4043
3556
|
children: [
|
|
4044
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
3557
|
+
/* @__PURE__ */ jsx("span", { className: styles$6.itemIcon, "aria-hidden": true, children: /* @__PURE__ */ jsx(CopyIcon, {}) }),
|
|
4045
3558
|
/* @__PURE__ */ jsx("span", { children: t.copy })
|
|
4046
3559
|
]
|
|
4047
3560
|
}
|
|
@@ -4051,11 +3564,11 @@ function BlockDragHandle({ editor }) {
|
|
|
4051
3564
|
{
|
|
4052
3565
|
type: "button",
|
|
4053
3566
|
role: "menuitem",
|
|
4054
|
-
className: styles$
|
|
3567
|
+
className: styles$6.item,
|
|
4055
3568
|
"data-block-drag-action": "duplicate",
|
|
4056
3569
|
onClick: () => run(() => duplicateBlock(editor, menu2.pos)),
|
|
4057
3570
|
children: [
|
|
4058
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
3571
|
+
/* @__PURE__ */ jsx("span", { className: styles$6.itemIcon, "aria-hidden": true, children: /* @__PURE__ */ jsx(CopyIcon, {}) }),
|
|
4059
3572
|
/* @__PURE__ */ jsx("span", { children: t.duplicate })
|
|
4060
3573
|
]
|
|
4061
3574
|
}
|
|
@@ -4065,11 +3578,11 @@ function BlockDragHandle({ editor }) {
|
|
|
4065
3578
|
{
|
|
4066
3579
|
type: "button",
|
|
4067
3580
|
role: "menuitem",
|
|
4068
|
-
className: styles$
|
|
3581
|
+
className: styles$6.item,
|
|
4069
3582
|
"data-block-drag-action": "reset",
|
|
4070
3583
|
onClick: () => run(() => resetBlockFormatting(editor, menu2.pos)),
|
|
4071
3584
|
children: [
|
|
4072
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
3585
|
+
/* @__PURE__ */ jsx("span", { className: styles$6.itemIcon, "aria-hidden": true, children: /* @__PURE__ */ jsx(EraserIcon, {}) }),
|
|
4073
3586
|
/* @__PURE__ */ jsx("span", { children: t.resetFormatting })
|
|
4074
3587
|
]
|
|
4075
3588
|
}
|
|
@@ -4079,26 +3592,26 @@ function BlockDragHandle({ editor }) {
|
|
|
4079
3592
|
{
|
|
4080
3593
|
type: "button",
|
|
4081
3594
|
role: "menuitem",
|
|
4082
|
-
className: styles$
|
|
3595
|
+
className: styles$6.item,
|
|
4083
3596
|
"data-block-drag-action": "download",
|
|
4084
3597
|
onClick: () => run(() => downloadImageBlock(menu2.node)),
|
|
4085
3598
|
children: [
|
|
4086
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
3599
|
+
/* @__PURE__ */ jsx("span", { className: styles$6.itemIcon, "aria-hidden": true, children: /* @__PURE__ */ jsx(DownloadIcon, {}) }),
|
|
4087
3600
|
/* @__PURE__ */ jsx("span", { children: t.downloadImage })
|
|
4088
3601
|
]
|
|
4089
3602
|
}
|
|
4090
3603
|
) : null,
|
|
4091
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
3604
|
+
/* @__PURE__ */ jsx("div", { className: styles$6.divider }),
|
|
4092
3605
|
/* @__PURE__ */ jsxs(
|
|
4093
3606
|
"button",
|
|
4094
3607
|
{
|
|
4095
3608
|
type: "button",
|
|
4096
3609
|
role: "menuitem",
|
|
4097
|
-
className: `${styles$
|
|
3610
|
+
className: `${styles$6.item} ${styles$6.itemDanger}`,
|
|
4098
3611
|
"data-block-drag-action": "delete",
|
|
4099
3612
|
onClick: () => run(() => deleteBlock(editor, menu2.pos)),
|
|
4100
3613
|
children: [
|
|
4101
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
3614
|
+
/* @__PURE__ */ jsx("span", { className: styles$6.itemIcon, "aria-hidden": true, children: /* @__PURE__ */ jsx(TrashIcon, {}) }),
|
|
4102
3615
|
/* @__PURE__ */ jsx("span", { children: t.delete })
|
|
4103
3616
|
]
|
|
4104
3617
|
}
|
|
@@ -4110,17 +3623,6 @@ function BlockDragHandle({ editor }) {
|
|
|
4110
3623
|
) : null
|
|
4111
3624
|
] });
|
|
4112
3625
|
}
|
|
4113
|
-
function useIsMobile(breakpoint = 768) {
|
|
4114
|
-
const [isMobile, setIsMobile] = useState(false);
|
|
4115
|
-
useEffect(() => {
|
|
4116
|
-
const mq = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
|
|
4117
|
-
const update = () => setIsMobile(mq.matches);
|
|
4118
|
-
update();
|
|
4119
|
-
mq.addEventListener("change", update);
|
|
4120
|
-
return () => mq.removeEventListener("change", update);
|
|
4121
|
-
}, [breakpoint]);
|
|
4122
|
-
return isMobile;
|
|
4123
|
-
}
|
|
4124
3626
|
const CodeBlock = CodeBlockLowlight.extend({
|
|
4125
3627
|
// Built-in `code` tokens often win over chart's custom fence tokenizer;
|
|
4126
3628
|
// upgrade ```tmr-chart here so the mid-column card editor renders ChartView.
|
|
@@ -4296,26 +3798,32 @@ function CharacterCountStatus({
|
|
|
4296
3798
|
return /* @__PURE__ */ jsxs(
|
|
4297
3799
|
"div",
|
|
4298
3800
|
{
|
|
4299
|
-
className: styles$
|
|
3801
|
+
className: styles$d.charCount,
|
|
4300
3802
|
role: "group",
|
|
4301
3803
|
"aria-label": t.label,
|
|
4302
3804
|
"data-characters": counts.characters,
|
|
4303
3805
|
"data-words": counts.words,
|
|
4304
3806
|
children: [
|
|
4305
3807
|
/* @__PURE__ */ jsx("span", { children: t.characters(counts.characters) }),
|
|
4306
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
3808
|
+
/* @__PURE__ */ jsx("span", { className: styles$d.charCountSep, "aria-hidden": "true", children: "·" }),
|
|
4307
3809
|
/* @__PURE__ */ jsx("span", { children: t.words(counts.words) })
|
|
4308
3810
|
]
|
|
4309
3811
|
}
|
|
4310
3812
|
);
|
|
4311
3813
|
}
|
|
4312
3814
|
function editorOwnsKeyboard(editor) {
|
|
4313
|
-
const
|
|
4314
|
-
const inEditor = !!
|
|
3815
|
+
const active = document.activeElement;
|
|
3816
|
+
const inEditor = !!active && editor.view.dom.contains(active);
|
|
4315
3817
|
if (inEditor || editor.isFocused) return true;
|
|
4316
|
-
const nothingFocused =
|
|
3818
|
+
const nothingFocused = active === null || active === document.body;
|
|
4317
3819
|
return nothingFocused && document.querySelectorAll(".ProseMirror").length <= 1;
|
|
4318
3820
|
}
|
|
3821
|
+
function sameTocItems(a3, b3) {
|
|
3822
|
+
if (a3.length !== b3.length) return false;
|
|
3823
|
+
return a3.every(
|
|
3824
|
+
(item2, index) => item2.id === b3[index].id && item2.level === b3[index].level && item2.text === b3[index].text
|
|
3825
|
+
);
|
|
3826
|
+
}
|
|
4319
3827
|
const MarkdownWysiwygEditor = forwardRef(function MarkdownWysiwygEditor2({
|
|
4320
3828
|
initialMarkdown = "",
|
|
4321
3829
|
editable = true,
|
|
@@ -4325,6 +3833,7 @@ const MarkdownWysiwygEditor = forwardRef(function MarkdownWysiwygEditor2({
|
|
|
4325
3833
|
placeholder,
|
|
4326
3834
|
onEditorReady,
|
|
4327
3835
|
onTocChange,
|
|
3836
|
+
toc = false,
|
|
4328
3837
|
markdownPaste = true,
|
|
4329
3838
|
markdownFileDrop = true,
|
|
4330
3839
|
extraExtensions,
|
|
@@ -4361,7 +3870,11 @@ const MarkdownWysiwygEditor = forwardRef(function MarkdownWysiwygEditor2({
|
|
|
4361
3870
|
const showBlockDrag = blockDrag && editable && !blockDragMobile;
|
|
4362
3871
|
const [findOpen, setFindOpen] = useState(false);
|
|
4363
3872
|
const [shortcutsOpen, setShortcutsOpen] = useState(false);
|
|
3873
|
+
const [tocItems, setTocItems] = useState([]);
|
|
4364
3874
|
const findInputRef = useRef(null);
|
|
3875
|
+
const onTocChangeRef = useRef(onTocChange);
|
|
3876
|
+
onTocChangeRef.current = onTocChange;
|
|
3877
|
+
const tocItemsRef = useRef([]);
|
|
4365
3878
|
const editor = useEditor({
|
|
4366
3879
|
extensions: [
|
|
4367
3880
|
...baseExtensions.map(
|
|
@@ -4417,10 +3930,19 @@ const MarkdownWysiwygEditor = forwardRef(function MarkdownWysiwygEditor2({
|
|
|
4417
3930
|
...characterCount ? [CharacterCount.configure({ wordCounter: countWords })] : [],
|
|
4418
3931
|
TableOfContents.configure({
|
|
4419
3932
|
getId: makeTocGetId(),
|
|
3933
|
+
// 官方扩展在滚动时也会 onUpdate(只为刷新 isActive)。目录项没变就不通知,
|
|
3934
|
+
// 否则每次滚动都 setState。回调走 ref:扩展只在创建时绑一次。
|
|
4420
3935
|
onUpdate: (anchors) => {
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
3936
|
+
var _a;
|
|
3937
|
+
const next = anchors.filter((a3) => a3.originalLevel <= 6 && a3.textContent.trim()).map((a3) => ({
|
|
3938
|
+
id: a3.id,
|
|
3939
|
+
level: a3.originalLevel,
|
|
3940
|
+
text: a3.textContent
|
|
3941
|
+
}));
|
|
3942
|
+
if (sameTocItems(tocItemsRef.current, next)) return;
|
|
3943
|
+
tocItemsRef.current = next;
|
|
3944
|
+
setTocItems(next);
|
|
3945
|
+
(_a = onTocChangeRef.current) == null ? void 0 : _a.call(onTocChangeRef, next);
|
|
4424
3946
|
}
|
|
4425
3947
|
}),
|
|
4426
3948
|
...markdownPaste ? [MarkdownPaste] : [],
|
|
@@ -4438,7 +3960,7 @@ const MarkdownWysiwygEditor = forwardRef(function MarkdownWysiwygEditor2({
|
|
|
4438
3960
|
immediatelyRender: false,
|
|
4439
3961
|
editorProps: {
|
|
4440
3962
|
attributes: {
|
|
4441
|
-
class: styles$
|
|
3963
|
+
class: styles$d.editorContent
|
|
4442
3964
|
}
|
|
4443
3965
|
}
|
|
4444
3966
|
});
|
|
@@ -4514,7 +4036,7 @@ const MarkdownWysiwygEditor = forwardRef(function MarkdownWysiwygEditor2({
|
|
|
4514
4036
|
const commentsSignatureRef = useRef("");
|
|
4515
4037
|
useEffect(() => {
|
|
4516
4038
|
if (!editor || !editable) return;
|
|
4517
|
-
const signature = (comments ?? []).map((
|
|
4039
|
+
const signature = (comments ?? []).map((c2) => `${c2.commentId}:${c2.segments.length}`).join("|");
|
|
4518
4040
|
if (signature === commentsSignatureRef.current) return;
|
|
4519
4041
|
commentsSignatureRef.current = signature;
|
|
4520
4042
|
applyCommentAnchorsToEditor(editor, comments ?? []);
|
|
@@ -4638,7 +4160,7 @@ const MarkdownWysiwygEditor = forwardRef(function MarkdownWysiwygEditor2({
|
|
|
4638
4160
|
locale,
|
|
4639
4161
|
onClose: closeFind,
|
|
4640
4162
|
inputRef: findInputRef,
|
|
4641
|
-
className: styles$
|
|
4163
|
+
className: styles$d.findBar,
|
|
4642
4164
|
style: findBarOffsetStyle(findBarOffset)
|
|
4643
4165
|
}
|
|
4644
4166
|
) : null;
|
|
@@ -4655,7 +4177,7 @@ const MarkdownWysiwygEditor = forwardRef(function MarkdownWysiwygEditor2({
|
|
|
4655
4177
|
"button",
|
|
4656
4178
|
{
|
|
4657
4179
|
type: "button",
|
|
4658
|
-
className: shortcutFabTarget ? `${styles$
|
|
4180
|
+
className: shortcutFabTarget ? `${styles$d.shortcutFab} ${styles$d.shortcutFabHosted}` : styles$d.shortcutFab,
|
|
4659
4181
|
title: shortcutT.panelTitle,
|
|
4660
4182
|
"aria-label": shortcutT.panelTitle,
|
|
4661
4183
|
"aria-expanded": shortcutsOpen,
|
|
@@ -4666,24 +4188,33 @@ const MarkdownWysiwygEditor = forwardRef(function MarkdownWysiwygEditor2({
|
|
|
4666
4188
|
return /* @__PURE__ */ jsxs(
|
|
4667
4189
|
"div",
|
|
4668
4190
|
{
|
|
4669
|
-
className: styles$
|
|
4191
|
+
className: styles$d.editorHost,
|
|
4670
4192
|
"data-block-drag-gutter": showBlockDrag ? "" : void 0,
|
|
4671
4193
|
children: [
|
|
4672
|
-
findBarNode && !findBarTarget ? /* @__PURE__ */ jsx("div", { className: styles$
|
|
4194
|
+
findBarNode && !findBarTarget ? /* @__PURE__ */ jsx("div", { className: styles$d.findBarAnchor, children: findBarNode }) : null,
|
|
4673
4195
|
findBarNode && findBarTarget ? createPortal(findBarNode, findBarTarget) : null,
|
|
4196
|
+
editor && toc && !blockDragMobile && tocItems.length > 0 ? /* @__PURE__ */ jsx(
|
|
4197
|
+
EditorToc,
|
|
4198
|
+
{
|
|
4199
|
+
items: tocItems,
|
|
4200
|
+
editorDom: editor.view.dom,
|
|
4201
|
+
locale
|
|
4202
|
+
}
|
|
4203
|
+
) : null,
|
|
4674
4204
|
/* @__PURE__ */ jsx(
|
|
4675
4205
|
EditorContent,
|
|
4676
4206
|
{
|
|
4677
4207
|
editor,
|
|
4678
4208
|
className: [
|
|
4679
|
-
styles$
|
|
4680
|
-
showBlockDrag ? styles$
|
|
4209
|
+
styles$d.editorScroll,
|
|
4210
|
+
showBlockDrag ? styles$d.withBlockDrag : "",
|
|
4211
|
+
toc && !blockDragMobile && tocItems.length > 0 ? styles$d.withToc : "",
|
|
4681
4212
|
className ?? ""
|
|
4682
4213
|
].filter(Boolean).join(" ")
|
|
4683
4214
|
}
|
|
4684
4215
|
),
|
|
4685
4216
|
editor && showBlockDrag ? /* @__PURE__ */ jsx(BlockDragHandle, { editor }) : null,
|
|
4686
|
-
editor && characterCount ? /* @__PURE__ */ jsxs("div", { className: styles$
|
|
4217
|
+
editor && characterCount ? /* @__PURE__ */ jsxs("div", { className: styles$d.editorStatus, children: [
|
|
4687
4218
|
/* @__PURE__ */ jsx(CharacterCountStatus, { editor, locale }),
|
|
4688
4219
|
shortcutFabNode && !shortcutFabTarget ? shortcutFabNode : null
|
|
4689
4220
|
] }) : shortcutFabNode && !shortcutFabTarget ? shortcutFabNode : null,
|
|
@@ -4705,8 +4236,12 @@ function MarkdownPreview({
|
|
|
4705
4236
|
sources,
|
|
4706
4237
|
renderCitation,
|
|
4707
4238
|
className,
|
|
4708
|
-
locale = "en"
|
|
4239
|
+
locale = "en",
|
|
4240
|
+
toc = false
|
|
4709
4241
|
}) {
|
|
4242
|
+
const mobile = useIsMobile(768);
|
|
4243
|
+
const [tocItems, setTocItems] = useState([]);
|
|
4244
|
+
const tocItemsRef = useRef([]);
|
|
4710
4245
|
const prepared = useMemo(
|
|
4711
4246
|
() => prepareChartMarkdown(
|
|
4712
4247
|
enrichMarkdownCitations(markdown, sources ?? [])
|
|
@@ -4728,9 +4263,22 @@ function MarkdownPreview({
|
|
|
4728
4263
|
pureImage,
|
|
4729
4264
|
createChart({ editable: false }),
|
|
4730
4265
|
createCitationRef({ renderCitation }),
|
|
4731
|
-
Markdown
|
|
4266
|
+
Markdown,
|
|
4267
|
+
TableOfContents.configure({
|
|
4268
|
+
getId: makeTocGetId(),
|
|
4269
|
+
onUpdate: (anchors) => {
|
|
4270
|
+
const next = anchors.filter((anchor) => anchor.originalLevel <= 6 && anchor.textContent.trim()).map((anchor) => ({
|
|
4271
|
+
id: anchor.id,
|
|
4272
|
+
level: anchor.originalLevel,
|
|
4273
|
+
text: anchor.textContent
|
|
4274
|
+
}));
|
|
4275
|
+
if (sameTocItems$1(tocItemsRef.current, next)) return;
|
|
4276
|
+
tocItemsRef.current = next;
|
|
4277
|
+
setTocItems(next);
|
|
4278
|
+
}
|
|
4279
|
+
})
|
|
4732
4280
|
],
|
|
4733
|
-
[renderCitation]
|
|
4281
|
+
[previewCodeBlock, renderCitation]
|
|
4734
4282
|
);
|
|
4735
4283
|
const editor = useEditor(
|
|
4736
4284
|
{
|
|
@@ -4740,7 +4288,7 @@ function MarkdownPreview({
|
|
|
4740
4288
|
editable: false,
|
|
4741
4289
|
immediatelyRender: false,
|
|
4742
4290
|
editorProps: {
|
|
4743
|
-
attributes: { class: styles$
|
|
4291
|
+
attributes: { class: styles$d.editorContent }
|
|
4744
4292
|
}
|
|
4745
4293
|
},
|
|
4746
4294
|
[extensions]
|
|
@@ -4750,13 +4298,17 @@ function MarkdownPreview({
|
|
|
4750
4298
|
if (!editor) return;
|
|
4751
4299
|
editor.commands.setContent(prepared, { contentType: "markdown" });
|
|
4752
4300
|
}, [editor, prepared]);
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
{
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4301
|
+
const showToc = Boolean(editor && toc && !mobile && tocItems.length > 0);
|
|
4302
|
+
return /* @__PURE__ */ jsxs("div", { className: styles$d.editorHost, children: [
|
|
4303
|
+
showToc && editor ? /* @__PURE__ */ jsx(EditorToc, { items: tocItems, editorDom: editor.view.dom, locale }) : null,
|
|
4304
|
+
/* @__PURE__ */ jsx(
|
|
4305
|
+
EditorContent,
|
|
4306
|
+
{
|
|
4307
|
+
editor,
|
|
4308
|
+
className: [className ?? styles$d.editorScroll, showToc ? styles$d.withToc : ""].filter(Boolean).join(" ")
|
|
4309
|
+
}
|
|
4310
|
+
)
|
|
4311
|
+
] });
|
|
4760
4312
|
}
|
|
4761
4313
|
const MD_FILE_RE = /\.(md|markdown)$/i;
|
|
4762
4314
|
const MD_ACCEPT = ".md,.markdown,text/markdown";
|
|
@@ -4877,7 +4429,7 @@ const mathFieldBlock = "_mathFieldBlock_1l6t0_531";
|
|
|
4877
4429
|
const mathInput = "_mathInput_1l6t0_538";
|
|
4878
4430
|
const mathDone = "_mathDone_1l6t0_556";
|
|
4879
4431
|
const mathDoneKbd = "_mathDoneKbd_1l6t0_581";
|
|
4880
|
-
const styles$
|
|
4432
|
+
const styles$5 = {
|
|
4881
4433
|
toolbar,
|
|
4882
4434
|
inner,
|
|
4883
4435
|
btn: btn$2,
|
|
@@ -4939,7 +4491,7 @@ const swatch = "_swatch_x5lrq_54";
|
|
|
4939
4491
|
const swatchActive = "_swatchActive_x5lrq_70";
|
|
4940
4492
|
const themeLabel = "_themeLabel_x5lrq_76";
|
|
4941
4493
|
const themeRow = "_themeRow_x5lrq_84";
|
|
4942
|
-
const styles$
|
|
4494
|
+
const styles$4 = {
|
|
4943
4495
|
palette,
|
|
4944
4496
|
noneRow,
|
|
4945
4497
|
noneIcon,
|
|
@@ -4962,46 +4514,46 @@ const THEME_COLORS = ["#ff6719", "#ff5500"];
|
|
|
4962
4514
|
function ColorPalette({ value, onPick, locale = "en" }) {
|
|
4963
4515
|
const t = getLocaleBundle(locale).palette;
|
|
4964
4516
|
const current = value == null ? void 0 : value.toLowerCase();
|
|
4965
|
-
return /* @__PURE__ */ jsxs("div", { className: styles$
|
|
4517
|
+
return /* @__PURE__ */ jsxs("div", { className: styles$4.palette, children: [
|
|
4966
4518
|
/* @__PURE__ */ jsxs(
|
|
4967
4519
|
"button",
|
|
4968
4520
|
{
|
|
4969
4521
|
type: "button",
|
|
4970
|
-
className: styles$
|
|
4522
|
+
className: styles$4.noneRow,
|
|
4971
4523
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
4972
4524
|
onClick: () => onPick(null),
|
|
4973
4525
|
children: [
|
|
4974
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
4975
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
4526
|
+
/* @__PURE__ */ jsx("span", { className: styles$4.noneIcon, "aria-hidden": true }),
|
|
4527
|
+
/* @__PURE__ */ jsx("span", { className: styles$4.noneLabel, children: t.none })
|
|
4976
4528
|
]
|
|
4977
4529
|
}
|
|
4978
4530
|
),
|
|
4979
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
4531
|
+
/* @__PURE__ */ jsx("div", { className: styles$4.grid, children: PALETTE.flat().map((c2) => /* @__PURE__ */ jsx(
|
|
4980
4532
|
"button",
|
|
4981
4533
|
{
|
|
4982
4534
|
type: "button",
|
|
4983
|
-
className: `${styles$
|
|
4984
|
-
style: { background:
|
|
4985
|
-
title:
|
|
4986
|
-
"aria-label":
|
|
4535
|
+
className: `${styles$4.swatch} ${current === c2.toLowerCase() ? styles$4.swatchActive : ""}`,
|
|
4536
|
+
style: { background: c2 },
|
|
4537
|
+
title: c2,
|
|
4538
|
+
"aria-label": c2,
|
|
4987
4539
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
4988
|
-
onClick: () => onPick(
|
|
4540
|
+
onClick: () => onPick(c2)
|
|
4989
4541
|
},
|
|
4990
|
-
|
|
4542
|
+
c2
|
|
4991
4543
|
)) }),
|
|
4992
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
4993
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
4544
|
+
/* @__PURE__ */ jsx("div", { className: styles$4.themeLabel, children: t.theme }),
|
|
4545
|
+
/* @__PURE__ */ jsx("div", { className: styles$4.themeRow, children: THEME_COLORS.map((c2) => /* @__PURE__ */ jsx(
|
|
4994
4546
|
"button",
|
|
4995
4547
|
{
|
|
4996
4548
|
type: "button",
|
|
4997
|
-
className: `${styles$
|
|
4998
|
-
style: { background:
|
|
4999
|
-
title:
|
|
5000
|
-
"aria-label":
|
|
4549
|
+
className: `${styles$4.swatch} ${current === c2.toLowerCase() ? styles$4.swatchActive : ""}`,
|
|
4550
|
+
style: { background: c2 },
|
|
4551
|
+
title: c2,
|
|
4552
|
+
"aria-label": c2,
|
|
5001
4553
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
5002
|
-
onClick: () => onPick(
|
|
4554
|
+
onClick: () => onPick(c2)
|
|
5003
4555
|
},
|
|
5004
|
-
|
|
4556
|
+
c2
|
|
5005
4557
|
)) })
|
|
5006
4558
|
] });
|
|
5007
4559
|
}
|
|
@@ -5025,7 +4577,7 @@ const captionRow = "_captionRow_mp2o5_13";
|
|
|
5025
4577
|
const captionInput = "_captionInput_mp2o5_40";
|
|
5026
4578
|
const btn$1 = "_btn_mp2o5_58";
|
|
5027
4579
|
const btnActive = "_btnActive_mp2o5_76";
|
|
5028
|
-
const styles$
|
|
4580
|
+
const styles$3 = {
|
|
5029
4581
|
bar,
|
|
5030
4582
|
divider: divider$1,
|
|
5031
4583
|
captionRow,
|
|
@@ -5143,7 +4695,7 @@ function ImageAlignTools({ editor, labels }) {
|
|
|
5143
4695
|
if (!hover || !editor.isEditable) return null;
|
|
5144
4696
|
const above = hover.top - TOOLBAR_HEIGHT - TOOLBAR_GAP >= 8;
|
|
5145
4697
|
const nodeAttrs = (_a = editor.state.doc.nodeAt(hover.pos)) == null ? void 0 : _a.attrs;
|
|
5146
|
-
const
|
|
4698
|
+
const active = normalizeImageAlign(nodeAttrs == null ? void 0 : nodeAttrs.align);
|
|
5147
4699
|
const caption = normalizeImageCaption(nodeAttrs == null ? void 0 : nodeAttrs.caption);
|
|
5148
4700
|
const labelOf = {
|
|
5149
4701
|
left: labels.imageAlignLeft,
|
|
@@ -5161,7 +4713,7 @@ function ImageAlignTools({ editor, labels }) {
|
|
|
5161
4713
|
"div",
|
|
5162
4714
|
{
|
|
5163
4715
|
"data-image-align": "",
|
|
5164
|
-
className: styles$
|
|
4716
|
+
className: styles$3.bar,
|
|
5165
4717
|
role: "toolbar",
|
|
5166
4718
|
"aria-label": labels.imageAlign,
|
|
5167
4719
|
style: {
|
|
@@ -5181,10 +4733,10 @@ function ImageAlignTools({ editor, labels }) {
|
|
|
5181
4733
|
{
|
|
5182
4734
|
type: "button",
|
|
5183
4735
|
"data-image-align-action": align,
|
|
5184
|
-
className: `${styles$
|
|
4736
|
+
className: `${styles$3.btn} ${active === align ? styles$3.btnActive : ""}`,
|
|
5185
4737
|
title: labelOf[align],
|
|
5186
4738
|
"aria-label": labelOf[align],
|
|
5187
|
-
"aria-pressed":
|
|
4739
|
+
"aria-pressed": active === align,
|
|
5188
4740
|
onClick: () => {
|
|
5189
4741
|
setImageAlignAtPos(editor, hover.pos, align);
|
|
5190
4742
|
remeasureHover();
|
|
@@ -5194,13 +4746,13 @@ function ImageAlignTools({ editor, labels }) {
|
|
|
5194
4746
|
align
|
|
5195
4747
|
);
|
|
5196
4748
|
}),
|
|
5197
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
4749
|
+
/* @__PURE__ */ jsx("span", { className: styles$3.divider, "aria-hidden": true }),
|
|
5198
4750
|
/* @__PURE__ */ jsx(
|
|
5199
4751
|
"button",
|
|
5200
4752
|
{
|
|
5201
4753
|
type: "button",
|
|
5202
4754
|
"data-image-align-action": "caption",
|
|
5203
|
-
className: `${styles$
|
|
4755
|
+
className: `${styles$3.btn} ${caption ? styles$3.btnActive : ""}`,
|
|
5204
4756
|
title: labels.imageCaption,
|
|
5205
4757
|
"aria-label": labels.imageCaption,
|
|
5206
4758
|
"aria-pressed": !!caption,
|
|
@@ -5211,10 +4763,10 @@ function ImageAlignTools({ editor, labels }) {
|
|
|
5211
4763
|
children: /* @__PURE__ */ jsx(CaptionsIcon, { size: 14 })
|
|
5212
4764
|
}
|
|
5213
4765
|
),
|
|
5214
|
-
captionDraft !== null ? /* @__PURE__ */ jsx("div", { className: styles$
|
|
4766
|
+
captionDraft !== null ? /* @__PURE__ */ jsx("div", { className: styles$3.captionRow, children: /* @__PURE__ */ jsx(
|
|
5215
4767
|
"input",
|
|
5216
4768
|
{
|
|
5217
|
-
className: styles$
|
|
4769
|
+
className: styles$3.captionInput,
|
|
5218
4770
|
value: captionDraft,
|
|
5219
4771
|
placeholder: labels.imageCaptionPlaceholder,
|
|
5220
4772
|
"aria-label": labels.imageCaptionPlaceholder,
|
|
@@ -5325,7 +4877,7 @@ const input = "_input_qysb1_52";
|
|
|
5325
4877
|
const divider = "_divider_qysb1_63";
|
|
5326
4878
|
const btn = "_btn_qysb1_71";
|
|
5327
4879
|
const apply = "_apply_qysb1_99";
|
|
5328
|
-
const styles$
|
|
4880
|
+
const styles$2 = {
|
|
5329
4881
|
panel,
|
|
5330
4882
|
field,
|
|
5331
4883
|
fieldInvalid,
|
|
@@ -5400,16 +4952,16 @@ function LinkPanel({
|
|
|
5400
4952
|
return /* @__PURE__ */ jsxs(
|
|
5401
4953
|
"div",
|
|
5402
4954
|
{
|
|
5403
|
-
className: className ? `${styles$
|
|
4955
|
+
className: className ? `${styles$2.panel} ${className}` : styles$2.panel,
|
|
5404
4956
|
style,
|
|
5405
4957
|
"data-link-popover": "",
|
|
5406
4958
|
role: "dialog",
|
|
5407
4959
|
"aria-label": t.field,
|
|
5408
4960
|
children: [
|
|
5409
|
-
/* @__PURE__ */ jsx("span", { className: `${styles$
|
|
4961
|
+
/* @__PURE__ */ jsx("span", { className: `${styles$2.field}${invalid ? ` ${styles$2.fieldInvalid}` : ""}`, children: /* @__PURE__ */ jsx(
|
|
5410
4962
|
"input",
|
|
5411
4963
|
{
|
|
5412
|
-
className: styles$
|
|
4964
|
+
className: styles$2.input,
|
|
5413
4965
|
"data-link-field": "",
|
|
5414
4966
|
"data-link-invalid": invalid ? "" : void 0,
|
|
5415
4967
|
type: "url",
|
|
@@ -5434,7 +4986,7 @@ function LinkPanel({
|
|
|
5434
4986
|
"button",
|
|
5435
4987
|
{
|
|
5436
4988
|
type: "button",
|
|
5437
|
-
className: `${styles$
|
|
4989
|
+
className: `${styles$2.btn} ${styles$2.apply}`,
|
|
5438
4990
|
"data-link-action": "apply",
|
|
5439
4991
|
title: t.apply,
|
|
5440
4992
|
"aria-label": t.apply,
|
|
@@ -5444,12 +4996,12 @@ function LinkPanel({
|
|
|
5444
4996
|
children: /* @__PURE__ */ jsx(CheckIcon, { size: 16 })
|
|
5445
4997
|
}
|
|
5446
4998
|
),
|
|
5447
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
4999
|
+
/* @__PURE__ */ jsx("span", { className: styles$2.divider, "aria-hidden": "true" }),
|
|
5448
5000
|
/* @__PURE__ */ jsx(
|
|
5449
5001
|
"button",
|
|
5450
5002
|
{
|
|
5451
5003
|
type: "button",
|
|
5452
|
-
className: styles$
|
|
5004
|
+
className: styles$2.btn,
|
|
5453
5005
|
"data-link-action": "open",
|
|
5454
5006
|
title: t.open,
|
|
5455
5007
|
"aria-label": t.open,
|
|
@@ -5463,7 +5015,7 @@ function LinkPanel({
|
|
|
5463
5015
|
"button",
|
|
5464
5016
|
{
|
|
5465
5017
|
type: "button",
|
|
5466
|
-
className: styles$
|
|
5018
|
+
className: styles$2.btn,
|
|
5467
5019
|
"data-link-action": "remove",
|
|
5468
5020
|
title: t.remove,
|
|
5469
5021
|
"aria-label": t.remove,
|
|
@@ -5662,7 +5214,7 @@ const tableMenuItem = "_tableMenuItem_1m19y_130";
|
|
|
5662
5214
|
const tableMenuItemIcon = "_tableMenuItemIcon_1m19y_156";
|
|
5663
5215
|
const tableMenuItemLabel = "_tableMenuItemLabel_1m19y_166";
|
|
5664
5216
|
const tableMenuDivider = "_tableMenuDivider_1m19y_171";
|
|
5665
|
-
const styles$
|
|
5217
|
+
const styles$1 = {
|
|
5666
5218
|
handle,
|
|
5667
5219
|
handleRow,
|
|
5668
5220
|
handleCol,
|
|
@@ -5936,7 +5488,7 @@ function TableHandles({ editor, labels }) {
|
|
|
5936
5488
|
{
|
|
5937
5489
|
type: "button",
|
|
5938
5490
|
"data-table-handle": "row",
|
|
5939
|
-
className: `${styles$
|
|
5491
|
+
className: `${styles$1.handle} ${styles$1.handleRow}`,
|
|
5940
5492
|
style: {
|
|
5941
5493
|
left: hover.tableLeft - ROW_HANDLE_GAP,
|
|
5942
5494
|
top: hover.rowTop,
|
|
@@ -5955,7 +5507,7 @@ function TableHandles({ editor, labels }) {
|
|
|
5955
5507
|
{
|
|
5956
5508
|
type: "button",
|
|
5957
5509
|
"data-table-handle": "col",
|
|
5958
|
-
className: `${styles$
|
|
5510
|
+
className: `${styles$1.handle} ${styles$1.handleCol}`,
|
|
5959
5511
|
style: {
|
|
5960
5512
|
left: hover.colLeft,
|
|
5961
5513
|
top: hover.tableTop - COL_HANDLE_GAP,
|
|
@@ -5974,7 +5526,7 @@ function TableHandles({ editor, labels }) {
|
|
|
5974
5526
|
{
|
|
5975
5527
|
type: "button",
|
|
5976
5528
|
"data-table-extend": "col",
|
|
5977
|
-
className: styles$
|
|
5529
|
+
className: styles$1.extend,
|
|
5978
5530
|
style: {
|
|
5979
5531
|
left: hover.tableRight + EXTEND_GAP,
|
|
5980
5532
|
top: hover.tableTop,
|
|
@@ -5996,7 +5548,7 @@ function TableHandles({ editor, labels }) {
|
|
|
5996
5548
|
{
|
|
5997
5549
|
type: "button",
|
|
5998
5550
|
"data-table-extend": "row",
|
|
5999
|
-
className: styles$
|
|
5551
|
+
className: styles$1.extend,
|
|
6000
5552
|
style: {
|
|
6001
5553
|
left: hover.tableLeft,
|
|
6002
5554
|
top: hover.tableBottom + EXTEND_GAP,
|
|
@@ -6017,7 +5569,7 @@ function TableHandles({ editor, labels }) {
|
|
|
6017
5569
|
menu2 ? /* @__PURE__ */ jsxs(
|
|
6018
5570
|
"div",
|
|
6019
5571
|
{
|
|
6020
|
-
className: styles$
|
|
5572
|
+
className: styles$1.tableBubble,
|
|
6021
5573
|
"data-table-menu": "",
|
|
6022
5574
|
style: { left: menu2.x, top: menu2.y },
|
|
6023
5575
|
role: "menu",
|
|
@@ -6025,39 +5577,39 @@ function TableHandles({ editor, labels }) {
|
|
|
6025
5577
|
onContextMenu: (e2) => e2.preventDefault(),
|
|
6026
5578
|
children: [
|
|
6027
5579
|
items.map((item2, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
6028
|
-
index > 0 && item2.group !== items[index - 1].group ? /* @__PURE__ */ jsx("span", { className: styles$
|
|
5580
|
+
index > 0 && item2.group !== items[index - 1].group ? /* @__PURE__ */ jsx("span", { className: styles$1.tableMenuDivider, "aria-hidden": true }) : null,
|
|
6029
5581
|
/* @__PURE__ */ jsxs(
|
|
6030
5582
|
"button",
|
|
6031
5583
|
{
|
|
6032
5584
|
type: "button",
|
|
6033
5585
|
role: "menuitem",
|
|
6034
|
-
className: styles$
|
|
5586
|
+
className: styles$1.tableMenuItem,
|
|
6035
5587
|
disabled: item2.disabled,
|
|
6036
5588
|
onClick: () => {
|
|
6037
5589
|
item2.run();
|
|
6038
5590
|
closeMenu();
|
|
6039
5591
|
},
|
|
6040
5592
|
children: [
|
|
6041
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6042
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
5593
|
+
/* @__PURE__ */ jsx("span", { className: styles$1.tableMenuItemIcon, "aria-hidden": true, children: item2.icon }),
|
|
5594
|
+
/* @__PURE__ */ jsx("span", { className: styles$1.tableMenuItemLabel, children: item2.label })
|
|
6043
5595
|
]
|
|
6044
5596
|
}
|
|
6045
5597
|
)
|
|
6046
5598
|
] }, item2.key)),
|
|
6047
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
5599
|
+
/* @__PURE__ */ jsx("span", { className: styles$1.tableMenuDivider, "aria-hidden": true }),
|
|
6048
5600
|
/* @__PURE__ */ jsxs(
|
|
6049
5601
|
"button",
|
|
6050
5602
|
{
|
|
6051
5603
|
type: "button",
|
|
6052
5604
|
role: "menuitem",
|
|
6053
|
-
className: styles$
|
|
5605
|
+
className: styles$1.tableMenuItem,
|
|
6054
5606
|
onClick: () => {
|
|
6055
5607
|
editor.commands.deleteTable();
|
|
6056
5608
|
closeMenu();
|
|
6057
5609
|
},
|
|
6058
5610
|
children: [
|
|
6059
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6060
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
5611
|
+
/* @__PURE__ */ jsx("span", { className: styles$1.tableMenuItemIcon, "aria-hidden": true, children: /* @__PURE__ */ jsx(TableDeleteIcon, {}) }),
|
|
5612
|
+
/* @__PURE__ */ jsx("span", { className: styles$1.tableMenuItemLabel, children: labels.tableDeleteTable })
|
|
6061
5613
|
]
|
|
6062
5614
|
}
|
|
6063
5615
|
)
|
|
@@ -6216,7 +5768,7 @@ function MathEditorPopover({
|
|
|
6216
5768
|
"textarea",
|
|
6217
5769
|
{
|
|
6218
5770
|
ref: inputRef,
|
|
6219
|
-
className: styles$
|
|
5771
|
+
className: styles$5.mathInput,
|
|
6220
5772
|
value: draft,
|
|
6221
5773
|
placeholder,
|
|
6222
5774
|
rows: Math.max(3, draft.split("\n").length),
|
|
@@ -6228,7 +5780,7 @@ function MathEditorPopover({
|
|
|
6228
5780
|
"input",
|
|
6229
5781
|
{
|
|
6230
5782
|
ref: inputRef,
|
|
6231
|
-
className: styles$
|
|
5783
|
+
className: styles$5.mathInput,
|
|
6232
5784
|
value: draft,
|
|
6233
5785
|
placeholder,
|
|
6234
5786
|
"aria-labelledby": titleId,
|
|
@@ -6242,7 +5794,7 @@ function MathEditorPopover({
|
|
|
6242
5794
|
"div",
|
|
6243
5795
|
{
|
|
6244
5796
|
ref: rootRef,
|
|
6245
|
-
className: styles$
|
|
5797
|
+
className: styles$5.mathLayer,
|
|
6246
5798
|
style: layerStyle,
|
|
6247
5799
|
role: "dialog",
|
|
6248
5800
|
"aria-modal": "false",
|
|
@@ -6250,15 +5802,15 @@ function MathEditorPopover({
|
|
|
6250
5802
|
children: /* @__PURE__ */ jsxs(
|
|
6251
5803
|
"div",
|
|
6252
5804
|
{
|
|
6253
|
-
className: isBlock ? `${styles$
|
|
5805
|
+
className: isBlock ? `${styles$5.mathStack} ${styles$5.mathStackBlock}` : styles$5.mathStack,
|
|
6254
5806
|
children: [
|
|
6255
5807
|
showHint ? /* @__PURE__ */ jsxs(
|
|
6256
5808
|
"div",
|
|
6257
5809
|
{
|
|
6258
5810
|
id: titleId,
|
|
6259
|
-
className: isBlock ? `${styles$
|
|
5811
|
+
className: isBlock ? `${styles$5.mathHint} ${styles$5.mathHintBlock}` : styles$5.mathHint,
|
|
6260
5812
|
children: [
|
|
6261
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
5813
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.mathHintIcon, "aria-hidden": true, children: isBlock ? "TeX" : "√x" }),
|
|
6262
5814
|
newLabel
|
|
6263
5815
|
]
|
|
6264
5816
|
}
|
|
@@ -6267,20 +5819,20 @@ function MathEditorPopover({
|
|
|
6267
5819
|
"div",
|
|
6268
5820
|
{
|
|
6269
5821
|
id: showHint ? void 0 : titleId,
|
|
6270
|
-
className: isBlock ? `${styles$
|
|
5822
|
+
className: isBlock ? `${styles$5.mathField} ${styles$5.mathFieldBlock}` : styles$5.mathField,
|
|
6271
5823
|
children: [
|
|
6272
5824
|
field2,
|
|
6273
5825
|
/* @__PURE__ */ jsxs(
|
|
6274
5826
|
"button",
|
|
6275
5827
|
{
|
|
6276
5828
|
type: "button",
|
|
6277
|
-
className: styles$
|
|
5829
|
+
className: styles$5.mathDone,
|
|
6278
5830
|
disabled: !canSubmit,
|
|
6279
5831
|
title: isBlock ? `${doneLabel} (⌘/Ctrl+Enter)` : `${doneLabel} (Enter)`,
|
|
6280
5832
|
onClick: submit,
|
|
6281
5833
|
children: [
|
|
6282
5834
|
doneLabel,
|
|
6283
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
5835
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.mathDoneKbd, "aria-hidden": true, children: "↵" })
|
|
6284
5836
|
]
|
|
6285
5837
|
}
|
|
6286
5838
|
)
|
|
@@ -6295,7 +5847,7 @@ function MathEditorPopover({
|
|
|
6295
5847
|
host
|
|
6296
5848
|
);
|
|
6297
5849
|
}
|
|
6298
|
-
const ToolbarButton = forwardRef(function ToolbarButton2({ title, active
|
|
5850
|
+
const ToolbarButton = forwardRef(function ToolbarButton2({ title, active, disabled, busy, onClick, children, className, ...rest }, ref) {
|
|
6299
5851
|
return /* @__PURE__ */ jsx(
|
|
6300
5852
|
"button",
|
|
6301
5853
|
{
|
|
@@ -6304,10 +5856,10 @@ const ToolbarButton = forwardRef(function ToolbarButton2({ title, active: active
|
|
|
6304
5856
|
type: "button",
|
|
6305
5857
|
title,
|
|
6306
5858
|
"aria-label": title,
|
|
6307
|
-
"aria-pressed":
|
|
5859
|
+
"aria-pressed": active,
|
|
6308
5860
|
"aria-busy": busy,
|
|
6309
5861
|
disabled,
|
|
6310
|
-
className: `${styles$
|
|
5862
|
+
className: `${styles$5.btn} ${active ? styles$5.btnActive : ""}${className ? ` ${className}` : ""}`,
|
|
6311
5863
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
6312
5864
|
onClick,
|
|
6313
5865
|
children
|
|
@@ -6315,7 +5867,7 @@ const ToolbarButton = forwardRef(function ToolbarButton2({ title, active: active
|
|
|
6315
5867
|
);
|
|
6316
5868
|
});
|
|
6317
5869
|
function Divider() {
|
|
6318
|
-
return /* @__PURE__ */ jsx("span", { className: styles$
|
|
5870
|
+
return /* @__PURE__ */ jsx("span", { className: styles$5.divider, "aria-hidden": true });
|
|
6319
5871
|
}
|
|
6320
5872
|
const LINE_HEIGHTS = ["1", "1.15", "1.5", "2", "2.5", "3"];
|
|
6321
5873
|
function readParaAttr(editor, name) {
|
|
@@ -6336,7 +5888,7 @@ function MenuPopover({
|
|
|
6336
5888
|
/* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(
|
|
6337
5889
|
Popover.Content,
|
|
6338
5890
|
{
|
|
6339
|
-
className: contentClassName ? `${styles$
|
|
5891
|
+
className: contentClassName ? `${styles$5.menu} ${contentClassName}` : styles$5.menu,
|
|
6340
5892
|
sideOffset: 4,
|
|
6341
5893
|
align,
|
|
6342
5894
|
onOpenAutoFocus: (e2) => e2.preventDefault(),
|
|
@@ -6358,7 +5910,7 @@ function MenuItem({
|
|
|
6358
5910
|
{
|
|
6359
5911
|
type: "button",
|
|
6360
5912
|
disabled,
|
|
6361
|
-
className: `${styles$
|
|
5913
|
+
className: `${styles$5.menuItem} ${selected ? styles$5.menuItemSelected : ""}`,
|
|
6362
5914
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
6363
5915
|
onClick: () => {
|
|
6364
5916
|
onSelect();
|
|
@@ -6373,29 +5925,29 @@ function NumberingFormatGrid({
|
|
|
6373
5925
|
onSelect
|
|
6374
5926
|
}) {
|
|
6375
5927
|
const close = useContext(MenuCloseCtx);
|
|
6376
|
-
return /* @__PURE__ */ jsx("div", { className: styles$
|
|
6377
|
-
const
|
|
5928
|
+
return /* @__PURE__ */ jsx("div", { className: styles$5.numberingGrid, role: "group", "aria-label": "Numbering formats", children: NUMBERING_FORMAT_IDS.map((format) => {
|
|
5929
|
+
const active = current === format;
|
|
6378
5930
|
return /* @__PURE__ */ jsx(
|
|
6379
5931
|
"button",
|
|
6380
5932
|
{
|
|
6381
5933
|
type: "button",
|
|
6382
5934
|
role: "menuitem",
|
|
6383
5935
|
"aria-label": NUMBERING_FORMAT_LABELS[format],
|
|
6384
|
-
"aria-pressed":
|
|
6385
|
-
className: `${styles$
|
|
5936
|
+
"aria-pressed": active,
|
|
5937
|
+
className: `${styles$5.numberingOption}${active ? ` ${styles$5.numberingOptionActive}` : ""}`,
|
|
6386
5938
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
6387
5939
|
onClick: () => {
|
|
6388
5940
|
onSelect(format);
|
|
6389
5941
|
close();
|
|
6390
5942
|
},
|
|
6391
|
-
children: /* @__PURE__ */ jsx("span", { className: styles$
|
|
5943
|
+
children: /* @__PURE__ */ jsx("span", { className: styles$5.numberingPreview, children: NUMBERING_FORMAT_PREVIEWS[format].map((row2, index) => /* @__PURE__ */ jsxs(
|
|
6392
5944
|
"span",
|
|
6393
5945
|
{
|
|
6394
|
-
className: styles$
|
|
5946
|
+
className: styles$5.numberingPreviewRow,
|
|
6395
5947
|
"data-depth": row2.depth,
|
|
6396
5948
|
children: [
|
|
6397
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6398
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
5949
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.numberingPreviewMarker, children: row2.marker }),
|
|
5950
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.numberingPreviewLine })
|
|
6399
5951
|
]
|
|
6400
5952
|
},
|
|
6401
5953
|
`${format}-${index}`
|
|
@@ -6430,21 +5982,21 @@ function TableInsertItem({
|
|
|
6430
5982
|
{
|
|
6431
5983
|
type: "button",
|
|
6432
5984
|
disabled,
|
|
6433
|
-
className: `${styles$
|
|
5985
|
+
className: `${styles$5.menuItem} ${open ? styles$5.menuItemSelected : ""}`,
|
|
6434
5986
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
6435
5987
|
children: [
|
|
6436
|
-
/* @__PURE__ */ jsxs("span", { className: styles$
|
|
6437
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
5988
|
+
/* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
5989
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: "⊞" }),
|
|
6438
5990
|
labels.tableInsert
|
|
6439
5991
|
] }),
|
|
6440
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$
|
|
5992
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$5.tableInsertCaret })
|
|
6441
5993
|
]
|
|
6442
5994
|
}
|
|
6443
5995
|
) }),
|
|
6444
5996
|
/* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsxs(
|
|
6445
5997
|
Popover.Content,
|
|
6446
5998
|
{
|
|
6447
|
-
className: styles$
|
|
5999
|
+
className: styles$5.tableSizePicker,
|
|
6448
6000
|
side: "right",
|
|
6449
6001
|
align: "start",
|
|
6450
6002
|
sideOffset: 6,
|
|
@@ -6454,7 +6006,7 @@ function TableInsertItem({
|
|
|
6454
6006
|
/* @__PURE__ */ jsx(
|
|
6455
6007
|
"div",
|
|
6456
6008
|
{
|
|
6457
|
-
className: styles$
|
|
6009
|
+
className: styles$5.tableSizeGrid,
|
|
6458
6010
|
style: {
|
|
6459
6011
|
gridTemplateColumns: `repeat(${TABLE_PICKER_COLS}, 1fr)`
|
|
6460
6012
|
},
|
|
@@ -6462,13 +6014,13 @@ function TableInsertItem({
|
|
|
6462
6014
|
children: Array.from({ length: TABLE_PICKER_ROWS * TABLE_PICKER_COLS }, (_, i) => {
|
|
6463
6015
|
const col = i % TABLE_PICKER_COLS + 1;
|
|
6464
6016
|
const row2 = Math.floor(i / TABLE_PICKER_COLS) + 1;
|
|
6465
|
-
const
|
|
6017
|
+
const active = hover.cols > 0 && col <= hover.cols && row2 <= hover.rows;
|
|
6466
6018
|
return /* @__PURE__ */ jsx(
|
|
6467
6019
|
"button",
|
|
6468
6020
|
{
|
|
6469
6021
|
type: "button",
|
|
6470
6022
|
"aria-label": labels.tableSizeSelected(col, row2),
|
|
6471
|
-
className: `${styles$
|
|
6023
|
+
className: `${styles$5.tableSizeCell} ${active ? styles$5.tableSizeCellActive : ""}`,
|
|
6472
6024
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
6473
6025
|
onMouseEnter: () => setHover({ cols: col, rows: row2 }),
|
|
6474
6026
|
onClick: () => {
|
|
@@ -6483,7 +6035,7 @@ function TableInsertItem({
|
|
|
6483
6035
|
})
|
|
6484
6036
|
}
|
|
6485
6037
|
),
|
|
6486
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
6038
|
+
/* @__PURE__ */ jsx("div", { className: styles$5.tableSizeLabel, children: hover.cols > 0 ? labels.tableSizeSelected(hover.cols, hover.rows) : labels.tableInsert })
|
|
6487
6039
|
]
|
|
6488
6040
|
}
|
|
6489
6041
|
) })
|
|
@@ -6505,20 +6057,20 @@ function ColorPopover({
|
|
|
6505
6057
|
"button",
|
|
6506
6058
|
{
|
|
6507
6059
|
type: "button",
|
|
6508
|
-
className: styles$
|
|
6060
|
+
className: styles$5.btn,
|
|
6509
6061
|
title,
|
|
6510
6062
|
"aria-label": title,
|
|
6511
6063
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
6512
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
6513
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6514
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6064
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.colorIcon, children: [
|
|
6065
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.colorIconGlyph, children: glyph }),
|
|
6066
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.colorIconBar, style: { background: bar2 } })
|
|
6515
6067
|
] })
|
|
6516
6068
|
}
|
|
6517
6069
|
) }),
|
|
6518
6070
|
/* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(
|
|
6519
6071
|
Popover.Content,
|
|
6520
6072
|
{
|
|
6521
|
-
className: styles$
|
|
6073
|
+
className: styles$5.popoverContent,
|
|
6522
6074
|
sideOffset: 4,
|
|
6523
6075
|
align: "start",
|
|
6524
6076
|
onOpenAutoFocus: (e2) => e2.preventDefault(),
|
|
@@ -6527,8 +6079,8 @@ function ColorPopover({
|
|
|
6527
6079
|
ColorPalette,
|
|
6528
6080
|
{
|
|
6529
6081
|
value,
|
|
6530
|
-
onPick: (
|
|
6531
|
-
onPick(
|
|
6082
|
+
onPick: (c2) => {
|
|
6083
|
+
onPick(c2);
|
|
6532
6084
|
setOpen(false);
|
|
6533
6085
|
},
|
|
6534
6086
|
locale
|
|
@@ -6784,8 +6336,8 @@ function EditorToolbar({
|
|
|
6784
6336
|
/* @__PURE__ */ jsx(
|
|
6785
6337
|
"div",
|
|
6786
6338
|
{
|
|
6787
|
-
className: className ? `${styles$
|
|
6788
|
-
children: /* @__PURE__ */ jsxs("div", { className: styles$
|
|
6339
|
+
className: className ? `${styles$5.toolbar} ${className}` : styles$5.toolbar,
|
|
6340
|
+
children: /* @__PURE__ */ jsxs("div", { className: styles$5.inner, children: [
|
|
6789
6341
|
/* @__PURE__ */ jsx(
|
|
6790
6342
|
ToolbarButton,
|
|
6791
6343
|
{
|
|
@@ -6812,12 +6364,12 @@ function EditorToolbar({
|
|
|
6812
6364
|
"button",
|
|
6813
6365
|
{
|
|
6814
6366
|
type: "button",
|
|
6815
|
-
className: styles$
|
|
6367
|
+
className: styles$5.styleTrigger,
|
|
6816
6368
|
title: t.style,
|
|
6817
6369
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
6818
6370
|
children: [
|
|
6819
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6820
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$
|
|
6371
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleTriggerLabel, children: t.style }),
|
|
6372
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$5.styleTriggerCaret })
|
|
6821
6373
|
]
|
|
6822
6374
|
}
|
|
6823
6375
|
),
|
|
@@ -6827,8 +6379,8 @@ function EditorToolbar({
|
|
|
6827
6379
|
{
|
|
6828
6380
|
selected: (state.headingLevel ?? 0) === 0,
|
|
6829
6381
|
onSelect: () => setBlockStyle(0),
|
|
6830
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
6831
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6382
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6383
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: "¶" }),
|
|
6832
6384
|
t.normalText
|
|
6833
6385
|
] })
|
|
6834
6386
|
}
|
|
@@ -6838,8 +6390,8 @@ function EditorToolbar({
|
|
|
6838
6390
|
{
|
|
6839
6391
|
selected: state.headingLevel === lv,
|
|
6840
6392
|
onSelect: () => setBlockStyle(lv),
|
|
6841
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
6842
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6393
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6394
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: `H${lv}` }),
|
|
6843
6395
|
t.headingLabel(lv)
|
|
6844
6396
|
] })
|
|
6845
6397
|
},
|
|
@@ -6855,14 +6407,14 @@ function EditorToolbar({
|
|
|
6855
6407
|
"button",
|
|
6856
6408
|
{
|
|
6857
6409
|
type: "button",
|
|
6858
|
-
className: styles$
|
|
6410
|
+
className: styles$5.styleTrigger,
|
|
6859
6411
|
title: t.fontSize,
|
|
6860
6412
|
"aria-label": t.fontSize,
|
|
6861
6413
|
disabled: !canEditFontSize,
|
|
6862
6414
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
6863
6415
|
children: [
|
|
6864
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6865
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$
|
|
6416
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleTriggerLabel, children: state.fontSize || t.fontSize }),
|
|
6417
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$5.styleTriggerCaret })
|
|
6866
6418
|
]
|
|
6867
6419
|
}
|
|
6868
6420
|
),
|
|
@@ -6872,8 +6424,8 @@ function EditorToolbar({
|
|
|
6872
6424
|
{
|
|
6873
6425
|
selected: !state.fontSize,
|
|
6874
6426
|
onSelect: () => applyFontSize(""),
|
|
6875
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
6876
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6427
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6428
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: "A" }),
|
|
6877
6429
|
t.fontSizeDefault
|
|
6878
6430
|
] })
|
|
6879
6431
|
}
|
|
@@ -6883,8 +6435,8 @@ function EditorToolbar({
|
|
|
6883
6435
|
{
|
|
6884
6436
|
selected: state.fontSize === size,
|
|
6885
6437
|
onSelect: () => applyFontSize(size),
|
|
6886
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
6887
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6438
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6439
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: parseInt(size, 10) }),
|
|
6888
6440
|
size
|
|
6889
6441
|
] })
|
|
6890
6442
|
},
|
|
@@ -6968,13 +6520,13 @@ function EditorToolbar({
|
|
|
6968
6520
|
"button",
|
|
6969
6521
|
{
|
|
6970
6522
|
type: "button",
|
|
6971
|
-
className: `${styles$
|
|
6523
|
+
className: `${styles$5.scriptTrigger} ${scriptActive !== "normal" ? styles$5.btnActive : ""}`,
|
|
6972
6524
|
title: t.scriptMenu,
|
|
6973
6525
|
"aria-label": t.scriptMenu,
|
|
6974
6526
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
6975
6527
|
children: [
|
|
6976
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6977
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$
|
|
6528
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.scriptTriggerGlyph, children: "A" }),
|
|
6529
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$5.styleTriggerCaret })
|
|
6978
6530
|
]
|
|
6979
6531
|
}
|
|
6980
6532
|
),
|
|
@@ -6984,8 +6536,8 @@ function EditorToolbar({
|
|
|
6984
6536
|
{
|
|
6985
6537
|
selected: scriptActive === "normal",
|
|
6986
6538
|
onSelect: () => chain().unsetSuperscript().unsetSubscript().run(),
|
|
6987
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
6988
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6539
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6540
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: "A" }),
|
|
6989
6541
|
t.scriptNormal
|
|
6990
6542
|
] })
|
|
6991
6543
|
}
|
|
@@ -6995,8 +6547,8 @@ function EditorToolbar({
|
|
|
6995
6547
|
{
|
|
6996
6548
|
selected: scriptActive === "superscript",
|
|
6997
6549
|
onSelect: () => chain().unsetSubscript().toggleSuperscript().run(),
|
|
6998
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
6999
|
-
/* @__PURE__ */ jsxs("span", { className: `${styles$
|
|
6550
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6551
|
+
/* @__PURE__ */ jsxs("span", { className: `${styles$5.styleIcon} ${styles$5.scriptGlyph}`, children: [
|
|
7000
6552
|
"x",
|
|
7001
6553
|
/* @__PURE__ */ jsx("sup", { children: "2" })
|
|
7002
6554
|
] }),
|
|
@@ -7009,8 +6561,8 @@ function EditorToolbar({
|
|
|
7009
6561
|
{
|
|
7010
6562
|
selected: scriptActive === "subscript",
|
|
7011
6563
|
onSelect: () => chain().unsetSuperscript().toggleSubscript().run(),
|
|
7012
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
7013
|
-
/* @__PURE__ */ jsxs("span", { className: `${styles$
|
|
6564
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6565
|
+
/* @__PURE__ */ jsxs("span", { className: `${styles$5.styleIcon} ${styles$5.scriptGlyph}`, children: [
|
|
7014
6566
|
"x",
|
|
7015
6567
|
/* @__PURE__ */ jsx("sub", { children: "2" })
|
|
7016
6568
|
] }),
|
|
@@ -7050,19 +6602,19 @@ function EditorToolbar({
|
|
|
7050
6602
|
"button",
|
|
7051
6603
|
{
|
|
7052
6604
|
type: "button",
|
|
7053
|
-
className: styles$
|
|
6605
|
+
className: styles$5.styleTrigger,
|
|
7054
6606
|
title: importTitle,
|
|
7055
6607
|
"aria-label": importTitle,
|
|
7056
6608
|
"aria-busy": !!importing,
|
|
7057
6609
|
disabled: !!importing,
|
|
7058
6610
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
7059
6611
|
children: [
|
|
7060
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6612
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleTriggerLabel, children: t.importDocument }),
|
|
7061
6613
|
/* @__PURE__ */ jsx(
|
|
7062
6614
|
ChevronDownIcon,
|
|
7063
6615
|
{
|
|
7064
6616
|
size: 12,
|
|
7065
|
-
className: styles$
|
|
6617
|
+
className: styles$5.styleTriggerCaret
|
|
7066
6618
|
}
|
|
7067
6619
|
)
|
|
7068
6620
|
]
|
|
@@ -7084,7 +6636,7 @@ function EditorToolbar({
|
|
|
7084
6636
|
title: t.blockquote,
|
|
7085
6637
|
active: state.blockquote,
|
|
7086
6638
|
onClick: () => chain().toggleBlockquote().run(),
|
|
7087
|
-
children: /* @__PURE__ */ jsx("span", { className: styles$
|
|
6639
|
+
children: /* @__PURE__ */ jsx("span", { className: styles$5.txtIcon, children: "❝" })
|
|
7088
6640
|
}
|
|
7089
6641
|
),
|
|
7090
6642
|
/* @__PURE__ */ jsx(
|
|
@@ -7108,13 +6660,13 @@ function EditorToolbar({
|
|
|
7108
6660
|
"button",
|
|
7109
6661
|
{
|
|
7110
6662
|
type: "button",
|
|
7111
|
-
className: `${styles$
|
|
6663
|
+
className: `${styles$5.styleTrigger} ${styles$5.iconTrigger}`,
|
|
7112
6664
|
title: t.align,
|
|
7113
6665
|
"aria-label": t.align,
|
|
7114
6666
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
7115
6667
|
children: [
|
|
7116
6668
|
state.textAlign === "center" ? /* @__PURE__ */ jsx(AlignCenterIcon, {}) : state.textAlign === "right" ? /* @__PURE__ */ jsx(AlignRightIcon, {}) : state.textAlign === "justify" ? /* @__PURE__ */ jsx(AlignJustifyIcon, {}) : /* @__PURE__ */ jsx(AlignLeftIcon, {}),
|
|
7117
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$
|
|
6669
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$5.styleTriggerCaret })
|
|
7118
6670
|
]
|
|
7119
6671
|
}
|
|
7120
6672
|
),
|
|
@@ -7128,8 +6680,8 @@ function EditorToolbar({
|
|
|
7128
6680
|
{
|
|
7129
6681
|
selected: state.textAlign === value,
|
|
7130
6682
|
onSelect: () => chain().setTextAlign(value).run(),
|
|
7131
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
7132
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6683
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6684
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: /* @__PURE__ */ jsx(Icon, { size: 14 }) }),
|
|
7133
6685
|
label
|
|
7134
6686
|
] })
|
|
7135
6687
|
},
|
|
@@ -7144,23 +6696,23 @@ function EditorToolbar({
|
|
|
7144
6696
|
"button",
|
|
7145
6697
|
{
|
|
7146
6698
|
type: "button",
|
|
7147
|
-
className: `${styles$
|
|
6699
|
+
className: `${styles$5.styleTrigger} ${styles$5.iconTrigger}`,
|
|
7148
6700
|
title: t.indent,
|
|
7149
6701
|
"aria-label": t.indent,
|
|
7150
6702
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
7151
6703
|
children: [
|
|
7152
6704
|
/* @__PURE__ */ jsx(IndentIncreaseIcon, {}),
|
|
7153
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$
|
|
6705
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$5.styleTriggerCaret })
|
|
7154
6706
|
]
|
|
7155
6707
|
}
|
|
7156
6708
|
),
|
|
7157
6709
|
children: [
|
|
7158
|
-
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => chain().increaseIndent().run(), children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
7159
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6710
|
+
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => chain().increaseIndent().run(), children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6711
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: /* @__PURE__ */ jsx(IndentIncreaseIcon, { size: 14 }) }),
|
|
7160
6712
|
t.indentIncrease
|
|
7161
6713
|
] }) }),
|
|
7162
|
-
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => chain().decreaseIndent().run(), children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
7163
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6714
|
+
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => chain().decreaseIndent().run(), children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6715
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: /* @__PURE__ */ jsx(IndentDecreaseIcon, { size: 14 }) }),
|
|
7164
6716
|
t.indentDecrease
|
|
7165
6717
|
] }) })
|
|
7166
6718
|
]
|
|
@@ -7173,13 +6725,13 @@ function EditorToolbar({
|
|
|
7173
6725
|
"button",
|
|
7174
6726
|
{
|
|
7175
6727
|
type: "button",
|
|
7176
|
-
className: `${styles$
|
|
6728
|
+
className: `${styles$5.styleTrigger} ${styles$5.iconTrigger}`,
|
|
7177
6729
|
title: t.lineHeight,
|
|
7178
6730
|
"aria-label": t.lineHeight,
|
|
7179
6731
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
7180
6732
|
children: [
|
|
7181
6733
|
/* @__PURE__ */ jsx(LineHeightIcon, {}),
|
|
7182
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$
|
|
6734
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$5.styleTriggerCaret })
|
|
7183
6735
|
]
|
|
7184
6736
|
}
|
|
7185
6737
|
),
|
|
@@ -7189,8 +6741,8 @@ function EditorToolbar({
|
|
|
7189
6741
|
{
|
|
7190
6742
|
selected: !state.lineHeight,
|
|
7191
6743
|
onSelect: () => chain().setLineHeight(null).run(),
|
|
7192
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
7193
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6744
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6745
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: "—" }),
|
|
7194
6746
|
t.lineHeightDefault
|
|
7195
6747
|
] })
|
|
7196
6748
|
}
|
|
@@ -7200,8 +6752,8 @@ function EditorToolbar({
|
|
|
7200
6752
|
{
|
|
7201
6753
|
selected: state.lineHeight === Number(value),
|
|
7202
6754
|
onSelect: () => chain().setLineHeight(Number(value)).run(),
|
|
7203
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
7204
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6755
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6756
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: "≡" }),
|
|
7205
6757
|
value
|
|
7206
6758
|
] })
|
|
7207
6759
|
},
|
|
@@ -7223,7 +6775,7 @@ function EditorToolbar({
|
|
|
7223
6775
|
/* @__PURE__ */ jsxs(
|
|
7224
6776
|
"span",
|
|
7225
6777
|
{
|
|
7226
|
-
className: `${styles$
|
|
6778
|
+
className: `${styles$5.listSplit}${state.orderedList ? ` ${styles$5.listSplitActive}` : ""}`,
|
|
7227
6779
|
children: [
|
|
7228
6780
|
/* @__PURE__ */ jsx(
|
|
7229
6781
|
ToolbarButton,
|
|
@@ -7238,12 +6790,12 @@ function EditorToolbar({
|
|
|
7238
6790
|
MenuPopover,
|
|
7239
6791
|
{
|
|
7240
6792
|
align: "end",
|
|
7241
|
-
contentClassName: styles$
|
|
6793
|
+
contentClassName: styles$5.numberingMenu,
|
|
7242
6794
|
trigger: /* @__PURE__ */ jsx(
|
|
7243
6795
|
"button",
|
|
7244
6796
|
{
|
|
7245
6797
|
type: "button",
|
|
7246
|
-
className: `${styles$
|
|
6798
|
+
className: `${styles$5.numberingCaret}${state.numberingFormat ? ` ${styles$5.numberingCaretActive}` : ""}`,
|
|
7247
6799
|
title: t.numberingFormat,
|
|
7248
6800
|
"aria-label": t.numberingFormat,
|
|
7249
6801
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
@@ -7288,30 +6840,30 @@ function EditorToolbar({
|
|
|
7288
6840
|
"button",
|
|
7289
6841
|
{
|
|
7290
6842
|
type: "button",
|
|
7291
|
-
className: styles$
|
|
6843
|
+
className: styles$5.styleTrigger,
|
|
7292
6844
|
title: t.more,
|
|
7293
6845
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
7294
6846
|
children: [
|
|
7295
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
7296
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$
|
|
6847
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleTriggerLabel, children: t.more }),
|
|
6848
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$5.styleTriggerCaret })
|
|
7297
6849
|
]
|
|
7298
6850
|
}
|
|
7299
6851
|
),
|
|
7300
6852
|
children: [
|
|
7301
|
-
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => chain().toggleCodeBlock().run(), children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
7302
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6853
|
+
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => chain().toggleCodeBlock().run(), children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6854
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: "{ }" }),
|
|
7303
6855
|
t.codeBlock
|
|
7304
6856
|
] }) }),
|
|
7305
|
-
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => openInsertMath("inline"), children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
7306
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6857
|
+
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => openInsertMath("inline"), children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6858
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: "√x" }),
|
|
7307
6859
|
t.inlineMath
|
|
7308
6860
|
] }) }),
|
|
7309
|
-
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => openInsertMath("block"), children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
7310
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6861
|
+
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => openInsertMath("block"), children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6862
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: "∑" }),
|
|
7311
6863
|
t.blockMath
|
|
7312
6864
|
] }) }),
|
|
7313
|
-
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => chain().setHorizontalRule().run(), children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
7314
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6865
|
+
/* @__PURE__ */ jsx(MenuItem, { onSelect: () => chain().setHorizontalRule().run(), children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6866
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: "—" }),
|
|
7315
6867
|
t.hr
|
|
7316
6868
|
] }) }),
|
|
7317
6869
|
/* @__PURE__ */ jsx(
|
|
@@ -7327,8 +6879,8 @@ function EditorToolbar({
|
|
|
7327
6879
|
{
|
|
7328
6880
|
disabled: item2.disabled,
|
|
7329
6881
|
onSelect: () => item2.onSelect(editor),
|
|
7330
|
-
children: /* @__PURE__ */ jsxs("span", { className: styles$
|
|
7331
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
6882
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles$5.styleItem, children: [
|
|
6883
|
+
/* @__PURE__ */ jsx("span", { className: styles$5.styleIcon, children: item2.icon }),
|
|
7332
6884
|
item2.label
|
|
7333
6885
|
] })
|
|
7334
6886
|
},
|
|
@@ -7369,159 +6921,6 @@ function EditorToolbar({
|
|
|
7369
6921
|
/* @__PURE__ */ jsx(ImageAlignTools, { editor, labels: t })
|
|
7370
6922
|
] });
|
|
7371
6923
|
}
|
|
7372
|
-
const desktop = "_desktop_euqdt_3";
|
|
7373
|
-
const header = "_header_euqdt_19";
|
|
7374
|
-
const headerTitle = "_headerTitle_euqdt_27";
|
|
7375
|
-
const collapseBtn = "_collapseBtn_euqdt_35";
|
|
7376
|
-
const collapsedRail = "_collapsedRail_euqdt_55";
|
|
7377
|
-
const list = "_list_euqdt_75";
|
|
7378
|
-
const item = "_item_euqdt_81";
|
|
7379
|
-
const itemText = "_itemText_euqdt_102";
|
|
7380
|
-
const active = "_active_euqdt_109";
|
|
7381
|
-
const locked = "_locked_euqdt_116";
|
|
7382
|
-
const lockIcon = "_lockIcon_euqdt_126";
|
|
7383
|
-
const mobile = "_mobile_euqdt_133";
|
|
7384
|
-
const mobileBar = "_mobileBar_euqdt_138";
|
|
7385
|
-
const mobileBarIcon = "_mobileBarIcon_euqdt_154";
|
|
7386
|
-
const chevron = "_chevron_euqdt_159";
|
|
7387
|
-
const chevronUp = "_chevronUp_euqdt_166";
|
|
7388
|
-
const mobilePanel = "_mobilePanel_euqdt_170";
|
|
7389
|
-
const mobilePanelOpen = "_mobilePanelOpen_euqdt_176";
|
|
7390
|
-
const styles$1 = {
|
|
7391
|
-
desktop,
|
|
7392
|
-
header,
|
|
7393
|
-
headerTitle,
|
|
7394
|
-
collapseBtn,
|
|
7395
|
-
collapsedRail,
|
|
7396
|
-
list,
|
|
7397
|
-
item,
|
|
7398
|
-
itemText,
|
|
7399
|
-
active,
|
|
7400
|
-
locked,
|
|
7401
|
-
lockIcon,
|
|
7402
|
-
mobile,
|
|
7403
|
-
mobileBar,
|
|
7404
|
-
mobileBarIcon,
|
|
7405
|
-
chevron,
|
|
7406
|
-
chevronUp,
|
|
7407
|
-
mobilePanel,
|
|
7408
|
-
mobilePanelOpen
|
|
7409
|
-
};
|
|
7410
|
-
function TocPanel({
|
|
7411
|
-
items,
|
|
7412
|
-
activeId,
|
|
7413
|
-
onItemClick,
|
|
7414
|
-
locale = "en"
|
|
7415
|
-
}) {
|
|
7416
|
-
const t = getLocaleBundle(locale).toc;
|
|
7417
|
-
const isMobile = useIsMobile();
|
|
7418
|
-
const [collapsed, setCollapsed] = useState(false);
|
|
7419
|
-
const [mobileOpen, setMobileOpen] = useState(false);
|
|
7420
|
-
const desktopNavRef = useRef(null);
|
|
7421
|
-
const mobilePanelRef = useRef(null);
|
|
7422
|
-
useEffect(() => {
|
|
7423
|
-
if (!activeId) return;
|
|
7424
|
-
const reduce = window.matchMedia(
|
|
7425
|
-
"(prefers-reduced-motion: reduce)"
|
|
7426
|
-
).matches;
|
|
7427
|
-
const container = desktopNavRef.current || mobilePanelRef.current;
|
|
7428
|
-
if (!container) return;
|
|
7429
|
-
const el = container.querySelector(`a[href="#${CSS.escape(activeId)}"]`);
|
|
7430
|
-
if (!el) return;
|
|
7431
|
-
el.scrollIntoView({
|
|
7432
|
-
block: "nearest",
|
|
7433
|
-
behavior: reduce ? "auto" : "smooth"
|
|
7434
|
-
});
|
|
7435
|
-
}, [activeId]);
|
|
7436
|
-
if (!items.length) return null;
|
|
7437
|
-
const minLevel = Math.min(...items.map((i) => i.level));
|
|
7438
|
-
const handleClick = (item2) => {
|
|
7439
|
-
if (item2.locked) return;
|
|
7440
|
-
onItemClick == null ? void 0 : onItemClick(item2);
|
|
7441
|
-
if (isMobile) setMobileOpen(false);
|
|
7442
|
-
};
|
|
7443
|
-
const list2 = /* @__PURE__ */ jsx("ul", { className: styles$1.list, children: items.map((item2) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
7444
|
-
"a",
|
|
7445
|
-
{
|
|
7446
|
-
href: item2.locked ? void 0 : `#${item2.id}`,
|
|
7447
|
-
className: `${styles$1.item} ${item2.id === activeId ? styles$1.active : ""} ${item2.locked ? styles$1.locked : ""}`,
|
|
7448
|
-
style: { paddingLeft: `${(item2.level - minLevel) * 12 + 12}px` },
|
|
7449
|
-
"aria-current": item2.id === activeId ? "true" : void 0,
|
|
7450
|
-
"aria-disabled": item2.locked ? "true" : void 0,
|
|
7451
|
-
onClick: (e2) => {
|
|
7452
|
-
e2.preventDefault();
|
|
7453
|
-
handleClick(item2);
|
|
7454
|
-
},
|
|
7455
|
-
children: [
|
|
7456
|
-
/* @__PURE__ */ jsx("span", { className: styles$1.itemText, children: item2.text }),
|
|
7457
|
-
item2.locked ? /* @__PURE__ */ jsx(LockIcon, { className: styles$1.lockIcon, "aria-hidden": true }) : null
|
|
7458
|
-
]
|
|
7459
|
-
}
|
|
7460
|
-
) }, item2.id)) });
|
|
7461
|
-
if (isMobile) {
|
|
7462
|
-
return /* @__PURE__ */ jsxs("nav", { className: styles$1.mobile, "aria-label": t.title, children: [
|
|
7463
|
-
/* @__PURE__ */ jsxs(
|
|
7464
|
-
"button",
|
|
7465
|
-
{
|
|
7466
|
-
type: "button",
|
|
7467
|
-
className: styles$1.mobileBar,
|
|
7468
|
-
"aria-expanded": mobileOpen,
|
|
7469
|
-
onClick: () => setMobileOpen((v) => !v),
|
|
7470
|
-
children: [
|
|
7471
|
-
/* @__PURE__ */ jsx(MenuIcon, { className: styles$1.mobileBarIcon, "aria-hidden": true }),
|
|
7472
|
-
/* @__PURE__ */ jsx("span", { children: t.title }),
|
|
7473
|
-
/* @__PURE__ */ jsx(
|
|
7474
|
-
"span",
|
|
7475
|
-
{
|
|
7476
|
-
className: `${styles$1.chevron} ${mobileOpen ? styles$1.chevronUp : ""}`,
|
|
7477
|
-
"aria-hidden": true,
|
|
7478
|
-
children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: 16 })
|
|
7479
|
-
}
|
|
7480
|
-
)
|
|
7481
|
-
]
|
|
7482
|
-
}
|
|
7483
|
-
),
|
|
7484
|
-
/* @__PURE__ */ jsx(
|
|
7485
|
-
"div",
|
|
7486
|
-
{
|
|
7487
|
-
ref: mobilePanelRef,
|
|
7488
|
-
className: `${styles$1.mobilePanel} ${mobileOpen ? styles$1.mobilePanelOpen : ""}`,
|
|
7489
|
-
children: list2
|
|
7490
|
-
}
|
|
7491
|
-
)
|
|
7492
|
-
] });
|
|
7493
|
-
}
|
|
7494
|
-
if (collapsed) {
|
|
7495
|
-
return /* @__PURE__ */ jsx(
|
|
7496
|
-
"button",
|
|
7497
|
-
{
|
|
7498
|
-
type: "button",
|
|
7499
|
-
className: styles$1.collapsedRail,
|
|
7500
|
-
"aria-label": t.expand,
|
|
7501
|
-
title: t.expand,
|
|
7502
|
-
onClick: () => setCollapsed(false),
|
|
7503
|
-
children: /* @__PURE__ */ jsx(ListUnorderedIcon, {})
|
|
7504
|
-
}
|
|
7505
|
-
);
|
|
7506
|
-
}
|
|
7507
|
-
return /* @__PURE__ */ jsxs("nav", { className: styles$1.desktop, "aria-label": t.title, ref: desktopNavRef, children: [
|
|
7508
|
-
/* @__PURE__ */ jsxs("div", { className: styles$1.header, children: [
|
|
7509
|
-
/* @__PURE__ */ jsx("span", { className: styles$1.headerTitle, children: t.title }),
|
|
7510
|
-
/* @__PURE__ */ jsx(
|
|
7511
|
-
"button",
|
|
7512
|
-
{
|
|
7513
|
-
type: "button",
|
|
7514
|
-
className: styles$1.collapseBtn,
|
|
7515
|
-
"aria-label": t.collapse,
|
|
7516
|
-
title: t.collapse,
|
|
7517
|
-
onClick: () => setCollapsed(true),
|
|
7518
|
-
children: "«"
|
|
7519
|
-
}
|
|
7520
|
-
)
|
|
7521
|
-
] }),
|
|
7522
|
-
list2
|
|
7523
|
-
] });
|
|
7524
|
-
}
|
|
7525
6924
|
function resetImageSize(editor) {
|
|
7526
6925
|
const pos = findImagePos(editor);
|
|
7527
6926
|
if (pos == null) return false;
|
|
@@ -7753,9 +7152,9 @@ export {
|
|
|
7753
7152
|
RedoIcon,
|
|
7754
7153
|
ReplaceAllIcon,
|
|
7755
7154
|
ReplaceIcon,
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7155
|
+
R as ReportContent,
|
|
7156
|
+
b as ReportContentInteractive,
|
|
7157
|
+
c as ReportContentWithCharts,
|
|
7759
7158
|
RotateCcwIcon,
|
|
7760
7159
|
RowAfterIcon,
|
|
7761
7160
|
RowBeforeIcon,
|
|
@@ -7765,7 +7164,6 @@ export {
|
|
|
7765
7164
|
SlashMenu,
|
|
7766
7165
|
StrikethroughIcon,
|
|
7767
7166
|
TableDeleteIcon,
|
|
7768
|
-
TocPanel,
|
|
7769
7167
|
TrashIcon,
|
|
7770
7168
|
UnderlineIcon,
|
|
7771
7169
|
UndoIcon,
|