mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
feat: migrate to blocksuite/affine (#8332)
Use `@blocksuite/affine` package for all blocksuite features in affine. ```ts @blocksuite/store -> @blocksuite/affine/store @blocksuite/global -> @blocksuite/affine/global @blocksuite/block-std -> @blocksuite/affine/block-std @blocksuite/blocks -> @blocksuite/affine/blocks @blocksuite/presets -> @blocksuite/affine/presets ```
This commit is contained in:
@@ -4,8 +4,8 @@ import { DebugLogger } from '@affine/debug';
|
||||
import type { ListHistoryQuery } from '@affine/graphql';
|
||||
import { listHistoryQuery, recoverDocMutation } from '@affine/graphql';
|
||||
import { i18nTime } from '@affine/i18n';
|
||||
import { assertEquals } from '@blocksuite/global/utils';
|
||||
import { DocCollection } from '@blocksuite/store';
|
||||
import { assertEquals } from '@blocksuite/affine/global/utils';
|
||||
import { DocCollection } from '@blocksuite/affine/store';
|
||||
import { getAFFiNEWorkspaceSchema } from '@toeverything/infra';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import useSWRImmutable from 'swr/immutable';
|
||||
|
||||
@@ -9,9 +9,12 @@ import { WorkspacePermissionService } from '@affine/core/modules/permissions';
|
||||
import { WorkspaceQuotaService } from '@affine/core/modules/quota';
|
||||
import { i18nTime, Trans, useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type {
|
||||
Doc as BlockSuiteDoc,
|
||||
DocCollection,
|
||||
} from '@blocksuite/affine/store';
|
||||
import { CloseIcon, ToggleCollapseIcon } from '@blocksuite/icons/rc';
|
||||
import type { Doc as BlockSuiteDoc, DocCollection } from '@blocksuite/store';
|
||||
import * as Collapsible from '@radix-ui/react-collapsible';
|
||||
import type { DialogContentProps } from '@radix-ui/react-dialog';
|
||||
import { useLiveData, useService, WorkspaceService } from '@toeverything/infra';
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
} from '@affine/core/modules/properties/services/schema';
|
||||
import { i18nTime, useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import {
|
||||
ArrowDownSmallIcon,
|
||||
DeleteIcon,
|
||||
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
import { WorkbenchLink } from '@affine/core/modules/workbench';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocCollection } from '@blocksuite/affine/store';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { nanoid } from 'nanoid';
|
||||
import {
|
||||
|
||||
@@ -19,8 +19,8 @@ import {
|
||||
PointStyle,
|
||||
StrokeStyle,
|
||||
TextAlign,
|
||||
} from '@blocksuite/blocks';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import { useFramework, useLiveData } from '@toeverything/infra';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AffineSchemas } from '@blocksuite/blocks';
|
||||
import type { Doc, DocSnapshot } from '@blocksuite/store';
|
||||
import { DocCollection, Job, Schema } from '@blocksuite/store';
|
||||
import { AffineSchemas } from '@blocksuite/affine/blocks';
|
||||
import type { Doc, DocSnapshot } from '@blocksuite/affine/store';
|
||||
import { DocCollection, Job, Schema } from '@blocksuite/affine/store';
|
||||
|
||||
const getCollection = (() => {
|
||||
let collection: DocCollection | null = null;
|
||||
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
import { SettingRow } from '@affine/component/setting-components';
|
||||
import { EditorSettingService } from '@affine/core/modules/editor-settting';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { LayoutType, MindmapStyle } from '@blocksuite/blocks';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import { LayoutType, MindmapStyle } from '@blocksuite/affine/blocks';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import { useFramework, useLiveData } from '@toeverything/infra';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ import {
|
||||
NoteShadow,
|
||||
NoteShadowMap,
|
||||
StrokeStyle,
|
||||
} from '@blocksuite/blocks';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import { useFramework, useLiveData } from '@toeverything/infra';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { MenuItem, MenuTrigger, Slider } from '@affine/component';
|
||||
import { SettingRow } from '@affine/component/setting-components';
|
||||
import { EditorSettingService } from '@affine/core/modules/editor-settting';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { LineColor, LineColorMap } from '@blocksuite/blocks';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import { LineColor, LineColorMap } from '@blocksuite/affine/blocks';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import { useFramework, useLiveData } from '@toeverything/infra';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ import {
|
||||
import { SettingRow } from '@affine/component/setting-components';
|
||||
import { EditorSettingService } from '@affine/core/modules/editor-settting';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { EditorHost } from '@blocksuite/block-std';
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import type {
|
||||
EdgelessRootService,
|
||||
ShapeElementModel,
|
||||
ShapeName,
|
||||
} from '@blocksuite/blocks';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
createEnumMap,
|
||||
FontFamily,
|
||||
@@ -28,8 +28,8 @@ import {
|
||||
ShapeType,
|
||||
StrokeStyle,
|
||||
TextAlign,
|
||||
} from '@blocksuite/blocks';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import { useFramework, useLiveData } from '@toeverything/infra';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Skeleton } from '@affine/component';
|
||||
import type { EditorSettingSchema } from '@affine/core/modules/editor-settting';
|
||||
import { EditorSettingService } from '@affine/core/modules/editor-settting';
|
||||
import type { EditorHost } from '@blocksuite/block-std';
|
||||
import { BlockStdScope } from '@blocksuite/block-std';
|
||||
import type { GfxPrimitiveElementModel } from '@blocksuite/block-std/gfx';
|
||||
import type { EdgelessRootService } from '@blocksuite/blocks';
|
||||
import { SpecProvider } from '@blocksuite/blocks';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import type { Block, Doc } from '@blocksuite/store';
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import { BlockStdScope } from '@blocksuite/affine/block-std';
|
||||
import type { GfxPrimitiveElementModel } from '@blocksuite/affine/block-std/gfx';
|
||||
import type { EdgelessRootService } from '@blocksuite/affine/blocks';
|
||||
import { SpecProvider } from '@blocksuite/affine/blocks';
|
||||
import { Bound } from '@blocksuite/affine/global/utils';
|
||||
import type { Block, Doc } from '@blocksuite/affine/store';
|
||||
import { useFramework } from '@toeverything/infra';
|
||||
import { isEqual } from 'lodash-es';
|
||||
import { useCallback, useEffect, useRef } from 'react';
|
||||
|
||||
@@ -15,8 +15,8 @@ import {
|
||||
LineColor,
|
||||
LineColorMap,
|
||||
TextAlign,
|
||||
} from '@blocksuite/blocks';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import { useFramework, useLiveData } from '@toeverything/infra';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { SurfaceBlockModel } from '@blocksuite/block-std/gfx';
|
||||
import type { FrameBlockModel } from '@blocksuite/blocks';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import type { SurfaceBlockModel } from '@blocksuite/affine/block-std/gfx';
|
||||
import type { FrameBlockModel } from '@blocksuite/affine/blocks';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
|
||||
export function getSurfaceBlock(doc: Doc) {
|
||||
const blocks = doc.getBlocksByFlavour('affine:surface');
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
SystemFontFamilyService,
|
||||
} from '@affine/core/modules/system-font-family';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import { DoneIcon, SearchIcon } from '@blocksuite/icons/rc';
|
||||
import {
|
||||
FeatureFlagService,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FontWeight } from '@blocksuite/blocks';
|
||||
import { FontWeight } from '@blocksuite/affine/blocks';
|
||||
import { useTheme } from 'next-themes';
|
||||
|
||||
function getColorFromMap(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEnableCloud } from '@affine/core/components/hooks/affine/use-enable-cloud';
|
||||
import { track } from '@affine/track';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import { type Workspace } from '@toeverything/infra';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import { Menu } from '@affine/component/ui/menu';
|
||||
import { ShareInfoService } from '@affine/core/modules/share-doc';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import { LockIcon, PublishIcon } from '@blocksuite/icons/rc';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import {
|
||||
useLiveData,
|
||||
useService,
|
||||
|
||||
@@ -15,7 +15,7 @@ import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { PublicPageMode } from '@affine/graphql';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
BlockIcon,
|
||||
CollaborationIcon,
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
GeneralNetworkError,
|
||||
PaymentRequiredError,
|
||||
UnauthorizedError,
|
||||
} from '@blocksuite/blocks';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { getCurrentStore } from '@toeverything/infra';
|
||||
|
||||
type OptionsField<T extends GraphQLQuery> =
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets/ai';
|
||||
import type { ForkChatSessionInput } from '@affine/graphql';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import { partition } from 'lodash-es';
|
||||
|
||||
import { CopilotClient } from './copilot-client';
|
||||
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
type RequestOptions,
|
||||
} from '@affine/graphql';
|
||||
import { track } from '@affine/track';
|
||||
import { UnauthorizedError } from '@blocksuite/blocks';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { UnauthorizedError } from '@blocksuite/affine/blocks';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import { getCurrentStore } from '@toeverything/infra';
|
||||
import { z } from 'zod';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets/ai';
|
||||
import { mixpanel, track } from '@affine/track';
|
||||
import type { EditorHost } from '@blocksuite/block-std';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import type { BlockModel } from '@blocksuite/affine/store';
|
||||
import { lowerCase, omit } from 'lodash-es';
|
||||
|
||||
type ElementModel = BlockSuite.SurfaceElementModel;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type {
|
||||
AffineEditorContainer,
|
||||
DocTitle,
|
||||
EdgelessEditor,
|
||||
PageEditor,
|
||||
} from '@blocksuite/presets';
|
||||
import { type Doc, Slot } from '@blocksuite/store';
|
||||
} from '@blocksuite/affine/presets';
|
||||
import { type Doc, Slot } from '@blocksuite/affine/store';
|
||||
import clsx from 'clsx';
|
||||
import type React from 'react';
|
||||
import {
|
||||
|
||||
@@ -8,10 +8,10 @@ import {
|
||||
EmbedLoomBlockService,
|
||||
EmbedYoutubeBlockService,
|
||||
ImageBlockService,
|
||||
} from '@blocksuite/blocks';
|
||||
import { DisposableGroup } from '@blocksuite/global/utils';
|
||||
import type { AffineEditorContainer } from '@blocksuite/presets';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { DisposableGroup } from '@blocksuite/affine/global/utils';
|
||||
import type { AffineEditorContainer } from '@blocksuite/affine/presets';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import { use } from 'foxact/use';
|
||||
import type { CSSProperties } from 'react';
|
||||
import { Suspense, useEffect } from 'react';
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { registerAICustomComponents } from '@affine/core/blocksuite/presets/ai';
|
||||
import { effects as blocksEffects } from '@blocksuite/blocks/effects';
|
||||
import { effects as presetsEffects } from '@blocksuite/presets/effects';
|
||||
import { effects as bsEffects } from '@blocksuite/affine/effects';
|
||||
|
||||
import { setupAIProvider } from './ai/setup-provider';
|
||||
import { effects as edgelessEffects } from './specs/edgeless';
|
||||
import { effects as patchEffects } from './specs/preview';
|
||||
|
||||
blocksEffects();
|
||||
presetsEffects();
|
||||
bsEffects();
|
||||
patchEffects();
|
||||
setupAIProvider();
|
||||
edgelessEffects();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useJournalInfoHelper } from '@affine/core/components/hooks/use-journal';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
|
||||
import * as styles from './styles.css';
|
||||
|
||||
|
||||
@@ -8,9 +8,13 @@ import { EditorService } from '@affine/core/modules/editor';
|
||||
import { EditorSettingService } from '@affine/core/modules/editor-settting';
|
||||
import { toURLSearchParams } from '@affine/core/modules/navigation';
|
||||
import { PeekViewService } from '@affine/core/modules/peek-view';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import { DocTitle, EdgelessEditor, PageEditor } from '@blocksuite/presets';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
DocTitle,
|
||||
EdgelessEditor,
|
||||
PageEditor,
|
||||
} from '@blocksuite/affine/presets';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import {
|
||||
DocService,
|
||||
DocsService,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import type { Map as YMap } from 'yjs';
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
AIImageBlockSpec,
|
||||
AIParagraphBlockSpec,
|
||||
} from '@affine/core/blocksuite/presets/ai';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import type { ExtensionType } from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
BookmarkBlockSpec,
|
||||
CodeBlockSpec,
|
||||
@@ -24,8 +24,8 @@ import {
|
||||
ParagraphBlockSpec,
|
||||
RefNodeSlotsExtension,
|
||||
RichTextExtensions,
|
||||
} from '@blocksuite/blocks';
|
||||
import { AIChatBlockSpec } from '@blocksuite/presets';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { AIChatBlockSpec } from '@blocksuite/affine/presets';
|
||||
|
||||
import { CustomAttachmentBlockSpec } from './custom/attachment-block';
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ import {
|
||||
BlockServiceIdentifier,
|
||||
type ExtensionType,
|
||||
StdIdentifier,
|
||||
} from '@blocksuite/block-std';
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
AttachmentBlockService,
|
||||
AttachmentBlockSpec,
|
||||
} from '@blocksuite/blocks';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import bytes from 'bytes';
|
||||
|
||||
class CustomAttachmentBlockService extends AttachmentBlockService {
|
||||
|
||||
@@ -7,7 +7,10 @@ import { getAffineCloudBaseUrl } from '@affine/core/modules/cloud/services/fetch
|
||||
import { EditorService } from '@affine/core/modules/editor';
|
||||
import { I18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { DatabaseBlockModel, MenuOptions } from '@blocksuite/blocks';
|
||||
import type {
|
||||
DatabaseBlockModel,
|
||||
MenuOptions,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { LinkIcon } from '@blocksuite/icons/lit';
|
||||
import type { FrameworkProvider } from '@toeverything/infra';
|
||||
import type { TemplateResult } from 'lit';
|
||||
|
||||
@@ -4,14 +4,20 @@ import {
|
||||
} from '@affine/core/blocksuite/presets/ai';
|
||||
import { EditorSettingService } from '@affine/core/modules/editor-settting';
|
||||
import { mixpanel } from '@affine/track';
|
||||
import { ConfigExtension, type ExtensionType } from '@blocksuite/block-std';
|
||||
import {
|
||||
ConfigExtension,
|
||||
type ExtensionType,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
EdgelessRootBlockSpec,
|
||||
EditorSettingExtension,
|
||||
FontLoaderService,
|
||||
PageRootBlockSpec,
|
||||
} from '@blocksuite/blocks';
|
||||
import { type TelemetryEventMap, TelemetryProvider } from '@blocksuite/blocks';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
type TelemetryEventMap,
|
||||
TelemetryProvider,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { type FrameworkProvider } from '@toeverything/infra';
|
||||
|
||||
import { getFontConfigExtension } from '../font-extension';
|
||||
|
||||
@@ -27,15 +27,15 @@ import {
|
||||
BlockViewIdentifier,
|
||||
type ExtensionType,
|
||||
type WidgetComponent,
|
||||
} from '@blocksuite/block-std';
|
||||
import { BlockServiceWatcher } from '@blocksuite/block-std';
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import { BlockServiceWatcher } from '@blocksuite/affine/block-std';
|
||||
import type {
|
||||
AffineReference,
|
||||
DocMode,
|
||||
DocModeProvider,
|
||||
QuickSearchResult,
|
||||
RootService,
|
||||
} from '@blocksuite/blocks';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
AffineSlashMenuWidget,
|
||||
DocModeExtension,
|
||||
@@ -46,9 +46,9 @@ import {
|
||||
PeekViewExtension,
|
||||
QuickSearchExtension,
|
||||
ReferenceNodeConfigExtension,
|
||||
} from '@blocksuite/blocks';
|
||||
import { AIChatBlockSchema } from '@blocksuite/presets';
|
||||
import { type BlockSnapshot, Text } from '@blocksuite/store';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { AIChatBlockSchema } from '@blocksuite/affine/presets';
|
||||
import { type BlockSnapshot, Text } from '@blocksuite/affine/store';
|
||||
import {
|
||||
type DocProps,
|
||||
type DocService,
|
||||
|
||||
@@ -2,10 +2,10 @@ import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta';
|
||||
import { WorkspacePropertiesAdapter } from '@affine/core/modules/properties';
|
||||
import { I18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { EditorHost } from '@blocksuite/block-std';
|
||||
import type { AffineInlineEditor } from '@blocksuite/blocks';
|
||||
import { LinkedWidgetUtils } from '@blocksuite/blocks';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import type { AffineInlineEditor } from '@blocksuite/affine/blocks';
|
||||
import { LinkedWidgetUtils } from '@blocksuite/affine/blocks';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { type FrameworkProvider, WorkspaceService } from '@toeverything/infra';
|
||||
|
||||
// TODO: fix the type
|
||||
|
||||
@@ -7,12 +7,12 @@ import { getAffineCloudBaseUrl } from '@affine/core/modules/cloud/services/fetch
|
||||
import { EditorService } from '@affine/core/modules/editor';
|
||||
import { I18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { MenuItemGroup } from '@blocksuite/affine-components/toolbar';
|
||||
import type {
|
||||
GfxBlockElementModel,
|
||||
GfxPrimitiveElementModel,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import type { MenuContext } from '@blocksuite/blocks';
|
||||
} from '@blocksuite/affine/block-std/gfx';
|
||||
import type { MenuContext } from '@blocksuite/affine/blocks';
|
||||
import type { MenuItemGroup } from '@blocksuite/affine-components/toolbar';
|
||||
import { LinkIcon } from '@blocksuite/icons/lit';
|
||||
import type { FrameworkProvider } from '@toeverything/infra';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { builtInTemplates as builtInEdgelessTemplates } from '@affine/templates/edgeless';
|
||||
import { builtInTemplates as builtInStickersTemplates } from '@affine/templates/stickers';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import type { TemplateManager } from '@blocksuite/blocks';
|
||||
import type { ExtensionType } from '@blocksuite/affine/block-std';
|
||||
import type { TemplateManager } from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
EdgelessNoteBlockSpec,
|
||||
EdgelessSurfaceBlockSpec,
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
EdgelessTemplatePanel,
|
||||
EdgelessTextBlockSpec,
|
||||
FrameBlockSpec,
|
||||
} from '@blocksuite/blocks';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { FrameworkProvider } from '@toeverything/infra';
|
||||
|
||||
import { AIBlockSpecs, DefaultBlockSpecs } from './common';
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { AffineCanvasTextFonts, FontConfigExtension } from '@blocksuite/blocks';
|
||||
import {
|
||||
AffineCanvasTextFonts,
|
||||
FontConfigExtension,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
|
||||
export function getFontConfigExtension() {
|
||||
return FontConfigExtension(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import type { ExtensionType } from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
NoteBlockSpec,
|
||||
PageSurfaceBlockSpec,
|
||||
PageSurfaceRefBlockSpec,
|
||||
} from '@blocksuite/blocks';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { type FrameworkProvider } from '@toeverything/infra';
|
||||
|
||||
import { AIBlockSpecs, DefaultBlockSpecs } from './common';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { SpecProvider } from '@blocksuite/blocks';
|
||||
import { AIChatBlockSpec } from '@blocksuite/presets';
|
||||
import type { ExtensionType } from '@blocksuite/affine/block-std';
|
||||
import { SpecProvider } from '@blocksuite/affine/blocks';
|
||||
import { AIChatBlockSpec } from '@blocksuite/affine/presets';
|
||||
|
||||
import { getFontConfigExtension } from './font-extension';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
useJournalInfoHelper,
|
||||
useJournalRouteHelper,
|
||||
} from '@affine/core/components/hooks/use-journal';
|
||||
import type { Doc, DocCollection } from '@blocksuite/store';
|
||||
import type { Doc, DocCollection } from '@blocksuite/affine/store';
|
||||
import dayjs from 'dayjs';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Button } from '@affine/component';
|
||||
import { useJournalRouteHelper } from '@affine/core/components/hooks/use-journal';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import type { DocCollection } from '@blocksuite/affine/store';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
export interface JournalTodayButtonProps {
|
||||
|
||||
@@ -26,6 +26,7 @@ import { ViewService } from '@affine/core/modules/workbench/services/view';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import {
|
||||
DuplicateIcon,
|
||||
EdgelessIcon,
|
||||
@@ -41,7 +42,6 @@ import {
|
||||
SplitViewIcon,
|
||||
TocIcon,
|
||||
} from '@blocksuite/icons/rc';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import { useLiveData, useService, WorkspaceService } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { registerAffineCommand } from '@affine/core/commands';
|
||||
import { EditorService } from '@affine/core/modules/editor';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import { EdgelessIcon, PageIcon } from '@blocksuite/icons/rc';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { useCallback, useEffect, useMemo } from 'react';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { toast } from '@affine/component';
|
||||
import { EditorSettingService } from '@affine/core/modules/editor-settting';
|
||||
import { WorkbenchService } from '@affine/core/modules/workbench';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocCollection } from '@blocksuite/affine/store';
|
||||
import { type DocProps, DocsService, useServices } from '@toeverything/infra';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
@@ -43,7 +43,7 @@ export const usePageHelper = (docCollection: DocCollection) => {
|
||||
|
||||
const importFileAndOpen = useMemo(
|
||||
() => async () => {
|
||||
const { showImportModal } = await import('@blocksuite/blocks');
|
||||
const { showImportModal } = await import('@blocksuite/affine/blocks');
|
||||
const { promise, resolve, reject } =
|
||||
Promise.withResolvers<
|
||||
Parameters<
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { AffineEditorContainer } from '@blocksuite/presets';
|
||||
import { OutlineViewer } from '@blocksuite/presets';
|
||||
import type { AffineEditorContainer } from '@blocksuite/affine/presets';
|
||||
import { OutlineViewer } from '@blocksuite/affine/presets';
|
||||
import { useCallback, useRef } from 'react';
|
||||
|
||||
import * as styles from './outline-viewer.css';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AuthService } from '@affine/core/modules/cloud';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
|
||||
import { ImportTemplateButton } from './import-template';
|
||||
|
||||
@@ -6,7 +6,7 @@ import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/properties'
|
||||
import { ShareDocsListService } from '@affine/core/modules/share-doc';
|
||||
import { PublicPageMode } from '@affine/graphql';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { useLiveData, useService, WorkspaceService } from '@toeverything/infra';
|
||||
import { useCallback, useEffect, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
||||
import { useDocMetaHelper } from '@affine/core/components/hooks/use-block-suite-page-meta';
|
||||
import { useDocCollectionHelper } from '@affine/core/components/hooks/use-block-suite-workspace-helper';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import { DocsService, useService, WorkspaceService } from '@toeverything/infra';
|
||||
import { useCallback } from 'react';
|
||||
import { applyUpdate, encodeStateAsUpdate } from 'yjs';
|
||||
|
||||
@@ -11,9 +11,9 @@ import {
|
||||
HtmlTransformer,
|
||||
MarkdownTransformer,
|
||||
printToPdf,
|
||||
} from '@blocksuite/blocks';
|
||||
import type { AffineEditorContainer } from '@blocksuite/presets';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { AffineEditorContainer } from '@blocksuite/affine/presets';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import type { DocCollection } from '@blocksuite/affine/store';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
export function useReferenceLinkHelper(docCollection: DocCollection) {
|
||||
|
||||
@@ -3,9 +3,9 @@ import { getAffineCloudBaseUrl } from '@affine/core/modules/cloud/services/fetch
|
||||
import { toURLSearchParams } from '@affine/core/modules/navigation';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import { type EditorHost } from '@blocksuite/block-std';
|
||||
import { GfxBlockElementModel } from '@blocksuite/block-std/gfx';
|
||||
import type { DocMode, EdgelessRootService } from '@blocksuite/blocks';
|
||||
import { type EditorHost } from '@blocksuite/affine/block-std';
|
||||
import { GfxBlockElementModel } from '@blocksuite/affine/block-std/gfx';
|
||||
import type { DocMode, EdgelessRootService } from '@blocksuite/affine/blocks';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
export type UseSharingUrl = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/store';
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/affine/store';
|
||||
import type { Atom } from 'jotai';
|
||||
import { atom, useAtomValue } from 'jotai';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { apis } from '@affine/electron-api';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import type { AppConfigSchema } from '@toeverything/infra';
|
||||
import { AppConfigStorage, defaultAppConfig } from '@toeverything/infra';
|
||||
import type { Dispatch } from 'react';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { AffineEditorContainer } from '@blocksuite/presets';
|
||||
import type { AffineEditorContainer } from '@blocksuite/affine/presets';
|
||||
import type { SetStateAction } from 'jotai';
|
||||
import { atom, useAtom } from 'jotai';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/store';
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/affine/store';
|
||||
import { DocsService, useService, WorkspaceService } from '@toeverything/infra';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Doc, DocCollection } from '@blocksuite/store';
|
||||
import type { Doc, DocCollection } from '@blocksuite/affine/store';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
export function useDocCollectionHelper(docCollection: DocCollection) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import type { DocCollection } from '@blocksuite/affine/store';
|
||||
import type { Atom } from 'jotai';
|
||||
import { atom, useAtomValue } from 'jotai';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { DisposableGroup } from '@blocksuite/global/utils';
|
||||
import type { Doc, DocCollection } from '@blocksuite/store';
|
||||
import { DisposableGroup } from '@blocksuite/affine/global/utils';
|
||||
import type { Doc, DocCollection } from '@blocksuite/affine/store';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
const logger = new DebugLogger('use-doc-collection-page');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { EditorSettingService } from '@affine/core/modules/editor-settting';
|
||||
import { i18nTime } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import { type DocCollection, Text } from '@blocksuite/store';
|
||||
import { type DocCollection, Text } from '@blocksuite/affine/store';
|
||||
import {
|
||||
type DocProps,
|
||||
DocsService,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { toURLSearchParams } from '@affine/core/modules/navigation';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import { createContext, useCallback, useContext, useMemo } from 'react';
|
||||
import type { NavigateFunction, NavigateOptions } from 'react-router-dom';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { AffineEditorContainer } from '@blocksuite/presets';
|
||||
import type { AffineEditorContainer } from '@blocksuite/affine/presets';
|
||||
import { useService, WorkspaceService } from '@toeverything/infra';
|
||||
import { useStore } from 'jotai';
|
||||
import { useTheme } from 'next-themes';
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
resolveGlobalLoadingEventAtom,
|
||||
} from '@affine/component/global-loading';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { type DocMode, ZipTransformer } from '@blocksuite/blocks';
|
||||
import { type DocMode, ZipTransformer } from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
DocsService,
|
||||
effect,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import './page-detail-editor.css';
|
||||
|
||||
import type { AffineEditorContainer } from '@blocksuite/presets';
|
||||
import type { AffineEditorContainer } from '@blocksuite/affine/presets';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { cssVar } from '@toeverything/theme';
|
||||
import clsx from 'clsx';
|
||||
|
||||
@@ -11,7 +11,7 @@ import type {
|
||||
VariableMap,
|
||||
} from '@affine/env/filter';
|
||||
import { createI18n, I18nextProvider } from '@affine/i18n';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import { render } from '@testing-library/react';
|
||||
import type { ReactElement } from 'react';
|
||||
import { useState } from 'react';
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
*/
|
||||
import 'fake-indexeddb/auto';
|
||||
|
||||
import { AffineSchemas } from '@blocksuite/blocks/schemas';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import { DocCollection, Schema } from '@blocksuite/store';
|
||||
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import { DocCollection, Schema } from '@blocksuite/affine/store';
|
||||
import { renderHook } from '@testing-library/react';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
||||
|
||||
@@ -13,7 +13,7 @@ import { isNewTabTrigger } from '@affine/core/utils';
|
||||
import type { Collection } from '@affine/env/filter';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { DocMode } from '@blocksuite/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
ArrowDownSmallIcon,
|
||||
SearchIcon,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { CollectionService } from '@affine/core/modules/collection';
|
||||
import type { Tag } from '@affine/core/modules/tag';
|
||||
import type { Collection, Filter } from '@affine/env/filter';
|
||||
import { Trans, useI18n } from '@affine/i18n';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { useService, WorkspaceService } from '@toeverything/infra';
|
||||
import { useCallback, useMemo, useRef, useState } from 'react';
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/properties'
|
||||
import type { Tag } from '@affine/core/modules/tag';
|
||||
import { TagService } from '@affine/core/modules/tag';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { FavoritedIcon, FavoriteIcon } from '@blocksuite/icons/rc';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import { LiveData, useLiveData, useService } from '@toeverything/infra';
|
||||
import { type ReactNode, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import { WorkbenchService } from '@affine/core/modules/workbench';
|
||||
import type { Collection, DeleteCollectionInfo } from '@affine/env/filter';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import {
|
||||
DeleteIcon,
|
||||
DeletePermanentlyIcon,
|
||||
@@ -28,7 +29,6 @@ import {
|
||||
ResetIcon,
|
||||
SplitViewIcon,
|
||||
} from '@blocksuite/icons/rc';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import {
|
||||
FeatureFlagService,
|
||||
useLiveData,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import type { DocCollection } from '@blocksuite/affine/store';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { type ReactNode, Suspense } from 'react';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta';
|
||||
import type { Tag } from '@affine/env/filter';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/affine/store';
|
||||
import { ToggleCollapseIcon, ViewLayersIcon } from '@blocksuite/icons/rc';
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/store';
|
||||
import * as Collapsible from '@radix-ui/react-collapsible';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Collection, Tag } from '@affine/env/filter';
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/store';
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/affine/store';
|
||||
import type { PropsWithChildren, ReactNode } from 'react';
|
||||
import type { To } from 'react-router-dom';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import type { Atom } from 'jotai';
|
||||
import { atom } from 'jotai';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { DisposableGroup } from '@blocksuite/global/utils';
|
||||
import type { Doc, DocCollection } from '@blocksuite/store';
|
||||
import { DisposableGroup } from '@blocksuite/affine/global/utils';
|
||||
import type { Doc, DocCollection } from '@blocksuite/affine/store';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
const logger = new DebugLogger('useBlockSuiteWorkspacePage');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Collection, Filter, VariableMap } from '@affine/env/filter';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
|
||||
import { evalFilterList } from './filter';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/properties'
|
||||
import { ShareDocsListService } from '@affine/core/modules/share-doc';
|
||||
import type { Collection, Filter } from '@affine/env/filter';
|
||||
import { PublicPageMode } from '@affine/graphql';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { useCallback, useEffect, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Button, Modal, RadioGroup } from '@affine/component';
|
||||
import { useAllPageListConfig } from '@affine/core/components/hooks/affine/use-all-page-list-config';
|
||||
import type { Collection } from '@affine/env/filter';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/store';
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/affine/store';
|
||||
import type { DialogContentProps } from '@radix-ui/react-dialog';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
@@ -2,13 +2,13 @@ import { Button, IconButton, Tooltip } from '@affine/component';
|
||||
import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/properties';
|
||||
import type { Collection } from '@affine/env/filter';
|
||||
import { Trans, useI18n } from '@affine/i18n';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import {
|
||||
CloseIcon,
|
||||
EdgelessIcon,
|
||||
PageIcon,
|
||||
ToggleCollapseIcon,
|
||||
} from '@blocksuite/icons/rc';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import { DocsService, useLiveData, useService } from '@toeverything/infra';
|
||||
import { cssVar } from '@toeverything/theme';
|
||||
import clsx from 'clsx';
|
||||
|
||||
@@ -4,8 +4,8 @@ import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/properties'
|
||||
import { ShareDocsListService } from '@affine/core/modules/share-doc';
|
||||
import { PublicPageMode } from '@affine/graphql';
|
||||
import { Trans, useI18n } from '@affine/i18n';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { FilterIcon } from '@blocksuite/icons/rc';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import {
|
||||
useLiveData,
|
||||
useServices,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { useState } from 'react';
|
||||
|
||||
export const useSearch = (list: DocMeta[]) => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { toast, useConfirmModal } from '@affine/component';
|
||||
import { useBlockSuiteMetaHelper } from '@affine/core/components/hooks/affine/use-block-suite-meta-helper';
|
||||
import { useBlockSuiteDocMeta } from '@affine/core/components/hooks/use-block-suite-page-meta';
|
||||
import { Trans, useI18n } from '@affine/i18n';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { useService, WorkspaceService } from '@toeverything/infra';
|
||||
import { useCallback, useMemo, useRef, useState } from 'react';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { notify } from '@affine/component';
|
||||
import { GraphQLError } from '@affine/graphql';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import type { PropsWithChildren, ReactNode } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
import type { SWRConfiguration } from 'swr';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { DocCollection } from '@blocksuite/affine/store';
|
||||
import { ImportIcon } from '@blocksuite/icons/rc';
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
|
||||
import { MenuItem } from '../app-sidebar';
|
||||
import { usePageHelper } from '../blocksuite/block-suite-page-list/utils';
|
||||
|
||||
@@ -12,13 +12,13 @@ import { isNewTabTrigger } from '@affine/core/utils';
|
||||
import { apis, events } from '@affine/electron-api';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import {
|
||||
AllDocsIcon,
|
||||
GithubIcon,
|
||||
JournalIcon,
|
||||
SettingsIcon,
|
||||
} from '@blocksuite/icons/rc';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import type { Workspace } from '@toeverything/infra';
|
||||
import {
|
||||
useLiveData,
|
||||
|
||||
@@ -7,8 +7,8 @@ import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta';
|
||||
import { WorkbenchService } from '@affine/core/modules/workbench';
|
||||
import { isNewTabTrigger } from '@affine/core/utils';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { DocCollection } from '@blocksuite/affine/store';
|
||||
import { TodayIcon } from '@blocksuite/icons/rc';
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { type MouseEvent } from 'react';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user