@celestia-island/hikari 0.55.373 → 0.55.375
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/HkEmergencyAlert.layering.contract.test.ts +23 -0
- package/src/components/HkEmergencyAlert.scss +22 -0
- package/src/components/HkEmergencyAlert.test.tsx +5 -0
- package/src/composables/wasmHighlight.ts +20 -0
- package/src/wasm/highlight/hikari_wasm_highlight.d.ts +21 -0
- package/src/wasm/highlight/hikari_wasm_highlight.js +6172 -0
- package/src/wasm/highlight/interfaces/hikari-highlight-types.d.ts +4 -0
- package/src/wasm/highlight/interfaces/wasi-cli-environment.d.ts +2 -0
- package/src/wasm/highlight/interfaces/wasi-cli-exit.d.ts +3 -0
- package/src/wasm/highlight/interfaces/wasi-cli-stderr.d.ts +3 -0
- package/src/wasm/highlight/interfaces/wasi-cli-stdin.d.ts +3 -0
- package/src/wasm/highlight/interfaces/wasi-cli-stdout.d.ts +3 -0
- package/src/wasm/highlight/interfaces/wasi-cli-terminal-input.d.ts +8 -0
- package/src/wasm/highlight/interfaces/wasi-cli-terminal-output.d.ts +8 -0
- package/src/wasm/highlight/interfaces/wasi-cli-terminal-stderr.d.ts +3 -0
- package/src/wasm/highlight/interfaces/wasi-cli-terminal-stdin.d.ts +3 -0
- package/src/wasm/highlight/interfaces/wasi-cli-terminal-stdout.d.ts +3 -0
- package/src/wasm/highlight/interfaces/wasi-clocks-monotonic-clock.d.ts +4 -0
- package/src/wasm/highlight/interfaces/wasi-io-error.d.ts +8 -0
- package/src/wasm/highlight/interfaces/wasi-io-poll.d.ts +10 -0
- package/src/wasm/highlight/interfaces/wasi-io-streams.d.ts +38 -0
package/package.json
CHANGED
|
@@ -146,6 +146,29 @@ describe("emergency alert layering contract", () => {
|
|
|
146
146
|
expect(root).toMatch(/--hk-emergency-wash:\s*color-mix\(in srgb, var\(--hk-emergency-line\)/);
|
|
147
147
|
});
|
|
148
148
|
|
|
149
|
+
it("the warning action is a caution chip in the band's own ink", () => {
|
|
150
|
+
// The chip replaces the brand-primary blue: tone wash fill, tone
|
|
151
|
+
// border — and the TEXT follows the theme text ink (NOT
|
|
152
|
+
// --color-on-warning, whose dark ink only works on a solid tone
|
|
153
|
+
// surface; the chip sits on the theme band in both modes). The
|
|
154
|
+
// doctrine chain (line/wash, never solid fill) is what R2's
|
|
155
|
+
// rejected fill form got wrong.
|
|
156
|
+
const css = sheet();
|
|
157
|
+
rootBlock(css);
|
|
158
|
+
// EXACTLY ONE chip rule, counted by name in any value form — a
|
|
159
|
+
// later duplicate would win the cascade silently (the R7
|
|
160
|
+
// multi-root vector, at chip granularity).
|
|
161
|
+
expect(css.match(/\.is-warning \.hk-emergency-actions \.hk-btn-primary\s*{/g)?.length).toBe(1);
|
|
162
|
+
const chip = css.match(
|
|
163
|
+
/\.is-warning \.hk-emergency-actions \.hk-btn-primary\s*{([^}]*)}/,
|
|
164
|
+
);
|
|
165
|
+
expect(chip, "the warning chip rule must exist").not.toBeNull();
|
|
166
|
+
expect(chip![1]).toContain("background: var(--hk-emergency-wash);");
|
|
167
|
+
expect(chip![1]).toContain("border-color: var(--hk-emergency-line);");
|
|
168
|
+
expect(chip![1]).toContain("color: rgb(var(--color-text");
|
|
169
|
+
expect(chip![1]).not.toContain("--color-on-warning");
|
|
170
|
+
});
|
|
171
|
+
|
|
149
172
|
it("long content stays reachable: the layer scrolls and the band safe-centers", () => {
|
|
150
173
|
// A fixed full-height layer never grows the document, so clipped
|
|
151
174
|
// content would strand the actions forever (R2 finding 5). The
|
|
@@ -211,6 +211,28 @@
|
|
|
211
211
|
margin-top: var(--space-14, 0.875rem);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
// The band's own color language carries its primary action: on a
|
|
215
|
+
// WARNING band the brand-primary (blue) chip read as another app's
|
|
216
|
+
// chrome pasted onto the alert (2026-11-14 field report). Repaint it
|
|
217
|
+
// as a CAUTION CHIP — tone wash fill, tone border, theme text ink —
|
|
218
|
+
// which reads as the alert's own instrument button in both modes AND
|
|
219
|
+
// respects every shipped theme doctrine by construction: it is a line
|
|
220
|
+
// and a wash, never a solid fill (endfield's "yellow never fills",
|
|
221
|
+
// amphoreus's "gold ≤10%", arcaea's tracks-not-fills). DANGER bands
|
|
222
|
+
// keep the solid hk-btn-danger (red on red). Theme packages may still
|
|
223
|
+
// re-point tone/line to retune the chip's color wholesale.
|
|
224
|
+
.is-warning .hk-emergency-actions .hk-btn-primary {
|
|
225
|
+
background: var(--hk-emergency-wash);
|
|
226
|
+
border-color: var(--hk-emergency-line);
|
|
227
|
+
color: rgb(var(--color-text, 236 238 242));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.is-warning .hk-emergency-actions .hk-btn-primary:hover:not(:disabled):not(:focus-visible) {
|
|
231
|
+
filter: none;
|
|
232
|
+
background: color-mix(in srgb, var(--hk-emergency-line) 22%, transparent);
|
|
233
|
+
box-shadow: 0 0 14px var(--hk-emergency-edge-glow);
|
|
234
|
+
}
|
|
235
|
+
|
|
214
236
|
// ── Motion ────────────────────────────────────────────────────────────
|
|
215
237
|
// Enter/leave: the band draws its signal edges and lifts into place;
|
|
216
238
|
// leave mirrors it. Steady state stays ALIVE but quiet — the badge
|
|
@@ -122,6 +122,11 @@ describe("actions & snooze", () => {
|
|
|
122
122
|
const [primary, snooze] = buttons();
|
|
123
123
|
expect(primary.textContent).toBe("立即处理");
|
|
124
124
|
expect(snooze.textContent).toBe("Hide for now");
|
|
125
|
+
// The band's color language carries the primary action: a WARNING
|
|
126
|
+
// band paints the primary button in the severity tone (band-scoped
|
|
127
|
+
// rule) — it must NOT be the brand-primary blue chip.
|
|
128
|
+
expect(primary.className).toContain("hk-btn-primary");
|
|
129
|
+
expect(primary.className).not.toContain("hk-btn-danger");
|
|
125
130
|
|
|
126
131
|
primary.click();
|
|
127
132
|
expect(handle).toHaveBeenCalledTimes(1);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// wasmHighlight.ts — the wasm-backed syntax highlighting engine.
|
|
2
|
+
//
|
|
3
|
+
// Wraps hikari-wasm-highlight (the pest-driven Rust component) and
|
|
4
|
+
// produces hljs-compatible HTML. When the wasm component supports the
|
|
5
|
+
// requested language, it takes over; otherwise the hljs fallback stays.
|
|
6
|
+
|
|
7
|
+
import { highlight as wasmHighlightFn, languages as wasmLanguages } from "../wasm/highlight/hikari_wasm_highlight.js";
|
|
8
|
+
|
|
9
|
+
export type HighlightResult = string | null;
|
|
10
|
+
|
|
11
|
+
/** The set of languages the wasm component currently supports. */
|
|
12
|
+
export function wasmSupportedLanguages(): Set<string> {
|
|
13
|
+
return new Set(wasmLanguages());
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Highlight through the wasm component; null when unsupported. */
|
|
17
|
+
export function wasmHighlight(code: string, language: string): HighlightResult {
|
|
18
|
+
const result = wasmHighlightFn(code, language);
|
|
19
|
+
return result?.html ?? null;
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// world root:component/root
|
|
2
|
+
export type HighlightResult = import('./interfaces/hikari-highlight-types.js').HighlightResult;
|
|
3
|
+
export type * as HikariHighlightTypes from './interfaces/hikari-highlight-types.js'; // import hikari:highlight/types
|
|
4
|
+
export type * as WasiCliEnvironment0212 from './interfaces/wasi-cli-environment.js'; // import wasi:cli/environment@0.2.12
|
|
5
|
+
export type * as WasiCliExit0212 from './interfaces/wasi-cli-exit.js'; // import wasi:cli/exit@0.2.12
|
|
6
|
+
export type * as WasiCliStderr0212 from './interfaces/wasi-cli-stderr.js'; // import wasi:cli/stderr@0.2.12
|
|
7
|
+
export type * as WasiCliStdin0212 from './interfaces/wasi-cli-stdin.js'; // import wasi:cli/stdin@0.2.12
|
|
8
|
+
export type * as WasiCliStdout0212 from './interfaces/wasi-cli-stdout.js'; // import wasi:cli/stdout@0.2.12
|
|
9
|
+
export type * as WasiCliTerminalInput0212 from './interfaces/wasi-cli-terminal-input.js'; // import wasi:cli/terminal-input@0.2.12
|
|
10
|
+
export type * as WasiCliTerminalOutput0212 from './interfaces/wasi-cli-terminal-output.js'; // import wasi:cli/terminal-output@0.2.12
|
|
11
|
+
export type * as WasiCliTerminalStderr0212 from './interfaces/wasi-cli-terminal-stderr.js'; // import wasi:cli/terminal-stderr@0.2.12
|
|
12
|
+
export type * as WasiCliTerminalStdin0212 from './interfaces/wasi-cli-terminal-stdin.js'; // import wasi:cli/terminal-stdin@0.2.12
|
|
13
|
+
export type * as WasiCliTerminalStdout0212 from './interfaces/wasi-cli-terminal-stdout.js'; // import wasi:cli/terminal-stdout@0.2.12
|
|
14
|
+
export type * as WasiClocksMonotonicClock0212 from './interfaces/wasi-clocks-monotonic-clock.js'; // import wasi:clocks/monotonic-clock@0.2.12
|
|
15
|
+
export type * as WasiIoError0212 from './interfaces/wasi-io-error.js'; // import wasi:io/error@0.2.12
|
|
16
|
+
export type * as WasiIoPoll0212 from './interfaces/wasi-io-poll.js'; // import wasi:io/poll@0.2.12
|
|
17
|
+
export type * as WasiIoStreams0212 from './interfaces/wasi-io-streams.js'; // import wasi:io/streams@0.2.12
|
|
18
|
+
export function highlight(code: string, language: string): HighlightResult;
|
|
19
|
+
export function languages(): Array<string>;
|
|
20
|
+
/** Permanently stop this instance and dispose guest-owned host resources. */
|
|
21
|
+
export const _util: { stop(): void; whenIdle(): Promise<void>; };
|