@celestia-island/hikari 0.55.367 → 0.55.369
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/package.json +1 -1
- package/src/components/HkDebugFloat.scss +145 -0
- package/src/components/HkDebugFloat.test.tsx +418 -0
- package/src/components/HkDebugFloat.tsx +292 -0
- package/src/components/debugFloat.ts +128 -0
- package/src/i18n/locales/ar/components.json +1 -0
- package/src/i18n/locales/de/components.json +1 -0
- package/src/i18n/locales/en/components.json +1 -0
- package/src/i18n/locales/es/components.json +1 -0
- package/src/i18n/locales/fr/components.json +1 -0
- package/src/i18n/locales/ja/components.json +1 -0
- package/src/i18n/locales/ko/components.json +1 -0
- package/src/i18n/locales/pt/components.json +1 -0
- package/src/i18n/locales/ru/components.json +1 -0
- package/src/i18n/locales/zh-Hans/components.json +1 -0
- package/src/i18n/locales/zh-Hant/components.json +1 -0
- package/src/index.ts +9 -0
- package/src/plugins/boot-recovery.details.test.ts +1 -1
- package/src/plugins/boot-recovery.diagnostics.test.ts +1 -1
- package/src/plugins/boot-recovery.locales.test.ts +1 -1
- package/src/plugins/bootLandingCss.js +1 -1
- package/src/scale.scss +4 -0
- package/src/shared.ts +7 -3
- package/src/styles/theme/scale.scss +4 -0
package/package.json
CHANGED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// AI-generated: developed with the DeepSeek Harness agent (model GLM-5.3 Flash); human-directed.
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* HkDebugFloat — generic debug floating window (HUD grammar).
|
|
5
|
+
*
|
|
6
|
+
* The wowsp idiom this window ports: a HUD card that turns SEMI-TRANSPARENT
|
|
7
|
+
* while the pointer is over it (`&:hover { opacity: 0.8 }` on the
|
|
8
|
+
* HoloScorebar/HoloShipCard family), so it stops competing with the
|
|
9
|
+
* content it measures and yields the visual field back to the page. The
|
|
10
|
+
* hovered opacity is prop-tunable (--hk-debug-float-hover-opacity, inline
|
|
11
|
+
* from the `hoverOpacity` prop); data-hovered mirrors :hover for the
|
|
12
|
+
* runtime tests and for pen/touch engines where :hover is sticky.
|
|
13
|
+
*
|
|
14
|
+
* Every ink hangs off hikari's theme tokens (no hardcoded colors); the
|
|
15
|
+
* body is compact mono with tabular figures so debug numbers line up.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
@use "../styles/polyfill" as *;
|
|
19
|
+
|
|
20
|
+
.hk-debug-float {
|
|
21
|
+
/* Document-space debug band: above every content-chrome rung, strictly
|
|
22
|
+
* below #hk-overlay-root (--hk-z-overlay-root, 90000) so every
|
|
23
|
+
* functional popup — modal, drawer, toast, tooltip — paints above the
|
|
24
|
+
* debug window. The band lives in scale.scss; the constant behind the
|
|
25
|
+
* fallback is HK_DEBUG_FLOAT_DOCUMENT_Z (kept honest by the test). */
|
|
26
|
+
z-index: var(--hk-z-debug-float, 80000);
|
|
27
|
+
|
|
28
|
+
position: fixed;
|
|
29
|
+
min-width: 0;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
border: 1px solid var(--border-faint);
|
|
32
|
+
border-radius: var(--radius-sm);
|
|
33
|
+
background: rgb(var(--color-surface) / 0.82);
|
|
34
|
+
box-shadow: var(--shadow-dropdown);
|
|
35
|
+
color: rgb(var(--color-text));
|
|
36
|
+
font-size: var(--text-xs);
|
|
37
|
+
/* A debug HUD is a numbers surface: mono face, tabular figures, so
|
|
38
|
+
* FPS/counters keep their columns while values tick (the wowsp
|
|
39
|
+
* scorebar's font-variant-numeric contract). */
|
|
40
|
+
font-family: var(--font-mono);
|
|
41
|
+
font-variant-numeric: tabular-nums;
|
|
42
|
+
line-height: 1.45;
|
|
43
|
+
/* The window catches pointers ONLY on itself — it is never an
|
|
44
|
+
* inset-0 overlay, so clicks outside its box land on the page. */
|
|
45
|
+
pointer-events: auto;
|
|
46
|
+
touch-action: none;
|
|
47
|
+
|
|
48
|
+
/* Hover → yield: the pointer over the HUD drops it to the translucent
|
|
49
|
+
* state so the measured content reads through it (~150ms, opacity only
|
|
50
|
+
* — nothing moves). hoverOpacity flows in as an inline custom
|
|
51
|
+
* property; 0.45 is the wowsp-derived default. */
|
|
52
|
+
opacity: 1;
|
|
53
|
+
transition: opacity var(--duration-short) ease;
|
|
54
|
+
|
|
55
|
+
&:hover,
|
|
56
|
+
&[data-hovered] {
|
|
57
|
+
opacity: var(--hk-debug-float-hover-opacity, 0.45);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Drag exception: while the user is GRABBING the window it must stay
|
|
61
|
+
* fully opaque — fading mid-grab hides what the hand is holding. */
|
|
62
|
+
&[data-dragging] {
|
|
63
|
+
opacity: 1;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* ---------- corner anchoring (pre-drag) ----------
|
|
68
|
+
* Physical corners on purpose: the `position` prop is named physically
|
|
69
|
+
* and the window is a viewport HUD, not in-flow content (HkFloatingLayer's
|
|
70
|
+
* precedent). Safe-area-aware like the HkFab/HkFloatingLayer insets. */
|
|
71
|
+
.hk-debug-float {
|
|
72
|
+
&[data-corner="top-left"] {
|
|
73
|
+
top: max(var(--hk-debug-float-offset, 16px), env(safe-area-inset-top, 0px));
|
|
74
|
+
left: max(var(--hk-debug-float-offset, 16px), env(safe-area-inset-left, 0px));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&[data-corner="top-right"] {
|
|
78
|
+
top: max(var(--hk-debug-float-offset, 16px), env(safe-area-inset-top, 0px));
|
|
79
|
+
right: max(var(--hk-debug-float-offset, 16px), env(safe-area-inset-right, 0px));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&[data-corner="bottom-left"] {
|
|
83
|
+
bottom: max(var(--hk-debug-float-offset, 16px), env(safe-area-inset-bottom, 0px));
|
|
84
|
+
left: max(var(--hk-debug-float-offset, 16px), env(safe-area-inset-left, 0px));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&[data-corner="bottom-right"] {
|
|
88
|
+
bottom: max(var(--hk-debug-float-offset, 16px), env(safe-area-inset-bottom, 0px));
|
|
89
|
+
right: max(var(--hk-debug-float-offset, 16px), env(safe-area-inset-right, 0px));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* ---------- header (drag handle) ---------- */
|
|
94
|
+
.hk-debug-float [data-el="header"] {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: space-between;
|
|
98
|
+
gap: var(--space-8);
|
|
99
|
+
padding: var(--space-4) var(--space-8) var(--space-4) var(--space-10);
|
|
100
|
+
border-bottom: 1px solid var(--border-faint);
|
|
101
|
+
background: rgb(var(--color-muted) / 8%);
|
|
102
|
+
cursor: grab;
|
|
103
|
+
/* The handle owns the drag gesture — mobile browsers must not fire
|
|
104
|
+
* pointercancel and scroll the page instead (HkMinimap precedent). */
|
|
105
|
+
touch-action: none;
|
|
106
|
+
@include user-select(none);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.hk-debug-float[data-dragging] [data-el="header"] {
|
|
110
|
+
cursor: grabbing;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.hk-debug-float [data-el="title"] {
|
|
114
|
+
font-size: var(--text-2xs);
|
|
115
|
+
font-weight: 600;
|
|
116
|
+
letter-spacing: 0.04em;
|
|
117
|
+
text-transform: uppercase;
|
|
118
|
+
color: rgb(var(--color-muted));
|
|
119
|
+
white-space: nowrap;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
text-overflow: ellipsis;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* ---------- body (slot content) ---------- */
|
|
125
|
+
.hk-debug-float [data-el="body"] {
|
|
126
|
+
padding: var(--space-8);
|
|
127
|
+
/* A fat debug dump must never cover the viewport: cap and scroll.
|
|
128
|
+
* Bar-less HUD scroller (nativeScrollbar contract): the bar stays
|
|
129
|
+
* hidden, wheel/touch/keyboard still scroll. */
|
|
130
|
+
max-height: 40vh;
|
|
131
|
+
overflow: auto;
|
|
132
|
+
overscroll-behavior: contain;
|
|
133
|
+
scrollbar-width: none;
|
|
134
|
+
|
|
135
|
+
&::-webkit-scrollbar {
|
|
136
|
+
display: none;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ---------- close ---------- */
|
|
141
|
+
/* The close affordance rides the STANDARD icon button at the 24 rung
|
|
142
|
+
* (close-button family contract) with the seat class for this window. */
|
|
143
|
+
.hk-debug-float-close {
|
|
144
|
+
flex-shrink: 0;
|
|
145
|
+
}
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
// AI-generated: developed with the DeepSeek Harness agent (model GLM-5.3 Flash); human-directed.
|
|
2
|
+
|
|
3
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
4
|
+
import { createApp, defineComponent, h, nextTick, ref } from "vue";
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { compile } from "sass";
|
|
7
|
+
import { dirname, resolve } from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
|
|
10
|
+
import HkDebugFloat from "./HkDebugFloat";
|
|
11
|
+
import {
|
|
12
|
+
clampDebugFloatPosition,
|
|
13
|
+
debugFloatStorageKey,
|
|
14
|
+
HK_DEBUG_FLOAT_DOCUMENT_Z,
|
|
15
|
+
} from "./debugFloat";
|
|
16
|
+
|
|
17
|
+
const mounts: Array<{ app: ReturnType<typeof createApp>; container: HTMLElement }> = [];
|
|
18
|
+
|
|
19
|
+
function mount(renderNode: () => ReturnType<typeof h>) {
|
|
20
|
+
const container = document.createElement("div");
|
|
21
|
+
document.body.appendChild(container);
|
|
22
|
+
const app = createApp({ render: renderNode });
|
|
23
|
+
app.mount(container);
|
|
24
|
+
mounts.push({ app, container });
|
|
25
|
+
return container;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** The live teleported window (HkDebugFloat renders INTO document.body,
|
|
29
|
+
* never into the mount container). */
|
|
30
|
+
function floatWindow(): HTMLElement | null {
|
|
31
|
+
return document.body.querySelector<HTMLElement>(".hk-debug-float");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function dispatchMouse(type: string, target: EventTarget, init: MouseEventInit = {}): void {
|
|
35
|
+
target.dispatchEvent(new MouseEvent(type, { bubbles: true, ...init }));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
afterEach(() => {
|
|
39
|
+
for (const { app, container } of mounts.splice(0)) {
|
|
40
|
+
app.unmount();
|
|
41
|
+
container.remove();
|
|
42
|
+
}
|
|
43
|
+
localStorage.clear();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Vitest stubs CSS, so the runtime suite can never catch a lost rule —
|
|
47
|
+
// the hover-fade and band contracts are additionally pinned by the
|
|
48
|
+
// compiled stylesheet guard at the bottom of this file (HkBadge pulse
|
|
49
|
+
// pattern).
|
|
50
|
+
describe("HkDebugFloat", () => {
|
|
51
|
+
it("teleports the window to body — never inside the mount container", () => {
|
|
52
|
+
const c = mount(() => h(HkDebugFloat, null, () => "fps 60"));
|
|
53
|
+
expect(document.body.querySelector(".hk-debug-float")).toBeTruthy();
|
|
54
|
+
expect(c.querySelector(".hk-debug-float")).toBeNull();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("renders the slot content", () => {
|
|
58
|
+
mount(() => h(HkDebugFloat, null, () => "fps 60"));
|
|
59
|
+
expect(document.body.querySelector(".hk-debug-float [data-el='body']")!.textContent).toContain(
|
|
60
|
+
"fps 60",
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("defaults the header to the localized DEBUG label", () => {
|
|
65
|
+
// The en bundle loads eagerly, so the two-arg t() fallback doubles as
|
|
66
|
+
// the assertion's expected string — no i18n test setup (HkLoadMore).
|
|
67
|
+
mount(() => h(HkDebugFloat));
|
|
68
|
+
expect(document.body.querySelector("[data-el='title']")!.textContent).toBe("DEBUG");
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("lets the title prop override the default", () => {
|
|
72
|
+
mount(() => h(HkDebugFloat, { title: "CACHE" }));
|
|
73
|
+
expect(document.body.querySelector("[data-el='title']")!.textContent).toBe("CACHE");
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("lets the title slot override everything", () => {
|
|
77
|
+
mount(() => h(HkDebugFloat, { title: "CACHE" }, { title: () => "SLOT" }));
|
|
78
|
+
expect(document.body.querySelector("[data-el='title']")!.textContent).toBe("SLOT");
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("labels the window group with the title and the close button with Close", () => {
|
|
82
|
+
mount(() => h(HkDebugFloat));
|
|
83
|
+
const win = floatWindow()!;
|
|
84
|
+
expect(win.getAttribute("aria-label")).toBe("DEBUG");
|
|
85
|
+
const close = win.querySelector("button.hk-icon-button")!;
|
|
86
|
+
expect(close.getAttribute("aria-label")).toBe("Close");
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("reflects the position prop as the corner anchor", () => {
|
|
90
|
+
mount(() => h(HkDebugFloat, { position: "top-left" }));
|
|
91
|
+
expect(floatWindow()!.getAttribute("data-corner")).toBe("top-left");
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("anchors to bottom-right by default", () => {
|
|
95
|
+
mount(() => h(HkDebugFloat));
|
|
96
|
+
expect(floatWindow()!.getAttribute("data-corner")).toBe("bottom-right");
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("wires width, offset and hover opacity as inline custom properties", () => {
|
|
100
|
+
mount(() => h(HkDebugFloat, { width: 320, offset: 8, hoverOpacity: 0.2 }));
|
|
101
|
+
const win = floatWindow()!;
|
|
102
|
+
expect(win.style.width).toBe("320px");
|
|
103
|
+
expect(win.style.getPropertyValue("--hk-debug-float-offset")).toBe("8px");
|
|
104
|
+
expect(win.style.getPropertyValue("--hk-debug-float-hover-opacity")).toBe("0.2");
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("defaults the z-index to the debug band (below every functional popup)", () => {
|
|
108
|
+
mount(() => h(HkDebugFloat));
|
|
109
|
+
expect(floatWindow()!.style.zIndex).toBe(String(HK_DEBUG_FLOAT_DOCUMENT_Z));
|
|
110
|
+
expect(floatWindow()!.style.zIndex).toBe("80000");
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("honors an explicit zIndex override", () => {
|
|
114
|
+
mount(() => h(HkDebugFloat, { zIndex: 42 }));
|
|
115
|
+
expect(floatWindow()!.style.zIndex).toBe("42");
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it("flips the hovered state on pointerenter and back on pointerleave", async () => {
|
|
119
|
+
mount(() => h(HkDebugFloat));
|
|
120
|
+
const win = floatWindow()!;
|
|
121
|
+
expect(win.hasAttribute("data-hovered")).toBe(false);
|
|
122
|
+
win.dispatchEvent(new Event("pointerenter"));
|
|
123
|
+
await nextTick();
|
|
124
|
+
expect(win.hasAttribute("data-hovered")).toBe(true);
|
|
125
|
+
win.dispatchEvent(new Event("pointerleave"));
|
|
126
|
+
await nextTick();
|
|
127
|
+
expect(win.hasAttribute("data-hovered")).toBe(false);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("close hides the window and emits update:open false (uncontrolled)", async () => {
|
|
131
|
+
const emitted: boolean[] = [];
|
|
132
|
+
mount(() =>
|
|
133
|
+
h(HkDebugFloat, {
|
|
134
|
+
"onUpdate:open": (v: boolean) => emitted.push(v),
|
|
135
|
+
}),
|
|
136
|
+
);
|
|
137
|
+
const close = floatWindow()!.querySelector("button.hk-icon-button") as HTMLButtonElement;
|
|
138
|
+
close.click();
|
|
139
|
+
// The emit is synchronous; the unmount lands on the next tick.
|
|
140
|
+
expect(emitted).toEqual([false]);
|
|
141
|
+
await nextTick();
|
|
142
|
+
expect(floatWindow()).toBeNull();
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it("stays hidden on remount when a persistKey persisted the closed state", async () => {
|
|
146
|
+
mount(() => h(HkDebugFloat, { persistKey: "roundtrip" }));
|
|
147
|
+
(floatWindow()!.querySelector("button.hk-icon-button") as HTMLButtonElement).click();
|
|
148
|
+
await nextTick();
|
|
149
|
+
const raw = localStorage.getItem(debugFloatStorageKey("roundtrip"));
|
|
150
|
+
expect(raw).not.toBeNull();
|
|
151
|
+
expect(JSON.parse(raw!)).toMatchObject({ open: false });
|
|
152
|
+
|
|
153
|
+
// A fresh mount reads the same record and stays closed.
|
|
154
|
+
mount(() => h(HkDebugFloat, { persistKey: "roundtrip" }));
|
|
155
|
+
expect(floatWindow()).toBeNull();
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("restores a persisted open state on remount", () => {
|
|
159
|
+
localStorage.setItem(debugFloatStorageKey("reopen"), JSON.stringify({ open: true }));
|
|
160
|
+
mount(() => h(HkDebugFloat, { persistKey: "reopen", defaultOpen: false }));
|
|
161
|
+
expect(floatWindow()).not.toBeNull();
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it("falls back to defaultOpen when nothing was persisted", () => {
|
|
165
|
+
mount(() => h(HkDebugFloat, { persistKey: "fresh", defaultOpen: false }));
|
|
166
|
+
expect(floatWindow()).toBeNull();
|
|
167
|
+
mount(() => h(HkDebugFloat, { persistKey: "fresh", defaultOpen: true }));
|
|
168
|
+
expect(floatWindow()).not.toBeNull();
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it("ignores corrupted persisted payloads instead of crashing", () => {
|
|
172
|
+
localStorage.setItem(debugFloatStorageKey("corrupt"), "{not json");
|
|
173
|
+
mount(() => h(HkDebugFloat, { persistKey: "corrupt" }));
|
|
174
|
+
expect(floatWindow()).not.toBeNull();
|
|
175
|
+
expect(floatWindow()!.style.left).toBe("");
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
it("honors the controlled open prop over the internal state", () => {
|
|
179
|
+
mount(() => h(HkDebugFloat, { open: false }));
|
|
180
|
+
expect(floatWindow()).toBeNull();
|
|
181
|
+
mount(() => h(HkDebugFloat, { open: true }));
|
|
182
|
+
expect(floatWindow()).not.toBeNull();
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it("v-model round-trips: clicking close emits and a flipped prop hides", async () => {
|
|
186
|
+
const Host = defineComponent({
|
|
187
|
+
setup() {
|
|
188
|
+
const open = ref(true);
|
|
189
|
+
return () =>
|
|
190
|
+
h(HkDebugFloat, {
|
|
191
|
+
open: open.value,
|
|
192
|
+
"onUpdate:open": (v: boolean) => {
|
|
193
|
+
open.value = v;
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
mount(() => h(Host));
|
|
199
|
+
expect(floatWindow()).not.toBeNull();
|
|
200
|
+
(floatWindow()!.querySelector("button.hk-icon-button") as HTMLButtonElement).click();
|
|
201
|
+
await nextTick();
|
|
202
|
+
expect(floatWindow()).toBeNull();
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
describe("HkDebugFloat drag", () => {
|
|
207
|
+
it("moves the window with the header pointer sequence and clamps to the viewport", async () => {
|
|
208
|
+
mount(() => h(HkDebugFloat, { width: 280 }));
|
|
209
|
+
const win = floatWindow()!;
|
|
210
|
+
const header = win.querySelector("[data-el='header']")!;
|
|
211
|
+
|
|
212
|
+
dispatchMouse("pointerdown", header, { clientX: 100, clientY: 100, button: 0, buttons: 1 });
|
|
213
|
+
await nextTick();
|
|
214
|
+
expect(win.hasAttribute("data-dragging")).toBe(true);
|
|
215
|
+
|
|
216
|
+
// happy-dom has no layout engine: rects read zero, so the first
|
|
217
|
+
// grab adopts origin (0,0) here — real browsers adopt the
|
|
218
|
+
// CSS-resolved corner spot (the component contract, exercised via
|
|
219
|
+
// the pure clamp helper below).
|
|
220
|
+
dispatchMouse("pointermove", header, { clientX: 140, clientY: 120, buttons: 1 });
|
|
221
|
+
await nextTick();
|
|
222
|
+
// A dragged position pins the top-left in px and kills the insets.
|
|
223
|
+
expect(win.style.left).toBe("40px");
|
|
224
|
+
expect(win.style.top).toBe("20px");
|
|
225
|
+
expect(win.style.right).toBe("auto");
|
|
226
|
+
expect(win.style.bottom).toBe("auto");
|
|
227
|
+
|
|
228
|
+
// Clamp: drag past the right/bottom edge of the 1024x768 viewport —
|
|
229
|
+
// the top-left never goes past the viewport box.
|
|
230
|
+
dispatchMouse("pointermove", header, { clientX: 5000, clientY: 5000, buttons: 1 });
|
|
231
|
+
await nextTick();
|
|
232
|
+
expect(Number.parseFloat(win.style.left)).toBeLessThanOrEqual(window.innerWidth);
|
|
233
|
+
expect(Number.parseFloat(win.style.top)).toBeLessThanOrEqual(window.innerHeight);
|
|
234
|
+
|
|
235
|
+
dispatchMouse("pointerup", header);
|
|
236
|
+
await nextTick();
|
|
237
|
+
expect(win.hasAttribute("data-dragging")).toBe(false);
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
it("persists the dropped position when a persistKey is set", async () => {
|
|
241
|
+
mount(() => h(HkDebugFloat, { persistKey: "dragpos", width: 280 }));
|
|
242
|
+
const win = floatWindow()!;
|
|
243
|
+
const header = win.querySelector("[data-el='header']")!;
|
|
244
|
+
dispatchMouse("pointerdown", header, { clientX: 100, clientY: 100, button: 0, buttons: 1 });
|
|
245
|
+
dispatchMouse("pointermove", header, { clientX: 150, clientY: 120, buttons: 1 });
|
|
246
|
+
dispatchMouse("pointerup", header);
|
|
247
|
+
await nextTick();
|
|
248
|
+
|
|
249
|
+
const raw = localStorage.getItem(debugFloatStorageKey("dragpos"));
|
|
250
|
+
expect(raw).not.toBeNull();
|
|
251
|
+
// origin (0,0) + pointer delta (50, 20) from the (100,100) grab.
|
|
252
|
+
expect(JSON.parse(raw!)).toEqual({ open: true, x: 50, y: 20 });
|
|
253
|
+
expect(win.style.left).toBe("50px");
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it("restores a persisted position as an explicit top-left pin", () => {
|
|
257
|
+
localStorage.setItem(
|
|
258
|
+
debugFloatStorageKey("restore"),
|
|
259
|
+
JSON.stringify({ open: true, x: 40, y: 60 }),
|
|
260
|
+
);
|
|
261
|
+
mount(() => h(HkDebugFloat, { persistKey: "restore" }));
|
|
262
|
+
const win = floatWindow()!;
|
|
263
|
+
expect(win.style.left).toBe("40px");
|
|
264
|
+
expect(win.style.top).toBe("60px");
|
|
265
|
+
expect(win.style.right).toBe("auto");
|
|
266
|
+
expect(win.style.bottom).toBe("auto");
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
it("clamps a restored position that no longer fits the viewport", () => {
|
|
270
|
+
localStorage.setItem(
|
|
271
|
+
debugFloatStorageKey("offscreen"),
|
|
272
|
+
JSON.stringify({ open: true, x: 9999, y: 9999 }),
|
|
273
|
+
);
|
|
274
|
+
mount(() => h(HkDebugFloat, { persistKey: "offscreen", width: 280 }));
|
|
275
|
+
const win = floatWindow()!;
|
|
276
|
+
// onMounted re-clamps against the rendered box and the viewport.
|
|
277
|
+
expect(win.getBoundingClientRect().right).toBeLessThanOrEqual(window.innerWidth);
|
|
278
|
+
expect(win.getBoundingClientRect().bottom).toBeLessThanOrEqual(window.innerHeight);
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
it("ignores non-primary-button grabs and pointerdowns on the close button", () => {
|
|
282
|
+
mount(() => h(HkDebugFloat));
|
|
283
|
+
const win = floatWindow()!;
|
|
284
|
+
const header = win.querySelector("[data-el='header']")!;
|
|
285
|
+
|
|
286
|
+
dispatchMouse("pointerdown", header, { clientX: 100, clientY: 100, button: 2, buttons: 2 });
|
|
287
|
+
expect(win.hasAttribute("data-dragging")).toBe(false);
|
|
288
|
+
|
|
289
|
+
const close = win.querySelector("button.hk-icon-button")!;
|
|
290
|
+
dispatchMouse("pointerdown", close, { clientX: 100, clientY: 100, button: 0, buttons: 1 });
|
|
291
|
+
expect(win.hasAttribute("data-dragging")).toBe(false);
|
|
292
|
+
// The close button also never starts a drag position.
|
|
293
|
+
expect(win.style.left).toBe("");
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
it("a hover with no button held never moves the window", () => {
|
|
297
|
+
mount(() => h(HkDebugFloat));
|
|
298
|
+
const win = floatWindow()!;
|
|
299
|
+
const header = win.querySelector("[data-el='header']")!;
|
|
300
|
+
// moves with dragStart unset (no pointerdown) are no-ops…
|
|
301
|
+
dispatchMouse("pointermove", header, { clientX: 500, clientY: 500, buttons: 1 });
|
|
302
|
+
expect(win.style.left).toBe("");
|
|
303
|
+
// …and a stale start releases when the button is no longer held.
|
|
304
|
+
dispatchMouse("pointerdown", header, { clientX: 100, clientY: 100, button: 0, buttons: 1 });
|
|
305
|
+
dispatchMouse("pointermove", header, { clientX: 140, clientY: 120, buttons: 0 });
|
|
306
|
+
expect(win.hasAttribute("data-dragging")).toBe(false);
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
describe("clampDebugFloatPosition", () => {
|
|
311
|
+
const VW = 1024;
|
|
312
|
+
const VH = 768;
|
|
313
|
+
|
|
314
|
+
it("keeps an in-range position untouched", () => {
|
|
315
|
+
expect(clampDebugFloatPosition(10, 20, 280, 200, VW, VH)).toEqual({ x: 10, y: 20 });
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
it("clamps negative offsets to the viewport origin", () => {
|
|
319
|
+
expect(clampDebugFloatPosition(-50, -1, 280, 200, VW, VH)).toEqual({ x: 0, y: 0 });
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
it("clamps past-edge drags to the fully-visible box", () => {
|
|
323
|
+
expect(clampDebugFloatPosition(5000, 5000, 280, 200, VW, VH)).toEqual({
|
|
324
|
+
x: VW - 280,
|
|
325
|
+
y: VH - 200,
|
|
326
|
+
});
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
it("pins a degenerate oversized window to the origin instead of going negative", () => {
|
|
330
|
+
expect(clampDebugFloatPosition(30, 30, 2000, 2000, VW, VH)).toEqual({ x: 0, y: 0 });
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
describe("HkDebugFloat stylesheet contract", () => {
|
|
335
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
336
|
+
const css = compile(resolve(here, "HkDebugFloat.scss"), { style: "expanded" }).css;
|
|
337
|
+
const scale = readFileSync(resolve(here, "..", "scale.scss"), "utf8");
|
|
338
|
+
|
|
339
|
+
it("fades to the prop-driven opacity on hover (the wowsp HUD idiom)", () => {
|
|
340
|
+
// Sass compiles quoted attribute selectors unquoted ([data-hovered]).
|
|
341
|
+
expect(css).toMatch(
|
|
342
|
+
/\.hk-debug-float:hover,\s*\.hk-debug-float\[data-hovered\]\s*\{\s*opacity:\s*var\(--hk-debug-float-hover-opacity,\s*0\.45\);/,
|
|
343
|
+
);
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
it("runs the fade as an opacity-only ~150ms transition on the root", () => {
|
|
347
|
+
expect(css).toMatch(
|
|
348
|
+
/\.hk-debug-float\s*\{[^}]*transition:\s*opacity\s+var\(--duration-short\)/,
|
|
349
|
+
);
|
|
350
|
+
// Opacity-only: nothing about the fade may move layout.
|
|
351
|
+
expect(css).toMatch(/\.hk-debug-float\s*\{[^}]*transition:\s*opacity[^;]*;/);
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
it("keeps the drag exception: a grabbed window stays opaque", () => {
|
|
355
|
+
expect(css).toMatch(/\.hk-debug-float\[data-dragging\]\s*\{\s*opacity:\s*1;/);
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
it("pins the drag exception AFTER the hover rule (equal specificity — order is the cascade)", () => {
|
|
359
|
+
// `.hk-debug-float:hover`/`[data-hovered]` and `[data-dragging]` have
|
|
360
|
+
// EQUAL specificity (0,2,0): mid-grab both match (the pointer is captured
|
|
361
|
+
// over the header, so :hover holds and pointerleave cannot fire). Which
|
|
362
|
+
// rule wins is decided purely by source order — moving the drag exception
|
|
363
|
+
// above the hover rule fades the window mid-grab, and no runtime test
|
|
364
|
+
// exercises that co-occurrence (happy-dom has no real hover pipeline).
|
|
365
|
+
const hoverIdx = css.search(
|
|
366
|
+
/\.hk-debug-float:hover,\s*\.hk-debug-float\[data-hovered\]\s*\{/,
|
|
367
|
+
);
|
|
368
|
+
const dragIdx = css.search(/\.hk-debug-float\[data-dragging\]\s*\{/);
|
|
369
|
+
expect(hoverIdx).toBeGreaterThan(-1);
|
|
370
|
+
expect(dragIdx).toBeGreaterThan(hoverIdx);
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
it("keeps scale.scss, the sheet fallback and the TS constant on one band", () => {
|
|
374
|
+
const band = scale.match(/--hk-z-debug-float:\s*(\d+)/);
|
|
375
|
+
// A missing match is a broken contract, not an empty pass.
|
|
376
|
+
expect(band).not.toBeNull();
|
|
377
|
+
expect(Number(band![1])).toBe(HK_DEBUG_FLOAT_DOCUMENT_Z);
|
|
378
|
+
expect(css).toContain(`z-index: var(--hk-z-debug-float, ${HK_DEBUG_FLOAT_DOCUMENT_Z});`);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
it("parks the band above content chrome and below every functional popup", () => {
|
|
382
|
+
const value = (name: string) => {
|
|
383
|
+
const m = scale.match(new RegExp(`--hk-z-${name}:\\s*(\\d+)`));
|
|
384
|
+
expect(m, `--hk-z-${name} must stay defined in scale.scss`).not.toBeNull();
|
|
385
|
+
return Number(m![1]);
|
|
386
|
+
};
|
|
387
|
+
const band = value("debug-float");
|
|
388
|
+
// Above every content-chrome rung (tooltip is the highest).
|
|
389
|
+
expect(band).toBeGreaterThan(value("tooltip"));
|
|
390
|
+
// Strictly below the fenced popup root: modals, drawers, toasts and
|
|
391
|
+
// tooltips all live inside #hk-overlay-root and must win over the
|
|
392
|
+
// debug window.
|
|
393
|
+
expect(band).toBeLessThan(value("overlay-root"));
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
it("never spans the viewport — pointers outside the window land on the page", () => {
|
|
397
|
+
const root = css.match(/\.hk-debug-float\s*\{[^}]*\}/)![0];
|
|
398
|
+
expect(root).not.toMatch(/inset\s*:/);
|
|
399
|
+
expect(root).toMatch(/pointer-events:\s*auto;/);
|
|
400
|
+
expect(css).not.toMatch(/\.hk-debug-float\s*\{[^}]*position:\s*absolute/);
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
it("gives the header the grab affordances and the body the tabular mono face", () => {
|
|
404
|
+
expect(css).toMatch(/\.hk-debug-float \[data-el=header\]\s*\{[^}]*cursor:\s*grab;/);
|
|
405
|
+
expect(css).toMatch(/\.hk-debug-float \[data-el=header\]\s*\{[^}]*touch-action:\s*none;/);
|
|
406
|
+
expect(css).toMatch(
|
|
407
|
+
/\.hk-debug-float\[data-dragging\] \[data-el=header\]\s*\{[^}]*cursor:\s*grabbing;/,
|
|
408
|
+
);
|
|
409
|
+
expect(css).toMatch(/\.hk-debug-float\s*\{[^}]*font-family:\s*var\(--font-mono\);/);
|
|
410
|
+
expect(css).toMatch(/\.hk-debug-float\s*\{[^}]*font-variant-numeric:\s*tabular-nums;/);
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
it("caps the body so a fat dump cannot cover the viewport", () => {
|
|
414
|
+
expect(css).toMatch(
|
|
415
|
+
/\.hk-debug-float \[data-el=body\]\s*\{[^}]*max-height:\s*40vh;[^}]*overflow:\s*auto;/,
|
|
416
|
+
);
|
|
417
|
+
});
|
|
418
|
+
});
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
// AI-generated: developed with the DeepSeek Harness agent (model GLM-5.3 Flash); human-directed.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* HkDebugFloat — a generic debug floating window.
|
|
5
|
+
*
|
|
6
|
+
* Debug data (FPS, tick counters, cache stats, …) keeps leaking into
|
|
7
|
+
* product chrome — the founding incident is shittim-chest's holographic
|
|
8
|
+
* panel, whose global header carried a raw "60 FPS" chip (cut in chest
|
|
9
|
+
* PR #2517). This component is the upstream, panel-independent home for
|
|
10
|
+
* that data: a viewport-fixed, body-level window a host mounts ONCE and
|
|
11
|
+
* feeds arbitrary debug content through the default slot.
|
|
12
|
+
*
|
|
13
|
+
* Design contract:
|
|
14
|
+
* - **Body-level overlay.** Teleported to `<body>` directly — never
|
|
15
|
+
* inside any panel/layout DOM, and deliberately NOT into
|
|
16
|
+
* `#hk-overlay-root`: the debug window is not a functional popup, it
|
|
17
|
+
* must not join the popup manager's bands or the fenced z space. It
|
|
18
|
+
* paints at `--hk-z-debug-float` (default 80000) — above every
|
|
19
|
+
* content-chrome rung, strictly below the overlay root (90000), so
|
|
20
|
+
* every modal/toast/tooltip a user opens still wins over it.
|
|
21
|
+
* - **Hover → yield (the wowsp HUD idiom).** Pointer over the window
|
|
22
|
+
* fades it to `hoverOpacity` (default 0.45, ~150ms opacity-only
|
|
23
|
+
* transition); leaving restores full opacity. While DRAGGING the
|
|
24
|
+
* window stays opaque — fading mid-grab hides what the hand holds.
|
|
25
|
+
* - **Drag anywhere on the header**, pointer-captured, clamped to the
|
|
26
|
+
* viewport (`clampDebugFloatPosition`); on drop the position persists.
|
|
27
|
+
* - **Close (×)** emits `update:open` (v-model:open) and persists the
|
|
28
|
+
* closed state. With `persistKey` set, open-state and dragged position
|
|
29
|
+
* round-trip via localStorage under `hk-debug-float:<key>`; reopening
|
|
30
|
+
* restores both.
|
|
31
|
+
* - The window intercepts pointers ONLY on its own box (no backdrop,
|
|
32
|
+
* no inset-0 overlay) — clicks outside it always reach the page.
|
|
33
|
+
*/
|
|
34
|
+
import { X } from "lucide-vue-next";
|
|
35
|
+
import {
|
|
36
|
+
computed,
|
|
37
|
+
defineComponent,
|
|
38
|
+
nextTick,
|
|
39
|
+
onMounted,
|
|
40
|
+
ref,
|
|
41
|
+
Teleport,
|
|
42
|
+
watch,
|
|
43
|
+
type CSSProperties,
|
|
44
|
+
type PropType,
|
|
45
|
+
} from "vue";
|
|
46
|
+
|
|
47
|
+
import HIconButton from "./HkIconButton";
|
|
48
|
+
import {
|
|
49
|
+
clampDebugFloatPosition,
|
|
50
|
+
debugFloatPersistedPosition,
|
|
51
|
+
HK_DEBUG_FLOAT_DOCUMENT_Z,
|
|
52
|
+
readDebugFloatPersisted,
|
|
53
|
+
writeDebugFloatPersisted,
|
|
54
|
+
type HkDebugFloatCorner,
|
|
55
|
+
} from "./debugFloat";
|
|
56
|
+
import { useI18n } from "../i18n/context";
|
|
57
|
+
import "./HkDebugFloat.scss";
|
|
58
|
+
|
|
59
|
+
interface DragStart {
|
|
60
|
+
px: number;
|
|
61
|
+
py: number;
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default defineComponent({
|
|
67
|
+
name: "HkDebugFloat",
|
|
68
|
+
props: {
|
|
69
|
+
/** v-model:open. Controlled when bound; leave undefined to let the
|
|
70
|
+
* window own the state (persisted value first, then defaultOpen). */
|
|
71
|
+
open: { type: Boolean, default: undefined },
|
|
72
|
+
/** Header text; falls back to the localized debug label ("DEBUG"). */
|
|
73
|
+
title: { type: String, default: undefined },
|
|
74
|
+
/** Viewport corner to anchor to until the window is dragged. */
|
|
75
|
+
position: { type: String as PropType<HkDebugFloatCorner>, default: "bottom-right" },
|
|
76
|
+
/** Distance from the anchored viewport edges, px. */
|
|
77
|
+
offset: { type: Number, default: 16 },
|
|
78
|
+
/** Window width, px. */
|
|
79
|
+
width: { type: Number, default: 280 },
|
|
80
|
+
/** Opacity the window fades to while hovered, 0..1. */
|
|
81
|
+
hoverOpacity: { type: Number, default: 0.45 },
|
|
82
|
+
/** Uncontrolled initial open state (superseded by any persisted one). */
|
|
83
|
+
defaultOpen: { type: Boolean, default: true },
|
|
84
|
+
/** When set: open-state + position persist under
|
|
85
|
+
* `hk-debug-float:<persistKey>` and restore on remount. */
|
|
86
|
+
persistKey: { type: String, default: undefined },
|
|
87
|
+
/** Document-space z-index. The default band stays below every
|
|
88
|
+
* functional hikari popup (see debugFloat.ts). */
|
|
89
|
+
zIndex: { type: Number, default: HK_DEBUG_FLOAT_DOCUMENT_Z },
|
|
90
|
+
},
|
|
91
|
+
emits: {
|
|
92
|
+
"update:open": (_open: boolean) => true,
|
|
93
|
+
},
|
|
94
|
+
setup(props, { emit, slots }) {
|
|
95
|
+
const { t } = useI18n();
|
|
96
|
+
|
|
97
|
+
const titleText = computed(() => props.title ?? t("hikari::debugFloat.title", "DEBUG"));
|
|
98
|
+
|
|
99
|
+
// -- persistence (read once at setup; re-read when the key changes) --
|
|
100
|
+
const readPersisted = () =>
|
|
101
|
+
props.persistKey ? readDebugFloatPersisted(props.persistKey) : null;
|
|
102
|
+
|
|
103
|
+
// -- open: controlled v-model:open over an uncontrolled fallback --
|
|
104
|
+
const initialPersisted = readPersisted();
|
|
105
|
+
const internalOpen = ref(initialPersisted ? initialPersisted.open : props.defaultOpen);
|
|
106
|
+
const isOpen = computed(() => props.open ?? internalOpen.value);
|
|
107
|
+
|
|
108
|
+
// -- dragged position: null until the first grab; corner CSS anchors
|
|
109
|
+
// the window until then, and a persisted position short-circuits it --
|
|
110
|
+
const dragPos = ref<{ x: number; y: number } | null>(
|
|
111
|
+
initialPersisted ? debugFloatPersistedPosition(initialPersisted) : null,
|
|
112
|
+
);
|
|
113
|
+
const dragging = ref(false);
|
|
114
|
+
const hovered = ref(false);
|
|
115
|
+
const windowEl = ref<HTMLElement>();
|
|
116
|
+
const headerEl = ref<HTMLElement>();
|
|
117
|
+
let dragStart: DragStart | null = null;
|
|
118
|
+
|
|
119
|
+
/** Best-effort persistence — the new open value is passed in because
|
|
120
|
+
* under a controlled v-model the prop (and thus isOpen) only flips
|
|
121
|
+
* after the parent round-trips the emitted update. */
|
|
122
|
+
function persistState(open: boolean): void {
|
|
123
|
+
if (!props.persistKey) return;
|
|
124
|
+
const pos = dragPos.value;
|
|
125
|
+
writeDebugFloatPersisted(props.persistKey, {
|
|
126
|
+
open,
|
|
127
|
+
...(pos ? { x: pos.x, y: pos.y } : {}),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Re-clamp a restored position against the RENDERED box (the width
|
|
132
|
+
* prop alone would mis-clamp on auto-grown bodies) and viewport. */
|
|
133
|
+
function reclampToViewport(): void {
|
|
134
|
+
const el = windowEl.value;
|
|
135
|
+
const pos = dragPos.value;
|
|
136
|
+
if (!el || !pos) return;
|
|
137
|
+
dragPos.value = clampDebugFloatPosition(
|
|
138
|
+
pos.x,
|
|
139
|
+
pos.y,
|
|
140
|
+
el.offsetWidth,
|
|
141
|
+
el.offsetHeight,
|
|
142
|
+
window.innerWidth,
|
|
143
|
+
window.innerHeight,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function setOpen(open: boolean): void {
|
|
148
|
+
internalOpen.value = open;
|
|
149
|
+
emit("update:open", open);
|
|
150
|
+
persistState(open);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// -- drag (header handle) --
|
|
154
|
+
function onHeaderPointerDown(e: PointerEvent): void {
|
|
155
|
+
// Primary button only; interactive chrome in the header (the
|
|
156
|
+
// close button) keeps its own pointer semantics.
|
|
157
|
+
if (e.button !== 0) return;
|
|
158
|
+
if ((e.target as HTMLElement).closest("button, a, input, select, textarea")) return;
|
|
159
|
+
const el = windowEl.value;
|
|
160
|
+
if (!el) return;
|
|
161
|
+
e.preventDefault();
|
|
162
|
+
// Corner-anchored windows take their CSS-resolved spot as the
|
|
163
|
+
// drag origin: position:fixed makes the rect viewport-true.
|
|
164
|
+
const rect = el.getBoundingClientRect();
|
|
165
|
+
const origin = dragPos.value ?? { x: rect.left, y: rect.top };
|
|
166
|
+
dragStart = { px: e.clientX, py: e.clientY, x: origin.x, y: origin.y };
|
|
167
|
+
dragging.value = true;
|
|
168
|
+
// Capture keeps live moves flowing while the pointer leaves the
|
|
169
|
+
// handle. A synthetic pointer (tests, some engines) has no active
|
|
170
|
+
// pointer id and the capture call may reject per spec — a failed
|
|
171
|
+
// capture must never kill the grab: moves land on the handle
|
|
172
|
+
// anyway, which is the plain no-capture semantic.
|
|
173
|
+
try {
|
|
174
|
+
headerEl.value?.setPointerCapture?.(e.pointerId);
|
|
175
|
+
} catch {
|
|
176
|
+
// No active pointer for the id — dragging continues un-captured.
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function onHeaderPointerMove(e: PointerEvent): void {
|
|
181
|
+
if (!dragStart) return;
|
|
182
|
+
// Re-check the press: a hover with no button held (or a stale
|
|
183
|
+
// start after a mid-drag close) must never move the window.
|
|
184
|
+
if (e.buttons === 0) {
|
|
185
|
+
dragStart = null;
|
|
186
|
+
dragging.value = false;
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const el = windowEl.value;
|
|
190
|
+
if (!el) return;
|
|
191
|
+
dragPos.value = clampDebugFloatPosition(
|
|
192
|
+
dragStart.x + (e.clientX - dragStart.px),
|
|
193
|
+
dragStart.y + (e.clientY - dragStart.py),
|
|
194
|
+
el.offsetWidth,
|
|
195
|
+
el.offsetHeight,
|
|
196
|
+
window.innerWidth,
|
|
197
|
+
window.innerHeight,
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function endDrag(): void {
|
|
202
|
+
if (!dragStart) return;
|
|
203
|
+
dragStart = null;
|
|
204
|
+
dragging.value = false;
|
|
205
|
+
persistState(isOpen.value);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// -- hover → yield --
|
|
209
|
+
function onPointerEnter(): void {
|
|
210
|
+
hovered.value = true;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function onPointerLeave(): void {
|
|
214
|
+
hovered.value = false;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// A restored position clamps once the real box is measurable.
|
|
218
|
+
onMounted(() => {
|
|
219
|
+
void nextTick(reclampToViewport);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// Switching keys re-reads storage and re-syncs both channels.
|
|
223
|
+
watch(
|
|
224
|
+
() => props.persistKey,
|
|
225
|
+
() => {
|
|
226
|
+
const persisted = readPersisted();
|
|
227
|
+
internalOpen.value = persisted ? persisted.open : props.defaultOpen;
|
|
228
|
+
dragPos.value = persisted ? debugFloatPersistedPosition(persisted) : null;
|
|
229
|
+
if (persisted) void nextTick(reclampToViewport);
|
|
230
|
+
},
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
return () => {
|
|
234
|
+
if (!isOpen.value) return null;
|
|
235
|
+
const style: Record<string, string> = {
|
|
236
|
+
width: `${props.width}px`,
|
|
237
|
+
zIndex: String(props.zIndex),
|
|
238
|
+
"--hk-debug-float-hover-opacity": String(props.hoverOpacity),
|
|
239
|
+
"--hk-debug-float-offset": `${props.offset}px`,
|
|
240
|
+
};
|
|
241
|
+
// A dragged/persisted position pins the top-left corner in px;
|
|
242
|
+
// the corner insets must yield to it entirely.
|
|
243
|
+
if (dragPos.value) {
|
|
244
|
+
style.left = `${dragPos.value.x}px`;
|
|
245
|
+
style.top = `${dragPos.value.y}px`;
|
|
246
|
+
style.right = "auto";
|
|
247
|
+
style.bottom = "auto";
|
|
248
|
+
}
|
|
249
|
+
return (
|
|
250
|
+
// Directly to <body> — NOT into #hk-overlay-root: this window
|
|
251
|
+
// is not a functional popup (no popup-manager band, no scroll
|
|
252
|
+
// lock, no breadcrumb) and must paint BELOW the whole fenced
|
|
253
|
+
// popup tree, which only a document-space z can do.
|
|
254
|
+
<Teleport to="body">
|
|
255
|
+
<div
|
|
256
|
+
ref={windowEl}
|
|
257
|
+
class="hk-debug-float"
|
|
258
|
+
data-corner={props.position}
|
|
259
|
+
data-hovered={hovered.value ? "" : undefined}
|
|
260
|
+
data-dragging={dragging.value ? "" : undefined}
|
|
261
|
+
role={titleText.value ? "group" : undefined}
|
|
262
|
+
aria-label={titleText.value || undefined}
|
|
263
|
+
style={style as CSSProperties}
|
|
264
|
+
onPointerenter={onPointerEnter}
|
|
265
|
+
onPointerleave={onPointerLeave}
|
|
266
|
+
>
|
|
267
|
+
<div
|
|
268
|
+
ref={headerEl}
|
|
269
|
+
data-el="header"
|
|
270
|
+
onPointerdown={onHeaderPointerDown}
|
|
271
|
+
onPointermove={onHeaderPointerMove}
|
|
272
|
+
onPointerup={endDrag}
|
|
273
|
+
onPointercancel={endDrag}
|
|
274
|
+
>
|
|
275
|
+
<span data-el="title">{slots.title ? slots.title() : titleText.value}</span>
|
|
276
|
+
<HIconButton
|
|
277
|
+
class="hk-debug-float-close"
|
|
278
|
+
size={24}
|
|
279
|
+
variant="ghost"
|
|
280
|
+
aria-label={t("hikari::alert.close", "Close")}
|
|
281
|
+
onClick={() => setOpen(false)}
|
|
282
|
+
>
|
|
283
|
+
{{ icon: () => <X aria-hidden="true" /> }}
|
|
284
|
+
</HIconButton>
|
|
285
|
+
</div>
|
|
286
|
+
<div data-el="body">{slots.default?.()}</div>
|
|
287
|
+
</div>
|
|
288
|
+
</Teleport>
|
|
289
|
+
);
|
|
290
|
+
};
|
|
291
|
+
},
|
|
292
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// AI-generated: developed with the DeepSeek Harness agent (model GLM-5.3 Flash); human-directed.
|
|
2
|
+
|
|
3
|
+
// Pure geometry + persistence helpers for HkDebugFloat.
|
|
4
|
+
//
|
|
5
|
+
// Dependency-free (no Vue, no i18n): everything here is pure and
|
|
6
|
+
// unit-testable, per the donutGeometry.ts / barChart.ts house pattern —
|
|
7
|
+
// the drag clamp in particular is exported so tests can pin the
|
|
8
|
+
// viewport-clamping contract without driving real pointer sequences.
|
|
9
|
+
|
|
10
|
+
/** Viewport corners HkDebugFloat can anchor to before the user drags it. */
|
|
11
|
+
export type HkDebugFloatCorner =
|
|
12
|
+
| "top-left"
|
|
13
|
+
| "top-right"
|
|
14
|
+
| "bottom-left"
|
|
15
|
+
| "bottom-right";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Document-space z band for the debug float. It must stay ABOVE every
|
|
19
|
+
* content-chrome band (`--hk-z-tooltip` is the highest at 6000) and
|
|
20
|
+
* STRICTLY BELOW `--hk-z-overlay-root` (90000) — the elevation that
|
|
21
|
+
* lifts hikari's whole functional popup tree (modals, drawers, toasts,
|
|
22
|
+
* tooltips) — so a debug window can never cover the UI it is measuring.
|
|
23
|
+
* Kept in sync with scale.scss by HkDebugFloat.test.tsx.
|
|
24
|
+
*/
|
|
25
|
+
export const HK_DEBUG_FLOAT_DOCUMENT_Z = 80000;
|
|
26
|
+
|
|
27
|
+
/** localStorage namespace: `hk-debug-float:<persistKey>`. */
|
|
28
|
+
export const HK_DEBUG_FLOAT_STORAGE_PREFIX = "hk-debug-float:";
|
|
29
|
+
|
|
30
|
+
/** Shape persisted under a persistKey. `x`/`y` are the window's
|
|
31
|
+
* top-left offset in viewport pixels (the dragged position); both are
|
|
32
|
+
* optional but PAIRED — a close before the first drag stores open-state
|
|
33
|
+
* only, and a drop always stores both. */
|
|
34
|
+
export interface HkDebugFloatPersisted {
|
|
35
|
+
open: boolean;
|
|
36
|
+
x?: number;
|
|
37
|
+
y?: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Clamp a dragged/restored top-left position so the window stays inside
|
|
42
|
+
* the viewport. A window bigger than the viewport (degenerate content,
|
|
43
|
+
* zoomed UI) pins to the top-left corner rather than going
|
|
44
|
+
* negative-jumpy; the caller measures the real box so live drags clamp
|
|
45
|
+
* against the rendered size, not the `width` prop alone.
|
|
46
|
+
*/
|
|
47
|
+
export function clampDebugFloatPosition(
|
|
48
|
+
x: number,
|
|
49
|
+
y: number,
|
|
50
|
+
width: number,
|
|
51
|
+
height: number,
|
|
52
|
+
viewportWidth: number,
|
|
53
|
+
viewportHeight: number,
|
|
54
|
+
): { x: number; y: number } {
|
|
55
|
+
const maxX = Math.max(0, viewportWidth - width);
|
|
56
|
+
const maxY = Math.max(0, viewportHeight - height);
|
|
57
|
+
return {
|
|
58
|
+
x: Math.min(Math.max(x, 0), maxX),
|
|
59
|
+
y: Math.min(Math.max(y, 0), maxY),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The storage key for a persistKey (namespaced, collision-free). */
|
|
64
|
+
export function debugFloatStorageKey(persistKey: string): string {
|
|
65
|
+
return `${HK_DEBUG_FLOAT_STORAGE_PREFIX}${persistKey}`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The definite top-left position of a persisted record — null when the
|
|
70
|
+
* record predates the first drag (open-state only). This is the one
|
|
71
|
+
* place the "optional but PAIRED" invariant is narrowed for TS.
|
|
72
|
+
*/
|
|
73
|
+
export function debugFloatPersistedPosition(
|
|
74
|
+
persisted: HkDebugFloatPersisted,
|
|
75
|
+
): { x: number; y: number } | null {
|
|
76
|
+
return persisted.x !== undefined && persisted.y !== undefined
|
|
77
|
+
? { x: persisted.x, y: persisted.y }
|
|
78
|
+
: null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Read the persisted state for a persistKey. Returns null when nothing
|
|
83
|
+
* was stored, storage is unavailable (SSR, privacy modes), or the
|
|
84
|
+
* payload is corrupted/mistyped — a broken debug overlay must never
|
|
85
|
+
* break rendering, so every failure degrades to "no persisted state".
|
|
86
|
+
*/
|
|
87
|
+
export function readDebugFloatPersisted(persistKey: string): HkDebugFloatPersisted | null {
|
|
88
|
+
try {
|
|
89
|
+
const raw = localStorage.getItem(debugFloatStorageKey(persistKey));
|
|
90
|
+
if (!raw) return null;
|
|
91
|
+
const parsed: unknown = JSON.parse(raw);
|
|
92
|
+
if (parsed === null || typeof parsed !== "object") return null;
|
|
93
|
+
const rec = parsed as Record<string, unknown>;
|
|
94
|
+
const hasPos = "x" in rec || "y" in rec;
|
|
95
|
+
if (typeof rec.open !== "boolean") return null;
|
|
96
|
+
if (
|
|
97
|
+
hasPos &&
|
|
98
|
+
(typeof rec.x !== "number" ||
|
|
99
|
+
typeof rec.y !== "number" ||
|
|
100
|
+
!Number.isFinite(rec.x) ||
|
|
101
|
+
!Number.isFinite(rec.y))
|
|
102
|
+
) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
open: rec.open,
|
|
107
|
+
...(hasPos ? { x: rec.x as number, y: rec.y as number } : {}),
|
|
108
|
+
};
|
|
109
|
+
} catch {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Write the persisted state for a persistKey. Storage failures
|
|
116
|
+
* (quota, privacy modes) are swallowed: persistence is best-effort by
|
|
117
|
+
* contract, the window still works fully without it.
|
|
118
|
+
*/
|
|
119
|
+
export function writeDebugFloatPersisted(
|
|
120
|
+
persistKey: string,
|
|
121
|
+
value: HkDebugFloatPersisted,
|
|
122
|
+
): void {
|
|
123
|
+
try {
|
|
124
|
+
localStorage.setItem(debugFloatStorageKey(persistKey), JSON.stringify(value));
|
|
125
|
+
} catch {
|
|
126
|
+
// Best-effort by contract.
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"hikari::datePicker.prevYear": "السنة السابقة",
|
|
31
31
|
"hikari::datePicker.prevYears": "Previous years",
|
|
32
32
|
"hikari::datePicker.today": "اليوم",
|
|
33
|
+
"hikari::debugFloat.title": "تصحيح",
|
|
33
34
|
"hikari::dateTimePicker.back": "رجوع",
|
|
34
35
|
"hikari::dateTimePicker.hour": "الساعة",
|
|
35
36
|
"hikari::dateTimePicker.minute": "الدقيقة",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"hikari::datePicker.prevYear": "Vorheriges Jahr",
|
|
31
31
|
"hikari::datePicker.prevYears": "Previous years",
|
|
32
32
|
"hikari::datePicker.today": "Heute",
|
|
33
|
+
"hikari::debugFloat.title": "Debug",
|
|
33
34
|
"hikari::dateTimePicker.back": "Zurück",
|
|
34
35
|
"hikari::dateTimePicker.hour": "Stunde",
|
|
35
36
|
"hikari::dateTimePicker.minute": "Minute",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"hikari::datePicker.prevYear": "Previous year",
|
|
31
31
|
"hikari::datePicker.prevYears": "Previous years",
|
|
32
32
|
"hikari::datePicker.today": "Today",
|
|
33
|
+
"hikari::debugFloat.title": "DEBUG",
|
|
33
34
|
"hikari::dateTimePicker.back": "Back",
|
|
34
35
|
"hikari::dateTimePicker.hour": "Hour",
|
|
35
36
|
"hikari::dateTimePicker.minute": "Minute",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"hikari::datePicker.prevYear": "Año anterior",
|
|
31
31
|
"hikari::datePicker.prevYears": "Previous years",
|
|
32
32
|
"hikari::datePicker.today": "Hoy",
|
|
33
|
+
"hikari::debugFloat.title": "Depuración",
|
|
33
34
|
"hikari::dateTimePicker.back": "Atrás",
|
|
34
35
|
"hikari::dateTimePicker.hour": "Hora",
|
|
35
36
|
"hikari::dateTimePicker.minute": "Minuto",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"hikari::datePicker.prevYear": "Année précédente",
|
|
31
31
|
"hikari::datePicker.prevYears": "Previous years",
|
|
32
32
|
"hikari::datePicker.today": "Aujourd'hui",
|
|
33
|
+
"hikari::debugFloat.title": "Débogage",
|
|
33
34
|
"hikari::dateTimePicker.back": "Retour",
|
|
34
35
|
"hikari::dateTimePicker.hour": "Heure",
|
|
35
36
|
"hikari::dateTimePicker.minute": "Minute",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"hikari::datePicker.prevYear": "前年",
|
|
31
31
|
"hikari::datePicker.prevYears": "前の12年",
|
|
32
32
|
"hikari::datePicker.today": "今日",
|
|
33
|
+
"hikari::debugFloat.title": "デバッグ",
|
|
33
34
|
"hikari::dateTimePicker.back": "戻る",
|
|
34
35
|
"hikari::dateTimePicker.hour": "時",
|
|
35
36
|
"hikari::dateTimePicker.minute": "分",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"hikari::datePicker.prevYear": "이전 연도",
|
|
31
31
|
"hikari::datePicker.prevYears": "이전 12년",
|
|
32
32
|
"hikari::datePicker.today": "오늘",
|
|
33
|
+
"hikari::debugFloat.title": "디버그",
|
|
33
34
|
"hikari::dateTimePicker.back": "뒤로",
|
|
34
35
|
"hikari::dateTimePicker.hour": "시",
|
|
35
36
|
"hikari::dateTimePicker.minute": "분",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"hikari::datePicker.prevYear": "Ano anterior",
|
|
31
31
|
"hikari::datePicker.prevYears": "Previous years",
|
|
32
32
|
"hikari::datePicker.today": "Hoje",
|
|
33
|
+
"hikari::debugFloat.title": "Depuração",
|
|
33
34
|
"hikari::dateTimePicker.back": "Voltar",
|
|
34
35
|
"hikari::dateTimePicker.hour": "Hora",
|
|
35
36
|
"hikari::dateTimePicker.minute": "Minuto",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"hikari::datePicker.prevYear": "Предыдущий год",
|
|
31
31
|
"hikari::datePicker.prevYears": "Previous years",
|
|
32
32
|
"hikari::datePicker.today": "Сегодня",
|
|
33
|
+
"hikari::debugFloat.title": "Отладка",
|
|
33
34
|
"hikari::dateTimePicker.back": "Назад",
|
|
34
35
|
"hikari::dateTimePicker.hour": "Час",
|
|
35
36
|
"hikari::dateTimePicker.minute": "Минута",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"hikari::datePicker.prevYear": "上一年",
|
|
31
31
|
"hikari::datePicker.prevYears": "前12年",
|
|
32
32
|
"hikari::datePicker.today": "今天",
|
|
33
|
+
"hikari::debugFloat.title": "调试",
|
|
33
34
|
"hikari::dateTimePicker.back": "返回",
|
|
34
35
|
"hikari::dateTimePicker.hour": "时",
|
|
35
36
|
"hikari::dateTimePicker.minute": "分",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"hikari::datePicker.prevYear": "上一年",
|
|
31
31
|
"hikari::datePicker.prevYears": "前12年",
|
|
32
32
|
"hikari::datePicker.today": "今天",
|
|
33
|
+
"hikari::debugFloat.title": "除錯",
|
|
33
34
|
"hikari::dateTimePicker.back": "返回",
|
|
34
35
|
"hikari::dateTimePicker.hour": "時",
|
|
35
36
|
"hikari::dateTimePicker.minute": "分",
|
package/src/index.ts
CHANGED
|
@@ -754,6 +754,15 @@ export { default as HkColorPicker } from "./components/HkColorPicker";
|
|
|
754
754
|
export { default as HkCopyBadge } from "./components/HkCopyBadge";
|
|
755
755
|
export { default as HkConfirmDialog } from "./components/HkConfirmDialog";
|
|
756
756
|
export { default as HkCrossfade } from "./components/HkCrossfade";
|
|
757
|
+
export { default as HkDebugFloat } from "./components/HkDebugFloat";
|
|
758
|
+
export {
|
|
759
|
+
clampDebugFloatPosition,
|
|
760
|
+
debugFloatStorageKey,
|
|
761
|
+
HK_DEBUG_FLOAT_DOCUMENT_Z,
|
|
762
|
+
HK_DEBUG_FLOAT_STORAGE_PREFIX,
|
|
763
|
+
type HkDebugFloatCorner,
|
|
764
|
+
type HkDebugFloatPersisted,
|
|
765
|
+
} from "./components/debugFloat";
|
|
757
766
|
export { default as HkTransitionContainer } from "./components/HkTransitionContainer";
|
|
758
767
|
export { default as HkPaneHolder } from "./components/HkPaneHolder";
|
|
759
768
|
export { default as HkWindowControls, isApplePlatform } from "./components/HkWindowControls";
|
|
@@ -39,7 +39,7 @@ import { BOOT_LANDING_DETAILS_CSS } from "./bootLandingDetailsCss.js";
|
|
|
39
39
|
|
|
40
40
|
/** The default script's bytes, pinned so an accidental default change fails. */
|
|
41
41
|
const DEFAULT_SCRIPT_SHA256 =
|
|
42
|
-
"
|
|
42
|
+
"b244cd45481ef9cd376c2e1a146fe78a51f9801c3e0c97dbd3057e6e28d9a5f7";
|
|
43
43
|
/** The heal-only script's bytes (the other shape a host may hash). */
|
|
44
44
|
const HEAL_ONLY_SCRIPT_SHA256 =
|
|
45
45
|
"bee06d4652e55708d8b130fec11ff8ede54d4eafb944ef0d18f7be5a76b3dca6";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
const GOLDEN_DEFAULT_SHA256 =
|
|
37
|
-
"
|
|
37
|
+
"b244cd45481ef9cd376c2e1a146fe78a51f9801c3e0c97dbd3057e6e28d9a5f7";
|
|
38
38
|
const GOLDEN_HEAL_ONLY_SHA256 =
|
|
39
39
|
"bee06d4652e55708d8b130fec11ff8ede54d4eafb944ef0d18f7be5a76b3dca6";
|
|
40
40
|
|
|
@@ -28,7 +28,7 @@ import { bootRecoveryScript } from "./boot-recovery.js";
|
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
const GOLDEN_DEFAULT_SHA256 =
|
|
31
|
-
"
|
|
31
|
+
"b244cd45481ef9cd376c2e1a146fe78a51f9801c3e0c97dbd3057e6e28d9a5f7";
|
|
32
32
|
const GOLDEN_HEAL_ONLY_SHA256 =
|
|
33
33
|
"bee06d4652e55708d8b130fec11ff8ede54d4eafb944ef0d18f7be5a76b3dca6";
|
|
34
34
|
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
// HkErrorLanding, so it ships the component's real stylesheet instead of a
|
|
12
12
|
// hand-copied palette. bootLandingCss.test.ts recompiles the entry and fails
|
|
13
13
|
// on drift.
|
|
14
|
-
export const BOOT_LANDING_CSS = ":root{--c-primary-faint: rgb(var(--color-primary, 122 162 247) / 5%);--c-primary-subtle: rgb(var(--color-primary, 122 162 247) / 8%);--c-primary-dim: rgb(var(--color-primary, 122 162 247) / 10%);--c-primary-light: rgb(var(--color-primary, 122 162 247) / 15%);--c-primary-overlay: rgb(var(--color-primary, 122 162 247) / 15%);--c-primary-medium: rgb(var(--color-primary, 122 162 247) / 25%);--c-primary-strong: rgb(var(--color-primary, 122 162 247) / 40%);--c-primary-intense: rgb(var(--color-primary, 122 162 247) / 40%);--c-error-dim: rgb(var(--color-error, 247 118 142) / 10%);--c-error-overlay: rgb(var(--color-error, 247 118 142) / 20%);--c-error-strong: rgb(var(--color-error, 247 118 142) / 50%);--shadow-elevated: 0 8px 32px rgb(0 0 0 / 15%);--shadow-dropdown: 0 4px 24px rgb(0 0 0 / 12%), 0 0 0 1px rgb(255 255 255 / 4%);--shadow-button: 0 4px 14px rgb(var(--color-primary, 122 162 247) / 35%);--shadow-button-danger: 0 4px 14px rgb(var(--color-error, 247 118 142) / 35%);--shadow-focus: 0 0 0 3px rgb(var(--color-primary, 122 162 247) / 12%);--shadow-focus-error: 0 0 0 3px rgb(var(--color-error, 247 118 142) / 12%);--border-input: rgb(var(--color-border, 100 100 100) / 15%);--border-faint: rgb(var(--color-border, 100 100 100) / 10%);--border-subtle: rgb(var(--color-border, 100 100 100) / 12%);--hi-icon-color: rgb(var(--color-text, 30 30 30));--hi-icon-size-xs: 0.75rem;--hi-icon-size-sm: 1rem;--hi-icon-size-md: 1.25rem;--hi-icon-size-lg: 1.5rem;--hi-duration-instant: var(--duration-instant, 0.1s);--hi-border-color-focus: rgb(var(--color-primary, 122 162 247));--hi-glow-color: transparent;--hi-bg-surface-dark: rgb(var(--color-muted, 108 108 108) / 12%);--hi-color-primary-dark: color-mix(in srgb, rgb(var(--color-primary, 122 162 247)) 82%, #000);--hi-color-secondary-dark: color-mix(in srgb, rgb(var(--color-secondary, 81 154 115)) 82%, #000);--hi-color-danger-dark: color-mix(in srgb, rgb(var(--color-error, 247 118 142)) 82%, #000);--hi-color-success-dark: color-mix(in srgb, rgb(var(--color-success, 14 184 64)) 82%, #000);--hi-color-text-on-secondary: rgb(var(--color-on-solid, 255 255 255));--hi-color-text-on-danger: rgb(var(--color-on-solid, 255 255 255));--hi-color-text-on-success: rgb(var(--color-on-solid, 255 255 255))}:root{--color-primary: 122 162 247;--color-on-primary: 255 255 255;--color-on-solid: 255 255 255;--color-on-solid-text: 255 255 255;--color-on-solid-icon: 255 255 255;--color-on-danger: 255 255 255;--color-on-success: 255 255 255;--color-on-warning: 0 0 0;--color-on-info: 0 0 0;--color-secondary: 81 154 115;--color-accent: 247 181 0;--color-text: 30 30 30;--color-text-secondary: 102 102 102;--color-text-tertiary: 140 140 140;--color-muted: 108 108 108;--color-border: 100 100 100;--color-focused-border: 122 162 247;--color-background: 255 255 255;--color-surface: 255 255 255;--color-selected-bg: 191 218 242;--color-selected-text: 30 30 30;--color-status-bar-bg: 240 244 248;--color-success: 14 184 64;--color-error: 247 118 142;--color-warning: 238 214 119;--color-info: 106 190 214;--hi-color-primary: rgb(var(--color-primary));--hi-color-secondary: rgb(var(--color-secondary));--hi-color-surface: rgb(var(--color-surface));--hi-color-background: rgb(var(--color-background));--hi-color-border: rgb(var(--color-border) / 15%);--hi-color-text-primary: rgb(var(--color-text));--hi-color-text-secondary: rgb(var(--color-text-secondary));--hi-color-muted: rgb(var(--color-muted));--hi-color-on-primary: rgb(var(--color-on-primary));--hi-color-text-on-primary: rgb(var(--color-on-primary));--hi-color-text-on-solid: rgb(var(--color-on-solid-text, 255 255 255));--hi-color-icon-on-solid: rgb(var(--color-on-solid-icon, 255 255 255));--hi-color-success: rgb(var(--color-success));--hi-color-error: rgb(var(--color-error));--hi-color-warning: rgb(var(--color-warning));--hi-color-info: rgb(var(--color-info));--hi-color-text-on-danger: rgb(var(--color-on-danger));--hi-color-text-on-success: rgb(var(--color-on-success));--hi-color-text-on-warning: rgb(var(--color-on-warning));--hi-color-text-on-info: rgb(var(--color-on-info));--hi-color-bg-subtle: rgb(var(--color-surface) / 0.5);--hi-color-bg-elevated: rgb(var(--color-surface));--hi-color-bg-canvas: rgb(var(--color-background));--hi-secondary-bg: rgb(var(--color-surface) / 0.5);--hi-color-accent: rgb(var(--color-accent));--hi-primary: var(--hi-color-primary);--hi-surface: var(--hi-color-surface);--hi-card-bg: var(--hi-color-surface)}:root{--space-1: 0.0625rem;--space-2: 0.125rem;--space-4: 0.25rem;--space-6: 0.375rem;--space-8: 0.5rem;--space-10: 0.625rem;--space-12: 0.75rem;--space-14: 0.875rem;--space-16: 1rem;--space-20: 1.25rem;--space-24: 1.5rem;--space-28: 1.75rem;--space-32: 2rem;--space-40: 2.5rem;--text-3xs: 0.5rem;--text-2xs: 0.625rem;--text-xs: 0.75rem;--text-sm: 0.8125rem;--text-base: 0.875rem;--text-md: 1rem;--text-lg: 1.125rem;--text-xl: 1.25rem;--text-2xl: 1.5rem;--radius-xs: 2px;--radius-sm: 4px;--radius-md: 8px;--radius-lg: 12px;--radius-xl: 16px;--radius-full: 9999px;--blur-xs: 4px;--blur-sm: 8px;--blur-md: 16px;--blur-lg: 24px;--blur-xl: 24px;--opacity-half: 0.92;--duration-instant: 0.1s;--duration-short: 0.15s;--duration-fast: 0.15s;--duration-normal: 0.3s;--ease-standard: cubic-bezier(0.4, 0, 0.2, 1);--ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);--ease-in: cubic-bezier(0.4, 0, 1, 1);--ease-elastic: cubic-bezier(0.16, 1, 0.3, 1);--hi-duration-fast: 0.15s;--hi-ease-default: cubic-bezier(0.4, 0, 0.2, 1);--hk-z-base: 0;--hk-z-above: 1;--hk-z-scrollbar: 10;--hk-z-fab: 40;--hk-z-toolbar: 50;--hk-z-header: 100;--hk-z-sidebar: 900;--hk-z-drag: 950;--hk-z-breadcrumb: 2500;--hk-z-float: 3000;--hk-z-toast: 4000;--hk-z-veil: 4100;--hk-z-modal: 5000;--hk-z-tooltip: 6000;--hk-z-overlay-root: 90000;--hk-z-hud: 90050;--hk-z-error: 95000;--hk-z-titlebar: 100001;--viewport-gutter: 16px;--font-sans: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", \"Noto Sans CJK SC\", sans-serif;--font-reading: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", \"Noto Sans CJK SC\", sans-serif;--font-mono: ui-monospace, \"SF Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", \"Liberation Mono\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans CJK SC\", monospace}@media(max-width: 767px){:root{--viewport-gutter: 8px}}.hk-error-landing{--hel-background: var(--color-background, 246 247 249);--hel-surface: var(--color-surface, 255 255 255);--hel-text: var(--color-text, 30 32 36);--hel-muted: var(--color-muted, 118 122 128);--hel-border: var(--color-border, 222 224 228);--hel-primary: var(--color-primary, 58 118 236);--hel-error: var(--color-error, 226 84 84);--hel-warning: var(--color-warning, 222 168 62);width:100%;min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:var(--space-20, 1.25rem);background:rgb(var(--hel-background));color:rgb(var(--hel-text));font-family:var(--font-sans, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", \"Noto Sans CJK SC\", sans-serif)}.hk-error-landing__card{position:relative;overflow:hidden;width:min(440px,100%);background:rgb(var(--hel-surface));border:1px solid rgb(var(--hel-border)/70%);border-radius:var(--radius-xl, 16px);box-shadow:var(--shadow-lg, 0 18px 48px rgba(0, 0, 0, 0.08));padding:2.25rem var(--space-28, 1.75rem) var(--space-28, 1.75rem);text-align:center}.hk-error-landing__card::before{content:\"\";position:absolute;inset:0 0 auto;height:150px;background:radial-gradient(58% 100% at 50% 0%, rgb(var(--hel-error)/8%), transparent 72%);pointer-events:none}.hk-error-landing.is-warning .hk-error-landing__card::before{background:radial-gradient(58% 100% at 50% 0%, rgb(var(--hel-warning)/10%), transparent 72%)}.hk-error-landing.is-info .hk-error-landing__card::before{background:radial-gradient(58% 100% at 50% 0%, rgb(var(--hel-primary)/7%), transparent 72%)}.hk-error-landing__brand{position:relative;display:flex;justify-content:center;margin-bottom:var(--space-16, 1rem)}.hk-error-landing__brand:empty{display:none}.hk-error-landing__icon{position:relative;width:64px;height:64px;margin:0 auto var(--space-14, 0.875rem);display:flex;align-items:center;justify-content:center;border-radius:50%}.hk-error-landing__icon,.hk-error-landing__icon svg{color:rgb(var(--hel-error))}.hk-error-landing__icon{background:linear-gradient(145deg, rgb(var(--hel-error)/18%), rgb(var(--hel-error)/6%));border:1px solid rgb(var(--hel-error)/26%);box-shadow:0 0 0 8px rgb(var(--hel-error)/5%),0 10px 28px -12px rgb(var(--hel-error)/45%)}.hk-error-landing.is-warning .hk-error-landing__icon,.hk-error-landing.is-warning .hk-error-landing__icon svg{color:rgb(var(--hel-warning))}.hk-error-landing.is-warning .hk-error-landing__icon{background:linear-gradient(145deg, rgb(var(--hel-warning)/20%), rgb(var(--hel-warning)/7%));border-color:rgb(var(--hel-warning)/28%);box-shadow:0 0 0 8px rgb(var(--hel-warning)/6%),0 10px 28px -12px rgb(var(--hel-warning)/45%)}.hk-error-landing.is-info .hk-error-landing__icon,.hk-error-landing.is-info .hk-error-landing__icon svg{color:rgb(var(--hel-primary))}.hk-error-landing.is-info .hk-error-landing__icon{background:linear-gradient(145deg, rgb(var(--hel-primary)/16%), rgb(var(--hel-primary)/5%));border-color:rgb(var(--hel-primary)/24%);box-shadow:0 0 0 8px rgb(var(--hel-primary)/5%),0 10px 28px -12px rgb(var(--hel-primary)/40%)}.hk-error-landing__meta{position:relative;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:var(--space-6, 0.375rem);margin-bottom:var(--space-8, 0.5rem)}.hk-error-landing__meta .hk-badge:not(.hk-badge-muted){--hk-badge-text: rgb(var(--hel-error));--hk-badge-bg: rgb(var(--hel-error) / 10%);--hk-badge-border: rgb(var(--hel-error) / 22%)}.hk-error-landing.is-warning .hk-error-landing__meta .hk-badge:not(.hk-badge-muted){--hk-badge-text: rgb(var(--hel-warning));--hk-badge-bg: rgb(var(--hel-warning) / 12%);--hk-badge-border: rgb(var(--hel-warning) / 24%)}.hk-error-landing.is-info .hk-error-landing__meta .hk-badge:not(.hk-badge-muted){--hk-badge-text: rgb(var(--hel-primary));--hk-badge-bg: rgb(var(--hel-primary) / 10%);--hk-badge-border: rgb(var(--hel-primary) / 20%)}.hk-error-landing__meta .hk-badge-muted{--hk-badge-text: rgb(var(--hel-muted));--hk-badge-bg: rgb(var(--hel-muted) / 8%);--hk-badge-border: rgb(var(--hel-border) / 80%)}.hk-error-landing__title{position:relative;margin:0;font-size:var(--text-xl, 1.25rem);font-weight:650;letter-spacing:-0.01em;line-height:1.35;color:rgb(var(--hel-text));white-space:pre-line;overflow-wrap:anywhere}.hk-error-landing__desc{position:relative;margin:var(--space-8, 0.5rem) 0 0;font-size:var(--text-sm, 0.8125rem);line-height:1.6;color:rgb(var(--hel-muted));white-space:pre-line;overflow-wrap:anywhere}.hk-error-landing__details{position:relative;margin-top:var(--space-16, 1rem);text-align:start}.hk-error-landing__details-label{display:flex;align-items:center;gap:var(--space-4, 4px);padding:0 var(--space-2, 2px);font-size:var(--text-xs, 0.75rem);font-weight:500;letter-spacing:.02em;color:rgb(var(--hel-muted));-webkit-user-select:none;user-select:none}.hk-error-landing__details-pane{position:relative;margin-top:var(--space-6, 0.375rem);height:max(9rem,20vh);height:max(9rem,20dvh);border:1px solid rgb(var(--hel-border)/70%);border-radius:var(--radius-md, 8px);background:rgb(var(--hel-muted)/4%)}.hk-error-landing__details-body{height:100%;overflow:auto;border-radius:inherit;padding:var(--space-4, 0.25rem);scrollbar-width:none}.hk-error-landing__details-body::-webkit-scrollbar{display:none}.hk-error-landing .hk-error-landing__details-body .s-tool-json-tree{max-height:none;height:auto;overflow:visible;margin:0;padding:0;border:none;border-radius:0;background:rgba(0,0,0,0)}.hk-error-landing__actions{position:relative;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:var(--space-8, 0.5rem);margin-top:var(--space-16, 1rem)}.hk-error-landing.is-inline{min-height:100%;padding:0 var(--space-12, 0.75rem);align-items:flex-start;background:rgba(0,0,0,0)}.hk-error-landing.is-inline.is-fill{flex:1 1 auto;min-height:0}.hk-error-landing.is-inline .hk-error-landing__card{margin:auto;padding:var(--space-16, 1rem) var(--space-28, 1.75rem) var(--space-24, 1.5rem);display:flex;flex-direction:column;max-height:100%;min-height:min-content}.hk-error-landing.is-inline .hk-error-landing__details{display:flex;flex-direction:column;min-height:0}.hk-error-landing.is-inline .hk-error-landing__details-pane{height:auto;flex-grow:0;flex-shrink:1;flex-basis:max(9rem,20vh);flex-basis:max(9rem,20dvh);min-height:6rem}@media(max-width: 480px){.hk-error-landing__card{padding:var(--space-28, 1.75rem) 1.125rem var(--space-24, 1.5rem)}}:root{--c-primary-faint: rgb(var(--color-primary, 122 162 247) / 5%);--c-primary-subtle: rgb(var(--color-primary, 122 162 247) / 8%);--c-primary-dim: rgb(var(--color-primary, 122 162 247) / 10%);--c-primary-light: rgb(var(--color-primary, 122 162 247) / 15%);--c-primary-overlay: rgb(var(--color-primary, 122 162 247) / 15%);--c-primary-medium: rgb(var(--color-primary, 122 162 247) / 25%);--c-primary-strong: rgb(var(--color-primary, 122 162 247) / 40%);--c-primary-intense: rgb(var(--color-primary, 122 162 247) / 40%);--c-error-dim: rgb(var(--color-error, 247 118 142) / 10%);--c-error-overlay: rgb(var(--color-error, 247 118 142) / 20%);--c-error-strong: rgb(var(--color-error, 247 118 142) / 50%);--shadow-elevated: 0 8px 32px rgb(0 0 0 / 15%);--shadow-dropdown: 0 4px 24px rgb(0 0 0 / 12%), 0 0 0 1px rgb(255 255 255 / 4%);--shadow-button: 0 4px 14px rgb(var(--color-primary, 122 162 247) / 35%);--shadow-button-danger: 0 4px 14px rgb(var(--color-error, 247 118 142) / 35%);--shadow-focus: 0 0 0 3px rgb(var(--color-primary, 122 162 247) / 12%);--shadow-focus-error: 0 0 0 3px rgb(var(--color-error, 247 118 142) / 12%);--border-input: rgb(var(--color-border, 100 100 100) / 15%);--border-faint: rgb(var(--color-border, 100 100 100) / 10%);--border-subtle: rgb(var(--color-border, 100 100 100) / 12%);--hi-icon-color: rgb(var(--color-text, 30 30 30));--hi-icon-size-xs: 0.75rem;--hi-icon-size-sm: 1rem;--hi-icon-size-md: 1.25rem;--hi-icon-size-lg: 1.5rem;--hi-duration-instant: var(--duration-instant, 0.1s);--hi-border-color-focus: rgb(var(--color-primary, 122 162 247));--hi-glow-color: transparent;--hi-bg-surface-dark: rgb(var(--color-muted, 108 108 108) / 12%);--hi-color-primary-dark: color-mix(in srgb, rgb(var(--color-primary, 122 162 247)) 82%, #000);--hi-color-secondary-dark: color-mix(in srgb, rgb(var(--color-secondary, 81 154 115)) 82%, #000);--hi-color-danger-dark: color-mix(in srgb, rgb(var(--color-error, 247 118 142)) 82%, #000);--hi-color-success-dark: color-mix(in srgb, rgb(var(--color-success, 14 184 64)) 82%, #000);--hi-color-text-on-secondary: rgb(var(--color-on-solid, 255 255 255));--hi-color-text-on-danger: rgb(var(--color-on-solid, 255 255 255));--hi-color-text-on-success: rgb(var(--color-on-solid, 255 255 255))}:root{--color-primary: 122 162 247;--color-on-primary: 255 255 255;--color-on-solid: 255 255 255;--color-on-solid-text: 255 255 255;--color-on-solid-icon: 255 255 255;--color-on-danger: 255 255 255;--color-on-success: 255 255 255;--color-on-warning: 0 0 0;--color-on-info: 0 0 0;--color-secondary: 81 154 115;--color-accent: 247 181 0;--color-text: 30 30 30;--color-text-secondary: 102 102 102;--color-text-tertiary: 140 140 140;--color-muted: 108 108 108;--color-border: 100 100 100;--color-focused-border: 122 162 247;--color-background: 255 255 255;--color-surface: 255 255 255;--color-selected-bg: 191 218 242;--color-selected-text: 30 30 30;--color-status-bar-bg: 240 244 248;--color-success: 14 184 64;--color-error: 247 118 142;--color-warning: 238 214 119;--color-info: 106 190 214;--hi-color-primary: rgb(var(--color-primary));--hi-color-secondary: rgb(var(--color-secondary));--hi-color-surface: rgb(var(--color-surface));--hi-color-background: rgb(var(--color-background));--hi-color-border: rgb(var(--color-border) / 15%);--hi-color-text-primary: rgb(var(--color-text));--hi-color-text-secondary: rgb(var(--color-text-secondary));--hi-color-muted: rgb(var(--color-muted));--hi-color-on-primary: rgb(var(--color-on-primary));--hi-color-text-on-primary: rgb(var(--color-on-primary));--hi-color-text-on-solid: rgb(var(--color-on-solid-text, 255 255 255));--hi-color-icon-on-solid: rgb(var(--color-on-solid-icon, 255 255 255));--hi-color-success: rgb(var(--color-success));--hi-color-error: rgb(var(--color-error));--hi-color-warning: rgb(var(--color-warning));--hi-color-info: rgb(var(--color-info));--hi-color-text-on-danger: rgb(var(--color-on-danger));--hi-color-text-on-success: rgb(var(--color-on-success));--hi-color-text-on-warning: rgb(var(--color-on-warning));--hi-color-text-on-info: rgb(var(--color-on-info));--hi-color-bg-subtle: rgb(var(--color-surface) / 0.5);--hi-color-bg-elevated: rgb(var(--color-surface));--hi-color-bg-canvas: rgb(var(--color-background));--hi-secondary-bg: rgb(var(--color-surface) / 0.5);--hi-color-accent: rgb(var(--color-accent));--hi-primary: var(--hi-color-primary);--hi-surface: var(--hi-color-surface);--hi-card-bg: var(--hi-color-surface)}.hk-btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-6);font-family:inherit;font-weight:600;line-height:1;border:1px solid rgba(0,0,0,0);border-radius:var(--radius-md, 8px);cursor:pointer;transition-property:background-color,border-color,color,box-shadow,opacity,transform,filter;transition-duration:var(--duration-normal);transition-timing-function:var(--ease-standard);white-space:nowrap;-webkit-user-select:none;user-select:none;outline:none;position:relative}.hk-btn:focus-visible{box-shadow:0 0 0 2px rgb(var(--color-surface)),0 0 0 4px rgb(var(--color-primary))}.hk-btn:disabled{opacity:.5;cursor:not-allowed}.hk-btn-xs{padding:var(--space-4) var(--space-8);font-size:var(--text-xs);min-height:1.375rem}.hk-btn-sm{padding:var(--space-6) var(--space-12);font-size:var(--text-xs);min-height:1.75rem}.hk-btn-md{padding:var(--space-8) var(--space-16);font-size:var(--text-base);min-height:2.5rem}.hk-btn-lg{padding:var(--space-10) var(--space-24);font-size:var(--text-base);min-height:2.75rem}.hk-btn-xs .hk-btn-icon,.hk-btn-xs .hk-btn-suffix{inline-size:.8125rem;block-size:.8125rem}.hk-btn-xs .hk-btn-icon .hk-icon,.hk-btn-xs .hk-btn-suffix .hk-icon{inline-size:100%;block-size:100%}.hk-btn-icon,.hk-btn-suffix{display:inline-flex;align-items:center;justify-content:center;flex:none;inline-size:1rem;block-size:1rem;line-height:0}.hk-btn-icon svg,.hk-btn-suffix svg{display:block}.hk-btn>svg{flex:none}.hk-btn-icon-only{padding:0;box-sizing:border-box}.hk-btn-xs.hk-btn-icon-only{width:1.375rem}.hk-btn-sm.hk-btn-icon-only{width:1.75rem}.hk-btn-md.hk-btn-icon-only{width:2.5rem}.hk-btn-lg.hk-btn-icon-only{width:2.75rem}.hk-btn-block.hk-btn-icon-only{width:100%}.hk-btn-label{display:inline-flex;align-items:center;min-width:0}@media(max-width: 639.98px){.hk-btn-label-collapse-sm.hk-btn-xs .hk-btn-label{display:none}.hk-btn-label-collapse-sm.hk-btn-xs{padding:0;box-sizing:border-box;width:1.375rem}}@media(max-width: 639.98px){.hk-btn-label-collapse-sm.hk-btn-sm .hk-btn-label{display:none}.hk-btn-label-collapse-sm.hk-btn-sm{padding:0;box-sizing:border-box;width:1.75rem}}@media(max-width: 639.98px){.hk-btn-label-collapse-sm.hk-btn-md .hk-btn-label{display:none}.hk-btn-label-collapse-sm.hk-btn-md{padding:0;box-sizing:border-box;width:2.5rem}}@media(max-width: 639.98px){.hk-btn-label-collapse-sm.hk-btn-lg .hk-btn-label{display:none}.hk-btn-label-collapse-sm.hk-btn-lg{padding:0;box-sizing:border-box;width:2.75rem}}@media(max-width: 767.98px){.hk-btn-label-collapse-md.hk-btn-xs .hk-btn-label{display:none}.hk-btn-label-collapse-md.hk-btn-xs{padding:0;box-sizing:border-box;width:1.375rem}}@media(max-width: 767.98px){.hk-btn-label-collapse-md.hk-btn-sm .hk-btn-label{display:none}.hk-btn-label-collapse-md.hk-btn-sm{padding:0;box-sizing:border-box;width:1.75rem}}@media(max-width: 767.98px){.hk-btn-label-collapse-md.hk-btn-md .hk-btn-label{display:none}.hk-btn-label-collapse-md.hk-btn-md{padding:0;box-sizing:border-box;width:2.5rem}}@media(max-width: 767.98px){.hk-btn-label-collapse-md.hk-btn-lg .hk-btn-label{display:none}.hk-btn-label-collapse-md.hk-btn-lg{padding:0;box-sizing:border-box;width:2.75rem}}@media(max-width: 1023.98px){.hk-btn-label-collapse-lg.hk-btn-xs .hk-btn-label{display:none}.hk-btn-label-collapse-lg.hk-btn-xs{padding:0;box-sizing:border-box;width:1.375rem}}@media(max-width: 1023.98px){.hk-btn-label-collapse-lg.hk-btn-sm .hk-btn-label{display:none}.hk-btn-label-collapse-lg.hk-btn-sm{padding:0;box-sizing:border-box;width:1.75rem}}@media(max-width: 1023.98px){.hk-btn-label-collapse-lg.hk-btn-md .hk-btn-label{display:none}.hk-btn-label-collapse-lg.hk-btn-md{padding:0;box-sizing:border-box;width:2.5rem}}@media(max-width: 1023.98px){.hk-btn-label-collapse-lg.hk-btn-lg .hk-btn-label{display:none}.hk-btn-label-collapse-lg.hk-btn-lg{padding:0;box-sizing:border-box;width:2.75rem}}@media(max-width: 1279.98px){.hk-btn-label-collapse-xl.hk-btn-xs .hk-btn-label{display:none}.hk-btn-label-collapse-xl.hk-btn-xs{padding:0;box-sizing:border-box;width:1.375rem}}@media(max-width: 1279.98px){.hk-btn-label-collapse-xl.hk-btn-sm .hk-btn-label{display:none}.hk-btn-label-collapse-xl.hk-btn-sm{padding:0;box-sizing:border-box;width:1.75rem}}@media(max-width: 1279.98px){.hk-btn-label-collapse-xl.hk-btn-md .hk-btn-label{display:none}.hk-btn-label-collapse-xl.hk-btn-md{padding:0;box-sizing:border-box;width:2.5rem}}@media(max-width: 1279.98px){.hk-btn-label-collapse-xl.hk-btn-lg .hk-btn-label{display:none}.hk-btn-label-collapse-xl.hk-btn-lg{padding:0;box-sizing:border-box;width:2.75rem}}.hk-btn-primary{background:rgb(var(--color-primary));color:rgb(var(--color-on-solid))}.hk-btn-primary svg{color:rgb(var(--color-on-solid-icon, 255 255 255))}.hk-btn-primary:hover:not(:disabled):not(:focus-visible){filter:brightness(1.1);box-shadow:var(--shadow-button)}.hk-btn-primary:active:not(:disabled){filter:brightness(0.95)}.hk-btn-secondary{background:rgb(var(--color-surface));color:rgb(var(--color-text));border-color:rgb(var(--color-border)/20%);-webkit-backdrop-filter:var(--hk-btn-secondary-blur, blur(var(--blur-sm)));backdrop-filter:var(--hk-btn-secondary-blur, blur(var(--blur-sm)))}.hk-btn-secondary:hover:not(:disabled){border-color:var(--c-primary-strong)}.hk-btn-secondary:active:not(:disabled){filter:brightness(0.95)}.hk-btn-outline{background:rgba(0,0,0,0);color:rgb(var(--color-primary));border-color:var(--c-primary-intense)}.hk-btn-outline:hover:not(:disabled){background:var(--c-primary-light);border-color:rgb(var(--color-primary))}.hk-btn-outline:active:not(:disabled){filter:brightness(0.95)}.hk-btn-ghost{background:rgba(0,0,0,0);color:rgb(var(--color-text));border-color:rgba(0,0,0,0)}.hk-btn-ghost:hover:not(:disabled){background:var(--c-primary-light)}.hk-btn-ghost:active:not(:disabled){filter:brightness(0.95)}.hk-btn-danger{background:rgb(var(--color-error));color:rgb(var(--color-on-solid))}.hk-btn-danger:hover:not(:disabled):not(:focus-visible){filter:brightness(1.1);box-shadow:var(--shadow-button-danger)}.hk-btn-danger:active:not(:disabled){filter:brightness(0.95)}.hk-btn-block{width:100%}.hk-btn-loading{pointer-events:none}@media(prefers-color-scheme: dark){:root{--color-primary: 136 192 208;--color-on-solid: 46 52 64;--color-on-solid-text: 46 52 64;--color-on-solid-icon: 46 52 64;--color-text: 247 249 252;--color-muted: 180 180 180;--color-border: 128 128 128;--color-background: 22 27 38;--color-surface: 34 40 54;--color-error: 191 97 106}}";
|
|
14
|
+
export const BOOT_LANDING_CSS = ":root{--c-primary-faint: rgb(var(--color-primary, 122 162 247) / 5%);--c-primary-subtle: rgb(var(--color-primary, 122 162 247) / 8%);--c-primary-dim: rgb(var(--color-primary, 122 162 247) / 10%);--c-primary-light: rgb(var(--color-primary, 122 162 247) / 15%);--c-primary-overlay: rgb(var(--color-primary, 122 162 247) / 15%);--c-primary-medium: rgb(var(--color-primary, 122 162 247) / 25%);--c-primary-strong: rgb(var(--color-primary, 122 162 247) / 40%);--c-primary-intense: rgb(var(--color-primary, 122 162 247) / 40%);--c-error-dim: rgb(var(--color-error, 247 118 142) / 10%);--c-error-overlay: rgb(var(--color-error, 247 118 142) / 20%);--c-error-strong: rgb(var(--color-error, 247 118 142) / 50%);--shadow-elevated: 0 8px 32px rgb(0 0 0 / 15%);--shadow-dropdown: 0 4px 24px rgb(0 0 0 / 12%), 0 0 0 1px rgb(255 255 255 / 4%);--shadow-button: 0 4px 14px rgb(var(--color-primary, 122 162 247) / 35%);--shadow-button-danger: 0 4px 14px rgb(var(--color-error, 247 118 142) / 35%);--shadow-focus: 0 0 0 3px rgb(var(--color-primary, 122 162 247) / 12%);--shadow-focus-error: 0 0 0 3px rgb(var(--color-error, 247 118 142) / 12%);--border-input: rgb(var(--color-border, 100 100 100) / 15%);--border-faint: rgb(var(--color-border, 100 100 100) / 10%);--border-subtle: rgb(var(--color-border, 100 100 100) / 12%);--hi-icon-color: rgb(var(--color-text, 30 30 30));--hi-icon-size-xs: 0.75rem;--hi-icon-size-sm: 1rem;--hi-icon-size-md: 1.25rem;--hi-icon-size-lg: 1.5rem;--hi-duration-instant: var(--duration-instant, 0.1s);--hi-border-color-focus: rgb(var(--color-primary, 122 162 247));--hi-glow-color: transparent;--hi-bg-surface-dark: rgb(var(--color-muted, 108 108 108) / 12%);--hi-color-primary-dark: color-mix(in srgb, rgb(var(--color-primary, 122 162 247)) 82%, #000);--hi-color-secondary-dark: color-mix(in srgb, rgb(var(--color-secondary, 81 154 115)) 82%, #000);--hi-color-danger-dark: color-mix(in srgb, rgb(var(--color-error, 247 118 142)) 82%, #000);--hi-color-success-dark: color-mix(in srgb, rgb(var(--color-success, 14 184 64)) 82%, #000);--hi-color-text-on-secondary: rgb(var(--color-on-solid, 255 255 255));--hi-color-text-on-danger: rgb(var(--color-on-solid, 255 255 255));--hi-color-text-on-success: rgb(var(--color-on-solid, 255 255 255))}:root{--color-primary: 122 162 247;--color-on-primary: 255 255 255;--color-on-solid: 255 255 255;--color-on-solid-text: 255 255 255;--color-on-solid-icon: 255 255 255;--color-on-danger: 255 255 255;--color-on-success: 255 255 255;--color-on-warning: 0 0 0;--color-on-info: 0 0 0;--color-secondary: 81 154 115;--color-accent: 247 181 0;--color-text: 30 30 30;--color-text-secondary: 102 102 102;--color-text-tertiary: 140 140 140;--color-muted: 108 108 108;--color-border: 100 100 100;--color-focused-border: 122 162 247;--color-background: 255 255 255;--color-surface: 255 255 255;--color-selected-bg: 191 218 242;--color-selected-text: 30 30 30;--color-status-bar-bg: 240 244 248;--color-success: 14 184 64;--color-error: 247 118 142;--color-warning: 238 214 119;--color-info: 106 190 214;--hi-color-primary: rgb(var(--color-primary));--hi-color-secondary: rgb(var(--color-secondary));--hi-color-surface: rgb(var(--color-surface));--hi-color-background: rgb(var(--color-background));--hi-color-border: rgb(var(--color-border) / 15%);--hi-color-text-primary: rgb(var(--color-text));--hi-color-text-secondary: rgb(var(--color-text-secondary));--hi-color-muted: rgb(var(--color-muted));--hi-color-on-primary: rgb(var(--color-on-primary));--hi-color-text-on-primary: rgb(var(--color-on-primary));--hi-color-text-on-solid: rgb(var(--color-on-solid-text, 255 255 255));--hi-color-icon-on-solid: rgb(var(--color-on-solid-icon, 255 255 255));--hi-color-success: rgb(var(--color-success));--hi-color-error: rgb(var(--color-error));--hi-color-warning: rgb(var(--color-warning));--hi-color-info: rgb(var(--color-info));--hi-color-text-on-danger: rgb(var(--color-on-danger));--hi-color-text-on-success: rgb(var(--color-on-success));--hi-color-text-on-warning: rgb(var(--color-on-warning));--hi-color-text-on-info: rgb(var(--color-on-info));--hi-color-bg-subtle: rgb(var(--color-surface) / 0.5);--hi-color-bg-elevated: rgb(var(--color-surface));--hi-color-bg-canvas: rgb(var(--color-background));--hi-secondary-bg: rgb(var(--color-surface) / 0.5);--hi-color-accent: rgb(var(--color-accent));--hi-primary: var(--hi-color-primary);--hi-surface: var(--hi-color-surface);--hi-card-bg: var(--hi-color-surface)}:root{--space-1: 0.0625rem;--space-2: 0.125rem;--space-4: 0.25rem;--space-6: 0.375rem;--space-8: 0.5rem;--space-10: 0.625rem;--space-12: 0.75rem;--space-14: 0.875rem;--space-16: 1rem;--space-20: 1.25rem;--space-24: 1.5rem;--space-28: 1.75rem;--space-32: 2rem;--space-40: 2.5rem;--text-3xs: 0.5rem;--text-2xs: 0.625rem;--text-xs: 0.75rem;--text-sm: 0.8125rem;--text-base: 0.875rem;--text-md: 1rem;--text-lg: 1.125rem;--text-xl: 1.25rem;--text-2xl: 1.5rem;--radius-xs: 2px;--radius-sm: 4px;--radius-md: 8px;--radius-lg: 12px;--radius-xl: 16px;--radius-full: 9999px;--blur-xs: 4px;--blur-sm: 8px;--blur-md: 16px;--blur-lg: 24px;--blur-xl: 24px;--opacity-half: 0.92;--duration-instant: 0.1s;--duration-short: 0.15s;--duration-fast: 0.15s;--duration-normal: 0.3s;--ease-standard: cubic-bezier(0.4, 0, 0.2, 1);--ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);--ease-in: cubic-bezier(0.4, 0, 1, 1);--ease-elastic: cubic-bezier(0.16, 1, 0.3, 1);--hi-duration-fast: 0.15s;--hi-ease-default: cubic-bezier(0.4, 0, 0.2, 1);--hk-z-base: 0;--hk-z-above: 1;--hk-z-scrollbar: 10;--hk-z-fab: 40;--hk-z-toolbar: 50;--hk-z-header: 100;--hk-z-sidebar: 900;--hk-z-drag: 950;--hk-z-breadcrumb: 2500;--hk-z-float: 3000;--hk-z-toast: 4000;--hk-z-veil: 4100;--hk-z-modal: 5000;--hk-z-tooltip: 6000;--hk-z-debug-float: 80000;--hk-z-overlay-root: 90000;--hk-z-hud: 90050;--hk-z-error: 95000;--hk-z-titlebar: 100001;--viewport-gutter: 16px;--font-sans: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", \"Noto Sans CJK SC\", sans-serif;--font-reading: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", \"Noto Sans CJK SC\", sans-serif;--font-mono: ui-monospace, \"SF Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", \"Liberation Mono\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans CJK SC\", monospace}@media(max-width: 767px){:root{--viewport-gutter: 8px}}.hk-error-landing{--hel-background: var(--color-background, 246 247 249);--hel-surface: var(--color-surface, 255 255 255);--hel-text: var(--color-text, 30 32 36);--hel-muted: var(--color-muted, 118 122 128);--hel-border: var(--color-border, 222 224 228);--hel-primary: var(--color-primary, 58 118 236);--hel-error: var(--color-error, 226 84 84);--hel-warning: var(--color-warning, 222 168 62);width:100%;min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:var(--space-20, 1.25rem);background:rgb(var(--hel-background));color:rgb(var(--hel-text));font-family:var(--font-sans, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", \"Noto Sans CJK SC\", sans-serif)}.hk-error-landing__card{position:relative;overflow:hidden;width:min(440px,100%);background:rgb(var(--hel-surface));border:1px solid rgb(var(--hel-border)/70%);border-radius:var(--radius-xl, 16px);box-shadow:var(--shadow-lg, 0 18px 48px rgba(0, 0, 0, 0.08));padding:2.25rem var(--space-28, 1.75rem) var(--space-28, 1.75rem);text-align:center}.hk-error-landing__card::before{content:\"\";position:absolute;inset:0 0 auto;height:150px;background:radial-gradient(58% 100% at 50% 0%, rgb(var(--hel-error)/8%), transparent 72%);pointer-events:none}.hk-error-landing.is-warning .hk-error-landing__card::before{background:radial-gradient(58% 100% at 50% 0%, rgb(var(--hel-warning)/10%), transparent 72%)}.hk-error-landing.is-info .hk-error-landing__card::before{background:radial-gradient(58% 100% at 50% 0%, rgb(var(--hel-primary)/7%), transparent 72%)}.hk-error-landing__brand{position:relative;display:flex;justify-content:center;margin-bottom:var(--space-16, 1rem)}.hk-error-landing__brand:empty{display:none}.hk-error-landing__icon{position:relative;width:64px;height:64px;margin:0 auto var(--space-14, 0.875rem);display:flex;align-items:center;justify-content:center;border-radius:50%}.hk-error-landing__icon,.hk-error-landing__icon svg{color:rgb(var(--hel-error))}.hk-error-landing__icon{background:linear-gradient(145deg, rgb(var(--hel-error)/18%), rgb(var(--hel-error)/6%));border:1px solid rgb(var(--hel-error)/26%);box-shadow:0 0 0 8px rgb(var(--hel-error)/5%),0 10px 28px -12px rgb(var(--hel-error)/45%)}.hk-error-landing.is-warning .hk-error-landing__icon,.hk-error-landing.is-warning .hk-error-landing__icon svg{color:rgb(var(--hel-warning))}.hk-error-landing.is-warning .hk-error-landing__icon{background:linear-gradient(145deg, rgb(var(--hel-warning)/20%), rgb(var(--hel-warning)/7%));border-color:rgb(var(--hel-warning)/28%);box-shadow:0 0 0 8px rgb(var(--hel-warning)/6%),0 10px 28px -12px rgb(var(--hel-warning)/45%)}.hk-error-landing.is-info .hk-error-landing__icon,.hk-error-landing.is-info .hk-error-landing__icon svg{color:rgb(var(--hel-primary))}.hk-error-landing.is-info .hk-error-landing__icon{background:linear-gradient(145deg, rgb(var(--hel-primary)/16%), rgb(var(--hel-primary)/5%));border-color:rgb(var(--hel-primary)/24%);box-shadow:0 0 0 8px rgb(var(--hel-primary)/5%),0 10px 28px -12px rgb(var(--hel-primary)/40%)}.hk-error-landing__meta{position:relative;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:var(--space-6, 0.375rem);margin-bottom:var(--space-8, 0.5rem)}.hk-error-landing__meta .hk-badge:not(.hk-badge-muted){--hk-badge-text: rgb(var(--hel-error));--hk-badge-bg: rgb(var(--hel-error) / 10%);--hk-badge-border: rgb(var(--hel-error) / 22%)}.hk-error-landing.is-warning .hk-error-landing__meta .hk-badge:not(.hk-badge-muted){--hk-badge-text: rgb(var(--hel-warning));--hk-badge-bg: rgb(var(--hel-warning) / 12%);--hk-badge-border: rgb(var(--hel-warning) / 24%)}.hk-error-landing.is-info .hk-error-landing__meta .hk-badge:not(.hk-badge-muted){--hk-badge-text: rgb(var(--hel-primary));--hk-badge-bg: rgb(var(--hel-primary) / 10%);--hk-badge-border: rgb(var(--hel-primary) / 20%)}.hk-error-landing__meta .hk-badge-muted{--hk-badge-text: rgb(var(--hel-muted));--hk-badge-bg: rgb(var(--hel-muted) / 8%);--hk-badge-border: rgb(var(--hel-border) / 80%)}.hk-error-landing__title{position:relative;margin:0;font-size:var(--text-xl, 1.25rem);font-weight:650;letter-spacing:-0.01em;line-height:1.35;color:rgb(var(--hel-text));white-space:pre-line;overflow-wrap:anywhere}.hk-error-landing__desc{position:relative;margin:var(--space-8, 0.5rem) 0 0;font-size:var(--text-sm, 0.8125rem);line-height:1.6;color:rgb(var(--hel-muted));white-space:pre-line;overflow-wrap:anywhere}.hk-error-landing__details{position:relative;margin-top:var(--space-16, 1rem);text-align:start}.hk-error-landing__details-label{display:flex;align-items:center;gap:var(--space-4, 4px);padding:0 var(--space-2, 2px);font-size:var(--text-xs, 0.75rem);font-weight:500;letter-spacing:.02em;color:rgb(var(--hel-muted));-webkit-user-select:none;user-select:none}.hk-error-landing__details-pane{position:relative;margin-top:var(--space-6, 0.375rem);height:max(9rem,20vh);height:max(9rem,20dvh);border:1px solid rgb(var(--hel-border)/70%);border-radius:var(--radius-md, 8px);background:rgb(var(--hel-muted)/4%)}.hk-error-landing__details-body{height:100%;overflow:auto;border-radius:inherit;padding:var(--space-4, 0.25rem);scrollbar-width:none}.hk-error-landing__details-body::-webkit-scrollbar{display:none}.hk-error-landing .hk-error-landing__details-body .s-tool-json-tree{max-height:none;height:auto;overflow:visible;margin:0;padding:0;border:none;border-radius:0;background:rgba(0,0,0,0)}.hk-error-landing__actions{position:relative;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:var(--space-8, 0.5rem);margin-top:var(--space-16, 1rem)}.hk-error-landing.is-inline{min-height:100%;padding:0 var(--space-12, 0.75rem);align-items:flex-start;background:rgba(0,0,0,0)}.hk-error-landing.is-inline.is-fill{flex:1 1 auto;min-height:0}.hk-error-landing.is-inline .hk-error-landing__card{margin:auto;padding:var(--space-16, 1rem) var(--space-28, 1.75rem) var(--space-24, 1.5rem);display:flex;flex-direction:column;max-height:100%;min-height:min-content}.hk-error-landing.is-inline .hk-error-landing__details{display:flex;flex-direction:column;min-height:0}.hk-error-landing.is-inline .hk-error-landing__details-pane{height:auto;flex-grow:0;flex-shrink:1;flex-basis:max(9rem,20vh);flex-basis:max(9rem,20dvh);min-height:6rem}@media(max-width: 480px){.hk-error-landing__card{padding:var(--space-28, 1.75rem) 1.125rem var(--space-24, 1.5rem)}}:root{--c-primary-faint: rgb(var(--color-primary, 122 162 247) / 5%);--c-primary-subtle: rgb(var(--color-primary, 122 162 247) / 8%);--c-primary-dim: rgb(var(--color-primary, 122 162 247) / 10%);--c-primary-light: rgb(var(--color-primary, 122 162 247) / 15%);--c-primary-overlay: rgb(var(--color-primary, 122 162 247) / 15%);--c-primary-medium: rgb(var(--color-primary, 122 162 247) / 25%);--c-primary-strong: rgb(var(--color-primary, 122 162 247) / 40%);--c-primary-intense: rgb(var(--color-primary, 122 162 247) / 40%);--c-error-dim: rgb(var(--color-error, 247 118 142) / 10%);--c-error-overlay: rgb(var(--color-error, 247 118 142) / 20%);--c-error-strong: rgb(var(--color-error, 247 118 142) / 50%);--shadow-elevated: 0 8px 32px rgb(0 0 0 / 15%);--shadow-dropdown: 0 4px 24px rgb(0 0 0 / 12%), 0 0 0 1px rgb(255 255 255 / 4%);--shadow-button: 0 4px 14px rgb(var(--color-primary, 122 162 247) / 35%);--shadow-button-danger: 0 4px 14px rgb(var(--color-error, 247 118 142) / 35%);--shadow-focus: 0 0 0 3px rgb(var(--color-primary, 122 162 247) / 12%);--shadow-focus-error: 0 0 0 3px rgb(var(--color-error, 247 118 142) / 12%);--border-input: rgb(var(--color-border, 100 100 100) / 15%);--border-faint: rgb(var(--color-border, 100 100 100) / 10%);--border-subtle: rgb(var(--color-border, 100 100 100) / 12%);--hi-icon-color: rgb(var(--color-text, 30 30 30));--hi-icon-size-xs: 0.75rem;--hi-icon-size-sm: 1rem;--hi-icon-size-md: 1.25rem;--hi-icon-size-lg: 1.5rem;--hi-duration-instant: var(--duration-instant, 0.1s);--hi-border-color-focus: rgb(var(--color-primary, 122 162 247));--hi-glow-color: transparent;--hi-bg-surface-dark: rgb(var(--color-muted, 108 108 108) / 12%);--hi-color-primary-dark: color-mix(in srgb, rgb(var(--color-primary, 122 162 247)) 82%, #000);--hi-color-secondary-dark: color-mix(in srgb, rgb(var(--color-secondary, 81 154 115)) 82%, #000);--hi-color-danger-dark: color-mix(in srgb, rgb(var(--color-error, 247 118 142)) 82%, #000);--hi-color-success-dark: color-mix(in srgb, rgb(var(--color-success, 14 184 64)) 82%, #000);--hi-color-text-on-secondary: rgb(var(--color-on-solid, 255 255 255));--hi-color-text-on-danger: rgb(var(--color-on-solid, 255 255 255));--hi-color-text-on-success: rgb(var(--color-on-solid, 255 255 255))}:root{--color-primary: 122 162 247;--color-on-primary: 255 255 255;--color-on-solid: 255 255 255;--color-on-solid-text: 255 255 255;--color-on-solid-icon: 255 255 255;--color-on-danger: 255 255 255;--color-on-success: 255 255 255;--color-on-warning: 0 0 0;--color-on-info: 0 0 0;--color-secondary: 81 154 115;--color-accent: 247 181 0;--color-text: 30 30 30;--color-text-secondary: 102 102 102;--color-text-tertiary: 140 140 140;--color-muted: 108 108 108;--color-border: 100 100 100;--color-focused-border: 122 162 247;--color-background: 255 255 255;--color-surface: 255 255 255;--color-selected-bg: 191 218 242;--color-selected-text: 30 30 30;--color-status-bar-bg: 240 244 248;--color-success: 14 184 64;--color-error: 247 118 142;--color-warning: 238 214 119;--color-info: 106 190 214;--hi-color-primary: rgb(var(--color-primary));--hi-color-secondary: rgb(var(--color-secondary));--hi-color-surface: rgb(var(--color-surface));--hi-color-background: rgb(var(--color-background));--hi-color-border: rgb(var(--color-border) / 15%);--hi-color-text-primary: rgb(var(--color-text));--hi-color-text-secondary: rgb(var(--color-text-secondary));--hi-color-muted: rgb(var(--color-muted));--hi-color-on-primary: rgb(var(--color-on-primary));--hi-color-text-on-primary: rgb(var(--color-on-primary));--hi-color-text-on-solid: rgb(var(--color-on-solid-text, 255 255 255));--hi-color-icon-on-solid: rgb(var(--color-on-solid-icon, 255 255 255));--hi-color-success: rgb(var(--color-success));--hi-color-error: rgb(var(--color-error));--hi-color-warning: rgb(var(--color-warning));--hi-color-info: rgb(var(--color-info));--hi-color-text-on-danger: rgb(var(--color-on-danger));--hi-color-text-on-success: rgb(var(--color-on-success));--hi-color-text-on-warning: rgb(var(--color-on-warning));--hi-color-text-on-info: rgb(var(--color-on-info));--hi-color-bg-subtle: rgb(var(--color-surface) / 0.5);--hi-color-bg-elevated: rgb(var(--color-surface));--hi-color-bg-canvas: rgb(var(--color-background));--hi-secondary-bg: rgb(var(--color-surface) / 0.5);--hi-color-accent: rgb(var(--color-accent));--hi-primary: var(--hi-color-primary);--hi-surface: var(--hi-color-surface);--hi-card-bg: var(--hi-color-surface)}.hk-btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-6);font-family:inherit;font-weight:600;line-height:1;border:1px solid rgba(0,0,0,0);border-radius:var(--radius-md, 8px);cursor:pointer;transition-property:background-color,border-color,color,box-shadow,opacity,transform,filter;transition-duration:var(--duration-normal);transition-timing-function:var(--ease-standard);white-space:nowrap;-webkit-user-select:none;user-select:none;outline:none;position:relative}.hk-btn:focus-visible{box-shadow:0 0 0 2px rgb(var(--color-surface)),0 0 0 4px rgb(var(--color-primary))}.hk-btn:disabled{opacity:.5;cursor:not-allowed}.hk-btn-xs{padding:var(--space-4) var(--space-8);font-size:var(--text-xs);min-height:1.375rem}.hk-btn-sm{padding:var(--space-6) var(--space-12);font-size:var(--text-xs);min-height:1.75rem}.hk-btn-md{padding:var(--space-8) var(--space-16);font-size:var(--text-base);min-height:2.5rem}.hk-btn-lg{padding:var(--space-10) var(--space-24);font-size:var(--text-base);min-height:2.75rem}.hk-btn-xs .hk-btn-icon,.hk-btn-xs .hk-btn-suffix{inline-size:.8125rem;block-size:.8125rem}.hk-btn-xs .hk-btn-icon .hk-icon,.hk-btn-xs .hk-btn-suffix .hk-icon{inline-size:100%;block-size:100%}.hk-btn-icon,.hk-btn-suffix{display:inline-flex;align-items:center;justify-content:center;flex:none;inline-size:1rem;block-size:1rem;line-height:0}.hk-btn-icon svg,.hk-btn-suffix svg{display:block}.hk-btn>svg{flex:none}.hk-btn-icon-only{padding:0;box-sizing:border-box}.hk-btn-xs.hk-btn-icon-only{width:1.375rem}.hk-btn-sm.hk-btn-icon-only{width:1.75rem}.hk-btn-md.hk-btn-icon-only{width:2.5rem}.hk-btn-lg.hk-btn-icon-only{width:2.75rem}.hk-btn-block.hk-btn-icon-only{width:100%}.hk-btn-label{display:inline-flex;align-items:center;min-width:0}@media(max-width: 639.98px){.hk-btn-label-collapse-sm.hk-btn-xs .hk-btn-label{display:none}.hk-btn-label-collapse-sm.hk-btn-xs{padding:0;box-sizing:border-box;width:1.375rem}}@media(max-width: 639.98px){.hk-btn-label-collapse-sm.hk-btn-sm .hk-btn-label{display:none}.hk-btn-label-collapse-sm.hk-btn-sm{padding:0;box-sizing:border-box;width:1.75rem}}@media(max-width: 639.98px){.hk-btn-label-collapse-sm.hk-btn-md .hk-btn-label{display:none}.hk-btn-label-collapse-sm.hk-btn-md{padding:0;box-sizing:border-box;width:2.5rem}}@media(max-width: 639.98px){.hk-btn-label-collapse-sm.hk-btn-lg .hk-btn-label{display:none}.hk-btn-label-collapse-sm.hk-btn-lg{padding:0;box-sizing:border-box;width:2.75rem}}@media(max-width: 767.98px){.hk-btn-label-collapse-md.hk-btn-xs .hk-btn-label{display:none}.hk-btn-label-collapse-md.hk-btn-xs{padding:0;box-sizing:border-box;width:1.375rem}}@media(max-width: 767.98px){.hk-btn-label-collapse-md.hk-btn-sm .hk-btn-label{display:none}.hk-btn-label-collapse-md.hk-btn-sm{padding:0;box-sizing:border-box;width:1.75rem}}@media(max-width: 767.98px){.hk-btn-label-collapse-md.hk-btn-md .hk-btn-label{display:none}.hk-btn-label-collapse-md.hk-btn-md{padding:0;box-sizing:border-box;width:2.5rem}}@media(max-width: 767.98px){.hk-btn-label-collapse-md.hk-btn-lg .hk-btn-label{display:none}.hk-btn-label-collapse-md.hk-btn-lg{padding:0;box-sizing:border-box;width:2.75rem}}@media(max-width: 1023.98px){.hk-btn-label-collapse-lg.hk-btn-xs .hk-btn-label{display:none}.hk-btn-label-collapse-lg.hk-btn-xs{padding:0;box-sizing:border-box;width:1.375rem}}@media(max-width: 1023.98px){.hk-btn-label-collapse-lg.hk-btn-sm .hk-btn-label{display:none}.hk-btn-label-collapse-lg.hk-btn-sm{padding:0;box-sizing:border-box;width:1.75rem}}@media(max-width: 1023.98px){.hk-btn-label-collapse-lg.hk-btn-md .hk-btn-label{display:none}.hk-btn-label-collapse-lg.hk-btn-md{padding:0;box-sizing:border-box;width:2.5rem}}@media(max-width: 1023.98px){.hk-btn-label-collapse-lg.hk-btn-lg .hk-btn-label{display:none}.hk-btn-label-collapse-lg.hk-btn-lg{padding:0;box-sizing:border-box;width:2.75rem}}@media(max-width: 1279.98px){.hk-btn-label-collapse-xl.hk-btn-xs .hk-btn-label{display:none}.hk-btn-label-collapse-xl.hk-btn-xs{padding:0;box-sizing:border-box;width:1.375rem}}@media(max-width: 1279.98px){.hk-btn-label-collapse-xl.hk-btn-sm .hk-btn-label{display:none}.hk-btn-label-collapse-xl.hk-btn-sm{padding:0;box-sizing:border-box;width:1.75rem}}@media(max-width: 1279.98px){.hk-btn-label-collapse-xl.hk-btn-md .hk-btn-label{display:none}.hk-btn-label-collapse-xl.hk-btn-md{padding:0;box-sizing:border-box;width:2.5rem}}@media(max-width: 1279.98px){.hk-btn-label-collapse-xl.hk-btn-lg .hk-btn-label{display:none}.hk-btn-label-collapse-xl.hk-btn-lg{padding:0;box-sizing:border-box;width:2.75rem}}.hk-btn-primary{background:rgb(var(--color-primary));color:rgb(var(--color-on-solid))}.hk-btn-primary svg{color:rgb(var(--color-on-solid-icon, 255 255 255))}.hk-btn-primary:hover:not(:disabled):not(:focus-visible){filter:brightness(1.1);box-shadow:var(--shadow-button)}.hk-btn-primary:active:not(:disabled){filter:brightness(0.95)}.hk-btn-secondary{background:rgb(var(--color-surface));color:rgb(var(--color-text));border-color:rgb(var(--color-border)/20%);-webkit-backdrop-filter:var(--hk-btn-secondary-blur, blur(var(--blur-sm)));backdrop-filter:var(--hk-btn-secondary-blur, blur(var(--blur-sm)))}.hk-btn-secondary:hover:not(:disabled){border-color:var(--c-primary-strong)}.hk-btn-secondary:active:not(:disabled){filter:brightness(0.95)}.hk-btn-outline{background:rgba(0,0,0,0);color:rgb(var(--color-primary));border-color:var(--c-primary-intense)}.hk-btn-outline:hover:not(:disabled){background:var(--c-primary-light);border-color:rgb(var(--color-primary))}.hk-btn-outline:active:not(:disabled){filter:brightness(0.95)}.hk-btn-ghost{background:rgba(0,0,0,0);color:rgb(var(--color-text));border-color:rgba(0,0,0,0)}.hk-btn-ghost:hover:not(:disabled){background:var(--c-primary-light)}.hk-btn-ghost:active:not(:disabled){filter:brightness(0.95)}.hk-btn-danger{background:rgb(var(--color-error));color:rgb(var(--color-on-solid))}.hk-btn-danger:hover:not(:disabled):not(:focus-visible){filter:brightness(1.1);box-shadow:var(--shadow-button-danger)}.hk-btn-danger:active:not(:disabled){filter:brightness(0.95)}.hk-btn-block{width:100%}.hk-btn-loading{pointer-events:none}@media(prefers-color-scheme: dark){:root{--color-primary: 136 192 208;--color-on-solid: 46 52 64;--color-on-solid-text: 46 52 64;--color-on-solid-icon: 46 52 64;--color-text: 247 249 252;--color-muted: 180 180 180;--color-border: 128 128 128;--color-background: 22 27 38;--color-surface: 34 40 54;--color-error: 191 97 106}}";
|
package/src/scale.scss
CHANGED
|
@@ -96,6 +96,10 @@
|
|
|
96
96
|
--hk-z-modal: 5000; /* modal backdrop + frame */
|
|
97
97
|
--hk-z-tooltip: 6000; /* tooltip — above toasts and modals so its text
|
|
98
98
|
is always readable and copyable */
|
|
99
|
+
--hk-z-debug-float: 80000; /* debug floating windows (HkDebugFloat): above
|
|
100
|
+
all content chrome, strictly below the
|
|
101
|
+
overlay root — a debug window must never
|
|
102
|
+
cover the popup it measures */
|
|
99
103
|
--hk-z-overlay-root: 90000; /* #hk-overlay-root — every floating layer's
|
|
100
104
|
document-space elevation (overlay/overlayRoot.ts);
|
|
101
105
|
above all content chrome, below the HUD root */
|
package/src/shared.ts
CHANGED
|
@@ -12,9 +12,13 @@
|
|
|
12
12
|
// subpath installs nothing extra.
|
|
13
13
|
export { detectLocale } from "./i18n/detectLocale";
|
|
14
14
|
export { useSystemStore } from "./stores/system";
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
|
|
15
|
+
// Same NAME as the main barrel's `useConfirm` but a different API — the
|
|
16
|
+
// view-facing state machine (`confirm(title, message)` plus the exposed
|
|
17
|
+
// visible/title/message/cancel fields) over the core one-liner. The two
|
|
18
|
+
// live on different specifiers (`hikari` vs `hikari/shared`), so they do
|
|
19
|
+
// not collide; the name stays so a consumer migrating from its own copy
|
|
20
|
+
// keeps its 100+ call sites unchanged.
|
|
21
|
+
export { useConfirm } from "./runtime/useConfirmView";
|
|
18
22
|
export {
|
|
19
23
|
WALLPAPER_UPLOAD_LIMITS,
|
|
20
24
|
WallpaperUploadError,
|
|
@@ -98,6 +98,10 @@
|
|
|
98
98
|
--hk-z-modal: 5000; /* modal backdrop + frame */
|
|
99
99
|
--hk-z-tooltip: 6000; /* tooltip — above toasts and modals so its text
|
|
100
100
|
is always readable and copyable */
|
|
101
|
+
--hk-z-debug-float: 80000; /* debug floating windows (HkDebugFloat): above
|
|
102
|
+
all content chrome, strictly below the
|
|
103
|
+
overlay root — a debug window must never
|
|
104
|
+
cover the popup it measures */
|
|
101
105
|
--hk-z-overlay-root: 90000; /* #hk-overlay-root — every floating layer's
|
|
102
106
|
document-space elevation (overlay/overlayRoot.ts);
|
|
103
107
|
above all content chrome, below the HUD root */
|