Skip to content

Commit

Permalink
chore: bump bs (#7914)
Browse files Browse the repository at this point in the history
  • Loading branch information
Saul-Mirone committed Aug 20, 2024
1 parent 152815c commit 6b0c398
Show file tree
Hide file tree
Showing 20 changed files with 199 additions and 135 deletions.
4 changes: 2 additions & 2 deletions packages/common/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"private": true,
"type": "module",
"devDependencies": {
"@blocksuite/global": "0.17.0-canary-202408160752-cb4b196",
"@blocksuite/store": "0.17.0-canary-202408160752-cb4b196",
"@blocksuite/global": "0.17.0-canary-202408191538-1511d04",
"@blocksuite/store": "0.17.0-canary-202408191538-1511d04",
"react": "18.3.1",
"react-dom": "18.3.1",
"vitest": "1.6.0"
Expand Down
12 changes: 6 additions & 6 deletions packages/common/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"@affine/debug": "workspace:*",
"@affine/env": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/blocks": "0.17.0-canary-202408160752-cb4b196",
"@blocksuite/global": "0.17.0-canary-202408160752-cb4b196",
"@blocksuite/presets": "0.17.0-canary-202408160752-cb4b196",
"@blocksuite/store": "0.17.0-canary-202408160752-cb4b196",
"@blocksuite/blocks": "0.17.0-canary-202408191538-1511d04",
"@blocksuite/global": "0.17.0-canary-202408191538-1511d04",
"@blocksuite/presets": "0.17.0-canary-202408191538-1511d04",
"@blocksuite/store": "0.17.0-canary-202408191538-1511d04",
"@datastructures-js/binary-search-tree": "^5.3.2",
"foxact": "^0.2.33",
"fuse.js": "^7.0.0",
Expand All @@ -34,8 +34,8 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/block-std": "0.17.0-canary-202408160752-cb4b196",
"@blocksuite/presets": "0.17.0-canary-202408160752-cb4b196",
"@blocksuite/block-std": "0.17.0-canary-202408191538-1511d04",
"@blocksuite/presets": "0.17.0-canary-202408191538-1511d04",
"@testing-library/react": "^16.0.0",
"async-call-rpc": "^6.4.0",
"fake-indexeddb": "^6.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ export class Workspace extends Entity {
},
idGenerator: () => nanoid(),
schema: globalBlockSuiteSchema,
disableBacklinkIndex: true,
disableSearchIndex: true,
});
}
return this._docCollection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ export class TestingWorkspaceLocalProvider
blobSources: {
main: blobStorage,
},
disableBacklinkIndex: true,
disableSearchIndex: true,
});

// apply initial state
Expand Down Expand Up @@ -97,8 +95,6 @@ export class TestingWorkspaceLocalProvider
const bs = new DocCollection({
id,
schema: globalBlockSuiteSchema,
disableBacklinkIndex: true,
disableSearchIndex: true,
});

applyUpdate(bs.doc, data);
Expand Down
10 changes: 5 additions & 5 deletions packages/frontend/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions packages/frontend/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
);
Expand Down Expand Up @@ -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
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -58,10 +53,6 @@ const adapted = {
react: React,
elementClass: DocTitle,
}),
PageMetaTags: createReactComponentFromLit({
react: React,
elementClass: DocMetaTags,
}),
EdgelessEditor: createReactComponentFromLit({
react: React,
elementClass: EdgelessEditor,
Expand Down Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -65,7 +65,7 @@ export function createEdgelessRootBlockSpec(
): EdgelessRootBlockSpecType {
return {
...AIEdgelessRootBlockSpec,
service: withAffineRootService(EdgelessRootService),
service: withAffineRootService(EdgelessRootService as never),
config: {
linkedWidget: createLinkedWidgetConfig(framework),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ export class CloudWorkspaceFlavourProviderService
blobSources: {
main: blobStorage,
},
disableBacklinkIndex: true,
disableSearchIndex: true,
});

// apply initial state
Expand Down Expand Up @@ -212,8 +210,6 @@ export class CloudWorkspaceFlavourProviderService
const bs = new DocCollection({
id,
schema: globalBlockSuiteSchema,
disableBacklinkIndex: true,
disableSearchIndex: true,
});

if (localData) applyUpdate(bs.doc, localData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ export class LocalWorkspaceFlavourProvider
idGenerator: () => nanoid(),
schema: globalBlockSuiteSchema,
blobSources: { main: blobStorage },
disableBacklinkIndex: true,
disableSearchIndex: true,
});

// apply initial state
Expand Down Expand Up @@ -146,8 +144,6 @@ export class LocalWorkspaceFlavourProvider
const bs = new DocCollection({
id,
schema: globalBlockSuiteSchema,
disableBacklinkIndex: true,
disableSearchIndex: true,
});

if (localData) applyUpdate(bs.doc, localData);
Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tools/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@affine/env": "workspace:*",
"@affine/templates": "workspace:*",
"@aws-sdk/client-s3": "^3.620.0",
"@blocksuite/presets": "0.17.0-canary-202408160752-cb4b196",
"@blocksuite/presets": "0.17.0-canary-202408191538-1511d04",
"@clack/core": "^0.3.4",
"@clack/prompts": "^0.7.0",
"@magic-works/i18n-codegen": "^0.6.0",
Expand Down
Loading

0 comments on commit 6b0c398

Please sign in to comment.