feat(core): bump blocksuite (#8114)

This commit is contained in:
akumatus 2024-09-05 13:54:56 +00:00
parent 5083fe3cfd
commit 4bbb94c32d
No known key found for this signature in database
GPG Key ID: D1FD534C6C29FE19
23 changed files with 313 additions and 249 deletions

View File

@ -3,8 +3,8 @@
"private": true, "private": true,
"type": "module", "type": "module",
"devDependencies": { "devDependencies": {
"@blocksuite/global": "0.0.0-canary-20240903103812", "@blocksuite/global": "0.0.0-canary-20240905130451",
"@blocksuite/store": "0.0.0-canary-20240903103812", "@blocksuite/store": "0.0.0-canary-20240905130451",
"react": "18.3.1", "react": "18.3.1",
"react-dom": "18.3.1", "react-dom": "18.3.1",
"vitest": "2.0.5" "vitest": "2.0.5"

View File

@ -14,10 +14,10 @@
"@affine/debug": "workspace:*", "@affine/debug": "workspace:*",
"@affine/env": "workspace:*", "@affine/env": "workspace:*",
"@affine/templates": "workspace:*", "@affine/templates": "workspace:*",
"@blocksuite/blocks": "0.0.0-canary-20240903103812", "@blocksuite/blocks": "0.0.0-canary-20240905130451",
"@blocksuite/global": "0.0.0-canary-20240903103812", "@blocksuite/global": "0.0.0-canary-20240905130451",
"@blocksuite/presets": "0.0.0-canary-20240903103812", "@blocksuite/presets": "0.0.0-canary-20240905130451",
"@blocksuite/store": "0.0.0-canary-20240903103812", "@blocksuite/store": "0.0.0-canary-20240905130451",
"@datastructures-js/binary-search-tree": "^5.3.2", "@datastructures-js/binary-search-tree": "^5.3.2",
"foxact": "^0.2.33", "foxact": "^0.2.33",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
@ -34,8 +34,8 @@
"devDependencies": { "devDependencies": {
"@affine-test/fixtures": "workspace:*", "@affine-test/fixtures": "workspace:*",
"@affine/templates": "workspace:*", "@affine/templates": "workspace:*",
"@blocksuite/block-std": "0.0.0-canary-20240903103812", "@blocksuite/block-std": "0.0.0-canary-20240905130451",
"@blocksuite/presets": "0.0.0-canary-20240903103812", "@blocksuite/presets": "0.0.0-canary-20240905130451",
"@testing-library/react": "^16.0.0", "@testing-library/react": "^16.0.0",
"async-call-rpc": "^6.4.0", "async-call-rpc": "^6.4.0",
"fake-indexeddb": "^6.0.0", "fake-indexeddb": "^6.0.0",

View File

@ -81,12 +81,12 @@
"zod": "^3.22.4" "zod": "^3.22.4"
}, },
"devDependencies": { "devDependencies": {
"@blocksuite/block-std": "0.0.0-canary-20240903103812", "@blocksuite/block-std": "0.0.0-canary-20240905130451",
"@blocksuite/blocks": "0.0.0-canary-20240903103812", "@blocksuite/blocks": "0.0.0-canary-20240905130451",
"@blocksuite/global": "0.0.0-canary-20240903103812", "@blocksuite/global": "0.0.0-canary-20240905130451",
"@blocksuite/icons": "2.1.67", "@blocksuite/icons": "2.1.67",
"@blocksuite/presets": "0.0.0-canary-20240903103812", "@blocksuite/presets": "0.0.0-canary-20240905130451",
"@blocksuite/store": "0.0.0-canary-20240903103812", "@blocksuite/store": "0.0.0-canary-20240905130451",
"@chromatic-com/storybook": "^1", "@chromatic-com/storybook": "^1",
"@storybook/addon-actions": "^8.2.9", "@storybook/addon-actions": "^8.2.9",
"@storybook/addon-essentials": "^8.2.9", "@storybook/addon-essentials": "^8.2.9",

View File

@ -15,13 +15,14 @@
"@affine/graphql": "workspace:*", "@affine/graphql": "workspace:*",
"@affine/i18n": "workspace:*", "@affine/i18n": "workspace:*",
"@affine/templates": "workspace:*", "@affine/templates": "workspace:*",
"@blocksuite/block-std": "0.0.0-canary-20240903103812", "@blocksuite/affine-block-surface": "0.0.0-canary-20240905130451",
"@blocksuite/blocks": "0.0.0-canary-20240903103812", "@blocksuite/block-std": "0.0.0-canary-20240905130451",
"@blocksuite/global": "0.0.0-canary-20240903103812", "@blocksuite/blocks": "0.0.0-canary-20240905130451",
"@blocksuite/global": "0.0.0-canary-20240905130451",
"@blocksuite/icons": "2.1.67", "@blocksuite/icons": "2.1.67",
"@blocksuite/inline": "0.0.0-canary-20240903103812", "@blocksuite/inline": "0.0.0-canary-20240905130451",
"@blocksuite/presets": "0.0.0-canary-20240903103812", "@blocksuite/presets": "0.0.0-canary-20240905130451",
"@blocksuite/store": "0.0.0-canary-20240903103812", "@blocksuite/store": "0.0.0-canary-20240905130451",
"@dnd-kit/core": "^6.1.0", "@dnd-kit/core": "^6.1.0",
"@dnd-kit/modifiers": "^7.0.0", "@dnd-kit/modifiers": "^7.0.0",
"@dnd-kit/sortable": "^8.0.0", "@dnd-kit/sortable": "^8.0.0",

View File

@ -10,6 +10,7 @@ import {
type EdgelessRootService, type EdgelessRootService,
type ImageSelection, type ImageSelection,
type PageRootService, type PageRootService,
TelemetryProvider,
} from '@blocksuite/blocks'; } from '@blocksuite/blocks';
import { BlocksUtils, NoteDisplayMode } from '@blocksuite/blocks'; import { BlocksUtils, NoteDisplayMode } from '@blocksuite/blocks';
import { import {
@ -304,7 +305,7 @@ const SAVE_CHAT_TO_BLOCK_ACTION: ChatAction = {
const { notificationService } = rootService; const { notificationService } = rootService;
const docModeService = host.std.get(DocModeProvider); const docModeService = host.std.get(DocModeProvider);
const { layer } = surfaceService; const { layer } = surfaceService;
const curMode = docModeService.getMode(); const curMode = docModeService.getEditorMode() || 'page';
const viewportCenter = getViewportCenter( const viewportCenter = getViewportCenter(
curMode, curMode,
rootService as PageRootService rootService as PageRootService
@ -313,7 +314,7 @@ const SAVE_CHAT_TO_BLOCK_ACTION: ChatAction = {
// If current mode is not edgeless, switch to edgeless mode first // If current mode is not edgeless, switch to edgeless mode first
if (curMode !== 'edgeless') { if (curMode !== 'edgeless') {
// Set mode to edgeless // Set mode to edgeless
docModeService.setMode('edgeless' as DocMode); docModeService.setEditorMode('edgeless' as DocMode);
// Notify user to switch to edgeless mode // Notify user to switch to edgeless mode
notificationService?.notify({ notificationService?.notify({
title: 'Save chat to a block', title: 'Save chat to a block',
@ -354,7 +355,8 @@ const SAVE_CHAT_TO_BLOCK_ACTION: ChatAction = {
return false; return false;
} }
rootService.telemetryService?.track('CanvasElementAdded', { const telemetryService = host.std.getOptional(TelemetryProvider);
telemetryService?.track('CanvasElementAdded', {
control: 'manually save', control: 'manually save',
page: 'whiteboard editor', page: 'whiteboard editor',
module: 'ai chat panel', module: 'ai chat panel',
@ -463,7 +465,7 @@ const CREATE_AS_LINKED_DOC = {
const service = host.std.getService<EdgelessRootService>('affine:page'); const service = host.std.getService<EdgelessRootService>('affine:page');
const docModeService = host.std.get(DocModeProvider); const docModeService = host.std.get(DocModeProvider);
const mode = docModeService.getMode(); const mode = docModeService.getEditorMode();
if (mode !== 'edgeless') { if (mode !== 'edgeless') {
return false; return false;
} }

View File

@ -56,7 +56,7 @@ export async function frameToCanvas(
) { ) {
const edgelessRoot = getEdgelessRootFromEditor(editor); const edgelessRoot = getEdgelessRootFromEditor(editor);
const { notes, frames, shapes, images } = BlocksUtils.splitElements( const { notes, frames, shapes, images } = BlocksUtils.splitElements(
edgelessRoot.service.frame.getElementsInFrame(frame, true) edgelessRoot.service.frame.getElementsInFrameBound(frame, true)
); );
if (notes.length + frames.length + images.length + shapes.length === 0) { if (notes.length + frames.length + images.length + shapes.length === 0) {
return; return;
@ -106,7 +106,10 @@ export const getFirstImageInFrame = (
editor: EditorHost editor: EditorHost
) => { ) => {
const edgelessRoot = getEdgelessRootFromEditor(editor); const edgelessRoot = getEdgelessRootFromEditor(editor);
const elements = edgelessRoot.service.frame.getElementsInFrame(frame, false); const elements = edgelessRoot.service.frame.getElementsInFrameBound(
frame,
false
);
const image = elements.find(ele => { const image = elements.find(ele => {
if (!BlocksUtils.isCanvasElement(ele)) { if (!BlocksUtils.isCanvasElement(ele)) {
return ele.flavour === 'affine:image'; return ele.flavour === 'affine:image';

View File

@ -1,3 +1,5 @@
import type { MindmapElementModel } from '@blocksuite/affine-block-surface';
import { fitContent } from '@blocksuite/affine-block-surface';
import type { EditorHost } from '@blocksuite/block-std'; import type { EditorHost } from '@blocksuite/block-std';
import type { import type {
AffineAIPanelWidget, AffineAIPanelWidget,
@ -5,7 +7,6 @@ import type {
EdgelessCopilotWidget, EdgelessCopilotWidget,
EdgelessElementToolbarWidget, EdgelessElementToolbarWidget,
EdgelessRootService, EdgelessRootService,
MindmapElementModel,
ShapeElementModel, ShapeElementModel,
SurfaceBlockModel, SurfaceBlockModel,
} from '@blocksuite/blocks'; } from '@blocksuite/blocks';
@ -15,12 +16,12 @@ import {
EDGELESS_TEXT_BLOCK_MIN_HEIGHT, EDGELESS_TEXT_BLOCK_MIN_HEIGHT,
EDGELESS_TEXT_BLOCK_MIN_WIDTH, EDGELESS_TEXT_BLOCK_MIN_WIDTH,
EdgelessTextBlockModel, EdgelessTextBlockModel,
fitContent,
ImageBlockModel, ImageBlockModel,
InsertBelowIcon, InsertBelowIcon,
LightLoadingIcon, LightLoadingIcon,
NoteDisplayMode, NoteDisplayMode,
ResetIcon, ResetIcon,
TelemetryProvider,
} from '@blocksuite/blocks'; } from '@blocksuite/blocks';
import { assertExists, Bound } from '@blocksuite/global/utils'; import { assertExists, Bound } from '@blocksuite/global/utils';
import { html, type TemplateResult } from 'lit'; import { html, type TemplateResult } from 'lit';
@ -435,7 +436,8 @@ export const responses: {
}); });
}); });
edgelessService.telemetryService?.track('CanvasElementAdded', { const telemetryService = host.std.getOptional(TelemetryProvider);
telemetryService?.track('CanvasElementAdded', {
control: 'ai', control: 'ai',
page: 'whiteboard editor', page: 'whiteboard editor',
module: 'toolbar', module: 'toolbar',

View File

@ -163,7 +163,12 @@ export class ChatPanelMessages extends WithDisposable(ShadowlessElement) {
}) })
); );
const docModeService = this.host.std.get(DocModeProvider); const docModeService = this.host.std.get(DocModeProvider);
disposables.add(docModeService.onModeChange(() => this.requestUpdate())); disposables.add(
docModeService.onPrimaryModeChange(
() => this.requestUpdate(),
this.host.doc.id
)
);
} }
} }

View File

@ -1,8 +1,8 @@
import { MindmapElementModel } from '@blocksuite/affine-block-surface';
import { import {
type AIItemGroupConfig, type AIItemGroupConfig,
AIStarIconWithAnimation, AIStarIconWithAnimation,
BlocksUtils, BlocksUtils,
MindmapElementModel,
ShapeElementModel, ShapeElementModel,
TextElementModel, TextElementModel,
} from '@blocksuite/blocks'; } from '@blocksuite/blocks';

View File

@ -40,7 +40,7 @@ export function setupSlashMenuAIEntry(slashMenu: AffineSlashMenuWidget) {
const chain = rootComponent.host.command.chain(); const chain = rootComponent.host.command.chain();
const docModeService = rootComponent.std.get(DocModeProvider); const docModeService = rootComponent.std.get(DocModeProvider);
const editorMode = docModeService.getMode(rootComponent.doc.id); const editorMode = docModeService.getPrimaryMode(rootComponent.doc.id);
return item?.showWhen?.(chain, editorMode, rootComponent.host) ?? true; return item?.showWhen?.(chain, editorMode, rootComponent.host) ?? true;
}; };

View File

@ -1,8 +1,6 @@
import type { MindmapStyle } from '@blocksuite/affine-block-surface';
import type { EditorHost } from '@blocksuite/block-std'; import type { EditorHost } from '@blocksuite/block-std';
import type { import type { AffineAIPanelWidgetConfig } from '@blocksuite/blocks';
AffineAIPanelWidgetConfig,
MindmapStyle,
} from '@blocksuite/blocks';
import { markdownToMindmap, MiniMindmapPreview } from '@blocksuite/blocks'; import { markdownToMindmap, MiniMindmapPreview } from '@blocksuite/blocks';
import { noop } from '@blocksuite/global/utils'; import { noop } from '@blocksuite/global/utils';
import { html, nothing } from 'lit'; import { html, nothing } from 'lit';

View File

@ -3,13 +3,14 @@ import './date-time';
import '../_common/components/chat-action-list'; import '../_common/components/chat-action-list';
import '../_common/components/copy-more'; import '../_common/components/copy-more';
import { CanvasElementType } from '@blocksuite/affine-block-surface';
import { type EditorHost } from '@blocksuite/block-std'; import { type EditorHost } from '@blocksuite/block-std';
import { import {
type AIError, type AIError,
CanvasElementType,
ConnectorMode, ConnectorMode,
DocModeProvider, DocModeProvider,
type EdgelessRootService, type EdgelessRootService,
TelemetryProvider,
} from '@blocksuite/blocks'; } from '@blocksuite/blocks';
import { import {
type AIChatBlockModel, type AIChatBlockModel,
@ -138,7 +139,7 @@ export class AIChatBlockPeekView extends LitElement {
*/ */
createAIChatBlock = async () => { createAIChatBlock = async () => {
// Only create AI chat block in edgeless mode // Only create AI chat block in edgeless mode
const mode = this._modeService.getMode(); const mode = this._modeService.getEditorMode();
if (mode !== 'edgeless') { if (mode !== 'edgeless') {
return; return;
} }
@ -204,7 +205,8 @@ export class AIChatBlockPeekView extends LitElement {
target: { id: aiChatBlockId }, target: { id: aiChatBlockId },
}); });
edgelessService.telemetryService?.track('CanvasElementAdded', { const telemetryService = this.host.std.getOptional(TelemetryProvider);
telemetryService?.track('CanvasElementAdded', {
control: 'conversation', control: 'conversation',
page: 'whiteboard editor', page: 'whiteboard editor',
module: 'canvas', module: 'canvas',

View File

@ -1,10 +1,10 @@
import { MindmapElementModel } from '@blocksuite/affine-block-surface';
import type { BlockComponent, EditorHost } from '@blocksuite/block-std'; import type { BlockComponent, EditorHost } from '@blocksuite/block-std';
import { import {
AFFINE_EDGELESS_COPILOT_WIDGET, AFFINE_EDGELESS_COPILOT_WIDGET,
type EdgelessCopilotWidget, type EdgelessCopilotWidget,
type EdgelessRootService, type EdgelessRootService,
matchFlavours, matchFlavours,
MindmapElementModel,
type ShapeElementModel, type ShapeElementModel,
} from '@blocksuite/blocks'; } from '@blocksuite/blocks';

View File

@ -62,7 +62,7 @@ export async function frameToCanvas(
) { ) {
const edgelessRoot = getEdgelessRootFromEditor(editor); const edgelessRoot = getEdgelessRootFromEditor(editor);
const { notes, frames, shapes, images } = BlocksUtils.splitElements( const { notes, frames, shapes, images } = BlocksUtils.splitElements(
edgelessRoot.service.frame.getElementsInFrame(frame, true) edgelessRoot.service.frame.getElementsInFrameBound(frame, true)
); );
if (notes.length + frames.length + images.length + shapes.length === 0) { if (notes.length + frames.length + images.length + shapes.length === 0) {
return; return;
@ -213,7 +213,10 @@ export const getFirstImageInFrame = (
editor: EditorHost editor: EditorHost
) => { ) => {
const edgelessRoot = getEdgelessRootFromEditor(editor); const edgelessRoot = getEdgelessRootFromEditor(editor);
const elements = edgelessRoot.service.frame.getElementsInFrame(frame, false); const elements = edgelessRoot.service.frame.getElementsInFrameBound(
frame,
false
);
const image = elements.find(ele => { const image = elements.find(ele => {
if (!BlocksUtils.isCanvasElement(ele)) { if (!BlocksUtils.isCanvasElement(ele)) {
return ele.flavour === 'affine:image'; return ele.flavour === 'affine:image';

View File

@ -4,6 +4,7 @@ import {
useLitPortalFactory, useLitPortalFactory,
} from '@affine/component'; } from '@affine/component';
import { useJournalInfoHelper } from '@affine/core/hooks/use-journal'; import { useJournalInfoHelper } from '@affine/core/hooks/use-journal';
import { EditorService } from '@affine/core/modules/editor';
import { EditorSettingService } from '@affine/core/modules/editor-settting'; import { EditorSettingService } from '@affine/core/modules/editor-settting';
import { PeekViewService } from '@affine/core/modules/peek-view'; import { PeekViewService } from '@affine/core/modules/peek-view';
import type { DocMode } from '@blocksuite/blocks'; import type { DocMode } from '@blocksuite/blocks';
@ -66,13 +67,19 @@ interface BlocksuiteEditorProps {
const usePatchSpecs = (page: Doc, shared: boolean, mode: DocMode) => { const usePatchSpecs = (page: Doc, shared: boolean, mode: DocMode) => {
const [reactToLit, portals] = useLitPortalFactory(); const [reactToLit, portals] = useLitPortalFactory();
const { peekViewService, docService, docsService, editorSettingService } = const {
useServices({ peekViewService,
PeekViewService, docService,
DocService, docsService,
DocsService, editorSettingService,
EditorSettingService, editorService,
}); } = useServices({
PeekViewService,
DocService,
DocsService,
EditorSettingService,
EditorService,
});
const framework = useFramework(); const framework = useFramework();
const referenceRenderer: ReferenceReactRenderer = useMemo(() => { const referenceRenderer: ReferenceReactRenderer = useMemo(() => {
return function customReference(reference) { return function customReference(reference) {
@ -115,12 +122,15 @@ const usePatchSpecs = (page: Doc, shared: boolean, mode: DocMode) => {
if (shared) { if (shared) {
patched = patched.concat(patchForSharedPage()); patched = patched.concat(patchForSharedPage());
} }
patched = patched.concat(patchDocModeService(docService, docsService)); patched = patched.concat(
patchDocModeService(docService, docsService, editorService)
);
return patched; return patched;
}, [ }, [
confirmModal, confirmModal,
docService, docService,
docsService, docsService,
editorService,
framework, framework,
page.readonly, page.readonly,
peekViewService, peekViewService,

View File

@ -4,6 +4,7 @@ import {
} from '@affine/core/blocksuite/presets/ai'; } from '@affine/core/blocksuite/presets/ai';
import { mixpanel } from '@affine/core/mixpanel'; import { mixpanel } from '@affine/core/mixpanel';
import { EditorSettingService } from '@affine/core/modules/editor-settting'; import { EditorSettingService } from '@affine/core/modules/editor-settting';
import { AffineCanvasTextFonts } from '@blocksuite/affine-block-surface';
import { import {
BlockFlavourIdentifier, BlockFlavourIdentifier,
BlockServiceIdentifier, BlockServiceIdentifier,
@ -11,9 +12,12 @@ import {
type ExtensionType, type ExtensionType,
StdIdentifier, StdIdentifier,
} from '@blocksuite/block-std'; } from '@blocksuite/block-std';
import type { RootService, TelemetryEventMap } from '@blocksuite/blocks';
import { import {
AffineCanvasTextFonts, type RootService,
type TelemetryEventMap,
TelemetryProvider,
} from '@blocksuite/blocks';
import {
EdgelessRootBlockSpec, EdgelessRootBlockSpec,
EdgelessRootService, EdgelessRootService,
PageRootBlockSpec, PageRootBlockSpec,
@ -44,15 +48,6 @@ function withAffineRootService(Service: typeof PageRootService) {
override loadFonts(): void { override loadFonts(): void {
customLoadFonts(this); customLoadFonts(this);
} }
override telemetryService = {
track: <T extends keyof TelemetryEventMap>(
eventName: T,
props: TelemetryEventMap[T]
) => {
mixpanel.track(eventName as string, props as Record<string, unknown>);
},
};
}; };
} }
@ -70,6 +65,17 @@ export function createPageRootBlockSpec(
withAffineRootService(PageRootService), withAffineRootService(PageRootService),
[StdIdentifier, BlockFlavourIdentifier('affine:page')] [StdIdentifier, BlockFlavourIdentifier('affine:page')]
); );
di.addImpl(TelemetryProvider, () => ({
track: <T extends keyof TelemetryEventMap>(
eventName: T,
props: TelemetryEventMap[T]
) => {
mixpanel.track(
eventName as string,
props as Record<string, unknown>
);
},
}));
}, },
}, },
ConfigExtension('affine:page', { ConfigExtension('affine:page', {

View File

@ -9,6 +9,7 @@ import {
} from '@affine/component'; } from '@affine/component';
import { track } from '@affine/core/mixpanel'; import { track } from '@affine/core/mixpanel';
import { DocsSearchService } from '@affine/core/modules/docs-search'; import { DocsSearchService } from '@affine/core/modules/docs-search';
import type { EditorService } from '@affine/core/modules/editor';
import { resolveLinkToDoc } from '@affine/core/modules/navigation'; import { resolveLinkToDoc } from '@affine/core/modules/navigation';
import type { PeekViewService } from '@affine/core/modules/peek-view'; import type { PeekViewService } from '@affine/core/modules/peek-view';
import type { ActivePeekView } from '@affine/core/modules/peek-view/entities/peek-view'; import type { ActivePeekView } from '@affine/core/modules/peek-view/entities/peek-view';
@ -27,13 +28,14 @@ import {
type WidgetComponent, type WidgetComponent,
} from '@blocksuite/block-std'; } from '@blocksuite/block-std';
import { BlockServiceWatcher } from '@blocksuite/block-std'; import { BlockServiceWatcher } from '@blocksuite/block-std';
import type { import {
AffineReference, type AffineReference,
DatabaseBlockService, type DatabaseBlockService,
DocMode, type DocMode,
ListBlockService, EmbedOptionProvider,
ParagraphBlockService, type ListBlockService,
RootService, type ParagraphBlockService,
type RootService,
} from '@blocksuite/blocks'; } from '@blocksuite/blocks';
import { import {
AffineSlashMenuWidget, AffineSlashMenuWidget,
@ -239,30 +241,37 @@ export function patchPeekViewService(service: PeekViewService) {
export function patchDocModeService( export function patchDocModeService(
docService: DocService, docService: DocService,
docsService: DocsService docsService: DocsService,
editorService: EditorService
): ExtensionType { ): ExtensionType {
const DEFAULT_MODE = 'page'; const DEFAULT_MODE = 'page';
class AffineDocModeService implements DocModeProvider { class AffineDocModeService implements DocModeProvider {
setMode = (mode: DocMode, id?: string) => { setEditorMode = (mode: DocMode) => {
editorService.editor.setMode(mode);
};
getEditorMode = () => {
return editorService.editor.mode$.value;
};
setPrimaryMode = (mode: DocMode, id?: string) => {
if (id) { if (id) {
docsService.list.setPrimaryMode(id, mode); docsService.list.setPrimaryMode(id, mode);
} else { } else {
docService.doc.setPrimaryMode(mode); docService.doc.setPrimaryMode(mode);
} }
}; };
getMode = (id?: string) => { getPrimaryMode = (id?: string) => {
const mode = id const mode = id
? docsService.list.getPrimaryMode(id) ? docsService.list.getPrimaryMode(id)
: docService.doc.getPrimaryMode(); : docService.doc.getPrimaryMode();
return (mode || DEFAULT_MODE) as DocMode; return (mode || DEFAULT_MODE) as DocMode;
}; };
toggleMode = (id?: string) => { togglePrimaryMode = (id?: string) => {
const mode = id const mode = id
? docsService.list.togglePrimaryMode(id) ? docsService.list.togglePrimaryMode(id)
: docService.doc.togglePrimaryMode(); : docService.doc.togglePrimaryMode();
return (mode || DEFAULT_MODE) as DocMode; return (mode || DEFAULT_MODE) as DocMode;
}; };
onModeChange = (handler: (mode: DocMode) => void, id?: string) => { onPrimaryModeChange = (handler: (mode: DocMode) => void, id?: string) => {
// eslint-disable-next-line rxjs/finnish // eslint-disable-next-line rxjs/finnish
const mode$ = id const mode$ = id
? docsService.list.primaryMode$(id) ? docsService.list.primaryMode$(id)
@ -408,7 +417,7 @@ export function patchQuickSearchService(framework: FrameworkProvider) {
) { ) {
const oldAction = item.action; const oldAction = item.action;
item.action = async ({ model, rootComponent }) => { item.action = async ({ model, rootComponent }) => {
const { host, service, std } = rootComponent; const { host, std } = rootComponent;
const quickSearchService = const quickSearchService =
component.std.getOptional(QuickSearchProvider); component.std.getOptional(QuickSearchProvider);
@ -434,9 +443,9 @@ export function patchQuickSearchService(framework: FrameworkProvider) {
} }
track.doc.editor.slashMenu.linkDoc({ control: 'linkDoc' }); track.doc.editor.slashMenu.linkDoc({ control: 'linkDoc' });
} else if ('userInput' in result) { } else if ('userInput' in result) {
const embedOptions = service.getEmbedBlockOptions( const embedOptions = std
result.userInput .get(EmbedOptionProvider)
); .getEmbedBlockOptions(result.userInput);
if (!embedOptions) return; if (!embedOptions) return;
host.doc.addSiblingBlocks(model, [ host.doc.addSiblingBlocks(model, [
@ -466,31 +475,28 @@ export function patchEdgelessClipboard() {
const { component } = view; const { component } = view;
if (component instanceof EdgelessRootBlockComponent) { if (component instanceof EdgelessRootBlockComponent) {
const AIChatBlockFlavour = AIChatBlockSchema.model.flavour; const AIChatBlockFlavour = AIChatBlockSchema.model.flavour;
const createFunc = (blocks: BlockSnapshot[]) => { const createFunc = (block: BlockSnapshot) => {
const blockIds = blocks.map(({ props }) => { const {
const { xywh,
scale,
messages,
sessionId,
rootDocId,
rootWorkspaceId,
} = block.props;
const blockId = component.service.addBlock(
AIChatBlockFlavour,
{
xywh, xywh,
scale, scale,
messages, messages,
sessionId, sessionId,
rootDocId, rootDocId,
rootWorkspaceId, rootWorkspaceId,
} = props; },
const blockId = component.service.addBlock( component.surface.model.id
AIChatBlockFlavour, );
{ return blockId;
xywh,
scale,
messages,
sessionId,
rootDocId,
rootWorkspaceId,
},
component.surface.model.id
);
return blockId;
});
return blockIds;
}; };
component.clipboardController.registerBlock( component.clipboardController.registerBlock(
AIChatBlockFlavour, AIChatBlockFlavour,

View File

@ -1,7 +1,7 @@
import { EdgelessSurfaceBlockSpec } from '@blocksuite/affine-block-surface';
import type { ExtensionType } from '@blocksuite/block-std'; import type { ExtensionType } from '@blocksuite/block-std';
import { import {
EdgelessNoteBlockSpec, EdgelessNoteBlockSpec,
EdgelessSurfaceBlockSpec,
EdgelessSurfaceRefBlockSpec, EdgelessSurfaceRefBlockSpec,
EdgelessTextBlockSpec, EdgelessTextBlockSpec,
FrameBlockSpec, FrameBlockSpec,

View File

@ -1,9 +1,6 @@
import { PageSurfaceBlockSpec } from '@blocksuite/affine-block-surface';
import type { ExtensionType } from '@blocksuite/block-std'; import type { ExtensionType } from '@blocksuite/block-std';
import { import { NoteBlockSpec, PageSurfaceRefBlockSpec } from '@blocksuite/blocks';
NoteBlockSpec,
PageSurfaceBlockSpec,
PageSurfaceRefBlockSpec,
} from '@blocksuite/blocks';
import { type FrameworkProvider } from '@toeverything/infra'; import { type FrameworkProvider } from '@toeverything/infra';
import { AIBlockSpecs, DefaultBlockSpecs } from './common'; import { AIBlockSpecs, DefaultBlockSpecs } from './common';

View File

@ -52,10 +52,10 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
pageService.slots.docLinkClicked.on(() => { pageService.slots.docLinkClicked.on(() => {
(chatPanelRef.current as ChatPanel).doc = editor.doc; (chatPanelRef.current as ChatPanel).doc = editor.doc;
}), }),
docModeService.onModeChange(() => { docModeService.onPrimaryModeChange(() => {
if (!editor.host) return; if (!editor.host) return;
(chatPanelRef.current as ChatPanel).host = editor.host; (chatPanelRef.current as ChatPanel).host = editor.host;
}), }, editor.doc.id),
]; ];
return () => disposable.forEach(d => d.dispose()); return () => disposable.forEach(d => d.dispose());

View File

@ -29,10 +29,10 @@
"@affine/env": "workspace:*", "@affine/env": "workspace:*",
"@affine/i18n": "workspace:*", "@affine/i18n": "workspace:*",
"@affine/native": "workspace:*", "@affine/native": "workspace:*",
"@blocksuite/block-std": "0.0.0-canary-20240903103812", "@blocksuite/block-std": "0.0.0-canary-20240905130451",
"@blocksuite/blocks": "0.0.0-canary-20240903103812", "@blocksuite/blocks": "0.0.0-canary-20240905130451",
"@blocksuite/presets": "0.0.0-canary-20240903103812", "@blocksuite/presets": "0.0.0-canary-20240905130451",
"@blocksuite/store": "0.0.0-canary-20240903103812", "@blocksuite/store": "0.0.0-canary-20240905130451",
"@electron-forge/cli": "^7.3.0", "@electron-forge/cli": "^7.3.0",
"@electron-forge/core": "^7.3.0", "@electron-forge/core": "^7.3.0",
"@electron-forge/core-utils": "^7.3.0", "@electron-forge/core-utils": "^7.3.0",

View File

@ -6,7 +6,7 @@
"@affine/env": "workspace:*", "@affine/env": "workspace:*",
"@affine/templates": "workspace:*", "@affine/templates": "workspace:*",
"@aws-sdk/client-s3": "^3.620.0", "@aws-sdk/client-s3": "^3.620.0",
"@blocksuite/presets": "0.0.0-canary-20240903103812", "@blocksuite/presets": "0.0.0-canary-20240905130451",
"@clack/core": "^0.3.4", "@clack/core": "^0.3.4",
"@clack/prompts": "^0.7.0", "@clack/prompts": "^0.7.0",
"@magic-works/i18n-codegen": "^0.6.0", "@magic-works/i18n-codegen": "^0.6.0",

311
yarn.lock
View File

@ -253,7 +253,7 @@ __metadata:
"@affine/env": "workspace:*" "@affine/env": "workspace:*"
"@affine/templates": "workspace:*" "@affine/templates": "workspace:*"
"@aws-sdk/client-s3": "npm:^3.620.0" "@aws-sdk/client-s3": "npm:^3.620.0"
"@blocksuite/presets": "npm:0.0.0-canary-20240903103812" "@blocksuite/presets": "npm:0.0.0-canary-20240905130451"
"@clack/core": "npm:^0.3.4" "@clack/core": "npm:^0.3.4"
"@clack/prompts": "npm:^0.7.0" "@clack/prompts": "npm:^0.7.0"
"@magic-works/i18n-codegen": "npm:^0.6.0" "@magic-works/i18n-codegen": "npm:^0.6.0"
@ -312,12 +312,12 @@ __metadata:
"@affine/i18n": "workspace:*" "@affine/i18n": "workspace:*"
"@atlaskit/pragmatic-drag-and-drop": "npm:^1.2.1" "@atlaskit/pragmatic-drag-and-drop": "npm:^1.2.1"
"@atlaskit/pragmatic-drag-and-drop-hitbox": "npm:^1.0.3" "@atlaskit/pragmatic-drag-and-drop-hitbox": "npm:^1.0.3"
"@blocksuite/block-std": "npm:0.0.0-canary-20240903103812" "@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/blocks": "npm:0.0.0-canary-20240903103812" "@blocksuite/blocks": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/icons": "npm:2.1.67" "@blocksuite/icons": "npm:2.1.67"
"@blocksuite/presets": "npm:0.0.0-canary-20240903103812" "@blocksuite/presets": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@blocksuite/store": "npm:0.0.0-canary-20240905130451"
"@chromatic-com/storybook": "npm:^1" "@chromatic-com/storybook": "npm:^1"
"@dnd-kit/core": "npm:^6.1.0" "@dnd-kit/core": "npm:^6.1.0"
"@dnd-kit/modifiers": "npm:^7.0.0" "@dnd-kit/modifiers": "npm:^7.0.0"
@ -413,13 +413,14 @@ __metadata:
"@affine/graphql": "workspace:*" "@affine/graphql": "workspace:*"
"@affine/i18n": "workspace:*" "@affine/i18n": "workspace:*"
"@affine/templates": "workspace:*" "@affine/templates": "workspace:*"
"@blocksuite/block-std": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-block-surface": "npm:0.0.0-canary-20240905130451"
"@blocksuite/blocks": "npm:0.0.0-canary-20240903103812" "@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/blocks": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/icons": "npm:2.1.67" "@blocksuite/icons": "npm:2.1.67"
"@blocksuite/inline": "npm:0.0.0-canary-20240903103812" "@blocksuite/inline": "npm:0.0.0-canary-20240905130451"
"@blocksuite/presets": "npm:0.0.0-canary-20240903103812" "@blocksuite/presets": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@blocksuite/store": "npm:0.0.0-canary-20240905130451"
"@dnd-kit/core": "npm:^6.1.0" "@dnd-kit/core": "npm:^6.1.0"
"@dnd-kit/modifiers": "npm:^7.0.0" "@dnd-kit/modifiers": "npm:^7.0.0"
"@dnd-kit/sortable": "npm:^8.0.0" "@dnd-kit/sortable": "npm:^8.0.0"
@ -552,10 +553,10 @@ __metadata:
"@affine/env": "workspace:*" "@affine/env": "workspace:*"
"@affine/i18n": "workspace:*" "@affine/i18n": "workspace:*"
"@affine/native": "workspace:*" "@affine/native": "workspace:*"
"@blocksuite/block-std": "npm:0.0.0-canary-20240903103812" "@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/blocks": "npm:0.0.0-canary-20240903103812" "@blocksuite/blocks": "npm:0.0.0-canary-20240905130451"
"@blocksuite/presets": "npm:0.0.0-canary-20240903103812" "@blocksuite/presets": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@blocksuite/store": "npm:0.0.0-canary-20240905130451"
"@electron-forge/cli": "npm:^7.3.0" "@electron-forge/cli": "npm:^7.3.0"
"@electron-forge/core": "npm:^7.3.0" "@electron-forge/core": "npm:^7.3.0"
"@electron-forge/core-utils": "npm:^7.3.0" "@electron-forge/core-utils": "npm:^7.3.0"
@ -612,8 +613,8 @@ __metadata:
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "@affine/env@workspace:packages/common/env" resolution: "@affine/env@workspace:packages/common/env"
dependencies: dependencies:
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@blocksuite/store": "npm:0.0.0-canary-20240905130451"
lit: "npm:^3.1.2" lit: "npm:^3.1.2"
react: "npm:18.3.1" react: "npm:18.3.1"
react-dom: "npm:18.3.1" react-dom: "npm:18.3.1"
@ -3451,115 +3452,139 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/affine-block-list@npm:0.0.0-canary-20240903103812": "@blocksuite/affine-block-list@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/affine-block-list@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/affine-block-list@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
"@blocksuite/affine-components": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-components": "npm:0.0.0-canary-20240905130451"
"@blocksuite/affine-model": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-model": "npm:0.0.0-canary-20240905130451"
"@blocksuite/affine-shared": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-shared": "npm:0.0.0-canary-20240905130451"
"@blocksuite/block-std": "npm:0.0.0-canary-20240903103812" "@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/inline": "npm:0.0.0-canary-20240903103812" "@blocksuite/inline": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@blocksuite/store": "npm:0.0.0-canary-20240905130451"
"@floating-ui/dom": "npm:^1.6.10" "@floating-ui/dom": "npm:^1.6.10"
"@lit-labs/preact-signals": "npm:^1.0.2" "@lit-labs/preact-signals": "npm:^1.0.2"
"@lit/context": "npm:^1.1.2" "@lit/context": "npm:^1.1.2"
"@toeverything/theme": "npm:^1.0.7" "@toeverything/theme": "npm:^1.0.8"
lit: "npm:^3.2.0" lit: "npm:^3.2.0"
minimatch: "npm:^10.0.1" minimatch: "npm:^10.0.1"
zod: "npm:^3.23.8" zod: "npm:^3.23.8"
checksum: 10/11a438aafa23571b6c4991c9bbd37996bbed1d1dda61e0633e15bbe9427da00e74eb6196e3e79f1e63d56a22c5322e1c82efddad5110251a7172cb24a95ffffb checksum: 10/d92bc1a85a6d9db9502548b88fd3df4c74103fd720beb730f7df899998ee6330093f35ece2984b9eb48725aa8d308d1e3f58dfe25e52003cbae7f958157ac3c9
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/affine-block-paragraph@npm:0.0.0-canary-20240903103812": "@blocksuite/affine-block-paragraph@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/affine-block-paragraph@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/affine-block-paragraph@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
"@blocksuite/affine-components": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-components": "npm:0.0.0-canary-20240905130451"
"@blocksuite/affine-model": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-model": "npm:0.0.0-canary-20240905130451"
"@blocksuite/affine-shared": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-shared": "npm:0.0.0-canary-20240905130451"
"@blocksuite/block-std": "npm:0.0.0-canary-20240903103812" "@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/inline": "npm:0.0.0-canary-20240903103812" "@blocksuite/inline": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@blocksuite/store": "npm:0.0.0-canary-20240905130451"
"@floating-ui/dom": "npm:^1.6.10" "@floating-ui/dom": "npm:^1.6.10"
"@lit-labs/preact-signals": "npm:^1.0.2" "@lit-labs/preact-signals": "npm:^1.0.2"
"@lit/context": "npm:^1.1.2" "@lit/context": "npm:^1.1.2"
"@toeverything/theme": "npm:^1.0.7" "@toeverything/theme": "npm:^1.0.8"
lit: "npm:^3.2.0" lit: "npm:^3.2.0"
minimatch: "npm:^10.0.1" minimatch: "npm:^10.0.1"
zod: "npm:^3.23.8" zod: "npm:^3.23.8"
checksum: 10/d48382b8671efb921c06457f358f27ae9bc761ced0c1a1601ed19b0ae655842463f182a34c70512794be85fbec2415a78898643a93133fdfa8fb40bd38015556 checksum: 10/dc71e93ce16609f7e5c3e55b154c42db715435a5a196c0d317459ed2da7ff8b3e4c40efb858e0bf9d56af35daa02287d3842bed5644c806138eacd1adc770160
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/affine-components@npm:0.0.0-canary-20240903103812": "@blocksuite/affine-block-surface@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/affine-components@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/affine-block-surface@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
"@blocksuite/affine-model": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-components": "npm:0.0.0-canary-20240905130451"
"@blocksuite/affine-shared": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-model": "npm:0.0.0-canary-20240905130451"
"@blocksuite/block-std": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-shared": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/icons": "npm:^2.1.66" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/inline": "npm:0.0.0-canary-20240903103812" "@blocksuite/store": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@lit-labs/preact-signals": "npm:^1.0.2"
"@lit/context": "npm:^1.1.2"
"@toeverything/theme": "npm:^1.0.8"
fractional-indexing: "npm:^3.2.0"
lit: "npm:^3.2.0"
lodash.isplainobject: "npm:^4.0.6"
lodash.merge: "npm:^4.6.2"
nanoid: "npm:^5.0.7"
zod: "npm:^3.23.8"
checksum: 10/324209e8962dfce3fb72818bd753061a5a82b6def2b99489e7c3b6111cafc23f5ae07e90df4c3b6b2ad93b341adbedc84ae173cc1e8d4e9dc3ffe98e1174e577
languageName: node
linkType: hard
"@blocksuite/affine-components@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/affine-components@npm:0.0.0-canary-20240905130451"
dependencies:
"@blocksuite/affine-model": "npm:0.0.0-canary-20240905130451"
"@blocksuite/affine-shared": "npm:0.0.0-canary-20240905130451"
"@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/icons": "npm:^2.1.67"
"@blocksuite/inline": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240905130451"
"@floating-ui/dom": "npm:^1.6.10" "@floating-ui/dom": "npm:^1.6.10"
"@lit-labs/preact-signals": "npm:^1.0.2" "@lit-labs/preact-signals": "npm:^1.0.2"
"@lit/context": "npm:^1.1.2" "@lit/context": "npm:^1.1.2"
"@lottiefiles/dotlottie-wc": "npm:^0.2.16" "@lottiefiles/dotlottie-wc": "npm:^0.2.16"
"@toeverything/theme": "npm:^1.0.7" "@toeverything/theme": "npm:^1.0.8"
katex: "npm:^0.16.11" katex: "npm:^0.16.11"
lit: "npm:^3.2.0" lit: "npm:^3.2.0"
shiki: "npm:^1.12.0" shiki: "npm:^1.12.0"
zod: "npm:^3.23.8" zod: "npm:^3.23.8"
checksum: 10/1ddb5cd9512026a9be68159b6b731189faec7c5e43bfa49a946bd8609bb3ebe662f51389fe60fec4384e83556dd23c73e53d0eb8e09456a92446036efc5dc999 checksum: 10/88b7255873938185e6ed683631113b0bae592a735e460e7f7beb935e0c60a2fe0729bbcf6409647e40d3e9bc0666e8c2231430d439d1e1c625ba8600f74d8159
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/affine-model@npm:0.0.0-canary-20240903103812": "@blocksuite/affine-model@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/affine-model@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/affine-model@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
"@blocksuite/block-std": "npm:0.0.0-canary-20240903103812" "@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/inline": "npm:0.0.0-canary-20240903103812" "@blocksuite/inline": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@blocksuite/store": "npm:0.0.0-canary-20240905130451"
zod: "npm:^3.23.8" zod: "npm:^3.23.8"
checksum: 10/dc02616add41f51d007cc321b2133ca1f44a7ea98298023e7038f722403345c22051cd2e7af7fa9fef24ebbea8b1207e7c5ca8f63b166965b18d8b3fff12b86d checksum: 10/45d450d1f11c49bc3f75af0f16ea612a6375fdb2cc85dbb987cb8f6399aa3b25787beabd13f16e487261341dc06be60d1b2cb745b1d6737bf66918111b384c2d
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/affine-shared@npm:0.0.0-canary-20240903103812": "@blocksuite/affine-shared@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/affine-shared@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/affine-shared@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
"@blocksuite/affine-model": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-model": "npm:0.0.0-canary-20240905130451"
"@blocksuite/block-std": "npm:0.0.0-canary-20240903103812" "@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/inline": "npm:0.0.0-canary-20240903103812" "@blocksuite/inline": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@blocksuite/store": "npm:0.0.0-canary-20240905130451"
"@floating-ui/dom": "npm:^1.6.10" "@floating-ui/dom": "npm:^1.6.10"
"@lit-labs/preact-signals": "npm:^1.0.2" "@lit-labs/preact-signals": "npm:^1.0.2"
"@lit/context": "npm:^1.1.2" "@lit/context": "npm:^1.1.2"
"@toeverything/theme": "npm:^1.0.7" "@toeverything/theme": "npm:^1.0.8"
lit: "npm:^3.2.0" lit: "npm:^3.2.0"
minimatch: "npm:^10.0.1" minimatch: "npm:^10.0.1"
zod: "npm:^3.23.8" zod: "npm:^3.23.8"
checksum: 10/47c0a21d5b57b713da6ccd7186ea7af5ca70224c2159f698eea9f534c64cb6f3b38d1eb9c8d5f7df9a484a5f84d94499ce074c04ff9807793611314aa4dc4f90 checksum: 10/9691c669ca106a6b3b71814c7034310fc54900c828beb6abbb92fa2280b89ee662b54b5bd03871c3c1f34981932d49d6923f8c38a74717738a14f087593331b8
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/block-std@npm:0.0.0-canary-20240903103812": "@blocksuite/block-std@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/block-std@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/block-std@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@lit-labs/preact-signals": "npm:^1.0.2" "@lit-labs/preact-signals": "npm:^1.0.2"
"@lit/context": "npm:^1.1.2" "@lit/context": "npm:^1.1.2"
"@types/hast": "npm:^3.0.4" "@types/hast": "npm:^3.0.4"
fractional-indexing: "npm:^3.2.0"
lib0: "npm:^0.2.97" lib0: "npm:^0.2.97"
lit: "npm:^3.2.0" lit: "npm:^3.2.0"
lz-string: "npm:^1.5.0" lz-string: "npm:^1.5.0"
@ -3568,30 +3593,31 @@ __metadata:
w3c-keyname: "npm:^2.2.8" w3c-keyname: "npm:^2.2.8"
zod: "npm:^3.23.8" zod: "npm:^3.23.8"
peerDependencies: peerDependencies:
"@blocksuite/inline": 0.0.0-canary-20240903103812 "@blocksuite/inline": 0.0.0-canary-20240905130451
"@blocksuite/store": 0.0.0-canary-20240903103812 "@blocksuite/store": 0.0.0-canary-20240905130451
checksum: 10/6918437af7f2f3121bfd981f055c80c875d99fa7911b2708c4ce7fe2d9d9895161460f8da8bc353b63a34fceb6a5b37a05043334c3ab929da0ab2a070ceb7bb8 checksum: 10/ffc8e82a058a51789bac81033522ac7927bf96d3bee05ec70b9aa409c826896b6994bb08062bcae1fc40d90c4e83474a5aac2576c4b3d9d472d024f4074bbd07
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/blocks@npm:0.0.0-canary-20240903103812": "@blocksuite/blocks@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/blocks@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/blocks@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
"@blocksuite/affine-block-list": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-block-list": "npm:0.0.0-canary-20240905130451"
"@blocksuite/affine-block-paragraph": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-block-paragraph": "npm:0.0.0-canary-20240905130451"
"@blocksuite/affine-components": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-block-surface": "npm:0.0.0-canary-20240905130451"
"@blocksuite/affine-model": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-components": "npm:0.0.0-canary-20240905130451"
"@blocksuite/affine-shared": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-model": "npm:0.0.0-canary-20240905130451"
"@blocksuite/block-std": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-shared": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/icons": "npm:^2.1.66" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/inline": "npm:0.0.0-canary-20240903103812" "@blocksuite/icons": "npm:^2.1.67"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@blocksuite/inline": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240905130451"
"@floating-ui/dom": "npm:^1.6.10" "@floating-ui/dom": "npm:^1.6.10"
"@lit-labs/preact-signals": "npm:^1.0.2" "@lit-labs/preact-signals": "npm:^1.0.2"
"@lit/context": "npm:^1.1.2" "@lit/context": "npm:^1.1.2"
"@toeverything/theme": "npm:^1.0.7" "@toeverything/theme": "npm:^1.0.8"
"@types/hast": "npm:^3.0.4" "@types/hast": "npm:^3.0.4"
"@types/mdast": "npm:^4.0.4" "@types/mdast": "npm:^4.0.4"
"@types/sortablejs": "npm:^1.15.8" "@types/sortablejs": "npm:^1.15.8"
@ -3599,11 +3625,12 @@ __metadata:
date-fns: "npm:^3.6.0" date-fns: "npm:^3.6.0"
dompurify: "npm:^3.1.6" dompurify: "npm:^3.1.6"
fflate: "npm:^0.8.2" fflate: "npm:^0.8.2"
figma-squircle: "npm:^0.3.1"
file-type: "npm:^19.4.1" file-type: "npm:^19.4.1"
fractional-indexing: "npm:^3.2.0" fractional-indexing: "npm:^3.2.0"
html2canvas: "npm:^1.4.1" html2canvas: "npm:^1.4.1"
katex: "npm:^0.16.11"
lit: "npm:^3.2.0" lit: "npm:^3.2.0"
lodash.clonedeep: "npm:^4.5.0"
lodash.isplainobject: "npm:^4.0.6" lodash.isplainobject: "npm:^4.0.6"
lodash.merge: "npm:^4.6.2" lodash.merge: "npm:^4.6.2"
mdast-util-gfm-autolink-literal: "npm:^2.0.1" mdast-util-gfm-autolink-literal: "npm:^2.0.1"
@ -3626,21 +3653,21 @@ __metadata:
sortablejs: "npm:^1.15.2" sortablejs: "npm:^1.15.2"
unified: "npm:^11.0.5" unified: "npm:^11.0.5"
zod: "npm:^3.23.8" zod: "npm:^3.23.8"
checksum: 10/8c038aaa393a12e5d2bbd5d455276cbc5392f356d69cb20f926903da586c278eeaafc38a85a6f9f5b2c83c7c7de33a8a33bf41f0d1241150023811e41969a2a4 checksum: 10/57d08465a97697e0f265e7af263785e1875ba787d8fbd3a9d99187239528cc649554b505cc3da77754216a87ed7bcf45e7c02644a36ae85be9000b545f7c6587
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/global@npm:0.0.0-canary-20240903103812": "@blocksuite/global@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/global@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/global@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
lib0: "npm:^0.2.97" lib0: "npm:^0.2.97"
zod: "npm:^3.23.8" zod: "npm:^3.23.8"
checksum: 10/eabd1d6140402e34db81ea2ac16e348bc04a0e7204d5dcfd4fb04611a00664d66f079093bc23c09f6465cc77ec1970b9d43126063011c56e35603f20382b8de4 checksum: 10/721132cf37ad64c6ea174260414e7ee76601505deb9e4f69a36b20e9caa1d5b301102e4c76f475dcd9774004c42594a585e4a3a1fbbe1c2d635a66cb6a0d6abd
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/icons@npm:2.1.67, @blocksuite/icons@npm:^2.1.66": "@blocksuite/icons@npm:2.1.67, @blocksuite/icons@npm:^2.1.66, @blocksuite/icons@npm:^2.1.67":
version: 2.1.67 version: 2.1.67
resolution: "@blocksuite/icons@npm:2.1.67" resolution: "@blocksuite/icons@npm:2.1.67"
peerDependencies: peerDependencies:
@ -3656,51 +3683,53 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/inline@npm:0.0.0-canary-20240903103812": "@blocksuite/inline@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/inline@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/inline@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
zod: "npm:^3.23.8" zod: "npm:^3.23.8"
peerDependencies: peerDependencies:
lit: ^3.1.1 lit: ^3.1.1
yjs: ^13.6.15 yjs: ^13.6.15
checksum: 10/021b2c4ffe20384054b8839217eebfc4717ff508bff4ead45905f14c080f66be4d78664f86e724f97110e2f84450bdf3aa3207ca647605217a5493663d10b479 checksum: 10/4e7bbf52cfa99bae61dd15d74439c5f0dc7aeaac0065b37b63ceed65eeec7c490e9647beab2957b52fbb6c78e52e895891cbad063f74100e3db5ddb4afc08653
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/presets@npm:0.0.0-canary-20240903103812": "@blocksuite/presets@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/presets@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/presets@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
"@blocksuite/affine-shared": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-block-surface": "npm:0.0.0-canary-20240905130451"
"@blocksuite/block-std": "npm:0.0.0-canary-20240903103812" "@blocksuite/affine-shared": "npm:0.0.0-canary-20240905130451"
"@blocksuite/blocks": "npm:0.0.0-canary-20240903103812" "@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/blocks": "npm:0.0.0-canary-20240905130451"
"@blocksuite/inline": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@blocksuite/inline": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240905130451"
"@floating-ui/dom": "npm:^1.6.10" "@floating-ui/dom": "npm:^1.6.10"
"@lit-labs/preact-signals": "npm:^1.0.2" "@lit-labs/preact-signals": "npm:^1.0.2"
"@lottiefiles/dotlottie-wc": "npm:^0.2.16" "@lottiefiles/dotlottie-wc": "npm:^0.2.16"
"@toeverything/theme": "npm:^1.0.7" "@toeverything/theme": "npm:^1.0.8"
lit: "npm:^3.2.0" lit: "npm:^3.2.0"
zod: "npm:^3.23.8" zod: "npm:^3.23.8"
checksum: 10/d423261a0d1a2af08f46f5a5fe24fd837e8531e0320a34ba6ae0e886ab6f7978dbfcf56bc6023f33450a85929ffd1e8f8ab8baf8a6d8d37b1c6e4937099ac820 checksum: 10/038f803d5c1d93472f7cd7e0151c6af41df6609f31bedfeea308416cd68a54efadbb98ad83c5271cc15cd0ce82dac632640b1c9490be342503c1e903005d0dad
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/store@npm:0.0.0-canary-20240903103812": "@blocksuite/store@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/store@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/store@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/inline": "npm:0.0.0-canary-20240903103812" "@blocksuite/inline": "npm:0.0.0-canary-20240905130451"
"@blocksuite/sync": "npm:0.0.0-canary-20240903103812" "@blocksuite/sync": "npm:0.0.0-canary-20240905130451"
"@preact/signals-core": "npm:^1.8.0" "@preact/signals-core": "npm:^1.8.0"
"@types/flexsearch": "npm:^0.7.6" "@types/flexsearch": "npm:^0.7.6"
"@types/lodash.ismatch": "npm:^4.4.9" "@types/lodash.ismatch": "npm:^4.4.9"
flexsearch: "npm:0.7.43" flexsearch: "npm:0.7.43"
lib0: "npm:^0.2.97" lib0: "npm:^0.2.97"
lodash.clonedeep: "npm:^4.5.0"
lodash.ismatch: "npm:^4.4.0" lodash.ismatch: "npm:^4.4.0"
lodash.merge: "npm:^4.6.2" lodash.merge: "npm:^4.6.2"
minimatch: "npm:^10.0.1" minimatch: "npm:^10.0.1"
@ -3709,21 +3738,21 @@ __metadata:
zod: "npm:^3.23.8" zod: "npm:^3.23.8"
peerDependencies: peerDependencies:
yjs: ^13.6.15 yjs: ^13.6.15
checksum: 10/7413af8c0ff893bd877a5e3283afe648a31837c7053d15ad2e7ca6a0a222f8e663fec25abef09a1e5373f393cb997ea9bf492e27ef1b9885b566fd6dd7ab58c1 checksum: 10/9a8cbb5c21a47537fb399791ae6e5af83b8daa956f0937341383c9822d7e06b750f793c0bb83c73dd6db9906ae74f5dd1ebe4670dfffa711e489e56c9ea6f3e8
languageName: node languageName: node
linkType: hard linkType: hard
"@blocksuite/sync@npm:0.0.0-canary-20240903103812": "@blocksuite/sync@npm:0.0.0-canary-20240905130451":
version: 0.0.0-canary-20240903103812 version: 0.0.0-canary-20240905130451
resolution: "@blocksuite/sync@npm:0.0.0-canary-20240903103812" resolution: "@blocksuite/sync@npm:0.0.0-canary-20240905130451"
dependencies: dependencies:
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
idb: "npm:^8.0.0" idb: "npm:^8.0.0"
idb-keyval: "npm:^6.2.1" idb-keyval: "npm:^6.2.1"
y-protocols: "npm:^1.0.6" y-protocols: "npm:^1.0.6"
peerDependencies: peerDependencies:
yjs: ^13.6.15 yjs: ^13.6.15
checksum: 10/082da90b4ede56a2474cbf6f94e23ca0bb0de050fde55ad1a41ad055738a0f5a5cf24cb27054c776072f1a73e46cfb0ffd9b1651a510490307b8e300cf3773f5 checksum: 10/d509650b33e8b940d70bbabd3b5066980e3a42ee99b4cff414a24e732c103f3f0692b041695ec38ae158e88f4ac6f0eb1a888de1b31b89e14c4c3be18ab2e194
languageName: node languageName: node
linkType: hard linkType: hard
@ -14156,11 +14185,11 @@ __metadata:
"@affine/debug": "workspace:*" "@affine/debug": "workspace:*"
"@affine/env": "workspace:*" "@affine/env": "workspace:*"
"@affine/templates": "workspace:*" "@affine/templates": "workspace:*"
"@blocksuite/block-std": "npm:0.0.0-canary-20240903103812" "@blocksuite/block-std": "npm:0.0.0-canary-20240905130451"
"@blocksuite/blocks": "npm:0.0.0-canary-20240903103812" "@blocksuite/blocks": "npm:0.0.0-canary-20240905130451"
"@blocksuite/global": "npm:0.0.0-canary-20240903103812" "@blocksuite/global": "npm:0.0.0-canary-20240905130451"
"@blocksuite/presets": "npm:0.0.0-canary-20240903103812" "@blocksuite/presets": "npm:0.0.0-canary-20240905130451"
"@blocksuite/store": "npm:0.0.0-canary-20240903103812" "@blocksuite/store": "npm:0.0.0-canary-20240905130451"
"@datastructures-js/binary-search-tree": "npm:^5.3.2" "@datastructures-js/binary-search-tree": "npm:^5.3.2"
"@testing-library/react": "npm:^16.0.0" "@testing-library/react": "npm:^16.0.0"
async-call-rpc: "npm:^6.4.0" async-call-rpc: "npm:^6.4.0"
@ -14203,7 +14232,7 @@ __metadata:
languageName: unknown languageName: unknown
linkType: soft linkType: soft
"@toeverything/theme@npm:^1.0.7": "@toeverything/theme@npm:^1.0.7, @toeverything/theme@npm:^1.0.8":
version: 1.0.8 version: 1.0.8
resolution: "@toeverything/theme@npm:1.0.8" resolution: "@toeverything/theme@npm:1.0.8"
checksum: 10/1cccf8a312625f0a9c2c92fa04af8aea1186385685c41b916d01b5f370fa5db216c51191d011e954e49d903526d98ef7f80812f4b38eda237d9d5f82b585c08b checksum: 10/1cccf8a312625f0a9c2c92fa04af8aea1186385685c41b916d01b5f370fa5db216c51191d011e954e49d903526d98ef7f80812f4b38eda237d9d5f82b585c08b
@ -22114,13 +22143,6 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"figma-squircle@npm:^0.3.1":
version: 0.3.1
resolution: "figma-squircle@npm:0.3.1"
checksum: 10/0a0c0965d96a5540cab444f476abac5b8b406fce7941128ad3bcefdbfbff0a613cce011f5377c39620dd96aeb0e57eab57b14c1cbb7eecab27bcf60e2d5beda7
languageName: node
linkType: hard
"figma-squircle@npm:^1.0.0": "figma-squircle@npm:^1.0.0":
version: 1.0.0 version: 1.0.0
resolution: "figma-squircle@npm:1.0.0" resolution: "figma-squircle@npm:1.0.0"
@ -26110,6 +26132,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"lodash.clonedeep@npm:^4.5.0":
version: 4.5.0
resolution: "lodash.clonedeep@npm:4.5.0"
checksum: 10/957ed243f84ba6791d4992d5c222ffffca339a3b79dbe81d2eaf0c90504160b500641c5a0f56e27630030b18b8e971ea10b44f928a977d5ced3c8948841b555f
languageName: node
linkType: hard
"lodash.curry@npm:^4.1.1": "lodash.curry@npm:^4.1.1":
version: 4.1.1 version: 4.1.1
resolution: "lodash.curry@npm:4.1.1" resolution: "lodash.curry@npm:4.1.1"