chore(editor): cleanup dead code (#9904)

This commit is contained in:
Saul-Mirone
2025-01-27 17:06:42 +00:00
parent 17bf75e843
commit 9c65c42d64
31 changed files with 175 additions and 319 deletions
@@ -1,17 +1,10 @@
import type {
PeekOptions,
PeekViewService,
} from '@blocksuite/affine-components/peek';
import { PeekViewExtension } from '@blocksuite/affine-components/peek';
import type { EditorSetting } from '@blocksuite/affine-shared/services';
import { BlockComponent } from '@blocksuite/block-std';
import {
ColorScheme,
type DocMode,
type DocModeProvider,
GeneralSettingSchema,
type GenerateDocUrlService,
matchFlavours,
type NotificationService,
type ParseDocUrlService,
type ReferenceParams,
@@ -22,9 +15,6 @@ import { Slot } from '@blocksuite/global/utils';
import type { AffineEditorContainer } from '@blocksuite/presets';
import { type Workspace } from '@blocksuite/store';
import { Signal, signal } from '@preact/signals-core';
import type { TemplateResult } from 'lit';
import type { AttachmentViewerPanel } from './components/attachment-viewer-panel.js';
function getModeFromStorage() {
const mapJson = localStorage.getItem('playground:docMode');
@@ -154,37 +144,6 @@ export const themeExtension: ThemeExtension = {
},
};
export function mockPeekViewExtension(
attachmentViewerPanel: AttachmentViewerPanel
) {
return PeekViewExtension({
peek(
element: {
target: HTMLElement;
docId: string;
blockIds?: string[];
template?: TemplateResult;
},
options?: PeekOptions
) {
const { target } = element;
if (
target instanceof BlockComponent &&
matchFlavours(target.model, ['affine:attachment'])
) {
attachmentViewerPanel.open(target.model);
return Promise.resolve();
}
alert('Peek view not implemented in playground');
console.log('peek', element, options);
return Promise.resolve();
},
} satisfies PeekViewService);
}
export function mockGenerateDocUrlService(collection: Workspace) {
const generateDocUrlService: GenerateDocUrlService = {
generateDocUrl: (docId: string, params?: ReferenceParams) => {