mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
style: enable import-x/no-duplicates (#6279)
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import { builtInTemplates } from '@affine/templates/edgeless';
|
||||
import {
|
||||
EdgelessTemplatePanel,
|
||||
type TemplateManager,
|
||||
} from '@blocksuite/blocks';
|
||||
import type { TemplateManager } from '@blocksuite/blocks';
|
||||
import { EdgelessTemplatePanel } from '@blocksuite/blocks';
|
||||
|
||||
EdgelessTemplatePanel.templates.extend(builtInTemplates as TemplateManager);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import type { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { SettingsIcon } from '@blocksuite/icons';
|
||||
import type { AffineEditorContainer } from '@blocksuite/presets';
|
||||
import { appSettingAtom } from '@toeverything/infra';
|
||||
import {
|
||||
appSettingAtom,
|
||||
PreconditionStrategy,
|
||||
registerAffineCommand,
|
||||
} from '@toeverything/infra';
|
||||
import { type createStore } from 'jotai';
|
||||
import type { createStore } from 'jotai';
|
||||
import type { useTheme } from 'next-themes';
|
||||
|
||||
import { openQuickSearchModalAtom } from '../atoms';
|
||||
|
||||
@@ -4,10 +4,8 @@ import type { FC } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import * as styles from './affine-error-fallback.css';
|
||||
import {
|
||||
ERROR_REFLECT_KEY,
|
||||
type FallbackProps,
|
||||
} from './error-basic/fallback-creator';
|
||||
import type { FallbackProps } from './error-basic/fallback-creator';
|
||||
import { ERROR_REFLECT_KEY } from './error-basic/fallback-creator';
|
||||
import { DumpInfo } from './error-basic/info-logger';
|
||||
import { AnyErrorFallback } from './error-fallbacks/any-error-fallback';
|
||||
import { NoPageRootFallback } from './error-fallbacks/no-page-root-fallback';
|
||||
|
||||
@@ -3,12 +3,8 @@ import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { useTheme } from 'next-themes';
|
||||
import {
|
||||
type FC,
|
||||
type PropsWithChildren,
|
||||
type ReactNode,
|
||||
useState,
|
||||
} from 'react';
|
||||
import type { FC, PropsWithChildren, ReactNode } from 'react';
|
||||
import { useState } from 'react';
|
||||
|
||||
import imageUrlFor404 from '../error-assets/404-status.assets.svg';
|
||||
import imageUrlForDark500 from '../error-assets/dark-500-status.assets.svg';
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { WorkspaceListService } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import {
|
||||
useLiveData,
|
||||
useService,
|
||||
WorkspaceListService,
|
||||
} from '@toeverything/infra';
|
||||
import { useEffect } from 'react';
|
||||
import { useLocation, useParams } from 'react-router-dom';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { type FC, useCallback } from 'react';
|
||||
import type { FC } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { ErrorDetail } from '../error-basic/error-detail';
|
||||
import type { FallbackProps } from '../error-basic/fallback-creator';
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { FC, PropsWithChildren } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { AffineErrorFallback } from './affine-error-fallback';
|
||||
import { type FallbackProps } from './error-basic/fallback-creator';
|
||||
import type { FallbackProps } from './error-basic/fallback-creator';
|
||||
|
||||
export { type FallbackProps } from './error-basic/fallback-creator';
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { useAppSettingHelper } from '../../hooks/affine/use-app-setting-helper';
|
||||
import {
|
||||
AppContainer as AppContainerWithoutSettings,
|
||||
type WorkspaceRootProps,
|
||||
} from '../workspace';
|
||||
import type { WorkspaceRootProps } from '../workspace';
|
||||
import { AppContainer as AppContainerWithoutSettings } from '../workspace';
|
||||
|
||||
export const AppContainer = (props: WorkspaceRootProps) => {
|
||||
const { appSettings } = useAppSettingHelper();
|
||||
|
||||
@@ -8,7 +8,8 @@ import { Button } from '@affine/component/ui/button';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { type FC, useCallback } from 'react';
|
||||
import type { FC } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { useCurrentLoginStatus } from '../../../hooks/affine/use-current-login-status';
|
||||
import type { AuthPanelProps } from './index';
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import {
|
||||
AuthModal as AuthModalBase,
|
||||
type AuthModalProps as AuthModalBaseProps,
|
||||
} from '@affine/component/auth-components';
|
||||
import { type FC, useCallback, useMemo } from 'react';
|
||||
import type { AuthModalProps as AuthModalBaseProps } from '@affine/component/auth-components';
|
||||
import { AuthModal as AuthModalBase } from '@affine/component/auth-components';
|
||||
import type { FC } from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
import { AfterSignInSendEmail } from './after-sign-in-send-email';
|
||||
import { AfterSignUpSendEmail } from './after-sign-up-send-email';
|
||||
|
||||
@@ -5,7 +5,8 @@ import {
|
||||
} from '@affine/component/auth-components';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { NewIcon } from '@blocksuite/icons';
|
||||
import { type FC, useCallback } from 'react';
|
||||
import type { FC } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { useCurrentLoginStatus } from '../../../hooks/affine/use-current-login-status';
|
||||
import type { AuthPanelProps } from './index';
|
||||
|
||||
@@ -5,7 +5,8 @@ import {
|
||||
} from '@affine/core/hooks/affine/use-server-config';
|
||||
import { OAuthProviderType } from '@affine/graphql';
|
||||
import { GithubIcon, GoogleDuotoneIcon } from '@blocksuite/icons';
|
||||
import { type ReactElement, useCallback, useState } from 'react';
|
||||
import type { ReactElement } from 'react';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { useAuth } from './use-auth';
|
||||
|
||||
|
||||
@@ -5,16 +5,13 @@ import {
|
||||
} from '@affine/component/auth-components';
|
||||
import { Button } from '@affine/component/ui/button';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import {
|
||||
findGraphQLError,
|
||||
type GetUserQuery,
|
||||
getUserQuery,
|
||||
} from '@affine/graphql';
|
||||
import type { GetUserQuery } from '@affine/graphql';
|
||||
import { findGraphQLError, getUserQuery } from '@affine/graphql';
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ArrowDownBigIcon } from '@blocksuite/icons';
|
||||
import { type FC, useState } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
import type { FC } from 'react';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { useCurrentLoginStatus } from '../../../hooks/affine/use-current-login-status';
|
||||
import { useMutation } from '../../../hooks/use-mutation';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { Suspense, useEffect } from 'react';
|
||||
|
||||
import { useCurrentLoginStatus } from '../../../hooks/affine/use-current-login-status';
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { Avatar, Input, Switch, toast } from '@affine/component';
|
||||
import {
|
||||
ConfirmModal,
|
||||
type ConfirmModalProps,
|
||||
Modal,
|
||||
} from '@affine/component/ui/modal';
|
||||
import type { ConfirmModalProps } from '@affine/component/ui/modal';
|
||||
import { ConfirmModal, Modal } from '@affine/component/ui/modal';
|
||||
import { authAtom, openDisableCloudAlertModalAtom } from '@affine/core/atoms';
|
||||
import { useCurrentLoginStatus } from '@affine/core/hooks/affine/use-current-login-status';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
@@ -12,13 +9,15 @@ 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 { WorkspaceManager } from '@toeverything/infra';
|
||||
import { buildShowcaseWorkspace, initEmptyPage } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import {
|
||||
buildShowcaseWorkspace,
|
||||
initEmptyPage,
|
||||
useService,
|
||||
WorkspaceManager,
|
||||
} from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import type { KeyboardEvent } from 'react';
|
||||
import { useLayoutEffect } from 'react';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useCallback, useLayoutEffect, useState } from 'react';
|
||||
|
||||
import { CloudSvg } from '../share-page-modal/cloud-svg';
|
||||
import * as styles from './index.css';
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import {
|
||||
ConfirmModal,
|
||||
type ConfirmModalProps,
|
||||
} from '@affine/component/ui/modal';
|
||||
import type { ConfirmModalProps } from '@affine/component/ui/modal';
|
||||
import { ConfirmModal } from '@affine/component/ui/modal';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Menu, MenuItem, MenuTrigger } from '@affine/component/ui/menu';
|
||||
import { memo, type ReactElement } from 'react';
|
||||
import type { ReactElement } from 'react';
|
||||
import { memo } from 'react';
|
||||
|
||||
import { useLanguageHelper } from '../../../hooks/affine/use-language-helper';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type ReactNode } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
import { Segment } from './segment';
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { type CSSProperties, useCallback, useState } from 'react';
|
||||
import type { CSSProperties } from 'react';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { AnimateInTooltip } from './animate-in-tooltip';
|
||||
import { articles } from './articles';
|
||||
|
||||
@@ -3,8 +3,12 @@ import { useCallback, useEffect, useState } from 'react';
|
||||
import { AnimateIn } from './steps/animate-in';
|
||||
import { EdgelessSwitch } from './steps/edgeless-switch';
|
||||
import { Unfolding } from './steps/unfolding';
|
||||
import type { ArticleId, OnboardingStatus, OnboardingStep } from './types';
|
||||
import { type ArticleOption } from './types';
|
||||
import type {
|
||||
ArticleId,
|
||||
ArticleOption,
|
||||
OnboardingStatus,
|
||||
OnboardingStep,
|
||||
} from './types';
|
||||
|
||||
interface PaperStepsProps {
|
||||
show?: boolean;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import anime from 'animejs';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { Paper, type PaperProps } from '../curve-paper/paper';
|
||||
import type { PaperProps } from '../curve-paper/paper';
|
||||
import { Paper } from '../curve-paper/paper';
|
||||
import * as paperStyles from '../curve-paper/paper.css';
|
||||
import type { ArticleOption } from '../types';
|
||||
import * as styles from './animate-in.css';
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
import { Button } from '@affine/component';
|
||||
import clsx from 'clsx';
|
||||
import { debounce } from 'lodash-es';
|
||||
import {
|
||||
type CSSProperties,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import type { CSSProperties } from 'react';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import Logo from '../assets/logo';
|
||||
import { OnboardingBlock } from '../switch-widgets/block';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { CSSProperties } from 'react';
|
||||
|
||||
import { type EdgelessSwitchMode, type OnboardingBlockOption } from '../types';
|
||||
import type { EdgelessSwitchMode, OnboardingBlockOption } from '../types';
|
||||
import { onboardingBlock } from './style.css';
|
||||
|
||||
interface OnboardingBlockProps extends OnboardingBlockOption {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { type CSSProperties, memo } from 'react';
|
||||
import type { CSSProperties } from 'react';
|
||||
import { memo } from 'react';
|
||||
|
||||
import { toolbar, toolbarPop } from './style.css';
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ import { useDocMetaHelper } from '@affine/core/hooks/use-block-suite-page-meta';
|
||||
import { useDocCollectionPage } from '@affine/core/hooks/use-block-suite-workspace-page';
|
||||
import { timestampToLocalDate } from '@affine/core/utils';
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import type { ListHistoryQuery } from '@affine/graphql';
|
||||
import {
|
||||
fetchWithTraceReport,
|
||||
type ListHistoryQuery,
|
||||
listHistoryQuery,
|
||||
recoverDocMutation,
|
||||
} from '@affine/graphql';
|
||||
|
||||
@@ -10,16 +10,15 @@ import { useWorkspaceQuota } from '@affine/core/hooks/use-workspace-quota';
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { CloseIcon, ToggleCollapseIcon } from '@blocksuite/icons';
|
||||
import type { Doc as BlockSuiteDoc } from '@blocksuite/store';
|
||||
import { type DocCollection } from '@blocksuite/store';
|
||||
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 { Doc, type PageMode, Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import type { PageMode } from '@toeverything/infra';
|
||||
import { Doc, useService, Workspace } from '@toeverything/infra';
|
||||
import { atom, useAtom, useSetAtom } from 'jotai';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import {
|
||||
Fragment,
|
||||
type PropsWithChildren,
|
||||
Suspense,
|
||||
useCallback,
|
||||
useLayoutEffect,
|
||||
|
||||
@@ -3,7 +3,8 @@ import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { chunk } from 'lodash-es';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
import { iconNames, nameToIcon, type PagePropertyIcon } from './icons-mapping';
|
||||
import type { PagePropertyIcon } from './icons-mapping';
|
||||
import { iconNames, nameToIcon } from './icons-mapping';
|
||||
import * as styles from './icons-selector.css';
|
||||
|
||||
const iconsPerRow = 6;
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
import type { MenuItemProps } from '@affine/component';
|
||||
import {
|
||||
Input,
|
||||
MenuIcon,
|
||||
MenuItem,
|
||||
type MenuItemProps,
|
||||
MenuSeparator,
|
||||
Scrollable,
|
||||
} from '@affine/component';
|
||||
import type { PageInfoCustomPropertyMeta } from '@affine/core/modules/workspace/properties/schema';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import {
|
||||
cloneElement,
|
||||
isValidElement,
|
||||
type KeyboardEventHandler,
|
||||
type MouseEventHandler,
|
||||
useCallback,
|
||||
} from 'react';
|
||||
import type { KeyboardEventHandler, MouseEventHandler } from 'react';
|
||||
import { cloneElement, isValidElement, useCallback } from 'react';
|
||||
|
||||
import type { PagePropertyIcon } from './icons-mapping';
|
||||
import {
|
||||
getDefaultIconName,
|
||||
getSafeIconName,
|
||||
nameToIcon,
|
||||
type PagePropertyIcon,
|
||||
} from './icons-mapping';
|
||||
import { IconsSelectorButton } from './icons-selector';
|
||||
import * as styles from './styles.css';
|
||||
|
||||
@@ -10,13 +10,8 @@ import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { Doc, useService, Workspace } from '@toeverything/infra';
|
||||
import { noop } from 'lodash-es';
|
||||
import {
|
||||
type ChangeEventHandler,
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
useState,
|
||||
} from 'react';
|
||||
import type { ChangeEventHandler } from 'react';
|
||||
import { useCallback, useContext, useEffect, useState } from 'react';
|
||||
|
||||
import { managerContext } from './common';
|
||||
import * as styles from './styles.css';
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { MenuProps } from '@affine/component';
|
||||
import {
|
||||
Button,
|
||||
IconButton,
|
||||
Menu,
|
||||
MenuIcon,
|
||||
MenuItem,
|
||||
type MenuProps,
|
||||
Tooltip,
|
||||
} from '@affine/component';
|
||||
import { useCurrentWorkspacePropertiesAdapter } from '@affine/core/hooks/use-affine-adapter';
|
||||
@@ -28,10 +28,9 @@ import {
|
||||
ViewIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import type { DragEndEvent, DraggableAttributes } from '@dnd-kit/core';
|
||||
import {
|
||||
DndContext,
|
||||
type DragEndEvent,
|
||||
type DraggableAttributes,
|
||||
PointerSensor,
|
||||
useSensor,
|
||||
useSensors,
|
||||
@@ -46,11 +45,13 @@ import clsx from 'clsx';
|
||||
import { use } from 'foxact/use';
|
||||
import { atom, useAtomValue, useSetAtom } from 'jotai';
|
||||
import type React from 'react';
|
||||
import type {
|
||||
CSSProperties,
|
||||
MouseEvent,
|
||||
MouseEventHandler,
|
||||
PropsWithChildren,
|
||||
} from 'react';
|
||||
import {
|
||||
type CSSProperties,
|
||||
type MouseEvent,
|
||||
type MouseEventHandler,
|
||||
type PropsWithChildren,
|
||||
Suspense,
|
||||
useCallback,
|
||||
useContext,
|
||||
@@ -62,14 +63,11 @@ import {
|
||||
import { AffinePageReference } from '../reference-link';
|
||||
import { managerContext } from './common';
|
||||
import { ConfirmDeletePropertyModal } from './confirm-delete-property-modal';
|
||||
import {
|
||||
getDefaultIconName,
|
||||
nameToIcon,
|
||||
type PagePropertyIcon,
|
||||
} from './icons-mapping';
|
||||
import type { PagePropertyIcon } from './icons-mapping';
|
||||
import { getDefaultIconName, nameToIcon } from './icons-mapping';
|
||||
import type { MenuItemOption } from './menu-items';
|
||||
import {
|
||||
EditPropertyNameMenuItem,
|
||||
type MenuItemOption,
|
||||
PropertyTypeMenuItem,
|
||||
renderMenuItemOptions,
|
||||
} from './menu-items';
|
||||
|
||||
@@ -1,30 +1,19 @@
|
||||
import {
|
||||
IconButton,
|
||||
Input,
|
||||
Menu,
|
||||
type MenuProps,
|
||||
Scrollable,
|
||||
} from '@affine/component';
|
||||
import type { MenuProps } from '@affine/component';
|
||||
import { IconButton, Input, Menu, Scrollable } from '@affine/component';
|
||||
import { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';
|
||||
import { DeleteTagConfirmModal, TagService } from '@affine/core/modules/tag';
|
||||
import { WorkspaceLegacyProperties } from '@affine/core/modules/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { DeleteIcon, MoreHorizontalIcon, TagsIcon } from '@blocksuite/icons';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import {
|
||||
type HTMLAttributes,
|
||||
type PropsWithChildren,
|
||||
useCallback,
|
||||
useMemo,
|
||||
useReducer,
|
||||
useState,
|
||||
} from 'react';
|
||||
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
||||
import { useCallback, useMemo, useReducer, useState } from 'react';
|
||||
|
||||
import { TagItem, TempTagItem } from '../../page-list';
|
||||
import { tagColors } from './common';
|
||||
import { type MenuItemOption, renderMenuItemOptions } from './menu-items';
|
||||
import type { MenuItemOption } from './menu-items';
|
||||
import { renderMenuItemOptions } from './menu-items';
|
||||
import * as styles from './tags-inline-editor.css';
|
||||
|
||||
interface TagsEditorProps {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { WorkbenchLink } from '@affine/core/modules/workbench';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { LinkedPageIcon, TodayIcon } from '@blocksuite/icons';
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import { type PropsWithChildren } from 'react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
|
||||
import * as styles from './styles.css';
|
||||
|
||||
|
||||
@@ -20,14 +20,8 @@ import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ArrowRightSmallIcon, CameraIcon } from '@blocksuite/icons';
|
||||
import bytes from 'bytes';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import {
|
||||
type FC,
|
||||
type MouseEvent,
|
||||
Suspense,
|
||||
useCallback,
|
||||
useMemo,
|
||||
useState,
|
||||
} from 'react';
|
||||
import type { FC, MouseEvent } from 'react';
|
||||
import { Suspense, useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import {
|
||||
authAtom,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { Switch } from '@affine/component';
|
||||
import { SettingHeader } from '@affine/component/setting-components';
|
||||
import { SettingRow } from '@affine/component/setting-components';
|
||||
import { SettingWrapper } from '@affine/component/setting-components';
|
||||
import {
|
||||
SettingHeader,
|
||||
SettingRow,
|
||||
SettingWrapper,
|
||||
} from '@affine/component/setting-components';
|
||||
import { useAppUpdater } from '@affine/core/hooks/use-app-updater';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ArrowRightSmallIcon, OpenInNewIcon } from '@blocksuite/icons';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Menu, MenuItem, MenuTrigger } from '@affine/component/ui/menu';
|
||||
import { dateFormatOptions, type DateFormats } from '@toeverything/infra';
|
||||
import type { DateFormats } from '@toeverything/infra';
|
||||
import { dateFormatOptions } from '@toeverything/infra';
|
||||
import dayjs from 'dayjs';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { RadioButton, RadioButtonGroup, Switch } from '@affine/component';
|
||||
import { SettingHeader } from '@affine/component/setting-components';
|
||||
import { SettingRow } from '@affine/component/setting-components';
|
||||
import { SettingWrapper } from '@affine/component/setting-components';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import {
|
||||
type AppSetting,
|
||||
fontStyleOptions,
|
||||
windowFrameStyleOptions,
|
||||
} from '@toeverything/infra';
|
||||
SettingHeader,
|
||||
SettingRow,
|
||||
SettingWrapper,
|
||||
} from '@affine/component/setting-components';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { AppSetting } from '@toeverything/infra';
|
||||
import { fontStyleOptions, windowFrameStyleOptions } from '@toeverything/infra';
|
||||
import { useTheme } from 'next-themes';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ import {
|
||||
import { Button, IconButton } from '@affine/component/ui/button';
|
||||
import { Loading } from '@affine/component/ui/loading';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import type { InvoicesQuery } from '@affine/graphql';
|
||||
import {
|
||||
createCustomerPortalMutation,
|
||||
getInvoicesCountQuery,
|
||||
type InvoicesQuery,
|
||||
invoicesQuery,
|
||||
InvoiceStatus,
|
||||
pricesQuery,
|
||||
@@ -29,10 +29,8 @@ import { openSettingModalAtom } from '../../../../../atoms';
|
||||
import { useCurrentLoginStatus } from '../../../../../hooks/affine/use-current-login-status';
|
||||
import { useMutation } from '../../../../../hooks/use-mutation';
|
||||
import { useQuery } from '../../../../../hooks/use-query';
|
||||
import {
|
||||
type SubscriptionMutator,
|
||||
useUserSubscription,
|
||||
} from '../../../../../hooks/use-subscription';
|
||||
import type { SubscriptionMutator } from '../../../../../hooks/use-subscription';
|
||||
import { useUserSubscription } from '../../../../../hooks/use-subscription';
|
||||
import { SWRErrorBoundary } from '../../../../pure/swr-error-bundary';
|
||||
import { CancelAction, ResumeAction } from '../plans/actions';
|
||||
import * as styles from './style.css';
|
||||
|
||||
@@ -16,7 +16,8 @@ import { useCurrentLoginStatus } from '../../../../../hooks/affine/use-current-l
|
||||
import { useQuery } from '../../../../../hooks/use-query';
|
||||
import { useUserSubscription } from '../../../../../hooks/use-subscription';
|
||||
import { PlanLayout } from './layout';
|
||||
import { type FixedPrice, getPlanDetail, PlanCard } from './plan-card';
|
||||
import type { FixedPrice } from './plan-card';
|
||||
import { getPlanDetail, PlanCard } from './plan-card';
|
||||
import { PlansSkeleton } from './skeleton';
|
||||
import * as styles from './style.css';
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import { Button } from '@affine/component/ui/button';
|
||||
import {
|
||||
ConfirmModal,
|
||||
type ConfirmModalProps,
|
||||
Modal,
|
||||
} from '@affine/component/ui/modal';
|
||||
import type { ConfirmModalProps } from '@affine/component/ui/modal';
|
||||
import { ConfirmModal, Modal } from '@affine/component/ui/modal';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { DialogTrigger } from '@radix-ui/react-dialog';
|
||||
import { type ReactNode, useEffect, useRef } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
import * as styles from './style.css';
|
||||
|
||||
|
||||
@@ -15,17 +15,10 @@ import {
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { DoneIcon } from '@blocksuite/icons';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useAtom } from 'jotai';
|
||||
import { useAtom, useSetAtom } from 'jotai';
|
||||
import { nanoid } from 'nanoid';
|
||||
import {
|
||||
type PropsWithChildren,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { openPaymentDisableAtom } from '../../../../../atoms';
|
||||
import { authAtom } from '../../../../../atoms/index';
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { SettingHeader } from '@affine/component/setting-components';
|
||||
import { SettingWrapper } from '@affine/component/setting-components';
|
||||
import {
|
||||
SettingHeader,
|
||||
SettingWrapper,
|
||||
} from '@affine/component/setting-components';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
|
||||
import type { ShortcutsInfo } from '../../../../../hooks/affine/use-shortcuts';
|
||||
import {
|
||||
type ShortcutsInfo,
|
||||
useEdgelessShortcuts,
|
||||
useGeneralShortcuts,
|
||||
useMarkdownShortcuts,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Loading } from '@affine/component';
|
||||
import { WorkspaceDetailSkeleton } from '@affine/component/setting-components';
|
||||
import { Modal, type ModalProps } from '@affine/component/ui/modal';
|
||||
import type { ModalProps } from '@affine/component/ui/modal';
|
||||
import { Modal } from '@affine/component/ui/modal';
|
||||
import {
|
||||
openIssueFeedbackModalAtom,
|
||||
openStarAFFiNEModalAtom,
|
||||
@@ -17,12 +18,8 @@ import { AccountSetting } from './account-setting';
|
||||
import { GeneralSetting } from './general-setting';
|
||||
import { SettingSidebar } from './setting-sidebar';
|
||||
import * as style from './style.css';
|
||||
import {
|
||||
type ActiveTab,
|
||||
type GeneralSettingKey,
|
||||
GeneralSettingKeys,
|
||||
type WorkspaceSubTab,
|
||||
} from './types';
|
||||
import type { ActiveTab, GeneralSettingKey, WorkspaceSubTab } from './types';
|
||||
import { GeneralSettingKeys } from './types';
|
||||
import { WorkspaceSetting } from './workspace-setting';
|
||||
|
||||
export interface SettingProps extends ModalProps {
|
||||
|
||||
@@ -11,16 +11,17 @@ import { useWorkspaceInfo } from '@affine/core/hooks/use-workspace-info';
|
||||
import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { Logo1Icon } from '@blocksuite/icons';
|
||||
import type { WorkspaceMetadata } from '@toeverything/infra';
|
||||
import {
|
||||
useLiveData,
|
||||
useService,
|
||||
Workspace,
|
||||
WorkspaceManager,
|
||||
type WorkspaceMetadata,
|
||||
} from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import { useAtom } from 'jotai/react';
|
||||
import { type ReactElement, Suspense, useCallback, useMemo } from 'react';
|
||||
import type { ReactElement } from 'react';
|
||||
import { Suspense, useCallback, useMemo } from 'react';
|
||||
|
||||
import { authAtom } from '../../../../atoms';
|
||||
import { useCurrentLoginStatus } from '../../../../hooks/affine/use-current-login-status';
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Input } from '@affine/component';
|
||||
import {
|
||||
ConfirmModal,
|
||||
type ConfirmModalProps,
|
||||
} from '@affine/component/ui/modal';
|
||||
import type { ConfirmModalProps } from '@affine/component/ui/modal';
|
||||
import { ConfirmModal } from '@affine/component/ui/modal';
|
||||
import { useWorkspaceInfo } from '@affine/core/hooks/use-workspace-info';
|
||||
import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
|
||||
@@ -4,9 +4,12 @@ import { ConfirmModal } from '@affine/component/ui/modal';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ArrowRightSmallIcon } from '@blocksuite/icons';
|
||||
import { Workspace, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import {
|
||||
useLiveData,
|
||||
useService,
|
||||
Workspace,
|
||||
WorkspaceManager,
|
||||
} from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import { useWorkspaceInfo } from '@affine/core/hooks/use-workspace-info';
|
||||
import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { type Workspace, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import type { Workspace } from '@toeverything/infra';
|
||||
import { useService, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useState } from 'react';
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import {
|
||||
InviteModal,
|
||||
type InviteModalProps,
|
||||
MemberLimitModal,
|
||||
import type {
|
||||
InviteModalProps,
|
||||
PaginationProps,
|
||||
} from '@affine/component/member-components';
|
||||
import {
|
||||
InviteModal,
|
||||
MemberLimitModal,
|
||||
Pagination,
|
||||
type PaginationProps,
|
||||
} from '@affine/component/member-components';
|
||||
import { pushNotificationAtom } from '@affine/component/notification-center';
|
||||
import { SettingRow } from '@affine/component/setting-components';
|
||||
@@ -20,7 +20,8 @@ import type { CheckedUser } from '@affine/core/hooks/affine/use-current-user';
|
||||
import { useCurrentUser } from '@affine/core/hooks/affine/use-current-user';
|
||||
import { useInviteMember } from '@affine/core/hooks/affine/use-invite-member';
|
||||
import { useMemberCount } from '@affine/core/hooks/affine/use-member-count';
|
||||
import { type Member, useMembers } from '@affine/core/hooks/affine/use-members';
|
||||
import type { Member } from '@affine/core/hooks/affine/use-members';
|
||||
import { useMembers } from '@affine/core/hooks/affine/use-members';
|
||||
import { useRevokeMemberPermission } from '@affine/core/hooks/affine/use-revoke-member-permission';
|
||||
import { useWorkspaceQuota } from '@affine/core/hooks/use-quota';
|
||||
import { useUserSubscription } from '@affine/core/hooks/use-subscription';
|
||||
|
||||
@@ -12,13 +12,8 @@ import { CameraIcon } from '@blocksuite/icons';
|
||||
import type { Workspace } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import {
|
||||
type KeyboardEvent,
|
||||
type MouseEvent,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useState,
|
||||
} from 'react';
|
||||
import type { KeyboardEvent, MouseEvent } from 'react';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import * as style from './style.css';
|
||||
import type { WorkspaceSettingDetailProps } from './types';
|
||||
|
||||
@@ -5,8 +5,7 @@ import { Tooltip } from '@affine/component/ui/tooltip';
|
||||
import { apis, events } from '@affine/electron-api';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { WorkspaceMetadata } from '@toeverything/infra';
|
||||
import { useMemo } from 'react';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
const useDBFileSecondaryPath = (workspaceId: string) => {
|
||||
const [path, setPath] = useState<string | undefined>(undefined);
|
||||
|
||||
@@ -8,10 +8,10 @@ import { Trans } from '@affine/i18n';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { DeleteIcon, FilterIcon, MoreHorizontalIcon } from '@blocksuite/icons';
|
||||
import type { Workspace, WorkspaceMetadata } from '@toeverything/infra';
|
||||
import type { MouseEvent } from 'react';
|
||||
import {
|
||||
createContext,
|
||||
Fragment,
|
||||
type MouseEvent,
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
@@ -19,16 +19,16 @@ import {
|
||||
useState,
|
||||
} from 'react';
|
||||
|
||||
import type { PagePropertyIcon } from '../../../page-properties';
|
||||
import {
|
||||
nameToIcon,
|
||||
PagePropertiesCreatePropertyMenuItems,
|
||||
PagePropertiesMetaManager,
|
||||
type PagePropertyIcon,
|
||||
} from '../../../page-properties';
|
||||
import { ConfirmDeletePropertyModal } from '../../../page-properties/confirm-delete-property-modal';
|
||||
import type { MenuItemOption } from '../../../page-properties/menu-items';
|
||||
import {
|
||||
EditPropertyNameMenuItem,
|
||||
type MenuItemOption,
|
||||
PropertyTypeMenuItem,
|
||||
renderMenuItemOptions,
|
||||
} from '../../../page-properties/menu-items';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import { type Workspace, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import type { Workspace } from '@toeverything/infra';
|
||||
import { useService, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useState } from 'react';
|
||||
|
||||
import { useNavigateHelper } from '../../../hooks/use-navigate-helper';
|
||||
|
||||
@@ -4,8 +4,7 @@ import { ExportMenuItems } from '@affine/core/components/page-list';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { LinkIcon } from '@blocksuite/icons';
|
||||
import { Doc, useLiveData } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { Doc, useLiveData, useService } from '@toeverything/infra';
|
||||
|
||||
import { useExportPage } from '../../../../hooks/affine/use-export-page';
|
||||
import * as styles from './index.css';
|
||||
|
||||
@@ -13,11 +13,9 @@ import { useServerBaseUrl } from '@affine/core/hooks/affine/use-server-config';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ArrowRightSmallIcon } from '@blocksuite/icons';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { Doc, type PageMode } from '@toeverything/infra';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
import type { PageMode } from '@toeverything/infra';
|
||||
import { Doc, useLiveData, useService } from '@toeverything/infra';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import { CloudSvg } from '../cloud-svg';
|
||||
import * as styles from './index.css';
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import {
|
||||
ConfirmModal,
|
||||
type ConfirmModalProps,
|
||||
} from '@affine/component/ui/modal';
|
||||
import type { ConfirmModalProps } from '@affine/component/ui/modal';
|
||||
import { ConfirmModal } from '@affine/component/ui/modal';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Empty } from '@affine/component';
|
||||
import { Modal, type ModalProps } from '@affine/component/ui/modal';
|
||||
import type { ModalProps } from '@affine/component/ui/modal';
|
||||
import { Modal } from '@affine/component/ui/modal';
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Skeleton } from '@affine/component';
|
||||
import { ResizePanel } from '@affine/component/resize-panel';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useServiceOptional } from '@toeverything/infra';
|
||||
import { useServiceOptional, Workspace } from '@toeverything/infra';
|
||||
import { useAtom, useAtomValue } from 'jotai';
|
||||
import { debounce } from 'lodash-es';
|
||||
import type { PropsWithChildren, ReactElement } from 'react';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { useHasScrollTop } from '@affine/component';
|
||||
import * as ScrollArea from '@radix-ui/react-scroll-area';
|
||||
import clsx from 'clsx';
|
||||
import { type PropsWithChildren, useRef } from 'react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import { useRef } from 'react';
|
||||
|
||||
import * as styles from './index.css';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
import { type PropsWithChildren } from 'react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
|
||||
import { Spotlight } from './index';
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ import type {
|
||||
EdgelessEditor,
|
||||
PageEditor,
|
||||
} from '@blocksuite/presets';
|
||||
import { type Doc, Slot } from '@blocksuite/store';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import { Slot } from '@blocksuite/store';
|
||||
import type { PageMode } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import type React from 'react';
|
||||
import type { RefObject } from 'react';
|
||||
import {
|
||||
forwardRef,
|
||||
type RefObject,
|
||||
useEffect,
|
||||
useLayoutEffect,
|
||||
useMemo,
|
||||
|
||||
@@ -17,10 +17,8 @@ import {
|
||||
useRef,
|
||||
} from 'react';
|
||||
|
||||
import {
|
||||
AffinePageReference,
|
||||
type PageReferenceRendererOptions,
|
||||
} from '../../affine/reference-link';
|
||||
import type { PageReferenceRendererOptions } from '../../affine/reference-link';
|
||||
import { AffinePageReference } from '../../affine/reference-link';
|
||||
import { BlocksuiteEditorContainer } from './blocksuite-editor-container';
|
||||
import { NoPageRootError } from './no-page-error';
|
||||
import type { InlineRenderers } from './specs';
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
EdgelessEditor,
|
||||
PageEditor,
|
||||
} from '@blocksuite/presets';
|
||||
import { type Doc } from '@blocksuite/store';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import React, {
|
||||
forwardRef,
|
||||
Fragment,
|
||||
@@ -23,12 +23,8 @@ import React, {
|
||||
|
||||
import { PagePropertiesTable } from '../../affine/page-properties';
|
||||
import { BlocksuiteEditorJournalDocTitle } from './journal-doc-title';
|
||||
import {
|
||||
docModeSpecs,
|
||||
edgelessModeSpecs,
|
||||
type InlineRenderers,
|
||||
patchSpecs,
|
||||
} from './specs';
|
||||
import type { InlineRenderers } from './specs';
|
||||
import { docModeSpecs, edgelessModeSpecs, patchSpecs } from './specs';
|
||||
import * as styles from './styles.css';
|
||||
|
||||
const adapted = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import { type Map as YMap } from 'yjs';
|
||||
import type { Map as YMap } from 'yjs';
|
||||
|
||||
/**
|
||||
* TODO: Define error to unexpected state together in the future.
|
||||
|
||||
@@ -4,8 +4,7 @@ import { useBlockSuiteDocMeta } from '@affine/core/hooks/use-block-suite-page-me
|
||||
import { toast } from '@affine/core/utils';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useService, Workspace } from '@toeverything/infra';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
export interface FavoriteButtonProps {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { WeekDatePicker, type WeekDatePickerHandle } from '@affine/component';
|
||||
import type { WeekDatePickerHandle } from '@affine/component';
|
||||
import { WeekDatePicker } from '@affine/component';
|
||||
import {
|
||||
useJournalInfoHelper,
|
||||
useJournalRouteHelper,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { InlineEdit, type InlineEditProps } from '@affine/component';
|
||||
import type { InlineEditProps } from '@affine/component';
|
||||
import { InlineEdit } from '@affine/component';
|
||||
import {
|
||||
useBlockSuiteDocMeta,
|
||||
useDocMetaHelper,
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import { Tooltip } from '@affine/component/ui/tooltip';
|
||||
import { useBlockSuiteDocMeta } from '@affine/core/hooks/use-block-suite-page-meta';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import {
|
||||
Doc,
|
||||
type PageMode,
|
||||
useLiveData,
|
||||
useService,
|
||||
} from '@toeverything/infra';
|
||||
import type { PageMode } from '@toeverything/infra';
|
||||
import { Doc, useLiveData, useService } from '@toeverything/infra';
|
||||
import type { CSSProperties } from 'react';
|
||||
import { useCallback, useEffect } from 'react';
|
||||
|
||||
|
||||
@@ -3,9 +3,7 @@ import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { useDocMetaHelper } from '@affine/core/hooks/use-block-suite-page-meta';
|
||||
import { useDocCollectionHelper } from '@affine/core/hooks/use-block-suite-workspace-helper';
|
||||
import { WorkspaceSubPath } from '@affine/core/shared';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { PageRecordList } from '@toeverything/infra';
|
||||
import { initEmptyPage } from '@toeverything/infra';
|
||||
import { initEmptyPage, PageRecordList, useService } from '@toeverything/infra';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
import { useNavigateHelper } from '../../../hooks/use-navigate-helper';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { cssVar } from '@toeverything/theme';
|
||||
import { baseTheme } from '@toeverything/theme';
|
||||
import { baseTheme, cssVar } from '@toeverything/theme';
|
||||
import { keyframes, style } from '@vanilla-extract/css';
|
||||
const fadeInAnimation = keyframes({
|
||||
from: {
|
||||
|
||||
@@ -18,8 +18,7 @@ import clsx from 'clsx';
|
||||
import { useErrorBoundary } from 'foxact/use-error-boundary';
|
||||
import { useAtom } from 'jotai';
|
||||
import type { PropsWithChildren, ReactElement } from 'react';
|
||||
import { Suspense, useCallback } from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { Suspense, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import type { FallbackProps } from 'react-error-boundary';
|
||||
import { ErrorBoundary } from 'react-error-boundary';
|
||||
|
||||
@@ -3,15 +3,14 @@ import './page-detail-editor.css';
|
||||
import { useDocCollectionPage } from '@affine/core/hooks/use-block-suite-workspace-page';
|
||||
import { assertExists, DisposableGroup } from '@blocksuite/global/utils';
|
||||
import type { AffineEditorContainer } from '@blocksuite/presets';
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import type { Doc as BlockSuiteDoc } from '@blocksuite/store';
|
||||
import type { Doc as BlockSuiteDoc, DocCollection } from '@blocksuite/store';
|
||||
import type { PageMode } from '@toeverything/infra';
|
||||
import {
|
||||
Doc,
|
||||
type PageMode,
|
||||
fontStyleOptions,
|
||||
useLiveData,
|
||||
useService,
|
||||
} from '@toeverything/infra';
|
||||
import { fontStyleOptions } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import type { CSSProperties } from 'react';
|
||||
import { memo, Suspense, useCallback, useMemo } from 'react';
|
||||
|
||||
@@ -9,8 +9,7 @@ import type { Doc } from '@blocksuite/store';
|
||||
import { DocCollection, Schema } from '@blocksuite/store';
|
||||
import { renderHook } from '@testing-library/react';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { describe, expect, test, vi } from 'vitest';
|
||||
import { beforeEach } from 'vitest';
|
||||
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
||||
|
||||
import { useBlockSuitePagePreview } from '../use-block-suite-page-preview';
|
||||
let docCollection: DocCollection;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Checkbox } from '@affine/component';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { useDraggable } from '@dnd-kit/core';
|
||||
import { type PropsWithChildren, useCallback, useMemo } from 'react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import type {
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
import { useDeleteCollectionInfo } from '@affine/core/hooks/affine/use-delete-collection-info';
|
||||
import type { Collection, DeleteCollectionInfo } from '@affine/env/filter';
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import {
|
||||
type ReactElement,
|
||||
useCallback,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { useService, Workspace } from '@toeverything/infra';
|
||||
import type { ReactElement } from 'react';
|
||||
import { useCallback, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { CollectionService } from '../../../modules/collection';
|
||||
import { ListFloatingToolbar } from '../components/list-floating-toolbar';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { IconButton, type IconButtonProps } from '@affine/component';
|
||||
import { Tooltip } from '@affine/component';
|
||||
import type { IconButtonProps } from '@affine/component';
|
||||
import { IconButton, Tooltip } from '@affine/component';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { FavoritedIcon, FavoriteIcon } from '@blocksuite/icons';
|
||||
import Lottie from 'lottie-react';
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import * as Popover from '@radix-ui/react-popover';
|
||||
import * as Toolbar from '@radix-ui/react-toolbar';
|
||||
import clsx from 'clsx';
|
||||
import {
|
||||
type CSSProperties,
|
||||
type HTMLAttributes,
|
||||
type MouseEventHandler,
|
||||
type PropsWithChildren,
|
||||
type ReactNode,
|
||||
import type {
|
||||
CSSProperties,
|
||||
HTMLAttributes,
|
||||
MouseEventHandler,
|
||||
PropsWithChildren,
|
||||
ReactNode,
|
||||
} from 'react';
|
||||
|
||||
import * as styles from './floating-toolbar.css';
|
||||
|
||||
@@ -2,7 +2,8 @@ import { DropdownButton, Menu } from '@affine/component';
|
||||
import { BlockCard } from '@affine/component/card/block-card';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { EdgelessIcon, ImportIcon, PageIcon } from '@blocksuite/icons';
|
||||
import { type PropsWithChildren, useCallback, useState } from 'react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { menuContent } from './new-page-button.css';
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Button, Divider, Menu, Scrollable } from '@affine/component';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';
|
||||
import { type Tag, TagService } from '@affine/core/modules/tag';
|
||||
import type { Tag } from '@affine/core/modules/tag';
|
||||
import { TagService } from '@affine/core/modules/tag';
|
||||
import type { Collection } from '@affine/env/filter';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import {
|
||||
|
||||
@@ -2,7 +2,8 @@ import { Checkbox } from '@affine/component';
|
||||
import { TagService } from '@affine/core/modules/tag';
|
||||
import { useDraggable } from '@dnd-kit/core';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { type PropsWithChildren, useCallback, useMemo } from 'react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
import { WorkbenchLink } from '../../../modules/workbench/view/workbench-link';
|
||||
import type { DraggableTitleCellData, PageListItemProps } from '../types';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useService, Workspace } from '@toeverything/infra';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
|
||||
import { usePageHelper } from '../../blocksuite/block-suite-page-list/utils';
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Menu } from '@affine/component';
|
||||
import { type Tag } from '@affine/core/modules/tag';
|
||||
import type { Tag } from '@affine/core/modules/tag';
|
||||
import { CloseIcon, MoreHorizontalIcon } from '@blocksuite/icons';
|
||||
import { LiveData, useLiveData } from '@toeverything/infra';
|
||||
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
||||
import clsx from 'clsx';
|
||||
import { type MouseEventHandler, useCallback, useMemo } from 'react';
|
||||
import type { MouseEventHandler } from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
import { stopPropagation } from '../utils';
|
||||
import * as styles from './page-tags.css';
|
||||
|
||||
@@ -8,8 +8,7 @@ import type { Collection, Filter } from '@affine/env/filter';
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService, Workspace } from '@toeverything/infra';
|
||||
import { useCallback, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { usePageHelper } from '../../blocksuite/block-suite-page-list/utils';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Menu, MenuItem } from '@affine/component';
|
||||
import type { Filter, Literal } from '@affine/env/filter';
|
||||
import type { PropertiesMeta } from '@affine/env/filter';
|
||||
import type { Filter, Literal, PropertiesMeta } from '@affine/env/filter';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { DatePicker, Popover, type PopoverProps } from '@affine/component';
|
||||
import type { PopoverProps } from '@affine/component';
|
||||
import { DatePicker, Popover } from '@affine/component';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import dayjs from 'dayjs';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Button, IconButton, Menu } from '@affine/component';
|
||||
import type { Filter } from '@affine/env/filter';
|
||||
import type { PropertiesMeta } from '@affine/env/filter';
|
||||
import type { Filter, PropertiesMeta } from '@affine/env/filter';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { CloseIcon, PlusIcon } from '@blocksuite/icons';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Input, Menu, MenuItem } from '@affine/component';
|
||||
import type { LiteralValue, Tag } from '@affine/env/filter';
|
||||
import { type ReactNode } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
import { DateSelect } from './date-select';
|
||||
import { FilterTag } from './filter-tag-translation';
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import { Trans } from '@affine/i18n';
|
||||
|
||||
import type { ItemGroupDefinition, ItemGroupProps, ListItem } from './types';
|
||||
import { type DateKey } from './types';
|
||||
import type {
|
||||
DateKey,
|
||||
ItemGroupDefinition,
|
||||
ItemGroupProps,
|
||||
ListItem,
|
||||
} from './types';
|
||||
import { betweenDaysAgo, withinDaysAgo } from './utils';
|
||||
|
||||
// todo: optimize date matchers
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { Scrollable, useHasScrollTop } from '@affine/component';
|
||||
import clsx from 'clsx';
|
||||
import type { ForwardedRef, PropsWithChildren } from 'react';
|
||||
import {
|
||||
type ForwardedRef,
|
||||
forwardRef,
|
||||
memo,
|
||||
type PropsWithChildren,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useImperativeHandle,
|
||||
|
||||
@@ -32,11 +32,8 @@ import { DisablePublicSharing, MoveToTrash } from './operation-menu-items';
|
||||
import { CreateOrEditTag } from './tags/create-tag';
|
||||
import type { TagMeta } from './types';
|
||||
import { ColWrapper, stopPropagationWithoutPrevent } from './utils';
|
||||
import {
|
||||
type AllPageListConfig,
|
||||
useEditCollection,
|
||||
useEditCollectionName,
|
||||
} from './view';
|
||||
import type { AllPageListConfig } from './view';
|
||||
import { useEditCollection, useEditCollectionName } from './view';
|
||||
|
||||
export interface PageOperationCellProps {
|
||||
favorite: boolean;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { MenuIcon, MenuItem, type MenuItemProps } from '@affine/component';
|
||||
import type { MenuItemProps } from '@affine/component';
|
||||
import { MenuIcon, MenuItem } from '@affine/component';
|
||||
import { PublicLinkDisableModal } from '@affine/component/disable-public-link';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ShareIcon } from '@blocksuite/icons';
|
||||
|
||||
@@ -7,7 +7,8 @@ import {
|
||||
ExportToPdfIcon,
|
||||
ExportToPngIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { type ReactNode, useMemo } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { transitionStyle } from './index.css';
|
||||
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import {
|
||||
ConfirmModal,
|
||||
type ConfirmModalProps,
|
||||
MenuIcon,
|
||||
MenuItem,
|
||||
type MenuItemProps,
|
||||
} from '@affine/component';
|
||||
import type { ConfirmModalProps, MenuItemProps } from '@affine/component';
|
||||
import { ConfirmModal, MenuIcon, MenuItem } from '@affine/component';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { DeleteIcon } from '@blocksuite/icons';
|
||||
|
||||
|
||||
@@ -11,12 +11,11 @@ import {
|
||||
} from '@blocksuite/icons';
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/store';
|
||||
import * as Collapsible from '@radix-ui/react-collapsible';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { PageRecordList } from '@toeverything/infra';
|
||||
import { PageRecordList, useLiveData, useService } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import { selectAtom } from 'jotai/utils';
|
||||
import { type MouseEventHandler, useCallback, useMemo, useState } from 'react';
|
||||
import type { MouseEventHandler } from 'react';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import { CollectionListItem } from './collections/collection-list-item';
|
||||
import { PageListItem } from './docs/page-list-item';
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { Checkbox, type CheckboxProps } from '@affine/component';
|
||||
import type { CheckboxProps } from '@affine/component';
|
||||
import { Checkbox } from '@affine/component';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { MultiSelectIcon } from '@blocksuite/icons';
|
||||
import clsx from 'clsx';
|
||||
import { selectAtom } from 'jotai/utils';
|
||||
import { type MouseEventHandler, useCallback } from 'react';
|
||||
import type { MouseEventHandler } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { ListHeaderCell } from './components/list-header-cell';
|
||||
import * as styles from './page-header.css';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Checkbox } from '@affine/component';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { useDraggable } from '@dnd-kit/core';
|
||||
import { type PropsWithChildren, useCallback, useMemo } from 'react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import type { DraggableTitleCellData, TagListItemProps } from '../types';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { Tag } from '@affine/core/modules/tag';
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService, Workspace } from '@toeverything/infra';
|
||||
import { useCallback, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { ListFloatingToolbar } from '../components/list-floating-toolbar';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import clsx from 'clsx';
|
||||
import { type BaseSyntheticEvent, forwardRef } from 'react';
|
||||
import type { BaseSyntheticEvent } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
import * as styles from './list.css';
|
||||
import type { ColWrapperProps } from './types';
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
import { Button } from '@affine/component';
|
||||
import { FlexWrapper } from '@affine/component';
|
||||
import { Menu } from '@affine/component';
|
||||
import { Button, FlexWrapper, Menu } from '@affine/component';
|
||||
import type {
|
||||
Collection,
|
||||
DeleteCollectionInfo,
|
||||
Filter,
|
||||
PropertiesMeta,
|
||||
} from '@affine/env/filter';
|
||||
import type { PropertiesMeta } from '@affine/env/filter';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { FilterIcon } from '@blocksuite/icons';
|
||||
|
||||
import { CreateFilterMenu } from '../filter/vars';
|
||||
import * as styles from './collection-list.css';
|
||||
import { CollectionOperations } from './collection-operations';
|
||||
import { type AllPageListConfig } from './edit-collection/edit-collection';
|
||||
import type { AllPageListConfig } from './edit-collection/edit-collection';
|
||||
|
||||
export const CollectionPageListOperationsMenu = ({
|
||||
collection,
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import {
|
||||
Menu,
|
||||
MenuIcon,
|
||||
MenuItem,
|
||||
type MenuItemProps,
|
||||
} from '@affine/component';
|
||||
import type { MenuItemProps } from '@affine/component';
|
||||
import { Menu, MenuIcon, MenuItem } from '@affine/component';
|
||||
import { useAppSettingHelper } from '@affine/core/hooks/affine/use-app-setting-helper';
|
||||
import { Workbench } from '@affine/core/modules/workbench';
|
||||
import type { Collection, DeleteCollectionInfo } from '@affine/env/filter';
|
||||
@@ -15,12 +11,8 @@ import {
|
||||
SplitViewIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import {
|
||||
type PropsWithChildren,
|
||||
type ReactElement,
|
||||
useCallback,
|
||||
useMemo,
|
||||
} from 'react';
|
||||
import type { PropsWithChildren, ReactElement } from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
import { CollectionService } from '../../../modules/collection';
|
||||
import * as styles from './collection-operations.css';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Button, Input, Modal } from '@affine/component';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { type KeyboardEvent } from 'react';
|
||||
import type { KeyboardEvent } from 'react';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import * as styles from './create-collection.css';
|
||||
|
||||
@@ -8,7 +8,8 @@ import type { Collection } from '@affine/env/filter';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { DocCollection, DocMeta } from '@blocksuite/store';
|
||||
import type { DialogContentProps } from '@radix-ui/react-dialog';
|
||||
import { type ReactNode, useCallback, useMemo, useState } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import * as styles from './edit-collection.css';
|
||||
import { PagesMode } from './pages-mode';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user