mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
Make the package dual-face: a dsh.client declaration (platform 'web') plus an exports["./client"] bundle built in dsh's closure-factory shape (window.__ModuleLoader__.load handoff, platform modules external, everything else inlined, CSS Modules via lightningcss). The client registers a keyed 'tool.call.toolview' view for browser_screenshot that keeps the terminal block (command + output) and, when the settled result carries an image block, resolves the durable attachment through the client session's authorized readAttachment RPC and renders it with the shared MessageImage thumbnail/lightbox atoms. Path-only results render unchanged; every other browser_* tool keeps the stock terminal card. Tests: view-model derivation (running/ok/error, image vs path-only), component rendering through @testing-library/react + happy-dom, and the registration key. biome.json now excludes the package's lib/ build output (same treatment as dist/).
58 lines
1.0 KiB
CSS
58 lines
1.0 KiB
CSS
/* browser_screenshot toolview: disclosure row over a terminal block plus the
|
|
screenshot image. Semantic tokens only (--dsw-alias-*), no literal colors. */
|
|
|
|
.card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.summary {
|
|
min-width: 0;
|
|
margin-left: 6px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
color: var(--dsw-alias-label-secondary);
|
|
}
|
|
|
|
.card[data-state="error"] .summary {
|
|
color: var(--dsw-alias-label-error);
|
|
}
|
|
|
|
.body {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
padding: 4px 0 4px 22px;
|
|
}
|
|
|
|
.image-wrap {
|
|
display: flex;
|
|
}
|
|
|
|
.inspect-button {
|
|
align-self: flex-start;
|
|
border: none;
|
|
background: none;
|
|
padding: 0;
|
|
font: inherit;
|
|
font-size: 12px;
|
|
color: var(--dsw-alias-label-tertiary);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.inspect-button:hover {
|
|
color: var(--dsw-alias-label-secondary);
|
|
}
|
|
|
|
.inspect-button:focus-visible {
|
|
outline: 2px solid var(--dsw-alias-border-focus);
|
|
outline-offset: 2px;
|
|
border-radius: 2px;
|
|
}
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.inspect-button {
|
|
transition: none;
|
|
}
|
|
}
|