@baishuyun/ui-mobile 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AMap/index.js +1 -1
- package/dist/ActionSheet/index.js +1 -1
- package/dist/Calendar/{Calendar-Cf81JVOC.js → Calendar-Bs1aP8-o.js} +1 -1
- package/dist/Calendar/index.js +3 -3
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/Editor/{Editor-CZ4Tz-N2.js → Editor-BdDwoeu2.js} +945 -585
- package/dist/Editor/index.js +2 -2
- package/dist/Gantt/index.js +1 -1
- package/dist/Icon/index.js +1 -1
- package/dist/Overlay/index.js +1 -1
- package/dist/Popup/index.js +1 -1
- package/dist/Segmented/{Segmented-CxQ3Pd05.js → Segmented-PwHjDHry.js} +9 -9
- package/dist/Segmented/index.js +2 -2
- package/dist/components/Editor/Thinking.d.ts +1 -3
- package/dist/components/Editor/hooks/useAiPreviewHtml.d.ts +7 -0
- package/dist/components/Editor/hooks/useAutoScroll.d.ts +9 -0
- package/dist/components/Editor/hooks/useEditorAiSession.d.ts +1 -5
- package/dist/components/Editor/interface.d.ts +2 -0
- package/dist/components/Editor/popups/AiResultPopup.d.ts +2 -1
- package/dist/components/Editor/utils/applyAiPolish.d.ts +0 -1
- package/dist/components/Editor/utils/applyAiTypeset.d.ts +4 -0
- package/dist/components/Editor/utils/placeProgrammaticCaret.d.ts +3 -1
- package/dist/components/Editor/utils/prepareTypesetProposed.d.ts +1 -0
- package/dist/components/Editor/utils/readEditorAiSnapshot.d.ts +3 -2
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/dist/vendors/{version-CMSvw03J.js → version-BqVAUWsV.js} +1 -1
- package/package.json +3 -2
|
@@ -8,10 +8,10 @@ import { useEventListener as h } from "ahooks";
|
|
|
8
8
|
import { LexicalComposer as g } from "@lexical/react/LexicalComposer";
|
|
9
9
|
import { $createLinkNode as _, $isLinkNode as v, $toggleLink as y, AutoLinkNode as b, LinkNode as x } from "@lexical/link";
|
|
10
10
|
import { $isListItemNode as S, $isListNode as C, INSERT_ORDERED_LIST_COMMAND as w, INSERT_UNORDERED_LIST_COMMAND as T, ListItemNode as E, ListNode as D, REMOVE_LIST_COMMAND as O } from "@lexical/list";
|
|
11
|
-
import { $createCodeHighlightNode as k, $isCodeHighlightNode as A, $isCodeNode as j, $plainifyCodeContent as ee, CodeHighlightNode as
|
|
12
|
-
import { $createHeadingNode as
|
|
13
|
-
import { $findCellNode as
|
|
14
|
-
import { $applyNodeReplacement as
|
|
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
|
+
import { $createHeadingNode as ne, $isHeadingNode as re, HeadingNode as ie } from "@lexical/rich-text";
|
|
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 _e, $createTabNode as ve, $createTextNode as ye, $getNodeByKey as F, $getRoot as I, $getSelection as L, $insertNodes as be, $isElementNode as xe, $isLineBreakNode as Se, $isRangeSelection as R, $isRootOrShadowRoot as Ce, $isTabNode as we, $isTextNode as Te, $nodesOfType as Ee, $onUpdate as De, $setSelection as Oe, BLUR_COMMAND as ke, COMMAND_PRIORITY_HIGH as Ae, COMMAND_PRIORITY_LOW as je, DROP_COMMAND as Me, DecoratorNode as Ne, FOCUS_COMMAND as Pe, FORMAT_ELEMENT_COMMAND as Fe, FORMAT_TEXT_COMMAND as Ie, HISTORY_MERGE_TAG as Le, INDENT_CONTENT_COMMAND as Re, KEY_ENTER_COMMAND as ze, KEY_TAB_COMMAND as Be, OUTDENT_CONTENT_COMMAND as Ve, PASTE_COMMAND as He, PASTE_TAG as Ue, TextNode as We, isHTMLElement as Ge, mergeRegister as Ke } from "lexical";
|
|
15
15
|
import { ContentEditable as qe } from "@lexical/react/LexicalContentEditable";
|
|
16
16
|
import { HistoryPlugin as Je } from "@lexical/react/LexicalHistoryPlugin";
|
|
17
17
|
import { LinkPlugin as Ye } from "@lexical/react/LexicalLinkPlugin";
|
|
@@ -132,105 +132,230 @@ var st = [
|
|
|
132
132
|
"bmp",
|
|
133
133
|
"tif"
|
|
134
134
|
], ht = mt.map((e) => `.${e}`).join(","), gt = "calc(100dvh - 104px)", V = {
|
|
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
|
-
}, _t =
|
|
135
|
+
"bsy-mobile-editor": "_bsy-mobile-editor_1eri1_2",
|
|
136
|
+
"bsy-mobile-editor__label": "_bsy-mobile-editor__label_1eri1_15",
|
|
137
|
+
"bsy-mobile-editor__label-text": "_bsy-mobile-editor__label-text_1eri1_20",
|
|
138
|
+
"bsy-mobile-editor__header": "_bsy-mobile-editor__header_1eri1_29",
|
|
139
|
+
"bsy-mobile-editor__title": "_bsy-mobile-editor__title_1eri1_39",
|
|
140
|
+
"bsy-mobile-editor__close": "_bsy-mobile-editor__close_1eri1_49",
|
|
141
|
+
"bsy-mobile-editor__content": "_bsy-mobile-editor__content_1eri1_63",
|
|
142
|
+
"bsy-mobile-editor__editable": "_bsy-mobile-editor__editable_1eri1_73",
|
|
143
|
+
"bsy-mobile-editor__image-shell": "_bsy-mobile-editor__image-shell_1eri1_228",
|
|
144
|
+
"bsy-mobile-editor__image": "_bsy-mobile-editor__image_1eri1_228",
|
|
145
|
+
"bsy-mobile-editor__image-mask": "_bsy-mobile-editor__image-mask_1eri1_250",
|
|
146
|
+
"bsy-mobile-editor__image-progress": "_bsy-mobile-editor__image-progress_1eri1_259",
|
|
147
|
+
"bsy-mobile-editor__image-progress--spin": "_bsy-mobile-editor__image-progress--spin_1eri1_262",
|
|
148
|
+
"bsy-mobile-editor-progress-spin": "_bsy-mobile-editor-progress-spin_1eri1_1",
|
|
149
|
+
"bsy-mobile-editor__toolbar": "_bsy-mobile-editor__toolbar_1eri1_265",
|
|
150
|
+
"bsy-mobile-editor__toolbar-scroller": "_bsy-mobile-editor__toolbar-scroller_1eri1_280",
|
|
151
|
+
"bsy-mobile-editor__toolbar-track": "_bsy-mobile-editor__toolbar-track_1eri1_297",
|
|
152
|
+
"bsy-mobile-editor__toolbar-thumb": "_bsy-mobile-editor__toolbar-thumb_1eri1_309",
|
|
153
|
+
"bsy-mobile-editor__toolbar-group": "_bsy-mobile-editor__toolbar-group_1eri1_314",
|
|
154
|
+
"bsy-mobile-editor__toolbar-divider": "_bsy-mobile-editor__toolbar-divider_1eri1_320",
|
|
155
|
+
"bsy-mobile-editor__tool": "_bsy-mobile-editor__tool_1eri1_265",
|
|
156
|
+
"bsy-mobile-editor__tool--active": "_bsy-mobile-editor__tool--active_1eri1_341",
|
|
157
|
+
"bsy-mobile-editor__tool--select": "_bsy-mobile-editor__tool--select_1eri1_348",
|
|
158
|
+
"bsy-mobile-editor__tool--select-align": "_bsy-mobile-editor__tool--select-align_1eri1_353",
|
|
159
|
+
"bsy-mobile-editor__tool-caret": "_bsy-mobile-editor__tool-caret_1eri1_356",
|
|
160
|
+
"bsy-mobile-editor__tool-caret--open": "_bsy-mobile-editor__tool-caret--open_1eri1_359",
|
|
161
|
+
"bsy-mobile-editor__ai-icon": "_bsy-mobile-editor__ai-icon_1eri1_362",
|
|
162
|
+
"bsy-mobile-editor__tool-text": "_bsy-mobile-editor__tool-text_1eri1_367",
|
|
163
|
+
"bsy-mobile-editor__color": "_bsy-mobile-editor__color_1eri1_372",
|
|
164
|
+
"bsy-mobile-editor__color--custom": "_bsy-mobile-editor__color--custom_1eri1_380",
|
|
165
|
+
"bsy-mobile-editor__color-header": "_bsy-mobile-editor__color-header_1eri1_383",
|
|
166
|
+
"bsy-mobile-editor__color-header-title": "_bsy-mobile-editor__color-header-title_1eri1_392",
|
|
167
|
+
"bsy-mobile-editor__color-header-back": "_bsy-mobile-editor__color-header-back_1eri1_405",
|
|
168
|
+
"bsy-mobile-editor__color-grid": "_bsy-mobile-editor__color-grid_1eri1_419",
|
|
169
|
+
"bsy-mobile-editor__color-swatch": "_bsy-mobile-editor__color-swatch_1eri1_426",
|
|
170
|
+
"bsy-mobile-editor__color-none": "_bsy-mobile-editor__color-none_1eri1_426",
|
|
171
|
+
"bsy-mobile-editor__color-custom-item": "_bsy-mobile-editor__color-custom-item_1eri1_426",
|
|
172
|
+
"bsy-mobile-editor__color-swatch--selected": "_bsy-mobile-editor__color-swatch--selected_1eri1_442",
|
|
173
|
+
"bsy-mobile-editor__color-none--selected": "_bsy-mobile-editor__color-none--selected_1eri1_442",
|
|
174
|
+
"bsy-mobile-editor__color-custom-item--selected": "_bsy-mobile-editor__color-custom-item--selected_1eri1_442",
|
|
175
|
+
"bsy-mobile-editor__color-swatch-fill": "_bsy-mobile-editor__color-swatch-fill_1eri1_456",
|
|
176
|
+
"bsy-mobile-editor__color-bar": "_bsy-mobile-editor__color-bar_1eri1_463",
|
|
177
|
+
"bsy-mobile-editor__color-custom-trigger": "_bsy-mobile-editor__color-custom-trigger_1eri1_469",
|
|
178
|
+
"bsy-mobile-editor__color-custom-trigger--active": "_bsy-mobile-editor__color-custom-trigger--active_1eri1_487",
|
|
179
|
+
"bsy-mobile-editor__color-custom-trigger--preview": "_bsy-mobile-editor__color-custom-trigger--preview_1eri1_492",
|
|
180
|
+
"bsy-mobile-editor__color-custom-list": "_bsy-mobile-editor__color-custom-list_1eri1_507",
|
|
181
|
+
"bsy-mobile-editor__color-mixer": "_bsy-mobile-editor__color-mixer_1eri1_527",
|
|
182
|
+
"bsy-mobile-editor__color-spectrum": "_bsy-mobile-editor__color-spectrum_1eri1_530",
|
|
183
|
+
"bsy-mobile-editor__color-spectrum-canvas": "_bsy-mobile-editor__color-spectrum-canvas_1eri1_538",
|
|
184
|
+
"bsy-mobile-editor__color-thumb": "_bsy-mobile-editor__color-thumb_1eri1_545",
|
|
185
|
+
"bsy-mobile-editor__sheet": "_bsy-mobile-editor__sheet_1eri1_555",
|
|
186
|
+
"bsy-mobile-editor__sheet-body": "_bsy-mobile-editor__sheet-body_1eri1_561",
|
|
187
|
+
"bsy-mobile-editor__sheet-body--stack": "_bsy-mobile-editor__sheet-body--stack_1eri1_566",
|
|
188
|
+
"bsy-mobile-editor__sheet-field": "_bsy-mobile-editor__sheet-field_1eri1_571",
|
|
189
|
+
"bsy-mobile-editor__sheet-label": "_bsy-mobile-editor__sheet-label_1eri1_576",
|
|
190
|
+
"bsy-mobile-editor__sheet-note": "_bsy-mobile-editor__sheet-note_1eri1_582",
|
|
191
|
+
"bsy-mobile-editor__sheet-note--hint": "_bsy-mobile-editor__sheet-note--hint_1eri1_588",
|
|
192
|
+
"bsy-mobile-editor__sheet-error": "_bsy-mobile-editor__sheet-error_1eri1_591",
|
|
193
|
+
"bsy-mobile-editor__sheet-bar": "_bsy-mobile-editor__sheet-bar_1eri1_611",
|
|
194
|
+
"bsy-mobile-editor__sheet-ok": "_bsy-mobile-editor__sheet-ok_1eri1_632",
|
|
195
|
+
"bsy-mobile-editor__check": "_bsy-mobile-editor__check_1eri1_637",
|
|
196
|
+
"bsy-mobile-editor__check-input": "_bsy-mobile-editor__check-input_1eri1_649",
|
|
197
|
+
"bsy-mobile-editor__check-box": "_bsy-mobile-editor__check-box_1eri1_656",
|
|
198
|
+
"bsy-mobile-editor__ai": "_bsy-mobile-editor__ai_1eri1_362",
|
|
199
|
+
"bsy-mobile-editor__ai-body": "_bsy-mobile-editor__ai-body_1eri1_678",
|
|
200
|
+
"bsy-mobile-editor__ai-section": "_bsy-mobile-editor__ai-section_1eri1_686",
|
|
201
|
+
"bsy-mobile-editor__ai-section-head": "_bsy-mobile-editor__ai-section-head_1eri1_694",
|
|
202
|
+
"bsy-mobile-editor__ai-section-scroll": "_bsy-mobile-editor__ai-section-scroll_1eri1_702",
|
|
203
|
+
"bsy-mobile-editor__ai-label": "_bsy-mobile-editor__ai-label_1eri1_709",
|
|
204
|
+
"bsy-mobile-editor__ai-label--after": "_bsy-mobile-editor__ai-label--after_1eri1_721",
|
|
205
|
+
"bsy-mobile-editor__ai-label--before": "_bsy-mobile-editor__ai-label--before_1eri1_725",
|
|
206
|
+
"bsy-mobile-editor__ai-dot": "_bsy-mobile-editor__ai-dot_1eri1_729",
|
|
207
|
+
"bsy-mobile-editor__ai-split": "_bsy-mobile-editor__ai-split_1eri1_736",
|
|
208
|
+
"bsy-mobile-editor__ai-preset": "_bsy-mobile-editor__ai-preset_1eri1_742",
|
|
209
|
+
"bsy-mobile-editor__ai-think-pin": "_bsy-mobile-editor__ai-think-pin_1eri1_762",
|
|
210
|
+
"bsy-mobile-editor__ai-think-head": "_bsy-mobile-editor__ai-think-head_1eri1_766",
|
|
211
|
+
"bsy-mobile-editor__ai-think-label": "_bsy-mobile-editor__ai-think-label_1eri1_783",
|
|
212
|
+
"bsy-mobile-editor__ai-think-label--shimmer": "_bsy-mobile-editor__ai-think-label--shimmer_1eri1_787",
|
|
213
|
+
"bsy-mobile-ai-think-shimmer": "_bsy-mobile-ai-think-shimmer_1eri1_1",
|
|
214
|
+
"bsy-mobile-editor__ai-think-arrow": "_bsy-mobile-editor__ai-think-arrow_1eri1_798",
|
|
215
|
+
"bsy-mobile-editor__ai-think-arrow--open": "_bsy-mobile-editor__ai-think-arrow--open_1eri1_805",
|
|
216
|
+
"bsy-mobile-editor__ai-think-icon": "_bsy-mobile-editor__ai-think-icon_1eri1_808",
|
|
217
|
+
"bsy-mobile-ai-think": "_bsy-mobile-ai-think_1eri1_1",
|
|
218
|
+
"bsy-mobile-editor__ai-think-body": "_bsy-mobile-editor__ai-think-body_1eri1_820",
|
|
219
|
+
"bsy-mobile-editor__ai-error": "_bsy-mobile-editor__ai-error_1eri1_829",
|
|
220
|
+
"bsy-mobile-editor__ai-footer": "_bsy-mobile-editor__ai-footer_1eri1_834",
|
|
221
|
+
"bsy-mobile-editor__ai-footer-ok": "_bsy-mobile-editor__ai-footer-ok_1eri1_856"
|
|
222
|
+
}, _t = {
|
|
223
|
+
typeset: [
|
|
224
|
+
"你是一名专业的 HTML 文档排版引擎。输入已是 HTML 片段。",
|
|
225
|
+
"任务:在不改内容层(措辞、语序、修辞、情感色彩)的前提下,做形式层 + 视觉层优化,充分利用富文本能力(标题、列表、加粗、字色、背景色、缩进、对齐)。",
|
|
226
|
+
"",
|
|
227
|
+
"【核心原则】",
|
|
228
|
+
"1. 清洁:物理勘误(OCR 误触)、空格/标点治理。",
|
|
229
|
+
"2. 结构:语义化标签(p / h1 / h2 / h3 / ul / ol / 联系方式分行)。",
|
|
230
|
+
"3. 视觉:为标题、小节名、关键词、联系方式、并列项增加加粗、颜色、浅底、缩进。可以新增强调,不要求原文先有引号或加粗。",
|
|
231
|
+
"绝对禁止:重写句子、替换同义词、删改口语词/语气词(如「哈哈」「傻死了」)、调整叙事顺序。",
|
|
232
|
+
"",
|
|
233
|
+
"【允许的排版操作】",
|
|
234
|
+
"1. 断句与分段:",
|
|
235
|
+
" - 无标点连写长句按语义切成短句,切分处可补「。」或「,」。",
|
|
236
|
+
" - 每个独立语义块用 <p> 包裹。",
|
|
237
|
+
" - 不得调换语义块先后顺序;允许同一语义流内断句分段。",
|
|
238
|
+
"2. 标点规范化:",
|
|
239
|
+
" - 「!!!!」→「!」,「。。。」→「。」,「,,,」→「,」。",
|
|
240
|
+
" - 中文语境下「,」→「,」、「.」→「。」;英文缩写、小数、网址、邮箱中的「.」「,」不改。",
|
|
241
|
+
"3. 空格治理:",
|
|
242
|
+
" - 删除汉字之间无意义空格;保留英文词间空格。",
|
|
243
|
+
" - 中英混排时,英文单词前后各留一个半角空格。",
|
|
244
|
+
"4. 物理勘误:",
|
|
245
|
+
" - 仅当上下文能唯一判定时,修正 0/O、1/l/I 等误触。",
|
|
246
|
+
" - 不修正拼写(「监介」必须保留)。",
|
|
247
|
+
"5. 结构标签化:",
|
|
248
|
+
" - 篇名/主标题用 <h1>,小节用 <h2>,更小的小标题用 <h3>。正文用 <p>。一篇里主标题通常只有一个 h1。",
|
|
249
|
+
" - 并列项用 <ul>/<ol> + <li>。",
|
|
250
|
+
" - 联系方式(电话/邮箱/地址)用 <p> 分行,除勘误外不改字符。",
|
|
251
|
+
" - 已有 a / img / table / strong / em / u / s / span 必须保留语义,可调整包裹层级。",
|
|
252
|
+
" - 表格单元格可以排版,不得删改实质内容。",
|
|
253
|
+
"6. 视觉增强(鼓励,且必须用内联 style;禁止 markdown):",
|
|
254
|
+
" - 小节名、分类标签、原文已强调的词:<strong>。禁止 **加粗**、## 标题、- 列表、[text](url)、围栏。",
|
|
255
|
+
" - 标题、关键数字、电话/邮箱:可给 span 加 color。",
|
|
256
|
+
" - 需要扫读的关键词:给 span 加 background-color 浅底。对:<span style=\"background-color:#fff4cd\">关键词</span>。错:<p style=\"background-color:#f0f6ff\">整段</p>。",
|
|
257
|
+
" - 背景色只能写在 span 上(短语级),禁止写在 p / h1-h3 / ul / ol / li。",
|
|
258
|
+
" - 段落/标题缩进只用 padding-inline-start,且必须是 40px 的倍数(与编辑器「增加缩进」一致)。",
|
|
259
|
+
" - 列表不要写 ul/ol/li 的 padding;标记槽由编辑器按字号处理。",
|
|
260
|
+
" - 颜色用任意合法 CSS 色值即可(#RGB、#RRGGBB、rgb())。同一篇里主色不超过 2 种强调色,正文保持深色可读。",
|
|
261
|
+
" - span 仅可用于 color / font-size / background-color。",
|
|
262
|
+
" - p / h1-h3 仅可用于 text-align / padding-inline-start。",
|
|
263
|
+
" - 禁止 padding(四边)、padding-top/right/bottom/left、border-radius、margin、box-shadow、border(td/th 除外)。编辑器不能给段落设内边距、圆角或背景色。",
|
|
264
|
+
"",
|
|
265
|
+
"【绝对红线】",
|
|
266
|
+
"- 不得增删实质性单词、数字、年份、名称。",
|
|
267
|
+
"- 不得删除括号、注释、语气词。",
|
|
268
|
+
"- 不得把口语改成书面语。",
|
|
269
|
+
"- 必须原样保留所有 <!--bsy-code-N-->;禁止新增、删除或改写 pre、code、data-language。",
|
|
270
|
+
"- 禁止编造或改写 img 的 src。",
|
|
271
|
+
"",
|
|
272
|
+
"【输出格式】",
|
|
273
|
+
"只输出纯净 HTML 片段。禁止 markdown 围栏(``` / ```html)、xml 声明、解释性前后文。",
|
|
274
|
+
"加粗用 <strong>,主标题用 <h1>,小节用 <h2>/<h3>,列表用 <ul>/<ol>。",
|
|
275
|
+
"允许标签:p, br, h1, h2, h3, ul, ol, li, strong, em, b, i, u, s, span, a, img, table, thead, tbody, tr, td, th, sub, sup。"
|
|
276
|
+
],
|
|
277
|
+
polishSystem: /* @__PURE__ */ "你是多语言语义层编辑引擎,只管「意」,不管「版式」(缩进、字体样式、HTML 标签)。,输入是按块切开的纯文本,可能包含任意语言(中文、英文、日文、代码注释、混合文本)。独立代码块不会出现在输入里。,输出仅润色后的纯文本,不加引号、标签或解释。,,【块结构(必须遵守)】,- 输入用 <!--bsy-block--> 分成若干块。一块对应编辑器里的一个标题或段落,顺序就是阅读顺序。,- 输出必须块数相同、顺序相同,并原样保留 <!--bsy-block-->。,- 禁止把两块合成一块,也禁止把一块拆成两块。,- 整块都是套话:该块输出为空,不要把文字并进前后块。,- 断句、加标点、删字只允许发生在块内。,- 不要跨块交换事实(电话、地址、日期、金额不要挪到别的块)。,- <!--bsy-block--> 不是版式,必须原样保留;分隔符周围的空行也不要删。,,【语言自适应处理】,- 自动识别输入文本的主语言(或混合语言比例)。,- 润色时,仅对该语言的语法、措辞、语气进行优化,绝对不跨语言串改(例如:不要把英文短句改成中文中式英语)。,- 专有名词(人名、地名、品牌名)、年份、固定术语保留原语言原字符,不进行翻译或音译。,,【受保护内容隔离区(绝对红线)】,以下内容不做语序或措辞调整;允许明显的 OCR/键盘字符级勘误(如 0 与 O、1 与 l),不要改空格布局。,1. 数学公式与符号:包括但不限于 = + - * / ^ _ { } ( ) [ ],以及 LaTeX 片段(如 E=mc^2、\\frac{a}{b})。,2. 计量单位与数值:如 10kg、$99.99、2026-08-26、99.9%。,3. 混在正文里的路径、命令、行内代码(如 /usr/bin/python)。独立代码块不在输入中。,4. 邮箱地址、网址(URL)、IP 地址:不要改域名或结构。,5. 化学式(H₂O)、物理量符号(λ、Δ)。,,【标点与断句(特殊允许)】,- 根据检测到的语言使用对应的标准标点(中文用中文标点,英文用英文标点)。,- 允许在块内添加/修改句号、逗号、感叹号、问号,用于断句和表达语气。,- 合并连续重复标点(如「!!!!」→「!」或「!!!!」→「!」)。,,【废话分级删除规则】,- 无意义套话(如「如有雷同纯属巧合」「最终解释权归本公司所有」)→ 直接删除。,- 无具体主体的万能版权模板(如单独一行 All rights reserved)可删;带年份或公司名的版权行保留。,- 冗余语气缓冲词(如「说实话」「我个人觉得」「I think」)→ 仅当语气为 formal / literary 时删除;为 colloquial / lively 时保留。,,【勘误优先级(必读)】,- 第一步:物理勘误(仅限明显的 OCR/键盘误触:如数字 0 写成字母 O、数字 1 写成 l/I,全角英文数字改成半角),直接修正。,- 第二步:措辞润色,但绝不修改第一步修正后的数字、年份、公式符号。,,【风格一致性约束】,- 全篇人称/敬语必须统一(中文:你/您;英文:you 与对应敬语;日文:です/ます调)。,- 禁止改变原文的事实性数据(数字、日期、金额、单位)。".split(","),
|
|
278
|
+
polish: {
|
|
279
|
+
quick: "语气:轻微改通顺,保持原意和人称。\n规则:尽量不改词,仅补充标点和必要连词;保护区原样保留。",
|
|
280
|
+
formal: "语气:更正式、书面(适配任意语言的标准书面体)。\n规则:删除口语词(啊/哦/啦/yeah/well),替换为客观陈述;数字原则上保持阿拉伯数字,不拼写为单词。",
|
|
281
|
+
colloquial: "语气:更口语、自然(适配日常聊天、社交媒体)。\n规则:保留语气词、感叹词,允许短句和不完整句,保留重复强调词(哈哈/haha/すごい)。",
|
|
282
|
+
lively: "语气:更生动、有画面感。\n规则:适当添加形容词和程度副词,但禁止虚构事实数据。",
|
|
283
|
+
literary: "语气:更书面、文学感(适配小说、散文、高级文案)。\n规则:若主语言为中文,允许四字格;若为英文,允许复杂从句和排比;不改变原风格基调。",
|
|
284
|
+
retro: "语气:带一点复古书面色彩,仍保持现代可读。\n规则:仅当主语言为中文时生效:仿民国白话风(之/其/乃);其他语言自动降级为 literary。"
|
|
285
|
+
}
|
|
286
|
+
}, vt = _t.typeset.join("\n"), yt = _t.polishSystem.join("\n"), bt = (e) => `${yt}\n\n【本轮风格】\n${_t.polish[e] ?? _t.polish.quick}`, xt = (e) => {
|
|
287
|
+
if (!e.trim()) return {
|
|
288
|
+
html: e,
|
|
289
|
+
blocks: []
|
|
290
|
+
};
|
|
291
|
+
let t = new DOMParser().parseFromString(e, "text/html"), n = [], r = Array.from(t.body.querySelectorAll("pre"));
|
|
292
|
+
for (let e of r) {
|
|
293
|
+
n.push(e.outerHTML);
|
|
294
|
+
let r = t.createComment(`bsy-code-${n.length - 1}`);
|
|
295
|
+
e.replaceWith(r);
|
|
296
|
+
}
|
|
297
|
+
return {
|
|
298
|
+
html: t.body.innerHTML,
|
|
299
|
+
blocks: n
|
|
300
|
+
};
|
|
301
|
+
}, St = "<!--bsy-block-->", Ct = /<!--bsy-code-(\d+)-->/g, wt = "bsy-html-root", Tt = (e) => new DOMParser().parseFromString(`<${wt}>${e}</${wt}>`, "text/html").body.querySelector(wt), Et = (e, t) => {
|
|
302
|
+
if (!t.length) return e;
|
|
303
|
+
let n = /* @__PURE__ */ new Set(), r = e.replace(Ct, (e, r) => {
|
|
304
|
+
let i = Number(r), a = t[i];
|
|
305
|
+
return a === void 0 ? "" : (n.add(i), a);
|
|
306
|
+
}), i = t.filter((e, t) => !n.has(t)).join("");
|
|
307
|
+
return i ? `${r}${i}` : r;
|
|
308
|
+
}, Dt = (e) => {
|
|
309
|
+
if (!/<pre[\s>/]/i.test(e)) return e;
|
|
310
|
+
let t = Tt(e);
|
|
311
|
+
if (!t) return e;
|
|
312
|
+
let n = t.ownerDocument;
|
|
313
|
+
for (let e of Array.from(t.querySelectorAll("pre"))) {
|
|
314
|
+
let t = n.createComment("bsy-code-dropped");
|
|
315
|
+
e.replaceWith(t);
|
|
316
|
+
}
|
|
317
|
+
return t.innerHTML.replace(/<!--bsy-code-dropped-->/g, "");
|
|
318
|
+
}, Ot = (e, t) => Et(Dt(e), t), kt = "p, h1, h2, h3, li", At = /background(-color)?\s*:/i, jt = (e) => {
|
|
319
|
+
if (!e.trim() || !At.test(e)) return e;
|
|
320
|
+
let t = Tt(e);
|
|
321
|
+
if (!t) return e;
|
|
322
|
+
for (let e of Array.from(t.querySelectorAll(kt))) {
|
|
323
|
+
let t = e;
|
|
324
|
+
t.style.removeProperty("background-color"), t.style.removeProperty("background"), t.getAttribute("style")?.trim() || t.removeAttribute("style");
|
|
325
|
+
}
|
|
326
|
+
return t.innerHTML;
|
|
327
|
+
}, Mt = "--listitem-marker-font-size", Nt = `max(24px, calc(var(${Mt}, 1em) * 1.25))`, Pt = new Set([
|
|
328
|
+
"U",
|
|
329
|
+
"I",
|
|
330
|
+
"EM",
|
|
331
|
+
"B",
|
|
332
|
+
"STRONG"
|
|
333
|
+
]), Ft = (e) => e.startsWith("--listitem-marker-"), It = (e) => {
|
|
334
|
+
let t = e.style.fontSize;
|
|
335
|
+
if (t) for (let n = e.parentElement; n; n = n.parentElement) Pt.has(n.tagName) && !n.style.fontSize && (n.style.fontSize = t), n.tagName === "LI" && !n.classList.contains("editor-nested-listitem") && !n.style.getPropertyValue(Mt) && n.style.setProperty(Mt, t);
|
|
336
|
+
}, Lt = (e, t, n, r) => {
|
|
337
|
+
if (!e) return;
|
|
338
|
+
let i = e.shadowRoot ?? e.attachShadow({ mode: "open" }), a = document.createElement("div");
|
|
339
|
+
a.className = "bsy-editor-html-preview__body", a.innerHTML = n(t);
|
|
340
|
+
for (let e of Array.from(a.querySelectorAll("table"))) {
|
|
341
|
+
if (e.parentElement?.classList.contains("editor-table-scrollable-wrapper")) continue;
|
|
342
|
+
let t = document.createElement("div");
|
|
343
|
+
t.className = "editor-table-scrollable-wrapper", e.replaceWith(t), t.append(e);
|
|
344
|
+
}
|
|
345
|
+
let o = document.createElement("style");
|
|
346
|
+
o.textContent = r, i.replaceChildren(o, a);
|
|
347
|
+
}, Rt = [
|
|
223
348
|
"color",
|
|
224
349
|
"background-color",
|
|
225
350
|
"font-size",
|
|
226
351
|
"font-family",
|
|
227
352
|
"font-weight",
|
|
228
353
|
"text-decoration"
|
|
229
|
-
],
|
|
354
|
+
], zt = (e) => {
|
|
230
355
|
let t = e.body.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, td, th");
|
|
231
356
|
for (let n of Array.from(t)) {
|
|
232
357
|
let t = n, r = [];
|
|
233
|
-
for (let e of
|
|
358
|
+
for (let e of Rt) {
|
|
234
359
|
let n = t.style.getPropertyValue(e);
|
|
235
360
|
n && (r.push(`${e}: ${n}`), t.style.removeProperty(e));
|
|
236
361
|
}
|
|
@@ -248,32 +373,34 @@ var st = [
|
|
|
248
373
|
}
|
|
249
374
|
}
|
|
250
375
|
}
|
|
251
|
-
},
|
|
252
|
-
let n =
|
|
376
|
+
}, Bt = (e, t) => {
|
|
377
|
+
let n = I();
|
|
253
378
|
if (n.clear(), t.trim()) {
|
|
254
379
|
let r = new DOMParser().parseFromString(t, "text/html");
|
|
255
|
-
|
|
380
|
+
zt(r);
|
|
256
381
|
let i = tt(e, r);
|
|
257
382
|
if (i.length) {
|
|
258
|
-
n.select(),
|
|
383
|
+
n.select(), be(i), Oe(null);
|
|
259
384
|
return;
|
|
260
385
|
}
|
|
261
386
|
}
|
|
262
|
-
let r =
|
|
263
|
-
n.append(r),
|
|
264
|
-
},
|
|
387
|
+
let r = _e();
|
|
388
|
+
n.append(r), Oe(null);
|
|
389
|
+
}, Vt = (e) => {
|
|
265
390
|
if (e) {
|
|
266
|
-
|
|
391
|
+
I().selectStart();
|
|
267
392
|
return;
|
|
268
393
|
}
|
|
269
|
-
|
|
270
|
-
},
|
|
271
|
-
|
|
394
|
+
Oe(null);
|
|
395
|
+
}, Ht = (e) => {
|
|
396
|
+
e && Oe(e.clone());
|
|
397
|
+
}, Ut = () => {
|
|
398
|
+
L() === null && I().selectStart();
|
|
272
399
|
}, H = (e) => {
|
|
273
400
|
e.isEditable() || e.setEditable(!0), e.update(() => {
|
|
274
|
-
|
|
401
|
+
Ut();
|
|
275
402
|
}), e.focus(void 0, { defaultSelection: "rootStart" });
|
|
276
|
-
},
|
|
403
|
+
}, Wt = (e, t) => !t.trim() && (e === "<p><br></p>" || e === "<p></p>" || e === "" || /^<p>\s*<br>\s*<\/p>$/.test(e)), Gt = /* @__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("."), Kt = [
|
|
277
404
|
"href",
|
|
278
405
|
"src",
|
|
279
406
|
"alt",
|
|
@@ -289,12 +416,12 @@ var st = [
|
|
|
289
416
|
"style",
|
|
290
417
|
"width",
|
|
291
418
|
"height"
|
|
292
|
-
],
|
|
419
|
+
], qt = 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(".")), Jt = /^(?:(?:(?:f|ht)tps?|mailto|blob):|data:image\/[a-z0-9.+-]+[;,].*|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i, Yt = new Set([
|
|
293
420
|
"pre",
|
|
294
421
|
"code",
|
|
295
422
|
"td",
|
|
296
423
|
"th"
|
|
297
|
-
]),
|
|
424
|
+
]), Xt = new Set(["pre", "code"]), Zt = new Set(["sup", "sub"]), Qt = (e, t) => Ft(e) ? t === "li" : qt.has(e) ? e === "padding-inline-start" ? !0 : e === "padding" || e.startsWith("padding-") ? Yt.has(t) : e === "border-radius" ? Xt.has(t) : e === "position" || e === "top" || e === "bottom" ? Zt.has(t) : !0 : !1, $t = (e, t) => e.split(";").map((e) => e.trim()).filter(Boolean).map((e) => {
|
|
298
425
|
let n = e.indexOf(":");
|
|
299
426
|
if (n === -1) return null;
|
|
300
427
|
let r = e.slice(0, n).trim().toLowerCase(), i = e.slice(n + 1).trim();
|
|
@@ -302,30 +429,30 @@ var st = [
|
|
|
302
429
|
if (/url\s*\(/i.test(i)) return null;
|
|
303
430
|
r = "background-color";
|
|
304
431
|
}
|
|
305
|
-
return !
|
|
306
|
-
}).filter((e) => e !== null).join("; "),
|
|
307
|
-
|
|
432
|
+
return !Qt(r, t) || /expression|javascript:|url\s*\(\s*['"]?\s*javascript/i.test(i) ? null : `${r}: ${i}`;
|
|
433
|
+
}).filter((e) => e !== null).join("; "), en = !1, tn = () => {
|
|
434
|
+
en ||= (nt.addHook("uponSanitizeAttribute", (e, t) => {
|
|
308
435
|
if (t.attrName === "href" && /^data:/i.test(t.attrValue)) {
|
|
309
436
|
t.keepAttr = !1;
|
|
310
437
|
return;
|
|
311
438
|
}
|
|
312
|
-
t.attrName === "style" && (t.attrValue =
|
|
439
|
+
t.attrName === "style" && (t.attrValue = $t(t.attrValue, e.nodeName.toLowerCase()), t.attrValue || (t.keepAttr = !1));
|
|
313
440
|
}), !0);
|
|
314
|
-
}, U = (e) => e ? (
|
|
315
|
-
ALLOWED_TAGS:
|
|
316
|
-
ALLOWED_ATTR:
|
|
441
|
+
}, U = (e) => e ? (tn(), nt.sanitize(e, {
|
|
442
|
+
ALLOWED_TAGS: Gt,
|
|
443
|
+
ALLOWED_ATTR: Kt,
|
|
317
444
|
ALLOW_DATA_ATTR: !1,
|
|
318
445
|
ADD_ATTR: [
|
|
319
446
|
"data-language",
|
|
320
447
|
"data-id",
|
|
321
448
|
"data-src"
|
|
322
449
|
],
|
|
323
|
-
ALLOWED_URI_REGEXP:
|
|
450
|
+
ALLOWED_URI_REGEXP: Jt
|
|
324
451
|
})) : "", W = {
|
|
325
452
|
margin: "0.6em 0 0.4em",
|
|
326
453
|
"font-weight": "600",
|
|
327
454
|
"line-height": "1.35"
|
|
328
|
-
},
|
|
455
|
+
}, nn = {
|
|
329
456
|
h1: {
|
|
330
457
|
...W,
|
|
331
458
|
"font-size": "2em"
|
|
@@ -350,24 +477,26 @@ var st = [
|
|
|
350
477
|
...W,
|
|
351
478
|
"font-size": "0.875em"
|
|
352
479
|
}
|
|
353
|
-
},
|
|
480
|
+
}, rn = {
|
|
354
481
|
color: "#0269ff",
|
|
355
482
|
cursor: "pointer"
|
|
356
|
-
},
|
|
483
|
+
}, an = {
|
|
357
484
|
margin: "0",
|
|
358
|
-
"padding-inline-start": "
|
|
485
|
+
"padding-inline-start": "0",
|
|
359
486
|
"list-style-position": "outside"
|
|
360
|
-
},
|
|
487
|
+
}, on = [
|
|
361
488
|
"disc",
|
|
362
489
|
"circle",
|
|
363
490
|
"square"
|
|
364
|
-
],
|
|
491
|
+
], sn = {
|
|
365
492
|
margin: "0",
|
|
493
|
+
"margin-inline-start": Nt,
|
|
366
494
|
"list-style": "inherit"
|
|
367
|
-
},
|
|
495
|
+
}, cn = {
|
|
368
496
|
margin: "0",
|
|
497
|
+
"margin-inline-start": "0",
|
|
369
498
|
"list-style-type": "none"
|
|
370
|
-
},
|
|
499
|
+
}, ln = {
|
|
371
500
|
display: "block",
|
|
372
501
|
"box-sizing": "border-box",
|
|
373
502
|
"max-width": "100%",
|
|
@@ -382,23 +511,23 @@ var st = [
|
|
|
382
511
|
"border-radius": "4px",
|
|
383
512
|
"background-color": "rgb(240, 242, 245)",
|
|
384
513
|
color: "#1f2328"
|
|
385
|
-
},
|
|
514
|
+
}, un = {
|
|
386
515
|
"border-collapse": "collapse",
|
|
387
516
|
"table-layout": "fixed",
|
|
388
517
|
width: "100%",
|
|
389
518
|
"overflow-x": "auto",
|
|
390
519
|
margin: "8px 0"
|
|
391
|
-
},
|
|
520
|
+
}, dn = {
|
|
392
521
|
"box-sizing": "border-box",
|
|
393
522
|
"min-width": "75px",
|
|
394
523
|
"min-height": "32px",
|
|
395
524
|
padding: "4px 8px",
|
|
396
525
|
border: "1px solid #d9d9d9",
|
|
397
526
|
"vertical-align": "top"
|
|
398
|
-
},
|
|
527
|
+
}, fn = {
|
|
399
528
|
"font-weight": "600",
|
|
400
529
|
"background-color": "#f2f3f5"
|
|
401
|
-
},
|
|
530
|
+
}, pn = {
|
|
402
531
|
display: "inline-block",
|
|
403
532
|
position: "static",
|
|
404
533
|
top: "auto",
|
|
@@ -407,38 +536,39 @@ var st = [
|
|
|
407
536
|
"line-height": "1"
|
|
408
537
|
}, G = (e, t) => {
|
|
409
538
|
for (let [n, r] of Object.entries(t)) e.style.getPropertyValue(n) || e.style.setProperty(n, r);
|
|
410
|
-
},
|
|
539
|
+
}, mn = (e) => {
|
|
411
540
|
let t = 0, n = e;
|
|
412
541
|
for (; n;) n.tagName === "UL" && (t += 1), n = n.parentElement;
|
|
413
542
|
return t;
|
|
414
|
-
},
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
543
|
+
}, hn = (e) => {
|
|
544
|
+
let t = [...e.querySelectorAll("*")].filter((e) => e instanceof HTMLElement);
|
|
545
|
+
for (let e of t) It(e);
|
|
546
|
+
for (let e of t) {
|
|
547
|
+
let t = e.tagName.toLowerCase(), n = nn[t];
|
|
548
|
+
if (n && G(e, n), t === "a" && G(e, rn), t === "ul") {
|
|
549
|
+
let t = Math.min(Math.max(mn(e), 1), on.length);
|
|
550
|
+
G(e, {
|
|
551
|
+
...an,
|
|
552
|
+
"list-style-type": on[t - 1]
|
|
423
553
|
});
|
|
424
554
|
}
|
|
425
|
-
|
|
426
|
-
...
|
|
555
|
+
t === "ol" && G(e, {
|
|
556
|
+
...an,
|
|
427
557
|
"list-style-type": "decimal"
|
|
428
|
-
}),
|
|
429
|
-
...
|
|
430
|
-
"vertical-align":
|
|
431
|
-
}),
|
|
432
|
-
for (let
|
|
433
|
-
|
|
558
|
+
}), t === "li" && G(e, e.classList.contains("editor-nested-listitem") ? cn : sn), t === "pre" && G(e, ln), (t === "sup" || t === "sub") && G(e, {
|
|
559
|
+
...pn,
|
|
560
|
+
"vertical-align": t === "sup" ? "super" : "sub"
|
|
561
|
+
}), t === "table" && G(e, un), (t === "td" || t === "th") && (G(e, dn), (t === "th" || e.classList.contains("editor-table-cell-header")) && G(e, fn)), 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
|
+
for (let t of Array.from(e.classList)) t.startsWith("editor-") && e.classList.remove(t);
|
|
563
|
+
e.classList.length === 0 && e.removeAttribute("class");
|
|
434
564
|
}
|
|
435
|
-
},
|
|
565
|
+
}, gn = (e) => {
|
|
436
566
|
let t = e.parentNode;
|
|
437
567
|
if (t) {
|
|
438
568
|
for (; e.firstChild;) t.insertBefore(e.firstChild, e);
|
|
439
569
|
t.removeChild(e);
|
|
440
570
|
}
|
|
441
|
-
},
|
|
571
|
+
}, _n = (e) => {
|
|
442
572
|
let t = !0;
|
|
443
573
|
for (; t;) {
|
|
444
574
|
t = !1;
|
|
@@ -446,21 +576,21 @@ var st = [
|
|
|
446
576
|
if (n.attributes.length > 0) continue;
|
|
447
577
|
let e = n.tagName.toLowerCase();
|
|
448
578
|
if (e === "span") {
|
|
449
|
-
|
|
579
|
+
gn(n), t = !0;
|
|
450
580
|
continue;
|
|
451
581
|
}
|
|
452
582
|
if (n.childElementCount !== 1 || n.childNodes.length !== 1) continue;
|
|
453
583
|
let r = n.firstElementChild;
|
|
454
|
-
(e === "b" && r?.tagName === "STRONG" || e === "i" && r?.tagName === "EM") && (
|
|
584
|
+
(e === "b" && r?.tagName === "STRONG" || e === "i" && r?.tagName === "EM") && (gn(n), t = !0);
|
|
455
585
|
}
|
|
456
586
|
}
|
|
457
|
-
},
|
|
587
|
+
}, vn = (e) => {
|
|
458
588
|
if (!e.trim()) return e;
|
|
459
589
|
let t = new DOMParser().parseFromString(e, "text/html");
|
|
460
|
-
|
|
590
|
+
hn(t.body), _n(t.body);
|
|
461
591
|
for (let e of Array.from(t.body.querySelectorAll("pre"))) e.textContent?.trim() || e.remove();
|
|
462
592
|
return t.body.innerHTML;
|
|
463
|
-
},
|
|
593
|
+
}, yn = (e) => e ? new DOMParser().parseFromString(e, "text/html").body.textContent ?? "" : "", bn = (e) => e.includes("<!--bsy-block-->") ? e.split(St).map((e) => e.trim()) : [e], xn = (e) => e.split(St).join("").trim().length > 0, Sn = (e, t) => {
|
|
464
594
|
let n = e.map(() => "");
|
|
465
595
|
if (e.length === 0) return n;
|
|
466
596
|
let r = [], i = [];
|
|
@@ -473,7 +603,7 @@ var st = [
|
|
|
473
603
|
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);
|
|
474
604
|
for (; d < c;) n[n.length - 1] += o[d], d += 1;
|
|
475
605
|
return n;
|
|
476
|
-
},
|
|
606
|
+
}, Cn = new Set([
|
|
477
607
|
"TABLE",
|
|
478
608
|
"THEAD",
|
|
479
609
|
"TBODY",
|
|
@@ -482,7 +612,7 @@ var st = [
|
|
|
482
612
|
"TH",
|
|
483
613
|
"IMG",
|
|
484
614
|
"BR"
|
|
485
|
-
]),
|
|
615
|
+
]), wn = (e) => {
|
|
486
616
|
let t = [], n = (e) => {
|
|
487
617
|
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
488
618
|
if (e.tagName === "PRE") return;
|
|
@@ -492,25 +622,25 @@ var st = [
|
|
|
492
622
|
e.nodeType === Node.TEXT_NODE && t.push(e);
|
|
493
623
|
};
|
|
494
624
|
return n(e), t;
|
|
495
|
-
},
|
|
625
|
+
}, Tn = (e, t) => {
|
|
496
626
|
let n = e;
|
|
497
|
-
for (; n && n !== t && !
|
|
627
|
+
for (; n && n !== t && !Cn.has(n.tagName) && !(n.textContent ?? "").trim() && !n.querySelector("img, table, br");) {
|
|
498
628
|
let e = n.parentElement;
|
|
499
629
|
n.remove(), n = e;
|
|
500
630
|
}
|
|
501
|
-
},
|
|
631
|
+
}, En = (e) => {
|
|
502
632
|
let t = e.tagName;
|
|
503
633
|
return t === "IMG" || t === "TABLE" || t === "PRE";
|
|
504
|
-
},
|
|
505
|
-
let t =
|
|
506
|
-
return t ? Array.from(t.children).filter((e) => !
|
|
507
|
-
},
|
|
508
|
-
let n =
|
|
634
|
+
}, Dn = (e) => {
|
|
635
|
+
let t = Tt(e);
|
|
636
|
+
return t ? Array.from(t.children).filter((e) => !En(e)).map((e) => e.textContent ?? "") : [];
|
|
637
|
+
}, On = (e) => e.includes("<!--bsy-block-->") ? e : yn(e) || e, kn = (e, t) => {
|
|
638
|
+
let n = wn(e);
|
|
509
639
|
if (n.length === 0) {
|
|
510
640
|
t && (e.querySelector("br")?.remove(), e.append(e.ownerDocument.createTextNode(t)));
|
|
511
641
|
return;
|
|
512
642
|
}
|
|
513
|
-
let r =
|
|
643
|
+
let r = Sn(n.map((e) => e.textContent ?? ""), t);
|
|
514
644
|
for (let t = 0; t < n.length; t++) {
|
|
515
645
|
let i = r[t], a = n[t];
|
|
516
646
|
if (i) {
|
|
@@ -518,60 +648,51 @@ var st = [
|
|
|
518
648
|
continue;
|
|
519
649
|
}
|
|
520
650
|
let o = a.parentElement;
|
|
521
|
-
a.remove(),
|
|
651
|
+
a.remove(), Tn(o, e);
|
|
522
652
|
}
|
|
523
|
-
},
|
|
524
|
-
let n =
|
|
525
|
-
if (!
|
|
526
|
-
let r =
|
|
653
|
+
}, An = (e, t) => {
|
|
654
|
+
let n = On(t);
|
|
655
|
+
if (!xn(n) || !e.trim()) return "";
|
|
656
|
+
let r = Tt(e);
|
|
527
657
|
if (!r) return "";
|
|
528
|
-
let i = Array.from(r.children).filter((e) => !
|
|
658
|
+
let i = Array.from(r.children).filter((e) => !En(e));
|
|
529
659
|
if (i.length === 0) return "";
|
|
530
|
-
let a =
|
|
531
|
-
for (let e = 0; e < i.length; e++)
|
|
660
|
+
let a = bn(n), o = a.length === i.length ? a : Sn(i.map((e) => e.textContent ?? ""), a.join(""));
|
|
661
|
+
for (let e = 0; e < i.length; e++) kn(i[e], o[e] ?? "");
|
|
532
662
|
return r.innerHTML;
|
|
533
|
-
},
|
|
663
|
+
}, jn = (e, t) => {
|
|
534
664
|
let n = "";
|
|
535
665
|
e.getEditorState().read(() => {
|
|
536
|
-
n =
|
|
666
|
+
n = vn(U(et(e, null)));
|
|
537
667
|
}, { editor: e });
|
|
538
|
-
let r = U(
|
|
539
|
-
return !r.trim() ||
|
|
540
|
-
|
|
668
|
+
let r = U(An(n, t));
|
|
669
|
+
return !r.trim() || Wt(r, yn(r)) ? !1 : (e.update(() => {
|
|
670
|
+
Bt(e, r), Vt(!0);
|
|
541
671
|
}, { discrete: !0 }), !0);
|
|
542
|
-
},
|
|
543
|
-
let t = "", n = "", r = "";
|
|
544
|
-
return e.getEditorState().read(() => {
|
|
545
|
-
n = F().getTextContent(), t = Yt(U(et(e, null))), r = cn(t).join(`\n\n${Xt}\n\n`);
|
|
546
|
-
}, { editor: e }), {
|
|
547
|
-
html: t,
|
|
548
|
-
text: n,
|
|
549
|
-
polishText: r
|
|
550
|
-
};
|
|
551
|
-
}, mn = /^\uFEFF/, hn = /^ {0,3}`{1,3}[A-Za-z]*$/, gn = /^( {0,3})([^`<]*?)```[ \t]*([A-Za-z0-9_-]*)[ \t]*(.*)$/, _n = /^ {0,3}```[ \t]*$/, vn = /<\/?[a-zA-Z]/, yn = /<[a-zA-Z!]/, bn = (e) => yn.test(e), xn = (e) => vn.test(e), Sn = (e) => e.replace(mn, "").replace(/\r\n/g, "\n"), Cn = (e) => {
|
|
672
|
+
}, Mn = /^\uFEFF/, Nn = /^ {0,3}`{1,3}[A-Za-z]*$/, Pn = /^( {0,3})([^`<]*?)```[ \t]*([A-Za-z0-9_-]*)[ \t]*(.*)$/, Fn = /^ {0,3}```[ \t]*$/, In = /<\/?[a-zA-Z]/, Ln = /<[a-zA-Z!]/, Rn = (e) => Ln.test(e), zn = (e) => In.test(e), Bn = (e) => e.replace(Mn, "").replace(/\r\n/g, "\n"), Vn = (e) => {
|
|
552
673
|
let t = e.replace(/\n+$/, ""), n = t.lastIndexOf("\n"), r = n === -1 ? t : t.slice(n + 1);
|
|
553
|
-
return
|
|
674
|
+
return Nn.test(r) ? {
|
|
554
675
|
text: n === -1 ? "" : t.slice(0, n),
|
|
555
676
|
withheld: !0
|
|
556
677
|
} : {
|
|
557
678
|
text: e,
|
|
558
679
|
withheld: !1
|
|
559
680
|
};
|
|
560
|
-
},
|
|
561
|
-
let t =
|
|
681
|
+
}, Hn = (e) => {
|
|
682
|
+
let t = Pn.exec(e);
|
|
562
683
|
return t ? { sameLineBody: t[4] ?? "" } : null;
|
|
563
|
-
},
|
|
684
|
+
}, Un = (e) => {
|
|
564
685
|
let t = e.replace(/[ \t]*```[ \t]*$/, "");
|
|
565
686
|
return t === e ? e : t;
|
|
566
|
-
},
|
|
687
|
+
}, Wn = (e) => Rn(e) ? e.replace(/^\n/, "") : "", Gn = (e) => {
|
|
567
688
|
let t = e.split("\n"), n = [], r = 0;
|
|
568
689
|
for (; r < t.length;) {
|
|
569
|
-
let e = t[r], i =
|
|
690
|
+
let e = t[r], i = Hn(e);
|
|
570
691
|
if (i) {
|
|
571
692
|
let e = i.sameLineBody;
|
|
572
|
-
if (e !==
|
|
573
|
-
e =
|
|
574
|
-
let i =
|
|
693
|
+
if (e !== Un(e)) {
|
|
694
|
+
e = Un(e);
|
|
695
|
+
let i = Wn(t.slice(r + 1).join("\n"));
|
|
575
696
|
return [
|
|
576
697
|
...n,
|
|
577
698
|
e,
|
|
@@ -579,61 +700,92 @@ var st = [
|
|
|
579
700
|
].filter(Boolean).join("\n");
|
|
580
701
|
}
|
|
581
702
|
let a = [];
|
|
582
|
-
for (e && a.push(e), r += 1; r < t.length && !
|
|
583
|
-
let o = r < t.length ?
|
|
703
|
+
for (e && a.push(e), r += 1; r < t.length && !Fn.test(t[r]);) a.push(t[r]), r += 1;
|
|
704
|
+
let o = r < t.length ? Wn(t.slice(r + 1).join("\n")) : "";
|
|
584
705
|
return [
|
|
585
706
|
...n,
|
|
586
707
|
a.join("\n"),
|
|
587
708
|
o
|
|
588
709
|
].filter(Boolean).join("\n");
|
|
589
710
|
}
|
|
590
|
-
if (
|
|
591
|
-
|
|
711
|
+
if (zn(e)) return Kn([...n, ...t.slice(r)].join("\n"));
|
|
712
|
+
Rn(e) && n.push(e), r += 1;
|
|
592
713
|
}
|
|
593
714
|
return n.length ? n.join("\n") : null;
|
|
594
|
-
},
|
|
715
|
+
}, Kn = (e) => {
|
|
595
716
|
let t = e.split("\n");
|
|
596
717
|
if (!t.length) return e;
|
|
597
|
-
let n =
|
|
598
|
-
return n && !
|
|
599
|
-
},
|
|
718
|
+
let n = Hn(t[0]);
|
|
719
|
+
return n && !zn(t[0].slice(0, t[0].indexOf("```"))) && (t.shift(), n.sameLineBody && t.unshift(Un(n.sameLineBody))), t.length && Fn.test(t[t.length - 1] ?? "") && t.pop(), t.join("\n");
|
|
720
|
+
}, qn = (e) => {
|
|
600
721
|
if (!e) return {
|
|
601
722
|
html: "",
|
|
602
723
|
pending: !1
|
|
603
724
|
};
|
|
604
|
-
let { text: t, withheld: n } =
|
|
725
|
+
let { text: t, withheld: n } = Vn(Bn(e));
|
|
605
726
|
if (!t.trim()) return {
|
|
606
727
|
html: "",
|
|
607
|
-
pending: n ||
|
|
728
|
+
pending: n || Nn.test(Bn(e).trim())
|
|
608
729
|
};
|
|
609
|
-
let r =
|
|
730
|
+
let r = Gn(t) ?? t, i = Gn(r);
|
|
610
731
|
i !== null && i !== r && (r = i);
|
|
611
732
|
let a = r.trim();
|
|
612
|
-
return
|
|
733
|
+
return Rn(a) ? {
|
|
613
734
|
html: a,
|
|
614
735
|
pending: !1
|
|
615
736
|
} : {
|
|
616
737
|
html: "",
|
|
617
738
|
pending: !0
|
|
618
739
|
};
|
|
619
|
-
},
|
|
740
|
+
}, Jn = (e, t) => {
|
|
741
|
+
let { html: n } = qn(e);
|
|
742
|
+
return n ? jt(Ot(n, t)) : "";
|
|
743
|
+
};
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region src/components/Editor/utils/applyAiTypeset.ts
|
|
746
|
+
function Yn(e, t, n) {
|
|
747
|
+
let r = U(Jn(t, n));
|
|
748
|
+
return !r.trim() || Wt(r, "") ? { applied: !1 } : (e.update(() => {
|
|
749
|
+
Bt(e, r), Vt(!0);
|
|
750
|
+
}, { discrete: !0 }), { applied: !0 });
|
|
751
|
+
}
|
|
752
|
+
//#endregion
|
|
753
|
+
//#region src/components/Editor/utils/readEditorAiSnapshot.ts
|
|
754
|
+
var Xn = (e) => {
|
|
755
|
+
let t = "", n = "", r = "";
|
|
756
|
+
e.getEditorState().read(() => {
|
|
757
|
+
n = I().getTextContent(), t = vn(U(et(e, null))), r = Dn(t).join(`\n\n${St}\n\n`);
|
|
758
|
+
}, { editor: e });
|
|
759
|
+
let i = xt(t);
|
|
760
|
+
return {
|
|
761
|
+
html: t,
|
|
762
|
+
text: n,
|
|
763
|
+
polishText: r,
|
|
764
|
+
htmlWithoutCode: i.html,
|
|
765
|
+
codeBlocks: i.blocks
|
|
766
|
+
};
|
|
767
|
+
}, Zn = ({ editor: e, ai: t }) => {
|
|
620
768
|
let n = u(t);
|
|
621
769
|
n.current = t;
|
|
622
770
|
let [r, i] = d(null), [a, o] = d({
|
|
623
771
|
html: "",
|
|
624
772
|
text: "",
|
|
625
|
-
polishText: ""
|
|
773
|
+
polishText: "",
|
|
774
|
+
htmlWithoutCode: "",
|
|
775
|
+
codeBlocks: []
|
|
626
776
|
}), [s, c] = d("quick"), l = () => {
|
|
627
|
-
let t =
|
|
777
|
+
let t = Xn(e);
|
|
628
778
|
o(t), i("typeset"), n.current?.typeset?.({
|
|
629
|
-
html: t.
|
|
630
|
-
text: t.text
|
|
779
|
+
html: t.htmlWithoutCode,
|
|
780
|
+
text: t.text,
|
|
781
|
+
prompt: vt
|
|
631
782
|
});
|
|
632
783
|
}, f = (t) => {
|
|
633
|
-
let r =
|
|
784
|
+
let r = Xn(e);
|
|
634
785
|
o(r), c(t), i("polish"), n.current?.stop?.(), n.current?.polish?.({
|
|
635
786
|
text: r.polishText,
|
|
636
|
-
preset: t
|
|
787
|
+
preset: t,
|
|
788
|
+
prompt: bt(t)
|
|
637
789
|
});
|
|
638
790
|
}, p = () => {
|
|
639
791
|
n.current?.stop?.(), i(null);
|
|
@@ -647,18 +799,11 @@ var st = [
|
|
|
647
799
|
close: p,
|
|
648
800
|
apply: () => {
|
|
649
801
|
let t = n.current?.text ?? "";
|
|
650
|
-
|
|
651
|
-
let n = U(kn(t).html);
|
|
652
|
-
if (!n.trim()) return;
|
|
653
|
-
e.update(() => {
|
|
654
|
-
yt(e, n), bt(!0);
|
|
655
|
-
});
|
|
656
|
-
} else r === "polish" && fn(e, t);
|
|
657
|
-
p();
|
|
802
|
+
r === "typeset" ? Yn(e, t, a.codeBlocks) : r === "polish" && jn(e, t), p();
|
|
658
803
|
}
|
|
659
804
|
};
|
|
660
|
-
},
|
|
661
|
-
let a = o(
|
|
805
|
+
}, Qn = i({}), K = 36, $n = 14, er = 2 * Math.PI * $n, tr = ({ nodeKey: e, src: t, altText: n, dataId: r, dataSrc: i }) => {
|
|
806
|
+
let a = o(Qn), s = e in a, c = a[e];
|
|
662
807
|
return /* @__PURE__ */ m("span", {
|
|
663
808
|
className: V["bsy-mobile-editor__image"],
|
|
664
809
|
children: [/* @__PURE__ */ p("img", {
|
|
@@ -682,26 +827,26 @@ var st = [
|
|
|
682
827
|
children: [/* @__PURE__ */ p("circle", {
|
|
683
828
|
cx: K / 2,
|
|
684
829
|
cy: K / 2,
|
|
685
|
-
r:
|
|
830
|
+
r: $n,
|
|
686
831
|
fill: "none",
|
|
687
832
|
stroke: "rgba(255,255,255,0.35)",
|
|
688
833
|
strokeWidth: "3"
|
|
689
834
|
}), /* @__PURE__ */ p("circle", {
|
|
690
835
|
cx: K / 2,
|
|
691
836
|
cy: K / 2,
|
|
692
|
-
r:
|
|
837
|
+
r: $n,
|
|
693
838
|
fill: "none",
|
|
694
839
|
stroke: "#fff",
|
|
695
840
|
strokeWidth: "3",
|
|
696
841
|
strokeLinecap: "round",
|
|
697
|
-
strokeDasharray: c === void 0 ? `${
|
|
698
|
-
strokeDashoffset: c === void 0 ? 0 :
|
|
842
|
+
strokeDasharray: c === void 0 ? `${er * .25} ${er}` : er,
|
|
843
|
+
strokeDashoffset: c === void 0 ? 0 : er * (1 - c / 100),
|
|
699
844
|
transform: `rotate(-90 ${K / 2} ${K / 2})`
|
|
700
845
|
})]
|
|
701
846
|
})
|
|
702
847
|
}) : null]
|
|
703
848
|
});
|
|
704
|
-
},
|
|
849
|
+
}, nr = class e extends Ne {
|
|
705
850
|
__src;
|
|
706
851
|
__altText;
|
|
707
852
|
__width;
|
|
@@ -741,13 +886,13 @@ var st = [
|
|
|
741
886
|
}
|
|
742
887
|
static importDOM() {
|
|
743
888
|
return { img: () => ({
|
|
744
|
-
conversion:
|
|
889
|
+
conversion: ar,
|
|
745
890
|
priority: 0
|
|
746
891
|
}) };
|
|
747
892
|
}
|
|
748
893
|
static importJSON(e) {
|
|
749
894
|
let { src: t, altText: n, width: r, height: i, dataId: a, dataSrc: o } = e;
|
|
750
|
-
return
|
|
895
|
+
return ir({
|
|
751
896
|
src: t,
|
|
752
897
|
altText: n,
|
|
753
898
|
width: r,
|
|
@@ -772,7 +917,7 @@ var st = [
|
|
|
772
917
|
return !0;
|
|
773
918
|
}
|
|
774
919
|
decorate() {
|
|
775
|
-
return /* @__PURE__ */ p(
|
|
920
|
+
return /* @__PURE__ */ p(tr, {
|
|
776
921
|
nodeKey: this.getKey(),
|
|
777
922
|
src: this.__src,
|
|
778
923
|
altText: this.__altText,
|
|
@@ -780,7 +925,7 @@ var st = [
|
|
|
780
925
|
dataSrc: this.__dataSrc
|
|
781
926
|
});
|
|
782
927
|
}
|
|
783
|
-
},
|
|
928
|
+
}, rr = (e) => e instanceof nr, ir = ({ src: e, altText: t, width: n, height: r, dataId: i, dataSrc: a, key: o }) => new nr(e, t, n, r, o, i, a), ar = (e) => {
|
|
784
929
|
if (!(e instanceof HTMLImageElement)) return null;
|
|
785
930
|
let { src: t, alt: n, style: r } = e, i, a;
|
|
786
931
|
if (r.width) {
|
|
@@ -791,7 +936,7 @@ var st = [
|
|
|
791
936
|
let e = parseInt(r.height, 10);
|
|
792
937
|
Number.isNaN(e) || (a = e);
|
|
793
938
|
}
|
|
794
|
-
return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node:
|
|
939
|
+
return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node: ir({
|
|
795
940
|
src: t,
|
|
796
941
|
altText: n,
|
|
797
942
|
width: i,
|
|
@@ -799,7 +944,7 @@ var st = [
|
|
|
799
944
|
dataId: e.getAttribute("data-id") || void 0,
|
|
800
945
|
dataSrc: e.getAttribute("data-src") || void 0
|
|
801
946
|
}) };
|
|
802
|
-
},
|
|
947
|
+
}, or = (e) => mt.includes(e.name.split(".").pop()?.toLowerCase() ?? ""), sr = (e) => or(e) ? e.size > 5242880 ? "size" : null : "type", cr = ({ editor: e, upload: t, savedSelectionRef: n, attachmentsBySrc: r }) => {
|
|
803
948
|
let i = u(null), o = u(null), c = u(!0), [l, f] = d({}), p = a(() => {
|
|
804
949
|
o.current?.abort(), o.current = null;
|
|
805
950
|
}, []);
|
|
@@ -809,15 +954,14 @@ var st = [
|
|
|
809
954
|
let m = a((t, r, i) => {
|
|
810
955
|
let a = "";
|
|
811
956
|
return e.update(() => {
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
let o = Ln({
|
|
957
|
+
Ht(n.current), L() === null && I().selectEnd();
|
|
958
|
+
let e = ir({
|
|
815
959
|
src: t,
|
|
816
960
|
altText: r,
|
|
817
961
|
dataSrc: i
|
|
818
962
|
});
|
|
819
|
-
a =
|
|
820
|
-
for (let
|
|
963
|
+
a = e.getKey(), be([e]);
|
|
964
|
+
for (let t of e.getParent()?.getChildren() ?? []) Te(t) && t.getTextContentSize() === 0 && t.remove();
|
|
821
965
|
}), a;
|
|
822
966
|
}, [e, n]);
|
|
823
967
|
return {
|
|
@@ -826,7 +970,7 @@ var st = [
|
|
|
826
970
|
insertImage: m,
|
|
827
971
|
onFileChange: a(async (n) => {
|
|
828
972
|
let i = n.target.files?.[0];
|
|
829
|
-
if (n.target.value = "", !i ||
|
|
973
|
+
if (n.target.value = "", !i || sr(i)) return;
|
|
830
974
|
p();
|
|
831
975
|
let a = new AbortController();
|
|
832
976
|
if (o.current = a, !t?.customRequest) {
|
|
@@ -851,7 +995,7 @@ var st = [
|
|
|
851
995
|
}));
|
|
852
996
|
let u = !1, d = (t) => {
|
|
853
997
|
u || (u = !0, URL.revokeObjectURL(s), t || e.update(() => {
|
|
854
|
-
|
|
998
|
+
F(l)?.remove();
|
|
855
999
|
}, c.current ? void 0 : { discrete: !0 }), c.current && f((e) => {
|
|
856
1000
|
let t = { ...e };
|
|
857
1001
|
return delete t[l], t;
|
|
@@ -880,8 +1024,8 @@ var st = [
|
|
|
880
1024
|
return;
|
|
881
1025
|
}
|
|
882
1026
|
e.update(() => {
|
|
883
|
-
let e =
|
|
884
|
-
|
|
1027
|
+
let e = F(l);
|
|
1028
|
+
rr(e) && (e.setSrc(o), s && e.setDataId(s));
|
|
885
1029
|
}), d(!0);
|
|
886
1030
|
} catch {
|
|
887
1031
|
d(!1);
|
|
@@ -895,13 +1039,13 @@ var st = [
|
|
|
895
1039
|
]),
|
|
896
1040
|
abortUpload: p
|
|
897
1041
|
};
|
|
898
|
-
},
|
|
1042
|
+
}, lr = ({ editor: e, savedSelectionRef: t, captureSelection: n }) => {
|
|
899
1043
|
let [r, i] = d(null);
|
|
900
1044
|
return {
|
|
901
1045
|
linkForm: r,
|
|
902
1046
|
openLink: () => {
|
|
903
1047
|
n(), e.getEditorState().read(() => {
|
|
904
|
-
let e =
|
|
1048
|
+
let e = L(), t = R(e) ? e.anchor.getNode() : null, n = t ? B(t, v) : null;
|
|
905
1049
|
if (n) {
|
|
906
1050
|
i({
|
|
907
1051
|
url: n.getURL(),
|
|
@@ -912,7 +1056,7 @@ var st = [
|
|
|
912
1056
|
}
|
|
913
1057
|
i({
|
|
914
1058
|
url: "",
|
|
915
|
-
text:
|
|
1059
|
+
text: R(e) ? e.getTextContent() : "",
|
|
916
1060
|
newBlank: !0
|
|
917
1061
|
});
|
|
918
1062
|
});
|
|
@@ -922,42 +1066,41 @@ var st = [
|
|
|
922
1066
|
if (!r) return;
|
|
923
1067
|
let a = r.startsWith("@") || /^https?:\/\//.test(r) ? r : `http://${r}`;
|
|
924
1068
|
e.update(() => {
|
|
925
|
-
|
|
926
|
-
e
|
|
927
|
-
let r = I(), i = n.newBlank ? {
|
|
1069
|
+
Ht(t.current);
|
|
1070
|
+
let e = L(), r = n.newBlank ? {
|
|
928
1071
|
target: "_blank",
|
|
929
1072
|
rel: "noopener noreferrer",
|
|
930
1073
|
title: n.url
|
|
931
1074
|
} : { title: n.url };
|
|
932
|
-
if (
|
|
933
|
-
let
|
|
934
|
-
if (
|
|
1075
|
+
if (R(e)) {
|
|
1076
|
+
let t = n.text.trim() || n.url;
|
|
1077
|
+
if (e.getTextContent()) y(a, r);
|
|
935
1078
|
else {
|
|
936
|
-
let
|
|
937
|
-
|
|
1079
|
+
let n = ye(t), i = _(a, r);
|
|
1080
|
+
i.append(n), e.insertNodes([i]);
|
|
938
1081
|
}
|
|
939
1082
|
} else {
|
|
940
|
-
let e = ye(n.text.trim() || n.url), t = _(a,
|
|
1083
|
+
let e = ye(n.text.trim() || n.url), t = _(a, r);
|
|
941
1084
|
t.append(e);
|
|
942
|
-
let
|
|
943
|
-
if (
|
|
1085
|
+
let i = I(), o = i.getLastChild();
|
|
1086
|
+
if (xe(o)) o.append(t);
|
|
944
1087
|
else {
|
|
945
|
-
let e =
|
|
946
|
-
e.append(t),
|
|
1088
|
+
let e = _e();
|
|
1089
|
+
e.append(t), i.append(e);
|
|
947
1090
|
}
|
|
948
1091
|
}
|
|
949
1092
|
}), i(null);
|
|
950
1093
|
},
|
|
951
1094
|
closeLink: () => i(null)
|
|
952
1095
|
};
|
|
953
|
-
},
|
|
1096
|
+
}, ur = ({ editor: e, value: t, onChange: n, attachmentsBySrc: r }) => {
|
|
954
1097
|
let i = u(null), o = u(n);
|
|
955
1098
|
o.current = n;
|
|
956
1099
|
let c = a((t) => {
|
|
957
1100
|
t.read(() => {
|
|
958
|
-
let n =
|
|
1101
|
+
let n = I().getTextContent(), a = vn(U(et(e, null))), s = Wt(a, n) ? null : a;
|
|
959
1102
|
i.current = s;
|
|
960
|
-
let c =
|
|
1103
|
+
let c = Ee(nr).map((e) => r.get(e.getSrc())).filter((e) => e !== void 0);
|
|
961
1104
|
o.current({
|
|
962
1105
|
text: n,
|
|
963
1106
|
html: s,
|
|
@@ -967,7 +1110,7 @@ var st = [
|
|
|
967
1110
|
}, [r, e]);
|
|
968
1111
|
return s(() => {
|
|
969
1112
|
t === void 0 || t === i.current || (i.current = t ?? null, e.update(() => {
|
|
970
|
-
|
|
1113
|
+
Bt(e, t?.trim() ? U(t) : ""), Vt(!!e.getRootElement()?.contains(document.activeElement));
|
|
971
1114
|
}, { onUpdate: () => {
|
|
972
1115
|
e.getRootElement() || c(e.getEditorState());
|
|
973
1116
|
} }));
|
|
@@ -976,19 +1119,19 @@ var st = [
|
|
|
976
1119
|
c,
|
|
977
1120
|
t
|
|
978
1121
|
]), c;
|
|
979
|
-
},
|
|
1122
|
+
}, dr = 250, fr = () => {
|
|
980
1123
|
let [e] = z(), t = u(0);
|
|
981
1124
|
return s(() => e.registerCommand(ze, (e) => {
|
|
982
1125
|
let n = Date.now(), r = n - t.current;
|
|
983
|
-
if (t.current = n, r <= 0 || r >=
|
|
984
|
-
let i =
|
|
985
|
-
if (!
|
|
1126
|
+
if (t.current = n, r <= 0 || r >= dr) return !1;
|
|
1127
|
+
let i = L();
|
|
1128
|
+
if (!R(i) || !i.isCollapsed()) return !1;
|
|
986
1129
|
let a = i.anchor.getNode();
|
|
987
1130
|
if (B(a, S)) return !1;
|
|
988
1131
|
let o = a.getTopLevelElement();
|
|
989
1132
|
if (!o || o.getTextContent().trim() !== "") return !1;
|
|
990
1133
|
i.setFormat(0);
|
|
991
|
-
let s =
|
|
1134
|
+
let s = _e();
|
|
992
1135
|
at(i, {
|
|
993
1136
|
"background-color": "",
|
|
994
1137
|
color: "",
|
|
@@ -1000,18 +1143,18 @@ var st = [
|
|
|
1000
1143
|
let c = s.getPreviousSibling();
|
|
1001
1144
|
return c?.getTextContent().trim() === "" && c.remove(), e?.preventDefault(), !0;
|
|
1002
1145
|
}, je), [e]), null;
|
|
1003
|
-
},
|
|
1146
|
+
}, pr = (e, t) => e.split(";").map((e) => e.trim()).filter((e) => e && e.split(":")[0].trim().toLowerCase() !== t).join("; "), mr = () => {
|
|
1004
1147
|
let [e] = z();
|
|
1005
|
-
return s(() => e.registerNodeTransform(
|
|
1148
|
+
return s(() => e.registerNodeTransform(ie, (e) => {
|
|
1006
1149
|
let t = e.getTag();
|
|
1007
1150
|
if (t === "h4" || t === "h5" || t === "h6") {
|
|
1008
|
-
e.replace(
|
|
1151
|
+
e.replace(_e(), !0);
|
|
1009
1152
|
return;
|
|
1010
1153
|
}
|
|
1011
1154
|
for (let t of e.getAllTextNodes()) {
|
|
1012
1155
|
let e = t.getStyle();
|
|
1013
1156
|
if (!e) continue;
|
|
1014
|
-
let n =
|
|
1157
|
+
let n = pr(e, "font-size");
|
|
1015
1158
|
n !== e && t.setStyle(n);
|
|
1016
1159
|
}
|
|
1017
1160
|
}), [e]), null;
|
|
@@ -1053,12 +1196,12 @@ var st = [
|
|
|
1053
1196
|
};
|
|
1054
1197
|
}
|
|
1055
1198
|
static importJSON(e) {
|
|
1056
|
-
return
|
|
1199
|
+
return hr().updateFromJSON(e);
|
|
1057
1200
|
}
|
|
1058
1201
|
isSimpleText() {
|
|
1059
1202
|
return this.__type === "extended-text" && this.__mode === 0;
|
|
1060
1203
|
}
|
|
1061
|
-
},
|
|
1204
|
+
}, hr = (e = "") => he(new q(e)), J = (e) => (t) => {
|
|
1062
1205
|
let n = e?.(t);
|
|
1063
1206
|
if (!n) return null;
|
|
1064
1207
|
let r = n.conversion(t);
|
|
@@ -1068,7 +1211,7 @@ var st = [
|
|
|
1068
1211
|
...r,
|
|
1069
1212
|
forChild: (e, t) => {
|
|
1070
1213
|
let n = (r?.forChild ?? ((e) => e))(e, t);
|
|
1071
|
-
if (
|
|
1214
|
+
if (Te(n)) {
|
|
1072
1215
|
let e = [
|
|
1073
1216
|
i ? `background-color: ${i}` : null,
|
|
1074
1217
|
a ? `color: ${a}` : null,
|
|
@@ -1082,33 +1225,33 @@ var st = [
|
|
|
1082
1225
|
return n;
|
|
1083
1226
|
}
|
|
1084
1227
|
};
|
|
1085
|
-
},
|
|
1228
|
+
}, gr = () => {
|
|
1086
1229
|
let [e] = z();
|
|
1087
1230
|
return s(() => e.registerNodeTransform(q, (e) => {
|
|
1088
1231
|
if (!B(e, v)) return;
|
|
1089
1232
|
let t = e.getStyle();
|
|
1090
1233
|
if (!t) return;
|
|
1091
|
-
let n =
|
|
1234
|
+
let n = pr(t, "color");
|
|
1092
1235
|
n !== t && e.setStyle(n);
|
|
1093
1236
|
}), [e]), null;
|
|
1094
|
-
},
|
|
1237
|
+
}, _r = /<img\b|<picture\b/i, vr = () => {
|
|
1095
1238
|
let [e] = z();
|
|
1096
1239
|
return s(() => {
|
|
1097
1240
|
let t = (t) => {
|
|
1098
1241
|
let n = "clipboardData" in t ? t.clipboardData : "dataTransfer" in t ? t.dataTransfer : null;
|
|
1099
1242
|
if (!n || n.getData("application/x-lexical-editor") || n.getData("application/x-lexical-drag")) return !1;
|
|
1100
1243
|
let r = n.getData("text/html");
|
|
1101
|
-
if (!(Array.from(n.files).some((e) => e.type.startsWith("image/")) || Array.from(n.items).some((e) => e.type.startsWith("image/")) ||
|
|
1244
|
+
if (!(Array.from(n.files).some((e) => e.type.startsWith("image/")) || Array.from(n.items).some((e) => e.type.startsWith("image/")) || _r.test(r))) return !1;
|
|
1102
1245
|
t.preventDefault();
|
|
1103
1246
|
let i = n.getData("text/plain");
|
|
1104
|
-
return !
|
|
1105
|
-
let t =
|
|
1247
|
+
return !_r.test(r) && !i || e.update(() => {
|
|
1248
|
+
let t = L();
|
|
1106
1249
|
if (t === null) return;
|
|
1107
1250
|
let n = r ? new DOMParser().parseFromString(r, "text/html") : null;
|
|
1108
1251
|
if (n?.querySelectorAll("img, picture").forEach((e) => e.remove()), (n?.body.innerHTML ?? "") && n?.body.textContent?.trim()) {
|
|
1109
1252
|
let t = tt(e, n);
|
|
1110
1253
|
if (t.length) {
|
|
1111
|
-
|
|
1254
|
+
be(t);
|
|
1112
1255
|
return;
|
|
1113
1256
|
}
|
|
1114
1257
|
}
|
|
@@ -1117,18 +1260,18 @@ var st = [
|
|
|
1117
1260
|
};
|
|
1118
1261
|
return rt(e.registerCommand(He, t, Ae), e.registerCommand(Me, t, Ae));
|
|
1119
1262
|
}, [e]), null;
|
|
1120
|
-
},
|
|
1263
|
+
}, yr = "data:image/png;base64,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", br = "data:image/png;base64,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", xr = (e, t, n) => Math.min(n, Math.max(t, e)), Y = (e) => xr(e, 0, 1), X = (e) => {
|
|
1121
1264
|
let t = e.trim().toLowerCase();
|
|
1122
1265
|
if (t === "" || t === "transparent") return !0;
|
|
1123
1266
|
let n = t.match(/^rgba\([^,]+,[^,]+,[^,]+,\s*([.\d]+)\s*\)$/);
|
|
1124
1267
|
return n !== null && Number(n[1]) === 0;
|
|
1125
|
-
},
|
|
1268
|
+
}, Sr = (e) => {
|
|
1126
1269
|
let t = e.trim().replace(/^#/, "");
|
|
1127
1270
|
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;
|
|
1128
|
-
},
|
|
1271
|
+
}, Cr = (e) => {
|
|
1129
1272
|
let t = e.trim();
|
|
1130
1273
|
if (X(t)) return null;
|
|
1131
|
-
let n =
|
|
1274
|
+
let n = Sr(t);
|
|
1132
1275
|
if (n) return {
|
|
1133
1276
|
r: Number.parseInt(n.slice(1, 3), 16),
|
|
1134
1277
|
g: Number.parseInt(n.slice(3, 5), 16),
|
|
@@ -1140,59 +1283,59 @@ var st = [
|
|
|
1140
1283
|
g: Number(r[2]),
|
|
1141
1284
|
b: Number(r[3])
|
|
1142
1285
|
} : null;
|
|
1143
|
-
},
|
|
1286
|
+
}, wr = ({ r: e, g: t, b: n }) => `#${[
|
|
1144
1287
|
e,
|
|
1145
1288
|
t,
|
|
1146
1289
|
n
|
|
1147
|
-
].map((e) =>
|
|
1290
|
+
].map((e) => xr(Math.round(e), 0, 255).toString(16).padStart(2, "0")).join("")}`, Tr = (e, t) => {
|
|
1148
1291
|
if (X(e) && X(t)) return !0;
|
|
1149
|
-
let n =
|
|
1292
|
+
let n = Cr(e), r = Cr(t);
|
|
1150
1293
|
return !!(n && r && n.r === r.r && n.g === r.g && n.b === r.b);
|
|
1151
|
-
},
|
|
1294
|
+
}, Er = (e) => {
|
|
1152
1295
|
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;
|
|
1153
1296
|
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), {
|
|
1154
1297
|
h: c,
|
|
1155
1298
|
s: s === 0 ? 0 : s / (1 - Math.abs(2 * o - 1)),
|
|
1156
1299
|
l: o
|
|
1157
1300
|
};
|
|
1158
|
-
},
|
|
1301
|
+
}, Dr = ({ h: e, s: t, l: n }) => {
|
|
1159
1302
|
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;
|
|
1160
1303
|
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), {
|
|
1161
1304
|
r: Math.round((s + o) * 255),
|
|
1162
1305
|
g: Math.round((c + o) * 255),
|
|
1163
1306
|
b: Math.round((l + o) * 255)
|
|
1164
1307
|
};
|
|
1165
|
-
},
|
|
1308
|
+
}, Or = (e) => wr(Dr(e)), kr = (e, t) => ({
|
|
1166
1309
|
h: Y(e) * 360,
|
|
1167
1310
|
s: 1,
|
|
1168
1311
|
l: Y(1 - t)
|
|
1169
|
-
}),
|
|
1312
|
+
}), Ar = (e) => ({
|
|
1170
1313
|
x: Y((e.h % 360 + 360) % 360 / 360),
|
|
1171
1314
|
y: Y(1 - e.l)
|
|
1172
|
-
}),
|
|
1315
|
+
}), jr = (e, t, n) => ({
|
|
1173
1316
|
x: Y(n.width === 0 ? 0 : (e - n.left) / n.width),
|
|
1174
1317
|
y: Y(n.height === 0 ? 0 : (t - n.top) / n.height)
|
|
1175
|
-
}),
|
|
1176
|
-
let r =
|
|
1318
|
+
}), Mr = (e, t, n = Infinity) => {
|
|
1319
|
+
let r = Cr(t);
|
|
1177
1320
|
if (!r) return e;
|
|
1178
|
-
let i =
|
|
1179
|
-
return [i, ...e.filter((e) => !
|
|
1180
|
-
},
|
|
1321
|
+
let i = wr(r);
|
|
1322
|
+
return [i, ...e.filter((e) => !Tr(e, i))].slice(0, n);
|
|
1323
|
+
}, Nr = (e, t = 24, n = 8) => Math.max(0, Math.floor((e + n) / (t + n))), Pr = (e, t) => {
|
|
1181
1324
|
let n = t % 11;
|
|
1182
1325
|
return Math.floor(t / 11) === 2 ? e[22] ?? e[t] : e[n] ?? e[t];
|
|
1183
|
-
}, Z = (...e) => e.filter(Boolean).join(" "),
|
|
1184
|
-
let t =
|
|
1326
|
+
}, Z = (...e) => e.filter(Boolean).join(" "), Fr = (e) => {
|
|
1327
|
+
let t = Cr(e) ?? {
|
|
1185
1328
|
r: 0,
|
|
1186
1329
|
g: 94,
|
|
1187
1330
|
b: 239
|
|
1188
1331
|
};
|
|
1189
1332
|
return {
|
|
1190
|
-
color:
|
|
1191
|
-
point:
|
|
1333
|
+
color: wr(t),
|
|
1334
|
+
point: Ar(Er(t))
|
|
1192
1335
|
};
|
|
1193
|
-
},
|
|
1194
|
-
let { t: l } = e(), [f, h] = d("presets"), [g, _] = d(() =>
|
|
1195
|
-
_(
|
|
1336
|
+
}, Ir = ({ mode: t, currentColor: r, customColors: i, onApply: a, onCustomDraftChange: o, onCustomConfirm: c }) => {
|
|
1337
|
+
let { t: l } = e(), [f, h] = d("presets"), [g, _] = d(() => Fr(r)), [v, y] = d(!1), [b, x] = d(null), S = u(null), C = u(null), w = u(null), T = (e = r) => {
|
|
1338
|
+
_(Fr(e)), y(!1), o(null), h("custom");
|
|
1196
1339
|
};
|
|
1197
1340
|
s(() => {
|
|
1198
1341
|
if (f !== "custom" || typeof ResizeObserver > "u") return;
|
|
@@ -1221,7 +1364,7 @@ var st = [
|
|
|
1221
1364
|
if (!e) return;
|
|
1222
1365
|
let t = () => {
|
|
1223
1366
|
let t = e.getBoundingClientRect().width;
|
|
1224
|
-
t > 0 && x(
|
|
1367
|
+
t > 0 && x(Nr(t));
|
|
1225
1368
|
};
|
|
1226
1369
|
if (t(), typeof ResizeObserver > "u") return;
|
|
1227
1370
|
let n = new ResizeObserver(t);
|
|
@@ -1230,7 +1373,7 @@ var st = [
|
|
|
1230
1373
|
let E = (e) => {
|
|
1231
1374
|
let t = S.current;
|
|
1232
1375
|
if (!t) return;
|
|
1233
|
-
let { x: n, y: r } =
|
|
1376
|
+
let { x: n, y: r } = jr(e.clientX, e.clientY, t.getBoundingClientRect()), i = Or(kr(n, r));
|
|
1234
1377
|
_({
|
|
1235
1378
|
color: i,
|
|
1236
1379
|
point: {
|
|
@@ -1269,7 +1412,7 @@ var st = [
|
|
|
1269
1412
|
role: "listbox",
|
|
1270
1413
|
"aria-label": l("editor.customColors"),
|
|
1271
1414
|
children: i.slice(0, b ?? i.length).map((e) => {
|
|
1272
|
-
let t =
|
|
1415
|
+
let t = Tr(r, e);
|
|
1273
1416
|
return /* @__PURE__ */ p("button", {
|
|
1274
1417
|
type: "button",
|
|
1275
1418
|
role: "option",
|
|
@@ -1347,7 +1490,7 @@ var st = [
|
|
|
1347
1490
|
role: "listbox",
|
|
1348
1491
|
"aria-label": l("editor.presetColors"),
|
|
1349
1492
|
children: ut.map((e, t) => {
|
|
1350
|
-
let n =
|
|
1493
|
+
let n = Tr(r, e);
|
|
1351
1494
|
return /* @__PURE__ */ p("button", {
|
|
1352
1495
|
type: "button",
|
|
1353
1496
|
role: "option",
|
|
@@ -1356,7 +1499,7 @@ var st = [
|
|
|
1356
1499
|
className: Z(V["bsy-mobile-editor__color-swatch"], n && V["bsy-mobile-editor__color-swatch--selected"]),
|
|
1357
1500
|
style: {
|
|
1358
1501
|
"--swatch-color": e,
|
|
1359
|
-
"--swatch-ring":
|
|
1502
|
+
"--swatch-ring": Pr(ut, t)
|
|
1360
1503
|
},
|
|
1361
1504
|
onClick: () => a(e),
|
|
1362
1505
|
children: /* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__color-swatch-fill"] })
|
|
@@ -1366,19 +1509,19 @@ var st = [
|
|
|
1366
1509
|
A
|
|
1367
1510
|
]
|
|
1368
1511
|
});
|
|
1369
|
-
},
|
|
1512
|
+
}, Lr = (e, t) => {
|
|
1370
1513
|
H(e), e.update(() => {
|
|
1371
|
-
ot(
|
|
1514
|
+
ot(L(), () => t === "paragraph" ? _e() : ne(t));
|
|
1372
1515
|
});
|
|
1373
|
-
},
|
|
1516
|
+
}, Rr = (e, t, n) => {
|
|
1374
1517
|
H(e), e.update(() => {
|
|
1375
|
-
|
|
1376
|
-
let e =
|
|
1518
|
+
Ht(n), Ut();
|
|
1519
|
+
let e = L();
|
|
1377
1520
|
e && at(e, t);
|
|
1378
1521
|
});
|
|
1379
|
-
},
|
|
1522
|
+
}, zr = ({ sheet: i, onClose: a, onTypeset: o, onPolishMenu: s, onPickPreset: c, onPicture: l, savedSelectionRef: h, committedColors: g, onColorCommit: _, canTypeset: v, canPolish: y }) => {
|
|
1380
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 : ct, D = (e, t = !1, n = !0) => {
|
|
1381
|
-
T && (n && (w.current = null),
|
|
1524
|
+
T && (n && (w.current = null), Rr(b, { [T === "fill" ? "background-color" : "color"]: e }, h.current), _(T, e), t && !X(e) && C((t) => Mr(t, e)), n && a());
|
|
1382
1525
|
}, O = (e) => {
|
|
1383
1526
|
w.current = null, D(e, !0, !1);
|
|
1384
1527
|
};
|
|
@@ -1441,7 +1584,7 @@ var st = [
|
|
|
1441
1584
|
text: x("editor.heading3")
|
|
1442
1585
|
}
|
|
1443
1586
|
],
|
|
1444
|
-
onAction: (e) =>
|
|
1587
|
+
onAction: (e) => Lr(b, e.key)
|
|
1445
1588
|
}),
|
|
1446
1589
|
/* @__PURE__ */ p(r, {
|
|
1447
1590
|
mode: "menu",
|
|
@@ -1452,7 +1595,7 @@ var st = [
|
|
|
1452
1595
|
key: e.value,
|
|
1453
1596
|
text: e.label
|
|
1454
1597
|
})),
|
|
1455
|
-
onAction: (e) =>
|
|
1598
|
+
onAction: (e) => Rr(b, { "font-size": e.key })
|
|
1456
1599
|
}),
|
|
1457
1600
|
/* @__PURE__ */ p(t, {
|
|
1458
1601
|
open: T !== null,
|
|
@@ -1461,7 +1604,7 @@ var st = [
|
|
|
1461
1604
|
e && O(e), a();
|
|
1462
1605
|
},
|
|
1463
1606
|
position: "bottom",
|
|
1464
|
-
children: T ? /* @__PURE__ */ p(
|
|
1607
|
+
children: T ? /* @__PURE__ */ p(Ir, {
|
|
1465
1608
|
mode: T,
|
|
1466
1609
|
currentColor: E,
|
|
1467
1610
|
customColors: S,
|
|
@@ -1481,7 +1624,7 @@ var st = [
|
|
|
1481
1624
|
text: x("editor.aiTypeset"),
|
|
1482
1625
|
disabled: !v,
|
|
1483
1626
|
icon: /* @__PURE__ */ p("img", {
|
|
1484
|
-
src:
|
|
1627
|
+
src: yr,
|
|
1485
1628
|
alt: "",
|
|
1486
1629
|
width: 16,
|
|
1487
1630
|
height: 16,
|
|
@@ -1493,7 +1636,7 @@ var st = [
|
|
|
1493
1636
|
text: x("editor.aiPolish"),
|
|
1494
1637
|
disabled: !y,
|
|
1495
1638
|
icon: /* @__PURE__ */ p("img", {
|
|
1496
|
-
src:
|
|
1639
|
+
src: br,
|
|
1497
1640
|
alt: "",
|
|
1498
1641
|
width: 16,
|
|
1499
1642
|
height: 16,
|
|
@@ -1543,7 +1686,7 @@ var st = [
|
|
|
1543
1686
|
onAction: (e) => l(e.key)
|
|
1544
1687
|
})
|
|
1545
1688
|
] });
|
|
1546
|
-
},
|
|
1689
|
+
}, Br = ({ open: r, title: i, bodyClassName: a, onClose: o, onConfirm: s, children: c }) => {
|
|
1547
1690
|
let { t: l } = e();
|
|
1548
1691
|
return /* @__PURE__ */ p(t, {
|
|
1549
1692
|
open: r,
|
|
@@ -1588,11 +1731,11 @@ var st = [
|
|
|
1588
1731
|
]
|
|
1589
1732
|
})
|
|
1590
1733
|
});
|
|
1591
|
-
},
|
|
1734
|
+
}, Vr = ({ open: t, seed: r, onClose: i, onConfirm: a }) => {
|
|
1592
1735
|
let { t: o } = e(), [c, l] = d(""), [u, f] = d(""), [h, g] = d(!0);
|
|
1593
1736
|
return s(() => {
|
|
1594
1737
|
!t || !r || (l(r.url), f(r.text), g(r.newBlank));
|
|
1595
|
-
}, [t, r]), /* @__PURE__ */ m(
|
|
1738
|
+
}, [t, r]), /* @__PURE__ */ m(Br, {
|
|
1596
1739
|
open: t,
|
|
1597
1740
|
title: o("editor.link"),
|
|
1598
1741
|
bodyClassName: V["bsy-mobile-editor__sheet-body--stack"],
|
|
@@ -1654,13 +1797,13 @@ var st = [
|
|
|
1654
1797
|
})
|
|
1655
1798
|
]
|
|
1656
1799
|
});
|
|
1657
|
-
},
|
|
1800
|
+
}, Hr = /^https?:\/\/.+/i, Ur = ({ open: t, onClose: n, onConfirm: r }) => {
|
|
1658
1801
|
let { t: i } = e(), [o, c] = d(""), [l, u] = d(null), f = a((e) => {
|
|
1659
1802
|
e?.focus();
|
|
1660
1803
|
}, []);
|
|
1661
1804
|
return s(() => {
|
|
1662
1805
|
t && (c(""), u(null));
|
|
1663
|
-
}, [t]), /* @__PURE__ */ p(
|
|
1806
|
+
}, [t]), /* @__PURE__ */ p(Br, {
|
|
1664
1807
|
open: t,
|
|
1665
1808
|
title: i("editor.imageUrl"),
|
|
1666
1809
|
onClose: n,
|
|
@@ -1670,7 +1813,7 @@ var st = [
|
|
|
1670
1813
|
u(i("editor.imageUrlRequired"));
|
|
1671
1814
|
return;
|
|
1672
1815
|
}
|
|
1673
|
-
if (!
|
|
1816
|
+
if (!Hr.test(e)) {
|
|
1674
1817
|
u(i("editor.imageUrlInvalid"));
|
|
1675
1818
|
return;
|
|
1676
1819
|
}
|
|
@@ -1703,26 +1846,175 @@ var st = [
|
|
|
1703
1846
|
]
|
|
1704
1847
|
})
|
|
1705
1848
|
});
|
|
1706
|
-
},
|
|
1849
|
+
}, Wr = `
|
|
1850
|
+
:host {
|
|
1851
|
+
all: initial;
|
|
1852
|
+
display: block;
|
|
1853
|
+
width: 100%;
|
|
1854
|
+
max-width: 100%;
|
|
1855
|
+
min-width: 0;
|
|
1856
|
+
}
|
|
1857
|
+
.bsy-editor-html-preview__body {
|
|
1858
|
+
color: #030303;
|
|
1859
|
+
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
|
|
1860
|
+
font-size: 15px;
|
|
1861
|
+
line-height: 1.6;
|
|
1862
|
+
word-break: break-word;
|
|
1863
|
+
}
|
|
1864
|
+
.bsy-editor-html-preview__body p {
|
|
1865
|
+
margin: 0;
|
|
1866
|
+
}
|
|
1867
|
+
.bsy-editor-html-preview__body .editor-text-bold {
|
|
1868
|
+
font-weight: 700;
|
|
1869
|
+
}
|
|
1870
|
+
.bsy-editor-html-preview__body .editor-text-italic {
|
|
1871
|
+
font-style: italic;
|
|
1872
|
+
}
|
|
1873
|
+
.bsy-editor-html-preview__body .editor-text-underline {
|
|
1874
|
+
text-decoration: underline;
|
|
1875
|
+
}
|
|
1876
|
+
.bsy-editor-html-preview__body .editor-text-strikethrough {
|
|
1877
|
+
text-decoration: line-through;
|
|
1878
|
+
}
|
|
1879
|
+
.bsy-editor-html-preview__body .editor-text-underline-strikethrough {
|
|
1880
|
+
text-decoration: underline line-through;
|
|
1881
|
+
}
|
|
1882
|
+
.bsy-editor-html-preview__body sup,
|
|
1883
|
+
.bsy-editor-html-preview__body sub {
|
|
1884
|
+
display: inline-block;
|
|
1885
|
+
position: static;
|
|
1886
|
+
top: auto;
|
|
1887
|
+
bottom: auto;
|
|
1888
|
+
font-size: 0.75em;
|
|
1889
|
+
line-height: 1;
|
|
1890
|
+
}
|
|
1891
|
+
.bsy-editor-html-preview__body sup {
|
|
1892
|
+
vertical-align: super;
|
|
1893
|
+
}
|
|
1894
|
+
.bsy-editor-html-preview__body sub {
|
|
1895
|
+
vertical-align: sub;
|
|
1896
|
+
}
|
|
1897
|
+
.bsy-editor-html-preview__body .editor-heading-h1,
|
|
1898
|
+
.bsy-editor-html-preview__body .editor-heading-h2,
|
|
1899
|
+
.bsy-editor-html-preview__body .editor-heading-h3 {
|
|
1900
|
+
margin: 0.6em 0 0.4em;
|
|
1901
|
+
font-weight: 600;
|
|
1902
|
+
line-height: 1.35;
|
|
1903
|
+
}
|
|
1904
|
+
.bsy-editor-html-preview__body .editor-heading-h1 {
|
|
1905
|
+
font-size: 2em;
|
|
1906
|
+
}
|
|
1907
|
+
.bsy-editor-html-preview__body .editor-heading-h2 {
|
|
1908
|
+
font-size: 1.5em;
|
|
1909
|
+
}
|
|
1910
|
+
.bsy-editor-html-preview__body .editor-heading-h3 {
|
|
1911
|
+
font-size: 1.25em;
|
|
1912
|
+
}
|
|
1913
|
+
.bsy-editor-html-preview__body ul,
|
|
1914
|
+
.bsy-editor-html-preview__body ol,
|
|
1915
|
+
.bsy-editor-html-preview__body .editor-list-ul,
|
|
1916
|
+
.bsy-editor-html-preview__body .editor-list-ol {
|
|
1917
|
+
margin: 0;
|
|
1918
|
+
padding-inline-start: 0;
|
|
1919
|
+
list-style-position: outside;
|
|
1920
|
+
}
|
|
1921
|
+
.bsy-editor-html-preview__body .editor-list-ul {
|
|
1922
|
+
list-style-type: disc;
|
|
1923
|
+
}
|
|
1924
|
+
.bsy-editor-html-preview__body .editor-list-ol {
|
|
1925
|
+
list-style-type: decimal;
|
|
1926
|
+
}
|
|
1927
|
+
.bsy-editor-html-preview__body li,
|
|
1928
|
+
.bsy-editor-html-preview__body .editor-listitem {
|
|
1929
|
+
margin: 0;
|
|
1930
|
+
margin-inline-start: ${Nt};
|
|
1931
|
+
list-style: inherit;
|
|
1932
|
+
}
|
|
1933
|
+
.bsy-editor-html-preview__body .editor-nested-listitem {
|
|
1934
|
+
margin-inline-start: 0;
|
|
1935
|
+
list-style-type: none;
|
|
1936
|
+
}
|
|
1937
|
+
.bsy-editor-html-preview__body li::marker,
|
|
1938
|
+
.bsy-editor-html-preview__body .editor-listitem::marker {
|
|
1939
|
+
color: var(--listitem-marker-color);
|
|
1940
|
+
background-color: var(--listitem-marker-background-color);
|
|
1941
|
+
font-family: var(--listitem-marker-font-family);
|
|
1942
|
+
font-size: var(--listitem-marker-font-size);
|
|
1943
|
+
}
|
|
1944
|
+
.bsy-editor-html-preview__body .editor-list-ul .editor-list-ul {
|
|
1945
|
+
list-style-type: circle;
|
|
1946
|
+
}
|
|
1947
|
+
.bsy-editor-html-preview__body .editor-list-ul .editor-list-ul .editor-list-ul {
|
|
1948
|
+
list-style-type: square;
|
|
1949
|
+
}
|
|
1950
|
+
.bsy-editor-html-preview__body .editor-link,
|
|
1951
|
+
.bsy-editor-html-preview__body .editor-link:link,
|
|
1952
|
+
.bsy-editor-html-preview__body .editor-link:visited,
|
|
1953
|
+
.bsy-editor-html-preview__body .editor-link:hover,
|
|
1954
|
+
.bsy-editor-html-preview__body .editor-link:active,
|
|
1955
|
+
.bsy-editor-html-preview__body .editor-link:focus {
|
|
1956
|
+
color: #0269ff;
|
|
1957
|
+
cursor: pointer;
|
|
1958
|
+
}
|
|
1959
|
+
.bsy-editor-html-preview__body .editor-link * {
|
|
1960
|
+
color: #0269ff !important;
|
|
1961
|
+
}
|
|
1962
|
+
.bsy-editor-html-preview__body pre {
|
|
1963
|
+
display: block;
|
|
1964
|
+
box-sizing: border-box;
|
|
1965
|
+
max-width: 100%;
|
|
1966
|
+
margin: 8px 0;
|
|
1967
|
+
padding: 8px 12px;
|
|
1968
|
+
overflow-x: auto;
|
|
1969
|
+
border-radius: 4px;
|
|
1970
|
+
background: rgb(240, 242, 245);
|
|
1971
|
+
color: #1f2328;
|
|
1972
|
+
font-family: Menlo, Consolas, Monaco, monospace;
|
|
1973
|
+
font-size: 13px;
|
|
1974
|
+
line-height: 1.53;
|
|
1975
|
+
tab-size: 2;
|
|
1976
|
+
white-space: pre;
|
|
1977
|
+
}
|
|
1978
|
+
.bsy-editor-html-preview__body .editor-table-scrollable-wrapper {
|
|
1979
|
+
max-width: 100%;
|
|
1980
|
+
margin: 8px 0;
|
|
1981
|
+
overflow-x: auto;
|
|
1982
|
+
-webkit-overflow-scrolling: touch;
|
|
1983
|
+
}
|
|
1984
|
+
.bsy-editor-html-preview__body table {
|
|
1985
|
+
width: max-content;
|
|
1986
|
+
min-width: 100%;
|
|
1987
|
+
margin: 0;
|
|
1988
|
+
border-collapse: collapse;
|
|
1989
|
+
table-layout: fixed;
|
|
1990
|
+
}
|
|
1991
|
+
.bsy-editor-html-preview__body td,
|
|
1992
|
+
.bsy-editor-html-preview__body th {
|
|
1993
|
+
box-sizing: border-box;
|
|
1994
|
+
min-width: 75px;
|
|
1995
|
+
min-height: 32px;
|
|
1996
|
+
padding: 4px 8px;
|
|
1997
|
+
border: 1px solid #d9d9d9;
|
|
1998
|
+
vertical-align: top;
|
|
1999
|
+
}
|
|
2000
|
+
.bsy-editor-html-preview__body th {
|
|
2001
|
+
background: #f2f3f5;
|
|
2002
|
+
font-weight: 600;
|
|
2003
|
+
}
|
|
2004
|
+
.bsy-editor-html-preview__body img {
|
|
2005
|
+
max-width: 100%;
|
|
2006
|
+
height: auto;
|
|
2007
|
+
vertical-align: baseline;
|
|
2008
|
+
}
|
|
2009
|
+
`, Gr = ({ html: e }) => {
|
|
1707
2010
|
let t = u(null);
|
|
1708
2011
|
return l(() => {
|
|
1709
|
-
|
|
1710
|
-
if (!n) return;
|
|
1711
|
-
let r = n.shadowRoot ?? n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
1712
|
-
i.className = "bsy-editor-html-preview__body", i.innerHTML = U(e);
|
|
1713
|
-
for (let e of Array.from(i.querySelectorAll("table"))) {
|
|
1714
|
-
if (e.parentElement?.classList.contains("editor-table-scrollable-wrapper")) continue;
|
|
1715
|
-
let t = document.createElement("div");
|
|
1716
|
-
t.className = "editor-table-scrollable-wrapper", e.replaceWith(t), t.append(e);
|
|
1717
|
-
}
|
|
1718
|
-
r.replaceChildren();
|
|
1719
|
-
let a = document.createElement("style");
|
|
1720
|
-
a.textContent = Cr, r.append(a, i);
|
|
2012
|
+
Lt(t.current, e, U, Wr);
|
|
1721
2013
|
}, [e]), /* @__PURE__ */ p("div", {
|
|
1722
2014
|
ref: t,
|
|
1723
2015
|
className: "bsy-editor-html-preview"
|
|
1724
2016
|
});
|
|
1725
|
-
},
|
|
2017
|
+
}, Kr = () => {
|
|
1726
2018
|
let e = `${c().replace(/:/g, "")}g`;
|
|
1727
2019
|
return /* @__PURE__ */ p("span", {
|
|
1728
2020
|
className: V["bsy-mobile-editor__ai-think-icon"],
|
|
@@ -1761,57 +2053,32 @@ var st = [
|
|
|
1761
2053
|
}) })]
|
|
1762
2054
|
})
|
|
1763
2055
|
});
|
|
1764
|
-
},
|
|
1765
|
-
let { t:
|
|
2056
|
+
}, qr = (t, n) => {
|
|
2057
|
+
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 ?? "";
|
|
1766
2058
|
return s(() => {
|
|
1767
|
-
if (!
|
|
1768
|
-
|
|
2059
|
+
if (!i) {
|
|
2060
|
+
p.current === null && (p.current = Math.max(1, Math.round((Date.now() - f.current) / 1e3)), l(p.current)), o(!1);
|
|
1769
2061
|
return;
|
|
1770
2062
|
}
|
|
1771
|
-
|
|
2063
|
+
f.current = Date.now(), p.current = null, o(!0);
|
|
1772
2064
|
let e = window.setInterval(() => {
|
|
1773
|
-
|
|
2065
|
+
l(Math.max(1, Math.round((Date.now() - f.current) / 1e3)));
|
|
1774
2066
|
}, 500);
|
|
1775
2067
|
return () => window.clearInterval(e);
|
|
1776
|
-
}, [
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
let e = r.current;
|
|
1784
|
-
!e || !v.current || (v.current = !1, e.scrollHeight - e.scrollTop - e.clientHeight > 8 && (_.current = !0));
|
|
1785
|
-
}, {
|
|
1786
|
-
target: b,
|
|
1787
|
-
passive: !0,
|
|
1788
|
-
enable: o
|
|
1789
|
-
}), s(() => {
|
|
1790
|
-
if (!o || _.current || !r.current) return;
|
|
1791
|
-
let e = window.requestAnimationFrame(() => {
|
|
1792
|
-
if (_.current) return;
|
|
1793
|
-
let e = r.current;
|
|
1794
|
-
e && e.scrollHeight - e.scrollTop - e.clientHeight > 1 && (e.scrollTop = e.scrollHeight);
|
|
1795
|
-
});
|
|
1796
|
-
return () => window.cancelAnimationFrame(e);
|
|
1797
|
-
}, [
|
|
1798
|
-
y,
|
|
1799
|
-
r,
|
|
1800
|
-
o
|
|
1801
|
-
]), {
|
|
1802
|
-
visible: (o || !!y) && !(t.status === "error" && !y),
|
|
1803
|
-
thinking: o,
|
|
1804
|
-
open: o || c,
|
|
1805
|
-
label: o ? i("editor.aiThinking") : i("editor.aiThoughtSeconds", { seconds: f }),
|
|
1806
|
-
reasoning: y,
|
|
1807
|
-
toggle: () => l((e) => !e)
|
|
2068
|
+
}, [i]), {
|
|
2069
|
+
visible: (i || !!m) && !(t.status === "error" && !m),
|
|
2070
|
+
thinking: i,
|
|
2071
|
+
open: i || a,
|
|
2072
|
+
label: i ? r("editor.aiThinking") : r("editor.aiThoughtSeconds", { seconds: c }),
|
|
2073
|
+
reasoning: m,
|
|
2074
|
+
toggle: () => o((e) => !e)
|
|
1808
2075
|
};
|
|
1809
|
-
},
|
|
2076
|
+
}, Jr = ({ model: e }) => /* @__PURE__ */ m("button", {
|
|
1810
2077
|
type: "button",
|
|
1811
2078
|
className: V["bsy-mobile-editor__ai-think-head"],
|
|
1812
2079
|
disabled: e.thinking,
|
|
1813
2080
|
onClick: e.toggle,
|
|
1814
|
-
children: [e.thinking ? /* @__PURE__ */ p(
|
|
2081
|
+
children: [e.thinking ? /* @__PURE__ */ p(Kr, {}) : /* @__PURE__ */ p(n, {
|
|
1815
2082
|
name: "arrow-down",
|
|
1816
2083
|
size: 12,
|
|
1817
2084
|
className: [V["bsy-mobile-editor__ai-think-arrow"], e.open ? V["bsy-mobile-editor__ai-think-arrow--open"] : ""].filter(Boolean).join(" ")
|
|
@@ -1819,17 +2086,108 @@ var st = [
|
|
|
1819
2086
|
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"],
|
|
1820
2087
|
children: e.label
|
|
1821
2088
|
})]
|
|
1822
|
-
}),
|
|
2089
|
+
}), Yr = ({ model: e }) => !e.visible || !e.open || !e.reasoning ? null : /* @__PURE__ */ p("div", {
|
|
1823
2090
|
className: V["bsy-mobile-editor__ai-think-body"],
|
|
1824
2091
|
children: e.reasoning
|
|
1825
|
-
}),
|
|
1826
|
-
let
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
2092
|
+
}), Xr = ({ enabled: e, status: t, revision: n, compute: r }) => {
|
|
2093
|
+
let [i, a] = d(""), o = u(r);
|
|
2094
|
+
o.current = r;
|
|
2095
|
+
let c = u(null);
|
|
2096
|
+
return l(() => {
|
|
2097
|
+
let n = () => {
|
|
2098
|
+
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
2099
|
+
};
|
|
2100
|
+
if (!e) {
|
|
2101
|
+
n(), a("");
|
|
2102
|
+
return;
|
|
2103
|
+
}
|
|
2104
|
+
let r = () => {
|
|
2105
|
+
c.current = null, a(o.current());
|
|
2106
|
+
};
|
|
2107
|
+
if (t === "ready" || t === "error") {
|
|
2108
|
+
n(), r();
|
|
2109
|
+
return;
|
|
2110
|
+
}
|
|
2111
|
+
c.current === null && (c.current = requestAnimationFrame(r));
|
|
2112
|
+
}, [
|
|
2113
|
+
e,
|
|
2114
|
+
n,
|
|
2115
|
+
t
|
|
2116
|
+
]), s(() => () => {
|
|
2117
|
+
c.current !== null && cancelAnimationFrame(c.current);
|
|
2118
|
+
}, []), i;
|
|
2119
|
+
}, Zr = 32, Qr = .25, $r = 2, ei = ({ viewportRef: e, enabled: t, revision: n }) => {
|
|
2120
|
+
let r = u(!0), i = u(!1), o = u(0), c = a(() => e.current ?? void 0, [e]), l = a(() => {
|
|
2121
|
+
o.current = 0;
|
|
2122
|
+
let t = e.current;
|
|
2123
|
+
if (!t || !r.current) return;
|
|
2124
|
+
let n = Math.max(0, t.scrollHeight - t.clientHeight), i = n - t.scrollTop;
|
|
2125
|
+
if (i <= 1) {
|
|
2126
|
+
t.scrollTop = n;
|
|
2127
|
+
return;
|
|
2128
|
+
}
|
|
2129
|
+
t.scrollTop += Math.max(i * Qr, Math.min(i, $r)), o.current = requestAnimationFrame(l);
|
|
2130
|
+
}, [e]), d = a(() => {
|
|
2131
|
+
!o.current && r.current && (o.current = requestAnimationFrame(l));
|
|
2132
|
+
}, [l]);
|
|
2133
|
+
s(() => {
|
|
2134
|
+
if (!t) {
|
|
2135
|
+
r.current = !0, i.current = !1, cancelAnimationFrame(o.current), o.current = 0;
|
|
2136
|
+
return;
|
|
2137
|
+
}
|
|
2138
|
+
d();
|
|
2139
|
+
}, [
|
|
2140
|
+
t,
|
|
2141
|
+
n,
|
|
2142
|
+
d
|
|
2143
|
+
]), s(() => {
|
|
2144
|
+
let n = e.current;
|
|
2145
|
+
if (!t || !n || typeof ResizeObserver > "u") return;
|
|
2146
|
+
let r = new ResizeObserver(d);
|
|
2147
|
+
return r.observe(n), n.firstElementChild && r.observe(n.firstElementChild), () => r.disconnect();
|
|
2148
|
+
}, [
|
|
2149
|
+
t,
|
|
2150
|
+
d,
|
|
2151
|
+
e
|
|
2152
|
+
]), s(() => () => cancelAnimationFrame(o.current), []);
|
|
2153
|
+
let f = () => {
|
|
2154
|
+
let t = e.current;
|
|
2155
|
+
if (!t) return;
|
|
2156
|
+
let n = t.scrollHeight - t.clientHeight - t.scrollTop <= Zr;
|
|
2157
|
+
i.current ? (i.current = !1, r.current = n, !n && o.current && (cancelAnimationFrame(o.current), o.current = 0)) : n && (r.current = !0);
|
|
2158
|
+
}, p = () => {
|
|
2159
|
+
i.current = !0;
|
|
2160
|
+
};
|
|
2161
|
+
return h("wheel", p, {
|
|
2162
|
+
target: c,
|
|
2163
|
+
passive: !0,
|
|
2164
|
+
enable: t
|
|
2165
|
+
}), h("touchstart", p, {
|
|
2166
|
+
target: c,
|
|
2167
|
+
passive: !0,
|
|
2168
|
+
enable: t
|
|
2169
|
+
}), h("scroll", f, {
|
|
2170
|
+
target: c,
|
|
2171
|
+
passive: !0,
|
|
2172
|
+
enable: t
|
|
2173
|
+
}), { onScroll: f };
|
|
2174
|
+
}, ti = ({ open: i, mode: a, originalHtml: o, codeBlocks: s = [], ai: c, polishPreset: l, onClose: h, onApply: g, onPickPreset: _ }) => {
|
|
2175
|
+
let { t: v } = e(), y = u(null), [b, x] = d(!1), S = c?.status ?? "idle", C = c?.text ?? "", w = Xr({
|
|
2176
|
+
enabled: i && !!a,
|
|
2177
|
+
status: S,
|
|
2178
|
+
revision: C,
|
|
2179
|
+
compute: () => a === "polish" ? U(An(o, C)) : Jn(C, s)
|
|
2180
|
+
}), T = !!w.trim(), E = qr({
|
|
2181
|
+
status: S,
|
|
2182
|
+
reasoning: c?.reasoning
|
|
2183
|
+
}, T), D = ei({
|
|
2184
|
+
viewportRef: y,
|
|
2185
|
+
enabled: i && S === "loading",
|
|
2186
|
+
revision: `${c?.reasoning ?? ""}\0${w}`
|
|
2187
|
+
}), O = S === "ready" && T;
|
|
1830
2188
|
return /* @__PURE__ */ m(t, {
|
|
1831
2189
|
open: i,
|
|
1832
|
-
onClose:
|
|
2190
|
+
onClose: h,
|
|
1833
2191
|
position: "bottom",
|
|
1834
2192
|
closeOnClickOverlay: !1,
|
|
1835
2193
|
children: [/* @__PURE__ */ m("div", {
|
|
@@ -1840,12 +2198,12 @@ var st = [
|
|
|
1840
2198
|
className: V["bsy-mobile-editor__header"],
|
|
1841
2199
|
children: [/* @__PURE__ */ p("div", {
|
|
1842
2200
|
className: V["bsy-mobile-editor__title"],
|
|
1843
|
-
children:
|
|
2201
|
+
children: v(a === "polish" ? "editor.aiPolish" : "editor.aiTypeset")
|
|
1844
2202
|
}), /* @__PURE__ */ p("button", {
|
|
1845
2203
|
type: "button",
|
|
1846
2204
|
className: V["bsy-mobile-editor__close"],
|
|
1847
|
-
"aria-label":
|
|
1848
|
-
onClick:
|
|
2205
|
+
"aria-label": v("popup.close"),
|
|
2206
|
+
onClick: h,
|
|
1849
2207
|
children: /* @__PURE__ */ p(n, {
|
|
1850
2208
|
name: "close",
|
|
1851
2209
|
size: 18
|
|
@@ -1862,28 +2220,29 @@ var st = [
|
|
|
1862
2220
|
className: V["bsy-mobile-editor__ai-section-head"],
|
|
1863
2221
|
children: [/* @__PURE__ */ m("div", {
|
|
1864
2222
|
className: `${V["bsy-mobile-editor__ai-label"]} ${V["bsy-mobile-editor__ai-label--after"]}`,
|
|
1865
|
-
children: [/* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__ai-dot"] }),
|
|
2223
|
+
children: [/* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__ai-dot"] }), v("editor.aiOptimized")]
|
|
1866
2224
|
}), a === "polish" ? /* @__PURE__ */ m("button", {
|
|
1867
2225
|
type: "button",
|
|
1868
2226
|
className: V["bsy-mobile-editor__ai-preset"],
|
|
1869
|
-
onClick: () =>
|
|
1870
|
-
children: [
|
|
2227
|
+
onClick: () => x(!0),
|
|
2228
|
+
children: [v(ft[l]), /* @__PURE__ */ p(n, {
|
|
1871
2229
|
name: "arrow-down",
|
|
1872
2230
|
size: 16
|
|
1873
2231
|
})]
|
|
1874
2232
|
}) : null]
|
|
1875
2233
|
}),
|
|
1876
|
-
|
|
2234
|
+
E.visible ? /* @__PURE__ */ p("div", {
|
|
1877
2235
|
className: V["bsy-mobile-editor__ai-think-pin"],
|
|
1878
|
-
children: /* @__PURE__ */ p(
|
|
2236
|
+
children: /* @__PURE__ */ p(Jr, { model: E })
|
|
1879
2237
|
}) : null,
|
|
1880
2238
|
/* @__PURE__ */ p("div", {
|
|
1881
|
-
ref:
|
|
2239
|
+
ref: y,
|
|
1882
2240
|
className: V["bsy-mobile-editor__ai-section-scroll"],
|
|
1883
|
-
|
|
2241
|
+
onScroll: D.onScroll,
|
|
2242
|
+
children: S === "error" ? /* @__PURE__ */ p("p", {
|
|
1884
2243
|
className: V["bsy-mobile-editor__ai-error"],
|
|
1885
|
-
children:
|
|
1886
|
-
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(
|
|
2244
|
+
children: c?.errorMessage || v("editor.aiError")
|
|
2245
|
+
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Yr, { model: E }), T ? /* @__PURE__ */ p(Gr, { html: w }) : null] })
|
|
1887
2246
|
})
|
|
1888
2247
|
]
|
|
1889
2248
|
}),
|
|
@@ -1894,11 +2253,11 @@ var st = [
|
|
|
1894
2253
|
className: V["bsy-mobile-editor__ai-section-head"],
|
|
1895
2254
|
children: /* @__PURE__ */ m("div", {
|
|
1896
2255
|
className: `${V["bsy-mobile-editor__ai-label"]} ${V["bsy-mobile-editor__ai-label--before"]}`,
|
|
1897
|
-
children: [/* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__ai-dot"] }),
|
|
2256
|
+
children: [/* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__ai-dot"] }), v("editor.aiOriginal")]
|
|
1898
2257
|
})
|
|
1899
2258
|
}), /* @__PURE__ */ p("div", {
|
|
1900
2259
|
className: V["bsy-mobile-editor__ai-section-scroll"],
|
|
1901
|
-
children: /* @__PURE__ */ p(
|
|
2260
|
+
children: /* @__PURE__ */ p(Gr, { html: o })
|
|
1902
2261
|
})]
|
|
1903
2262
|
})
|
|
1904
2263
|
]
|
|
@@ -1907,51 +2266,51 @@ var st = [
|
|
|
1907
2266
|
className: V["bsy-mobile-editor__ai-footer"],
|
|
1908
2267
|
children: [/* @__PURE__ */ p("button", {
|
|
1909
2268
|
type: "button",
|
|
1910
|
-
onClick:
|
|
1911
|
-
children:
|
|
2269
|
+
onClick: h,
|
|
2270
|
+
children: v("editor.aiAbandon")
|
|
1912
2271
|
}), /* @__PURE__ */ p("button", {
|
|
1913
2272
|
type: "button",
|
|
1914
2273
|
className: V["bsy-mobile-editor__ai-footer-ok"],
|
|
1915
|
-
disabled: !
|
|
1916
|
-
onClick:
|
|
1917
|
-
children:
|
|
2274
|
+
disabled: !O,
|
|
2275
|
+
onClick: g,
|
|
2276
|
+
children: v("editor.aiApply")
|
|
1918
2277
|
})]
|
|
1919
2278
|
})
|
|
1920
2279
|
]
|
|
1921
2280
|
}), a === "polish" ? /* @__PURE__ */ p(r, {
|
|
1922
2281
|
mode: "menu",
|
|
1923
|
-
open:
|
|
1924
|
-
title:
|
|
1925
|
-
onClose: () =>
|
|
2282
|
+
open: b,
|
|
2283
|
+
title: v("editor.aiPolish"),
|
|
2284
|
+
onClose: () => x(!1),
|
|
1926
2285
|
actions: dt.map((e) => ({
|
|
1927
2286
|
key: e,
|
|
1928
|
-
text:
|
|
2287
|
+
text: v(ft[e])
|
|
1929
2288
|
})),
|
|
1930
|
-
onAction: (e) =>
|
|
2289
|
+
onAction: (e) => _(e.key)
|
|
1931
2290
|
}) : null]
|
|
1932
2291
|
});
|
|
1933
|
-
},
|
|
2292
|
+
}, ni = "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", ri = "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", ii = 860.48, ai = 99.52, oi = /rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0(?:\.0+)?\s*\)/, si = {
|
|
1934
2293
|
fontColor: {
|
|
1935
|
-
path:
|
|
1936
|
-
clipHeight:
|
|
2294
|
+
path: ni,
|
|
2295
|
+
clipHeight: ii,
|
|
1937
2296
|
x: 128,
|
|
1938
2297
|
width: 768,
|
|
1939
2298
|
rx: 0
|
|
1940
2299
|
},
|
|
1941
2300
|
fill: {
|
|
1942
|
-
path:
|
|
2301
|
+
path: ri,
|
|
1943
2302
|
clipHeight: 816,
|
|
1944
2303
|
x: 112,
|
|
1945
2304
|
width: 800,
|
|
1946
2305
|
rx: 8
|
|
1947
2306
|
}
|
|
1948
|
-
},
|
|
2307
|
+
}, ci = (e, t) => {
|
|
1949
2308
|
let n = t.trim().toLowerCase();
|
|
1950
|
-
if (e === "fill") return !n || n === "transparent" ||
|
|
2309
|
+
if (e === "fill") return !n || n === "transparent" || oi.test(n);
|
|
1951
2310
|
let r = n.replace(/\s+/g, "");
|
|
1952
2311
|
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)";
|
|
1953
|
-
},
|
|
1954
|
-
let r = `${c().replace(/:/g, "")}clip`, i =
|
|
2312
|
+
}, li = ({ variant: e, barColor: t, size: n }) => {
|
|
2313
|
+
let r = `${c().replace(/:/g, "")}clip`, i = si[e];
|
|
1955
2314
|
return /* @__PURE__ */ m("svg", {
|
|
1956
2315
|
width: n,
|
|
1957
2316
|
height: n,
|
|
@@ -1974,15 +2333,15 @@ var st = [
|
|
|
1974
2333
|
}),
|
|
1975
2334
|
/* @__PURE__ */ p("rect", {
|
|
1976
2335
|
x: i.x,
|
|
1977
|
-
y:
|
|
2336
|
+
y: ii,
|
|
1978
2337
|
width: i.width,
|
|
1979
|
-
height:
|
|
2338
|
+
height: ai,
|
|
1980
2339
|
rx: i.rx,
|
|
1981
|
-
fill:
|
|
2340
|
+
fill: ci(e, t) ? "currentColor" : t
|
|
1982
2341
|
})
|
|
1983
2342
|
]
|
|
1984
2343
|
});
|
|
1985
|
-
},
|
|
2344
|
+
}, ui = {
|
|
1986
2345
|
bold: !1,
|
|
1987
2346
|
italic: !1,
|
|
1988
2347
|
underline: !1,
|
|
@@ -1995,20 +2354,20 @@ var st = [
|
|
|
1995
2354
|
headingTag: !1,
|
|
1996
2355
|
hasRangeSelection: !1,
|
|
1997
2356
|
hasEditorText: !1
|
|
1998
|
-
},
|
|
1999
|
-
let t = !!
|
|
2000
|
-
...
|
|
2357
|
+
}, di = (e) => e === "center" || e === "right" || e === "left" ? e : e === "end" ? "right" : "left", fi = (e) => {
|
|
2358
|
+
let t = !!I().getTextContent().trim(), n = {
|
|
2359
|
+
...ui,
|
|
2001
2360
|
hasEditorText: t
|
|
2002
2361
|
};
|
|
2003
2362
|
if (!e) return n;
|
|
2004
|
-
let r =
|
|
2005
|
-
if (!
|
|
2363
|
+
let r = L();
|
|
2364
|
+
if (!R(r)) return n;
|
|
2006
2365
|
let i = it(r, "color", ct), a = it(r, "background-color", lt), o = r.anchor.getNode(), s = o.getKey() === "root" ? o : B(o, (e) => {
|
|
2007
2366
|
let t = e.getParent();
|
|
2008
|
-
return t !== null &&
|
|
2367
|
+
return t !== null && Ce(t);
|
|
2009
2368
|
});
|
|
2010
2369
|
s === null && (s = o.getTopLevelElementOrThrow());
|
|
2011
|
-
let c = B(o, S), l = !1, u =
|
|
2370
|
+
let c = B(o, S), l = !1, u = xe(s) ? s.getIndent() : 0;
|
|
2012
2371
|
if (S(c)) {
|
|
2013
2372
|
u = c.getIndent();
|
|
2014
2373
|
let e = c.getParent();
|
|
@@ -2017,7 +2376,7 @@ var st = [
|
|
|
2017
2376
|
l = t === "number" || t === "bullet" ? t : !1;
|
|
2018
2377
|
}
|
|
2019
2378
|
}
|
|
2020
|
-
let d = B(o,
|
|
2379
|
+
let d = B(o, re), f = re(d) ? d.getTag() : void 0;
|
|
2021
2380
|
return {
|
|
2022
2381
|
bold: r.hasFormat("bold"),
|
|
2023
2382
|
italic: r.hasFormat("italic"),
|
|
@@ -2025,28 +2384,28 @@ var st = [
|
|
|
2025
2384
|
strikethrough: r.hasFormat("strikethrough"),
|
|
2026
2385
|
fontColor: i,
|
|
2027
2386
|
backgroundColor: a,
|
|
2028
|
-
align:
|
|
2387
|
+
align: di(xe(s) ? s.getFormatType() : ""),
|
|
2029
2388
|
listType: l,
|
|
2030
2389
|
canOutdent: u > 0 || l !== !1,
|
|
2031
2390
|
headingTag: f === "h1" || f === "h2" || f === "h3" ? f : !1,
|
|
2032
2391
|
hasRangeSelection: !0,
|
|
2033
2392
|
hasEditorText: t
|
|
2034
2393
|
};
|
|
2035
|
-
},
|
|
2394
|
+
}, pi = (e, t) => {
|
|
2036
2395
|
e.isEditable() || e.setEditable(!0), e.update(() => {
|
|
2037
|
-
|
|
2396
|
+
Ut(), t(fi(!0));
|
|
2038
2397
|
}), e.focus(void 0, { defaultSelection: "rootStart" });
|
|
2039
|
-
},
|
|
2040
|
-
let t =
|
|
2041
|
-
return
|
|
2398
|
+
}, mi = (e) => {
|
|
2399
|
+
let t = ui;
|
|
2400
|
+
return pi(e, (e) => {
|
|
2042
2401
|
t = e;
|
|
2043
2402
|
}), t;
|
|
2044
|
-
},
|
|
2403
|
+
}, hi = (...e) => e.filter(Boolean).join(" "), gi = (e) => e.buttons.map((e) => ({
|
|
2045
2404
|
name: typeof e == "string" ? e : e.name,
|
|
2046
2405
|
disabled: typeof e != "string" && !!e.props?.disabled
|
|
2047
|
-
})), Q = 24,
|
|
2406
|
+
})), Q = 24, _i = 20, $ = ({ active: e, disabled: t, expanded: n, label: r, select: i, selectAlign: a, onClick: o, children: s }) => /* @__PURE__ */ p("button", {
|
|
2048
2407
|
type: "button",
|
|
2049
|
-
className:
|
|
2408
|
+
className: hi(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"]),
|
|
2050
2409
|
"aria-label": r,
|
|
2051
2410
|
"aria-pressed": e,
|
|
2052
2411
|
"aria-expanded": i ? !!n : void 0,
|
|
@@ -2054,11 +2413,11 @@ var st = [
|
|
|
2054
2413
|
onMouseDown: (e) => e.preventDefault(),
|
|
2055
2414
|
onClick: o,
|
|
2056
2415
|
children: s
|
|
2057
|
-
}),
|
|
2416
|
+
}), vi = ({ open: e }) => /* @__PURE__ */ p(n, {
|
|
2058
2417
|
name: "arrow-down",
|
|
2059
|
-
size:
|
|
2060
|
-
className:
|
|
2061
|
-
}),
|
|
2418
|
+
size: _i,
|
|
2419
|
+
className: hi(V["bsy-mobile-editor__tool-caret"], e && V["bsy-mobile-editor__tool-caret--open"])
|
|
2420
|
+
}), yi = ({ config: t, formats: r, colorValues: i, openSheet: a, onOpenSheet: o, onOpenLink: c }) => {
|
|
2062
2421
|
let [l] = z(), { t: d } = e(), f = u(null), h = u(null), g = u(null), _ = () => {
|
|
2063
2422
|
let e = f.current, t = h.current, n = g.current;
|
|
2064
2423
|
if (!e || !t || !n) return;
|
|
@@ -2149,7 +2508,7 @@ var st = [
|
|
|
2149
2508
|
disabled: t,
|
|
2150
2509
|
label: d("editor.bulletList"),
|
|
2151
2510
|
onClick: () => {
|
|
2152
|
-
let e =
|
|
2511
|
+
let e = mi(l);
|
|
2153
2512
|
l.dispatchCommand(e.listType === "bullet" ? O : T, void 0);
|
|
2154
2513
|
},
|
|
2155
2514
|
children: /* @__PURE__ */ p(n, {
|
|
@@ -2162,7 +2521,7 @@ var st = [
|
|
|
2162
2521
|
disabled: t,
|
|
2163
2522
|
label: d("editor.numberList"),
|
|
2164
2523
|
onClick: () => {
|
|
2165
|
-
let e =
|
|
2524
|
+
let e = mi(l);
|
|
2166
2525
|
l.dispatchCommand(e.listType === "number" ? O : w, void 0);
|
|
2167
2526
|
},
|
|
2168
2527
|
children: /* @__PURE__ */ p(n, {
|
|
@@ -2181,7 +2540,7 @@ var st = [
|
|
|
2181
2540
|
children: [/* @__PURE__ */ p(n, {
|
|
2182
2541
|
name: r.align === "center" ? "paragraphmiddle" : r.align === "right" ? "paragraphright" : "paragraph",
|
|
2183
2542
|
size: Q
|
|
2184
|
-
}), /* @__PURE__ */ p(
|
|
2543
|
+
}), /* @__PURE__ */ p(vi, { open: a === "align" })]
|
|
2185
2544
|
}, e);
|
|
2186
2545
|
case "heading": return /* @__PURE__ */ m($, {
|
|
2187
2546
|
select: !0,
|
|
@@ -2194,7 +2553,7 @@ var st = [
|
|
|
2194
2553
|
children: [/* @__PURE__ */ p("span", {
|
|
2195
2554
|
className: V["bsy-mobile-editor__tool-text"],
|
|
2196
2555
|
children: r.headingTag ? r.headingTag.toUpperCase() : d("editor.paragraph")
|
|
2197
|
-
}), /* @__PURE__ */ p(
|
|
2556
|
+
}), /* @__PURE__ */ p(vi, { open: a === "heading" })]
|
|
2198
2557
|
}, e);
|
|
2199
2558
|
case "fontSize": return /* @__PURE__ */ p($, {
|
|
2200
2559
|
active: a === "fontSize",
|
|
@@ -2211,7 +2570,7 @@ var st = [
|
|
|
2211
2570
|
disabled: t,
|
|
2212
2571
|
label: d("editor.fontColor"),
|
|
2213
2572
|
onClick: () => o("fontColor"),
|
|
2214
|
-
children: /* @__PURE__ */ p(
|
|
2573
|
+
children: /* @__PURE__ */ p(li, {
|
|
2215
2574
|
variant: "fontColor",
|
|
2216
2575
|
barColor: i.fontColor,
|
|
2217
2576
|
size: Q
|
|
@@ -2222,7 +2581,7 @@ var st = [
|
|
|
2222
2581
|
disabled: t,
|
|
2223
2582
|
label: d("editor.fill"),
|
|
2224
2583
|
onClick: () => o("fill"),
|
|
2225
|
-
children: /* @__PURE__ */ p(
|
|
2584
|
+
children: /* @__PURE__ */ p(li, {
|
|
2226
2585
|
variant: "fill",
|
|
2227
2586
|
barColor: i.fill,
|
|
2228
2587
|
size: Q
|
|
@@ -2238,7 +2597,7 @@ var st = [
|
|
|
2238
2597
|
children: [/* @__PURE__ */ p(n, {
|
|
2239
2598
|
name: "picture",
|
|
2240
2599
|
size: Q
|
|
2241
|
-
}), /* @__PURE__ */ p(
|
|
2600
|
+
}), /* @__PURE__ */ p(vi, { open: a === "picture" })]
|
|
2242
2601
|
}, e);
|
|
2243
2602
|
case "link": return /* @__PURE__ */ p($, {
|
|
2244
2603
|
disabled: t,
|
|
@@ -2259,13 +2618,13 @@ var st = [
|
|
|
2259
2618
|
label: d("editor.ai"),
|
|
2260
2619
|
onClick: () => o("ai"),
|
|
2261
2620
|
children: [/* @__PURE__ */ p("img", {
|
|
2262
|
-
src:
|
|
2621
|
+
src: yr,
|
|
2263
2622
|
alt: "",
|
|
2264
2623
|
width: Q,
|
|
2265
2624
|
height: Q,
|
|
2266
2625
|
className: V["bsy-mobile-editor__ai-icon"],
|
|
2267
2626
|
draggable: !1
|
|
2268
|
-
}), /* @__PURE__ */ p(
|
|
2627
|
+
}), /* @__PURE__ */ p(vi, { open: n })]
|
|
2269
2628
|
}, e);
|
|
2270
2629
|
}
|
|
2271
2630
|
default: return null;
|
|
@@ -2278,7 +2637,7 @@ var st = [
|
|
|
2278
2637
|
className: V["bsy-mobile-editor__toolbar-scroller"],
|
|
2279
2638
|
onScroll: _,
|
|
2280
2639
|
children: t.map((e, t) => {
|
|
2281
|
-
let n =
|
|
2640
|
+
let n = gi(e);
|
|
2282
2641
|
return n.length ? /* @__PURE__ */ m("div", {
|
|
2283
2642
|
className: V["bsy-mobile-editor__toolbar-group"],
|
|
2284
2643
|
children: [t > 0 ? /* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__toolbar-divider"] }) : null, n.map(v)]
|
|
@@ -2295,19 +2654,19 @@ var st = [
|
|
|
2295
2654
|
})
|
|
2296
2655
|
})]
|
|
2297
2656
|
});
|
|
2298
|
-
},
|
|
2657
|
+
}, bi = () => {
|
|
2299
2658
|
let [e] = z(), [t, n] = d(!1);
|
|
2300
2659
|
return s(() => rt(e.registerCommand(Pe, () => (n(!0), !1), je), e.registerCommand(ke, () => (n(!1), !1), je)), [e]), t;
|
|
2301
|
-
},
|
|
2302
|
-
let [e] = z(), t =
|
|
2660
|
+
}, xi = () => {
|
|
2661
|
+
let [e] = z(), t = bi(), [n, r] = d(ui);
|
|
2303
2662
|
return s(() => (e.getEditorState().read(() => {
|
|
2304
|
-
r(
|
|
2663
|
+
r(fi(t));
|
|
2305
2664
|
}, { editor: e }), e.registerUpdateListener(({ editorState: n }) => {
|
|
2306
2665
|
n.read(() => {
|
|
2307
|
-
r(
|
|
2666
|
+
r(fi(t));
|
|
2308
2667
|
}, { editor: e });
|
|
2309
2668
|
})), [e, t]), n;
|
|
2310
|
-
},
|
|
2669
|
+
}, Si = "plaintext", Ci = "github-light", wi = new Set([
|
|
2311
2670
|
"plaintext",
|
|
2312
2671
|
"css",
|
|
2313
2672
|
"html",
|
|
@@ -2329,7 +2688,7 @@ var st = [
|
|
|
2329
2688
|
"bash",
|
|
2330
2689
|
"lua",
|
|
2331
2690
|
"markdown"
|
|
2332
|
-
]),
|
|
2691
|
+
]), Ti = (e) => e && wi.has(e) ? e : Si, Ei = {
|
|
2333
2692
|
css: () => import("@shikijs/langs/css"),
|
|
2334
2693
|
html: () => import("@shikijs/langs/html"),
|
|
2335
2694
|
xml: () => import("@shikijs/langs/xml"),
|
|
@@ -2350,41 +2709,41 @@ var st = [
|
|
|
2350
2709
|
bash: () => import("@shikijs/langs/shellscript"),
|
|
2351
2710
|
lua: () => import("@shikijs/langs/lua"),
|
|
2352
2711
|
markdown: () => import("@shikijs/langs/markdown")
|
|
2353
|
-
},
|
|
2712
|
+
}, Di = (e) => e === "bash" ? "shellscript" : e, Oi = (e) => e in Ei, ki = null, Ai = null, ji = /* @__PURE__ */ new Map(), Mi = () => (ki ||= Promise.all([import("@shikijs/core"), import("@shikijs/engine-javascript")]).then(([{ createHighlighterCoreSync: e }, { createJavaScriptRegexEngine: t }]) => e({
|
|
2354
2713
|
engine: t(),
|
|
2355
2714
|
langs: [],
|
|
2356
2715
|
themes: []
|
|
2357
2716
|
})).catch((e) => {
|
|
2358
|
-
throw
|
|
2359
|
-
}),
|
|
2360
|
-
let t =
|
|
2361
|
-
return t || (t =
|
|
2362
|
-
let n =
|
|
2717
|
+
throw ki = null, e;
|
|
2718
|
+
}), ki), Ni = (e, t) => Oi(t) && e.getLoadedLanguages().includes(Di(t)), Pi = (e) => {
|
|
2719
|
+
let t = ji.get(e);
|
|
2720
|
+
return t || (t = Mi().then(async (t) => {
|
|
2721
|
+
let n = Di(e);
|
|
2363
2722
|
if (!t.getLoadedLanguages().includes(n)) {
|
|
2364
|
-
let n = await
|
|
2723
|
+
let n = await Ei[e]();
|
|
2365
2724
|
await t.loadLanguage(n.default);
|
|
2366
2725
|
}
|
|
2367
2726
|
return t;
|
|
2368
2727
|
}).catch((t) => {
|
|
2369
|
-
throw
|
|
2370
|
-
}),
|
|
2371
|
-
},
|
|
2728
|
+
throw ji.delete(e), t;
|
|
2729
|
+
}), ji.set(e, t)), t;
|
|
2730
|
+
}, Fi = () => (Ai ||= Mi().then(async (e) => {
|
|
2372
2731
|
if (!e.getLoadedThemes().includes("github-light")) {
|
|
2373
2732
|
let t = await import("@shikijs/themes/github-light");
|
|
2374
2733
|
await e.loadTheme(t.default);
|
|
2375
2734
|
}
|
|
2376
2735
|
return e;
|
|
2377
2736
|
}).catch((e) => {
|
|
2378
|
-
throw
|
|
2379
|
-
}),
|
|
2737
|
+
throw Ai = null, e;
|
|
2738
|
+
}), Ai), Ii = (e, t, n) => {
|
|
2380
2739
|
let r = e.getTextContent();
|
|
2381
|
-
if (e.getStyle() && e.setStyle(""), !n || !
|
|
2740
|
+
if (e.getStyle() && e.setStyle(""), !n || !Ni(n, t)) return ee(r);
|
|
2382
2741
|
let i = n.codeToTokens(r, {
|
|
2383
|
-
lang:
|
|
2384
|
-
theme:
|
|
2742
|
+
lang: Di(t),
|
|
2743
|
+
theme: Ci
|
|
2385
2744
|
}).tokens, a = [];
|
|
2386
2745
|
return i.forEach((e, t) => {
|
|
2387
|
-
t && a.push(
|
|
2746
|
+
t && a.push(ge()), e.forEach((e) => {
|
|
2388
2747
|
e.content.split(" ").forEach((t, n) => {
|
|
2389
2748
|
if (n && a.push(ve()), !t) return;
|
|
2390
2749
|
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}` : "";
|
|
@@ -2392,11 +2751,11 @@ var st = [
|
|
|
2392
2751
|
});
|
|
2393
2752
|
});
|
|
2394
2753
|
}), a;
|
|
2395
|
-
},
|
|
2396
|
-
let n =
|
|
2754
|
+
}, Li = (e, t) => {
|
|
2755
|
+
let n = F(e);
|
|
2397
2756
|
if (!j(n) || !n.isAttached()) return;
|
|
2398
|
-
let r =
|
|
2399
|
-
if (!
|
|
2757
|
+
let r = L();
|
|
2758
|
+
if (!R(r)) {
|
|
2400
2759
|
t();
|
|
2401
2760
|
return;
|
|
2402
2761
|
}
|
|
@@ -2405,15 +2764,15 @@ var st = [
|
|
|
2405
2764
|
t();
|
|
2406
2765
|
return;
|
|
2407
2766
|
}
|
|
2408
|
-
let a = i.offset, o = i.type === "element" &&
|
|
2767
|
+
let a = i.offset, o = i.type === "element" && Se(n.getChildAtIndex(i.offset - 1)), s = 0;
|
|
2409
2768
|
if (o || (s = a + i.getNode().getPreviousSiblings().reduce((e, t) => e + t.getTextContentSize(), 0)), t()) {
|
|
2410
2769
|
if (o) {
|
|
2411
2770
|
i.getNode().select(a, a);
|
|
2412
2771
|
return;
|
|
2413
2772
|
}
|
|
2414
2773
|
n.getChildren().some((e) => {
|
|
2415
|
-
let t =
|
|
2416
|
-
if (t ||
|
|
2774
|
+
let t = Te(e);
|
|
2775
|
+
if (t || Se(e)) {
|
|
2417
2776
|
let n = e.getTextContentSize();
|
|
2418
2777
|
if (t && n >= s) return e.select(s, s), !0;
|
|
2419
2778
|
s -= n;
|
|
@@ -2421,27 +2780,27 @@ var st = [
|
|
|
2421
2780
|
return !1;
|
|
2422
2781
|
});
|
|
2423
2782
|
}
|
|
2424
|
-
},
|
|
2783
|
+
}, Ri = (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), zi = (e, t) => {
|
|
2425
2784
|
let n = 0;
|
|
2426
|
-
for (; n < e.length &&
|
|
2785
|
+
for (; n < e.length && Ri(e[n], t[n]);) n++;
|
|
2427
2786
|
let r = 0, i = Math.min(e.length, t.length) - n;
|
|
2428
|
-
for (; r < i &&
|
|
2787
|
+
for (; r < i && Ri(e[e.length - r - 1], t[t.length - r - 1]);) r++;
|
|
2429
2788
|
return {
|
|
2430
2789
|
from: n,
|
|
2431
2790
|
to: e.length - r,
|
|
2432
2791
|
replacement: t.slice(n, t.length - r)
|
|
2433
2792
|
};
|
|
2434
|
-
},
|
|
2435
|
-
let a = i.getKey(), o =
|
|
2793
|
+
}, Bi = (e, t, n, r, i) => {
|
|
2794
|
+
let a = i.getKey(), o = Ti(i.getLanguage());
|
|
2436
2795
|
if (i.getLanguage() !== o && i.setLanguage(o), o === "plaintext") i.getIsSyntaxHighlightSupported() && i.setIsSyntaxHighlightSupported(!1);
|
|
2437
2796
|
else {
|
|
2438
|
-
i.getTheme() !== "github-light" && i.setTheme(
|
|
2439
|
-
let s = t ? t.getLoadedThemes().includes("github-light") ?
|
|
2797
|
+
i.getTheme() !== "github-light" && i.setTheme(Ci);
|
|
2798
|
+
let s = t ? t.getLoadedThemes().includes("github-light") ? Oi(o) && !Ni(t, o) ? Pi(o) : null : Fi() : Mi();
|
|
2440
2799
|
if (s) {
|
|
2441
2800
|
i.getIsSyntaxHighlightSupported() && i.setIsSyntaxHighlightSupported(!1), n.pendingKeys.add(a), n.loading !== s && (n.loading = s, s.then((t) => {
|
|
2442
2801
|
r(t);
|
|
2443
2802
|
let i = [...n.pendingKeys];
|
|
2444
|
-
n.pendingKeys.clear(), n.loading = null, e.update(() => i.forEach((e) =>
|
|
2803
|
+
n.pendingKeys.clear(), n.loading = null, e.update(() => i.forEach((e) => F(e)?.markDirty()), { tag: Le });
|
|
2445
2804
|
}, () => {
|
|
2446
2805
|
n.pendingKeys.clear(), n.loading = null;
|
|
2447
2806
|
}));
|
|
@@ -2449,48 +2808,48 @@ var st = [
|
|
|
2449
2808
|
}
|
|
2450
2809
|
i.getIsSyntaxHighlightSupported() || i.setIsSyntaxHighlightSupported(!0);
|
|
2451
2810
|
}
|
|
2452
|
-
n.nodesCurrentlyHighlighting.has(a) || (n.nodesCurrentlyHighlighting.add(a), n.didTransform || (n.didTransform = !0,
|
|
2811
|
+
n.nodesCurrentlyHighlighting.has(a) || (n.nodesCurrentlyHighlighting.add(a), n.didTransform || (n.didTransform = !0, De(() => {
|
|
2453
2812
|
n.didTransform = !1, n.nodesCurrentlyHighlighting.clear();
|
|
2454
|
-
})),
|
|
2455
|
-
let e =
|
|
2813
|
+
})), Li(a, () => {
|
|
2814
|
+
let e = F(a);
|
|
2456
2815
|
if (!j(e) || !e.isAttached()) return !1;
|
|
2457
|
-
let n =
|
|
2816
|
+
let n = Ii(e, Ti(e.getLanguage()), t), { from: r, to: i, replacement: o } = zi(e.getChildren(), n);
|
|
2458
2817
|
return r === i && o.length === 0 ? !1 : (e.splice(r, i - r, o), !0);
|
|
2459
2818
|
}));
|
|
2460
|
-
},
|
|
2819
|
+
}, Vi = () => {
|
|
2461
2820
|
let [e] = z();
|
|
2462
2821
|
return s(() => {
|
|
2463
|
-
if (!e.hasNodes([
|
|
2822
|
+
if (!e.hasNodes([N, M])) throw Error("CodeHighlightPlugin: code nodes are not registered");
|
|
2464
2823
|
let t = null, n = {
|
|
2465
2824
|
didTransform: !1,
|
|
2466
2825
|
nodesCurrentlyHighlighting: /* @__PURE__ */ new Set(),
|
|
2467
2826
|
pendingKeys: /* @__PURE__ */ new Set(),
|
|
2468
2827
|
loading: null
|
|
2469
|
-
}, r = (r) =>
|
|
2828
|
+
}, r = (r) => Bi(e, t, n, (e) => {
|
|
2470
2829
|
t = e;
|
|
2471
2830
|
}, r), i = (e) => {
|
|
2472
2831
|
let t = e.getParent();
|
|
2473
2832
|
j(t) ? r(t) : A(e) && e.replace(ye(e.__text));
|
|
2474
2833
|
};
|
|
2475
|
-
return Ke(
|
|
2834
|
+
return Ke(te(e), e.registerNodeTransform(N, r), e.registerNodeTransform(We, i), e.registerNodeTransform(M, i));
|
|
2476
2835
|
}, [e]), null;
|
|
2477
|
-
},
|
|
2836
|
+
}, Hi = () => {
|
|
2478
2837
|
let [e] = z();
|
|
2479
|
-
return s(() => (
|
|
2838
|
+
return s(() => (me(e, !0), rt(fe(e), pe(e, !1), de(e), e.registerNodeTransform(ce, (e) => {
|
|
2480
2839
|
e.getBackgroundColor() !== null && e.setBackgroundColor(null);
|
|
2481
2840
|
}), e.registerCommand(Be, (e) => {
|
|
2482
|
-
let t =
|
|
2483
|
-
if (!
|
|
2484
|
-
let n =
|
|
2841
|
+
let t = L();
|
|
2842
|
+
if (!R(t) || !t.isCollapsed()) return !1;
|
|
2843
|
+
let n = ae(t.anchor.getNode());
|
|
2485
2844
|
if (n === null) return !1;
|
|
2486
2845
|
let r = e.shiftKey ? "previous" : "next", i = r === "next" ? "getNextSibling" : "getPreviousSibling", a = r === "next" ? "getFirstChild" : "getLastChild", o = n[i](), s = null;
|
|
2487
|
-
if (
|
|
2846
|
+
if (oe(o)) s = o;
|
|
2488
2847
|
else {
|
|
2489
|
-
let e = B(n,
|
|
2848
|
+
let e = B(n, se);
|
|
2490
2849
|
if (e !== null) for (let t = e[i](); t !== null; t = t[i]()) {
|
|
2491
|
-
if (!
|
|
2850
|
+
if (!se(t)) continue;
|
|
2492
2851
|
let e = t[a]();
|
|
2493
|
-
if (
|
|
2852
|
+
if (oe(e)) {
|
|
2494
2853
|
s = e;
|
|
2495
2854
|
break;
|
|
2496
2855
|
}
|
|
@@ -2500,39 +2859,39 @@ var st = [
|
|
|
2500
2859
|
let e = s.getFirstDescendant();
|
|
2501
2860
|
e ? e.selectStart() : s.selectStart();
|
|
2502
2861
|
} else {
|
|
2503
|
-
let e = B(n,
|
|
2862
|
+
let e = B(n, P);
|
|
2504
2863
|
e && (r === "next" ? e.selectNext() : e.selectPrevious());
|
|
2505
2864
|
}
|
|
2506
2865
|
return !0;
|
|
2507
2866
|
}, Ae))), [e]), null;
|
|
2508
|
-
},
|
|
2509
|
-
let [f] = z(), { t: h } = e(), g =
|
|
2867
|
+
}, Ui = ({ value: n, onChange: r, open: i, onOpenChange: a, toolbar: o, upload: c, ai: l }) => {
|
|
2868
|
+
let [f] = z(), { t: h } = e(), g = xi(), [_, v] = d(!1), y = i ?? _, b = (e) => {
|
|
2510
2869
|
a?.(e), i === void 0 && v(e);
|
|
2511
2870
|
}, [x, S] = d(null), [C, w] = d(() => ({
|
|
2512
2871
|
fontColor: g.fontColor,
|
|
2513
2872
|
fill: g.backgroundColor
|
|
2514
2873
|
})), T = u(!1), [E, D] = d(!1), O = u(null), k = () => {
|
|
2515
2874
|
f.getEditorState().read(() => {
|
|
2516
|
-
O.current =
|
|
2875
|
+
O.current = L()?.clone() ?? null;
|
|
2517
2876
|
});
|
|
2518
|
-
}, { linkForm: A, openLink: j, confirmLink: ee, closeLink:
|
|
2877
|
+
}, { linkForm: A, openLink: j, confirmLink: ee, closeLink: M } = lr({
|
|
2519
2878
|
editor: f,
|
|
2520
2879
|
savedSelectionRef: O,
|
|
2521
2880
|
captureSelection: k
|
|
2522
|
-
}), [
|
|
2881
|
+
}), [N] = d(() => /* @__PURE__ */ new Map()), { fileInputRef: te, uploadProgress: ne, insertImage: re, onFileChange: ie, abortUpload: ae } = cr({
|
|
2523
2882
|
editor: f,
|
|
2524
2883
|
upload: c,
|
|
2525
2884
|
savedSelectionRef: O,
|
|
2526
|
-
attachmentsBySrc:
|
|
2527
|
-
}),
|
|
2885
|
+
attachmentsBySrc: N
|
|
2886
|
+
}), oe = ur({
|
|
2528
2887
|
editor: f,
|
|
2529
2888
|
value: n,
|
|
2530
2889
|
onChange: r,
|
|
2531
|
-
attachmentsBySrc:
|
|
2532
|
-
}),
|
|
2890
|
+
attachmentsBySrc: N
|
|
2891
|
+
}), P = Zn({
|
|
2533
2892
|
editor: f,
|
|
2534
2893
|
ai: l
|
|
2535
|
-
}), [
|
|
2894
|
+
}), [se, ce] = d(0), le = o?.config ?? pt;
|
|
2536
2895
|
s(() => {
|
|
2537
2896
|
!g.hasRangeSelection || !g.hasEditorText || w({
|
|
2538
2897
|
fontColor: g.fontColor,
|
|
@@ -2544,43 +2903,43 @@ var st = [
|
|
|
2544
2903
|
g.hasEditorText,
|
|
2545
2904
|
g.hasRangeSelection
|
|
2546
2905
|
]);
|
|
2547
|
-
let
|
|
2548
|
-
|
|
2906
|
+
let ue = () => {
|
|
2907
|
+
ae(), P.close(), S(null), M(), D(!1), b(!1);
|
|
2549
2908
|
};
|
|
2550
2909
|
s(() => {
|
|
2551
2910
|
if (!y) return;
|
|
2552
2911
|
let e = window.visualViewport;
|
|
2553
2912
|
if (!e) return;
|
|
2554
2913
|
let t = () => {
|
|
2555
|
-
|
|
2914
|
+
ce(Math.max(0, window.innerHeight - e.height - e.offsetTop));
|
|
2556
2915
|
};
|
|
2557
2916
|
return e.addEventListener("resize", t), e.addEventListener("scroll", t), t(), () => {
|
|
2558
2917
|
e.removeEventListener("resize", t), e.removeEventListener("scroll", t);
|
|
2559
2918
|
};
|
|
2560
2919
|
}, [y]), s(() => {
|
|
2561
|
-
y ||
|
|
2562
|
-
}, [
|
|
2920
|
+
y || ae();
|
|
2921
|
+
}, [ae, y]), s(() => {
|
|
2563
2922
|
if (y) return f.setEditable(!0), f.registerRootListener((e) => {
|
|
2564
2923
|
e && f.focus(void 0, { defaultSelection: "rootEnd" });
|
|
2565
2924
|
});
|
|
2566
2925
|
}, [y, f]);
|
|
2567
|
-
let
|
|
2568
|
-
T.current = !0, S(null),
|
|
2569
|
-
},
|
|
2570
|
-
x === "aiPreset" && (T.current = !0), S(null),
|
|
2926
|
+
let de = () => {
|
|
2927
|
+
T.current = !0, S(null), P.startTypeset();
|
|
2928
|
+
}, fe = (e) => {
|
|
2929
|
+
x === "aiPreset" && (T.current = !0), S(null), P.startPolish(e);
|
|
2571
2930
|
};
|
|
2572
2931
|
return /* @__PURE__ */ p(t, {
|
|
2573
2932
|
open: y,
|
|
2574
|
-
onClose:
|
|
2933
|
+
onClose: ue,
|
|
2575
2934
|
position: "bottom",
|
|
2576
2935
|
closeOnClickOverlay: !0,
|
|
2577
|
-
children: /* @__PURE__ */ p(
|
|
2578
|
-
value:
|
|
2936
|
+
children: /* @__PURE__ */ p(Qn.Provider, {
|
|
2937
|
+
value: ne,
|
|
2579
2938
|
children: /* @__PURE__ */ m("div", {
|
|
2580
2939
|
className: V["bsy-mobile-editor"],
|
|
2581
2940
|
style: {
|
|
2582
2941
|
height: 300,
|
|
2583
|
-
transform:
|
|
2942
|
+
transform: se ? `translate3d(0, -${se}px, 0)` : void 0
|
|
2584
2943
|
},
|
|
2585
2944
|
children: [
|
|
2586
2945
|
/* @__PURE__ */ p("div", {
|
|
@@ -2598,8 +2957,8 @@ var st = [
|
|
|
2598
2957
|
ErrorBoundary: $e
|
|
2599
2958
|
})
|
|
2600
2959
|
}),
|
|
2601
|
-
|
|
2602
|
-
config:
|
|
2960
|
+
le.length > 0 ? /* @__PURE__ */ p(yi, {
|
|
2961
|
+
config: le,
|
|
2603
2962
|
formats: g,
|
|
2604
2963
|
colorValues: C,
|
|
2605
2964
|
openSheet: x,
|
|
@@ -2617,24 +2976,24 @@ var st = [
|
|
|
2617
2976
|
/* @__PURE__ */ p(Je, {}),
|
|
2618
2977
|
/* @__PURE__ */ p(Xe, {}),
|
|
2619
2978
|
/* @__PURE__ */ p(Ye, {}),
|
|
2620
|
-
/* @__PURE__ */ p(
|
|
2621
|
-
/* @__PURE__ */ p(
|
|
2622
|
-
/* @__PURE__ */ p(
|
|
2623
|
-
/* @__PURE__ */ p(
|
|
2624
|
-
/* @__PURE__ */ p(
|
|
2625
|
-
/* @__PURE__ */ p(
|
|
2979
|
+
/* @__PURE__ */ p(fr, {}),
|
|
2980
|
+
/* @__PURE__ */ p(vr, {}),
|
|
2981
|
+
/* @__PURE__ */ p(mr, {}),
|
|
2982
|
+
/* @__PURE__ */ p(gr, {}),
|
|
2983
|
+
/* @__PURE__ */ p(Vi, {}),
|
|
2984
|
+
/* @__PURE__ */ p(Hi, {}),
|
|
2626
2985
|
/* @__PURE__ */ p(Ze, {
|
|
2627
|
-
onChange:
|
|
2986
|
+
onChange: oe,
|
|
2628
2987
|
ignoreSelectionChange: !0
|
|
2629
2988
|
}),
|
|
2630
2989
|
/* @__PURE__ */ p("input", {
|
|
2631
|
-
ref:
|
|
2990
|
+
ref: te,
|
|
2632
2991
|
type: "file",
|
|
2633
2992
|
accept: ht,
|
|
2634
2993
|
hidden: !0,
|
|
2635
|
-
onChange:
|
|
2994
|
+
onChange: ie
|
|
2636
2995
|
}),
|
|
2637
|
-
/* @__PURE__ */ p(
|
|
2996
|
+
/* @__PURE__ */ p(zr, {
|
|
2638
2997
|
sheet: x,
|
|
2639
2998
|
onClose: () => {
|
|
2640
2999
|
if (T.current) {
|
|
@@ -2643,11 +3002,11 @@ var st = [
|
|
|
2643
3002
|
}
|
|
2644
3003
|
S(null), window.requestAnimationFrame(() => f.focus());
|
|
2645
3004
|
},
|
|
2646
|
-
onTypeset:
|
|
3005
|
+
onTypeset: de,
|
|
2647
3006
|
onPolishMenu: () => {
|
|
2648
3007
|
T.current = !0, S("aiPreset");
|
|
2649
3008
|
},
|
|
2650
|
-
onPickPreset:
|
|
3009
|
+
onPickPreset: fe,
|
|
2651
3010
|
savedSelectionRef: O,
|
|
2652
3011
|
committedColors: C,
|
|
2653
3012
|
onColorCommit: (e, t) => w((n) => ({
|
|
@@ -2656,7 +3015,7 @@ var st = [
|
|
|
2656
3015
|
})),
|
|
2657
3016
|
onPicture: (e) => {
|
|
2658
3017
|
if (k(), e === "upload") {
|
|
2659
|
-
|
|
3018
|
+
te.current?.click();
|
|
2660
3019
|
return;
|
|
2661
3020
|
}
|
|
2662
3021
|
T.current = !0, S(null), D(!0);
|
|
@@ -2664,37 +3023,38 @@ var st = [
|
|
|
2664
3023
|
canTypeset: !!l?.typeset,
|
|
2665
3024
|
canPolish: !!l?.polish
|
|
2666
3025
|
}),
|
|
2667
|
-
/* @__PURE__ */ p(
|
|
3026
|
+
/* @__PURE__ */ p(Vr, {
|
|
2668
3027
|
open: A !== null,
|
|
2669
3028
|
seed: A,
|
|
2670
|
-
onClose:
|
|
3029
|
+
onClose: M,
|
|
2671
3030
|
onConfirm: ee
|
|
2672
3031
|
}),
|
|
2673
|
-
/* @__PURE__ */ p(
|
|
3032
|
+
/* @__PURE__ */ p(Ur, {
|
|
2674
3033
|
open: E,
|
|
2675
3034
|
onClose: () => D(!1),
|
|
2676
3035
|
onConfirm: (e) => {
|
|
2677
|
-
|
|
3036
|
+
re(e, "", e), D(!1);
|
|
2678
3037
|
}
|
|
2679
3038
|
}),
|
|
2680
|
-
/* @__PURE__ */ p(
|
|
2681
|
-
open:
|
|
2682
|
-
mode:
|
|
2683
|
-
originalHtml:
|
|
3039
|
+
/* @__PURE__ */ p(ti, {
|
|
3040
|
+
open: P.mode !== null,
|
|
3041
|
+
mode: P.mode,
|
|
3042
|
+
originalHtml: P.snapshot.html,
|
|
3043
|
+
codeBlocks: P.snapshot.codeBlocks,
|
|
2684
3044
|
ai: l,
|
|
2685
|
-
polishPreset:
|
|
2686
|
-
onClose:
|
|
2687
|
-
onApply:
|
|
2688
|
-
onPickPreset:
|
|
3045
|
+
polishPreset: P.preset,
|
|
3046
|
+
onClose: P.close,
|
|
3047
|
+
onApply: P.apply,
|
|
3048
|
+
onPickPreset: fe
|
|
2689
3049
|
})
|
|
2690
3050
|
]
|
|
2691
3051
|
})
|
|
2692
3052
|
})
|
|
2693
3053
|
});
|
|
2694
|
-
},
|
|
3054
|
+
}, Wi = "1px solid #d9d9d9", Gi = { export: new Map([[ce, (e, t) => {
|
|
2695
3055
|
let n = t.exportDOM(e);
|
|
2696
|
-
return Ge(n.element) && (n.element.style.border =
|
|
2697
|
-
}]]) },
|
|
3056
|
+
return Ge(n.element) && (n.element.style.border = Wi), n;
|
|
3057
|
+
}]]) }, Ki = class e extends x {
|
|
2698
3058
|
constructor(e = "", t = {}, n) {
|
|
2699
3059
|
super(e, t, n);
|
|
2700
3060
|
}
|
|
@@ -2709,12 +3069,12 @@ var st = [
|
|
|
2709
3069
|
}, t.__key);
|
|
2710
3070
|
}
|
|
2711
3071
|
static importJSON(e) {
|
|
2712
|
-
return
|
|
3072
|
+
return qi().updateFromJSON(e);
|
|
2713
3073
|
}
|
|
2714
3074
|
sanitizeUrl(e) {
|
|
2715
3075
|
return e.startsWith("@") ? e : super.sanitizeUrl(e);
|
|
2716
3076
|
}
|
|
2717
|
-
},
|
|
3077
|
+
}, qi = (e = "", t = {}) => he(new Ki(e, t)), Ji = {
|
|
2718
3078
|
namespace: "bsyLexicalEditor",
|
|
2719
3079
|
onError: (e) => {
|
|
2720
3080
|
console.error("Lexical error", e);
|
|
@@ -2747,28 +3107,28 @@ var st = [
|
|
|
2747
3107
|
tableRow: "editor-table-row",
|
|
2748
3108
|
tableScrollableWrapper: "editor-table-scrollable-wrapper"
|
|
2749
3109
|
},
|
|
2750
|
-
html:
|
|
3110
|
+
html: Gi,
|
|
2751
3111
|
nodes: [
|
|
2752
|
-
|
|
3112
|
+
Ki,
|
|
2753
3113
|
{
|
|
2754
3114
|
replace: x,
|
|
2755
|
-
with: (e) => new
|
|
3115
|
+
with: (e) => new Ki(e.__url, {
|
|
2756
3116
|
rel: e.__rel,
|
|
2757
3117
|
target: e.__target,
|
|
2758
3118
|
title: e.__title
|
|
2759
3119
|
}),
|
|
2760
|
-
withKlass:
|
|
3120
|
+
withKlass: Ki
|
|
2761
3121
|
},
|
|
2762
3122
|
b,
|
|
2763
3123
|
D,
|
|
2764
3124
|
E,
|
|
2765
|
-
|
|
3125
|
+
ie,
|
|
3126
|
+
N,
|
|
2766
3127
|
M,
|
|
2767
|
-
te,
|
|
2768
|
-
ue,
|
|
2769
|
-
de,
|
|
2770
3128
|
le,
|
|
2771
|
-
|
|
3129
|
+
ue,
|
|
3130
|
+
ce,
|
|
3131
|
+
nr,
|
|
2772
3132
|
q,
|
|
2773
3133
|
{
|
|
2774
3134
|
replace: We,
|
|
@@ -2776,10 +3136,10 @@ var st = [
|
|
|
2776
3136
|
withKlass: q
|
|
2777
3137
|
}
|
|
2778
3138
|
]
|
|
2779
|
-
},
|
|
2780
|
-
initialConfig:
|
|
2781
|
-
children: /* @__PURE__ */ p(
|
|
3139
|
+
}, Yi = (e) => /* @__PURE__ */ p(g, {
|
|
3140
|
+
initialConfig: Ji,
|
|
3141
|
+
children: /* @__PURE__ */ p(Ui, { ...e })
|
|
2782
3142
|
});
|
|
2783
|
-
|
|
3143
|
+
Yi.displayName = "BsyMobileEditor";
|
|
2784
3144
|
//#endregion
|
|
2785
|
-
export {
|
|
3145
|
+
export { Gr as n, Yi as t };
|