mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
chore: bump bs (#7914)
This commit is contained in:
@@ -79,12 +79,12 @@
|
||||
"zod": "^3.22.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/block-std": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/blocks": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/global": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/block-std": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/blocks": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/global": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/icons": "2.1.62",
|
||||
"@blocksuite/presets": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/store": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/presets": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/store": "0.17.0-canary-202408191538-1511d04",
|
||||
"@chromatic-com/storybook": "^1",
|
||||
"@storybook/addon-actions": "^8.2.9",
|
||||
"@storybook/addon-essentials": "^8.2.9",
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
"@affine/graphql": "workspace:*",
|
||||
"@affine/i18n": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@blocksuite/block-std": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/blocks": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/global": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/block-std": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/blocks": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/global": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/icons": "2.1.62",
|
||||
"@blocksuite/inline": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/presets": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/store": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/inline": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/presets": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/store": "0.17.0-canary-202408191538-1511d04",
|
||||
"@dnd-kit/core": "^6.1.0",
|
||||
"@dnd-kit/modifiers": "^7.0.0",
|
||||
"@dnd-kit/sortable": "^8.0.0",
|
||||
|
||||
@@ -10,12 +10,12 @@ import type {
|
||||
ImageSelection,
|
||||
PageRootService,
|
||||
} from '@blocksuite/blocks';
|
||||
import { BlocksUtils, NoteDisplayMode } from '@blocksuite/blocks';
|
||||
import {
|
||||
BlocksUtils,
|
||||
Bound,
|
||||
getElementsBound,
|
||||
NoteDisplayMode,
|
||||
} from '@blocksuite/blocks';
|
||||
import { Bound, type SerializedXYWH } from '@blocksuite/global/utils';
|
||||
type SerializedXYWH,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { type ChatMessage } from '@blocksuite/presets';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import type { TemplateResult } from 'lit';
|
||||
@@ -304,7 +304,10 @@ const SAVE_CHAT_TO_BLOCK_ACTION: ChatAction = {
|
||||
const { docModeService, notificationService } = rootService;
|
||||
const { layer } = surfaceService;
|
||||
const curMode = docModeService.getMode();
|
||||
const viewportCenter = getViewportCenter(curMode, rootService);
|
||||
const viewportCenter = getViewportCenter(
|
||||
curMode,
|
||||
rootService as PageRootService
|
||||
);
|
||||
const newBlockIndex = layer.generateIndex('affine:embed-ai-chat');
|
||||
// If current mode is not edgeless, switch to edgeless mode first
|
||||
if (curMode !== 'edgeless') {
|
||||
|
||||
@@ -216,8 +216,6 @@ export class AISlidesRenderer extends WithDisposable(LitElement) {
|
||||
const collection = new DocCollection({
|
||||
schema,
|
||||
id: 'SLIDES_PREVIEW',
|
||||
disableBacklinkIndex: true,
|
||||
disableSearchIndex: true,
|
||||
});
|
||||
collection.meta.initialize();
|
||||
collection.start();
|
||||
|
||||
@@ -226,6 +226,7 @@ export class AIChatBlockPeekView extends LitElement {
|
||||
|
||||
const { doc } = this.host;
|
||||
const chatBlock = doc.getBlock(this.chatContext.currentChatBlockId);
|
||||
if (!chatBlock) return;
|
||||
|
||||
// Get fork session messages
|
||||
const { parentRootWorkspaceId, parentRootDocId } = this;
|
||||
@@ -278,7 +279,7 @@ export class AIChatBlockPeekView extends LitElement {
|
||||
|
||||
if (currentChatBlockId) {
|
||||
const edgelessService = this._rootService as EdgelessRootService;
|
||||
const chatBlock = doc.getBlock(currentChatBlockId).model;
|
||||
const chatBlock = doc.getBlock(currentChatBlockId)?.model;
|
||||
if (chatBlock) {
|
||||
const connectors = edgelessService.getConnectors(
|
||||
chatBlock as AIChatBlockModel
|
||||
|
||||
@@ -68,7 +68,10 @@ export function findNoteBlockModel(blockElement: BlockComponent) {
|
||||
if (matchFlavours(curBlock.model, ['affine:page', 'affine:surface'])) {
|
||||
return null;
|
||||
}
|
||||
curBlock = curBlock.parentBlock;
|
||||
if (!curBlock.parentComponent) {
|
||||
break;
|
||||
}
|
||||
curBlock = curBlock.parentComponent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,10 @@ import {
|
||||
const getNoteId = (blockElement: BlockComponent) => {
|
||||
let element = blockElement;
|
||||
while (element.flavour !== 'affine:note') {
|
||||
element = element.parentBlock;
|
||||
if (!element.parentComponent) {
|
||||
break;
|
||||
}
|
||||
element = element.parentComponent;
|
||||
}
|
||||
|
||||
return element.model.id;
|
||||
@@ -53,7 +56,8 @@ export const insert = async (
|
||||
selectBlock: BlockComponent,
|
||||
below: boolean = true
|
||||
) => {
|
||||
const blockParent = selectBlock.parentBlock;
|
||||
const blockParent = selectBlock.parentComponent;
|
||||
if (!blockParent) return;
|
||||
const index = blockParent.model.children.findIndex(
|
||||
model => model.id === selectBlock.model.id
|
||||
);
|
||||
@@ -94,7 +98,8 @@ export const replace = async (
|
||||
selectedModels: BlockModel[],
|
||||
textSelection?: TextSelection
|
||||
) => {
|
||||
const firstBlockParent = firstBlock.parentBlock;
|
||||
const firstBlockParent = firstBlock.parentComponent;
|
||||
if (!firstBlockParent) return;
|
||||
const firstIndex = firstBlockParent.model.children.findIndex(
|
||||
model => model.id === firstBlock.model.id
|
||||
);
|
||||
|
||||
@@ -189,8 +189,6 @@ export async function markDownToDoc(host: EditorHost, answer: string) {
|
||||
// Should not create a new doc in the original collection
|
||||
const collection = new DocCollection({
|
||||
schema,
|
||||
disableBacklinkIndex: true,
|
||||
disableSearchIndex: true,
|
||||
});
|
||||
collection.meta.initialize();
|
||||
const job = new Job({
|
||||
|
||||
@@ -109,8 +109,6 @@ const getOrCreateShellWorkspace = (workspaceId: string) => {
|
||||
main: blobStorage,
|
||||
},
|
||||
schema: globalBlockSuiteSchema,
|
||||
disableBacklinkIndex: true,
|
||||
disableSearchIndex: true,
|
||||
});
|
||||
docCollectionMap.set(workspaceId, docCollection);
|
||||
docCollection.doc.emit('sync', [true, docCollection.doc]);
|
||||
|
||||
@@ -7,12 +7,7 @@ import { useJournalInfoHelper } from '@affine/core/hooks/use-journal';
|
||||
import { PeekViewService } from '@affine/core/modules/peek-view';
|
||||
import { WorkbenchService } from '@affine/core/modules/workbench';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import {
|
||||
DocMetaTags,
|
||||
DocTitle,
|
||||
EdgelessEditor,
|
||||
PageEditor,
|
||||
} from '@blocksuite/presets';
|
||||
import { DocTitle, EdgelessEditor, PageEditor } from '@blocksuite/presets';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import {
|
||||
DocService,
|
||||
@@ -58,10 +53,6 @@ const adapted = {
|
||||
react: React,
|
||||
elementClass: DocTitle,
|
||||
}),
|
||||
PageMetaTags: createReactComponentFromLit({
|
||||
react: React,
|
||||
elementClass: DocMetaTags,
|
||||
}),
|
||||
EdgelessEditor: createReactComponentFromLit({
|
||||
react: React,
|
||||
elementClass: EdgelessEditor,
|
||||
@@ -207,7 +198,7 @@ export const BlocksuiteDocEditor = forwardRef<
|
||||
<div
|
||||
className={styles.docEditorGap}
|
||||
onClick={() => {
|
||||
docPage.std.spec.getService('affine:page').appendParagraph();
|
||||
docPage.std.command.exec('appendParagraph' as never, {});
|
||||
}}
|
||||
></div>
|
||||
) : null}
|
||||
|
||||
@@ -31,7 +31,7 @@ function customLoadFonts(service: RootService): void {
|
||||
}
|
||||
}
|
||||
|
||||
function withAffineRootService(Service: typeof RootService) {
|
||||
function withAffineRootService(Service: typeof PageRootService) {
|
||||
return class extends Service {
|
||||
override loadFonts(): void {
|
||||
customLoadFonts(this);
|
||||
@@ -65,7 +65,7 @@ export function createEdgelessRootBlockSpec(
|
||||
): EdgelessRootBlockSpecType {
|
||||
return {
|
||||
...AIEdgelessRootBlockSpec,
|
||||
service: withAffineRootService(EdgelessRootService),
|
||||
service: withAffineRootService(EdgelessRootService as never),
|
||||
config: {
|
||||
linkedWidget: createLinkedWidgetConfig(framework),
|
||||
},
|
||||
|
||||
@@ -100,8 +100,6 @@ export class CloudWorkspaceFlavourProviderService
|
||||
blobSources: {
|
||||
main: blobStorage,
|
||||
},
|
||||
disableBacklinkIndex: true,
|
||||
disableSearchIndex: true,
|
||||
});
|
||||
|
||||
// apply initial state
|
||||
@@ -212,8 +210,6 @@ export class CloudWorkspaceFlavourProviderService
|
||||
const bs = new DocCollection({
|
||||
id,
|
||||
schema: globalBlockSuiteSchema,
|
||||
disableBacklinkIndex: true,
|
||||
disableSearchIndex: true,
|
||||
});
|
||||
|
||||
if (localData) applyUpdate(bs.doc, localData);
|
||||
|
||||
@@ -72,8 +72,6 @@ export class LocalWorkspaceFlavourProvider
|
||||
idGenerator: () => nanoid(),
|
||||
schema: globalBlockSuiteSchema,
|
||||
blobSources: { main: blobStorage },
|
||||
disableBacklinkIndex: true,
|
||||
disableSearchIndex: true,
|
||||
});
|
||||
|
||||
// apply initial state
|
||||
@@ -146,8 +144,6 @@ export class LocalWorkspaceFlavourProvider
|
||||
const bs = new DocCollection({
|
||||
id,
|
||||
schema: globalBlockSuiteSchema,
|
||||
disableBacklinkIndex: true,
|
||||
disableSearchIndex: true,
|
||||
});
|
||||
|
||||
if (localData) applyUpdate(bs.doc, localData);
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
"@affine/env": "workspace:*",
|
||||
"@affine/i18n": "workspace:*",
|
||||
"@affine/native": "workspace:*",
|
||||
"@blocksuite/block-std": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/blocks": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/presets": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/store": "0.17.0-canary-202408160752-cb4b196",
|
||||
"@blocksuite/block-std": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/blocks": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/presets": "0.17.0-canary-202408191538-1511d04",
|
||||
"@blocksuite/store": "0.17.0-canary-202408191538-1511d04",
|
||||
"@electron-forge/cli": "^7.3.0",
|
||||
"@electron-forge/core": "^7.3.0",
|
||||
"@electron-forge/core-utils": "^7.3.0",
|
||||
|
||||
Reference in New Issue
Block a user