fix: linked-doc and figma scale issue (#12493)
Fixes [BS-2993](https://linear.app/affine-design/issue/BS-2993/)
This commit is contained in:
@@ -384,10 +384,6 @@ export class EmbedLinkedDocBlockComponent extends EmbedBlockComponent<EmbedLinke
|
|||||||
() => html`
|
() => html`
|
||||||
<div
|
<div
|
||||||
class="affine-embed-linked-doc-block ${cardClassMap}"
|
class="affine-embed-linked-doc-block ${cardClassMap}"
|
||||||
style=${styleMap({
|
|
||||||
transform: `scale(${this._scale})`,
|
|
||||||
transformOrigin: '0 0',
|
|
||||||
})}
|
|
||||||
@click=${this._handleClick}
|
@click=${this._handleClick}
|
||||||
@dblclick=${this._handleDoubleClick}
|
@dblclick=${this._handleDoubleClick}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -305,7 +305,6 @@ export const styles = css`
|
|||||||
|
|
||||||
.affine-embed-linked-doc-content-note {
|
.affine-embed-linked-doc-content-note {
|
||||||
-webkit-line-clamp: 16;
|
-webkit-line-clamp: 16;
|
||||||
max-height: 320px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.affine-embed-linked-doc-content-date {
|
.affine-embed-linked-doc-content-date {
|
||||||
|
|||||||
@@ -50,12 +50,6 @@ export class EmbedBlockComponent<
|
|||||||
|
|
||||||
_cardStyle: EmbedCardStyle = 'horizontal';
|
_cardStyle: EmbedCardStyle = 'horizontal';
|
||||||
|
|
||||||
/**
|
|
||||||
* The actual rendered scale of the embed card.
|
|
||||||
* By default, it is set to 1.
|
|
||||||
*/
|
|
||||||
protected _scale = 1;
|
|
||||||
|
|
||||||
blockDraggable = true;
|
blockDraggable = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ export function toEdgelessEmbedBlock<
|
|||||||
this.blockContainerStyles = {
|
this.blockContainerStyles = {
|
||||||
width: `${bound.w}px`,
|
width: `${bound.w}px`,
|
||||||
};
|
};
|
||||||
this._scale = bound.w / this._cardWidth;
|
|
||||||
|
|
||||||
return this.renderPageContent();
|
return this.renderPageContent();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import type {
|
|||||||
import { BlockSelection } from '@blocksuite/std';
|
import { BlockSelection } from '@blocksuite/std';
|
||||||
import { html, nothing } from 'lit';
|
import { html, nothing } from 'lit';
|
||||||
import { classMap } from 'lit/directives/class-map.js';
|
import { classMap } from 'lit/directives/class-map.js';
|
||||||
import { styleMap } from 'lit/directives/style-map.js';
|
|
||||||
|
|
||||||
import { EmbedBlockComponent } from '../common/embed-block-element.js';
|
import { EmbedBlockComponent } from '../common/embed-block-element.js';
|
||||||
import { FigmaIcon, styles } from './styles.js';
|
import { FigmaIcon, styles } from './styles.js';
|
||||||
@@ -76,10 +75,6 @@ export class EmbedFigmaBlockComponent extends EmbedBlockComponent<EmbedFigmaMode
|
|||||||
'affine-embed-figma-block': true,
|
'affine-embed-figma-block': true,
|
||||||
selected: this.selected$.value,
|
selected: this.selected$.value,
|
||||||
})}
|
})}
|
||||||
style=${styleMap({
|
|
||||||
transform: `scale(${this._scale})`,
|
|
||||||
transformOrigin: '0 0',
|
|
||||||
})}
|
|
||||||
@click=${this._handleClick}
|
@click=${this._handleClick}
|
||||||
@dblclick=${this._handleDoubleClick}
|
@dblclick=${this._handleDoubleClick}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ export class EmbedLoomBlockComponent extends EmbedBlockComponent<
|
|||||||
selected: this.selected$.value,
|
selected: this.selected$.value,
|
||||||
})}
|
})}
|
||||||
style=${styleMap({
|
style=${styleMap({
|
||||||
transform: `scale(${this._scale})`,
|
|
||||||
transformOrigin: '0 0',
|
transformOrigin: '0 0',
|
||||||
})}
|
})}
|
||||||
@click=${this._handleClick}
|
@click=${this._handleClick}
|
||||||
|
|||||||
Reference in New Issue
Block a user