mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-31 21:59:10 +08:00
chore: merge blocksuite source code (#9213)
This commit is contained in:
@@ -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>;
|
||||
Reference in New Issue
Block a user