mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-02 02:00:49 +08:00
chore: bump toolchain & fix lint
This commit is contained in:
@@ -117,7 +117,7 @@ export class EmbedGithubBlockComponent extends EmbedBlockComponent<
|
||||
|
||||
override renderBlock() {
|
||||
const {
|
||||
title = 'GitHub',
|
||||
title,
|
||||
githubType,
|
||||
status,
|
||||
statusReason,
|
||||
@@ -139,7 +139,7 @@ export class EmbedGithubBlockComponent extends EmbedBlockComponent<
|
||||
? getGithubStatusIcon(githubType, status, statusReason)
|
||||
: nothing;
|
||||
const statusText = loading ? '' : status;
|
||||
const titleText = loading ? 'Loading...' : title;
|
||||
const titleText = loading ? 'Loading...' : title || 'GitHub';
|
||||
const descriptionText = loading ? '' : description;
|
||||
const bannerImage =
|
||||
!loading && image
|
||||
|
||||
@@ -89,14 +89,14 @@ export class EmbedLoomBlockComponent extends EmbedBlockComponent<
|
||||
}
|
||||
|
||||
override renderBlock() {
|
||||
const { image, title = 'Loom', description, videoId } = this.model.props;
|
||||
const { image, title, description, videoId } = this.model.props;
|
||||
|
||||
const loading = this.loading;
|
||||
const theme = this.std.get(ThemeProvider).theme;
|
||||
const imageProxyService = this.store.get(ImageProxyService);
|
||||
const { EmbedCardBannerIcon } = getEmbedCardIcons(theme);
|
||||
const titleIcon = loading ? LoadingIcon() : LoomIcon;
|
||||
const titleText = loading ? 'Loading...' : title;
|
||||
const titleText = loading ? 'Loading...' : title || 'Loom';
|
||||
const descriptionText = loading ? '' : description;
|
||||
const bannerImage =
|
||||
!loading && image
|
||||
|
||||
@@ -96,21 +96,15 @@ export class EmbedYoutubeBlockComponent extends EmbedBlockComponent<
|
||||
}
|
||||
|
||||
override renderBlock() {
|
||||
const {
|
||||
image,
|
||||
title = 'YouTube',
|
||||
description,
|
||||
creator,
|
||||
creatorImage,
|
||||
videoId,
|
||||
} = this.model.props;
|
||||
const { image, title, description, creator, creatorImage, videoId } =
|
||||
this.model.props;
|
||||
|
||||
const loading = this.loading;
|
||||
const theme = this.std.get(ThemeProvider).theme;
|
||||
const imageProxyService = this.store.get(ImageProxyService);
|
||||
const { EmbedCardBannerIcon } = getEmbedCardIcons(theme);
|
||||
const titleIcon = loading ? LoadingIcon() : YoutubeIcon;
|
||||
const titleText = loading ? 'Loading...' : title;
|
||||
const titleText = loading ? 'Loading...' : title || 'YouTube';
|
||||
const descriptionText = loading ? null : description;
|
||||
const bannerImage =
|
||||
!loading && image
|
||||
|
||||
@@ -276,7 +276,8 @@ export class ImageEdgelessBlockComponent extends GfxBlockComponent<ImageBlockMod
|
||||
|
||||
override renderGfxBlock() {
|
||||
const blobUrl = this.blobUrl;
|
||||
const { rotate = 0, size = 0, caption = 'Image' } = this.model.props;
|
||||
const { rotate, size: rawSize, caption = 'Image' } = this.model.props;
|
||||
const size = rawSize ?? 0;
|
||||
this._resetLodSource(blobUrl);
|
||||
|
||||
const containerStyleMap = styleMap({
|
||||
|
||||
@@ -119,15 +119,14 @@ export class MindMapView extends GfxElementModelView<MindmapElementModel> {
|
||||
private _setLayoutMethod() {
|
||||
this.model.setLayoutMethod(function (
|
||||
this: MindmapElementModel,
|
||||
tree: MindmapNode | MindmapRoot = this.tree,
|
||||
options: {
|
||||
applyStyle?: boolean;
|
||||
layoutType?: LayoutType;
|
||||
stashed?: boolean;
|
||||
} = {
|
||||
applyStyle: true,
|
||||
stashed: true,
|
||||
}
|
||||
tree: MindmapNode | MindmapRoot | undefined,
|
||||
options:
|
||||
| {
|
||||
applyStyle?: boolean;
|
||||
layoutType?: LayoutType;
|
||||
stashed?: boolean;
|
||||
}
|
||||
| undefined
|
||||
) {
|
||||
const { stashed, applyStyle, layoutType } = Object.assign(
|
||||
{
|
||||
@@ -137,9 +136,10 @@ export class MindMapView extends GfxElementModelView<MindmapElementModel> {
|
||||
},
|
||||
options
|
||||
);
|
||||
const targetTree = tree ?? this.tree;
|
||||
|
||||
const pop = stashed ? this.stashTree(tree) : null;
|
||||
handleLayout(this, tree, applyStyle, layoutType);
|
||||
const pop = stashed ? this.stashTree(targetTree) : null;
|
||||
handleLayout(this, targetTree, applyStyle, layoutType);
|
||||
pop?.();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -58,8 +58,7 @@ export const getSelectedModelsCommand: Command<
|
||||
])
|
||||
.pipe(getSelectedBlocksCommand, { types, mode })
|
||||
.pipe(ctx => {
|
||||
const { selectedBlocks = [] } = ctx;
|
||||
selectedModels.push(...selectedBlocks.map(el => el.model));
|
||||
selectedModels.push(...ctx.selectedBlocks.map(el => el.model));
|
||||
})
|
||||
.run();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user