import { unsafeCSSVarV2 } from '@blocksuite/affine-shared/theme'; import { css, html } from 'lit'; export const styles = css` .affine-embed-youtube-block { box-sizing: border-box; width: 100%; height: 100%; display: flex; flex-direction: column; gap: 20px; padding: 12px; border-radius: 8px; border: 1px solid var(--affine-background-tertiary-color); background: var(--affine-background-primary-color); user-select: none; } .affine-embed-youtube-video { flex-grow: 1; width: 100%; } .affine-embed-youtube-video img, .affine-embed-youtube-video object, .affine-embed-youtube-video svg { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; } .affine-embed-youtube-video-iframe-container { position: relative; height: 100%; } .affine-embed-youtube-video-iframe-container > iframe { width: 100%; height: 100%; border-radius: 4px; } .affine-embed-youtube-video-iframe-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .affine-embed-youtube-video-iframe-overlay.hide { display: none; } .affine-embed-youtube-content { display: block; flex-direction: column; width: 100%; height: fit-content; } .affine-embed-youtube-content-header { display: flex; flex-direction: row; gap: 8px; align-items: center; align-self: stretch; } .affine-embed-youtube-content-title-icon { display: flex; width: 20px; height: 20px; justify-content: center; align-items: center; } .affine-embed-youtube-content-title-icon img, .affine-embed-youtube-content-title-icon object, .affine-embed-youtube-content-title-icon svg { width: 20px; height: 20px; fill: var(--affine-background-primary-color); } .affine-embed-youtube-content-title-text { flex: 1 0 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; word-break: break-word; overflow: hidden; text-overflow: ellipsis; color: var(--affine-text-primary-color); font-family: var(--affine-font-family); font-size: var(--affine-font-sm); font-style: normal; font-weight: 600; line-height: 22px; } .affine-embed-youtube-content-creator-image { display: flex; width: 16px; height: 16px; flex-direction: column; align-items: flex-start; } .affine-embed-youtube-content-creator-image img, .affine-embed-youtube-content-creator-image object, .affine-embed-youtube-content-creator-image svg { width: 16px; height: 16px; border-radius: 50%; fill: var(--affine-background-primary-color); } .affine-embed-youtube-content-creator-text { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; color: var(--affine-text-primary-color); text-align: justify; font-family: var(--affine-font-family); font-size: var(--affine-font-xs); font-style: normal; font-weight: 400; line-height: 20px; } .affine-embed-youtube-content-description { height: 40px; position: relative; word-break: break-word; white-space: normal; overflow: hidden; text-overflow: ellipsis; color: var(--affine-text-primary-color); font-family: var(--affine-font-family); font-size: var(--affine-font-xs); font-style: normal; font-weight: 400; line-height: 20px; } .affine-embed-youtube-content-description::after { content: '...'; position: absolute; right: 0; bottom: 0; background-color: var(--affine-background-primary-color); } .affine-embed-youtube-content-url { display: flex; align-items: center; justify-content: flex-start; gap: 4px; width: max-content; max-width: 100%; cursor: pointer; } .affine-embed-youtube-content-url > span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; word-break: break-all; white-space: normal; overflow: hidden; text-overflow: ellipsis; color: ${unsafeCSSVarV2('icon/primary')}; font-family: var(--affine-font-family); font-size: var(--affine-font-xs); font-style: normal; font-weight: 400; line-height: 20px; } .affine-embed-youtube-content-url:hover > span { color: var(--affine-link-color); } .affine-embed-youtube-content-url:hover .open-icon { fill: var(--affine-link-color); } .affine-embed-youtube-content-url-icon { display: flex; align-items: center; justify-content: center; width: 12px; height: 12px; } .affine-embed-youtube-content-url-icon svg { height: 12px; width: 12px; fill: ${unsafeCSSVarV2('icon/primary')}; } .affine-embed-youtube-block.loading { .affine-embed-youtube-content-title-text { color: var(--affine-placeholder-color); } } .affine-embed-youtube-block.selected { .affine-embed-youtube-content-url > span { color: var(--affine-link-color); } .affine-embed-youtube-content-url .open-icon { fill: var(--affine-link-color); } } `; export const YoutubeIcon = html` `;