feat(editor): embed iframe loading status card in surface (#10868)

This commit is contained in:
donteatfriedrice
2025-03-16 09:05:04 +00:00
parent 26285f7dcb
commit 7ecb1f510d
2 changed files with 111 additions and 16 deletions

View File

@@ -16,6 +16,7 @@ import { html, nothing } from 'lit';
import { type ClassInfo, classMap } from 'lit/directives/class-map.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import type { EmbedIframeLoadingCardOptions } from './components/embed-iframe-loading-card.js';
import type { IframeOptions } from './extension/embed-iframe-config.js';
import { EmbedIframeService } from './extension/embed-iframe-service.js';
import { embedIframeBlockStyles } from './style.js';
@@ -74,6 +75,12 @@ export class EmbedIframeBlockComponent extends CaptionedBlockComponent<EmbedIfra
return flag ?? false;
}
get _loadingCardOptions(): EmbedIframeLoadingCardOptions {
return this.inSurface
? { layout: 'vertical' }
: { layout: 'horizontal', height: 114 };
}
open = () => {
const link = this.model.props.url;
window.open(link, '_blank');
@@ -206,6 +213,7 @@ export class EmbedIframeBlockComponent extends CaptionedBlockComponent<EmbedIfra
if (this.isLoading$.value) {
return html`<embed-iframe-loading-card
.std=${this.std}
.options=${this._loadingCardOptions}
></embed-iframe-loading-card>`;
}