Skip to content

Commit

Permalink
🔀 feat: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
ONLY-yours committed Aug 31, 2023
2 parents 234ef98 + d183b89 commit 781217f
Show file tree
Hide file tree
Showing 46 changed files with 1,159 additions and 688 deletions.
87 changes: 87 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,92 @@
# Changelog

## [Version 0.16.0](https://github.com/ant-design/pro-editor/compare/v0.15.0...v0.16.0)

<sup>Released on **2023-08-31**</sup>

#### ✨ 新特性

- 支持传入 getId 方法自定义 id 生成规则.

#### 🐛 修复

- DispatchListData error, 修复控制台报错, 去除自动生成 ID 的逻辑,改为由用户自行传递 ID.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

- 支持传入 getId 方法自定义 id 生成规则 ([74016a8](https://github.com/ant-design/pro-editor/commit/74016a8))

#### What's fixed

- DispatchListData error ([2852524](https://github.com/ant-design/pro-editor/commit/2852524))
- 修复控制台报错 ([dadf4b3](https://github.com/ant-design/pro-editor/commit/dadf4b3))
- 去除自动生成 ID 的逻辑,改为由用户自行传递 ID ([9026256](https://github.com/ant-design/pro-editor/commit/9026256))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

## [Version&nbsp;0.15.0](https://github.com/ant-design/pro-editor/compare/v0.14.1...v0.15.0)

<sup>Released on **2023-08-30**</sup>

#### ✨ 新特性

- Doc update.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

- Doc update ([01f6325](https://github.com/ant-design/pro-editor/commit/01f6325))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version&nbsp;0.14.1](https://github.com/ant-design/pro-editor/compare/v0.14.0...v0.14.1)

<sup>Released on **2023-08-29**</sup>

#### 🐛 修复

- Drag over index lost, 修复 sortableList item 样式问题 && 更新文档, 多实例时的定位错误问题.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

- Drag over index lost ([75752fe](https://github.com/ant-design/pro-editor/commit/75752fe))
- 修复 sortableList item 样式问题 && 更新文档 ([850cbe7](https://github.com/ant-design/pro-editor/commit/850cbe7))
- 多实例时的定位错误问题 ([f3b38ba](https://github.com/ant-design/pro-editor/commit/f3b38ba))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

## [Version&nbsp;0.14.0](https://github.com/ant-design/pro-editor/compare/v0.13.1...v0.14.0)

<sup>Released on **2023-08-29**</sup>
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ Open your browser and visit http://localhost:8000
<a href="https://github.com/rdmclin2" title="rdmclin2">
<img src="https://avatars.githubusercontent.com/u/4705237?v=4" width="50" />
</a>
<a href="https://github.com/actions-user" title="actions-user">
<img src="https://avatars.githubusercontent.com/u/65916846?v=4" width="50" />
</a>
<a href="https://github.com/ONLY-yours" title="ONLY-yours">
<img src="https://avatars.githubusercontent.com/u/52664827?v=4" width="50" />
</a>
<a href="https://github.com/actions-user" title="actions-user">
<img src="https://avatars.githubusercontent.com/u/65916846?v=4" width="50" />
</a>
<a href="https://github.com/chenshuai2144" title="chenshuai2144">
<img src="https://avatars.githubusercontent.com/u/8186664?v=4" width="50" />
</a>
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ant-design/pro-editor",
"version": "0.14.0",
"version": "0.16.0",
"description": "🌟 Lightweight Editor UI Framework",
"homepage": "https://github.com/ant-design/pro-editor",
"bugs": {
Expand Down Expand Up @@ -58,7 +58,7 @@
},
"dependencies": {
"@ant-design/icons": "^5.2.5",
"@ant-design/pro-components": "^2.6.13",
"@ant-design/pro-components": "^2.6.15",
"@antv/dw-random": "^1.1.7",
"@babel/runtime": "^7.22.11",
"@dnd-kit/core": "^6.0.8",
Expand Down Expand Up @@ -93,7 +93,6 @@
"lodash.unionby": "^4.8.0",
"lodash.uniq": "^4.5.0",
"mockjs": "^1.1.0",
"object-hash": "^3.0.0",
"polished": "^4.2.2",
"prettier": "^2.8.8",
"re-resizable": "^6.9.11",
Expand Down Expand Up @@ -124,7 +123,7 @@
"@types/react-dom": "^18.2.7",
"@umijs/lint": "^4.0.78",
"@vitest/coverage-v8": "latest",
"antd": "^5.8.4",
"antd": "^5.8.5",
"antd-style": "^3.4.4",
"babel-plugin-antd-style": "^1.0.4",
"commitlint": "^17.7.1",
Expand Down
3 changes: 3 additions & 0 deletions src/ActionGroup/demos/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* title: 基础使用
*/
import { ActionGroup } from '@ant-design/pro-editor';

export default () => {
Expand Down
4 changes: 4 additions & 0 deletions src/ActionGroup/demos/config.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* title: 配置使用
* description: 通过配置 `items` 渲染整个内容
*/
import { CopyOutlined, DragOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons';
import { ActionGroup } from '@ant-design/pro-editor';
import { message } from 'antd';
Expand Down
4 changes: 4 additions & 0 deletions src/ActionGroup/demos/custom.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* title: 自定义
* description: 通过 `render` 可以自定义渲染特殊的操作内容
*/
import { ActionGroup, ActionIcon } from '@ant-design/pro-editor';
import { Card, Input, Rate, Switch } from 'antd';

Expand Down
5 changes: 5 additions & 0 deletions src/ActionGroup/demos/dropMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* title: dropdown
* description: 通过配置 `dropdownMenu` 可以在尾部渲染一个下拉内容
*/

import { CopyOutlined, DragOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons';
import { ActionGroup } from '@ant-design/pro-editor';
import { message } from 'antd';
Expand Down
3 changes: 3 additions & 0 deletions src/ActionGroup/demos/type.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { CopyOutlined, DragOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons';
/**
* title: 模式配置
*/
import { ActionGroup } from '@ant-design/pro-editor';
import { InputNumber, Segmented, Space } from 'antd';
import { useState } from 'react';
Expand Down
5 changes: 5 additions & 0 deletions src/ActionGroup/demos/withPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* title: 浮动面板中使用
* description: 配合 DraggablePanel 可以使得整个面板可浮动拖拽
*/

import type { Position } from '@ant-design/pro-editor';
import { ActionGroup, DraggablePanel } from '@ant-design/pro-editor';
import { useLocalStorageState } from 'ahooks';
Expand Down
19 changes: 2 additions & 17 deletions src/ActionGroup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: ActionGroup 工具面板
atomId: ActionGroup
group: 基础组件
demo:
cols: 2
---

# ActionGroup 工具面板
Expand All @@ -12,28 +14,11 @@ group: 基础组件

## 代码演示

### 基础

<code src="./demos/basic.tsx" ></code>

### 使用配置

<code src="./demos/config.tsx" ></code>

### 使用 dropdownMenu 扩展更多内容

<code src="./demos/dropMenu.tsx" ></code>

### 类型、大小和方向调整

<code src="./demos/type.tsx" ></code>

### 高度自定义

<code src="./demos/custom.tsx" ></code>

### 使用浮动面板

<code src="./demos/withPanel.tsx" iframe></code>

## API
Expand Down
5 changes: 4 additions & 1 deletion src/ColumnList/ColumnItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
ColumnItemList,
DeleteAction,
HandleAction,
SortableItem,
useSortableList,
} from '@ant-design/pro-editor';
import { createStyles } from 'antd-style';
Expand Down Expand Up @@ -68,7 +69,7 @@ const useStyle = createStyles(({ css, cx }, prefixCls) => {
};
});

interface ItemRenderProps<T = any> {
interface ItemRenderProps<T extends SortableItem = SortableItem> {
columns: ColumnItemList<T>;
item: T;
index: number;
Expand Down Expand Up @@ -98,6 +99,7 @@ const ColumnItem = memo<ItemRenderProps>(
const props = {
dataIndex: col.dataIndex,
value: item[col.dataIndex],
id: item.id,
index,
prefixCls,
style,
Expand All @@ -121,6 +123,7 @@ const ColumnItem = memo<ItemRenderProps>(
return Custom ? (
<Custom
item={item}
key={`${item?.dataIndex}-${colIndex}`}
column={col}
onChange={(value) => {
instance.updateItem({ [col.dataIndex]: value }, index);
Expand Down

0 comments on commit 781217f

Please sign in to comment.