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 cff3c8f commit b8c634a
Show file tree
Hide file tree
Showing 139 changed files with 357 additions and 462 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {
GlobalContextService,
useLiveData,
useServices,
} from '@toeverything/infra';
import { GlobalContextService } from '@affine/core/modules/global-context';
import { useLiveData, useServices } from '@toeverything/infra';
import { useEffect } from 'react';
import { useLocation, useParams } from 'react-router-dom';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FeatureFlagService, useService } from '@toeverything/infra';
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { useService } from '@toeverything/infra';
import { Suspense, useCallback, useEffect, useState } from 'react';

import { AIOnboardingEdgeless } from './edgeless.dialog';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useLiveData, useService, WorkspaceService } from '@toeverything/infra';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { useLiveData, useService } from '@toeverything/infra';
import { useEffect } from 'react';

import { AuthService } from '../../../modules/cloud';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { usePromptModal } from '@affine/component';
import { useNavigateHelper } from '@affine/core/components/hooks/use-navigate-helper';
import { CollectionService } from '@affine/core/modules/collection';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { useI18n } from '@affine/i18n';
import { ViewLayersIcon } from '@blocksuite/icons/rc';
import { useService, WorkspaceService } from '@toeverything/infra';
import { useService } from '@toeverything/infra';
import { nanoid } from 'nanoid';
import { useCallback } from 'react';

Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/core/src/components/affine/empty/docs.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { TagService } from '@affine/core/modules/tag';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { isNewTabTrigger } from '@affine/core/utils';
import { useI18n } from '@affine/i18n';
import { AllDocsIcon } from '@blocksuite/icons/rc';
import { useLiveData, useService, WorkspaceService } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { type MouseEvent, useCallback } from 'react';

import { usePageHelper } from '../../blocksuite/block-suite-page-list/utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta';
import { EditorService } from '@affine/core/modules/editor';
import { WorkspacePermissionService } from '@affine/core/modules/permissions';
import { WorkspaceQuotaService } from '@affine/core/modules/quota';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { i18nTime, Trans, useI18n } from '@affine/i18n';
import { track } from '@affine/track';
import type { DocMode } from '@blocksuite/affine/blocks';
Expand All @@ -17,7 +18,7 @@ import type {
import { CloseIcon, ToggleCollapseIcon } from '@blocksuite/icons/rc';
import * as Collapsible from '@radix-ui/react-collapsible';
import type { DialogContentProps } from '@radix-ui/react-dialog';
import { useLiveData, useService, WorkspaceService } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { atom, useAtom } from 'jotai';
import type { PropsWithChildren } from 'react';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { UserQuotaService } from '@affine/core/modules/cloud';
import { GlobalDialogService } from '@affine/core/modules/dialogs';
import { WorkspacePermissionService } from '@affine/core/modules/permissions';
import { WorkspaceQuotaService } from '@affine/core/modules/quota';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { type I18nString, useI18n } from '@affine/i18n';
import { track } from '@affine/track';
import { useLiveData, useService, WorkspaceService } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import bytes from 'bytes';
import { useAtom } from 'jotai';
import { useCallback, useEffect, useMemo } from 'react';
Expand Down Expand Up @@ -70,7 +71,7 @@ export const CloudQuotaModal = () => {
if (!workspaceQuota) {
return;
}
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
currentWorkspace.engine.blob.singleBlobSizeLimit = bytes.parse(
workspaceQuota.blobLimit.toString()
)!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,28 @@ import {
useLitPortalFactory,
} from '@affine/component';
import { TextRenderer } from '@affine/core/blocksuite/presets';
import { DocService } from '@affine/core/modules/doc';
import {
type Backlink,
DocLinksService,
type Link,
} from '@affine/core/modules/doc-link';
import { toURLSearchParams } from '@affine/core/modules/navigation';
import { GlobalSessionStateService } from '@affine/core/modules/storage';
import { WorkbenchLink } from '@affine/core/modules/workbench';
import {
getAFFiNEWorkspaceSchema,
WorkspaceService,
} from '@affine/core/modules/workspace';
import { useI18n } from '@affine/i18n';
import type { JobMiddleware } from '@blocksuite/affine/store';
import { ToggleExpandIcon } from '@blocksuite/icons/rc';
import * as Collapsible from '@radix-ui/react-collapsible';
import {
DocService,
getAFFiNEWorkspaceSchema,
GlobalSessionStateService,
LiveData,
useFramework,
useLiveData,
useServices,
WorkspaceService,
} from '@toeverything/infra';
import React, {
Fragment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
useConfirmModal,
useLitPortalFactory,
} from '@affine/component';
import type { DocCustomPropertyInfo } from '@affine/core/modules/db';
import { DocService, DocsService } from '@affine/core/modules/doc';
import type {
DatabaseRow,
DatabaseValueCell,
Expand All @@ -12,6 +14,7 @@ import { EditorSettingService } from '@affine/core/modules/editor-setting';
import { JournalService } from '@affine/core/modules/journal';
import { toURLSearchParams } from '@affine/core/modules/navigation';
import { PeekViewService } from '@affine/core/modules/peek-view/services/peek-view';
import { WorkspaceService } from '@affine/core/modules/workspace';
import track from '@affine/track';
import type { DocMode } from '@blocksuite/affine/blocks';
import {
Expand All @@ -21,14 +24,10 @@ import {
} from '@blocksuite/affine/presets';
import type { Doc } from '@blocksuite/affine/store';
import {
type DocCustomPropertyInfo,
DocService,
DocsService,
useFramework,
useLiveData,
useService,
useServices,
WorkspaceService,
} from '@toeverything/infra';
import React, {
forwardRef,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import {
AIEdgelessRootBlockSpec,
AIPageRootBlockSpec,
} from '@affine/core/blocksuite/presets/ai';
import { DocService, DocsService } from '@affine/core/modules/doc';
import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta';
import { EditorSettingService } from '@affine/core/modules/editor-setting';
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { AppThemeService } from '@affine/core/modules/theme';
import { mixpanel } from '@affine/track';
import {
Expand Down Expand Up @@ -39,12 +41,7 @@ import {
} from '@blocksuite/affine-shared/utils';
import type { Container } from '@blocksuite/global/di';
import { LinkedPageIcon, PageIcon } from '@blocksuite/icons/lit';
import {
DocService,
DocsService,
FeatureFlagService,
type FrameworkProvider,
} from '@toeverything/infra';
import { type FrameworkProvider } from '@toeverything/infra';
import type { TemplateResult } from 'lit';
import type { Observable } from 'rxjs';
import { combineLatest, map } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
type useConfirmModal,
} from '@affine/component';
import { WorkspaceServerService } from '@affine/core/modules/cloud';
import { 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 All @@ -22,6 +23,7 @@ import {
import { ExternalLinksQuickSearchSession } from '@affine/core/modules/quicksearch/impls/external-links';
import { JournalsQuickSearchSession } from '@affine/core/modules/quicksearch/impls/journals';
import { WorkbenchService } from '@affine/core/modules/workbench';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { isNewTabTrigger } from '@affine/core/utils';
import { DebugLogger } from '@affine/debug';
import { track } from '@affine/track';
Expand Down Expand Up @@ -62,10 +64,7 @@ import type { ReferenceParams } from '@blocksuite/affine-model';
import {
AIChatBlockSchema,
type DocProps,
type DocService,
DocsService,
type FrameworkProvider,
WorkspaceService,
} from '@toeverything/infra';
import { type TemplateResult } from 'lit';
import { customElement } from 'lit/decorators.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { builtInTemplates as builtInEdgelessTemplates } from '@affine/templates/edgeless';
import { builtInTemplates as builtInStickersTemplates } from '@affine/templates/stickers';
import type { ExtensionType } from '@blocksuite/affine/block-std';
Expand All @@ -10,10 +11,7 @@ import {
EdgelessTextBlockSpec,
FrameBlockSpec,
} from '@blocksuite/affine/blocks';
import {
FeatureFlagService,
type FrameworkProvider,
} from '@toeverything/infra';
import { type FrameworkProvider } from '@toeverything/infra';

import { AIBlockSpecs, DefaultBlockSpecs } from './common';
import { createEdgelessRootBlockSpec } from './custom/root-block';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { OverlayModal } from '@affine/component';
import { useEnableCloud } from '@affine/core/components/hooks/affine/use-enable-cloud';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { useI18n } from '@affine/i18n';
import { useService, WorkspaceService } from '@toeverything/infra';
import { useService } from '@toeverything/infra';
import { useCallback } from 'react';

import TopSvg from './top-svg';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import type { InlineEditProps } from '@affine/component';
import { InlineEdit } from '@affine/component';
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
import { DocsService } from '@affine/core/modules/doc';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { track } from '@affine/track';
import {
DocsService,
useLiveData,
useService,
WorkspaceService,
} from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import clsx from 'clsx';
import type { HTMLAttributes } from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { toast } from '@affine/component';
import { AppSidebarService } from '@affine/core/modules/app-sidebar';
import { DocsService } from '@affine/core/modules/doc';
import { EditorSettingService } from '@affine/core/modules/editor-setting';
import { WorkbenchService } from '@affine/core/modules/workbench';
import { type DocMode } from '@blocksuite/affine/blocks';
import type { DocCollection } from '@blocksuite/affine/store';
import { type DocProps, DocsService, useServices } from '@toeverything/infra';
import { type DocProps, useServices } from '@toeverything/infra';
import { useCallback, useMemo } from 'react';

export const usePageHelper = (docCollection: DocCollection) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ import {
useDraggable,
useDropTarget,
} from '@affine/component';
import type { DocCustomPropertyInfo } from '@affine/core/modules/db';
import { DocsService } from '@affine/core/modules/doc';
import { WorkspaceService } from '@affine/core/modules/workspace';
import type { AffineDNDData } from '@affine/core/types/dnd';
import { useI18n } from '@affine/i18n';
import { MoreHorizontalIcon } from '@blocksuite/icons/rc';
import {
type DocCustomPropertyInfo,
DocsService,
useLiveData,
useService,
WorkspaceService,
} from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import clsx from 'clsx';
import { type HTMLProps, useCallback, useState } from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { MenuItem, MenuSeparator } from '@affine/component';
import type { DocCustomPropertyInfo } from '@affine/core/modules/db';
import { DocsService } from '@affine/core/modules/doc';
import { generateUniqueNameInSequence } from '@affine/core/utils/unique-name';
import { useI18n } from '@affine/i18n';
import {
type DocCustomPropertyInfo,
DocsService,
useLiveData,
useService,
} from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { useCallback } from 'react';

import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import {
MenuSeparator,
useConfirmModal,
} from '@affine/component';
import { DocsService } from '@affine/core/modules/doc';
import { Trans, useI18n } from '@affine/i18n';
import { DeleteIcon, InvisibleIcon, ViewIcon } from '@blocksuite/icons/rc';
import { DocsService, useLiveData, useService } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import {
type KeyboardEventHandler,
type MouseEvent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Divider, IconButton, Tooltip } from '@affine/component';
import { DocsService } from '@affine/core/modules/doc';
import { generateUniqueNameInSequence } from '@affine/core/utils/unique-name';
import { useI18n } from '@affine/i18n';
import track from '@affine/track';
Expand All @@ -7,7 +8,7 @@ import {
Content as CollapsibleContent,
Root as CollapsibleRoot,
} from '@radix-ui/react-collapsible';
import { DocsService, useLiveData, useService } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { useCallback, useState } from 'react';

import { DocPropertyManager } from '../manager';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@ import {
useDraggable,
useDropTarget,
} from '@affine/component';
import type { DocCustomPropertyInfo } from '@affine/core/modules/db';
import { DocService, DocsService } from '@affine/core/modules/doc';
import { DocDatabaseBacklinkInfo } from '@affine/core/modules/doc-info';
import type {
DatabaseRow,
DatabaseValueCell,
} from '@affine/core/modules/doc-info/types';
import { WorkbenchService } from '@affine/core/modules/workbench';
import { ViewService } from '@affine/core/modules/workbench/services/view';
import { ViewService } from '@affine/core/modules/workbench';
import type { AffineDNDData } from '@affine/core/types/dnd';
import { useI18n } from '@affine/i18n';
import { track } from '@affine/track';
import { PlusIcon, PropertyIcon, ToggleExpandIcon } from '@blocksuite/icons/rc';
import * as Collapsible from '@radix-ui/react-collapsible';
import {
type DocCustomPropertyInfo,
DocService,
DocsService,
useLiveData,
useService,
useServiceOptional,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { TagService, useDeleteTagConfirmModal } from '@affine/core/modules/tag';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { useI18n } from '@affine/i18n';
import { TagsIcon } from '@blocksuite/icons/rc';
import {
LiveData,
useLiveData,
useService,
WorkspaceService,
} from '@toeverything/infra';
import { LiveData, useLiveData, useService } from '@toeverything/infra';
import { useCallback, useMemo } from 'react';

import { useAsyncCallback } from '../hooks/affine-async-hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Avatar, PropertyValue } from '@affine/component';
import { CloudDocMetaService } from '@affine/core/modules/cloud/services/cloud-doc-meta';
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 { useEffect, useMemo } from 'react';

import { userWrapper } from './created-updated-by.css';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DatePicker, Menu, PropertyValue, Tooltip } from '@affine/component';
import { DocService } from '@affine/core/modules/doc';
import { i18nTime, useI18n } from '@affine/i18n';
import { DocService, useLiveData, useServices } from '@toeverything/infra';
import { useLiveData, useServices } from '@toeverything/infra';

import * as styles from './date.css';
import type { PropertyValueProps } from './types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import {
RadioGroup,
type RadioItem,
} from '@affine/component';
import { DocService } from '@affine/core/modules/doc';
import { useI18n } from '@affine/i18n';
import type { DocMode } from '@blocksuite/affine/blocks';
import { DocService, useLiveData, useService } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { useCallback, useMemo } from 'react';

import * as styles from './doc-primary-mode.css';
Expand Down
Loading

0 comments on commit b8c634a

Please sign in to comment.