Skip to content

Commit

Permalink
feat: 使用 @asany/icons 管理图标
Browse files Browse the repository at this point in the history
  • Loading branch information
limaofeng committed Jul 30, 2021
1 parent 6c44484 commit 74d9a76
Show file tree
Hide file tree
Showing 32 changed files with 679 additions and 787 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
}
],
"dependencies": {
"@asany/icons": "^0.1.3",
"@asany/library-manager": "^0.1.4",
"@daybrush/drag": "^0.19.3",
"@scena/react-guides": "^0.16.0",
Expand Down
2 changes: 1 addition & 1 deletion src/AsanyContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { debounce } from 'lodash';
import { debounce } from 'lodash-es';
import React, {
useCallback,
useEffect,
Expand Down
2 changes: 1 addition & 1 deletion src/components/InfiniteViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, {
CSSProperties,
} from 'react';
import classnames from 'classnames';
import { throttle } from 'lodash';
import { throttle } from 'lodash-es';
import { drag, OnDrag, OnDragStart } from '@daybrush/drag';
import { calculateScaling } from '../reducers/ui.reducer/scena.reducer';
import { useDragDropManager, useDrop } from 'react-dnd';
Expand Down
2 changes: 1 addition & 1 deletion src/components/aside/Aside.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// import { Cascader } from 'antd';
import { assign, isEqual } from 'lodash';
import { assign, isEqual } from 'lodash-es';
import React, { useCallback, useEffect, useRef, useState } from 'react';

// import { visibleFilter } from '../../../library-manager/ConfigurationPanel';
Expand Down
2 changes: 1 addition & 1 deletion src/components/aside/PropertiesPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// import { CloseOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons';
import Icon from '@asany/icons';
import { Tabs } from 'antd';
import classnames from 'classnames';
import React, {
Expand All @@ -10,7 +11,6 @@ import React, {
useRef,
useState,
} from 'react';
import Icon from '../../icon';

import { sleep, useDeepCompareEffect } from '../../utils';

Expand Down
5 changes: 3 additions & 2 deletions src/components/aside/components/AlignPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Icon from '@asany/icons';
import React from 'react';
import IconButton from './IconButton';
import styled from 'styled-components';
import Icon from '../../../icon';

import IconButton from './IconButton';

const aligns = [
{ icon: 'AlignLeft', title: '左对齐' },
Expand Down
3 changes: 1 addition & 2 deletions src/components/aside/components/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Icon from '@asany/icons';
import { Tooltip } from 'antd';
import classnames from 'classnames';
import React, { forwardRef, MutableRefObject, useRef } from 'react';

import Icon from '../../../icon';

interface IconButtonProps {
tooltip?: string;
className?: string;
Expand Down
3 changes: 1 addition & 2 deletions src/components/aside/components/ListTree.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Icon from '@asany/icons';
import classnames from 'classnames';
import { OverlayScrollbarsComponent } from 'overlayscrollbars-react';
import React, { useCallback, useEffect, useState } from 'react';

import Icon from '../../../icon';

export interface ListTreeNode {
id: string;
name?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/aside/components/OptionButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Icon from '@asany/icons';
import { Tooltip } from 'antd';
import classnames from 'classnames';
import React, { CSSProperties, useEffect, useRef, useState } from 'react';

import Icon from '../../../icon';
export interface OptionButtonProps {
onChange?: (value: boolean) => void;
value?: boolean;
Expand Down
15 changes: 8 additions & 7 deletions src/components/aside/components/RadiusAllSetting.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import Icon from '@asany/icons';
import { Input } from 'antd';
import { isEqual } from 'lodash-es';
import React, {
useState,
memo,
ChangeEvent,
useEffect,
memo,
useCallback,
useEffect,
useState,
} from 'react';
import { Input } from 'antd';
import Icon from '../../../icon';
import { isEqual } from 'lodash';
import { onlyNumber } from './utils';

import { RadiusAllSettingProps } from './typings';
import { onlyNumber } from './utils';

const icons = [
'TopLeftCornerRadius',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Input, InputNumber, Tooltip } from 'antd';
import classnames from 'classnames';
import { isEqual } from 'lodash';
import { isEqual } from 'lodash-es';
import React, {
ChangeEvent,
CSSProperties,
Expand All @@ -10,7 +10,7 @@ import React, {
useState,
} from 'react';

import Icon from '../../../../icon';
import Icon from '@asany/icons';
import { useDeepCompareEffect } from '../../../../utils';
import { InputFormat, InputText } from '../typings';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { CSSProperties, useEffect, useState } from 'react';
import classnames from 'classnames';
import Icon from '../../../../icon';
import Icon from '@asany/icons';
import { Tooltip } from 'antd';
import classnames from 'classnames';
import React, { CSSProperties, useEffect, useState } from 'react';

export interface SegmentedControlOption {
label: string;
value: string;
Expand Down
5 changes: 2 additions & 3 deletions src/components/aside/components/data-entry/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Icon from '@asany/icons';
import { registerComponent } from '@asany/library-manager';
import { Popover } from 'antd';
import classnames from 'classnames';
import React, {
Expand All @@ -10,9 +12,6 @@ import React, {
} from 'react';
import { useClickAway } from 'react-use';

import Icon from '../../../../icon';
import { registerComponent } from '@asany/library-manager';

export interface SelectOption {
label: string | React.ReactElement;
value: string;
Expand Down
7 changes: 4 additions & 3 deletions src/components/scena/Toolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { isEqual } from 'lodash';
import React from 'react';
import Icon from '@asany/icons';
import classnames from 'classnames';
import Icon from '../../icon';
import { isEqual } from 'lodash-es';
import React from 'react';

import { useSelector } from '../../hooks';
import useTools from '../../hooks/useTools';

Expand Down
2 changes: 1 addition & 1 deletion src/components/scena/viewport/ScreenViewport.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CheckOutlined, DownOutlined } from '@ant-design/icons';
import { InputNumber, Popover } from 'antd';
import classnames from 'classnames';
import { isEqual } from 'lodash';
import { isEqual } from 'lodash-es';
import React, { useCallback, useState } from 'react';

import devices from '../../../assets/devices';
Expand Down
4 changes: 2 additions & 2 deletions src/components/sidebar/Toolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Icon from '@asany/icons';
import classnames from 'classnames';
import { isEqual } from 'lodash';
import { isEqual } from 'lodash-es';
import React from 'react';

import Icon from '../../icon';
import { useSelector } from '../../hooks';
import useTools from '../../hooks/useTools';
import { AsanyTool } from '../../typings';
Expand Down
8 changes: 4 additions & 4 deletions src/components/sidebar/Toolboard.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Icon from '@asany/icons';
import classnames from 'classnames';
import React, {
ComponentType,
Expand All @@ -10,12 +11,11 @@ import React, {
useState,
} from 'react';

import Icon from '../../icon';
import Resizer from '../resizer';
import { sleep } from '../../utils';
import { useDispatch, useSelector } from '../../hooks';
import { IAsanyEditor, IToolboard } from '../../typings';
import { ActionType, UISidebarActionType } from '../../reducers/actions';
import { IAsanyEditor, IToolboard } from '../../typings';
import { sleep } from '../../utils';
import Resizer from '../resizer';

interface Panel {
title: string;
Expand Down
4 changes: 2 additions & 2 deletions src/components/toolbar/Toolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import classnames from 'classnames';
import { isEqual } from 'lodash';
import { isEqual } from 'lodash-es';
import React, { useCallback } from 'react';
import { AsanyTool } from '../..';
import Icon from '../../icon';
import Icon from '@asany/icons';
import { useSelector } from '../../hooks';
import useTools from '../../hooks/useTools';

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// import { ApolloClient, useApolloClient } from '@apollo/client';
import classnames from 'classnames';
import { EventEmitter } from 'events';
import { isEqual } from 'lodash';
import { isEqual } from 'lodash-es';
import React, {
DependencyList,
MouseEventHandler,
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useTools.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isEqual } from 'lodash';
import { isEqual } from 'lodash-es';
import { useEffect, useReducer, useRef } from 'react';
import { AsanyTool, IAsanyEditor, ToolClick } from '../typings';
import useEditor from './useEditor';
Expand Down
70 changes: 0 additions & 70 deletions src/icon/index.tsx

This file was deleted.

Loading

0 comments on commit 74d9a76

Please sign in to comment.