@sia.soul/sia-react-ui 0.1.166 → 0.1.167

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.
Files changed (40) hide show
  1. package/dist/chart.cjs +4553 -4513
  2. package/dist/chart.d.cts +1850 -1843
  3. package/dist/chart.d.ts +1850 -1843
  4. package/dist/chart.js +1 -1
  5. package/dist/chunk-2FZI7TP6.js +0 -0
  6. package/dist/{chunk-T2F6X3LA.js → chunk-5CGJVE4C.js} +26 -22
  7. package/dist/{chunk-2EC653G5.js → chunk-5KTQXNGL.js} +2 -2
  8. package/dist/{chunk-NHGCGOF2.js → chunk-A7TLMWMM.js} +4754 -4714
  9. package/dist/{chunk-G5EJJFUI.js → chunk-FSO46WEJ.js} +14 -6
  10. package/dist/{chunk-SX4LLT3H.js → chunk-KDNOLFDJ.js} +2 -2
  11. package/dist/{chunk-DKQ5UCN6.js → chunk-S6FA6NN3.js} +519 -220
  12. package/dist/{chunk-23FQ5ARA.js → chunk-XS7AVCHO.js} +27 -17
  13. package/dist/{core-Cnt8r6pj.d.cts → core-C7Was4Vc.d.cts} +6 -9
  14. package/dist/{core-Dy8NWJ1b.d.ts → core-D7C32Rdq.d.ts} +6 -9
  15. package/dist/core.cjs +83 -61
  16. package/dist/core.css +3135 -5340
  17. package/dist/core.d.cts +1 -1
  18. package/dist/core.d.ts +1 -1
  19. package/dist/core.js +4 -4
  20. package/dist/game.cjs +14 -6
  21. package/dist/game.css +1666 -3147
  22. package/dist/game.js +1 -1
  23. package/dist/index.cjs +6625 -6197
  24. package/dist/index.css +8733 -8560
  25. package/dist/index.d.cts +126 -110
  26. package/dist/index.d.ts +126 -110
  27. package/dist/index.js +817 -749
  28. package/dist/markdown-editor.css +461 -0
  29. package/dist/markdown-editor.js +2 -1
  30. package/dist/rich-text-editor.cjs +38 -20
  31. package/dist/rich-text-editor.css +461 -0
  32. package/dist/rich-text-editor.js +4 -3
  33. package/dist/{select-date-range-E1N5-oXv.d.ts → select-date-range-AOleKBXc.d.ts} +6 -9
  34. package/dist/{select-date-range-BnlISSPV.d.cts → select-date-range-BtTkMElI.d.cts} +6 -9
  35. package/dist/select-date-range.cjs +529 -222
  36. package/dist/select-date-range.d.cts +1 -1
  37. package/dist/select-date-range.d.ts +1 -1
  38. package/dist/select-date-range.js +4 -4
  39. package/package.json +5 -1
  40. /package/dist/{chunk-V4I32DPL.js → chunk-GKWSCL5Q.js} +0 -0
@@ -1,3 +1,464 @@
1
+ /* src/editors.css */
2
+ .sia-rich-text-editor {
3
+ --sia-rich-text-min-height: 150px;
4
+ min-height: 0;
5
+ display: flex;
6
+ flex-direction: column;
7
+ overflow: hidden;
8
+ color: var(--sia-color-text);
9
+ background: var(--sia-color-surface);
10
+ border: 1px solid var(--sia-color-border);
11
+ border-radius: var(--sia-radius);
12
+ transition: border-color 160ms ease, box-shadow 160ms ease;
13
+ }
14
+ .sia-rich-text-editor:hover:not(.is-disabled) {
15
+ border-color: var(--sia-color-primary-hover);
16
+ }
17
+ .sia-rich-text-editor:focus-within:not(.is-disabled) {
18
+ border-color: var(--sia-color-primary);
19
+ }
20
+ .sia-rich-text-editor.is-disabled {
21
+ color: var(--sia-color-text-secondary);
22
+ background: var(--sia-color-control-disabled);
23
+ border-color: var(--sia-color-border-disabled);
24
+ }
25
+ .sia-rich-text-editor__toolbar {
26
+ position: relative;
27
+ z-index: 2;
28
+ display: flex;
29
+ min-height: 44px;
30
+ align-items: flex-start;
31
+ justify-content: space-between;
32
+ gap: 6px 10px;
33
+ padding: 5px 8px;
34
+ background: var(--sia-color-surface);
35
+ border-bottom: 1px solid var(--sia-color-border);
36
+ }
37
+ .sia-rich-text-editor__toolbar-main {
38
+ min-width: 0;
39
+ display: flex;
40
+ align-items: center;
41
+ flex: 1;
42
+ flex-wrap: wrap;
43
+ gap: 2px;
44
+ }
45
+ .sia-rich-text-editor__toolbar small {
46
+ display: inline-flex;
47
+ flex-shrink: 0;
48
+ align-items: center;
49
+ gap: 5px;
50
+ color: var(--sia-color-text-secondary);
51
+ white-space: nowrap;
52
+ }
53
+ .sia-rich-text-editor__tool {
54
+ min-width: 30px;
55
+ height: 30px;
56
+ padding-inline: 8px;
57
+ border-radius: 5px;
58
+ }
59
+ .sia-rich-text-editor__tool.is-active {
60
+ color: var(--sia-color-primary-text);
61
+ background: var(--sia-color-primary-light);
62
+ }
63
+ .sia-rich-text-editor__divider {
64
+ width: 1px;
65
+ height: 20px;
66
+ margin-inline: 4px;
67
+ background: var(--sia-color-border);
68
+ }
69
+ .sia-rich-text-editor__block-type {
70
+ min-width: 70px;
71
+ height: 30px;
72
+ padding-inline: 8px;
73
+ }
74
+ .sia-rich-text-editor__block-type > span {
75
+ display: inline-flex;
76
+ align-items: center;
77
+ justify-content: space-between;
78
+ gap: 5px;
79
+ width: 100%;
80
+ }
81
+ .sia-rich-text-editor__link-popup {
82
+ min-width: min(360px, calc(100vw - 24px));
83
+ padding: 8px;
84
+ background: var(--sia-color-surface);
85
+ border: 1px solid var(--sia-color-border);
86
+ border-radius: calc(var(--sia-radius) + 2px);
87
+ box-shadow: var(--sia-shadow-popup);
88
+ }
89
+ .sia-rich-text-editor__link-form {
90
+ display: grid;
91
+ grid-template-columns: minmax(180px, 1fr) auto auto;
92
+ align-items: center;
93
+ gap: 6px;
94
+ }
95
+ .sia-rich-text-editor__link-form .sia-field {
96
+ min-width: 0;
97
+ }
98
+ .sia-rich-text-editor__table-toolbar {
99
+ position: relative;
100
+ z-index: 1;
101
+ display: flex;
102
+ min-height: 38px;
103
+ align-items: center;
104
+ flex-wrap: wrap;
105
+ gap: 2px;
106
+ padding: 4px 10px;
107
+ color: var(--sia-color-text-secondary);
108
+ background: var(--sia-color-control-hover);
109
+ border-bottom: 1px solid var(--sia-color-border);
110
+ }
111
+ .sia-rich-text-editor__table-toolbar > span:first-child {
112
+ margin-right: 5px;
113
+ font-size: 12px;
114
+ font-weight: 600;
115
+ }
116
+ .sia-rich-text-editor__content {
117
+ min-height: 0;
118
+ flex: 1;
119
+ overflow: var(--sia-scroll-overflow, auto);
120
+ overscroll-behavior: contain;
121
+ }
122
+ .sia-rich-text-editor__content > .ProseMirror {
123
+ min-height: var(--sia-rich-text-min-height);
124
+ padding: 16px 18px;
125
+ outline: none;
126
+ font:
127
+ 400 var(--sia-font-size)/1.75 system-ui,
128
+ -apple-system,
129
+ "Segoe UI",
130
+ "Microsoft YaHei",
131
+ sans-serif;
132
+ overflow-wrap: anywhere;
133
+ }
134
+ .sia-rich-text-editor__content > .ProseMirror p.is-editor-empty:first-child::before {
135
+ float: left;
136
+ height: 0;
137
+ color: var(--sia-color-text-secondary);
138
+ pointer-events: none;
139
+ content: attr(data-placeholder);
140
+ opacity: .65;
141
+ }
142
+ .sia-rich-text-editor__content :is(p, ul, ol, blockquote, pre, table) {
143
+ margin: 0 0 12px;
144
+ }
145
+ .sia-rich-text-editor__content :is(h1, h2, h3, h4, h5, h6) {
146
+ margin: 1.35em 0 .55em;
147
+ color: var(--sia-color-text);
148
+ line-height: 1.3;
149
+ }
150
+ .sia-rich-text-editor__content h1 {
151
+ font-size: 2em;
152
+ }
153
+ .sia-rich-text-editor__content h2 {
154
+ padding-bottom: .25em;
155
+ border-bottom: 1px solid var(--sia-color-border);
156
+ font-size: 1.55em;
157
+ }
158
+ .sia-rich-text-editor__content h3 {
159
+ font-size: 1.3em;
160
+ }
161
+ .sia-rich-text-editor__content :is(ul, ol) {
162
+ padding-inline-start: 26px;
163
+ }
164
+ .sia-rich-text-editor__content ul[data-type=taskList] {
165
+ padding-inline-start: 0;
166
+ list-style: none;
167
+ }
168
+ .sia-rich-text-editor__content ul[data-type=taskList] li {
169
+ display: flex;
170
+ align-items: flex-start;
171
+ gap: 7px;
172
+ }
173
+ .sia-rich-text-editor__content ul[data-type=taskList] li > label {
174
+ margin-top: 4px;
175
+ }
176
+ .sia-rich-text-editor__content ul[data-type=taskList] li > div {
177
+ min-width: 0;
178
+ flex: 1;
179
+ }
180
+ .sia-rich-text-editor__content blockquote {
181
+ padding: 6px 12px;
182
+ color: var(--sia-color-text-secondary);
183
+ border-left: 3px solid var(--sia-color-primary);
184
+ background: var(--sia-color-control-hover);
185
+ }
186
+ .sia-rich-text-editor__content pre {
187
+ padding: 14px 16px;
188
+ overflow-x: var(--sia-scroll-overflow, auto);
189
+ color: var(--sia-color-text);
190
+ background: var(--sia-color-control-hover);
191
+ border-radius: 7px;
192
+ }
193
+ .sia-rich-text-editor__content code {
194
+ padding: .12em .35em;
195
+ background: var(--sia-color-control-hover);
196
+ border-radius: 4px;
197
+ font-family:
198
+ "SFMono-Regular",
199
+ Consolas,
200
+ monospace;
201
+ }
202
+ .sia-rich-text-editor__content pre code {
203
+ padding: 0;
204
+ background: transparent;
205
+ }
206
+ .sia-rich-text-editor__content table {
207
+ width: 100%;
208
+ table-layout: fixed;
209
+ border-collapse: collapse;
210
+ }
211
+ .sia-rich-text-editor__content :is(th, td) {
212
+ position: relative;
213
+ min-width: 80px;
214
+ padding: 8px 10px;
215
+ vertical-align: top;
216
+ border: 1px solid var(--sia-color-border);
217
+ }
218
+ .sia-rich-text-editor__content th {
219
+ font-weight: 600;
220
+ background: var(--sia-color-control-hover);
221
+ }
222
+ .sia-rich-text-editor__content .selectedCell::after {
223
+ position: absolute;
224
+ inset: 0;
225
+ z-index: 0;
226
+ pointer-events: none;
227
+ content: "";
228
+ background: color-mix(in srgb, var(--sia-color-primary) 14%, transparent);
229
+ }
230
+ .sia-rich-text-editor__content .column-resize-handle {
231
+ position: absolute;
232
+ top: 0;
233
+ right: -2px;
234
+ bottom: -2px;
235
+ width: 4px;
236
+ pointer-events: none;
237
+ background: var(--sia-color-primary);
238
+ }
239
+ .sia-rich-text-editor__content img,
240
+ .sia-rich-text-content img {
241
+ display: block;
242
+ max-width: 100%;
243
+ height: auto;
244
+ margin: 12px 0;
245
+ border: 1px solid var(--sia-color-border);
246
+ border-radius: 7px;
247
+ }
248
+ @media (max-width: 640px) {
249
+ .sia-rich-text-editor__toolbar {
250
+ align-items: stretch;
251
+ flex-direction: column;
252
+ }
253
+ .sia-rich-text-editor__toolbar small {
254
+ padding-inline: 4px;
255
+ }
256
+ .sia-rich-text-editor__link-form {
257
+ grid-template-columns: minmax(0, 1fr) auto;
258
+ }
259
+ .sia-rich-text-editor__link-form .sia-field {
260
+ grid-column: 1 / -1;
261
+ }
262
+ }
263
+ .sia-rich-text-content {
264
+ color: inherit;
265
+ font: inherit;
266
+ line-height: 1.75;
267
+ overflow-wrap: anywhere;
268
+ }
269
+ .sia-rich-text-content > :first-child {
270
+ margin-top: 0;
271
+ }
272
+ .sia-rich-text-content > :last-child {
273
+ margin-bottom: 0;
274
+ }
275
+ .sia-rich-text-content--empty {
276
+ color: var(--sia-color-text-secondary);
277
+ }
278
+ .sia-markdown-editor {
279
+ position: relative;
280
+ display: flex;
281
+ min-width: 0;
282
+ min-height: var(--sia-markdown-editor-min-height, 320px);
283
+ height: 100%;
284
+ overflow: visible;
285
+ color: var(--sia-color-text);
286
+ background: var(--sia-color-surface);
287
+ }
288
+ .sia-markdown-editor__mount,
289
+ .sia-markdown-editor__mount > .vditor {
290
+ width: 100%;
291
+ min-width: 0;
292
+ min-height: 0;
293
+ height: 100% !important;
294
+ }
295
+ .sia-markdown-editor__mount > .vditor {
296
+ display: flex;
297
+ flex-direction: column;
298
+ overflow: visible;
299
+ border-color: var(--sia-color-border);
300
+ border-radius: var(--sia-radius);
301
+ background: var(--sia-color-surface);
302
+ }
303
+ .sia-markdown-editor .vditor-toolbar {
304
+ position: relative;
305
+ z-index: 5;
306
+ flex: 0 0 auto;
307
+ min-height: 44px;
308
+ overflow: visible;
309
+ padding: 6px 10px !important;
310
+ border-color: var(--sia-color-border);
311
+ background: var(--sia-color-surface);
312
+ }
313
+ .sia-markdown-editor .vditor-toolbar__item {
314
+ margin: 1px;
315
+ }
316
+ .sia-markdown-editor .vditor-content {
317
+ flex: 1 1 auto;
318
+ min-width: 0;
319
+ min-height: 0;
320
+ height: auto !important;
321
+ overflow: hidden;
322
+ background: var(--sia-color-surface);
323
+ }
324
+ .sia-markdown-editor :where(.vditor-emojis, .vditor-preview, .vditor-devtools, .vditor-img__img, .vditor-hint, .vditor-reset, .vditor-outline, .vditor-sv) {
325
+ overflow: var(--sia-scroll-overflow, auto);
326
+ }
327
+ .sia-markdown-editor .vditor-reset,
328
+ .sia-markdown-editor .vditor-preview,
329
+ .sia-markdown-editor .vditor-wysiwyg,
330
+ .sia-markdown-editor .vditor-ir,
331
+ .sia-markdown-editor .vditor-sv {
332
+ background: var(--sia-color-surface);
333
+ }
334
+ .sia-markdown-editor .vditor-wysiwyg,
335
+ .sia-markdown-editor .vditor-ir {
336
+ min-height: 100%;
337
+ padding: 0 !important;
338
+ font-size: 16px;
339
+ line-height: 1.8;
340
+ }
341
+ .sia-markdown-editor .vditor-wysiwyg > .vditor-reset,
342
+ .sia-markdown-editor .vditor-ir > .vditor-reset,
343
+ .sia-markdown-editor .vditor-sv {
344
+ padding: 24px 28px 64px !important;
345
+ }
346
+ .sia-markdown-editor .vditor-preview {
347
+ padding: 24px 28px 64px;
348
+ }
349
+ .sia-markdown-editor .vditor-reset ol {
350
+ padding-inline-start: 2em;
351
+ list-style: decimal outside;
352
+ }
353
+ .sia-markdown-editor .vditor-reset ol ol {
354
+ list-style-type: lower-alpha;
355
+ }
356
+ .sia-markdown-editor .vditor-reset ol ol ol {
357
+ list-style-type: lower-roman;
358
+ }
359
+ .sia-markdown-editor .vditor-reset li:not(.vditor-task) {
360
+ display: list-item;
361
+ }
362
+ .sia-markdown-editor .vditor-reset a,
363
+ .sia-markdown-editor .vditor-wysiwyg a,
364
+ .sia-markdown-editor .vditor-ir__node:not(.vditor-ir__node--expand)[data-type=a] {
365
+ color: var(--sia-color-primary-text, #1677ff);
366
+ text-decoration: underline;
367
+ text-decoration-thickness: from-font;
368
+ text-underline-offset: 2px;
369
+ }
370
+ .sia-markdown-editor .vditor-reset a:hover,
371
+ .sia-markdown-editor .vditor-wysiwyg a:hover {
372
+ color: var(--sia-color-primary-hover, #4096ff);
373
+ }
374
+ .sia-markdown-editor .vditor-counter {
375
+ right: 12px;
376
+ bottom: 8px;
377
+ color: var(--sia-color-text-secondary);
378
+ }
379
+ .sia-markdown-editor__loading {
380
+ position: absolute;
381
+ inset: 0;
382
+ display: grid;
383
+ place-items: center;
384
+ color: var(--sia-color-text-secondary);
385
+ background: var(--sia-color-surface);
386
+ pointer-events: none;
387
+ }
388
+ @media (max-width: 768px) {
389
+ .sia-markdown-editor .vditor-wysiwyg > .vditor-reset,
390
+ .sia-markdown-editor .vditor-ir > .vditor-reset,
391
+ .sia-markdown-editor .vditor-sv,
392
+ .sia-markdown-editor .vditor-preview {
393
+ padding: 18px 16px 56px !important;
394
+ }
395
+ }
396
+ .sia-editor-control {
397
+ position: relative;
398
+ width: 100%;
399
+ height: 100%;
400
+ min-width: 0;
401
+ min-height: 180px;
402
+ overflow: hidden;
403
+ color: var(--sia-color-text);
404
+ background: var(--sia-color-surface);
405
+ }
406
+ .sia-editor-control__surface {
407
+ width: 100%;
408
+ height: 100%;
409
+ }
410
+ .sia-editor-control__selection-drop-caret {
411
+ display: block;
412
+ width: 2px;
413
+ height: 23px;
414
+ pointer-events: none;
415
+ background: var(--vscode-editorCursor-foreground, var(--sia-color-primary));
416
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--vscode-editor-background, var(--sia-color-surface)) 35%, transparent);
417
+ }
418
+ .sia-editor-control__context-menu {
419
+ display: flex;
420
+ width: 100%;
421
+ height: 100%;
422
+ min-width: 0;
423
+ min-height: 0;
424
+ }
425
+ .sia-editor-control__context-menu > .sia-editor-control {
426
+ flex: 1;
427
+ min-height: 0;
428
+ }
429
+ .sia-editor-control__range-highlight {
430
+ position: absolute;
431
+ z-index: 3;
432
+ display: none;
433
+ box-sizing: border-box;
434
+ pointer-events: none;
435
+ border: 1px dashed color-mix(in srgb, var(--sia-color-primary) 42%, var(--sia-color-border));
436
+ border-radius: 3px;
437
+ background: color-mix(in srgb, var(--sia-color-primary) 4%, transparent);
438
+ }
439
+ .sia-editor-control__range-highlight[data-visible=true] {
440
+ display: block;
441
+ }
442
+ .sia-editor-control__loading {
443
+ position: absolute;
444
+ inset: 0;
445
+ display: flex;
446
+ align-items: center;
447
+ justify-content: center;
448
+ gap: 9px;
449
+ color: var(--sia-color-text-secondary);
450
+ background: var(--sia-color-surface);
451
+ font-size: 12px;
452
+ }
453
+ .sia-editor-control__loading span {
454
+ width: 14px;
455
+ height: 14px;
456
+ border: 2px solid var(--sia-color-border);
457
+ border-top-color: var(--sia-color-primary);
458
+ border-radius: 50%;
459
+ animation: sia-spin 700ms linear infinite;
460
+ }
461
+
1
462
  /* src/title-tooltip.css */
2
463
  body > .sia-title-tooltip[data-sia-popup-layer] {
3
464
  position: fixed;
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  MarkdownEditor
3
- } from "./chunk-V4I32DPL.js";
3
+ } from "./chunk-GKWSCL5Q.js";
4
+ import "./chunk-2FZI7TP6.js";
4
5
  import "./chunk-OHAESA5R.js";
5
6
  import {
6
7
  initializeDefaultScrollbars
@@ -2769,7 +2769,7 @@ var placementMap = {
2769
2769
  topLeft: "top-start",
2770
2770
  topRight: "top-end"
2771
2771
  };
2772
- function DropdownInternal({
2772
+ var DropdownInternal = (0, import_react12.forwardRef)(function DropdownInternal2({
2773
2773
  popupAnchorRef,
2774
2774
  menu,
2775
2775
  children,
@@ -2794,8 +2794,13 @@ function DropdownInternal({
2794
2794
  onContextMenu,
2795
2795
  onKeyDown,
2796
2796
  ...props
2797
- }) {
2797
+ }, forwardedRef) {
2798
2798
  const rootRef = (0, import_react12.useRef)(null);
2799
+ function setRootRef(node) {
2800
+ rootRef.current = node;
2801
+ if (typeof forwardedRef === "function") forwardedRef(node);
2802
+ else if (forwardedRef) forwardedRef.current = node;
2803
+ }
2799
2804
  const contextAnchorRef = (0, import_react12.useRef)(null);
2800
2805
  const popupRef = (0, import_react12.useRef)(null);
2801
2806
  const menuListRef = (0, import_react12.useRef)(null);
@@ -2947,7 +2952,7 @@ function DropdownInternal({
2947
2952
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2948
2953
  "span",
2949
2954
  {
2950
- ref: rootRef,
2955
+ ref: setRootRef,
2951
2956
  className: `sia-dropdown${visible ? " is-open" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(),
2952
2957
  "aria-expanded": visible,
2953
2958
  "aria-haspopup": "menu",
@@ -3003,11 +3008,11 @@ function DropdownInternal({
3003
3008
  ]
3004
3009
  }
3005
3010
  );
3006
- }
3007
- function DropdownRoot(props) {
3008
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownInternal, { ...props });
3009
- }
3010
- function DropdownButton({
3011
+ });
3012
+ var DropdownRoot = (0, import_react12.forwardRef)(function Dropdown(props, forwardedRef) {
3013
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownInternal, { ref: forwardedRef, ...props });
3014
+ });
3015
+ var DropdownButton = (0, import_react12.forwardRef)(function DropdownButton2({
3011
3016
  children,
3012
3017
  className = "",
3013
3018
  buttonProps,
@@ -3017,9 +3022,14 @@ function DropdownButton({
3017
3022
  dropdownDisabled,
3018
3023
  trigger = ["click"],
3019
3024
  ...dropdownProps
3020
- }) {
3025
+ }, forwardedRef) {
3021
3026
  const groupRef = (0, import_react12.useRef)(null);
3022
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { ref: groupRef, className: `sia-dropdown-button ${className}`.trim(), children: [
3027
+ function setGroupRef(node) {
3028
+ groupRef.current = node;
3029
+ if (typeof forwardedRef === "function") forwardedRef(node);
3030
+ else if (forwardedRef) forwardedRef.current = node;
3031
+ }
3032
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { ref: setGroupRef, className: `sia-dropdown-button ${className}`.trim(), children: [
3023
3033
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { ...buttonProps, disabled: disabled || buttonDisabled, onClick, children }),
3024
3034
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownInternal, { ...dropdownProps, popupAnchorRef: groupRef, disabled: disabled || dropdownDisabled, trigger, showTriggerIcon: false, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3025
3035
  Button,
@@ -3032,8 +3042,8 @@ function DropdownButton({
3032
3042
  }
3033
3043
  ) })
3034
3044
  ] });
3035
- }
3036
- var Dropdown = Object.assign(DropdownRoot, {
3045
+ });
3046
+ var Dropdown2 = Object.assign(DropdownRoot, {
3037
3047
  /** 组合主操作按钮与下拉菜单的按钮组件。 */
3038
3048
  Button: DropdownButton
3039
3049
  });
@@ -3209,19 +3219,27 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true, au
3209
3219
  closeRef.current();
3210
3220
  return;
3211
3221
  }
3212
- if (event.key !== "Tab" || !panelRef.current) return;
3213
- const focusable = focusableElements(panelRef.current);
3222
+ const panel = panelRef.current;
3223
+ if (event.key !== "Tab" || !panel) return;
3224
+ const focusable = focusableElements(panel);
3214
3225
  if (focusable.length === 0) {
3215
3226
  event.preventDefault();
3216
- panelRef.current.focus();
3227
+ panel.focus();
3217
3228
  return;
3218
3229
  }
3219
3230
  const first = focusable[0];
3220
3231
  const last = focusable.at(-1);
3221
- if (event.shiftKey && document.activeElement === first) {
3232
+ const active = document.activeElement;
3233
+ const insidePanel = active instanceof Node && panel.contains(active);
3234
+ if (!insidePanel || active === panel) {
3235
+ event.preventDefault();
3236
+ (event.shiftKey ? last : first).focus();
3237
+ return;
3238
+ }
3239
+ if (event.shiftKey && active === first) {
3222
3240
  event.preventDefault();
3223
3241
  last.focus();
3224
- } else if (!event.shiftKey && document.activeElement === last) {
3242
+ } else if (!event.shiftKey && active === last) {
3225
3243
  event.preventDefault();
3226
3244
  first.focus();
3227
3245
  }
@@ -3236,7 +3254,7 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true, au
3236
3254
  unlockBody();
3237
3255
  previouslyFocused?.focus({ preventScroll: true });
3238
3256
  };
3239
- }, [keyboard, open, panelRef, autoFocusInput]);
3257
+ }, [keyboard, open, panelRef]);
3240
3258
  (0, import_react14.useEffect)(() => {
3241
3259
  if (!open) return;
3242
3260
  const timer = window.setTimeout(() => {
@@ -3914,7 +3932,7 @@ function RichTextEditor({
3914
3932
  formatButton("\u64A4\u9500", () => editor?.chain().focus().undo().run(), false, !editor?.can().undo(), /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "undo" })),
3915
3933
  formatButton("\u91CD\u505A", () => editor?.chain().focus().redo().run(), false, !editor?.can().redo(), /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "redo" })),
3916
3934
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "sia-rich-text-editor__divider" }),
3917
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Dropdown, { menu: blockTypeMenu, trigger: ["click"], placement: "bottomLeft", disabled: disabled || !editor, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Button, { type: "button", variant: "text", size: "small", className: "sia-rich-text-editor__block-type", disabled: disabled || !editor, "aria-label": "\u6BB5\u843D\u683C\u5F0F", title: "\u6BB5\u843D\u683C\u5F0F", onMouseDown: (event) => event.preventDefault(), children: [
3935
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Dropdown2, { menu: blockTypeMenu, trigger: ["click"], placement: "bottomLeft", disabled: disabled || !editor, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Button, { type: "button", variant: "text", size: "small", className: "sia-rich-text-editor__block-type", disabled: disabled || !editor, "aria-label": "\u6BB5\u843D\u683C\u5F0F", title: "\u6BB5\u843D\u683C\u5F0F", onMouseDown: (event) => event.preventDefault(), children: [
3918
3936
  currentBlockLabel,
3919
3937
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "chevron-down", size: 13 })
3920
3938
  ] }) }),
@@ -3927,7 +3945,7 @@ function RichTextEditor({
3927
3945
  formatButton("\u5220\u9664\u7EBF", () => editor?.chain().focus().toggleStrike().run(), Boolean(editor?.isActive("strike")), false, /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("s", { children: "S" })),
3928
3946
  formatButton("\u884C\u5185\u4EE3\u7801", () => editor?.chain().focus().toggleCode().run(), Boolean(editor?.isActive("code")), false, "</>"),
3929
3947
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3930
- Dropdown,
3948
+ Dropdown2,
3931
3949
  {
3932
3950
  menu: { items: [] },
3933
3951
  trigger: ["click"],