chore: merge blocksuite source code (#9213)

This commit is contained in:
Mirone
2024-12-20 15:38:06 +08:00
committed by GitHub
parent 2c9ef916f4
commit 30200ff86d
2031 changed files with 238888 additions and 229 deletions
@@ -0,0 +1,2 @@
export * from './slots.js';
export * from './type.js';
@@ -0,0 +1,27 @@
import { Slot } from '@blocksuite/global/utils';
import type { BlockService } from '../extension/service.js';
import type { BlockComponent, WidgetComponent } from '../view/index.js';
export type BlockSpecSlots<Service extends BlockService = BlockService> = {
mounted: Slot<{ service: Service }>;
unmounted: Slot<{ service: Service }>;
viewConnected: Slot<{ component: BlockComponent; service: Service }>;
viewDisconnected: Slot<{ component: BlockComponent; service: Service }>;
widgetConnected: Slot<{ component: WidgetComponent; service: Service }>;
widgetDisconnected: Slot<{
component: WidgetComponent;
service: Service;
}>;
};
export const getSlots = (): BlockSpecSlots => {
return {
mounted: new Slot(),
unmounted: new Slot(),
viewConnected: new Slot(),
viewDisconnected: new Slot(),
widgetConnected: new Slot(),
widgetDisconnected: new Slot(),
};
};
@@ -0,0 +1,6 @@
import type { BlockModel } from '@blocksuite/store';
import type { StaticValue } from 'lit/static-html.js';
export type BlockCommands = Partial<BlockSuite.Commands>;
export type BlockViewType = StaticValue | ((model: BlockModel) => StaticValue);
export type WidgetViewMapType = Record<string, StaticValue>;