Skip to content

Commit

Permalink
chore: try bs-affine
Browse files Browse the repository at this point in the history
  • Loading branch information
Saul-Mirone committed Sep 19, 2024
1 parent fc9e5fb commit 6be857f
Show file tree
Hide file tree
Showing 222 changed files with 656 additions and 628 deletions.
3 changes: 1 addition & 2 deletions packages/common/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"private": true,
"type": "module",
"devDependencies": {
"@blocksuite/global": "0.17.13",
"@blocksuite/store": "0.17.13",
"@blocksuite/affine": "0.0.0-canary-20240919125746",
"vitest": "2.1.1"
},
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/env/src/constant.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file should has not side effect
import type { DocCollection } from '@blocksuite/store';
import type { DocCollection } from '@blocksuite/affine/store';

declare global {
// eslint-disable-next-line no-var
Expand Down
2 changes: 1 addition & 1 deletion packages/common/env/src/filter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DocCollection } from '@blocksuite/store';
import type { DocCollection } from '@blocksuite/affine/store';
import { z } from 'zod';

export const literalValueSchema: z.ZodType<LiteralValue, z.ZodTypeDef> =
Expand Down
2 changes: 0 additions & 2 deletions packages/common/env/src/global.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// <reference types="@blocksuite/global" />

import { UaHelper } from './ua-helper.js';

export type BUILD_CONFIG_TYPE = {
Expand Down
7 changes: 2 additions & 5 deletions packages/common/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
"@affine/debug": "workspace:*",
"@affine/env": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/blocks": "0.17.13",
"@blocksuite/global": "0.17.13",
"@blocksuite/presets": "0.17.13",
"@blocksuite/store": "0.17.13",
"@blocksuite/affine": "0.0.0-canary-20240919125746",
"@datastructures-js/binary-search-tree": "^5.3.2",
"foxact": "^0.2.33",
"fuse.js": "^7.0.0",
Expand All @@ -34,7 +31,7 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/presets": "0.17.13",
"@blocksuite/presets": "0.0.0-canary-20240919125746",
"@testing-library/react": "^16.0.0",
"fake-indexeddb": "^6.0.0",
"react": "^18.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Schema } from '@blocksuite/store';
import type { Schema } from '@blocksuite/affine/store';
import type { Array as YArray } from 'yjs';
import {
applyUpdate,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DocCollection } from '@blocksuite/store';
import type { DocCollection } from '@blocksuite/affine/store';
import type { Array as YArray, Doc as YDoc, Map as YMap } from 'yjs';

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/common/infra/src/initialization/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { SurfaceBlockProps } from '@blocksuite/block-std/gfx';
import type { SurfaceBlockProps } from '@blocksuite/affine/block-std/gfx';
import {
NoteDisplayMode,
type NoteProps,
type ParagraphProps,
type RootBlockProps,
} from '@blocksuite/blocks';
import { type Doc, Text } from '@blocksuite/store';
} from '@blocksuite/affine/blocks';
import { type Doc, Text } from '@blocksuite/affine/store';

export interface DocProps {
page?: Partial<RootBlockProps>;
Expand Down
2 changes: 1 addition & 1 deletion packages/common/infra/src/modules/doc/entities/doc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DocMode, RootBlockModel } from '@blocksuite/blocks';
import type { DocMode, RootBlockModel } from '@blocksuite/affine/blocks';

import { Entity } from '../../../framework';
import type { WorkspaceService } from '../../workspace';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DocMode } from '@blocksuite/blocks';
import type { DocMode } from '@blocksuite/affine/blocks';
import { map } from 'rxjs';

import { Entity } from '../../../framework';
Expand Down
4 changes: 2 additions & 2 deletions packages/common/infra/src/modules/doc/entities/record.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DocMode } from '@blocksuite/blocks';
import type { DocMeta } from '@blocksuite/store';
import type { DocMode } from '@blocksuite/affine/blocks';
import type { DocMeta } from '@blocksuite/affine/store';

import { Entity } from '../../../framework';
import { LiveData } from '../../../livedata';
Expand Down
2 changes: 1 addition & 1 deletion packages/common/infra/src/modules/doc/scopes/doc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Doc as BlockSuiteDoc } from '@blocksuite/store';
import type { Doc as BlockSuiteDoc } from '@blocksuite/affine/store';

import { Scope } from '../../../framework';
import type { DocRecord } from '../entities/record';
Expand Down
2 changes: 1 addition & 1 deletion packages/common/infra/src/modules/doc/services/docs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Unreachable } from '@affine/env/constant';
import { type DocMode } from '@blocksuite/blocks';
import { type DocMode } from '@blocksuite/affine/blocks';

import { Service } from '../../../framework';
import { type DocProps, initDocFromProps } from '../../../initialization';
Expand Down
4 changes: 2 additions & 2 deletions packages/common/infra/src/modules/doc/stores/docs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DocMode } from '@blocksuite/blocks';
import type { DocMeta } from '@blocksuite/store';
import type { DocMode } from '@blocksuite/affine/blocks';
import type { DocMeta } from '@blocksuite/affine/store';
import { isEqual } from 'lodash-es';
import { distinctUntilChanged, Observable } from 'rxjs';

Expand Down
1 change: 1 addition & 0 deletions packages/common/infra/src/modules/feature-flag/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { BlockSuiteFlags } from '@blocksuite/affine/global/types';
type FeedbackType = 'discord' | 'email' | 'github';

export type FlagInfo = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DocMode } from '@blocksuite/blocks';
import type { DocMode } from '@blocksuite/affine/blocks';

import { Entity } from '../../../framework';
import { LiveData } from '../../../livedata';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DocCollection } from '@blocksuite/store';
import { DocCollection } from '@blocksuite/affine/store';
import { nanoid } from 'nanoid';
import { Observable } from 'rxjs';
import type { Awareness } from 'y-protocols/awareness.js';
Expand Down
6 changes: 3 additions & 3 deletions packages/common/infra/src/modules/workspace/global-schema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AffineSchemas } from '@blocksuite/blocks/schemas';
import { AIChatBlockSchema } from '@blocksuite/presets';
import { Schema } from '@blocksuite/store';
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
import { AIChatBlockSchema } from '@blocksuite/affine/presets';
import { Schema } from '@blocksuite/affine/store';

let _schema: Schema | null = null;
export function getAFFiNEWorkspaceSchema() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { WorkspaceFlavour } from '@affine/env/workspace';
import type { DocCollection } from '@blocksuite/store';
import type { DocCollection } from '@blocksuite/affine/store';

import { createIdentifier } from '../../../framework';
import type { LiveData } from '../../../livedata';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Scope } from '../../../framework';
import type { WorkspaceOpenOptions } from '../open-options';
import type { WorkspaceEngineProvider } from '../providers/flavour';

export type { DocCollection } from '@blocksuite/store';
export type { DocCollection } from '@blocksuite/affine/store';

export class WorkspaceScope extends Scope<{
openOptions: WorkspaceOpenOptions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { WorkspaceFlavour } from '@affine/env/workspace';
import type { DocCollection } from '@blocksuite/store';
import type { DocCollection } from '@blocksuite/affine/store';

import { Service } from '../../../framework';
import type { BlobStorage, DocStorage } from '../../../sync';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WorkspaceFlavour } from '@affine/env/workspace';
import { assertEquals } from '@blocksuite/global/utils';
import { assertEquals } from '@blocksuite/affine/global/utils';
import { applyUpdate, encodeStateAsUpdate } from 'yjs';

import { Service } from '../../../framework';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WorkspaceFlavour } from '@affine/env/workspace';
import { DocCollection, nanoid } from '@blocksuite/store';
import { DocCollection, nanoid } from '@blocksuite/affine/store';
import { map } from 'rxjs';
import { applyUpdate, encodeStateAsUpdate } from 'yjs';

Expand Down
2 changes: 1 addition & 1 deletion packages/common/infra/src/sync/blob/blob.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DebugLogger } from '@affine/debug';
import { Slot } from '@blocksuite/global/utils';
import { Slot } from '@blocksuite/affine/global/utils';
import { difference } from 'lodash-es';

import { LiveData } from '../../livedata';
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/apps/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@affine/core": "workspace:*",
"@affine/i18n": "workspace:*",
"@affine/native": "workspace:*",
"@blocksuite/global": "0.17.13",
"@blocksuite/affine": "0.0.0-canary-20240919125746",
"@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 packages/frontend/apps/electron/src/helper/main-rpc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertExists } from '@blocksuite/global/utils';
import { assertExists } from '@blocksuite/affine/global/utils';
import { AsyncCall } from 'async-call-rpc';

import type { HelperToMain, MainToHelper } from '../shared/type';
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@affine/component": "workspace:*",
"@affine/core": "workspace:*",
"@affine/i18n": "workspace:*",
"@blocksuite/blocks": "0.17.13",
"@blocksuite/affine": "0.0.0-canary-20240919125746",
"@blocksuite/icons": "^2.1.67",
"@sentry/react": "^8.0.0",
"react": "^18.2.0",
Expand Down
9 changes: 3 additions & 6 deletions packages/frontend/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
"build:storybook": "storybook build"
},
"peerDependencies": {
"@blocksuite/blocks": "*",
"@blocksuite/global": "*",
"@blocksuite/icons": "2.1.67",
"@blocksuite/presets": "*",
"@blocksuite/store": "*"
"@blocksuite/affine": "*",
"@blocksuite/icons": "2.1.67"
},
"dependencies": {
"@affine/cli": "workspace:*",
Expand Down Expand Up @@ -63,7 +60,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@blocksuite/global": "0.17.13",
"@blocksuite/affine": "0.0.0-canary-20240919125746",
"@blocksuite/icons": "2.1.67",
"@chromatic-com/storybook": "^2.0.0",
"@storybook/addon-essentials": "^8.2.9",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertExists } from '@blocksuite/global/utils';
import { assertExists } from '@blocksuite/affine/global/utils';
import { assignInlineVars } from '@vanilla-extract/dynamic';
import clsx from 'clsx';
import {
Expand Down
7 changes: 1 addition & 6 deletions packages/frontend/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@
"@affine/i18n": "workspace:*",
"@affine/templates": "workspace:*",
"@affine/track": "workspace:*",
"@blocksuite/block-std": "0.17.13",
"@blocksuite/blocks": "0.17.13",
"@blocksuite/global": "0.17.13",
"@blocksuite/affine": "0.0.0-canary-20240919125746",
"@blocksuite/icons": "2.1.67",
"@blocksuite/inline": "0.17.13",
"@blocksuite/presets": "0.17.13",
"@blocksuite/store": "0.17.13",
"@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 @@ -3,13 +3,13 @@ import type {
BlockSelection,
EditorHost,
TextSelection,
} from '@blocksuite/block-std';
} from '@blocksuite/affine/block-std';
import type {
DocMode,
EdgelessRootService,
ImageSelection,
RootService,
} from '@blocksuite/blocks';
} from '@blocksuite/affine/blocks';
import {
BlocksUtils,
DocModeProvider,
Expand All @@ -18,14 +18,14 @@ import {
NotificationProvider,
RefNodeSlotsProvider,
TelemetryProvider,
} from '@blocksuite/blocks';
} from '@blocksuite/affine/blocks';
import {
Bound,
getElementsBound,
type SerializedXYWH,
} from '@blocksuite/global/utils';
import { type ChatMessage } from '@blocksuite/presets';
import type { Doc } from '@blocksuite/store';
} from '@blocksuite/affine/global/utils';
import { type ChatMessage } from '@blocksuite/affine/presets';
import type { Doc } from '@blocksuite/affine/store';
import type { TemplateResult } from 'lit';

import { AIProvider, type AIUserInfo } from '../provider';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import './ask-ai-panel';

import { type EditorHost } from '@blocksuite/block-std';
import { type EditorHost } from '@blocksuite/affine/block-std';
import {
type AIItemGroupConfig,
AIStarIcon,
EdgelessRootService,
} from '@blocksuite/blocks';
import { createLitPortal, HoverController } from '@blocksuite/blocks';
import { assertExists, WithDisposable } from '@blocksuite/global/utils';
} from '@blocksuite/affine/blocks';
import { createLitPortal, HoverController } from '@blocksuite/affine/blocks';
import { assertExists, WithDisposable } from '@blocksuite/affine/global/utils';
import { flip, offset } from '@floating-ui/dom';
import { css, html, LitElement, nothing } from 'lit';
import { property, query } from 'lit/decorators.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { type EditorHost } from '@blocksuite/block-std';
import { type EditorHost } from '@blocksuite/affine/block-std';
import {
type AIItemGroupConfig,
EdgelessRootService,
scrollbarStyle,
} from '@blocksuite/blocks';
import { WithDisposable } from '@blocksuite/global/utils';
} from '@blocksuite/affine/blocks';
import { WithDisposable } from '@blocksuite/affine/global/utils';
import { css, html, LitElement } from 'lit';
import { property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import type {
BlockSelection,
EditorHost,
TextSelection,
} from '@blocksuite/block-std';
import { type ImageSelection, NotificationProvider } from '@blocksuite/blocks';
} from '@blocksuite/affine/block-std';
import {
type ImageSelection,
NotificationProvider,
} from '@blocksuite/affine/blocks';
import { css, html, LitElement, nothing } from 'lit';
import { property } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import type {
BlockSelection,
EditorHost,
TextSelection,
} from '@blocksuite/block-std';
} from '@blocksuite/affine/block-std';
import {
createButtonPopper,
NotificationProvider,
Tooltip,
} from '@blocksuite/blocks';
import { noop, WithDisposable } from '@blocksuite/global/utils';
} from '@blocksuite/affine/blocks';
import { noop, WithDisposable } from '@blocksuite/affine/global/utils';
import { css, html, LitElement, nothing, type PropertyValues } from 'lit';
import { property, query, state } from 'lit/decorators.js';
import { repeat } from 'lit/directives/repeat.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import type { Chain, EditorHost, InitCommandCtx } from '@blocksuite/block-std';
import type {
Chain,
EditorHost,
InitCommandCtx,
} from '@blocksuite/affine/block-std';
import {
type AIItemGroupConfig,
type AISubItemConfig,
type CopilotSelectionController,
EDGELESS_ELEMENT_TOOLBAR_WIDGET,
type EdgelessElementToolbarWidget,
matchFlavours,
} from '@blocksuite/blocks';
} from '@blocksuite/affine/blocks';
import type { TemplateResult } from 'lit';

import { actionToHandler } from '../actions/doc-handler';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { EditorHost } from '@blocksuite/block-std';
import type { EditorHost } from '@blocksuite/affine/block-std';
import type {
AffineAIPanelWidget,
AffineAIPanelWidgetConfig,
AIError,
} from '@blocksuite/blocks';
import { assertExists } from '@blocksuite/global/utils';
} from '@blocksuite/affine/blocks';
import { assertExists } from '@blocksuite/affine/global/utils';
import type { TemplateResult } from 'lit';

import {
Expand Down
Loading

0 comments on commit 6be857f

Please sign in to comment.