@smartdoca/markdown 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/README.zh-CN.md +10 -1
- package/dist/chunks/index-Cd3grnUT.js +2815 -0
- package/dist/chunks/index-DQLDZhUI.cjs +86 -0
- package/dist/chunks/pdf-file-impl-CMlXt-sQ.cjs +8 -0
- package/dist/chunks/pdf-file-impl-Hh_4oE89.js +622 -0
- package/dist/index.cjs +1 -51
- package/dist/index.js +48 -2351
- package/dist/style.css +1 -1
- package/dist/types/components/ImageLightbox.d.ts +13 -0
- package/dist/types/components/ImageLightbox.d.ts.map +1 -0
- package/dist/types/components/MarkdownPreview.d.ts +4 -1
- package/dist/types/components/MarkdownPreview.d.ts.map +1 -1
- package/dist/types/components/MermaidDiagram.d.ts.map +1 -1
- package/dist/types/editor/i18n.d.ts +777 -3
- package/dist/types/editor/i18n.d.ts.map +1 -1
- package/dist/types/editor/image-preview.d.ts +30 -0
- package/dist/types/editor/image-preview.d.ts.map +1 -0
- package/dist/types/editor/locales/es.d.ts +130 -0
- package/dist/types/editor/locales/es.d.ts.map +1 -0
- package/dist/types/editor/locales/fr.d.ts +130 -0
- package/dist/types/editor/locales/fr.d.ts.map +1 -0
- package/dist/types/editor/locales/ja.d.ts +130 -0
- package/dist/types/editor/locales/ja.d.ts.map +1 -0
- package/dist/types/editor/locales/ko.d.ts +130 -0
- package/dist/types/editor/locales/ko.d.ts.map +1 -0
- package/dist/types/editor/locales/ru.d.ts +130 -0
- package/dist/types/editor/locales/ru.d.ts.map +1 -0
- package/dist/types/editor/locales/zh-Hant.d.ts +130 -0
- package/dist/types/editor/locales/zh-Hant.d.ts.map +1 -0
- package/dist/types/editor/locales.d.ts +771 -0
- package/dist/types/editor/locales.d.ts.map +1 -0
- package/dist/types/editor/pdf-contract.d.ts +77 -0
- package/dist/types/editor/pdf-contract.d.ts.map +1 -0
- package/dist/types/editor/pdf-file-impl.d.ts +7 -0
- package/dist/types/editor/pdf-file-impl.d.ts.map +1 -0
- package/dist/types/editor/pdf-file.d.ts +4 -78
- package/dist/types/editor/pdf-file.d.ts.map +1 -1
- package/dist/types/lib/CollaborativeMarkdownEditor.d.ts +3 -0
- package/dist/types/lib/CollaborativeMarkdownEditor.d.ts.map +1 -1
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/index.d.ts.map +1 -1
- package/docs/COLLABORATION.md +4 -0
- package/docs/IMAGE_PREVIEW.md +62 -0
- package/package.json +3 -2
|
@@ -0,0 +1,2815 @@
|
|
|
1
|
+
import { jsx as d, jsxs as S, Fragment as le } from "react/jsx-runtime";
|
|
2
|
+
import { memo as We, useId as no, useState as j, useEffect as V, useRef as C, useCallback as Pe, useMemo as Z, useLayoutEffect as Dt, forwardRef as Xe, createElement as ht, useImperativeHandle as io } from "react";
|
|
3
|
+
import so from "@uiw/react-codemirror";
|
|
4
|
+
import { createPortal as Tt } from "react-dom";
|
|
5
|
+
import { markdown as lo } from "@codemirror/lang-markdown";
|
|
6
|
+
import { syntaxHighlighting as co, defaultHighlightStyle as mo } from "@codemirror/language";
|
|
7
|
+
import { ViewPlugin as uo, EditorView as de, Decoration as ge, WidgetType as fo, keymap as po } from "@codemirror/view";
|
|
8
|
+
import { StateEffect as Ce, StateField as go, EditorState as vt, Prec as bt } from "@codemirror/state";
|
|
9
|
+
import { yCollab as ho, ySyncAnnotation as vo } from "y-codemirror.next";
|
|
10
|
+
import * as U from "yjs";
|
|
11
|
+
import { ZoomOut as bo, ZoomIn as wo, RotateCcw as xo, X as ko, ChevronLeft as Fo, ChevronRight as yo, Undo2 as Po, Redo2 as Mo, ImagePlus as Do, Workflow as To, Sigma as Eo, PanelLeft as Lo, Columns2 as Co, PanelRight as Io, Check as So, TriangleAlert as Ro, CloudOff as Ao, LoaderCircle as No } from "lucide-react";
|
|
12
|
+
import Oo from "react-markdown";
|
|
13
|
+
import Uo from "remark-gfm";
|
|
14
|
+
import Bo from "remark-math";
|
|
15
|
+
import zo from "rehype-katex";
|
|
16
|
+
import qo from "rehype-raw";
|
|
17
|
+
import _o, { defaultSchema as _e } from "rehype-sanitize";
|
|
18
|
+
import J from "highlight.js/lib/core";
|
|
19
|
+
import Vo from "highlight.js/lib/languages/bash";
|
|
20
|
+
import Ho from "highlight.js/lib/languages/c";
|
|
21
|
+
import jo from "highlight.js/lib/languages/cpp";
|
|
22
|
+
import Ko from "highlight.js/lib/languages/csharp";
|
|
23
|
+
import $o from "highlight.js/lib/languages/css";
|
|
24
|
+
import Go from "highlight.js/lib/languages/dockerfile";
|
|
25
|
+
import Wo from "highlight.js/lib/languages/go";
|
|
26
|
+
import Xo from "highlight.js/lib/languages/graphql";
|
|
27
|
+
import Yo from "highlight.js/lib/languages/java";
|
|
28
|
+
import Zo from "highlight.js/lib/languages/javascript";
|
|
29
|
+
import Jo from "highlight.js/lib/languages/json";
|
|
30
|
+
import Qo from "highlight.js/lib/languages/kotlin";
|
|
31
|
+
import ea from "highlight.js/lib/languages/markdown";
|
|
32
|
+
import ta from "highlight.js/lib/languages/php";
|
|
33
|
+
import oa from "highlight.js/lib/languages/python";
|
|
34
|
+
import aa from "highlight.js/lib/languages/ruby";
|
|
35
|
+
import ra from "highlight.js/lib/languages/rust";
|
|
36
|
+
import na from "highlight.js/lib/languages/sql";
|
|
37
|
+
import ia from "highlight.js/lib/languages/swift";
|
|
38
|
+
import sa from "highlight.js/lib/languages/typescript";
|
|
39
|
+
import la from "highlight.js/lib/languages/xml";
|
|
40
|
+
import da from "highlight.js/lib/languages/yaml";
|
|
41
|
+
import { postprocess as ca, parse as ma, preprocess as ua } from "micromark";
|
|
42
|
+
import { gfm as fa } from "micromark-extension-gfm";
|
|
43
|
+
import { decodeString as pa } from "micromark-util-decode-string";
|
|
44
|
+
import { IndexeddbPersistence as ga } from "y-indexeddb";
|
|
45
|
+
import { WebsocketProvider as ha } from "y-websocket";
|
|
46
|
+
import { Awareness as Et } from "y-protocols/awareness";
|
|
47
|
+
const va = {
|
|
48
|
+
"collaboration.initializationFailed": "本地協同資料載入失敗",
|
|
49
|
+
"collaboration.schemaMismatch": "文件格式不受支援",
|
|
50
|
+
"diagram.syntaxError": "流程圖語法有誤,請檢查 Mermaid 程式碼。",
|
|
51
|
+
"document.title": "協作文件",
|
|
52
|
+
"editor.characters.one": "{count} 字元",
|
|
53
|
+
"editor.characters.other": "{count} 字元",
|
|
54
|
+
"editor.pane": "Markdown 編輯器",
|
|
55
|
+
"editor.transportRequired": "roomId 和 websocketUrl 必填,或傳入宿主管理的 collaboration 會話",
|
|
56
|
+
"footer.dropImages": "圖片可直接拖入或貼上",
|
|
57
|
+
"footer.formats": "支援 CommonMark · GFM · Mermaid",
|
|
58
|
+
"footer.readOnly": "只讀模式",
|
|
59
|
+
"format.bold": "加粗",
|
|
60
|
+
"format.boldPlaceholder": "加粗文字",
|
|
61
|
+
"format.bulletList": "無序列表",
|
|
62
|
+
"format.codePlaceholder": "程式碼",
|
|
63
|
+
"format.colorPlaceholder": "彩色文字",
|
|
64
|
+
"format.heading1": "一級標題",
|
|
65
|
+
"format.heading2": "二級標題",
|
|
66
|
+
"format.heading3": "三級標題",
|
|
67
|
+
"format.heading4": "四級標題",
|
|
68
|
+
"format.heading5": "五級標題",
|
|
69
|
+
"format.inlineCode": "行內程式碼",
|
|
70
|
+
"format.italic": "斜體",
|
|
71
|
+
"format.italicPlaceholder": "斜體文字",
|
|
72
|
+
"format.link": "連結",
|
|
73
|
+
"format.linkPlaceholder": "連結文字",
|
|
74
|
+
"format.orderedList": "有序列表",
|
|
75
|
+
"format.quote": "引用",
|
|
76
|
+
"format.strike": "刪除線",
|
|
77
|
+
"format.strikePlaceholder": "刪除文字",
|
|
78
|
+
"format.task": "待辦事項",
|
|
79
|
+
"header.room": "房間 · {roomId}",
|
|
80
|
+
"image.close": "關閉圖片預覽",
|
|
81
|
+
"image.counter": "{current} / {total}",
|
|
82
|
+
"image.diagram": "流程圖",
|
|
83
|
+
"image.hint": "拖動平移 · 滾輪縮放 · 方向鍵或滑動切換",
|
|
84
|
+
"image.image": "圖片",
|
|
85
|
+
"image.next": "下一張圖片",
|
|
86
|
+
"image.open": "預覽{name}",
|
|
87
|
+
"image.preview": "圖片預覽",
|
|
88
|
+
"image.previous": "上一張圖片",
|
|
89
|
+
"image.reset": "重置縮放和位置",
|
|
90
|
+
"image.unavailable": "此圖片暫時無法顯示",
|
|
91
|
+
"image.zoomIn": "放大",
|
|
92
|
+
"image.zoomOut": "縮小",
|
|
93
|
+
"insert.codePlaceholder": "在這裡輸入程式碼",
|
|
94
|
+
"insert.diagram": `
|
|
95
|
+
\`\`\`mermaid
|
|
96
|
+
flowchart TD
|
|
97
|
+
A["開始"] --> B{"通過審查?"}
|
|
98
|
+
B -->|是| C["完成"]
|
|
99
|
+
B -->|否| D["修改"]
|
|
100
|
+
\`\`\`
|
|
101
|
+
`,
|
|
102
|
+
"loading.document": "正在獲取協作文件…",
|
|
103
|
+
"markdown.binary": "檔案包含 NUL 字元,可能是二進位制或不受支援的 UTF-16/UTF-32 編碼",
|
|
104
|
+
"markdown.bomRemoved": "已移除檔案開頭的 UTF-8 BOM;正文內的 U+FEFF 保留",
|
|
105
|
+
"markdown.fileTooLarge": "檔案超過 {maxBytes} 位元組限制",
|
|
106
|
+
"markdown.invalidUtf8": "檔案不是有效 UTF-8;請先轉換編碼,未替換任何損壞字元",
|
|
107
|
+
"markdown.mixedLineEndings": "檔案混用了換行格式;原樣保留,未統一換行",
|
|
108
|
+
"markdown.readFailed": "無法讀取 Markdown 檔案",
|
|
109
|
+
"markdown.resourcePreserved": "僅交換 Markdown 原文;圖片、附件和內部連結的 ID/path/地址原樣保留,未讀取資源或驗證授權,平臺內部資源離開平臺不保證可訪問。",
|
|
110
|
+
"markdown.unsupportedExtension": "只支援 .md 和 .markdown 檔案",
|
|
111
|
+
"notice.downloadFailed": "下載失敗",
|
|
112
|
+
"notice.imageRequired": "請選擇圖片檔案",
|
|
113
|
+
"notice.readOnly": "當前文件為只讀模式",
|
|
114
|
+
"notice.uploadFailed": "圖片上傳失敗",
|
|
115
|
+
"notice.uploading": "正在處理圖片…",
|
|
116
|
+
"pdf.aborted": "PDF 轉換已取消",
|
|
117
|
+
"pdf.canvasUnavailable": "當前執行環境沒有可用的 Canvas,無法提取 PDF 內嵌圖片",
|
|
118
|
+
"pdf.complexTableExport": "表格按固定寬度繪製;合併單元格和超寬列可能有損",
|
|
119
|
+
"pdf.complexTableImport": "PDF 表格按座標文字近似還原,複雜合併單元格可能有損",
|
|
120
|
+
"pdf.errorDetail": "{message}({detail})",
|
|
121
|
+
"pdf.fileTooLarge": "PDF 檔案超過 {maxBytes} 位元組限制",
|
|
122
|
+
"pdf.fontFallback": "未提供可覆蓋全部字元的字型;不相容字元已替換為問號。建議在 PdfExportOptions.fontBytes 中提供中文 TTF/OTF 字型",
|
|
123
|
+
"pdf.fontFallbackCjk": "未提供中文字型;匯出會將標準字型無法編碼的字元降級為問號。請在 PdfExportOptions.fontBytes 中提供中文 TTF/OTF 字型",
|
|
124
|
+
"pdf.imageAlt": "PDF 圖片",
|
|
125
|
+
"pdf.imageFailed": "Markdown 圖片資源解析失敗,已用替代文字匯出",
|
|
126
|
+
"pdf.imageParseFailed": "PDF 內嵌圖片解析失敗,已繼續匯入文字",
|
|
127
|
+
"pdf.imagePixelLimit": "PDF 內圖片超過 {maxImagePixels} 畫素限制",
|
|
128
|
+
"pdf.imageSkipped": "PDF 內嵌圖片無法提取,已跳過",
|
|
129
|
+
"pdf.imageUnresolved": "Markdown 圖片未提供 resolveResource,已用替代文字匯出",
|
|
130
|
+
"pdf.inlineImageFailed": "Markdown 行內圖片資源解析失敗,已用替代文字匯出",
|
|
131
|
+
"pdf.inlineImageUnresolved": "Markdown 行內圖片未提供 resolveResource,已用替代文字匯出",
|
|
132
|
+
"pdf.inlineImageUnsupported": "Markdown 行內圖片格式不受支援,已用替代文字匯出",
|
|
133
|
+
"pdf.invalid": "PDF 檔案損壞或格式不受支援",
|
|
134
|
+
"pdf.mathDegraded": "數學公式已按可讀純文字降級",
|
|
135
|
+
"pdf.multiColumn": "檢測到可能的多欄佈局,文字順序按 PDF 座標近似重建",
|
|
136
|
+
"pdf.noText": "PDF 沒有可提取文字;掃描 PDF 第一階段不執行 OCR",
|
|
137
|
+
"pdf.noTextPage": "此頁沒有可提取文字;掃描 PDF 第一階段不執行 OCR",
|
|
138
|
+
"pdf.pageGeometry": "PDF 頁面尺寸和頁邊距必須為正數",
|
|
139
|
+
"pdf.pageLimit": "PDF 頁數超過 {maxPages} 頁限制",
|
|
140
|
+
"pdf.passwordRequired": "PDF 需要密碼,第一階段不支援密碼 PDF",
|
|
141
|
+
"pdf.pngFailed": "無法將 PDF 圖片轉換為 PNG",
|
|
142
|
+
"pdf.readFailed": "無法讀取 PDF 檔案",
|
|
143
|
+
"pdf.timeout": "PDF 轉換超過 {timeoutMs} 毫秒限制",
|
|
144
|
+
"pdf.unsafeLink": "已跳過不安全或無法驗證的 PDF 連結",
|
|
145
|
+
"pdf.unsafeLinkText": "已將不安全連結降級為純文字",
|
|
146
|
+
"presence.anonymous": "匿名",
|
|
147
|
+
"presence.cursor": "{name} 的游標",
|
|
148
|
+
"presence.online.one": "{count} 人線上",
|
|
149
|
+
"presence.online.other": "{count} 人線上",
|
|
150
|
+
"preview.label": "預覽",
|
|
151
|
+
"preview.live": "實時渲染",
|
|
152
|
+
"preview.pane": "文件預覽",
|
|
153
|
+
"preview.syncScroll": "同步滾動",
|
|
154
|
+
"preview.updating": "預覽更新中…",
|
|
155
|
+
"selection.toolbar": "選中文字操作",
|
|
156
|
+
"status.error": "協同錯誤",
|
|
157
|
+
"status.loading": "載入文件中",
|
|
158
|
+
"status.offline": "離線",
|
|
159
|
+
"status.offlineEditing": "離線編輯",
|
|
160
|
+
"status.ready": "協同就緒",
|
|
161
|
+
"status.syncing": "同步文件中",
|
|
162
|
+
"toolbar.codeLanguage": "程式碼語言",
|
|
163
|
+
"toolbar.insertCode": "插入程式碼塊",
|
|
164
|
+
"toolbar.insertDiagram": "插入流程圖",
|
|
165
|
+
"toolbar.insertFormula": "插入數學公式",
|
|
166
|
+
"toolbar.label": "Markdown 格式工具欄",
|
|
167
|
+
"toolbar.redo": "重做",
|
|
168
|
+
"toolbar.textColor": "文字顏色",
|
|
169
|
+
"toolbar.undo": "撤銷",
|
|
170
|
+
"toolbar.uploadImage": "上傳圖片",
|
|
171
|
+
"toolbar.viewEdit": "僅編輯",
|
|
172
|
+
"toolbar.viewPreview": "僅預覽",
|
|
173
|
+
"toolbar.viewSplit": "分欄",
|
|
174
|
+
"upload.failed": "上傳失敗({status})",
|
|
175
|
+
"upload.missingUrl": "上傳介面未返回圖片地址",
|
|
176
|
+
"upload.readFailed": "讀取圖片失敗",
|
|
177
|
+
"validation.loneSurrogate": "Markdown 包含孤立 UTF-16 代理字元,無法無損匯出為 UTF-8",
|
|
178
|
+
"validation.markdownString": "markdown 必須為字串",
|
|
179
|
+
"validation.nonNegativeInteger": "{name} 必須為非負安全整數",
|
|
180
|
+
"validation.positiveInteger": "{name} 必須為正安全整數"
|
|
181
|
+
}, ba = {
|
|
182
|
+
"collaboration.initializationFailed": "ローカルな共同編集データの読み込みに失敗しました",
|
|
183
|
+
"collaboration.schemaMismatch": "この文書形式はサポートされていません。",
|
|
184
|
+
"diagram.syntaxError": "図の構文が正しくありません。Mermaidコードを確認してください。",
|
|
185
|
+
"document.title": "共同で作成する文書",
|
|
186
|
+
"editor.characters.one": "{count}文字",
|
|
187
|
+
"editor.characters.other": "{count}文字",
|
|
188
|
+
"editor.pane": "Markdownエディター",
|
|
189
|
+
"editor.transportRequired": "roomIdとwebsocketUrlが必要です。または、ホストが管理する共同編集セッションを指定してください。",
|
|
190
|
+
"footer.dropImages": "画像をダウンロードまたは貼り付け",
|
|
191
|
+
"footer.formats": "CommonMark · GFM · Mermaid",
|
|
192
|
+
"footer.readOnly": "読み取り専用",
|
|
193
|
+
"format.bold": "太字",
|
|
194
|
+
"format.boldPlaceholder": "太字",
|
|
195
|
+
"format.bulletList": "項目形式のリスト",
|
|
196
|
+
"format.codePlaceholder": "コード",
|
|
197
|
+
"format.colorPlaceholder": "色付きテキスト",
|
|
198
|
+
"format.heading1": "ヘッディング1",
|
|
199
|
+
"format.heading2": "ヘッジング2",
|
|
200
|
+
"format.heading3": "ヘッジング3",
|
|
201
|
+
"format.heading4": "ヘッディング4",
|
|
202
|
+
"format.heading5": "項目5",
|
|
203
|
+
"format.inlineCode": "インラインコード",
|
|
204
|
+
"format.italic": "斜体",
|
|
205
|
+
"format.italicPlaceholder": "イタリック文字",
|
|
206
|
+
"format.link": "リンク",
|
|
207
|
+
"format.linkPlaceholder": "リンクテキスト",
|
|
208
|
+
"format.orderedList": "番号付きリスト",
|
|
209
|
+
"format.quote": "引用",
|
|
210
|
+
"format.strike": "取り消し線",
|
|
211
|
+
"format.strikePlaceholder": "文字を切り抜く",
|
|
212
|
+
"format.task": "タスクリスト",
|
|
213
|
+
"header.room": "ルーム · {roomId}",
|
|
214
|
+
"image.close": "画像プレビューを閉じる",
|
|
215
|
+
"image.counter": "{current} / {total}",
|
|
216
|
+
"image.diagram": "図表",
|
|
217
|
+
"image.hint": "ドラッグして移動する · スクロールして拡大する · 矢印キーまたはスワイプで切り替える",
|
|
218
|
+
"image.image": "画像",
|
|
219
|
+
"image.next": "次の画像",
|
|
220
|
+
"image.open": "プレビュー {name}",
|
|
221
|
+
"image.preview": "画像プレビュー",
|
|
222
|
+
"image.previous": "前の画像",
|
|
223
|
+
"image.reset": "ズームと位置をリセットする",
|
|
224
|
+
"image.unavailable": "この画像は利用できません",
|
|
225
|
+
"image.zoomIn": "ズームイン",
|
|
226
|
+
"image.zoomOut": "ズームアウト",
|
|
227
|
+
"insert.codePlaceholder": "ここにタイプコードを入力してください",
|
|
228
|
+
"insert.diagram": `
|
|
229
|
+
\`\`\`mermaid
|
|
230
|
+
flowchart TD
|
|
231
|
+
A["開始"] --> B{"承認しますか?"}
|
|
232
|
+
B -->|はい| C["完了"]
|
|
233
|
+
B -->|いいえ| D["修正"]
|
|
234
|
+
\`\`\`
|
|
235
|
+
`,
|
|
236
|
+
"loading.document": "共同で作成された文書の読み込み中…",
|
|
237
|
+
"markdown.binary": "このファイルにはNUL文字が含まれており、バイナリ形式であるか、UTF-16/UTF-32形式ではサポートされていない可能性があります。",
|
|
238
|
+
"markdown.bomRemoved": "ファイルの先頭のUTF-8 BOMを削除しました。中身のU+FEFFは保持されました。",
|
|
239
|
+
"markdown.fileTooLarge": "ファイルが{maxBytes}-バイトの制限を超えました",
|
|
240
|
+
"markdown.invalidUtf8": "ファイルは有効なUTF-8形式ではありません。先にエンコーディングを変換してください。損傷した文字は置き換えられていません。",
|
|
241
|
+
"markdown.mixedLineEndings": "ファイル内の行終端形式が混在しています。それらはそのまま保持されており、正規化されていません。",
|
|
242
|
+
"markdown.readFailed": "Markdownファイルを読み取ることができませんでした。",
|
|
243
|
+
"markdown.resourcePreserved": "マークダン形式のソースのみが交換される。画像、添付ファイル、内部リンクのID、パス、アドレスはそのまま保持される。リソースは読み取られず、認可もチェックされない。プラットフォーム内のリソースがプラットフォーム外でも正常に動作するとは限らない。",
|
|
244
|
+
"markdown.unsupportedExtension": ".mdおよび.markdownファイルのみがサポートされています。",
|
|
245
|
+
"notice.downloadFailed": "ダウンロードに失敗しました",
|
|
246
|
+
"notice.imageRequired": "画像ファイルを選択してください",
|
|
247
|
+
"notice.readOnly": "この文書は読み取り専用です。",
|
|
248
|
+
"notice.uploadFailed": "画像のアップロードに失敗しました",
|
|
249
|
+
"notice.uploading": "画像処理中…",
|
|
250
|
+
"pdf.aborted": "PDF変換が中止されました",
|
|
251
|
+
"pdf.canvasUnavailable": "この環境ではキャンバスが利用できないため、埋め込み型PDF画像を抽出することはできませんでした",
|
|
252
|
+
"pdf.complexTableExport": "テーブルは固定の幅で描かれています。マージされたセルや幅が広すぎる列は、データが失われる可能性があります。",
|
|
253
|
+
"pdf.complexTableImport": "PDF表は、テキストの座標からほぼ再構築される。複雑なマージされたセルは、データが失われる可能性がある。",
|
|
254
|
+
"pdf.errorDetail": "{message} ({detail})",
|
|
255
|
+
"pdf.fileTooLarge": "PDFは{maxBytes}バイトの制限を超えています",
|
|
256
|
+
"pdf.fontFallback": "すべての文字をカバーできるフォントは提供されていません。サポートされていない文字は疑問符に置き換えられました。PdfExportOptions.fontBytes内に中国語のTTF/OTFフォントを提供してください。",
|
|
257
|
+
"pdf.fontFallbackCjk": "中国語のフォントは提供されていません。標準フォントでは表記できない文字は疑問符で置き換えられています。PdfExportOptions.fontBytesに中国語のTTF/OTFフォントを提供してください。",
|
|
258
|
+
"pdf.imageAlt": "PDF画像",
|
|
259
|
+
"pdf.imageFailed": "Markdown画像を解決できませんでした。代替テキストがエクスポートされました。",
|
|
260
|
+
"pdf.imageParseFailed": "埋め込まれたPDF画像の解析に失敗しました。テキストのインポートは続行されました。",
|
|
261
|
+
"pdf.imagePixelLimit": "PDF内の画像が{maxImagePixels}ピクセルの制限を超えています",
|
|
262
|
+
"pdf.imageSkipped": "埋め込まれたPDF画像を抽出できませんでした。スキップされました。",
|
|
263
|
+
"pdf.imageUnresolved": "Markdown画像に対してresolveResourceコールバックが提供されなかった。代わりに代替テキストがエクスポートされた。",
|
|
264
|
+
"pdf.inlineImageFailed": "インラインのMarkdown画像を解決できませんでした。代替テキストがエクスポートされました。",
|
|
265
|
+
"pdf.inlineImageUnresolved": "インラインMarkdown画像に対してresolveResourceコールバックが提供されませんでした。代わりに代替テキストがエクスポートされました。",
|
|
266
|
+
"pdf.inlineImageUnsupported": "インラインマークダック画像形式はサポートされていません。代わりに代替テキストがエクスポートされました。",
|
|
267
|
+
"pdf.invalid": "PDFが破損しているか、サポートされていない形式を使用している",
|
|
268
|
+
"pdf.mathDegraded": "数学の内容は読みやすい普通のテキストに降格された",
|
|
269
|
+
"pdf.multiColumn": "複数の列が並ぶレイアウトが可能であることが検出されました。テキストの順序はPDFの座標からおおよそ再構築されています。",
|
|
270
|
+
"pdf.noText": "PDFには抽出可能なテキストがありません。スキャンされたPDFはこの段階ではOCR処理されていません。",
|
|
271
|
+
"pdf.noTextPage": "このページには抽出可能なテキストはありません。スキャンされたPDFはこの段階ではOCR処理されていません。",
|
|
272
|
+
"pdf.pageGeometry": "PDFのページサイズと余白は正の数でなければなりません。",
|
|
273
|
+
"pdf.pageLimit": "PDFは{maxPages}ページの制限を超えています",
|
|
274
|
+
"pdf.passwordRequired": "このPDFにはパスワードが必要です。この段階ではパスワード保護されたPDFはサポートされていません。",
|
|
275
|
+
"pdf.pngFailed": "PDF画像をPNGに変換できませんでした。",
|
|
276
|
+
"pdf.readFailed": "PDFファイルを読み取ることができませんでした。",
|
|
277
|
+
"pdf.timeout": "PDF変換が{timeoutMs}ミリ秒の制限を超えました",
|
|
278
|
+
"pdf.unsafeLink": "安全でない、または確認不可能なPDFリンクをスキップした",
|
|
279
|
+
"pdf.unsafeLinkText": "安全でないリンクを平文テキストに変換した",
|
|
280
|
+
"presence.anonymous": "匿名",
|
|
281
|
+
"presence.cursor": "{name}のカーソル",
|
|
282
|
+
"presence.online.one": "{count}人がオンライン",
|
|
283
|
+
"presence.online.other": "{count}人がオンライン",
|
|
284
|
+
"preview.label": "プレビュー",
|
|
285
|
+
"preview.live": "ライブレンダリング",
|
|
286
|
+
"preview.pane": "文書プレビュー",
|
|
287
|
+
"preview.syncScroll": "スクロール同期",
|
|
288
|
+
"preview.updating": "プレビューを更新中…",
|
|
289
|
+
"selection.toolbar": "選択操作",
|
|
290
|
+
"status.error": "共同編集エラー",
|
|
291
|
+
"status.loading": "文書の読み込み中",
|
|
292
|
+
"status.offline": "オフライン",
|
|
293
|
+
"status.offlineEditing": "オフライン編集",
|
|
294
|
+
"status.ready": "共同編集の準備ができています",
|
|
295
|
+
"status.syncing": "ドキュメントの同期",
|
|
296
|
+
"toolbar.codeLanguage": "コード言語",
|
|
297
|
+
"toolbar.insertCode": "コードブロックを挿入する",
|
|
298
|
+
"toolbar.insertDiagram": "図を挿入する",
|
|
299
|
+
"toolbar.insertFormula": "数学公式を挿入する",
|
|
300
|
+
"toolbar.label": "Markdownフォーマットツールバー",
|
|
301
|
+
"toolbar.redo": "やり直す",
|
|
302
|
+
"toolbar.textColor": "テキストの色",
|
|
303
|
+
"toolbar.undo": "元に戻す",
|
|
304
|
+
"toolbar.uploadImage": "画像をアップロードする",
|
|
305
|
+
"toolbar.viewEdit": "編集のみ",
|
|
306
|
+
"toolbar.viewPreview": "プレビューのみ",
|
|
307
|
+
"toolbar.viewSplit": "分割表示",
|
|
308
|
+
"upload.failed": "アップロード失敗({status})",
|
|
309
|
+
"upload.missingUrl": "アップロードエンドポイントが画像URLを返さなかった",
|
|
310
|
+
"upload.readFailed": "画像を読み取ることができませんでした",
|
|
311
|
+
"validation.loneSurrogate": "Markdownには孤立したUTF-16サローアが含まれており、データが失われることなくUTF-8にエクスポートすることはできません。",
|
|
312
|
+
"validation.markdownString": "markdownは文字列でなければなりません",
|
|
313
|
+
"validation.nonNegativeInteger": "{name}は非負の安全な整数でなければなりません",
|
|
314
|
+
"validation.positiveInteger": "{name}は正の安全な整数でなければなりません"
|
|
315
|
+
}, wa = {
|
|
316
|
+
"collaboration.initializationFailed": "Échec de chargement des données locales de collaboration",
|
|
317
|
+
"collaboration.schemaMismatch": "Ce format de document n’est pas supporté.",
|
|
318
|
+
"diagram.syntaxError": "La syntaxe du diagramme est invalide. Vérifiez le code Mermaid.",
|
|
319
|
+
"document.title": "Document collaboratif",
|
|
320
|
+
"editor.characters.one": "{count} caractère",
|
|
321
|
+
"editor.characters.other": "{count} caractères",
|
|
322
|
+
"editor.pane": "Editeur Markdown",
|
|
323
|
+
"editor.transportRequired": "roomId et websocketUrl sont obligatoires, ou passez une session de collaboration gérée par l'hôte",
|
|
324
|
+
"footer.dropImages": "Déposer ou coller des images",
|
|
325
|
+
"footer.formats": "CommonMark · GFM · Mermaid",
|
|
326
|
+
"footer.readOnly": "Sans modification",
|
|
327
|
+
"format.bold": "Gras",
|
|
328
|
+
"format.boldPlaceholder": "texte en gras",
|
|
329
|
+
"format.bulletList": "Liste à puces",
|
|
330
|
+
"format.codePlaceholder": "code",
|
|
331
|
+
"format.colorPlaceholder": "texte coloré",
|
|
332
|
+
"format.heading1": "Sous-titre 1",
|
|
333
|
+
"format.heading2": "Sous-titre 2",
|
|
334
|
+
"format.heading3": "Sous-titre 3",
|
|
335
|
+
"format.heading4": "Sous-titre 4",
|
|
336
|
+
"format.heading5": "Sous-titre 5",
|
|
337
|
+
"format.inlineCode": "Code en ligne",
|
|
338
|
+
"format.italic": "Italique",
|
|
339
|
+
"format.italicPlaceholder": "texte italique",
|
|
340
|
+
"format.link": "Lien",
|
|
341
|
+
"format.linkPlaceholder": "texte du lien",
|
|
342
|
+
"format.orderedList": "Liste numérotée",
|
|
343
|
+
"format.quote": "Citation",
|
|
344
|
+
"format.strike": "Barré",
|
|
345
|
+
"format.strikePlaceholder": "texte supprimé",
|
|
346
|
+
"format.task": "Liste de tâches",
|
|
347
|
+
"header.room": "Chambre · {roomId}",
|
|
348
|
+
"image.close": "Affichage prévisualisé de l'image",
|
|
349
|
+
"image.counter": "{current} / {total}",
|
|
350
|
+
"image.diagram": "Diagramme",
|
|
351
|
+
"image.hint": "Déplacer avec le curseur · Zoomer avec le scroll · Claviers flèches ou glisser pour changer",
|
|
352
|
+
"image.image": "Image",
|
|
353
|
+
"image.next": "Image suivante",
|
|
354
|
+
"image.open": "Prévisualisation {name}",
|
|
355
|
+
"image.preview": "Prévisualisation de l’image",
|
|
356
|
+
"image.previous": "Image précédente",
|
|
357
|
+
"image.reset": "Réinitialiser le zoom et la position",
|
|
358
|
+
"image.unavailable": "Cette image n’est pas disponible",
|
|
359
|
+
"image.zoomIn": "Zoomer en grossissement",
|
|
360
|
+
"image.zoomOut": "Reculer",
|
|
361
|
+
"insert.codePlaceholder": "Code de type ici",
|
|
362
|
+
"insert.diagram": `
|
|
363
|
+
\`\`\`mermaid
|
|
364
|
+
flowchart TD
|
|
365
|
+
A["Début"] --> B{"Validé ?"}
|
|
366
|
+
B -->|Oui| C["Terminé"]
|
|
367
|
+
B -->|Non| D["Réviser"]
|
|
368
|
+
\`\`\`
|
|
369
|
+
`,
|
|
370
|
+
"loading.document": "Chargement du document collaboratif…",
|
|
371
|
+
"markdown.binary": "Le fichier contient un caractère NUL et peut être binaire ou ne supporter pas le UTF-16/UTF-32",
|
|
372
|
+
"markdown.bomRemoved": "J’ai supprimé le BOM UTF-8 au début du fichier. Le caractère U+FEFF dans le corps du fichier a été conservé.",
|
|
373
|
+
"markdown.fileTooLarge": "Le fichier dépasse la limite de {maxBytes} octets",
|
|
374
|
+
"markdown.invalidUtf8": "Le fichier n’est pas valide en UTF-8. Convertissez d’abord le code de codage. Aucun caractère endommagé n’a été remplacé.",
|
|
375
|
+
"markdown.mixedLineEndings": "Le fichier mélange différents styles de fin de ligne. Ils ont été conservés tels quels et non normalisés.",
|
|
376
|
+
"markdown.readFailed": "Impossible de lire le fichier Markdown",
|
|
377
|
+
"markdown.resourcePreserved": "Seulement la source Markdown est échangée. Les identifiants d’images, d’attachements et de liens internes, les chemins et les adresses restent inchangés. Les ressources n’ont pas été lues et l’autorisation n’a pas été vérifiée. Les ressources internes de la plateforme ne sont pas garanties pour fonctionner en dehors de la plateforme.",
|
|
378
|
+
"markdown.unsupportedExtension": "Seuls les fichiers .md et .markdown sont supportés.",
|
|
379
|
+
"notice.downloadFailed": "Téléchargement échoué",
|
|
380
|
+
"notice.imageRequired": "Choisissez un fichier image",
|
|
381
|
+
"notice.readOnly": "Ce document est uniquement lu.",
|
|
382
|
+
"notice.uploadFailed": "L’enregistrement de l’image a échoué",
|
|
383
|
+
"notice.uploading": "Traitement de l’image…",
|
|
384
|
+
"pdf.aborted": "La conversion en PDF a été annulée",
|
|
385
|
+
"pdf.canvasUnavailable": 'Aucun "canvas" n’est disponible dans cet environnement, donc les images PDF intégrées ne pouvaient pas être extraites.',
|
|
386
|
+
"pdf.complexTableExport": "Les tables ont une largeur fixe. Les cellules fusionnées et les colonnes trop larges peuvent entraîner des pertes de données.",
|
|
387
|
+
"pdf.complexTableImport": "Les tableaux en PDF sont reconstruits à partir des coordonnées textuelles. Les cellules combinées complexes peuvent être perdues.",
|
|
388
|
+
"pdf.errorDetail": "{message} ({detail})",
|
|
389
|
+
"pdf.fileTooLarge": "Le fichier PDF dépasse la limite de {maxBytes} octets",
|
|
390
|
+
"pdf.fontFallback": "Aucun font couvrant tous les caractères n’a été fourni. Les caractères non supportés ont été remplacés par des points d’interrogation. Fournissez un font chinois TTF/OTF dans PdfExportOptions.fontBytes",
|
|
391
|
+
"pdf.fontFallbackCjk": "Aucun font chinois n’a été fourni. Les caractères que les fonts standards ne peuvent encoder sont remplacés par des signes de question. Fournissez un font chinois TTF/OTF dans PdfExportOptions.fontBytes",
|
|
392
|
+
"pdf.imageAlt": "Image en PDF",
|
|
393
|
+
"pdf.imageFailed": "Échec à résoudre une image Markdown. Le texte alternatif a été exporté à la place.",
|
|
394
|
+
"pdf.imageParseFailed": "Échec de la parsing d’une image PDF intégrée. L’import du texte a continué.",
|
|
395
|
+
"pdf.imagePixelLimit": "Une image dans le PDF dépasse la limite de {maxImagePixels} pixels",
|
|
396
|
+
"pdf.imageSkipped": "Impossible d’extraire l’image PDF intégrée. Elle a été ignorée.",
|
|
397
|
+
"pdf.imageUnresolved": "Aucun callback resolveResource n’a été fourni pour une image Markdown. Le texte alternatif a été exporté à la place.",
|
|
398
|
+
"pdf.inlineImageFailed": "Échec à résoudre une image Markdown intégrée. Le texte alternatif a été exporté à la place.",
|
|
399
|
+
"pdf.inlineImageUnresolved": "Aucun callback resolveResource n’a été fourni pour une image Markdown intégrée. Un texte alternatif a été exporté à la place.",
|
|
400
|
+
"pdf.inlineImageUnsupported": "Le format d’image Markdown intégré n’est pas supporté. Un texte alternatif a été exporté à la place.",
|
|
401
|
+
"pdf.invalid": "Le fichier PDF est endommagé ou utilise un format non supporté.",
|
|
402
|
+
"pdf.mathDegraded": "Les mathématiques ont été réduites au texte simple lisible",
|
|
403
|
+
"pdf.multiColumn": "Un affichage multi-colonne possible a été détecté. L’ordre des textes est reconstruit approximativement à partir des coordonnées du PDF.",
|
|
404
|
+
"pdf.noText": "Le PDF ne contient aucun texte extravable. Les PDF scannés ne sont pas convertis en texte OCR à ce stade.",
|
|
405
|
+
"pdf.noTextPage": "Cette page ne contient aucun texte exploitable. Les PDF scannés ne sont pas OCR’és à ce stade.",
|
|
406
|
+
"pdf.pageGeometry": "Les dimensions et les marges de la page PDF doivent être des nombres positifs.",
|
|
407
|
+
"pdf.pageLimit": "Le PDF dépasse la limite de {maxPages} pages",
|
|
408
|
+
"pdf.passwordRequired": "Ce PDF nécessite une mot de passe. Les PDF protégés par mot de passe ne sont pas supportés à ce stade.",
|
|
409
|
+
"pdf.pngFailed": "Impossible de convertir une image PDF en PNG",
|
|
410
|
+
"pdf.readFailed": "Impossible de lire le fichier PDF",
|
|
411
|
+
"pdf.timeout": "La conversion en PDF a dépassé la limite de {timeoutMs} ms",
|
|
412
|
+
"pdf.unsafeLink": "Évité un lien PDF dangereux ou non vérifiable",
|
|
413
|
+
"pdf.unsafeLinkText": "Dégradé un lien dangereux en texte simple",
|
|
414
|
+
"presence.anonymous": "Anonyme",
|
|
415
|
+
"presence.cursor": "Le curseur de {name}",
|
|
416
|
+
"presence.online.one": "{count} personne en ligne",
|
|
417
|
+
"presence.online.other": "{count} personnes en ligne",
|
|
418
|
+
"preview.label": "Prévisualisation",
|
|
419
|
+
"preview.live": "Réalisation en direct",
|
|
420
|
+
"preview.pane": "Prévisualisation du document",
|
|
421
|
+
"preview.syncScroll": "Synchronisation de scroll",
|
|
422
|
+
"preview.updating": "Mise à jour de l’aperçu…",
|
|
423
|
+
"selection.toolbar": "Actions de sélection",
|
|
424
|
+
"status.error": "Erreur de collaboration",
|
|
425
|
+
"status.loading": "Chargement du document",
|
|
426
|
+
"status.offline": "En ligne",
|
|
427
|
+
"status.offlineEditing": "Édition hors ligne",
|
|
428
|
+
"status.ready": "Prêt à la collaboration",
|
|
429
|
+
"status.syncing": "Synchronisation du document",
|
|
430
|
+
"toolbar.codeLanguage": "Langue de code",
|
|
431
|
+
"toolbar.insertCode": "Insérer le bloc de code",
|
|
432
|
+
"toolbar.insertDiagram": "Insérer le diagramme",
|
|
433
|
+
"toolbar.insertFormula": "Insérer la formule mathématique",
|
|
434
|
+
"toolbar.label": "Barre d'outils de formatage Markdown",
|
|
435
|
+
"toolbar.redo": "Rétablir",
|
|
436
|
+
"toolbar.textColor": "Couleur du texte",
|
|
437
|
+
"toolbar.undo": "Annuler",
|
|
438
|
+
"toolbar.uploadImage": "Télécharger l'image",
|
|
439
|
+
"toolbar.viewEdit": "Modification uniquement",
|
|
440
|
+
"toolbar.viewPreview": "Seulement aperçu",
|
|
441
|
+
"toolbar.viewSplit": "Vue divisée",
|
|
442
|
+
"upload.failed": "Téléchargement échoué ({status})",
|
|
443
|
+
"upload.missingUrl": "L’endpoint d’upload n’a pas renvoyé une URL d’image.",
|
|
444
|
+
"upload.readFailed": "Impossible de lire l’image",
|
|
445
|
+
"validation.loneSurrogate": "Le Markdown contient un surrogé UTF-16 isolé et ne peut pas être exporté en UTF-8 sans perte de données",
|
|
446
|
+
"validation.markdownString": "Le markdown doit être une chaîne de caractères",
|
|
447
|
+
"validation.nonNegativeInteger": "{name} doit être un entier non négatif et sûr",
|
|
448
|
+
"validation.positiveInteger": "{name} doit être un entier positif et sûr"
|
|
449
|
+
}, xa = {
|
|
450
|
+
"collaboration.initializationFailed": "로컬 협업 데이터를 로드할 수 없음",
|
|
451
|
+
"collaboration.schemaMismatch": "이 문서 형식은 지원되지 않습니다.",
|
|
452
|
+
"diagram.syntaxError": "다이어그램 구문이 유효하지 않습니다. Mermaid 코드를 확인하세요.",
|
|
453
|
+
"document.title": "협력적 문서",
|
|
454
|
+
"editor.characters.one": "{count} 자리",
|
|
455
|
+
"editor.characters.other": "{count} 자리",
|
|
456
|
+
"editor.pane": "마크다운 편집기",
|
|
457
|
+
"editor.transportRequired": "roomId와 websocketUrl이 필수이며, 또는 호스트가 관리하는 협업 세션을 지정해야 합니다.",
|
|
458
|
+
"footer.dropImages": "이미지를 드래그하거나 붙여넣기",
|
|
459
|
+
"footer.formats": "CommonMark · GFM · Mermaid",
|
|
460
|
+
"footer.readOnly": "읽기 전용",
|
|
461
|
+
"format.bold": "굵게",
|
|
462
|
+
"format.boldPlaceholder": "굵은 텍스트",
|
|
463
|
+
"format.bulletList": "목록 형태로 작성된 목록",
|
|
464
|
+
"format.codePlaceholder": "코드",
|
|
465
|
+
"format.colorPlaceholder": "색상이 있는 텍스트",
|
|
466
|
+
"format.heading1": "헤딩 1",
|
|
467
|
+
"format.heading2": "제2항목",
|
|
468
|
+
"format.heading3": "제3항목",
|
|
469
|
+
"format.heading4": "헤딩 4",
|
|
470
|
+
"format.heading5": "제5항목",
|
|
471
|
+
"format.inlineCode": "인라인 코드",
|
|
472
|
+
"format.italic": "기울임꼴",
|
|
473
|
+
"format.italicPlaceholder": "이탤릭체 텍스트",
|
|
474
|
+
"format.link": "링크",
|
|
475
|
+
"format.linkPlaceholder": "링크 텍스트",
|
|
476
|
+
"format.orderedList": "번호가 지정된 목록",
|
|
477
|
+
"format.quote": "인용문",
|
|
478
|
+
"format.strike": "취소선",
|
|
479
|
+
"format.strikePlaceholder": "문장을 삭제함",
|
|
480
|
+
"format.task": "작업 목록",
|
|
481
|
+
"header.room": "룸 · {roomId}",
|
|
482
|
+
"image.close": "이미지 미리보기 닫기",
|
|
483
|
+
"image.counter": "{current} / {total}",
|
|
484
|
+
"image.diagram": "다이어그램",
|
|
485
|
+
"image.hint": "드래그하여 이동 · 스크롤하여 확대 · 화살표 키 또는 스와이프로 전환",
|
|
486
|
+
"image.image": "이미지",
|
|
487
|
+
"image.next": "다음 이미지",
|
|
488
|
+
"image.open": "미리보기 {name}",
|
|
489
|
+
"image.preview": "이미지 미리보기",
|
|
490
|
+
"image.previous": "이전 이미지",
|
|
491
|
+
"image.reset": "줌과 위치를 재설정하세요.",
|
|
492
|
+
"image.unavailable": "이 이미지는 사용할 수 없습니다.",
|
|
493
|
+
"image.zoomIn": "줌인",
|
|
494
|
+
"image.zoomOut": "축소",
|
|
495
|
+
"insert.codePlaceholder": "여기에 유형 코드를 입력하세요",
|
|
496
|
+
"insert.diagram": `
|
|
497
|
+
\`\`\`mermaid
|
|
498
|
+
flowchart TD
|
|
499
|
+
A["시작"] --> B{"승인되었나요?"}
|
|
500
|
+
B -->|예| C["완료"]
|
|
501
|
+
B -->|아니요| D["수정"]
|
|
502
|
+
\`\`\`
|
|
503
|
+
`,
|
|
504
|
+
"loading.document": "협업 문서 로딩 중…",
|
|
505
|
+
"markdown.binary": "이 파일에는 NUL 문자가 포함되어 있으며, 바이너리 형식이거나 지원되지 않는 UTF-16/UTF-32 형식일 수 있습니다.",
|
|
506
|
+
"markdown.bomRemoved": "파일 시작 부분의 UTF-8 BOM을 제거했습니다. 내용 중의 U+FEFF는 유지되었습니다.",
|
|
507
|
+
"markdown.fileTooLarge": "파일이 {maxBytes}-바이트 제한을 초과했습니다.",
|
|
508
|
+
"markdown.invalidUtf8": "파일이 유효한 UTF-8 형식이 아닙니다. 먼저 인코딩을 변환하세요. 손상된 문자는 교체되지 않았습니다.",
|
|
509
|
+
"markdown.mixedLineEndings": "파일에는 줄 끝 표기법이 혼합되어 있습니다. 그대로 유지되었으며 정규화되지 않았습니다.",
|
|
510
|
+
"markdown.readFailed": "Markdown 파일을 읽을 수 없음",
|
|
511
|
+
"markdown.resourcePreserved": "Markdown 소스만 교환됩니다. 이미지, 첨부 파일, 내부 링크 ID, 경로 및 주소는 그대로 유지됩니다. 리소스는 읽히지 않았으며 권한도 확인되지 않았습니다. 플랫폼 내부 리소스는 플랫폼 외부에서도 작동할 것이라는 보장은 없습니다.",
|
|
512
|
+
"markdown.unsupportedExtension": ".md 및 .markdown 파일만 지원됩니다.",
|
|
513
|
+
"notice.downloadFailed": "다운로드 실패",
|
|
514
|
+
"notice.imageRequired": "이미지 파일을 선택하세요.",
|
|
515
|
+
"notice.readOnly": "이 문서는 읽기 전용입니다.",
|
|
516
|
+
"notice.uploadFailed": "이미지 업로드 실패",
|
|
517
|
+
"notice.uploading": "이미지 처리 중…",
|
|
518
|
+
"pdf.aborted": "PDF 변환이 취소되었습니다.",
|
|
519
|
+
"pdf.canvasUnavailable": "이 환경에서는 캔버스가 사용할 수 없으므로 내장된 PDF 이미지를 추출할 수 없었습니다.",
|
|
520
|
+
"pdf.complexTableExport": "표는 고정된 너비로 그려집니다. 병합된 셀과 너무 넓은 열은 손실이 있을 수 있습니다.",
|
|
521
|
+
"pdf.complexTableImport": "PDF 표는 텍스트 좌표로부터 거의 재구성됩니다. 복잡한 병합 셀은 손실이 있을 수 있습니다.",
|
|
522
|
+
"pdf.errorDetail": "{message} ({detail})",
|
|
523
|
+
"pdf.fileTooLarge": "PDF는 {maxBytes}-바이트 제한을 초과했습니다.",
|
|
524
|
+
"pdf.fontFallback": "모든 문자를 커버하는 글꼴이 제공되지 않았습니다. 지원되지 않는 문자들은 물음표로 대체되었습니다. PdfExportOptions.fontBytes에 중국어 TTF/OTF 글꼴을 제공해 주세요.",
|
|
525
|
+
"pdf.fontFallbackCjk": "중국어 폰트가 제공되지 않았습니다. 표준 폰트로 인코딩할 수 없는 문자들은 물음표로 대체됩니다. PdfExportOptions.fontBytes에 중국어 TTF/OTF 폰트를 제공해 주세요.",
|
|
526
|
+
"pdf.imageAlt": "PDF 이미지",
|
|
527
|
+
"pdf.imageFailed": "Markdown 이미지를 해결할 수 없음. 대체 텍스트가 대신 내보내졌습니다.",
|
|
528
|
+
"pdf.imageParseFailed": "내장된 PDF 이미지를 파싱할 수 없음. 텍스트 가져오기는 계속됨",
|
|
529
|
+
"pdf.imagePixelLimit": "PDF에 있는 이미지는 {maxImagePixels}-픽셀 제한을 초과했습니다.",
|
|
530
|
+
"pdf.imageSkipped": "내장된 PDF 이미지를 추출할 수 없었습니다. 건너뛰었습니다.",
|
|
531
|
+
"pdf.imageUnresolved": "Markdown 이미지에 resolveResource 콜백이 제공되지 않았습니다. 대체 텍스트가 대신 내보내졌습니다.",
|
|
532
|
+
"pdf.inlineImageFailed": "인라인 Markdown 이미지를 해결할 수 없음. 대체 텍스트가 대신 내보내졌습니다.",
|
|
533
|
+
"pdf.inlineImageUnresolved": "인라인 Markdown 이미지에 resolveResource 콜백이 제공되지 않았습니다. 대체 텍스트가 대신 내보내졌습니다.",
|
|
534
|
+
"pdf.inlineImageUnsupported": "인라인 Markdown 이미지 형식은 지원되지 않습니다. 대체 텍스트가 대신 내보내졌습니다.",
|
|
535
|
+
"pdf.invalid": "PDF가 손상되었거나 지원되지 않는 형식을 사용하고 있습니다.",
|
|
536
|
+
"pdf.mathDegraded": "수학 내용이 읽기 쉬운 일반 텍스트로 변경됨",
|
|
537
|
+
"pdf.multiColumn": "다중 열 레이아웃이 가능함이 감지됨. 텍스트 순서는 PDF 좌표를 기반으로 대략적으로 재구성됨",
|
|
538
|
+
"pdf.noText": "PDF에는 추출 가능한 텍스트가 없습니다. 스캔된 PDF는 이 단계에서는 OCR 처리되지 않습니다.",
|
|
539
|
+
"pdf.noTextPage": "이 페이지에는 추출 가능한 텍스트가 없습니다. 스캔된 PDF는 이 단계에서는 OCR 처리되지 않습니다.",
|
|
540
|
+
"pdf.pageGeometry": "PDF 페이지 크기와 여백은 양의 숫자여야 합니다.",
|
|
541
|
+
"pdf.pageLimit": "PDF는 {maxPages}페이지 제한을 초과했습니다.",
|
|
542
|
+
"pdf.passwordRequired": "이 PDF는 비밀번호가 필요합니다. 비밀번호로 보호된 PDF는 이 단계에서는 지원되지 않습니다.",
|
|
543
|
+
"pdf.pngFailed": "PDF 이미지를 PNG로 변환할 수 없음",
|
|
544
|
+
"pdf.readFailed": "PDF 파일을 읽을 수 없음",
|
|
545
|
+
"pdf.timeout": "PDF 변환이 {timeoutMs} ms 제한을 초과했습니다",
|
|
546
|
+
"pdf.unsafeLink": "안전하지 않거나 검증할 수 없는 PDF 링크를 건너뛰었습니다.",
|
|
547
|
+
"pdf.unsafeLinkText": "안전하지 않은 링크를 일반 텍스트로 변환함",
|
|
548
|
+
"presence.anonymous": "익명",
|
|
549
|
+
"presence.cursor": "{name}'s 커서",
|
|
550
|
+
"presence.online.one": "{count}명이 온라인에 있습니다",
|
|
551
|
+
"presence.online.other": "{count}명이 온라인에 있습니다",
|
|
552
|
+
"preview.label": "미리보기",
|
|
553
|
+
"preview.live": "라이브 렌더링",
|
|
554
|
+
"preview.pane": "문서 미리보기",
|
|
555
|
+
"preview.syncScroll": "스크롤 동기화",
|
|
556
|
+
"preview.updating": "미리보기 업데이트 중…",
|
|
557
|
+
"selection.toolbar": "선택 동작",
|
|
558
|
+
"status.error": "협력 오류",
|
|
559
|
+
"status.loading": "문서 로딩 중",
|
|
560
|
+
"status.offline": "오프라인",
|
|
561
|
+
"status.offlineEditing": "오프라인 편집",
|
|
562
|
+
"status.ready": "협력 준비 완료",
|
|
563
|
+
"status.syncing": "문서 동기화",
|
|
564
|
+
"toolbar.codeLanguage": "코드 언어",
|
|
565
|
+
"toolbar.insertCode": "코드 블록 삽입",
|
|
566
|
+
"toolbar.insertDiagram": "도표 삽입",
|
|
567
|
+
"toolbar.insertFormula": "수학 공식 삽입",
|
|
568
|
+
"toolbar.label": "마크다운 포맷팅 툴바",
|
|
569
|
+
"toolbar.redo": "다시 실행",
|
|
570
|
+
"toolbar.textColor": "텍스트 색상",
|
|
571
|
+
"toolbar.undo": "실행 취소",
|
|
572
|
+
"toolbar.uploadImage": "이미지 업로드",
|
|
573
|
+
"toolbar.viewEdit": "수정만",
|
|
574
|
+
"toolbar.viewPreview": "미리보기 전용",
|
|
575
|
+
"toolbar.viewSplit": "분할 보기",
|
|
576
|
+
"upload.failed": "업로드 실패 ({status})",
|
|
577
|
+
"upload.missingUrl": "업로드 엔드포인트가 이미지 URL을 반환하지 않았습니다.",
|
|
578
|
+
"upload.readFailed": "이미지를 읽을 수 없음",
|
|
579
|
+
"validation.loneSurrogate": "Markdown에는 격리된 UTF-16 서브스위어가 포함되어 있어 데이터 손실 없이 UTF-8로 내보낼 수 없습니다.",
|
|
580
|
+
"validation.markdownString": "마크다운은 문자열이어야 합니다.",
|
|
581
|
+
"validation.nonNegativeInteger": "{name}는 음수가 아닌 안전한 정수여야 합니다",
|
|
582
|
+
"validation.positiveInteger": "{name}는 양수인 안전한 정수여야 합니다"
|
|
583
|
+
}, ka = {
|
|
584
|
+
"collaboration.initializationFailed": "No se pudo cargar los datos locales de colaboración",
|
|
585
|
+
"collaboration.schemaMismatch": "Este formato de documento no está soportado.",
|
|
586
|
+
"diagram.syntaxError": "La sintaxis del diagrama es inválida. Verifique el código Mermaid.",
|
|
587
|
+
"document.title": "Documento colaborativo",
|
|
588
|
+
"editor.characters.one": "{count} carácter",
|
|
589
|
+
"editor.characters.other": "{count} caracteres",
|
|
590
|
+
"editor.pane": "Editor de Markdown",
|
|
591
|
+
"editor.transportRequired": "Se requieren roomId y websocketUrl, o pasar una sesión de colaboración gestionada por el host",
|
|
592
|
+
"footer.dropImages": "Guarda o pega imágenes",
|
|
593
|
+
"footer.formats": "CommonMark · GFM · Mermaid",
|
|
594
|
+
"footer.readOnly": "Solo lectura",
|
|
595
|
+
"format.bold": "Negrita",
|
|
596
|
+
"format.boldPlaceholder": "texto en negrita",
|
|
597
|
+
"format.bulletList": "Lista en viñetas",
|
|
598
|
+
"format.codePlaceholder": "código",
|
|
599
|
+
"format.colorPlaceholder": "texto coloreado",
|
|
600
|
+
"format.heading1": "Título 1",
|
|
601
|
+
"format.heading2": "Sección 2",
|
|
602
|
+
"format.heading3": "Categoría 3",
|
|
603
|
+
"format.heading4": "Título 4",
|
|
604
|
+
"format.heading5": "Categoría 5",
|
|
605
|
+
"format.inlineCode": "Código en línea",
|
|
606
|
+
"format.italic": "Cursiva",
|
|
607
|
+
"format.italicPlaceholder": "texto itálico",
|
|
608
|
+
"format.link": "Enlace",
|
|
609
|
+
"format.linkPlaceholder": "Texto del enlace",
|
|
610
|
+
"format.orderedList": "Lista numerada",
|
|
611
|
+
"format.quote": "Cita",
|
|
612
|
+
"format.strike": "Tachado",
|
|
613
|
+
"format.strikePlaceholder": "texto eliminado",
|
|
614
|
+
"format.task": "Lista de tareas",
|
|
615
|
+
"header.room": "Habitación · {roomId}",
|
|
616
|
+
"image.close": "Cerrar vista previa de imagen",
|
|
617
|
+
"image.counter": "{current} / {total}",
|
|
618
|
+
"image.diagram": "Diagrama",
|
|
619
|
+
"image.hint": "Arrastrar para mover · Desplazar para ampliar · Teclas de flecha o deslizar para cambiar",
|
|
620
|
+
"image.image": "Imagen",
|
|
621
|
+
"image.next": "Imagen siguiente",
|
|
622
|
+
"image.open": "Vista previa {name}",
|
|
623
|
+
"image.preview": "Vista previa de imagen",
|
|
624
|
+
"image.previous": "Imagen anterior",
|
|
625
|
+
"image.reset": "Restablecer el zoom y la posición",
|
|
626
|
+
"image.unavailable": "Esta imagen no está disponible",
|
|
627
|
+
"image.zoomIn": "Aumentar el zoom",
|
|
628
|
+
"image.zoomOut": "Ajustar hacia abajo",
|
|
629
|
+
"insert.codePlaceholder": "Escriba el código aquí",
|
|
630
|
+
"insert.diagram": `
|
|
631
|
+
\`\`\`mermaid
|
|
632
|
+
flowchart TD
|
|
633
|
+
A["Inicio"] --> B{"¿Aprobado?"}
|
|
634
|
+
B -->|Sí| C["Terminado"]
|
|
635
|
+
B -->|No| D["Revisar"]
|
|
636
|
+
\`\`\`
|
|
637
|
+
`,
|
|
638
|
+
"loading.document": "Cargando documento colaborativo…",
|
|
639
|
+
"markdown.binary": "El archivo contiene un carácter NUL y puede ser binario o no soportar UTF-16/UTF-32",
|
|
640
|
+
"markdown.bomRemoved": "Se eliminó el UTF-8 BOM al inicio del archivo. El U+FEFF en el cuerpo se mantuvo.",
|
|
641
|
+
"markdown.fileTooLarge": "El archivo supera el límite de {maxBytes} bytes",
|
|
642
|
+
"markdown.invalidUtf8": "El archivo no es válido en UTF-8. Convierte primero el codificación. No se reemplazaron caracteres dañados.",
|
|
643
|
+
"markdown.mixedLineEndings": "El archivo mezcla diferentes estilos de final de línea. Se mantuvieron tal como estaban y no se normalizaron.",
|
|
644
|
+
"markdown.readFailed": "No se pudo leer el archivo Markdown",
|
|
645
|
+
"markdown.resourcePreserved": "Solo se intercambia la fuente en Markdown. Las identificaciones de imágenes, archivos adjuntos y enlaces internos, así como las rutas y direcciones, se mantienen tal como están. No se leyeron los recursos y no se verificó la autorización. No se garantiza que los recursos internos de la plataforma funcionen fuera de ella.",
|
|
646
|
+
"markdown.unsupportedExtension": "Solo se admiten archivos .md y .markdown.",
|
|
647
|
+
"notice.downloadFailed": "Descarga fallida",
|
|
648
|
+
"notice.imageRequired": "Elija un archivo de imagen",
|
|
649
|
+
"notice.readOnly": "Este documento es de solo lectura.",
|
|
650
|
+
"notice.uploadFailed": "Subida de imagen fallida",
|
|
651
|
+
"notice.uploading": "Procesamiento de imagen…",
|
|
652
|
+
"pdf.aborted": "La conversión a PDF fue cancelada",
|
|
653
|
+
"pdf.canvasUnavailable": "No hay Canvas disponible en este entorno, por lo que no se pudieron extraer las imágenes PDF incrustadas.",
|
|
654
|
+
"pdf.complexTableExport": "Las tablas tienen un ancho fijo. Las celdas fusionadas y las columnas demasiado anchas pueden causar pérdidas.",
|
|
655
|
+
"pdf.complexTableImport": "Las tablas en formato PDF se reconstruyen aproximadamente a partir de las coordenadas del texto. Las celdas combinadas complejas pueden ser perdiosas.",
|
|
656
|
+
"pdf.errorDetail": "{message} ({detail})",
|
|
657
|
+
"pdf.fileTooLarge": "El PDF supera el límite de {maxBytes} bytes",
|
|
658
|
+
"pdf.fontFallback": "No se proporcionó una fuente que cubra todos los caracteres. Los caracteres no soportados fueron reemplazados por signos de interrogación. Proporcione una fuente china en formato TTF/OTF en PdfExportOptions.fontBytes",
|
|
659
|
+
"pdf.fontFallbackCjk": "No se proporcionó una fuente china. Los caracteres que las fuentes estándar no pueden codificar se reemplazan por signos de interrogación. Proporcione una fuente china en formato TTF/OTF en PdfExportOptions.fontBytes",
|
|
660
|
+
"pdf.imageAlt": "Imagen en PDF",
|
|
661
|
+
"pdf.imageFailed": "No se pudo resolver una imagen Markdown. Se exportó el texto alternativo en su lugar.",
|
|
662
|
+
"pdf.imageParseFailed": "No se pudo analizar una imagen PDF incrustada. La importación de texto continuó.",
|
|
663
|
+
"pdf.imagePixelLimit": "Una imagen en el PDF supera el límite de {maxImagePixels} píxeles",
|
|
664
|
+
"pdf.imageSkipped": "No se pudo extraer una imagen PDF incrustada. Fue omitida.",
|
|
665
|
+
"pdf.imageUnresolved": "No se proporcionó el callback resolveResource para una imagen Markdown. En su lugar, se exportó el texto alternativo.",
|
|
666
|
+
"pdf.inlineImageFailed": "No se pudo resolver una imagen Markdown integrada. Se exportó el texto alternativo en su lugar.",
|
|
667
|
+
"pdf.inlineImageUnresolved": "No se proporcionó el callback resolveResource para una imagen Markdown integrada. En su lugar, se exportó el texto alternativo.",
|
|
668
|
+
"pdf.inlineImageUnsupported": "El formato de imagen Markdown en línea no es soportado. En su lugar, se exportó el texto alternativo.",
|
|
669
|
+
"pdf.invalid": "El PDF está dañado o utiliza un formato no soportado.",
|
|
670
|
+
"pdf.mathDegraded": "Las matemáticas fueron degradadas a texto plano legible",
|
|
671
|
+
"pdf.multiColumn": "Se detectó un posible diseño de múltiples columnas. El orden del texto se reconstruye aproximadamente a partir de las coordenadas del PDF.",
|
|
672
|
+
"pdf.noText": "El PDF no contiene texto extraíble. Los PDF escaneados no se procesan con OCR en esta fase.",
|
|
673
|
+
"pdf.noTextPage": "Esta página no tiene texto extraíble. Los PDF escaneados no se han procesado con OCR en esta fase.",
|
|
674
|
+
"pdf.pageGeometry": "El tamaño de página y los márgenes en PDF deben ser números positivos.",
|
|
675
|
+
"pdf.pageLimit": "El PDF supera el límite de {maxPages} páginas",
|
|
676
|
+
"pdf.passwordRequired": "Este PDF requiere una contraseña. Los PDF protegidos con contraseña no son soportados en esta fase.",
|
|
677
|
+
"pdf.pngFailed": "No se pudo convertir una imagen PDF a PNG",
|
|
678
|
+
"pdf.readFailed": "No se pudo leer el archivo PDF",
|
|
679
|
+
"pdf.timeout": "La conversión de PDF superó el límite de {timeoutMs} ms",
|
|
680
|
+
"pdf.unsafeLink": "Se saltó un enlace de PDF inseguro o no verificable",
|
|
681
|
+
"pdf.unsafeLinkText": "Disminuido el nivel de seguridad de un enlace inseguro a texto plano",
|
|
682
|
+
"presence.anonymous": "Anónimo",
|
|
683
|
+
"presence.cursor": "El cursor de {name}",
|
|
684
|
+
"presence.online.one": "{count} personas en línea",
|
|
685
|
+
"presence.online.other": "{count} personas en línea",
|
|
686
|
+
"preview.label": "Vista previa",
|
|
687
|
+
"preview.live": "Render en vivo",
|
|
688
|
+
"preview.pane": "Vista previa del documento",
|
|
689
|
+
"preview.syncScroll": "Sincronización de desplazamiento",
|
|
690
|
+
"preview.updating": "Actualizando vista previa…",
|
|
691
|
+
"selection.toolbar": "Acciones de selección",
|
|
692
|
+
"status.error": "Error de colaboración",
|
|
693
|
+
"status.loading": "Cargando documento",
|
|
694
|
+
"status.offline": "Sin conexión",
|
|
695
|
+
"status.offlineEditing": "Edición sin conexión",
|
|
696
|
+
"status.ready": "Listo para colaboración",
|
|
697
|
+
"status.syncing": "Sincronizar documento",
|
|
698
|
+
"toolbar.codeLanguage": "Idioma del código",
|
|
699
|
+
"toolbar.insertCode": "Insertar bloque de código",
|
|
700
|
+
"toolbar.insertDiagram": "Inserir diagrama",
|
|
701
|
+
"toolbar.insertFormula": "Inserir fórmula matemática",
|
|
702
|
+
"toolbar.label": "Barra de herramientas de formato Markdown",
|
|
703
|
+
"toolbar.redo": "Rehacer",
|
|
704
|
+
"toolbar.textColor": "Color del texto",
|
|
705
|
+
"toolbar.undo": "Deshacer",
|
|
706
|
+
"toolbar.uploadImage": "Subir imagen",
|
|
707
|
+
"toolbar.viewEdit": "Edición solamente",
|
|
708
|
+
"toolbar.viewPreview": "Solo vista previa",
|
|
709
|
+
"toolbar.viewSplit": "Vista dividida",
|
|
710
|
+
"upload.failed": "Subida fallida ({status})",
|
|
711
|
+
"upload.missingUrl": "El punto de enlace de subida no devolvió una URL de imagen.",
|
|
712
|
+
"upload.readFailed": "No se pudo leer la imagen",
|
|
713
|
+
"validation.loneSurrogate": "El Markdown contiene un sustituto de UTF-16 aislado y no puede exportarse a UTF-8 sin pérdida de datos",
|
|
714
|
+
"validation.markdownString": "Markdown debe ser una cadena de texto.",
|
|
715
|
+
"validation.nonNegativeInteger": "{name} debe ser un entero seguro no negativo",
|
|
716
|
+
"validation.positiveInteger": "{name} debe ser un entero positivo y seguro"
|
|
717
|
+
}, Fa = {
|
|
718
|
+
"collaboration.initializationFailed": "Не удалось загрузить локальные данные о сотрудничестве",
|
|
719
|
+
"collaboration.schemaMismatch": "Этот формат документа не поддерживается",
|
|
720
|
+
"diagram.syntaxError": "Синтаксис диаграммы некорректен. Проверьте код Mermaid.",
|
|
721
|
+
"document.title": "Совместный документ",
|
|
722
|
+
"editor.characters.one": "{count} символов",
|
|
723
|
+
"editor.characters.other": "{count} символов",
|
|
724
|
+
"editor.pane": "Редактор Markdown",
|
|
725
|
+
"editor.transportRequired": "Необходимы roomId и websocketUrl, или указать сессию сотрудничества, управляемую хостом",
|
|
726
|
+
"footer.dropImages": "Скопируйте или вставьте изображения",
|
|
727
|
+
"footer.formats": "CommonMark · GFM · Mermaid",
|
|
728
|
+
"footer.readOnly": "Только для чтения",
|
|
729
|
+
"format.bold": "Полужирный",
|
|
730
|
+
"format.boldPlaceholder": "жирный текст",
|
|
731
|
+
"format.bulletList": "Список в буллетах",
|
|
732
|
+
"format.codePlaceholder": "код",
|
|
733
|
+
"format.colorPlaceholder": "цветной текст",
|
|
734
|
+
"format.heading1": "Заголовок 1",
|
|
735
|
+
"format.heading2": "Раздел 2",
|
|
736
|
+
"format.heading3": "Раздел 3",
|
|
737
|
+
"format.heading4": "Раздел 4",
|
|
738
|
+
"format.heading5": "Раздел 5",
|
|
739
|
+
"format.inlineCode": "Встроенный код",
|
|
740
|
+
"format.italic": "Курсив",
|
|
741
|
+
"format.italicPlaceholder": "курсивный текст",
|
|
742
|
+
"format.link": "Ссылка",
|
|
743
|
+
"format.linkPlaceholder": "Текст ссылки",
|
|
744
|
+
"format.orderedList": "Нумерованный список",
|
|
745
|
+
"format.quote": "Цитата",
|
|
746
|
+
"format.strike": "Зачёркнутый",
|
|
747
|
+
"format.strikePlaceholder": "вырезано текст",
|
|
748
|
+
"format.task": "Список задач",
|
|
749
|
+
"header.room": "Комната · {roomId}",
|
|
750
|
+
"image.close": "Закрыть предпросмотр изображения",
|
|
751
|
+
"image.counter": "{current} / {total}",
|
|
752
|
+
"image.diagram": "Диаграмма",
|
|
753
|
+
"image.hint": "Перетаскивайте, чтобы перемещать · Прокручивайте, чтобы увеличить · Клавиши стрелок или наведение, чтобы переключаться",
|
|
754
|
+
"image.image": "Изображение",
|
|
755
|
+
"image.next": "Следующее изображение",
|
|
756
|
+
"image.open": "Предварительный просмотр {name}",
|
|
757
|
+
"image.preview": "Предпросмотр изображения",
|
|
758
|
+
"image.previous": "Предыдущая картинка",
|
|
759
|
+
"image.reset": "Сбросить масштаб и положение",
|
|
760
|
+
"image.unavailable": "Это изображение недоступно",
|
|
761
|
+
"image.zoomIn": "Увеличить",
|
|
762
|
+
"image.zoomOut": "Уменьшить масштаб",
|
|
763
|
+
"insert.codePlaceholder": "Введите код типа здесь",
|
|
764
|
+
"insert.diagram": `
|
|
765
|
+
\`\`\`mermaid
|
|
766
|
+
flowchart TD
|
|
767
|
+
A["Начало"] --> B{"Одобрено?"}
|
|
768
|
+
B -->|Да| C["Готово"]
|
|
769
|
+
B -->|Нет| D["Доработать"]
|
|
770
|
+
\`\`\`
|
|
771
|
+
`,
|
|
772
|
+
"loading.document": "Загрузка совместного документа…",
|
|
773
|
+
"markdown.binary": "Файл содержит символ NUL и может быть бинарным или не поддерживаемым форматом UTF-16/UTF-32",
|
|
774
|
+
"markdown.bomRemoved": "Удален UTF-8 BOM в начале файла. Символ U+FEFF внутри файла был сохранен.",
|
|
775
|
+
"markdown.fileTooLarge": "Файл превышает лимит в {maxBytes} байт",
|
|
776
|
+
"markdown.invalidUtf8": "Файл не является корректным в формате UTF-8. Сначала необходимо изменить кодировку. Ни одного поврежденного символа не заменено.",
|
|
777
|
+
"markdown.mixedLineEndings": "Файл содержит разные стили завершения строк. Они остались такими, как были, и не были нормализованы.",
|
|
778
|
+
"markdown.readFailed": "Не удалось прочитать файл Markdown",
|
|
779
|
+
"markdown.resourcePreserved": "Обменивается только исходный Markdown-код. Изображения, приложения, идентификаторы внутренних ссылок, пути и адреса сохраняются без изменений. Ресурсы не читались, а авторизация не проверялась. Внутренние ресурсы платформы не гарантируются работоспособностью вне платформы.",
|
|
780
|
+
"markdown.unsupportedExtension": "Поддерживаются только файлы .md и .markdown.",
|
|
781
|
+
"notice.downloadFailed": "Скачивание не удалось",
|
|
782
|
+
"notice.imageRequired": "Выберите файл изображения",
|
|
783
|
+
"notice.readOnly": "Этот документ предназначен только для чтения.",
|
|
784
|
+
"notice.uploadFailed": "Попытка загрузки изображения не удалась.",
|
|
785
|
+
"notice.uploading": "Обработка изображения…",
|
|
786
|
+
"pdf.aborted": "Преобразование в PDF отменено.",
|
|
787
|
+
"pdf.canvasUnavailable": "В этом окружении нет холста, поэтому встроенные изображения в формате PDF не могли быть извлечены.",
|
|
788
|
+
"pdf.complexTableExport": "Таблицы имеют фиксированную ширину. Сливаемые ячейки и слишком широкие столбцы могут привести к потере данных.",
|
|
789
|
+
"pdf.complexTableImport": "Таблицы в формате PDF реконструируются приблизительно на основе координат текста. Сложные объединенные ячейки могут иметь потерю данных.",
|
|
790
|
+
"pdf.errorDetail": "{message} ({detail})",
|
|
791
|
+
"pdf.fileTooLarge": "PDF превышает лимит в {maxBytes} байт",
|
|
792
|
+
"pdf.fontFallback": "Не предоставлен шрифт, который покрывает все символы. Неподдерживаемые символы заменены на вопросительные знаки. Необходимо предоставить китайский шрифт TTF/OTF в файле PdfExportOptions.fontBytes",
|
|
793
|
+
"pdf.fontFallbackCjk": "Не предоставлен китайский шрифт. Символы, которые не могут быть представлены с помощью стандартных шрифтов, заменены на знаки вопроса. Необходимо предоставить китайский TTF/OTF шрифт в файле PdfExportOptions.fontBytes",
|
|
794
|
+
"pdf.imageAlt": "PDF-изображение",
|
|
795
|
+
"pdf.imageFailed": "Не удалось разрешить изображение в формате Markdown. Вместо этого был экспортирован альтернативный текст.",
|
|
796
|
+
"pdf.imageParseFailed": "Не удалось обработать встроенное изображение в PDF. Интеграция текста продолжается.",
|
|
797
|
+
"pdf.imagePixelLimit": "Изображение в PDF превышает лимит в {maxImagePixels} пикселей",
|
|
798
|
+
"pdf.imageSkipped": "Не удалось извлечь встроенное изображение в формате PDF. Оно было пропущено.",
|
|
799
|
+
"pdf.imageUnresolved": "Не было предоставлено обратное вызове resolveResource для изображения в формате Markdown. Вместо этого был экспортирован альтернативный текст.",
|
|
800
|
+
"pdf.inlineImageFailed": "Не удалось распознать изображение в Markdown. Вместо этого был экспортирован альтернативный текст.",
|
|
801
|
+
"pdf.inlineImageUnresolved": "Не было предоставлено callback-объекта resolveResource для вставки изображения в формате Markdown. Вместо этого был экспортирован альтернативный текст.",
|
|
802
|
+
"pdf.inlineImageUnsupported": "Формат изображений Markdown внутри текста не поддерживается. Вместо этого был экспортирован альтернативный текст.",
|
|
803
|
+
"pdf.invalid": "PDF поврежден или использует неподдерживаемый формат",
|
|
804
|
+
"pdf.mathDegraded": "Математика была понижена до читаемого простого текста",
|
|
805
|
+
"pdf.multiColumn": "Обнаружен возможный многоколоночный дизайн. Порядок текста восстановлен приблизительно на основе координат из PDF-файла.",
|
|
806
|
+
"pdf.noText": "В PDF нет выделяемого текста. Scanned PDF-файлы не обрабатываются с помощью OCR на этом этапе.",
|
|
807
|
+
"pdf.noTextPage": "На этой странице нет текста, который можно извлечь. PDF-файлы, сканированные с помощью сканера, не обрабатываются с помощью OCR на этом этапе.",
|
|
808
|
+
"pdf.pageGeometry": "Размер страницы и отступы PDF должны быть положительными числами.",
|
|
809
|
+
"pdf.pageLimit": "PDF превышает лимит в {maxPages} страниц",
|
|
810
|
+
"pdf.passwordRequired": "Этот PDF требует пароля. PDF с защитой паролем не поддерживается на данном этапе.",
|
|
811
|
+
"pdf.pngFailed": "Не удалось конвертировать изображение из PDF в PNG.",
|
|
812
|
+
"pdf.readFailed": "Не удалось прочитать PDF-файл.",
|
|
813
|
+
"pdf.timeout": "Преобразование PDF превысило лимит {timeoutMs} мс",
|
|
814
|
+
"pdf.unsafeLink": "Пропустил небезопасный или непроверенный ссылку на PDF",
|
|
815
|
+
"pdf.unsafeLinkText": "Переключили небезопасный ссылку на простой текст",
|
|
816
|
+
"presence.anonymous": "Анонимно",
|
|
817
|
+
"presence.cursor": "Курсор {name}",
|
|
818
|
+
"presence.online.one": "{count} человек в сети",
|
|
819
|
+
"presence.online.other": "{count} человек в сети",
|
|
820
|
+
"preview.label": "Предварительный просмотр",
|
|
821
|
+
"preview.live": "Прямое отображение",
|
|
822
|
+
"preview.pane": "Предпросмотр документа",
|
|
823
|
+
"preview.syncScroll": "Синхронизация скролла",
|
|
824
|
+
"preview.updating": "Обновление предварительного просмотра…",
|
|
825
|
+
"selection.toolbar": "Действия по отбору",
|
|
826
|
+
"status.error": "Ошибка в сотрудничестве",
|
|
827
|
+
"status.loading": "Загрузка документа",
|
|
828
|
+
"status.offline": "Оффлайн",
|
|
829
|
+
"status.offlineEditing": "Оффлайн редактирование",
|
|
830
|
+
"status.ready": "Готова к сотрудничеству",
|
|
831
|
+
"status.syncing": "Синхронизация документа",
|
|
832
|
+
"toolbar.codeLanguage": "Язык кода",
|
|
833
|
+
"toolbar.insertCode": "Вставьте блок кода",
|
|
834
|
+
"toolbar.insertDiagram": "Вставьте диаграмму",
|
|
835
|
+
"toolbar.insertFormula": "Вставьте математическую формулу",
|
|
836
|
+
"toolbar.label": "Инструменты форматирования Markdown",
|
|
837
|
+
"toolbar.redo": "Повторить",
|
|
838
|
+
"toolbar.textColor": "Цвет текста",
|
|
839
|
+
"toolbar.undo": "Отменить",
|
|
840
|
+
"toolbar.uploadImage": "Загрузить изображение",
|
|
841
|
+
"toolbar.viewEdit": "Только редактирование",
|
|
842
|
+
"toolbar.viewPreview": "Только предварительный просмотр",
|
|
843
|
+
"toolbar.viewSplit": "Раздельное отображение",
|
|
844
|
+
"upload.failed": "Загрузка не удалась ({status})",
|
|
845
|
+
"upload.missingUrl": "Эндпоинт загрузки не вернул URL изображения.",
|
|
846
|
+
"upload.readFailed": "Не удалось прочитать изображение",
|
|
847
|
+
"validation.loneSurrogate": "В Markdown содержится изолированный UTF-16 суррогат, и его нельзя экспортировать в UTF-8 без потери данных",
|
|
848
|
+
"validation.markdownString": "Markdown должен быть строкой.",
|
|
849
|
+
"validation.nonNegativeInteger": "{name} должно быть неотрицательным безопасным целым числом",
|
|
850
|
+
"validation.positiveInteger": "{name} должно быть положительным безопасным целым числом"
|
|
851
|
+
}, Lt = { "zh-Hant": va, ja: ba, fr: wa, ko: xa, es: ka, ru: Fa };
|
|
852
|
+
function Ct(t) {
|
|
853
|
+
return t == null || t === "" ? "zh" : Object.hasOwn(He, t) ? t : "en";
|
|
854
|
+
}
|
|
855
|
+
function ya(t) {
|
|
856
|
+
const e = Ct(t);
|
|
857
|
+
return e === "zh" ? "zh-CN" : e;
|
|
858
|
+
}
|
|
859
|
+
const Ye = {
|
|
860
|
+
"toolbar.label": "Markdown formatting toolbar",
|
|
861
|
+
"toolbar.undo": "Undo",
|
|
862
|
+
"toolbar.redo": "Redo",
|
|
863
|
+
"toolbar.insertCode": "Insert code block",
|
|
864
|
+
"toolbar.codeLanguage": "Code language",
|
|
865
|
+
"toolbar.textColor": "Text color",
|
|
866
|
+
"toolbar.uploadImage": "Upload image",
|
|
867
|
+
"toolbar.insertDiagram": "Insert diagram",
|
|
868
|
+
"toolbar.insertFormula": "Insert math formula",
|
|
869
|
+
"toolbar.viewEdit": "Edit only",
|
|
870
|
+
"toolbar.viewSplit": "Split view",
|
|
871
|
+
"toolbar.viewPreview": "Preview only",
|
|
872
|
+
"format.heading1": "Heading 1",
|
|
873
|
+
"format.heading2": "Heading 2",
|
|
874
|
+
"format.heading3": "Heading 3",
|
|
875
|
+
"format.heading4": "Heading 4",
|
|
876
|
+
"format.heading5": "Heading 5",
|
|
877
|
+
"format.bold": "Bold",
|
|
878
|
+
"format.italic": "Italic",
|
|
879
|
+
"format.strike": "Strikethrough",
|
|
880
|
+
"format.inlineCode": "Inline code",
|
|
881
|
+
"format.quote": "Quote",
|
|
882
|
+
"format.bulletList": "Bulleted list",
|
|
883
|
+
"format.orderedList": "Numbered list",
|
|
884
|
+
"format.task": "Task list",
|
|
885
|
+
"format.link": "Link",
|
|
886
|
+
"format.boldPlaceholder": "bold text",
|
|
887
|
+
"format.italicPlaceholder": "italic text",
|
|
888
|
+
"format.strikePlaceholder": "strikethrough text",
|
|
889
|
+
"format.codePlaceholder": "code",
|
|
890
|
+
"format.linkPlaceholder": "link text",
|
|
891
|
+
"format.colorPlaceholder": "colored text",
|
|
892
|
+
"insert.diagram": `
|
|
893
|
+
\`\`\`mermaid
|
|
894
|
+
flowchart TD
|
|
895
|
+
A[Start] --> B{Decision}
|
|
896
|
+
B -->|Yes| C[Done]
|
|
897
|
+
B -->|No| D[Revise]
|
|
898
|
+
\`\`\`
|
|
899
|
+
`,
|
|
900
|
+
"insert.codePlaceholder": "Type code here",
|
|
901
|
+
"diagram.syntaxError": "The diagram syntax is invalid. Check the Mermaid code.",
|
|
902
|
+
"image.open": "Preview {name}",
|
|
903
|
+
"image.image": "Image",
|
|
904
|
+
"image.diagram": "Diagram",
|
|
905
|
+
"image.preview": "Image preview",
|
|
906
|
+
"image.counter": "{current} / {total}",
|
|
907
|
+
"image.zoomOut": "Zoom out",
|
|
908
|
+
"image.zoomIn": "Zoom in",
|
|
909
|
+
"image.reset": "Reset zoom and position",
|
|
910
|
+
"image.close": "Close image preview",
|
|
911
|
+
"image.previous": "Previous image",
|
|
912
|
+
"image.next": "Next image",
|
|
913
|
+
"image.unavailable": "This image is unavailable",
|
|
914
|
+
"image.hint": "Drag to move · Scroll to zoom · Arrow keys or swipe to switch",
|
|
915
|
+
"selection.toolbar": "Selection actions",
|
|
916
|
+
"notice.imageRequired": "Choose an image file",
|
|
917
|
+
"notice.readOnly": "This document is read-only",
|
|
918
|
+
"notice.uploadFailed": "Image upload failed",
|
|
919
|
+
"notice.downloadFailed": "Download failed",
|
|
920
|
+
"notice.uploading": "Processing image…",
|
|
921
|
+
"editor.pane": "Markdown editor",
|
|
922
|
+
"editor.characters.one": "{count} character",
|
|
923
|
+
"editor.characters.other": "{count} characters",
|
|
924
|
+
"editor.transportRequired": "roomId and websocketUrl are required, or pass a host-managed collaboration session",
|
|
925
|
+
"preview.pane": "Document preview",
|
|
926
|
+
"preview.label": "Preview",
|
|
927
|
+
"preview.updating": "Updating preview…",
|
|
928
|
+
"preview.syncScroll": "Scroll sync",
|
|
929
|
+
"preview.live": "Live render",
|
|
930
|
+
"document.title": "Collaborative document",
|
|
931
|
+
"status.ready": "Collaboration ready",
|
|
932
|
+
"status.error": "Collaboration error",
|
|
933
|
+
"status.offline": "Offline",
|
|
934
|
+
"status.offlineEditing": "Offline editing",
|
|
935
|
+
"status.syncing": "Syncing document",
|
|
936
|
+
"status.loading": "Loading document",
|
|
937
|
+
"header.room": "Room · {roomId}",
|
|
938
|
+
"presence.online.one": "{count} person online",
|
|
939
|
+
"presence.online.other": "{count} people online",
|
|
940
|
+
"presence.cursor": "{name}'s cursor",
|
|
941
|
+
"presence.anonymous": "Anonymous",
|
|
942
|
+
"loading.document": "Loading collaborative document…",
|
|
943
|
+
"footer.formats": "CommonMark · GFM · Mermaid",
|
|
944
|
+
"footer.readOnly": "Read-only",
|
|
945
|
+
"footer.dropImages": "Drop or paste images",
|
|
946
|
+
"collaboration.schemaMismatch": "This document format is not supported",
|
|
947
|
+
"collaboration.initializationFailed": "Failed to load local collaboration data",
|
|
948
|
+
"pdf.aborted": "PDF conversion was cancelled",
|
|
949
|
+
"pdf.fileTooLarge": "PDF exceeds the {maxBytes}-byte limit",
|
|
950
|
+
"pdf.readFailed": "Could not read the PDF file",
|
|
951
|
+
"pdf.passwordRequired": "This PDF requires a password. Password-protected PDFs are not supported in this phase",
|
|
952
|
+
"pdf.errorDetail": "{message} ({detail})",
|
|
953
|
+
"pdf.timeout": "PDF conversion exceeded the {timeoutMs} ms limit",
|
|
954
|
+
"pdf.pageLimit": "PDF exceeds the {maxPages}-page limit",
|
|
955
|
+
"pdf.unsafeLink": "Skipped an unsafe or unverifiable PDF link",
|
|
956
|
+
"pdf.multiColumn": "Possible multi-column layout detected. Text order is reconstructed approximately from PDF coordinates",
|
|
957
|
+
"pdf.imagePixelLimit": "An image in the PDF exceeds the {maxImagePixels}-pixel limit",
|
|
958
|
+
"pdf.pngFailed": "Could not convert a PDF image to PNG",
|
|
959
|
+
"pdf.imageSkipped": "Could not extract an embedded PDF image. It was skipped",
|
|
960
|
+
"pdf.canvasUnavailable": "No Canvas is available in this environment, so embedded PDF images could not be extracted",
|
|
961
|
+
"pdf.imageParseFailed": "Failed to parse an embedded PDF image. Text import continued",
|
|
962
|
+
"pdf.noTextPage": "This page has no extractable text. Scanned PDFs are not OCR'd in this phase",
|
|
963
|
+
"pdf.imageAlt": "PDF image",
|
|
964
|
+
"pdf.complexTableImport": "PDF tables are reconstructed approximately from text coordinates. Complex merged cells may be lossy",
|
|
965
|
+
"pdf.noText": "The PDF has no extractable text. Scanned PDFs are not OCR'd in this phase",
|
|
966
|
+
"pdf.invalid": "The PDF is damaged or uses an unsupported format",
|
|
967
|
+
"pdf.unsafeLinkText": "Downgraded an unsafe link to plain text",
|
|
968
|
+
"pdf.mathDegraded": "Math was downgraded to readable plain text",
|
|
969
|
+
"pdf.complexTableExport": "Tables are drawn at a fixed width. Merged cells and overly wide columns may be lossy",
|
|
970
|
+
"pdf.fontFallback": "No font covering every character was provided. Unsupported characters were replaced with question marks. Provide a Chinese TTF/OTF font in PdfExportOptions.fontBytes",
|
|
971
|
+
"pdf.fontFallbackCjk": "No Chinese font was provided. Characters the standard fonts cannot encode are replaced with question marks. Provide a Chinese TTF/OTF font in PdfExportOptions.fontBytes",
|
|
972
|
+
"pdf.imageUnresolved": "No resolveResource callback was provided for a Markdown image. Alternate text was exported instead",
|
|
973
|
+
"pdf.imageFailed": "Failed to resolve a Markdown image. Alternate text was exported instead",
|
|
974
|
+
"pdf.inlineImageUnresolved": "No resolveResource callback was provided for an inline Markdown image. Alternate text was exported instead",
|
|
975
|
+
"pdf.inlineImageUnsupported": "The inline Markdown image format is unsupported. Alternate text was exported instead",
|
|
976
|
+
"pdf.inlineImageFailed": "Failed to resolve an inline Markdown image. Alternate text was exported instead",
|
|
977
|
+
"pdf.pageGeometry": "PDF page size and margins must be positive numbers",
|
|
978
|
+
"validation.positiveInteger": "{name} must be a positive safe integer",
|
|
979
|
+
"validation.nonNegativeInteger": "{name} must be a non-negative safe integer",
|
|
980
|
+
"validation.markdownString": "markdown must be a string",
|
|
981
|
+
"validation.loneSurrogate": "Markdown contains an isolated UTF-16 surrogate and cannot be exported to UTF-8 without data loss",
|
|
982
|
+
"markdown.resourcePreserved": "Only the Markdown source is exchanged. Image, attachment, and internal-link IDs, paths, and addresses are kept as-is. Resources were not read and authorization was not checked. Platform-internal resources are not guaranteed to work outside the platform.",
|
|
983
|
+
"markdown.unsupportedExtension": "Only .md and .markdown files are supported",
|
|
984
|
+
"markdown.fileTooLarge": "File exceeds the {maxBytes}-byte limit",
|
|
985
|
+
"markdown.readFailed": "Could not read the Markdown file",
|
|
986
|
+
"markdown.invalidUtf8": "The file is not valid UTF-8. Convert the encoding first. No damaged characters were replaced",
|
|
987
|
+
"markdown.binary": "The file contains a NUL character and may be binary or unsupported UTF-16/UTF-32",
|
|
988
|
+
"markdown.bomRemoved": "Removed the UTF-8 BOM at the start of the file. U+FEFF in the body was kept",
|
|
989
|
+
"markdown.mixedLineEndings": "The file mixes line-ending styles. They were kept as-is and not normalized",
|
|
990
|
+
"upload.failed": "Upload failed ({status})",
|
|
991
|
+
"upload.missingUrl": "The upload endpoint did not return an image URL",
|
|
992
|
+
"upload.readFailed": "Could not read the image"
|
|
993
|
+
}, It = {
|
|
994
|
+
"toolbar.label": "Markdown 格式工具栏",
|
|
995
|
+
"toolbar.undo": "撤销",
|
|
996
|
+
"toolbar.redo": "重做",
|
|
997
|
+
"toolbar.insertCode": "插入代码块",
|
|
998
|
+
"toolbar.codeLanguage": "代码语言",
|
|
999
|
+
"toolbar.textColor": "文字颜色",
|
|
1000
|
+
"toolbar.uploadImage": "上传图片",
|
|
1001
|
+
"toolbar.insertDiagram": "插入流程图",
|
|
1002
|
+
"toolbar.insertFormula": "插入数学公式",
|
|
1003
|
+
"toolbar.viewEdit": "仅编辑",
|
|
1004
|
+
"toolbar.viewSplit": "分栏",
|
|
1005
|
+
"toolbar.viewPreview": "仅预览",
|
|
1006
|
+
"format.heading1": "一级标题",
|
|
1007
|
+
"format.heading2": "二级标题",
|
|
1008
|
+
"format.heading3": "三级标题",
|
|
1009
|
+
"format.heading4": "四级标题",
|
|
1010
|
+
"format.heading5": "五级标题",
|
|
1011
|
+
"format.bold": "加粗",
|
|
1012
|
+
"format.italic": "斜体",
|
|
1013
|
+
"format.strike": "删除线",
|
|
1014
|
+
"format.inlineCode": "行内代码",
|
|
1015
|
+
"format.quote": "引用",
|
|
1016
|
+
"format.bulletList": "无序列表",
|
|
1017
|
+
"format.orderedList": "有序列表",
|
|
1018
|
+
"format.task": "待办事项",
|
|
1019
|
+
"format.link": "链接",
|
|
1020
|
+
"format.boldPlaceholder": "加粗文字",
|
|
1021
|
+
"format.italicPlaceholder": "斜体文字",
|
|
1022
|
+
"format.strikePlaceholder": "删除文字",
|
|
1023
|
+
"format.codePlaceholder": "代码",
|
|
1024
|
+
"format.linkPlaceholder": "链接文字",
|
|
1025
|
+
"format.colorPlaceholder": "彩色文字",
|
|
1026
|
+
"insert.diagram": `
|
|
1027
|
+
\`\`\`mermaid
|
|
1028
|
+
flowchart TD
|
|
1029
|
+
A[开始] --> B{判断}
|
|
1030
|
+
B -->|是| C[完成]
|
|
1031
|
+
B -->|否| D[调整]
|
|
1032
|
+
\`\`\`
|
|
1033
|
+
`,
|
|
1034
|
+
"insert.codePlaceholder": "在这里输入代码",
|
|
1035
|
+
"diagram.syntaxError": "流程图语法有误,请检查 Mermaid 代码。",
|
|
1036
|
+
"image.open": "预览{name}",
|
|
1037
|
+
"image.image": "图片",
|
|
1038
|
+
"image.diagram": "流程图",
|
|
1039
|
+
"image.preview": "图片预览",
|
|
1040
|
+
"image.counter": "{current} / {total}",
|
|
1041
|
+
"image.zoomOut": "缩小",
|
|
1042
|
+
"image.zoomIn": "放大",
|
|
1043
|
+
"image.reset": "重置缩放和位置",
|
|
1044
|
+
"image.close": "关闭图片预览",
|
|
1045
|
+
"image.previous": "上一张图片",
|
|
1046
|
+
"image.next": "下一张图片",
|
|
1047
|
+
"image.unavailable": "此图片暂时无法显示",
|
|
1048
|
+
"image.hint": "拖动平移 · 滚轮缩放 · 方向键或滑动切换",
|
|
1049
|
+
"selection.toolbar": "选中文字操作",
|
|
1050
|
+
"notice.imageRequired": "请选择图片文件",
|
|
1051
|
+
"notice.readOnly": "当前文档为只读模式",
|
|
1052
|
+
"notice.uploadFailed": "图片上传失败",
|
|
1053
|
+
"notice.downloadFailed": "下载失败",
|
|
1054
|
+
"notice.uploading": "正在处理图片…",
|
|
1055
|
+
"editor.pane": "Markdown 编辑器",
|
|
1056
|
+
"editor.characters.one": "{count} 字符",
|
|
1057
|
+
"editor.characters.other": "{count} 字符",
|
|
1058
|
+
"editor.transportRequired": "roomId 和 websocketUrl 必填,或传入宿主管理的 collaboration 会话",
|
|
1059
|
+
"preview.pane": "文档预览",
|
|
1060
|
+
"preview.label": "预览",
|
|
1061
|
+
"preview.updating": "预览更新中…",
|
|
1062
|
+
"preview.syncScroll": "同步滚动",
|
|
1063
|
+
"preview.live": "实时渲染",
|
|
1064
|
+
"document.title": "协作文档",
|
|
1065
|
+
"status.ready": "协同就绪",
|
|
1066
|
+
"status.error": "协同错误",
|
|
1067
|
+
"status.offline": "离线",
|
|
1068
|
+
"status.offlineEditing": "离线编辑",
|
|
1069
|
+
"status.syncing": "同步文档中",
|
|
1070
|
+
"status.loading": "加载文档中",
|
|
1071
|
+
"header.room": "房间 · {roomId}",
|
|
1072
|
+
"presence.online.one": "{count} 人在线",
|
|
1073
|
+
"presence.online.other": "{count} 人在线",
|
|
1074
|
+
"presence.cursor": "{name} 的光标",
|
|
1075
|
+
"presence.anonymous": "匿名",
|
|
1076
|
+
"loading.document": "正在获取协作文档…",
|
|
1077
|
+
"footer.formats": "支持 CommonMark · GFM · Mermaid",
|
|
1078
|
+
"footer.readOnly": "只读模式",
|
|
1079
|
+
"footer.dropImages": "图片可直接拖入或粘贴",
|
|
1080
|
+
"collaboration.schemaMismatch": "文档格式不受支持",
|
|
1081
|
+
"collaboration.initializationFailed": "本地协同数据加载失败",
|
|
1082
|
+
"pdf.aborted": "PDF 转换已取消",
|
|
1083
|
+
"pdf.fileTooLarge": "PDF 文件超过 {maxBytes} 字节限制",
|
|
1084
|
+
"pdf.readFailed": "无法读取 PDF 文件",
|
|
1085
|
+
"pdf.passwordRequired": "PDF 需要密码,第一阶段不支持密码 PDF",
|
|
1086
|
+
"pdf.errorDetail": "{message}({detail})",
|
|
1087
|
+
"pdf.timeout": "PDF 转换超过 {timeoutMs} 毫秒限制",
|
|
1088
|
+
"pdf.pageLimit": "PDF 页数超过 {maxPages} 页限制",
|
|
1089
|
+
"pdf.unsafeLink": "已跳过不安全或无法验证的 PDF 链接",
|
|
1090
|
+
"pdf.multiColumn": "检测到可能的多栏布局,文本顺序按 PDF 坐标近似重建",
|
|
1091
|
+
"pdf.imagePixelLimit": "PDF 内图片超过 {maxImagePixels} 像素限制",
|
|
1092
|
+
"pdf.pngFailed": "无法将 PDF 图片转换为 PNG",
|
|
1093
|
+
"pdf.imageSkipped": "PDF 内嵌图片无法提取,已跳过",
|
|
1094
|
+
"pdf.canvasUnavailable": "当前运行环境没有可用的 Canvas,无法提取 PDF 内嵌图片",
|
|
1095
|
+
"pdf.imageParseFailed": "PDF 内嵌图片解析失败,已继续导入文本",
|
|
1096
|
+
"pdf.noTextPage": "此页没有可提取文本;扫描 PDF 第一阶段不执行 OCR",
|
|
1097
|
+
"pdf.imageAlt": "PDF 图片",
|
|
1098
|
+
"pdf.complexTableImport": "PDF 表格按坐标文本近似还原,复杂合并单元格可能有损",
|
|
1099
|
+
"pdf.noText": "PDF 没有可提取文本;扫描 PDF 第一阶段不执行 OCR",
|
|
1100
|
+
"pdf.invalid": "PDF 文件损坏或格式不受支持",
|
|
1101
|
+
"pdf.unsafeLinkText": "已将不安全链接降级为纯文本",
|
|
1102
|
+
"pdf.mathDegraded": "数学公式已按可读纯文本降级",
|
|
1103
|
+
"pdf.complexTableExport": "表格按固定宽度绘制;合并单元格和超宽列可能有损",
|
|
1104
|
+
"pdf.fontFallback": "未提供可覆盖全部字符的字体;不兼容字符已替换为问号。建议在 PdfExportOptions.fontBytes 中提供中文 TTF/OTF 字体",
|
|
1105
|
+
"pdf.fontFallbackCjk": "未提供中文字体;导出会将标准字体无法编码的字符降级为问号。请在 PdfExportOptions.fontBytes 中提供中文 TTF/OTF 字体",
|
|
1106
|
+
"pdf.imageUnresolved": "Markdown 图片未提供 resolveResource,已用替代文本导出",
|
|
1107
|
+
"pdf.imageFailed": "Markdown 图片资源解析失败,已用替代文本导出",
|
|
1108
|
+
"pdf.inlineImageUnresolved": "Markdown 行内图片未提供 resolveResource,已用替代文本导出",
|
|
1109
|
+
"pdf.inlineImageUnsupported": "Markdown 行内图片格式不受支持,已用替代文本导出",
|
|
1110
|
+
"pdf.inlineImageFailed": "Markdown 行内图片资源解析失败,已用替代文本导出",
|
|
1111
|
+
"pdf.pageGeometry": "PDF 页面尺寸和页边距必须为正数",
|
|
1112
|
+
"validation.positiveInteger": "{name} 必须为正安全整数",
|
|
1113
|
+
"validation.nonNegativeInteger": "{name} 必须为非负安全整数",
|
|
1114
|
+
"validation.markdownString": "markdown 必须为字符串",
|
|
1115
|
+
"validation.loneSurrogate": "Markdown 包含孤立 UTF-16 代理字符,无法无损导出为 UTF-8",
|
|
1116
|
+
"markdown.resourcePreserved": "仅交换 Markdown 原文;图片、附件和内部链接的 ID/path/地址原样保留,未读取资源或验证授权,平台内部资源离开平台不保证可访问。",
|
|
1117
|
+
"markdown.unsupportedExtension": "只支持 .md 和 .markdown 文件",
|
|
1118
|
+
"markdown.fileTooLarge": "文件超过 {maxBytes} 字节限制",
|
|
1119
|
+
"markdown.readFailed": "无法读取 Markdown 文件",
|
|
1120
|
+
"markdown.invalidUtf8": "文件不是有效 UTF-8;请先转换编码,未替换任何损坏字符",
|
|
1121
|
+
"markdown.binary": "文件包含 NUL 字符,可能是二进制或不受支持的 UTF-16/UTF-32 编码",
|
|
1122
|
+
"markdown.bomRemoved": "已移除文件开头的 UTF-8 BOM;正文内的 U+FEFF 保留",
|
|
1123
|
+
"markdown.mixedLineEndings": "文件混用了换行格式;原样保留,未统一换行",
|
|
1124
|
+
"upload.failed": "上传失败({status})",
|
|
1125
|
+
"upload.missingUrl": "上传接口未返回图片地址",
|
|
1126
|
+
"upload.readFailed": "读取图片失败"
|
|
1127
|
+
};
|
|
1128
|
+
function St(t, e) {
|
|
1129
|
+
const o = Object.keys(t).filter((r) => !Object.prototype.hasOwnProperty.call(e, r)), a = Object.keys(e).filter((r) => !Object.prototype.hasOwnProperty.call(t, r));
|
|
1130
|
+
if (o.length || a.length)
|
|
1131
|
+
throw new Error(`Message catalog mismatch. Missing zh: ${o.join(", ")}. Extra zh: ${a.join(", ")}`);
|
|
1132
|
+
}
|
|
1133
|
+
St(Ye, It);
|
|
1134
|
+
const He = { en: Ye, zh: It, ...Lt };
|
|
1135
|
+
for (const t of Object.values(Lt)) St(Ye, t);
|
|
1136
|
+
function I(t, e, o, a) {
|
|
1137
|
+
const r = Ct(t), s = o && typeof o.count == "number" ? o.count : void 0, c = s === void 0 ? [e] : [`${e}.${s === 1 ? "one" : "other"}`, e], m = [a, He[r], He.en];
|
|
1138
|
+
let n;
|
|
1139
|
+
for (const i of m)
|
|
1140
|
+
if (i) {
|
|
1141
|
+
for (const f of c)
|
|
1142
|
+
if (Object.prototype.hasOwnProperty.call(i, f)) {
|
|
1143
|
+
n = i[f];
|
|
1144
|
+
break;
|
|
1145
|
+
}
|
|
1146
|
+
if (n !== void 0) break;
|
|
1147
|
+
}
|
|
1148
|
+
return n === void 0 && (n = c[0]), o ? n.replace(/\{([A-Za-z0-9_]+)\}/g, (i, f) => {
|
|
1149
|
+
const l = o[f];
|
|
1150
|
+
return l == null ? i : String(l);
|
|
1151
|
+
}) : n;
|
|
1152
|
+
}
|
|
1153
|
+
function rn(t, e) {
|
|
1154
|
+
return (o, a) => I(t, o, a, e);
|
|
1155
|
+
}
|
|
1156
|
+
function Pa(t, e, o) {
|
|
1157
|
+
return t.code === "INITIALIZATION_FAILED" ? I(e, "collaboration.initializationFailed", void 0, o) : t.code === "SCHEMA_MISMATCH" && !(t.cause instanceof Error) ? I(e, "collaboration.schemaMismatch", void 0, o) : t.message;
|
|
1158
|
+
}
|
|
1159
|
+
let wt = !1;
|
|
1160
|
+
const Ma = We(function({ code: e, locale: o, messages: a }) {
|
|
1161
|
+
const r = no().replace(/:/g, ""), [s, c] = j(null), m = s?.code === e ? s.svg : "", n = s?.code === e && s.failed;
|
|
1162
|
+
return V(() => {
|
|
1163
|
+
let i = !0;
|
|
1164
|
+
const f = `mermaid-${r}-${Date.now()}`;
|
|
1165
|
+
return import("mermaid").then(({ default: l }) => (wt || (l.initialize({ startOnLoad: !1, theme: "neutral", securityLevel: "strict", fontFamily: "Inter, system-ui, sans-serif" }), wt = !0), l.render(f, e))).then(({ svg: l }) => {
|
|
1166
|
+
i && c({ code: e, svg: l, failed: !1 });
|
|
1167
|
+
}).catch(() => {
|
|
1168
|
+
i && c({ code: e, svg: "", failed: !0 });
|
|
1169
|
+
}), () => {
|
|
1170
|
+
i = !1;
|
|
1171
|
+
};
|
|
1172
|
+
}, [e, r]), n ? /* @__PURE__ */ d("div", { className: "diagram-error", children: I(o, "diagram.syntaxError", void 0, a) }) : /* @__PURE__ */ d("div", { className: "mermaid-diagram", dangerouslySetInnerHTML: { __html: m } });
|
|
1173
|
+
}), Da = { bash: Vo, c: Ho, cpp: jo, csharp: Ko, css: $o, dockerfile: Go, go: Wo, graphql: Xo, java: Yo, javascript: Zo, json: Jo, kotlin: Qo, markdown: ea, php: ta, python: oa, ruby: aa, rust: ra, sql: na, swift: ia, typescript: sa, xml: la, yaml: da };
|
|
1174
|
+
Object.entries(Da).forEach(([t, e]) => {
|
|
1175
|
+
J.getLanguage(t) || J.registerLanguage(t, e);
|
|
1176
|
+
});
|
|
1177
|
+
J.registerAliases(["js", "jsx"], { languageName: "javascript" });
|
|
1178
|
+
J.registerAliases(["ts", "tsx"], { languageName: "typescript" });
|
|
1179
|
+
J.registerAliases(["sh", "shell"], { languageName: "bash" });
|
|
1180
|
+
J.registerAliases(["html", "svg", "vue"], { languageName: "xml" });
|
|
1181
|
+
J.registerAliases(["yml"], { languageName: "yaml" });
|
|
1182
|
+
J.registerAliases(["cs", "dotnet"], { languageName: "csharp" });
|
|
1183
|
+
J.registerAliases(["md"], { languageName: "markdown" });
|
|
1184
|
+
function Ze(t, e, o) {
|
|
1185
|
+
if (!e) return;
|
|
1186
|
+
const a = t.at(-1);
|
|
1187
|
+
a && a.scope === o ? a.text += e : t.push({ text: e, scope: o });
|
|
1188
|
+
}
|
|
1189
|
+
function Rt(t, e, o) {
|
|
1190
|
+
if (typeof t == "string") {
|
|
1191
|
+
Ze(e, t, o);
|
|
1192
|
+
return;
|
|
1193
|
+
}
|
|
1194
|
+
const a = t.scope || o;
|
|
1195
|
+
for (const r of t.children || []) Rt(r, e, a);
|
|
1196
|
+
}
|
|
1197
|
+
function Ta(t) {
|
|
1198
|
+
const e = [[]];
|
|
1199
|
+
for (const o of t) {
|
|
1200
|
+
const a = o.text.split(`
|
|
1201
|
+
`);
|
|
1202
|
+
for (let r = 0; r < a.length; r++)
|
|
1203
|
+
Ze(e.at(-1), a[r], o.scope), r < a.length - 1 && e.push([]);
|
|
1204
|
+
}
|
|
1205
|
+
return e;
|
|
1206
|
+
}
|
|
1207
|
+
function Ea(t) {
|
|
1208
|
+
const e = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
1209
|
+
return t.replace(/[&<>"']/g, (o) => e[o]);
|
|
1210
|
+
}
|
|
1211
|
+
function La(t, e) {
|
|
1212
|
+
const o = (e || "").toLowerCase(), a = J.getLanguage(o) ? o : "plaintext";
|
|
1213
|
+
if (a === "plaintext") return { language: a, html: Ea(t), lines: t.split(`
|
|
1214
|
+
`).map((m) => m ? [{ text: m }] : []) };
|
|
1215
|
+
const r = J.highlight(t, { language: a }), s = r._emitter.rootNode, c = [];
|
|
1216
|
+
return s ? Rt(s, c) : Ze(c, t), { language: a, html: r.value, lines: Ta(c) };
|
|
1217
|
+
}
|
|
1218
|
+
function Ca({ code: t, language: e }) {
|
|
1219
|
+
const o = t.replace(/\n$/, ""), a = La(o, e);
|
|
1220
|
+
return /* @__PURE__ */ d("pre", { className: "highlighted-code", children: /* @__PURE__ */ d("code", { className: `hljs language-${a.language}`, dangerouslySetInnerHTML: { __html: a.html } }) });
|
|
1221
|
+
}
|
|
1222
|
+
function Ia(t) {
|
|
1223
|
+
const e = [];
|
|
1224
|
+
let o = 0;
|
|
1225
|
+
for (const [i, f] of ca(ma({ extensions: [fa()] }).document().write(ua()(t, "utf8", !0)))) {
|
|
1226
|
+
if (f.type === "codeText" && (o += i === "enter" ? 1 : -1), i !== "enter") continue;
|
|
1227
|
+
const l = f.start.offset, w = f.end.offset, g = t.slice(l, w);
|
|
1228
|
+
if (["data", "codeTextData", "autolinkProtocol", "autolinkEmail"].includes(f.type))
|
|
1229
|
+
for (let h = 0; h < g.length; h++) e.push({ from: l + h, to: l + h + 1, value: g[h] === "\0" ? "�" : g[h] });
|
|
1230
|
+
else if (f.type === "characterEscape" || f.type === "characterReference")
|
|
1231
|
+
for (const h of pa(g).split("")) e.push({ from: l, to: w, value: h });
|
|
1232
|
+
else if (f.type === "lineEnding")
|
|
1233
|
+
if (o) e.push({ from: l, to: w, value: " " });
|
|
1234
|
+
else for (let h = 0; h < g.length; h++) e.push({ from: l + h, to: l + h + 1, value: g[h] });
|
|
1235
|
+
}
|
|
1236
|
+
e.sort((i, f) => i.from - f.from);
|
|
1237
|
+
const a = { source: t, runs: /* @__PURE__ */ new Map() }, r = /* @__PURE__ */ new Map(), s = (i) => `${i.position?.start?.offset}:${i.position?.end?.offset}`, c = (i) => {
|
|
1238
|
+
let f = 0, l = e.length;
|
|
1239
|
+
for (; f < l; ) {
|
|
1240
|
+
const w = f + l >>> 1;
|
|
1241
|
+
e[w].from < i ? f = w + 1 : l = w;
|
|
1242
|
+
}
|
|
1243
|
+
return f;
|
|
1244
|
+
};
|
|
1245
|
+
return { mapping: a, beforeRaw: () => (i) => {
|
|
1246
|
+
a.runs.clear(), r.clear();
|
|
1247
|
+
const f = (l, w = !1) => {
|
|
1248
|
+
w ||= l.tagName === "pre" || l.tagName === "code" && !!l.properties?.className, !(!l.children || w) && (l.children = l.children.map((g) => {
|
|
1249
|
+
if (g.type !== "text")
|
|
1250
|
+
return f(g, w), g;
|
|
1251
|
+
const h = g.position?.start?.offset, F = g.position?.end?.offset;
|
|
1252
|
+
if (h === void 0 || F === void 0 || !g.value) return g;
|
|
1253
|
+
const D = [];
|
|
1254
|
+
for (let v = c(h); v < e.length && e[v].to <= F; v++) D.push(e[v]);
|
|
1255
|
+
if (D.map((v) => v.value).join("") !== g.value) return g;
|
|
1256
|
+
const x = String(a.runs.size);
|
|
1257
|
+
return a.runs.set(x, { value: g.value, characters: D.map(({ from: v, to: y }) => ({ from: v, to: y })) }), r.set(s(g), x), { type: "element", tagName: "span", properties: {}, position: g.position, children: [g] };
|
|
1258
|
+
}));
|
|
1259
|
+
};
|
|
1260
|
+
f(i);
|
|
1261
|
+
}, afterSanitize: () => (i) => {
|
|
1262
|
+
const f = (l) => {
|
|
1263
|
+
l.type === "element" && l.position?.start?.line && (l.properties = {
|
|
1264
|
+
...l.properties,
|
|
1265
|
+
dataExmdSourceLine: l.position.start.line,
|
|
1266
|
+
dataExmdSourceEndLine: l.position.end?.line ?? l.position.start.line
|
|
1267
|
+
});
|
|
1268
|
+
const w = l.tagName === "span" ? r.get(s(l)) : void 0;
|
|
1269
|
+
w !== void 0 && l.children?.length === 1 && l.children[0].type === "text" && l.children[0].value === a.runs.get(w)?.value && (l.properties = { ...l.properties, dataExmdText: w }), l.children?.forEach(f);
|
|
1270
|
+
};
|
|
1271
|
+
f(i);
|
|
1272
|
+
} };
|
|
1273
|
+
}
|
|
1274
|
+
function At(t, e) {
|
|
1275
|
+
const o = [], a = t.ownerDocument.createTreeWalker(
|
|
1276
|
+
t,
|
|
1277
|
+
4
|
|
1278
|
+
/* SHOW_TEXT */
|
|
1279
|
+
);
|
|
1280
|
+
for (let r = a.nextNode(); r; r = a.nextNode()) {
|
|
1281
|
+
const s = r.parentElement?.closest("[data-exmd-text]"), c = s && e.runs.get(s.dataset.exmdText);
|
|
1282
|
+
c && r.nodeValue === c.value && t.contains(s) && o.push({ node: r, run: c });
|
|
1283
|
+
}
|
|
1284
|
+
return o;
|
|
1285
|
+
}
|
|
1286
|
+
function xt(t, e) {
|
|
1287
|
+
const o = t.ownerDocument.getSelection();
|
|
1288
|
+
if (!o || o.isCollapsed || o.rangeCount !== 1) return null;
|
|
1289
|
+
const a = o.getRangeAt(0);
|
|
1290
|
+
if (!t.contains(a.startContainer) || !t.contains(a.endContainer)) return null;
|
|
1291
|
+
const r = new Map(At(t, e).map((n) => [n.node, n.run]));
|
|
1292
|
+
let s, c;
|
|
1293
|
+
const m = t.ownerDocument.createTreeWalker(t, 4);
|
|
1294
|
+
for (let n = m.nextNode(); n; n = m.nextNode()) {
|
|
1295
|
+
if (!a.intersectsNode(n)) continue;
|
|
1296
|
+
const i = n === a.startContainer ? a.startOffset : 0, f = n === a.endContainer ? a.endOffset : n.nodeValue.length;
|
|
1297
|
+
if (i >= f) continue;
|
|
1298
|
+
const l = r.get(n);
|
|
1299
|
+
if (!l) {
|
|
1300
|
+
if (n.nodeValue.slice(i, f).trim()) return null;
|
|
1301
|
+
continue;
|
|
1302
|
+
}
|
|
1303
|
+
if (!l.characters[i] || !l.characters[f - 1]) return null;
|
|
1304
|
+
s ??= l.characters[i].from, c = l.characters[f - 1].to;
|
|
1305
|
+
}
|
|
1306
|
+
for (const n of t.querySelectorAll("img,svg,.katex,pre")) if (a.intersectsNode(n)) return null;
|
|
1307
|
+
return s !== void 0 && c !== void 0 && s < c ? { from: s, to: c, range: a.cloneRange() } : null;
|
|
1308
|
+
}
|
|
1309
|
+
function Sa(t, e, o, a) {
|
|
1310
|
+
const r = [];
|
|
1311
|
+
for (const { node: s, run: c } of At(t, e)) {
|
|
1312
|
+
let m = -1, n = -1;
|
|
1313
|
+
if (c.characters.forEach((f, l) => {
|
|
1314
|
+
f.to > o && f.from < a && (m < 0 && (m = l), n = l + 1);
|
|
1315
|
+
}), m < 0) continue;
|
|
1316
|
+
const i = t.ownerDocument.createRange();
|
|
1317
|
+
i.setStart(s, m), i.setEnd(s, n), r.push(i);
|
|
1318
|
+
}
|
|
1319
|
+
return r;
|
|
1320
|
+
}
|
|
1321
|
+
function kt(t) {
|
|
1322
|
+
const e = /* @__PURE__ */ new Map(), o = [], a = [];
|
|
1323
|
+
for (const r of t.querySelectorAll("[data-exmd-preview-kind]")) {
|
|
1324
|
+
const s = r.dataset.exmdPreviewKind;
|
|
1325
|
+
if (s !== "image" && s !== "mermaid") continue;
|
|
1326
|
+
const c = r.dataset.exmdPreviewKey || "", m = `${s}:${c.length}:${c}`, n = e.get(m) || 0;
|
|
1327
|
+
e.set(m, n + 1);
|
|
1328
|
+
const i = {
|
|
1329
|
+
id: `${m}:${n}`,
|
|
1330
|
+
kind: s,
|
|
1331
|
+
alt: r.getAttribute("alt") || r.dataset.exmdPreviewAlt || ""
|
|
1332
|
+
}, f = r.getAttribute("title");
|
|
1333
|
+
f && (i.title = f);
|
|
1334
|
+
const l = r.dataset.exmdPreviewFrom, w = r.dataset.exmdPreviewTo;
|
|
1335
|
+
if (l !== void 0 && w !== void 0 && (i.source = { from: Number(l), to: Number(w) }), s === "image") {
|
|
1336
|
+
const g = r;
|
|
1337
|
+
i.path = c, i.src = g.getAttribute("src") || void 0, g.naturalWidth && (i.width = g.naturalWidth), g.naturalHeight && (i.height = g.naturalHeight);
|
|
1338
|
+
} else {
|
|
1339
|
+
const g = r.querySelector("svg");
|
|
1340
|
+
if (!g) continue;
|
|
1341
|
+
const h = t.ownerDocument.defaultView?.XMLSerializer;
|
|
1342
|
+
if (!h) continue;
|
|
1343
|
+
i.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(new h().serializeToString(g))}`, g.viewBox.baseVal.width && (i.width = g.viewBox.baseVal.width), g.viewBox.baseVal.height && (i.height = g.viewBox.baseVal.height);
|
|
1344
|
+
}
|
|
1345
|
+
o.push(r), a.push(i);
|
|
1346
|
+
}
|
|
1347
|
+
return { elements: o, images: a };
|
|
1348
|
+
}
|
|
1349
|
+
const ye = () => ({ scale: 1, x: 0, y: 0 });
|
|
1350
|
+
function Ra({ images: t, index: e, onClose: o, locale: a, messages: r }) {
|
|
1351
|
+
const [s, c] = j(e), [m, n] = j(ye), [i, f] = j(!1), [l, w] = j(!1), g = C(null), h = C(null), F = C(null), D = C(m), x = C({ onClose: o, active: s, images: t });
|
|
1352
|
+
D.current = m, x.current = { onClose: o, active: s, images: t };
|
|
1353
|
+
const v = t[s], y = (P, E) => I(a, P, E, r), B = (P) => {
|
|
1354
|
+
c((E) => Math.max(0, Math.min(t.length - 1, E + P)));
|
|
1355
|
+
}, R = (P) => n((E) => ({ ...E, scale: Math.max(0.2, Math.min(8, E.scale * P)) }));
|
|
1356
|
+
V(() => {
|
|
1357
|
+
c(e);
|
|
1358
|
+
}, [e]), V(() => {
|
|
1359
|
+
F.current = null, f(!1), n(ye()), w(!1);
|
|
1360
|
+
}, [s, v?.src]), V(() => {
|
|
1361
|
+
const P = document.activeElement instanceof HTMLElement ? document.activeElement : null, E = document.body.style.overflow;
|
|
1362
|
+
document.body.style.overflow = "hidden", g.current?.focus();
|
|
1363
|
+
const b = (p) => {
|
|
1364
|
+
if (p.key === "Escape")
|
|
1365
|
+
p.preventDefault(), p.stopPropagation(), x.current.onClose();
|
|
1366
|
+
else if (p.key === "ArrowLeft" || p.key === "ArrowRight") {
|
|
1367
|
+
p.preventDefault(), p.stopPropagation();
|
|
1368
|
+
const M = p.key === "ArrowLeft" ? -1 : 1;
|
|
1369
|
+
c((K) => Math.max(0, Math.min(x.current.images.length - 1, K + M)));
|
|
1370
|
+
} else if (p.key === "Tab") {
|
|
1371
|
+
const M = Array.from(g.current?.querySelectorAll("button:not(:disabled)") || []), K = M[0], H = M.at(-1);
|
|
1372
|
+
if (!K || !H) {
|
|
1373
|
+
p.preventDefault();
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1376
|
+
const z = document.activeElement;
|
|
1377
|
+
p.shiftKey && (z === K || z === g.current) ? (p.preventDefault(), H.focus()) : !p.shiftKey && (z === H || z === g.current) && (p.preventDefault(), K.focus());
|
|
1378
|
+
}
|
|
1379
|
+
}, T = (p) => {
|
|
1380
|
+
p.target instanceof Node && !g.current?.contains(p.target) && g.current?.focus();
|
|
1381
|
+
};
|
|
1382
|
+
return document.addEventListener("keydown", b, !0), document.addEventListener("focusin", T), () => {
|
|
1383
|
+
document.removeEventListener("keydown", b, !0), document.removeEventListener("focusin", T), document.body.style.overflow = E, P?.isConnected && P.focus({ preventScroll: !0 });
|
|
1384
|
+
};
|
|
1385
|
+
}, []), V(() => {
|
|
1386
|
+
const P = h.current;
|
|
1387
|
+
if (!P) return;
|
|
1388
|
+
const E = (b) => {
|
|
1389
|
+
b.preventDefault(), n((T) => ({ ...T, scale: Math.max(0.2, Math.min(8, T.scale * Math.exp(-b.deltaY * 2e-3))) }));
|
|
1390
|
+
};
|
|
1391
|
+
return P.addEventListener("wheel", E, { passive: !1 }), () => P.removeEventListener("wheel", E);
|
|
1392
|
+
}, []);
|
|
1393
|
+
const O = (P) => {
|
|
1394
|
+
if (F.current) {
|
|
1395
|
+
F.current.singlePointer = !1;
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
P.button === 0 && (P.preventDefault(), F.current = {
|
|
1399
|
+
pointerId: P.pointerId,
|
|
1400
|
+
type: P.pointerType,
|
|
1401
|
+
startX: P.clientX,
|
|
1402
|
+
startY: P.clientY,
|
|
1403
|
+
view: D.current,
|
|
1404
|
+
moved: !1,
|
|
1405
|
+
backdrop: P.target === P.currentTarget,
|
|
1406
|
+
singlePointer: !0
|
|
1407
|
+
}, P.currentTarget.setPointerCapture(P.pointerId), f(!0));
|
|
1408
|
+
}, oe = (P) => {
|
|
1409
|
+
const E = F.current;
|
|
1410
|
+
if (!E || E.pointerId !== P.pointerId) return;
|
|
1411
|
+
const b = P.clientX - E.startX, T = P.clientY - E.startY;
|
|
1412
|
+
Math.hypot(b, T) > 4 && (E.moved = !0), n({ ...E.view, x: E.view.x + b, y: E.view.y + T });
|
|
1413
|
+
}, N = (P, E = !1) => {
|
|
1414
|
+
const b = F.current;
|
|
1415
|
+
if (!b || b.pointerId !== P.pointerId || (F.current = null, f(!1), P.currentTarget.hasPointerCapture(P.pointerId) && P.currentTarget.releasePointerCapture(P.pointerId), E)) return;
|
|
1416
|
+
const T = P.clientX - b.startX, p = P.clientY - b.startY;
|
|
1417
|
+
b.type === "touch" && b.singlePointer && b.view.scale === 1 && Math.abs(T) >= 60 && Math.abs(T) > Math.abs(p) * 1.5 ? (n(ye()), B(T < 0 ? 1 : -1)) : !b.moved && Math.hypot(T, p) <= 4 && b.backdrop && o();
|
|
1418
|
+
};
|
|
1419
|
+
return v ? Tt(/* @__PURE__ */ S(
|
|
1420
|
+
"div",
|
|
1421
|
+
{
|
|
1422
|
+
ref: g,
|
|
1423
|
+
className: "exmd-image-lightbox",
|
|
1424
|
+
role: "dialog",
|
|
1425
|
+
"aria-modal": "true",
|
|
1426
|
+
"aria-label": y("image.preview"),
|
|
1427
|
+
tabIndex: -1,
|
|
1428
|
+
children: [
|
|
1429
|
+
/* @__PURE__ */ S("div", { className: "exmd-image-lightbox-toolbar", children: [
|
|
1430
|
+
/* @__PURE__ */ d("span", { className: "exmd-image-lightbox-title", children: v.title || v.alt || y(v.kind === "mermaid" ? "image.diagram" : "image.image") }),
|
|
1431
|
+
/* @__PURE__ */ d("span", { className: "exmd-image-lightbox-counter", "aria-live": "polite", children: y("image.counter", { current: s + 1, total: t.length }) }),
|
|
1432
|
+
/* @__PURE__ */ d("button", { type: "button", "aria-label": y("image.zoomOut"), title: y("image.zoomOut"), onClick: () => R(1 / 1.25), disabled: m.scale <= 0.2, children: /* @__PURE__ */ d(bo, {}) }),
|
|
1433
|
+
/* @__PURE__ */ S("span", { className: "exmd-image-lightbox-scale", children: [
|
|
1434
|
+
Math.round(m.scale * 100),
|
|
1435
|
+
"%"
|
|
1436
|
+
] }),
|
|
1437
|
+
/* @__PURE__ */ d("button", { type: "button", "aria-label": y("image.zoomIn"), title: y("image.zoomIn"), onClick: () => R(1.25), disabled: m.scale >= 8, children: /* @__PURE__ */ d(wo, {}) }),
|
|
1438
|
+
/* @__PURE__ */ d("button", { type: "button", "aria-label": y("image.reset"), title: y("image.reset"), onClick: () => n(ye()), children: /* @__PURE__ */ d(xo, {}) }),
|
|
1439
|
+
/* @__PURE__ */ d("button", { type: "button", className: "exmd-image-lightbox-close", "aria-label": y("image.close"), title: y("image.close"), onClick: o, children: /* @__PURE__ */ d(ko, {}) })
|
|
1440
|
+
] }),
|
|
1441
|
+
/* @__PURE__ */ d(
|
|
1442
|
+
"div",
|
|
1443
|
+
{
|
|
1444
|
+
ref: h,
|
|
1445
|
+
className: `exmd-image-lightbox-stage${i ? " is-dragging" : ""}`,
|
|
1446
|
+
onPointerDown: O,
|
|
1447
|
+
onPointerMove: oe,
|
|
1448
|
+
onPointerUp: (P) => N(P),
|
|
1449
|
+
onPointerCancel: (P) => N(P, !0),
|
|
1450
|
+
onLostPointerCapture: () => {
|
|
1451
|
+
F.current = null, f(!1);
|
|
1452
|
+
},
|
|
1453
|
+
children: v.src && !l ? /* @__PURE__ */ d(
|
|
1454
|
+
"img",
|
|
1455
|
+
{
|
|
1456
|
+
className: "exmd-image-lightbox-image",
|
|
1457
|
+
src: v.src,
|
|
1458
|
+
alt: v.alt,
|
|
1459
|
+
draggable: !1,
|
|
1460
|
+
style: { transform: `translate(${m.x}px, ${m.y}px) scale(${m.scale})` },
|
|
1461
|
+
onError: () => w(!0)
|
|
1462
|
+
}
|
|
1463
|
+
) : /* @__PURE__ */ d("p", { className: "exmd-image-lightbox-unavailable", role: "status", children: y("image.unavailable") })
|
|
1464
|
+
}
|
|
1465
|
+
),
|
|
1466
|
+
t.length > 1 && /* @__PURE__ */ S(le, { children: [
|
|
1467
|
+
/* @__PURE__ */ d(
|
|
1468
|
+
"button",
|
|
1469
|
+
{
|
|
1470
|
+
type: "button",
|
|
1471
|
+
className: "exmd-image-lightbox-previous",
|
|
1472
|
+
"aria-label": y("image.previous"),
|
|
1473
|
+
title: y("image.previous"),
|
|
1474
|
+
onClick: () => B(-1),
|
|
1475
|
+
disabled: s === 0,
|
|
1476
|
+
children: /* @__PURE__ */ d(Fo, {})
|
|
1477
|
+
}
|
|
1478
|
+
),
|
|
1479
|
+
/* @__PURE__ */ d(
|
|
1480
|
+
"button",
|
|
1481
|
+
{
|
|
1482
|
+
type: "button",
|
|
1483
|
+
className: "exmd-image-lightbox-next",
|
|
1484
|
+
"aria-label": y("image.next"),
|
|
1485
|
+
title: y("image.next"),
|
|
1486
|
+
onClick: () => B(1),
|
|
1487
|
+
disabled: s === t.length - 1,
|
|
1488
|
+
children: /* @__PURE__ */ d(yo, {})
|
|
1489
|
+
}
|
|
1490
|
+
)
|
|
1491
|
+
] }),
|
|
1492
|
+
/* @__PURE__ */ d("p", { className: "exmd-image-lightbox-hint", children: y("image.hint") })
|
|
1493
|
+
]
|
|
1494
|
+
}
|
|
1495
|
+
), document.body) : null;
|
|
1496
|
+
}
|
|
1497
|
+
const Aa = {
|
|
1498
|
+
..._e,
|
|
1499
|
+
attributes: { ..._e.attributes, span: [..._e.attributes?.span || [], "dataColor"] }
|
|
1500
|
+
}, Na = {
|
|
1501
|
+
a: ({ children: t, ...e }) => /* @__PURE__ */ d("a", { ...e, target: "_blank", rel: "noreferrer", children: t }),
|
|
1502
|
+
span: ({ node: t, children: e, ...o }) => {
|
|
1503
|
+
const a = t?.properties?.dataColor, r = typeof a == "string" && /^#[0-9a-fA-F]{6}$/.test(a) ? a : void 0;
|
|
1504
|
+
return /* @__PURE__ */ d("span", { ...o, style: r ? { ...o.style, color: r } : o.style, children: e });
|
|
1505
|
+
},
|
|
1506
|
+
pre: ({ children: t, node: e }) => /* @__PURE__ */ d("div", { "data-exmd-source-line": e?.position?.start.line, "data-exmd-source-end-line": e?.position?.end.line, children: t })
|
|
1507
|
+
}, Oa = We(function({ value: e, resolveImageUrl: o, onImagePreview: a, interaction: r, locale: s, messages: c }) {
|
|
1508
|
+
const m = C(null), [n, i] = j(null);
|
|
1509
|
+
V(() => i(null), [e, o, a]);
|
|
1510
|
+
const f = n !== null;
|
|
1511
|
+
V(() => {
|
|
1512
|
+
const h = m.current;
|
|
1513
|
+
if (!f || !h) return;
|
|
1514
|
+
const F = () => {
|
|
1515
|
+
const x = new Map(kt(h).images.map((v) => [v.id, v]));
|
|
1516
|
+
i((v) => {
|
|
1517
|
+
if (!v) return null;
|
|
1518
|
+
const y = v.images.map((B) => x.get(B.id) || B);
|
|
1519
|
+
return { images: y, index: v.index, image: y[v.index] };
|
|
1520
|
+
});
|
|
1521
|
+
}, D = new MutationObserver(F);
|
|
1522
|
+
return D.observe(h, { attributes: !0, subtree: !0, attributeFilter: ["src"] }), h.addEventListener("load", F, !0), () => {
|
|
1523
|
+
D.disconnect(), h.removeEventListener("load", F, !0);
|
|
1524
|
+
};
|
|
1525
|
+
}, [f]);
|
|
1526
|
+
const l = Pe((h) => {
|
|
1527
|
+
const F = m.current;
|
|
1528
|
+
if (!F || !h || !h.closest) return !1;
|
|
1529
|
+
const D = h.closest("[data-exmd-preview-kind]");
|
|
1530
|
+
if (!D || !F.contains(D)) return !1;
|
|
1531
|
+
const { elements: x, images: v } = kt(F), y = x.indexOf(D);
|
|
1532
|
+
if (y < 0) return !1;
|
|
1533
|
+
const B = { image: v[y], images: v, index: y };
|
|
1534
|
+
return a ? a(B) : i(B), !0;
|
|
1535
|
+
}, [a]), w = Z(() => r ? Ia(e) : null, [e, r]);
|
|
1536
|
+
Dt(() => {
|
|
1537
|
+
if (m.current && w && r) return r.attach(m.current, w.mapping);
|
|
1538
|
+
}, [w, r]);
|
|
1539
|
+
const g = Z(() => ({
|
|
1540
|
+
...Na,
|
|
1541
|
+
code: ({ className: h, children: F, ...D }) => {
|
|
1542
|
+
const x = /language-([\w-]+)/.exec(h || ""), v = String(F);
|
|
1543
|
+
return x?.[1] === "mermaid" ? /* @__PURE__ */ d(
|
|
1544
|
+
"div",
|
|
1545
|
+
{
|
|
1546
|
+
"data-exmd-preview-kind": "mermaid",
|
|
1547
|
+
"data-exmd-preview-key": v,
|
|
1548
|
+
"data-exmd-preview-from": D.node?.position?.start.offset,
|
|
1549
|
+
"data-exmd-preview-to": D.node?.position?.end.offset,
|
|
1550
|
+
"data-exmd-preview-alt": I(s, "image.diagram", void 0, c),
|
|
1551
|
+
role: "button",
|
|
1552
|
+
tabIndex: 0,
|
|
1553
|
+
"aria-label": I(s, "image.open", { name: I(s, "image.diagram", void 0, c) }, c),
|
|
1554
|
+
children: /* @__PURE__ */ d(Ma, { code: v.replace(/\n$/, ""), locale: s, messages: c })
|
|
1555
|
+
}
|
|
1556
|
+
) : x ? /* @__PURE__ */ d(Ca, { code: v, language: x[1] }) : /* @__PURE__ */ d("code", { className: h, ...D, children: F });
|
|
1557
|
+
},
|
|
1558
|
+
img: ({ node: h, alt: F, src: D, ...x }) => /* @__PURE__ */ d(
|
|
1559
|
+
Ua,
|
|
1560
|
+
{
|
|
1561
|
+
...x,
|
|
1562
|
+
alt: F || "",
|
|
1563
|
+
path: D || "",
|
|
1564
|
+
resolveUrl: o,
|
|
1565
|
+
"data-exmd-preview-kind": "image",
|
|
1566
|
+
"data-exmd-preview-key": D || "",
|
|
1567
|
+
"data-exmd-preview-from": h?.position?.start.offset,
|
|
1568
|
+
"data-exmd-preview-to": h?.position?.end.offset,
|
|
1569
|
+
role: "button",
|
|
1570
|
+
tabIndex: 0,
|
|
1571
|
+
"aria-label": I(s, "image.open", { name: F || I(s, "image.image", void 0, c) }, c)
|
|
1572
|
+
}
|
|
1573
|
+
)
|
|
1574
|
+
}), [o, s, c]);
|
|
1575
|
+
return /* @__PURE__ */ S(le, { children: [
|
|
1576
|
+
/* @__PURE__ */ d("article", { ref: m, className: "markdown-body", onClick: (h) => {
|
|
1577
|
+
l(h.target) && (h.preventDefault(), h.stopPropagation());
|
|
1578
|
+
}, onKeyDown: (h) => {
|
|
1579
|
+
(h.key === "Enter" || h.key === " ") && l(h.target) && (h.preventDefault(), h.stopPropagation());
|
|
1580
|
+
}, children: /* @__PURE__ */ d(Oo, { remarkPlugins: [Uo, Bo], rehypePlugins: [
|
|
1581
|
+
...w ? [w.beforeRaw] : [],
|
|
1582
|
+
// No raw HTML can exist without '<'. Keep sanitization on both paths.
|
|
1583
|
+
...e.includes("<") ? [qo] : [],
|
|
1584
|
+
[_o, Aa],
|
|
1585
|
+
...w ? [w.afterSanitize] : [],
|
|
1586
|
+
zo
|
|
1587
|
+
], components: g, children: e }) }),
|
|
1588
|
+
n && /* @__PURE__ */ d(Ra, { images: n.images, index: n.index, onClose: () => i(null), locale: s, messages: c })
|
|
1589
|
+
] });
|
|
1590
|
+
});
|
|
1591
|
+
function Ua({ path: t, resolveUrl: e, alt: o, ...a }) {
|
|
1592
|
+
const [r, s] = j(null), c = e ? r?.path === t && r.resolveUrl === e ? r.src : "" : t;
|
|
1593
|
+
return V(() => {
|
|
1594
|
+
let m = !0;
|
|
1595
|
+
if (e)
|
|
1596
|
+
return Promise.resolve().then(() => e(t)).then((n) => {
|
|
1597
|
+
m && s({ path: t, resolveUrl: e, src: n });
|
|
1598
|
+
}).catch(() => {
|
|
1599
|
+
m && s({ path: t, resolveUrl: e, src: "" });
|
|
1600
|
+
}), () => {
|
|
1601
|
+
m = !1;
|
|
1602
|
+
};
|
|
1603
|
+
}, [t, e]), /* @__PURE__ */ d("img", { ...a, src: c || void 0, alt: o || "", loading: "lazy" });
|
|
1604
|
+
}
|
|
1605
|
+
const Ba = [
|
|
1606
|
+
{ id: "heading1", label: "H1", titleKey: "format.heading1", prefix: "# ", block: !0 },
|
|
1607
|
+
{ id: "heading2", label: "H2", titleKey: "format.heading2", prefix: "## ", block: !0 },
|
|
1608
|
+
{ id: "heading3", label: "H3", titleKey: "format.heading3", prefix: "### ", block: !0 },
|
|
1609
|
+
{ id: "heading4", label: "H4", titleKey: "format.heading4", prefix: "#### ", block: !0 },
|
|
1610
|
+
{ id: "heading5", label: "H5", titleKey: "format.heading5", prefix: "##### ", block: !0 },
|
|
1611
|
+
{ id: "bold", label: "B", titleKey: "format.bold", prefix: "**", suffix: "**", placeholderKey: "format.boldPlaceholder" },
|
|
1612
|
+
{ id: "italic", label: "I", titleKey: "format.italic", prefix: "*", suffix: "*", placeholderKey: "format.italicPlaceholder" },
|
|
1613
|
+
{ id: "strike", label: "S", titleKey: "format.strike", prefix: "~~", suffix: "~~", placeholderKey: "format.strikePlaceholder" },
|
|
1614
|
+
{ id: "code", label: "</>", titleKey: "format.inlineCode", prefix: "`", suffix: "`", placeholderKey: "format.codePlaceholder" },
|
|
1615
|
+
{ id: "quote", label: "“", titleKey: "format.quote", prefix: "> ", block: !0 },
|
|
1616
|
+
{ id: "bullet", label: "•", titleKey: "format.bulletList", prefix: "- ", block: !0 },
|
|
1617
|
+
{ id: "ordered", label: "1.", titleKey: "format.orderedList", prefix: "1. ", block: !0 },
|
|
1618
|
+
{ id: "task", label: "☑", titleKey: "format.task", prefix: "- [ ] ", block: !0 },
|
|
1619
|
+
{ id: "link", label: "↗", titleKey: "format.link", prefix: "[", suffix: "](https://)", placeholderKey: "format.linkPlaceholder" }
|
|
1620
|
+
];
|
|
1621
|
+
function za(t, e) {
|
|
1622
|
+
const o = t.state.selection.main, a = t.state.sliceDoc(o.from, o.to);
|
|
1623
|
+
if (e.block) {
|
|
1624
|
+
const r = t.state.doc.lineAt(o.from), s = e.prefix;
|
|
1625
|
+
t.dispatch({ changes: { from: r.from, insert: s }, selection: { anchor: o.from + s.length, head: o.to + s.length } });
|
|
1626
|
+
} else {
|
|
1627
|
+
const r = a || e.placeholder || "", s = `${e.prefix}${r}${e.suffix || ""}`, c = o.from + e.prefix.length;
|
|
1628
|
+
t.dispatch({ changes: { from: o.from, to: o.to, insert: s }, selection: { anchor: c, head: c + r.length } });
|
|
1629
|
+
}
|
|
1630
|
+
t.focus();
|
|
1631
|
+
}
|
|
1632
|
+
function he(t, e) {
|
|
1633
|
+
const o = t.state.selection.main;
|
|
1634
|
+
t.dispatch({ changes: { from: o.from, to: o.to, insert: e }, selection: { anchor: o.from + e.length } }), t.focus();
|
|
1635
|
+
}
|
|
1636
|
+
function qa(t, e, o) {
|
|
1637
|
+
return { label: t.label, title: e, prefix: t.prefix, suffix: t.suffix, placeholder: o, block: t.block };
|
|
1638
|
+
}
|
|
1639
|
+
function _a(t) {
|
|
1640
|
+
const e = t.readOnly, o = (a) => I(t.locale, a, void 0, t.messages);
|
|
1641
|
+
return /* @__PURE__ */ S("div", { className: "toolbar", role: "toolbar", "aria-label": o("toolbar.label"), children: [
|
|
1642
|
+
/* @__PURE__ */ S("div", { className: "tool-group history-tools", children: [
|
|
1643
|
+
/* @__PURE__ */ d("button", { disabled: e, onClick: t.onUndo, title: o("toolbar.undo"), children: /* @__PURE__ */ d(Po, {}) }),
|
|
1644
|
+
/* @__PURE__ */ d("button", { disabled: e, onClick: t.onRedo, title: o("toolbar.redo"), children: /* @__PURE__ */ d(Mo, {}) })
|
|
1645
|
+
] }),
|
|
1646
|
+
/* @__PURE__ */ d("div", { className: "tool-divider" }),
|
|
1647
|
+
/* @__PURE__ */ d("div", { className: "tool-group format-tools", children: Ba.map((a) => {
|
|
1648
|
+
const r = o(a.titleKey);
|
|
1649
|
+
return /* @__PURE__ */ d("button", { disabled: e, onClick: () => t.onAction(qa(a, r, a.placeholderKey ? o(a.placeholderKey) : void 0)), title: r, className: a.label === "I" ? "italic" : "", children: a.label }, a.id);
|
|
1650
|
+
}) }),
|
|
1651
|
+
/* @__PURE__ */ d("div", { className: "tool-divider" }),
|
|
1652
|
+
/* @__PURE__ */ S("div", { className: "tool-group rich-tools", children: [
|
|
1653
|
+
/* @__PURE__ */ S("select", { disabled: e, defaultValue: "", "aria-label": o("toolbar.insertCode"), title: o("toolbar.insertCode"), onChange: (a) => {
|
|
1654
|
+
a.target.value && t.onCodeBlock(a.target.value), a.target.value = "";
|
|
1655
|
+
}, children: [
|
|
1656
|
+
/* @__PURE__ */ d("option", { value: "", disabled: !0, children: o("toolbar.codeLanguage") }),
|
|
1657
|
+
/* @__PURE__ */ d("option", { value: "typescript", children: "TypeScript" }),
|
|
1658
|
+
/* @__PURE__ */ d("option", { value: "javascript", children: "JavaScript" }),
|
|
1659
|
+
/* @__PURE__ */ d("option", { value: "tsx", children: "TSX" }),
|
|
1660
|
+
/* @__PURE__ */ d("option", { value: "python", children: "Python" }),
|
|
1661
|
+
/* @__PURE__ */ d("option", { value: "java", children: "Java" }),
|
|
1662
|
+
/* @__PURE__ */ d("option", { value: "go", children: "Go" }),
|
|
1663
|
+
/* @__PURE__ */ d("option", { value: "rust", children: "Rust" }),
|
|
1664
|
+
/* @__PURE__ */ d("option", { value: "cpp", children: "C++" }),
|
|
1665
|
+
/* @__PURE__ */ d("option", { value: "csharp", children: "C#" }),
|
|
1666
|
+
/* @__PURE__ */ d("option", { value: "php", children: "PHP" }),
|
|
1667
|
+
/* @__PURE__ */ d("option", { value: "ruby", children: "Ruby" }),
|
|
1668
|
+
/* @__PURE__ */ d("option", { value: "swift", children: "Swift" }),
|
|
1669
|
+
/* @__PURE__ */ d("option", { value: "kotlin", children: "Kotlin" }),
|
|
1670
|
+
/* @__PURE__ */ d("option", { value: "bash", children: "Shell" }),
|
|
1671
|
+
/* @__PURE__ */ d("option", { value: "sql", children: "SQL" }),
|
|
1672
|
+
/* @__PURE__ */ d("option", { value: "json", children: "JSON" }),
|
|
1673
|
+
/* @__PURE__ */ d("option", { value: "yaml", children: "YAML" }),
|
|
1674
|
+
/* @__PURE__ */ d("option", { value: "html", children: "HTML" }),
|
|
1675
|
+
/* @__PURE__ */ d("option", { value: "css", children: "CSS" }),
|
|
1676
|
+
/* @__PURE__ */ d("option", { value: "graphql", children: "GraphQL" }),
|
|
1677
|
+
/* @__PURE__ */ d("option", { value: "dockerfile", children: "Dockerfile" }),
|
|
1678
|
+
/* @__PURE__ */ d("option", { value: "markdown", children: "Markdown" })
|
|
1679
|
+
] }),
|
|
1680
|
+
/* @__PURE__ */ S("label", { className: "color-tool", title: o("toolbar.textColor"), children: [
|
|
1681
|
+
/* @__PURE__ */ d("span", { children: "A" }),
|
|
1682
|
+
/* @__PURE__ */ d("input", { disabled: e, type: "color", defaultValue: "#d14f4f", "aria-label": o("toolbar.textColor"), onChange: (a) => t.onColor(a.target.value) })
|
|
1683
|
+
] })
|
|
1684
|
+
] }),
|
|
1685
|
+
/* @__PURE__ */ d("div", { className: "tool-divider" }),
|
|
1686
|
+
/* @__PURE__ */ S("div", { className: "tool-group", children: [
|
|
1687
|
+
/* @__PURE__ */ d("button", { disabled: e, onClick: t.onImage, title: o("toolbar.uploadImage"), children: /* @__PURE__ */ d(Do, {}) }),
|
|
1688
|
+
/* @__PURE__ */ d("button", { disabled: e, onClick: t.onDiagram, title: o("toolbar.insertDiagram"), children: /* @__PURE__ */ d(To, {}) }),
|
|
1689
|
+
/* @__PURE__ */ d("button", { disabled: e, onClick: t.onFormula, title: o("toolbar.insertFormula"), children: /* @__PURE__ */ d(Eo, {}) })
|
|
1690
|
+
] }),
|
|
1691
|
+
/* @__PURE__ */ d("div", { className: "toolbar-spacer" }),
|
|
1692
|
+
t.hostActions,
|
|
1693
|
+
/* @__PURE__ */ S("div", { className: "tool-group view-switcher", children: [
|
|
1694
|
+
/* @__PURE__ */ d("button", { className: t.mode === "edit" ? "active" : "", onClick: () => t.onModeChange("edit"), title: o("toolbar.viewEdit"), children: /* @__PURE__ */ d(Lo, {}) }),
|
|
1695
|
+
/* @__PURE__ */ d("button", { className: t.mode === "split" ? "active" : "", onClick: () => t.onModeChange("split"), title: o("toolbar.viewSplit"), children: /* @__PURE__ */ d(Co, {}) }),
|
|
1696
|
+
/* @__PURE__ */ d("button", { className: t.mode === "preview" ? "active" : "", onClick: () => t.onModeChange("preview"), title: o("toolbar.viewPreview"), children: /* @__PURE__ */ d(Io, {}) })
|
|
1697
|
+
] })
|
|
1698
|
+
] });
|
|
1699
|
+
}
|
|
1700
|
+
function Ft({ actions: t, context: e, capture: o }) {
|
|
1701
|
+
return /* @__PURE__ */ d("div", { className: "exmd-host-actions", children: t.map((a) => /* @__PURE__ */ d(
|
|
1702
|
+
"button",
|
|
1703
|
+
{
|
|
1704
|
+
type: "button",
|
|
1705
|
+
title: a.title,
|
|
1706
|
+
"aria-label": a.title,
|
|
1707
|
+
disabled: a.disabled || a.requiresSelection !== !1 && !e.anchor,
|
|
1708
|
+
onPointerDown: (r) => r.preventDefault(),
|
|
1709
|
+
onMouseDown: (r) => r.preventDefault(),
|
|
1710
|
+
onClick: () => {
|
|
1711
|
+
const r = o();
|
|
1712
|
+
!a.disabled && (a.requiresSelection === !1 || r.anchor) && a.onClick(r);
|
|
1713
|
+
},
|
|
1714
|
+
children: a.icon || a.title
|
|
1715
|
+
},
|
|
1716
|
+
a.id
|
|
1717
|
+
)) });
|
|
1718
|
+
}
|
|
1719
|
+
function Me(t) {
|
|
1720
|
+
return { bytes: U.encodeRelativePosition(t) };
|
|
1721
|
+
}
|
|
1722
|
+
function yt(t) {
|
|
1723
|
+
return U.decodeRelativePosition(new Uint8Array(t.bytes));
|
|
1724
|
+
}
|
|
1725
|
+
function De(t, e) {
|
|
1726
|
+
if (!Number.isInteger(e) || e < 0 || e > t.length) throw new RangeError("Invalid Markdown text position");
|
|
1727
|
+
}
|
|
1728
|
+
function Va(t, e, o) {
|
|
1729
|
+
return De(t, e), De(t, o), {
|
|
1730
|
+
kind: "text",
|
|
1731
|
+
anchor: Me(U.createRelativePositionFromTypeIndex(t, e)),
|
|
1732
|
+
focus: Me(U.createRelativePositionFromTypeIndex(t, o))
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1735
|
+
function nn(t, e, o) {
|
|
1736
|
+
const a = Je(t, e, o);
|
|
1737
|
+
return a ? { from: Math.min(a.anchor, a.focus), to: Math.max(a.anchor, a.focus) } : null;
|
|
1738
|
+
}
|
|
1739
|
+
function Je(t, e, o) {
|
|
1740
|
+
try {
|
|
1741
|
+
if (o.kind !== "text") return null;
|
|
1742
|
+
const a = U.createAbsolutePositionFromRelativePosition(yt(o.anchor), t, !1), r = U.createAbsolutePositionFromRelativePosition(yt(o.focus), t, !1);
|
|
1743
|
+
return !a || !r || a.type !== e || r.type !== e ? null : { anchor: a.index, focus: r.index };
|
|
1744
|
+
} catch {
|
|
1745
|
+
return null;
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
function Nt(t, e, o) {
|
|
1749
|
+
if (De(t, e), De(t, o), e >= o) throw new RangeError("A comment anchor requires a nonempty forward range");
|
|
1750
|
+
return {
|
|
1751
|
+
kind: "markdown-text-range",
|
|
1752
|
+
start: Me(U.createRelativePositionFromTypeIndex(t, e, 0)),
|
|
1753
|
+
end: Me(U.createRelativePositionFromTypeIndex(t, o, -1)),
|
|
1754
|
+
content: Ha(t, e, o)
|
|
1755
|
+
};
|
|
1756
|
+
}
|
|
1757
|
+
function ve(t, e, o) {
|
|
1758
|
+
if (!o || o.kind !== "markdown-text-range" || !Array.isArray(o.content) || !o.content.length || o.content && (!Array.isArray(o.content) || o.content.some((r) => !r || !Number.isSafeInteger(r.client) || r.client < 0 || !Number.isSafeInteger(r.clock) || r.clock < 0 || !Number.isSafeInteger(r.length) || r.length <= 0))) return null;
|
|
1759
|
+
if (o.content?.length) {
|
|
1760
|
+
const r = U.createDeleteSetFromStructStore(t.store);
|
|
1761
|
+
if (o.content.every((c) => {
|
|
1762
|
+
let m = c.clock;
|
|
1763
|
+
for (const n of r.clients.get(c.client) || []) {
|
|
1764
|
+
if (n.clock > m) break;
|
|
1765
|
+
if (n.clock + n.len > m && (m = n.clock + n.len), m >= c.clock + c.length) return !0;
|
|
1766
|
+
}
|
|
1767
|
+
return !1;
|
|
1768
|
+
})) return null;
|
|
1769
|
+
}
|
|
1770
|
+
const a = Je(t, e, { kind: "text", anchor: o.start, focus: o.end });
|
|
1771
|
+
return a && a.anchor < a.focus ? { from: a.anchor, to: a.focus } : null;
|
|
1772
|
+
}
|
|
1773
|
+
function Ha(t, e, o) {
|
|
1774
|
+
const a = t.doc;
|
|
1775
|
+
if (!a) throw new Error("The text must belong to a Y.Doc");
|
|
1776
|
+
const r = [];
|
|
1777
|
+
for (const s of a.store.clients.values())
|
|
1778
|
+
for (const c of s) {
|
|
1779
|
+
if (!(c instanceof U.Item) || c.parent !== t || c.deleted || !c.countable) continue;
|
|
1780
|
+
const m = U.createAbsolutePositionFromRelativePosition(
|
|
1781
|
+
U.createRelativePositionFromJSON({ item: c.id, assoc: 0 }),
|
|
1782
|
+
a,
|
|
1783
|
+
!1
|
|
1784
|
+
);
|
|
1785
|
+
if (!m) continue;
|
|
1786
|
+
const n = Math.max(e, m.index), i = Math.min(o, m.index + c.length);
|
|
1787
|
+
n < i && r.push({ client: c.id.client, clock: c.id.clock + n - m.index, length: i - n });
|
|
1788
|
+
}
|
|
1789
|
+
return r;
|
|
1790
|
+
}
|
|
1791
|
+
function ja(t, e) {
|
|
1792
|
+
let o, a, r = [], s = null, c = null, m = !1, n = () => {
|
|
1793
|
+
};
|
|
1794
|
+
const i = () => !!(o && a && a.source === t.toString()), f = () => {
|
|
1795
|
+
if (!i()) return null;
|
|
1796
|
+
const g = xt(o, a);
|
|
1797
|
+
return g ? Nt(t, g.from, g.to) : null;
|
|
1798
|
+
}, l = (g) => {
|
|
1799
|
+
const h = t.doc && ve(t.doc, t, g);
|
|
1800
|
+
return i() && h ? Sa(o, a, h.from, h.to) : [];
|
|
1801
|
+
};
|
|
1802
|
+
return {
|
|
1803
|
+
capture: f,
|
|
1804
|
+
selectionRect: () => i() && xt(o, a)?.range.getBoundingClientRect() || null,
|
|
1805
|
+
clearSelection: () => {
|
|
1806
|
+
c = null, m = !1;
|
|
1807
|
+
},
|
|
1808
|
+
setComments: (g) => {
|
|
1809
|
+
r = [...new Map(g.map((h) => [h.id, h])).values()], n();
|
|
1810
|
+
},
|
|
1811
|
+
setActive: (g) => {
|
|
1812
|
+
s = g, n();
|
|
1813
|
+
},
|
|
1814
|
+
reveal: (g) => {
|
|
1815
|
+
const h = l(g);
|
|
1816
|
+
return h.length ? (e.activate(), h[0].startContainer.parentElement?.scrollIntoView({ block: "center", inline: "nearest" }), n(), !0) : !1;
|
|
1817
|
+
},
|
|
1818
|
+
attach: (g, h) => {
|
|
1819
|
+
o = g, a = h;
|
|
1820
|
+
const F = o.ownerDocument, D = F.defaultView, x = F.createElement("div");
|
|
1821
|
+
x.className = "exmd-preview-annotations", x.setAttribute("aria-hidden", "true"), Object.assign(x.style, { position: "fixed", inset: "0", pointerEvents: "none", zIndex: "4" }), F.body.append(x);
|
|
1822
|
+
let v = 0, y = [];
|
|
1823
|
+
const B = () => {
|
|
1824
|
+
if (v = 0, x.replaceChildren(), y = [], !r.length || !i() || !g.getClientRects().length) return;
|
|
1825
|
+
let b = { left: 0, top: 0, right: D.innerWidth, bottom: D.innerHeight };
|
|
1826
|
+
for (let T = g; T; T = T.parentElement) {
|
|
1827
|
+
const p = D.getComputedStyle(T);
|
|
1828
|
+
if (/(auto|scroll|hidden|clip)/.test(p.overflow + p.overflowX + p.overflowY)) {
|
|
1829
|
+
const M = T.getBoundingClientRect();
|
|
1830
|
+
b = {
|
|
1831
|
+
left: Math.max(b.left, M.left),
|
|
1832
|
+
right: Math.min(b.right, M.right),
|
|
1833
|
+
top: Math.max(b.top, M.top),
|
|
1834
|
+
bottom: Math.min(b.bottom, M.bottom)
|
|
1835
|
+
};
|
|
1836
|
+
}
|
|
1837
|
+
if (T.classList.contains("preview-pane")) {
|
|
1838
|
+
const M = T.querySelector(".pane-label")?.getBoundingClientRect();
|
|
1839
|
+
M && (b.top = Math.max(b.top, M.bottom));
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
for (const T of r)
|
|
1843
|
+
if (!(T.resolved || T.deleted))
|
|
1844
|
+
for (const p of l(T.anchor)) for (const M of p.getClientRects()) {
|
|
1845
|
+
const K = Math.max(M.left, b.left), H = Math.min(M.right, b.right), z = Math.max(M.top, b.top), Q = Math.min(M.bottom, b.bottom);
|
|
1846
|
+
if (H <= K || Q <= z) continue;
|
|
1847
|
+
const G = F.createElement("span");
|
|
1848
|
+
G.dataset.commentId = T.id, G.className = "exmd-preview-comment" + (T.id === s ? " exmd-preview-comment-active" : ""), Object.assign(G.style, {
|
|
1849
|
+
position: "absolute",
|
|
1850
|
+
left: K + "px",
|
|
1851
|
+
top: z + "px",
|
|
1852
|
+
width: H - K + "px",
|
|
1853
|
+
height: Q - z + "px",
|
|
1854
|
+
boxSizing: "border-box",
|
|
1855
|
+
borderBottom: "2px solid #d8a12c",
|
|
1856
|
+
background: T.id === s ? "#ffd86666" : "transparent"
|
|
1857
|
+
}), x.append(G), y.push({ id: T.id, left: K, right: H, top: z, bottom: Q });
|
|
1858
|
+
}
|
|
1859
|
+
};
|
|
1860
|
+
n = () => {
|
|
1861
|
+
v || (v = D.requestAnimationFrame(B));
|
|
1862
|
+
};
|
|
1863
|
+
const R = () => {
|
|
1864
|
+
const b = F.getSelection(), T = b?.anchorNode && g.contains(b.anchorNode);
|
|
1865
|
+
!T && !e.isActive() || i() && (T && e.activate(), e.isActive() && (c = f(), e.selectionChanged()));
|
|
1866
|
+
}, O = () => {
|
|
1867
|
+
e.activate(), c = null, m = !1;
|
|
1868
|
+
}, oe = (b) => {
|
|
1869
|
+
if (!i() || !F.getSelection()?.isCollapsed) return;
|
|
1870
|
+
const T = [...new Set(y.filter((M) => b.clientX >= M.left && b.clientX <= M.right && b.clientY >= M.top && b.clientY <= M.bottom).map((M) => M.id))];
|
|
1871
|
+
if (!T.length) return;
|
|
1872
|
+
b.preventDefault();
|
|
1873
|
+
const p = T[(T.indexOf(s || "") + 1) % T.length];
|
|
1874
|
+
e.click(p);
|
|
1875
|
+
}, N = () => {
|
|
1876
|
+
m = e.isActive() && !!c, n();
|
|
1877
|
+
};
|
|
1878
|
+
g.addEventListener("pointerdown", O), g.addEventListener("click", oe), F.addEventListener("selectionchange", R), F.addEventListener("scroll", n, !0), D.addEventListener("resize", n), D.visualViewport?.addEventListener("resize", n), D.visualViewport?.addEventListener("scroll", n);
|
|
1879
|
+
const P = new ResizeObserver(n);
|
|
1880
|
+
P.observe(g);
|
|
1881
|
+
const E = new MutationObserver(n);
|
|
1882
|
+
for (let b = g; b; b = b.parentElement)
|
|
1883
|
+
E.observe(b, { attributes: !0, attributeFilter: ["style", "class"] });
|
|
1884
|
+
if (F.fonts?.addEventListener("loadingdone", n), t.observe(N), m && c && e.isActive()) {
|
|
1885
|
+
const b = l(c);
|
|
1886
|
+
if (b.length) {
|
|
1887
|
+
const T = F.createRange(), p = b[b.length - 1];
|
|
1888
|
+
T.setStart(b[0].startContainer, b[0].startOffset), T.setEnd(p.endContainer, p.endOffset);
|
|
1889
|
+
const M = F.getSelection();
|
|
1890
|
+
M?.removeAllRanges(), M?.addRange(T);
|
|
1891
|
+
} else
|
|
1892
|
+
c = null, F.getSelection()?.removeAllRanges();
|
|
1893
|
+
}
|
|
1894
|
+
return m = !1, n(), () => {
|
|
1895
|
+
g.removeEventListener("pointerdown", O), g.removeEventListener("click", oe), F.removeEventListener("selectionchange", R), F.removeEventListener("scroll", n, !0), D.removeEventListener("resize", n), D.visualViewport?.removeEventListener("resize", n), D.visualViewport?.removeEventListener("scroll", n), P.disconnect(), E.disconnect(), F.fonts?.removeEventListener("loadingdone", n), t.unobserve(N), D.cancelAnimationFrame(v), x.remove(), o = void 0, a = void 0, n = () => {
|
|
1896
|
+
};
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
};
|
|
1900
|
+
}
|
|
1901
|
+
function Ka(t, e, o) {
|
|
1902
|
+
if (o.button !== 0 || o.shiftKey || o.ctrlKey || o.metaKey || o.altKey) return !1;
|
|
1903
|
+
const a = o.target;
|
|
1904
|
+
if (a !== e && a !== t.dom.parentElement && a !== t.dom && a !== t.scrollDOM && a !== t.contentDOM) return !1;
|
|
1905
|
+
const r = e.getBoundingClientRect(), s = r.width / e.offsetWidth, c = r.height / e.offsetHeight;
|
|
1906
|
+
if (o.clientX < r.left + e.clientLeft * s || o.clientX >= r.left + (e.clientLeft + e.clientWidth) * s || o.clientY >= r.top + (e.clientTop + e.clientHeight) * c) return !1;
|
|
1907
|
+
const m = t.state.doc.length, n = t.coordsAtPos(m);
|
|
1908
|
+
return !n || o.clientY < n.bottom ? !1 : (t.dispatch({ selection: { anchor: m }, scrollIntoView: !0 }), t.focus(), !0);
|
|
1909
|
+
}
|
|
1910
|
+
function Pt(t) {
|
|
1911
|
+
if (t.length >= 1e4) return 150;
|
|
1912
|
+
let e = 1;
|
|
1913
|
+
for (let o = 0; o < t.length; o++) if (t[o] === `
|
|
1914
|
+
` && ++e >= 500) return 150;
|
|
1915
|
+
return 0;
|
|
1916
|
+
}
|
|
1917
|
+
function $a(t, e, o) {
|
|
1918
|
+
const a = o === void 0 ? Pt(t) : Number.isFinite(o) ? Math.min(2e3, Math.max(0, o)) : Pt(t), [r, s] = j(t), c = C(e);
|
|
1919
|
+
return Dt(() => {
|
|
1920
|
+
const m = e && !c.current;
|
|
1921
|
+
if (c.current = e, !e) return;
|
|
1922
|
+
if (m || a === 0) {
|
|
1923
|
+
s(t);
|
|
1924
|
+
return;
|
|
1925
|
+
}
|
|
1926
|
+
const n = window.setTimeout(() => s(t), a);
|
|
1927
|
+
return () => window.clearTimeout(n);
|
|
1928
|
+
}, [t, e, a]), a === 0 ? t : r;
|
|
1929
|
+
}
|
|
1930
|
+
function Ga(t, e) {
|
|
1931
|
+
if (!t.length) return e;
|
|
1932
|
+
if (e <= t[0].source) return t[0].target;
|
|
1933
|
+
for (let o = 1; o < t.length; o++) {
|
|
1934
|
+
const a = t[o - 1], r = t[o];
|
|
1935
|
+
if (e <= r.source) return a.target + (r.target - a.target) * (e - a.source) / Math.max(1, r.source - a.source);
|
|
1936
|
+
}
|
|
1937
|
+
return t[t.length - 1].target;
|
|
1938
|
+
}
|
|
1939
|
+
function Wa(t, e, o) {
|
|
1940
|
+
let a = 0, r = null, s = null, c = "", m = [];
|
|
1941
|
+
const n = () => {
|
|
1942
|
+
const l = t();
|
|
1943
|
+
if (!l) return [];
|
|
1944
|
+
const w = [e.scrollHeight, o.scrollHeight, e.clientWidth, o.clientWidth, l.state.doc.length].join(":");
|
|
1945
|
+
if (c === w && m.length) return m;
|
|
1946
|
+
c = w;
|
|
1947
|
+
const g = l.documentTop - e.getBoundingClientRect().top + e.scrollTop, h = o.getBoundingClientRect().top - o.scrollTop, F = [{ source: 0, target: 0 }], D = /* @__PURE__ */ new Set();
|
|
1948
|
+
for (const x of o.querySelectorAll(".markdown-body > [data-exmd-source-line]")) {
|
|
1949
|
+
const v = Math.max(1, Math.min(l.state.doc.lines, Number(x.dataset.exmdSourceLine)));
|
|
1950
|
+
if (!Number.isFinite(v) || D.has(v)) continue;
|
|
1951
|
+
D.add(v), F.push({ source: g + l.lineBlockAt(l.state.doc.line(v).from).top, target: x.getBoundingClientRect().top - h });
|
|
1952
|
+
const y = Number(x.dataset.exmdSourceEndLine) + 1;
|
|
1953
|
+
y > v && y <= l.state.doc.lines && !D.has(y) && (F.push({ source: g + l.lineBlockAt(l.state.doc.line(y).from).top, target: x.getBoundingClientRect().bottom - h }), D.add(y));
|
|
1954
|
+
}
|
|
1955
|
+
F.push({ source: e.scrollHeight, target: o.scrollHeight }), m = F.sort((x, v) => x.source - v.source).filter((x, v, y) => !v || x.source > y[v - 1].source);
|
|
1956
|
+
for (let x = 1; x < m.length; x++) m[x].target = Math.max(m[x - 1].target, m[x].target);
|
|
1957
|
+
return m;
|
|
1958
|
+
}, i = () => {
|
|
1959
|
+
a = 0;
|
|
1960
|
+
const l = r;
|
|
1961
|
+
if (r = null, !l) return;
|
|
1962
|
+
const w = l === e ? o : e, g = Math.max(0, l.scrollHeight - l.clientHeight), h = Math.max(0, w.scrollHeight - w.clientHeight), F = n(), D = l === e ? F : F.map((v) => ({ source: v.target, target: v.source })).filter((v, y, B) => !y || v.source > B[y - 1].source), x = l.scrollTop <= 1 ? 0 : l.scrollTop >= g - 1 ? h : Math.max(0, Math.min(h, Ga(D, l.scrollTop + l.clientHeight / 2) - w.clientHeight / 2));
|
|
1963
|
+
s = { node: w, top: x }, w.scrollTop = x;
|
|
1964
|
+
}, f = (l) => {
|
|
1965
|
+
const w = l.currentTarget;
|
|
1966
|
+
if (s?.node === w && Math.abs(w.scrollTop - s.top) < 1) {
|
|
1967
|
+
s = null;
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
r = w, a || (a = requestAnimationFrame(i));
|
|
1971
|
+
};
|
|
1972
|
+
return e.addEventListener("scroll", f, { passive: !0 }), o.addEventListener("scroll", f, { passive: !0 }), () => {
|
|
1973
|
+
cancelAnimationFrame(a), e.removeEventListener("scroll", f), o.removeEventListener("scroll", f);
|
|
1974
|
+
};
|
|
1975
|
+
}
|
|
1976
|
+
const Xa = 1, Qe = "markdown-ytext", et = 1, Ya = "markdown", Ot = "exmd:meta", Te = {
|
|
1977
|
+
bootstrap: /* @__PURE__ */ Symbol("exmd.bootstrap"),
|
|
1978
|
+
remote: /* @__PURE__ */ Symbol("exmd.remote")
|
|
1979
|
+
};
|
|
1980
|
+
function tt(t) {
|
|
1981
|
+
return t.getText(Ya);
|
|
1982
|
+
}
|
|
1983
|
+
function Ut(t) {
|
|
1984
|
+
const e = t.getMap(Ot);
|
|
1985
|
+
return {
|
|
1986
|
+
codec: e.get("codec"),
|
|
1987
|
+
schemaVersion: e.get("schemaVersion")
|
|
1988
|
+
};
|
|
1989
|
+
}
|
|
1990
|
+
function Za(t, e) {
|
|
1991
|
+
const o = tt(t), a = t.getMap(Ot);
|
|
1992
|
+
t.transact(() => {
|
|
1993
|
+
o.length === 0 && e && o.insert(0, e), a.has("codec") || a.set("codec", Qe), a.has("schemaVersion") || a.set("schemaVersion", et);
|
|
1994
|
+
}, Te.bootstrap);
|
|
1995
|
+
}
|
|
1996
|
+
function je(t) {
|
|
1997
|
+
const e = Ut(t);
|
|
1998
|
+
if (e.codec !== Qe) throw new Error(`Unsupported codec: ${e.codec}`);
|
|
1999
|
+
if (e.schemaVersion !== et) throw new Error(`Unsupported schema version: ${e.schemaVersion}`);
|
|
2000
|
+
}
|
|
2001
|
+
function sn(t) {
|
|
2002
|
+
return U.encodeStateAsUpdate(t);
|
|
2003
|
+
}
|
|
2004
|
+
const Ke = ["#7357d8", "#d9547a", "#16866f", "#d57828", "#3676c8", "#8a5b3d"], ln = `# 一起写点什么
|
|
2005
|
+
|
|
2006
|
+
这是一个支持 **实时协作** 的 Markdown 文档。试试从另一个窗口打开相同链接。
|
|
2007
|
+
|
|
2008
|
+
## 快速开始
|
|
2009
|
+
|
|
2010
|
+
- 使用上方工具栏插入常用格式
|
|
2011
|
+
- 拖入或粘贴图片
|
|
2012
|
+
- 用 Mermaid 描述流程图
|
|
2013
|
+
|
|
2014
|
+
\`\`\`mermaid
|
|
2015
|
+
flowchart LR
|
|
2016
|
+
A[想法] --> B{一起讨论}
|
|
2017
|
+
B --> C[写成文档]
|
|
2018
|
+
B --> D[继续迭代]
|
|
2019
|
+
\`\`\`
|
|
2020
|
+
`;
|
|
2021
|
+
function Ja() {
|
|
2022
|
+
const t = localStorage.getItem("collab-markdown:user");
|
|
2023
|
+
if (t)
|
|
2024
|
+
try {
|
|
2025
|
+
return JSON.parse(t);
|
|
2026
|
+
} catch {
|
|
2027
|
+
}
|
|
2028
|
+
const e = {
|
|
2029
|
+
name: `访客 ${Math.floor(100 + Math.random() * 900)}`,
|
|
2030
|
+
color: Ke[Math.floor(Math.random() * Ke.length)]
|
|
2031
|
+
};
|
|
2032
|
+
return localStorage.setItem("collab-markdown:user", JSON.stringify(e)), e;
|
|
2033
|
+
}
|
|
2034
|
+
function Qa(t) {
|
|
2035
|
+
const { roomId: e, websocketUrl: o, initialValue: a = "", user: r, persistence: s = !0, persistenceKey: c, readOnly: m = !1, enabled: n = !0, locale: i, messages: f } = t, l = C(i), w = C(f);
|
|
2036
|
+
l.current = i, w.current = f;
|
|
2037
|
+
const g = C(() => {
|
|
2038
|
+
}), h = r?.name, F = r?.color, D = r?.colorLight, x = Z(() => {
|
|
2039
|
+
const E = new U.Doc(), b = tt(E), T = new Et(E), p = new U.UndoManager(b);
|
|
2040
|
+
return { doc: E, text: b, awareness: T, undoManager: p };
|
|
2041
|
+
}, [e]), [v, y] = j("loading"), [B, R] = j(!1), [O, oe] = j([]), [N, P] = j();
|
|
2042
|
+
return V(() => {
|
|
2043
|
+
if (!n) return () => {
|
|
2044
|
+
g.current = () => {
|
|
2045
|
+
}, x.undoManager.destroy(), x.doc.destroy();
|
|
2046
|
+
};
|
|
2047
|
+
const { doc: E, awareness: b, text: T } = x, p = new ha(o, e, E, { awareness: b }), M = s ? new ga(c || `collab-markdown:${e}`, E) : void 0;
|
|
2048
|
+
m ? b.setLocalState(null) : b.setLocalStateField("user", h && F ? { name: h, color: F, colorLight: D } : Ja());
|
|
2049
|
+
let K = !M, H = !1, z = !1;
|
|
2050
|
+
const Q = () => {
|
|
2051
|
+
if (!(z || !K || !H))
|
|
2052
|
+
try {
|
|
2053
|
+
je(E), Za(E, a), z = !0, R(!0), y("ready");
|
|
2054
|
+
} catch (q) {
|
|
2055
|
+
P({ code: "SCHEMA_MISMATCH", message: q instanceof Error ? q.message : "文档格式不受支持", retryable: !1, cause: q }), y("error");
|
|
2056
|
+
}
|
|
2057
|
+
};
|
|
2058
|
+
M && M.whenSynced.then(() => {
|
|
2059
|
+
K = !0, (T.length > 0 || Ut(E).codec) && (z = !0, R(!0)), Q();
|
|
2060
|
+
}).catch((q) => {
|
|
2061
|
+
P({ code: "INITIALIZATION_FAILED", message: "本地协同数据加载失败", retryable: !0, cause: q }), y("error");
|
|
2062
|
+
});
|
|
2063
|
+
const G = (q) => {
|
|
2064
|
+
if (q)
|
|
2065
|
+
if (H = !0, z)
|
|
2066
|
+
try {
|
|
2067
|
+
je(E), y("ready");
|
|
2068
|
+
} catch (W) {
|
|
2069
|
+
P({ code: "SCHEMA_MISMATCH", message: W instanceof Error ? W.message : "文档格式不受支持", retryable: !1, cause: W }), y("error");
|
|
2070
|
+
}
|
|
2071
|
+
else Q();
|
|
2072
|
+
}, _ = ({ status: q }) => y((W) => q === "connected" ? W === "ready" ? "ready" : "syncing" : W === "error" ? W : "disconnected"), ae = () => {
|
|
2073
|
+
const q = [];
|
|
2074
|
+
p.awareness.getStates().forEach((W, re) => {
|
|
2075
|
+
const ne = W.user;
|
|
2076
|
+
ne && q.push({ clientId: re, name: ne.name || I(l.current, "presence.anonymous", void 0, w.current), color: ne.color || Ke[0] });
|
|
2077
|
+
}), oe(q);
|
|
2078
|
+
};
|
|
2079
|
+
return g.current = ae, p.on("status", _), p.on("sync", G), p.awareness.on("change", ae), y(p.wsconnected ? "syncing" : "loading"), ae(), () => {
|
|
2080
|
+
g.current = () => {
|
|
2081
|
+
}, p.off("status", _), p.off("sync", G), p.awareness.off("change", ae), p.destroy(), M?.destroy(), x.undoManager.destroy(), x.doc.destroy();
|
|
2082
|
+
};
|
|
2083
|
+
}, [n, a, s, c, m, x, e, F, D, h, o]), V(() => {
|
|
2084
|
+
g.current();
|
|
2085
|
+
}, [i, f]), {
|
|
2086
|
+
doc: x.doc,
|
|
2087
|
+
text: x.text,
|
|
2088
|
+
awareness: x.awareness,
|
|
2089
|
+
undoManager: x.undoManager,
|
|
2090
|
+
state: v,
|
|
2091
|
+
ready: B,
|
|
2092
|
+
saveState: "unavailable",
|
|
2093
|
+
collaborators: O,
|
|
2094
|
+
error: N
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
async function dn(t, e) {
|
|
2098
|
+
if (e) {
|
|
2099
|
+
const o = typeof e == "string" ? { endpoint: e } : e, a = new FormData();
|
|
2100
|
+
a.append(o.fieldName || "file", t);
|
|
2101
|
+
const r = await fetch(o.endpoint, {
|
|
2102
|
+
method: "POST",
|
|
2103
|
+
body: a,
|
|
2104
|
+
headers: o.headers,
|
|
2105
|
+
signal: o.signal,
|
|
2106
|
+
credentials: o.credentials
|
|
2107
|
+
});
|
|
2108
|
+
if (!r.ok) throw new Error(I(o.locale, "upload.failed", { status: r.status }, o.messages));
|
|
2109
|
+
const s = await r.json(), c = o.resolveUrl ? await o.resolveUrl(s) : s?.url;
|
|
2110
|
+
if (!c) throw new Error(I(o.locale, "upload.missingUrl", void 0, o.messages));
|
|
2111
|
+
return c;
|
|
2112
|
+
}
|
|
2113
|
+
return Bt(t);
|
|
2114
|
+
}
|
|
2115
|
+
function Bt(t, e = {}) {
|
|
2116
|
+
return new Promise((o, a) => {
|
|
2117
|
+
const r = new FileReader();
|
|
2118
|
+
r.onload = () => o(String(r.result)), r.onerror = () => a(new Error(I(e.locale, "upload.readFailed", void 0, e.messages))), r.readAsDataURL(t);
|
|
2119
|
+
});
|
|
2120
|
+
}
|
|
2121
|
+
function zt(t, e = {}) {
|
|
2122
|
+
for (let o = 0; o < t.length; o++) {
|
|
2123
|
+
const a = t.charCodeAt(o);
|
|
2124
|
+
if (a >= 55296 && a <= 56319) {
|
|
2125
|
+
const r = t.charCodeAt(++o);
|
|
2126
|
+
if (!(r >= 56320 && r <= 57343)) throw new TypeError(I(e.locale, "validation.loneSurrogate", void 0, e.messages));
|
|
2127
|
+
} else if (a >= 56320 && a <= 57343) throw new TypeError(I(e.locale, "validation.loneSurrogate", void 0, e.messages));
|
|
2128
|
+
}
|
|
2129
|
+
return new File(
|
|
2130
|
+
[t],
|
|
2131
|
+
er(e.fileName || "document.md"),
|
|
2132
|
+
{ type: e.mimeType || "text/markdown;charset=utf-8" }
|
|
2133
|
+
);
|
|
2134
|
+
}
|
|
2135
|
+
function cn(t, e = {}) {
|
|
2136
|
+
const o = zt(t, e), a = URL.createObjectURL(o), r = document.createElement("a");
|
|
2137
|
+
r.href = a, r.download = o.name, r.click(), URL.revokeObjectURL(a);
|
|
2138
|
+
}
|
|
2139
|
+
function er(t) {
|
|
2140
|
+
const e = t.replace(/[\u0000-\u001f\u007f\\/:*?"<>|]/g, "-").trim().replace(/\.markdown$/i, ".md") || "document.md";
|
|
2141
|
+
return /\.md$/i.test(e) ? e : `${e}.md`;
|
|
2142
|
+
}
|
|
2143
|
+
const Ee = Ce.define(), $e = Ce.define(), Le = Ce.define(), Ge = Ce.define(), Ve = go.define({
|
|
2144
|
+
create: () => ({ remote: [], comments: [], active: null }),
|
|
2145
|
+
update: (t, e) => {
|
|
2146
|
+
for (const o of e.effects)
|
|
2147
|
+
o.is(Ee) && (t = { ...t, remote: o.value }), o.is($e) && (t = {
|
|
2148
|
+
...t,
|
|
2149
|
+
comments: o.value,
|
|
2150
|
+
active: o.value.some((a) => a.id === t.active && !a.resolved && !a.deleted) ? t.active : null
|
|
2151
|
+
}), o.is(Le) && (t = { ...t, active: o.value });
|
|
2152
|
+
return t;
|
|
2153
|
+
}
|
|
2154
|
+
});
|
|
2155
|
+
class tr extends fo {
|
|
2156
|
+
constructor(e, o, a, r) {
|
|
2157
|
+
super(), this.sessionId = e, this.name = o, this.color = a, this.label = r;
|
|
2158
|
+
}
|
|
2159
|
+
sessionId;
|
|
2160
|
+
name;
|
|
2161
|
+
color;
|
|
2162
|
+
label;
|
|
2163
|
+
eq(e) {
|
|
2164
|
+
return this.sessionId === e.sessionId && this.name === e.name && this.color === e.color && this.label === e.label;
|
|
2165
|
+
}
|
|
2166
|
+
toDOM() {
|
|
2167
|
+
const e = document.createElement("span");
|
|
2168
|
+
e.className = "exmd-remote-caret", e.dataset.sessionId = this.sessionId, e.style.setProperty("--exmd-selection-color", this.color), e.setAttribute("aria-label", this.label);
|
|
2169
|
+
const o = e.appendChild(document.createElement("span"));
|
|
2170
|
+
return o.className = "exmd-remote-label", o.textContent = this.name, e;
|
|
2171
|
+
}
|
|
2172
|
+
ignoreEvent() {
|
|
2173
|
+
return !0;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
function or(t, e) {
|
|
2177
|
+
const o = (a) => {
|
|
2178
|
+
const r = t.doc;
|
|
2179
|
+
if (!r) return ge.none;
|
|
2180
|
+
const s = a.state.field(Ve), c = [];
|
|
2181
|
+
if (e.showRemote()) {
|
|
2182
|
+
const m = new Map(s.remote.map((n) => [n.sessionId, n]));
|
|
2183
|
+
for (const n of m.values()) {
|
|
2184
|
+
if (!n.selection) continue;
|
|
2185
|
+
const i = Je(r, t, n.selection);
|
|
2186
|
+
if (!i) continue;
|
|
2187
|
+
const f = /^#[0-9a-f]{6}$/i.test(n.color) ? n.color : "#7357d8", l = Math.min(i.anchor, i.focus), w = Math.max(i.anchor, i.focus);
|
|
2188
|
+
w > l && c.push(ge.mark({
|
|
2189
|
+
class: "exmd-remote-selection",
|
|
2190
|
+
attributes: {
|
|
2191
|
+
"data-session-id": n.sessionId,
|
|
2192
|
+
style: "--exmd-selection-color:" + f
|
|
2193
|
+
}
|
|
2194
|
+
}).range(l, w)), c.push(ge.widget({ widget: new tr(n.sessionId, n.name, f, e.cursorLabel?.(n.name) || `${n.name} 的光标`), side: 1 }).range(i.focus));
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
for (const m of s.comments) {
|
|
2198
|
+
if (m.resolved || m.deleted) continue;
|
|
2199
|
+
const n = ve(r, t, m.anchor);
|
|
2200
|
+
n && c.push(ge.mark({
|
|
2201
|
+
class: "exmd-comment-anchor" + (m.id === s.active ? " exmd-comment-active" : ""),
|
|
2202
|
+
attributes: { "data-comment-id": m.id }
|
|
2203
|
+
}).range(n.from, n.to));
|
|
2204
|
+
}
|
|
2205
|
+
return ge.set(c, !0);
|
|
2206
|
+
};
|
|
2207
|
+
return [
|
|
2208
|
+
Ve,
|
|
2209
|
+
uo.fromClass(class {
|
|
2210
|
+
decorations;
|
|
2211
|
+
composing = !1;
|
|
2212
|
+
frame = 0;
|
|
2213
|
+
constructor(a) {
|
|
2214
|
+
this.decorations = o(a);
|
|
2215
|
+
}
|
|
2216
|
+
update(a) {
|
|
2217
|
+
if (this.composing || a.view.composing) {
|
|
2218
|
+
this.decorations = this.decorations.map(a.changes);
|
|
2219
|
+
return;
|
|
2220
|
+
}
|
|
2221
|
+
(a.docChanged || a.viewportChanged || a.transactions.some((r) => r.effects.length)) && (this.decorations = o(a.view));
|
|
2222
|
+
}
|
|
2223
|
+
destroy() {
|
|
2224
|
+
cancelAnimationFrame(this.frame);
|
|
2225
|
+
}
|
|
2226
|
+
}, {
|
|
2227
|
+
decorations: (a) => a.decorations,
|
|
2228
|
+
eventHandlers: {
|
|
2229
|
+
compositionstart() {
|
|
2230
|
+
cancelAnimationFrame(this.frame), this.composing = !0;
|
|
2231
|
+
},
|
|
2232
|
+
compositionend(a, r) {
|
|
2233
|
+
cancelAnimationFrame(this.frame), this.frame = requestAnimationFrame(() => {
|
|
2234
|
+
this.composing = !1, r.dispatch({ effects: Ge.of() });
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
}),
|
|
2239
|
+
de.domEventHandlers({
|
|
2240
|
+
click: (a, r) => {
|
|
2241
|
+
const s = a.target instanceof Element ? a.target.closest("[data-comment-id]") : null;
|
|
2242
|
+
let c = s?.getAttribute("data-comment-id");
|
|
2243
|
+
if (c && r.dom.contains(s)) {
|
|
2244
|
+
const m = r.state.field(Ve), n = r.posAtCoords({ x: a.clientX, y: a.clientY }), i = n === null ? [c] : [...new Set(m.comments.filter((f) => {
|
|
2245
|
+
const l = !f.deleted && !f.resolved && t.doc && ve(t.doc, t, f.anchor);
|
|
2246
|
+
return l && n >= l.from && n < l.to;
|
|
2247
|
+
}).map((f) => f.id))];
|
|
2248
|
+
i.length && (c = i[(i.indexOf(m.active || "") + 1) % i.length]), r.dispatch({ effects: Le.of(c) }), e.onAnchorClick(c);
|
|
2249
|
+
}
|
|
2250
|
+
return !1;
|
|
2251
|
+
}
|
|
2252
|
+
})
|
|
2253
|
+
];
|
|
2254
|
+
}
|
|
2255
|
+
const mn = Xe(function(e, o) {
|
|
2256
|
+
if (e.collaboration) return /* @__PURE__ */ ht(qt, { ...e, ref: o, key: e.collaboration.doc.guid });
|
|
2257
|
+
if (!e.roomId || !e.websocketUrl) throw new Error(I(e.locale, "editor.transportRequired", void 0, e.messages));
|
|
2258
|
+
return /* @__PURE__ */ ht(ar, { ...e, ref: o, key: e.roomId + ":" + e.websocketUrl });
|
|
2259
|
+
}), ar = Xe(function(e, o) {
|
|
2260
|
+
const a = Qa({
|
|
2261
|
+
roomId: e.roomId,
|
|
2262
|
+
websocketUrl: e.websocketUrl,
|
|
2263
|
+
initialValue: e.initialValue,
|
|
2264
|
+
user: e.user,
|
|
2265
|
+
persistence: e.persistence,
|
|
2266
|
+
persistenceKey: e.persistenceKey,
|
|
2267
|
+
readOnly: e.mode === "readonly",
|
|
2268
|
+
locale: e.locale,
|
|
2269
|
+
messages: e.messages
|
|
2270
|
+
});
|
|
2271
|
+
return /* @__PURE__ */ d(qt, { ...e, collaboration: a, standalone: !0, ref: o });
|
|
2272
|
+
}), rr = {
|
|
2273
|
+
lineNumbers: !0,
|
|
2274
|
+
foldGutter: !0,
|
|
2275
|
+
highlightActiveLine: !0,
|
|
2276
|
+
highlightActiveLineGutter: !0,
|
|
2277
|
+
history: !1,
|
|
2278
|
+
historyKeymap: !1
|
|
2279
|
+
}, nr = We(so), qt = Xe(function({
|
|
2280
|
+
roomId: e,
|
|
2281
|
+
collaboration: o,
|
|
2282
|
+
uploadImage: a,
|
|
2283
|
+
defaultViewMode: r = "split",
|
|
2284
|
+
title: s,
|
|
2285
|
+
className: c = "",
|
|
2286
|
+
height: m = "100vh",
|
|
2287
|
+
syncScroll: n = !0,
|
|
2288
|
+
previewDebounceMs: i,
|
|
2289
|
+
mode: f = "edit",
|
|
2290
|
+
resources: l,
|
|
2291
|
+
onImagePreview: w,
|
|
2292
|
+
onUploadProgress: g,
|
|
2293
|
+
onChange: h,
|
|
2294
|
+
onConnectionChange: F,
|
|
2295
|
+
components: D = {},
|
|
2296
|
+
standalone: x = !1,
|
|
2297
|
+
selectionActions: v = [],
|
|
2298
|
+
selectionToolbar: y = !0,
|
|
2299
|
+
toolbarActions: B = [],
|
|
2300
|
+
locale: R,
|
|
2301
|
+
messages: O
|
|
2302
|
+
}, oe) {
|
|
2303
|
+
const N = (u, k) => I(R, u, k, O), P = a ?? ((u) => Bt(u, { locale: R, messages: O })), E = s ?? N("document.title"), b = C(R), T = C(O);
|
|
2304
|
+
b.current = R, T.current = O;
|
|
2305
|
+
const p = o, M = f === "readonly" || !p.ready || p.state === "error", K = e || "document", H = C(null), z = C(null), Q = C(null), G = C(null), [_, ae] = j(r), [q, W] = j(() => p.text.toString()), re = $a(q, _ !== "edit", i), [ne, Ie] = j(!1), [Se, be] = j(""), ot = C(0), we = C(void 0), ce = C(void 0), xe = C(/* @__PURE__ */ new Set()), ke = C(void 0), at = C(/* @__PURE__ */ new Set()), X = C(r === "preview" ? "preview" : "source"), rt = C([]), Re = C(null), [, Vt] = j(0), me = Pe(() => Vt((u) => u + 1), []), nt = C(me), Ae = C(() => {
|
|
2306
|
+
}), L = C({ readOnly: M, session: p, mode: _, standalone: x, onChange: h, mounted: !0 });
|
|
2307
|
+
L.current = { ...L.current, readOnly: M, session: p, mode: _, standalone: x, onChange: h };
|
|
2308
|
+
const Y = Z(() => ja(p.text, {
|
|
2309
|
+
activate: () => {
|
|
2310
|
+
X.current = "preview";
|
|
2311
|
+
},
|
|
2312
|
+
isActive: () => X.current === "preview" && L.current.mode !== "edit",
|
|
2313
|
+
selectionChanged: () => nt.current(),
|
|
2314
|
+
click: (u) => Ae.current(u)
|
|
2315
|
+
}), [p.text]), it = () => {
|
|
2316
|
+
if (L.current.mode === "preview" || L.current.mode !== "edit" && X.current === "preview") return Y.capture();
|
|
2317
|
+
const u = H.current?.view, k = u?.state.selection.main;
|
|
2318
|
+
return !k || k.empty || u?.state.doc.toString() !== p.text.toString() ? null : Nt(p.text, k.from, k.to);
|
|
2319
|
+
}, Ne = (u) => {
|
|
2320
|
+
Re.current = u, Y.setActive(u), H.current?.view?.dispatch({ effects: Le.of(u) });
|
|
2321
|
+
};
|
|
2322
|
+
Ae.current = (u) => {
|
|
2323
|
+
Ne(u), at.current.forEach((k) => k(u));
|
|
2324
|
+
}, V(() => F?.(p.state), [F, p.state]), V(() => {
|
|
2325
|
+
M && p.awareness.setLocalStateField("cursor", null);
|
|
2326
|
+
}, [M, p.awareness]);
|
|
2327
|
+
const st = Z(() => de.updateListener.of((u) => {
|
|
2328
|
+
(u.focusChanged && u.view.hasFocus || u.selectionSet && !u.docChanged) && (X.current = "source", Y.clearSelection(), nt.current()), !(!u.selectionSet && !u.focusChanged) && (window.clearTimeout(ke.current), ke.current = window.setTimeout(() => {
|
|
2329
|
+
const k = L.current, A = k.mounted && !k.readOnly && k.mode !== "preview" && k.session.state === "ready" && u.view.hasFocus ? Va(k.session.text, u.view.state.selection.main.anchor, u.view.state.selection.main.head) : null;
|
|
2330
|
+
xe.current.forEach((ee) => ee(A));
|
|
2331
|
+
}, 120));
|
|
2332
|
+
}), [Y]);
|
|
2333
|
+
V(() => {
|
|
2334
|
+
if (!n || _ !== "split") return;
|
|
2335
|
+
const u = z.current, k = Q.current;
|
|
2336
|
+
if (!(!u || !k) && re === q)
|
|
2337
|
+
return Wa(() => H.current?.view, u, k);
|
|
2338
|
+
}, [_, n, re, q]), V(() => {
|
|
2339
|
+
const u = () => {
|
|
2340
|
+
ot.current += 1;
|
|
2341
|
+
const k = p.text.toString();
|
|
2342
|
+
W(k), L.current.onChange?.(k);
|
|
2343
|
+
};
|
|
2344
|
+
return W(p.text.toString()), p.text.observe(u), () => p.text.unobserve(u);
|
|
2345
|
+
}, [p.text]);
|
|
2346
|
+
const lt = Z(() => ho(
|
|
2347
|
+
p.text,
|
|
2348
|
+
x ? p.awareness : null,
|
|
2349
|
+
{ undoManager: p.undoManager }
|
|
2350
|
+
), [p.text, p.awareness, p.undoManager, x]), dt = Z(() => or(p.text, {
|
|
2351
|
+
showRemote: () => !L.current.readOnly && L.current.mode !== "preview" && L.current.session.state === "ready",
|
|
2352
|
+
onAnchorClick: (u) => Ae.current(u),
|
|
2353
|
+
cursorLabel: (u) => I(b.current, "presence.cursor", { name: u }, T.current)
|
|
2354
|
+
}), [p.text]), ct = Z(() => vt.transactionFilter.of((u) => u.docChanged && L.current.readOnly && !u.annotation(vo) ? [] : u), []), mt = Z(() => bt.highest(po.of([
|
|
2355
|
+
{ key: "Mod-z", run: () => (L.current.readOnly || L.current.session.undoManager.undo(), !0) },
|
|
2356
|
+
{ key: "Mod-Shift-z", run: () => (L.current.readOnly || L.current.session.undoManager.redo(), !0) },
|
|
2357
|
+
{ key: "Mod-y", run: () => (L.current.readOnly || L.current.session.undoManager.redo(), !0) }
|
|
2358
|
+
])), []), ut = Z(() => bt.highest(de.domEventHandlers({
|
|
2359
|
+
beforeinput: (u) => u.inputType !== "historyUndo" && u.inputType !== "historyRedo" ? !1 : (u.preventDefault(), L.current.readOnly || (u.inputType === "historyUndo" ? L.current.session.undoManager.undo() : L.current.session.undoManager.redo()), !0)
|
|
2360
|
+
})), []), Ht = Z(
|
|
2361
|
+
() => [
|
|
2362
|
+
vt.lineSeparator.of(`
|
|
2363
|
+
`),
|
|
2364
|
+
lo(),
|
|
2365
|
+
co(mo),
|
|
2366
|
+
de.lineWrapping,
|
|
2367
|
+
ut,
|
|
2368
|
+
lt,
|
|
2369
|
+
dt,
|
|
2370
|
+
ct,
|
|
2371
|
+
mt,
|
|
2372
|
+
st
|
|
2373
|
+
],
|
|
2374
|
+
[dt, lt, ct, ut, st, mt]
|
|
2375
|
+
), $ = () => H.current?.view, jt = N("presence.cursor", { name: " " });
|
|
2376
|
+
V(() => {
|
|
2377
|
+
$()?.dispatch({ effects: Ge.of() });
|
|
2378
|
+
}, [jt]), V(() => {
|
|
2379
|
+
_ === "preview" && (X.current = "preview"), _ === "edit" && (X.current = "source", Y.clearSelection()), M && (ce.current?.abort(), Ie(!1)), (M || _ === "preview" || p.state !== "ready") && (window.clearTimeout(ke.current), $()?.dispatch({ effects: Ee.of([]) }), xe.current.forEach((u) => u(null))), $()?.dispatch({ effects: Ge.of() }), _ !== "preview" && $()?.requestMeasure();
|
|
2380
|
+
}, [M, _, p.state]), V(() => {
|
|
2381
|
+
const u = Q.current || z.current;
|
|
2382
|
+
if (!u || !v.length && !B.length) return;
|
|
2383
|
+
const k = u.ownerDocument, A = k.defaultView;
|
|
2384
|
+
let ee = 0;
|
|
2385
|
+
const te = () => {
|
|
2386
|
+
ee || (ee = A.requestAnimationFrame(() => {
|
|
2387
|
+
ee = 0, me();
|
|
2388
|
+
}));
|
|
2389
|
+
};
|
|
2390
|
+
return k.addEventListener("scroll", te, !0), k.addEventListener("selectionchange", te), A.addEventListener("resize", te), A.visualViewport?.addEventListener("resize", te), () => {
|
|
2391
|
+
k.removeEventListener("scroll", te, !0), k.removeEventListener("selectionchange", te), A.removeEventListener("resize", te), A.visualViewport?.removeEventListener("resize", te), A.cancelAnimationFrame(ee);
|
|
2392
|
+
};
|
|
2393
|
+
}, [v.length, B.length, me]);
|
|
2394
|
+
const Kt = (u) => {
|
|
2395
|
+
const k = $();
|
|
2396
|
+
k && !M && za(k, u);
|
|
2397
|
+
}, $t = () => {
|
|
2398
|
+
const u = $();
|
|
2399
|
+
u && he(u, N("insert.diagram"));
|
|
2400
|
+
}, Gt = () => {
|
|
2401
|
+
const u = $();
|
|
2402
|
+
u && he(u, `
|
|
2403
|
+
$$
|
|
2404
|
+
E = mc^2
|
|
2405
|
+
$$
|
|
2406
|
+
`);
|
|
2407
|
+
}, Wt = (u) => {
|
|
2408
|
+
const k = $();
|
|
2409
|
+
k && he(k, `
|
|
2410
|
+
\`\`\`${u}
|
|
2411
|
+
${N("insert.codePlaceholder")}
|
|
2412
|
+
\`\`\`
|
|
2413
|
+
`);
|
|
2414
|
+
}, Xt = (u) => {
|
|
2415
|
+
const k = $();
|
|
2416
|
+
if (!k) return;
|
|
2417
|
+
const A = k.state.selection.main, ee = k.state.sliceDoc(A.from, A.to) || N("format.colorPlaceholder");
|
|
2418
|
+
he(k, `<span data-color="${u}">${ee}</span>`);
|
|
2419
|
+
}, Oe = Pe(async (u) => {
|
|
2420
|
+
if (!u || !u.type.startsWith("image/")) {
|
|
2421
|
+
be(I(R, "notice.imageRequired", void 0, O));
|
|
2422
|
+
return;
|
|
2423
|
+
}
|
|
2424
|
+
if (L.current.readOnly) {
|
|
2425
|
+
be(I(R, "notice.readOnly", void 0, O));
|
|
2426
|
+
return;
|
|
2427
|
+
}
|
|
2428
|
+
const k = $();
|
|
2429
|
+
if (!k) return;
|
|
2430
|
+
const A = k.state.selection.main, ee = U.createRelativePositionFromTypeIndex(p.text, A.from), te = U.createRelativePositionFromTypeIndex(p.text, A.to);
|
|
2431
|
+
ce.current?.abort();
|
|
2432
|
+
const fe = new AbortController();
|
|
2433
|
+
ce.current = fe, Ie(!0), be("");
|
|
2434
|
+
try {
|
|
2435
|
+
const se = l?.uploadImage ? await l.uploadImage(u, { signal: fe.signal, onProgress: (ro) => g?.(ro) }) : await P(u);
|
|
2436
|
+
if (fe.signal.aborted || L.current.readOnly || !L.current.mounted) return;
|
|
2437
|
+
const ao = typeof se == "string" ? se : se.path, Fe = p.text.doc, pe = Fe && U.createAbsolutePositionFromRelativePosition(ee, Fe), qe = Fe && U.createAbsolutePositionFromRelativePosition(te, Fe);
|
|
2438
|
+
if (!pe || !qe || pe.type !== p.text || qe.type !== p.text) return;
|
|
2439
|
+
const gt = `![${u.name.replace(/\.[^.]+$/, "")}](${ao})`;
|
|
2440
|
+
k.dispatch({
|
|
2441
|
+
changes: { from: pe.index, to: Math.max(pe.index, qe.index), insert: gt },
|
|
2442
|
+
selection: { anchor: pe.index + gt.length }
|
|
2443
|
+
});
|
|
2444
|
+
} catch (se) {
|
|
2445
|
+
!fe.signal.aborted && L.current.mounted && be(se instanceof Error ? se.message : I(R, "notice.uploadFailed", void 0, O));
|
|
2446
|
+
} finally {
|
|
2447
|
+
L.current.mounted && ce.current === fe && (Ie(!1), G.current && (G.current.value = ""));
|
|
2448
|
+
}
|
|
2449
|
+
}, [M, R, O, g, l, p.text, P]);
|
|
2450
|
+
V(() => (L.current.mounted = !0, () => {
|
|
2451
|
+
L.current.mounted = !1, ce.current?.abort(), window.clearTimeout(ke.current), xe.current.forEach((u) => u(null));
|
|
2452
|
+
}), []), io(oe, () => dr(
|
|
2453
|
+
$,
|
|
2454
|
+
p,
|
|
2455
|
+
() => L.current.readOnly || !L.current.mounted,
|
|
2456
|
+
ot,
|
|
2457
|
+
xe.current,
|
|
2458
|
+
at.current,
|
|
2459
|
+
() => {
|
|
2460
|
+
X.current = "source", L.current.mode === "preview" && ae("split");
|
|
2461
|
+
},
|
|
2462
|
+
{
|
|
2463
|
+
capture: it,
|
|
2464
|
+
render: (u) => {
|
|
2465
|
+
rt.current = u, Y.setComments(u), $()?.dispatch({ effects: $e.of(u) }), u.some((k) => k.id === Re.current && !k.resolved && !k.deleted) || Ne(null);
|
|
2466
|
+
},
|
|
2467
|
+
activate: Ne,
|
|
2468
|
+
reveal: (u) => {
|
|
2469
|
+
if (L.current.mode === "preview" || X.current === "preview" && L.current.mode !== "edit") return Y.reveal(u);
|
|
2470
|
+
const k = $(), A = ve(p.doc, p.text, u);
|
|
2471
|
+
return !k || !A ? !1 : (k.dispatch({ selection: { anchor: A.from, head: A.to }, effects: de.scrollIntoView(A.from, { y: "center" }) }), !0);
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
), [p.text, p.undoManager, Y]);
|
|
2475
|
+
const Yt = D.Header || ir, Zt = D.Toolbar || _a, Jt = D.Preview || Oa, Qt = D.Loading || sr, eo = D.Footer || lr, Ue = () => ({
|
|
2476
|
+
view: L.current.mode === "preview" ? "preview" : L.current.mode === "edit" ? "source" : X.current,
|
|
2477
|
+
anchor: it()
|
|
2478
|
+
}), ie = Ue(), Be = $();
|
|
2479
|
+
let ue = ie.view === "preview" ? Y.selectionRect() : null;
|
|
2480
|
+
if (ie.anchor && ie.view === "source" && Be) {
|
|
2481
|
+
const u = Be.coordsAtPos(Be.state.selection.main.from);
|
|
2482
|
+
u && (ue = new DOMRect(u.left, u.top, 0, u.bottom - u.top));
|
|
2483
|
+
}
|
|
2484
|
+
const ft = y && v.length > 0 && !!(ie.anchor && ue), pt = [...B, ...ft ? [] : v], to = pt.length ? /* @__PURE__ */ d(Ft, { actions: pt, context: ie, capture: Ue }) : void 0, ze = z.current?.ownerDocument, oo = Pe((u) => {
|
|
2485
|
+
u.dispatch({ effects: [$e.of(rt.current), Le.of(Re.current)] }), me();
|
|
2486
|
+
}, [me]);
|
|
2487
|
+
return p.ready && we.current === void 0 && (we.current = p.text.toString()), /* @__PURE__ */ S("div", { className: `exmd-editor app-shell ${c}`, style: { height: m }, lang: ya(R), children: [
|
|
2488
|
+
/* @__PURE__ */ d(Yt, { title: E, roomId: K, session: p, locale: R, messages: O }),
|
|
2489
|
+
/* @__PURE__ */ d(Zt, { hostActions: to, readOnly: M, mode: _, onModeChange: ae, onAction: Kt, onUndo: () => {
|
|
2490
|
+
L.current.readOnly || p.undoManager.undo();
|
|
2491
|
+
}, onRedo: () => {
|
|
2492
|
+
L.current.readOnly || p.undoManager.redo();
|
|
2493
|
+
}, onImage: () => {
|
|
2494
|
+
L.current.readOnly || G.current?.click();
|
|
2495
|
+
}, onDiagram: $t, onFormula: Gt, onCodeBlock: Wt, onColor: Xt, locale: R, messages: O }),
|
|
2496
|
+
ft && ze && ue && Tt(/* @__PURE__ */ d(
|
|
2497
|
+
"div",
|
|
2498
|
+
{
|
|
2499
|
+
className: "exmd-selection-toolbar",
|
|
2500
|
+
role: "toolbar",
|
|
2501
|
+
"aria-label": N("selection.toolbar"),
|
|
2502
|
+
style: {
|
|
2503
|
+
position: "fixed",
|
|
2504
|
+
left: Math.max(8, Math.min(ue.left, ze.documentElement.clientWidth - 180)),
|
|
2505
|
+
top: Math.max(8, ue.top - 42),
|
|
2506
|
+
zIndex: 1e3
|
|
2507
|
+
},
|
|
2508
|
+
children: /* @__PURE__ */ d(Ft, { actions: v, context: ie, capture: Ue })
|
|
2509
|
+
}
|
|
2510
|
+
), ze.body),
|
|
2511
|
+
/* @__PURE__ */ d("input", { ref: G, hidden: !0, type: "file", accept: "image/*", onChange: (u) => {
|
|
2512
|
+
Oe(u.target.files?.[0]);
|
|
2513
|
+
} }),
|
|
2514
|
+
(ne || Se) && /* @__PURE__ */ d("div", { className: Se ? "notice error" : "notice", children: ne ? N("notice.uploading") : Se }),
|
|
2515
|
+
/* @__PURE__ */ S("main", { className: `workspace mode-${_}`, onDragOver: (u) => {
|
|
2516
|
+
M || u.preventDefault();
|
|
2517
|
+
}, onDrop: (u) => {
|
|
2518
|
+
if (M) return;
|
|
2519
|
+
const k = [...u.dataTransfer.files].find((A) => A.type.startsWith("image/"));
|
|
2520
|
+
k && (u.preventDefault(), Oe(k));
|
|
2521
|
+
}, onPaste: (u) => {
|
|
2522
|
+
if (M) return;
|
|
2523
|
+
const k = [...u.clipboardData.files].find((A) => A.type.startsWith("image/"));
|
|
2524
|
+
k && (u.preventDefault(), Oe(k));
|
|
2525
|
+
}, children: [
|
|
2526
|
+
/* @__PURE__ */ S("section", { ref: z, className: "editor-pane", hidden: _ === "preview", onPointerDown: () => {
|
|
2527
|
+
X.current = "source", Y.clearSelection();
|
|
2528
|
+
}, onMouseDownCapture: (u) => {
|
|
2529
|
+
const k = H.current?.view;
|
|
2530
|
+
k && Ka(k, u.currentTarget, u.nativeEvent) && (u.preventDefault(), u.stopPropagation());
|
|
2531
|
+
}, "aria-label": N("editor.pane"), children: [
|
|
2532
|
+
/* @__PURE__ */ S("div", { className: "pane-label", children: [
|
|
2533
|
+
/* @__PURE__ */ d("span", { children: "MARKDOWN" }),
|
|
2534
|
+
/* @__PURE__ */ d("span", { children: N("editor.characters", { count: q.length }) })
|
|
2535
|
+
] }),
|
|
2536
|
+
we.current !== void 0 ? /* @__PURE__ */ d(nr, { ref: H, onCreateEditor: oo, value: we.current, extensions: Ht, editable: !M, readOnly: M, basicSetup: rr }) : /* @__PURE__ */ d(Qt, { state: p.state, errorMessage: p.error ? Pa(p.error, R, O) : void 0, locale: R, messages: O })
|
|
2537
|
+
] }),
|
|
2538
|
+
_ !== "edit" && /* @__PURE__ */ S("section", { ref: Q, className: "preview-pane", "aria-busy": re !== q, onPointerDown: () => {
|
|
2539
|
+
X.current = "preview";
|
|
2540
|
+
}, "aria-label": N("preview.pane"), children: [
|
|
2541
|
+
/* @__PURE__ */ S("div", { className: "pane-label", children: [
|
|
2542
|
+
/* @__PURE__ */ d("span", { children: N("preview.label") }),
|
|
2543
|
+
/* @__PURE__ */ d("span", { children: N(re !== q ? "preview.updating" : n && _ === "split" ? "preview.syncScroll" : "preview.live") })
|
|
2544
|
+
] }),
|
|
2545
|
+
/* @__PURE__ */ d(Jt, { value: re, resolveImageUrl: l?.resolveUrl, onImagePreview: w, interaction: Y, locale: R, messages: O })
|
|
2546
|
+
] })
|
|
2547
|
+
] }),
|
|
2548
|
+
/* @__PURE__ */ d(eo, { readOnly: M, locale: R, messages: O })
|
|
2549
|
+
] });
|
|
2550
|
+
});
|
|
2551
|
+
function ir({ title: t, roomId: e, session: o, locale: a, messages: r }) {
|
|
2552
|
+
const s = (n, i) => I(a, n, i, r), c = o.state === "ready" ? /* @__PURE__ */ S(le, { children: [
|
|
2553
|
+
/* @__PURE__ */ d(So, {}),
|
|
2554
|
+
" ",
|
|
2555
|
+
s("status.ready")
|
|
2556
|
+
] }) : o.state === "error" ? /* @__PURE__ */ S(le, { children: [
|
|
2557
|
+
/* @__PURE__ */ d(Ro, {}),
|
|
2558
|
+
" ",
|
|
2559
|
+
s("status.error")
|
|
2560
|
+
] }) : o.state === "disconnected" ? /* @__PURE__ */ S(le, { children: [
|
|
2561
|
+
/* @__PURE__ */ d(Ao, {}),
|
|
2562
|
+
" ",
|
|
2563
|
+
o.ready ? s("status.offlineEditing") : s("status.offline")
|
|
2564
|
+
] }) : /* @__PURE__ */ S(le, { children: [
|
|
2565
|
+
/* @__PURE__ */ d(No, { className: "spin" }),
|
|
2566
|
+
" ",
|
|
2567
|
+
o.state === "syncing" ? s("status.syncing") : s("status.loading")
|
|
2568
|
+
] }), m = s("presence.online", { count: o.collaborators.length });
|
|
2569
|
+
return /* @__PURE__ */ S("header", { className: "topbar", children: [
|
|
2570
|
+
/* @__PURE__ */ S("div", { className: "brand", children: [
|
|
2571
|
+
/* @__PURE__ */ d("span", { className: "brand-mark", children: "墨" }),
|
|
2572
|
+
/* @__PURE__ */ S("div", { children: [
|
|
2573
|
+
/* @__PURE__ */ d("strong", { children: t }),
|
|
2574
|
+
/* @__PURE__ */ d("small", { children: s("header.room", { roomId: e }) })
|
|
2575
|
+
] })
|
|
2576
|
+
] }),
|
|
2577
|
+
/* @__PURE__ */ d("div", { className: `sync-state ${o.state}`, children: c }),
|
|
2578
|
+
/* @__PURE__ */ S("div", { className: "presence", "aria-label": m, children: [
|
|
2579
|
+
/* @__PURE__ */ d("div", { className: "avatars", children: o.collaborators.slice(0, 4).map((n) => /* @__PURE__ */ d("span", { title: n.name, style: { background: n.color }, children: n.name.slice(0, 1) }, n.clientId)) }),
|
|
2580
|
+
/* @__PURE__ */ d("span", { children: m })
|
|
2581
|
+
] })
|
|
2582
|
+
] });
|
|
2583
|
+
}
|
|
2584
|
+
function sr({ errorMessage: t, locale: e, messages: o }) {
|
|
2585
|
+
return /* @__PURE__ */ d("div", { className: "collaboration-loading", children: t || I(e, "loading.document", void 0, o) });
|
|
2586
|
+
}
|
|
2587
|
+
function lr({ readOnly: t, locale: e, messages: o }) {
|
|
2588
|
+
const a = (r) => I(e, r, void 0, o);
|
|
2589
|
+
return /* @__PURE__ */ S("footer", { children: [
|
|
2590
|
+
/* @__PURE__ */ d("span", { children: a("footer.formats") }),
|
|
2591
|
+
/* @__PURE__ */ d("span", { children: a(t ? "footer.readOnly" : "footer.dropImages") })
|
|
2592
|
+
] });
|
|
2593
|
+
}
|
|
2594
|
+
function dr(t, e, o, a, r, s, c, m) {
|
|
2595
|
+
const n = (i, f = {}) => cr(e.text.toString(), i, f, a.current);
|
|
2596
|
+
return {
|
|
2597
|
+
focus: () => t()?.focus(),
|
|
2598
|
+
getMarkdown: () => e.text.toString(),
|
|
2599
|
+
replaceMarkdown: (i, f = {}) => {
|
|
2600
|
+
const l = t();
|
|
2601
|
+
if (!l || o()) return !1;
|
|
2602
|
+
const w = e.text.toString();
|
|
2603
|
+
return f.expectedMarkdown !== void 0 && f.expectedMarkdown !== w || l.state.doc.toString() !== w ? !1 : (i === w || (e.undoManager.stopCapturing(), l.dispatch({ changes: { from: 0, to: l.state.doc.length, insert: i }, selection: { anchor: 0 } }), e.undoManager.stopCapturing()), !0);
|
|
2604
|
+
},
|
|
2605
|
+
getEditorView: t,
|
|
2606
|
+
insertText: (i) => {
|
|
2607
|
+
const f = t();
|
|
2608
|
+
return !f || o() ? !1 : (he(f, i), !0);
|
|
2609
|
+
},
|
|
2610
|
+
find: n,
|
|
2611
|
+
reveal: (i) => {
|
|
2612
|
+
const f = t();
|
|
2613
|
+
return !f || i.revision !== a.current || i.from < 0 || i.to > f.state.doc.length ? !1 : (c(), f.dispatch({ selection: { anchor: i.from, head: i.to }, effects: de.scrollIntoView(i.from, { y: "center" }) }), f.focus(), !0);
|
|
2614
|
+
},
|
|
2615
|
+
replace: (i, f) => {
|
|
2616
|
+
const l = t();
|
|
2617
|
+
return !l || o() || i.revision !== a.current || l.state.sliceDoc(i.from, i.to) !== i.text ? !1 : (e.undoManager.stopCapturing(), l.dispatch({ changes: { from: i.from, to: i.to, insert: f } }), e.undoManager.stopCapturing(), !0);
|
|
2618
|
+
},
|
|
2619
|
+
replaceAll: (i, f, l = {}) => {
|
|
2620
|
+
const w = t();
|
|
2621
|
+
if (!w || o()) return 0;
|
|
2622
|
+
const g = n(i, l);
|
|
2623
|
+
return g.length ? (e.undoManager.stopCapturing(), w.dispatch({ changes: g.map((h) => ({ from: h.from, to: h.to, insert: f })) }), e.undoManager.stopCapturing(), g.length) : 0;
|
|
2624
|
+
},
|
|
2625
|
+
undo: () => o() || !e.undoManager.canUndo() ? !1 : (e.undoManager.undo(), !0),
|
|
2626
|
+
redo: () => o() || !e.undoManager.canRedo() ? !1 : (e.undoManager.redo(), !0),
|
|
2627
|
+
queryFormatState: () => {
|
|
2628
|
+
const f = t()?.state.selection.main;
|
|
2629
|
+
return {
|
|
2630
|
+
selection: { from: f?.from || 0, to: f?.to || 0 },
|
|
2631
|
+
canUndo: !o() && e.undoManager.canUndo(),
|
|
2632
|
+
canRedo: !o() && e.undoManager.canRedo()
|
|
2633
|
+
};
|
|
2634
|
+
},
|
|
2635
|
+
onSelectionChange: (i) => (r.add(i), () => r.delete(i)),
|
|
2636
|
+
renderRemoteSelections: (i) => {
|
|
2637
|
+
const f = t();
|
|
2638
|
+
!f || o() || f.dispatch({ effects: Ee.of(i) });
|
|
2639
|
+
},
|
|
2640
|
+
clearRemoteSelections: () => {
|
|
2641
|
+
t()?.dispatch({ effects: Ee.of([]) });
|
|
2642
|
+
},
|
|
2643
|
+
renderAnchors: m.render,
|
|
2644
|
+
setActiveAnchor: m.activate,
|
|
2645
|
+
clearAnchors: () => {
|
|
2646
|
+
m.render([]), m.activate(null);
|
|
2647
|
+
},
|
|
2648
|
+
onAnchorClick: (i) => (s.add(i), () => s.delete(i)),
|
|
2649
|
+
captureAnchor: m.capture,
|
|
2650
|
+
resolveAnchor: (i) => ve(e.doc, e.text, i),
|
|
2651
|
+
revealAnchor: m.reveal
|
|
2652
|
+
};
|
|
2653
|
+
}
|
|
2654
|
+
function cr(t, e, o, a) {
|
|
2655
|
+
if (!e) return [];
|
|
2656
|
+
const r = o.caseSensitive ? t : t.toLocaleLowerCase(), s = o.caseSensitive ? e : e.toLocaleLowerCase(), c = [];
|
|
2657
|
+
let m = 0;
|
|
2658
|
+
for (; m <= r.length - s.length; ) {
|
|
2659
|
+
const n = r.indexOf(s, m);
|
|
2660
|
+
if (n < 0) break;
|
|
2661
|
+
const i = n + e.length;
|
|
2662
|
+
c.push({ id: `${a}:${n}:${i}`, from: n, to: i, text: t.slice(n, i), revision: a }), m = Math.max(i, n + 1);
|
|
2663
|
+
}
|
|
2664
|
+
return c;
|
|
2665
|
+
}
|
|
2666
|
+
const Mt = "text/markdown;charset=utf-8", mr = 512 * 1024;
|
|
2667
|
+
function _t(t, e) {
|
|
2668
|
+
return { code: "RESOURCE_REFERENCES_PRESERVED", message: I(t, "markdown.resourcePreserved", void 0, e) };
|
|
2669
|
+
}
|
|
2670
|
+
function ur(t) {
|
|
2671
|
+
const e = /* @__PURE__ */ new Set();
|
|
2672
|
+
for (const o of t.matchAll(/\r\n|\r|\n/g)) e.add(o[0] === `\r
|
|
2673
|
+
` ? "crlf" : o[0] === "\r" ? "cr" : "lf");
|
|
2674
|
+
return e.size > 1 ? "mixed" : e.values().next().value || "none";
|
|
2675
|
+
}
|
|
2676
|
+
async function un(t, e = {}) {
|
|
2677
|
+
const o = e.maxBytes ?? mr, a = (f, l) => I(e.locale, f, l, e.messages);
|
|
2678
|
+
if (!Number.isSafeInteger(o) || o < 0) throw new RangeError(a("validation.nonNegativeInteger", { name: "maxBytes" }));
|
|
2679
|
+
const r = (f, l) => ({ ok: !1, error: { code: f, message: l }, warnings: [] });
|
|
2680
|
+
if (!/\.(md|markdown)$/i.test(t.name)) return r("UNSUPPORTED_EXTENSION", a("markdown.unsupportedExtension"));
|
|
2681
|
+
if (t.size > o) return r("FILE_TOO_LARGE", a("markdown.fileTooLarge", { maxBytes: o }));
|
|
2682
|
+
let s;
|
|
2683
|
+
try {
|
|
2684
|
+
s = new Uint8Array(await t.arrayBuffer());
|
|
2685
|
+
} catch {
|
|
2686
|
+
return r("READ_FAILED", a("markdown.readFailed"));
|
|
2687
|
+
}
|
|
2688
|
+
if (s.byteLength > o) return r("FILE_TOO_LARGE", a("markdown.fileTooLarge", { maxBytes: o }));
|
|
2689
|
+
let c;
|
|
2690
|
+
const m = s[0] === 239 && s[1] === 187 && s[2] === 191;
|
|
2691
|
+
try {
|
|
2692
|
+
c = new TextDecoder("utf-8", { fatal: !0, ignoreBOM: !0 }).decode(m ? s.subarray(3) : s);
|
|
2693
|
+
} catch {
|
|
2694
|
+
return r("INVALID_UTF8", a("markdown.invalidUtf8"));
|
|
2695
|
+
}
|
|
2696
|
+
if (c.includes("\0")) return r("BINARY_CONTENT", a("markdown.binary"));
|
|
2697
|
+
const n = ur(c), i = [_t(e.locale, e.messages)];
|
|
2698
|
+
return m && i.unshift({ code: "UTF8_BOM_REMOVED", message: a("markdown.bomRemoved") }), n === "mixed" && i.push({ code: "MIXED_LINE_ENDINGS", message: a("markdown.mixedLineEndings") }), { ok: !0, markdown: c, fileName: t.name, byteLength: s.byteLength, encoding: "utf-8", hadBom: m, lineEndings: n, warnings: i };
|
|
2699
|
+
}
|
|
2700
|
+
function fn(t, e = {}) {
|
|
2701
|
+
const o = zt(t, { fileName: e.fileName, mimeType: Mt, locale: e.locale, messages: e.messages });
|
|
2702
|
+
return { blob: o, fileName: o.name, mimeType: Mt, warnings: [_t(e.locale, e.messages)] };
|
|
2703
|
+
}
|
|
2704
|
+
const pn = "application/pdf", gn = 25 * 1024 * 1024, hn = 100, vn = 4e7, bn = 3e4;
|
|
2705
|
+
class wn extends Error {
|
|
2706
|
+
code;
|
|
2707
|
+
cause;
|
|
2708
|
+
constructor(e, o, a) {
|
|
2709
|
+
super(o), this.name = "PdfFileError", this.code = e, this.cause = a;
|
|
2710
|
+
}
|
|
2711
|
+
}
|
|
2712
|
+
async function xn(t, e = {}) {
|
|
2713
|
+
return (await import("./pdf-file-impl-Hh_4oE89.js")).importPdfFile(t, e);
|
|
2714
|
+
}
|
|
2715
|
+
async function kn(t, e = {}) {
|
|
2716
|
+
return (await import("./pdf-file-impl-Hh_4oE89.js")).exportPdfFile(t, e);
|
|
2717
|
+
}
|
|
2718
|
+
function Fn(t) {
|
|
2719
|
+
je(t.doc);
|
|
2720
|
+
const e = tt(t.doc), o = !t.awareness, a = !t.undoManager, r = t.awareness || new Et(t.doc), s = t.undoManager || new U.UndoManager(e);
|
|
2721
|
+
return {
|
|
2722
|
+
doc: t.doc,
|
|
2723
|
+
text: e,
|
|
2724
|
+
awareness: r,
|
|
2725
|
+
undoManager: s,
|
|
2726
|
+
state: t.state,
|
|
2727
|
+
saveState: t.saveState,
|
|
2728
|
+
ready: t.ready,
|
|
2729
|
+
collaborators: t.collaborators || [],
|
|
2730
|
+
error: t.error,
|
|
2731
|
+
epochId: t.epochId,
|
|
2732
|
+
dispose: () => {
|
|
2733
|
+
a && s.destroy(), o && r.destroy();
|
|
2734
|
+
}
|
|
2735
|
+
};
|
|
2736
|
+
}
|
|
2737
|
+
function yn(t, e) {
|
|
2738
|
+
return { ...t, ...e };
|
|
2739
|
+
}
|
|
2740
|
+
function Pn(t, e) {
|
|
2741
|
+
const o = (a, r, s, c) => {
|
|
2742
|
+
const m = Array.from(c.changedParentTypes.keys()).some((n) => Object.is(n, t.text));
|
|
2743
|
+
!c.local || r === Te.bootstrap || r === Te.remote || !m || e({ update: a, origin: r, transaction: c });
|
|
2744
|
+
};
|
|
2745
|
+
return t.doc.on("update", o), () => t.doc.off("update", o);
|
|
2746
|
+
}
|
|
2747
|
+
function Mn(t, e) {
|
|
2748
|
+
U.applyUpdate(t, e, Te.remote);
|
|
2749
|
+
}
|
|
2750
|
+
const Dn = Object.freeze({
|
|
2751
|
+
protocolVersion: Xa,
|
|
2752
|
+
codec: Qe,
|
|
2753
|
+
schemaVersion: et,
|
|
2754
|
+
textRoot: "markdown",
|
|
2755
|
+
find: { literal: !0, caseSensitive: !0, regex: !1 },
|
|
2756
|
+
permanentTextAnchors: !0,
|
|
2757
|
+
remoteCarets: !0,
|
|
2758
|
+
commentDecorations: !0,
|
|
2759
|
+
previewTextAnchors: !0,
|
|
2760
|
+
previewCommentDecorations: !0,
|
|
2761
|
+
hostSelectionActions: !0,
|
|
2762
|
+
anchorKind: "markdown-text-range",
|
|
2763
|
+
anchorBoundary: "exclude-both"
|
|
2764
|
+
});
|
|
2765
|
+
export {
|
|
2766
|
+
ya as A,
|
|
2767
|
+
sn as B,
|
|
2768
|
+
Xa as C,
|
|
2769
|
+
gn as D,
|
|
2770
|
+
fn as E,
|
|
2771
|
+
kn as F,
|
|
2772
|
+
tt as G,
|
|
2773
|
+
Bt as H,
|
|
2774
|
+
un as I,
|
|
2775
|
+
xn as J,
|
|
2776
|
+
Za as K,
|
|
2777
|
+
Pn as L,
|
|
2778
|
+
Qe as M,
|
|
2779
|
+
Ut as N,
|
|
2780
|
+
Ct as O,
|
|
2781
|
+
wn as P,
|
|
2782
|
+
ve as Q,
|
|
2783
|
+
nn as R,
|
|
2784
|
+
I as S,
|
|
2785
|
+
Te as T,
|
|
2786
|
+
yn as U,
|
|
2787
|
+
dn as V,
|
|
2788
|
+
Qa as W,
|
|
2789
|
+
pn as a,
|
|
2790
|
+
rn as b,
|
|
2791
|
+
bn as c,
|
|
2792
|
+
hn as d,
|
|
2793
|
+
vn as e,
|
|
2794
|
+
Ca as f,
|
|
2795
|
+
mn as g,
|
|
2796
|
+
La as h,
|
|
2797
|
+
ln as i,
|
|
2798
|
+
mr as j,
|
|
2799
|
+
lr as k,
|
|
2800
|
+
ir as l,
|
|
2801
|
+
sr as m,
|
|
2802
|
+
Mt as n,
|
|
2803
|
+
Dn as o,
|
|
2804
|
+
et as p,
|
|
2805
|
+
Oa as q,
|
|
2806
|
+
Ma as r,
|
|
2807
|
+
_a as s,
|
|
2808
|
+
Mn as t,
|
|
2809
|
+
je as u,
|
|
2810
|
+
Fn as v,
|
|
2811
|
+
zt as w,
|
|
2812
|
+
Nt as x,
|
|
2813
|
+
Va as y,
|
|
2814
|
+
cn as z
|
|
2815
|
+
};
|