fix(editor): fix color of the circle on loading icon (#12092)

* Unified loading icon
* Removed loading icon on image block
* Fixed color of circle on loading icon

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

- **New Features**
  - Icons in image fallback and loading states now automatically adapt to the current theme (light or dark mode) for a more consistent visual experience.

- **Style**
  - Updated loading, success, and error icons to support theming and improved their color assignments for better visibility in different themes.

- **Refactor**
  - Replaced static icon usage across several components with dynamic, theme-aware icons to ensure consistent appearance throughout the app.
  - Removed static SVG icon exports and replaced them with theme-aware icon functions for improved maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
fundon
2025-04-30 10:21:28 +00:00
parent bcb0e80a75
commit 8938da4c24
9 changed files with 38 additions and 96 deletions

View File

@@ -1,9 +1,10 @@
import { LoadingIcon } from '@blocksuite/affine-block-image';
import type { IconButton } from '@blocksuite/affine-components/icon-button';
import { getLoadingIconWith } from '@blocksuite/affine-components/icons';
import {
cleanSpecifiedTail,
getTextContentFromInlineRange,
} from '@blocksuite/affine-rich-text';
import { ThemeProvider } from '@blocksuite/affine-shared/services';
import { unsafeCSSVar } from '@blocksuite/affine-shared/theme';
import {
createKeydownObserver,
@@ -127,6 +128,10 @@ export class LinkedDocPopover extends SignalWatcher(
);
}
private get _loadingIcon() {
return getLoadingIconWith(this.context.std.get(ThemeProvider).theme$.value);
}
private _getActionItems(group: LinkedMenuGroup) {
const isExpanded = !!this._expanded.get(group.name);
let items = resolveSignal(group.items);
@@ -286,7 +291,7 @@ export class LinkedDocPopover extends SignalWatcher(
<div class="group-title">
<div class="group-title-text">${group.name}</div>
${group.isLoading
? html`<span class="loading-icon">${LoadingIcon}</span>`
? html`<span class="loading-icon">${this._loadingIcon}</span>`
: nothing}
</div>
<div class="group" style=${group.styles ?? ''}>