@baishuyun/ui-mobile 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AMap/index.js +1 -1
- package/dist/ActionSheet/index.js +1 -1
- package/dist/Calendar/{Calendar-Cf81JVOC.js → Calendar-Bs1aP8-o.js} +1 -1
- package/dist/Calendar/index.js +3 -3
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/Editor/{Editor-CfA-ye-u.js → Editor-DacCT187.js} +647 -448
- package/dist/Editor/index.js +2 -2
- package/dist/Gantt/index.js +1 -1
- package/dist/Icon/index.js +1 -1
- package/dist/Overlay/index.js +1 -1
- package/dist/Popup/index.js +1 -1
- package/dist/Segmented/{Segmented-CxQ3Pd05.js → Segmented-PwHjDHry.js} +9 -9
- package/dist/Segmented/index.js +2 -2
- package/dist/components/Editor/Thinking.d.ts +1 -3
- package/dist/components/Editor/hooks/useAiPreviewHtml.d.ts +7 -0
- package/dist/components/Editor/hooks/useAutoScroll.d.ts +9 -0
- package/dist/components/Editor/hooks/useEditorAiSession.d.ts +1 -5
- package/dist/components/Editor/hooks/useEditorImageUpload.d.ts +1 -1
- package/dist/components/Editor/interface.d.ts +2 -0
- package/dist/components/Editor/nodes/ImageNode.d.ts +5 -2
- package/dist/components/Editor/popups/AiResultPopup.d.ts +2 -1
- package/dist/components/Editor/utils/applyAiPolish.d.ts +0 -1
- package/dist/components/Editor/utils/applyAiTypeset.d.ts +4 -0
- package/dist/components/Editor/utils/placeProgrammaticCaret.d.ts +3 -1
- package/dist/components/Editor/utils/prepareTypesetProposed.d.ts +1 -0
- package/dist/components/Editor/utils/readEditorAiSnapshot.d.ts +3 -2
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/dist/vendors/{version-C0got4sp.js → version-CTRMhnVV.js} +1 -1
- package/package.json +3 -2
|
@@ -8,10 +8,10 @@ import { useEventListener as h } from "ahooks";
|
|
|
8
8
|
import { LexicalComposer as g } from "@lexical/react/LexicalComposer";
|
|
9
9
|
import { $createLinkNode as _, $isLinkNode as v, $toggleLink as y, AutoLinkNode as b, LinkNode as x } from "@lexical/link";
|
|
10
10
|
import { $isListItemNode as S, $isListNode as C, INSERT_ORDERED_LIST_COMMAND as w, INSERT_UNORDERED_LIST_COMMAND as T, ListItemNode as E, ListNode as D, REMOVE_LIST_COMMAND as O } from "@lexical/list";
|
|
11
|
-
import { $createCodeHighlightNode as k, $isCodeHighlightNode as A, $isCodeNode as j, $plainifyCodeContent as ee, CodeHighlightNode as
|
|
11
|
+
import { $createCodeHighlightNode as k, $isCodeHighlightNode as A, $isCodeNode as j, $plainifyCodeContent as ee, CodeHighlightNode as M, CodeNode as te, registerCodeIndentation as ne } from "@lexical/code-core";
|
|
12
12
|
import { $createHeadingNode as re, $isHeadingNode as ie, HeadingNode as ae } from "@lexical/rich-text";
|
|
13
13
|
import { $findCellNode as oe, $isTableCellNode as se, $isTableNode as N, $isTableRowNode as ce, TableCellNode as le, TableNode as ue, TableRowNode as de, registerTableCellUnmergeTransform as fe, registerTablePlugin as pe, registerTableSelectionObserver as me, setScrollableTablesActive as he } from "@lexical/table";
|
|
14
|
-
import { $applyNodeReplacement as ge, $createLineBreakNode as _e, $createParagraphNode as P, $createTabNode as ve, $createTextNode as ye, $getNodeByKey as
|
|
14
|
+
import { $applyNodeReplacement as ge, $createLineBreakNode as _e, $createParagraphNode as P, $createTabNode as ve, $createTextNode as ye, $getNodeByKey as F, $getRoot as I, $getSelection as L, $insertNodes as be, $isElementNode as xe, $isLineBreakNode as Se, $isRangeSelection as R, $isRootOrShadowRoot as Ce, $isTabNode as we, $isTextNode as Te, $nodesOfType as Ee, $onUpdate as De, $setSelection as Oe, BLUR_COMMAND as ke, COMMAND_PRIORITY_HIGH as Ae, COMMAND_PRIORITY_LOW as je, DROP_COMMAND as Me, DecoratorNode as Ne, FOCUS_COMMAND as Pe, FORMAT_ELEMENT_COMMAND as Fe, FORMAT_TEXT_COMMAND as Ie, HISTORY_MERGE_TAG as Le, INDENT_CONTENT_COMMAND as Re, KEY_ENTER_COMMAND as ze, KEY_TAB_COMMAND as Be, OUTDENT_CONTENT_COMMAND as Ve, PASTE_COMMAND as He, PASTE_TAG as Ue, TextNode as We, isHTMLElement as Ge, mergeRegister as Ke } from "lexical";
|
|
15
15
|
import { ContentEditable as qe } from "@lexical/react/LexicalContentEditable";
|
|
16
16
|
import { HistoryPlugin as Je } from "@lexical/react/LexicalHistoryPlugin";
|
|
17
17
|
import { LinkPlugin as Ye } from "@lexical/react/LexicalLinkPlugin";
|
|
@@ -219,18 +219,123 @@ var st = [
|
|
|
219
219
|
"bsy-mobile-editor__ai-error": "_bsy-mobile-editor__ai-error_mpjz5_826",
|
|
220
220
|
"bsy-mobile-editor__ai-footer": "_bsy-mobile-editor__ai-footer_mpjz5_831",
|
|
221
221
|
"bsy-mobile-editor__ai-footer-ok": "_bsy-mobile-editor__ai-footer-ok_mpjz5_853"
|
|
222
|
-
}, _t =
|
|
222
|
+
}, _t = {
|
|
223
|
+
typeset: [
|
|
224
|
+
"你是一名专业的 HTML 文档排版引擎。输入已是 HTML 片段。",
|
|
225
|
+
"任务:在不改内容层(措辞、语序、修辞、情感色彩)的前提下,做形式层 + 视觉层优化,充分利用富文本能力(标题、列表、加粗、字色、背景色、缩进、对齐)。",
|
|
226
|
+
"",
|
|
227
|
+
"【核心原则】",
|
|
228
|
+
"1. 清洁:物理勘误(OCR 误触)、空格/标点治理。",
|
|
229
|
+
"2. 结构:语义化标签(p / h1 / h2 / h3 / ul / ol / 联系方式分行)。",
|
|
230
|
+
"3. 视觉:为标题、小节名、关键词、联系方式、并列项增加加粗、颜色、浅底、缩进。可以新增强调,不要求原文先有引号或加粗。",
|
|
231
|
+
"绝对禁止:重写句子、替换同义词、删改口语词/语气词(如「哈哈」「傻死了」)、调整叙事顺序。",
|
|
232
|
+
"",
|
|
233
|
+
"【允许的排版操作】",
|
|
234
|
+
"1. 断句与分段:",
|
|
235
|
+
" - 无标点连写长句按语义切成短句,切分处可补「。」或「,」。",
|
|
236
|
+
" - 每个独立语义块用 <p> 包裹。",
|
|
237
|
+
" - 不得调换语义块先后顺序;允许同一语义流内断句分段。",
|
|
238
|
+
"2. 标点规范化:",
|
|
239
|
+
" - 「!!!!」→「!」,「。。。」→「。」,「,,,」→「,」。",
|
|
240
|
+
" - 中文语境下「,」→「,」、「.」→「。」;英文缩写、小数、网址、邮箱中的「.」「,」不改。",
|
|
241
|
+
"3. 空格治理:",
|
|
242
|
+
" - 删除汉字之间无意义空格;保留英文词间空格。",
|
|
243
|
+
" - 中英混排时,英文单词前后各留一个半角空格。",
|
|
244
|
+
"4. 物理勘误:",
|
|
245
|
+
" - 仅当上下文能唯一判定时,修正 0/O、1/l/I 等误触。",
|
|
246
|
+
" - 不修正拼写(「监介」必须保留)。",
|
|
247
|
+
"5. 结构标签化:",
|
|
248
|
+
" - 篇名/主标题用 <h1>,小节用 <h2>,更小的小标题用 <h3>。正文用 <p>。一篇里主标题通常只有一个 h1。",
|
|
249
|
+
" - 并列项用 <ul>/<ol> + <li>。",
|
|
250
|
+
" - 联系方式(电话/邮箱/地址)用 <p> 分行,除勘误外不改字符。",
|
|
251
|
+
" - 已有 a / img / table / strong / em / u / s / span 必须保留语义,可调整包裹层级。",
|
|
252
|
+
" - 表格单元格可以排版,不得删改实质内容。",
|
|
253
|
+
"6. 视觉增强(鼓励,且必须用内联 style;禁止 markdown):",
|
|
254
|
+
" - 小节名、分类标签、原文已强调的词:<strong>。禁止 **加粗**、## 标题、- 列表、[text](url)、围栏。",
|
|
255
|
+
" - 标题、关键数字、电话/邮箱:可给 span 加 color。",
|
|
256
|
+
" - 需要扫读的关键词:给 span 加 background-color 浅底。对:<span style=\"background-color:#fff4cd\">关键词</span>。错:<p style=\"background-color:#f0f6ff\">整段</p>。",
|
|
257
|
+
" - 背景色只能写在 span 上(短语级),禁止写在 p / h1-h3 / ul / ol / li。",
|
|
258
|
+
" - 段落/标题缩进只用 padding-inline-start,且必须是 40px 的倍数(与编辑器「增加缩进」一致)。",
|
|
259
|
+
" - 列表缩进只写在 ul/ol 的 padding-inline-start(通常 24px),不要写到 p/li 的 padding。",
|
|
260
|
+
" - 颜色用任意合法 CSS 色值即可(#RGB、#RRGGBB、rgb())。同一篇里主色不超过 2 种强调色,正文保持深色可读。",
|
|
261
|
+
" - span 仅可用于 color / font-size / background-color。",
|
|
262
|
+
" - p / h1-h3 仅可用于 text-align / padding-inline-start。",
|
|
263
|
+
" - 禁止 padding(四边)、padding-top/right/bottom/left、border-radius、margin、box-shadow、border(td/th 除外)。编辑器不能给段落设内边距、圆角或背景色。",
|
|
264
|
+
"",
|
|
265
|
+
"【绝对红线】",
|
|
266
|
+
"- 不得增删实质性单词、数字、年份、名称。",
|
|
267
|
+
"- 不得删除括号、注释、语气词。",
|
|
268
|
+
"- 不得把口语改成书面语。",
|
|
269
|
+
"- 必须原样保留所有 <!--bsy-code-N-->;禁止新增、删除或改写 pre、code、data-language。",
|
|
270
|
+
"- 禁止编造或改写 img 的 src。",
|
|
271
|
+
"",
|
|
272
|
+
"【输出格式】",
|
|
273
|
+
"只输出纯净 HTML 片段。禁止 markdown 围栏(``` / ```html)、xml 声明、解释性前后文。",
|
|
274
|
+
"加粗用 <strong>,主标题用 <h1>,小节用 <h2>/<h3>,列表用 <ul>/<ol>。",
|
|
275
|
+
"允许标签:p, br, h1, h2, h3, ul, ol, li, strong, em, b, i, u, s, span, a, img, table, thead, tbody, tr, td, th, sub, sup。"
|
|
276
|
+
],
|
|
277
|
+
polishSystem: /* @__PURE__ */ "你是多语言语义层编辑引擎,只管「意」,不管「版式」(缩进、字体样式、HTML 标签)。,输入是按块切开的纯文本,可能包含任意语言(中文、英文、日文、代码注释、混合文本)。独立代码块不会出现在输入里。,输出仅润色后的纯文本,不加引号、标签或解释。,,【块结构(必须遵守)】,- 输入用 <!--bsy-block--> 分成若干块。一块对应编辑器里的一个标题或段落,顺序就是阅读顺序。,- 输出必须块数相同、顺序相同,并原样保留 <!--bsy-block-->。,- 禁止把两块合成一块,也禁止把一块拆成两块。,- 整块都是套话:该块输出为空,不要把文字并进前后块。,- 断句、加标点、删字只允许发生在块内。,- 不要跨块交换事实(电话、地址、日期、金额不要挪到别的块)。,- <!--bsy-block--> 不是版式,必须原样保留;分隔符周围的空行也不要删。,,【语言自适应处理】,- 自动识别输入文本的主语言(或混合语言比例)。,- 润色时,仅对该语言的语法、措辞、语气进行优化,绝对不跨语言串改(例如:不要把英文短句改成中文中式英语)。,- 专有名词(人名、地名、品牌名)、年份、固定术语保留原语言原字符,不进行翻译或音译。,,【受保护内容隔离区(绝对红线)】,以下内容不做语序或措辞调整;允许明显的 OCR/键盘字符级勘误(如 0 与 O、1 与 l),不要改空格布局。,1. 数学公式与符号:包括但不限于 = + - * / ^ _ { } ( ) [ ],以及 LaTeX 片段(如 E=mc^2、\\frac{a}{b})。,2. 计量单位与数值:如 10kg、$99.99、2026-08-26、99.9%。,3. 混在正文里的路径、命令、行内代码(如 /usr/bin/python)。独立代码块不在输入中。,4. 邮箱地址、网址(URL)、IP 地址:不要改域名或结构。,5. 化学式(H₂O)、物理量符号(λ、Δ)。,,【标点与断句(特殊允许)】,- 根据检测到的语言使用对应的标准标点(中文用中文标点,英文用英文标点)。,- 允许在块内添加/修改句号、逗号、感叹号、问号,用于断句和表达语气。,- 合并连续重复标点(如「!!!!」→「!」或「!!!!」→「!」)。,,【废话分级删除规则】,- 无意义套话(如「如有雷同纯属巧合」「最终解释权归本公司所有」)→ 直接删除。,- 无具体主体的万能版权模板(如单独一行 All rights reserved)可删;带年份或公司名的版权行保留。,- 冗余语气缓冲词(如「说实话」「我个人觉得」「I think」)→ 仅当语气为 formal / literary 时删除;为 colloquial / lively 时保留。,,【勘误优先级(必读)】,- 第一步:物理勘误(仅限明显的 OCR/键盘误触:如数字 0 写成字母 O、数字 1 写成 l/I,全角英文数字改成半角),直接修正。,- 第二步:措辞润色,但绝不修改第一步修正后的数字、年份、公式符号。,,【风格一致性约束】,- 全篇人称/敬语必须统一(中文:你/您;英文:you 与对应敬语;日文:です/ます调)。,- 禁止改变原文的事实性数据(数字、日期、金额、单位)。".split(","),
|
|
278
|
+
polish: {
|
|
279
|
+
quick: "语气:轻微改通顺,保持原意和人称。\n规则:尽量不改词,仅补充标点和必要连词;保护区原样保留。",
|
|
280
|
+
formal: "语气:更正式、书面(适配任意语言的标准书面体)。\n规则:删除口语词(啊/哦/啦/yeah/well),替换为客观陈述;数字原则上保持阿拉伯数字,不拼写为单词。",
|
|
281
|
+
colloquial: "语气:更口语、自然(适配日常聊天、社交媒体)。\n规则:保留语气词、感叹词,允许短句和不完整句,保留重复强调词(哈哈/haha/すごい)。",
|
|
282
|
+
lively: "语气:更生动、有画面感。\n规则:适当添加形容词和程度副词,但禁止虚构事实数据。",
|
|
283
|
+
literary: "语气:更书面、文学感(适配小说、散文、高级文案)。\n规则:若主语言为中文,允许四字格;若为英文,允许复杂从句和排比;不改变原风格基调。",
|
|
284
|
+
retro: "语气:带一点复古书面色彩,仍保持现代可读。\n规则:仅当主语言为中文时生效:仿民国白话风(之/其/乃);其他语言自动降级为 literary。"
|
|
285
|
+
}
|
|
286
|
+
}, vt = _t.typeset.join("\n"), yt = _t.polishSystem.join("\n"), bt = (e) => `${yt}\n\n【本轮风格】\n${_t.polish[e] ?? _t.polish.quick}`, xt = (e) => {
|
|
287
|
+
if (!e.trim()) return {
|
|
288
|
+
html: e,
|
|
289
|
+
blocks: []
|
|
290
|
+
};
|
|
291
|
+
let t = new DOMParser().parseFromString(e, "text/html"), n = [], r = Array.from(t.body.querySelectorAll("pre"));
|
|
292
|
+
for (let e of r) {
|
|
293
|
+
n.push(e.outerHTML);
|
|
294
|
+
let r = t.createComment(`bsy-code-${n.length - 1}`);
|
|
295
|
+
e.replaceWith(r);
|
|
296
|
+
}
|
|
297
|
+
return {
|
|
298
|
+
html: t.body.innerHTML,
|
|
299
|
+
blocks: n
|
|
300
|
+
};
|
|
301
|
+
}, St = "<!--bsy-block-->", Ct = /<!--bsy-code-(\d+)-->/g, wt = "bsy-html-root", Tt = (e) => new DOMParser().parseFromString(`<${wt}>${e}</${wt}>`, "text/html").body.querySelector(wt), Et = (e, t) => {
|
|
302
|
+
if (!t.length) return e;
|
|
303
|
+
let n = /* @__PURE__ */ new Set(), r = e.replace(Ct, (e, r) => {
|
|
304
|
+
let i = Number(r), a = t[i];
|
|
305
|
+
return a === void 0 ? "" : (n.add(i), a);
|
|
306
|
+
}), i = t.filter((e, t) => !n.has(t)).join("");
|
|
307
|
+
return i ? `${r}${i}` : r;
|
|
308
|
+
}, Dt = (e) => {
|
|
309
|
+
if (!/<pre[\s>/]/i.test(e)) return e;
|
|
310
|
+
let t = Tt(e);
|
|
311
|
+
if (!t) return e;
|
|
312
|
+
let n = t.ownerDocument;
|
|
313
|
+
for (let e of Array.from(t.querySelectorAll("pre"))) {
|
|
314
|
+
let t = n.createComment("bsy-code-dropped");
|
|
315
|
+
e.replaceWith(t);
|
|
316
|
+
}
|
|
317
|
+
return t.innerHTML.replace(/<!--bsy-code-dropped-->/g, "");
|
|
318
|
+
}, Ot = (e, t) => Et(Dt(e), t), kt = "p, h1, h2, h3, li", At = /background(-color)?\s*:/i, jt = (e) => {
|
|
319
|
+
if (!e.trim() || !At.test(e)) return e;
|
|
320
|
+
let t = Tt(e);
|
|
321
|
+
if (!t) return e;
|
|
322
|
+
for (let e of Array.from(t.querySelectorAll(kt))) {
|
|
323
|
+
let t = e;
|
|
324
|
+
t.style.removeProperty("background-color"), t.style.removeProperty("background"), t.getAttribute("style")?.trim() || t.removeAttribute("style");
|
|
325
|
+
}
|
|
326
|
+
return t.innerHTML;
|
|
327
|
+
}, Mt = [
|
|
223
328
|
"color",
|
|
224
329
|
"background-color",
|
|
225
330
|
"font-size",
|
|
226
331
|
"font-family",
|
|
227
332
|
"font-weight",
|
|
228
333
|
"text-decoration"
|
|
229
|
-
],
|
|
334
|
+
], Nt = (e) => {
|
|
230
335
|
let t = e.body.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, td, th");
|
|
231
336
|
for (let n of Array.from(t)) {
|
|
232
337
|
let t = n, r = [];
|
|
233
|
-
for (let e of
|
|
338
|
+
for (let e of Mt) {
|
|
234
339
|
let n = t.style.getPropertyValue(e);
|
|
235
340
|
n && (r.push(`${e}: ${n}`), t.style.removeProperty(e));
|
|
236
341
|
}
|
|
@@ -248,32 +353,34 @@ var st = [
|
|
|
248
353
|
}
|
|
249
354
|
}
|
|
250
355
|
}
|
|
251
|
-
},
|
|
252
|
-
let n =
|
|
356
|
+
}, Pt = (e, t) => {
|
|
357
|
+
let n = I();
|
|
253
358
|
if (n.clear(), t.trim()) {
|
|
254
359
|
let r = new DOMParser().parseFromString(t, "text/html");
|
|
255
|
-
|
|
360
|
+
Nt(r);
|
|
256
361
|
let i = tt(e, r);
|
|
257
362
|
if (i.length) {
|
|
258
|
-
n.select(),
|
|
363
|
+
n.select(), be(i), Oe(null);
|
|
259
364
|
return;
|
|
260
365
|
}
|
|
261
366
|
}
|
|
262
367
|
let r = P();
|
|
263
|
-
n.append(r),
|
|
264
|
-
},
|
|
368
|
+
n.append(r), Oe(null);
|
|
369
|
+
}, Ft = (e) => {
|
|
265
370
|
if (e) {
|
|
266
|
-
|
|
371
|
+
I().selectStart();
|
|
267
372
|
return;
|
|
268
373
|
}
|
|
269
|
-
|
|
270
|
-
},
|
|
271
|
-
|
|
374
|
+
Oe(null);
|
|
375
|
+
}, It = (e) => {
|
|
376
|
+
e && Oe(e.clone());
|
|
377
|
+
}, Lt = () => {
|
|
378
|
+
L() === null && I().selectStart();
|
|
272
379
|
}, H = (e) => {
|
|
273
380
|
e.isEditable() || e.setEditable(!0), e.update(() => {
|
|
274
|
-
|
|
381
|
+
Lt();
|
|
275
382
|
}), e.focus(void 0, { defaultSelection: "rootStart" });
|
|
276
|
-
},
|
|
383
|
+
}, Rt = (e, t) => !t.trim() && (e === "<p><br></p>" || e === "<p></p>" || e === "" || /^<p>\s*<br>\s*<\/p>$/.test(e)), zt = /* @__PURE__ */ "p.br.strong.em.b.i.u.s.span.sub.sup.ul.ol.li.a.img.pre.code.table.thead.tbody.tr.td.th.h1.h2.h3.h4.h5.h6".split("."), Bt = [
|
|
277
384
|
"href",
|
|
278
385
|
"src",
|
|
279
386
|
"alt",
|
|
@@ -284,16 +391,17 @@ var st = [
|
|
|
284
391
|
"rowspan",
|
|
285
392
|
"data-language",
|
|
286
393
|
"data-id",
|
|
394
|
+
"data-src",
|
|
287
395
|
"class",
|
|
288
396
|
"style",
|
|
289
397
|
"width",
|
|
290
398
|
"height"
|
|
291
|
-
],
|
|
399
|
+
], Vt = new Set(/* @__PURE__ */ "color.background-color.font-size.font-family.font-weight.font-style.text-decoration.text-align.max-width.display.vertical-align.width.height.border.margin.padding.padding-inline-start.line-height.list-style-type.list-style-position.list-style.border-collapse.table-layout.overflow-x.white-space.position.top.bottom.tab-size.border-radius.box-sizing.min-width.min-height.cursor".split(".")), Ht = /^(?:(?:(?:f|ht)tps?|mailto|blob):|data:image\/[a-z0-9.+-]+[;,].*|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i, Ut = new Set([
|
|
292
400
|
"pre",
|
|
293
401
|
"code",
|
|
294
402
|
"td",
|
|
295
403
|
"th"
|
|
296
|
-
]),
|
|
404
|
+
]), Wt = new Set(["pre", "code"]), Gt = new Set(["sup", "sub"]), Kt = (e, t) => Vt.has(e) ? e === "padding-inline-start" ? !0 : e === "padding" || e.startsWith("padding-") ? Ut.has(t) : e === "border-radius" ? Wt.has(t) : e === "position" || e === "top" || e === "bottom" ? Gt.has(t) : !0 : !1, qt = (e, t) => e.split(";").map((e) => e.trim()).filter(Boolean).map((e) => {
|
|
297
405
|
let n = e.indexOf(":");
|
|
298
406
|
if (n === -1) return null;
|
|
299
407
|
let r = e.slice(0, n).trim().toLowerCase(), i = e.slice(n + 1).trim();
|
|
@@ -301,26 +409,30 @@ var st = [
|
|
|
301
409
|
if (/url\s*\(/i.test(i)) return null;
|
|
302
410
|
r = "background-color";
|
|
303
411
|
}
|
|
304
|
-
return !
|
|
305
|
-
}).filter((e) => e !== null).join("; "),
|
|
306
|
-
|
|
412
|
+
return !Kt(r, t) || /expression|javascript:|url\s*\(\s*['"]?\s*javascript/i.test(i) ? null : `${r}: ${i}`;
|
|
413
|
+
}).filter((e) => e !== null).join("; "), Jt = !1, Yt = () => {
|
|
414
|
+
Jt ||= (nt.addHook("uponSanitizeAttribute", (e, t) => {
|
|
307
415
|
if (t.attrName === "href" && /^data:/i.test(t.attrValue)) {
|
|
308
416
|
t.keepAttr = !1;
|
|
309
417
|
return;
|
|
310
418
|
}
|
|
311
|
-
t.attrName === "style" && (t.attrValue =
|
|
419
|
+
t.attrName === "style" && (t.attrValue = qt(t.attrValue, e.nodeName.toLowerCase()), t.attrValue || (t.keepAttr = !1));
|
|
312
420
|
}), !0);
|
|
313
|
-
}, U = (e) => e ? (
|
|
314
|
-
ALLOWED_TAGS:
|
|
315
|
-
ALLOWED_ATTR:
|
|
421
|
+
}, U = (e) => e ? (Yt(), nt.sanitize(e, {
|
|
422
|
+
ALLOWED_TAGS: zt,
|
|
423
|
+
ALLOWED_ATTR: Bt,
|
|
316
424
|
ALLOW_DATA_ATTR: !1,
|
|
317
|
-
ADD_ATTR: [
|
|
318
|
-
|
|
425
|
+
ADD_ATTR: [
|
|
426
|
+
"data-language",
|
|
427
|
+
"data-id",
|
|
428
|
+
"data-src"
|
|
429
|
+
],
|
|
430
|
+
ALLOWED_URI_REGEXP: Ht
|
|
319
431
|
})) : "", W = {
|
|
320
432
|
margin: "0.6em 0 0.4em",
|
|
321
433
|
"font-weight": "600",
|
|
322
434
|
"line-height": "1.35"
|
|
323
|
-
},
|
|
435
|
+
}, Xt = {
|
|
324
436
|
h1: {
|
|
325
437
|
...W,
|
|
326
438
|
"font-size": "2em"
|
|
@@ -345,24 +457,24 @@ var st = [
|
|
|
345
457
|
...W,
|
|
346
458
|
"font-size": "0.875em"
|
|
347
459
|
}
|
|
348
|
-
},
|
|
460
|
+
}, Zt = {
|
|
349
461
|
color: "#0269ff",
|
|
350
462
|
cursor: "pointer"
|
|
351
|
-
},
|
|
463
|
+
}, Qt = {
|
|
352
464
|
margin: "0",
|
|
353
465
|
"padding-inline-start": "24px",
|
|
354
466
|
"list-style-position": "outside"
|
|
355
|
-
},
|
|
467
|
+
}, $t = [
|
|
356
468
|
"disc",
|
|
357
469
|
"circle",
|
|
358
470
|
"square"
|
|
359
|
-
],
|
|
471
|
+
], en = {
|
|
360
472
|
margin: "0",
|
|
361
473
|
"list-style": "inherit"
|
|
362
|
-
},
|
|
474
|
+
}, tn = {
|
|
363
475
|
margin: "0",
|
|
364
476
|
"list-style-type": "none"
|
|
365
|
-
},
|
|
477
|
+
}, nn = {
|
|
366
478
|
display: "block",
|
|
367
479
|
"box-sizing": "border-box",
|
|
368
480
|
"max-width": "100%",
|
|
@@ -377,23 +489,23 @@ var st = [
|
|
|
377
489
|
"border-radius": "4px",
|
|
378
490
|
"background-color": "rgb(240, 242, 245)",
|
|
379
491
|
color: "#1f2328"
|
|
380
|
-
},
|
|
492
|
+
}, rn = {
|
|
381
493
|
"border-collapse": "collapse",
|
|
382
494
|
"table-layout": "fixed",
|
|
383
495
|
width: "100%",
|
|
384
496
|
"overflow-x": "auto",
|
|
385
497
|
margin: "8px 0"
|
|
386
|
-
},
|
|
498
|
+
}, an = {
|
|
387
499
|
"box-sizing": "border-box",
|
|
388
500
|
"min-width": "75px",
|
|
389
501
|
"min-height": "32px",
|
|
390
502
|
padding: "4px 8px",
|
|
391
503
|
border: "1px solid #d9d9d9",
|
|
392
504
|
"vertical-align": "top"
|
|
393
|
-
},
|
|
505
|
+
}, on = {
|
|
394
506
|
"font-weight": "600",
|
|
395
507
|
"background-color": "#f2f3f5"
|
|
396
|
-
},
|
|
508
|
+
}, sn = {
|
|
397
509
|
display: "inline-block",
|
|
398
510
|
position: "static",
|
|
399
511
|
top: "auto",
|
|
@@ -402,38 +514,38 @@ var st = [
|
|
|
402
514
|
"line-height": "1"
|
|
403
515
|
}, G = (e, t) => {
|
|
404
516
|
for (let [n, r] of Object.entries(t)) e.style.getPropertyValue(n) || e.style.setProperty(n, r);
|
|
405
|
-
},
|
|
517
|
+
}, cn = (e) => {
|
|
406
518
|
let t = 0, n = e;
|
|
407
519
|
for (; n;) n.tagName === "UL" && (t += 1), n = n.parentElement;
|
|
408
520
|
return t;
|
|
409
|
-
},
|
|
521
|
+
}, ln = (e) => {
|
|
410
522
|
for (let t of Array.from(e.querySelectorAll("*"))) {
|
|
411
523
|
if (!(t instanceof HTMLElement)) continue;
|
|
412
|
-
let e = t.tagName.toLowerCase(), n =
|
|
413
|
-
if (n && G(t, n), e === "a" && G(t,
|
|
414
|
-
let e = Math.min(Math.max(
|
|
524
|
+
let e = t.tagName.toLowerCase(), n = Xt[e];
|
|
525
|
+
if (n && G(t, n), e === "a" && G(t, Zt), e === "ul") {
|
|
526
|
+
let e = Math.min(Math.max(cn(t), 1), $t.length);
|
|
415
527
|
G(t, {
|
|
416
|
-
...
|
|
417
|
-
"list-style-type":
|
|
528
|
+
...Qt,
|
|
529
|
+
"list-style-type": $t[e - 1]
|
|
418
530
|
});
|
|
419
531
|
}
|
|
420
532
|
e === "ol" && G(t, {
|
|
421
|
-
...
|
|
533
|
+
...Qt,
|
|
422
534
|
"list-style-type": "decimal"
|
|
423
|
-
}), e === "li" && G(t, t.classList.contains("editor-nested-listitem") ?
|
|
424
|
-
...
|
|
535
|
+
}), e === "li" && G(t, t.classList.contains("editor-nested-listitem") ? tn : en), e === "pre" && G(t, nn), (e === "sup" || e === "sub") && G(t, {
|
|
536
|
+
...sn,
|
|
425
537
|
"vertical-align": e === "sup" ? "super" : "sub"
|
|
426
|
-
}), e === "table" && G(t,
|
|
538
|
+
}), e === "table" && G(t, rn), (e === "td" || e === "th") && (G(t, an), (e === "th" || t.classList.contains("editor-table-cell-header")) && G(t, on)), t.classList.contains("editor-text-underline-strikethrough") ? G(t, { "text-decoration": "underline line-through" }) : t.classList.contains("editor-text-underline") ? G(t, { "text-decoration": "underline" }) : t.classList.contains("editor-text-strikethrough") && G(t, { "text-decoration": "line-through" });
|
|
427
539
|
for (let e of Array.from(t.classList)) e.startsWith("editor-") && t.classList.remove(e);
|
|
428
540
|
t.classList.length === 0 && t.removeAttribute("class");
|
|
429
541
|
}
|
|
430
|
-
},
|
|
542
|
+
}, un = (e) => {
|
|
431
543
|
let t = e.parentNode;
|
|
432
544
|
if (t) {
|
|
433
545
|
for (; e.firstChild;) t.insertBefore(e.firstChild, e);
|
|
434
546
|
t.removeChild(e);
|
|
435
547
|
}
|
|
436
|
-
},
|
|
548
|
+
}, dn = (e) => {
|
|
437
549
|
let t = !0;
|
|
438
550
|
for (; t;) {
|
|
439
551
|
t = !1;
|
|
@@ -441,21 +553,21 @@ var st = [
|
|
|
441
553
|
if (n.attributes.length > 0) continue;
|
|
442
554
|
let e = n.tagName.toLowerCase();
|
|
443
555
|
if (e === "span") {
|
|
444
|
-
|
|
556
|
+
un(n), t = !0;
|
|
445
557
|
continue;
|
|
446
558
|
}
|
|
447
559
|
if (n.childElementCount !== 1 || n.childNodes.length !== 1) continue;
|
|
448
560
|
let r = n.firstElementChild;
|
|
449
|
-
(e === "b" && r?.tagName === "STRONG" || e === "i" && r?.tagName === "EM") && (
|
|
561
|
+
(e === "b" && r?.tagName === "STRONG" || e === "i" && r?.tagName === "EM") && (un(n), t = !0);
|
|
450
562
|
}
|
|
451
563
|
}
|
|
452
|
-
},
|
|
564
|
+
}, fn = (e) => {
|
|
453
565
|
if (!e.trim()) return e;
|
|
454
566
|
let t = new DOMParser().parseFromString(e, "text/html");
|
|
455
|
-
|
|
567
|
+
ln(t.body), dn(t.body);
|
|
456
568
|
for (let e of Array.from(t.body.querySelectorAll("pre"))) e.textContent?.trim() || e.remove();
|
|
457
569
|
return t.body.innerHTML;
|
|
458
|
-
},
|
|
570
|
+
}, pn = (e) => e ? new DOMParser().parseFromString(e, "text/html").body.textContent ?? "" : "", mn = (e) => e.includes("<!--bsy-block-->") ? e.split(St).map((e) => e.trim()) : [e], hn = (e) => e.split(St).join("").trim().length > 0, gn = (e, t) => {
|
|
459
571
|
let n = e.map(() => "");
|
|
460
572
|
if (e.length === 0) return n;
|
|
461
573
|
let r = [], i = [];
|
|
@@ -468,7 +580,7 @@ var st = [
|
|
|
468
580
|
for (; u < s && d < c;) a[u] === o[d] ? (f = r[u], n[f] += o[d], u += 1, d += 1) : l[u + 1][d] >= l[u][d + 1] ? (f = r[u], u += 1) : (n[f] += o[d], d += 1);
|
|
469
581
|
for (; d < c;) n[n.length - 1] += o[d], d += 1;
|
|
470
582
|
return n;
|
|
471
|
-
},
|
|
583
|
+
}, _n = new Set([
|
|
472
584
|
"TABLE",
|
|
473
585
|
"THEAD",
|
|
474
586
|
"TBODY",
|
|
@@ -477,7 +589,7 @@ var st = [
|
|
|
477
589
|
"TH",
|
|
478
590
|
"IMG",
|
|
479
591
|
"BR"
|
|
480
|
-
]),
|
|
592
|
+
]), vn = (e) => {
|
|
481
593
|
let t = [], n = (e) => {
|
|
482
594
|
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
483
595
|
if (e.tagName === "PRE") return;
|
|
@@ -487,25 +599,25 @@ var st = [
|
|
|
487
599
|
e.nodeType === Node.TEXT_NODE && t.push(e);
|
|
488
600
|
};
|
|
489
601
|
return n(e), t;
|
|
490
|
-
},
|
|
602
|
+
}, yn = (e, t) => {
|
|
491
603
|
let n = e;
|
|
492
|
-
for (; n && n !== t && !
|
|
604
|
+
for (; n && n !== t && !_n.has(n.tagName) && !(n.textContent ?? "").trim() && !n.querySelector("img, table, br");) {
|
|
493
605
|
let e = n.parentElement;
|
|
494
606
|
n.remove(), n = e;
|
|
495
607
|
}
|
|
496
|
-
},
|
|
608
|
+
}, bn = (e) => {
|
|
497
609
|
let t = e.tagName;
|
|
498
610
|
return t === "IMG" || t === "TABLE" || t === "PRE";
|
|
499
|
-
},
|
|
500
|
-
let t =
|
|
501
|
-
return t ? Array.from(t.children).filter((e) => !
|
|
502
|
-
},
|
|
503
|
-
let n =
|
|
611
|
+
}, xn = (e) => {
|
|
612
|
+
let t = Tt(e);
|
|
613
|
+
return t ? Array.from(t.children).filter((e) => !bn(e)).map((e) => e.textContent ?? "") : [];
|
|
614
|
+
}, Sn = (e) => e.includes("<!--bsy-block-->") ? e : pn(e) || e, Cn = (e, t) => {
|
|
615
|
+
let n = vn(e);
|
|
504
616
|
if (n.length === 0) {
|
|
505
617
|
t && (e.querySelector("br")?.remove(), e.append(e.ownerDocument.createTextNode(t)));
|
|
506
618
|
return;
|
|
507
619
|
}
|
|
508
|
-
let r =
|
|
620
|
+
let r = gn(n.map((e) => e.textContent ?? ""), t);
|
|
509
621
|
for (let t = 0; t < n.length; t++) {
|
|
510
622
|
let i = r[t], a = n[t];
|
|
511
623
|
if (i) {
|
|
@@ -513,60 +625,51 @@ var st = [
|
|
|
513
625
|
continue;
|
|
514
626
|
}
|
|
515
627
|
let o = a.parentElement;
|
|
516
|
-
a.remove(),
|
|
628
|
+
a.remove(), yn(o, e);
|
|
517
629
|
}
|
|
518
|
-
},
|
|
519
|
-
let n =
|
|
520
|
-
if (!
|
|
521
|
-
let r =
|
|
630
|
+
}, wn = (e, t) => {
|
|
631
|
+
let n = Sn(t);
|
|
632
|
+
if (!hn(n) || !e.trim()) return "";
|
|
633
|
+
let r = Tt(e);
|
|
522
634
|
if (!r) return "";
|
|
523
|
-
let i = Array.from(r.children).filter((e) => !
|
|
635
|
+
let i = Array.from(r.children).filter((e) => !bn(e));
|
|
524
636
|
if (i.length === 0) return "";
|
|
525
|
-
let a =
|
|
526
|
-
for (let e = 0; e < i.length; e++)
|
|
637
|
+
let a = mn(n), o = a.length === i.length ? a : gn(i.map((e) => e.textContent ?? ""), a.join(""));
|
|
638
|
+
for (let e = 0; e < i.length; e++) Cn(i[e], o[e] ?? "");
|
|
527
639
|
return r.innerHTML;
|
|
528
|
-
},
|
|
640
|
+
}, Tn = (e, t) => {
|
|
529
641
|
let n = "";
|
|
530
642
|
e.getEditorState().read(() => {
|
|
531
|
-
n =
|
|
643
|
+
n = fn(U(et(e, null)));
|
|
532
644
|
}, { editor: e });
|
|
533
|
-
let r = U(
|
|
534
|
-
return !r.trim() ||
|
|
535
|
-
|
|
645
|
+
let r = U(wn(n, t));
|
|
646
|
+
return !r.trim() || Rt(r, pn(r)) ? !1 : (e.update(() => {
|
|
647
|
+
Pt(e, r), Ft(!0);
|
|
536
648
|
}, { discrete: !0 }), !0);
|
|
537
|
-
},
|
|
538
|
-
let t = "", n = "", r = "";
|
|
539
|
-
return e.getEditorState().read(() => {
|
|
540
|
-
n = F().getTextContent(), t = Yt(U(et(e, null))), r = cn(t).join(`\n\n${Xt}\n\n`);
|
|
541
|
-
}, { editor: e }), {
|
|
542
|
-
html: t,
|
|
543
|
-
text: n,
|
|
544
|
-
polishText: r
|
|
545
|
-
};
|
|
546
|
-
}, mn = /^\uFEFF/, hn = /^ {0,3}`{1,3}[A-Za-z]*$/, gn = /^( {0,3})([^`<]*?)```[ \t]*([A-Za-z0-9_-]*)[ \t]*(.*)$/, _n = /^ {0,3}```[ \t]*$/, vn = /<\/?[a-zA-Z]/, yn = /<[a-zA-Z!]/, bn = (e) => yn.test(e), xn = (e) => vn.test(e), Sn = (e) => e.replace(mn, "").replace(/\r\n/g, "\n"), Cn = (e) => {
|
|
649
|
+
}, En = /^\uFEFF/, Dn = /^ {0,3}`{1,3}[A-Za-z]*$/, On = /^( {0,3})([^`<]*?)```[ \t]*([A-Za-z0-9_-]*)[ \t]*(.*)$/, kn = /^ {0,3}```[ \t]*$/, An = /<\/?[a-zA-Z]/, jn = /<[a-zA-Z!]/, Mn = (e) => jn.test(e), Nn = (e) => An.test(e), Pn = (e) => e.replace(En, "").replace(/\r\n/g, "\n"), Fn = (e) => {
|
|
547
650
|
let t = e.replace(/\n+$/, ""), n = t.lastIndexOf("\n"), r = n === -1 ? t : t.slice(n + 1);
|
|
548
|
-
return
|
|
651
|
+
return Dn.test(r) ? {
|
|
549
652
|
text: n === -1 ? "" : t.slice(0, n),
|
|
550
653
|
withheld: !0
|
|
551
654
|
} : {
|
|
552
655
|
text: e,
|
|
553
656
|
withheld: !1
|
|
554
657
|
};
|
|
555
|
-
},
|
|
556
|
-
let t =
|
|
658
|
+
}, In = (e) => {
|
|
659
|
+
let t = On.exec(e);
|
|
557
660
|
return t ? { sameLineBody: t[4] ?? "" } : null;
|
|
558
|
-
},
|
|
661
|
+
}, Ln = (e) => {
|
|
559
662
|
let t = e.replace(/[ \t]*```[ \t]*$/, "");
|
|
560
663
|
return t === e ? e : t;
|
|
561
|
-
},
|
|
664
|
+
}, Rn = (e) => Mn(e) ? e.replace(/^\n/, "") : "", zn = (e) => {
|
|
562
665
|
let t = e.split("\n"), n = [], r = 0;
|
|
563
666
|
for (; r < t.length;) {
|
|
564
|
-
let e = t[r], i =
|
|
667
|
+
let e = t[r], i = In(e);
|
|
565
668
|
if (i) {
|
|
566
669
|
let e = i.sameLineBody;
|
|
567
|
-
if (e !==
|
|
568
|
-
e =
|
|
569
|
-
let i =
|
|
670
|
+
if (e !== Ln(e)) {
|
|
671
|
+
e = Ln(e);
|
|
672
|
+
let i = Rn(t.slice(r + 1).join("\n"));
|
|
570
673
|
return [
|
|
571
674
|
...n,
|
|
572
675
|
e,
|
|
@@ -574,61 +677,92 @@ var st = [
|
|
|
574
677
|
].filter(Boolean).join("\n");
|
|
575
678
|
}
|
|
576
679
|
let a = [];
|
|
577
|
-
for (e && a.push(e), r += 1; r < t.length && !
|
|
578
|
-
let o = r < t.length ?
|
|
680
|
+
for (e && a.push(e), r += 1; r < t.length && !kn.test(t[r]);) a.push(t[r]), r += 1;
|
|
681
|
+
let o = r < t.length ? Rn(t.slice(r + 1).join("\n")) : "";
|
|
579
682
|
return [
|
|
580
683
|
...n,
|
|
581
684
|
a.join("\n"),
|
|
582
685
|
o
|
|
583
686
|
].filter(Boolean).join("\n");
|
|
584
687
|
}
|
|
585
|
-
if (
|
|
586
|
-
|
|
688
|
+
if (Nn(e)) return Bn([...n, ...t.slice(r)].join("\n"));
|
|
689
|
+
Mn(e) && n.push(e), r += 1;
|
|
587
690
|
}
|
|
588
691
|
return n.length ? n.join("\n") : null;
|
|
589
|
-
},
|
|
692
|
+
}, Bn = (e) => {
|
|
590
693
|
let t = e.split("\n");
|
|
591
694
|
if (!t.length) return e;
|
|
592
|
-
let n =
|
|
593
|
-
return n && !
|
|
594
|
-
},
|
|
695
|
+
let n = In(t[0]);
|
|
696
|
+
return n && !Nn(t[0].slice(0, t[0].indexOf("```"))) && (t.shift(), n.sameLineBody && t.unshift(Ln(n.sameLineBody))), t.length && kn.test(t[t.length - 1] ?? "") && t.pop(), t.join("\n");
|
|
697
|
+
}, Vn = (e) => {
|
|
595
698
|
if (!e) return {
|
|
596
699
|
html: "",
|
|
597
700
|
pending: !1
|
|
598
701
|
};
|
|
599
|
-
let { text: t, withheld: n } =
|
|
702
|
+
let { text: t, withheld: n } = Fn(Pn(e));
|
|
600
703
|
if (!t.trim()) return {
|
|
601
704
|
html: "",
|
|
602
|
-
pending: n ||
|
|
705
|
+
pending: n || Dn.test(Pn(e).trim())
|
|
603
706
|
};
|
|
604
|
-
let r =
|
|
707
|
+
let r = zn(t) ?? t, i = zn(r);
|
|
605
708
|
i !== null && i !== r && (r = i);
|
|
606
709
|
let a = r.trim();
|
|
607
|
-
return
|
|
710
|
+
return Mn(a) ? {
|
|
608
711
|
html: a,
|
|
609
712
|
pending: !1
|
|
610
713
|
} : {
|
|
611
714
|
html: "",
|
|
612
715
|
pending: !0
|
|
613
716
|
};
|
|
614
|
-
},
|
|
717
|
+
}, Hn = (e, t) => {
|
|
718
|
+
let { html: n } = Vn(e);
|
|
719
|
+
return n ? jt(Ot(n, t)) : "";
|
|
720
|
+
};
|
|
721
|
+
//#endregion
|
|
722
|
+
//#region src/components/Editor/utils/applyAiTypeset.ts
|
|
723
|
+
function Un(e, t, n) {
|
|
724
|
+
let r = U(Hn(t, n));
|
|
725
|
+
return !r.trim() || Rt(r, "") ? { applied: !1 } : (e.update(() => {
|
|
726
|
+
Pt(e, r), Ft(!0);
|
|
727
|
+
}, { discrete: !0 }), { applied: !0 });
|
|
728
|
+
}
|
|
729
|
+
//#endregion
|
|
730
|
+
//#region src/components/Editor/utils/readEditorAiSnapshot.ts
|
|
731
|
+
var Wn = (e) => {
|
|
732
|
+
let t = "", n = "", r = "";
|
|
733
|
+
e.getEditorState().read(() => {
|
|
734
|
+
n = I().getTextContent(), t = fn(U(et(e, null))), r = xn(t).join(`\n\n${St}\n\n`);
|
|
735
|
+
}, { editor: e });
|
|
736
|
+
let i = xt(t);
|
|
737
|
+
return {
|
|
738
|
+
html: t,
|
|
739
|
+
text: n,
|
|
740
|
+
polishText: r,
|
|
741
|
+
htmlWithoutCode: i.html,
|
|
742
|
+
codeBlocks: i.blocks
|
|
743
|
+
};
|
|
744
|
+
}, Gn = ({ editor: e, ai: t }) => {
|
|
615
745
|
let n = u(t);
|
|
616
746
|
n.current = t;
|
|
617
747
|
let [r, i] = d(null), [a, o] = d({
|
|
618
748
|
html: "",
|
|
619
749
|
text: "",
|
|
620
|
-
polishText: ""
|
|
750
|
+
polishText: "",
|
|
751
|
+
htmlWithoutCode: "",
|
|
752
|
+
codeBlocks: []
|
|
621
753
|
}), [s, c] = d("quick"), l = () => {
|
|
622
|
-
let t =
|
|
754
|
+
let t = Wn(e);
|
|
623
755
|
o(t), i("typeset"), n.current?.typeset?.({
|
|
624
|
-
html: t.
|
|
625
|
-
text: t.text
|
|
756
|
+
html: t.htmlWithoutCode,
|
|
757
|
+
text: t.text,
|
|
758
|
+
prompt: vt
|
|
626
759
|
});
|
|
627
760
|
}, f = (t) => {
|
|
628
|
-
let r =
|
|
761
|
+
let r = Wn(e);
|
|
629
762
|
o(r), c(t), i("polish"), n.current?.stop?.(), n.current?.polish?.({
|
|
630
763
|
text: r.polishText,
|
|
631
|
-
preset: t
|
|
764
|
+
preset: t,
|
|
765
|
+
prompt: bt(t)
|
|
632
766
|
});
|
|
633
767
|
}, p = () => {
|
|
634
768
|
n.current?.stop?.(), i(null);
|
|
@@ -642,33 +776,27 @@ var st = [
|
|
|
642
776
|
close: p,
|
|
643
777
|
apply: () => {
|
|
644
778
|
let t = n.current?.text ?? "";
|
|
645
|
-
|
|
646
|
-
let n = U(kn(t).html);
|
|
647
|
-
if (!n.trim()) return;
|
|
648
|
-
e.update(() => {
|
|
649
|
-
yt(e, n), bt(!0);
|
|
650
|
-
});
|
|
651
|
-
} else r === "polish" && fn(e, t);
|
|
652
|
-
p();
|
|
779
|
+
r === "typeset" ? Un(e, t, a.codeBlocks) : r === "polish" && Tn(e, t), p();
|
|
653
780
|
}
|
|
654
781
|
};
|
|
655
|
-
},
|
|
656
|
-
let
|
|
782
|
+
}, Kn = i({}), K = 36, qn = 14, Jn = 2 * Math.PI * qn, Yn = ({ nodeKey: e, src: t, altText: n, dataId: r, dataSrc: i }) => {
|
|
783
|
+
let a = o(Kn), s = e in a, c = a[e];
|
|
657
784
|
return /* @__PURE__ */ m("span", {
|
|
658
785
|
className: V["bsy-mobile-editor__image"],
|
|
659
786
|
children: [/* @__PURE__ */ p("img", {
|
|
660
787
|
src: t,
|
|
661
788
|
alt: n,
|
|
662
|
-
"data-id": r
|
|
663
|
-
|
|
789
|
+
"data-id": r,
|
|
790
|
+
"data-src": i
|
|
791
|
+
}), s ? /* @__PURE__ */ p("span", {
|
|
664
792
|
className: V["bsy-mobile-editor__image-mask"],
|
|
665
793
|
role: "progressbar",
|
|
666
794
|
"aria-label": n,
|
|
667
795
|
"aria-valuemin": 0,
|
|
668
796
|
"aria-valuemax": 100,
|
|
669
|
-
"aria-valuenow":
|
|
797
|
+
"aria-valuenow": c === void 0 ? void 0 : Math.round(c),
|
|
670
798
|
children: /* @__PURE__ */ m("svg", {
|
|
671
|
-
className:
|
|
799
|
+
className: c === void 0 ? `${V["bsy-mobile-editor__image-progress"]} ${V["bsy-mobile-editor__image-progress--spin"]}` : V["bsy-mobile-editor__image-progress"],
|
|
672
800
|
width: K,
|
|
673
801
|
height: K,
|
|
674
802
|
viewBox: `0 0 ${K} ${K}`,
|
|
@@ -676,39 +804,40 @@ var st = [
|
|
|
676
804
|
children: [/* @__PURE__ */ p("circle", {
|
|
677
805
|
cx: K / 2,
|
|
678
806
|
cy: K / 2,
|
|
679
|
-
r:
|
|
807
|
+
r: qn,
|
|
680
808
|
fill: "none",
|
|
681
809
|
stroke: "rgba(255,255,255,0.35)",
|
|
682
810
|
strokeWidth: "3"
|
|
683
811
|
}), /* @__PURE__ */ p("circle", {
|
|
684
812
|
cx: K / 2,
|
|
685
813
|
cy: K / 2,
|
|
686
|
-
r:
|
|
814
|
+
r: qn,
|
|
687
815
|
fill: "none",
|
|
688
816
|
stroke: "#fff",
|
|
689
817
|
strokeWidth: "3",
|
|
690
818
|
strokeLinecap: "round",
|
|
691
|
-
strokeDasharray:
|
|
692
|
-
strokeDashoffset:
|
|
819
|
+
strokeDasharray: c === void 0 ? `${Jn * .25} ${Jn}` : Jn,
|
|
820
|
+
strokeDashoffset: c === void 0 ? 0 : Jn * (1 - c / 100),
|
|
693
821
|
transform: `rotate(-90 ${K / 2} ${K / 2})`
|
|
694
822
|
})]
|
|
695
823
|
})
|
|
696
824
|
}) : null]
|
|
697
825
|
});
|
|
698
|
-
},
|
|
826
|
+
}, Xn = class e extends Ne {
|
|
699
827
|
__src;
|
|
700
828
|
__altText;
|
|
701
829
|
__width;
|
|
702
830
|
__height;
|
|
703
831
|
__dataId;
|
|
832
|
+
__dataSrc;
|
|
704
833
|
static getType() {
|
|
705
834
|
return "image";
|
|
706
835
|
}
|
|
707
836
|
static clone(t) {
|
|
708
|
-
return new e(t.__src, t.__altText, t.__width, t.__height, t.__key, t.__dataId);
|
|
837
|
+
return new e(t.__src, t.__altText, t.__width, t.__height, t.__key, t.__dataId, t.__dataSrc);
|
|
709
838
|
}
|
|
710
|
-
constructor(e, t, n, r, i, a) {
|
|
711
|
-
super(i), this.__src = e, this.__altText = t || "", this.__width = n, this.__height = r, this.__dataId = a;
|
|
839
|
+
constructor(e, t, n, r, i, a, o) {
|
|
840
|
+
super(i), this.__src = e, this.__altText = t || "", this.__width = n, this.__height = r, this.__dataId = a, this.__dataSrc = o;
|
|
712
841
|
}
|
|
713
842
|
createDOM() {
|
|
714
843
|
let e = document.createElement("span");
|
|
@@ -719,7 +848,7 @@ var st = [
|
|
|
719
848
|
}
|
|
720
849
|
exportDOM() {
|
|
721
850
|
let e = document.createElement("img");
|
|
722
|
-
return e.setAttribute("src", this.__src), e.setAttribute("alt", this.__altText), e.style.maxWidth = "100%", e.style.display = "inline", e.style.verticalAlign = "baseline", this.__width && e.setAttribute("width", this.__width.toString()), this.__height && e.setAttribute("height", this.__height.toString()), this.__dataId && e.setAttribute("data-id", this.__dataId), { element: e };
|
|
851
|
+
return e.setAttribute("src", this.__src), e.setAttribute("alt", this.__altText), e.style.maxWidth = "100%", e.style.display = "inline", e.style.verticalAlign = "baseline", this.__width && e.setAttribute("width", this.__width.toString()), this.__height && e.setAttribute("height", this.__height.toString()), this.__dataId && e.setAttribute("data-id", this.__dataId), this.__dataSrc && e.setAttribute("data-src", this.__dataSrc), { element: e };
|
|
723
852
|
}
|
|
724
853
|
getSrc() {
|
|
725
854
|
return this.__src;
|
|
@@ -734,18 +863,19 @@ var st = [
|
|
|
734
863
|
}
|
|
735
864
|
static importDOM() {
|
|
736
865
|
return { img: () => ({
|
|
737
|
-
conversion:
|
|
866
|
+
conversion: $n,
|
|
738
867
|
priority: 0
|
|
739
868
|
}) };
|
|
740
869
|
}
|
|
741
870
|
static importJSON(e) {
|
|
742
|
-
let { src: t, altText: n, width: r, height: i, dataId: a } = e;
|
|
743
|
-
return
|
|
871
|
+
let { src: t, altText: n, width: r, height: i, dataId: a, dataSrc: o } = e;
|
|
872
|
+
return Qn({
|
|
744
873
|
src: t,
|
|
745
874
|
altText: n,
|
|
746
875
|
width: r,
|
|
747
876
|
height: i,
|
|
748
|
-
dataId: a
|
|
877
|
+
dataId: a,
|
|
878
|
+
dataSrc: o
|
|
749
879
|
});
|
|
750
880
|
}
|
|
751
881
|
exportJSON() {
|
|
@@ -755,6 +885,7 @@ var st = [
|
|
|
755
885
|
width: this.__width,
|
|
756
886
|
height: this.__height,
|
|
757
887
|
dataId: this.__dataId,
|
|
888
|
+
dataSrc: this.__dataSrc,
|
|
758
889
|
type: "image",
|
|
759
890
|
version: 1
|
|
760
891
|
};
|
|
@@ -763,14 +894,15 @@ var st = [
|
|
|
763
894
|
return !0;
|
|
764
895
|
}
|
|
765
896
|
decorate() {
|
|
766
|
-
return /* @__PURE__ */ p(
|
|
897
|
+
return /* @__PURE__ */ p(Yn, {
|
|
767
898
|
nodeKey: this.getKey(),
|
|
768
899
|
src: this.__src,
|
|
769
900
|
altText: this.__altText,
|
|
770
|
-
dataId: this.__dataId
|
|
901
|
+
dataId: this.__dataId,
|
|
902
|
+
dataSrc: this.__dataSrc
|
|
771
903
|
});
|
|
772
904
|
}
|
|
773
|
-
},
|
|
905
|
+
}, Zn = (e) => e instanceof Xn, Qn = ({ src: e, altText: t, width: n, height: r, dataId: i, dataSrc: a, key: o }) => new Xn(e, t, n, r, o, i, a), $n = (e) => {
|
|
774
906
|
if (!(e instanceof HTMLImageElement)) return null;
|
|
775
907
|
let { src: t, alt: n, style: r } = e, i, a;
|
|
776
908
|
if (r.width) {
|
|
@@ -781,14 +913,15 @@ var st = [
|
|
|
781
913
|
let e = parseInt(r.height, 10);
|
|
782
914
|
Number.isNaN(e) || (a = e);
|
|
783
915
|
}
|
|
784
|
-
return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node:
|
|
916
|
+
return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node: Qn({
|
|
785
917
|
src: t,
|
|
786
918
|
altText: n,
|
|
787
919
|
width: i,
|
|
788
920
|
height: a,
|
|
789
|
-
dataId: e.getAttribute("data-id") || void 0
|
|
921
|
+
dataId: e.getAttribute("data-id") || void 0,
|
|
922
|
+
dataSrc: e.getAttribute("data-src") || void 0
|
|
790
923
|
}) };
|
|
791
|
-
},
|
|
924
|
+
}, er = (e) => mt.includes(e.name.split(".").pop()?.toLowerCase() ?? ""), tr = (e) => er(e) ? e.size > 5242880 ? "size" : null : "type", nr = ({ editor: e, upload: t, savedSelectionRef: n, attachmentsBySrc: r }) => {
|
|
792
925
|
let i = u(null), o = u(null), c = u(!0), [l, f] = d({}), p = a(() => {
|
|
793
926
|
o.current?.abort(), o.current = null;
|
|
794
927
|
}, []);
|
|
@@ -798,15 +931,14 @@ var st = [
|
|
|
798
931
|
let m = a((t, r, i) => {
|
|
799
932
|
let a = "";
|
|
800
933
|
return e.update(() => {
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
let o = Ln({
|
|
934
|
+
It(n.current), L() === null && I().selectEnd();
|
|
935
|
+
let e = Qn({
|
|
804
936
|
src: t,
|
|
805
937
|
altText: r,
|
|
806
|
-
|
|
938
|
+
dataSrc: i
|
|
807
939
|
});
|
|
808
|
-
a =
|
|
809
|
-
for (let
|
|
940
|
+
a = e.getKey(), be([e]);
|
|
941
|
+
for (let t of e.getParent()?.getChildren() ?? []) Te(t) && t.getTextContentSize() === 0 && t.remove();
|
|
810
942
|
}), a;
|
|
811
943
|
}, [e, n]);
|
|
812
944
|
return {
|
|
@@ -815,7 +947,7 @@ var st = [
|
|
|
815
947
|
insertImage: m,
|
|
816
948
|
onFileChange: a(async (n) => {
|
|
817
949
|
let i = n.target.files?.[0];
|
|
818
|
-
if (n.target.value = "", !i ||
|
|
950
|
+
if (n.target.value = "", !i || tr(i)) return;
|
|
819
951
|
p();
|
|
820
952
|
let a = new AbortController();
|
|
821
953
|
if (o.current = a, !t?.customRequest) {
|
|
@@ -840,7 +972,7 @@ var st = [
|
|
|
840
972
|
}));
|
|
841
973
|
let u = !1, d = (t) => {
|
|
842
974
|
u || (u = !0, URL.revokeObjectURL(s), t || e.update(() => {
|
|
843
|
-
|
|
975
|
+
F(l)?.remove();
|
|
844
976
|
}, c.current ? void 0 : { discrete: !0 }), c.current && f((e) => {
|
|
845
977
|
let t = { ...e };
|
|
846
978
|
return delete t[l], t;
|
|
@@ -869,8 +1001,8 @@ var st = [
|
|
|
869
1001
|
return;
|
|
870
1002
|
}
|
|
871
1003
|
e.update(() => {
|
|
872
|
-
let e =
|
|
873
|
-
|
|
1004
|
+
let e = F(l);
|
|
1005
|
+
Zn(e) && (e.setSrc(o), s && e.setDataId(s));
|
|
874
1006
|
}), d(!0);
|
|
875
1007
|
} catch {
|
|
876
1008
|
d(!1);
|
|
@@ -884,13 +1016,13 @@ var st = [
|
|
|
884
1016
|
]),
|
|
885
1017
|
abortUpload: p
|
|
886
1018
|
};
|
|
887
|
-
},
|
|
1019
|
+
}, rr = ({ editor: e, savedSelectionRef: t, captureSelection: n }) => {
|
|
888
1020
|
let [r, i] = d(null);
|
|
889
1021
|
return {
|
|
890
1022
|
linkForm: r,
|
|
891
1023
|
openLink: () => {
|
|
892
1024
|
n(), e.getEditorState().read(() => {
|
|
893
|
-
let e =
|
|
1025
|
+
let e = L(), t = R(e) ? e.anchor.getNode() : null, n = t ? B(t, v) : null;
|
|
894
1026
|
if (n) {
|
|
895
1027
|
i({
|
|
896
1028
|
url: n.getURL(),
|
|
@@ -901,7 +1033,7 @@ var st = [
|
|
|
901
1033
|
}
|
|
902
1034
|
i({
|
|
903
1035
|
url: "",
|
|
904
|
-
text:
|
|
1036
|
+
text: R(e) ? e.getTextContent() : "",
|
|
905
1037
|
newBlank: !0
|
|
906
1038
|
});
|
|
907
1039
|
});
|
|
@@ -911,42 +1043,41 @@ var st = [
|
|
|
911
1043
|
if (!r) return;
|
|
912
1044
|
let a = r.startsWith("@") || /^https?:\/\//.test(r) ? r : `http://${r}`;
|
|
913
1045
|
e.update(() => {
|
|
914
|
-
|
|
915
|
-
e
|
|
916
|
-
let r = I(), i = n.newBlank ? {
|
|
1046
|
+
It(t.current);
|
|
1047
|
+
let e = L(), r = n.newBlank ? {
|
|
917
1048
|
target: "_blank",
|
|
918
1049
|
rel: "noopener noreferrer",
|
|
919
1050
|
title: n.url
|
|
920
1051
|
} : { title: n.url };
|
|
921
|
-
if (
|
|
922
|
-
let
|
|
923
|
-
if (
|
|
1052
|
+
if (R(e)) {
|
|
1053
|
+
let t = n.text.trim() || n.url;
|
|
1054
|
+
if (e.getTextContent()) y(a, r);
|
|
924
1055
|
else {
|
|
925
|
-
let
|
|
926
|
-
|
|
1056
|
+
let n = ye(t), i = _(a, r);
|
|
1057
|
+
i.append(n), e.insertNodes([i]);
|
|
927
1058
|
}
|
|
928
1059
|
} else {
|
|
929
|
-
let e = ye(n.text.trim() || n.url), t = _(a,
|
|
1060
|
+
let e = ye(n.text.trim() || n.url), t = _(a, r);
|
|
930
1061
|
t.append(e);
|
|
931
|
-
let
|
|
932
|
-
if (
|
|
1062
|
+
let i = I(), o = i.getLastChild();
|
|
1063
|
+
if (xe(o)) o.append(t);
|
|
933
1064
|
else {
|
|
934
1065
|
let e = P();
|
|
935
|
-
e.append(t),
|
|
1066
|
+
e.append(t), i.append(e);
|
|
936
1067
|
}
|
|
937
1068
|
}
|
|
938
1069
|
}), i(null);
|
|
939
1070
|
},
|
|
940
1071
|
closeLink: () => i(null)
|
|
941
1072
|
};
|
|
942
|
-
},
|
|
1073
|
+
}, ir = ({ editor: e, value: t, onChange: n, attachmentsBySrc: r }) => {
|
|
943
1074
|
let i = u(null), o = u(n);
|
|
944
1075
|
o.current = n;
|
|
945
1076
|
let c = a((t) => {
|
|
946
1077
|
t.read(() => {
|
|
947
|
-
let n =
|
|
1078
|
+
let n = I().getTextContent(), a = fn(U(et(e, null))), s = Rt(a, n) ? null : a;
|
|
948
1079
|
i.current = s;
|
|
949
|
-
let c =
|
|
1080
|
+
let c = Ee(Xn).map((e) => r.get(e.getSrc())).filter((e) => e !== void 0);
|
|
950
1081
|
o.current({
|
|
951
1082
|
text: n,
|
|
952
1083
|
html: s,
|
|
@@ -956,7 +1087,7 @@ var st = [
|
|
|
956
1087
|
}, [r, e]);
|
|
957
1088
|
return s(() => {
|
|
958
1089
|
t === void 0 || t === i.current || (i.current = t ?? null, e.update(() => {
|
|
959
|
-
|
|
1090
|
+
Pt(e, t?.trim() ? U(t) : ""), Ft(!!e.getRootElement()?.contains(document.activeElement));
|
|
960
1091
|
}, { onUpdate: () => {
|
|
961
1092
|
e.getRootElement() || c(e.getEditorState());
|
|
962
1093
|
} }));
|
|
@@ -965,13 +1096,13 @@ var st = [
|
|
|
965
1096
|
c,
|
|
966
1097
|
t
|
|
967
1098
|
]), c;
|
|
968
|
-
},
|
|
1099
|
+
}, ar = 250, or = () => {
|
|
969
1100
|
let [e] = z(), t = u(0);
|
|
970
1101
|
return s(() => e.registerCommand(ze, (e) => {
|
|
971
1102
|
let n = Date.now(), r = n - t.current;
|
|
972
|
-
if (t.current = n, r <= 0 || r >=
|
|
973
|
-
let i =
|
|
974
|
-
if (!
|
|
1103
|
+
if (t.current = n, r <= 0 || r >= ar) return !1;
|
|
1104
|
+
let i = L();
|
|
1105
|
+
if (!R(i) || !i.isCollapsed()) return !1;
|
|
975
1106
|
let a = i.anchor.getNode();
|
|
976
1107
|
if (B(a, S)) return !1;
|
|
977
1108
|
let o = a.getTopLevelElement();
|
|
@@ -989,7 +1120,7 @@ var st = [
|
|
|
989
1120
|
let c = s.getPreviousSibling();
|
|
990
1121
|
return c?.getTextContent().trim() === "" && c.remove(), e?.preventDefault(), !0;
|
|
991
1122
|
}, je), [e]), null;
|
|
992
|
-
},
|
|
1123
|
+
}, sr = (e, t) => e.split(";").map((e) => e.trim()).filter((e) => e && e.split(":")[0].trim().toLowerCase() !== t).join("; "), cr = () => {
|
|
993
1124
|
let [e] = z();
|
|
994
1125
|
return s(() => e.registerNodeTransform(ae, (e) => {
|
|
995
1126
|
let t = e.getTag();
|
|
@@ -1000,7 +1131,7 @@ var st = [
|
|
|
1000
1131
|
for (let t of e.getAllTextNodes()) {
|
|
1001
1132
|
let e = t.getStyle();
|
|
1002
1133
|
if (!e) continue;
|
|
1003
|
-
let n =
|
|
1134
|
+
let n = sr(e, "font-size");
|
|
1004
1135
|
n !== e && t.setStyle(n);
|
|
1005
1136
|
}
|
|
1006
1137
|
}), [e]), null;
|
|
@@ -1042,12 +1173,12 @@ var st = [
|
|
|
1042
1173
|
};
|
|
1043
1174
|
}
|
|
1044
1175
|
static importJSON(e) {
|
|
1045
|
-
return
|
|
1176
|
+
return lr().updateFromJSON(e);
|
|
1046
1177
|
}
|
|
1047
1178
|
isSimpleText() {
|
|
1048
1179
|
return this.__type === "extended-text" && this.__mode === 0;
|
|
1049
1180
|
}
|
|
1050
|
-
},
|
|
1181
|
+
}, lr = (e = "") => ge(new q(e)), J = (e) => (t) => {
|
|
1051
1182
|
let n = e?.(t);
|
|
1052
1183
|
if (!n) return null;
|
|
1053
1184
|
let r = n.conversion(t);
|
|
@@ -1057,7 +1188,7 @@ var st = [
|
|
|
1057
1188
|
...r,
|
|
1058
1189
|
forChild: (e, t) => {
|
|
1059
1190
|
let n = (r?.forChild ?? ((e) => e))(e, t);
|
|
1060
|
-
if (
|
|
1191
|
+
if (Te(n)) {
|
|
1061
1192
|
let e = [
|
|
1062
1193
|
i ? `background-color: ${i}` : null,
|
|
1063
1194
|
a ? `color: ${a}` : null,
|
|
@@ -1071,33 +1202,33 @@ var st = [
|
|
|
1071
1202
|
return n;
|
|
1072
1203
|
}
|
|
1073
1204
|
};
|
|
1074
|
-
},
|
|
1205
|
+
}, ur = () => {
|
|
1075
1206
|
let [e] = z();
|
|
1076
1207
|
return s(() => e.registerNodeTransform(q, (e) => {
|
|
1077
1208
|
if (!B(e, v)) return;
|
|
1078
1209
|
let t = e.getStyle();
|
|
1079
1210
|
if (!t) return;
|
|
1080
|
-
let n =
|
|
1211
|
+
let n = sr(t, "color");
|
|
1081
1212
|
n !== t && e.setStyle(n);
|
|
1082
1213
|
}), [e]), null;
|
|
1083
|
-
},
|
|
1214
|
+
}, dr = /<img\b|<picture\b/i, fr = () => {
|
|
1084
1215
|
let [e] = z();
|
|
1085
1216
|
return s(() => {
|
|
1086
1217
|
let t = (t) => {
|
|
1087
1218
|
let n = "clipboardData" in t ? t.clipboardData : "dataTransfer" in t ? t.dataTransfer : null;
|
|
1088
1219
|
if (!n || n.getData("application/x-lexical-editor") || n.getData("application/x-lexical-drag")) return !1;
|
|
1089
1220
|
let r = n.getData("text/html");
|
|
1090
|
-
if (!(Array.from(n.files).some((e) => e.type.startsWith("image/")) || Array.from(n.items).some((e) => e.type.startsWith("image/")) ||
|
|
1221
|
+
if (!(Array.from(n.files).some((e) => e.type.startsWith("image/")) || Array.from(n.items).some((e) => e.type.startsWith("image/")) || dr.test(r))) return !1;
|
|
1091
1222
|
t.preventDefault();
|
|
1092
1223
|
let i = n.getData("text/plain");
|
|
1093
|
-
return !
|
|
1094
|
-
let t =
|
|
1224
|
+
return !dr.test(r) && !i || e.update(() => {
|
|
1225
|
+
let t = L();
|
|
1095
1226
|
if (t === null) return;
|
|
1096
1227
|
let n = r ? new DOMParser().parseFromString(r, "text/html") : null;
|
|
1097
1228
|
if (n?.querySelectorAll("img, picture").forEach((e) => e.remove()), (n?.body.innerHTML ?? "") && n?.body.textContent?.trim()) {
|
|
1098
1229
|
let t = tt(e, n);
|
|
1099
1230
|
if (t.length) {
|
|
1100
|
-
|
|
1231
|
+
be(t);
|
|
1101
1232
|
return;
|
|
1102
1233
|
}
|
|
1103
1234
|
}
|
|
@@ -1106,18 +1237,18 @@ var st = [
|
|
|
1106
1237
|
};
|
|
1107
1238
|
return rt(e.registerCommand(He, t, Ae), e.registerCommand(Me, t, Ae));
|
|
1108
1239
|
}, [e]), null;
|
|
1109
|
-
},
|
|
1240
|
+
}, pr = "data:image/png;base64,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", mr = "data:image/png;base64,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", hr = (e, t, n) => Math.min(n, Math.max(t, e)), Y = (e) => hr(e, 0, 1), X = (e) => {
|
|
1110
1241
|
let t = e.trim().toLowerCase();
|
|
1111
1242
|
if (t === "" || t === "transparent") return !0;
|
|
1112
1243
|
let n = t.match(/^rgba\([^,]+,[^,]+,[^,]+,\s*([.\d]+)\s*\)$/);
|
|
1113
1244
|
return n !== null && Number(n[1]) === 0;
|
|
1114
|
-
},
|
|
1245
|
+
}, gr = (e) => {
|
|
1115
1246
|
let t = e.trim().replace(/^#/, "");
|
|
1116
1247
|
return /^[0-9a-fA-F]{3}$/.test(t) ? `#${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`.toLowerCase() : /^[0-9a-fA-F]{6}$/.test(t) ? `#${t.toLowerCase()}` : null;
|
|
1117
|
-
},
|
|
1248
|
+
}, _r = (e) => {
|
|
1118
1249
|
let t = e.trim();
|
|
1119
1250
|
if (X(t)) return null;
|
|
1120
|
-
let n =
|
|
1251
|
+
let n = gr(t);
|
|
1121
1252
|
if (n) return {
|
|
1122
1253
|
r: Number.parseInt(n.slice(1, 3), 16),
|
|
1123
1254
|
g: Number.parseInt(n.slice(3, 5), 16),
|
|
@@ -1129,59 +1260,59 @@ var st = [
|
|
|
1129
1260
|
g: Number(r[2]),
|
|
1130
1261
|
b: Number(r[3])
|
|
1131
1262
|
} : null;
|
|
1132
|
-
},
|
|
1263
|
+
}, vr = ({ r: e, g: t, b: n }) => `#${[
|
|
1133
1264
|
e,
|
|
1134
1265
|
t,
|
|
1135
1266
|
n
|
|
1136
|
-
].map((e) =>
|
|
1267
|
+
].map((e) => hr(Math.round(e), 0, 255).toString(16).padStart(2, "0")).join("")}`, yr = (e, t) => {
|
|
1137
1268
|
if (X(e) && X(t)) return !0;
|
|
1138
|
-
let n =
|
|
1269
|
+
let n = _r(e), r = _r(t);
|
|
1139
1270
|
return !!(n && r && n.r === r.r && n.g === r.g && n.b === r.b);
|
|
1140
|
-
},
|
|
1271
|
+
}, br = (e) => {
|
|
1141
1272
|
let t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.max(t, n, r), a = Math.min(t, n, r), o = (i + a) / 2, s = i - a, c = 0;
|
|
1142
1273
|
return s !== 0 && (c = i === t ? ((n - r) / s + (n < r ? 6 : 0)) * 60 : i === n ? ((r - t) / s + 2) * 60 : ((t - n) / s + 4) * 60), {
|
|
1143
1274
|
h: c,
|
|
1144
1275
|
s: s === 0 ? 0 : s / (1 - Math.abs(2 * o - 1)),
|
|
1145
1276
|
l: o
|
|
1146
1277
|
};
|
|
1147
|
-
},
|
|
1278
|
+
}, xr = ({ h: e, s: t, l: n }) => {
|
|
1148
1279
|
let r = (e % 360 + 360) % 360, i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(r / 60 % 2 - 1)), o = n - i / 2, s = 0, c = 0, l = 0;
|
|
1149
1280
|
return r < 60 ? (s = i, c = a) : r < 120 ? (s = a, c = i) : r < 180 ? (c = i, l = a) : r < 240 ? (c = a, l = i) : r < 300 ? (s = a, l = i) : (s = i, l = a), {
|
|
1150
1281
|
r: Math.round((s + o) * 255),
|
|
1151
1282
|
g: Math.round((c + o) * 255),
|
|
1152
1283
|
b: Math.round((l + o) * 255)
|
|
1153
1284
|
};
|
|
1154
|
-
},
|
|
1285
|
+
}, Sr = (e) => vr(xr(e)), Cr = (e, t) => ({
|
|
1155
1286
|
h: Y(e) * 360,
|
|
1156
1287
|
s: 1,
|
|
1157
1288
|
l: Y(1 - t)
|
|
1158
|
-
}),
|
|
1289
|
+
}), wr = (e) => ({
|
|
1159
1290
|
x: Y((e.h % 360 + 360) % 360 / 360),
|
|
1160
1291
|
y: Y(1 - e.l)
|
|
1161
|
-
}),
|
|
1292
|
+
}), Tr = (e, t, n) => ({
|
|
1162
1293
|
x: Y(n.width === 0 ? 0 : (e - n.left) / n.width),
|
|
1163
1294
|
y: Y(n.height === 0 ? 0 : (t - n.top) / n.height)
|
|
1164
|
-
}),
|
|
1165
|
-
let r =
|
|
1295
|
+
}), Er = (e, t, n = Infinity) => {
|
|
1296
|
+
let r = _r(t);
|
|
1166
1297
|
if (!r) return e;
|
|
1167
|
-
let i =
|
|
1168
|
-
return [i, ...e.filter((e) => !
|
|
1169
|
-
},
|
|
1298
|
+
let i = vr(r);
|
|
1299
|
+
return [i, ...e.filter((e) => !yr(e, i))].slice(0, n);
|
|
1300
|
+
}, Dr = (e, t = 24, n = 8) => Math.max(0, Math.floor((e + n) / (t + n))), Or = (e, t) => {
|
|
1170
1301
|
let n = t % 11;
|
|
1171
1302
|
return Math.floor(t / 11) === 2 ? e[22] ?? e[t] : e[n] ?? e[t];
|
|
1172
|
-
}, Z = (...e) => e.filter(Boolean).join(" "),
|
|
1173
|
-
let t =
|
|
1303
|
+
}, Z = (...e) => e.filter(Boolean).join(" "), kr = (e) => {
|
|
1304
|
+
let t = _r(e) ?? {
|
|
1174
1305
|
r: 0,
|
|
1175
1306
|
g: 94,
|
|
1176
1307
|
b: 239
|
|
1177
1308
|
};
|
|
1178
1309
|
return {
|
|
1179
|
-
color:
|
|
1180
|
-
point:
|
|
1310
|
+
color: vr(t),
|
|
1311
|
+
point: wr(br(t))
|
|
1181
1312
|
};
|
|
1182
|
-
},
|
|
1183
|
-
let { t: l } = e(), [f, h] = d("presets"), [g, _] = d(() =>
|
|
1184
|
-
_(
|
|
1313
|
+
}, Ar = ({ mode: t, currentColor: r, customColors: i, onApply: a, onCustomDraftChange: o, onCustomConfirm: c }) => {
|
|
1314
|
+
let { t: l } = e(), [f, h] = d("presets"), [g, _] = d(() => kr(r)), [v, y] = d(!1), [b, x] = d(null), S = u(null), C = u(null), w = u(null), T = (e = r) => {
|
|
1315
|
+
_(kr(e)), y(!1), o(null), h("custom");
|
|
1185
1316
|
};
|
|
1186
1317
|
s(() => {
|
|
1187
1318
|
if (f !== "custom" || typeof ResizeObserver > "u") return;
|
|
@@ -1210,7 +1341,7 @@ var st = [
|
|
|
1210
1341
|
if (!e) return;
|
|
1211
1342
|
let t = () => {
|
|
1212
1343
|
let t = e.getBoundingClientRect().width;
|
|
1213
|
-
t > 0 && x(
|
|
1344
|
+
t > 0 && x(Dr(t));
|
|
1214
1345
|
};
|
|
1215
1346
|
if (t(), typeof ResizeObserver > "u") return;
|
|
1216
1347
|
let n = new ResizeObserver(t);
|
|
@@ -1219,7 +1350,7 @@ var st = [
|
|
|
1219
1350
|
let E = (e) => {
|
|
1220
1351
|
let t = S.current;
|
|
1221
1352
|
if (!t) return;
|
|
1222
|
-
let { x: n, y: r } =
|
|
1353
|
+
let { x: n, y: r } = Tr(e.clientX, e.clientY, t.getBoundingClientRect()), i = Sr(Cr(n, r));
|
|
1223
1354
|
_({
|
|
1224
1355
|
color: i,
|
|
1225
1356
|
point: {
|
|
@@ -1258,7 +1389,7 @@ var st = [
|
|
|
1258
1389
|
role: "listbox",
|
|
1259
1390
|
"aria-label": l("editor.customColors"),
|
|
1260
1391
|
children: i.slice(0, b ?? i.length).map((e) => {
|
|
1261
|
-
let t =
|
|
1392
|
+
let t = yr(r, e);
|
|
1262
1393
|
return /* @__PURE__ */ p("button", {
|
|
1263
1394
|
type: "button",
|
|
1264
1395
|
role: "option",
|
|
@@ -1336,7 +1467,7 @@ var st = [
|
|
|
1336
1467
|
role: "listbox",
|
|
1337
1468
|
"aria-label": l("editor.presetColors"),
|
|
1338
1469
|
children: ut.map((e, t) => {
|
|
1339
|
-
let n =
|
|
1470
|
+
let n = yr(r, e);
|
|
1340
1471
|
return /* @__PURE__ */ p("button", {
|
|
1341
1472
|
type: "button",
|
|
1342
1473
|
role: "option",
|
|
@@ -1345,7 +1476,7 @@ var st = [
|
|
|
1345
1476
|
className: Z(V["bsy-mobile-editor__color-swatch"], n && V["bsy-mobile-editor__color-swatch--selected"]),
|
|
1346
1477
|
style: {
|
|
1347
1478
|
"--swatch-color": e,
|
|
1348
|
-
"--swatch-ring":
|
|
1479
|
+
"--swatch-ring": Or(ut, t)
|
|
1349
1480
|
},
|
|
1350
1481
|
onClick: () => a(e),
|
|
1351
1482
|
children: /* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__color-swatch-fill"] })
|
|
@@ -1355,19 +1486,19 @@ var st = [
|
|
|
1355
1486
|
A
|
|
1356
1487
|
]
|
|
1357
1488
|
});
|
|
1358
|
-
},
|
|
1489
|
+
}, jr = (e, t) => {
|
|
1359
1490
|
H(e), e.update(() => {
|
|
1360
|
-
ot(
|
|
1491
|
+
ot(L(), () => t === "paragraph" ? P() : re(t));
|
|
1361
1492
|
});
|
|
1362
|
-
},
|
|
1493
|
+
}, Mr = (e, t, n) => {
|
|
1363
1494
|
H(e), e.update(() => {
|
|
1364
|
-
|
|
1365
|
-
let e =
|
|
1495
|
+
It(n), Lt();
|
|
1496
|
+
let e = L();
|
|
1366
1497
|
e && at(e, t);
|
|
1367
1498
|
});
|
|
1368
|
-
},
|
|
1499
|
+
}, Nr = ({ sheet: i, onClose: a, onTypeset: o, onPolishMenu: s, onPickPreset: c, onPicture: l, savedSelectionRef: h, committedColors: g, onColorCommit: _, canTypeset: v, canPolish: y }) => {
|
|
1369
1500
|
let [b] = z(), { t: x } = e(), [S, C] = d([]), w = u(null), T = i === "fontColor" || i === "fill" ? i : null, E = T === "fill" ? g.fill : T === "fontColor" ? g.fontColor : ct, D = (e, t = !1, n = !0) => {
|
|
1370
|
-
T && (n && (w.current = null),
|
|
1501
|
+
T && (n && (w.current = null), Mr(b, { [T === "fill" ? "background-color" : "color"]: e }, h.current), _(T, e), t && !X(e) && C((t) => Er(t, e)), n && a());
|
|
1371
1502
|
}, O = (e) => {
|
|
1372
1503
|
w.current = null, D(e, !0, !1);
|
|
1373
1504
|
};
|
|
@@ -1430,7 +1561,7 @@ var st = [
|
|
|
1430
1561
|
text: x("editor.heading3")
|
|
1431
1562
|
}
|
|
1432
1563
|
],
|
|
1433
|
-
onAction: (e) =>
|
|
1564
|
+
onAction: (e) => jr(b, e.key)
|
|
1434
1565
|
}),
|
|
1435
1566
|
/* @__PURE__ */ p(r, {
|
|
1436
1567
|
mode: "menu",
|
|
@@ -1441,7 +1572,7 @@ var st = [
|
|
|
1441
1572
|
key: e.value,
|
|
1442
1573
|
text: e.label
|
|
1443
1574
|
})),
|
|
1444
|
-
onAction: (e) =>
|
|
1575
|
+
onAction: (e) => Mr(b, { "font-size": e.key })
|
|
1445
1576
|
}),
|
|
1446
1577
|
/* @__PURE__ */ p(t, {
|
|
1447
1578
|
open: T !== null,
|
|
@@ -1450,7 +1581,7 @@ var st = [
|
|
|
1450
1581
|
e && O(e), a();
|
|
1451
1582
|
},
|
|
1452
1583
|
position: "bottom",
|
|
1453
|
-
children: T ? /* @__PURE__ */ p(
|
|
1584
|
+
children: T ? /* @__PURE__ */ p(Ar, {
|
|
1454
1585
|
mode: T,
|
|
1455
1586
|
currentColor: E,
|
|
1456
1587
|
customColors: S,
|
|
@@ -1470,7 +1601,7 @@ var st = [
|
|
|
1470
1601
|
text: x("editor.aiTypeset"),
|
|
1471
1602
|
disabled: !v,
|
|
1472
1603
|
icon: /* @__PURE__ */ p("img", {
|
|
1473
|
-
src:
|
|
1604
|
+
src: pr,
|
|
1474
1605
|
alt: "",
|
|
1475
1606
|
width: 16,
|
|
1476
1607
|
height: 16,
|
|
@@ -1482,7 +1613,7 @@ var st = [
|
|
|
1482
1613
|
text: x("editor.aiPolish"),
|
|
1483
1614
|
disabled: !y,
|
|
1484
1615
|
icon: /* @__PURE__ */ p("img", {
|
|
1485
|
-
src:
|
|
1616
|
+
src: mr,
|
|
1486
1617
|
alt: "",
|
|
1487
1618
|
width: 16,
|
|
1488
1619
|
height: 16,
|
|
@@ -1532,7 +1663,7 @@ var st = [
|
|
|
1532
1663
|
onAction: (e) => l(e.key)
|
|
1533
1664
|
})
|
|
1534
1665
|
] });
|
|
1535
|
-
},
|
|
1666
|
+
}, Pr = ({ open: r, title: i, bodyClassName: a, onClose: o, onConfirm: s, children: c }) => {
|
|
1536
1667
|
let { t: l } = e();
|
|
1537
1668
|
return /* @__PURE__ */ p(t, {
|
|
1538
1669
|
open: r,
|
|
@@ -1577,11 +1708,11 @@ var st = [
|
|
|
1577
1708
|
]
|
|
1578
1709
|
})
|
|
1579
1710
|
});
|
|
1580
|
-
},
|
|
1711
|
+
}, Fr = ({ open: t, seed: r, onClose: i, onConfirm: a }) => {
|
|
1581
1712
|
let { t: o } = e(), [c, l] = d(""), [u, f] = d(""), [h, g] = d(!0);
|
|
1582
1713
|
return s(() => {
|
|
1583
1714
|
!t || !r || (l(r.url), f(r.text), g(r.newBlank));
|
|
1584
|
-
}, [t, r]), /* @__PURE__ */ m(
|
|
1715
|
+
}, [t, r]), /* @__PURE__ */ m(Pr, {
|
|
1585
1716
|
open: t,
|
|
1586
1717
|
title: o("editor.link"),
|
|
1587
1718
|
bodyClassName: V["bsy-mobile-editor__sheet-body--stack"],
|
|
@@ -1643,13 +1774,13 @@ var st = [
|
|
|
1643
1774
|
})
|
|
1644
1775
|
]
|
|
1645
1776
|
});
|
|
1646
|
-
},
|
|
1777
|
+
}, Ir = /^https?:\/\/.+/i, Lr = ({ open: t, onClose: n, onConfirm: r }) => {
|
|
1647
1778
|
let { t: i } = e(), [o, c] = d(""), [l, u] = d(null), f = a((e) => {
|
|
1648
1779
|
e?.focus();
|
|
1649
1780
|
}, []);
|
|
1650
1781
|
return s(() => {
|
|
1651
1782
|
t && (c(""), u(null));
|
|
1652
|
-
}, [t]), /* @__PURE__ */ p(
|
|
1783
|
+
}, [t]), /* @__PURE__ */ p(Pr, {
|
|
1653
1784
|
open: t,
|
|
1654
1785
|
title: i("editor.imageUrl"),
|
|
1655
1786
|
onClose: n,
|
|
@@ -1659,7 +1790,7 @@ var st = [
|
|
|
1659
1790
|
u(i("editor.imageUrlRequired"));
|
|
1660
1791
|
return;
|
|
1661
1792
|
}
|
|
1662
|
-
if (!
|
|
1793
|
+
if (!Ir.test(e)) {
|
|
1663
1794
|
u(i("editor.imageUrlInvalid"));
|
|
1664
1795
|
return;
|
|
1665
1796
|
}
|
|
@@ -1692,7 +1823,7 @@ var st = [
|
|
|
1692
1823
|
]
|
|
1693
1824
|
})
|
|
1694
1825
|
});
|
|
1695
|
-
},
|
|
1826
|
+
}, Rr = "\n:host {\n all: initial;\n display: block;\n width: 100%;\n max-width: 100%;\n min-width: 0;\n}\n.bsy-editor-html-preview__body {\n color: #030303;\n font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;\n font-size: 15px;\n line-height: 1.6;\n word-break: break-word;\n}\n.bsy-editor-html-preview__body p {\n margin: 0;\n}\n.bsy-editor-html-preview__body .editor-text-bold {\n font-weight: 700;\n}\n.bsy-editor-html-preview__body .editor-text-italic {\n font-style: italic;\n}\n.bsy-editor-html-preview__body .editor-text-underline {\n text-decoration: underline;\n}\n.bsy-editor-html-preview__body .editor-text-strikethrough {\n text-decoration: line-through;\n}\n.bsy-editor-html-preview__body .editor-text-underline-strikethrough {\n text-decoration: underline line-through;\n}\n.bsy-editor-html-preview__body sup,\n.bsy-editor-html-preview__body sub {\n display: inline-block;\n position: static;\n top: auto;\n bottom: auto;\n font-size: 0.75em;\n line-height: 1;\n}\n.bsy-editor-html-preview__body sup {\n vertical-align: super;\n}\n.bsy-editor-html-preview__body sub {\n vertical-align: sub;\n}\n.bsy-editor-html-preview__body .editor-heading-h1,\n.bsy-editor-html-preview__body .editor-heading-h2,\n.bsy-editor-html-preview__body .editor-heading-h3 {\n margin: 0.6em 0 0.4em;\n font-weight: 600;\n line-height: 1.35;\n}\n.bsy-editor-html-preview__body .editor-heading-h1 {\n font-size: 2em;\n}\n.bsy-editor-html-preview__body .editor-heading-h2 {\n font-size: 1.5em;\n}\n.bsy-editor-html-preview__body .editor-heading-h3 {\n font-size: 1.25em;\n}\n.bsy-editor-html-preview__body .editor-list-ul,\n.bsy-editor-html-preview__body .editor-list-ol {\n margin: 0;\n padding-inline-start: 24px;\n list-style-position: outside;\n}\n.bsy-editor-html-preview__body .editor-list-ul {\n list-style-type: disc;\n}\n.bsy-editor-html-preview__body .editor-list-ol {\n list-style-type: decimal;\n}\n.bsy-editor-html-preview__body .editor-listitem {\n margin: 0;\n list-style: inherit;\n}\n.bsy-editor-html-preview__body .editor-nested-listitem {\n list-style-type: none;\n}\n.bsy-editor-html-preview__body .editor-list-ul .editor-list-ul {\n list-style-type: circle;\n}\n.bsy-editor-html-preview__body .editor-list-ul .editor-list-ul .editor-list-ul {\n list-style-type: square;\n}\n.bsy-editor-html-preview__body .editor-link,\n.bsy-editor-html-preview__body .editor-link:link,\n.bsy-editor-html-preview__body .editor-link:visited,\n.bsy-editor-html-preview__body .editor-link:hover,\n.bsy-editor-html-preview__body .editor-link:active,\n.bsy-editor-html-preview__body .editor-link:focus {\n color: #0269ff;\n cursor: pointer;\n}\n.bsy-editor-html-preview__body .editor-link * {\n color: #0269ff !important;\n}\n.bsy-editor-html-preview__body pre {\n display: block;\n box-sizing: border-box;\n max-width: 100%;\n margin: 8px 0;\n padding: 8px 12px;\n overflow-x: auto;\n border-radius: 4px;\n background: rgb(240, 242, 245);\n color: #1f2328;\n font-family: Menlo, Consolas, Monaco, monospace;\n font-size: 13px;\n line-height: 1.53;\n tab-size: 2;\n white-space: pre;\n}\n.bsy-editor-html-preview__body .editor-table-scrollable-wrapper {\n max-width: 100%;\n margin: 8px 0;\n overflow-x: auto;\n -webkit-overflow-scrolling: touch;\n}\n.bsy-editor-html-preview__body table {\n width: max-content;\n min-width: 100%;\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n}\n.bsy-editor-html-preview__body td,\n.bsy-editor-html-preview__body th {\n box-sizing: border-box;\n min-width: 75px;\n min-height: 32px;\n padding: 4px 8px;\n border: 1px solid #d9d9d9;\n vertical-align: top;\n}\n.bsy-editor-html-preview__body th {\n background: #f2f3f5;\n font-weight: 600;\n}\n.bsy-editor-html-preview__body img {\n max-width: 100%;\n height: auto;\n vertical-align: baseline;\n}\n", zr = ({ html: e }) => {
|
|
1696
1827
|
let t = u(null);
|
|
1697
1828
|
return l(() => {
|
|
1698
1829
|
let n = t.current;
|
|
@@ -1706,12 +1837,12 @@ var st = [
|
|
|
1706
1837
|
}
|
|
1707
1838
|
r.replaceChildren();
|
|
1708
1839
|
let a = document.createElement("style");
|
|
1709
|
-
a.textContent =
|
|
1840
|
+
a.textContent = Rr, r.append(a, i);
|
|
1710
1841
|
}, [e]), /* @__PURE__ */ p("div", {
|
|
1711
1842
|
ref: t,
|
|
1712
1843
|
className: "bsy-editor-html-preview"
|
|
1713
1844
|
});
|
|
1714
|
-
},
|
|
1845
|
+
}, Br = () => {
|
|
1715
1846
|
let e = `${c().replace(/:/g, "")}g`;
|
|
1716
1847
|
return /* @__PURE__ */ p("span", {
|
|
1717
1848
|
className: V["bsy-mobile-editor__ai-think-icon"],
|
|
@@ -1750,57 +1881,32 @@ var st = [
|
|
|
1750
1881
|
}) })]
|
|
1751
1882
|
})
|
|
1752
1883
|
});
|
|
1753
|
-
},
|
|
1754
|
-
let { t:
|
|
1884
|
+
}, Vr = (t, n) => {
|
|
1885
|
+
let { t: r } = e(), i = t.status === "loading" && !n, [a, o] = d(!0), [c, l] = d(0), f = u(Date.now()), p = u(null), m = t.reasoning ?? "";
|
|
1755
1886
|
return s(() => {
|
|
1756
|
-
if (!
|
|
1757
|
-
|
|
1887
|
+
if (!i) {
|
|
1888
|
+
p.current === null && (p.current = Math.max(1, Math.round((Date.now() - f.current) / 1e3)), l(p.current)), o(!1);
|
|
1758
1889
|
return;
|
|
1759
1890
|
}
|
|
1760
|
-
|
|
1891
|
+
f.current = Date.now(), p.current = null, o(!0);
|
|
1761
1892
|
let e = window.setInterval(() => {
|
|
1762
|
-
|
|
1893
|
+
l(Math.max(1, Math.round((Date.now() - f.current) / 1e3)));
|
|
1763
1894
|
}, 500);
|
|
1764
1895
|
return () => window.clearInterval(e);
|
|
1765
|
-
}, [
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
let e = r.current;
|
|
1773
|
-
!e || !v.current || (v.current = !1, e.scrollHeight - e.scrollTop - e.clientHeight > 8 && (_.current = !0));
|
|
1774
|
-
}, {
|
|
1775
|
-
target: b,
|
|
1776
|
-
passive: !0,
|
|
1777
|
-
enable: o
|
|
1778
|
-
}), s(() => {
|
|
1779
|
-
if (!o || _.current || !r.current) return;
|
|
1780
|
-
let e = window.requestAnimationFrame(() => {
|
|
1781
|
-
if (_.current) return;
|
|
1782
|
-
let e = r.current;
|
|
1783
|
-
e && e.scrollHeight - e.scrollTop - e.clientHeight > 1 && (e.scrollTop = e.scrollHeight);
|
|
1784
|
-
});
|
|
1785
|
-
return () => window.cancelAnimationFrame(e);
|
|
1786
|
-
}, [
|
|
1787
|
-
y,
|
|
1788
|
-
r,
|
|
1789
|
-
o
|
|
1790
|
-
]), {
|
|
1791
|
-
visible: (o || !!y) && !(t.status === "error" && !y),
|
|
1792
|
-
thinking: o,
|
|
1793
|
-
open: o || c,
|
|
1794
|
-
label: o ? i("editor.aiThinking") : i("editor.aiThoughtSeconds", { seconds: f }),
|
|
1795
|
-
reasoning: y,
|
|
1796
|
-
toggle: () => l((e) => !e)
|
|
1896
|
+
}, [i]), {
|
|
1897
|
+
visible: (i || !!m) && !(t.status === "error" && !m),
|
|
1898
|
+
thinking: i,
|
|
1899
|
+
open: i || a,
|
|
1900
|
+
label: i ? r("editor.aiThinking") : r("editor.aiThoughtSeconds", { seconds: c }),
|
|
1901
|
+
reasoning: m,
|
|
1902
|
+
toggle: () => o((e) => !e)
|
|
1797
1903
|
};
|
|
1798
|
-
},
|
|
1904
|
+
}, Hr = ({ model: e }) => /* @__PURE__ */ m("button", {
|
|
1799
1905
|
type: "button",
|
|
1800
1906
|
className: V["bsy-mobile-editor__ai-think-head"],
|
|
1801
1907
|
disabled: e.thinking,
|
|
1802
1908
|
onClick: e.toggle,
|
|
1803
|
-
children: [e.thinking ? /* @__PURE__ */ p(
|
|
1909
|
+
children: [e.thinking ? /* @__PURE__ */ p(Br, {}) : /* @__PURE__ */ p(n, {
|
|
1804
1910
|
name: "arrow-down",
|
|
1805
1911
|
size: 12,
|
|
1806
1912
|
className: [V["bsy-mobile-editor__ai-think-arrow"], e.open ? V["bsy-mobile-editor__ai-think-arrow--open"] : ""].filter(Boolean).join(" ")
|
|
@@ -1808,17 +1914,108 @@ var st = [
|
|
|
1808
1914
|
className: e.thinking ? `${V["bsy-mobile-editor__ai-think-label"]} ${V["bsy-mobile-editor__ai-think-label--shimmer"]}` : V["bsy-mobile-editor__ai-think-label"],
|
|
1809
1915
|
children: e.label
|
|
1810
1916
|
})]
|
|
1811
|
-
}),
|
|
1917
|
+
}), Ur = ({ model: e }) => !e.visible || !e.open || !e.reasoning ? null : /* @__PURE__ */ p("div", {
|
|
1812
1918
|
className: V["bsy-mobile-editor__ai-think-body"],
|
|
1813
1919
|
children: e.reasoning
|
|
1814
|
-
}),
|
|
1815
|
-
let
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1920
|
+
}), Wr = ({ enabled: e, status: t, revision: n, compute: r }) => {
|
|
1921
|
+
let [i, a] = d(""), o = u(r);
|
|
1922
|
+
o.current = r;
|
|
1923
|
+
let c = u(null);
|
|
1924
|
+
return l(() => {
|
|
1925
|
+
let n = () => {
|
|
1926
|
+
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1927
|
+
};
|
|
1928
|
+
if (!e) {
|
|
1929
|
+
n(), a("");
|
|
1930
|
+
return;
|
|
1931
|
+
}
|
|
1932
|
+
let r = () => {
|
|
1933
|
+
c.current = null, a(o.current());
|
|
1934
|
+
};
|
|
1935
|
+
if (t === "ready" || t === "error") {
|
|
1936
|
+
n(), r();
|
|
1937
|
+
return;
|
|
1938
|
+
}
|
|
1939
|
+
c.current === null && (c.current = requestAnimationFrame(r));
|
|
1940
|
+
}, [
|
|
1941
|
+
e,
|
|
1942
|
+
n,
|
|
1943
|
+
t
|
|
1944
|
+
]), s(() => () => {
|
|
1945
|
+
c.current !== null && cancelAnimationFrame(c.current);
|
|
1946
|
+
}, []), i;
|
|
1947
|
+
}, Gr = 32, Kr = .25, qr = 2, Jr = ({ viewportRef: e, enabled: t, revision: n }) => {
|
|
1948
|
+
let r = u(!0), i = u(!1), o = u(0), c = a(() => e.current ?? void 0, [e]), l = a(() => {
|
|
1949
|
+
o.current = 0;
|
|
1950
|
+
let t = e.current;
|
|
1951
|
+
if (!t || !r.current) return;
|
|
1952
|
+
let n = Math.max(0, t.scrollHeight - t.clientHeight), i = n - t.scrollTop;
|
|
1953
|
+
if (i <= 1) {
|
|
1954
|
+
t.scrollTop = n;
|
|
1955
|
+
return;
|
|
1956
|
+
}
|
|
1957
|
+
t.scrollTop += Math.max(i * Kr, Math.min(i, qr)), o.current = requestAnimationFrame(l);
|
|
1958
|
+
}, [e]), d = a(() => {
|
|
1959
|
+
!o.current && r.current && (o.current = requestAnimationFrame(l));
|
|
1960
|
+
}, [l]);
|
|
1961
|
+
s(() => {
|
|
1962
|
+
if (!t) {
|
|
1963
|
+
r.current = !0, i.current = !1, cancelAnimationFrame(o.current), o.current = 0;
|
|
1964
|
+
return;
|
|
1965
|
+
}
|
|
1966
|
+
d();
|
|
1967
|
+
}, [
|
|
1968
|
+
t,
|
|
1969
|
+
n,
|
|
1970
|
+
d
|
|
1971
|
+
]), s(() => {
|
|
1972
|
+
let n = e.current;
|
|
1973
|
+
if (!t || !n || typeof ResizeObserver > "u") return;
|
|
1974
|
+
let r = new ResizeObserver(d);
|
|
1975
|
+
return r.observe(n), n.firstElementChild && r.observe(n.firstElementChild), () => r.disconnect();
|
|
1976
|
+
}, [
|
|
1977
|
+
t,
|
|
1978
|
+
d,
|
|
1979
|
+
e
|
|
1980
|
+
]), s(() => () => cancelAnimationFrame(o.current), []);
|
|
1981
|
+
let f = () => {
|
|
1982
|
+
let t = e.current;
|
|
1983
|
+
if (!t) return;
|
|
1984
|
+
let n = t.scrollHeight - t.clientHeight - t.scrollTop <= Gr;
|
|
1985
|
+
i.current ? (i.current = !1, r.current = n, !n && o.current && (cancelAnimationFrame(o.current), o.current = 0)) : n && (r.current = !0);
|
|
1986
|
+
}, p = () => {
|
|
1987
|
+
i.current = !0;
|
|
1988
|
+
};
|
|
1989
|
+
return h("wheel", p, {
|
|
1990
|
+
target: c,
|
|
1991
|
+
passive: !0,
|
|
1992
|
+
enable: t
|
|
1993
|
+
}), h("touchstart", p, {
|
|
1994
|
+
target: c,
|
|
1995
|
+
passive: !0,
|
|
1996
|
+
enable: t
|
|
1997
|
+
}), h("scroll", f, {
|
|
1998
|
+
target: c,
|
|
1999
|
+
passive: !0,
|
|
2000
|
+
enable: t
|
|
2001
|
+
}), { onScroll: f };
|
|
2002
|
+
}, Yr = ({ open: i, mode: a, originalHtml: o, codeBlocks: s = [], ai: c, polishPreset: l, onClose: h, onApply: g, onPickPreset: _ }) => {
|
|
2003
|
+
let { t: v } = e(), y = u(null), [b, x] = d(!1), S = c?.status ?? "idle", C = c?.text ?? "", w = Wr({
|
|
2004
|
+
enabled: i && !!a,
|
|
2005
|
+
status: S,
|
|
2006
|
+
revision: C,
|
|
2007
|
+
compute: () => a === "polish" ? U(wn(o, C)) : Hn(C, s)
|
|
2008
|
+
}), T = !!w.trim(), E = Vr({
|
|
2009
|
+
status: S,
|
|
2010
|
+
reasoning: c?.reasoning
|
|
2011
|
+
}, T), D = Jr({
|
|
2012
|
+
viewportRef: y,
|
|
2013
|
+
enabled: i && S === "loading",
|
|
2014
|
+
revision: `${c?.reasoning ?? ""}\0${w}`
|
|
2015
|
+
}), O = S === "ready" && T;
|
|
1819
2016
|
return /* @__PURE__ */ m(t, {
|
|
1820
2017
|
open: i,
|
|
1821
|
-
onClose:
|
|
2018
|
+
onClose: h,
|
|
1822
2019
|
position: "bottom",
|
|
1823
2020
|
closeOnClickOverlay: !1,
|
|
1824
2021
|
children: [/* @__PURE__ */ m("div", {
|
|
@@ -1829,12 +2026,12 @@ var st = [
|
|
|
1829
2026
|
className: V["bsy-mobile-editor__header"],
|
|
1830
2027
|
children: [/* @__PURE__ */ p("div", {
|
|
1831
2028
|
className: V["bsy-mobile-editor__title"],
|
|
1832
|
-
children:
|
|
2029
|
+
children: v(a === "polish" ? "editor.aiPolish" : "editor.aiTypeset")
|
|
1833
2030
|
}), /* @__PURE__ */ p("button", {
|
|
1834
2031
|
type: "button",
|
|
1835
2032
|
className: V["bsy-mobile-editor__close"],
|
|
1836
|
-
"aria-label":
|
|
1837
|
-
onClick:
|
|
2033
|
+
"aria-label": v("popup.close"),
|
|
2034
|
+
onClick: h,
|
|
1838
2035
|
children: /* @__PURE__ */ p(n, {
|
|
1839
2036
|
name: "close",
|
|
1840
2037
|
size: 18
|
|
@@ -1851,28 +2048,29 @@ var st = [
|
|
|
1851
2048
|
className: V["bsy-mobile-editor__ai-section-head"],
|
|
1852
2049
|
children: [/* @__PURE__ */ m("div", {
|
|
1853
2050
|
className: `${V["bsy-mobile-editor__ai-label"]} ${V["bsy-mobile-editor__ai-label--after"]}`,
|
|
1854
|
-
children: [/* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__ai-dot"] }),
|
|
2051
|
+
children: [/* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__ai-dot"] }), v("editor.aiOptimized")]
|
|
1855
2052
|
}), a === "polish" ? /* @__PURE__ */ m("button", {
|
|
1856
2053
|
type: "button",
|
|
1857
2054
|
className: V["bsy-mobile-editor__ai-preset"],
|
|
1858
|
-
onClick: () =>
|
|
1859
|
-
children: [
|
|
2055
|
+
onClick: () => x(!0),
|
|
2056
|
+
children: [v(ft[l]), /* @__PURE__ */ p(n, {
|
|
1860
2057
|
name: "arrow-down",
|
|
1861
2058
|
size: 16
|
|
1862
2059
|
})]
|
|
1863
2060
|
}) : null]
|
|
1864
2061
|
}),
|
|
1865
|
-
|
|
2062
|
+
E.visible ? /* @__PURE__ */ p("div", {
|
|
1866
2063
|
className: V["bsy-mobile-editor__ai-think-pin"],
|
|
1867
|
-
children: /* @__PURE__ */ p(
|
|
2064
|
+
children: /* @__PURE__ */ p(Hr, { model: E })
|
|
1868
2065
|
}) : null,
|
|
1869
2066
|
/* @__PURE__ */ p("div", {
|
|
1870
|
-
ref:
|
|
2067
|
+
ref: y,
|
|
1871
2068
|
className: V["bsy-mobile-editor__ai-section-scroll"],
|
|
1872
|
-
|
|
2069
|
+
onScroll: D.onScroll,
|
|
2070
|
+
children: S === "error" ? /* @__PURE__ */ p("p", {
|
|
1873
2071
|
className: V["bsy-mobile-editor__ai-error"],
|
|
1874
|
-
children:
|
|
1875
|
-
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(
|
|
2072
|
+
children: c?.errorMessage || v("editor.aiError")
|
|
2073
|
+
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Ur, { model: E }), T ? /* @__PURE__ */ p(zr, { html: w }) : null] })
|
|
1876
2074
|
})
|
|
1877
2075
|
]
|
|
1878
2076
|
}),
|
|
@@ -1883,11 +2081,11 @@ var st = [
|
|
|
1883
2081
|
className: V["bsy-mobile-editor__ai-section-head"],
|
|
1884
2082
|
children: /* @__PURE__ */ m("div", {
|
|
1885
2083
|
className: `${V["bsy-mobile-editor__ai-label"]} ${V["bsy-mobile-editor__ai-label--before"]}`,
|
|
1886
|
-
children: [/* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__ai-dot"] }),
|
|
2084
|
+
children: [/* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__ai-dot"] }), v("editor.aiOriginal")]
|
|
1887
2085
|
})
|
|
1888
2086
|
}), /* @__PURE__ */ p("div", {
|
|
1889
2087
|
className: V["bsy-mobile-editor__ai-section-scroll"],
|
|
1890
|
-
children: /* @__PURE__ */ p(
|
|
2088
|
+
children: /* @__PURE__ */ p(zr, { html: o })
|
|
1891
2089
|
})]
|
|
1892
2090
|
})
|
|
1893
2091
|
]
|
|
@@ -1896,51 +2094,51 @@ var st = [
|
|
|
1896
2094
|
className: V["bsy-mobile-editor__ai-footer"],
|
|
1897
2095
|
children: [/* @__PURE__ */ p("button", {
|
|
1898
2096
|
type: "button",
|
|
1899
|
-
onClick:
|
|
1900
|
-
children:
|
|
2097
|
+
onClick: h,
|
|
2098
|
+
children: v("editor.aiAbandon")
|
|
1901
2099
|
}), /* @__PURE__ */ p("button", {
|
|
1902
2100
|
type: "button",
|
|
1903
2101
|
className: V["bsy-mobile-editor__ai-footer-ok"],
|
|
1904
|
-
disabled: !
|
|
1905
|
-
onClick:
|
|
1906
|
-
children:
|
|
2102
|
+
disabled: !O,
|
|
2103
|
+
onClick: g,
|
|
2104
|
+
children: v("editor.aiApply")
|
|
1907
2105
|
})]
|
|
1908
2106
|
})
|
|
1909
2107
|
]
|
|
1910
2108
|
}), a === "polish" ? /* @__PURE__ */ p(r, {
|
|
1911
2109
|
mode: "menu",
|
|
1912
|
-
open:
|
|
1913
|
-
title:
|
|
1914
|
-
onClose: () =>
|
|
2110
|
+
open: b,
|
|
2111
|
+
title: v("editor.aiPolish"),
|
|
2112
|
+
onClose: () => x(!1),
|
|
1915
2113
|
actions: dt.map((e) => ({
|
|
1916
2114
|
key: e,
|
|
1917
|
-
text:
|
|
2115
|
+
text: v(ft[e])
|
|
1918
2116
|
})),
|
|
1919
|
-
onAction: (e) =>
|
|
2117
|
+
onAction: (e) => _(e.key)
|
|
1920
2118
|
}) : null]
|
|
1921
2119
|
});
|
|
1922
|
-
},
|
|
2120
|
+
}, Xr = "M896 860.48V960H128v-99.52h768zM578.944 128l251.648 655.936h-115.2l-59.904-164.48H379.904L320 784H204.8L456.384 128h122.56z m-58.944 115.776h-3.712L412.16 531.2h211.072L520 243.84z", Zr = "M766.4 744.32c43.712 0 79.36-36.224 79.36-80.512 0-53.504-79.36-140.8-79.36-140.8s-79.36 87.296-79.36 140.8c0 44.288 35.648 80.512 79.36 80.512z m-377.088-44.16c7.04 7.168 18.56 7.168 25.6 0l256.064-256c7.104-7.04 7.104-18.56 0-25.6l-256-256a16.32 16.32 0 0 0-1.92-1.664L334.72 82.688a9.088 9.088 0 0 0-12.8 0l-48 48a9.088 9.088 0 0 0 0 12.8l67.2 67.2-207.808 207.936c-7.04 7.04-7.04 18.56 0 25.6l255.936 256z m12.864-448.576L581.12 430.528H223.36L402.24 251.52z m501.824 564.416H120a8 8 0 0 0-8 8v80c0 4.416 3.584 8 8 8h784a8 8 0 0 0 8-8v-80a8 8 0 0 0-8-8z", Qr = 860.48, $r = 99.52, ei = /rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0(?:\.0+)?\s*\)/, ti = {
|
|
1923
2121
|
fontColor: {
|
|
1924
|
-
path:
|
|
1925
|
-
clipHeight:
|
|
2122
|
+
path: Xr,
|
|
2123
|
+
clipHeight: Qr,
|
|
1926
2124
|
x: 128,
|
|
1927
2125
|
width: 768,
|
|
1928
2126
|
rx: 0
|
|
1929
2127
|
},
|
|
1930
2128
|
fill: {
|
|
1931
|
-
path:
|
|
2129
|
+
path: Zr,
|
|
1932
2130
|
clipHeight: 816,
|
|
1933
2131
|
x: 112,
|
|
1934
2132
|
width: 800,
|
|
1935
2133
|
rx: 8
|
|
1936
2134
|
}
|
|
1937
|
-
},
|
|
2135
|
+
}, ni = (e, t) => {
|
|
1938
2136
|
let n = t.trim().toLowerCase();
|
|
1939
|
-
if (e === "fill") return !n || n === "transparent" ||
|
|
2137
|
+
if (e === "fill") return !n || n === "transparent" || ei.test(n);
|
|
1940
2138
|
let r = n.replace(/\s+/g, "");
|
|
1941
2139
|
return r === "#000" || r === "#000000" || r === "black" || r === "rgb(0,0,0)" || r === "rgba(0,0,0,1)" || r === "rgba(0,0,0,1.0)";
|
|
1942
|
-
},
|
|
1943
|
-
let r = `${c().replace(/:/g, "")}clip`, i =
|
|
2140
|
+
}, ri = ({ variant: e, barColor: t, size: n }) => {
|
|
2141
|
+
let r = `${c().replace(/:/g, "")}clip`, i = ti[e];
|
|
1944
2142
|
return /* @__PURE__ */ m("svg", {
|
|
1945
2143
|
width: n,
|
|
1946
2144
|
height: n,
|
|
@@ -1963,15 +2161,15 @@ var st = [
|
|
|
1963
2161
|
}),
|
|
1964
2162
|
/* @__PURE__ */ p("rect", {
|
|
1965
2163
|
x: i.x,
|
|
1966
|
-
y:
|
|
2164
|
+
y: Qr,
|
|
1967
2165
|
width: i.width,
|
|
1968
|
-
height:
|
|
2166
|
+
height: $r,
|
|
1969
2167
|
rx: i.rx,
|
|
1970
|
-
fill:
|
|
2168
|
+
fill: ni(e, t) ? "currentColor" : t
|
|
1971
2169
|
})
|
|
1972
2170
|
]
|
|
1973
2171
|
});
|
|
1974
|
-
},
|
|
2172
|
+
}, ii = {
|
|
1975
2173
|
bold: !1,
|
|
1976
2174
|
italic: !1,
|
|
1977
2175
|
underline: !1,
|
|
@@ -1984,20 +2182,20 @@ var st = [
|
|
|
1984
2182
|
headingTag: !1,
|
|
1985
2183
|
hasRangeSelection: !1,
|
|
1986
2184
|
hasEditorText: !1
|
|
1987
|
-
},
|
|
1988
|
-
let t = !!
|
|
1989
|
-
...
|
|
2185
|
+
}, ai = (e) => e === "center" || e === "right" || e === "left" ? e : e === "end" ? "right" : "left", oi = (e) => {
|
|
2186
|
+
let t = !!I().getTextContent().trim(), n = {
|
|
2187
|
+
...ii,
|
|
1990
2188
|
hasEditorText: t
|
|
1991
2189
|
};
|
|
1992
2190
|
if (!e) return n;
|
|
1993
|
-
let r =
|
|
1994
|
-
if (!
|
|
2191
|
+
let r = L();
|
|
2192
|
+
if (!R(r)) return n;
|
|
1995
2193
|
let i = it(r, "color", ct), a = it(r, "background-color", lt), o = r.anchor.getNode(), s = o.getKey() === "root" ? o : B(o, (e) => {
|
|
1996
2194
|
let t = e.getParent();
|
|
1997
|
-
return t !== null &&
|
|
2195
|
+
return t !== null && Ce(t);
|
|
1998
2196
|
});
|
|
1999
2197
|
s === null && (s = o.getTopLevelElementOrThrow());
|
|
2000
|
-
let c = B(o, S), l = !1, u =
|
|
2198
|
+
let c = B(o, S), l = !1, u = xe(s) ? s.getIndent() : 0;
|
|
2001
2199
|
if (S(c)) {
|
|
2002
2200
|
u = c.getIndent();
|
|
2003
2201
|
let e = c.getParent();
|
|
@@ -2014,28 +2212,28 @@ var st = [
|
|
|
2014
2212
|
strikethrough: r.hasFormat("strikethrough"),
|
|
2015
2213
|
fontColor: i,
|
|
2016
2214
|
backgroundColor: a,
|
|
2017
|
-
align:
|
|
2215
|
+
align: ai(xe(s) ? s.getFormatType() : ""),
|
|
2018
2216
|
listType: l,
|
|
2019
2217
|
canOutdent: u > 0 || l !== !1,
|
|
2020
2218
|
headingTag: f === "h1" || f === "h2" || f === "h3" ? f : !1,
|
|
2021
2219
|
hasRangeSelection: !0,
|
|
2022
2220
|
hasEditorText: t
|
|
2023
2221
|
};
|
|
2024
|
-
},
|
|
2222
|
+
}, si = (e, t) => {
|
|
2025
2223
|
e.isEditable() || e.setEditable(!0), e.update(() => {
|
|
2026
|
-
|
|
2224
|
+
Lt(), t(oi(!0));
|
|
2027
2225
|
}), e.focus(void 0, { defaultSelection: "rootStart" });
|
|
2028
|
-
},
|
|
2029
|
-
let t =
|
|
2030
|
-
return
|
|
2226
|
+
}, ci = (e) => {
|
|
2227
|
+
let t = ii;
|
|
2228
|
+
return si(e, (e) => {
|
|
2031
2229
|
t = e;
|
|
2032
2230
|
}), t;
|
|
2033
|
-
},
|
|
2231
|
+
}, li = (...e) => e.filter(Boolean).join(" "), ui = (e) => e.buttons.map((e) => ({
|
|
2034
2232
|
name: typeof e == "string" ? e : e.name,
|
|
2035
2233
|
disabled: typeof e != "string" && !!e.props?.disabled
|
|
2036
|
-
})), Q = 24,
|
|
2234
|
+
})), Q = 24, di = 20, $ = ({ active: e, disabled: t, expanded: n, label: r, select: i, selectAlign: a, onClick: o, children: s }) => /* @__PURE__ */ p("button", {
|
|
2037
2235
|
type: "button",
|
|
2038
|
-
className:
|
|
2236
|
+
className: li(V["bsy-mobile-editor__tool"], i && V["bsy-mobile-editor__tool--select"], a && V["bsy-mobile-editor__tool--select-align"], e && V["bsy-mobile-editor__tool--active"]),
|
|
2039
2237
|
"aria-label": r,
|
|
2040
2238
|
"aria-pressed": e,
|
|
2041
2239
|
"aria-expanded": i ? !!n : void 0,
|
|
@@ -2043,11 +2241,11 @@ var st = [
|
|
|
2043
2241
|
onMouseDown: (e) => e.preventDefault(),
|
|
2044
2242
|
onClick: o,
|
|
2045
2243
|
children: s
|
|
2046
|
-
}),
|
|
2244
|
+
}), fi = ({ open: e }) => /* @__PURE__ */ p(n, {
|
|
2047
2245
|
name: "arrow-down",
|
|
2048
|
-
size:
|
|
2049
|
-
className:
|
|
2050
|
-
}),
|
|
2246
|
+
size: di,
|
|
2247
|
+
className: li(V["bsy-mobile-editor__tool-caret"], e && V["bsy-mobile-editor__tool-caret--open"])
|
|
2248
|
+
}), pi = ({ config: t, formats: r, colorValues: i, openSheet: a, onOpenSheet: o, onOpenLink: c }) => {
|
|
2051
2249
|
let [l] = z(), { t: d } = e(), f = u(null), h = u(null), g = u(null), _ = () => {
|
|
2052
2250
|
let e = f.current, t = h.current, n = g.current;
|
|
2053
2251
|
if (!e || !t || !n) return;
|
|
@@ -2138,7 +2336,7 @@ var st = [
|
|
|
2138
2336
|
disabled: t,
|
|
2139
2337
|
label: d("editor.bulletList"),
|
|
2140
2338
|
onClick: () => {
|
|
2141
|
-
let e =
|
|
2339
|
+
let e = ci(l);
|
|
2142
2340
|
l.dispatchCommand(e.listType === "bullet" ? O : T, void 0);
|
|
2143
2341
|
},
|
|
2144
2342
|
children: /* @__PURE__ */ p(n, {
|
|
@@ -2151,7 +2349,7 @@ var st = [
|
|
|
2151
2349
|
disabled: t,
|
|
2152
2350
|
label: d("editor.numberList"),
|
|
2153
2351
|
onClick: () => {
|
|
2154
|
-
let e =
|
|
2352
|
+
let e = ci(l);
|
|
2155
2353
|
l.dispatchCommand(e.listType === "number" ? O : w, void 0);
|
|
2156
2354
|
},
|
|
2157
2355
|
children: /* @__PURE__ */ p(n, {
|
|
@@ -2170,7 +2368,7 @@ var st = [
|
|
|
2170
2368
|
children: [/* @__PURE__ */ p(n, {
|
|
2171
2369
|
name: r.align === "center" ? "paragraphmiddle" : r.align === "right" ? "paragraphright" : "paragraph",
|
|
2172
2370
|
size: Q
|
|
2173
|
-
}), /* @__PURE__ */ p(
|
|
2371
|
+
}), /* @__PURE__ */ p(fi, { open: a === "align" })]
|
|
2174
2372
|
}, e);
|
|
2175
2373
|
case "heading": return /* @__PURE__ */ m($, {
|
|
2176
2374
|
select: !0,
|
|
@@ -2183,7 +2381,7 @@ var st = [
|
|
|
2183
2381
|
children: [/* @__PURE__ */ p("span", {
|
|
2184
2382
|
className: V["bsy-mobile-editor__tool-text"],
|
|
2185
2383
|
children: r.headingTag ? r.headingTag.toUpperCase() : d("editor.paragraph")
|
|
2186
|
-
}), /* @__PURE__ */ p(
|
|
2384
|
+
}), /* @__PURE__ */ p(fi, { open: a === "heading" })]
|
|
2187
2385
|
}, e);
|
|
2188
2386
|
case "fontSize": return /* @__PURE__ */ p($, {
|
|
2189
2387
|
active: a === "fontSize",
|
|
@@ -2200,7 +2398,7 @@ var st = [
|
|
|
2200
2398
|
disabled: t,
|
|
2201
2399
|
label: d("editor.fontColor"),
|
|
2202
2400
|
onClick: () => o("fontColor"),
|
|
2203
|
-
children: /* @__PURE__ */ p(
|
|
2401
|
+
children: /* @__PURE__ */ p(ri, {
|
|
2204
2402
|
variant: "fontColor",
|
|
2205
2403
|
barColor: i.fontColor,
|
|
2206
2404
|
size: Q
|
|
@@ -2211,7 +2409,7 @@ var st = [
|
|
|
2211
2409
|
disabled: t,
|
|
2212
2410
|
label: d("editor.fill"),
|
|
2213
2411
|
onClick: () => o("fill"),
|
|
2214
|
-
children: /* @__PURE__ */ p(
|
|
2412
|
+
children: /* @__PURE__ */ p(ri, {
|
|
2215
2413
|
variant: "fill",
|
|
2216
2414
|
barColor: i.fill,
|
|
2217
2415
|
size: Q
|
|
@@ -2227,7 +2425,7 @@ var st = [
|
|
|
2227
2425
|
children: [/* @__PURE__ */ p(n, {
|
|
2228
2426
|
name: "picture",
|
|
2229
2427
|
size: Q
|
|
2230
|
-
}), /* @__PURE__ */ p(
|
|
2428
|
+
}), /* @__PURE__ */ p(fi, { open: a === "picture" })]
|
|
2231
2429
|
}, e);
|
|
2232
2430
|
case "link": return /* @__PURE__ */ p($, {
|
|
2233
2431
|
disabled: t,
|
|
@@ -2248,13 +2446,13 @@ var st = [
|
|
|
2248
2446
|
label: d("editor.ai"),
|
|
2249
2447
|
onClick: () => o("ai"),
|
|
2250
2448
|
children: [/* @__PURE__ */ p("img", {
|
|
2251
|
-
src:
|
|
2449
|
+
src: pr,
|
|
2252
2450
|
alt: "",
|
|
2253
2451
|
width: Q,
|
|
2254
2452
|
height: Q,
|
|
2255
2453
|
className: V["bsy-mobile-editor__ai-icon"],
|
|
2256
2454
|
draggable: !1
|
|
2257
|
-
}), /* @__PURE__ */ p(
|
|
2455
|
+
}), /* @__PURE__ */ p(fi, { open: n })]
|
|
2258
2456
|
}, e);
|
|
2259
2457
|
}
|
|
2260
2458
|
default: return null;
|
|
@@ -2267,7 +2465,7 @@ var st = [
|
|
|
2267
2465
|
className: V["bsy-mobile-editor__toolbar-scroller"],
|
|
2268
2466
|
onScroll: _,
|
|
2269
2467
|
children: t.map((e, t) => {
|
|
2270
|
-
let n =
|
|
2468
|
+
let n = ui(e);
|
|
2271
2469
|
return n.length ? /* @__PURE__ */ m("div", {
|
|
2272
2470
|
className: V["bsy-mobile-editor__toolbar-group"],
|
|
2273
2471
|
children: [t > 0 ? /* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__toolbar-divider"] }) : null, n.map(v)]
|
|
@@ -2284,19 +2482,19 @@ var st = [
|
|
|
2284
2482
|
})
|
|
2285
2483
|
})]
|
|
2286
2484
|
});
|
|
2287
|
-
},
|
|
2485
|
+
}, mi = () => {
|
|
2288
2486
|
let [e] = z(), [t, n] = d(!1);
|
|
2289
2487
|
return s(() => rt(e.registerCommand(Pe, () => (n(!0), !1), je), e.registerCommand(ke, () => (n(!1), !1), je)), [e]), t;
|
|
2290
|
-
},
|
|
2291
|
-
let [e] = z(), t =
|
|
2488
|
+
}, hi = () => {
|
|
2489
|
+
let [e] = z(), t = mi(), [n, r] = d(ii);
|
|
2292
2490
|
return s(() => (e.getEditorState().read(() => {
|
|
2293
|
-
r(
|
|
2491
|
+
r(oi(t));
|
|
2294
2492
|
}, { editor: e }), e.registerUpdateListener(({ editorState: n }) => {
|
|
2295
2493
|
n.read(() => {
|
|
2296
|
-
r(
|
|
2494
|
+
r(oi(t));
|
|
2297
2495
|
}, { editor: e });
|
|
2298
2496
|
})), [e, t]), n;
|
|
2299
|
-
},
|
|
2497
|
+
}, gi = "plaintext", _i = "github-light", vi = new Set([
|
|
2300
2498
|
"plaintext",
|
|
2301
2499
|
"css",
|
|
2302
2500
|
"html",
|
|
@@ -2318,7 +2516,7 @@ var st = [
|
|
|
2318
2516
|
"bash",
|
|
2319
2517
|
"lua",
|
|
2320
2518
|
"markdown"
|
|
2321
|
-
]),
|
|
2519
|
+
]), yi = (e) => e && vi.has(e) ? e : gi, bi = {
|
|
2322
2520
|
css: () => import("@shikijs/langs/css"),
|
|
2323
2521
|
html: () => import("@shikijs/langs/html"),
|
|
2324
2522
|
xml: () => import("@shikijs/langs/xml"),
|
|
@@ -2339,38 +2537,38 @@ var st = [
|
|
|
2339
2537
|
bash: () => import("@shikijs/langs/shellscript"),
|
|
2340
2538
|
lua: () => import("@shikijs/langs/lua"),
|
|
2341
2539
|
markdown: () => import("@shikijs/langs/markdown")
|
|
2342
|
-
},
|
|
2540
|
+
}, xi = (e) => e === "bash" ? "shellscript" : e, Si = (e) => e in bi, Ci = null, wi = null, Ti = /* @__PURE__ */ new Map(), Ei = () => (Ci ||= Promise.all([import("@shikijs/core"), import("@shikijs/engine-javascript")]).then(([{ createHighlighterCoreSync: e }, { createJavaScriptRegexEngine: t }]) => e({
|
|
2343
2541
|
engine: t(),
|
|
2344
2542
|
langs: [],
|
|
2345
2543
|
themes: []
|
|
2346
2544
|
})).catch((e) => {
|
|
2347
|
-
throw
|
|
2348
|
-
}),
|
|
2349
|
-
let t =
|
|
2350
|
-
return t || (t =
|
|
2351
|
-
let n =
|
|
2545
|
+
throw Ci = null, e;
|
|
2546
|
+
}), Ci), Di = (e, t) => Si(t) && e.getLoadedLanguages().includes(xi(t)), Oi = (e) => {
|
|
2547
|
+
let t = Ti.get(e);
|
|
2548
|
+
return t || (t = Ei().then(async (t) => {
|
|
2549
|
+
let n = xi(e);
|
|
2352
2550
|
if (!t.getLoadedLanguages().includes(n)) {
|
|
2353
|
-
let n = await
|
|
2551
|
+
let n = await bi[e]();
|
|
2354
2552
|
await t.loadLanguage(n.default);
|
|
2355
2553
|
}
|
|
2356
2554
|
return t;
|
|
2357
2555
|
}).catch((t) => {
|
|
2358
|
-
throw
|
|
2359
|
-
}),
|
|
2360
|
-
},
|
|
2556
|
+
throw Ti.delete(e), t;
|
|
2557
|
+
}), Ti.set(e, t)), t;
|
|
2558
|
+
}, ki = () => (wi ||= Ei().then(async (e) => {
|
|
2361
2559
|
if (!e.getLoadedThemes().includes("github-light")) {
|
|
2362
2560
|
let t = await import("@shikijs/themes/github-light");
|
|
2363
2561
|
await e.loadTheme(t.default);
|
|
2364
2562
|
}
|
|
2365
2563
|
return e;
|
|
2366
2564
|
}).catch((e) => {
|
|
2367
|
-
throw
|
|
2368
|
-
}),
|
|
2565
|
+
throw wi = null, e;
|
|
2566
|
+
}), wi), Ai = (e, t, n) => {
|
|
2369
2567
|
let r = e.getTextContent();
|
|
2370
|
-
if (e.getStyle() && e.setStyle(""), !n || !
|
|
2568
|
+
if (e.getStyle() && e.setStyle(""), !n || !Di(n, t)) return ee(r);
|
|
2371
2569
|
let i = n.codeToTokens(r, {
|
|
2372
|
-
lang:
|
|
2373
|
-
theme:
|
|
2570
|
+
lang: xi(t),
|
|
2571
|
+
theme: _i
|
|
2374
2572
|
}).tokens, a = [];
|
|
2375
2573
|
return i.forEach((e, t) => {
|
|
2376
2574
|
t && a.push(_e()), e.forEach((e) => {
|
|
@@ -2381,11 +2579,11 @@ var st = [
|
|
|
2381
2579
|
});
|
|
2382
2580
|
});
|
|
2383
2581
|
}), a;
|
|
2384
|
-
},
|
|
2385
|
-
let n =
|
|
2582
|
+
}, ji = (e, t) => {
|
|
2583
|
+
let n = F(e);
|
|
2386
2584
|
if (!j(n) || !n.isAttached()) return;
|
|
2387
|
-
let r =
|
|
2388
|
-
if (!
|
|
2585
|
+
let r = L();
|
|
2586
|
+
if (!R(r)) {
|
|
2389
2587
|
t();
|
|
2390
2588
|
return;
|
|
2391
2589
|
}
|
|
@@ -2394,15 +2592,15 @@ var st = [
|
|
|
2394
2592
|
t();
|
|
2395
2593
|
return;
|
|
2396
2594
|
}
|
|
2397
|
-
let a = i.offset, o = i.type === "element" &&
|
|
2595
|
+
let a = i.offset, o = i.type === "element" && Se(n.getChildAtIndex(i.offset - 1)), s = 0;
|
|
2398
2596
|
if (o || (s = a + i.getNode().getPreviousSiblings().reduce((e, t) => e + t.getTextContentSize(), 0)), t()) {
|
|
2399
2597
|
if (o) {
|
|
2400
2598
|
i.getNode().select(a, a);
|
|
2401
2599
|
return;
|
|
2402
2600
|
}
|
|
2403
2601
|
n.getChildren().some((e) => {
|
|
2404
|
-
let t =
|
|
2405
|
-
if (t ||
|
|
2602
|
+
let t = Te(e);
|
|
2603
|
+
if (t || Se(e)) {
|
|
2406
2604
|
let n = e.getTextContentSize();
|
|
2407
2605
|
if (t && n >= s) return e.select(s, s), !0;
|
|
2408
2606
|
s -= n;
|
|
@@ -2410,27 +2608,27 @@ var st = [
|
|
|
2410
2608
|
return !1;
|
|
2411
2609
|
});
|
|
2412
2610
|
}
|
|
2413
|
-
},
|
|
2611
|
+
}, Mi = (e, t) => A(e) && A(t) && e.__text === t.__text && e.__highlightType === t.__highlightType && e.__style === t.__style || we(e) && we(t) || Se(e) && Se(t), Ni = (e, t) => {
|
|
2414
2612
|
let n = 0;
|
|
2415
|
-
for (; n < e.length &&
|
|
2613
|
+
for (; n < e.length && Mi(e[n], t[n]);) n++;
|
|
2416
2614
|
let r = 0, i = Math.min(e.length, t.length) - n;
|
|
2417
|
-
for (; r < i &&
|
|
2615
|
+
for (; r < i && Mi(e[e.length - r - 1], t[t.length - r - 1]);) r++;
|
|
2418
2616
|
return {
|
|
2419
2617
|
from: n,
|
|
2420
2618
|
to: e.length - r,
|
|
2421
2619
|
replacement: t.slice(n, t.length - r)
|
|
2422
2620
|
};
|
|
2423
|
-
},
|
|
2424
|
-
let a = i.getKey(), o =
|
|
2621
|
+
}, Pi = (e, t, n, r, i) => {
|
|
2622
|
+
let a = i.getKey(), o = yi(i.getLanguage());
|
|
2425
2623
|
if (i.getLanguage() !== o && i.setLanguage(o), o === "plaintext") i.getIsSyntaxHighlightSupported() && i.setIsSyntaxHighlightSupported(!1);
|
|
2426
2624
|
else {
|
|
2427
|
-
i.getTheme() !== "github-light" && i.setTheme(
|
|
2428
|
-
let s = t ? t.getLoadedThemes().includes("github-light") ?
|
|
2625
|
+
i.getTheme() !== "github-light" && i.setTheme(_i);
|
|
2626
|
+
let s = t ? t.getLoadedThemes().includes("github-light") ? Si(o) && !Di(t, o) ? Oi(o) : null : ki() : Ei();
|
|
2429
2627
|
if (s) {
|
|
2430
2628
|
i.getIsSyntaxHighlightSupported() && i.setIsSyntaxHighlightSupported(!1), n.pendingKeys.add(a), n.loading !== s && (n.loading = s, s.then((t) => {
|
|
2431
2629
|
r(t);
|
|
2432
2630
|
let i = [...n.pendingKeys];
|
|
2433
|
-
n.pendingKeys.clear(), n.loading = null, e.update(() => i.forEach((e) =>
|
|
2631
|
+
n.pendingKeys.clear(), n.loading = null, e.update(() => i.forEach((e) => F(e)?.markDirty()), { tag: Le });
|
|
2434
2632
|
}, () => {
|
|
2435
2633
|
n.pendingKeys.clear(), n.loading = null;
|
|
2436
2634
|
}));
|
|
@@ -2438,38 +2636,38 @@ var st = [
|
|
|
2438
2636
|
}
|
|
2439
2637
|
i.getIsSyntaxHighlightSupported() || i.setIsSyntaxHighlightSupported(!0);
|
|
2440
2638
|
}
|
|
2441
|
-
n.nodesCurrentlyHighlighting.has(a) || (n.nodesCurrentlyHighlighting.add(a), n.didTransform || (n.didTransform = !0,
|
|
2639
|
+
n.nodesCurrentlyHighlighting.has(a) || (n.nodesCurrentlyHighlighting.add(a), n.didTransform || (n.didTransform = !0, De(() => {
|
|
2442
2640
|
n.didTransform = !1, n.nodesCurrentlyHighlighting.clear();
|
|
2443
|
-
})),
|
|
2444
|
-
let e =
|
|
2641
|
+
})), ji(a, () => {
|
|
2642
|
+
let e = F(a);
|
|
2445
2643
|
if (!j(e) || !e.isAttached()) return !1;
|
|
2446
|
-
let n =
|
|
2644
|
+
let n = Ai(e, yi(e.getLanguage()), t), { from: r, to: i, replacement: o } = Ni(e.getChildren(), n);
|
|
2447
2645
|
return r === i && o.length === 0 ? !1 : (e.splice(r, i - r, o), !0);
|
|
2448
2646
|
}));
|
|
2449
|
-
},
|
|
2647
|
+
}, Fi = () => {
|
|
2450
2648
|
let [e] = z();
|
|
2451
2649
|
return s(() => {
|
|
2452
|
-
if (!e.hasNodes([
|
|
2650
|
+
if (!e.hasNodes([te, M])) throw Error("CodeHighlightPlugin: code nodes are not registered");
|
|
2453
2651
|
let t = null, n = {
|
|
2454
2652
|
didTransform: !1,
|
|
2455
2653
|
nodesCurrentlyHighlighting: /* @__PURE__ */ new Set(),
|
|
2456
2654
|
pendingKeys: /* @__PURE__ */ new Set(),
|
|
2457
2655
|
loading: null
|
|
2458
|
-
}, r = (r) =>
|
|
2656
|
+
}, r = (r) => Pi(e, t, n, (e) => {
|
|
2459
2657
|
t = e;
|
|
2460
2658
|
}, r), i = (e) => {
|
|
2461
2659
|
let t = e.getParent();
|
|
2462
2660
|
j(t) ? r(t) : A(e) && e.replace(ye(e.__text));
|
|
2463
2661
|
};
|
|
2464
|
-
return Ke(ne(e), e.registerNodeTransform(
|
|
2662
|
+
return Ke(ne(e), e.registerNodeTransform(te, r), e.registerNodeTransform(We, i), e.registerNodeTransform(M, i));
|
|
2465
2663
|
}, [e]), null;
|
|
2466
|
-
},
|
|
2664
|
+
}, Ii = () => {
|
|
2467
2665
|
let [e] = z();
|
|
2468
2666
|
return s(() => (he(e, !0), rt(pe(e), me(e, !1), fe(e), e.registerNodeTransform(le, (e) => {
|
|
2469
2667
|
e.getBackgroundColor() !== null && e.setBackgroundColor(null);
|
|
2470
2668
|
}), e.registerCommand(Be, (e) => {
|
|
2471
|
-
let t =
|
|
2472
|
-
if (!
|
|
2669
|
+
let t = L();
|
|
2670
|
+
if (!R(t) || !t.isCollapsed()) return !1;
|
|
2473
2671
|
let n = oe(t.anchor.getNode());
|
|
2474
2672
|
if (n === null) return !1;
|
|
2475
2673
|
let r = e.shiftKey ? "previous" : "next", i = r === "next" ? "getNextSibling" : "getPreviousSibling", a = r === "next" ? "getFirstChild" : "getLastChild", o = n[i](), s = null;
|
|
@@ -2494,31 +2692,31 @@ var st = [
|
|
|
2494
2692
|
}
|
|
2495
2693
|
return !0;
|
|
2496
2694
|
}, Ae))), [e]), null;
|
|
2497
|
-
},
|
|
2498
|
-
let [f] = z(), { t: h } = e(), g =
|
|
2695
|
+
}, Li = ({ value: n, onChange: r, open: i, onOpenChange: a, toolbar: o, upload: c, ai: l }) => {
|
|
2696
|
+
let [f] = z(), { t: h } = e(), g = hi(), [_, v] = d(!1), y = i ?? _, b = (e) => {
|
|
2499
2697
|
a?.(e), i === void 0 && v(e);
|
|
2500
2698
|
}, [x, S] = d(null), [C, w] = d(() => ({
|
|
2501
2699
|
fontColor: g.fontColor,
|
|
2502
2700
|
fill: g.backgroundColor
|
|
2503
2701
|
})), T = u(!1), [E, D] = d(!1), O = u(null), k = () => {
|
|
2504
2702
|
f.getEditorState().read(() => {
|
|
2505
|
-
O.current =
|
|
2703
|
+
O.current = L()?.clone() ?? null;
|
|
2506
2704
|
});
|
|
2507
|
-
}, { linkForm: A, openLink: j, confirmLink: ee, closeLink:
|
|
2705
|
+
}, { linkForm: A, openLink: j, confirmLink: ee, closeLink: M } = rr({
|
|
2508
2706
|
editor: f,
|
|
2509
2707
|
savedSelectionRef: O,
|
|
2510
2708
|
captureSelection: k
|
|
2511
|
-
}), [
|
|
2709
|
+
}), [te] = d(() => /* @__PURE__ */ new Map()), { fileInputRef: ne, uploadProgress: re, insertImage: ie, onFileChange: ae, abortUpload: oe } = nr({
|
|
2512
2710
|
editor: f,
|
|
2513
2711
|
upload: c,
|
|
2514
2712
|
savedSelectionRef: O,
|
|
2515
|
-
attachmentsBySrc:
|
|
2516
|
-
}), se =
|
|
2713
|
+
attachmentsBySrc: te
|
|
2714
|
+
}), se = ir({
|
|
2517
2715
|
editor: f,
|
|
2518
2716
|
value: n,
|
|
2519
2717
|
onChange: r,
|
|
2520
|
-
attachmentsBySrc:
|
|
2521
|
-
}), N =
|
|
2718
|
+
attachmentsBySrc: te
|
|
2719
|
+
}), N = Gn({
|
|
2522
2720
|
editor: f,
|
|
2523
2721
|
ai: l
|
|
2524
2722
|
}), [ce, le] = d(0), ue = o?.config ?? pt;
|
|
@@ -2534,7 +2732,7 @@ var st = [
|
|
|
2534
2732
|
g.hasRangeSelection
|
|
2535
2733
|
]);
|
|
2536
2734
|
let de = () => {
|
|
2537
|
-
oe(), N.close(), S(null),
|
|
2735
|
+
oe(), N.close(), S(null), M(), D(!1), b(!1);
|
|
2538
2736
|
};
|
|
2539
2737
|
s(() => {
|
|
2540
2738
|
if (!y) return;
|
|
@@ -2563,7 +2761,7 @@ var st = [
|
|
|
2563
2761
|
onClose: de,
|
|
2564
2762
|
position: "bottom",
|
|
2565
2763
|
closeOnClickOverlay: !0,
|
|
2566
|
-
children: /* @__PURE__ */ p(
|
|
2764
|
+
children: /* @__PURE__ */ p(Kn.Provider, {
|
|
2567
2765
|
value: re,
|
|
2568
2766
|
children: /* @__PURE__ */ m("div", {
|
|
2569
2767
|
className: V["bsy-mobile-editor"],
|
|
@@ -2587,7 +2785,7 @@ var st = [
|
|
|
2587
2785
|
ErrorBoundary: $e
|
|
2588
2786
|
})
|
|
2589
2787
|
}),
|
|
2590
|
-
ue.length > 0 ? /* @__PURE__ */ p(
|
|
2788
|
+
ue.length > 0 ? /* @__PURE__ */ p(pi, {
|
|
2591
2789
|
config: ue,
|
|
2592
2790
|
formats: g,
|
|
2593
2791
|
colorValues: C,
|
|
@@ -2606,12 +2804,12 @@ var st = [
|
|
|
2606
2804
|
/* @__PURE__ */ p(Je, {}),
|
|
2607
2805
|
/* @__PURE__ */ p(Xe, {}),
|
|
2608
2806
|
/* @__PURE__ */ p(Ye, {}),
|
|
2609
|
-
/* @__PURE__ */ p(
|
|
2610
|
-
/* @__PURE__ */ p(
|
|
2611
|
-
/* @__PURE__ */ p(
|
|
2612
|
-
/* @__PURE__ */ p(
|
|
2613
|
-
/* @__PURE__ */ p(
|
|
2614
|
-
/* @__PURE__ */ p(
|
|
2807
|
+
/* @__PURE__ */ p(or, {}),
|
|
2808
|
+
/* @__PURE__ */ p(fr, {}),
|
|
2809
|
+
/* @__PURE__ */ p(cr, {}),
|
|
2810
|
+
/* @__PURE__ */ p(ur, {}),
|
|
2811
|
+
/* @__PURE__ */ p(Fi, {}),
|
|
2812
|
+
/* @__PURE__ */ p(Ii, {}),
|
|
2615
2813
|
/* @__PURE__ */ p(Ze, {
|
|
2616
2814
|
onChange: se,
|
|
2617
2815
|
ignoreSelectionChange: !0
|
|
@@ -2623,7 +2821,7 @@ var st = [
|
|
|
2623
2821
|
hidden: !0,
|
|
2624
2822
|
onChange: ae
|
|
2625
2823
|
}),
|
|
2626
|
-
/* @__PURE__ */ p(
|
|
2824
|
+
/* @__PURE__ */ p(Nr, {
|
|
2627
2825
|
sheet: x,
|
|
2628
2826
|
onClose: () => {
|
|
2629
2827
|
if (T.current) {
|
|
@@ -2653,23 +2851,24 @@ var st = [
|
|
|
2653
2851
|
canTypeset: !!l?.typeset,
|
|
2654
2852
|
canPolish: !!l?.polish
|
|
2655
2853
|
}),
|
|
2656
|
-
/* @__PURE__ */ p(
|
|
2854
|
+
/* @__PURE__ */ p(Fr, {
|
|
2657
2855
|
open: A !== null,
|
|
2658
2856
|
seed: A,
|
|
2659
|
-
onClose:
|
|
2857
|
+
onClose: M,
|
|
2660
2858
|
onConfirm: ee
|
|
2661
2859
|
}),
|
|
2662
|
-
/* @__PURE__ */ p(
|
|
2860
|
+
/* @__PURE__ */ p(Lr, {
|
|
2663
2861
|
open: E,
|
|
2664
2862
|
onClose: () => D(!1),
|
|
2665
2863
|
onConfirm: (e) => {
|
|
2666
|
-
ie(e, e), D(!1);
|
|
2864
|
+
ie(e, "", e), D(!1);
|
|
2667
2865
|
}
|
|
2668
2866
|
}),
|
|
2669
|
-
/* @__PURE__ */ p(
|
|
2867
|
+
/* @__PURE__ */ p(Yr, {
|
|
2670
2868
|
open: N.mode !== null,
|
|
2671
2869
|
mode: N.mode,
|
|
2672
2870
|
originalHtml: N.snapshot.html,
|
|
2871
|
+
codeBlocks: N.snapshot.codeBlocks,
|
|
2673
2872
|
ai: l,
|
|
2674
2873
|
polishPreset: N.preset,
|
|
2675
2874
|
onClose: N.close,
|
|
@@ -2680,10 +2879,10 @@ var st = [
|
|
|
2680
2879
|
})
|
|
2681
2880
|
})
|
|
2682
2881
|
});
|
|
2683
|
-
},
|
|
2882
|
+
}, Ri = "1px solid #d9d9d9", zi = { export: new Map([[le, (e, t) => {
|
|
2684
2883
|
let n = t.exportDOM(e);
|
|
2685
|
-
return Ge(n.element) && (n.element.style.border =
|
|
2686
|
-
}]]) },
|
|
2884
|
+
return Ge(n.element) && (n.element.style.border = Ri), n;
|
|
2885
|
+
}]]) }, Bi = class e extends x {
|
|
2687
2886
|
constructor(e = "", t = {}, n) {
|
|
2688
2887
|
super(e, t, n);
|
|
2689
2888
|
}
|
|
@@ -2698,12 +2897,12 @@ var st = [
|
|
|
2698
2897
|
}, t.__key);
|
|
2699
2898
|
}
|
|
2700
2899
|
static importJSON(e) {
|
|
2701
|
-
return
|
|
2900
|
+
return Vi().updateFromJSON(e);
|
|
2702
2901
|
}
|
|
2703
2902
|
sanitizeUrl(e) {
|
|
2704
2903
|
return e.startsWith("@") ? e : super.sanitizeUrl(e);
|
|
2705
2904
|
}
|
|
2706
|
-
},
|
|
2905
|
+
}, Vi = (e = "", t = {}) => ge(new Bi(e, t)), Hi = {
|
|
2707
2906
|
namespace: "bsyLexicalEditor",
|
|
2708
2907
|
onError: (e) => {
|
|
2709
2908
|
console.error("Lexical error", e);
|
|
@@ -2736,28 +2935,28 @@ var st = [
|
|
|
2736
2935
|
tableRow: "editor-table-row",
|
|
2737
2936
|
tableScrollableWrapper: "editor-table-scrollable-wrapper"
|
|
2738
2937
|
},
|
|
2739
|
-
html:
|
|
2938
|
+
html: zi,
|
|
2740
2939
|
nodes: [
|
|
2741
|
-
|
|
2940
|
+
Bi,
|
|
2742
2941
|
{
|
|
2743
2942
|
replace: x,
|
|
2744
|
-
with: (e) => new
|
|
2943
|
+
with: (e) => new Bi(e.__url, {
|
|
2745
2944
|
rel: e.__rel,
|
|
2746
2945
|
target: e.__target,
|
|
2747
2946
|
title: e.__title
|
|
2748
2947
|
}),
|
|
2749
|
-
withKlass:
|
|
2948
|
+
withKlass: Bi
|
|
2750
2949
|
},
|
|
2751
2950
|
b,
|
|
2752
2951
|
D,
|
|
2753
2952
|
E,
|
|
2754
2953
|
ae,
|
|
2755
|
-
M,
|
|
2756
2954
|
te,
|
|
2955
|
+
M,
|
|
2757
2956
|
ue,
|
|
2758
2957
|
de,
|
|
2759
2958
|
le,
|
|
2760
|
-
|
|
2959
|
+
Xn,
|
|
2761
2960
|
q,
|
|
2762
2961
|
{
|
|
2763
2962
|
replace: We,
|
|
@@ -2765,10 +2964,10 @@ var st = [
|
|
|
2765
2964
|
withKlass: q
|
|
2766
2965
|
}
|
|
2767
2966
|
]
|
|
2768
|
-
},
|
|
2769
|
-
initialConfig:
|
|
2770
|
-
children: /* @__PURE__ */ p(
|
|
2967
|
+
}, Ui = (e) => /* @__PURE__ */ p(g, {
|
|
2968
|
+
initialConfig: Hi,
|
|
2969
|
+
children: /* @__PURE__ */ p(Li, { ...e })
|
|
2771
2970
|
});
|
|
2772
|
-
|
|
2971
|
+
Ui.displayName = "BsyMobileEditor";
|
|
2773
2972
|
//#endregion
|
|
2774
|
-
export {
|
|
2973
|
+
export { zr as n, Ui as t };
|