@baishuyun/ui-mobile 0.12.1 → 0.12.3
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/index.js +1 -1
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/Editor/{Editor-BdDwoeu2.js → Editor-CiMeb1VH.js} +527 -483
- 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/index.js +1 -1
- package/dist/components/Editor/constants.d.ts +2 -0
- package/dist/components/Editor/plugins/IndentLimitPlugin.d.ts +1 -0
- package/dist/components/Editor/utils/clampElementIndent.d.ts +3 -0
- package/dist/components/Editor/utils/readTextFormats.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/vendors/{version-BqVAUWsV.js → version-DNTXk7hK.js} +1 -1
- package/package.json +2 -2
|
@@ -11,21 +11,21 @@ import { $isListItemNode as S, $isListNode as C, INSERT_ORDERED_LIST_COMMAND as
|
|
|
11
11
|
import { $createCodeHighlightNode as k, $isCodeHighlightNode as A, $isCodeNode as j, $plainifyCodeContent as ee, CodeHighlightNode as M, CodeNode as N, registerCodeIndentation as te } from "@lexical/code-core";
|
|
12
12
|
import { $createHeadingNode as ne, $isHeadingNode as re, HeadingNode as ie } from "@lexical/rich-text";
|
|
13
13
|
import { $findCellNode as ae, $isTableCellNode as oe, $isTableNode as P, $isTableRowNode as se, TableCellNode as ce, TableNode as le, TableRowNode as ue, registerTableCellUnmergeTransform as de, registerTablePlugin as fe, registerTableSelectionObserver as pe, setScrollableTablesActive as me } from "@lexical/table";
|
|
14
|
-
import { $applyNodeReplacement as he, $createLineBreakNode as ge, $createParagraphNode as
|
|
15
|
-
import { ContentEditable as
|
|
16
|
-
import { HistoryPlugin as
|
|
17
|
-
import { LinkPlugin as
|
|
18
|
-
import { ListPlugin as
|
|
19
|
-
import { OnChangePlugin as
|
|
20
|
-
import { RichTextPlugin as
|
|
21
|
-
import { LexicalErrorBoundary as
|
|
14
|
+
import { $applyNodeReplacement as he, $createLineBreakNode as ge, $createParagraphNode as F, $createTabNode as _e, $createTextNode as ve, $getNodeByKey as ye, $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, ParagraphNode as We, TextNode as Ge, isHTMLElement as Ke, mergeRegister as qe } from "lexical";
|
|
15
|
+
import { ContentEditable as Je } from "@lexical/react/LexicalContentEditable";
|
|
16
|
+
import { HistoryPlugin as Ye } from "@lexical/react/LexicalHistoryPlugin";
|
|
17
|
+
import { LinkPlugin as Xe } from "@lexical/react/LexicalLinkPlugin";
|
|
18
|
+
import { ListPlugin as Ze } from "@lexical/react/LexicalListPlugin";
|
|
19
|
+
import { OnChangePlugin as Qe } from "@lexical/react/LexicalOnChangePlugin";
|
|
20
|
+
import { RichTextPlugin as $e } from "@lexical/react/LexicalRichTextPlugin";
|
|
21
|
+
import { LexicalErrorBoundary as et } from "@lexical/react/LexicalErrorBoundary";
|
|
22
22
|
import { useLexicalComposerContext as z } from "@lexical/react/LexicalComposerContext";
|
|
23
|
-
import { $generateHtmlFromNodes as
|
|
24
|
-
import
|
|
25
|
-
import { $findMatchingParent as B, mergeRegister as
|
|
26
|
-
import { $getSelectionStyleValueForProperty as
|
|
23
|
+
import { $generateHtmlFromNodes as tt, $generateNodesFromDOM as nt } from "@lexical/html";
|
|
24
|
+
import rt from "dompurify";
|
|
25
|
+
import { $findMatchingParent as B, $handleIndentAndOutdent as it, mergeRegister as at } from "@lexical/utils";
|
|
26
|
+
import { $getSelectionStyleValueForProperty as ot, $patchStyleText as st, $setBlocksType as ct } from "@lexical/selection";
|
|
27
27
|
//#region src/components/Editor/constants.ts
|
|
28
|
-
var
|
|
28
|
+
var lt = [
|
|
29
29
|
{
|
|
30
30
|
label: "12",
|
|
31
31
|
value: "12px"
|
|
@@ -74,21 +74,21 @@ var st = [
|
|
|
74
74
|
label: "128",
|
|
75
75
|
value: "128px"
|
|
76
76
|
}
|
|
77
|
-
],
|
|
77
|
+
], ut = "#000", dt = "transparent", ft = /* @__PURE__ */ "#005eef.#3642e9.#7f43c8.#114bb8.#1379d9.#10a9c4.#119d85.#ffc502.#ff9921.#f06648.#f168b6.#d9e8ff.#dee0ff.#efe2ff.#d5e4ff.#daedff.#ddfaff.#d7fff8.#fff4d0.#ffecd7.#ffe3dd.#ffdef1.#262626.#3c3c3d.#454545.#515152.#5d5c5e.#6c6c6e.#878789.#b0afb1.#d0d0d1.#e6e6e7.#f5f5f6".split("."), pt = [
|
|
78
78
|
"quick",
|
|
79
79
|
"formal",
|
|
80
80
|
"colloquial",
|
|
81
81
|
"lively",
|
|
82
82
|
"literary",
|
|
83
83
|
"retro"
|
|
84
|
-
],
|
|
84
|
+
], mt = {
|
|
85
85
|
quick: "editor.aiPresetQuick",
|
|
86
86
|
formal: "editor.aiPresetFormal",
|
|
87
87
|
colloquial: "editor.aiPresetColloquial",
|
|
88
88
|
lively: "editor.aiPresetLively",
|
|
89
89
|
literary: "editor.aiPresetLiterary",
|
|
90
90
|
retro: "editor.aiPresetRetro"
|
|
91
|
-
},
|
|
91
|
+
}, ht = [
|
|
92
92
|
{
|
|
93
93
|
key: "ai",
|
|
94
94
|
buttons: ["ai"]
|
|
@@ -124,102 +124,102 @@ var st = [
|
|
|
124
124
|
key: "insert",
|
|
125
125
|
buttons: ["picture", "link"]
|
|
126
126
|
}
|
|
127
|
-
],
|
|
127
|
+
], gt = [
|
|
128
128
|
"jpg",
|
|
129
129
|
"jpeg",
|
|
130
130
|
"png",
|
|
131
131
|
"gif",
|
|
132
132
|
"bmp",
|
|
133
133
|
"tif"
|
|
134
|
-
],
|
|
135
|
-
"bsy-mobile-editor": "_bsy-mobile-
|
|
136
|
-
"bsy-mobile-editor__label": "_bsy-mobile-
|
|
137
|
-
"bsy-mobile-editor__label-text": "_bsy-mobile-editor__label-
|
|
138
|
-
"bsy-mobile-editor__header": "_bsy-mobile-
|
|
139
|
-
"bsy-mobile-editor__title": "_bsy-mobile-
|
|
140
|
-
"bsy-mobile-editor__close": "_bsy-mobile-
|
|
141
|
-
"bsy-mobile-editor__content": "_bsy-mobile-
|
|
142
|
-
"bsy-mobile-editor__editable": "_bsy-mobile-
|
|
143
|
-
"bsy-mobile-editor__image-shell": "_bsy-mobile-editor__image-
|
|
144
|
-
"bsy-mobile-editor__image": "_bsy-mobile-
|
|
145
|
-
"bsy-mobile-editor__image-mask": "_bsy-mobile-editor__image-
|
|
146
|
-
"bsy-mobile-editor__image-progress": "_bsy-mobile-editor__image-
|
|
147
|
-
"bsy-mobile-editor__image-progress--spin": "_bsy-mobile-editor__image-progress--
|
|
148
|
-
"bsy-mobile-editor-progress-spin": "_bsy-mobile-editor-progress-
|
|
149
|
-
"bsy-mobile-editor__toolbar": "_bsy-mobile-
|
|
150
|
-
"bsy-mobile-editor__toolbar-scroller": "_bsy-mobile-editor__toolbar-
|
|
151
|
-
"bsy-mobile-editor__toolbar-track": "_bsy-mobile-editor__toolbar-
|
|
152
|
-
"bsy-mobile-editor__toolbar-thumb": "_bsy-mobile-editor__toolbar-
|
|
153
|
-
"bsy-mobile-editor__toolbar-group": "_bsy-mobile-editor__toolbar-
|
|
154
|
-
"bsy-mobile-editor__toolbar-divider": "_bsy-mobile-editor__toolbar-
|
|
155
|
-
"bsy-mobile-editor__tool": "_bsy-mobile-
|
|
156
|
-
"bsy-mobile-editor__tool--active": "_bsy-mobile-editor__tool--
|
|
157
|
-
"bsy-mobile-editor__tool--select": "_bsy-mobile-editor__tool--
|
|
158
|
-
"bsy-mobile-editor__tool--select-align": "_bsy-mobile-editor__tool--select-
|
|
159
|
-
"bsy-mobile-editor__tool-caret": "_bsy-mobile-editor__tool-
|
|
160
|
-
"bsy-mobile-editor__tool-caret--open": "_bsy-mobile-editor__tool-caret--
|
|
161
|
-
"bsy-mobile-editor__ai-icon": "_bsy-mobile-editor__ai-
|
|
162
|
-
"bsy-mobile-editor__tool-text": "_bsy-mobile-editor__tool-
|
|
163
|
-
"bsy-mobile-editor__color": "_bsy-mobile-
|
|
164
|
-
"bsy-mobile-editor__color--custom": "_bsy-mobile-editor__color--
|
|
165
|
-
"bsy-mobile-editor__color-header": "_bsy-mobile-editor__color-
|
|
166
|
-
"bsy-mobile-editor__color-header-title": "_bsy-mobile-editor__color-header-
|
|
167
|
-
"bsy-mobile-editor__color-header-back": "_bsy-mobile-editor__color-header-
|
|
168
|
-
"bsy-mobile-editor__color-grid": "_bsy-mobile-editor__color-
|
|
169
|
-
"bsy-mobile-editor__color-swatch": "_bsy-mobile-editor__color-
|
|
170
|
-
"bsy-mobile-editor__color-none": "_bsy-mobile-editor__color-
|
|
171
|
-
"bsy-mobile-editor__color-custom-item": "_bsy-mobile-editor__color-custom-
|
|
172
|
-
"bsy-mobile-editor__color-swatch--selected": "_bsy-mobile-editor__color-swatch--
|
|
173
|
-
"bsy-mobile-editor__color-none--selected": "_bsy-mobile-editor__color-none--
|
|
174
|
-
"bsy-mobile-editor__color-custom-item--selected": "_bsy-mobile-editor__color-custom-item--
|
|
175
|
-
"bsy-mobile-editor__color-swatch-fill": "_bsy-mobile-editor__color-swatch-
|
|
176
|
-
"bsy-mobile-editor__color-bar": "_bsy-mobile-editor__color-
|
|
177
|
-
"bsy-mobile-editor__color-custom-trigger": "_bsy-mobile-editor__color-custom-
|
|
178
|
-
"bsy-mobile-editor__color-custom-trigger--active": "_bsy-mobile-editor__color-custom-trigger--
|
|
179
|
-
"bsy-mobile-editor__color-custom-trigger--preview": "_bsy-mobile-editor__color-custom-trigger--
|
|
180
|
-
"bsy-mobile-editor__color-custom-list": "_bsy-mobile-editor__color-custom-
|
|
181
|
-
"bsy-mobile-editor__color-mixer": "_bsy-mobile-editor__color-
|
|
182
|
-
"bsy-mobile-editor__color-spectrum": "_bsy-mobile-editor__color-
|
|
183
|
-
"bsy-mobile-editor__color-spectrum-canvas": "_bsy-mobile-editor__color-spectrum-
|
|
184
|
-
"bsy-mobile-editor__color-thumb": "_bsy-mobile-editor__color-
|
|
185
|
-
"bsy-mobile-editor__sheet": "_bsy-mobile-
|
|
186
|
-
"bsy-mobile-editor__sheet-body": "_bsy-mobile-editor__sheet-
|
|
187
|
-
"bsy-mobile-editor__sheet-body--stack": "_bsy-mobile-editor__sheet-body--
|
|
188
|
-
"bsy-mobile-editor__sheet-field": "_bsy-mobile-editor__sheet-
|
|
189
|
-
"bsy-mobile-editor__sheet-label": "_bsy-mobile-editor__sheet-
|
|
190
|
-
"bsy-mobile-editor__sheet-note": "_bsy-mobile-editor__sheet-
|
|
191
|
-
"bsy-mobile-editor__sheet-note--hint": "_bsy-mobile-editor__sheet-note--
|
|
192
|
-
"bsy-mobile-editor__sheet-error": "_bsy-mobile-editor__sheet-
|
|
193
|
-
"bsy-mobile-editor__sheet-bar": "_bsy-mobile-editor__sheet-
|
|
194
|
-
"bsy-mobile-editor__sheet-ok": "_bsy-mobile-editor__sheet-
|
|
195
|
-
"bsy-mobile-editor__check": "_bsy-mobile-
|
|
196
|
-
"bsy-mobile-editor__check-input": "_bsy-mobile-editor__check-
|
|
197
|
-
"bsy-mobile-editor__check-box": "_bsy-mobile-editor__check-
|
|
198
|
-
"bsy-mobile-editor__ai": "_bsy-mobile-
|
|
199
|
-
"bsy-mobile-editor__ai-body": "_bsy-mobile-editor__ai-
|
|
200
|
-
"bsy-mobile-editor__ai-section": "_bsy-mobile-editor__ai-
|
|
201
|
-
"bsy-mobile-editor__ai-section-head": "_bsy-mobile-editor__ai-section-
|
|
202
|
-
"bsy-mobile-editor__ai-section-scroll": "_bsy-mobile-editor__ai-section-
|
|
203
|
-
"bsy-mobile-editor__ai-label": "_bsy-mobile-editor__ai-
|
|
204
|
-
"bsy-mobile-editor__ai-label--after": "_bsy-mobile-editor__ai-label--
|
|
205
|
-
"bsy-mobile-editor__ai-label--before": "_bsy-mobile-editor__ai-label--
|
|
206
|
-
"bsy-mobile-editor__ai-dot": "_bsy-mobile-editor__ai-
|
|
207
|
-
"bsy-mobile-editor__ai-split": "_bsy-mobile-editor__ai-
|
|
208
|
-
"bsy-mobile-editor__ai-preset": "_bsy-mobile-editor__ai-
|
|
209
|
-
"bsy-mobile-editor__ai-think-pin": "_bsy-mobile-editor__ai-think-
|
|
210
|
-
"bsy-mobile-editor__ai-think-head": "_bsy-mobile-editor__ai-think-
|
|
211
|
-
"bsy-mobile-editor__ai-think-label": "_bsy-mobile-editor__ai-think-
|
|
212
|
-
"bsy-mobile-editor__ai-think-label--shimmer": "_bsy-mobile-editor__ai-think-label--
|
|
213
|
-
"bsy-mobile-ai-think-shimmer": "_bsy-mobile-ai-think-
|
|
214
|
-
"bsy-mobile-editor__ai-think-arrow": "_bsy-mobile-editor__ai-think-
|
|
215
|
-
"bsy-mobile-editor__ai-think-arrow--open": "_bsy-mobile-editor__ai-think-arrow--
|
|
216
|
-
"bsy-mobile-editor__ai-think-icon": "_bsy-mobile-editor__ai-think-
|
|
217
|
-
"bsy-mobile-ai-think": "_bsy-mobile-ai-
|
|
218
|
-
"bsy-mobile-editor__ai-think-body": "_bsy-mobile-editor__ai-think-
|
|
219
|
-
"bsy-mobile-editor__ai-error": "_bsy-mobile-editor__ai-
|
|
220
|
-
"bsy-mobile-editor__ai-footer": "_bsy-mobile-editor__ai-
|
|
221
|
-
"bsy-mobile-editor__ai-footer-ok": "_bsy-mobile-editor__ai-footer-
|
|
222
|
-
},
|
|
134
|
+
], _t = gt.map((e) => `.${e}`).join(","), vt = "calc(100dvh - 104px)", V = {
|
|
135
|
+
"bsy-mobile-editor": "_bsy-mobile-editor_dfbcr_2",
|
|
136
|
+
"bsy-mobile-editor__label": "_bsy-mobile-editor__label_dfbcr_15",
|
|
137
|
+
"bsy-mobile-editor__label-text": "_bsy-mobile-editor__label-text_dfbcr_20",
|
|
138
|
+
"bsy-mobile-editor__header": "_bsy-mobile-editor__header_dfbcr_29",
|
|
139
|
+
"bsy-mobile-editor__title": "_bsy-mobile-editor__title_dfbcr_39",
|
|
140
|
+
"bsy-mobile-editor__close": "_bsy-mobile-editor__close_dfbcr_49",
|
|
141
|
+
"bsy-mobile-editor__content": "_bsy-mobile-editor__content_dfbcr_63",
|
|
142
|
+
"bsy-mobile-editor__editable": "_bsy-mobile-editor__editable_dfbcr_73",
|
|
143
|
+
"bsy-mobile-editor__image-shell": "_bsy-mobile-editor__image-shell_dfbcr_243",
|
|
144
|
+
"bsy-mobile-editor__image": "_bsy-mobile-editor__image_dfbcr_243",
|
|
145
|
+
"bsy-mobile-editor__image-mask": "_bsy-mobile-editor__image-mask_dfbcr_265",
|
|
146
|
+
"bsy-mobile-editor__image-progress": "_bsy-mobile-editor__image-progress_dfbcr_274",
|
|
147
|
+
"bsy-mobile-editor__image-progress--spin": "_bsy-mobile-editor__image-progress--spin_dfbcr_277",
|
|
148
|
+
"bsy-mobile-editor-progress-spin": "_bsy-mobile-editor-progress-spin_dfbcr_1",
|
|
149
|
+
"bsy-mobile-editor__toolbar": "_bsy-mobile-editor__toolbar_dfbcr_280",
|
|
150
|
+
"bsy-mobile-editor__toolbar-scroller": "_bsy-mobile-editor__toolbar-scroller_dfbcr_295",
|
|
151
|
+
"bsy-mobile-editor__toolbar-track": "_bsy-mobile-editor__toolbar-track_dfbcr_312",
|
|
152
|
+
"bsy-mobile-editor__toolbar-thumb": "_bsy-mobile-editor__toolbar-thumb_dfbcr_324",
|
|
153
|
+
"bsy-mobile-editor__toolbar-group": "_bsy-mobile-editor__toolbar-group_dfbcr_329",
|
|
154
|
+
"bsy-mobile-editor__toolbar-divider": "_bsy-mobile-editor__toolbar-divider_dfbcr_335",
|
|
155
|
+
"bsy-mobile-editor__tool": "_bsy-mobile-editor__tool_dfbcr_280",
|
|
156
|
+
"bsy-mobile-editor__tool--active": "_bsy-mobile-editor__tool--active_dfbcr_356",
|
|
157
|
+
"bsy-mobile-editor__tool--select": "_bsy-mobile-editor__tool--select_dfbcr_363",
|
|
158
|
+
"bsy-mobile-editor__tool--select-align": "_bsy-mobile-editor__tool--select-align_dfbcr_368",
|
|
159
|
+
"bsy-mobile-editor__tool-caret": "_bsy-mobile-editor__tool-caret_dfbcr_371",
|
|
160
|
+
"bsy-mobile-editor__tool-caret--open": "_bsy-mobile-editor__tool-caret--open_dfbcr_374",
|
|
161
|
+
"bsy-mobile-editor__ai-icon": "_bsy-mobile-editor__ai-icon_dfbcr_377",
|
|
162
|
+
"bsy-mobile-editor__tool-text": "_bsy-mobile-editor__tool-text_dfbcr_382",
|
|
163
|
+
"bsy-mobile-editor__color": "_bsy-mobile-editor__color_dfbcr_387",
|
|
164
|
+
"bsy-mobile-editor__color--custom": "_bsy-mobile-editor__color--custom_dfbcr_395",
|
|
165
|
+
"bsy-mobile-editor__color-header": "_bsy-mobile-editor__color-header_dfbcr_398",
|
|
166
|
+
"bsy-mobile-editor__color-header-title": "_bsy-mobile-editor__color-header-title_dfbcr_407",
|
|
167
|
+
"bsy-mobile-editor__color-header-back": "_bsy-mobile-editor__color-header-back_dfbcr_420",
|
|
168
|
+
"bsy-mobile-editor__color-grid": "_bsy-mobile-editor__color-grid_dfbcr_434",
|
|
169
|
+
"bsy-mobile-editor__color-swatch": "_bsy-mobile-editor__color-swatch_dfbcr_441",
|
|
170
|
+
"bsy-mobile-editor__color-none": "_bsy-mobile-editor__color-none_dfbcr_441",
|
|
171
|
+
"bsy-mobile-editor__color-custom-item": "_bsy-mobile-editor__color-custom-item_dfbcr_441",
|
|
172
|
+
"bsy-mobile-editor__color-swatch--selected": "_bsy-mobile-editor__color-swatch--selected_dfbcr_457",
|
|
173
|
+
"bsy-mobile-editor__color-none--selected": "_bsy-mobile-editor__color-none--selected_dfbcr_457",
|
|
174
|
+
"bsy-mobile-editor__color-custom-item--selected": "_bsy-mobile-editor__color-custom-item--selected_dfbcr_457",
|
|
175
|
+
"bsy-mobile-editor__color-swatch-fill": "_bsy-mobile-editor__color-swatch-fill_dfbcr_471",
|
|
176
|
+
"bsy-mobile-editor__color-bar": "_bsy-mobile-editor__color-bar_dfbcr_478",
|
|
177
|
+
"bsy-mobile-editor__color-custom-trigger": "_bsy-mobile-editor__color-custom-trigger_dfbcr_484",
|
|
178
|
+
"bsy-mobile-editor__color-custom-trigger--active": "_bsy-mobile-editor__color-custom-trigger--active_dfbcr_502",
|
|
179
|
+
"bsy-mobile-editor__color-custom-trigger--preview": "_bsy-mobile-editor__color-custom-trigger--preview_dfbcr_507",
|
|
180
|
+
"bsy-mobile-editor__color-custom-list": "_bsy-mobile-editor__color-custom-list_dfbcr_522",
|
|
181
|
+
"bsy-mobile-editor__color-mixer": "_bsy-mobile-editor__color-mixer_dfbcr_542",
|
|
182
|
+
"bsy-mobile-editor__color-spectrum": "_bsy-mobile-editor__color-spectrum_dfbcr_545",
|
|
183
|
+
"bsy-mobile-editor__color-spectrum-canvas": "_bsy-mobile-editor__color-spectrum-canvas_dfbcr_553",
|
|
184
|
+
"bsy-mobile-editor__color-thumb": "_bsy-mobile-editor__color-thumb_dfbcr_560",
|
|
185
|
+
"bsy-mobile-editor__sheet": "_bsy-mobile-editor__sheet_dfbcr_570",
|
|
186
|
+
"bsy-mobile-editor__sheet-body": "_bsy-mobile-editor__sheet-body_dfbcr_576",
|
|
187
|
+
"bsy-mobile-editor__sheet-body--stack": "_bsy-mobile-editor__sheet-body--stack_dfbcr_581",
|
|
188
|
+
"bsy-mobile-editor__sheet-field": "_bsy-mobile-editor__sheet-field_dfbcr_586",
|
|
189
|
+
"bsy-mobile-editor__sheet-label": "_bsy-mobile-editor__sheet-label_dfbcr_591",
|
|
190
|
+
"bsy-mobile-editor__sheet-note": "_bsy-mobile-editor__sheet-note_dfbcr_597",
|
|
191
|
+
"bsy-mobile-editor__sheet-note--hint": "_bsy-mobile-editor__sheet-note--hint_dfbcr_603",
|
|
192
|
+
"bsy-mobile-editor__sheet-error": "_bsy-mobile-editor__sheet-error_dfbcr_606",
|
|
193
|
+
"bsy-mobile-editor__sheet-bar": "_bsy-mobile-editor__sheet-bar_dfbcr_626",
|
|
194
|
+
"bsy-mobile-editor__sheet-ok": "_bsy-mobile-editor__sheet-ok_dfbcr_647",
|
|
195
|
+
"bsy-mobile-editor__check": "_bsy-mobile-editor__check_dfbcr_652",
|
|
196
|
+
"bsy-mobile-editor__check-input": "_bsy-mobile-editor__check-input_dfbcr_664",
|
|
197
|
+
"bsy-mobile-editor__check-box": "_bsy-mobile-editor__check-box_dfbcr_671",
|
|
198
|
+
"bsy-mobile-editor__ai": "_bsy-mobile-editor__ai_dfbcr_377",
|
|
199
|
+
"bsy-mobile-editor__ai-body": "_bsy-mobile-editor__ai-body_dfbcr_693",
|
|
200
|
+
"bsy-mobile-editor__ai-section": "_bsy-mobile-editor__ai-section_dfbcr_701",
|
|
201
|
+
"bsy-mobile-editor__ai-section-head": "_bsy-mobile-editor__ai-section-head_dfbcr_709",
|
|
202
|
+
"bsy-mobile-editor__ai-section-scroll": "_bsy-mobile-editor__ai-section-scroll_dfbcr_717",
|
|
203
|
+
"bsy-mobile-editor__ai-label": "_bsy-mobile-editor__ai-label_dfbcr_724",
|
|
204
|
+
"bsy-mobile-editor__ai-label--after": "_bsy-mobile-editor__ai-label--after_dfbcr_736",
|
|
205
|
+
"bsy-mobile-editor__ai-label--before": "_bsy-mobile-editor__ai-label--before_dfbcr_740",
|
|
206
|
+
"bsy-mobile-editor__ai-dot": "_bsy-mobile-editor__ai-dot_dfbcr_744",
|
|
207
|
+
"bsy-mobile-editor__ai-split": "_bsy-mobile-editor__ai-split_dfbcr_751",
|
|
208
|
+
"bsy-mobile-editor__ai-preset": "_bsy-mobile-editor__ai-preset_dfbcr_757",
|
|
209
|
+
"bsy-mobile-editor__ai-think-pin": "_bsy-mobile-editor__ai-think-pin_dfbcr_777",
|
|
210
|
+
"bsy-mobile-editor__ai-think-head": "_bsy-mobile-editor__ai-think-head_dfbcr_781",
|
|
211
|
+
"bsy-mobile-editor__ai-think-label": "_bsy-mobile-editor__ai-think-label_dfbcr_798",
|
|
212
|
+
"bsy-mobile-editor__ai-think-label--shimmer": "_bsy-mobile-editor__ai-think-label--shimmer_dfbcr_802",
|
|
213
|
+
"bsy-mobile-ai-think-shimmer": "_bsy-mobile-ai-think-shimmer_dfbcr_1",
|
|
214
|
+
"bsy-mobile-editor__ai-think-arrow": "_bsy-mobile-editor__ai-think-arrow_dfbcr_813",
|
|
215
|
+
"bsy-mobile-editor__ai-think-arrow--open": "_bsy-mobile-editor__ai-think-arrow--open_dfbcr_820",
|
|
216
|
+
"bsy-mobile-editor__ai-think-icon": "_bsy-mobile-editor__ai-think-icon_dfbcr_823",
|
|
217
|
+
"bsy-mobile-ai-think": "_bsy-mobile-ai-think_dfbcr_1",
|
|
218
|
+
"bsy-mobile-editor__ai-think-body": "_bsy-mobile-editor__ai-think-body_dfbcr_835",
|
|
219
|
+
"bsy-mobile-editor__ai-error": "_bsy-mobile-editor__ai-error_dfbcr_844",
|
|
220
|
+
"bsy-mobile-editor__ai-footer": "_bsy-mobile-editor__ai-footer_dfbcr_849",
|
|
221
|
+
"bsy-mobile-editor__ai-footer-ok": "_bsy-mobile-editor__ai-footer-ok_dfbcr_871"
|
|
222
|
+
}, yt = {
|
|
223
223
|
typeset: [
|
|
224
224
|
"你是一名专业的 HTML 文档排版引擎。输入已是 HTML 片段。",
|
|
225
225
|
"任务:在不改内容层(措辞、语序、修辞、情感色彩)的前提下,做形式层 + 视觉层优化,充分利用富文本能力(标题、列表、加粗、字色、背景色、缩进、对齐)。",
|
|
@@ -283,7 +283,7 @@ var st = [
|
|
|
283
283
|
literary: "语气:更书面、文学感(适配小说、散文、高级文案)。\n规则:若主语言为中文,允许四字格;若为英文,允许复杂从句和排比;不改变原风格基调。",
|
|
284
284
|
retro: "语气:带一点复古书面色彩,仍保持现代可读。\n规则:仅当主语言为中文时生效:仿民国白话风(之/其/乃);其他语言自动降级为 literary。"
|
|
285
285
|
}
|
|
286
|
-
},
|
|
286
|
+
}, bt = yt.typeset.join("\n"), xt = yt.polishSystem.join("\n"), St = (e) => `${xt}\n\n【本轮风格】\n${yt.polish[e] ?? yt.polish.quick}`, Ct = (e) => {
|
|
287
287
|
if (!e.trim()) return {
|
|
288
288
|
html: e,
|
|
289
289
|
blocks: []
|
|
@@ -298,16 +298,16 @@ var st = [
|
|
|
298
298
|
html: t.body.innerHTML,
|
|
299
299
|
blocks: n
|
|
300
300
|
};
|
|
301
|
-
},
|
|
301
|
+
}, wt = "<!--bsy-block-->", Tt = /<!--bsy-code-(\d+)-->/g, Et = "bsy-html-root", Dt = (e) => new DOMParser().parseFromString(`<${Et}>${e}</${Et}>`, "text/html").body.querySelector(Et), Ot = (e, t) => {
|
|
302
302
|
if (!t.length) return e;
|
|
303
|
-
let n = /* @__PURE__ */ new Set(), r = e.replace(
|
|
303
|
+
let n = /* @__PURE__ */ new Set(), r = e.replace(Tt, (e, r) => {
|
|
304
304
|
let i = Number(r), a = t[i];
|
|
305
305
|
return a === void 0 ? "" : (n.add(i), a);
|
|
306
306
|
}), i = t.filter((e, t) => !n.has(t)).join("");
|
|
307
307
|
return i ? `${r}${i}` : r;
|
|
308
|
-
},
|
|
308
|
+
}, kt = (e) => {
|
|
309
309
|
if (!/<pre[\s>/]/i.test(e)) return e;
|
|
310
|
-
let t =
|
|
310
|
+
let t = Dt(e);
|
|
311
311
|
if (!t) return e;
|
|
312
312
|
let n = t.ownerDocument;
|
|
313
313
|
for (let e of Array.from(t.querySelectorAll("pre"))) {
|
|
@@ -315,25 +315,35 @@ var st = [
|
|
|
315
315
|
e.replaceWith(t);
|
|
316
316
|
}
|
|
317
317
|
return t.innerHTML.replace(/<!--bsy-code-dropped-->/g, "");
|
|
318
|
-
},
|
|
319
|
-
if (!e.trim() || !
|
|
320
|
-
let t =
|
|
318
|
+
}, At = (e, t) => Ot(kt(e), t), jt = "p, h1, h2, h3, li", Mt = /background(-color)?\s*:/i, Nt = (e) => {
|
|
319
|
+
if (!e.trim() || !Mt.test(e)) return e;
|
|
320
|
+
let t = Dt(e);
|
|
321
321
|
if (!t) return e;
|
|
322
|
-
for (let e of Array.from(t.querySelectorAll(
|
|
322
|
+
for (let e of Array.from(t.querySelectorAll(jt))) {
|
|
323
323
|
let t = e;
|
|
324
324
|
t.style.removeProperty("background-color"), t.style.removeProperty("background"), t.getAttribute("style")?.trim() || t.removeAttribute("style");
|
|
325
325
|
}
|
|
326
326
|
return t.innerHTML;
|
|
327
|
-
},
|
|
327
|
+
}, Pt = "--listitem-marker-font-size", Ft = `max(24px, calc(var(${Pt}, 1em) * 1.25))`, It = new Set([
|
|
328
328
|
"U",
|
|
329
329
|
"I",
|
|
330
330
|
"EM",
|
|
331
331
|
"B",
|
|
332
332
|
"STRONG"
|
|
333
|
-
]),
|
|
333
|
+
]), Lt = (e) => e.startsWith("--listitem-marker-"), Rt = [
|
|
334
|
+
["fontSize", Pt],
|
|
335
|
+
["color", "--listitem-marker-color"],
|
|
336
|
+
["backgroundColor", "--listitem-marker-background-color"],
|
|
337
|
+
["fontFamily", "--listitem-marker-font-family"]
|
|
338
|
+
], zt = (e) => {
|
|
334
339
|
let t = e.style.fontSize;
|
|
335
|
-
if (t)
|
|
336
|
-
|
|
340
|
+
if (Rt.some(([t]) => e.style[t])) {
|
|
341
|
+
for (let n = e.parentElement; n; n = n.parentElement) if (t && It.has(n.tagName) && !n.style.fontSize && (n.style.fontSize = t), !(n.tagName !== "LI" || n.classList.contains("editor-nested-listitem"))) for (let [t, r] of Rt) {
|
|
342
|
+
let i = e.style[t];
|
|
343
|
+
i && !n.style.getPropertyValue(r) && n.style.setProperty(r, i);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}, Bt = (e, t, n, r) => {
|
|
337
347
|
if (!e) return;
|
|
338
348
|
let i = e.shadowRoot ?? e.attachShadow({ mode: "open" }), a = document.createElement("div");
|
|
339
349
|
a.className = "bsy-editor-html-preview__body", a.innerHTML = n(t);
|
|
@@ -344,18 +354,18 @@ var st = [
|
|
|
344
354
|
}
|
|
345
355
|
let o = document.createElement("style");
|
|
346
356
|
o.textContent = r, i.replaceChildren(o, a);
|
|
347
|
-
},
|
|
357
|
+
}, Vt = [
|
|
348
358
|
"color",
|
|
349
359
|
"background-color",
|
|
350
360
|
"font-size",
|
|
351
361
|
"font-family",
|
|
352
362
|
"font-weight",
|
|
353
363
|
"text-decoration"
|
|
354
|
-
],
|
|
364
|
+
], Ht = (e) => {
|
|
355
365
|
let t = e.body.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, td, th");
|
|
356
366
|
for (let n of Array.from(t)) {
|
|
357
367
|
let t = n, r = [];
|
|
358
|
-
for (let e of
|
|
368
|
+
for (let e of Vt) {
|
|
359
369
|
let n = t.style.getPropertyValue(e);
|
|
360
370
|
n && (r.push(`${e}: ${n}`), t.style.removeProperty(e));
|
|
361
371
|
}
|
|
@@ -373,34 +383,34 @@ var st = [
|
|
|
373
383
|
}
|
|
374
384
|
}
|
|
375
385
|
}
|
|
376
|
-
},
|
|
386
|
+
}, Ut = (e, t) => {
|
|
377
387
|
let n = I();
|
|
378
388
|
if (n.clear(), t.trim()) {
|
|
379
389
|
let r = new DOMParser().parseFromString(t, "text/html");
|
|
380
|
-
|
|
381
|
-
let i =
|
|
390
|
+
Ht(r);
|
|
391
|
+
let i = nt(e, r);
|
|
382
392
|
if (i.length) {
|
|
383
393
|
n.select(), be(i), Oe(null);
|
|
384
394
|
return;
|
|
385
395
|
}
|
|
386
396
|
}
|
|
387
|
-
let r =
|
|
397
|
+
let r = F();
|
|
388
398
|
n.append(r), Oe(null);
|
|
389
|
-
},
|
|
399
|
+
}, Wt = (e) => {
|
|
390
400
|
if (e) {
|
|
391
401
|
I().selectStart();
|
|
392
402
|
return;
|
|
393
403
|
}
|
|
394
404
|
Oe(null);
|
|
395
|
-
},
|
|
405
|
+
}, Gt = (e) => {
|
|
396
406
|
e && Oe(e.clone());
|
|
397
|
-
},
|
|
407
|
+
}, Kt = () => {
|
|
398
408
|
L() === null && I().selectStart();
|
|
399
409
|
}, H = (e) => {
|
|
400
410
|
e.isEditable() || e.setEditable(!0), e.update(() => {
|
|
401
|
-
|
|
411
|
+
Kt();
|
|
402
412
|
}), e.focus(void 0, { defaultSelection: "rootStart" });
|
|
403
|
-
},
|
|
413
|
+
}, qt = (e, t) => !t.trim() && (e === "<p><br></p>" || e === "<p></p>" || e === "" || /^<p>\s*<br>\s*<\/p>$/.test(e)), Jt = /* @__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("."), Yt = [
|
|
404
414
|
"href",
|
|
405
415
|
"src",
|
|
406
416
|
"alt",
|
|
@@ -416,12 +426,12 @@ var st = [
|
|
|
416
426
|
"style",
|
|
417
427
|
"width",
|
|
418
428
|
"height"
|
|
419
|
-
],
|
|
429
|
+
], Xt = 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.margin-inline-start.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(".")), Zt = /^(?:(?:(?:f|ht)tps?|mailto|blob):|data:image\/[a-z0-9.+-]+[;,].*|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i, Qt = new Set([
|
|
420
430
|
"pre",
|
|
421
431
|
"code",
|
|
422
432
|
"td",
|
|
423
433
|
"th"
|
|
424
|
-
]),
|
|
434
|
+
]), $t = new Set(["pre", "code"]), en = new Set(["sup", "sub"]), tn = (e, t) => Lt(e) ? t === "li" : Xt.has(e) ? e === "padding-inline-start" ? !0 : e === "padding" || e.startsWith("padding-") ? Qt.has(t) : e === "border-radius" ? $t.has(t) : e === "position" || e === "top" || e === "bottom" ? en.has(t) : !0 : !1, nn = (e, t) => e.split(";").map((e) => e.trim()).filter(Boolean).map((e) => {
|
|
425
435
|
let n = e.indexOf(":");
|
|
426
436
|
if (n === -1) return null;
|
|
427
437
|
let r = e.slice(0, n).trim().toLowerCase(), i = e.slice(n + 1).trim();
|
|
@@ -429,30 +439,30 @@ var st = [
|
|
|
429
439
|
if (/url\s*\(/i.test(i)) return null;
|
|
430
440
|
r = "background-color";
|
|
431
441
|
}
|
|
432
|
-
return !
|
|
433
|
-
}).filter((e) => e !== null).join("; "),
|
|
434
|
-
|
|
442
|
+
return !tn(r, t) || /expression|javascript:|url\s*\(\s*['"]?\s*javascript/i.test(i) ? null : `${r}: ${i}`;
|
|
443
|
+
}).filter((e) => e !== null).join("; "), rn = !1, an = () => {
|
|
444
|
+
rn ||= (rt.addHook("uponSanitizeAttribute", (e, t) => {
|
|
435
445
|
if (t.attrName === "href" && /^data:/i.test(t.attrValue)) {
|
|
436
446
|
t.keepAttr = !1;
|
|
437
447
|
return;
|
|
438
448
|
}
|
|
439
|
-
t.attrName === "style" && (t.attrValue =
|
|
449
|
+
t.attrName === "style" && (t.attrValue = nn(t.attrValue, e.nodeName.toLowerCase()), t.attrValue || (t.keepAttr = !1));
|
|
440
450
|
}), !0);
|
|
441
|
-
}, U = (e) => e ? (
|
|
442
|
-
ALLOWED_TAGS:
|
|
443
|
-
ALLOWED_ATTR:
|
|
451
|
+
}, U = (e) => e ? (an(), rt.sanitize(e, {
|
|
452
|
+
ALLOWED_TAGS: Jt,
|
|
453
|
+
ALLOWED_ATTR: Yt,
|
|
444
454
|
ALLOW_DATA_ATTR: !1,
|
|
445
455
|
ADD_ATTR: [
|
|
446
456
|
"data-language",
|
|
447
457
|
"data-id",
|
|
448
458
|
"data-src"
|
|
449
459
|
],
|
|
450
|
-
ALLOWED_URI_REGEXP:
|
|
460
|
+
ALLOWED_URI_REGEXP: Zt
|
|
451
461
|
})) : "", W = {
|
|
452
462
|
margin: "0.6em 0 0.4em",
|
|
453
463
|
"font-weight": "600",
|
|
454
464
|
"line-height": "1.35"
|
|
455
|
-
},
|
|
465
|
+
}, on = {
|
|
456
466
|
h1: {
|
|
457
467
|
...W,
|
|
458
468
|
"font-size": "2em"
|
|
@@ -477,26 +487,26 @@ var st = [
|
|
|
477
487
|
...W,
|
|
478
488
|
"font-size": "0.875em"
|
|
479
489
|
}
|
|
480
|
-
},
|
|
490
|
+
}, sn = {
|
|
481
491
|
color: "#0269ff",
|
|
482
492
|
cursor: "pointer"
|
|
483
|
-
},
|
|
493
|
+
}, cn = {
|
|
484
494
|
margin: "0",
|
|
485
495
|
"padding-inline-start": "0",
|
|
486
496
|
"list-style-position": "outside"
|
|
487
|
-
},
|
|
497
|
+
}, ln = [
|
|
488
498
|
"disc",
|
|
489
499
|
"circle",
|
|
490
500
|
"square"
|
|
491
|
-
],
|
|
501
|
+
], un = {
|
|
492
502
|
margin: "0",
|
|
493
|
-
"margin-inline-start":
|
|
503
|
+
"margin-inline-start": Ft,
|
|
494
504
|
"list-style": "inherit"
|
|
495
|
-
},
|
|
505
|
+
}, dn = {
|
|
496
506
|
margin: "0",
|
|
497
507
|
"margin-inline-start": "0",
|
|
498
508
|
"list-style-type": "none"
|
|
499
|
-
},
|
|
509
|
+
}, fn = {
|
|
500
510
|
display: "block",
|
|
501
511
|
"box-sizing": "border-box",
|
|
502
512
|
"max-width": "100%",
|
|
@@ -511,23 +521,23 @@ var st = [
|
|
|
511
521
|
"border-radius": "4px",
|
|
512
522
|
"background-color": "rgb(240, 242, 245)",
|
|
513
523
|
color: "#1f2328"
|
|
514
|
-
},
|
|
524
|
+
}, pn = {
|
|
515
525
|
"border-collapse": "collapse",
|
|
516
526
|
"table-layout": "fixed",
|
|
517
527
|
width: "100%",
|
|
518
528
|
"overflow-x": "auto",
|
|
519
529
|
margin: "8px 0"
|
|
520
|
-
},
|
|
530
|
+
}, mn = {
|
|
521
531
|
"box-sizing": "border-box",
|
|
522
532
|
"min-width": "75px",
|
|
523
533
|
"min-height": "32px",
|
|
524
534
|
padding: "4px 8px",
|
|
525
535
|
border: "1px solid #d9d9d9",
|
|
526
536
|
"vertical-align": "top"
|
|
527
|
-
},
|
|
537
|
+
}, hn = {
|
|
528
538
|
"font-weight": "600",
|
|
529
539
|
"background-color": "#f2f3f5"
|
|
530
|
-
},
|
|
540
|
+
}, gn = {
|
|
531
541
|
display: "inline-block",
|
|
532
542
|
position: "static",
|
|
533
543
|
top: "auto",
|
|
@@ -536,39 +546,39 @@ var st = [
|
|
|
536
546
|
"line-height": "1"
|
|
537
547
|
}, G = (e, t) => {
|
|
538
548
|
for (let [n, r] of Object.entries(t)) e.style.getPropertyValue(n) || e.style.setProperty(n, r);
|
|
539
|
-
},
|
|
549
|
+
}, _n = (e) => {
|
|
540
550
|
let t = 0, n = e;
|
|
541
551
|
for (; n;) n.tagName === "UL" && (t += 1), n = n.parentElement;
|
|
542
552
|
return t;
|
|
543
|
-
},
|
|
553
|
+
}, vn = (e) => {
|
|
544
554
|
let t = [...e.querySelectorAll("*")].filter((e) => e instanceof HTMLElement);
|
|
545
|
-
for (let e of t)
|
|
555
|
+
for (let e of t) zt(e);
|
|
546
556
|
for (let e of t) {
|
|
547
|
-
let t = e.tagName.toLowerCase(), n =
|
|
548
|
-
if (n && G(e, n), t === "a" && G(e,
|
|
549
|
-
let t = Math.min(Math.max(
|
|
557
|
+
let t = e.tagName.toLowerCase(), n = on[t];
|
|
558
|
+
if (n && G(e, n), t === "a" && G(e, sn), t === "ul") {
|
|
559
|
+
let t = Math.min(Math.max(_n(e), 1), ln.length);
|
|
550
560
|
G(e, {
|
|
551
|
-
...
|
|
552
|
-
"list-style-type":
|
|
561
|
+
...cn,
|
|
562
|
+
"list-style-type": ln[t - 1]
|
|
553
563
|
});
|
|
554
564
|
}
|
|
555
565
|
t === "ol" && G(e, {
|
|
556
|
-
...
|
|
566
|
+
...cn,
|
|
557
567
|
"list-style-type": "decimal"
|
|
558
|
-
}), t === "li" && G(e, e.classList.contains("editor-nested-listitem") ?
|
|
559
|
-
...
|
|
568
|
+
}), t === "li" && G(e, e.classList.contains("editor-nested-listitem") ? dn : un), t === "pre" && G(e, fn), (t === "sup" || t === "sub") && G(e, {
|
|
569
|
+
...gn,
|
|
560
570
|
"vertical-align": t === "sup" ? "super" : "sub"
|
|
561
|
-
}), t === "table" && G(e,
|
|
571
|
+
}), t === "table" && G(e, pn), (t === "td" || t === "th") && (G(e, mn), (t === "th" || e.classList.contains("editor-table-cell-header")) && G(e, hn)), e.classList.contains("editor-text-underline-strikethrough") ? G(e, { "text-decoration": "underline line-through" }) : e.classList.contains("editor-text-underline") ? G(e, { "text-decoration": "underline" }) : e.classList.contains("editor-text-strikethrough") && G(e, { "text-decoration": "line-through" });
|
|
562
572
|
for (let t of Array.from(e.classList)) t.startsWith("editor-") && e.classList.remove(t);
|
|
563
573
|
e.classList.length === 0 && e.removeAttribute("class");
|
|
564
574
|
}
|
|
565
|
-
},
|
|
575
|
+
}, yn = (e) => {
|
|
566
576
|
let t = e.parentNode;
|
|
567
577
|
if (t) {
|
|
568
578
|
for (; e.firstChild;) t.insertBefore(e.firstChild, e);
|
|
569
579
|
t.removeChild(e);
|
|
570
580
|
}
|
|
571
|
-
},
|
|
581
|
+
}, bn = (e) => {
|
|
572
582
|
let t = !0;
|
|
573
583
|
for (; t;) {
|
|
574
584
|
t = !1;
|
|
@@ -576,21 +586,21 @@ var st = [
|
|
|
576
586
|
if (n.attributes.length > 0) continue;
|
|
577
587
|
let e = n.tagName.toLowerCase();
|
|
578
588
|
if (e === "span") {
|
|
579
|
-
|
|
589
|
+
yn(n), t = !0;
|
|
580
590
|
continue;
|
|
581
591
|
}
|
|
582
592
|
if (n.childElementCount !== 1 || n.childNodes.length !== 1) continue;
|
|
583
593
|
let r = n.firstElementChild;
|
|
584
|
-
(e === "b" && r?.tagName === "STRONG" || e === "i" && r?.tagName === "EM") && (
|
|
594
|
+
(e === "b" && r?.tagName === "STRONG" || e === "i" && r?.tagName === "EM") && (yn(n), t = !0);
|
|
585
595
|
}
|
|
586
596
|
}
|
|
587
|
-
},
|
|
597
|
+
}, xn = (e) => {
|
|
588
598
|
if (!e.trim()) return e;
|
|
589
599
|
let t = new DOMParser().parseFromString(e, "text/html");
|
|
590
|
-
|
|
600
|
+
vn(t.body), bn(t.body);
|
|
591
601
|
for (let e of Array.from(t.body.querySelectorAll("pre"))) e.textContent?.trim() || e.remove();
|
|
592
602
|
return t.body.innerHTML;
|
|
593
|
-
},
|
|
603
|
+
}, Sn = (e) => e ? new DOMParser().parseFromString(e, "text/html").body.textContent ?? "" : "", Cn = (e) => e.includes("<!--bsy-block-->") ? e.split(wt).map((e) => e.trim()) : [e], wn = (e) => e.split(wt).join("").trim().length > 0, Tn = (e, t) => {
|
|
594
604
|
let n = e.map(() => "");
|
|
595
605
|
if (e.length === 0) return n;
|
|
596
606
|
let r = [], i = [];
|
|
@@ -603,7 +613,7 @@ var st = [
|
|
|
603
613
|
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);
|
|
604
614
|
for (; d < c;) n[n.length - 1] += o[d], d += 1;
|
|
605
615
|
return n;
|
|
606
|
-
},
|
|
616
|
+
}, En = new Set([
|
|
607
617
|
"TABLE",
|
|
608
618
|
"THEAD",
|
|
609
619
|
"TBODY",
|
|
@@ -612,7 +622,7 @@ var st = [
|
|
|
612
622
|
"TH",
|
|
613
623
|
"IMG",
|
|
614
624
|
"BR"
|
|
615
|
-
]),
|
|
625
|
+
]), Dn = (e) => {
|
|
616
626
|
let t = [], n = (e) => {
|
|
617
627
|
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
618
628
|
if (e.tagName === "PRE") return;
|
|
@@ -622,25 +632,25 @@ var st = [
|
|
|
622
632
|
e.nodeType === Node.TEXT_NODE && t.push(e);
|
|
623
633
|
};
|
|
624
634
|
return n(e), t;
|
|
625
|
-
},
|
|
635
|
+
}, On = (e, t) => {
|
|
626
636
|
let n = e;
|
|
627
|
-
for (; n && n !== t && !
|
|
637
|
+
for (; n && n !== t && !En.has(n.tagName) && !(n.textContent ?? "").trim() && !n.querySelector("img, table, br");) {
|
|
628
638
|
let e = n.parentElement;
|
|
629
639
|
n.remove(), n = e;
|
|
630
640
|
}
|
|
631
|
-
},
|
|
641
|
+
}, kn = (e) => {
|
|
632
642
|
let t = e.tagName;
|
|
633
643
|
return t === "IMG" || t === "TABLE" || t === "PRE";
|
|
634
|
-
},
|
|
635
|
-
let t =
|
|
636
|
-
return t ? Array.from(t.children).filter((e) => !
|
|
637
|
-
},
|
|
638
|
-
let n =
|
|
644
|
+
}, An = (e) => {
|
|
645
|
+
let t = Dt(e);
|
|
646
|
+
return t ? Array.from(t.children).filter((e) => !kn(e)).map((e) => e.textContent ?? "") : [];
|
|
647
|
+
}, jn = (e) => e.includes("<!--bsy-block-->") ? e : Sn(e) || e, Mn = (e, t) => {
|
|
648
|
+
let n = Dn(e);
|
|
639
649
|
if (n.length === 0) {
|
|
640
650
|
t && (e.querySelector("br")?.remove(), e.append(e.ownerDocument.createTextNode(t)));
|
|
641
651
|
return;
|
|
642
652
|
}
|
|
643
|
-
let r =
|
|
653
|
+
let r = Tn(n.map((e) => e.textContent ?? ""), t);
|
|
644
654
|
for (let t = 0; t < n.length; t++) {
|
|
645
655
|
let i = r[t], a = n[t];
|
|
646
656
|
if (i) {
|
|
@@ -648,51 +658,51 @@ var st = [
|
|
|
648
658
|
continue;
|
|
649
659
|
}
|
|
650
660
|
let o = a.parentElement;
|
|
651
|
-
a.remove(),
|
|
661
|
+
a.remove(), On(o, e);
|
|
652
662
|
}
|
|
653
|
-
},
|
|
654
|
-
let n =
|
|
655
|
-
if (!
|
|
656
|
-
let r =
|
|
663
|
+
}, Nn = (e, t) => {
|
|
664
|
+
let n = jn(t);
|
|
665
|
+
if (!wn(n) || !e.trim()) return "";
|
|
666
|
+
let r = Dt(e);
|
|
657
667
|
if (!r) return "";
|
|
658
|
-
let i = Array.from(r.children).filter((e) => !
|
|
668
|
+
let i = Array.from(r.children).filter((e) => !kn(e));
|
|
659
669
|
if (i.length === 0) return "";
|
|
660
|
-
let a =
|
|
661
|
-
for (let e = 0; e < i.length; e++)
|
|
670
|
+
let a = Cn(n), o = a.length === i.length ? a : Tn(i.map((e) => e.textContent ?? ""), a.join(""));
|
|
671
|
+
for (let e = 0; e < i.length; e++) Mn(i[e], o[e] ?? "");
|
|
662
672
|
return r.innerHTML;
|
|
663
|
-
},
|
|
673
|
+
}, Pn = (e, t) => {
|
|
664
674
|
let n = "";
|
|
665
675
|
e.getEditorState().read(() => {
|
|
666
|
-
n =
|
|
676
|
+
n = xn(U(tt(e, null)));
|
|
667
677
|
}, { editor: e });
|
|
668
|
-
let r = U(
|
|
669
|
-
return !r.trim() ||
|
|
670
|
-
|
|
678
|
+
let r = U(Nn(n, t));
|
|
679
|
+
return !r.trim() || qt(r, Sn(r)) ? !1 : (e.update(() => {
|
|
680
|
+
Ut(e, r), Wt(!0);
|
|
671
681
|
}, { discrete: !0 }), !0);
|
|
672
|
-
},
|
|
682
|
+
}, Fn = /^\uFEFF/, In = /^ {0,3}`{1,3}[A-Za-z]*$/, Ln = /^( {0,3})([^`<]*?)```[ \t]*([A-Za-z0-9_-]*)[ \t]*(.*)$/, Rn = /^ {0,3}```[ \t]*$/, zn = /<\/?[a-zA-Z]/, Bn = /<[a-zA-Z!]/, Vn = (e) => Bn.test(e), Hn = (e) => zn.test(e), Un = (e) => e.replace(Fn, "").replace(/\r\n/g, "\n"), Wn = (e) => {
|
|
673
683
|
let t = e.replace(/\n+$/, ""), n = t.lastIndexOf("\n"), r = n === -1 ? t : t.slice(n + 1);
|
|
674
|
-
return
|
|
684
|
+
return In.test(r) ? {
|
|
675
685
|
text: n === -1 ? "" : t.slice(0, n),
|
|
676
686
|
withheld: !0
|
|
677
687
|
} : {
|
|
678
688
|
text: e,
|
|
679
689
|
withheld: !1
|
|
680
690
|
};
|
|
681
|
-
},
|
|
682
|
-
let t =
|
|
691
|
+
}, Gn = (e) => {
|
|
692
|
+
let t = Ln.exec(e);
|
|
683
693
|
return t ? { sameLineBody: t[4] ?? "" } : null;
|
|
684
|
-
},
|
|
694
|
+
}, Kn = (e) => {
|
|
685
695
|
let t = e.replace(/[ \t]*```[ \t]*$/, "");
|
|
686
696
|
return t === e ? e : t;
|
|
687
|
-
},
|
|
697
|
+
}, qn = (e) => Vn(e) ? e.replace(/^\n/, "") : "", Jn = (e) => {
|
|
688
698
|
let t = e.split("\n"), n = [], r = 0;
|
|
689
699
|
for (; r < t.length;) {
|
|
690
|
-
let e = t[r], i =
|
|
700
|
+
let e = t[r], i = Gn(e);
|
|
691
701
|
if (i) {
|
|
692
702
|
let e = i.sameLineBody;
|
|
693
|
-
if (e !==
|
|
694
|
-
e =
|
|
695
|
-
let i =
|
|
703
|
+
if (e !== Kn(e)) {
|
|
704
|
+
e = Kn(e);
|
|
705
|
+
let i = qn(t.slice(r + 1).join("\n"));
|
|
696
706
|
return [
|
|
697
707
|
...n,
|
|
698
708
|
e,
|
|
@@ -700,63 +710,63 @@ var st = [
|
|
|
700
710
|
].filter(Boolean).join("\n");
|
|
701
711
|
}
|
|
702
712
|
let a = [];
|
|
703
|
-
for (e && a.push(e), r += 1; r < t.length && !
|
|
704
|
-
let o = r < t.length ?
|
|
713
|
+
for (e && a.push(e), r += 1; r < t.length && !Rn.test(t[r]);) a.push(t[r]), r += 1;
|
|
714
|
+
let o = r < t.length ? qn(t.slice(r + 1).join("\n")) : "";
|
|
705
715
|
return [
|
|
706
716
|
...n,
|
|
707
717
|
a.join("\n"),
|
|
708
718
|
o
|
|
709
719
|
].filter(Boolean).join("\n");
|
|
710
720
|
}
|
|
711
|
-
if (
|
|
712
|
-
|
|
721
|
+
if (Hn(e)) return Yn([...n, ...t.slice(r)].join("\n"));
|
|
722
|
+
Vn(e) && n.push(e), r += 1;
|
|
713
723
|
}
|
|
714
724
|
return n.length ? n.join("\n") : null;
|
|
715
|
-
},
|
|
725
|
+
}, Yn = (e) => {
|
|
716
726
|
let t = e.split("\n");
|
|
717
727
|
if (!t.length) return e;
|
|
718
|
-
let n =
|
|
719
|
-
return n && !
|
|
720
|
-
},
|
|
728
|
+
let n = Gn(t[0]);
|
|
729
|
+
return n && !Hn(t[0].slice(0, t[0].indexOf("```"))) && (t.shift(), n.sameLineBody && t.unshift(Kn(n.sameLineBody))), t.length && Rn.test(t[t.length - 1] ?? "") && t.pop(), t.join("\n");
|
|
730
|
+
}, Xn = (e) => {
|
|
721
731
|
if (!e) return {
|
|
722
732
|
html: "",
|
|
723
733
|
pending: !1
|
|
724
734
|
};
|
|
725
|
-
let { text: t, withheld: n } =
|
|
735
|
+
let { text: t, withheld: n } = Wn(Un(e));
|
|
726
736
|
if (!t.trim()) return {
|
|
727
737
|
html: "",
|
|
728
|
-
pending: n ||
|
|
738
|
+
pending: n || In.test(Un(e).trim())
|
|
729
739
|
};
|
|
730
|
-
let r =
|
|
740
|
+
let r = Jn(t) ?? t, i = Jn(r);
|
|
731
741
|
i !== null && i !== r && (r = i);
|
|
732
742
|
let a = r.trim();
|
|
733
|
-
return
|
|
743
|
+
return Vn(a) ? {
|
|
734
744
|
html: a,
|
|
735
745
|
pending: !1
|
|
736
746
|
} : {
|
|
737
747
|
html: "",
|
|
738
748
|
pending: !0
|
|
739
749
|
};
|
|
740
|
-
},
|
|
741
|
-
let { html: n } =
|
|
742
|
-
return n ?
|
|
750
|
+
}, Zn = (e, t) => {
|
|
751
|
+
let { html: n } = Xn(e);
|
|
752
|
+
return n ? Nt(At(n, t)) : "";
|
|
743
753
|
};
|
|
744
754
|
//#endregion
|
|
745
755
|
//#region src/components/Editor/utils/applyAiTypeset.ts
|
|
746
|
-
function
|
|
747
|
-
let r = U(
|
|
748
|
-
return !r.trim() ||
|
|
749
|
-
|
|
756
|
+
function Qn(e, t, n) {
|
|
757
|
+
let r = U(Zn(t, n));
|
|
758
|
+
return !r.trim() || qt(r, "") ? { applied: !1 } : (e.update(() => {
|
|
759
|
+
Ut(e, r), Wt(!0);
|
|
750
760
|
}, { discrete: !0 }), { applied: !0 });
|
|
751
761
|
}
|
|
752
762
|
//#endregion
|
|
753
763
|
//#region src/components/Editor/utils/readEditorAiSnapshot.ts
|
|
754
|
-
var
|
|
764
|
+
var $n = (e) => {
|
|
755
765
|
let t = "", n = "", r = "";
|
|
756
766
|
e.getEditorState().read(() => {
|
|
757
|
-
n = I().getTextContent(), t =
|
|
767
|
+
n = I().getTextContent(), t = xn(U(tt(e, null))), r = An(t).join(`\n\n${wt}\n\n`);
|
|
758
768
|
}, { editor: e });
|
|
759
|
-
let i =
|
|
769
|
+
let i = Ct(t);
|
|
760
770
|
return {
|
|
761
771
|
html: t,
|
|
762
772
|
text: n,
|
|
@@ -764,7 +774,7 @@ var Xn = (e) => {
|
|
|
764
774
|
htmlWithoutCode: i.html,
|
|
765
775
|
codeBlocks: i.blocks
|
|
766
776
|
};
|
|
767
|
-
},
|
|
777
|
+
}, er = ({ editor: e, ai: t }) => {
|
|
768
778
|
let n = u(t);
|
|
769
779
|
n.current = t;
|
|
770
780
|
let [r, i] = d(null), [a, o] = d({
|
|
@@ -774,18 +784,18 @@ var Xn = (e) => {
|
|
|
774
784
|
htmlWithoutCode: "",
|
|
775
785
|
codeBlocks: []
|
|
776
786
|
}), [s, c] = d("quick"), l = () => {
|
|
777
|
-
let t =
|
|
787
|
+
let t = $n(e);
|
|
778
788
|
o(t), i("typeset"), n.current?.typeset?.({
|
|
779
789
|
html: t.htmlWithoutCode,
|
|
780
790
|
text: t.text,
|
|
781
|
-
prompt:
|
|
791
|
+
prompt: bt
|
|
782
792
|
});
|
|
783
793
|
}, f = (t) => {
|
|
784
|
-
let r =
|
|
794
|
+
let r = $n(e);
|
|
785
795
|
o(r), c(t), i("polish"), n.current?.stop?.(), n.current?.polish?.({
|
|
786
796
|
text: r.polishText,
|
|
787
797
|
preset: t,
|
|
788
|
-
prompt:
|
|
798
|
+
prompt: St(t)
|
|
789
799
|
});
|
|
790
800
|
}, p = () => {
|
|
791
801
|
n.current?.stop?.(), i(null);
|
|
@@ -799,11 +809,11 @@ var Xn = (e) => {
|
|
|
799
809
|
close: p,
|
|
800
810
|
apply: () => {
|
|
801
811
|
let t = n.current?.text ?? "";
|
|
802
|
-
r === "typeset" ?
|
|
812
|
+
r === "typeset" ? Qn(e, t, a.codeBlocks) : r === "polish" && Pn(e, t), p();
|
|
803
813
|
}
|
|
804
814
|
};
|
|
805
|
-
},
|
|
806
|
-
let a = o(
|
|
815
|
+
}, tr = i({}), K = 36, nr = 14, rr = 2 * Math.PI * nr, ir = ({ nodeKey: e, src: t, altText: n, dataId: r, dataSrc: i }) => {
|
|
816
|
+
let a = o(tr), s = e in a, c = a[e];
|
|
807
817
|
return /* @__PURE__ */ m("span", {
|
|
808
818
|
className: V["bsy-mobile-editor__image"],
|
|
809
819
|
children: [/* @__PURE__ */ p("img", {
|
|
@@ -827,26 +837,26 @@ var Xn = (e) => {
|
|
|
827
837
|
children: [/* @__PURE__ */ p("circle", {
|
|
828
838
|
cx: K / 2,
|
|
829
839
|
cy: K / 2,
|
|
830
|
-
r:
|
|
840
|
+
r: nr,
|
|
831
841
|
fill: "none",
|
|
832
842
|
stroke: "rgba(255,255,255,0.35)",
|
|
833
843
|
strokeWidth: "3"
|
|
834
844
|
}), /* @__PURE__ */ p("circle", {
|
|
835
845
|
cx: K / 2,
|
|
836
846
|
cy: K / 2,
|
|
837
|
-
r:
|
|
847
|
+
r: nr,
|
|
838
848
|
fill: "none",
|
|
839
849
|
stroke: "#fff",
|
|
840
850
|
strokeWidth: "3",
|
|
841
851
|
strokeLinecap: "round",
|
|
842
|
-
strokeDasharray: c === void 0 ? `${
|
|
843
|
-
strokeDashoffset: c === void 0 ? 0 :
|
|
852
|
+
strokeDasharray: c === void 0 ? `${rr * .25} ${rr}` : rr,
|
|
853
|
+
strokeDashoffset: c === void 0 ? 0 : rr * (1 - c / 100),
|
|
844
854
|
transform: `rotate(-90 ${K / 2} ${K / 2})`
|
|
845
855
|
})]
|
|
846
856
|
})
|
|
847
857
|
}) : null]
|
|
848
858
|
});
|
|
849
|
-
},
|
|
859
|
+
}, ar = class e extends Ne {
|
|
850
860
|
__src;
|
|
851
861
|
__altText;
|
|
852
862
|
__width;
|
|
@@ -886,13 +896,13 @@ var Xn = (e) => {
|
|
|
886
896
|
}
|
|
887
897
|
static importDOM() {
|
|
888
898
|
return { img: () => ({
|
|
889
|
-
conversion:
|
|
899
|
+
conversion: cr,
|
|
890
900
|
priority: 0
|
|
891
901
|
}) };
|
|
892
902
|
}
|
|
893
903
|
static importJSON(e) {
|
|
894
904
|
let { src: t, altText: n, width: r, height: i, dataId: a, dataSrc: o } = e;
|
|
895
|
-
return
|
|
905
|
+
return sr({
|
|
896
906
|
src: t,
|
|
897
907
|
altText: n,
|
|
898
908
|
width: r,
|
|
@@ -917,7 +927,7 @@ var Xn = (e) => {
|
|
|
917
927
|
return !0;
|
|
918
928
|
}
|
|
919
929
|
decorate() {
|
|
920
|
-
return /* @__PURE__ */ p(
|
|
930
|
+
return /* @__PURE__ */ p(ir, {
|
|
921
931
|
nodeKey: this.getKey(),
|
|
922
932
|
src: this.__src,
|
|
923
933
|
altText: this.__altText,
|
|
@@ -925,7 +935,7 @@ var Xn = (e) => {
|
|
|
925
935
|
dataSrc: this.__dataSrc
|
|
926
936
|
});
|
|
927
937
|
}
|
|
928
|
-
},
|
|
938
|
+
}, or = (e) => e instanceof ar, sr = ({ src: e, altText: t, width: n, height: r, dataId: i, dataSrc: a, key: o }) => new ar(e, t, n, r, o, i, a), cr = (e) => {
|
|
929
939
|
if (!(e instanceof HTMLImageElement)) return null;
|
|
930
940
|
let { src: t, alt: n, style: r } = e, i, a;
|
|
931
941
|
if (r.width) {
|
|
@@ -936,7 +946,7 @@ var Xn = (e) => {
|
|
|
936
946
|
let e = parseInt(r.height, 10);
|
|
937
947
|
Number.isNaN(e) || (a = e);
|
|
938
948
|
}
|
|
939
|
-
return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node:
|
|
949
|
+
return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node: sr({
|
|
940
950
|
src: t,
|
|
941
951
|
altText: n,
|
|
942
952
|
width: i,
|
|
@@ -944,7 +954,7 @@ var Xn = (e) => {
|
|
|
944
954
|
dataId: e.getAttribute("data-id") || void 0,
|
|
945
955
|
dataSrc: e.getAttribute("data-src") || void 0
|
|
946
956
|
}) };
|
|
947
|
-
},
|
|
957
|
+
}, lr = (e) => gt.includes(e.name.split(".").pop()?.toLowerCase() ?? ""), ur = (e) => lr(e) ? e.size > 5242880 ? "size" : null : "type", dr = ({ editor: e, upload: t, savedSelectionRef: n, attachmentsBySrc: r }) => {
|
|
948
958
|
let i = u(null), o = u(null), c = u(!0), [l, f] = d({}), p = a(() => {
|
|
949
959
|
o.current?.abort(), o.current = null;
|
|
950
960
|
}, []);
|
|
@@ -954,8 +964,8 @@ var Xn = (e) => {
|
|
|
954
964
|
let m = a((t, r, i) => {
|
|
955
965
|
let a = "";
|
|
956
966
|
return e.update(() => {
|
|
957
|
-
|
|
958
|
-
let e =
|
|
967
|
+
Gt(n.current), L() === null && I().selectEnd();
|
|
968
|
+
let e = sr({
|
|
959
969
|
src: t,
|
|
960
970
|
altText: r,
|
|
961
971
|
dataSrc: i
|
|
@@ -970,7 +980,7 @@ var Xn = (e) => {
|
|
|
970
980
|
insertImage: m,
|
|
971
981
|
onFileChange: a(async (n) => {
|
|
972
982
|
let i = n.target.files?.[0];
|
|
973
|
-
if (n.target.value = "", !i ||
|
|
983
|
+
if (n.target.value = "", !i || ur(i)) return;
|
|
974
984
|
p();
|
|
975
985
|
let a = new AbortController();
|
|
976
986
|
if (o.current = a, !t?.customRequest) {
|
|
@@ -995,7 +1005,7 @@ var Xn = (e) => {
|
|
|
995
1005
|
}));
|
|
996
1006
|
let u = !1, d = (t) => {
|
|
997
1007
|
u || (u = !0, URL.revokeObjectURL(s), t || e.update(() => {
|
|
998
|
-
|
|
1008
|
+
ye(l)?.remove();
|
|
999
1009
|
}, c.current ? void 0 : { discrete: !0 }), c.current && f((e) => {
|
|
1000
1010
|
let t = { ...e };
|
|
1001
1011
|
return delete t[l], t;
|
|
@@ -1024,8 +1034,8 @@ var Xn = (e) => {
|
|
|
1024
1034
|
return;
|
|
1025
1035
|
}
|
|
1026
1036
|
e.update(() => {
|
|
1027
|
-
let e =
|
|
1028
|
-
|
|
1037
|
+
let e = ye(l);
|
|
1038
|
+
or(e) && (e.setSrc(o), s && e.setDataId(s));
|
|
1029
1039
|
}), d(!0);
|
|
1030
1040
|
} catch {
|
|
1031
1041
|
d(!1);
|
|
@@ -1039,7 +1049,7 @@ var Xn = (e) => {
|
|
|
1039
1049
|
]),
|
|
1040
1050
|
abortUpload: p
|
|
1041
1051
|
};
|
|
1042
|
-
},
|
|
1052
|
+
}, fr = ({ editor: e, savedSelectionRef: t, captureSelection: n }) => {
|
|
1043
1053
|
let [r, i] = d(null);
|
|
1044
1054
|
return {
|
|
1045
1055
|
linkForm: r,
|
|
@@ -1066,7 +1076,7 @@ var Xn = (e) => {
|
|
|
1066
1076
|
if (!r) return;
|
|
1067
1077
|
let a = r.startsWith("@") || /^https?:\/\//.test(r) ? r : `http://${r}`;
|
|
1068
1078
|
e.update(() => {
|
|
1069
|
-
|
|
1079
|
+
Gt(t.current);
|
|
1070
1080
|
let e = L(), r = n.newBlank ? {
|
|
1071
1081
|
target: "_blank",
|
|
1072
1082
|
rel: "noopener noreferrer",
|
|
@@ -1076,16 +1086,16 @@ var Xn = (e) => {
|
|
|
1076
1086
|
let t = n.text.trim() || n.url;
|
|
1077
1087
|
if (e.getTextContent()) y(a, r);
|
|
1078
1088
|
else {
|
|
1079
|
-
let n =
|
|
1089
|
+
let n = ve(t), i = _(a, r);
|
|
1080
1090
|
i.append(n), e.insertNodes([i]);
|
|
1081
1091
|
}
|
|
1082
1092
|
} else {
|
|
1083
|
-
let e =
|
|
1093
|
+
let e = ve(n.text.trim() || n.url), t = _(a, r);
|
|
1084
1094
|
t.append(e);
|
|
1085
1095
|
let i = I(), o = i.getLastChild();
|
|
1086
1096
|
if (xe(o)) o.append(t);
|
|
1087
1097
|
else {
|
|
1088
|
-
let e =
|
|
1098
|
+
let e = F();
|
|
1089
1099
|
e.append(t), i.append(e);
|
|
1090
1100
|
}
|
|
1091
1101
|
}
|
|
@@ -1093,14 +1103,14 @@ var Xn = (e) => {
|
|
|
1093
1103
|
},
|
|
1094
1104
|
closeLink: () => i(null)
|
|
1095
1105
|
};
|
|
1096
|
-
},
|
|
1106
|
+
}, pr = ({ editor: e, value: t, onChange: n, attachmentsBySrc: r }) => {
|
|
1097
1107
|
let i = u(null), o = u(n);
|
|
1098
1108
|
o.current = n;
|
|
1099
1109
|
let c = a((t) => {
|
|
1100
1110
|
t.read(() => {
|
|
1101
|
-
let n = I().getTextContent(), a =
|
|
1111
|
+
let n = I().getTextContent(), a = xn(U(tt(e, null))), s = qt(a, n) ? null : a;
|
|
1102
1112
|
i.current = s;
|
|
1103
|
-
let c = Ee(
|
|
1113
|
+
let c = Ee(ar).map((e) => r.get(e.getSrc())).filter((e) => e !== void 0);
|
|
1104
1114
|
o.current({
|
|
1105
1115
|
text: n,
|
|
1106
1116
|
html: s,
|
|
@@ -1110,7 +1120,7 @@ var Xn = (e) => {
|
|
|
1110
1120
|
}, [r, e]);
|
|
1111
1121
|
return s(() => {
|
|
1112
1122
|
t === void 0 || t === i.current || (i.current = t ?? null, e.update(() => {
|
|
1113
|
-
|
|
1123
|
+
Ut(e, t?.trim() ? U(t) : ""), Wt(!!e.getRootElement()?.contains(document.activeElement));
|
|
1114
1124
|
}, { onUpdate: () => {
|
|
1115
1125
|
e.getRootElement() || c(e.getEditorState());
|
|
1116
1126
|
} }));
|
|
@@ -1119,11 +1129,11 @@ var Xn = (e) => {
|
|
|
1119
1129
|
c,
|
|
1120
1130
|
t
|
|
1121
1131
|
]), c;
|
|
1122
|
-
},
|
|
1132
|
+
}, mr = 250, hr = () => {
|
|
1123
1133
|
let [e] = z(), t = u(0);
|
|
1124
1134
|
return s(() => e.registerCommand(ze, (e) => {
|
|
1125
1135
|
let n = Date.now(), r = n - t.current;
|
|
1126
|
-
if (t.current = n, r <= 0 || r >=
|
|
1136
|
+
if (t.current = n, r <= 0 || r >= mr) return !1;
|
|
1127
1137
|
let i = L();
|
|
1128
1138
|
if (!R(i) || !i.isCollapsed()) return !1;
|
|
1129
1139
|
let a = i.anchor.getNode();
|
|
@@ -1131,8 +1141,8 @@ var Xn = (e) => {
|
|
|
1131
1141
|
let o = a.getTopLevelElement();
|
|
1132
1142
|
if (!o || o.getTextContent().trim() !== "") return !1;
|
|
1133
1143
|
i.setFormat(0);
|
|
1134
|
-
let s =
|
|
1135
|
-
|
|
1144
|
+
let s = F();
|
|
1145
|
+
st(i, {
|
|
1136
1146
|
"background-color": "",
|
|
1137
1147
|
color: "",
|
|
1138
1148
|
"font-size": "",
|
|
@@ -1143,22 +1153,22 @@ var Xn = (e) => {
|
|
|
1143
1153
|
let c = s.getPreviousSibling();
|
|
1144
1154
|
return c?.getTextContent().trim() === "" && c.remove(), e?.preventDefault(), !0;
|
|
1145
1155
|
}, je), [e]), null;
|
|
1146
|
-
},
|
|
1156
|
+
}, gr = (e, t) => e.split(";").map((e) => e.trim()).filter((e) => e && e.split(":")[0].trim().toLowerCase() !== t).join("; "), _r = () => {
|
|
1147
1157
|
let [e] = z();
|
|
1148
1158
|
return s(() => e.registerNodeTransform(ie, (e) => {
|
|
1149
1159
|
let t = e.getTag();
|
|
1150
1160
|
if (t === "h4" || t === "h5" || t === "h6") {
|
|
1151
|
-
e.replace(
|
|
1161
|
+
e.replace(F(), !0);
|
|
1152
1162
|
return;
|
|
1153
1163
|
}
|
|
1154
1164
|
for (let t of e.getAllTextNodes()) {
|
|
1155
1165
|
let e = t.getStyle();
|
|
1156
1166
|
if (!e) continue;
|
|
1157
|
-
let n =
|
|
1167
|
+
let n = gr(e, "font-size");
|
|
1158
1168
|
n !== e && t.setStyle(n);
|
|
1159
1169
|
}
|
|
1160
1170
|
}), [e]), null;
|
|
1161
|
-
}, q = class e extends
|
|
1171
|
+
}, q = class e extends Ge {
|
|
1162
1172
|
static getType() {
|
|
1163
1173
|
return "extended-text";
|
|
1164
1174
|
}
|
|
@@ -1166,7 +1176,7 @@ var Xn = (e) => {
|
|
|
1166
1176
|
return new e(t.__text, t.__key);
|
|
1167
1177
|
}
|
|
1168
1178
|
static importDOM() {
|
|
1169
|
-
let e =
|
|
1179
|
+
let e = Ge.importDOM();
|
|
1170
1180
|
return {
|
|
1171
1181
|
...e,
|
|
1172
1182
|
code: () => ({
|
|
@@ -1196,12 +1206,12 @@ var Xn = (e) => {
|
|
|
1196
1206
|
};
|
|
1197
1207
|
}
|
|
1198
1208
|
static importJSON(e) {
|
|
1199
|
-
return
|
|
1209
|
+
return vr().updateFromJSON(e);
|
|
1200
1210
|
}
|
|
1201
1211
|
isSimpleText() {
|
|
1202
1212
|
return this.__type === "extended-text" && this.__mode === 0;
|
|
1203
1213
|
}
|
|
1204
|
-
},
|
|
1214
|
+
}, vr = (e = "") => he(new q(e)), J = (e) => (t) => {
|
|
1205
1215
|
let n = e?.(t);
|
|
1206
1216
|
if (!n) return null;
|
|
1207
1217
|
let r = n.conversion(t);
|
|
@@ -1225,31 +1235,31 @@ var Xn = (e) => {
|
|
|
1225
1235
|
return n;
|
|
1226
1236
|
}
|
|
1227
1237
|
};
|
|
1228
|
-
},
|
|
1238
|
+
}, yr = () => {
|
|
1229
1239
|
let [e] = z();
|
|
1230
1240
|
return s(() => e.registerNodeTransform(q, (e) => {
|
|
1231
1241
|
if (!B(e, v)) return;
|
|
1232
1242
|
let t = e.getStyle();
|
|
1233
1243
|
if (!t) return;
|
|
1234
|
-
let n =
|
|
1244
|
+
let n = gr(t, "color");
|
|
1235
1245
|
n !== t && e.setStyle(n);
|
|
1236
1246
|
}), [e]), null;
|
|
1237
|
-
},
|
|
1247
|
+
}, br = /<img\b|<picture\b/i, xr = () => {
|
|
1238
1248
|
let [e] = z();
|
|
1239
1249
|
return s(() => {
|
|
1240
1250
|
let t = (t) => {
|
|
1241
1251
|
let n = "clipboardData" in t ? t.clipboardData : "dataTransfer" in t ? t.dataTransfer : null;
|
|
1242
1252
|
if (!n || n.getData("application/x-lexical-editor") || n.getData("application/x-lexical-drag")) return !1;
|
|
1243
1253
|
let r = n.getData("text/html");
|
|
1244
|
-
if (!(Array.from(n.files).some((e) => e.type.startsWith("image/")) || Array.from(n.items).some((e) => e.type.startsWith("image/")) ||
|
|
1254
|
+
if (!(Array.from(n.files).some((e) => e.type.startsWith("image/")) || Array.from(n.items).some((e) => e.type.startsWith("image/")) || br.test(r))) return !1;
|
|
1245
1255
|
t.preventDefault();
|
|
1246
1256
|
let i = n.getData("text/plain");
|
|
1247
|
-
return !
|
|
1257
|
+
return !br.test(r) && !i || e.update(() => {
|
|
1248
1258
|
let t = L();
|
|
1249
1259
|
if (t === null) return;
|
|
1250
1260
|
let n = r ? new DOMParser().parseFromString(r, "text/html") : null;
|
|
1251
1261
|
if (n?.querySelectorAll("img, picture").forEach((e) => e.remove()), (n?.body.innerHTML ?? "") && n?.body.textContent?.trim()) {
|
|
1252
|
-
let t =
|
|
1262
|
+
let t = nt(e, n);
|
|
1253
1263
|
if (t.length) {
|
|
1254
1264
|
be(t);
|
|
1255
1265
|
return;
|
|
@@ -1258,20 +1268,20 @@ var Xn = (e) => {
|
|
|
1258
1268
|
i && t.insertRawText(i);
|
|
1259
1269
|
}, { tag: Ue }), !0;
|
|
1260
1270
|
};
|
|
1261
|
-
return
|
|
1271
|
+
return at(e.registerCommand(He, t, Ae), e.registerCommand(Me, t, Ae));
|
|
1262
1272
|
}, [e]), null;
|
|
1263
|
-
},
|
|
1273
|
+
}, Sr = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAADNBJREFUeAG1WuuvXUUV/619dqEPaG+pUFqg3AKFIoFWkKeKLWLRaKD6vVGMMcYQC8EPmBge/4A0fpEQEkmMz0QjH8CoIa3WUGwQ2oAiFWiFthb77qXvy1nOY83MWrP3qY2hk3vu3mfPzJr1+K3HzD6EqrXf5GVg3MPASncdd4+YCMTsvgHk7sEcx/r71Hy/H6e+Q49Nj/00RTPTSfOreXpNPcfw4q6b3GXTFMJjx56gbXrBzNDY/Tx2+DgecQ9WG96psCVCJqZILcqum1gtDM7CyMOusJlhP5ZEcKFDijdGpYg4prCmFD1krJlxNh47sIYOZAG9cCcmsdbdLmVYZhMj2jJ9FqkE1yPYjCCQ0pkhZHSalFdWybIwzH1RmAjeNM6aDZZ7IVvfM8l4ZDBwwhVN6sVIM8MVsTQm94UV4q2MISWoZaorhFkXfQqoeSx0tcWXDoFH3O0DNPYQj+MEtnJli5GQUlTo1LA1nDIsbS1TR0AF77BGZ7CaXrmD4sUrennbfOAkbawzF9ag2LKISg+bbh80Y1QGm2DVO54z04R+VzBT9H+1jqa5sh00WIKu9JSALjSowj1Vy3egXXOiAkUdlCLBJgwzUdKyFAKIiQfod2VtmLu9gB8zXgLLKidpklblv4mgKrqpcX1yjn5mwmI/jabHimHtYQw8SXjlXgvbZiAdrMhDBEkCa7xnETOMyOiMsmJ0yC/jOM8K9wILUgpSdi0jb10IumUceHxtXioruGmFTzb8h2vbtpFRkZqyNQvDQVC3OhNLkJF7pQSlU9T2CHSzDqgOlpEtE5alLyd991lwHvDgHSEFYM26KECA+DDAOyqKuyhpGxvSI+NNWDZpkwzrKH1h/QbqcRSYipropoXgFYuAFYuBmVPDhw4dA/6+C/jVZuD3W4BDR8Xv+3wqrkULZscHDywDbh0HXvwXsP0AaMdB4C/vyMweWLftIFtCR4OSU1hhmjKMsuUYHSjmtvgC4Oerulr1gnq4+c/qg6C7nwImjlfrWrp0zbwyP8317fl/gl/artZIiJN5Psj0O7fygGxZJRwL6qkISkRKKe76tZvxP9vFs4C7nHV//ZogSSOGol6/cgNw55Xdud56Dz0LckUKS64MXAmqgpDtoBViSnVJg6HDwjQLYkI9ST5nRcJ9u2kBCKfRvnwd8MzrJWcSFZ+aPxO475PdOd7iX/0FcORk8EuSSG8QFywYoigkwGgRSWnTLyhBxVgMJiea2HrP1aCLZuG02o2XALOngQSmkWZECn/2KtCWPcC5ZwNXnV/m7DwE7HrfCTdArxaTkiNEJbAkhqkqU9hcJJAACb5pgRT1wvUzi9Db3thtGU1t5bXAT142/h7az1wg+umm+H2mE/KxFcDyy5yAEy6ADExg08KVwtsHGYfhMNhfHWR9XnEd7jqIYTmMaeI4GYPU5xXkx+a57vslY46Jy7tCeAt9fz16m2e6bYXmoFpziqPvnh+eBH/nWeDJjc56E4W3NvLDmT/3zH8Pff4GXKCltJGgKPYpkTNYmoolWRcBrt24oF+IP24FXtkVBfWQ081bdda0HE1LoxILkls89RIw/9xswRzsuOLNP2+8loL1/FU01pQPi2U5aLMRK8n4NDYhIKHgi4v7BfztlkjruS3dPi+wt3peL1kjoUS+J7T854iymkJXGEfyvfGW7E5mESiZGlq4rJAieCbs5180Br5+flcAHxA2vxdp/vmdfgV84arMS2a4LfdRGMqKjUoXnhutkDbzB58m2FQtVMFDp4iqnNKb1QTVZeP9zL/y77igb2/vB94/AZxzlh2zaI6D6dTYp3kQ6OXdvL93FVosuBx/D90OPP2KU+Jhy6+/81HUpnkuohLMxjWVdJ19V6Lg/z63qD/3/eHtKKAnevQD4C0n5JK5dowX+Mrzg6X1QUeptNID71vpi2ufujR+3twHenitVVDKgzlYJA11ONQJXwUkPeTy2aArzuvMDAu+ujtCPDm/E5hqAROzr+1W1Yy6+n9DDpVKprPqWlBCwgvbnfKGAbKZr3YwsAWgG0wP3x79ZYObcMEM4LoLYkh+4q/KvigKTdPvugK9bcOO6BthrJwe+Gd9bYVLF0++jJHZu4lU8lbt+W1gr5AHb3FF9868ThzNPoUMLLNHZSPrNAP/Se3xjdG5Aw5lB+JrAwnJ4cFtF/fDc6uD47yZGd7Zz992B3uXjdmx3hpL50WLK/UVR0G+81sl2u12JnvcbuS7Dpp7jhXrsaS7DFGp/QIJr4lrq2pj464YtToLSQ5cOBs8dwZ62zeuj5/TbR66f9tniu8+xREGJTc64UIE1rWjb23blISeSq6m6VJLuUaXQZrQnZf2W+//abdcBPzyDVU66EDHvfFBnz4UHn0t6oVJu+Z0CnTzvP5F171bIKZwHabePB8fWls4Kyb+I5PWyTkGmLKjS+ZTwVEHST8u5EHZ6gTGp09xgWU68NxWt+veB8xw/R+/EOR9Zf0OKYMAFcNBH5ka53yY7Y5LIw/ZXFqj8Xssz0jtVTVjMitCVBn9uMugq/9UCHkB1u+M96FuVduotJCz3kh4bjsULTGqnT8tfup2k0PR795VfkjqVEGOMXQ+1gpn9T0W21D5TR8QpUveD+Womed4gjfO7WfeR7fvvaiUX4ri7Md3ucJ8VU/tOj5TYHrSKE+vm9EEFGtajqWSUeeIlGoiVo5bCpWOwjyE6eqe5O7b6/ul4re+Au0rm/a6ZN0TJae7evKymaDXD4hQmj+UfSAA8yoAFar9sWHpFEY4aaGRLoEEbJUTIPLRORjZHPNQ27G0DBVAgPefAPkQ7/24bjc4ZGyZKMwyYM/Qk0TU6csBp/EMpI1r2rCmyr1t1FZE7n1/05StyoyzRgv41oTaVjVS/cfKP60ZdgMb3uuf/4kLy06mqXkpOxrbJxtdatLOxx7YJD3nkkqtZyJ2eviqg+FeZ4E5lQW2uBMv9zhUFvlQWXm7Cna01m2Cb5vbpeFbShc1N8mHEz8J+pBU0iTi39rAw9xZZndfWxbJuIF9QTrnbNB17mD2Eqlk9rpd+WaXYrYfiVMUMwZieQEOwvHyeaDpsqVyc/lFV2M64QwPOc/ppC9lW3YvxRvdt5GHVPaDOdLB5pO+94WnbtV89B/zj6pMimKsijtR0tDq3iHnwZ63Q2xYTeGdBB5JVZQDj5nF9fsLfeqjAlVHEUrwhBbTI9wILHTl0ksrF9uAYYFQEy4LpCzIPFTvIaQvHbgqRAT9wVYd/Y2qlyhabWxgWaAJdBWkBZT9IDMbZplVjsnVkaogwnFFk8s8KIYoi6tZl//M6JxjpjVhgaiLykitKX0yOq5dbQ5y3uX08sWSNxjKBLgLQ5A2UhyjIFsUg55CAnYcwSpXH10qxs3bLDUXnUApi7eDemuk4JDgFi5yTCDZ3hToU91n8bmKQuHM/p4FnbiVU4XhQP75s5utR2J9nPnuK7Lt266iKcjLF/n5SHLasCNJRc2wrEg90MEsN/9e925hrMUZaQfcy5Wnd7iK52Q5N8oKE/8eshEqu7//3oZXT2yzgH47Y19P5HyWNf6lC8+ccL6Nue3byrmgH+8quVmEzOhokOOCxKisBXeYTYL3FDwgWmpKoEHlCxpq49NwxptfY6BgJS3xR0YwVS0hQHSQmY7zBYgqimpBkZ6lMQcnI0zPZPNrND4YDov/JJdJ/KV3F7DFBWUBUZzb5JgsKAruff6TaMgvTIA+PxtntK2biIWzHFeQYphR3CkHSB1ofJowL0UJlWCDnNCzbrgpaeEfJ8B73YnyNa5QPkvZuYqYJpLWbVSedufF/OYx0LvH5cgSJWcrGGoCpHOiH9s2JQ/q1GzCtvxMg1SyyXD2i+110Fl/pDCrI5oRRPuQzR8ZHNzDhxz5Z9LGErDKzBFUihJvwW3sf/iqy6BuEVz7Zgk+KeF1fffUxbk1cZmD8lze1RfB1VhDqvihDTyMzd4Hn3FEVhPMIY7RlGKYKsYN6nRfJzilGhYg4w9KCX58I3iSV+FlL2mNhFFCKp783E30wwle5jaHa1PQ0D9GUEKl43nSYmn/1s9HNaHfx2Q9M+8bNU8mDnA13io6zBlOYmF4+NQEr3HH4N9WNWBK/lDs6A0mdGJVkMLQ5iq7eNfviu/XfWn3UI+B6pd7sTybgmaIH3z9HLo/ZLDBOXiUTuDTbsQSIVUzFIMAqWCjRVeaa6xKyj1B66YewyaPFTat8F216ViRBXb/N2MaHoWe9iPmscFk+Bnw/Yp9eywAVRKp/VmPcxiWSogcna/UOP3GGXWq6RAvqog3znLDKXj0XlI/StfNCTo+ZegEJSx11lhSa1XxmbYpdDoJT+/RRlqlh/+6PFPQpaITbBsSfsOTeGbVFFqnif0XGylI3w1jW9QAAAAASUVORK5CYII=", Cr = "data:image/png;base64,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", wr = (e, t, n) => Math.min(n, Math.max(t, e)), Y = (e) => wr(e, 0, 1), X = (e) => {
|
|
1264
1274
|
let t = e.trim().toLowerCase();
|
|
1265
1275
|
if (t === "" || t === "transparent") return !0;
|
|
1266
1276
|
let n = t.match(/^rgba\([^,]+,[^,]+,[^,]+,\s*([.\d]+)\s*\)$/);
|
|
1267
1277
|
return n !== null && Number(n[1]) === 0;
|
|
1268
|
-
},
|
|
1278
|
+
}, Tr = (e) => {
|
|
1269
1279
|
let t = e.trim().replace(/^#/, "");
|
|
1270
1280
|
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;
|
|
1271
|
-
},
|
|
1281
|
+
}, Er = (e) => {
|
|
1272
1282
|
let t = e.trim();
|
|
1273
1283
|
if (X(t)) return null;
|
|
1274
|
-
let n =
|
|
1284
|
+
let n = Tr(t);
|
|
1275
1285
|
if (n) return {
|
|
1276
1286
|
r: Number.parseInt(n.slice(1, 3), 16),
|
|
1277
1287
|
g: Number.parseInt(n.slice(3, 5), 16),
|
|
@@ -1283,59 +1293,59 @@ var Xn = (e) => {
|
|
|
1283
1293
|
g: Number(r[2]),
|
|
1284
1294
|
b: Number(r[3])
|
|
1285
1295
|
} : null;
|
|
1286
|
-
},
|
|
1296
|
+
}, Dr = ({ r: e, g: t, b: n }) => `#${[
|
|
1287
1297
|
e,
|
|
1288
1298
|
t,
|
|
1289
1299
|
n
|
|
1290
|
-
].map((e) =>
|
|
1300
|
+
].map((e) => wr(Math.round(e), 0, 255).toString(16).padStart(2, "0")).join("")}`, Or = (e, t) => {
|
|
1291
1301
|
if (X(e) && X(t)) return !0;
|
|
1292
|
-
let n =
|
|
1302
|
+
let n = Er(e), r = Er(t);
|
|
1293
1303
|
return !!(n && r && n.r === r.r && n.g === r.g && n.b === r.b);
|
|
1294
|
-
},
|
|
1304
|
+
}, kr = (e) => {
|
|
1295
1305
|
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;
|
|
1296
1306
|
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), {
|
|
1297
1307
|
h: c,
|
|
1298
1308
|
s: s === 0 ? 0 : s / (1 - Math.abs(2 * o - 1)),
|
|
1299
1309
|
l: o
|
|
1300
1310
|
};
|
|
1301
|
-
},
|
|
1311
|
+
}, Ar = ({ h: e, s: t, l: n }) => {
|
|
1302
1312
|
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;
|
|
1303
1313
|
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), {
|
|
1304
1314
|
r: Math.round((s + o) * 255),
|
|
1305
1315
|
g: Math.round((c + o) * 255),
|
|
1306
1316
|
b: Math.round((l + o) * 255)
|
|
1307
1317
|
};
|
|
1308
|
-
},
|
|
1318
|
+
}, jr = (e) => Dr(Ar(e)), Mr = (e, t) => ({
|
|
1309
1319
|
h: Y(e) * 360,
|
|
1310
1320
|
s: 1,
|
|
1311
1321
|
l: Y(1 - t)
|
|
1312
|
-
}),
|
|
1322
|
+
}), Nr = (e) => ({
|
|
1313
1323
|
x: Y((e.h % 360 + 360) % 360 / 360),
|
|
1314
1324
|
y: Y(1 - e.l)
|
|
1315
|
-
}),
|
|
1325
|
+
}), Pr = (e, t, n) => ({
|
|
1316
1326
|
x: Y(n.width === 0 ? 0 : (e - n.left) / n.width),
|
|
1317
1327
|
y: Y(n.height === 0 ? 0 : (t - n.top) / n.height)
|
|
1318
|
-
}),
|
|
1319
|
-
let r =
|
|
1328
|
+
}), Fr = (e, t, n = Infinity) => {
|
|
1329
|
+
let r = Er(t);
|
|
1320
1330
|
if (!r) return e;
|
|
1321
|
-
let i =
|
|
1322
|
-
return [i, ...e.filter((e) => !
|
|
1323
|
-
},
|
|
1331
|
+
let i = Dr(r);
|
|
1332
|
+
return [i, ...e.filter((e) => !Or(e, i))].slice(0, n);
|
|
1333
|
+
}, Ir = (e, t = 24, n = 8) => Math.max(0, Math.floor((e + n) / (t + n))), Lr = (e, t) => {
|
|
1324
1334
|
let n = t % 11;
|
|
1325
1335
|
return Math.floor(t / 11) === 2 ? e[22] ?? e[t] : e[n] ?? e[t];
|
|
1326
|
-
}, Z = (...e) => e.filter(Boolean).join(" "),
|
|
1327
|
-
let t =
|
|
1336
|
+
}, Z = (...e) => e.filter(Boolean).join(" "), Rr = (e) => {
|
|
1337
|
+
let t = Er(e) ?? {
|
|
1328
1338
|
r: 0,
|
|
1329
1339
|
g: 94,
|
|
1330
1340
|
b: 239
|
|
1331
1341
|
};
|
|
1332
1342
|
return {
|
|
1333
|
-
color:
|
|
1334
|
-
point:
|
|
1343
|
+
color: Dr(t),
|
|
1344
|
+
point: Nr(kr(t))
|
|
1335
1345
|
};
|
|
1336
|
-
},
|
|
1337
|
-
let { t: l } = e(), [f, h] = d("presets"), [g, _] = d(() =>
|
|
1338
|
-
_(
|
|
1346
|
+
}, zr = ({ mode: t, currentColor: r, customColors: i, onApply: a, onCustomDraftChange: o, onCustomConfirm: c }) => {
|
|
1347
|
+
let { t: l } = e(), [f, h] = d("presets"), [g, _] = d(() => Rr(r)), [v, y] = d(!1), [b, x] = d(null), S = u(null), C = u(null), w = u(null), T = (e = r) => {
|
|
1348
|
+
_(Rr(e)), y(!1), o(null), h("custom");
|
|
1339
1349
|
};
|
|
1340
1350
|
s(() => {
|
|
1341
1351
|
if (f !== "custom" || typeof ResizeObserver > "u") return;
|
|
@@ -1364,7 +1374,7 @@ var Xn = (e) => {
|
|
|
1364
1374
|
if (!e) return;
|
|
1365
1375
|
let t = () => {
|
|
1366
1376
|
let t = e.getBoundingClientRect().width;
|
|
1367
|
-
t > 0 && x(
|
|
1377
|
+
t > 0 && x(Ir(t));
|
|
1368
1378
|
};
|
|
1369
1379
|
if (t(), typeof ResizeObserver > "u") return;
|
|
1370
1380
|
let n = new ResizeObserver(t);
|
|
@@ -1373,7 +1383,7 @@ var Xn = (e) => {
|
|
|
1373
1383
|
let E = (e) => {
|
|
1374
1384
|
let t = S.current;
|
|
1375
1385
|
if (!t) return;
|
|
1376
|
-
let { x: n, y: r } =
|
|
1386
|
+
let { x: n, y: r } = Pr(e.clientX, e.clientY, t.getBoundingClientRect()), i = jr(Mr(n, r));
|
|
1377
1387
|
_({
|
|
1378
1388
|
color: i,
|
|
1379
1389
|
point: {
|
|
@@ -1412,7 +1422,7 @@ var Xn = (e) => {
|
|
|
1412
1422
|
role: "listbox",
|
|
1413
1423
|
"aria-label": l("editor.customColors"),
|
|
1414
1424
|
children: i.slice(0, b ?? i.length).map((e) => {
|
|
1415
|
-
let t =
|
|
1425
|
+
let t = Or(r, e);
|
|
1416
1426
|
return /* @__PURE__ */ p("button", {
|
|
1417
1427
|
type: "button",
|
|
1418
1428
|
role: "option",
|
|
@@ -1489,8 +1499,8 @@ var Xn = (e) => {
|
|
|
1489
1499
|
className: V["bsy-mobile-editor__color-grid"],
|
|
1490
1500
|
role: "listbox",
|
|
1491
1501
|
"aria-label": l("editor.presetColors"),
|
|
1492
|
-
children:
|
|
1493
|
-
let n =
|
|
1502
|
+
children: ft.map((e, t) => {
|
|
1503
|
+
let n = Or(r, e);
|
|
1494
1504
|
return /* @__PURE__ */ p("button", {
|
|
1495
1505
|
type: "button",
|
|
1496
1506
|
role: "option",
|
|
@@ -1499,7 +1509,7 @@ var Xn = (e) => {
|
|
|
1499
1509
|
className: Z(V["bsy-mobile-editor__color-swatch"], n && V["bsy-mobile-editor__color-swatch--selected"]),
|
|
1500
1510
|
style: {
|
|
1501
1511
|
"--swatch-color": e,
|
|
1502
|
-
"--swatch-ring":
|
|
1512
|
+
"--swatch-ring": Lr(ft, t)
|
|
1503
1513
|
},
|
|
1504
1514
|
onClick: () => a(e),
|
|
1505
1515
|
children: /* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__color-swatch-fill"] })
|
|
@@ -1509,19 +1519,19 @@ var Xn = (e) => {
|
|
|
1509
1519
|
A
|
|
1510
1520
|
]
|
|
1511
1521
|
});
|
|
1512
|
-
},
|
|
1522
|
+
}, Br = (e, t) => {
|
|
1513
1523
|
H(e), e.update(() => {
|
|
1514
|
-
|
|
1524
|
+
ct(L(), () => t === "paragraph" ? F() : ne(t));
|
|
1515
1525
|
});
|
|
1516
|
-
},
|
|
1526
|
+
}, Vr = (e, t, n) => {
|
|
1517
1527
|
H(e), e.update(() => {
|
|
1518
|
-
|
|
1528
|
+
Gt(n), Kt();
|
|
1519
1529
|
let e = L();
|
|
1520
|
-
e &&
|
|
1530
|
+
e && st(e, t);
|
|
1521
1531
|
});
|
|
1522
|
-
},
|
|
1523
|
-
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 :
|
|
1524
|
-
T && (n && (w.current = null),
|
|
1532
|
+
}, Hr = ({ sheet: i, onClose: a, onTypeset: o, onPolishMenu: s, onPickPreset: c, onPicture: l, savedSelectionRef: h, committedColors: g, onColorCommit: _, canTypeset: v, canPolish: y }) => {
|
|
1533
|
+
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 : ut, D = (e, t = !1, n = !0) => {
|
|
1534
|
+
T && (n && (w.current = null), Vr(b, { [T === "fill" ? "background-color" : "color"]: e }, h.current), _(T, e), t && !X(e) && C((t) => Fr(t, e)), n && a());
|
|
1525
1535
|
}, O = (e) => {
|
|
1526
1536
|
w.current = null, D(e, !0, !1);
|
|
1527
1537
|
};
|
|
@@ -1584,18 +1594,18 @@ var Xn = (e) => {
|
|
|
1584
1594
|
text: x("editor.heading3")
|
|
1585
1595
|
}
|
|
1586
1596
|
],
|
|
1587
|
-
onAction: (e) =>
|
|
1597
|
+
onAction: (e) => Br(b, e.key)
|
|
1588
1598
|
}),
|
|
1589
1599
|
/* @__PURE__ */ p(r, {
|
|
1590
1600
|
mode: "menu",
|
|
1591
1601
|
open: i === "fontSize",
|
|
1592
1602
|
title: x("editor.fontSize"),
|
|
1593
1603
|
onClose: a,
|
|
1594
|
-
actions:
|
|
1604
|
+
actions: lt.map((e) => ({
|
|
1595
1605
|
key: e.value,
|
|
1596
1606
|
text: e.label
|
|
1597
1607
|
})),
|
|
1598
|
-
onAction: (e) =>
|
|
1608
|
+
onAction: (e) => Vr(b, { "font-size": e.key })
|
|
1599
1609
|
}),
|
|
1600
1610
|
/* @__PURE__ */ p(t, {
|
|
1601
1611
|
open: T !== null,
|
|
@@ -1604,7 +1614,7 @@ var Xn = (e) => {
|
|
|
1604
1614
|
e && O(e), a();
|
|
1605
1615
|
},
|
|
1606
1616
|
position: "bottom",
|
|
1607
|
-
children: T ? /* @__PURE__ */ p(
|
|
1617
|
+
children: T ? /* @__PURE__ */ p(zr, {
|
|
1608
1618
|
mode: T,
|
|
1609
1619
|
currentColor: E,
|
|
1610
1620
|
customColors: S,
|
|
@@ -1624,7 +1634,7 @@ var Xn = (e) => {
|
|
|
1624
1634
|
text: x("editor.aiTypeset"),
|
|
1625
1635
|
disabled: !v,
|
|
1626
1636
|
icon: /* @__PURE__ */ p("img", {
|
|
1627
|
-
src:
|
|
1637
|
+
src: Sr,
|
|
1628
1638
|
alt: "",
|
|
1629
1639
|
width: 16,
|
|
1630
1640
|
height: 16,
|
|
@@ -1636,7 +1646,7 @@ var Xn = (e) => {
|
|
|
1636
1646
|
text: x("editor.aiPolish"),
|
|
1637
1647
|
disabled: !y,
|
|
1638
1648
|
icon: /* @__PURE__ */ p("img", {
|
|
1639
|
-
src:
|
|
1649
|
+
src: Cr,
|
|
1640
1650
|
alt: "",
|
|
1641
1651
|
width: 16,
|
|
1642
1652
|
height: 16,
|
|
@@ -1657,9 +1667,9 @@ var Xn = (e) => {
|
|
|
1657
1667
|
open: i === "aiPreset",
|
|
1658
1668
|
title: x("editor.aiPolish"),
|
|
1659
1669
|
onClose: a,
|
|
1660
|
-
actions:
|
|
1670
|
+
actions: pt.map((e) => ({
|
|
1661
1671
|
key: e,
|
|
1662
|
-
text: x(
|
|
1672
|
+
text: x(mt[e])
|
|
1663
1673
|
})),
|
|
1664
1674
|
onAction: (e) => c(e.key)
|
|
1665
1675
|
}),
|
|
@@ -1686,7 +1696,7 @@ var Xn = (e) => {
|
|
|
1686
1696
|
onAction: (e) => l(e.key)
|
|
1687
1697
|
})
|
|
1688
1698
|
] });
|
|
1689
|
-
},
|
|
1699
|
+
}, Ur = ({ open: r, title: i, bodyClassName: a, onClose: o, onConfirm: s, children: c }) => {
|
|
1690
1700
|
let { t: l } = e();
|
|
1691
1701
|
return /* @__PURE__ */ p(t, {
|
|
1692
1702
|
open: r,
|
|
@@ -1731,11 +1741,11 @@ var Xn = (e) => {
|
|
|
1731
1741
|
]
|
|
1732
1742
|
})
|
|
1733
1743
|
});
|
|
1734
|
-
},
|
|
1744
|
+
}, Wr = ({ open: t, seed: r, onClose: i, onConfirm: a }) => {
|
|
1735
1745
|
let { t: o } = e(), [c, l] = d(""), [u, f] = d(""), [h, g] = d(!0);
|
|
1736
1746
|
return s(() => {
|
|
1737
1747
|
!t || !r || (l(r.url), f(r.text), g(r.newBlank));
|
|
1738
|
-
}, [t, r]), /* @__PURE__ */ m(
|
|
1748
|
+
}, [t, r]), /* @__PURE__ */ m(Ur, {
|
|
1739
1749
|
open: t,
|
|
1740
1750
|
title: o("editor.link"),
|
|
1741
1751
|
bodyClassName: V["bsy-mobile-editor__sheet-body--stack"],
|
|
@@ -1797,13 +1807,13 @@ var Xn = (e) => {
|
|
|
1797
1807
|
})
|
|
1798
1808
|
]
|
|
1799
1809
|
});
|
|
1800
|
-
},
|
|
1810
|
+
}, Gr = /^https?:\/\/.+/i, Kr = ({ open: t, onClose: n, onConfirm: r }) => {
|
|
1801
1811
|
let { t: i } = e(), [o, c] = d(""), [l, u] = d(null), f = a((e) => {
|
|
1802
1812
|
e?.focus();
|
|
1803
1813
|
}, []);
|
|
1804
1814
|
return s(() => {
|
|
1805
1815
|
t && (c(""), u(null));
|
|
1806
|
-
}, [t]), /* @__PURE__ */ p(
|
|
1816
|
+
}, [t]), /* @__PURE__ */ p(Ur, {
|
|
1807
1817
|
open: t,
|
|
1808
1818
|
title: i("editor.imageUrl"),
|
|
1809
1819
|
onClose: n,
|
|
@@ -1813,7 +1823,7 @@ var Xn = (e) => {
|
|
|
1813
1823
|
u(i("editor.imageUrlRequired"));
|
|
1814
1824
|
return;
|
|
1815
1825
|
}
|
|
1816
|
-
if (!
|
|
1826
|
+
if (!Gr.test(e)) {
|
|
1817
1827
|
u(i("editor.imageUrlInvalid"));
|
|
1818
1828
|
return;
|
|
1819
1829
|
}
|
|
@@ -1846,7 +1856,7 @@ var Xn = (e) => {
|
|
|
1846
1856
|
]
|
|
1847
1857
|
})
|
|
1848
1858
|
});
|
|
1849
|
-
},
|
|
1859
|
+
}, qr = `
|
|
1850
1860
|
:host {
|
|
1851
1861
|
all: initial;
|
|
1852
1862
|
display: block;
|
|
@@ -1859,8 +1869,20 @@ var Xn = (e) => {
|
|
|
1859
1869
|
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
|
|
1860
1870
|
font-size: 15px;
|
|
1861
1871
|
line-height: 1.6;
|
|
1872
|
+
overflow-wrap: anywhere;
|
|
1862
1873
|
word-break: break-word;
|
|
1863
1874
|
}
|
|
1875
|
+
.bsy-editor-html-preview__body p,
|
|
1876
|
+
.bsy-editor-html-preview__body li,
|
|
1877
|
+
.bsy-editor-html-preview__body h1,
|
|
1878
|
+
.bsy-editor-html-preview__body h2,
|
|
1879
|
+
.bsy-editor-html-preview__body h3,
|
|
1880
|
+
.bsy-editor-html-preview__body h4,
|
|
1881
|
+
.bsy-editor-html-preview__body h5,
|
|
1882
|
+
.bsy-editor-html-preview__body h6 {
|
|
1883
|
+
box-sizing: border-box;
|
|
1884
|
+
max-width: 100%;
|
|
1885
|
+
}
|
|
1864
1886
|
.bsy-editor-html-preview__body p {
|
|
1865
1887
|
margin: 0;
|
|
1866
1888
|
}
|
|
@@ -1927,7 +1949,7 @@ var Xn = (e) => {
|
|
|
1927
1949
|
.bsy-editor-html-preview__body li,
|
|
1928
1950
|
.bsy-editor-html-preview__body .editor-listitem {
|
|
1929
1951
|
margin: 0;
|
|
1930
|
-
margin-inline-start: ${
|
|
1952
|
+
margin-inline-start: ${Ft};
|
|
1931
1953
|
list-style: inherit;
|
|
1932
1954
|
}
|
|
1933
1955
|
.bsy-editor-html-preview__body .editor-nested-listitem {
|
|
@@ -2006,15 +2028,15 @@ var Xn = (e) => {
|
|
|
2006
2028
|
height: auto;
|
|
2007
2029
|
vertical-align: baseline;
|
|
2008
2030
|
}
|
|
2009
|
-
`,
|
|
2031
|
+
`, Jr = ({ html: e }) => {
|
|
2010
2032
|
let t = u(null);
|
|
2011
2033
|
return l(() => {
|
|
2012
|
-
|
|
2034
|
+
Bt(t.current, e, U, qr);
|
|
2013
2035
|
}, [e]), /* @__PURE__ */ p("div", {
|
|
2014
2036
|
ref: t,
|
|
2015
2037
|
className: "bsy-editor-html-preview"
|
|
2016
2038
|
});
|
|
2017
|
-
},
|
|
2039
|
+
}, Yr = () => {
|
|
2018
2040
|
let e = `${c().replace(/:/g, "")}g`;
|
|
2019
2041
|
return /* @__PURE__ */ p("span", {
|
|
2020
2042
|
className: V["bsy-mobile-editor__ai-think-icon"],
|
|
@@ -2053,7 +2075,7 @@ var Xn = (e) => {
|
|
|
2053
2075
|
}) })]
|
|
2054
2076
|
})
|
|
2055
2077
|
});
|
|
2056
|
-
},
|
|
2078
|
+
}, Xr = (t, n) => {
|
|
2057
2079
|
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 ?? "";
|
|
2058
2080
|
return s(() => {
|
|
2059
2081
|
if (!i) {
|
|
@@ -2073,12 +2095,12 @@ var Xn = (e) => {
|
|
|
2073
2095
|
reasoning: m,
|
|
2074
2096
|
toggle: () => o((e) => !e)
|
|
2075
2097
|
};
|
|
2076
|
-
},
|
|
2098
|
+
}, Zr = ({ model: e }) => /* @__PURE__ */ m("button", {
|
|
2077
2099
|
type: "button",
|
|
2078
2100
|
className: V["bsy-mobile-editor__ai-think-head"],
|
|
2079
2101
|
disabled: e.thinking,
|
|
2080
2102
|
onClick: e.toggle,
|
|
2081
|
-
children: [e.thinking ? /* @__PURE__ */ p(
|
|
2103
|
+
children: [e.thinking ? /* @__PURE__ */ p(Yr, {}) : /* @__PURE__ */ p(n, {
|
|
2082
2104
|
name: "arrow-down",
|
|
2083
2105
|
size: 12,
|
|
2084
2106
|
className: [V["bsy-mobile-editor__ai-think-arrow"], e.open ? V["bsy-mobile-editor__ai-think-arrow--open"] : ""].filter(Boolean).join(" ")
|
|
@@ -2086,10 +2108,10 @@ var Xn = (e) => {
|
|
|
2086
2108
|
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"],
|
|
2087
2109
|
children: e.label
|
|
2088
2110
|
})]
|
|
2089
|
-
}),
|
|
2111
|
+
}), Qr = ({ model: e }) => !e.visible || !e.open || !e.reasoning ? null : /* @__PURE__ */ p("div", {
|
|
2090
2112
|
className: V["bsy-mobile-editor__ai-think-body"],
|
|
2091
2113
|
children: e.reasoning
|
|
2092
|
-
}),
|
|
2114
|
+
}), $r = ({ enabled: e, status: t, revision: n, compute: r }) => {
|
|
2093
2115
|
let [i, a] = d(""), o = u(r);
|
|
2094
2116
|
o.current = r;
|
|
2095
2117
|
let c = u(null);
|
|
@@ -2116,7 +2138,7 @@ var Xn = (e) => {
|
|
|
2116
2138
|
]), s(() => () => {
|
|
2117
2139
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
2118
2140
|
}, []), i;
|
|
2119
|
-
},
|
|
2141
|
+
}, ei = 32, ti = .25, ni = 2, ri = ({ viewportRef: e, enabled: t, revision: n }) => {
|
|
2120
2142
|
let r = u(!0), i = u(!1), o = u(0), c = a(() => e.current ?? void 0, [e]), l = a(() => {
|
|
2121
2143
|
o.current = 0;
|
|
2122
2144
|
let t = e.current;
|
|
@@ -2126,7 +2148,7 @@ var Xn = (e) => {
|
|
|
2126
2148
|
t.scrollTop = n;
|
|
2127
2149
|
return;
|
|
2128
2150
|
}
|
|
2129
|
-
t.scrollTop += Math.max(i *
|
|
2151
|
+
t.scrollTop += Math.max(i * ti, Math.min(i, ni)), o.current = requestAnimationFrame(l);
|
|
2130
2152
|
}, [e]), d = a(() => {
|
|
2131
2153
|
!o.current && r.current && (o.current = requestAnimationFrame(l));
|
|
2132
2154
|
}, [l]);
|
|
@@ -2153,7 +2175,7 @@ var Xn = (e) => {
|
|
|
2153
2175
|
let f = () => {
|
|
2154
2176
|
let t = e.current;
|
|
2155
2177
|
if (!t) return;
|
|
2156
|
-
let n = t.scrollHeight - t.clientHeight - t.scrollTop <=
|
|
2178
|
+
let n = t.scrollHeight - t.clientHeight - t.scrollTop <= ei;
|
|
2157
2179
|
i.current ? (i.current = !1, r.current = n, !n && o.current && (cancelAnimationFrame(o.current), o.current = 0)) : n && (r.current = !0);
|
|
2158
2180
|
}, p = () => {
|
|
2159
2181
|
i.current = !0;
|
|
@@ -2171,16 +2193,16 @@ var Xn = (e) => {
|
|
|
2171
2193
|
passive: !0,
|
|
2172
2194
|
enable: t
|
|
2173
2195
|
}), { onScroll: f };
|
|
2174
|
-
},
|
|
2175
|
-
let { t: v } = e(), y = u(null), [b, x] = d(!1), S = c?.status ?? "idle", C = c?.text ?? "", w =
|
|
2196
|
+
}, ii = ({ open: i, mode: a, originalHtml: o, codeBlocks: s = [], ai: c, polishPreset: l, onClose: h, onApply: g, onPickPreset: _ }) => {
|
|
2197
|
+
let { t: v } = e(), y = u(null), [b, x] = d(!1), S = c?.status ?? "idle", C = c?.text ?? "", w = $r({
|
|
2176
2198
|
enabled: i && !!a,
|
|
2177
2199
|
status: S,
|
|
2178
2200
|
revision: C,
|
|
2179
|
-
compute: () => a === "polish" ? U(
|
|
2180
|
-
}), T = !!w.trim(), E =
|
|
2201
|
+
compute: () => a === "polish" ? U(Nn(o, C)) : Zn(C, s)
|
|
2202
|
+
}), T = !!w.trim(), E = Xr({
|
|
2181
2203
|
status: S,
|
|
2182
2204
|
reasoning: c?.reasoning
|
|
2183
|
-
}, T), D =
|
|
2205
|
+
}, T), D = ri({
|
|
2184
2206
|
viewportRef: y,
|
|
2185
2207
|
enabled: i && S === "loading",
|
|
2186
2208
|
revision: `${c?.reasoning ?? ""}\0${w}`
|
|
@@ -2192,7 +2214,7 @@ var Xn = (e) => {
|
|
|
2192
2214
|
closeOnClickOverlay: !1,
|
|
2193
2215
|
children: [/* @__PURE__ */ m("div", {
|
|
2194
2216
|
className: V["bsy-mobile-editor__ai"],
|
|
2195
|
-
style: { height:
|
|
2217
|
+
style: { height: vt },
|
|
2196
2218
|
children: [
|
|
2197
2219
|
/* @__PURE__ */ m("div", {
|
|
2198
2220
|
className: V["bsy-mobile-editor__header"],
|
|
@@ -2225,7 +2247,7 @@ var Xn = (e) => {
|
|
|
2225
2247
|
type: "button",
|
|
2226
2248
|
className: V["bsy-mobile-editor__ai-preset"],
|
|
2227
2249
|
onClick: () => x(!0),
|
|
2228
|
-
children: [v(
|
|
2250
|
+
children: [v(mt[l]), /* @__PURE__ */ p(n, {
|
|
2229
2251
|
name: "arrow-down",
|
|
2230
2252
|
size: 16
|
|
2231
2253
|
})]
|
|
@@ -2233,7 +2255,7 @@ var Xn = (e) => {
|
|
|
2233
2255
|
}),
|
|
2234
2256
|
E.visible ? /* @__PURE__ */ p("div", {
|
|
2235
2257
|
className: V["bsy-mobile-editor__ai-think-pin"],
|
|
2236
|
-
children: /* @__PURE__ */ p(
|
|
2258
|
+
children: /* @__PURE__ */ p(Zr, { model: E })
|
|
2237
2259
|
}) : null,
|
|
2238
2260
|
/* @__PURE__ */ p("div", {
|
|
2239
2261
|
ref: y,
|
|
@@ -2242,7 +2264,7 @@ var Xn = (e) => {
|
|
|
2242
2264
|
children: S === "error" ? /* @__PURE__ */ p("p", {
|
|
2243
2265
|
className: V["bsy-mobile-editor__ai-error"],
|
|
2244
2266
|
children: c?.errorMessage || v("editor.aiError")
|
|
2245
|
-
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(
|
|
2267
|
+
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Qr, { model: E }), T ? /* @__PURE__ */ p(Jr, { html: w }) : null] })
|
|
2246
2268
|
})
|
|
2247
2269
|
]
|
|
2248
2270
|
}),
|
|
@@ -2257,7 +2279,7 @@ var Xn = (e) => {
|
|
|
2257
2279
|
})
|
|
2258
2280
|
}), /* @__PURE__ */ p("div", {
|
|
2259
2281
|
className: V["bsy-mobile-editor__ai-section-scroll"],
|
|
2260
|
-
children: /* @__PURE__ */ p(
|
|
2282
|
+
children: /* @__PURE__ */ p(Jr, { html: o })
|
|
2261
2283
|
})]
|
|
2262
2284
|
})
|
|
2263
2285
|
]
|
|
@@ -2282,35 +2304,35 @@ var Xn = (e) => {
|
|
|
2282
2304
|
open: b,
|
|
2283
2305
|
title: v("editor.aiPolish"),
|
|
2284
2306
|
onClose: () => x(!1),
|
|
2285
|
-
actions:
|
|
2307
|
+
actions: pt.map((e) => ({
|
|
2286
2308
|
key: e,
|
|
2287
|
-
text: v(
|
|
2309
|
+
text: v(mt[e])
|
|
2288
2310
|
})),
|
|
2289
2311
|
onAction: (e) => _(e.key)
|
|
2290
2312
|
}) : null]
|
|
2291
2313
|
});
|
|
2292
|
-
},
|
|
2314
|
+
}, ai = "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", oi = "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", si = 860.48, ci = 99.52, li = /rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0(?:\.0+)?\s*\)/, ui = {
|
|
2293
2315
|
fontColor: {
|
|
2294
|
-
path:
|
|
2295
|
-
clipHeight:
|
|
2316
|
+
path: ai,
|
|
2317
|
+
clipHeight: si,
|
|
2296
2318
|
x: 128,
|
|
2297
2319
|
width: 768,
|
|
2298
2320
|
rx: 0
|
|
2299
2321
|
},
|
|
2300
2322
|
fill: {
|
|
2301
|
-
path:
|
|
2323
|
+
path: oi,
|
|
2302
2324
|
clipHeight: 816,
|
|
2303
2325
|
x: 112,
|
|
2304
2326
|
width: 800,
|
|
2305
2327
|
rx: 8
|
|
2306
2328
|
}
|
|
2307
|
-
},
|
|
2329
|
+
}, di = (e, t) => {
|
|
2308
2330
|
let n = t.trim().toLowerCase();
|
|
2309
|
-
if (e === "fill") return !n || n === "transparent" ||
|
|
2331
|
+
if (e === "fill") return !n || n === "transparent" || li.test(n);
|
|
2310
2332
|
let r = n.replace(/\s+/g, "");
|
|
2311
2333
|
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)";
|
|
2312
|
-
},
|
|
2313
|
-
let r = `${c().replace(/:/g, "")}clip`, i =
|
|
2334
|
+
}, fi = ({ variant: e, barColor: t, size: n }) => {
|
|
2335
|
+
let r = `${c().replace(/:/g, "")}clip`, i = ui[e];
|
|
2314
2336
|
return /* @__PURE__ */ m("svg", {
|
|
2315
2337
|
width: n,
|
|
2316
2338
|
height: n,
|
|
@@ -2333,36 +2355,37 @@ var Xn = (e) => {
|
|
|
2333
2355
|
}),
|
|
2334
2356
|
/* @__PURE__ */ p("rect", {
|
|
2335
2357
|
x: i.x,
|
|
2336
|
-
y:
|
|
2358
|
+
y: si,
|
|
2337
2359
|
width: i.width,
|
|
2338
|
-
height:
|
|
2360
|
+
height: ci,
|
|
2339
2361
|
rx: i.rx,
|
|
2340
|
-
fill:
|
|
2362
|
+
fill: di(e, t) ? "currentColor" : t
|
|
2341
2363
|
})
|
|
2342
2364
|
]
|
|
2343
2365
|
});
|
|
2344
|
-
},
|
|
2366
|
+
}, pi = {
|
|
2345
2367
|
bold: !1,
|
|
2346
2368
|
italic: !1,
|
|
2347
2369
|
underline: !1,
|
|
2348
2370
|
strikethrough: !1,
|
|
2349
|
-
fontColor:
|
|
2350
|
-
backgroundColor:
|
|
2371
|
+
fontColor: ut,
|
|
2372
|
+
backgroundColor: dt,
|
|
2351
2373
|
align: "left",
|
|
2352
2374
|
listType: !1,
|
|
2375
|
+
canIndent: !0,
|
|
2353
2376
|
canOutdent: !1,
|
|
2354
2377
|
headingTag: !1,
|
|
2355
2378
|
hasRangeSelection: !1,
|
|
2356
2379
|
hasEditorText: !1
|
|
2357
|
-
},
|
|
2380
|
+
}, mi = (e) => e === "center" || e === "right" || e === "left" ? e : e === "end" ? "right" : "left", hi = (e) => {
|
|
2358
2381
|
let t = !!I().getTextContent().trim(), n = {
|
|
2359
|
-
...
|
|
2382
|
+
...pi,
|
|
2360
2383
|
hasEditorText: t
|
|
2361
2384
|
};
|
|
2362
2385
|
if (!e) return n;
|
|
2363
2386
|
let r = L();
|
|
2364
2387
|
if (!R(r)) return n;
|
|
2365
|
-
let i =
|
|
2388
|
+
let i = ot(r, "color", ut), a = ot(r, "background-color", dt), o = r.anchor.getNode(), s = o.getKey() === "root" ? o : B(o, (e) => {
|
|
2366
2389
|
let t = e.getParent();
|
|
2367
2390
|
return t !== null && Ce(t);
|
|
2368
2391
|
});
|
|
@@ -2384,28 +2407,29 @@ var Xn = (e) => {
|
|
|
2384
2407
|
strikethrough: r.hasFormat("strikethrough"),
|
|
2385
2408
|
fontColor: i,
|
|
2386
2409
|
backgroundColor: a,
|
|
2387
|
-
align:
|
|
2410
|
+
align: mi(xe(s) ? s.getFormatType() : ""),
|
|
2388
2411
|
listType: l,
|
|
2412
|
+
canIndent: u < 8,
|
|
2389
2413
|
canOutdent: u > 0 || l !== !1,
|
|
2390
2414
|
headingTag: f === "h1" || f === "h2" || f === "h3" ? f : !1,
|
|
2391
2415
|
hasRangeSelection: !0,
|
|
2392
2416
|
hasEditorText: t
|
|
2393
2417
|
};
|
|
2394
|
-
},
|
|
2418
|
+
}, gi = (e, t) => {
|
|
2395
2419
|
e.isEditable() || e.setEditable(!0), e.update(() => {
|
|
2396
|
-
|
|
2420
|
+
Kt(), t(hi(!0));
|
|
2397
2421
|
}), e.focus(void 0, { defaultSelection: "rootStart" });
|
|
2398
|
-
},
|
|
2399
|
-
let t =
|
|
2400
|
-
return
|
|
2422
|
+
}, _i = (e) => {
|
|
2423
|
+
let t = pi;
|
|
2424
|
+
return gi(e, (e) => {
|
|
2401
2425
|
t = e;
|
|
2402
2426
|
}), t;
|
|
2403
|
-
},
|
|
2427
|
+
}, vi = (...e) => e.filter(Boolean).join(" "), yi = (e) => e.buttons.map((e) => ({
|
|
2404
2428
|
name: typeof e == "string" ? e : e.name,
|
|
2405
2429
|
disabled: typeof e != "string" && !!e.props?.disabled
|
|
2406
|
-
})), Q = 24,
|
|
2430
|
+
})), Q = 24, bi = 20, $ = ({ active: e, disabled: t, expanded: n, label: r, select: i, selectAlign: a, onClick: o, children: s }) => /* @__PURE__ */ p("button", {
|
|
2407
2431
|
type: "button",
|
|
2408
|
-
className:
|
|
2432
|
+
className: vi(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"]),
|
|
2409
2433
|
"aria-label": r,
|
|
2410
2434
|
"aria-pressed": e,
|
|
2411
2435
|
"aria-expanded": i ? !!n : void 0,
|
|
@@ -2413,11 +2437,11 @@ var Xn = (e) => {
|
|
|
2413
2437
|
onMouseDown: (e) => e.preventDefault(),
|
|
2414
2438
|
onClick: o,
|
|
2415
2439
|
children: s
|
|
2416
|
-
}),
|
|
2440
|
+
}), xi = ({ open: e }) => /* @__PURE__ */ p(n, {
|
|
2417
2441
|
name: "arrow-down",
|
|
2418
|
-
size:
|
|
2419
|
-
className:
|
|
2420
|
-
}),
|
|
2442
|
+
size: bi,
|
|
2443
|
+
className: vi(V["bsy-mobile-editor__tool-caret"], e && V["bsy-mobile-editor__tool-caret--open"])
|
|
2444
|
+
}), Si = ({ config: t, formats: r, colorValues: i, openSheet: a, onOpenSheet: o, onOpenLink: c }) => {
|
|
2421
2445
|
let [l] = z(), { t: d } = e(), f = u(null), h = u(null), g = u(null), _ = () => {
|
|
2422
2446
|
let e = f.current, t = h.current, n = g.current;
|
|
2423
2447
|
if (!e || !t || !n) return;
|
|
@@ -2493,7 +2517,7 @@ var Xn = (e) => {
|
|
|
2493
2517
|
})
|
|
2494
2518
|
}, e);
|
|
2495
2519
|
case "indent": return /* @__PURE__ */ p($, {
|
|
2496
|
-
disabled: t,
|
|
2520
|
+
disabled: t || r.hasRangeSelection && !r.canIndent,
|
|
2497
2521
|
label: d("editor.indent"),
|
|
2498
2522
|
onClick: () => {
|
|
2499
2523
|
H(l), l.dispatchCommand(Re, void 0);
|
|
@@ -2508,7 +2532,7 @@ var Xn = (e) => {
|
|
|
2508
2532
|
disabled: t,
|
|
2509
2533
|
label: d("editor.bulletList"),
|
|
2510
2534
|
onClick: () => {
|
|
2511
|
-
let e =
|
|
2535
|
+
let e = _i(l);
|
|
2512
2536
|
l.dispatchCommand(e.listType === "bullet" ? O : T, void 0);
|
|
2513
2537
|
},
|
|
2514
2538
|
children: /* @__PURE__ */ p(n, {
|
|
@@ -2521,7 +2545,7 @@ var Xn = (e) => {
|
|
|
2521
2545
|
disabled: t,
|
|
2522
2546
|
label: d("editor.numberList"),
|
|
2523
2547
|
onClick: () => {
|
|
2524
|
-
let e =
|
|
2548
|
+
let e = _i(l);
|
|
2525
2549
|
l.dispatchCommand(e.listType === "number" ? O : w, void 0);
|
|
2526
2550
|
},
|
|
2527
2551
|
children: /* @__PURE__ */ p(n, {
|
|
@@ -2540,7 +2564,7 @@ var Xn = (e) => {
|
|
|
2540
2564
|
children: [/* @__PURE__ */ p(n, {
|
|
2541
2565
|
name: r.align === "center" ? "paragraphmiddle" : r.align === "right" ? "paragraphright" : "paragraph",
|
|
2542
2566
|
size: Q
|
|
2543
|
-
}), /* @__PURE__ */ p(
|
|
2567
|
+
}), /* @__PURE__ */ p(xi, { open: a === "align" })]
|
|
2544
2568
|
}, e);
|
|
2545
2569
|
case "heading": return /* @__PURE__ */ m($, {
|
|
2546
2570
|
select: !0,
|
|
@@ -2553,7 +2577,7 @@ var Xn = (e) => {
|
|
|
2553
2577
|
children: [/* @__PURE__ */ p("span", {
|
|
2554
2578
|
className: V["bsy-mobile-editor__tool-text"],
|
|
2555
2579
|
children: r.headingTag ? r.headingTag.toUpperCase() : d("editor.paragraph")
|
|
2556
|
-
}), /* @__PURE__ */ p(
|
|
2580
|
+
}), /* @__PURE__ */ p(xi, { open: a === "heading" })]
|
|
2557
2581
|
}, e);
|
|
2558
2582
|
case "fontSize": return /* @__PURE__ */ p($, {
|
|
2559
2583
|
active: a === "fontSize",
|
|
@@ -2570,7 +2594,7 @@ var Xn = (e) => {
|
|
|
2570
2594
|
disabled: t,
|
|
2571
2595
|
label: d("editor.fontColor"),
|
|
2572
2596
|
onClick: () => o("fontColor"),
|
|
2573
|
-
children: /* @__PURE__ */ p(
|
|
2597
|
+
children: /* @__PURE__ */ p(fi, {
|
|
2574
2598
|
variant: "fontColor",
|
|
2575
2599
|
barColor: i.fontColor,
|
|
2576
2600
|
size: Q
|
|
@@ -2581,7 +2605,7 @@ var Xn = (e) => {
|
|
|
2581
2605
|
disabled: t,
|
|
2582
2606
|
label: d("editor.fill"),
|
|
2583
2607
|
onClick: () => o("fill"),
|
|
2584
|
-
children: /* @__PURE__ */ p(
|
|
2608
|
+
children: /* @__PURE__ */ p(fi, {
|
|
2585
2609
|
variant: "fill",
|
|
2586
2610
|
barColor: i.fill,
|
|
2587
2611
|
size: Q
|
|
@@ -2597,7 +2621,7 @@ var Xn = (e) => {
|
|
|
2597
2621
|
children: [/* @__PURE__ */ p(n, {
|
|
2598
2622
|
name: "picture",
|
|
2599
2623
|
size: Q
|
|
2600
|
-
}), /* @__PURE__ */ p(
|
|
2624
|
+
}), /* @__PURE__ */ p(xi, { open: a === "picture" })]
|
|
2601
2625
|
}, e);
|
|
2602
2626
|
case "link": return /* @__PURE__ */ p($, {
|
|
2603
2627
|
disabled: t,
|
|
@@ -2618,13 +2642,13 @@ var Xn = (e) => {
|
|
|
2618
2642
|
label: d("editor.ai"),
|
|
2619
2643
|
onClick: () => o("ai"),
|
|
2620
2644
|
children: [/* @__PURE__ */ p("img", {
|
|
2621
|
-
src:
|
|
2645
|
+
src: Sr,
|
|
2622
2646
|
alt: "",
|
|
2623
2647
|
width: Q,
|
|
2624
2648
|
height: Q,
|
|
2625
2649
|
className: V["bsy-mobile-editor__ai-icon"],
|
|
2626
2650
|
draggable: !1
|
|
2627
|
-
}), /* @__PURE__ */ p(
|
|
2651
|
+
}), /* @__PURE__ */ p(xi, { open: n })]
|
|
2628
2652
|
}, e);
|
|
2629
2653
|
}
|
|
2630
2654
|
default: return null;
|
|
@@ -2637,7 +2661,7 @@ var Xn = (e) => {
|
|
|
2637
2661
|
className: V["bsy-mobile-editor__toolbar-scroller"],
|
|
2638
2662
|
onScroll: _,
|
|
2639
2663
|
children: t.map((e, t) => {
|
|
2640
|
-
let n =
|
|
2664
|
+
let n = yi(e);
|
|
2641
2665
|
return n.length ? /* @__PURE__ */ m("div", {
|
|
2642
2666
|
className: V["bsy-mobile-editor__toolbar-group"],
|
|
2643
2667
|
children: [t > 0 ? /* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__toolbar-divider"] }) : null, n.map(v)]
|
|
@@ -2654,19 +2678,19 @@ var Xn = (e) => {
|
|
|
2654
2678
|
})
|
|
2655
2679
|
})]
|
|
2656
2680
|
});
|
|
2657
|
-
},
|
|
2681
|
+
}, Ci = () => {
|
|
2658
2682
|
let [e] = z(), [t, n] = d(!1);
|
|
2659
|
-
return s(() =>
|
|
2660
|
-
},
|
|
2661
|
-
let [e] = z(), t =
|
|
2683
|
+
return s(() => at(e.registerCommand(Pe, () => (n(!0), !1), je), e.registerCommand(ke, () => (n(!1), !1), je)), [e]), t;
|
|
2684
|
+
}, wi = () => {
|
|
2685
|
+
let [e] = z(), t = Ci(), [n, r] = d(pi);
|
|
2662
2686
|
return s(() => (e.getEditorState().read(() => {
|
|
2663
|
-
r(
|
|
2687
|
+
r(hi(t));
|
|
2664
2688
|
}, { editor: e }), e.registerUpdateListener(({ editorState: n }) => {
|
|
2665
2689
|
n.read(() => {
|
|
2666
|
-
r(
|
|
2690
|
+
r(hi(t));
|
|
2667
2691
|
}, { editor: e });
|
|
2668
2692
|
})), [e, t]), n;
|
|
2669
|
-
},
|
|
2693
|
+
}, Ti = "plaintext", Ei = "github-light", Di = new Set([
|
|
2670
2694
|
"plaintext",
|
|
2671
2695
|
"css",
|
|
2672
2696
|
"html",
|
|
@@ -2688,7 +2712,7 @@ var Xn = (e) => {
|
|
|
2688
2712
|
"bash",
|
|
2689
2713
|
"lua",
|
|
2690
2714
|
"markdown"
|
|
2691
|
-
]),
|
|
2715
|
+
]), Oi = (e) => e && Di.has(e) ? e : Ti, ki = {
|
|
2692
2716
|
css: () => import("@shikijs/langs/css"),
|
|
2693
2717
|
html: () => import("@shikijs/langs/html"),
|
|
2694
2718
|
xml: () => import("@shikijs/langs/xml"),
|
|
@@ -2709,50 +2733,50 @@ var Xn = (e) => {
|
|
|
2709
2733
|
bash: () => import("@shikijs/langs/shellscript"),
|
|
2710
2734
|
lua: () => import("@shikijs/langs/lua"),
|
|
2711
2735
|
markdown: () => import("@shikijs/langs/markdown")
|
|
2712
|
-
},
|
|
2736
|
+
}, Ai = (e) => e === "bash" ? "shellscript" : e, ji = (e) => e in ki, Mi = null, Ni = null, Pi = /* @__PURE__ */ new Map(), Fi = () => (Mi ||= Promise.all([import("@shikijs/core"), import("@shikijs/engine-javascript")]).then(([{ createHighlighterCoreSync: e }, { createJavaScriptRegexEngine: t }]) => e({
|
|
2713
2737
|
engine: t(),
|
|
2714
2738
|
langs: [],
|
|
2715
2739
|
themes: []
|
|
2716
2740
|
})).catch((e) => {
|
|
2717
|
-
throw
|
|
2718
|
-
}),
|
|
2719
|
-
let t =
|
|
2720
|
-
return t || (t =
|
|
2721
|
-
let n =
|
|
2741
|
+
throw Mi = null, e;
|
|
2742
|
+
}), Mi), Ii = (e, t) => ji(t) && e.getLoadedLanguages().includes(Ai(t)), Li = (e) => {
|
|
2743
|
+
let t = Pi.get(e);
|
|
2744
|
+
return t || (t = Fi().then(async (t) => {
|
|
2745
|
+
let n = Ai(e);
|
|
2722
2746
|
if (!t.getLoadedLanguages().includes(n)) {
|
|
2723
|
-
let n = await
|
|
2747
|
+
let n = await ki[e]();
|
|
2724
2748
|
await t.loadLanguage(n.default);
|
|
2725
2749
|
}
|
|
2726
2750
|
return t;
|
|
2727
2751
|
}).catch((t) => {
|
|
2728
|
-
throw
|
|
2729
|
-
}),
|
|
2730
|
-
},
|
|
2752
|
+
throw Pi.delete(e), t;
|
|
2753
|
+
}), Pi.set(e, t)), t;
|
|
2754
|
+
}, Ri = () => (Ni ||= Fi().then(async (e) => {
|
|
2731
2755
|
if (!e.getLoadedThemes().includes("github-light")) {
|
|
2732
2756
|
let t = await import("@shikijs/themes/github-light");
|
|
2733
2757
|
await e.loadTheme(t.default);
|
|
2734
2758
|
}
|
|
2735
2759
|
return e;
|
|
2736
2760
|
}).catch((e) => {
|
|
2737
|
-
throw
|
|
2738
|
-
}),
|
|
2761
|
+
throw Ni = null, e;
|
|
2762
|
+
}), Ni), zi = (e, t, n) => {
|
|
2739
2763
|
let r = e.getTextContent();
|
|
2740
|
-
if (e.getStyle() && e.setStyle(""), !n || !
|
|
2764
|
+
if (e.getStyle() && e.setStyle(""), !n || !Ii(n, t)) return ee(r);
|
|
2741
2765
|
let i = n.codeToTokens(r, {
|
|
2742
|
-
lang:
|
|
2743
|
-
theme:
|
|
2766
|
+
lang: Ai(t),
|
|
2767
|
+
theme: Ei
|
|
2744
2768
|
}).tokens, a = [];
|
|
2745
2769
|
return i.forEach((e, t) => {
|
|
2746
2770
|
t && a.push(ge()), e.forEach((e) => {
|
|
2747
2771
|
e.content.split(" ").forEach((t, n) => {
|
|
2748
|
-
if (n && a.push(
|
|
2772
|
+
if (n && a.push(_e()), !t) return;
|
|
2749
2773
|
let r = k(t), i = typeof e.htmlStyle == "string" ? e.htmlStyle : e.htmlStyle ? Object.entries(e.htmlStyle).map(([e, t]) => `${e}:${t}`).join(";") : e.color ? `color: ${e.color}` : "";
|
|
2750
2774
|
i && r.setStyle(i), a.push(r);
|
|
2751
2775
|
});
|
|
2752
2776
|
});
|
|
2753
2777
|
}), a;
|
|
2754
|
-
},
|
|
2755
|
-
let n =
|
|
2778
|
+
}, Bi = (e, t) => {
|
|
2779
|
+
let n = ye(e);
|
|
2756
2780
|
if (!j(n) || !n.isAttached()) return;
|
|
2757
2781
|
let r = L();
|
|
2758
2782
|
if (!R(r)) {
|
|
@@ -2780,27 +2804,27 @@ var Xn = (e) => {
|
|
|
2780
2804
|
return !1;
|
|
2781
2805
|
});
|
|
2782
2806
|
}
|
|
2783
|
-
},
|
|
2807
|
+
}, Vi = (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), Hi = (e, t) => {
|
|
2784
2808
|
let n = 0;
|
|
2785
|
-
for (; n < e.length &&
|
|
2809
|
+
for (; n < e.length && Vi(e[n], t[n]);) n++;
|
|
2786
2810
|
let r = 0, i = Math.min(e.length, t.length) - n;
|
|
2787
|
-
for (; r < i &&
|
|
2811
|
+
for (; r < i && Vi(e[e.length - r - 1], t[t.length - r - 1]);) r++;
|
|
2788
2812
|
return {
|
|
2789
2813
|
from: n,
|
|
2790
2814
|
to: e.length - r,
|
|
2791
2815
|
replacement: t.slice(n, t.length - r)
|
|
2792
2816
|
};
|
|
2793
|
-
},
|
|
2794
|
-
let a = i.getKey(), o =
|
|
2817
|
+
}, Ui = (e, t, n, r, i) => {
|
|
2818
|
+
let a = i.getKey(), o = Oi(i.getLanguage());
|
|
2795
2819
|
if (i.getLanguage() !== o && i.setLanguage(o), o === "plaintext") i.getIsSyntaxHighlightSupported() && i.setIsSyntaxHighlightSupported(!1);
|
|
2796
2820
|
else {
|
|
2797
|
-
i.getTheme() !== "github-light" && i.setTheme(
|
|
2798
|
-
let s = t ? t.getLoadedThemes().includes("github-light") ?
|
|
2821
|
+
i.getTheme() !== "github-light" && i.setTheme(Ei);
|
|
2822
|
+
let s = t ? t.getLoadedThemes().includes("github-light") ? ji(o) && !Ii(t, o) ? Li(o) : null : Ri() : Fi();
|
|
2799
2823
|
if (s) {
|
|
2800
2824
|
i.getIsSyntaxHighlightSupported() && i.setIsSyntaxHighlightSupported(!1), n.pendingKeys.add(a), n.loading !== s && (n.loading = s, s.then((t) => {
|
|
2801
2825
|
r(t);
|
|
2802
2826
|
let i = [...n.pendingKeys];
|
|
2803
|
-
n.pendingKeys.clear(), n.loading = null, e.update(() => i.forEach((e) =>
|
|
2827
|
+
n.pendingKeys.clear(), n.loading = null, e.update(() => i.forEach((e) => ye(e)?.markDirty()), { tag: Le });
|
|
2804
2828
|
}, () => {
|
|
2805
2829
|
n.pendingKeys.clear(), n.loading = null;
|
|
2806
2830
|
}));
|
|
@@ -2810,13 +2834,13 @@ var Xn = (e) => {
|
|
|
2810
2834
|
}
|
|
2811
2835
|
n.nodesCurrentlyHighlighting.has(a) || (n.nodesCurrentlyHighlighting.add(a), n.didTransform || (n.didTransform = !0, De(() => {
|
|
2812
2836
|
n.didTransform = !1, n.nodesCurrentlyHighlighting.clear();
|
|
2813
|
-
})),
|
|
2814
|
-
let e =
|
|
2837
|
+
})), Bi(a, () => {
|
|
2838
|
+
let e = ye(a);
|
|
2815
2839
|
if (!j(e) || !e.isAttached()) return !1;
|
|
2816
|
-
let n =
|
|
2840
|
+
let n = zi(e, Oi(e.getLanguage()), t), { from: r, to: i, replacement: o } = Hi(e.getChildren(), n);
|
|
2817
2841
|
return r === i && o.length === 0 ? !1 : (e.splice(r, i - r, o), !0);
|
|
2818
2842
|
}));
|
|
2819
|
-
},
|
|
2843
|
+
}, Wi = () => {
|
|
2820
2844
|
let [e] = z();
|
|
2821
2845
|
return s(() => {
|
|
2822
2846
|
if (!e.hasNodes([N, M])) throw Error("CodeHighlightPlugin: code nodes are not registered");
|
|
@@ -2825,17 +2849,17 @@ var Xn = (e) => {
|
|
|
2825
2849
|
nodesCurrentlyHighlighting: /* @__PURE__ */ new Set(),
|
|
2826
2850
|
pendingKeys: /* @__PURE__ */ new Set(),
|
|
2827
2851
|
loading: null
|
|
2828
|
-
}, r = (r) =>
|
|
2852
|
+
}, r = (r) => Ui(e, t, n, (e) => {
|
|
2829
2853
|
t = e;
|
|
2830
2854
|
}, r), i = (e) => {
|
|
2831
2855
|
let t = e.getParent();
|
|
2832
|
-
j(t) ? r(t) : A(e) && e.replace(
|
|
2856
|
+
j(t) ? r(t) : A(e) && e.replace(ve(e.__text));
|
|
2833
2857
|
};
|
|
2834
|
-
return
|
|
2858
|
+
return qe(te(e), e.registerNodeTransform(N, r), e.registerNodeTransform(Ge, i), e.registerNodeTransform(M, i));
|
|
2835
2859
|
}, [e]), null;
|
|
2836
|
-
},
|
|
2860
|
+
}, Gi = () => {
|
|
2837
2861
|
let [e] = z();
|
|
2838
|
-
return s(() => (me(e, !0),
|
|
2862
|
+
return s(() => (me(e, !0), at(fe(e), pe(e, !1), de(e), e.registerNodeTransform(ce, (e) => {
|
|
2839
2863
|
e.getBackgroundColor() !== null && e.setBackgroundColor(null);
|
|
2840
2864
|
}), e.registerCommand(Be, (e) => {
|
|
2841
2865
|
let t = L();
|
|
@@ -2864,8 +2888,27 @@ var Xn = (e) => {
|
|
|
2864
2888
|
}
|
|
2865
2889
|
return !0;
|
|
2866
2890
|
}, Ae))), [e]), null;
|
|
2867
|
-
},
|
|
2868
|
-
let
|
|
2891
|
+
}, Ki = (e) => {
|
|
2892
|
+
let t = e.getIndent();
|
|
2893
|
+
t < 8 && e.setIndent(t + 1);
|
|
2894
|
+
}, qi = (e) => {
|
|
2895
|
+
let t = e.getIndent();
|
|
2896
|
+
if (t > 8) {
|
|
2897
|
+
e.setIndent(8);
|
|
2898
|
+
return;
|
|
2899
|
+
}
|
|
2900
|
+
t < 0 && e.setIndent(0);
|
|
2901
|
+
};
|
|
2902
|
+
//#endregion
|
|
2903
|
+
//#region src/components/Editor/plugins/IndentLimitPlugin.tsx
|
|
2904
|
+
function Ji() {
|
|
2905
|
+
let [e] = z();
|
|
2906
|
+
return s(() => at(e.registerCommand(Re, () => it(Ki), Ae), e.registerNodeTransform(We, qi), e.registerNodeTransform(ie, qi), e.registerNodeTransform(E, qi)), [e]), null;
|
|
2907
|
+
}
|
|
2908
|
+
//#endregion
|
|
2909
|
+
//#region src/components/Editor/EditorCore.tsx
|
|
2910
|
+
var Yi = ({ value: n, onChange: r, open: i, onOpenChange: a, toolbar: o, upload: c, ai: l }) => {
|
|
2911
|
+
let [f] = z(), { t: h } = e(), g = wi(), [_, v] = d(!1), y = i ?? _, b = (e) => {
|
|
2869
2912
|
a?.(e), i === void 0 && v(e);
|
|
2870
2913
|
}, [x, S] = d(null), [C, w] = d(() => ({
|
|
2871
2914
|
fontColor: g.fontColor,
|
|
@@ -2874,24 +2917,24 @@ var Xn = (e) => {
|
|
|
2874
2917
|
f.getEditorState().read(() => {
|
|
2875
2918
|
O.current = L()?.clone() ?? null;
|
|
2876
2919
|
});
|
|
2877
|
-
}, { linkForm: A, openLink: j, confirmLink: ee, closeLink: M } =
|
|
2920
|
+
}, { linkForm: A, openLink: j, confirmLink: ee, closeLink: M } = fr({
|
|
2878
2921
|
editor: f,
|
|
2879
2922
|
savedSelectionRef: O,
|
|
2880
2923
|
captureSelection: k
|
|
2881
|
-
}), [N] = d(() => /* @__PURE__ */ new Map()), { fileInputRef: te, uploadProgress: ne, insertImage: re, onFileChange: ie, abortUpload: ae } =
|
|
2924
|
+
}), [N] = d(() => /* @__PURE__ */ new Map()), { fileInputRef: te, uploadProgress: ne, insertImage: re, onFileChange: ie, abortUpload: ae } = dr({
|
|
2882
2925
|
editor: f,
|
|
2883
2926
|
upload: c,
|
|
2884
2927
|
savedSelectionRef: O,
|
|
2885
2928
|
attachmentsBySrc: N
|
|
2886
|
-
}), oe =
|
|
2929
|
+
}), oe = pr({
|
|
2887
2930
|
editor: f,
|
|
2888
2931
|
value: n,
|
|
2889
2932
|
onChange: r,
|
|
2890
2933
|
attachmentsBySrc: N
|
|
2891
|
-
}), P =
|
|
2934
|
+
}), P = er({
|
|
2892
2935
|
editor: f,
|
|
2893
2936
|
ai: l
|
|
2894
|
-
}), [se, ce] = d(0), le = o?.config ??
|
|
2937
|
+
}), [se, ce] = d(0), le = o?.config ?? ht;
|
|
2895
2938
|
s(() => {
|
|
2896
2939
|
!g.hasRangeSelection || !g.hasEditorText || w({
|
|
2897
2940
|
fontColor: g.fontColor,
|
|
@@ -2933,7 +2976,7 @@ var Xn = (e) => {
|
|
|
2933
2976
|
onClose: ue,
|
|
2934
2977
|
position: "bottom",
|
|
2935
2978
|
closeOnClickOverlay: !0,
|
|
2936
|
-
children: /* @__PURE__ */ p(
|
|
2979
|
+
children: /* @__PURE__ */ p(tr.Provider, {
|
|
2937
2980
|
value: ne,
|
|
2938
2981
|
children: /* @__PURE__ */ m("div", {
|
|
2939
2982
|
className: V["bsy-mobile-editor"],
|
|
@@ -2952,12 +2995,12 @@ var Xn = (e) => {
|
|
|
2952
2995
|
/* @__PURE__ */ p("div", {
|
|
2953
2996
|
className: V["bsy-mobile-editor__content"],
|
|
2954
2997
|
style: { height: 200 },
|
|
2955
|
-
children: /* @__PURE__ */ p(
|
|
2956
|
-
contentEditable: /* @__PURE__ */ p(
|
|
2957
|
-
ErrorBoundary:
|
|
2998
|
+
children: /* @__PURE__ */ p($e, {
|
|
2999
|
+
contentEditable: /* @__PURE__ */ p(Je, { className: V["bsy-mobile-editor__editable"] }),
|
|
3000
|
+
ErrorBoundary: et
|
|
2958
3001
|
})
|
|
2959
3002
|
}),
|
|
2960
|
-
le.length > 0 ? /* @__PURE__ */ p(
|
|
3003
|
+
le.length > 0 ? /* @__PURE__ */ p(Si, {
|
|
2961
3004
|
config: le,
|
|
2962
3005
|
formats: g,
|
|
2963
3006
|
colorValues: C,
|
|
@@ -2973,27 +3016,28 @@ var Xn = (e) => {
|
|
|
2973
3016
|
},
|
|
2974
3017
|
onOpenLink: j
|
|
2975
3018
|
}) : null,
|
|
2976
|
-
/* @__PURE__ */ p(Je, {}),
|
|
2977
|
-
/* @__PURE__ */ p(Xe, {}),
|
|
2978
3019
|
/* @__PURE__ */ p(Ye, {}),
|
|
2979
|
-
/* @__PURE__ */ p(
|
|
2980
|
-
/* @__PURE__ */ p(
|
|
2981
|
-
/* @__PURE__ */ p(
|
|
2982
|
-
/* @__PURE__ */ p(
|
|
2983
|
-
/* @__PURE__ */ p(
|
|
2984
|
-
/* @__PURE__ */ p(
|
|
2985
|
-
/* @__PURE__ */ p(
|
|
3020
|
+
/* @__PURE__ */ p(Ze, {}),
|
|
3021
|
+
/* @__PURE__ */ p(Xe, {}),
|
|
3022
|
+
/* @__PURE__ */ p(hr, {}),
|
|
3023
|
+
/* @__PURE__ */ p(xr, {}),
|
|
3024
|
+
/* @__PURE__ */ p(_r, {}),
|
|
3025
|
+
/* @__PURE__ */ p(yr, {}),
|
|
3026
|
+
/* @__PURE__ */ p(Wi, {}),
|
|
3027
|
+
/* @__PURE__ */ p(Gi, {}),
|
|
3028
|
+
/* @__PURE__ */ p(Ji, {}),
|
|
3029
|
+
/* @__PURE__ */ p(Qe, {
|
|
2986
3030
|
onChange: oe,
|
|
2987
3031
|
ignoreSelectionChange: !0
|
|
2988
3032
|
}),
|
|
2989
3033
|
/* @__PURE__ */ p("input", {
|
|
2990
3034
|
ref: te,
|
|
2991
3035
|
type: "file",
|
|
2992
|
-
accept:
|
|
3036
|
+
accept: _t,
|
|
2993
3037
|
hidden: !0,
|
|
2994
3038
|
onChange: ie
|
|
2995
3039
|
}),
|
|
2996
|
-
/* @__PURE__ */ p(
|
|
3040
|
+
/* @__PURE__ */ p(Hr, {
|
|
2997
3041
|
sheet: x,
|
|
2998
3042
|
onClose: () => {
|
|
2999
3043
|
if (T.current) {
|
|
@@ -3023,20 +3067,20 @@ var Xn = (e) => {
|
|
|
3023
3067
|
canTypeset: !!l?.typeset,
|
|
3024
3068
|
canPolish: !!l?.polish
|
|
3025
3069
|
}),
|
|
3026
|
-
/* @__PURE__ */ p(
|
|
3070
|
+
/* @__PURE__ */ p(Wr, {
|
|
3027
3071
|
open: A !== null,
|
|
3028
3072
|
seed: A,
|
|
3029
3073
|
onClose: M,
|
|
3030
3074
|
onConfirm: ee
|
|
3031
3075
|
}),
|
|
3032
|
-
/* @__PURE__ */ p(
|
|
3076
|
+
/* @__PURE__ */ p(Kr, {
|
|
3033
3077
|
open: E,
|
|
3034
3078
|
onClose: () => D(!1),
|
|
3035
3079
|
onConfirm: (e) => {
|
|
3036
3080
|
re(e, "", e), D(!1);
|
|
3037
3081
|
}
|
|
3038
3082
|
}),
|
|
3039
|
-
/* @__PURE__ */ p(
|
|
3083
|
+
/* @__PURE__ */ p(ii, {
|
|
3040
3084
|
open: P.mode !== null,
|
|
3041
3085
|
mode: P.mode,
|
|
3042
3086
|
originalHtml: P.snapshot.html,
|
|
@@ -3051,10 +3095,10 @@ var Xn = (e) => {
|
|
|
3051
3095
|
})
|
|
3052
3096
|
})
|
|
3053
3097
|
});
|
|
3054
|
-
},
|
|
3098
|
+
}, Xi = "1px solid #d9d9d9", Zi = { export: new Map([[ce, (e, t) => {
|
|
3055
3099
|
let n = t.exportDOM(e);
|
|
3056
|
-
return
|
|
3057
|
-
}]]) },
|
|
3100
|
+
return Ke(n.element) && (n.element.style.border = Xi), n;
|
|
3101
|
+
}]]) }, Qi = class e extends x {
|
|
3058
3102
|
constructor(e = "", t = {}, n) {
|
|
3059
3103
|
super(e, t, n);
|
|
3060
3104
|
}
|
|
@@ -3069,12 +3113,12 @@ var Xn = (e) => {
|
|
|
3069
3113
|
}, t.__key);
|
|
3070
3114
|
}
|
|
3071
3115
|
static importJSON(e) {
|
|
3072
|
-
return
|
|
3116
|
+
return $i().updateFromJSON(e);
|
|
3073
3117
|
}
|
|
3074
3118
|
sanitizeUrl(e) {
|
|
3075
3119
|
return e.startsWith("@") ? e : super.sanitizeUrl(e);
|
|
3076
3120
|
}
|
|
3077
|
-
},
|
|
3121
|
+
}, $i = (e = "", t = {}) => he(new Qi(e, t)), ea = {
|
|
3078
3122
|
namespace: "bsyLexicalEditor",
|
|
3079
3123
|
onError: (e) => {
|
|
3080
3124
|
console.error("Lexical error", e);
|
|
@@ -3107,17 +3151,17 @@ var Xn = (e) => {
|
|
|
3107
3151
|
tableRow: "editor-table-row",
|
|
3108
3152
|
tableScrollableWrapper: "editor-table-scrollable-wrapper"
|
|
3109
3153
|
},
|
|
3110
|
-
html:
|
|
3154
|
+
html: Zi,
|
|
3111
3155
|
nodes: [
|
|
3112
|
-
|
|
3156
|
+
Qi,
|
|
3113
3157
|
{
|
|
3114
3158
|
replace: x,
|
|
3115
|
-
with: (e) => new
|
|
3159
|
+
with: (e) => new Qi(e.__url, {
|
|
3116
3160
|
rel: e.__rel,
|
|
3117
3161
|
target: e.__target,
|
|
3118
3162
|
title: e.__title
|
|
3119
3163
|
}),
|
|
3120
|
-
withKlass:
|
|
3164
|
+
withKlass: Qi
|
|
3121
3165
|
},
|
|
3122
3166
|
b,
|
|
3123
3167
|
D,
|
|
@@ -3128,18 +3172,18 @@ var Xn = (e) => {
|
|
|
3128
3172
|
le,
|
|
3129
3173
|
ue,
|
|
3130
3174
|
ce,
|
|
3131
|
-
|
|
3175
|
+
ar,
|
|
3132
3176
|
q,
|
|
3133
3177
|
{
|
|
3134
|
-
replace:
|
|
3178
|
+
replace: Ge,
|
|
3135
3179
|
with: (e) => new q(e.__text),
|
|
3136
3180
|
withKlass: q
|
|
3137
3181
|
}
|
|
3138
3182
|
]
|
|
3139
|
-
},
|
|
3140
|
-
initialConfig:
|
|
3141
|
-
children: /* @__PURE__ */ p(
|
|
3183
|
+
}, ta = (e) => /* @__PURE__ */ p(g, {
|
|
3184
|
+
initialConfig: ea,
|
|
3185
|
+
children: /* @__PURE__ */ p(Yi, { ...e })
|
|
3142
3186
|
});
|
|
3143
|
-
|
|
3187
|
+
ta.displayName = "BsyMobileEditor";
|
|
3144
3188
|
//#endregion
|
|
3145
|
-
export {
|
|
3189
|
+
export { Jr as n, ta as t };
|