@baishuyun/ui-mobile 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AMap/index.js +1 -1
- package/dist/ActionSheet/index.js +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/Editor/{Editor-DacCT187.js → Editor-Cnznf4wf.js} +611 -429
- package/dist/Editor/index.js +2 -2
- package/dist/Gantt/index.js +1 -1
- package/dist/Icon/index.js +1 -1
- package/dist/Overlay/index.js +1 -1
- package/dist/Popup/index.js +1 -1
- package/dist/Segmented/index.js +1 -1
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/vendors/{version-CTRMhnVV.js → version-BgnXws3P.js} +1 -1
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@ 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
|
|
11
|
+
import { $createCodeHighlightNode as k, $isCodeHighlightNode as A, $isCodeNode as ee, $plainifyCodeContent as te, CodeHighlightNode as j, CodeNode as M, registerCodeIndentation as ne } from "@lexical/code-core";
|
|
12
12
|
import { $createHeadingNode as re, $isHeadingNode as ie, HeadingNode as ae } from "@lexical/rich-text";
|
|
13
13
|
import { $findCellNode as oe, $isTableCellNode as se, $isTableNode as N, $isTableRowNode as ce, TableCellNode as le, TableNode as ue, TableRowNode as de, registerTableCellUnmergeTransform as fe, registerTablePlugin as pe, registerTableSelectionObserver as me, setScrollableTablesActive as he } from "@lexical/table";
|
|
14
14
|
import { $applyNodeReplacement as ge, $createLineBreakNode as _e, $createParagraphNode as P, $createTabNode as ve, $createTextNode as ye, $getNodeByKey as F, $getRoot as I, $getSelection as L, $insertNodes as be, $isElementNode as xe, $isLineBreakNode as Se, $isRangeSelection as R, $isRootOrShadowRoot as Ce, $isTabNode as we, $isTextNode as Te, $nodesOfType as Ee, $onUpdate as De, $setSelection as Oe, BLUR_COMMAND as ke, COMMAND_PRIORITY_HIGH as Ae, COMMAND_PRIORITY_LOW as je, DROP_COMMAND as Me, DecoratorNode as Ne, FOCUS_COMMAND as Pe, FORMAT_ELEMENT_COMMAND as Fe, FORMAT_TEXT_COMMAND as Ie, HISTORY_MERGE_TAG as Le, INDENT_CONTENT_COMMAND as Re, KEY_ENTER_COMMAND as ze, KEY_TAB_COMMAND as Be, OUTDENT_CONTENT_COMMAND as Ve, PASTE_COMMAND as He, PASTE_TAG as Ue, TextNode as We, isHTMLElement as Ge, mergeRegister as Ke } from "lexical";
|
|
@@ -132,93 +132,93 @@ 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-
|
|
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
222
|
}, _t = {
|
|
223
223
|
typeset: [
|
|
224
224
|
"你是一名专业的 HTML 文档排版引擎。输入已是 HTML 片段。",
|
|
@@ -256,7 +256,7 @@ var st = [
|
|
|
256
256
|
" - 需要扫读的关键词:给 span 加 background-color 浅底。对:<span style=\"background-color:#fff4cd\">关键词</span>。错:<p style=\"background-color:#f0f6ff\">整段</p>。",
|
|
257
257
|
" - 背景色只能写在 span 上(短语级),禁止写在 p / h1-h3 / ul / ol / li。",
|
|
258
258
|
" - 段落/标题缩进只用 padding-inline-start,且必须是 40px 的倍数(与编辑器「增加缩进」一致)。",
|
|
259
|
-
" -
|
|
259
|
+
" - 列表不要写 ul/ol/li 的 padding;标记槽由编辑器按字号处理。",
|
|
260
260
|
" - 颜色用任意合法 CSS 色值即可(#RGB、#RRGGBB、rgb())。同一篇里主色不超过 2 种强调色,正文保持深色可读。",
|
|
261
261
|
" - span 仅可用于 color / font-size / background-color。",
|
|
262
262
|
" - p / h1-h3 仅可用于 text-align / padding-inline-start。",
|
|
@@ -324,18 +324,48 @@ var st = [
|
|
|
324
324
|
t.style.removeProperty("background-color"), t.style.removeProperty("background"), t.getAttribute("style")?.trim() || t.removeAttribute("style");
|
|
325
325
|
}
|
|
326
326
|
return t.innerHTML;
|
|
327
|
-
}, Mt = [
|
|
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 = [
|
|
334
|
+
["fontSize", Mt],
|
|
335
|
+
["color", "--listitem-marker-color"],
|
|
336
|
+
["backgroundColor", "--listitem-marker-background-color"],
|
|
337
|
+
["fontFamily", "--listitem-marker-font-family"]
|
|
338
|
+
], Lt = (e) => {
|
|
339
|
+
let t = e.style.fontSize;
|
|
340
|
+
if (It.some(([t]) => e.style[t])) {
|
|
341
|
+
for (let n = e.parentElement; n; n = n.parentElement) if (t && Pt.has(n.tagName) && !n.style.fontSize && (n.style.fontSize = t), !(n.tagName !== "LI" || n.classList.contains("editor-nested-listitem"))) for (let [t, r] of It) {
|
|
342
|
+
let i = e.style[t];
|
|
343
|
+
i && !n.style.getPropertyValue(r) && n.style.setProperty(r, i);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}, Rt = (e, t, n, r) => {
|
|
347
|
+
if (!e) return;
|
|
348
|
+
let i = e.shadowRoot ?? e.attachShadow({ mode: "open" }), a = document.createElement("div");
|
|
349
|
+
a.className = "bsy-editor-html-preview__body", a.innerHTML = n(t);
|
|
350
|
+
for (let e of Array.from(a.querySelectorAll("table"))) {
|
|
351
|
+
if (e.parentElement?.classList.contains("editor-table-scrollable-wrapper")) continue;
|
|
352
|
+
let t = document.createElement("div");
|
|
353
|
+
t.className = "editor-table-scrollable-wrapper", e.replaceWith(t), t.append(e);
|
|
354
|
+
}
|
|
355
|
+
let o = document.createElement("style");
|
|
356
|
+
o.textContent = r, i.replaceChildren(o, a);
|
|
357
|
+
}, zt = [
|
|
328
358
|
"color",
|
|
329
359
|
"background-color",
|
|
330
360
|
"font-size",
|
|
331
361
|
"font-family",
|
|
332
362
|
"font-weight",
|
|
333
363
|
"text-decoration"
|
|
334
|
-
],
|
|
364
|
+
], Bt = (e) => {
|
|
335
365
|
let t = e.body.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, td, th");
|
|
336
366
|
for (let n of Array.from(t)) {
|
|
337
367
|
let t = n, r = [];
|
|
338
|
-
for (let e of
|
|
368
|
+
for (let e of zt) {
|
|
339
369
|
let n = t.style.getPropertyValue(e);
|
|
340
370
|
n && (r.push(`${e}: ${n}`), t.style.removeProperty(e));
|
|
341
371
|
}
|
|
@@ -353,11 +383,11 @@ var st = [
|
|
|
353
383
|
}
|
|
354
384
|
}
|
|
355
385
|
}
|
|
356
|
-
},
|
|
386
|
+
}, Vt = (e, t) => {
|
|
357
387
|
let n = I();
|
|
358
388
|
if (n.clear(), t.trim()) {
|
|
359
389
|
let r = new DOMParser().parseFromString(t, "text/html");
|
|
360
|
-
|
|
390
|
+
Bt(r);
|
|
361
391
|
let i = tt(e, r);
|
|
362
392
|
if (i.length) {
|
|
363
393
|
n.select(), be(i), Oe(null);
|
|
@@ -366,21 +396,21 @@ var st = [
|
|
|
366
396
|
}
|
|
367
397
|
let r = P();
|
|
368
398
|
n.append(r), Oe(null);
|
|
369
|
-
},
|
|
399
|
+
}, Ht = (e) => {
|
|
370
400
|
if (e) {
|
|
371
401
|
I().selectStart();
|
|
372
402
|
return;
|
|
373
403
|
}
|
|
374
404
|
Oe(null);
|
|
375
|
-
},
|
|
405
|
+
}, Ut = (e) => {
|
|
376
406
|
e && Oe(e.clone());
|
|
377
|
-
},
|
|
407
|
+
}, Wt = () => {
|
|
378
408
|
L() === null && I().selectStart();
|
|
379
409
|
}, H = (e) => {
|
|
380
410
|
e.isEditable() || e.setEditable(!0), e.update(() => {
|
|
381
|
-
|
|
411
|
+
Wt();
|
|
382
412
|
}), e.focus(void 0, { defaultSelection: "rootStart" });
|
|
383
|
-
},
|
|
413
|
+
}, Gt = (e, t) => !t.trim() && (e === "<p><br></p>" || e === "<p></p>" || e === "" || /^<p>\s*<br>\s*<\/p>$/.test(e)), Kt = /* @__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("."), qt = [
|
|
384
414
|
"href",
|
|
385
415
|
"src",
|
|
386
416
|
"alt",
|
|
@@ -396,12 +426,12 @@ var st = [
|
|
|
396
426
|
"style",
|
|
397
427
|
"width",
|
|
398
428
|
"height"
|
|
399
|
-
],
|
|
429
|
+
], Jt = 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(".")), Yt = /^(?:(?:(?:f|ht)tps?|mailto|blob):|data:image\/[a-z0-9.+-]+[;,].*|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i, Xt = new Set([
|
|
400
430
|
"pre",
|
|
401
431
|
"code",
|
|
402
432
|
"td",
|
|
403
433
|
"th"
|
|
404
|
-
]),
|
|
434
|
+
]), Zt = new Set(["pre", "code"]), Qt = new Set(["sup", "sub"]), $t = (e, t) => Ft(e) ? t === "li" : Jt.has(e) ? e === "padding-inline-start" ? !0 : e === "padding" || e.startsWith("padding-") ? Xt.has(t) : e === "border-radius" ? Zt.has(t) : e === "position" || e === "top" || e === "bottom" ? Qt.has(t) : !0 : !1, en = (e, t) => e.split(";").map((e) => e.trim()).filter(Boolean).map((e) => {
|
|
405
435
|
let n = e.indexOf(":");
|
|
406
436
|
if (n === -1) return null;
|
|
407
437
|
let r = e.slice(0, n).trim().toLowerCase(), i = e.slice(n + 1).trim();
|
|
@@ -409,30 +439,30 @@ var st = [
|
|
|
409
439
|
if (/url\s*\(/i.test(i)) return null;
|
|
410
440
|
r = "background-color";
|
|
411
441
|
}
|
|
412
|
-
return
|
|
413
|
-
}).filter((e) => e !== null).join("; "),
|
|
414
|
-
|
|
442
|
+
return !$t(r, t) || /expression|javascript:|url\s*\(\s*['"]?\s*javascript/i.test(i) ? null : `${r}: ${i}`;
|
|
443
|
+
}).filter((e) => e !== null).join("; "), tn = !1, nn = () => {
|
|
444
|
+
tn ||= (nt.addHook("uponSanitizeAttribute", (e, t) => {
|
|
415
445
|
if (t.attrName === "href" && /^data:/i.test(t.attrValue)) {
|
|
416
446
|
t.keepAttr = !1;
|
|
417
447
|
return;
|
|
418
448
|
}
|
|
419
|
-
t.attrName === "style" && (t.attrValue =
|
|
449
|
+
t.attrName === "style" && (t.attrValue = en(t.attrValue, e.nodeName.toLowerCase()), t.attrValue || (t.keepAttr = !1));
|
|
420
450
|
}), !0);
|
|
421
|
-
}, U = (e) => e ? (
|
|
422
|
-
ALLOWED_TAGS:
|
|
423
|
-
ALLOWED_ATTR:
|
|
451
|
+
}, U = (e) => e ? (nn(), nt.sanitize(e, {
|
|
452
|
+
ALLOWED_TAGS: Kt,
|
|
453
|
+
ALLOWED_ATTR: qt,
|
|
424
454
|
ALLOW_DATA_ATTR: !1,
|
|
425
455
|
ADD_ATTR: [
|
|
426
456
|
"data-language",
|
|
427
457
|
"data-id",
|
|
428
458
|
"data-src"
|
|
429
459
|
],
|
|
430
|
-
ALLOWED_URI_REGEXP:
|
|
460
|
+
ALLOWED_URI_REGEXP: Yt
|
|
431
461
|
})) : "", W = {
|
|
432
462
|
margin: "0.6em 0 0.4em",
|
|
433
463
|
"font-weight": "600",
|
|
434
464
|
"line-height": "1.35"
|
|
435
|
-
},
|
|
465
|
+
}, rn = {
|
|
436
466
|
h1: {
|
|
437
467
|
...W,
|
|
438
468
|
"font-size": "2em"
|
|
@@ -457,24 +487,26 @@ var st = [
|
|
|
457
487
|
...W,
|
|
458
488
|
"font-size": "0.875em"
|
|
459
489
|
}
|
|
460
|
-
},
|
|
490
|
+
}, an = {
|
|
461
491
|
color: "#0269ff",
|
|
462
492
|
cursor: "pointer"
|
|
463
|
-
},
|
|
493
|
+
}, on = {
|
|
464
494
|
margin: "0",
|
|
465
|
-
"padding-inline-start": "
|
|
495
|
+
"padding-inline-start": "0",
|
|
466
496
|
"list-style-position": "outside"
|
|
467
|
-
},
|
|
497
|
+
}, sn = [
|
|
468
498
|
"disc",
|
|
469
499
|
"circle",
|
|
470
500
|
"square"
|
|
471
|
-
],
|
|
501
|
+
], cn = {
|
|
472
502
|
margin: "0",
|
|
503
|
+
"margin-inline-start": Nt,
|
|
473
504
|
"list-style": "inherit"
|
|
474
|
-
},
|
|
505
|
+
}, ln = {
|
|
475
506
|
margin: "0",
|
|
507
|
+
"margin-inline-start": "0",
|
|
476
508
|
"list-style-type": "none"
|
|
477
|
-
},
|
|
509
|
+
}, un = {
|
|
478
510
|
display: "block",
|
|
479
511
|
"box-sizing": "border-box",
|
|
480
512
|
"max-width": "100%",
|
|
@@ -489,23 +521,23 @@ var st = [
|
|
|
489
521
|
"border-radius": "4px",
|
|
490
522
|
"background-color": "rgb(240, 242, 245)",
|
|
491
523
|
color: "#1f2328"
|
|
492
|
-
},
|
|
524
|
+
}, dn = {
|
|
493
525
|
"border-collapse": "collapse",
|
|
494
526
|
"table-layout": "fixed",
|
|
495
527
|
width: "100%",
|
|
496
528
|
"overflow-x": "auto",
|
|
497
529
|
margin: "8px 0"
|
|
498
|
-
},
|
|
530
|
+
}, fn = {
|
|
499
531
|
"box-sizing": "border-box",
|
|
500
532
|
"min-width": "75px",
|
|
501
533
|
"min-height": "32px",
|
|
502
534
|
padding: "4px 8px",
|
|
503
535
|
border: "1px solid #d9d9d9",
|
|
504
536
|
"vertical-align": "top"
|
|
505
|
-
},
|
|
537
|
+
}, pn = {
|
|
506
538
|
"font-weight": "600",
|
|
507
539
|
"background-color": "#f2f3f5"
|
|
508
|
-
},
|
|
540
|
+
}, mn = {
|
|
509
541
|
display: "inline-block",
|
|
510
542
|
position: "static",
|
|
511
543
|
top: "auto",
|
|
@@ -514,38 +546,39 @@ var st = [
|
|
|
514
546
|
"line-height": "1"
|
|
515
547
|
}, G = (e, t) => {
|
|
516
548
|
for (let [n, r] of Object.entries(t)) e.style.getPropertyValue(n) || e.style.setProperty(n, r);
|
|
517
|
-
},
|
|
549
|
+
}, hn = (e) => {
|
|
518
550
|
let t = 0, n = e;
|
|
519
551
|
for (; n;) n.tagName === "UL" && (t += 1), n = n.parentElement;
|
|
520
552
|
return t;
|
|
521
|
-
},
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
553
|
+
}, gn = (e) => {
|
|
554
|
+
let t = [...e.querySelectorAll("*")].filter((e) => e instanceof HTMLElement);
|
|
555
|
+
for (let e of t) Lt(e);
|
|
556
|
+
for (let e of t) {
|
|
557
|
+
let t = e.tagName.toLowerCase(), n = rn[t];
|
|
558
|
+
if (n && G(e, n), t === "a" && G(e, an), t === "ul") {
|
|
559
|
+
let t = Math.min(Math.max(hn(e), 1), sn.length);
|
|
560
|
+
G(e, {
|
|
561
|
+
...on,
|
|
562
|
+
"list-style-type": sn[t - 1]
|
|
530
563
|
});
|
|
531
564
|
}
|
|
532
|
-
|
|
533
|
-
...
|
|
565
|
+
t === "ol" && G(e, {
|
|
566
|
+
...on,
|
|
534
567
|
"list-style-type": "decimal"
|
|
535
|
-
}),
|
|
536
|
-
...
|
|
537
|
-
"vertical-align":
|
|
538
|
-
}),
|
|
539
|
-
for (let
|
|
540
|
-
|
|
568
|
+
}), t === "li" && G(e, e.classList.contains("editor-nested-listitem") ? ln : cn), t === "pre" && G(e, un), (t === "sup" || t === "sub") && G(e, {
|
|
569
|
+
...mn,
|
|
570
|
+
"vertical-align": t === "sup" ? "super" : "sub"
|
|
571
|
+
}), t === "table" && G(e, dn), (t === "td" || t === "th") && (G(e, fn), (t === "th" || e.classList.contains("editor-table-cell-header")) && G(e, pn)), 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" });
|
|
572
|
+
for (let t of Array.from(e.classList)) t.startsWith("editor-") && e.classList.remove(t);
|
|
573
|
+
e.classList.length === 0 && e.removeAttribute("class");
|
|
541
574
|
}
|
|
542
|
-
},
|
|
575
|
+
}, _n = (e) => {
|
|
543
576
|
let t = e.parentNode;
|
|
544
577
|
if (t) {
|
|
545
578
|
for (; e.firstChild;) t.insertBefore(e.firstChild, e);
|
|
546
579
|
t.removeChild(e);
|
|
547
580
|
}
|
|
548
|
-
},
|
|
581
|
+
}, vn = (e) => {
|
|
549
582
|
let t = !0;
|
|
550
583
|
for (; t;) {
|
|
551
584
|
t = !1;
|
|
@@ -553,21 +586,21 @@ var st = [
|
|
|
553
586
|
if (n.attributes.length > 0) continue;
|
|
554
587
|
let e = n.tagName.toLowerCase();
|
|
555
588
|
if (e === "span") {
|
|
556
|
-
|
|
589
|
+
_n(n), t = !0;
|
|
557
590
|
continue;
|
|
558
591
|
}
|
|
559
592
|
if (n.childElementCount !== 1 || n.childNodes.length !== 1) continue;
|
|
560
593
|
let r = n.firstElementChild;
|
|
561
|
-
(e === "b" && r?.tagName === "STRONG" || e === "i" && r?.tagName === "EM") && (
|
|
594
|
+
(e === "b" && r?.tagName === "STRONG" || e === "i" && r?.tagName === "EM") && (_n(n), t = !0);
|
|
562
595
|
}
|
|
563
596
|
}
|
|
564
|
-
},
|
|
597
|
+
}, yn = (e) => {
|
|
565
598
|
if (!e.trim()) return e;
|
|
566
599
|
let t = new DOMParser().parseFromString(e, "text/html");
|
|
567
|
-
|
|
600
|
+
gn(t.body), vn(t.body);
|
|
568
601
|
for (let e of Array.from(t.body.querySelectorAll("pre"))) e.textContent?.trim() || e.remove();
|
|
569
602
|
return t.body.innerHTML;
|
|
570
|
-
},
|
|
603
|
+
}, bn = (e) => e ? new DOMParser().parseFromString(e, "text/html").body.textContent ?? "" : "", xn = (e) => e.includes("<!--bsy-block-->") ? e.split(St).map((e) => e.trim()) : [e], Sn = (e) => e.split(St).join("").trim().length > 0, Cn = (e, t) => {
|
|
571
604
|
let n = e.map(() => "");
|
|
572
605
|
if (e.length === 0) return n;
|
|
573
606
|
let r = [], i = [];
|
|
@@ -580,7 +613,7 @@ var st = [
|
|
|
580
613
|
for (; u < s && d < c;) a[u] === o[d] ? (f = r[u], n[f] += o[d], u += 1, d += 1) : l[u + 1][d] >= l[u][d + 1] ? (f = r[u], u += 1) : (n[f] += o[d], d += 1);
|
|
581
614
|
for (; d < c;) n[n.length - 1] += o[d], d += 1;
|
|
582
615
|
return n;
|
|
583
|
-
},
|
|
616
|
+
}, wn = new Set([
|
|
584
617
|
"TABLE",
|
|
585
618
|
"THEAD",
|
|
586
619
|
"TBODY",
|
|
@@ -589,7 +622,7 @@ var st = [
|
|
|
589
622
|
"TH",
|
|
590
623
|
"IMG",
|
|
591
624
|
"BR"
|
|
592
|
-
]),
|
|
625
|
+
]), Tn = (e) => {
|
|
593
626
|
let t = [], n = (e) => {
|
|
594
627
|
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
595
628
|
if (e.tagName === "PRE") return;
|
|
@@ -599,25 +632,25 @@ var st = [
|
|
|
599
632
|
e.nodeType === Node.TEXT_NODE && t.push(e);
|
|
600
633
|
};
|
|
601
634
|
return n(e), t;
|
|
602
|
-
},
|
|
635
|
+
}, En = (e, t) => {
|
|
603
636
|
let n = e;
|
|
604
|
-
for (; n && n !== t && !
|
|
637
|
+
for (; n && n !== t && !wn.has(n.tagName) && !(n.textContent ?? "").trim() && !n.querySelector("img, table, br");) {
|
|
605
638
|
let e = n.parentElement;
|
|
606
639
|
n.remove(), n = e;
|
|
607
640
|
}
|
|
608
|
-
},
|
|
641
|
+
}, Dn = (e) => {
|
|
609
642
|
let t = e.tagName;
|
|
610
643
|
return t === "IMG" || t === "TABLE" || t === "PRE";
|
|
611
|
-
},
|
|
644
|
+
}, On = (e) => {
|
|
612
645
|
let t = Tt(e);
|
|
613
|
-
return t ? Array.from(t.children).filter((e) => !
|
|
614
|
-
},
|
|
615
|
-
let n =
|
|
646
|
+
return t ? Array.from(t.children).filter((e) => !Dn(e)).map((e) => e.textContent ?? "") : [];
|
|
647
|
+
}, kn = (e) => e.includes("<!--bsy-block-->") ? e : bn(e) || e, An = (e, t) => {
|
|
648
|
+
let n = Tn(e);
|
|
616
649
|
if (n.length === 0) {
|
|
617
650
|
t && (e.querySelector("br")?.remove(), e.append(e.ownerDocument.createTextNode(t)));
|
|
618
651
|
return;
|
|
619
652
|
}
|
|
620
|
-
let r =
|
|
653
|
+
let r = Cn(n.map((e) => e.textContent ?? ""), t);
|
|
621
654
|
for (let t = 0; t < n.length; t++) {
|
|
622
655
|
let i = r[t], a = n[t];
|
|
623
656
|
if (i) {
|
|
@@ -625,51 +658,51 @@ var st = [
|
|
|
625
658
|
continue;
|
|
626
659
|
}
|
|
627
660
|
let o = a.parentElement;
|
|
628
|
-
a.remove(),
|
|
661
|
+
a.remove(), En(o, e);
|
|
629
662
|
}
|
|
630
|
-
},
|
|
631
|
-
let n =
|
|
632
|
-
if (!
|
|
663
|
+
}, jn = (e, t) => {
|
|
664
|
+
let n = kn(t);
|
|
665
|
+
if (!Sn(n) || !e.trim()) return "";
|
|
633
666
|
let r = Tt(e);
|
|
634
667
|
if (!r) return "";
|
|
635
|
-
let i = Array.from(r.children).filter((e) => !
|
|
668
|
+
let i = Array.from(r.children).filter((e) => !Dn(e));
|
|
636
669
|
if (i.length === 0) return "";
|
|
637
|
-
let a =
|
|
638
|
-
for (let e = 0; e < i.length; e++)
|
|
670
|
+
let a = xn(n), o = a.length === i.length ? a : Cn(i.map((e) => e.textContent ?? ""), a.join(""));
|
|
671
|
+
for (let e = 0; e < i.length; e++) An(i[e], o[e] ?? "");
|
|
639
672
|
return r.innerHTML;
|
|
640
|
-
},
|
|
673
|
+
}, Mn = (e, t) => {
|
|
641
674
|
let n = "";
|
|
642
675
|
e.getEditorState().read(() => {
|
|
643
|
-
n =
|
|
676
|
+
n = yn(U(et(e, null)));
|
|
644
677
|
}, { editor: e });
|
|
645
|
-
let r = U(
|
|
646
|
-
return !r.trim() ||
|
|
647
|
-
|
|
678
|
+
let r = U(jn(n, t));
|
|
679
|
+
return !r.trim() || Gt(r, bn(r)) ? !1 : (e.update(() => {
|
|
680
|
+
Vt(e, r), Ht(!0);
|
|
648
681
|
}, { discrete: !0 }), !0);
|
|
649
|
-
},
|
|
682
|
+
}, Nn = /^\uFEFF/, Pn = /^ {0,3}`{1,3}[A-Za-z]*$/, Fn = /^( {0,3})([^`<]*?)```[ \t]*([A-Za-z0-9_-]*)[ \t]*(.*)$/, In = /^ {0,3}```[ \t]*$/, Ln = /<\/?[a-zA-Z]/, Rn = /<[a-zA-Z!]/, zn = (e) => Rn.test(e), Bn = (e) => Ln.test(e), Vn = (e) => e.replace(Nn, "").replace(/\r\n/g, "\n"), Hn = (e) => {
|
|
650
683
|
let t = e.replace(/\n+$/, ""), n = t.lastIndexOf("\n"), r = n === -1 ? t : t.slice(n + 1);
|
|
651
|
-
return
|
|
684
|
+
return Pn.test(r) ? {
|
|
652
685
|
text: n === -1 ? "" : t.slice(0, n),
|
|
653
686
|
withheld: !0
|
|
654
687
|
} : {
|
|
655
688
|
text: e,
|
|
656
689
|
withheld: !1
|
|
657
690
|
};
|
|
658
|
-
},
|
|
659
|
-
let t =
|
|
691
|
+
}, Un = (e) => {
|
|
692
|
+
let t = Fn.exec(e);
|
|
660
693
|
return t ? { sameLineBody: t[4] ?? "" } : null;
|
|
661
|
-
},
|
|
694
|
+
}, Wn = (e) => {
|
|
662
695
|
let t = e.replace(/[ \t]*```[ \t]*$/, "");
|
|
663
696
|
return t === e ? e : t;
|
|
664
|
-
},
|
|
697
|
+
}, Gn = (e) => zn(e) ? e.replace(/^\n/, "") : "", Kn = (e) => {
|
|
665
698
|
let t = e.split("\n"), n = [], r = 0;
|
|
666
699
|
for (; r < t.length;) {
|
|
667
|
-
let e = t[r], i =
|
|
700
|
+
let e = t[r], i = Un(e);
|
|
668
701
|
if (i) {
|
|
669
702
|
let e = i.sameLineBody;
|
|
670
|
-
if (e !==
|
|
671
|
-
e =
|
|
672
|
-
let i =
|
|
703
|
+
if (e !== Wn(e)) {
|
|
704
|
+
e = Wn(e);
|
|
705
|
+
let i = Gn(t.slice(r + 1).join("\n"));
|
|
673
706
|
return [
|
|
674
707
|
...n,
|
|
675
708
|
e,
|
|
@@ -677,61 +710,61 @@ var st = [
|
|
|
677
710
|
].filter(Boolean).join("\n");
|
|
678
711
|
}
|
|
679
712
|
let a = [];
|
|
680
|
-
for (e && a.push(e), r += 1; r < t.length && !
|
|
681
|
-
let o = r < t.length ?
|
|
713
|
+
for (e && a.push(e), r += 1; r < t.length && !In.test(t[r]);) a.push(t[r]), r += 1;
|
|
714
|
+
let o = r < t.length ? Gn(t.slice(r + 1).join("\n")) : "";
|
|
682
715
|
return [
|
|
683
716
|
...n,
|
|
684
717
|
a.join("\n"),
|
|
685
718
|
o
|
|
686
719
|
].filter(Boolean).join("\n");
|
|
687
720
|
}
|
|
688
|
-
if (
|
|
689
|
-
|
|
721
|
+
if (Bn(e)) return qn([...n, ...t.slice(r)].join("\n"));
|
|
722
|
+
zn(e) && n.push(e), r += 1;
|
|
690
723
|
}
|
|
691
724
|
return n.length ? n.join("\n") : null;
|
|
692
|
-
},
|
|
725
|
+
}, qn = (e) => {
|
|
693
726
|
let t = e.split("\n");
|
|
694
727
|
if (!t.length) return e;
|
|
695
|
-
let n =
|
|
696
|
-
return n && !
|
|
697
|
-
},
|
|
728
|
+
let n = Un(t[0]);
|
|
729
|
+
return n && !Bn(t[0].slice(0, t[0].indexOf("```"))) && (t.shift(), n.sameLineBody && t.unshift(Wn(n.sameLineBody))), t.length && In.test(t[t.length - 1] ?? "") && t.pop(), t.join("\n");
|
|
730
|
+
}, Jn = (e) => {
|
|
698
731
|
if (!e) return {
|
|
699
732
|
html: "",
|
|
700
733
|
pending: !1
|
|
701
734
|
};
|
|
702
|
-
let { text: t, withheld: n } =
|
|
735
|
+
let { text: t, withheld: n } = Hn(Vn(e));
|
|
703
736
|
if (!t.trim()) return {
|
|
704
737
|
html: "",
|
|
705
|
-
pending: n ||
|
|
738
|
+
pending: n || Pn.test(Vn(e).trim())
|
|
706
739
|
};
|
|
707
|
-
let r =
|
|
740
|
+
let r = Kn(t) ?? t, i = Kn(r);
|
|
708
741
|
i !== null && i !== r && (r = i);
|
|
709
742
|
let a = r.trim();
|
|
710
|
-
return
|
|
743
|
+
return zn(a) ? {
|
|
711
744
|
html: a,
|
|
712
745
|
pending: !1
|
|
713
746
|
} : {
|
|
714
747
|
html: "",
|
|
715
748
|
pending: !0
|
|
716
749
|
};
|
|
717
|
-
},
|
|
718
|
-
let { html: n } =
|
|
750
|
+
}, Yn = (e, t) => {
|
|
751
|
+
let { html: n } = Jn(e);
|
|
719
752
|
return n ? jt(Ot(n, t)) : "";
|
|
720
753
|
};
|
|
721
754
|
//#endregion
|
|
722
755
|
//#region src/components/Editor/utils/applyAiTypeset.ts
|
|
723
|
-
function
|
|
724
|
-
let r = U(
|
|
725
|
-
return !r.trim() ||
|
|
726
|
-
|
|
756
|
+
function Xn(e, t, n) {
|
|
757
|
+
let r = U(Yn(t, n));
|
|
758
|
+
return !r.trim() || Gt(r, "") ? { applied: !1 } : (e.update(() => {
|
|
759
|
+
Vt(e, r), Ht(!0);
|
|
727
760
|
}, { discrete: !0 }), { applied: !0 });
|
|
728
761
|
}
|
|
729
762
|
//#endregion
|
|
730
763
|
//#region src/components/Editor/utils/readEditorAiSnapshot.ts
|
|
731
|
-
var
|
|
764
|
+
var Zn = (e) => {
|
|
732
765
|
let t = "", n = "", r = "";
|
|
733
766
|
e.getEditorState().read(() => {
|
|
734
|
-
n = I().getTextContent(), t =
|
|
767
|
+
n = I().getTextContent(), t = yn(U(et(e, null))), r = On(t).join(`\n\n${St}\n\n`);
|
|
735
768
|
}, { editor: e });
|
|
736
769
|
let i = xt(t);
|
|
737
770
|
return {
|
|
@@ -741,7 +774,7 @@ var Wn = (e) => {
|
|
|
741
774
|
htmlWithoutCode: i.html,
|
|
742
775
|
codeBlocks: i.blocks
|
|
743
776
|
};
|
|
744
|
-
},
|
|
777
|
+
}, Qn = ({ editor: e, ai: t }) => {
|
|
745
778
|
let n = u(t);
|
|
746
779
|
n.current = t;
|
|
747
780
|
let [r, i] = d(null), [a, o] = d({
|
|
@@ -751,14 +784,14 @@ var Wn = (e) => {
|
|
|
751
784
|
htmlWithoutCode: "",
|
|
752
785
|
codeBlocks: []
|
|
753
786
|
}), [s, c] = d("quick"), l = () => {
|
|
754
|
-
let t =
|
|
787
|
+
let t = Zn(e);
|
|
755
788
|
o(t), i("typeset"), n.current?.typeset?.({
|
|
756
789
|
html: t.htmlWithoutCode,
|
|
757
790
|
text: t.text,
|
|
758
791
|
prompt: vt
|
|
759
792
|
});
|
|
760
793
|
}, f = (t) => {
|
|
761
|
-
let r =
|
|
794
|
+
let r = Zn(e);
|
|
762
795
|
o(r), c(t), i("polish"), n.current?.stop?.(), n.current?.polish?.({
|
|
763
796
|
text: r.polishText,
|
|
764
797
|
preset: t,
|
|
@@ -776,11 +809,11 @@ var Wn = (e) => {
|
|
|
776
809
|
close: p,
|
|
777
810
|
apply: () => {
|
|
778
811
|
let t = n.current?.text ?? "";
|
|
779
|
-
r === "typeset" ?
|
|
812
|
+
r === "typeset" ? Xn(e, t, a.codeBlocks) : r === "polish" && Mn(e, t), p();
|
|
780
813
|
}
|
|
781
814
|
};
|
|
782
|
-
},
|
|
783
|
-
let a = o(
|
|
815
|
+
}, $n = i({}), K = 36, er = 14, tr = 2 * Math.PI * er, nr = ({ nodeKey: e, src: t, altText: n, dataId: r, dataSrc: i }) => {
|
|
816
|
+
let a = o($n), s = e in a, c = a[e];
|
|
784
817
|
return /* @__PURE__ */ m("span", {
|
|
785
818
|
className: V["bsy-mobile-editor__image"],
|
|
786
819
|
children: [/* @__PURE__ */ p("img", {
|
|
@@ -804,26 +837,26 @@ var Wn = (e) => {
|
|
|
804
837
|
children: [/* @__PURE__ */ p("circle", {
|
|
805
838
|
cx: K / 2,
|
|
806
839
|
cy: K / 2,
|
|
807
|
-
r:
|
|
840
|
+
r: er,
|
|
808
841
|
fill: "none",
|
|
809
842
|
stroke: "rgba(255,255,255,0.35)",
|
|
810
843
|
strokeWidth: "3"
|
|
811
844
|
}), /* @__PURE__ */ p("circle", {
|
|
812
845
|
cx: K / 2,
|
|
813
846
|
cy: K / 2,
|
|
814
|
-
r:
|
|
847
|
+
r: er,
|
|
815
848
|
fill: "none",
|
|
816
849
|
stroke: "#fff",
|
|
817
850
|
strokeWidth: "3",
|
|
818
851
|
strokeLinecap: "round",
|
|
819
|
-
strokeDasharray: c === void 0 ? `${
|
|
820
|
-
strokeDashoffset: c === void 0 ? 0 :
|
|
852
|
+
strokeDasharray: c === void 0 ? `${tr * .25} ${tr}` : tr,
|
|
853
|
+
strokeDashoffset: c === void 0 ? 0 : tr * (1 - c / 100),
|
|
821
854
|
transform: `rotate(-90 ${K / 2} ${K / 2})`
|
|
822
855
|
})]
|
|
823
856
|
})
|
|
824
857
|
}) : null]
|
|
825
858
|
});
|
|
826
|
-
},
|
|
859
|
+
}, rr = class e extends Ne {
|
|
827
860
|
__src;
|
|
828
861
|
__altText;
|
|
829
862
|
__width;
|
|
@@ -863,13 +896,13 @@ var Wn = (e) => {
|
|
|
863
896
|
}
|
|
864
897
|
static importDOM() {
|
|
865
898
|
return { img: () => ({
|
|
866
|
-
conversion:
|
|
899
|
+
conversion: or,
|
|
867
900
|
priority: 0
|
|
868
901
|
}) };
|
|
869
902
|
}
|
|
870
903
|
static importJSON(e) {
|
|
871
904
|
let { src: t, altText: n, width: r, height: i, dataId: a, dataSrc: o } = e;
|
|
872
|
-
return
|
|
905
|
+
return ar({
|
|
873
906
|
src: t,
|
|
874
907
|
altText: n,
|
|
875
908
|
width: r,
|
|
@@ -894,7 +927,7 @@ var Wn = (e) => {
|
|
|
894
927
|
return !0;
|
|
895
928
|
}
|
|
896
929
|
decorate() {
|
|
897
|
-
return /* @__PURE__ */ p(
|
|
930
|
+
return /* @__PURE__ */ p(nr, {
|
|
898
931
|
nodeKey: this.getKey(),
|
|
899
932
|
src: this.__src,
|
|
900
933
|
altText: this.__altText,
|
|
@@ -902,7 +935,7 @@ var Wn = (e) => {
|
|
|
902
935
|
dataSrc: this.__dataSrc
|
|
903
936
|
});
|
|
904
937
|
}
|
|
905
|
-
},
|
|
938
|
+
}, ir = (e) => e instanceof rr, ar = ({ src: e, altText: t, width: n, height: r, dataId: i, dataSrc: a, key: o }) => new rr(e, t, n, r, o, i, a), or = (e) => {
|
|
906
939
|
if (!(e instanceof HTMLImageElement)) return null;
|
|
907
940
|
let { src: t, alt: n, style: r } = e, i, a;
|
|
908
941
|
if (r.width) {
|
|
@@ -913,7 +946,7 @@ var Wn = (e) => {
|
|
|
913
946
|
let e = parseInt(r.height, 10);
|
|
914
947
|
Number.isNaN(e) || (a = e);
|
|
915
948
|
}
|
|
916
|
-
return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node:
|
|
949
|
+
return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node: ar({
|
|
917
950
|
src: t,
|
|
918
951
|
altText: n,
|
|
919
952
|
width: i,
|
|
@@ -921,7 +954,7 @@ var Wn = (e) => {
|
|
|
921
954
|
dataId: e.getAttribute("data-id") || void 0,
|
|
922
955
|
dataSrc: e.getAttribute("data-src") || void 0
|
|
923
956
|
}) };
|
|
924
|
-
},
|
|
957
|
+
}, sr = (e) => mt.includes(e.name.split(".").pop()?.toLowerCase() ?? ""), cr = (e) => sr(e) ? e.size > 5242880 ? "size" : null : "type", lr = ({ editor: e, upload: t, savedSelectionRef: n, attachmentsBySrc: r }) => {
|
|
925
958
|
let i = u(null), o = u(null), c = u(!0), [l, f] = d({}), p = a(() => {
|
|
926
959
|
o.current?.abort(), o.current = null;
|
|
927
960
|
}, []);
|
|
@@ -931,8 +964,8 @@ var Wn = (e) => {
|
|
|
931
964
|
let m = a((t, r, i) => {
|
|
932
965
|
let a = "";
|
|
933
966
|
return e.update(() => {
|
|
934
|
-
|
|
935
|
-
let e =
|
|
967
|
+
Ut(n.current), L() === null && I().selectEnd();
|
|
968
|
+
let e = ar({
|
|
936
969
|
src: t,
|
|
937
970
|
altText: r,
|
|
938
971
|
dataSrc: i
|
|
@@ -947,7 +980,7 @@ var Wn = (e) => {
|
|
|
947
980
|
insertImage: m,
|
|
948
981
|
onFileChange: a(async (n) => {
|
|
949
982
|
let i = n.target.files?.[0];
|
|
950
|
-
if (n.target.value = "", !i ||
|
|
983
|
+
if (n.target.value = "", !i || cr(i)) return;
|
|
951
984
|
p();
|
|
952
985
|
let a = new AbortController();
|
|
953
986
|
if (o.current = a, !t?.customRequest) {
|
|
@@ -1002,7 +1035,7 @@ var Wn = (e) => {
|
|
|
1002
1035
|
}
|
|
1003
1036
|
e.update(() => {
|
|
1004
1037
|
let e = F(l);
|
|
1005
|
-
|
|
1038
|
+
ir(e) && (e.setSrc(o), s && e.setDataId(s));
|
|
1006
1039
|
}), d(!0);
|
|
1007
1040
|
} catch {
|
|
1008
1041
|
d(!1);
|
|
@@ -1016,7 +1049,7 @@ var Wn = (e) => {
|
|
|
1016
1049
|
]),
|
|
1017
1050
|
abortUpload: p
|
|
1018
1051
|
};
|
|
1019
|
-
},
|
|
1052
|
+
}, ur = ({ editor: e, savedSelectionRef: t, captureSelection: n }) => {
|
|
1020
1053
|
let [r, i] = d(null);
|
|
1021
1054
|
return {
|
|
1022
1055
|
linkForm: r,
|
|
@@ -1043,7 +1076,7 @@ var Wn = (e) => {
|
|
|
1043
1076
|
if (!r) return;
|
|
1044
1077
|
let a = r.startsWith("@") || /^https?:\/\//.test(r) ? r : `http://${r}`;
|
|
1045
1078
|
e.update(() => {
|
|
1046
|
-
|
|
1079
|
+
Ut(t.current);
|
|
1047
1080
|
let e = L(), r = n.newBlank ? {
|
|
1048
1081
|
target: "_blank",
|
|
1049
1082
|
rel: "noopener noreferrer",
|
|
@@ -1070,14 +1103,14 @@ var Wn = (e) => {
|
|
|
1070
1103
|
},
|
|
1071
1104
|
closeLink: () => i(null)
|
|
1072
1105
|
};
|
|
1073
|
-
},
|
|
1106
|
+
}, dr = ({ editor: e, value: t, onChange: n, attachmentsBySrc: r }) => {
|
|
1074
1107
|
let i = u(null), o = u(n);
|
|
1075
1108
|
o.current = n;
|
|
1076
1109
|
let c = a((t) => {
|
|
1077
1110
|
t.read(() => {
|
|
1078
|
-
let n = I().getTextContent(), a =
|
|
1111
|
+
let n = I().getTextContent(), a = yn(U(et(e, null))), s = Gt(a, n) ? null : a;
|
|
1079
1112
|
i.current = s;
|
|
1080
|
-
let c = Ee(
|
|
1113
|
+
let c = Ee(rr).map((e) => r.get(e.getSrc())).filter((e) => e !== void 0);
|
|
1081
1114
|
o.current({
|
|
1082
1115
|
text: n,
|
|
1083
1116
|
html: s,
|
|
@@ -1087,7 +1120,7 @@ var Wn = (e) => {
|
|
|
1087
1120
|
}, [r, e]);
|
|
1088
1121
|
return s(() => {
|
|
1089
1122
|
t === void 0 || t === i.current || (i.current = t ?? null, e.update(() => {
|
|
1090
|
-
|
|
1123
|
+
Vt(e, t?.trim() ? U(t) : ""), Ht(!!e.getRootElement()?.contains(document.activeElement));
|
|
1091
1124
|
}, { onUpdate: () => {
|
|
1092
1125
|
e.getRootElement() || c(e.getEditorState());
|
|
1093
1126
|
} }));
|
|
@@ -1096,11 +1129,11 @@ var Wn = (e) => {
|
|
|
1096
1129
|
c,
|
|
1097
1130
|
t
|
|
1098
1131
|
]), c;
|
|
1099
|
-
},
|
|
1132
|
+
}, fr = 250, pr = () => {
|
|
1100
1133
|
let [e] = z(), t = u(0);
|
|
1101
1134
|
return s(() => e.registerCommand(ze, (e) => {
|
|
1102
1135
|
let n = Date.now(), r = n - t.current;
|
|
1103
|
-
if (t.current = n, r <= 0 || r >=
|
|
1136
|
+
if (t.current = n, r <= 0 || r >= fr) return !1;
|
|
1104
1137
|
let i = L();
|
|
1105
1138
|
if (!R(i) || !i.isCollapsed()) return !1;
|
|
1106
1139
|
let a = i.anchor.getNode();
|
|
@@ -1120,7 +1153,7 @@ var Wn = (e) => {
|
|
|
1120
1153
|
let c = s.getPreviousSibling();
|
|
1121
1154
|
return c?.getTextContent().trim() === "" && c.remove(), e?.preventDefault(), !0;
|
|
1122
1155
|
}, je), [e]), null;
|
|
1123
|
-
},
|
|
1156
|
+
}, mr = (e, t) => e.split(";").map((e) => e.trim()).filter((e) => e && e.split(":")[0].trim().toLowerCase() !== t).join("; "), hr = () => {
|
|
1124
1157
|
let [e] = z();
|
|
1125
1158
|
return s(() => e.registerNodeTransform(ae, (e) => {
|
|
1126
1159
|
let t = e.getTag();
|
|
@@ -1131,7 +1164,7 @@ var Wn = (e) => {
|
|
|
1131
1164
|
for (let t of e.getAllTextNodes()) {
|
|
1132
1165
|
let e = t.getStyle();
|
|
1133
1166
|
if (!e) continue;
|
|
1134
|
-
let n =
|
|
1167
|
+
let n = mr(e, "font-size");
|
|
1135
1168
|
n !== e && t.setStyle(n);
|
|
1136
1169
|
}
|
|
1137
1170
|
}), [e]), null;
|
|
@@ -1173,12 +1206,12 @@ var Wn = (e) => {
|
|
|
1173
1206
|
};
|
|
1174
1207
|
}
|
|
1175
1208
|
static importJSON(e) {
|
|
1176
|
-
return
|
|
1209
|
+
return gr().updateFromJSON(e);
|
|
1177
1210
|
}
|
|
1178
1211
|
isSimpleText() {
|
|
1179
1212
|
return this.__type === "extended-text" && this.__mode === 0;
|
|
1180
1213
|
}
|
|
1181
|
-
},
|
|
1214
|
+
}, gr = (e = "") => ge(new q(e)), J = (e) => (t) => {
|
|
1182
1215
|
let n = e?.(t);
|
|
1183
1216
|
if (!n) return null;
|
|
1184
1217
|
let r = n.conversion(t);
|
|
@@ -1202,26 +1235,26 @@ var Wn = (e) => {
|
|
|
1202
1235
|
return n;
|
|
1203
1236
|
}
|
|
1204
1237
|
};
|
|
1205
|
-
},
|
|
1238
|
+
}, _r = () => {
|
|
1206
1239
|
let [e] = z();
|
|
1207
1240
|
return s(() => e.registerNodeTransform(q, (e) => {
|
|
1208
1241
|
if (!B(e, v)) return;
|
|
1209
1242
|
let t = e.getStyle();
|
|
1210
1243
|
if (!t) return;
|
|
1211
|
-
let n =
|
|
1244
|
+
let n = mr(t, "color");
|
|
1212
1245
|
n !== t && e.setStyle(n);
|
|
1213
1246
|
}), [e]), null;
|
|
1214
|
-
},
|
|
1247
|
+
}, vr = /<img\b|<picture\b/i, yr = () => {
|
|
1215
1248
|
let [e] = z();
|
|
1216
1249
|
return s(() => {
|
|
1217
1250
|
let t = (t) => {
|
|
1218
1251
|
let n = "clipboardData" in t ? t.clipboardData : "dataTransfer" in t ? t.dataTransfer : null;
|
|
1219
1252
|
if (!n || n.getData("application/x-lexical-editor") || n.getData("application/x-lexical-drag")) return !1;
|
|
1220
1253
|
let r = n.getData("text/html");
|
|
1221
|
-
if (!(Array.from(n.files).some((e) => e.type.startsWith("image/")) || Array.from(n.items).some((e) => e.type.startsWith("image/")) ||
|
|
1254
|
+
if (!(Array.from(n.files).some((e) => e.type.startsWith("image/")) || Array.from(n.items).some((e) => e.type.startsWith("image/")) || vr.test(r))) return !1;
|
|
1222
1255
|
t.preventDefault();
|
|
1223
1256
|
let i = n.getData("text/plain");
|
|
1224
|
-
return !
|
|
1257
|
+
return !vr.test(r) && !i || e.update(() => {
|
|
1225
1258
|
let t = L();
|
|
1226
1259
|
if (t === null) return;
|
|
1227
1260
|
let n = r ? new DOMParser().parseFromString(r, "text/html") : null;
|
|
@@ -1237,18 +1270,18 @@ var Wn = (e) => {
|
|
|
1237
1270
|
};
|
|
1238
1271
|
return rt(e.registerCommand(He, t, Ae), e.registerCommand(Me, t, Ae));
|
|
1239
1272
|
}, [e]), null;
|
|
1240
|
-
},
|
|
1273
|
+
}, br = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAADNBJREFUeAG1WuuvXUUV/619dqEPaG+pUFqg3AKFIoFWkKeKLWLRaKD6vVGMMcYQC8EPmBge/4A0fpEQEkmMz0QjH8CoIa3WUGwQ2oAiFWiFthb77qXvy1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VYeaQ5yxcndavPp1cEhjJVHWou5h4YAjbeIinyoPSP2nue/yFlpf9b/euXJ69DujDD/iy+1JkqHjoBeIfOMPtYElswTzq6av2s+//OHWwk4UCe4H5DJUqofpVwONXaEgo8YzOHqsYH4EtlnTgM0+COFl26gyD5hiLPIizPicP2fKkc4whGOcCjwKViIGaRSStOhAAAAAElFTkSuQmCC", Sr = (e, t, n) => Math.min(n, Math.max(t, e)), Y = (e) => Sr(e, 0, 1), X = (e) => {
|
|
1241
1274
|
let t = e.trim().toLowerCase();
|
|
1242
1275
|
if (t === "" || t === "transparent") return !0;
|
|
1243
1276
|
let n = t.match(/^rgba\([^,]+,[^,]+,[^,]+,\s*([.\d]+)\s*\)$/);
|
|
1244
1277
|
return n !== null && Number(n[1]) === 0;
|
|
1245
|
-
},
|
|
1278
|
+
}, Cr = (e) => {
|
|
1246
1279
|
let t = e.trim().replace(/^#/, "");
|
|
1247
1280
|
return /^[0-9a-fA-F]{3}$/.test(t) ? `#${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`.toLowerCase() : /^[0-9a-fA-F]{6}$/.test(t) ? `#${t.toLowerCase()}` : null;
|
|
1248
|
-
},
|
|
1281
|
+
}, wr = (e) => {
|
|
1249
1282
|
let t = e.trim();
|
|
1250
1283
|
if (X(t)) return null;
|
|
1251
|
-
let n =
|
|
1284
|
+
let n = Cr(t);
|
|
1252
1285
|
if (n) return {
|
|
1253
1286
|
r: Number.parseInt(n.slice(1, 3), 16),
|
|
1254
1287
|
g: Number.parseInt(n.slice(3, 5), 16),
|
|
@@ -1260,59 +1293,59 @@ var Wn = (e) => {
|
|
|
1260
1293
|
g: Number(r[2]),
|
|
1261
1294
|
b: Number(r[3])
|
|
1262
1295
|
} : null;
|
|
1263
|
-
},
|
|
1296
|
+
}, Tr = ({ r: e, g: t, b: n }) => `#${[
|
|
1264
1297
|
e,
|
|
1265
1298
|
t,
|
|
1266
1299
|
n
|
|
1267
|
-
].map((e) =>
|
|
1300
|
+
].map((e) => Sr(Math.round(e), 0, 255).toString(16).padStart(2, "0")).join("")}`, Er = (e, t) => {
|
|
1268
1301
|
if (X(e) && X(t)) return !0;
|
|
1269
|
-
let n =
|
|
1302
|
+
let n = wr(e), r = wr(t);
|
|
1270
1303
|
return !!(n && r && n.r === r.r && n.g === r.g && n.b === r.b);
|
|
1271
|
-
},
|
|
1304
|
+
}, Dr = (e) => {
|
|
1272
1305
|
let t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.max(t, n, r), a = Math.min(t, n, r), o = (i + a) / 2, s = i - a, c = 0;
|
|
1273
1306
|
return s !== 0 && (c = i === t ? ((n - r) / s + (n < r ? 6 : 0)) * 60 : i === n ? ((r - t) / s + 2) * 60 : ((t - n) / s + 4) * 60), {
|
|
1274
1307
|
h: c,
|
|
1275
1308
|
s: s === 0 ? 0 : s / (1 - Math.abs(2 * o - 1)),
|
|
1276
1309
|
l: o
|
|
1277
1310
|
};
|
|
1278
|
-
},
|
|
1311
|
+
}, Or = ({ h: e, s: t, l: n }) => {
|
|
1279
1312
|
let r = (e % 360 + 360) % 360, i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(r / 60 % 2 - 1)), o = n - i / 2, s = 0, c = 0, l = 0;
|
|
1280
1313
|
return r < 60 ? (s = i, c = a) : r < 120 ? (s = a, c = i) : r < 180 ? (c = i, l = a) : r < 240 ? (c = a, l = i) : r < 300 ? (s = a, l = i) : (s = i, l = a), {
|
|
1281
1314
|
r: Math.round((s + o) * 255),
|
|
1282
1315
|
g: Math.round((c + o) * 255),
|
|
1283
1316
|
b: Math.round((l + o) * 255)
|
|
1284
1317
|
};
|
|
1285
|
-
},
|
|
1318
|
+
}, kr = (e) => Tr(Or(e)), Ar = (e, t) => ({
|
|
1286
1319
|
h: Y(e) * 360,
|
|
1287
1320
|
s: 1,
|
|
1288
1321
|
l: Y(1 - t)
|
|
1289
|
-
}),
|
|
1322
|
+
}), jr = (e) => ({
|
|
1290
1323
|
x: Y((e.h % 360 + 360) % 360 / 360),
|
|
1291
1324
|
y: Y(1 - e.l)
|
|
1292
|
-
}),
|
|
1325
|
+
}), Mr = (e, t, n) => ({
|
|
1293
1326
|
x: Y(n.width === 0 ? 0 : (e - n.left) / n.width),
|
|
1294
1327
|
y: Y(n.height === 0 ? 0 : (t - n.top) / n.height)
|
|
1295
|
-
}),
|
|
1296
|
-
let r =
|
|
1328
|
+
}), Nr = (e, t, n = Infinity) => {
|
|
1329
|
+
let r = wr(t);
|
|
1297
1330
|
if (!r) return e;
|
|
1298
|
-
let i =
|
|
1299
|
-
return [i, ...e.filter((e) => !
|
|
1300
|
-
},
|
|
1331
|
+
let i = Tr(r);
|
|
1332
|
+
return [i, ...e.filter((e) => !Er(e, i))].slice(0, n);
|
|
1333
|
+
}, Pr = (e, t = 24, n = 8) => Math.max(0, Math.floor((e + n) / (t + n))), Fr = (e, t) => {
|
|
1301
1334
|
let n = t % 11;
|
|
1302
1335
|
return Math.floor(t / 11) === 2 ? e[22] ?? e[t] : e[n] ?? e[t];
|
|
1303
|
-
}, Z = (...e) => e.filter(Boolean).join(" "),
|
|
1304
|
-
let t =
|
|
1336
|
+
}, Z = (...e) => e.filter(Boolean).join(" "), Ir = (e) => {
|
|
1337
|
+
let t = wr(e) ?? {
|
|
1305
1338
|
r: 0,
|
|
1306
1339
|
g: 94,
|
|
1307
1340
|
b: 239
|
|
1308
1341
|
};
|
|
1309
1342
|
return {
|
|
1310
|
-
color:
|
|
1311
|
-
point:
|
|
1343
|
+
color: Tr(t),
|
|
1344
|
+
point: jr(Dr(t))
|
|
1312
1345
|
};
|
|
1313
|
-
},
|
|
1314
|
-
let { t: l } = e(), [f, h] = d("presets"), [g, _] = d(() =>
|
|
1315
|
-
_(
|
|
1346
|
+
}, Lr = ({ mode: t, currentColor: r, customColors: i, onApply: a, onCustomDraftChange: o, onCustomConfirm: c }) => {
|
|
1347
|
+
let { t: l } = e(), [f, h] = d("presets"), [g, _] = d(() => Ir(r)), [v, y] = d(!1), [b, x] = d(null), S = u(null), C = u(null), w = u(null), T = (e = r) => {
|
|
1348
|
+
_(Ir(e)), y(!1), o(null), h("custom");
|
|
1316
1349
|
};
|
|
1317
1350
|
s(() => {
|
|
1318
1351
|
if (f !== "custom" || typeof ResizeObserver > "u") return;
|
|
@@ -1341,7 +1374,7 @@ var Wn = (e) => {
|
|
|
1341
1374
|
if (!e) return;
|
|
1342
1375
|
let t = () => {
|
|
1343
1376
|
let t = e.getBoundingClientRect().width;
|
|
1344
|
-
t > 0 && x(
|
|
1377
|
+
t > 0 && x(Pr(t));
|
|
1345
1378
|
};
|
|
1346
1379
|
if (t(), typeof ResizeObserver > "u") return;
|
|
1347
1380
|
let n = new ResizeObserver(t);
|
|
@@ -1350,7 +1383,7 @@ var Wn = (e) => {
|
|
|
1350
1383
|
let E = (e) => {
|
|
1351
1384
|
let t = S.current;
|
|
1352
1385
|
if (!t) return;
|
|
1353
|
-
let { x: n, y: r } =
|
|
1386
|
+
let { x: n, y: r } = Mr(e.clientX, e.clientY, t.getBoundingClientRect()), i = kr(Ar(n, r));
|
|
1354
1387
|
_({
|
|
1355
1388
|
color: i,
|
|
1356
1389
|
point: {
|
|
@@ -1389,7 +1422,7 @@ var Wn = (e) => {
|
|
|
1389
1422
|
role: "listbox",
|
|
1390
1423
|
"aria-label": l("editor.customColors"),
|
|
1391
1424
|
children: i.slice(0, b ?? i.length).map((e) => {
|
|
1392
|
-
let t =
|
|
1425
|
+
let t = Er(r, e);
|
|
1393
1426
|
return /* @__PURE__ */ p("button", {
|
|
1394
1427
|
type: "button",
|
|
1395
1428
|
role: "option",
|
|
@@ -1467,7 +1500,7 @@ var Wn = (e) => {
|
|
|
1467
1500
|
role: "listbox",
|
|
1468
1501
|
"aria-label": l("editor.presetColors"),
|
|
1469
1502
|
children: ut.map((e, t) => {
|
|
1470
|
-
let n =
|
|
1503
|
+
let n = Er(r, e);
|
|
1471
1504
|
return /* @__PURE__ */ p("button", {
|
|
1472
1505
|
type: "button",
|
|
1473
1506
|
role: "option",
|
|
@@ -1476,7 +1509,7 @@ var Wn = (e) => {
|
|
|
1476
1509
|
className: Z(V["bsy-mobile-editor__color-swatch"], n && V["bsy-mobile-editor__color-swatch--selected"]),
|
|
1477
1510
|
style: {
|
|
1478
1511
|
"--swatch-color": e,
|
|
1479
|
-
"--swatch-ring":
|
|
1512
|
+
"--swatch-ring": Fr(ut, t)
|
|
1480
1513
|
},
|
|
1481
1514
|
onClick: () => a(e),
|
|
1482
1515
|
children: /* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__color-swatch-fill"] })
|
|
@@ -1486,19 +1519,19 @@ var Wn = (e) => {
|
|
|
1486
1519
|
A
|
|
1487
1520
|
]
|
|
1488
1521
|
});
|
|
1489
|
-
},
|
|
1522
|
+
}, Rr = (e, t) => {
|
|
1490
1523
|
H(e), e.update(() => {
|
|
1491
1524
|
ot(L(), () => t === "paragraph" ? P() : re(t));
|
|
1492
1525
|
});
|
|
1493
|
-
},
|
|
1526
|
+
}, zr = (e, t, n) => {
|
|
1494
1527
|
H(e), e.update(() => {
|
|
1495
|
-
|
|
1528
|
+
Ut(n), Wt();
|
|
1496
1529
|
let e = L();
|
|
1497
1530
|
e && at(e, t);
|
|
1498
1531
|
});
|
|
1499
|
-
},
|
|
1532
|
+
}, Br = ({ sheet: i, onClose: a, onTypeset: o, onPolishMenu: s, onPickPreset: c, onPicture: l, savedSelectionRef: h, committedColors: g, onColorCommit: _, canTypeset: v, canPolish: y }) => {
|
|
1500
1533
|
let [b] = z(), { t: x } = e(), [S, C] = d([]), w = u(null), T = i === "fontColor" || i === "fill" ? i : null, E = T === "fill" ? g.fill : T === "fontColor" ? g.fontColor : ct, D = (e, t = !1, n = !0) => {
|
|
1501
|
-
T && (n && (w.current = null),
|
|
1534
|
+
T && (n && (w.current = null), zr(b, { [T === "fill" ? "background-color" : "color"]: e }, h.current), _(T, e), t && !X(e) && C((t) => Nr(t, e)), n && a());
|
|
1502
1535
|
}, O = (e) => {
|
|
1503
1536
|
w.current = null, D(e, !0, !1);
|
|
1504
1537
|
};
|
|
@@ -1561,7 +1594,7 @@ var Wn = (e) => {
|
|
|
1561
1594
|
text: x("editor.heading3")
|
|
1562
1595
|
}
|
|
1563
1596
|
],
|
|
1564
|
-
onAction: (e) =>
|
|
1597
|
+
onAction: (e) => Rr(b, e.key)
|
|
1565
1598
|
}),
|
|
1566
1599
|
/* @__PURE__ */ p(r, {
|
|
1567
1600
|
mode: "menu",
|
|
@@ -1572,7 +1605,7 @@ var Wn = (e) => {
|
|
|
1572
1605
|
key: e.value,
|
|
1573
1606
|
text: e.label
|
|
1574
1607
|
})),
|
|
1575
|
-
onAction: (e) =>
|
|
1608
|
+
onAction: (e) => zr(b, { "font-size": e.key })
|
|
1576
1609
|
}),
|
|
1577
1610
|
/* @__PURE__ */ p(t, {
|
|
1578
1611
|
open: T !== null,
|
|
@@ -1581,7 +1614,7 @@ var Wn = (e) => {
|
|
|
1581
1614
|
e && O(e), a();
|
|
1582
1615
|
},
|
|
1583
1616
|
position: "bottom",
|
|
1584
|
-
children: T ? /* @__PURE__ */ p(
|
|
1617
|
+
children: T ? /* @__PURE__ */ p(Lr, {
|
|
1585
1618
|
mode: T,
|
|
1586
1619
|
currentColor: E,
|
|
1587
1620
|
customColors: S,
|
|
@@ -1601,7 +1634,7 @@ var Wn = (e) => {
|
|
|
1601
1634
|
text: x("editor.aiTypeset"),
|
|
1602
1635
|
disabled: !v,
|
|
1603
1636
|
icon: /* @__PURE__ */ p("img", {
|
|
1604
|
-
src:
|
|
1637
|
+
src: br,
|
|
1605
1638
|
alt: "",
|
|
1606
1639
|
width: 16,
|
|
1607
1640
|
height: 16,
|
|
@@ -1613,7 +1646,7 @@ var Wn = (e) => {
|
|
|
1613
1646
|
text: x("editor.aiPolish"),
|
|
1614
1647
|
disabled: !y,
|
|
1615
1648
|
icon: /* @__PURE__ */ p("img", {
|
|
1616
|
-
src:
|
|
1649
|
+
src: xr,
|
|
1617
1650
|
alt: "",
|
|
1618
1651
|
width: 16,
|
|
1619
1652
|
height: 16,
|
|
@@ -1663,7 +1696,7 @@ var Wn = (e) => {
|
|
|
1663
1696
|
onAction: (e) => l(e.key)
|
|
1664
1697
|
})
|
|
1665
1698
|
] });
|
|
1666
|
-
},
|
|
1699
|
+
}, Vr = ({ open: r, title: i, bodyClassName: a, onClose: o, onConfirm: s, children: c }) => {
|
|
1667
1700
|
let { t: l } = e();
|
|
1668
1701
|
return /* @__PURE__ */ p(t, {
|
|
1669
1702
|
open: r,
|
|
@@ -1708,11 +1741,11 @@ var Wn = (e) => {
|
|
|
1708
1741
|
]
|
|
1709
1742
|
})
|
|
1710
1743
|
});
|
|
1711
|
-
},
|
|
1744
|
+
}, Hr = ({ open: t, seed: r, onClose: i, onConfirm: a }) => {
|
|
1712
1745
|
let { t: o } = e(), [c, l] = d(""), [u, f] = d(""), [h, g] = d(!0);
|
|
1713
1746
|
return s(() => {
|
|
1714
1747
|
!t || !r || (l(r.url), f(r.text), g(r.newBlank));
|
|
1715
|
-
}, [t, r]), /* @__PURE__ */ m(
|
|
1748
|
+
}, [t, r]), /* @__PURE__ */ m(Vr, {
|
|
1716
1749
|
open: t,
|
|
1717
1750
|
title: o("editor.link"),
|
|
1718
1751
|
bodyClassName: V["bsy-mobile-editor__sheet-body--stack"],
|
|
@@ -1774,13 +1807,13 @@ var Wn = (e) => {
|
|
|
1774
1807
|
})
|
|
1775
1808
|
]
|
|
1776
1809
|
});
|
|
1777
|
-
},
|
|
1810
|
+
}, Ur = /^https?:\/\/.+/i, Wr = ({ open: t, onClose: n, onConfirm: r }) => {
|
|
1778
1811
|
let { t: i } = e(), [o, c] = d(""), [l, u] = d(null), f = a((e) => {
|
|
1779
1812
|
e?.focus();
|
|
1780
1813
|
}, []);
|
|
1781
1814
|
return s(() => {
|
|
1782
1815
|
t && (c(""), u(null));
|
|
1783
|
-
}, [t]), /* @__PURE__ */ p(
|
|
1816
|
+
}, [t]), /* @__PURE__ */ p(Vr, {
|
|
1784
1817
|
open: t,
|
|
1785
1818
|
title: i("editor.imageUrl"),
|
|
1786
1819
|
onClose: n,
|
|
@@ -1790,7 +1823,7 @@ var Wn = (e) => {
|
|
|
1790
1823
|
u(i("editor.imageUrlRequired"));
|
|
1791
1824
|
return;
|
|
1792
1825
|
}
|
|
1793
|
-
if (!
|
|
1826
|
+
if (!Ur.test(e)) {
|
|
1794
1827
|
u(i("editor.imageUrlInvalid"));
|
|
1795
1828
|
return;
|
|
1796
1829
|
}
|
|
@@ -1823,26 +1856,175 @@ var Wn = (e) => {
|
|
|
1823
1856
|
]
|
|
1824
1857
|
})
|
|
1825
1858
|
});
|
|
1826
|
-
},
|
|
1859
|
+
}, Gr = `
|
|
1860
|
+
:host {
|
|
1861
|
+
all: initial;
|
|
1862
|
+
display: block;
|
|
1863
|
+
width: 100%;
|
|
1864
|
+
max-width: 100%;
|
|
1865
|
+
min-width: 0;
|
|
1866
|
+
}
|
|
1867
|
+
.bsy-editor-html-preview__body {
|
|
1868
|
+
color: #030303;
|
|
1869
|
+
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
|
|
1870
|
+
font-size: 15px;
|
|
1871
|
+
line-height: 1.6;
|
|
1872
|
+
word-break: break-word;
|
|
1873
|
+
}
|
|
1874
|
+
.bsy-editor-html-preview__body p {
|
|
1875
|
+
margin: 0;
|
|
1876
|
+
}
|
|
1877
|
+
.bsy-editor-html-preview__body .editor-text-bold {
|
|
1878
|
+
font-weight: 700;
|
|
1879
|
+
}
|
|
1880
|
+
.bsy-editor-html-preview__body .editor-text-italic {
|
|
1881
|
+
font-style: italic;
|
|
1882
|
+
}
|
|
1883
|
+
.bsy-editor-html-preview__body .editor-text-underline {
|
|
1884
|
+
text-decoration: underline;
|
|
1885
|
+
}
|
|
1886
|
+
.bsy-editor-html-preview__body .editor-text-strikethrough {
|
|
1887
|
+
text-decoration: line-through;
|
|
1888
|
+
}
|
|
1889
|
+
.bsy-editor-html-preview__body .editor-text-underline-strikethrough {
|
|
1890
|
+
text-decoration: underline line-through;
|
|
1891
|
+
}
|
|
1892
|
+
.bsy-editor-html-preview__body sup,
|
|
1893
|
+
.bsy-editor-html-preview__body sub {
|
|
1894
|
+
display: inline-block;
|
|
1895
|
+
position: static;
|
|
1896
|
+
top: auto;
|
|
1897
|
+
bottom: auto;
|
|
1898
|
+
font-size: 0.75em;
|
|
1899
|
+
line-height: 1;
|
|
1900
|
+
}
|
|
1901
|
+
.bsy-editor-html-preview__body sup {
|
|
1902
|
+
vertical-align: super;
|
|
1903
|
+
}
|
|
1904
|
+
.bsy-editor-html-preview__body sub {
|
|
1905
|
+
vertical-align: sub;
|
|
1906
|
+
}
|
|
1907
|
+
.bsy-editor-html-preview__body .editor-heading-h1,
|
|
1908
|
+
.bsy-editor-html-preview__body .editor-heading-h2,
|
|
1909
|
+
.bsy-editor-html-preview__body .editor-heading-h3 {
|
|
1910
|
+
margin: 0.6em 0 0.4em;
|
|
1911
|
+
font-weight: 600;
|
|
1912
|
+
line-height: 1.35;
|
|
1913
|
+
}
|
|
1914
|
+
.bsy-editor-html-preview__body .editor-heading-h1 {
|
|
1915
|
+
font-size: 2em;
|
|
1916
|
+
}
|
|
1917
|
+
.bsy-editor-html-preview__body .editor-heading-h2 {
|
|
1918
|
+
font-size: 1.5em;
|
|
1919
|
+
}
|
|
1920
|
+
.bsy-editor-html-preview__body .editor-heading-h3 {
|
|
1921
|
+
font-size: 1.25em;
|
|
1922
|
+
}
|
|
1923
|
+
.bsy-editor-html-preview__body ul,
|
|
1924
|
+
.bsy-editor-html-preview__body ol,
|
|
1925
|
+
.bsy-editor-html-preview__body .editor-list-ul,
|
|
1926
|
+
.bsy-editor-html-preview__body .editor-list-ol {
|
|
1927
|
+
margin: 0;
|
|
1928
|
+
padding-inline-start: 0;
|
|
1929
|
+
list-style-position: outside;
|
|
1930
|
+
}
|
|
1931
|
+
.bsy-editor-html-preview__body .editor-list-ul {
|
|
1932
|
+
list-style-type: disc;
|
|
1933
|
+
}
|
|
1934
|
+
.bsy-editor-html-preview__body .editor-list-ol {
|
|
1935
|
+
list-style-type: decimal;
|
|
1936
|
+
}
|
|
1937
|
+
.bsy-editor-html-preview__body li,
|
|
1938
|
+
.bsy-editor-html-preview__body .editor-listitem {
|
|
1939
|
+
margin: 0;
|
|
1940
|
+
margin-inline-start: ${Nt};
|
|
1941
|
+
list-style: inherit;
|
|
1942
|
+
}
|
|
1943
|
+
.bsy-editor-html-preview__body .editor-nested-listitem {
|
|
1944
|
+
margin-inline-start: 0;
|
|
1945
|
+
list-style-type: none;
|
|
1946
|
+
}
|
|
1947
|
+
.bsy-editor-html-preview__body li::marker,
|
|
1948
|
+
.bsy-editor-html-preview__body .editor-listitem::marker {
|
|
1949
|
+
color: var(--listitem-marker-color);
|
|
1950
|
+
background-color: var(--listitem-marker-background-color);
|
|
1951
|
+
font-family: var(--listitem-marker-font-family);
|
|
1952
|
+
font-size: var(--listitem-marker-font-size);
|
|
1953
|
+
}
|
|
1954
|
+
.bsy-editor-html-preview__body .editor-list-ul .editor-list-ul {
|
|
1955
|
+
list-style-type: circle;
|
|
1956
|
+
}
|
|
1957
|
+
.bsy-editor-html-preview__body .editor-list-ul .editor-list-ul .editor-list-ul {
|
|
1958
|
+
list-style-type: square;
|
|
1959
|
+
}
|
|
1960
|
+
.bsy-editor-html-preview__body .editor-link,
|
|
1961
|
+
.bsy-editor-html-preview__body .editor-link:link,
|
|
1962
|
+
.bsy-editor-html-preview__body .editor-link:visited,
|
|
1963
|
+
.bsy-editor-html-preview__body .editor-link:hover,
|
|
1964
|
+
.bsy-editor-html-preview__body .editor-link:active,
|
|
1965
|
+
.bsy-editor-html-preview__body .editor-link:focus {
|
|
1966
|
+
color: #0269ff;
|
|
1967
|
+
cursor: pointer;
|
|
1968
|
+
}
|
|
1969
|
+
.bsy-editor-html-preview__body .editor-link * {
|
|
1970
|
+
color: #0269ff !important;
|
|
1971
|
+
}
|
|
1972
|
+
.bsy-editor-html-preview__body pre {
|
|
1973
|
+
display: block;
|
|
1974
|
+
box-sizing: border-box;
|
|
1975
|
+
max-width: 100%;
|
|
1976
|
+
margin: 8px 0;
|
|
1977
|
+
padding: 8px 12px;
|
|
1978
|
+
overflow-x: auto;
|
|
1979
|
+
border-radius: 4px;
|
|
1980
|
+
background: rgb(240, 242, 245);
|
|
1981
|
+
color: #1f2328;
|
|
1982
|
+
font-family: Menlo, Consolas, Monaco, monospace;
|
|
1983
|
+
font-size: 13px;
|
|
1984
|
+
line-height: 1.53;
|
|
1985
|
+
tab-size: 2;
|
|
1986
|
+
white-space: pre;
|
|
1987
|
+
}
|
|
1988
|
+
.bsy-editor-html-preview__body .editor-table-scrollable-wrapper {
|
|
1989
|
+
max-width: 100%;
|
|
1990
|
+
margin: 8px 0;
|
|
1991
|
+
overflow-x: auto;
|
|
1992
|
+
-webkit-overflow-scrolling: touch;
|
|
1993
|
+
}
|
|
1994
|
+
.bsy-editor-html-preview__body table {
|
|
1995
|
+
width: max-content;
|
|
1996
|
+
min-width: 100%;
|
|
1997
|
+
margin: 0;
|
|
1998
|
+
border-collapse: collapse;
|
|
1999
|
+
table-layout: fixed;
|
|
2000
|
+
}
|
|
2001
|
+
.bsy-editor-html-preview__body td,
|
|
2002
|
+
.bsy-editor-html-preview__body th {
|
|
2003
|
+
box-sizing: border-box;
|
|
2004
|
+
min-width: 75px;
|
|
2005
|
+
min-height: 32px;
|
|
2006
|
+
padding: 4px 8px;
|
|
2007
|
+
border: 1px solid #d9d9d9;
|
|
2008
|
+
vertical-align: top;
|
|
2009
|
+
}
|
|
2010
|
+
.bsy-editor-html-preview__body th {
|
|
2011
|
+
background: #f2f3f5;
|
|
2012
|
+
font-weight: 600;
|
|
2013
|
+
}
|
|
2014
|
+
.bsy-editor-html-preview__body img {
|
|
2015
|
+
max-width: 100%;
|
|
2016
|
+
height: auto;
|
|
2017
|
+
vertical-align: baseline;
|
|
2018
|
+
}
|
|
2019
|
+
`, Kr = ({ html: e }) => {
|
|
1827
2020
|
let t = u(null);
|
|
1828
2021
|
return l(() => {
|
|
1829
|
-
|
|
1830
|
-
if (!n) return;
|
|
1831
|
-
let r = n.shadowRoot ?? n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
1832
|
-
i.className = "bsy-editor-html-preview__body", i.innerHTML = U(e);
|
|
1833
|
-
for (let e of Array.from(i.querySelectorAll("table"))) {
|
|
1834
|
-
if (e.parentElement?.classList.contains("editor-table-scrollable-wrapper")) continue;
|
|
1835
|
-
let t = document.createElement("div");
|
|
1836
|
-
t.className = "editor-table-scrollable-wrapper", e.replaceWith(t), t.append(e);
|
|
1837
|
-
}
|
|
1838
|
-
r.replaceChildren();
|
|
1839
|
-
let a = document.createElement("style");
|
|
1840
|
-
a.textContent = Rr, r.append(a, i);
|
|
2022
|
+
Rt(t.current, e, U, Gr);
|
|
1841
2023
|
}, [e]), /* @__PURE__ */ p("div", {
|
|
1842
2024
|
ref: t,
|
|
1843
2025
|
className: "bsy-editor-html-preview"
|
|
1844
2026
|
});
|
|
1845
|
-
},
|
|
2027
|
+
}, qr = () => {
|
|
1846
2028
|
let e = `${c().replace(/:/g, "")}g`;
|
|
1847
2029
|
return /* @__PURE__ */ p("span", {
|
|
1848
2030
|
className: V["bsy-mobile-editor__ai-think-icon"],
|
|
@@ -1881,7 +2063,7 @@ var Wn = (e) => {
|
|
|
1881
2063
|
}) })]
|
|
1882
2064
|
})
|
|
1883
2065
|
});
|
|
1884
|
-
},
|
|
2066
|
+
}, Jr = (t, n) => {
|
|
1885
2067
|
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 ?? "";
|
|
1886
2068
|
return s(() => {
|
|
1887
2069
|
if (!i) {
|
|
@@ -1901,12 +2083,12 @@ var Wn = (e) => {
|
|
|
1901
2083
|
reasoning: m,
|
|
1902
2084
|
toggle: () => o((e) => !e)
|
|
1903
2085
|
};
|
|
1904
|
-
},
|
|
2086
|
+
}, Yr = ({ model: e }) => /* @__PURE__ */ m("button", {
|
|
1905
2087
|
type: "button",
|
|
1906
2088
|
className: V["bsy-mobile-editor__ai-think-head"],
|
|
1907
2089
|
disabled: e.thinking,
|
|
1908
2090
|
onClick: e.toggle,
|
|
1909
|
-
children: [e.thinking ? /* @__PURE__ */ p(
|
|
2091
|
+
children: [e.thinking ? /* @__PURE__ */ p(qr, {}) : /* @__PURE__ */ p(n, {
|
|
1910
2092
|
name: "arrow-down",
|
|
1911
2093
|
size: 12,
|
|
1912
2094
|
className: [V["bsy-mobile-editor__ai-think-arrow"], e.open ? V["bsy-mobile-editor__ai-think-arrow--open"] : ""].filter(Boolean).join(" ")
|
|
@@ -1914,10 +2096,10 @@ var Wn = (e) => {
|
|
|
1914
2096
|
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"],
|
|
1915
2097
|
children: e.label
|
|
1916
2098
|
})]
|
|
1917
|
-
}),
|
|
2099
|
+
}), Xr = ({ model: e }) => !e.visible || !e.open || !e.reasoning ? null : /* @__PURE__ */ p("div", {
|
|
1918
2100
|
className: V["bsy-mobile-editor__ai-think-body"],
|
|
1919
2101
|
children: e.reasoning
|
|
1920
|
-
}),
|
|
2102
|
+
}), Zr = ({ enabled: e, status: t, revision: n, compute: r }) => {
|
|
1921
2103
|
let [i, a] = d(""), o = u(r);
|
|
1922
2104
|
o.current = r;
|
|
1923
2105
|
let c = u(null);
|
|
@@ -1944,7 +2126,7 @@ var Wn = (e) => {
|
|
|
1944
2126
|
]), s(() => () => {
|
|
1945
2127
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
1946
2128
|
}, []), i;
|
|
1947
|
-
},
|
|
2129
|
+
}, Qr = 32, $r = .25, ei = 2, ti = ({ viewportRef: e, enabled: t, revision: n }) => {
|
|
1948
2130
|
let r = u(!0), i = u(!1), o = u(0), c = a(() => e.current ?? void 0, [e]), l = a(() => {
|
|
1949
2131
|
o.current = 0;
|
|
1950
2132
|
let t = e.current;
|
|
@@ -1954,7 +2136,7 @@ var Wn = (e) => {
|
|
|
1954
2136
|
t.scrollTop = n;
|
|
1955
2137
|
return;
|
|
1956
2138
|
}
|
|
1957
|
-
t.scrollTop += Math.max(i *
|
|
2139
|
+
t.scrollTop += Math.max(i * $r, Math.min(i, ei)), o.current = requestAnimationFrame(l);
|
|
1958
2140
|
}, [e]), d = a(() => {
|
|
1959
2141
|
!o.current && r.current && (o.current = requestAnimationFrame(l));
|
|
1960
2142
|
}, [l]);
|
|
@@ -1981,7 +2163,7 @@ var Wn = (e) => {
|
|
|
1981
2163
|
let f = () => {
|
|
1982
2164
|
let t = e.current;
|
|
1983
2165
|
if (!t) return;
|
|
1984
|
-
let n = t.scrollHeight - t.clientHeight - t.scrollTop <=
|
|
2166
|
+
let n = t.scrollHeight - t.clientHeight - t.scrollTop <= Qr;
|
|
1985
2167
|
i.current ? (i.current = !1, r.current = n, !n && o.current && (cancelAnimationFrame(o.current), o.current = 0)) : n && (r.current = !0);
|
|
1986
2168
|
}, p = () => {
|
|
1987
2169
|
i.current = !0;
|
|
@@ -1999,16 +2181,16 @@ var Wn = (e) => {
|
|
|
1999
2181
|
passive: !0,
|
|
2000
2182
|
enable: t
|
|
2001
2183
|
}), { onScroll: f };
|
|
2002
|
-
},
|
|
2003
|
-
let { t: v } = e(), y = u(null), [b, x] = d(!1), S = c?.status ?? "idle", C = c?.text ?? "", w =
|
|
2184
|
+
}, ni = ({ open: i, mode: a, originalHtml: o, codeBlocks: s = [], ai: c, polishPreset: l, onClose: h, onApply: g, onPickPreset: _ }) => {
|
|
2185
|
+
let { t: v } = e(), y = u(null), [b, x] = d(!1), S = c?.status ?? "idle", C = c?.text ?? "", w = Zr({
|
|
2004
2186
|
enabled: i && !!a,
|
|
2005
2187
|
status: S,
|
|
2006
2188
|
revision: C,
|
|
2007
|
-
compute: () => a === "polish" ? U(
|
|
2008
|
-
}), T = !!w.trim(), E =
|
|
2189
|
+
compute: () => a === "polish" ? U(jn(o, C)) : Yn(C, s)
|
|
2190
|
+
}), T = !!w.trim(), E = Jr({
|
|
2009
2191
|
status: S,
|
|
2010
2192
|
reasoning: c?.reasoning
|
|
2011
|
-
}, T), D =
|
|
2193
|
+
}, T), D = ti({
|
|
2012
2194
|
viewportRef: y,
|
|
2013
2195
|
enabled: i && S === "loading",
|
|
2014
2196
|
revision: `${c?.reasoning ?? ""}\0${w}`
|
|
@@ -2061,7 +2243,7 @@ var Wn = (e) => {
|
|
|
2061
2243
|
}),
|
|
2062
2244
|
E.visible ? /* @__PURE__ */ p("div", {
|
|
2063
2245
|
className: V["bsy-mobile-editor__ai-think-pin"],
|
|
2064
|
-
children: /* @__PURE__ */ p(
|
|
2246
|
+
children: /* @__PURE__ */ p(Yr, { model: E })
|
|
2065
2247
|
}) : null,
|
|
2066
2248
|
/* @__PURE__ */ p("div", {
|
|
2067
2249
|
ref: y,
|
|
@@ -2070,7 +2252,7 @@ var Wn = (e) => {
|
|
|
2070
2252
|
children: S === "error" ? /* @__PURE__ */ p("p", {
|
|
2071
2253
|
className: V["bsy-mobile-editor__ai-error"],
|
|
2072
2254
|
children: c?.errorMessage || v("editor.aiError")
|
|
2073
|
-
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(
|
|
2255
|
+
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Xr, { model: E }), T ? /* @__PURE__ */ p(Kr, { html: w }) : null] })
|
|
2074
2256
|
})
|
|
2075
2257
|
]
|
|
2076
2258
|
}),
|
|
@@ -2085,7 +2267,7 @@ var Wn = (e) => {
|
|
|
2085
2267
|
})
|
|
2086
2268
|
}), /* @__PURE__ */ p("div", {
|
|
2087
2269
|
className: V["bsy-mobile-editor__ai-section-scroll"],
|
|
2088
|
-
children: /* @__PURE__ */ p(
|
|
2270
|
+
children: /* @__PURE__ */ p(Kr, { html: o })
|
|
2089
2271
|
})]
|
|
2090
2272
|
})
|
|
2091
2273
|
]
|
|
@@ -2117,28 +2299,28 @@ var Wn = (e) => {
|
|
|
2117
2299
|
onAction: (e) => _(e.key)
|
|
2118
2300
|
}) : null]
|
|
2119
2301
|
});
|
|
2120
|
-
},
|
|
2302
|
+
}, ri = "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", ii = "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", ai = 860.48, oi = 99.52, si = /rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0(?:\.0+)?\s*\)/, ci = {
|
|
2121
2303
|
fontColor: {
|
|
2122
|
-
path:
|
|
2123
|
-
clipHeight:
|
|
2304
|
+
path: ri,
|
|
2305
|
+
clipHeight: ai,
|
|
2124
2306
|
x: 128,
|
|
2125
2307
|
width: 768,
|
|
2126
2308
|
rx: 0
|
|
2127
2309
|
},
|
|
2128
2310
|
fill: {
|
|
2129
|
-
path:
|
|
2311
|
+
path: ii,
|
|
2130
2312
|
clipHeight: 816,
|
|
2131
2313
|
x: 112,
|
|
2132
2314
|
width: 800,
|
|
2133
2315
|
rx: 8
|
|
2134
2316
|
}
|
|
2135
|
-
},
|
|
2317
|
+
}, li = (e, t) => {
|
|
2136
2318
|
let n = t.trim().toLowerCase();
|
|
2137
|
-
if (e === "fill") return !n || n === "transparent" ||
|
|
2319
|
+
if (e === "fill") return !n || n === "transparent" || si.test(n);
|
|
2138
2320
|
let r = n.replace(/\s+/g, "");
|
|
2139
2321
|
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)";
|
|
2140
|
-
},
|
|
2141
|
-
let r = `${c().replace(/:/g, "")}clip`, i =
|
|
2322
|
+
}, ui = ({ variant: e, barColor: t, size: n }) => {
|
|
2323
|
+
let r = `${c().replace(/:/g, "")}clip`, i = ci[e];
|
|
2142
2324
|
return /* @__PURE__ */ m("svg", {
|
|
2143
2325
|
width: n,
|
|
2144
2326
|
height: n,
|
|
@@ -2161,15 +2343,15 @@ var Wn = (e) => {
|
|
|
2161
2343
|
}),
|
|
2162
2344
|
/* @__PURE__ */ p("rect", {
|
|
2163
2345
|
x: i.x,
|
|
2164
|
-
y:
|
|
2346
|
+
y: ai,
|
|
2165
2347
|
width: i.width,
|
|
2166
|
-
height:
|
|
2348
|
+
height: oi,
|
|
2167
2349
|
rx: i.rx,
|
|
2168
|
-
fill:
|
|
2350
|
+
fill: li(e, t) ? "currentColor" : t
|
|
2169
2351
|
})
|
|
2170
2352
|
]
|
|
2171
2353
|
});
|
|
2172
|
-
},
|
|
2354
|
+
}, di = {
|
|
2173
2355
|
bold: !1,
|
|
2174
2356
|
italic: !1,
|
|
2175
2357
|
underline: !1,
|
|
@@ -2182,9 +2364,9 @@ var Wn = (e) => {
|
|
|
2182
2364
|
headingTag: !1,
|
|
2183
2365
|
hasRangeSelection: !1,
|
|
2184
2366
|
hasEditorText: !1
|
|
2185
|
-
},
|
|
2367
|
+
}, fi = (e) => e === "center" || e === "right" || e === "left" ? e : e === "end" ? "right" : "left", pi = (e) => {
|
|
2186
2368
|
let t = !!I().getTextContent().trim(), n = {
|
|
2187
|
-
...
|
|
2369
|
+
...di,
|
|
2188
2370
|
hasEditorText: t
|
|
2189
2371
|
};
|
|
2190
2372
|
if (!e) return n;
|
|
@@ -2212,28 +2394,28 @@ var Wn = (e) => {
|
|
|
2212
2394
|
strikethrough: r.hasFormat("strikethrough"),
|
|
2213
2395
|
fontColor: i,
|
|
2214
2396
|
backgroundColor: a,
|
|
2215
|
-
align:
|
|
2397
|
+
align: fi(xe(s) ? s.getFormatType() : ""),
|
|
2216
2398
|
listType: l,
|
|
2217
2399
|
canOutdent: u > 0 || l !== !1,
|
|
2218
2400
|
headingTag: f === "h1" || f === "h2" || f === "h3" ? f : !1,
|
|
2219
2401
|
hasRangeSelection: !0,
|
|
2220
2402
|
hasEditorText: t
|
|
2221
2403
|
};
|
|
2222
|
-
},
|
|
2404
|
+
}, mi = (e, t) => {
|
|
2223
2405
|
e.isEditable() || e.setEditable(!0), e.update(() => {
|
|
2224
|
-
|
|
2406
|
+
Wt(), t(pi(!0));
|
|
2225
2407
|
}), e.focus(void 0, { defaultSelection: "rootStart" });
|
|
2226
|
-
},
|
|
2227
|
-
let t =
|
|
2228
|
-
return
|
|
2408
|
+
}, hi = (e) => {
|
|
2409
|
+
let t = di;
|
|
2410
|
+
return mi(e, (e) => {
|
|
2229
2411
|
t = e;
|
|
2230
2412
|
}), t;
|
|
2231
|
-
},
|
|
2413
|
+
}, gi = (...e) => e.filter(Boolean).join(" "), _i = (e) => e.buttons.map((e) => ({
|
|
2232
2414
|
name: typeof e == "string" ? e : e.name,
|
|
2233
2415
|
disabled: typeof e != "string" && !!e.props?.disabled
|
|
2234
|
-
})), Q = 24,
|
|
2416
|
+
})), Q = 24, vi = 20, $ = ({ active: e, disabled: t, expanded: n, label: r, select: i, selectAlign: a, onClick: o, children: s }) => /* @__PURE__ */ p("button", {
|
|
2235
2417
|
type: "button",
|
|
2236
|
-
className:
|
|
2418
|
+
className: gi(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"]),
|
|
2237
2419
|
"aria-label": r,
|
|
2238
2420
|
"aria-pressed": e,
|
|
2239
2421
|
"aria-expanded": i ? !!n : void 0,
|
|
@@ -2241,11 +2423,11 @@ var Wn = (e) => {
|
|
|
2241
2423
|
onMouseDown: (e) => e.preventDefault(),
|
|
2242
2424
|
onClick: o,
|
|
2243
2425
|
children: s
|
|
2244
|
-
}),
|
|
2426
|
+
}), yi = ({ open: e }) => /* @__PURE__ */ p(n, {
|
|
2245
2427
|
name: "arrow-down",
|
|
2246
|
-
size:
|
|
2247
|
-
className:
|
|
2248
|
-
}),
|
|
2428
|
+
size: vi,
|
|
2429
|
+
className: gi(V["bsy-mobile-editor__tool-caret"], e && V["bsy-mobile-editor__tool-caret--open"])
|
|
2430
|
+
}), bi = ({ config: t, formats: r, colorValues: i, openSheet: a, onOpenSheet: o, onOpenLink: c }) => {
|
|
2249
2431
|
let [l] = z(), { t: d } = e(), f = u(null), h = u(null), g = u(null), _ = () => {
|
|
2250
2432
|
let e = f.current, t = h.current, n = g.current;
|
|
2251
2433
|
if (!e || !t || !n) return;
|
|
@@ -2336,7 +2518,7 @@ var Wn = (e) => {
|
|
|
2336
2518
|
disabled: t,
|
|
2337
2519
|
label: d("editor.bulletList"),
|
|
2338
2520
|
onClick: () => {
|
|
2339
|
-
let e =
|
|
2521
|
+
let e = hi(l);
|
|
2340
2522
|
l.dispatchCommand(e.listType === "bullet" ? O : T, void 0);
|
|
2341
2523
|
},
|
|
2342
2524
|
children: /* @__PURE__ */ p(n, {
|
|
@@ -2349,7 +2531,7 @@ var Wn = (e) => {
|
|
|
2349
2531
|
disabled: t,
|
|
2350
2532
|
label: d("editor.numberList"),
|
|
2351
2533
|
onClick: () => {
|
|
2352
|
-
let e =
|
|
2534
|
+
let e = hi(l);
|
|
2353
2535
|
l.dispatchCommand(e.listType === "number" ? O : w, void 0);
|
|
2354
2536
|
},
|
|
2355
2537
|
children: /* @__PURE__ */ p(n, {
|
|
@@ -2368,7 +2550,7 @@ var Wn = (e) => {
|
|
|
2368
2550
|
children: [/* @__PURE__ */ p(n, {
|
|
2369
2551
|
name: r.align === "center" ? "paragraphmiddle" : r.align === "right" ? "paragraphright" : "paragraph",
|
|
2370
2552
|
size: Q
|
|
2371
|
-
}), /* @__PURE__ */ p(
|
|
2553
|
+
}), /* @__PURE__ */ p(yi, { open: a === "align" })]
|
|
2372
2554
|
}, e);
|
|
2373
2555
|
case "heading": return /* @__PURE__ */ m($, {
|
|
2374
2556
|
select: !0,
|
|
@@ -2381,7 +2563,7 @@ var Wn = (e) => {
|
|
|
2381
2563
|
children: [/* @__PURE__ */ p("span", {
|
|
2382
2564
|
className: V["bsy-mobile-editor__tool-text"],
|
|
2383
2565
|
children: r.headingTag ? r.headingTag.toUpperCase() : d("editor.paragraph")
|
|
2384
|
-
}), /* @__PURE__ */ p(
|
|
2566
|
+
}), /* @__PURE__ */ p(yi, { open: a === "heading" })]
|
|
2385
2567
|
}, e);
|
|
2386
2568
|
case "fontSize": return /* @__PURE__ */ p($, {
|
|
2387
2569
|
active: a === "fontSize",
|
|
@@ -2398,7 +2580,7 @@ var Wn = (e) => {
|
|
|
2398
2580
|
disabled: t,
|
|
2399
2581
|
label: d("editor.fontColor"),
|
|
2400
2582
|
onClick: () => o("fontColor"),
|
|
2401
|
-
children: /* @__PURE__ */ p(
|
|
2583
|
+
children: /* @__PURE__ */ p(ui, {
|
|
2402
2584
|
variant: "fontColor",
|
|
2403
2585
|
barColor: i.fontColor,
|
|
2404
2586
|
size: Q
|
|
@@ -2409,7 +2591,7 @@ var Wn = (e) => {
|
|
|
2409
2591
|
disabled: t,
|
|
2410
2592
|
label: d("editor.fill"),
|
|
2411
2593
|
onClick: () => o("fill"),
|
|
2412
|
-
children: /* @__PURE__ */ p(
|
|
2594
|
+
children: /* @__PURE__ */ p(ui, {
|
|
2413
2595
|
variant: "fill",
|
|
2414
2596
|
barColor: i.fill,
|
|
2415
2597
|
size: Q
|
|
@@ -2425,7 +2607,7 @@ var Wn = (e) => {
|
|
|
2425
2607
|
children: [/* @__PURE__ */ p(n, {
|
|
2426
2608
|
name: "picture",
|
|
2427
2609
|
size: Q
|
|
2428
|
-
}), /* @__PURE__ */ p(
|
|
2610
|
+
}), /* @__PURE__ */ p(yi, { open: a === "picture" })]
|
|
2429
2611
|
}, e);
|
|
2430
2612
|
case "link": return /* @__PURE__ */ p($, {
|
|
2431
2613
|
disabled: t,
|
|
@@ -2446,13 +2628,13 @@ var Wn = (e) => {
|
|
|
2446
2628
|
label: d("editor.ai"),
|
|
2447
2629
|
onClick: () => o("ai"),
|
|
2448
2630
|
children: [/* @__PURE__ */ p("img", {
|
|
2449
|
-
src:
|
|
2631
|
+
src: br,
|
|
2450
2632
|
alt: "",
|
|
2451
2633
|
width: Q,
|
|
2452
2634
|
height: Q,
|
|
2453
2635
|
className: V["bsy-mobile-editor__ai-icon"],
|
|
2454
2636
|
draggable: !1
|
|
2455
|
-
}), /* @__PURE__ */ p(
|
|
2637
|
+
}), /* @__PURE__ */ p(yi, { open: n })]
|
|
2456
2638
|
}, e);
|
|
2457
2639
|
}
|
|
2458
2640
|
default: return null;
|
|
@@ -2465,7 +2647,7 @@ var Wn = (e) => {
|
|
|
2465
2647
|
className: V["bsy-mobile-editor__toolbar-scroller"],
|
|
2466
2648
|
onScroll: _,
|
|
2467
2649
|
children: t.map((e, t) => {
|
|
2468
|
-
let n =
|
|
2650
|
+
let n = _i(e);
|
|
2469
2651
|
return n.length ? /* @__PURE__ */ m("div", {
|
|
2470
2652
|
className: V["bsy-mobile-editor__toolbar-group"],
|
|
2471
2653
|
children: [t > 0 ? /* @__PURE__ */ p("span", { className: V["bsy-mobile-editor__toolbar-divider"] }) : null, n.map(v)]
|
|
@@ -2482,19 +2664,19 @@ var Wn = (e) => {
|
|
|
2482
2664
|
})
|
|
2483
2665
|
})]
|
|
2484
2666
|
});
|
|
2485
|
-
},
|
|
2667
|
+
}, xi = () => {
|
|
2486
2668
|
let [e] = z(), [t, n] = d(!1);
|
|
2487
2669
|
return s(() => rt(e.registerCommand(Pe, () => (n(!0), !1), je), e.registerCommand(ke, () => (n(!1), !1), je)), [e]), t;
|
|
2488
|
-
},
|
|
2489
|
-
let [e] = z(), t =
|
|
2670
|
+
}, Si = () => {
|
|
2671
|
+
let [e] = z(), t = xi(), [n, r] = d(di);
|
|
2490
2672
|
return s(() => (e.getEditorState().read(() => {
|
|
2491
|
-
r(
|
|
2673
|
+
r(pi(t));
|
|
2492
2674
|
}, { editor: e }), e.registerUpdateListener(({ editorState: n }) => {
|
|
2493
2675
|
n.read(() => {
|
|
2494
|
-
r(
|
|
2676
|
+
r(pi(t));
|
|
2495
2677
|
}, { editor: e });
|
|
2496
2678
|
})), [e, t]), n;
|
|
2497
|
-
},
|
|
2679
|
+
}, Ci = "plaintext", wi = "github-light", Ti = new Set([
|
|
2498
2680
|
"plaintext",
|
|
2499
2681
|
"css",
|
|
2500
2682
|
"html",
|
|
@@ -2516,7 +2698,7 @@ var Wn = (e) => {
|
|
|
2516
2698
|
"bash",
|
|
2517
2699
|
"lua",
|
|
2518
2700
|
"markdown"
|
|
2519
|
-
]),
|
|
2701
|
+
]), Ei = (e) => e && Ti.has(e) ? e : Ci, Di = {
|
|
2520
2702
|
css: () => import("@shikijs/langs/css"),
|
|
2521
2703
|
html: () => import("@shikijs/langs/html"),
|
|
2522
2704
|
xml: () => import("@shikijs/langs/xml"),
|
|
@@ -2537,38 +2719,38 @@ var Wn = (e) => {
|
|
|
2537
2719
|
bash: () => import("@shikijs/langs/shellscript"),
|
|
2538
2720
|
lua: () => import("@shikijs/langs/lua"),
|
|
2539
2721
|
markdown: () => import("@shikijs/langs/markdown")
|
|
2540
|
-
},
|
|
2722
|
+
}, Oi = (e) => e === "bash" ? "shellscript" : e, ki = (e) => e in Di, Ai = null, ji = null, Mi = /* @__PURE__ */ new Map(), Ni = () => (Ai ||= Promise.all([import("@shikijs/core"), import("@shikijs/engine-javascript")]).then(([{ createHighlighterCoreSync: e }, { createJavaScriptRegexEngine: t }]) => e({
|
|
2541
2723
|
engine: t(),
|
|
2542
2724
|
langs: [],
|
|
2543
2725
|
themes: []
|
|
2544
2726
|
})).catch((e) => {
|
|
2545
|
-
throw
|
|
2546
|
-
}),
|
|
2547
|
-
let t =
|
|
2548
|
-
return t || (t =
|
|
2549
|
-
let n =
|
|
2727
|
+
throw Ai = null, e;
|
|
2728
|
+
}), Ai), Pi = (e, t) => ki(t) && e.getLoadedLanguages().includes(Oi(t)), Fi = (e) => {
|
|
2729
|
+
let t = Mi.get(e);
|
|
2730
|
+
return t || (t = Ni().then(async (t) => {
|
|
2731
|
+
let n = Oi(e);
|
|
2550
2732
|
if (!t.getLoadedLanguages().includes(n)) {
|
|
2551
|
-
let n = await
|
|
2733
|
+
let n = await Di[e]();
|
|
2552
2734
|
await t.loadLanguage(n.default);
|
|
2553
2735
|
}
|
|
2554
2736
|
return t;
|
|
2555
2737
|
}).catch((t) => {
|
|
2556
|
-
throw
|
|
2557
|
-
}),
|
|
2558
|
-
},
|
|
2738
|
+
throw Mi.delete(e), t;
|
|
2739
|
+
}), Mi.set(e, t)), t;
|
|
2740
|
+
}, Ii = () => (ji ||= Ni().then(async (e) => {
|
|
2559
2741
|
if (!e.getLoadedThemes().includes("github-light")) {
|
|
2560
2742
|
let t = await import("@shikijs/themes/github-light");
|
|
2561
2743
|
await e.loadTheme(t.default);
|
|
2562
2744
|
}
|
|
2563
2745
|
return e;
|
|
2564
2746
|
}).catch((e) => {
|
|
2565
|
-
throw
|
|
2566
|
-
}),
|
|
2747
|
+
throw ji = null, e;
|
|
2748
|
+
}), ji), Li = (e, t, n) => {
|
|
2567
2749
|
let r = e.getTextContent();
|
|
2568
|
-
if (e.getStyle() && e.setStyle(""), !n || !
|
|
2750
|
+
if (e.getStyle() && e.setStyle(""), !n || !Pi(n, t)) return te(r);
|
|
2569
2751
|
let i = n.codeToTokens(r, {
|
|
2570
|
-
lang:
|
|
2571
|
-
theme:
|
|
2752
|
+
lang: Oi(t),
|
|
2753
|
+
theme: wi
|
|
2572
2754
|
}).tokens, a = [];
|
|
2573
2755
|
return i.forEach((e, t) => {
|
|
2574
2756
|
t && a.push(_e()), e.forEach((e) => {
|
|
@@ -2579,16 +2761,16 @@ var Wn = (e) => {
|
|
|
2579
2761
|
});
|
|
2580
2762
|
});
|
|
2581
2763
|
}), a;
|
|
2582
|
-
},
|
|
2764
|
+
}, Ri = (e, t) => {
|
|
2583
2765
|
let n = F(e);
|
|
2584
|
-
if (!
|
|
2766
|
+
if (!ee(n) || !n.isAttached()) return;
|
|
2585
2767
|
let r = L();
|
|
2586
2768
|
if (!R(r)) {
|
|
2587
2769
|
t();
|
|
2588
2770
|
return;
|
|
2589
2771
|
}
|
|
2590
2772
|
let { anchor: i } = r;
|
|
2591
|
-
if (B(i.getNode(),
|
|
2773
|
+
if (B(i.getNode(), ee) !== n) {
|
|
2592
2774
|
t();
|
|
2593
2775
|
return;
|
|
2594
2776
|
}
|
|
@@ -2608,22 +2790,22 @@ var Wn = (e) => {
|
|
|
2608
2790
|
return !1;
|
|
2609
2791
|
});
|
|
2610
2792
|
}
|
|
2611
|
-
},
|
|
2793
|
+
}, zi = (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), Bi = (e, t) => {
|
|
2612
2794
|
let n = 0;
|
|
2613
|
-
for (; n < e.length &&
|
|
2795
|
+
for (; n < e.length && zi(e[n], t[n]);) n++;
|
|
2614
2796
|
let r = 0, i = Math.min(e.length, t.length) - n;
|
|
2615
|
-
for (; r < i &&
|
|
2797
|
+
for (; r < i && zi(e[e.length - r - 1], t[t.length - r - 1]);) r++;
|
|
2616
2798
|
return {
|
|
2617
2799
|
from: n,
|
|
2618
2800
|
to: e.length - r,
|
|
2619
2801
|
replacement: t.slice(n, t.length - r)
|
|
2620
2802
|
};
|
|
2621
|
-
},
|
|
2622
|
-
let a = i.getKey(), o =
|
|
2803
|
+
}, Vi = (e, t, n, r, i) => {
|
|
2804
|
+
let a = i.getKey(), o = Ei(i.getLanguage());
|
|
2623
2805
|
if (i.getLanguage() !== o && i.setLanguage(o), o === "plaintext") i.getIsSyntaxHighlightSupported() && i.setIsSyntaxHighlightSupported(!1);
|
|
2624
2806
|
else {
|
|
2625
|
-
i.getTheme() !== "github-light" && i.setTheme(
|
|
2626
|
-
let s = t ? t.getLoadedThemes().includes("github-light") ?
|
|
2807
|
+
i.getTheme() !== "github-light" && i.setTheme(wi);
|
|
2808
|
+
let s = t ? t.getLoadedThemes().includes("github-light") ? ki(o) && !Pi(t, o) ? Fi(o) : null : Ii() : Ni();
|
|
2627
2809
|
if (s) {
|
|
2628
2810
|
i.getIsSyntaxHighlightSupported() && i.setIsSyntaxHighlightSupported(!1), n.pendingKeys.add(a), n.loading !== s && (n.loading = s, s.then((t) => {
|
|
2629
2811
|
r(t);
|
|
@@ -2638,30 +2820,30 @@ var Wn = (e) => {
|
|
|
2638
2820
|
}
|
|
2639
2821
|
n.nodesCurrentlyHighlighting.has(a) || (n.nodesCurrentlyHighlighting.add(a), n.didTransform || (n.didTransform = !0, De(() => {
|
|
2640
2822
|
n.didTransform = !1, n.nodesCurrentlyHighlighting.clear();
|
|
2641
|
-
})),
|
|
2823
|
+
})), Ri(a, () => {
|
|
2642
2824
|
let e = F(a);
|
|
2643
|
-
if (!
|
|
2644
|
-
let n =
|
|
2825
|
+
if (!ee(e) || !e.isAttached()) return !1;
|
|
2826
|
+
let n = Li(e, Ei(e.getLanguage()), t), { from: r, to: i, replacement: o } = Bi(e.getChildren(), n);
|
|
2645
2827
|
return r === i && o.length === 0 ? !1 : (e.splice(r, i - r, o), !0);
|
|
2646
2828
|
}));
|
|
2647
|
-
},
|
|
2829
|
+
}, Hi = () => {
|
|
2648
2830
|
let [e] = z();
|
|
2649
2831
|
return s(() => {
|
|
2650
|
-
if (!e.hasNodes([
|
|
2832
|
+
if (!e.hasNodes([M, j])) throw Error("CodeHighlightPlugin: code nodes are not registered");
|
|
2651
2833
|
let t = null, n = {
|
|
2652
2834
|
didTransform: !1,
|
|
2653
2835
|
nodesCurrentlyHighlighting: /* @__PURE__ */ new Set(),
|
|
2654
2836
|
pendingKeys: /* @__PURE__ */ new Set(),
|
|
2655
2837
|
loading: null
|
|
2656
|
-
}, r = (r) =>
|
|
2838
|
+
}, r = (r) => Vi(e, t, n, (e) => {
|
|
2657
2839
|
t = e;
|
|
2658
2840
|
}, r), i = (e) => {
|
|
2659
2841
|
let t = e.getParent();
|
|
2660
|
-
|
|
2842
|
+
ee(t) ? r(t) : A(e) && e.replace(ye(e.__text));
|
|
2661
2843
|
};
|
|
2662
|
-
return Ke(ne(e), e.registerNodeTransform(
|
|
2844
|
+
return Ke(ne(e), e.registerNodeTransform(M, r), e.registerNodeTransform(We, i), e.registerNodeTransform(j, i));
|
|
2663
2845
|
}, [e]), null;
|
|
2664
|
-
},
|
|
2846
|
+
}, Ui = () => {
|
|
2665
2847
|
let [e] = z();
|
|
2666
2848
|
return s(() => (he(e, !0), rt(pe(e), me(e, !1), fe(e), e.registerNodeTransform(le, (e) => {
|
|
2667
2849
|
e.getBackgroundColor() !== null && e.setBackgroundColor(null);
|
|
@@ -2692,8 +2874,8 @@ var Wn = (e) => {
|
|
|
2692
2874
|
}
|
|
2693
2875
|
return !0;
|
|
2694
2876
|
}, Ae))), [e]), null;
|
|
2695
|
-
},
|
|
2696
|
-
let [f] = z(), { t: h } = e(), g =
|
|
2877
|
+
}, Wi = ({ value: n, onChange: r, open: i, onOpenChange: a, toolbar: o, upload: c, ai: l }) => {
|
|
2878
|
+
let [f] = z(), { t: h } = e(), g = Si(), [_, v] = d(!1), y = i ?? _, b = (e) => {
|
|
2697
2879
|
a?.(e), i === void 0 && v(e);
|
|
2698
2880
|
}, [x, S] = d(null), [C, w] = d(() => ({
|
|
2699
2881
|
fontColor: g.fontColor,
|
|
@@ -2702,21 +2884,21 @@ var Wn = (e) => {
|
|
|
2702
2884
|
f.getEditorState().read(() => {
|
|
2703
2885
|
O.current = L()?.clone() ?? null;
|
|
2704
2886
|
});
|
|
2705
|
-
}, { linkForm: A, openLink:
|
|
2887
|
+
}, { linkForm: A, openLink: ee, confirmLink: te, closeLink: j } = ur({
|
|
2706
2888
|
editor: f,
|
|
2707
2889
|
savedSelectionRef: O,
|
|
2708
2890
|
captureSelection: k
|
|
2709
|
-
}), [
|
|
2891
|
+
}), [M] = d(() => /* @__PURE__ */ new Map()), { fileInputRef: ne, uploadProgress: re, insertImage: ie, onFileChange: ae, abortUpload: oe } = lr({
|
|
2710
2892
|
editor: f,
|
|
2711
2893
|
upload: c,
|
|
2712
2894
|
savedSelectionRef: O,
|
|
2713
|
-
attachmentsBySrc:
|
|
2714
|
-
}), se =
|
|
2895
|
+
attachmentsBySrc: M
|
|
2896
|
+
}), se = dr({
|
|
2715
2897
|
editor: f,
|
|
2716
2898
|
value: n,
|
|
2717
2899
|
onChange: r,
|
|
2718
|
-
attachmentsBySrc:
|
|
2719
|
-
}), N =
|
|
2900
|
+
attachmentsBySrc: M
|
|
2901
|
+
}), N = Qn({
|
|
2720
2902
|
editor: f,
|
|
2721
2903
|
ai: l
|
|
2722
2904
|
}), [ce, le] = d(0), ue = o?.config ?? pt;
|
|
@@ -2732,7 +2914,7 @@ var Wn = (e) => {
|
|
|
2732
2914
|
g.hasRangeSelection
|
|
2733
2915
|
]);
|
|
2734
2916
|
let de = () => {
|
|
2735
|
-
oe(), N.close(), S(null),
|
|
2917
|
+
oe(), N.close(), S(null), j(), D(!1), b(!1);
|
|
2736
2918
|
};
|
|
2737
2919
|
s(() => {
|
|
2738
2920
|
if (!y) return;
|
|
@@ -2761,7 +2943,7 @@ var Wn = (e) => {
|
|
|
2761
2943
|
onClose: de,
|
|
2762
2944
|
position: "bottom",
|
|
2763
2945
|
closeOnClickOverlay: !0,
|
|
2764
|
-
children: /* @__PURE__ */ p(
|
|
2946
|
+
children: /* @__PURE__ */ p($n.Provider, {
|
|
2765
2947
|
value: re,
|
|
2766
2948
|
children: /* @__PURE__ */ m("div", {
|
|
2767
2949
|
className: V["bsy-mobile-editor"],
|
|
@@ -2785,7 +2967,7 @@ var Wn = (e) => {
|
|
|
2785
2967
|
ErrorBoundary: $e
|
|
2786
2968
|
})
|
|
2787
2969
|
}),
|
|
2788
|
-
ue.length > 0 ? /* @__PURE__ */ p(
|
|
2970
|
+
ue.length > 0 ? /* @__PURE__ */ p(bi, {
|
|
2789
2971
|
config: ue,
|
|
2790
2972
|
formats: g,
|
|
2791
2973
|
colorValues: C,
|
|
@@ -2799,17 +2981,17 @@ var Wn = (e) => {
|
|
|
2799
2981
|
};
|
|
2800
2982
|
})), S(e);
|
|
2801
2983
|
},
|
|
2802
|
-
onOpenLink:
|
|
2984
|
+
onOpenLink: ee
|
|
2803
2985
|
}) : null,
|
|
2804
2986
|
/* @__PURE__ */ p(Je, {}),
|
|
2805
2987
|
/* @__PURE__ */ p(Xe, {}),
|
|
2806
2988
|
/* @__PURE__ */ p(Ye, {}),
|
|
2807
|
-
/* @__PURE__ */ p(
|
|
2808
|
-
/* @__PURE__ */ p(
|
|
2809
|
-
/* @__PURE__ */ p(
|
|
2810
|
-
/* @__PURE__ */ p(
|
|
2811
|
-
/* @__PURE__ */ p(
|
|
2812
|
-
/* @__PURE__ */ p(
|
|
2989
|
+
/* @__PURE__ */ p(pr, {}),
|
|
2990
|
+
/* @__PURE__ */ p(yr, {}),
|
|
2991
|
+
/* @__PURE__ */ p(hr, {}),
|
|
2992
|
+
/* @__PURE__ */ p(_r, {}),
|
|
2993
|
+
/* @__PURE__ */ p(Hi, {}),
|
|
2994
|
+
/* @__PURE__ */ p(Ui, {}),
|
|
2813
2995
|
/* @__PURE__ */ p(Ze, {
|
|
2814
2996
|
onChange: se,
|
|
2815
2997
|
ignoreSelectionChange: !0
|
|
@@ -2821,7 +3003,7 @@ var Wn = (e) => {
|
|
|
2821
3003
|
hidden: !0,
|
|
2822
3004
|
onChange: ae
|
|
2823
3005
|
}),
|
|
2824
|
-
/* @__PURE__ */ p(
|
|
3006
|
+
/* @__PURE__ */ p(Br, {
|
|
2825
3007
|
sheet: x,
|
|
2826
3008
|
onClose: () => {
|
|
2827
3009
|
if (T.current) {
|
|
@@ -2851,20 +3033,20 @@ var Wn = (e) => {
|
|
|
2851
3033
|
canTypeset: !!l?.typeset,
|
|
2852
3034
|
canPolish: !!l?.polish
|
|
2853
3035
|
}),
|
|
2854
|
-
/* @__PURE__ */ p(
|
|
3036
|
+
/* @__PURE__ */ p(Hr, {
|
|
2855
3037
|
open: A !== null,
|
|
2856
3038
|
seed: A,
|
|
2857
|
-
onClose:
|
|
2858
|
-
onConfirm:
|
|
3039
|
+
onClose: j,
|
|
3040
|
+
onConfirm: te
|
|
2859
3041
|
}),
|
|
2860
|
-
/* @__PURE__ */ p(
|
|
3042
|
+
/* @__PURE__ */ p(Wr, {
|
|
2861
3043
|
open: E,
|
|
2862
3044
|
onClose: () => D(!1),
|
|
2863
3045
|
onConfirm: (e) => {
|
|
2864
3046
|
ie(e, "", e), D(!1);
|
|
2865
3047
|
}
|
|
2866
3048
|
}),
|
|
2867
|
-
/* @__PURE__ */ p(
|
|
3049
|
+
/* @__PURE__ */ p(ni, {
|
|
2868
3050
|
open: N.mode !== null,
|
|
2869
3051
|
mode: N.mode,
|
|
2870
3052
|
originalHtml: N.snapshot.html,
|
|
@@ -2879,10 +3061,10 @@ var Wn = (e) => {
|
|
|
2879
3061
|
})
|
|
2880
3062
|
})
|
|
2881
3063
|
});
|
|
2882
|
-
},
|
|
3064
|
+
}, Gi = "1px solid #d9d9d9", Ki = { export: new Map([[le, (e, t) => {
|
|
2883
3065
|
let n = t.exportDOM(e);
|
|
2884
|
-
return Ge(n.element) && (n.element.style.border =
|
|
2885
|
-
}]]) },
|
|
3066
|
+
return Ge(n.element) && (n.element.style.border = Gi), n;
|
|
3067
|
+
}]]) }, qi = class e extends x {
|
|
2886
3068
|
constructor(e = "", t = {}, n) {
|
|
2887
3069
|
super(e, t, n);
|
|
2888
3070
|
}
|
|
@@ -2897,12 +3079,12 @@ var Wn = (e) => {
|
|
|
2897
3079
|
}, t.__key);
|
|
2898
3080
|
}
|
|
2899
3081
|
static importJSON(e) {
|
|
2900
|
-
return
|
|
3082
|
+
return Ji().updateFromJSON(e);
|
|
2901
3083
|
}
|
|
2902
3084
|
sanitizeUrl(e) {
|
|
2903
3085
|
return e.startsWith("@") ? e : super.sanitizeUrl(e);
|
|
2904
3086
|
}
|
|
2905
|
-
},
|
|
3087
|
+
}, Ji = (e = "", t = {}) => ge(new qi(e, t)), Yi = {
|
|
2906
3088
|
namespace: "bsyLexicalEditor",
|
|
2907
3089
|
onError: (e) => {
|
|
2908
3090
|
console.error("Lexical error", e);
|
|
@@ -2935,28 +3117,28 @@ var Wn = (e) => {
|
|
|
2935
3117
|
tableRow: "editor-table-row",
|
|
2936
3118
|
tableScrollableWrapper: "editor-table-scrollable-wrapper"
|
|
2937
3119
|
},
|
|
2938
|
-
html:
|
|
3120
|
+
html: Ki,
|
|
2939
3121
|
nodes: [
|
|
2940
|
-
|
|
3122
|
+
qi,
|
|
2941
3123
|
{
|
|
2942
3124
|
replace: x,
|
|
2943
|
-
with: (e) => new
|
|
3125
|
+
with: (e) => new qi(e.__url, {
|
|
2944
3126
|
rel: e.__rel,
|
|
2945
3127
|
target: e.__target,
|
|
2946
3128
|
title: e.__title
|
|
2947
3129
|
}),
|
|
2948
|
-
withKlass:
|
|
3130
|
+
withKlass: qi
|
|
2949
3131
|
},
|
|
2950
3132
|
b,
|
|
2951
3133
|
D,
|
|
2952
3134
|
E,
|
|
2953
3135
|
ae,
|
|
2954
|
-
te,
|
|
2955
3136
|
M,
|
|
3137
|
+
j,
|
|
2956
3138
|
ue,
|
|
2957
3139
|
de,
|
|
2958
3140
|
le,
|
|
2959
|
-
|
|
3141
|
+
rr,
|
|
2960
3142
|
q,
|
|
2961
3143
|
{
|
|
2962
3144
|
replace: We,
|
|
@@ -2964,10 +3146,10 @@ var Wn = (e) => {
|
|
|
2964
3146
|
withKlass: q
|
|
2965
3147
|
}
|
|
2966
3148
|
]
|
|
2967
|
-
},
|
|
2968
|
-
initialConfig:
|
|
2969
|
-
children: /* @__PURE__ */ p(
|
|
3149
|
+
}, Xi = (e) => /* @__PURE__ */ p(g, {
|
|
3150
|
+
initialConfig: Yi,
|
|
3151
|
+
children: /* @__PURE__ */ p(Wi, { ...e })
|
|
2970
3152
|
});
|
|
2971
|
-
|
|
3153
|
+
Xi.displayName = "BsyMobileEditor";
|
|
2972
3154
|
//#endregion
|
|
2973
|
-
export {
|
|
3155
|
+
export { Kr as n, Xi as t };
|