diff --git a/packages/playground/apps/_common/components/adapters-panel.ts b/packages/playground/apps/_common/components/adapters-panel.ts index 2e4c58f7502a..66afaa46d19f 100644 --- a/packages/playground/apps/_common/components/adapters-panel.ts +++ b/packages/playground/apps/_common/components/adapters-panel.ts @@ -22,7 +22,7 @@ import { customElement, property, query, state } from 'lit/decorators.js'; export class AdaptersPanel extends WithDisposable(ShadowlessElement) { static override styles = css` adapters-panel { - width: 30vw; + width: 36vw; } .adapters-container { border: 1px solid var(--affine-border-color, #e3e2e4); @@ -55,6 +55,41 @@ export class AdaptersPanel extends WithDisposable(ShadowlessElement) { .update-button:hover { background-color: var(--affine-hover-color); } + .html-panel { + display: flex; + gap: 8px; + flex-direction: column; + } + .html-preview-container, + .html-panel-content { + width: 100%; + flex: 1; + border: none; + box-sizing: border-box; + color: var(--affine-text-primary-color); + overflow: auto; + } + .html-panel-footer { + width: 100%; + height: 32px; + display: flex; + justify-content: flex-end; + + span { + cursor: pointer; + padding: 4px 8px; + font-size: 12px; + font-weight: 500; + border: 1px solid var(--affine-border-color); + font-family: var(--affine-font-family); + color: var(--affine-text-primary-color); + background-color: var(--affine-background-primary-color); + line-height: 20px; + } + span[active] { + background-color: var(--affine-hover-color); + } + } `; get doc() { @@ -62,7 +97,6 @@ export class AdaptersPanel extends WithDisposable(ShadowlessElement) { } private _createJob() { - console.log('collection', this.doc.collection.id, this.doc.id); return new Job({ collection: this.doc.collection, middlewares: [ @@ -118,6 +152,31 @@ export class AdaptersPanel extends WithDisposable(ShadowlessElement) { } } + private _renderHtmlPanel() { + return html` + ${this._isHtmlPreview + ? html`` + : html`