tfrere's picture
tfrere HF Staff
Cursor
feat(embed-studio): tweak panel, inspect, automatic check, launcher, inline edit
4953bfd
Raw History Blame Contribute Delete
6.08 kB
/* ============================================================================ */
/* HTML Embed NodeView */
/* ============================================================================ */
.embed-view {
border: 1px solid var(--border-color);
border-radius: 8px;
overflow: hidden;
margin: 0.75em 0;
user-select: none;
background: var(--surface-bg);
}
/* --- Header --- */
.embed-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 6px 12px;
border-bottom: 1px solid var(--border-color);
background: var(--surface-bg);
gap: 8px;
}
.embed-header-left {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
}
.embed-header-icon {
font-size: 14px;
line-height: 1;
flex-shrink: 0;
}
.embed-header-label {
font-size: 12px;
font-weight: 600;
color: var(--muted-color);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.embed-header-src {
font-size: 11px;
color: var(--muted-color);
opacity: 0.6;
font-family: var(--font-mono);
white-space: nowrap;
}
.embed-header-actions {
display: flex;
gap: 4px;
flex-shrink: 0;
}
/* --- Buttons --- */
.embed-btn {
background: none;
border: 1px solid var(--border-color);
border-radius: 4px;
padding: 2px 10px;
font-size: 11px;
color: var(--muted-color);
cursor: pointer;
white-space: nowrap;
transition: background 120ms ease, color 120ms ease;
}
.embed-btn:hover {
background: var(--border-color);
color: var(--text-color);
}
.embed-btn-primary {
background: var(--primary-color);
color: var(--on-primary);
border-color: var(--primary-color);
}
.embed-btn-primary:hover {
opacity: 0.9;
}
/* --- Settings panel --- */
.embed-settings {
padding: 8px 12px;
border-bottom: 1px solid var(--border-color);
display: flex;
flex-direction: column;
gap: 6px;
background: var(--surface-bg);
}
.embed-field-row {
display: flex;
align-items: center;
gap: 8px;
}
.embed-field-checkbox {
font-size: 12px;
color: var(--muted-color);
cursor: pointer;
gap: 6px;
}
.embed-field-checkbox input {
accent-color: var(--primary-color);
}
.embed-field-label {
font-size: 12px;
color: var(--muted-color);
min-width: 80px;
flex-shrink: 0;
}
.embed-field-input {
background: transparent;
border: 1px solid var(--border-color);
border-radius: 4px;
color: var(--text-color);
font-size: 13px;
padding: 3px 8px;
outline: none;
flex: 1;
min-width: 0;
}
.embed-field-input:focus {
border-color: var(--primary-color);
}
/* --- Preview area --- */
.embed-preview {
position: relative;
padding: 16px;
overflow: hidden;
}
.embed-iframe {
width: 100%;
border: none;
display: block;
border-radius: 4px;
background: transparent;
/* Isolate iframe layout changes so height updates from ResizeObserver
don't propagate reflows up to the scroll container. */
contain: layout style;
}
/* --- Empty state --- */
.embed-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px;
padding: 32px 24px;
color: var(--muted-color);
font-size: 13px;
text-align: center;
}
.embed-empty-icon {
font-size: 24px;
opacity: 0.5;
}
.embed-empty code {
font-family: var(--font-mono);
font-size: 12px;
background: var(--code-bg);
padding: 1px 5px;
border-radius: 3px;
}
/* Studio presence / unapplied draft, next to the embed title */
.embed-header-badge {
display: inline-flex;
align-items: center;
gap: 5px;
margin-left: 8px;
padding: 1px 8px;
border-radius: 999px;
font-size: 11px;
font-weight: 500;
white-space: nowrap;
color: var(--muted-color);
background: var(--code-bg);
}
.embed-header-badge--live {
color: var(--text-color);
background: color-mix(in srgb, var(--peer, var(--primary-color)) 16%, transparent);
}
.embed-header-badge--live::before {
content: "";
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--peer, var(--primary-color));
}
.embed-btn-active {
background: color-mix(in srgb, var(--primary-color) 14%, transparent);
color: var(--text-color);
}
.embed-header-actions .embed-btn {
display: inline-flex;
align-items: center;
gap: 4px;
}
/* The chart shows the inline edit bar's draft */
.embed-preview--draft {
outline: 2px dashed color-mix(in srgb, var(--primary-color) 60%, transparent);
outline-offset: -2px;
}
/* --- Inline edit bar (Ask AI) under a chart --- */
.embed-inline-edit {
display: flex;
flex-direction: column;
gap: 6px;
padding: 8px 10px;
border-top: 1px solid var(--border-color);
background: var(--surface-bg);
}
.embed-inline-edit__row {
display: flex;
align-items: center;
gap: 6px;
}
.embed-inline-edit__icon {
flex-shrink: 0;
color: var(--primary-color);
}
.embed-inline-edit textarea {
flex: 1;
min-width: 0;
resize: none;
padding: 6px 10px;
border: 1px solid var(--border-color);
border-radius: 8px;
font: inherit;
font-size: 13px;
line-height: 1.4;
color: var(--text-color);
background: var(--page-bg);
}
.embed-inline-edit textarea:focus {
outline: none;
border-color: var(--primary-color);
}
.embed-inline-edit .embed-btn {
display: inline-flex;
align-items: center;
gap: 4px;
flex-shrink: 0;
}
.embed-inline-edit__status,
.embed-inline-edit__reply {
display: flex;
align-items: center;
gap: 6px;
margin: 0;
font-size: 12px;
color: var(--muted-color);
}
.embed-inline-edit__status--error {
color: var(--danger-color, #d64545);
}
.embed-inline-edit__toggle {
display: inline-flex;
border: 1px solid var(--border-color);
border-radius: 7px;
overflow: hidden;
}
.embed-inline-edit__toggle button {
padding: 3px 10px;
border: none;
background: none;
font: inherit;
font-size: 12px;
color: var(--muted-color);
cursor: pointer;
}
.embed-inline-edit__toggle button.is-on {
background: color-mix(in srgb, var(--primary-color) 16%, transparent);
color: var(--text-color);
font-weight: 600;
}