@one2x/medeo-rte 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/README.md +209 -2
  2. package/dist/chunks/types-I0yc5X7i.js +18 -0
  3. package/dist/chunks/types-I0yc5X7i.js.map +1 -0
  4. package/dist/formula.js +186 -0
  5. package/dist/formula.js.map +1 -0
  6. package/dist/index.js +5503 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/style.css +718 -0
  9. package/dist/types/commands/index.d.ts +4 -0
  10. package/dist/types/commands/index.d.ts.map +1 -0
  11. package/dist/types/commands/selfcheck.d.ts +2 -0
  12. package/dist/types/commands/selfcheck.d.ts.map +1 -0
  13. package/dist/types/commands/shortcuts.d.ts +48 -0
  14. package/dist/types/commands/shortcuts.d.ts.map +1 -0
  15. package/dist/types/commands/types.d.ts +69 -0
  16. package/dist/types/commands/types.d.ts.map +1 -0
  17. package/dist/types/convert/clipboard.d.ts +7 -0
  18. package/dist/types/convert/clipboard.d.ts.map +1 -0
  19. package/dist/types/convert/markdown.d.ts +30 -0
  20. package/dist/types/convert/markdown.d.ts.map +1 -0
  21. package/dist/types/convert/mdPaste.d.ts +8 -0
  22. package/dist/types/convert/mdPaste.d.ts.map +1 -0
  23. package/dist/types/editor.d.ts +469 -0
  24. package/dist/types/editor.d.ts.map +1 -0
  25. package/dist/types/edits/editResult.d.ts +62 -0
  26. package/dist/types/edits/editResult.d.ts.map +1 -0
  27. package/dist/types/edits/index.d.ts +12 -0
  28. package/dist/types/edits/index.d.ts.map +1 -0
  29. package/dist/types/edits/selfcheck.d.ts +2 -0
  30. package/dist/types/edits/selfcheck.d.ts.map +1 -0
  31. package/dist/types/edits/transaction.d.ts +35 -0
  32. package/dist/types/edits/transaction.d.ts.map +1 -0
  33. package/dist/types/edits/undoStack.d.ts +50 -0
  34. package/dist/types/edits/undoStack.d.ts.map +1 -0
  35. package/dist/types/embed/code.d.ts +9 -0
  36. package/dist/types/embed/code.d.ts.map +1 -0
  37. package/dist/types/embed/formula-katex.d.ts +4 -0
  38. package/dist/types/embed/formula-katex.d.ts.map +1 -0
  39. package/dist/types/embed/formula-mathlive.d.ts +6 -0
  40. package/dist/types/embed/formula-mathlive.d.ts.map +1 -0
  41. package/dist/types/embed/formula.d.ts +8 -0
  42. package/dist/types/embed/formula.d.ts.map +1 -0
  43. package/dist/types/embed/host.d.ts +70 -0
  44. package/dist/types/embed/host.d.ts.map +1 -0
  45. package/dist/types/embed/image.d.ts +3 -0
  46. package/dist/types/embed/image.d.ts.map +1 -0
  47. package/dist/types/embed/index.d.ts +20 -0
  48. package/dist/types/embed/index.d.ts.map +1 -0
  49. package/dist/types/embed/ref.d.ts +25 -0
  50. package/dist/types/embed/ref.d.ts.map +1 -0
  51. package/dist/types/embed/registry.d.ts +6 -0
  52. package/dist/types/embed/registry.d.ts.map +1 -0
  53. package/dist/types/embed/slot.d.ts +15 -0
  54. package/dist/types/embed/slot.d.ts.map +1 -0
  55. package/dist/types/embed/types.d.ts +53 -0
  56. package/dist/types/embed/types.d.ts.map +1 -0
  57. package/dist/types/embed/video.d.ts +3 -0
  58. package/dist/types/embed/video.d.ts.map +1 -0
  59. package/dist/types/formula.d.ts +15 -0
  60. package/dist/types/formula.d.ts.map +1 -0
  61. package/dist/types/index.d.ts +39 -0
  62. package/dist/types/index.d.ts.map +1 -0
  63. package/dist/types/input/ime.d.ts +27 -0
  64. package/dist/types/input/ime.d.ts.map +1 -0
  65. package/dist/types/input/keyboard.d.ts +21 -0
  66. package/dist/types/input/keyboard.d.ts.map +1 -0
  67. package/dist/types/layout/engine.d.ts +55 -0
  68. package/dist/types/layout/engine.d.ts.map +1 -0
  69. package/dist/types/layout/harness.d.ts +3 -0
  70. package/dist/types/layout/harness.d.ts.map +1 -0
  71. package/dist/types/layout/measure.d.ts +37 -0
  72. package/dist/types/layout/measure.d.ts.map +1 -0
  73. package/dist/types/layout/refMetrics.d.ts +5 -0
  74. package/dist/types/layout/refMetrics.d.ts.map +1 -0
  75. package/dist/types/layout/selfcheck.d.ts +2 -0
  76. package/dist/types/layout/selfcheck.d.ts.map +1 -0
  77. package/dist/types/layout/style.d.ts +4 -0
  78. package/dist/types/layout/style.d.ts.map +1 -0
  79. package/dist/types/layout/types.d.ts +133 -0
  80. package/dist/types/layout/types.d.ts.map +1 -0
  81. package/dist/types/layout/wrap.d.ts +65 -0
  82. package/dist/types/layout/wrap.d.ts.map +1 -0
  83. package/dist/types/model/blocks.d.ts +66 -0
  84. package/dist/types/model/blocks.d.ts.map +1 -0
  85. package/dist/types/model/document.d.ts +102 -0
  86. package/dist/types/model/document.d.ts.map +1 -0
  87. package/dist/types/model/fragment.d.ts +7 -0
  88. package/dist/types/model/fragment.d.ts.map +1 -0
  89. package/dist/types/model/markers.d.ts +14 -0
  90. package/dist/types/model/markers.d.ts.map +1 -0
  91. package/dist/types/model/types.d.ts +155 -0
  92. package/dist/types/model/types.d.ts.map +1 -0
  93. package/dist/types/model/virtualBlock.d.ts +44 -0
  94. package/dist/types/model/virtualBlock.d.ts.map +1 -0
  95. package/dist/types/mutations/apply.d.ts +14 -0
  96. package/dist/types/mutations/apply.d.ts.map +1 -0
  97. package/dist/types/mutations/index.d.ts +15 -0
  98. package/dist/types/mutations/index.d.ts.map +1 -0
  99. package/dist/types/mutations/invert.d.ts +21 -0
  100. package/dist/types/mutations/invert.d.ts.map +1 -0
  101. package/dist/types/mutations/ranges.d.ts +39 -0
  102. package/dist/types/mutations/ranges.d.ts.map +1 -0
  103. package/dist/types/mutations/registry.d.ts +27 -0
  104. package/dist/types/mutations/registry.d.ts.map +1 -0
  105. package/dist/types/mutations/selection.d.ts +12 -0
  106. package/dist/types/mutations/selection.d.ts.map +1 -0
  107. package/dist/types/mutations/selfcheck.d.ts +2 -0
  108. package/dist/types/mutations/selfcheck.d.ts.map +1 -0
  109. package/dist/types/mutations/transform.d.ts +33 -0
  110. package/dist/types/mutations/transform.d.ts.map +1 -0
  111. package/dist/types/mutations/types.d.ts +128 -0
  112. package/dist/types/mutations/types.d.ts.map +1 -0
  113. package/dist/types/operations/context.d.ts +47 -0
  114. package/dist/types/operations/context.d.ts.map +1 -0
  115. package/dist/types/operations/entity.d.ts +18 -0
  116. package/dist/types/operations/entity.d.ts.map +1 -0
  117. package/dist/types/operations/harness.d.ts +54 -0
  118. package/dist/types/operations/harness.d.ts.map +1 -0
  119. package/dist/types/operations/index.d.ts +20 -0
  120. package/dist/types/operations/index.d.ts.map +1 -0
  121. package/dist/types/operations/primitives.d.ts +35 -0
  122. package/dist/types/operations/primitives.d.ts.map +1 -0
  123. package/dist/types/operations/resolve.d.ts +31 -0
  124. package/dist/types/operations/resolve.d.ts.map +1 -0
  125. package/dist/types/operations/selfcheck.d.ts +2 -0
  126. package/dist/types/operations/selfcheck.d.ts.map +1 -0
  127. package/dist/types/operations/slice.d.ts +28 -0
  128. package/dist/types/operations/slice.d.ts.map +1 -0
  129. package/dist/types/operations/style.d.ts +20 -0
  130. package/dist/types/operations/style.d.ts.map +1 -0
  131. package/dist/types/operations/table.d.ts +14 -0
  132. package/dist/types/operations/table.d.ts.map +1 -0
  133. package/dist/types/operations/text.d.ts +20 -0
  134. package/dist/types/operations/text.d.ts.map +1 -0
  135. package/dist/types/operations/virtualBlock.d.ts +44 -0
  136. package/dist/types/operations/virtualBlock.d.ts.map +1 -0
  137. package/dist/types/paint/canvasPainter.d.ts +37 -0
  138. package/dist/types/paint/canvasPainter.d.ts.map +1 -0
  139. package/dist/types/paint/decorations.d.ts +19 -0
  140. package/dist/types/paint/decorations.d.ts.map +1 -0
  141. package/dist/types/paint/htmlPainter.d.ts +19 -0
  142. package/dist/types/paint/htmlPainter.d.ts.map +1 -0
  143. package/dist/types/paint/types.d.ts +36 -0
  144. package/dist/types/paint/types.d.ts.map +1 -0
  145. package/package.json +64 -4
package/dist/style.css ADDED
@@ -0,0 +1,718 @@
1
+ /* medeo-rte 核心样式:文档渲染、光标、选区、嵌入对象。
2
+ 工具栏、状态栏、小地图等宿主外壳样式不在这里。
3
+ 色板挂在 .mini-editor 上,禁止写到 :root,避免污染宿主(如 Medeo)的页面底色。 */
4
+
5
+ .mini-editor {
6
+ --page: #fff;
7
+ --ink: #1f2329;
8
+ --muted: #667085;
9
+ --line: #e6e8eb;
10
+ --brand: #2b6cff;
11
+ --sel: rgba(43, 108, 255, 0.22);
12
+ --bg: #eef1f6;
13
+ --toolbar: #f7f8fa;
14
+ --mini-caret-color: #09090b;
15
+ --mini-caret-width: 2px;
16
+ --mini-ime-underline-color: #1f2329;
17
+ --mini-ime-underline-width: 2px;
18
+ --mini-sel-color: rgba(43, 108, 255, 0.22);
19
+ --mini-sel-radius: 0px;
20
+ --mini-font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
21
+ }
22
+
23
+ .mini-editor,
24
+ .mini-editor *,
25
+ .mini-editor *::before,
26
+ .mini-editor *::after {
27
+ box-sizing: border-box;
28
+ }
29
+
30
+ .mini-editor {
31
+ display: flex;
32
+ flex-direction: column;
33
+ height: 100%;
34
+ position: relative;
35
+ /*
36
+ * 默认字体与 measure.ts 的 FONT_FAMILY 一致。宿主 textDefaults.fontFamily
37
+ * 会写成 --mini-font-family,测宽与绘制必须用同一栈。
38
+ */
39
+ font-family: var(--mini-font-family, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif);
40
+ font-weight: var(--mini-font-weight, 400);
41
+ letter-spacing: 0;
42
+ word-spacing: 0;
43
+ font-kerning: none;
44
+ font-variant: normal;
45
+ font-feature-settings: normal;
46
+ }
47
+
48
+ /*
49
+ * 编辑器默认贴合外部容器:不设四周留白、不设最小高度、不加纸张阴影/圆角。
50
+ * 编辑器把自己定位为可嵌入的容器自适应组件,而非固定尺寸的“页面/文档”。
51
+ * 若宿主需要纸张观感(留白、阴影、整页最小高度),应在宿主层自行添加(参见 demo)。
52
+ */
53
+ .mini-page-wrap {
54
+ flex: 1;
55
+ overflow: auto;
56
+ }
57
+
58
+ .mini-page {
59
+ width: 100%;
60
+ min-height: 100%;
61
+ position: relative;
62
+ }
63
+
64
+ .mini-surface {
65
+ position: relative;
66
+ min-height: 100%;
67
+ background: var(--page);
68
+ }
69
+
70
+ .mini-editor[data-surface='transparent'] .mini-surface {
71
+ background: transparent;
72
+ }
73
+
74
+ .mini-canvas {
75
+ display: block;
76
+ }
77
+
78
+ .mini-canvas-chrome {
79
+ position: absolute;
80
+ inset: 0;
81
+ pointer-events: none;
82
+ z-index: 4;
83
+ }
84
+
85
+ .mini-layer {
86
+ position: absolute;
87
+ inset: 0;
88
+ pointer-events: none;
89
+ }
90
+
91
+ .mini-content {
92
+ z-index: 1;
93
+ }
94
+
95
+ .mini-embeds {
96
+ z-index: 1;
97
+ pointer-events: none;
98
+ }
99
+
100
+ .mini-selection {
101
+ z-index: 0;
102
+ }
103
+
104
+ .mini-run,
105
+ .mini-list-marker,
106
+ .mini-image,
107
+ .mini-table,
108
+ .mini-cell,
109
+ .mini-sel-rect,
110
+ .mini-vblock,
111
+ .mini-vblock-outline,
112
+ .mini-caret,
113
+ .mini-ime,
114
+ .mini-ime-bar,
115
+ .mini-placeholder,
116
+ .mini-deco,
117
+ .mini-resize {
118
+ position: absolute;
119
+ }
120
+
121
+ .mini-run,
122
+ .mini-list-marker {
123
+ white-space: pre;
124
+ pointer-events: none;
125
+ letter-spacing: 0;
126
+ word-spacing: 0;
127
+ font-kerning: none;
128
+ /*
129
+ * 关闭 CJK 与拉丁/数字之间的自动间距。排版测量走 canvas measureText,不会在中西文
130
+ * 边界插入任何间距;若绘制端沿用浏览器默认的 text-autospace: normal,DOM 会在每个
131
+ * 中西文边界插入约数像素间距,使渲染文字比排版逐字测量更宽,光标/选区随之与可见文字
132
+ * 错位(中西文穿插越多、边界越多,累积偏差越大)。这里强制与测量口径一致,不受宿主
133
+ * 全局样式影响。text-spacing-trim 一并锁定以覆盖不同浏览器的实现差异。
134
+ */
135
+ text-autospace: no-autospace;
136
+ -webkit-text-autospace: no-autospace;
137
+ text-spacing-trim: space-all;
138
+ }
139
+
140
+ .mini-run {
141
+ /* 垂直居中靠 line-height(painter 设为行高)。family/weight 由根变量继承,避免 font 简写把整串 family 解析坏。 */
142
+ overflow: visible;
143
+ font-family: inherit;
144
+ }
145
+
146
+ .mini-list-marker {
147
+ color: var(--muted);
148
+ display: flex;
149
+ align-items: center;
150
+ justify-content: flex-end;
151
+ padding-right: 8px;
152
+ font-size: 16px;
153
+ }
154
+
155
+ .mini-image {
156
+ pointer-events: none;
157
+ object-fit: contain;
158
+ user-select: none;
159
+ }
160
+
161
+ .mini-image.is-inline {
162
+ object-fit: cover;
163
+ border-radius: 6px;
164
+ }
165
+
166
+ .mini-embed {
167
+ position: absolute;
168
+ box-sizing: border-box;
169
+ }
170
+
171
+ .mini-embed-interactive {
172
+ pointer-events: auto;
173
+ }
174
+
175
+ .mini-host {
176
+ max-width: var(--mini-content-width);
177
+ }
178
+
179
+ /* 宿主渲染块:外层由 SDK 定位占位,内层由宿主内容自然撑开(也是自动测尺的观察对象)。
180
+ 内层必须按内容测宽,不能当 flex 子项被外层回填宽度挤扁,否则后随文字会叠进胶囊。
181
+ max-width 钳在行宽上,文本槽超宽时在槽内折行而不是撑出编辑器。 */
182
+ .mini-host-inner {
183
+ display: inline-flex;
184
+ align-items: center;
185
+ max-width: var(--mini-content-width);
186
+ line-height: 0;
187
+ vertical-align: bottom;
188
+ }
189
+
190
+ .mini-video {
191
+ pointer-events: auto;
192
+ background: #111827;
193
+ object-fit: contain;
194
+ }
195
+
196
+ .mini-code {
197
+ display: flex;
198
+ flex-direction: column;
199
+ background: #f4f6f8;
200
+ border: 1px solid #e6e8eb;
201
+ border-radius: 6px;
202
+ overflow: hidden;
203
+ }
204
+
205
+ .mini-code-bar {
206
+ height: 28px;
207
+ display: flex;
208
+ align-items: center;
209
+ padding: 0 8px;
210
+ border-bottom: 1px solid #e6e8eb;
211
+ background: #eef1f6;
212
+ flex: none;
213
+ }
214
+
215
+ .mini-code-lang {
216
+ border: none;
217
+ background: transparent;
218
+ font: inherit;
219
+ font-size: 12px;
220
+ color: var(--muted);
221
+ }
222
+
223
+ .mini-code-input {
224
+ flex: 1;
225
+ margin: 0;
226
+ padding: 8px 12px;
227
+ border: none;
228
+ resize: none;
229
+ background: transparent;
230
+ font: 13px/18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
231
+ color: var(--ink);
232
+ outline: none;
233
+ }
234
+
235
+ .mini-formula {
236
+ display: flex;
237
+ align-items: center;
238
+ justify-content: center;
239
+ background: #f7f8fa;
240
+ border: 1px solid #e6e8eb;
241
+ border-radius: 6px;
242
+ padding: 4px 8px;
243
+ }
244
+
245
+ .mini-formula.is-editing {
246
+ min-width: 220px;
247
+ min-height: 56px;
248
+ height: auto;
249
+ background: #fff;
250
+ z-index: 3;
251
+ }
252
+
253
+ .mini-formula-view {
254
+ overflow: hidden;
255
+ }
256
+
257
+ .mini-formula-host {
258
+ width: 100%;
259
+ }
260
+
261
+ .mini-formula-math {
262
+ width: 100%;
263
+ min-height: 40px;
264
+ border: none;
265
+ outline: none;
266
+ font-size: 18px;
267
+ }
268
+
269
+ .mini-slot {
270
+ display: inline-flex;
271
+ align-items: center;
272
+ gap: 6px;
273
+ padding: 0 12px 0 8px;
274
+ border-radius: 999px;
275
+ background: #f2f4f7;
276
+ color: #98a2b3;
277
+ font-size: 13px;
278
+ line-height: 28px;
279
+ white-space: nowrap;
280
+ cursor: pointer;
281
+ user-select: none;
282
+ z-index: 2;
283
+ }
284
+
285
+ .mini-slot.is-filled {
286
+ background: #e9edf5;
287
+ color: #1f2329;
288
+ }
289
+
290
+ .mini-slot.is-image-filled {
291
+ padding: 2px;
292
+ gap: 0;
293
+ background: #eef1f6;
294
+ }
295
+
296
+ .mini-slot.is-editing {
297
+ background: #fff;
298
+ box-shadow: 0 0 0 2px var(--brand);
299
+ z-index: 8;
300
+ }
301
+
302
+ .mini-slot-icon[hidden],
303
+ .mini-slot-text[hidden],
304
+ .mini-slot-thumb[hidden],
305
+ .mini-slot-input[hidden] {
306
+ display: none !important;
307
+ }
308
+
309
+ .mini-slot-icon {
310
+ display: flex;
311
+ width: 16px;
312
+ height: 16px;
313
+ flex: none;
314
+ }
315
+
316
+ .mini-slot-text {
317
+ overflow: hidden;
318
+ text-overflow: ellipsis;
319
+ }
320
+
321
+ .mini-slot-thumb {
322
+ display: block;
323
+ width: 100%;
324
+ height: 100%;
325
+ object-fit: cover;
326
+ border-radius: 10px;
327
+ pointer-events: none;
328
+ }
329
+
330
+ .mini-slot-input {
331
+ flex: 1;
332
+ min-width: 64px;
333
+ width: 100%;
334
+ border: none;
335
+ background: transparent;
336
+ padding: 0;
337
+ font: inherit;
338
+ font-size: 13px;
339
+ color: var(--ink);
340
+ outline: none;
341
+ }
342
+
343
+ .mini-slot-file {
344
+ position: absolute;
345
+ width: 0;
346
+ height: 0;
347
+ opacity: 0;
348
+ pointer-events: none;
349
+ }
350
+
351
+ .mini-slot-menu {
352
+ position: absolute;
353
+ left: 0;
354
+ top: calc(100% + 6px);
355
+ min-width: 100%;
356
+ background: #fff;
357
+ border: 1px solid #e6e8eb;
358
+ border-radius: 8px;
359
+ box-shadow: 0 8px 24px rgba(31, 35, 41, 0.12);
360
+ padding: 4px;
361
+ z-index: 20;
362
+ }
363
+
364
+ .mini-slot-menu button {
365
+ display: block;
366
+ width: 100%;
367
+ border: none;
368
+ background: transparent;
369
+ text-align: left;
370
+ padding: 6px 10px;
371
+ border-radius: 6px;
372
+ font: inherit;
373
+ font-size: 13px;
374
+ color: #1f2329;
375
+ cursor: pointer;
376
+ }
377
+
378
+ .mini-slot-menu button:hover,
379
+ .mini-slot-menu button.is-on {
380
+ background: #f2f4f7;
381
+ }
382
+
383
+ .mini-ref {
384
+ background: #fff8dc;
385
+ border: none;
386
+ border-radius: 3px;
387
+ overflow: visible;
388
+ z-index: 2;
389
+ }
390
+
391
+ .mini-ref.is-editing {
392
+ z-index: 6;
393
+ }
394
+
395
+ .mini-ref-badge {
396
+ position: absolute;
397
+ top: -16px;
398
+ left: 0;
399
+ border: none;
400
+ background: var(--page);
401
+ color: #4c6ad9;
402
+ font: inherit;
403
+ font-size: 11px;
404
+ font-weight: 600;
405
+ line-height: 16px;
406
+ padding: 0 4px 0 0;
407
+ cursor: pointer;
408
+ opacity: 0;
409
+ pointer-events: none;
410
+ white-space: nowrap;
411
+ }
412
+
413
+ .mini-ref:hover .mini-ref-badge,
414
+ .mini-ref.is-selected .mini-ref-badge,
415
+ .mini-ref.is-editing .mini-ref-badge {
416
+ opacity: 1;
417
+ pointer-events: auto;
418
+ }
419
+
420
+ .mini-ref-badge:hover {
421
+ text-decoration: underline;
422
+ }
423
+
424
+ .mini-ref-body {
425
+ position: absolute;
426
+ left: 0;
427
+ right: 0;
428
+ top: 0;
429
+ overflow: hidden;
430
+ pointer-events: none;
431
+ }
432
+
433
+ .mini-ref-line {
434
+ position: absolute;
435
+ inset: 0;
436
+ pointer-events: none;
437
+ }
438
+
439
+ .mini-ref-hole {
440
+ position: absolute;
441
+ }
442
+
443
+ .mini-ref-hole {
444
+ background: #eef1f6;
445
+ border-radius: 4px;
446
+ color: #98a2b3;
447
+ font-size: 11px;
448
+ display: flex;
449
+ align-items: center;
450
+ justify-content: center;
451
+ }
452
+
453
+ .mini-embed-frame.is-ref {
454
+ border-radius: 2px;
455
+ background: transparent;
456
+ box-shadow: none;
457
+ }
458
+
459
+ .mini-embed-frame.is-slot {
460
+ border-radius: 999px;
461
+ }
462
+
463
+ .mini-embed-frame.is-slot.is-image {
464
+ border-radius: 10px;
465
+ }
466
+
467
+ .mini-table {
468
+ pointer-events: none;
469
+ z-index: 0;
470
+ }
471
+
472
+ .mini-cell {
473
+ border: 1px solid #c9cdd4;
474
+ box-sizing: border-box;
475
+ }
476
+
477
+ .mini-sel-rect {
478
+ border-radius: var(--mini-sel-radius, 0px);
479
+ background: var(--mini-sel-color, var(--sel));
480
+ }
481
+
482
+ .mini-vblock {
483
+ pointer-events: none;
484
+ box-sizing: border-box;
485
+ z-index: 0;
486
+ }
487
+
488
+ .mini-vblock-outline {
489
+ pointer-events: none;
490
+ box-sizing: border-box;
491
+ background: transparent;
492
+ border: 2px solid var(--brand);
493
+ z-index: 2;
494
+ }
495
+
496
+ .mini-editor[data-caret='rainbow'] .mini-sel-rect {
497
+ background: var(
498
+ --mini-sel-color,
499
+ linear-gradient(90deg, rgba(255, 77, 109, 0.16), rgba(43, 108, 255, 0.22))
500
+ );
501
+ border-radius: var(--mini-sel-radius, 6px);
502
+ box-shadow: inset 0 0 0 1px rgba(43, 108, 255, 0.18);
503
+ }
504
+
505
+ .mini-editor[data-caret='solid'] .mini-sel-rect {
506
+ box-shadow: none;
507
+ }
508
+
509
+ .mini-caret {
510
+ width: 3px;
511
+ border-radius: 2px;
512
+ background: linear-gradient(180deg, #ff4d6d 0%, #ffd166 35%, #06d6a0 65%, #4cc9f0 100%);
513
+ box-shadow: 0 0 8px rgba(76, 201, 240, 0.65);
514
+ pointer-events: none;
515
+ z-index: 4;
516
+ transform-origin: bottom center;
517
+ }
518
+
519
+ .mini-caret.is-italic {
520
+ transform: skewX(-14deg);
521
+ }
522
+
523
+ .mini-caret-trail {
524
+ filter: blur(0.4px);
525
+ box-shadow: none;
526
+ }
527
+
528
+ .mini-editor[data-caret='solid'] .mini-caret {
529
+ width: var(--mini-caret-width, 2px);
530
+ border-radius: 0;
531
+ background: var(--mini-caret-color, #09090b);
532
+ box-shadow: none;
533
+ animation: mini-caret-blink 1.06s step-end infinite;
534
+ }
535
+
536
+ .mini-editor[data-caret='solid'] .mini-caret-trail {
537
+ display: none;
538
+ }
539
+
540
+ @keyframes mini-caret-blink {
541
+ 50% {
542
+ opacity: 0;
543
+ }
544
+ }
545
+
546
+ .mini-deco {
547
+ pointer-events: none;
548
+ z-index: 1;
549
+ }
550
+
551
+ .mini-deco-single::after,
552
+ .mini-deco-double::after,
553
+ .mini-deco-dotted::after,
554
+ .mini-deco-wavy::after,
555
+ .mini-deco-marker::after {
556
+ content: "";
557
+ position: absolute;
558
+ left: 0;
559
+ right: 0;
560
+ pointer-events: none;
561
+ }
562
+
563
+ .mini-deco-single::after {
564
+ bottom: 4px;
565
+ height: 1.5px;
566
+ background: currentColor;
567
+ }
568
+
569
+ .mini-deco-double::after {
570
+ bottom: 3px;
571
+ height: 5px;
572
+ background: linear-gradient(currentColor, currentColor) top / 100% 1.5px no-repeat,
573
+ linear-gradient(currentColor, currentColor) bottom / 100% 1.5px no-repeat;
574
+ }
575
+
576
+ .mini-deco-dotted::after {
577
+ bottom: 4px;
578
+ height: 2px;
579
+ background: radial-gradient(circle, currentColor 1px, transparent 1.3px) 0 0 / 6px 2px repeat-x;
580
+ }
581
+
582
+ .mini-deco-wavy::after {
583
+ bottom: 2px;
584
+ height: 6px;
585
+ background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 3 Q 2.5 0 5 3 T 10 3' fill='none' stroke='%232b6cff' stroke-width='1.3'/></svg>")
586
+ repeat-x bottom;
587
+ }
588
+
589
+ .mini-deco-marker::after {
590
+ bottom: 5px;
591
+ height: 8px;
592
+ background: rgba(255, 209, 102, 0.48);
593
+ border-radius: 4px;
594
+ transform: rotate(-1.2deg);
595
+ }
596
+
597
+ .mini-deco.is-strike::before {
598
+ content: "";
599
+ position: absolute;
600
+ left: 0;
601
+ right: 0;
602
+ top: 50%;
603
+ height: 1.5px;
604
+ background: currentColor;
605
+ }
606
+
607
+ .mini-run.is-fill {
608
+ -webkit-text-fill-color: transparent;
609
+ }
610
+
611
+ .mini-placeholder {
612
+ color: var(--muted);
613
+ pointer-events: none;
614
+ user-select: none;
615
+ white-space: nowrap;
616
+ overflow: hidden;
617
+ text-overflow: ellipsis;
618
+ z-index: 1;
619
+ }
620
+
621
+ .mini-ime-bar {
622
+ display: none;
623
+ position: absolute;
624
+ height: var(--mini-ime-underline-width, 2px);
625
+ border-radius: 0;
626
+ background: var(--mini-ime-underline-color, #1f2329);
627
+ box-shadow: none;
628
+ pointer-events: none;
629
+ z-index: 8;
630
+ }
631
+
632
+ .mini-page.is-flipping {
633
+ animation: mini-flip 0.45s ease;
634
+ }
635
+
636
+ @keyframes mini-flip {
637
+ 0% {
638
+ transform: perspective(900px) rotateY(0);
639
+ }
640
+ 45% {
641
+ transform: perspective(900px) rotateY(88deg);
642
+ opacity: 0.55;
643
+ }
644
+ 100% {
645
+ transform: perspective(900px) rotateY(0);
646
+ opacity: 1;
647
+ }
648
+ }
649
+
650
+ .mini-ime {
651
+ min-width: 1px;
652
+ width: 1px;
653
+ opacity: 0;
654
+ z-index: 6;
655
+ outline: none;
656
+ white-space: pre;
657
+ overflow: hidden;
658
+ caret-color: transparent;
659
+ color: var(--ink);
660
+ display: flex;
661
+ align-items: center;
662
+ /* 命中交给页面/表面;IME 只靠程序 focus 接收按键。 */
663
+ pointer-events: none;
664
+ }
665
+
666
+ /*
667
+ * 组合态:组合串已镜像插入文档模型、由正文渲染出来(字体字号都对),所以这个
668
+ * 输入靶子里系统重绘的那份组合串是重复的,让它整体隐形。
669
+ *
670
+ * Safari / WebKit 会在 contenteditable 组合串上再画一条系统 IME 下划线,
671
+ * `text-decoration: none` 去不掉;若 overflow:visible + opacity:1,就会和自绘
672
+ * imeBar 叠成两条线。这里把靶子裁成 1px 并整体透明,只留候选框锚点。
673
+ * 可见的组合区提示交给自绘的 imeBar 与光标。
674
+ */
675
+ .mini-ime.is-composing {
676
+ opacity: 0;
677
+ width: 1px;
678
+ min-width: 1px;
679
+ background: transparent;
680
+ color: transparent;
681
+ -webkit-text-fill-color: transparent;
682
+ z-index: 7;
683
+ overflow: hidden;
684
+ caret-color: transparent;
685
+ text-decoration: none;
686
+ text-decoration-line: none;
687
+ -webkit-text-decoration-line: none;
688
+ box-shadow: none;
689
+ }
690
+
691
+ .mini-embed-frame {
692
+ display: none;
693
+ position: absolute;
694
+ box-sizing: border-box;
695
+ pointer-events: none;
696
+ z-index: 7;
697
+ border: 2px solid var(--brand);
698
+ border-radius: 6px;
699
+ background: rgba(43, 108, 255, 0.12);
700
+ box-shadow: 0 0 0 1px rgba(43, 108, 255, 0.2);
701
+ }
702
+
703
+ .mini-resize {
704
+ display: none;
705
+ width: 12px;
706
+ height: 12px;
707
+ background: var(--brand);
708
+ border: 2px solid #fff;
709
+ border-radius: 2px;
710
+ z-index: 8;
711
+ cursor: nwse-resize;
712
+ pointer-events: auto;
713
+ box-shadow: 0 0 0 1px rgba(31, 35, 41, 0.25);
714
+ }
715
+
716
+ .mini-surface.is-col-resize {
717
+ cursor: col-resize;
718
+ }
@@ -0,0 +1,4 @@
1
+ export type { ArrowKey, CommandTable, EditorCommands } from './types';
2
+ export type { KeyStroke, Shortcut } from './shortcuts';
3
+ export { findShortcut, INPUT_SHORTCUTS, inputShortcuts, SHORTCUTS } from './shortcuts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACtE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=selfcheck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selfcheck.d.ts","sourceRoot":"","sources":["../../../src/commands/selfcheck.ts"],"names":[],"mappings":""}