Files
AFFiNE-Mirror/blocksuite/affine/gfx/mindmap/src/toolbar/mindmap-importing-placeholder.ts
fundon 9465d0dc73 fix(editor): loading style (#12537)
Closes: [BS-3555](https://linear.app/affine-design/issue/BS-3555/ui-attachment-loading-变量更新)
Closes: [BS-3559](https://linear.app/affine-design/issue/BS-3559/ui-图片-loading-变量更新)

### Dark
<img width="625" alt="Screenshot 2025-05-26 at 20 32 36" src="https://github.com/user-attachments/assets/93501e3d-8fc6-45f9-84a0-ac147e5c5f9f" />

### Light
<img width="623" alt="Screenshot 2025-05-26 at 20 32 25" src="https://github.com/user-attachments/assets/7d5bc128-6667-45b5-982d-dab3a22706a7" />

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Loading icons are now invoked as functions, allowing for more flexible and customizable rendering with parameters like size and progress.

- **Refactor**
  - Replaced theme-dependent and static loading icon references with a unified `LoadingIcon()` component across multiple components and blocks.
  - Removed legacy icon variants and simplified icon import statements, centralizing icon rendering logic.

- **Style**
  - Updated styles for loading and reload buttons to use theme-aware CSS variables.
  - Enlarged and repositioned loading indicators in image blocks for better visibility.

- **Bug Fixes**
  - Achieved consistent loading icon rendering across various blocks and components by standardizing icon invocation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-27 05:10:27 +00:00

55 lines
1.4 KiB
TypeScript

import { LoadingIcon } from '@blocksuite/affine-components/icons';
import { unsafeCSSVarV2 } from '@blocksuite/affine-shared/theme';
import { ShadowlessElement } from '@blocksuite/std';
import { css, html } from 'lit';
import { importMindMapIcon } from './icons.js';
export class MindMapPlaceholder extends ShadowlessElement {
static override styles = css`
mindmap-import-placeholder {
display: flex;
flex-direction: column;
padding: 28px 12px 12px;
box-sizing: border-box;
width: 200px;
height: 122px;
border-radius: 12px;
gap: 12px;
background-color: ${unsafeCSSVarV2('layer/background/secondary')};
border: 1px solid ${unsafeCSSVarV2('layer/insideBorder/border')};
color: ${unsafeCSSVarV2('text/placeholder')};
box-shadow: 0px 0px 4px 0px rgba(66, 65, 73, 0.14);
}
mindmap-import-placeholder .preview-icon {
text-align: center;
}
mindmap-import-placeholder .description {
display: flex;
gap: 8px;
color: ${unsafeCSSVarV2('text/placeholder')};
font-size: 14px;
line-height: 22px;
align-items: center;
}
`;
override render() {
return html`<div class="placeholder-container">
<div class="preview-icon">${importMindMapIcon}</div>
<div class="description">
${LoadingIcon()}
<span>Importing mind map...</span>
</div>
</div>`;
}
}