Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
EYHN committed Dec 20, 2024
1 parent b8c634a commit b59afc1
Show file tree
Hide file tree
Showing 99 changed files with 156 additions and 158 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { useDocMetaHelper } from '@affine/core/components/hooks/use-block-suite-page-meta';
import { useDocCollectionPage } from '@affine/core/components/hooks/use-block-suite-workspace-page';
import { FetchService, GraphQLService } from '@affine/core/modules/cloud';
import { getAFFiNEWorkspaceSchema } from '@affine/core/modules/workspace';
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/affine/global/utils';
import { DocCollection } from '@blocksuite/affine/store';
import { getAFFiNEWorkspaceSchema, useService } from '@toeverything/infra';
import { useService } from '@toeverything/infra';
import { useEffect, useMemo } from 'react';
import useSWRImmutable from 'swr/immutable';
import {
Expand Down Expand Up @@ -236,7 +237,7 @@ export function revertUpdate(
} else if (type === 'Array') {
return snapshotDoc.getArray(key);
}
// eslint-disable-next-line array-callback-return

throw new Error('Unknown type');
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ export const CloudQuotaModal = () => {
if (!workspaceQuota) {
return;
}

currentWorkspace.engine.blob.singleBlobSizeLimit = bytes.parse(
workspaceQuota.blobLimit.toString()
)!;

currentWorkspace.engine.blob.singleBlobSizeLimit =
bytes.parse(workspaceQuota.blobLimit.toString()) ?? 0;

const disposable = currentWorkspace.engine.blob.onAbortLargeBlob.on(() => {
setOpen(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ConfirmModal } from '@affine/component/ui/modal';
import { openQuotaModalAtom } from '@affine/core/components/atoms';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { useI18n } from '@affine/i18n';
import { useService, WorkspaceService } from '@toeverything/infra';
import { useService } from '@toeverything/infra';
import { useAtom } from 'jotai';
import { useCallback, useEffect } from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DocsService } from '@affine/core/modules/doc';
import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta';
import { JournalService } from '@affine/core/modules/journal';
import { PeekViewService } from '@affine/core/modules/peek-view/services/peek-view';
Expand All @@ -6,12 +7,7 @@ import { WorkbenchLink } from '@affine/core/modules/workbench';
import { track } from '@affine/track';
import type { DocMode } from '@blocksuite/affine/blocks';
import type { DocCollection } from '@blocksuite/affine/store';
import {
DocsService,
LiveData,
useLiveData,
useService,
} from '@toeverything/infra';
import { LiveData, useLiveData, useService } from '@toeverything/infra';
import clsx from 'clsx';
import { nanoid } from 'nanoid';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEnableCloud } from '@affine/core/components/hooks/affine/use-enable-cloud';
import type { Workspace } from '@affine/core/modules/workspace';
import { track } from '@affine/track';
import type { Doc } from '@blocksuite/affine/store';
import { type Workspace } from '@toeverything/infra';
import { useCallback } from 'react';

import { ShareMenu } from './share-menu';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ import { Tabs, Tooltip } from '@affine/component';
import { Button } from '@affine/component/ui/button';
import { Menu } from '@affine/component/ui/menu';
import { ShareInfoService } from '@affine/core/modules/share-doc';
import type { WorkspaceMetadata } from '@affine/core/modules/workspace';
import { useI18n } from '@affine/i18n';
import type { Doc } from '@blocksuite/affine/store';
import { LockIcon, PublishIcon } from '@blocksuite/icons/rc';
import {
useLiveData,
useService,
type WorkspaceMetadata,
} from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { forwardRef, type PropsWithChildren, type Ref, useEffect } from 'react';

import * as styles from './index.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import {
type useConfirmModal,
} from '@affine/component';
import { WorkspaceServerService } from '@affine/core/modules/cloud';
import { DocService, DocsService } from '@affine/core/modules/doc';
import {
type DocRecord,
DocService,
DocsService,
} from '@affine/core/modules/doc';
import type { EditorService } from '@affine/core/modules/editor';
import { EditorSettingService } from '@affine/core/modules/editor-setting';
import { resolveLinkToDoc } from '@affine/core/modules/navigation';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import type { ExtensionType } from '@blocksuite/affine/block-std';
import {
NoteBlockSpec,
PageSurfaceBlockSpec,
PageSurfaceRefBlockSpec,
} from '@blocksuite/affine/blocks';
import {
FeatureFlagService,
type FrameworkProvider,
} from '@toeverything/infra';
import { type FrameworkProvider } from '@toeverything/infra';

import { AIBlockSpecs, DefaultBlockSpecs } from './common';
import { createPageRootBlockSpec } from './custom/root-block';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { EditorService } from '@affine/core/modules/editor';
import { OpenInAppService } from '@affine/core/modules/open-in-app/services';
import { WorkbenchService } from '@affine/core/modules/workbench';
import { ViewService } from '@affine/core/modules/workbench/services/view';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { useI18n } from '@affine/i18n';
import { track } from '@affine/track';
import type { Doc } from '@blocksuite/affine/store';
Expand All @@ -42,7 +43,6 @@ import {
useLiveData,
useService,
useServiceOptional,
WorkspaceService,
} from '@toeverything/infra';
import { useCallback, useState } from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DocCustomPropertyInfo } from '@affine/core/modules/db';
import * as icons from '@blocksuite/icons/rc';
import type { DocCustomPropertyInfo } from '@toeverything/infra';
import type { SVGProps } from 'react';

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Menu, Scrollable } from '@affine/component';
import type { DocCustomPropertyInfo } from '@affine/core/modules/db';
import { useI18n } from '@affine/i18n';
import type { DocCustomPropertyInfo } from '@toeverything/infra';
import { chunk } from 'lodash-es';

import { type DocPropertyIconName, DocPropertyIconNames } from './constant';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Checkbox, DatePicker, Menu, PropertyValue } from '@affine/component';
import { MobileJournalConflictList } from '@affine/core/mobile/pages/workspace/detail/menu/journal-conflicts';
import { DocService } from '@affine/core/modules/doc';
import { JournalService } from '@affine/core/modules/journal';
import { WorkbenchService } from '@affine/core/modules/workbench';
import { ViewService } from '@affine/core/modules/workbench/services/view';
import { i18nTime, useI18n } from '@affine/i18n';
import {
DocService,
useLiveData,
useService,
useServiceOptional,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DocCustomPropertyInfo } from '@toeverything/infra';
import type { DocCustomPropertyInfo } from '@affine/core/modules/db';

export interface PropertyValueProps {
propertyInfo?: DocCustomPropertyInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { BlockSuiteEditor as Editor } from './blocksuite/block-suite-editor';
import * as styles from './page-detail-editor.css';

declare global {

var currentEditor: AffineEditorContainer | undefined;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Menu, MenuItem, usePromptModal } from '@affine/component';
import { useDeleteCollectionInfo } from '@affine/core/components/hooks/affine/use-delete-collection-info';
import { WorkspaceDialogService } from '@affine/core/modules/dialogs';
import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/favorite';
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { WorkbenchService } from '@affine/core/modules/workbench';
import type { Collection } from '@affine/env/filter';
import { useI18n } from '@affine/i18n';
Expand All @@ -14,12 +15,7 @@ import {
PlusIcon,
SplitViewIcon,
} from '@blocksuite/icons/rc';
import {
FeatureFlagService,
useLiveData,
useService,
useServices,
} from '@toeverything/infra';
import { useLiveData, useService, useServices } from '@toeverything/infra';
import type { PropsWithChildren, ReactElement } from 'react';
import { useCallback, useMemo } from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { Tooltip } from '@affine/component/ui/tooltip';
import { GlobalDialogService } from '@affine/core/modules/dialogs';
import type { SettingTab } from '@affine/core/modules/dialogs/constant';
import { GlobalContextService } from '@affine/core/modules/global-context';
import { UrlService } from '@affine/core/modules/url';
import { useI18n } from '@affine/i18n';
import { CloseIcon, NewIcon } from '@blocksuite/icons/rc';
import {
GlobalContextService,
useLiveData,
useService,
useServices,
} from '@toeverything/infra';
import { useLiveData, useService, useServices } from '@toeverything/infra';
import { useCallback, useState } from 'react';

import { ContactIcon, HelpIcon, KeyboardIcon } from './icons';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
} from '@affine/core/modules/app-sidebar/views';
import { AppTabsHeader } from '@affine/core/modules/app-tabs-header';
import { NavigationButtons } from '@affine/core/modules/navigation';
import { WorkspaceService } from '@affine/core/modules/workspace';
import {
useLiveData,
useService,
useServiceOptional,
WorkspaceService,
} from '@toeverything/infra';
import clsx from 'clsx';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Modal, Scrollable } from '@affine/component';
import { BlocksuiteHeaderTitle } from '@affine/core/components/blocksuite/block-suite-header/title';
import type { DialogComponentProps } from '@affine/core/modules/dialogs';
import type { WORKSPACE_DIALOG_SCHEMA } from '@affine/core/modules/dialogs/constant';
import { Doc, DocsService } from '@affine/core/modules/doc';
import { type Doc, DocsService } from '@affine/core/modules/doc';
import { FrameworkScope, useService } from '@toeverything/infra';
import { useEffect, useState } from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,15 @@ import {
fontStyleOptions,
} from '@affine/core/modules/editor-setting';
import { SpellCheckSettingService } from '@affine/core/modules/editor-setting/services/spell-check-setting';
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import {
type FontData,
SystemFontFamilyService,
} from '@affine/core/modules/system-font-family';
import { Trans, useI18n } from '@affine/i18n';
import type { DocMode } from '@blocksuite/affine/blocks';
import { DoneIcon, SearchIcon } from '@blocksuite/icons/rc';
import {
FeatureFlagService,
useLiveData,
useService,
useServices,
} from '@toeverything/infra';
import { useLiveData, useService, useServices } from '@toeverything/infra';
import clsx from 'clsx';
import {
forwardRef,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { UserFeatureService } from '@affine/core/modules/cloud/services/user-feature';
import type { SettingTab } from '@affine/core/modules/dialogs/constant';
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { useI18n } from '@affine/i18n';
import {
AppearanceIcon,
Expand All @@ -8,11 +9,7 @@ import {
KeyboardIcon,
PenIcon,
} from '@blocksuite/icons/rc';
import {
FeatureFlagService,
useLiveData,
useServices,
} from '@toeverything/infra';
import { useLiveData, useServices } from '@toeverything/infra';
import type { ReactElement, SVGProps } from 'react';
import { useEffect } from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import {
} from '@affine/component/setting-components';
import { Avatar } from '@affine/component/ui/avatar';
import { Tooltip } from '@affine/component/ui/tooltip';
import { WorkspaceAvatar } from '@affine/component/workspace-avatar';
import { UserPlanButton } from '@affine/core/components/affine/auth/user-plan-button';
import { useCatchEventCallback } from '@affine/core/components/hooks/use-catch-event-hook';
import { useWorkspaceInfo } from '@affine/core/components/hooks/use-workspace-info';
import { WorkspaceAvatar } from '@affine/core/components/workspace-avatar';
import { AuthService } from '@affine/core/modules/cloud';
import { UserFeatureService } from '@affine/core/modules/cloud/services/user-feature';
import { GlobalDialogService } from '@affine/core/modules/dialogs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { SettingTab } from '@affine/core/modules/dialogs/constant';
import type { WorkspaceMetadata } from '@toeverything/infra';
import type { WorkspaceMetadata } from '@affine/core/modules/workspace';

export interface SettingState {
activeTab: SettingTab;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { SettingTab } from '@affine/core/modules/dialogs/constant';
import type { WorkspaceMetadata } from '@toeverything/infra';
import type { WorkspaceMetadata } from '@affine/core/modules/workspace';

import type { SettingState } from '../types';
import { WorkspaceSettingBilling } from './billing';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { SettingRow } from '@affine/component/setting-components';
import { Button } from '@affine/component/ui/button';
import { useEnableCloud } from '@affine/core/components/hooks/affine/use-enable-cloud';
import { Workspace, WorkspaceService } from '@affine/core/modules/workspace';
import {
type Workspace,
WorkspaceService,
} from '@affine/core/modules/workspace';
import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant';
import { useI18n } from '@affine/i18n';
import { useLiveData, useService } from '@toeverything/infra';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { WorkspacePermissionService } from '@affine/core/modules/permissions';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { useI18n } from '@affine/i18n';
import { useLiveData, useService, WorkspaceService } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { cssVarV2 } from '@toeverything/theme/v2';
import { useEffect, useMemo } from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { Button, Tooltip } from '@affine/component';
import { SettingRow } from '@affine/component/setting-components';
import { AffineErrorBoundary } from '@affine/core/components/affine/affine-error-boundary';
import { useWorkspaceInfo } from '@affine/core/components/hooks/use-workspace-info';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { useI18n } from '@affine/i18n';
import { useService, WorkspaceService } from '@toeverything/infra';
import { useService } from '@toeverything/infra';
import type { ReactElement } from 'react';

import type { SettingState } from '../../../types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { FlexWrapper, Input, notify, Wrapper } from '@affine/component';
import { Button } from '@affine/component/ui/button';
import { WorkspaceAvatar } from '@affine/component/workspace-avatar';
import { useCatchEventCallback } from '@affine/core/components/hooks/use-catch-event-hook';
import { Upload } from '@affine/core/components/pure/file-upload';
import { WorkspaceAvatar } from '@affine/core/components/workspace-avatar';
import { WorkspacePermissionService } from '@affine/core/modules/permissions';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { validateAndReduceImage } from '@affine/core/utils/reduce-image';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { ThemeEditorService } from '@affine/core/modules/theme-editor';
import {
FeatureFlagService,
useLiveData,
useServices,
} from '@toeverything/infra';
import { useLiveData, useServices } from '@toeverything/infra';
import { useTheme } from 'next-themes';
import { useEffect } from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import { Header } from '@affine/core/components/pure/header';
import { WorkspaceModeFilterTab } from '@affine/core/components/pure/workspace-mode-filter-tab';
import { WorkspaceDialogService } from '@affine/core/modules/dialogs';
import { WorkbenchService } from '@affine/core/modules/workbench';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { isNewTabTrigger } from '@affine/core/utils';
import type { Filter } from '@affine/env/filter';
import { track } from '@affine/track';
import { PlusIcon } from '@blocksuite/icons/rc';
import { useServices, WorkspaceService } from '@toeverything/infra';
import { useServices } from '@toeverything/infra';
import clsx from 'clsx';
import { useCallback } from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Skeleton } from '@affine/component';
import { Doc, DocsService } from '@affine/core/modules/doc';
import { type Doc, DocsService } from '@affine/core/modules/doc';
import { type AttachmentBlockModel } from '@blocksuite/affine/blocks';
import { FrameworkScope, useLiveData, useService } from '@toeverything/infra';
import { type ReactElement, useLayoutEffect, useState } from 'react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Doc, DocsService } from '@affine/core/modules/doc';
import { type Doc, DocsService } from '@affine/core/modules/doc';
import type { Editor } from '@affine/core/modules/editor';
import { EditorsService } from '@affine/core/modules/editor';
import { ViewService } from '@affine/core/modules/workbench/services/view';
Expand Down
Loading

0 comments on commit b59afc1

Please sign in to comment.