mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-03 18:40:00 +08:00
refactor(workspace): split workspace interface and implementation (#5463)
@affine/workspace -> (@affine/workspace, @affine/workspace-impl)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { DEFAULT_WORKSPACE_NAME } from '@affine/env/constant';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { workspaceManager } from '@affine/workspace';
|
||||
import { workspaceManager } from '@affine/workspace-impl';
|
||||
import { getCurrentStore } from '@toeverything/infra/atom';
|
||||
import {
|
||||
buildShowcaseWorkspace,
|
||||
|
||||
@@ -10,6 +10,7 @@ import { DebugLogger } from '@affine/debug';
|
||||
import { apis } from '@affine/electron-api';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { _addLocalWorkspace } from '@affine/workspace-impl';
|
||||
import { getCurrentStore } from '@toeverything/infra/atom';
|
||||
import {
|
||||
buildShowcaseWorkspace,
|
||||
@@ -119,7 +120,7 @@ export const CreateWorkspaceModal = ({
|
||||
setStep(undefined);
|
||||
const result = await apis.dialog.loadDBFile();
|
||||
if (result.workspaceId && !canceled) {
|
||||
workspaceManager._addLocalWorkspace(result.workspaceId);
|
||||
_addLocalWorkspace(result.workspaceId);
|
||||
onCreate(result.workspaceId);
|
||||
} else if (result.error || result.canceled) {
|
||||
if (result.error) {
|
||||
|
||||
@@ -7,10 +7,8 @@ import {
|
||||
listHistoryQuery,
|
||||
recoverDocMutation,
|
||||
} from '@affine/graphql';
|
||||
import {
|
||||
createAffineCloudBlobStorage,
|
||||
globalBlockSuiteSchema,
|
||||
} from '@affine/workspace';
|
||||
import { globalBlockSuiteSchema } from '@affine/workspace';
|
||||
import { createAffineCloudBlobStorage } from '@affine/workspace-impl';
|
||||
import { assertEquals } from '@blocksuite/global/utils';
|
||||
import { Workspace } from '@blocksuite/store';
|
||||
import { revertUpdate } from '@toeverything/y-indexeddb';
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import {
|
||||
type Workspace,
|
||||
workspaceManager,
|
||||
type WorkspaceMetadata,
|
||||
} from '@affine/workspace';
|
||||
import type { Workspace, WorkspaceMetadata } from '@affine/workspace';
|
||||
import { workspaceManager } from '@affine/workspace-impl';
|
||||
import { atom } from 'jotai';
|
||||
import { atomWithObservable } from 'jotai/utils';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { MainContainer } from '@affine/component/workspace';
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { fetchWithTraceReport } from '@affine/graphql';
|
||||
import { globalBlockSuiteSchema } from '@affine/workspace';
|
||||
import {
|
||||
createAffineCloudBlobStorage,
|
||||
createStaticBlobStorage,
|
||||
globalBlockSuiteSchema,
|
||||
} from '@affine/workspace';
|
||||
} from '@affine/workspace-impl';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { type Page, Workspace } from '@blocksuite/store';
|
||||
import { noop } from 'foxact/noop';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { pushNotificationAtom } from '@affine/component/notification-center';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { affine } from '@affine/electron-api';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { CLOUD_WORKSPACE_CHANGED_BROADCAST_CHANNEL_KEY } from '@affine/workspace';
|
||||
import { CLOUD_WORKSPACE_CHANGED_BROADCAST_CHANNEL_KEY } from '@affine/workspace-impl';
|
||||
import { useAtom, useSetAtom } from 'jotai';
|
||||
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
||||
import { SessionProvider, useSession } from 'next-auth/react';
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
TRACE_ID_BYTES,
|
||||
traceReporter,
|
||||
} from '@affine/graphql';
|
||||
import { CLOUD_WORKSPACE_CHANGED_BROADCAST_CHANNEL_KEY } from '@affine/workspace';
|
||||
import { CLOUD_WORKSPACE_CHANGED_BROADCAST_CHANNEL_KEY } from '@affine/workspace-impl';
|
||||
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
||||
import { signIn, signOut } from 'next-auth/react';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user