Skip to content

Commit

Permalink
➖ chore: remove c2d2c packages
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmclin2 committed Jul 22, 2023
1 parent 1f936fc commit 6851c5c
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 9 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"@ant-design/pro-components": "^2",
"@antv/dw-random": "^1",
"@babel/runtime": "^7.21.5",
"@c2d2c/types": "^1",
"@dnd-kit/core": "^6",
"@dnd-kit/modifiers": "^6",
"@dnd-kit/sortable": "^7",
Expand Down
2 changes: 1 addition & 1 deletion src/IconPicker/components/IconList/IconThumbnail.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { IconUnit } from '@c2d2c/types';
import { createStyles } from 'antd-style';
import type { FC } from 'react';
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';
import type { IconUnit } from '../../types';

import IconItem from '../../features/IconRender';
import { useStore } from '../../store';
Expand Down
2 changes: 1 addition & 1 deletion src/IconPicker/contents/antdIcons.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as AntdIcon from '@ant-design/icons';
import type { ReactIcon } from '@c2d2c/types';
import type { ReactIcon } from '../types';

const list = Object.keys(AntdIcon).filter(
(key) => key.endsWith('Outlined') || key.endsWith('Filled'),
Expand Down
3 changes: 1 addition & 2 deletions src/IconPicker/store/initialState.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IconfontIcon, IconUnit, ReactIcon } from '@c2d2c/types';
import { antdIconList } from '../contents/antdIcons';
import type { ExternalScripts } from '../types';
import type { ExternalScripts, IconfontIcon, IconUnit, ReactIcon } from '../types';

export interface State {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/IconPicker/store/store.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { IconUnit } from '@c2d2c/types';
import { act, renderHook } from '@testing-library/react';
import { readFileSync } from 'fs';
import path from 'path';
import { vi } from 'vitest';
import { create } from 'zustand';
import type { IconUnit } from '../types';

import type { Store } from './store';
import vanillaStore from './store';
Expand Down
22 changes: 20 additions & 2 deletions src/IconPicker/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export type { IconUnit, IconfontIcon, ReactIcon } from '@c2d2c/types';

/**
* 外部的图标 url
*/
Expand All @@ -13,3 +11,23 @@ export interface ExternalScripts {
*/
url: string;
}

export interface ReactIcon {
type: 'antd' | 'custom';
componentName: string;
props?: object;
}

export interface IconfontIcon {
type: 'iconfont';
componentName: string;
props: {
type: string;
};
scriptUrl?: string;
}

/**
* 最基础的图标信息单元
*/
export type IconUnit = ReactIcon | IconfontIcon;
15 changes: 14 additions & 1 deletion src/types/catogory.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
import type { CategoryConfig } from '@c2d2c/types';
export interface CategoryBaseField {
title?: string;
description?: string;
defaultActive?: boolean;
}
/**
* 目录分类
* 默认包含 四个分类
* type: '类型'
* content: '内容'
* style: '样式'
* status: '状态'
*/
export type CategoryConfig = Record<string, CategoryBaseField>;

export enum CategoryMap {
type = 'type',
Expand Down

0 comments on commit 6851c5c

Please sign in to comment.