@dou-ui/code 0.1.0-alpha.0 → 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/code-editor.js.map +1 -1
- package/dist/code-editor.vue_vue_type_script_setup_true_lang.js +234 -73
- package/dist/code-editor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/code-keys.vue_vue_type_script_setup_true_lang.js +138 -62
- package/dist/code-keys.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/code-keys2.js.map +1 -1
- package/dist/locale.js +6 -12
- package/dist/locale.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/code-diff.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/locale.d.ts +5 -5
- package/dist/types/types.d.ts +2 -2
- package/dist/types/view/viewport.d.ts +16 -0
- package/dist/types/view/viewport.test.d.ts +1 -0
- package/dist/view/viewport.js +31 -0
- package/dist/view/viewport.js.map +1 -0
- package/package.json +3 -3
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { cursorCharLeft, cursorCharRight, cursorLineDown, cursorLineUp, typeText } from "./core/commands.js";
|
|
2
2
|
import { useCodeMessages } from "./locale.js";
|
|
3
3
|
import { defaultCodeKeys, keyName } from "./code-keys.js";
|
|
4
|
+
import { visibleViewport } from "./view/viewport.js";
|
|
4
5
|
import { useNamespace } from "dou-ui";
|
|
5
|
-
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, onBeforeUnmount, openBlock, ref, renderList, resolveDynamicComponent, toDisplayString, unref, withModifiers } from "vue";
|
|
6
|
+
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, resolveDynamicComponent, toDisplayString, unref, withModifiers } from "vue";
|
|
6
7
|
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon } from "@dou-ui/icons";
|
|
7
8
|
// src/code-keys.vue?vue&type=script&setup=true&lang.ts
|
|
8
9
|
var _hoisted_1 = ["aria-label"];
|
|
@@ -12,13 +13,10 @@ var _hoisted_2 = [
|
|
|
12
13
|
"onPointerdown",
|
|
13
14
|
"onClick"
|
|
14
15
|
];
|
|
15
|
-
var _hoisted_3 = [
|
|
16
|
-
"aria-label",
|
|
17
|
-
"title",
|
|
18
|
-
"onPointerdown",
|
|
19
|
-
"onClick"
|
|
20
|
-
];
|
|
16
|
+
var _hoisted_3 = ["aria-label", "title"];
|
|
21
17
|
var SLOP = 8;
|
|
18
|
+
var STICK_REACH = 26;
|
|
19
|
+
var STICK_REST = 8;
|
|
22
20
|
var code_keys_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
23
21
|
name: "DouCodeKeys",
|
|
24
22
|
__name: "code-keys",
|
|
@@ -33,42 +31,8 @@ var code_keys_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
33
31
|
const messages = useCodeMessages(() => props.messages);
|
|
34
32
|
/** Keys that scroll; a string is a key that types itself. */
|
|
35
33
|
const symbolKeys = computed(() => (props.keys ?? defaultCodeKeys).map((key) => typeof key === "string" ? { label: key } : key));
|
|
36
|
-
/** Moving the cursor, always at hand at the end of the bar. */
|
|
37
|
-
const arrowKeys = computed(() => {
|
|
38
|
-
const m = messages.value;
|
|
39
|
-
return [
|
|
40
|
-
{
|
|
41
|
-
label: m.cursorLeft,
|
|
42
|
-
icon: ChevronLeftIcon,
|
|
43
|
-
command: cursorCharLeft,
|
|
44
|
-
repeat: true
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: m.cursorUp,
|
|
48
|
-
icon: ChevronUpIcon,
|
|
49
|
-
command: cursorLineUp,
|
|
50
|
-
repeat: true
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
label: m.cursorDown,
|
|
54
|
-
icon: ChevronDownIcon,
|
|
55
|
-
command: cursorLineDown,
|
|
56
|
-
repeat: true
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
label: m.cursorRight,
|
|
60
|
-
icon: ChevronRightIcon,
|
|
61
|
-
command: cursorCharRight,
|
|
62
|
-
repeat: true
|
|
63
|
-
}
|
|
64
|
-
];
|
|
65
|
-
});
|
|
66
34
|
function fire(key) {
|
|
67
|
-
|
|
68
|
-
const { editor } = props;
|
|
69
|
-
if (!editor) return;
|
|
70
|
-
editor.run(command);
|
|
71
|
-
editor.focus?.();
|
|
35
|
+
run(key.command ?? typeText(key.text ?? key.label));
|
|
72
36
|
}
|
|
73
37
|
/** How far a finger may slide on a key before it counts as scrolling the bar. */
|
|
74
38
|
const pressed = ref(null);
|
|
@@ -115,7 +79,112 @@ var code_keys_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
115
79
|
function onClick(event, key) {
|
|
116
80
|
if (event.detail === 0) fire(key);
|
|
117
81
|
}
|
|
118
|
-
|
|
82
|
+
/**
|
|
83
|
+
* The stick at the end of the bar moves the cursor. Pressed, it grows into a
|
|
84
|
+
* round pad over the bar, the way a number field's keys do, so a thumb has
|
|
85
|
+
* room to lean it: past its rest it steps the way it leans, and the further,
|
|
86
|
+
* the faster. Lifted, it shrinks back.
|
|
87
|
+
*/
|
|
88
|
+
const MOVES = {
|
|
89
|
+
left: cursorCharLeft,
|
|
90
|
+
right: cursorCharRight,
|
|
91
|
+
up: cursorLineUp,
|
|
92
|
+
down: cursorLineDown
|
|
93
|
+
};
|
|
94
|
+
const thumb = ref({
|
|
95
|
+
x: 0,
|
|
96
|
+
y: 0
|
|
97
|
+
});
|
|
98
|
+
const held = ref(false);
|
|
99
|
+
/** How far the pad moves in from the window's edge to fit, in px. */
|
|
100
|
+
const padShift = ref({
|
|
101
|
+
x: 0,
|
|
102
|
+
y: 0
|
|
103
|
+
});
|
|
104
|
+
let stick = null;
|
|
105
|
+
function leanOf(x, y) {
|
|
106
|
+
if (Math.hypot(x, y) < STICK_REST) return null;
|
|
107
|
+
return Math.abs(x) >= Math.abs(y) ? x < 0 ? "left" : "right" : y < 0 ? "up" : "down";
|
|
108
|
+
}
|
|
109
|
+
/** Steps while the stick leans: slowly near its rest, fast pushed all the way and beyond. */
|
|
110
|
+
function stepStick() {
|
|
111
|
+
if (!stick?.lean) return;
|
|
112
|
+
run(MOVES[stick.lean]);
|
|
113
|
+
stick.timer = window.setTimeout(stepStick, 280 - stick.far * 240);
|
|
114
|
+
}
|
|
115
|
+
function onStickDown(event) {
|
|
116
|
+
if (event.button !== 0) return;
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
endStick();
|
|
119
|
+
const el = event.currentTarget;
|
|
120
|
+
el.setPointerCapture?.(event.pointerId);
|
|
121
|
+
const box = el.getBoundingClientRect();
|
|
122
|
+
const cx = box.left + box.width / 2;
|
|
123
|
+
const cy = box.top + box.height / 2;
|
|
124
|
+
const room = 56;
|
|
125
|
+
const view = visibleViewport();
|
|
126
|
+
padShift.value = {
|
|
127
|
+
x: Math.min(0, view.left + view.width - room - cx) + Math.max(0, view.left + room - cx),
|
|
128
|
+
y: Math.min(0, view.top + view.height - room - cy) + Math.max(0, view.top + room - cy)
|
|
129
|
+
};
|
|
130
|
+
held.value = true;
|
|
131
|
+
stick = {
|
|
132
|
+
pointer: event.pointerId,
|
|
133
|
+
x: event.clientX,
|
|
134
|
+
y: event.clientY,
|
|
135
|
+
timer: 0,
|
|
136
|
+
lean: null,
|
|
137
|
+
far: 0
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function onStickMove(event) {
|
|
141
|
+
if (!stick || event.pointerId !== stick.pointer) return;
|
|
142
|
+
const x = event.clientX - stick.x;
|
|
143
|
+
const y = event.clientY - stick.y;
|
|
144
|
+
const d = Math.hypot(x, y);
|
|
145
|
+
const k = d > STICK_REACH ? STICK_REACH / d : 1;
|
|
146
|
+
thumb.value = {
|
|
147
|
+
x: x * k,
|
|
148
|
+
y: y * k
|
|
149
|
+
};
|
|
150
|
+
stick.far = Math.min(1, Math.max(0, d - STICK_REST) / (STICK_REACH * 1.5 - STICK_REST));
|
|
151
|
+
const lean = leanOf(x, y);
|
|
152
|
+
if (lean === stick.lean) return;
|
|
153
|
+
clearTimeout(stick.timer);
|
|
154
|
+
stick.lean = lean;
|
|
155
|
+
stepStick();
|
|
156
|
+
}
|
|
157
|
+
function endStick() {
|
|
158
|
+
if (stick) clearTimeout(stick.timer);
|
|
159
|
+
stick = null;
|
|
160
|
+
held.value = false;
|
|
161
|
+
thumb.value = {
|
|
162
|
+
x: 0,
|
|
163
|
+
y: 0
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/** With the stick focused, the arrow keys move the cursor. */
|
|
167
|
+
function onStickKey(event) {
|
|
168
|
+
const lean = {
|
|
169
|
+
ArrowLeft: "left",
|
|
170
|
+
ArrowRight: "right",
|
|
171
|
+
ArrowUp: "up",
|
|
172
|
+
ArrowDown: "down"
|
|
173
|
+
}[event.key];
|
|
174
|
+
if (!lean) return;
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
run(MOVES[lean], false);
|
|
177
|
+
}
|
|
178
|
+
function run(command, focus = true) {
|
|
179
|
+
const { editor } = props;
|
|
180
|
+
if (!editor) return;
|
|
181
|
+
editor.run(command);
|
|
182
|
+
if (focus) editor.focus?.();
|
|
183
|
+
}
|
|
184
|
+
onBeforeUnmount(() => {
|
|
185
|
+
stop();
|
|
186
|
+
endStick();
|
|
187
|
+
});
|
|
119
188
|
return (_ctx, _cache) => {
|
|
120
189
|
return openBlock(), createElementBlock("div", {
|
|
121
190
|
class: normalizeClass(unref(ns).b()),
|
|
@@ -141,25 +210,32 @@ var code_keys_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
141
210
|
onPointerleave: stop,
|
|
142
211
|
onClick: ($event) => onClick($event, key)
|
|
143
212
|
}, [key.icon ? (openBlock(), createBlock(resolveDynamicComponent(key.icon), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(key.label), 1)], 64))], 42, _hoisted_2);
|
|
144
|
-
}), 128))], 2), createElementVNode("div", { class: normalizeClass(unref(ns).e("arrows")) }, [(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
213
|
+
}), 128))], 2), createElementVNode("div", { class: normalizeClass(unref(ns).e("arrows")) }, [createElementVNode("button", {
|
|
214
|
+
type: "button",
|
|
215
|
+
class: normalizeClass([unref(ns).e("stick"), unref(ns).is("held", held.value)]),
|
|
216
|
+
"aria-label": unref(messages).moveCursor,
|
|
217
|
+
title: unref(messages).moveCursor,
|
|
218
|
+
"aria-keyshortcuts": "ArrowUp ArrowDown ArrowLeft ArrowRight",
|
|
219
|
+
onPointerdown: onStickDown,
|
|
220
|
+
onPointermove: onStickMove,
|
|
221
|
+
onPointerup: endStick,
|
|
222
|
+
onPointercancel: endStick,
|
|
223
|
+
onLostpointercapture: endStick,
|
|
224
|
+
onKeydown: onStickKey
|
|
225
|
+
}, [createElementVNode("span", {
|
|
226
|
+
class: normalizeClass(unref(ns).e("pad")),
|
|
227
|
+
style: normalizeStyle(held.value ? { translate: `${padShift.value.x}px ${padShift.value.y}px` } : void 0),
|
|
228
|
+
"aria-hidden": "true"
|
|
229
|
+
}, [
|
|
230
|
+
createVNode(unref(ChevronUpIcon), { class: normalizeClass([unref(ns).e("way"), unref(ns).is("up", true)]) }, null, 8, ["class"]),
|
|
231
|
+
createVNode(unref(ChevronRightIcon), { class: normalizeClass([unref(ns).e("way"), unref(ns).is("right", true)]) }, null, 8, ["class"]),
|
|
232
|
+
createVNode(unref(ChevronDownIcon), { class: normalizeClass([unref(ns).e("way"), unref(ns).is("down", true)]) }, null, 8, ["class"]),
|
|
233
|
+
createVNode(unref(ChevronLeftIcon), { class: normalizeClass([unref(ns).e("way"), unref(ns).is("left", true)]) }, null, 8, ["class"]),
|
|
234
|
+
createElementVNode("span", {
|
|
235
|
+
class: normalizeClass(unref(ns).e("thumb")),
|
|
236
|
+
style: normalizeStyle({ transform: `translate(${thumb.value.x}px, ${thumb.value.y}px)` })
|
|
237
|
+
}, null, 6)
|
|
238
|
+
], 6)], 42, _hoisted_3)], 2)], 42, _hoisted_1);
|
|
163
239
|
};
|
|
164
240
|
}
|
|
165
241
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-keys.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_withModifiers","_createElementVNode","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_createTextVNode","_toDisplayString"],"sources":["../src/code-keys.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon } from '@dou-ui/icons'\nimport { useNamespace } from 'dou-ui'\nimport { computed, onBeforeUnmount, ref } from 'vue'\nimport {\n type CodeCommand,\n cursorCharLeft,\n cursorCharRight,\n cursorLineDown,\n cursorLineUp,\n typeText,\n} from './core/commands'\nimport { defaultCodeKeys, keyName } from './code-keys'\nimport { useCodeMessages } from './locale'\nimport type { CodeKey, CodeKeysProps } from './types'\n\ndefineOptions({ name: 'DouCodeKeys' })\n\nconst props = withDefaults(defineProps<CodeKeysProps>(), {\n editor: undefined,\n keys: undefined,\n messages: undefined,\n})\n\nconst ns = useNamespace('code-keys')\nconst messages = useCodeMessages(() => props.messages)\n\n/** Keys that scroll; a string is a key that types itself. */\nconst symbolKeys = computed<CodeKey[]>(() =>\n (props.keys ?? defaultCodeKeys).map((key) => (typeof key === 'string' ? { label: key } : key)),\n)\n\n/** Moving the cursor, always at hand at the end of the bar. */\nconst arrowKeys = computed<CodeKey[]>(() => {\n const m = messages.value\n return [\n { label: m.cursorLeft, icon: ChevronLeftIcon, command: cursorCharLeft, repeat: true },\n { label: m.cursorUp, icon: ChevronUpIcon, command: cursorLineUp, repeat: true },\n { label: m.cursorDown, icon: ChevronDownIcon, command: cursorLineDown, repeat: true },\n { label: m.cursorRight, icon: ChevronRightIcon, command: cursorCharRight, repeat: true },\n ]\n})\n\nfunction fire(key: CodeKey) {\n const command: CodeCommand = key.command ?? typeText(key.text ?? key.label)\n const { editor } = props\n if (!editor) return\n editor.run(command)\n // A key pressed while the editor is away (beside it on a desktop) brings the cursor back into view.\n editor.focus?.()\n}\n\n/** How far a finger may slide on a key before it counts as scrolling the bar. */\nconst SLOP = 8\nconst pressed = ref<string | null>(null)\nlet press: {\n id: string\n key: CodeKey\n pointer: number\n x: number\n y: number\n timer: number\n /** It already repeated, so lifting the finger types nothing more. */\n fired: boolean\n} | null = null\n\nfunction stop() {\n if (press) {\n clearTimeout(press.timer)\n clearInterval(press.timer)\n }\n press = null\n pressed.value = null\n}\n\nfunction onPointerDown(event: PointerEvent, key: CodeKey, id: string) {\n if (event.button !== 0) return\n stop()\n pressed.value = id\n press = {\n id,\n key,\n pointer: event.pointerId,\n x: event.clientX,\n y: event.clientY,\n timer: 0,\n fired: false,\n }\n if (!key.repeat) return\n // Held, a key goes on: after a pause, then quickly.\n press.timer = window.setTimeout(() => {\n if (!press) return\n press.fired = true\n fire(key)\n press.timer = window.setInterval(() => fire(key), 60)\n }, 400)\n}\n\nfunction onPointerMove(event: PointerEvent) {\n if (!press || event.pointerId !== press.pointer || press.fired) return\n if (Math.hypot(event.clientX - press.x, event.clientY - press.y) > SLOP) stop()\n}\n\nfunction onPointerUp(event: PointerEvent) {\n if (!press || event.pointerId !== press.pointer) return\n const { key, fired } = press\n stop()\n if (!fired) fire(key)\n}\n\n// A key pressed from the keyboard clicks with no pointer behind it.\nfunction onClick(event: MouseEvent, key: CodeKey) {\n if (event.detail === 0) fire(key)\n}\n\nonBeforeUnmount(stop)\n</script>\n\n<template>\n <div\n :class=\"ns.b()\"\n role=\"toolbar\"\n :aria-label=\"messages.keys\"\n @mousedown.prevent\n @contextmenu.prevent\n >\n <div :class=\"ns.e('scroll')\">\n <button\n v-for=\"(key, i) in symbolKeys\"\n :key=\"`s${i}`\"\n type=\"button\"\n :class=\"[ns.e('key'), ns.is('pressed', pressed === `s${i}`), ns.is('icon', !!key.icon)]\"\n :aria-label=\"keyName(key, messages)\"\n :title=\"key.icon ? keyName(key, messages) : undefined\"\n @pointerdown=\"onPointerDown($event, key, `s${i}`)\"\n @pointermove=\"onPointerMove\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"stop\"\n @pointerleave=\"stop\"\n @click=\"onClick($event, key)\"\n >\n <component :is=\"key.icon\" v-if=\"key.icon\" />\n <template v-else>{{ key.label }}</template>\n </button>\n </div>\n <div :class=\"ns.e('arrows')\">\n <button\n v-for=\"(key, i) in arrowKeys\"\n :key=\"`a${i}`\"\n type=\"button\"\n :class=\"[ns.e('key'), ns.is('pressed', pressed === `a${i}`), ns.is('icon', true)]\"\n :aria-label=\"key.label\"\n :title=\"key.label\"\n @pointerdown=\"onPointerDown($event, key, `a${i}`)\"\n @pointermove=\"onPointerMove\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"stop\"\n @pointerleave=\"stop\"\n @click=\"onClick($event, key)\"\n >\n <component :is=\"key.icon\" />\n </button>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqDA,IAAM,OAAO;;;;;;;;;;EAnCb,MAAM,QAAQ;EAMd,MAAM,KAAK,aAAa,WAAW;EACnC,MAAM,WAAW,sBAAsB,MAAM,QAAQ;;EAGrD,MAAM,aAAa,gBAChB,MAAM,QAAQ,gBAAA,CAAiB,KAAK,QAAS,OAAO,QAAQ,WAAW,EAAE,OAAO,IAAI,IAAI,GAAI,CAC/F;;EAGA,MAAM,YAAY,eAA0B;GAC1C,MAAM,IAAI,SAAS;GACnB,OAAO;IACL;KAAE,OAAO,EAAE;KAAY,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,gBAAc;KACd,UAAK,WAAE,QAAQ,QAAQ,GAAG;I,IAEK,IAAI,QAApCH,UAAA,GAAAQ,YAA4CC,wBAA5B,IAAI,IAAI,GAAA,EAAA,KAAA,EAAA,CAAA,MACxBT,UAAA,GAAAC,mBAA2CK,UAAA,EAAA,KAAA,EAAA,GAAA,CAAvBI,gBAAAC,gBAAA,IAAI,KAAK,GAAA,CAAA,C;G,gBAGjCN,mBAiBM,OAAA,EAjBA,OAAKH,eAAEC,MAAA,EAAA,CAAE,CAAC,EAAC,QAAA,CAAA,E,KACfH,UAAA,IAAA,GAAAC,mBAeSK,UAAA,MAAAC,WAdY,UAAA,QAAX,KAAK,MAAC;IADhB,OAAAP,UAAA,GAAAC,mBAeS,UAAA;KAbN,KAAG,IAAM;KACV,MAAK;KACJ,OAAKC,eAAA;MAAGC,MAAA,EAAA,CAAE,CAAC,EAAC,KAAA;MAASA,MAAA,EAAA,CAAE,CAAC,GAAE,WAAY,QAAA,UAAO,IAAS,GAAC;MAAKA,MAAA,EAAA,CAAE,CAAC,GAAE,QAAA,IAAA;KAAA,CAAA;KACjE,cAAY,IAAI;KAChB,OAAO,IAAI;KACX,gBAAW,WAAE,cAAc,QAAQ,KAAG,IAAM,GAAC;KAC7C,eAAa;KACb,aAAW;KACX,iBAAe;KACf,gBAAc;KACd,UAAK,WAAE,QAAQ,QAAQ,GAAG;I,KAE3BH,UAAA,GAAAQ,YAA4BC,wBAAZ,IAAI,IAAI,CAAA,E"}
|
|
1
|
+
{"version":3,"file":"code-keys.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_withModifiers","_createElementVNode","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_createTextVNode","_toDisplayString","_normalizeStyle","_createVNode"],"sources":["../src/code-keys.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from 'dou-ui'\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon } from '@dou-ui/icons'\nimport { computed, onBeforeUnmount, ref } from 'vue'\nimport {\n type CodeCommand,\n cursorCharLeft,\n cursorCharRight,\n cursorLineDown,\n cursorLineUp,\n typeText,\n} from './core/commands'\nimport { defaultCodeKeys, keyName } from './code-keys'\nimport { useCodeMessages } from './locale'\nimport { visibleViewport } from './view/viewport'\nimport type { CodeKey, CodeKeysProps } from './types'\n\ndefineOptions({ name: 'DouCodeKeys' })\n\nconst props = withDefaults(defineProps<CodeKeysProps>(), {\n editor: undefined,\n keys: undefined,\n messages: undefined,\n})\n\nconst ns = useNamespace('code-keys')\nconst messages = useCodeMessages(() => props.messages)\n\n/** Keys that scroll; a string is a key that types itself. */\nconst symbolKeys = computed<CodeKey[]>(() =>\n (props.keys ?? defaultCodeKeys).map((key) => (typeof key === 'string' ? { label: key } : key)),\n)\n\nfunction fire(key: CodeKey) {\n run(key.command ?? typeText(key.text ?? key.label))\n}\n\n/** How far a finger may slide on a key before it counts as scrolling the bar. */\nconst SLOP = 8\nconst pressed = ref<string | null>(null)\nlet press: {\n id: string\n key: CodeKey\n pointer: number\n x: number\n y: number\n timer: number\n /** It already repeated, so lifting the finger types nothing more. */\n fired: boolean\n} | null = null\n\nfunction stop() {\n if (press) {\n clearTimeout(press.timer)\n clearInterval(press.timer)\n }\n press = null\n pressed.value = null\n}\n\nfunction onPointerDown(event: PointerEvent, key: CodeKey, id: string) {\n if (event.button !== 0) return\n stop()\n pressed.value = id\n press = {\n id,\n key,\n pointer: event.pointerId,\n x: event.clientX,\n y: event.clientY,\n timer: 0,\n fired: false,\n }\n if (!key.repeat) return\n // Held, a key goes on: after a pause, then quickly.\n press.timer = window.setTimeout(() => {\n if (!press) return\n press.fired = true\n fire(key)\n press.timer = window.setInterval(() => fire(key), 60)\n }, 400)\n}\n\nfunction onPointerMove(event: PointerEvent) {\n if (!press || event.pointerId !== press.pointer || press.fired) return\n if (Math.hypot(event.clientX - press.x, event.clientY - press.y) > SLOP) stop()\n}\n\nfunction onPointerUp(event: PointerEvent) {\n if (!press || event.pointerId !== press.pointer) return\n const { key, fired } = press\n stop()\n if (!fired) fire(key)\n}\n\n// A key pressed from the keyboard clicks with no pointer behind it.\nfunction onClick(event: MouseEvent, key: CodeKey) {\n if (event.detail === 0) fire(key)\n}\n\n/**\n * The stick at the end of the bar moves the cursor. Pressed, it grows into a\n * round pad over the bar, the way a number field's keys do, so a thumb has\n * room to lean it: past its rest it steps the way it leans, and the further,\n * the faster. Lifted, it shrinks back.\n */\nconst STICK_REACH = 26\nconst STICK_REST = 8\n/** The pad's radius once grown, and the room it keeps from the window's edge. */\nconst PAD_RADIUS = 52\nconst PAD_MARGIN = 4\nconst MOVES = {\n left: cursorCharLeft,\n right: cursorCharRight,\n up: cursorLineUp,\n down: cursorLineDown,\n} as const\ntype Lean = keyof typeof MOVES\nconst thumb = ref({ x: 0, y: 0 })\nconst held = ref(false)\n/** How far the pad moves in from the window's edge to fit, in px. */\nconst padShift = ref({ x: 0, y: 0 })\nlet stick: {\n pointer: number\n x: number\n y: number\n timer: number\n lean: Lean | null\n far: number\n} | null = null\n\nfunction leanOf(x: number, y: number): Lean | null {\n if (Math.hypot(x, y) < STICK_REST) return null\n return Math.abs(x) >= Math.abs(y) ? (x < 0 ? 'left' : 'right') : y < 0 ? 'up' : 'down'\n}\n\n/** Steps while the stick leans: slowly near its rest, fast pushed all the way and beyond. */\nfunction stepStick() {\n if (!stick?.lean) return\n run(MOVES[stick.lean])\n stick.timer = window.setTimeout(stepStick, 280 - stick.far * 240)\n}\n\nfunction onStickDown(event: PointerEvent) {\n if (event.button !== 0) return\n event.preventDefault()\n endStick()\n const el = event.currentTarget as HTMLElement\n el.setPointerCapture?.(event.pointerId)\n // Grown from its middle, the pad moves in as it grows wherever it would reach past the window's edge.\n const box = el.getBoundingClientRect()\n const cx = box.left + box.width / 2\n const cy = box.top + box.height / 2\n const room = PAD_RADIUS + PAD_MARGIN\n const view = visibleViewport()\n padShift.value = {\n x: Math.min(0, view.left + view.width - room - cx) + Math.max(0, view.left + room - cx),\n y: Math.min(0, view.top + view.height - room - cy) + Math.max(0, view.top + room - cy),\n }\n held.value = true\n stick = {\n pointer: event.pointerId,\n x: event.clientX,\n y: event.clientY,\n timer: 0,\n lean: null,\n far: 0,\n }\n}\n\nfunction onStickMove(event: PointerEvent) {\n if (!stick || event.pointerId !== stick.pointer) return\n const x = event.clientX - stick.x\n const y = event.clientY - stick.y\n const d = Math.hypot(x, y)\n const k = d > STICK_REACH ? STICK_REACH / d : 1\n thumb.value = { x: x * k, y: y * k }\n stick.far = Math.min(1, Math.max(0, d - STICK_REST) / (STICK_REACH * 1.5 - STICK_REST))\n const lean = leanOf(x, y)\n if (lean === stick.lean) return\n clearTimeout(stick.timer)\n stick.lean = lean\n // A new way steps at once, then goes on.\n stepStick()\n}\n\nfunction endStick() {\n if (stick) clearTimeout(stick.timer)\n stick = null\n held.value = false\n thumb.value = { x: 0, y: 0 }\n}\n\n/** With the stick focused, the arrow keys move the cursor. */\nfunction onStickKey(event: KeyboardEvent) {\n const lean = (\n { ArrowLeft: 'left', ArrowRight: 'right', ArrowUp: 'up', ArrowDown: 'down' } as const\n )[event.key as 'ArrowLeft']\n if (!lean) return\n event.preventDefault()\n // From the keyboard, the focus stays on the stick, for the next arrow.\n run(MOVES[lean], false)\n}\n\nfunction run(command: CodeCommand, focus = true) {\n const { editor } = props\n if (!editor) return\n editor.run(command)\n // A key pressed while the editor is away (beside it on a desktop) brings the cursor back into view.\n if (focus) editor.focus?.()\n}\n\nonBeforeUnmount(() => {\n stop()\n endStick()\n})\n</script>\n\n<template>\n <div\n :class=\"ns.b()\"\n role=\"toolbar\"\n :aria-label=\"messages.keys\"\n @mousedown.prevent\n @contextmenu.prevent\n >\n <div :class=\"ns.e('scroll')\">\n <button\n v-for=\"(key, i) in symbolKeys\"\n :key=\"`s${i}`\"\n type=\"button\"\n :class=\"[ns.e('key'), ns.is('pressed', pressed === `s${i}`), ns.is('icon', !!key.icon)]\"\n :aria-label=\"keyName(key, messages)\"\n :title=\"key.icon ? keyName(key, messages) : undefined\"\n @pointerdown=\"onPointerDown($event, key, `s${i}`)\"\n @pointermove=\"onPointerMove\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"stop\"\n @pointerleave=\"stop\"\n @click=\"onClick($event, key)\"\n >\n <component :is=\"key.icon\" v-if=\"key.icon\" />\n <template v-else>{{ key.label }}</template>\n </button>\n </div>\n <div :class=\"ns.e('arrows')\">\n <button\n type=\"button\"\n :class=\"[ns.e('stick'), ns.is('held', held)]\"\n :aria-label=\"messages.moveCursor\"\n :title=\"messages.moveCursor\"\n aria-keyshortcuts=\"ArrowUp ArrowDown ArrowLeft ArrowRight\"\n @pointerdown=\"onStickDown\"\n @pointermove=\"onStickMove\"\n @pointerup=\"endStick\"\n @pointercancel=\"endStick\"\n @lostpointercapture=\"endStick\"\n @keydown=\"onStickKey\"\n >\n <span\n :class=\"ns.e('pad')\"\n :style=\"held ? { translate: `${padShift.x}px ${padShift.y}px` } : undefined\"\n aria-hidden=\"true\"\n >\n <ChevronUpIcon :class=\"[ns.e('way'), ns.is('up', true)]\" />\n <ChevronRightIcon :class=\"[ns.e('way'), ns.is('right', true)]\" />\n <ChevronDownIcon :class=\"[ns.e('way'), ns.is('down', true)]\" />\n <ChevronLeftIcon :class=\"[ns.e('way'), ns.is('left', true)]\" />\n <span\n :class=\"ns.e('thumb')\"\n :style=\"{ transform: `translate(${thumb.x}px, ${thumb.y}px)` }\"\n />\n </span>\n </button>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;AAsCA,IAAM,OAAO;AAoEb,IAAM,cAAc;AACpB,IAAM,aAAa;;;;;;;;;;EAxFnB,MAAM,QAAQ;EAMd,MAAM,KAAK,aAAa,WAAW;EACnC,MAAM,WAAW,sBAAsB,MAAM,QAAQ;;EAGrD,MAAM,aAAa,gBAChB,MAAM,QAAQ,gBAAA,CAAiB,KAAK,QAAS,OAAO,QAAQ,WAAW,EAAE,OAAO,IAAI,IAAI,GAA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|
|
1
|
-
{"version":3,"file":"code-keys2.js","names":["_sfc_main"],"sources":["../src/code-keys.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {
|
|
1
|
+
{"version":3,"file":"code-keys2.js","names":["_sfc_main"],"sources":["../src/code-keys.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from 'dou-ui'\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon } from '@dou-ui/icons'\nimport { computed, onBeforeUnmount, ref } from 'vue'\nimport {\n type CodeCommand,\n cursorCharLeft,\n cursorCharRight,\n cursorLineDown,\n cursorLineUp,\n typeText,\n} from './core/commands'\nimport { defaultCodeKeys, keyName } from './code-keys'\nimport { useCodeMessages } from './locale'\nimport { visibleViewport } from './view/viewport'\nimport type { CodeKey, CodeKeysProps } from './types'\n\ndefineOptions({ name: 'DouCodeKeys' })\n\nconst props = withDefaults(defineProps<CodeKeysProps>(), {\n editor: undefined,\n keys: undefined,\n messages: undefined,\n})\n\nconst ns = useNamespace('code-keys')\nconst messages = useCodeMessages(() => props.messages)\n\n/** Keys that scroll; a string is a key that types itself. */\nconst symbolKeys = computed<CodeKey[]>(() =>\n (props.keys ?? defaultCodeKeys).map((key) => (typeof key === 'string' ? { label: key } : key)),\n)\n\nfunction fire(key: CodeKey) {\n run(key.command ?? typeText(key.text ?? key.label))\n}\n\n/** How far a finger may slide on a key before it counts as scrolling the bar. */\nconst SLOP = 8\nconst pressed = ref<string | null>(null)\nlet press: {\n id: string\n key: CodeKey\n pointer: number\n x: number\n y: number\n timer: number\n /** It already repeated, so lifting the finger types nothing more. */\n fired: boolean\n} | null = null\n\nfunction stop() {\n if (press) {\n clearTimeout(press.timer)\n clearInterval(press.timer)\n }\n press = null\n pressed.value = null\n}\n\nfunction onPointerDown(event: PointerEvent, key: CodeKey, id: string) {\n if (event.button !== 0) return\n stop()\n pressed.value = id\n press = {\n id,\n key,\n pointer: event.pointerId,\n x: event.clientX,\n y: event.clientY,\n timer: 0,\n fired: false,\n }\n if (!key.repeat) return\n // Held, a key goes on: after a pause, then quickly.\n press.timer = window.setTimeout(() => {\n if (!press) return\n press.fired = true\n fire(key)\n press.timer = window.setInterval(() => fire(key), 60)\n }, 400)\n}\n\nfunction onPointerMove(event: PointerEvent) {\n if (!press || event.pointerId !== press.pointer || press.fired) return\n if (Math.hypot(event.clientX - press.x, event.clientY - press.y) > SLOP) stop()\n}\n\nfunction onPointerUp(event: PointerEvent) {\n if (!press || event.pointerId !== press.pointer) return\n const { key, fired } = press\n stop()\n if (!fired) fire(key)\n}\n\n// A key pressed from the keyboard clicks with no pointer behind it.\nfunction onClick(event: MouseEvent, key: CodeKey) {\n if (event.detail === 0) fire(key)\n}\n\n/**\n * The stick at the end of the bar moves the cursor. Pressed, it grows into a\n * round pad over the bar, the way a number field's keys do, so a thumb has\n * room to lean it: past its rest it steps the way it leans, and the further,\n * the faster. Lifted, it shrinks back.\n */\nconst STICK_REACH = 26\nconst STICK_REST = 8\n/** The pad's radius once grown, and the room it keeps from the window's edge. */\nconst PAD_RADIUS = 52\nconst PAD_MARGIN = 4\nconst MOVES = {\n left: cursorCharLeft,\n right: cursorCharRight,\n up: cursorLineUp,\n down: cursorLineDown,\n} as const\ntype Lean = keyof typeof MOVES\nconst thumb = ref({ x: 0, y: 0 })\nconst held = ref(false)\n/** How far the pad moves in from the window's edge to fit, in px. */\nconst padShift = ref({ x: 0, y: 0 })\nlet stick: {\n pointer: number\n x: number\n y: number\n timer: number\n lean: Lean | null\n far: number\n} | null = null\n\nfunction leanOf(x: number, y: number): Lean | null {\n if (Math.hypot(x, y) < STICK_REST) return null\n return Math.abs(x) >= Math.abs(y) ? (x < 0 ? 'left' : 'right') : y < 0 ? 'up' : 'down'\n}\n\n/** Steps while the stick leans: slowly near its rest, fast pushed all the way and beyond. */\nfunction stepStick() {\n if (!stick?.lean) return\n run(MOVES[stick.lean])\n stick.timer = window.setTimeout(stepStick, 280 - stick.far * 240)\n}\n\nfunction onStickDown(event: PointerEvent) {\n if (event.button !== 0) return\n event.preventDefault()\n endStick()\n const el = event.currentTarget as HTMLElement\n el.setPointerCapture?.(event.pointerId)\n // Grown from its middle, the pad moves in as it grows wherever it would reach past the window's edge.\n const box = el.getBoundingClientRect()\n const cx = box.left + box.width / 2\n const cy = box.top + box.height / 2\n const room = PAD_RADIUS + PAD_MARGIN\n const view = visibleViewport()\n padShift.value = {\n x: Math.min(0, view.left + view.width - room - cx) + Math.max(0, view.left + room - cx),\n y: Math.min(0, view.top + view.height - room - cy) + Math.max(0, view.top + room - cy),\n }\n held.value = true\n stick = {\n pointer: event.pointerId,\n x: event.clientX,\n y: event.clientY,\n timer: 0,\n lean: null,\n far: 0,\n }\n}\n\nfunction onStickMove(event: PointerEvent) {\n if (!stick || event.pointerId !== stick.pointer) return\n const x = event.clientX - stick.x\n const y = event.clientY - stick.y\n const d = Math.hypot(x, y)\n const k = d > STICK_REACH ? STICK_REACH / d : 1\n thumb.value = { x: x * k, y: y * k }\n stick.far = Math.min(1, Math.max(0, d - STICK_REST) / (STICK_REACH * 1.5 - STICK_REST))\n const lean = leanOf(x, y)\n if (lean === stick.lean) return\n clearTimeout(stick.timer)\n stick.lean = lean\n // A new way steps at once, then goes on.\n stepStick()\n}\n\nfunction endStick() {\n if (stick) clearTimeout(stick.timer)\n stick = null\n held.value = false\n thumb.value = { x: 0, y: 0 }\n}\n\n/** With the stick focused, the arrow keys move the cursor. */\nfunction onStickKey(event: KeyboardEvent) {\n const lean = (\n { ArrowLeft: 'left', ArrowRight: 'right', ArrowUp: 'up', ArrowDown: 'down' } as const\n )[event.key as 'ArrowLeft']\n if (!lean) return\n event.preventDefault()\n // From the keyboard, the focus stays on the stick, for the next arrow.\n run(MOVES[lean], false)\n}\n\nfunction run(command: CodeCommand, focus = true) {\n const { editor } = props\n if (!editor) return\n editor.run(command)\n // A key pressed while the editor is away (beside it on a desktop) brings the cursor back into view.\n if (focus) editor.focus?.()\n}\n\nonBeforeUnmount(() => {\n stop()\n endStick()\n})\n</script>\n\n<template>\n <div\n :class=\"ns.b()\"\n role=\"toolbar\"\n :aria-label=\"messages.keys\"\n @mousedown.prevent\n @contextmenu.prevent\n >\n <div :class=\"ns.e('scroll')\">\n <button\n v-for=\"(key, i) in symbolKeys\"\n :key=\"`s${i}`\"\n type=\"button\"\n :class=\"[ns.e('key'), ns.is('pressed', pressed === `s${i}`), ns.is('icon', !!key.icon)]\"\n :aria-label=\"keyName(key, messages)\"\n :title=\"key.icon ? keyName(key, messages) : undefined\"\n @pointerdown=\"onPointerDown($event, key, `s${i}`)\"\n @pointermove=\"onPointerMove\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"stop\"\n @pointerleave=\"stop\"\n @click=\"onClick($event, key)\"\n >\n <component :is=\"key.icon\" v-if=\"key.icon\" />\n <template v-else>{{ key.label }}</template>\n </button>\n </div>\n <div :class=\"ns.e('arrows')\">\n <button\n type=\"button\"\n :class=\"[ns.e('stick'), ns.is('held', held)]\"\n :aria-label=\"messages.moveCursor\"\n :title=\"messages.moveCursor\"\n aria-keyshortcuts=\"ArrowUp ArrowDown ArrowLeft ArrowRight\"\n @pointerdown=\"onStickDown\"\n @pointermove=\"onStickMove\"\n @pointerup=\"endStick\"\n @pointercancel=\"endStick\"\n @lostpointercapture=\"endStick\"\n @keydown=\"onStickKey\"\n >\n <span\n :class=\"ns.e('pad')\"\n :style=\"held ? { translate: `${padShift.x}px ${padShift.y}px` } : undefined\"\n aria-hidden=\"true\"\n >\n <ChevronUpIcon :class=\"[ns.e('way'), ns.is('up', true)]\" />\n <ChevronRightIcon :class=\"[ns.e('way'), ns.is('right', true)]\" />\n <ChevronDownIcon :class=\"[ns.e('way'), ns.is('down', true)]\" />\n <ChevronLeftIcon :class=\"[ns.e('way'), ns.is('left', true)]\" />\n <span\n :class=\"ns.e('thumb')\"\n :style=\"{ transform: `translate(${thumb.x}px, ${thumb.y}px)` }\"\n />\n </span>\n </button>\n </div>\n </div>\n</template>\n"],"mappings":""}
|
package/dist/locale.js
CHANGED
|
@@ -14,11 +14,9 @@ var zhCN = {
|
|
|
14
14
|
selectAll: "全选",
|
|
15
15
|
goToDefinition: "跳到定义",
|
|
16
16
|
keys: "符号栏",
|
|
17
|
+
moveKeys: "移动符号栏",
|
|
17
18
|
indent: "缩进",
|
|
18
|
-
|
|
19
|
-
cursorRight: "光标右移",
|
|
20
|
-
cursorUp: "光标上移",
|
|
21
|
-
cursorDown: "光标下移",
|
|
19
|
+
moveCursor: "移动光标",
|
|
22
20
|
undo: "撤销",
|
|
23
21
|
redo: "重做",
|
|
24
22
|
error: "错误",
|
|
@@ -60,11 +58,9 @@ var zhTW = {
|
|
|
60
58
|
selectAll: "全選",
|
|
61
59
|
goToDefinition: "跳至定義",
|
|
62
60
|
keys: "符號列",
|
|
61
|
+
moveKeys: "移動符號列",
|
|
63
62
|
indent: "縮排",
|
|
64
|
-
|
|
65
|
-
cursorRight: "游標右移",
|
|
66
|
-
cursorUp: "游標上移",
|
|
67
|
-
cursorDown: "游標下移",
|
|
63
|
+
moveCursor: "移動游標",
|
|
68
64
|
undo: "復原",
|
|
69
65
|
redo: "重做",
|
|
70
66
|
error: "錯誤",
|
|
@@ -106,11 +102,9 @@ var en = {
|
|
|
106
102
|
selectAll: "Select all",
|
|
107
103
|
goToDefinition: "Go to definition",
|
|
108
104
|
keys: "Symbols",
|
|
105
|
+
moveKeys: "Move symbols",
|
|
109
106
|
indent: "Indent",
|
|
110
|
-
|
|
111
|
-
cursorRight: "Move right",
|
|
112
|
-
cursorUp: "Move up",
|
|
113
|
-
cursorDown: "Move down",
|
|
107
|
+
moveCursor: "Move cursor",
|
|
114
108
|
undo: "Undo",
|
|
115
109
|
redo: "Redo",
|
|
116
110
|
error: "Error",
|
package/dist/locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","names":[],"sources":["../src/locale.ts"],"sourcesContent":["import { useLocale } from 'dou-ui'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nexport interface CodeMessages {\n /** The marker of a folded block, as a tooltip. */\n unfold: string\n /** Read out after folding: `{from}`, `{to}` are the hidden lines. */\n folded: string\n unfolded: string\n foldedAll: string\n unfoldedAll: string\n /** The toolbar over a selection on touch screens. */\n editMenu: string\n cut: string\n copy: string\n paste: string\n selectAll: string\n /** Toolbar button of a language server (`@dou-ui/code/lsp`): go to where the name is defined. */\n goToDefinition: string\n /** The bar of symbol keys
|
|
1
|
+
{"version":3,"file":"locale.js","names":[],"sources":["../src/locale.ts"],"sourcesContent":["import { useLocale } from 'dou-ui'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nexport interface CodeMessages {\n /** The marker of a folded block, as a tooltip. */\n unfold: string\n /** Read out after folding: `{from}`, `{to}` are the hidden lines. */\n folded: string\n unfolded: string\n foldedAll: string\n unfoldedAll: string\n /** The toolbar over a selection on touch screens. */\n editMenu: string\n cut: string\n copy: string\n paste: string\n selectAll: string\n /** Toolbar button of a language server (`@dou-ui/code/lsp`): go to where the name is defined. */\n goToDefinition: string\n /** The bar of symbol keys on a touch screen. */\n keys: string\n /** The grip that moves the bar of symbol keys. */\n moveKeys: string\n /** The Tab key on that bar. */\n indent: string\n /** The stick at the end of the bar of keys, which moves the cursor. */\n moveCursor: string\n undo: string\n redo: string\n error: string\n warning: string\n info: string\n hint: string\n /** The box with the problems at a place in the text. */\n problems: string\n /** Read out when the cursor moves to a problem: `{line}`, `{severity}`, `{message}`. */\n problemAt: string\n /** Read out when a fix or a completion is picked: `{label}`, `{index}`, `{count}`. */\n itemAt: string\n /** The box with the text about a place, and its problems. */\n details: string\n /** The completion list. */\n completions: string\n /** The box with the parameters of a call. */\n signature: string\n /** The diff view's name. */\n diff: string\n /** The original side's label. */\n diffOriginal: string\n /** The modified side's label. */\n diffModified: string\n diffPrevious: string\n diffNext: string\n /** Shows the two sides next to each other. */\n diffSplit: string\n /** Shows the changes in one column. */\n diffInline: string\n /** Shows all the unchanged lines. */\n diffExpandAll: string\n /** Hides the unchanged lines again. */\n diffCollapse: string\n /** The bar over hidden unchanged lines: `{count}`. */\n diffUnchanged: string\n /** How many lines were added and removed: `{added}`, `{removed}`. */\n diffStats: string\n diffNoChanges: string\n /** A removed line, in the gutter. */\n diffRemoved: string\n /** An added line, in the gutter. */\n diffAdded: string\n /** Read out when moving to a change: `{index}`, `{count}`, `{line}`, `{removed}`, `{added}`. */\n diffChangeAt: string\n}\n\nexport const zhCN: CodeMessages = {\n unfold: '展开',\n folded: '已折叠第 {from}–{to} 行',\n unfolded: '已展开',\n foldedAll: '已全部折叠',\n unfoldedAll: '已全部展开',\n editMenu: '编辑',\n cut: '剪切',\n copy: '复制',\n paste: '粘贴',\n selectAll: '全选',\n goToDefinition: '跳到定义',\n keys: '符号栏',\n moveKeys: '移动符号栏',\n indent: '缩进',\n moveCursor: '移动光标',\n undo: '撤销',\n redo: '重做',\n error: '错误',\n warning: '警告',\n info: '信息',\n hint: '提示',\n problems: '问题',\n problemAt: '第 {line} 行,{severity}:{message}',\n itemAt: '{label},第 {index} 项,共 {count} 项',\n details: '说明',\n completions: '补全',\n signature: '参数提示',\n diff: '对比',\n diffOriginal: '原文',\n diffModified: '修改后',\n diffPrevious: '上一处改动',\n diffNext: '下一处改动',\n diffSplit: '并排显示',\n diffInline: '行内显示',\n diffExpandAll: '展开全部',\n diffCollapse: '折叠未改动的行',\n diffUnchanged: '{count} 行未改动',\n diffStats: '新增 {added} 行,删除 {removed} 行',\n diffNoChanges: '没有改动',\n diffRemoved: '删除',\n diffAdded: '新增',\n diffChangeAt:\n '第 {index} 处改动,共 {count} 处,第 {line} 行:删除 {removed} 行,新增 {added} 行',\n}\n\nexport const zhTW: CodeMessages = {\n unfold: '展開',\n folded: '已摺疊第 {from}–{to} 行',\n unfolded: '已展開',\n foldedAll: '已全部摺疊',\n unfoldedAll: '已全部展開',\n editMenu: '編輯',\n cut: '剪下',\n copy: '拷貝',\n paste: '貼上',\n selectAll: '全選',\n goToDefinition: '跳至定義',\n keys: '符號列',\n moveKeys: '移動符號列',\n indent: '縮排',\n moveCursor: '移動游標',\n undo: '復原',\n redo: '重做',\n error: '錯誤',\n warning: '警告',\n info: '資訊',\n hint: '提示',\n problems: '問題',\n problemAt: '第 {line} 行,{severity}:{message}',\n itemAt: '{label},第 {index} 項,共 {count} 項',\n details: '說明',\n completions: '自動完成',\n signature: '參數提示',\n diff: '對比',\n diffOriginal: '原文',\n diffModified: '修改後',\n diffPrevious: '上一處改動',\n diffNext: '下一處改動',\n diffSplit: '並排顯示',\n diffInline: '行內顯示',\n diffExpandAll: '展開全部',\n diffCollapse: '摺疊未改動的行',\n diffUnchanged: '{count} 行未改動',\n diffStats: '新增 {added} 行,刪除 {removed} 行',\n diffNoChanges: '沒有改動',\n diffRemoved: '刪除',\n diffAdded: '新增',\n diffChangeAt:\n '第 {index} 處改動,共 {count} 處,第 {line} 行:刪除 {removed} 行,新增 {added} 行',\n}\n\nexport const en: CodeMessages = {\n unfold: 'Unfold',\n folded: 'Folded lines {from}–{to}',\n unfolded: 'Unfolded',\n foldedAll: 'Folded all',\n unfoldedAll: 'Unfolded all',\n editMenu: 'Edit',\n cut: 'Cut',\n copy: 'Copy',\n paste: 'Paste',\n selectAll: 'Select all',\n goToDefinition: 'Go to definition',\n keys: 'Symbols',\n moveKeys: 'Move symbols',\n indent: 'Indent',\n moveCursor: 'Move cursor',\n undo: 'Undo',\n redo: 'Redo',\n error: 'Error',\n warning: 'Warning',\n info: 'Info',\n hint: 'Hint',\n problems: 'Problems',\n problemAt: 'Line {line}, {severity}: {message}',\n itemAt: '{label}, {index} of {count}',\n details: 'Details',\n completions: 'Suggestions',\n signature: 'Parameter hints',\n diff: 'Diff',\n diffOriginal: 'Original',\n diffModified: 'Modified',\n diffPrevious: 'Previous change',\n diffNext: 'Next change',\n diffSplit: 'Side by side',\n diffInline: 'Inline',\n diffExpandAll: 'Expand all',\n diffCollapse: 'Collapse unchanged lines',\n diffUnchanged: '{count} unchanged lines',\n diffStats: '{added} added, {removed} removed',\n diffNoChanges: 'No changes',\n diffRemoved: 'Removed',\n diffAdded: 'Added',\n diffChangeAt: 'Change {index} of {count}, line {line}: {removed} removed, {added} added',\n}\n\nexport const codeLocales: Record<string, CodeMessages> = {\n 'zh-CN': zhCN,\n 'zh-TW': zhTW,\n en,\n}\n\n/** The code editor's texts, picked by the name of DouUI's current locale. Pass `messages` to override any of them. */\nexport function useCodeMessages(override?: MaybeRefOrGetter<Partial<CodeMessages> | undefined>) {\n const { locale } = useLocale()\n return computed<CodeMessages>(() => {\n const name = locale.value.name\n const base =\n codeLocales[name] ?? codeLocales[name.split('-')[0]!] ?? (name.startsWith('zh') ? zhCN : en)\n const extra = toValue(override)\n if (!extra) return base\n const out = { ...base }\n for (const [key, value] of Object.entries(extra))\n if (value !== undefined) out[key as keyof CodeMessages] = value\n return out\n })\n}\n\n/** Fills `{name}` placeholders. */\nexport const format = (text: string, params: Record<string, string | number>) =>\n text.replace(/\\{(\\w+)\\}/g, (match, key: string) => String(params[key] ?? match))\n"],"mappings":";;;AA0EA,IAAa,OAAqB;CAChC,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,WAAW;CACX,aAAa;CACb,UAAU;CACV,KAAK;CACL,MAAM;CACN,OAAO;CACP,WAAW;CACX,gBAAgB;CAChB,MAAM;CACN,UAAU;CACV,QAAQ;CACR,YAAY;CACZ,MAAM;CACN,MAAM;CACN,OAAO;CACP,SAAS;CACT,MAAM;CACN,MAAM;CACN,UAAU;CACV,WAAW;CACX,QAAQ;CACR,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,cAAc;CACd,cAAc;CACd,cAAc;CACd,UAAU;CACV,WAAW;CACX,YAAY;CACZ,eAAe;CACf,cAAc;CACd,eAAe;CACf,WAAW;CACX,eAAe;CACf,aAAa;CACb,WAAW;CACX,cACE;AACJ;AAEA,IAAa,OAAqB;CAChC,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,WAAW;CACX,aAAa;CACb,UAAU;CACV,KA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M,MAAM,EAAE,GAAG,KAAK;EACtB,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAC7C,IAAI,UAAU,KAAA,GAAW,IAAI,OAA6B;EAC5D,OAAO;CACT,CAAC;AACH;;AAGA,IAAa,UAAU,MAAc,WACnC,KAAK,QAAQ,eAAe,OAAO,QAAgB,OAAO,OAAO,QAAQ,KAAK,CAAC"}
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer dou.components{.dou-code-editor{--dou-code-editor-font-size:var(--dou-font-size-sm);--dou-code-editor-line-height:20px;--dou-code-editor-padding-y:8px;--dou-code-editor-padding-x:12px;--dou-code-editor-bg:var(--dou-color-bg-surface);--dou-code-editor-gutter-bg:var(--dou-code-editor-bg);--dou-code-editor-gutter-text:var(--dou-color-text-tertiary);--dou-code-editor-border:var(--dou-color-border);--dou-code-editor-border-focus:color-mix(in oklab,var(--dou-color-focus)70%,var(--dou-color-text));--dou-code-editor-cursor:var(--dou-color-text);--dou-code-editor-active-line:color-mix(in oklab,var(--dou-color-text)4%,transparent);--dou-code-editor-selection:color-mix(in oklab,var(--dou-color-primary)20%,transparent);--dou-code-editor-match:color-mix(in oklab,var(--dou-color-warning)22%,transparent);--dou-code-editor-match-current:color-mix(in oklab,var(--dou-color-warning-text)80%,transparent);--dou-code-editor-match-mark:color-mix(in oklab,var(--dou-color-warning)60%,transparent);--dou-code-editor-bracket:color-mix(in oklab,var(--dou-color-text)35%,transparent);--dou-code-editor-error:var(--dou-color-danger-text);--dou-code-editor-warning:var(--dou-color-warning-text);--dou-code-editor-info:var(--dou-color-primary-text);--dou-code-editor-bracket-unmatched:color-mix(in oklab,var(--dou-color-danger-text)70%,transparent);position:relative;display:flex;box-sizing:border-box;min-height:calc(var(--dou-code-editor-line-height) + 2*var(--dou-code-editor-padding-y) + 2px);overflow:hidden;border:1px solid var(--dou-code-editor-border);border-radius:var(--dou-radius-container);background-color:var(--dou-code-editor-bg);color:var(--dou-color-text);font-family:var(--dou-font-family-mono);font-size:var(--dou-code-editor-font-size);font-variant-ligatures:none;line-height:var(--dou-code-editor-line-height);transition:border-color var(--dou-motion-duration-fast)var(--dou-motion-easing);flex-direction:column;width:100%;min-width:0}.dou-code-editor.is-focused{border-color:var(--dou-code-editor-border-focus)}.dou-code-editor:not(.is-focused){--dou-code-editor-selection:color-mix(in oklab,var(--dou-color-text)10%,transparent)}.dou-code-editor.is-disabled{color:var(--dou-color-text-disabled);cursor:not-allowed}.dou-code-editor__body{position:relative;display:flex;flex:auto;min-height:0}.dou-code-editor__scroller{position:relative;overflow:auto;overscroll-behavior-x:contain;scrollbar-width:thin;flex:auto;min-width:0;min-height:0}.dou-code-editor__minimap{position:relative;overflow:hidden;box-shadow:inset 1px 0 0 color-mix(in oklab,var(--dou-color-text)6%,transparent);color:var(--dou-color-text-tertiary);cursor:default;touch-action:none;user-select:none;flex:none;width:96px}.dou-code-editor__minimap-canvas{position:absolute;width:100%;height:100%;inset:0}.dou-code-editor__minimap-view{position:absolute;background-color:color-mix(in oklab,var(--dou-color-text)6%,transparent);transition:background-color var(--dou-motion-duration-fast)var(--dou-motion-easing);top:0;left:0;right:0}.dou-code-editor__minimap:hover .dou-code-editor__minimap-view{background-color:color-mix(in oklab,var(--dou-color-text)9%,transparent)}.dou-code-editor__minimap:active .dou-code-editor__minimap-view{background-color:color-mix(in oklab,var(--dou-color-text)12%,transparent)}.dou-code-editor__sizer{position:relative;display:flex;box-sizing:border-box;width:max-content;min-width:100%}.dou-code-editor__gutter{position:sticky;z-index:2;box-sizing:border-box;width:var(--dou-code-editor-gutter);background-color:var(--dou-code-editor-gutter-bg);color:var(--dou-code-editor-gutter-text);font-variant-numeric:tabular-nums;cursor:default;user-select:none;-webkit-user-select:none;touch-action:manipulation;flex:none;left:0}.dou-code-editor__numbers{position:absolute;will-change:transform;top:0;left:0;right:0}.dou-code-editor__number{position:relative;box-sizing:border-box;height:var(--dou-code-editor-line-height);padding:0 12px 0 calc(16px + var(--dou-code-editor-gutter-cells,0px));text-align:right}.dou-code-editor__number.is-active{color:var(--dou-color-text-secondary)}.dou-code-editor.is-foldable .dou-code-editor__number{padding-right:24px}.dou-code-editor__fold-toggle{position:absolute;display:flex;height:var(--dou-code-editor-line-height);color:var(--dou-color-text-tertiary);cursor:pointer;opacity:0;transition:opacity var(--dou-motion-duration-fast)var(--dou-motion-easing);justify-content:center;align-items: center;width:14px;font-size:12px;top:0;right:6px}.dou-code-editor__gutter:hover .dou-code-editor__fold-toggle{opacity:1}.dou-code-editor__fold-toggle.is-folded{opacity:1}.dou-code-editor__fold-toggle:hover{color:var(--dou-color-text)}@media (pointer:coarse){.dou-code-editor__fold-toggle{opacity:1}.dou-code-editor__fold-toggle:before{position:absolute;content:"";inset:-4px -6px}}.dou-code-editor__content{position:relative;cursor:text;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;flex:auto;min-width:0}.dou-code-editor.is-disabled .dou-code-editor__content{cursor:not-allowed}.dou-code-editor__lines,.dou-code-editor__matches,.dou-code-editor__brackets,.dou-code-editor__selections,.dou-code-editor__cursors{position:absolute;pointer-events:none;top:0;left:0}.dou-code-editor__lines{will-change:transform;right:0}.dou-code-editor__line{box-sizing:border-box;height:var(--dou-code-editor-line-height);padding:0 var(--dou-code-editor-padding-x);white-space:pre;tab-size:var(--dou-code-editor-tab-size,2)}.dou-code-editor__line.is-wrapped{height:auto}.dou-code-editor__row{box-sizing:border-box;height:var(--dou-code-editor-line-height)}.dou-code-editor__fold-marker{display:inline-block;box-sizing:border-box;border:1px solid var(--dou-color-border);background-color:var(--dou-color-bg-muted);color:var(--dou-color-text-secondary);vertical-align:1px;cursor:pointer;pointer-events:auto;border-radius:4px;height:16px;margin-left:6px;padding:0 6px;font-size:12px;line-height:14px}.dou-code-editor__fold-marker:hover{color:var(--dou-color-text)}.dou-code-editor__line :-webkit-any(.dou-syntax-heading,.dou-syntax-strong){font-weight:inherit}.dou-code-editor__line :-moz-any(.dou-syntax-heading,.dou-syntax-strong){font-weight:inherit}.dou-code-editor__line :is(.dou-syntax-heading,.dou-syntax-strong){font-weight:inherit}.dou-code-editor__compose{text-decoration:underline;text-decoration-color:var(--dou-color-text-tertiary);text-underline-offset:3px}.dou-code-editor__probe{position:absolute;visibility:hidden;white-space:pre;pointer-events:none;top:0;left:0}.dou-code-editor__active-line{position:absolute;height:var(--dou-code-editor-line-height);background-color:var(--dou-code-editor-active-line);pointer-events:none;top:0;left:0;right:0}.dou-code-editor:not(.is-focused) .dou-code-editor__active-line{background-color:#0000}.dou-code-editor__match{position:absolute;box-sizing:border-box;height:var(--dou-code-editor-line-height);background-color:var(--dou-code-editor-match);border-radius:2px;top:0;left:0}.dou-code-editor__match.is-current{box-shadow:inset 0 0 0 1px var(--dou-code-editor-match-current)}.dou-code-editor__marks{position:absolute;z-index:3;pointer-events:none;width:6px;top:0;bottom:0;right:0}.dou-code-editor__mark{position:absolute;background-color:var(--dou-code-editor-match-mark);border-radius:1px;width:6px;height:2px;right:0}.dou-code-editor__mark.is-current{background-color:var(--dou-code-editor-match-current);height:3px}.dou-code-editor__live{position:absolute;overflow:hidden;clip-path:inset(50%);white-space:nowrap;width:1px;height:1px}.dou-code-editor__search{position:absolute;z-index:4;display:flex;container-type:inline-size;pointer-events:none;justify-content:flex-end;top:6px;left:6px;right:14px}.dou-code-editor__search>*{pointer-events:auto}.dou-code-editor__bracket{position:absolute;box-sizing:border-box;height:var(--dou-code-editor-line-height);border:1px solid var(--dou-code-editor-bracket);border-radius:2px;top:0;left:0}.dou-code-editor__bracket.is-unmatched{border-color:var(--dou-code-editor-bracket-unmatched)}.dou-code-editor__selection{position:absolute;height:var(--dou-code-editor-line-height);background-color:var(--dou-code-editor-selection);border-radius:2px;top:0;left:0}.dou-code-editor__cursor{position:absolute;height:var(--dou-code-editor-line-height);background-color:var(--dou-code-editor-cursor);animation:1.2s step-end .5s infinite dou-code-editor-blink;border-radius:1px;width:2px;top:0;left:0}.dou-code-editor.is-readonly .dou-code-editor__cursor{opacity:.4;animation:none}@media (prefers-reduced-motion:reduce){.dou-code-editor__cursor{animation:none}}.dou-code-editor__placeholder{position:absolute;top:var(--dou-code-editor-padding-y);left:var(--dou-code-editor-padding-x);color:var(--dou-color-text-tertiary);white-space:pre;pointer-events:none}.dou-code-editor__input{position:absolute;z-index:-1;box-sizing:border-box;width:calc(100% - var(--dou-code-editor-padding-x));overflow:hidden;outline:none;color:#0000;caret-color:transparent;font:inherit;font-size:max(var(--dou-font-size-input-min),var(--dou-code-editor-font-size));line-height:inherit;letter-spacing:inherit;white-space:pre;tab-size:var(--dou-code-editor-tab-size,2);resize:none;pointer-events:none;background:0 0;border:0;min-width:1px;margin:0;padding:0}.dou-code-editor__input::selection{background:0 0}}@layer dou.components{.dou-code-editor__problem{text-decoration-line:underline;text-decoration-style:wavy;text-decoration-thickness:1px;text-decoration-skip-ink:none;text-underline-offset:3px}.dou-code-editor__problem.is-error{text-decoration-color:var(--dou-code-editor-error)}.dou-code-editor__problem.is-warning{text-decoration-color:var(--dou-code-editor-warning)}.dou-code-editor__problem.is-info{text-decoration-color:var(--dou-code-editor-info)}.dou-code-editor__problem.is-hint{text-decoration-style:dotted;text-decoration-color:var(--dou-color-text-tertiary)}.dou-code-editor__cells{position:absolute;display:flex;height:var(--dou-code-editor-line-height);top:0;left:0}.dou-code-editor__cell{display:inline-flex;font-size:var(--dou-font-size-sm);flex:none;justify-content:center;align-items: center;height:100%}.dou-code-editor__cell[data-gutter-cell]{cursor:pointer}.dou-code-editor__cell>svg{width:14px;height:14px}.dou-code-editor__problem-icon.is-error{color:var(--dou-code-editor-error)}.dou-code-editor__problem-icon.is-warning{color:var(--dou-code-editor-warning)}.dou-code-editor__problem-icon.is-info{color:var(--dou-code-editor-info)}.dou-code-editor__problem-icon.is-hint{color:var(--dou-color-text-tertiary)}.dou-code-editor__problem-mark.is-error{background-color:var(--dou-code-editor-error)}.dou-code-editor__problem-mark.is-warning{background-color:var(--dou-code-editor-warning)}.dou-code-editor__problem-mark.is-info{background-color:var(--dou-code-editor-info)}.dou-code-editor__problem-mark.is-hint{background-color:var(--dou-color-text-tertiary)}.dou-code-editor__floating{display:contents}.dou-code-editor__floating.is-outside{--dou-code-editor-font-size:var(--dou-font-size-sm);--dou-code-editor-bg:var(--dou-color-bg-surface);--dou-code-editor-error:var(--dou-color-danger-text);--dou-code-editor-warning:var(--dou-color-warning-text);--dou-code-editor-info:var(--dou-color-primary-text);position:absolute;display:block;color:var(--dou-color-text);transition:opacity var(--dou-motion-duration-fast)var(--dou-motion-easing);width:0;height:0;line-height:20px;top:0;left:0}.dou-code-editor__floating.is-outside.is-scrolling{opacity:0;pointer-events:none;transition:none}.dou-code-editor__floating.is-outside.is-fixed{position:fixed}.dou-code-editor__problems{position:absolute;z-index:6;box-sizing:border-box;display:flex;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);white-space:normal;overflow-y:auto;overscroll-behavior:contain;flex-direction:column;gap:4px;width:max-content;max-width:min(440px,100% - 8px);padding:6px;line-height:20px;top:0;left:0}.dou-code-editor__problems>*{flex-shrink:0}.dou-code-editor__problem-item{display:flex;align-items: flex-start;gap:6px;padding:0 2px}.dou-code-editor__problem-item.is-error{--dou-code-editor-problem:var(--dou-code-editor-error)}.dou-code-editor__problem-item.is-warning{--dou-code-editor-problem:var(--dou-code-editor-warning)}.dou-code-editor__problem-item.is-info{--dou-code-editor-problem:var(--dou-code-editor-info)}.dou-code-editor__problem-item.is-hint{--dou-code-editor-problem:var(--dou-color-text-tertiary)}.dou-code-editor__problem-severity{color:var(--dou-code-editor-problem);flex:none;width:14px;height:20px}.dou-code-editor__problem-message{overflow-wrap:anywhere;color:var(--dou-color-text);min-width:0}.dou-code-editor__problem-source{color:var(--dou-color-text-tertiary);margin-left:8px}.dou-code-editor__fixes{display:flex;border-top:1px solid var(--dou-color-border-subtle);flex-wrap:wrap;gap:2px;padding-top:4px}.dou-code-editor__fix{display:inline-flex;border-radius:calc(var(--dou-radius-control) - 2px);color:var(--dou-color-primary-text);font:inherit;cursor:pointer;background:0 0;border:0;align-items: center;height:24px;padding:0 8px}.dou-code-editor__fix.is-active{background-color:color-mix(in oklab,var(--dou-color-text)6%,transparent)}.dou-code-editor__fix:hover{background-color:color-mix(in oklab,var(--dou-color-text)6%,transparent)}@media (pointer:coarse){.dou-code-editor__fix{height:36px}}.dou-code-editor__hover{color:var(--dou-color-text);overflow-wrap:anywhere;white-space:pre-wrap;padding:0 2px}.dou-code-editor__hover+.dou-code-editor__problem-item{border-top:1px solid var(--dou-color-border-subtle);padding-top:4px}.dou-code-lsp-markup{display:flex;white-space:normal;flex-direction:column;gap:6px}.dou-code-lsp-markup__text{white-space:pre-wrap;margin:0}.dou-code-lsp-markup__code{font-family:var(--dou-font-family-mono);white-space:pre-wrap;margin:0}.dou-code-lsp-markup__inline{font-family:var(--dou-font-family-mono)}.dou-code-editor__completions{position:absolute;z-index:7;box-sizing:border-box;display:flex;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);font-family:var(--dou-font-family-mono);font-size:var(--dou-code-editor-font-size);flex-direction:column;width:max-content;min-width:min(200px,100%);max-height:264px;padding:4px;line-height:20px;top:0;left:0}.dou-code-editor__completion-list{overflow-y:auto;overscroll-behavior:contain;flex:0 auto;min-height:28px}.dou-code-editor__completion{display:flex;border-radius:calc(var(--dou-radius-control) - 2px);color:var(--dou-color-text);cursor:pointer;align-items: center;gap:8px;height:28px;padding:0 8px 0 6px}.dou-code-editor__completion.is-active{background-color:color-mix(in oklab,var(--dou-color-text)8%,transparent)}@media (hover:hover){.dou-code-editor__completion:not(.is-active):hover{background-color:color-mix(in oklab,var(--dou-color-text)4%,transparent)}}@media (pointer:coarse){.dou-code-editor__completion{height:36px}}.dou-code-editor__completion-kind{color:var(--dou-color-text-tertiary);flex:none;width:16px;height:16px}.dou-code-editor__completion-label{overflow:hidden;text-overflow:ellipsis;white-space:pre;flex:none;max-width:75%}.dou-code-editor__completion-match{color:var(--dou-color-primary-text);background:0 0;font-weight:600}.dou-code-editor__completion-detail{overflow:hidden;color:var(--dou-color-text-tertiary);font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;margin-left:auto;padding-left:16px}.dou-code-editor__completion-info{border-top:1px solid var(--dou-color-border-subtle);color:var(--dou-color-text-secondary);font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);white-space:pre-wrap;overflow-wrap:anywhere;flex:none;max-width:400px;margin-top:4px;padding:6px 6px 2px}.dou-code-editor__signature{position:absolute;z-index:6;box-sizing:border-box;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);font-size:var(--dou-font-size-sm);overflow-y:auto;pointer-events:none;width:max-content;max-width:min(440px,100% - 8px);padding:4px 8px;line-height:20px;top:0;left:0}.dou-code-editor__signature-label{color:var(--dou-color-text-secondary);font-family:var(--dou-font-family-mono);font-size:var(--dou-code-editor-font-size);overflow-wrap:anywhere}.dou-code-editor__signature-active{color:var(--dou-color-text);text-decoration:underline;text-underline-offset:3px;font-weight:600}.dou-code-editor__signature-info{color:var(--dou-color-text-tertiary);font-family:var(--dou-font-family);white-space:pre-wrap}.dou-code-editor__field{box-shadow:inset 0 0 0 1px var(--dou-color-border-strong);border-radius:2px}.dou-code-editor__widgets{position:absolute;z-index:3;top:0;left:0}.dou-code-editor__widget{position:absolute;box-sizing:border-box;cursor:auto;font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);white-space:normal;user-select:text;-webkit-user-select:text;display:flow-root;line-height:20px;top:0;left:0}.dou-code-editor__inline{display:inline-block;vertical-align:top;height:var(--dou-code-editor-line-height);white-space:nowrap}.dou-code-editor__panels{font-family:var(--dou-font-family);flex:none}.dou-code-editor__panels.is-top{border-bottom:1px solid var(--dou-color-border-subtle)}.dou-code-editor__panels.is-bottom{border-top:1px solid var(--dou-color-border-subtle)}.dou-code-editor__handle{position:absolute;z-index:5;touch-action:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;width:0;height:0;top:0;left:0}.dou-code-editor__handle:before{position:absolute;content:"";width:36px;height:36px;top:-6px}.dou-code-editor__handle:after{position:absolute;background-color:var(--dou-color-primary);content:"";width:14px;height:14px;top:0}.dou-code-editor__handle.is-start:before{left:-27px}.dou-code-editor__handle.is-start:after{border-radius:50% 0 50% 50%;right:0}.dou-code-editor__handle.is-end:before{left:-9px}.dou-code-editor__handle.is-end:after{border-radius:0 50% 50%;left:0}.dou-code-editor__handle.is-caret:before{left:-18px}.dou-code-editor__handle.is-caret:after{border-radius:0 50% 50%;width:12px;height:12px;top:4px;left:-6px;transform:rotate(45deg)}.dou-code-editor__magnifier{position:absolute;z-index:6;box-sizing:border-box;overflow:hidden;border:1px solid var(--dou-color-border);background:linear-gradient(var(--dou-code-editor-bg),var(--dou-code-editor-bg)),var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);pointer-events:none;border-radius:999px;width:128px;top:0;left:0}.dou-code-editor__magnifier-text{position:absolute;height:var(--dou-code-editor-line-height);margin-top:calc(var(--dou-code-editor-line-height)/-2);white-space:pre;tab-size:var(--dou-code-editor-tab-size);transform-origin:0 50%;top:50%;left:0}.dou-code-editor__magnifier-caret{position:absolute;height:calc(var(--dou-code-editor-line-height)*1.5);background-color:var(--dou-color-primary);border-radius:1px;width:2px;top:50%;translate:0 -50%}.dou-code-editor__menu{position:absolute;z-index:6;display:flex;border:1px solid var(--dou-color-border);border-radius:calc(var(--dou-radius-control) + 2px);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);font-family:var(--dou-font-family);white-space:nowrap;gap:2px;padding:2px;top:0;left:0}.dou-code-editor__menu-button{display:inline-flex;border-radius:var(--dou-radius-control);color:var(--dou-color-text);font:inherit;font-size:var(--dou-font-size-sm);cursor:pointer;-webkit-tap-highlight-color:transparent;background:0 0;border:0;align-items: center;min-width:36px;height:36px;padding:0 12px;line-height:1}.dou-code-editor__menu-button:active{background-color:color-mix(in oklab,var(--dou-color-text)8%,transparent)}@media (hover:hover){.dou-code-editor__menu-button:hover{background-color:color-mix(in oklab,var(--dou-color-text)5%,transparent)}}.dou-code-editor__keys{position:fixed;box-sizing:border-box;padding:0 max(8px,env(safe-area-inset-right))0 max(8px,env(safe-area-inset-left));pointer-events:none;transition:opacity var(--dou-motion-duration-fast)var(--dou-motion-easing);top:0;left:0}.dou-code-editor__keys.is-scrolling{opacity:0}.dou-code-editor__keys.is-scrolling>.dou-code-keys{pointer-events:none}.dou-code-editor__keys>.dou-code-keys{overflow:hidden;border:1px solid color-mix(in oklab,var(--dou-color-text)10%,transparent);background-color:color-mix(in oklab,var(--dou-color-bg-surface)92%,transparent);box-shadow:var(--dou-shadow-md);-webkit-backdrop-filter:blur(20px)saturate(1.8);backdrop-filter:blur(20px)saturate(1.8);pointer-events:auto;border-radius:22px;height:44px;padding:0 3px}.dou-code-editor__keys>.dou-code-keys .dou-code-keys__scroll{padding:0}.dou-code-editor__keys>.dou-code-keys .dou-code-keys__arrows{position:relative;box-shadow:none;padding:0 0 0 5px}.dou-code-editor__keys>.dou-code-keys .dou-code-keys__arrows:before{position:absolute;background-color:var(--dou-color-border-subtle);content:"";width:1px;top:10px;bottom:10px;left:0}.dou-code-editor__keys>.dou-code-keys .dou-code-keys__key{border-radius:18px}.dou-code-keys{display:flex;box-sizing:border-box;border-top:1px solid var(--dou-color-border);background-color:var(--dou-color-bg-surface);color:var(--dou-color-text);font-family:var(--dou-font-family-mono);font-size:var(--dou-font-size-md);user-select:none;-webkit-user-select:none;height:45px}.dou-code-keys__scroll{display:flex;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x;flex:auto;align-items: center;gap:2px;min-width:0;padding:0 4px}.dou-code-keys__scroll::-webkit-scrollbar{display:none}.dou-code-keys__arrows{display:flex;box-shadow:-1px 0 0 var(--dou-color-border-subtle);flex:none;align-items: center;gap:2px;padding:0 4px}.dou-code-keys__key{display:inline-flex;box-sizing:border-box;border-radius:var(--dou-radius-control);color:inherit;font:inherit;cursor:pointer;touch-action:pan-x;-webkit-tap-highlight-color:transparent;transition-property:background-color,transform;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing-exit);background:0 0;border:0;flex:none;justify-content:center;align-items: center;min-width:36px;height:36px;padding:0 8px;line-height:1}.dou-code-keys__key>svg{color:var(--dou-color-text-secondary);width:18px;height:18px}@media (hover:hover){.dou-code-keys__key:hover{background-color:color-mix(in oklab,var(--dou-color-text)5%,transparent)}}.dou-code-keys__key.is-pressed{background-color:color-mix(in oklab,var(--dou-color-text)10%,transparent);transition-duration:var(--dou-motion-duration-slow);transition-timing-function:var(--dou-motion-easing-spring);transform:scale(1.12)}}@layer dou.components{.dou-code-input{--dou-code-input-height:var(--dou-control-height-md);display:block;width:100%;min-width:0}.dou-code-input .dou-code-editor{--dou-code-editor-padding-x:var(--dou-control-padding-x-md);--dou-code-editor-padding-y:calc((var(--dou-code-input-height) - var(--dou-code-editor-line-height) - 2px)/2);min-height:var(--dou-code-input-height);border-radius:var(--dou-radius-control);transition-property:border-color,box-shadow}@media (hover:hover){.dou-code-input .dou-code-editor:not(:-webkit-any(.is-focused,.is-disabled)):hover{--dou-code-editor-border:var(--dou-color-border-strong)}.dou-code-input .dou-code-editor:not(:-moz-any(.is-focused,.is-disabled)):hover{--dou-code-editor-border:var(--dou-color-border-strong)}.dou-code-input .dou-code-editor:not(:is(.is-focused,.is-disabled)):hover{--dou-code-editor-border:var(--dou-color-border-strong)}}.dou-code-input .dou-code-editor__marks{display:none}.dou-code-input:not(.is-multiline) .dou-code-editor{height:var(--dou-code-input-height)}.dou-code-input:not(.is-multiline) .dou-code-editor .dou-code-editor__scroller{scrollbar-width:none}.dou-code-input:not(.is-multiline) .dou-code-editor .dou-code-editor__scroller::-webkit-scrollbar{display:none}.dou-code-input.is-multiline .dou-code-editor{min-height:calc(var(--dou-code-input-min-rows,1)*var(--dou-code-editor-line-height) + 2*var(--dou-code-editor-padding-y) + 2px);max-height:calc(var(--dou-code-input-max-rows,6)*var(--dou-code-editor-line-height) + 2*var(--dou-code-editor-padding-y) + 2px)}.dou-code-input.is-invalid .dou-code-editor{--dou-code-editor-border:color-mix(in oklab,var(--dou-color-danger)55%,var(--dou-color-border));--dou-code-editor-border-focus:var(--dou-color-danger)}.dou-code-input--sm{--dou-code-input-height:var(--dou-control-height-sm)}.dou-code-input--sm .dou-code-editor{--dou-code-editor-padding-x:var(--dou-control-padding-x-sm)}.dou-code-input--lg{--dou-code-input-height:var(--dou-control-height-lg)}.dou-code-input--lg .dou-code-editor{--dou-code-editor-padding-x:var(--dou-control-padding-x-lg)}}@keyframes dou-code-peer-name{to{opacity:0;visibility:hidden}}@keyframes dou-code-editor-blink{50%{opacity:0}}@layer dou.components{.dou-code-diff{--dou-code-diff-removed:color-mix(in oklab,var(--dou-color-danger)10%,transparent);--dou-code-diff-added:color-mix(in oklab,var(--dou-color-success)10%,transparent);--dou-code-diff-removed-word:color-mix(in oklab,var(--dou-color-danger-text)30%,transparent);--dou-code-diff-added-word:color-mix(in oklab,var(--dou-color-success-text)30%,transparent);--dou-code-diff-border:var(--dou-color-border);position:relative;display:flex;box-sizing:border-box;overflow:hidden;border:1px solid var(--dou-code-diff-border);border-radius:var(--dou-radius-container);background-color:var(--dou-color-bg-surface);transition:border-color var(--dou-motion-duration-fast)var(--dou-motion-easing);flex-direction:column;width:100%;min-width:0}.dou-code-diff:focus-within{border-color:color-mix(in oklab,var(--dou-color-focus)70%,var(--dou-color-text))}.dou-code-diff .dou-code-editor{border:0;border-radius:0}.dou-code-diff__toolbar{display:flex;border-bottom:1px solid var(--dou-code-diff-border);font-size:var(--dou-font-size-sm);flex:none;align-items: center;gap:2px;min-height:36px;padding:0 6px 0 12px}@media (pointer:coarse){.dou-code-diff__toolbar{min-height:44px}}.dou-code-diff__stats{display:flex;overflow:hidden;white-space:nowrap;flex:auto;align-items: center;gap:8px;min-width:0}.dou-code-diff__count{font-family:var(--dou-font-family-mono);font-variant-numeric:tabular-nums}.dou-code-diff__count.is-added{color:var(--dou-color-success-text)}.dou-code-diff__count.is-removed{color:var(--dou-color-danger-text)}.dou-code-diff__summary{overflow:hidden;color:var(--dou-color-text-secondary);text-overflow:ellipsis}.dou-code-diff__hidden-text{position:absolute;overflow:hidden;clip-path:inset(50%);white-space:nowrap;width:1px;height:1px}@media (pointer:coarse){.dou-code-diff__toolbar .dou-button{position:relative;min-width:36px;min-height:36px}.dou-code-diff__toolbar .dou-button:after{position:absolute;content:"";inset:-2px}}.dou-code-diff__body{display:grid;grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr);flex:auto;min-height:0}.dou-code-diff--split>.dou-code-diff__body{grid-template-rows:auto minmax(0,1fr);grid-template-columns:minmax(0,1fr)minmax(0,1fr)}.dou-code-diff__label{border-bottom:1px solid var(--dou-code-diff-border);color:var(--dou-color-text-secondary);padding:4px 12px;font-size:12px}.dou-code-diff__label:nth-child(2){border-left:1px solid var(--dou-code-diff-border)}.dou-code-diff__side{display:flex;flex-direction:column;min-width:0;min-height:0}.dou-code-diff__side.is-modified{border-left:1px solid var(--dou-code-diff-border)}.dou-code-diff__side>.dou-code-editor{flex:auto}.dou-code-diff__line.is-removed{background-color:var(--dou-code-diff-removed)}.dou-code-diff__line.is-added{background-color:var(--dou-code-diff-added)}.dou-code-diff__word.is-removed{background-color:var(--dou-code-diff-removed-word)}.dou-code-diff__word.is-added{background-color:var(--dou-code-diff-added-word)}.dou-code-editor__cell.dou-code-diff__sign{font-family:var(--dou-font-family-mono)}.dou-code-editor__cell.dou-code-diff__sign.is-removed{background-color:var(--dou-code-diff-removed);color:var(--dou-color-danger-text)}.dou-code-editor__cell.dou-code-diff__sign.is-added{background-color:var(--dou-code-diff-added);color:var(--dou-color-success-text)}.dou-code-editor__cell.dou-code-diff__number{box-sizing:border-box;color:var(--dou-code-editor-gutter-text);font-family:var(--dou-font-family-mono);font-size:inherit;font-variant-numeric:tabular-nums;justify-content:flex-end;padding-right:8px}.dou-code-editor__cell.dou-code-diff__number.is-removed{background-color:var(--dou-code-diff-removed)}.dou-code-editor__cell.dou-code-diff__number.is-added{background-color:var(--dou-code-diff-added)}.dou-code-diff__filler{background-image:repeating-linear-gradient(-45deg,transparent 0 6px,color-mix(in oklab,var(--dou-color-text)5%,transparent)6px 7px)}.dou-code-diff__bar{display:flex;box-sizing:border-box;border:0;border-block:1px solid var(--dou-code-diff-border);background-color:color-mix(in oklab,var(--dou-color-text)3%,transparent);color:var(--dou-color-text-secondary);font:inherit;text-align:left;cursor:pointer;align-items: center;gap:6px;width:100%;height:28px;margin:0;padding:0 12px;font-size:12px}@media (hover:hover){.dou-code-diff__bar:hover{background-color:color-mix(in oklab,var(--dou-color-text)6%,transparent);color:var(--dou-color-text)}}.dou-code-diff__bar:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:-2px}@media (pointer:coarse){.dou-code-diff__bar{height:36px}}.dou-code-diff__bar-icon{flex:none;font-size:14px}.dou-code-diff__live{position:absolute;overflow:hidden;clip-path:inset(50%);white-space:nowrap;width:1px;height:1px}.dou-code-peer{position:relative;z-index:1;display:inline-block;height:var(--dou-code-editor-line-height);vertical-align:top;pointer-events:none;width:0}.dou-code-peer:before{content:"";position:absolute;background-color:var(--dou-code-peer-color);border-radius:1px;width:2px;height:100%;top:0;left:-1px}.dou-code-peer__name{position:absolute;background-color:var(--dou-code-peer-color);color:oklch(from var(--dou-code-peer-color)clamp(.2,(.66 - l)*100,.99)0 0);font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);white-space:nowrap;user-select:none;animation:dou-code-peer-name var(--dou-motion-duration-fast)var(--dou-motion-easing)3s forwards;border-radius:4px 4px 4px 0;padding:0 6px;line-height:18px;bottom:100%;left:-1px}.dou-code-peer.is-below .dou-code-peer__name{border-radius:0 4px 4px;top:100%;bottom:auto}.dou-code-peer-selection{background-color:color-mix(in oklab,var(--dou-code-peer-color)20%,transparent)}}
|
|
1
|
+
@layer dou.components{.dou-code-editor{--dou-code-editor-font-size:var(--dou-font-size-sm);--dou-code-editor-line-height:20px;--dou-code-editor-padding-y:8px;--dou-code-editor-padding-x:12px;--dou-code-editor-bg:var(--dou-color-bg-surface);--dou-code-editor-gutter-bg:var(--dou-code-editor-bg);--dou-code-editor-gutter-text:var(--dou-color-text-tertiary);--dou-code-editor-border:var(--dou-color-border);--dou-code-editor-border-focus:color-mix(in oklab,var(--dou-color-focus)70%,var(--dou-color-text));--dou-code-editor-cursor:var(--dou-color-text);--dou-code-editor-active-line:color-mix(in oklab,var(--dou-color-text)4%,transparent);--dou-code-editor-selection:color-mix(in oklab,var(--dou-color-primary)20%,transparent);--dou-code-editor-match:color-mix(in oklab,var(--dou-color-warning)22%,transparent);--dou-code-editor-match-current:color-mix(in oklab,var(--dou-color-warning-text)80%,transparent);--dou-code-editor-match-mark:color-mix(in oklab,var(--dou-color-warning)60%,transparent);--dou-code-editor-bracket:color-mix(in oklab,var(--dou-color-text)35%,transparent);--dou-code-editor-error:var(--dou-color-danger-text);--dou-code-editor-warning:var(--dou-color-warning-text);--dou-code-editor-info:var(--dou-color-primary-text);--dou-code-editor-bracket-unmatched:color-mix(in oklab,var(--dou-color-danger-text)70%,transparent);position:relative;display:flex;box-sizing:border-box;min-height:calc(var(--dou-code-editor-line-height) + 2*var(--dou-code-editor-padding-y) + 2px);overflow:hidden;border:1px solid var(--dou-code-editor-border);border-radius:var(--dou-radius-container);background-color:var(--dou-code-editor-bg);color:var(--dou-color-text);font-family:var(--dou-font-family-mono);font-size:var(--dou-code-editor-font-size);font-variant-ligatures:none;line-height:var(--dou-code-editor-line-height);transition:border-color var(--dou-motion-duration-fast)var(--dou-motion-easing);flex-direction:column;width:100%;min-width:0}.dou-code-editor.is-focused{border-color:var(--dou-code-editor-border-focus)}.dou-code-editor:not(.is-focused){--dou-code-editor-selection:color-mix(in oklab,var(--dou-color-text)10%,transparent)}.dou-code-editor.is-disabled{color:var(--dou-color-text-disabled);cursor:not-allowed}.dou-code-editor__body{position:relative;display:flex;flex:auto;min-height:0}.dou-code-editor__scroller{position:relative;overflow:auto;overscroll-behavior-x:contain;scrollbar-width:thin;flex:auto;min-width:0;min-height:0}.dou-code-editor__minimap{position:relative;overflow:hidden;box-shadow:inset 1px 0 0 color-mix(in oklab,var(--dou-color-text)6%,transparent);color:var(--dou-color-text-tertiary);cursor:default;touch-action:none;user-select:none;flex:none;width:96px}.dou-code-editor__minimap-canvas{position:absolute;width:100%;height:100%;inset:0}.dou-code-editor__minimap-view{position:absolute;background-color:color-mix(in oklab,var(--dou-color-text)6%,transparent);transition:background-color var(--dou-motion-duration-fast)var(--dou-motion-easing);top:0;left:0;right:0}.dou-code-editor__minimap:hover .dou-code-editor__minimap-view{background-color:color-mix(in oklab,var(--dou-color-text)9%,transparent)}.dou-code-editor__minimap:active .dou-code-editor__minimap-view{background-color:color-mix(in oklab,var(--dou-color-text)12%,transparent)}.dou-code-editor__sizer{position:relative;display:flex;box-sizing:border-box;width:max-content;min-width:100%}.dou-code-editor__gutter{position:sticky;z-index:2;box-sizing:border-box;width:var(--dou-code-editor-gutter);background-color:var(--dou-code-editor-gutter-bg);color:var(--dou-code-editor-gutter-text);font-variant-numeric:tabular-nums;cursor:default;user-select:none;-webkit-user-select:none;touch-action:manipulation;flex:none;left:0}.dou-code-editor__numbers{position:absolute;will-change:transform;top:0;left:0;right:0}.dou-code-editor__number{position:relative;box-sizing:border-box;height:var(--dou-code-editor-line-height);padding:0 12px 0 calc(16px + var(--dou-code-editor-gutter-cells,0px));text-align:right}.dou-code-editor__number.is-active{color:var(--dou-color-text-secondary)}.dou-code-editor.is-foldable .dou-code-editor__number{padding-right:24px}.dou-code-editor__fold-toggle{position:absolute;display:flex;height:var(--dou-code-editor-line-height);color:var(--dou-color-text-tertiary);cursor:pointer;opacity:0;transition:opacity var(--dou-motion-duration-fast)var(--dou-motion-easing);justify-content:center;align-items: center;width:14px;font-size:12px;top:0;right:6px}.dou-code-editor__gutter:hover .dou-code-editor__fold-toggle{opacity:1}.dou-code-editor__fold-toggle.is-folded{opacity:1}.dou-code-editor__fold-toggle:hover{color:var(--dou-color-text)}@media (pointer:coarse){.dou-code-editor__fold-toggle{opacity:1}.dou-code-editor__fold-toggle:before{position:absolute;content:"";inset:-4px -6px}}.dou-code-editor__content{position:relative;cursor:text;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;flex:auto;min-width:0}.dou-code-editor.is-disabled .dou-code-editor__content{cursor:not-allowed}.dou-code-editor__lines,.dou-code-editor__matches,.dou-code-editor__brackets,.dou-code-editor__selections,.dou-code-editor__cursors{position:absolute;pointer-events:none;top:0;left:0}.dou-code-editor__lines{will-change:transform;right:0}.dou-code-editor__line{box-sizing:border-box;height:var(--dou-code-editor-line-height);padding:0 var(--dou-code-editor-padding-x);white-space:pre;tab-size:var(--dou-code-editor-tab-size,2)}.dou-code-editor__line.is-wrapped{height:auto}.dou-code-editor__row{box-sizing:border-box;height:var(--dou-code-editor-line-height)}.dou-code-editor__fold-marker{display:inline-block;box-sizing:border-box;border:1px solid var(--dou-color-border);background-color:var(--dou-color-bg-muted);color:var(--dou-color-text-secondary);vertical-align:1px;cursor:pointer;pointer-events:auto;border-radius:4px;height:16px;margin-left:6px;padding:0 6px;font-size:12px;line-height:14px}.dou-code-editor__fold-marker:hover{color:var(--dou-color-text)}.dou-code-editor__line :-webkit-any(.dou-syntax-heading,.dou-syntax-strong){font-weight:inherit}.dou-code-editor__line :-moz-any(.dou-syntax-heading,.dou-syntax-strong){font-weight:inherit}.dou-code-editor__line :is(.dou-syntax-heading,.dou-syntax-strong){font-weight:inherit}.dou-code-editor__compose{text-decoration:underline;text-decoration-color:var(--dou-color-text-tertiary);text-underline-offset:3px}.dou-code-editor__probe{position:absolute;visibility:hidden;white-space:pre;pointer-events:none;top:0;left:0}.dou-code-editor__active-line{position:absolute;height:var(--dou-code-editor-line-height);background-color:var(--dou-code-editor-active-line);pointer-events:none;top:0;left:0;right:0}.dou-code-editor:not(.is-focused) .dou-code-editor__active-line{background-color:#0000}.dou-code-editor__match{position:absolute;box-sizing:border-box;height:var(--dou-code-editor-line-height);background-color:var(--dou-code-editor-match);border-radius:2px;top:0;left:0}.dou-code-editor__match.is-current{box-shadow:inset 0 0 0 1px var(--dou-code-editor-match-current)}.dou-code-editor__marks{position:absolute;z-index:3;pointer-events:none;width:6px;top:0;bottom:0;right:0}.dou-code-editor__mark{position:absolute;background-color:var(--dou-code-editor-match-mark);border-radius:1px;width:6px;height:2px;right:0}.dou-code-editor__mark.is-current{background-color:var(--dou-code-editor-match-current);height:3px}.dou-code-editor__live{position:absolute;overflow:hidden;clip-path:inset(50%);white-space:nowrap;width:1px;height:1px}.dou-code-editor__search{position:absolute;z-index:4;display:flex;container-type:inline-size;pointer-events:none;justify-content:flex-end;top:6px;left:6px;right:14px}.dou-code-editor__search>*{pointer-events:auto}.dou-code-editor__bracket{position:absolute;box-sizing:border-box;height:var(--dou-code-editor-line-height);border:1px solid var(--dou-code-editor-bracket);border-radius:2px;top:0;left:0}.dou-code-editor__bracket.is-unmatched{border-color:var(--dou-code-editor-bracket-unmatched)}.dou-code-editor__selection{position:absolute;height:var(--dou-code-editor-line-height);background-color:var(--dou-code-editor-selection);border-radius:2px;top:0;left:0}.dou-code-editor__cursor{position:absolute;height:var(--dou-code-editor-line-height);background-color:var(--dou-code-editor-cursor);animation:1.2s step-end .5s infinite dou-code-editor-blink;border-radius:1px;width:2px;top:0;left:0}.dou-code-editor.is-readonly .dou-code-editor__cursor{opacity:.4;animation:none}@media (prefers-reduced-motion:reduce){.dou-code-editor__cursor{animation:none}}.dou-code-editor__placeholder{position:absolute;top:var(--dou-code-editor-padding-y);left:var(--dou-code-editor-padding-x);color:var(--dou-color-text-tertiary);white-space:pre;pointer-events:none}.dou-code-editor__input{position:absolute;z-index:-1;box-sizing:border-box;width:calc(100% - var(--dou-code-editor-padding-x));overflow:hidden;outline:none;color:#0000;caret-color:transparent;font:inherit;font-size:max(var(--dou-font-size-input-min),var(--dou-code-editor-font-size));line-height:inherit;letter-spacing:inherit;white-space:pre;tab-size:var(--dou-code-editor-tab-size,2);resize:none;pointer-events:none;background:0 0;border:0;min-width:1px;margin:0;padding:0}.dou-code-editor__input::selection{background:0 0}}@layer dou.components{.dou-code-editor__problem{text-decoration-line:underline;text-decoration-style:wavy;text-decoration-thickness:1px;text-decoration-skip-ink:none;text-underline-offset:3px}.dou-code-editor__problem.is-error{text-decoration-color:var(--dou-code-editor-error)}.dou-code-editor__problem.is-warning{text-decoration-color:var(--dou-code-editor-warning)}.dou-code-editor__problem.is-info{text-decoration-color:var(--dou-code-editor-info)}.dou-code-editor__problem.is-hint{text-decoration-style:dotted;text-decoration-color:var(--dou-color-text-tertiary)}.dou-code-editor__cells{position:absolute;display:flex;height:var(--dou-code-editor-line-height);top:0;left:0}.dou-code-editor__cell{display:inline-flex;font-size:var(--dou-font-size-sm);flex:none;justify-content:center;align-items: center;height:100%}.dou-code-editor__cell[data-gutter-cell]{cursor:pointer}.dou-code-editor__cell>svg{width:14px;height:14px}.dou-code-editor__problem-icon.is-error{color:var(--dou-code-editor-error)}.dou-code-editor__problem-icon.is-warning{color:var(--dou-code-editor-warning)}.dou-code-editor__problem-icon.is-info{color:var(--dou-code-editor-info)}.dou-code-editor__problem-icon.is-hint{color:var(--dou-color-text-tertiary)}.dou-code-editor__problem-mark.is-error{background-color:var(--dou-code-editor-error)}.dou-code-editor__problem-mark.is-warning{background-color:var(--dou-code-editor-warning)}.dou-code-editor__problem-mark.is-info{background-color:var(--dou-code-editor-info)}.dou-code-editor__problem-mark.is-hint{background-color:var(--dou-color-text-tertiary)}.dou-code-editor__floating{display:contents}.dou-code-editor__floating.is-outside{--dou-code-editor-font-size:var(--dou-font-size-sm);--dou-code-editor-bg:var(--dou-color-bg-surface);--dou-code-editor-error:var(--dou-color-danger-text);--dou-code-editor-warning:var(--dou-color-warning-text);--dou-code-editor-info:var(--dou-color-primary-text);position:absolute;display:block;color:var(--dou-color-text);transition:opacity var(--dou-motion-duration-fast)var(--dou-motion-easing);width:0;height:0;line-height:20px;top:0;left:0}.dou-code-editor__floating.is-outside.is-scrolling{opacity:0;pointer-events:none;transition:none}.dou-code-editor__floating.is-outside.is-fixed{position:fixed}.dou-code-editor__problems{position:absolute;z-index:6;box-sizing:border-box;display:flex;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);white-space:normal;overflow-y:auto;overscroll-behavior:contain;flex-direction:column;gap:4px;width:max-content;max-width:min(440px,100% - 8px);padding:6px;line-height:20px;top:0;left:0}.dou-code-editor__problems>*{flex-shrink:0}.dou-code-editor__problem-item{display:flex;align-items: flex-start;gap:6px;padding:0 2px}.dou-code-editor__problem-item.is-error{--dou-code-editor-problem:var(--dou-code-editor-error)}.dou-code-editor__problem-item.is-warning{--dou-code-editor-problem:var(--dou-code-editor-warning)}.dou-code-editor__problem-item.is-info{--dou-code-editor-problem:var(--dou-code-editor-info)}.dou-code-editor__problem-item.is-hint{--dou-code-editor-problem:var(--dou-color-text-tertiary)}.dou-code-editor__problem-severity{color:var(--dou-code-editor-problem);flex:none;width:14px;height:20px}.dou-code-editor__problem-message{overflow-wrap:anywhere;color:var(--dou-color-text);min-width:0}.dou-code-editor__problem-source{color:var(--dou-color-text-tertiary);margin-left:8px}.dou-code-editor__fixes{display:flex;border-top:1px solid var(--dou-color-border-subtle);flex-wrap:wrap;gap:2px;padding-top:4px}.dou-code-editor__fix{display:inline-flex;border-radius:calc(var(--dou-radius-control) - 2px);color:var(--dou-color-primary-text);font:inherit;cursor:pointer;background:0 0;border:0;align-items: center;height:24px;padding:0 8px}.dou-code-editor__fix.is-active{background-color:color-mix(in oklab,var(--dou-color-text)6%,transparent)}.dou-code-editor__fix:hover{background-color:color-mix(in oklab,var(--dou-color-text)6%,transparent)}@media (pointer:coarse){.dou-code-editor__fix{height:36px}}.dou-code-editor__hover{color:var(--dou-color-text);overflow-wrap:anywhere;white-space:pre-wrap;padding:0 2px}.dou-code-editor__hover+.dou-code-editor__problem-item{border-top:1px solid var(--dou-color-border-subtle);padding-top:4px}.dou-code-lsp-markup{display:flex;white-space:normal;flex-direction:column;gap:6px}.dou-code-lsp-markup__text{white-space:pre-wrap;margin:0}.dou-code-lsp-markup__code{font-family:var(--dou-font-family-mono);white-space:pre-wrap;margin:0}.dou-code-lsp-markup__inline{font-family:var(--dou-font-family-mono)}.dou-code-editor__completions{position:absolute;z-index:7;box-sizing:border-box;display:flex;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);font-family:var(--dou-font-family-mono);font-size:var(--dou-code-editor-font-size);flex-direction:column;width:max-content;min-width:min(200px,100%);max-height:264px;padding:4px;line-height:20px;top:0;left:0}.dou-code-editor__completion-list{overflow-y:auto;overscroll-behavior:contain;flex:0 auto;min-height:28px}.dou-code-editor__completion{display:flex;border-radius:calc(var(--dou-radius-control) - 2px);color:var(--dou-color-text);cursor:pointer;align-items: center;gap:8px;height:28px;padding:0 8px 0 6px}.dou-code-editor__completion.is-active{background-color:color-mix(in oklab,var(--dou-color-text)8%,transparent)}@media (hover:hover){.dou-code-editor__completion:not(.is-active):hover{background-color:color-mix(in oklab,var(--dou-color-text)4%,transparent)}}@media (pointer:coarse){.dou-code-editor__completion{height:36px}}.dou-code-editor__completion-kind{color:var(--dou-color-text-tertiary);flex:none;width:16px;height:16px}.dou-code-editor__completion-label{overflow:hidden;text-overflow:ellipsis;white-space:pre;flex:none;max-width:75%}.dou-code-editor__completion-match{color:var(--dou-color-primary-text);background:0 0;font-weight:600}.dou-code-editor__completion-detail{overflow:hidden;color:var(--dou-color-text-tertiary);font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;margin-left:auto;padding-left:16px}.dou-code-editor__completion-info{border-top:1px solid var(--dou-color-border-subtle);color:var(--dou-color-text-secondary);font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);white-space:pre-wrap;overflow-wrap:anywhere;flex:none;max-width:400px;margin-top:4px;padding:6px 6px 2px}.dou-code-editor__signature{position:absolute;z-index:6;box-sizing:border-box;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);font-size:var(--dou-font-size-sm);overflow-y:auto;pointer-events:none;width:max-content;max-width:min(440px,100% - 8px);padding:4px 8px;line-height:20px;top:0;left:0}.dou-code-editor__signature-label{color:var(--dou-color-text-secondary);font-family:var(--dou-font-family-mono);font-size:var(--dou-code-editor-font-size);overflow-wrap:anywhere}.dou-code-editor__signature-active{color:var(--dou-color-text);text-decoration:underline;text-underline-offset:3px;font-weight:600}.dou-code-editor__signature-info{color:var(--dou-color-text-tertiary);font-family:var(--dou-font-family);white-space:pre-wrap}.dou-code-editor__field{box-shadow:inset 0 0 0 1px var(--dou-color-border-strong);border-radius:2px}.dou-code-editor__widgets{position:absolute;z-index:3;top:0;left:0}.dou-code-editor__widget{position:absolute;box-sizing:border-box;cursor:auto;font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);white-space:normal;user-select:text;-webkit-user-select:text;display:flow-root;line-height:20px;top:0;left:0}.dou-code-editor__inline{display:inline-block;vertical-align:top;height:var(--dou-code-editor-line-height);white-space:nowrap}.dou-code-editor__panels{font-family:var(--dou-font-family);flex:none}.dou-code-editor__panels.is-top{border-bottom:1px solid var(--dou-color-border-subtle)}.dou-code-editor__panels.is-bottom{border-top:1px solid var(--dou-color-border-subtle)}.dou-code-editor__handle{position:absolute;z-index:5;touch-action:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;width:0;height:0;top:0;left:0}.dou-code-editor__handle:before{position:absolute;content:"";width:36px;height:36px;top:-6px}.dou-code-editor__handle:after{position:absolute;background-color:var(--dou-color-primary);content:"";width:14px;height:14px;top:0}.dou-code-editor__handle.is-start:before{left:-27px}.dou-code-editor__handle.is-start:after{border-radius:50% 0 50% 50%;right:0}.dou-code-editor__handle.is-end:before{left:-9px}.dou-code-editor__handle.is-end:after{border-radius:0 50% 50%;left:0}.dou-code-editor__handle.is-caret:before{left:-18px}.dou-code-editor__handle.is-caret:after{border-radius:0 50% 50%;width:12px;height:12px;top:4px;left:-6px;transform:rotate(45deg)}.dou-code-editor__magnifier{position:absolute;z-index:6;box-sizing:border-box;overflow:hidden;border:1px solid var(--dou-color-border);background:linear-gradient(var(--dou-code-editor-bg),var(--dou-code-editor-bg)),var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);pointer-events:none;border-radius:999px;width:128px;top:0;left:0}.dou-code-editor__magnifier-text{position:absolute;height:var(--dou-code-editor-line-height);margin-top:calc(var(--dou-code-editor-line-height)/-2);white-space:pre;tab-size:var(--dou-code-editor-tab-size);transform-origin:0 50%;top:50%;left:0}.dou-code-editor__magnifier-caret{position:absolute;height:calc(var(--dou-code-editor-line-height)*1.5);background-color:var(--dou-color-primary);border-radius:1px;width:2px;top:50%;translate:0 -50%}.dou-code-editor__menu{position:absolute;z-index:6;display:flex;border:1px solid var(--dou-color-border);border-radius:calc(var(--dou-radius-control) + 2px);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);font-family:var(--dou-font-family);white-space:nowrap;gap:2px;padding:2px;top:0;left:0}.dou-code-editor__menu-button{display:inline-flex;border-radius:var(--dou-radius-control);color:var(--dou-color-text);font:inherit;font-size:var(--dou-font-size-sm);cursor:pointer;-webkit-tap-highlight-color:transparent;background:0 0;border:0;align-items: center;min-width:36px;height:36px;padding:0 12px;line-height:1}.dou-code-editor__menu-button:active{background-color:color-mix(in oklab,var(--dou-color-text)8%,transparent)}@media (hover:hover){.dou-code-editor__menu-button:hover{background-color:color-mix(in oklab,var(--dou-color-text)5%,transparent)}}.dou-code-editor__keys{position:absolute;box-sizing:border-box;display:flex;border:1px solid color-mix(in oklab,var(--dou-color-text)10%,transparent);background-color:color-mix(in oklab,var(--dou-color-bg-surface)92%,transparent);box-shadow:var(--dou-shadow-md);-webkit-backdrop-filter:blur(20px)saturate(1.8);backdrop-filter:blur(20px)saturate(1.8);transition:opacity var(--dou-motion-duration-fast)var(--dou-motion-easing);border-radius:22px;height:44px;padding:0 3px 0 0;top:0;left:0}.dou-code-editor__keys.is-fixed{position:fixed}.dou-code-editor__keys.is-scrolling{opacity:0;pointer-events:none;transition:none}.dou-code-editor__keys>.dou-code-keys{background-color:#0000;border-top:0;flex:auto;min-width:0;height:42px}.dou-code-editor__keys>.dou-code-keys .dou-code-keys__scroll{padding:0}.dou-code-editor__keys>.dou-code-keys .dou-code-keys__arrows{position:relative;box-shadow:none;padding:0 0 0 5px}.dou-code-editor__keys>.dou-code-keys .dou-code-keys__arrows:before{position:absolute;background-color:var(--dou-color-border-subtle);content:"";width:1px;top:10px;bottom:10px;left:0}.dou-code-editor__keys>.dou-code-keys .dou-code-keys__key{border-radius:18px}.dou-code-editor__keys-grip{display:flex;color:var(--dou-color-text-tertiary);cursor:grab;touch-action:none;-webkit-tap-highlight-color:transparent;background:0 0;border:0;flex:none;justify-content:center;align-items: center;width:36px;margin:0;padding:0 0 0 6px}.dou-code-editor__keys-grip>svg{width:18px;height:18px}.dou-code-editor__keys-grip:active{cursor:grabbing}.dou-code-editor__keys-grip:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:-4px;border-radius:18px}.dou-code-keys{display:flex;box-sizing:border-box;border-top:1px solid var(--dou-color-border);background-color:var(--dou-color-bg-surface);color:var(--dou-color-text);font-family:var(--dou-font-family-mono);font-size:var(--dou-font-size-md);user-select:none;-webkit-user-select:none;height:45px}.dou-code-keys__scroll{display:flex;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x;flex:auto;align-items: center;gap:2px;min-width:0;padding:0 4px}.dou-code-keys__scroll::-webkit-scrollbar{display:none}.dou-code-keys__arrows{display:flex;box-shadow:-1px 0 0 var(--dou-color-border-subtle);flex:none;align-items: center;gap:2px;padding:0 4px}.dou-code-keys__stick{position:relative;color:var(--dou-color-text-tertiary);cursor:grab;touch-action:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;background:0 0;border:0;border-radius:50%;flex:none;width:36px;height:36px;margin:0;padding:0}.dou-code-keys__stick:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:0}.dou-code-keys__pad{position:absolute;z-index:1;display:flex;box-sizing:border-box;background-color:var(--dou-color-bg-muted);box-shadow:inset 0 0 0 1px var(--dou-color-border-subtle);pointer-events:none;transition-property:width,height,margin,background-color,box-shadow,translate;transition-duration:var(--dou-motion-duration-normal);transition-timing-function:var(--dou-motion-easing);border-radius:50%;justify-content:center;align-items: center;width:32px;height:32px;margin:-16px 0 0 -16px;top:50%;left:50%}.dou-code-keys__way{position:absolute;opacity:0;transition:opacity var(--dou-motion-duration-fast)var(--dou-motion-easing);width:16px;height:16px}.dou-code-keys__way.is-up{top:8px}.dou-code-keys__way.is-down{bottom:8px}.dou-code-keys__way.is-left{left:8px}.dou-code-keys__way.is-right{right:8px}.dou-code-keys__thumb{box-sizing:border-box;background-color:var(--dou-color-bg-surface);box-shadow:0 0 0 1px color-mix(in oklab,var(--dou-color-text)14%,transparent),var(--dou-shadow-sm);transition-property:width,height,transform;transition-duration:var(--dou-motion-duration-normal);transition-timing-function:var(--dou-motion-easing-spring);border-radius:50%;width:18px;height:18px}.dou-code-keys__stick.is-held{cursor:grabbing}.dou-code-keys__stick.is-held .dou-code-keys__pad{background-color:var(--dou-color-bg-surface);box-shadow:inset 0 0 0 1px var(--dou-color-border),var(--dou-shadow-lg);transition-duration:var(--dou-motion-duration-slow);transition-timing-function:var(--dou-motion-easing-spring);width:104px;height:104px;margin:-52px 0 0 -52px}.dou-code-keys__stick.is-held .dou-code-keys__way{opacity:1}.dou-code-keys__stick.is-held .dou-code-keys__thumb{background-color:color-mix(in oklab,var(--dou-color-text)8%,var(--dou-color-bg-surface));width:40px;height:40px;transition-property:width,height}.dou-code-keys__key{display:inline-flex;box-sizing:border-box;border-radius:var(--dou-radius-control);color:inherit;font:inherit;cursor:pointer;touch-action:pan-x;-webkit-tap-highlight-color:transparent;transition-property:background-color,transform;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing-exit);background:0 0;border:0;flex:none;justify-content:center;align-items: center;min-width:36px;height:36px;padding:0 8px;line-height:1}.dou-code-keys__key>svg{color:var(--dou-color-text-secondary);width:18px;height:18px}@media (hover:hover){.dou-code-keys__key:hover{background-color:color-mix(in oklab,var(--dou-color-text)5%,transparent)}}.dou-code-keys__key.is-pressed{background-color:color-mix(in oklab,var(--dou-color-text)10%,transparent);transition-duration:var(--dou-motion-duration-slow);transition-timing-function:var(--dou-motion-easing-spring);transform:scale(1.12)}}@layer dou.components{.dou-code-input{--dou-code-input-height:var(--dou-control-height-md);display:block;width:100%;min-width:0}.dou-code-input .dou-code-editor{--dou-code-editor-padding-x:var(--dou-control-padding-x-md);--dou-code-editor-padding-y:calc((var(--dou-code-input-height) - var(--dou-code-editor-line-height) - 2px)/2);min-height:var(--dou-code-input-height);border-radius:var(--dou-radius-control);transition-property:border-color,box-shadow}@media (hover:hover){.dou-code-input .dou-code-editor:not(:-webkit-any(.is-focused,.is-disabled)):hover{--dou-code-editor-border:var(--dou-color-border-strong)}.dou-code-input .dou-code-editor:not(:-moz-any(.is-focused,.is-disabled)):hover{--dou-code-editor-border:var(--dou-color-border-strong)}.dou-code-input .dou-code-editor:not(:is(.is-focused,.is-disabled)):hover{--dou-code-editor-border:var(--dou-color-border-strong)}}.dou-code-input .dou-code-editor__marks{display:none}.dou-code-input:not(.is-multiline) .dou-code-editor{height:var(--dou-code-input-height)}.dou-code-input:not(.is-multiline) .dou-code-editor .dou-code-editor__scroller{scrollbar-width:none}.dou-code-input:not(.is-multiline) .dou-code-editor .dou-code-editor__scroller::-webkit-scrollbar{display:none}.dou-code-input.is-multiline .dou-code-editor{min-height:calc(var(--dou-code-input-min-rows,1)*var(--dou-code-editor-line-height) + 2*var(--dou-code-editor-padding-y) + 2px);max-height:calc(var(--dou-code-input-max-rows,6)*var(--dou-code-editor-line-height) + 2*var(--dou-code-editor-padding-y) + 2px)}.dou-code-input.is-invalid .dou-code-editor{--dou-code-editor-border:color-mix(in oklab,var(--dou-color-danger)55%,var(--dou-color-border));--dou-code-editor-border-focus:var(--dou-color-danger)}.dou-code-input--sm{--dou-code-input-height:var(--dou-control-height-sm)}.dou-code-input--sm .dou-code-editor{--dou-code-editor-padding-x:var(--dou-control-padding-x-sm)}.dou-code-input--lg{--dou-code-input-height:var(--dou-control-height-lg)}.dou-code-input--lg .dou-code-editor{--dou-code-editor-padding-x:var(--dou-control-padding-x-lg)}}@keyframes dou-code-peer-name{to{opacity:0;visibility:hidden}}@keyframes dou-code-editor-blink{50%{opacity:0}}@layer dou.components{.dou-code-diff{--dou-code-diff-removed:color-mix(in oklab,var(--dou-color-danger)10%,transparent);--dou-code-diff-added:color-mix(in oklab,var(--dou-color-success)10%,transparent);--dou-code-diff-removed-word:color-mix(in oklab,var(--dou-color-danger-text)30%,transparent);--dou-code-diff-added-word:color-mix(in oklab,var(--dou-color-success-text)30%,transparent);--dou-code-diff-border:var(--dou-color-border);position:relative;display:flex;box-sizing:border-box;overflow:hidden;border:1px solid var(--dou-code-diff-border);border-radius:var(--dou-radius-container);background-color:var(--dou-color-bg-surface);transition:border-color var(--dou-motion-duration-fast)var(--dou-motion-easing);flex-direction:column;width:100%;min-width:0}.dou-code-diff:focus-within{border-color:color-mix(in oklab,var(--dou-color-focus)70%,var(--dou-color-text))}.dou-code-diff .dou-code-editor{border:0;border-radius:0}.dou-code-diff__toolbar{display:flex;border-bottom:1px solid var(--dou-code-diff-border);font-size:var(--dou-font-size-sm);flex:none;align-items: center;gap:2px;min-height:36px;padding:0 6px 0 12px}@media (pointer:coarse){.dou-code-diff__toolbar{min-height:44px}}.dou-code-diff__stats{display:flex;overflow:hidden;white-space:nowrap;flex:auto;align-items: center;gap:8px;min-width:0}.dou-code-diff__count{font-family:var(--dou-font-family-mono);font-variant-numeric:tabular-nums}.dou-code-diff__count.is-added{color:var(--dou-color-success-text)}.dou-code-diff__count.is-removed{color:var(--dou-color-danger-text)}.dou-code-diff__summary{overflow:hidden;color:var(--dou-color-text-secondary);text-overflow:ellipsis}.dou-code-diff__hidden-text{position:absolute;overflow:hidden;clip-path:inset(50%);white-space:nowrap;width:1px;height:1px}@media (pointer:coarse){.dou-code-diff__toolbar .dou-button{position:relative;min-width:36px;min-height:36px}.dou-code-diff__toolbar .dou-button:after{position:absolute;content:"";inset:-2px}}.dou-code-diff__body{display:grid;grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr);flex:auto;min-height:0}.dou-code-diff--split>.dou-code-diff__body{grid-template-rows:auto minmax(0,1fr);grid-template-columns:minmax(0,1fr)minmax(0,1fr)}.dou-code-diff__label{border-bottom:1px solid var(--dou-code-diff-border);color:var(--dou-color-text-secondary);padding:4px 12px;font-size:12px}.dou-code-diff__label:nth-child(2){border-left:1px solid var(--dou-code-diff-border)}.dou-code-diff__side{display:flex;flex-direction:column;min-width:0;min-height:0}.dou-code-diff__side.is-modified{border-left:1px solid var(--dou-code-diff-border)}.dou-code-diff__side>.dou-code-editor{flex:auto}.dou-code-diff__line.is-removed{background-color:var(--dou-code-diff-removed)}.dou-code-diff__line.is-added{background-color:var(--dou-code-diff-added)}.dou-code-diff__word.is-removed{background-color:var(--dou-code-diff-removed-word)}.dou-code-diff__word.is-added{background-color:var(--dou-code-diff-added-word)}.dou-code-editor__cell.dou-code-diff__sign{font-family:var(--dou-font-family-mono)}.dou-code-editor__cell.dou-code-diff__sign.is-removed{background-color:var(--dou-code-diff-removed);color:var(--dou-color-danger-text)}.dou-code-editor__cell.dou-code-diff__sign.is-added{background-color:var(--dou-code-diff-added);color:var(--dou-color-success-text)}.dou-code-editor__cell.dou-code-diff__number{box-sizing:border-box;color:var(--dou-code-editor-gutter-text);font-family:var(--dou-font-family-mono);font-size:inherit;font-variant-numeric:tabular-nums;justify-content:flex-end;padding-right:8px}.dou-code-editor__cell.dou-code-diff__number.is-removed{background-color:var(--dou-code-diff-removed)}.dou-code-editor__cell.dou-code-diff__number.is-added{background-color:var(--dou-code-diff-added)}.dou-code-diff__filler{background-image:repeating-linear-gradient(-45deg,transparent 0 6px,color-mix(in oklab,var(--dou-color-text)5%,transparent)6px 7px)}.dou-code-diff__bar{display:flex;box-sizing:border-box;border:0;border-block:1px solid var(--dou-code-diff-border);background-color:color-mix(in oklab,var(--dou-color-text)3%,transparent);color:var(--dou-color-text-secondary);font:inherit;text-align:left;cursor:pointer;align-items: center;gap:6px;width:100%;height:28px;margin:0;padding:0 12px;font-size:12px}@media (hover:hover){.dou-code-diff__bar:hover{background-color:color-mix(in oklab,var(--dou-color-text)6%,transparent);color:var(--dou-color-text)}}.dou-code-diff__bar:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:-2px}@media (pointer:coarse){.dou-code-diff__bar{height:36px}}.dou-code-diff__bar-icon{flex:none;font-size:14px}.dou-code-diff__live{position:absolute;overflow:hidden;clip-path:inset(50%);white-space:nowrap;width:1px;height:1px}.dou-code-peer{position:relative;z-index:1;display:inline-block;height:var(--dou-code-editor-line-height);vertical-align:top;pointer-events:none;width:0}.dou-code-peer:before{content:"";position:absolute;background-color:var(--dou-code-peer-color);border-radius:1px;width:2px;height:100%;top:0;left:-1px}.dou-code-peer__name{position:absolute;background-color:var(--dou-code-peer-color);color:oklch(from var(--dou-code-peer-color)clamp(.2,(.66 - l)*100,.99)0 0);font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);white-space:nowrap;user-select:none;animation:dou-code-peer-name var(--dou-motion-duration-fast)var(--dou-motion-easing)3s forwards;border-radius:4px 4px 4px 0;padding:0 6px;line-height:18px;bottom:100%;left:-1px}.dou-code-peer.is-below .dou-code-peer__name{border-radius:0 4px 4px;top:100%;bottom:auto}.dou-code-peer-selection{background-color:color-mix(in oklab,var(--dou-code-peer-color)20%,transparent)}}
|
|
@@ -28,11 +28,11 @@ declare const __VLS_export: import("vue").DefineComponent<CodeDiffProps, {
|
|
|
28
28
|
language: import("./index.js").CodeLanguage<any> | null;
|
|
29
29
|
tabSize: number;
|
|
30
30
|
messages: Partial<import("./locale").CodeMessages>;
|
|
31
|
+
mode: "split" | "inline" | "auto";
|
|
31
32
|
modelValue: string;
|
|
32
33
|
wrap: boolean;
|
|
33
34
|
extensions: CodeExtension[];
|
|
34
35
|
editable: boolean;
|
|
35
|
-
mode: "split" | "inline" | "auto";
|
|
36
36
|
original: string;
|
|
37
37
|
collapseUnchanged: boolean | {
|
|
38
38
|
context?: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -87,11 +87,11 @@ export declare const DouCodeDiff: import("dou-ui").WithInstall<import("vue").Def
|
|
|
87
87
|
language: import("./index.js").CodeLanguage<any> | null;
|
|
88
88
|
tabSize: number;
|
|
89
89
|
messages: Partial<import("./locale").CodeMessages>;
|
|
90
|
+
mode: "split" | "inline" | "auto";
|
|
90
91
|
modelValue: string;
|
|
91
92
|
wrap: boolean;
|
|
92
93
|
extensions: import("./extension").CodeExtension[];
|
|
93
94
|
editable: boolean;
|
|
94
|
-
mode: "split" | "inline" | "auto";
|
|
95
95
|
original: string;
|
|
96
96
|
collapseUnchanged: boolean | {
|
|
97
97
|
context?: number;
|