chore: prohibit import package itself (#2612)

Co-authored-by: Whitewater <me@waterwater.moe>
This commit is contained in:
Himself65
2023-05-31 15:00:50 +08:00
parent 3eef11416a
commit 52c1efee9e
38 changed files with 138 additions and 98 deletions

View File

@@ -1,4 +1,3 @@
import { IconButton } from '@affine/component';
import {
DeleteTemporarilyIcon,
SettingsIcon,
@@ -8,6 +7,7 @@ import type { Meta, StoryFn } from '@storybook/react';
import { useAtom } from 'jotai';
import { type PropsWithChildren, useState } from 'react';
import { IconButton } from '../..';
import { AppSidebar, AppSidebarFallback, appSidebarOpenAtom } from '.';
import { AddPageButton } from './add-page-button';
import { CategoryDivider } from './category-divider';

View File

@@ -1,4 +1,3 @@
import { IconButton } from '@affine/component';
import { getEnvironment } from '@affine/env/config';
import {
ArrowLeftSmallIcon,
@@ -7,6 +6,7 @@ import {
} from '@blocksuite/icons';
import { useAtom } from 'jotai';
import { IconButton } from '../../..';
import type { History } from '..';
import { navHeaderStyle, sidebarButtonStyle } from '../index.css';
import { appSidebarOpenAtom } from '../index.jotai';

View File

@@ -1,5 +1,3 @@
import { MenuItem, MuiClickAwayListener, PureMenu } from '@affine/component';
import type { EditorPlugin } from '@affine/component/block-suite-editor';
import type { SerializedBlock } from '@blocksuite/blocks';
import {
getCurrentBlockRange,
@@ -10,6 +8,9 @@ import type { Page } from '@blocksuite/store';
import { assertExists } from '@blocksuite/store';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { MenuItem, MuiClickAwayListener, PureMenu } from '../../..';
import type { EditorPlugin } from '..';
type ShortcutMap = {
[key: string]: (e: KeyboardEvent, page: Page) => void;
};

View File

@@ -1,11 +1,6 @@
import {
FlexWrapper,
Modal,
ModalCloseButton,
ModalWrapper,
} from '@affine/component';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { FlexWrapper, Modal, ModalCloseButton, ModalWrapper } from '../..';
import {
DiscordIcon,
DocIcon,

View File

@@ -1,4 +1,4 @@
import { absoluteCenter, displayFlex, styled } from '@affine/component';
import { absoluteCenter, displayFlex, styled } from '../..';
export const StyledBigLink = styled('a')(() => {
return {

View File

@@ -1,10 +1,3 @@
import {
Table,
TableBody,
TableCell,
TableHead,
TableRow,
} from '@affine/component';
import { DEFAULT_SORT_KEY } from '@affine/env/constant';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { ArrowDownBigIcon, ArrowUpBigIcon } from '@blocksuite/icons';
@@ -12,6 +5,7 @@ import { useMediaQuery, useTheme } from '@mui/material';
import type React from 'react';
import { type CSSProperties } from 'react';
import { Table, TableBody, TableCell, TableHead, TableRow } from '../..';
import { AllPagesBody } from './all-pages-body';
import { NewPageButton } from './components/new-page-buttton';
import { TitleCell } from './components/title-cell';

View File

@@ -1,9 +1,9 @@
import { styled, TableBody, TableCell } from '@affine/component';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { useDraggable } from '@dnd-kit/core';
import type { ReactNode } from 'react';
import { Fragment } from 'react';
import { styled, TableBody, TableCell } from '../../..';
import { FavoriteTag } from './components/favorite-tag';
import { TitleCell } from './components/title-cell';
import { OperationCell } from './operation-cell';

View File

@@ -1,9 +1,10 @@
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 { forwardRef } from 'react';
import type { IconButtonProps } from '../../..';
import { IconButton, Tooltip } from '../../..';
export const FavoriteTag = forwardRef<
HTMLButtonElement,
{

View File

@@ -1,7 +1,7 @@
import type { TableCellProps } from '@affine/component';
import { Content, TableCell } from '@affine/component';
import React, { useCallback } from 'react';
import type { TableCellProps } from '../../..';
import { Content, TableCell } from '../../..';
import {
StyledTitleContentWrapper,
StyledTitleLink,

View File

@@ -1,5 +1,4 @@
import { Menu } from '@affine/component';
import { Menu } from '../../..';
import { Condition } from './condition';
import type { Filter } from './vars';
import { CreateFilterMenu } from './vars';

View File

@@ -1,3 +1,5 @@
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import {
Content,
Table,
@@ -5,9 +7,7 @@ import {
TableCell,
TableHead,
TableRow,
} from '@affine/component';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
} from '../../..';
import { AllPagesBody } from './all-pages-body';
import { NewPageButton } from './components/new-page-buttton';
import {

View File

@@ -1,11 +1,3 @@
import {
Confirm,
FlexWrapper,
IconButton,
Menu,
MenuItem,
Tooltip,
} from '@affine/component';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import {
DeletePermanentlyIcon,
@@ -18,6 +10,14 @@ import {
import type React from 'react';
import { useState } from 'react';
import {
Confirm,
FlexWrapper,
IconButton,
Menu,
MenuItem,
Tooltip,
} from '../../..';
import { DisablePublicSharing, MoveToTrash } from './operation-menu-items';
export type OperationCellProps = {

View File

@@ -1,8 +1,8 @@
import { MenuItem, toast } from '@affine/component';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { CopyIcon } from '@blocksuite/icons';
import { useCallback } from 'react';
import { MenuItem, toast } from '../../..';
import type { CommonMenuItemProps } from './types';
export const CopyLink = ({ onItemClick, onSelect }: CommonMenuItemProps) => {

View File

@@ -1,8 +1,8 @@
import { MenuItem, styled } from '@affine/component';
import { PublicLinkDisableModal } from '@affine/component/share-menu';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { ShareIcon } from '@blocksuite/icons';
import { MenuItem, styled } from '../../../';
import { PublicLinkDisableModal } from '../../share-menu';
import type { CommonMenuItemProps } from './types';
const StyledMenuItem = styled(MenuItem)(({ theme }) => {

View File

@@ -1,4 +1,3 @@
import { Menu, MenuItem } from '@affine/component';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import type { PageBlockModel } from '@blocksuite/blocks';
import { ContentParser } from '@blocksuite/blocks/content-parser';
@@ -12,6 +11,7 @@ import {
} from '@blocksuite/icons';
import { useRef } from 'react';
import { Menu, MenuItem } from '../../..';
import type { CommonMenuItemProps } from './types';
export const Export = ({

View File

@@ -1,8 +1,8 @@
import type { ConfirmProps } from '@affine/component';
import { Confirm, MenuItem } from '@affine/component';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { DeleteTemporarilyIcon } from '@blocksuite/icons';
import type { ConfirmProps } from '../../..';
import { Confirm, MenuItem } from '../../..';
import type { CommonMenuItemProps } from './types';
export const MoveToTrash = ({

View File

@@ -1,5 +1,5 @@
import { Content, displayFlex, styled } from '@affine/component';
import { TableRow } from '@affine/component';
import { TableRow } from '../..';
import { Content, displayFlex, styled } from '../../';
export const StyledTableContainer = styled('div')(({ theme }) => {
return {

View File

@@ -1,7 +1,7 @@
import { Button, Input, Modal, ModalWrapper } from '@affine/component';
import { uuidv4 } from '@blocksuite/store';
import { useState } from 'react';
import { Button, Input, Modal, ModalWrapper } from '../../..';
import { FilterList } from '../filter';
import type { Filter } from '../filter/vars';
import type { View } from '../use-all-page-setting';

View File

@@ -1,6 +1,6 @@
import { Button, MenuItem } from '@affine/component';
import { FilteredIcon } from '@blocksuite/icons';
import { Button, MenuItem } from '../../..';
import Menu from '../../../ui/menu/menu';
import { CreateFilterMenu } from '../filter/vars';
import type { useAllPageSetting } from '../use-all-page-setting';

View File

@@ -1,4 +1,4 @@
import { styled, TextButton } from '@affine/component';
import { styled, TextButton } from '../../..';
export const StyledModalWrapper = styled('div')(() => {
return {

View File

@@ -1,8 +1,8 @@
import { BlockCard } from '@affine/component/card/block-card';
import { WorkspaceFlavour } from '@affine/workspace/type';
import { EdgelessIcon, PageIcon } from '@blocksuite/icons';
import { Workspace } from '@blocksuite/store';
import { BlockCard } from '../components/card/block-card';
import { WorkspaceCard } from '../components/card/workspace-card';
import { toast } from '../ui/toast';

View File

@@ -1,9 +1,9 @@
import { Button } from '@affine/component';
import type { StoryFn } from '@storybook/react';
import { useState } from 'react';
import type { ContactModalProps } from '../components/contact-modal';
import { ContactModal } from '../components/contact-modal';
import { Button } from '../ui/button';
export default {
title: 'AFFiNE/ContactModal',