import { customElement } from 'lit/decorators.js'; import { styleMap } from 'lit/directives/style-map.js'; import { html } from 'lit/static-html.js'; import type { EmbedBlockModel } from '../../../../../_common/embed-block-helper/index.js'; import { Bound } from '../../../../../surface-block/index.js'; import { EdgelessPortalBase } from '../edgeless-portal-base.js'; @customElement('edgeless-block-portal-embed') export class EdgelessBlockPortalEmbed extends EdgelessPortalBase { override render() { const { model, index } = this; const bound = Bound.deserialize(model.xywh); const style = { position: 'absolute', zIndex: `${index}`, width: `${bound.w}px`, height: `${bound.h}px`, left: `${bound.x}px`, top: `${bound.y}px`, transformOrigin: '0px 0px', }; return html`
${this.renderModel(model)}
`; } } declare global { interface HTMLElementTagNameMap { 'edgeless-block-portal-embed': EdgelessBlockPortalEmbed; } }