Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
pointhalo committed Nov 29, 2024
2 parents fa2f361 + ee43498 commit 90d852b
Show file tree
Hide file tree
Showing 24 changed files with 244 additions and 184 deletions.
12 changes: 11 additions & 1 deletion content/start/changelog/index-en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@ Version:Major.Minor.Patch (follow the **Semver** specification)
- **Patch version**: Only include bug fix, the release time is not limited

---


#### 🎉 2.70.1 (2024-11-25)
- 【Fix】
- Fixed the problem that the URL of the file attachment in the Chat component's dialog box was incorrect, causing the file to fail to open when clicking on the file [#2589](https://github.com/DouyinFE/semi-design/pull/2589)

#### 🎉 2.70.0 (2024-11-22)
- 【Fix】
- Fixed an issue where the placement area was incorrectly displayed when dragging the internal files of the Chat component [#2569](https://github.com/DouyinFE/semi-design/issues/2569)

#### 🎉 2.70.0-beta.0 (2024-11-18)
- 【Fix】
- When all items except the disabled item in the left panel of transfer are selected, the operation button should display Cancel all selections [#2575 ](https://github.com/DouyinFE/semi-design/issues/2575)
- When all items except the disabled item in the left panel of transfer are selected, the operation button should display Cancel all selections [#2575](https://github.com/DouyinFE/semi-design/issues/2575)
- fix resizeItem size offset caused by float,invalid min/max setting caused by browser resizing and incorrect behavior in react strictMode [@Nathon2Y](https://github.com/Nathon2Y)
- Fix the problem that the placeholder of TreeSelect is blocked when single selection and search box are in trigger, affecting versions v2.61.0 - 2.69.0
- 【Feat】
Expand Down
11 changes: 10 additions & 1 deletion content/start/changelog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ Semi 版本号遵循 **Semver** 规范(主版本号-次版本号-修订版本
- 修订版本号(patch):仅会进行 bugfix,发布时间不限
- 不同版本间的详细关系,可查阅 [FAQ](/zh-CN/start/faq)


#### 🎉 2.70.1 (2024-11-25)
- 【Fix】
- 修复 Chat 组件对话框中的文件 url 错误导致点击文件无法正确打开文件问题 [#2589](https://github.com/DouyinFE/semi-design/pull/2589)

#### 🎉 2.70.0 (2024-11-22)
- 【Fix】
- 修复拖动 Chat 组件内部文件时候,错误显示放置区域问题 [#2569](https://github.com/DouyinFE/semi-design/issues/2569)

#### 🎉 2.70.0-beta.0 (2024-11-18)
- 【Fix】
- 当 Transfer 的左侧面板中除去被禁用项外的其他项目都被选中时,操作按钮应当显示取消全选 [#2575 ](https://github.com/DouyinFE/semi-design/issues/2575) [#2574](https://github.com/DouyinFE/semi-design/pull/2574)
- 当 Transfer 的左侧面板中除去被禁用项外的其他项目都被选中时,操作按钮应当显示取消全选 [#2575](https://github.com/DouyinFE/semi-design/issues/2575) [#2574](https://github.com/DouyinFE/semi-design/pull/2574)
- 修复计算中浮点数导致伸缩框组件尺寸的误差,浏览器拖动导致的最大最小值失效的问题,以及strictMode引起的问题 [@Nathon2Y](https://github.com/Nathon2Y) [#2551](https://github.com/DouyinFE/semi-design/pull/2551)
- 修复当单选,搜索框在 trigger 时,TreeSelect 的 placeholder被遮挡问题 ,影响版本 2.61.0-2.69.0 [#2566](https://github.com/DouyinFE/semi-design/pull/2566)
- 【Feat】
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"useWorkspaces": true,
"npmClient": "yarn",
"version": "2.70.0-beta.0"
"version": "2.70.1"
}
6 changes: 3 additions & 3 deletions packages/semi-animation-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-animation-react",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "motion library for semi-ui-react",
"keywords": [
"motion",
Expand All @@ -25,8 +25,8 @@
"prepublishOnly": "npm run build:lib"
},
"dependencies": {
"@douyinfe/semi-animation": "2.70.0-beta.0",
"@douyinfe/semi-animation-styled": "2.70.0-beta.0",
"@douyinfe/semi-animation": "2.70.1",
"@douyinfe/semi-animation-styled": "2.70.1",
"classnames": "^2.2.6"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-animation-styled/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-animation-styled",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "semi styled animation",
"keywords": [
"semi",
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-animation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-animation",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "animation base library for semi-ui",
"keywords": [
"animation",
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-eslint-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-semi-design",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "semi ui eslint plugin",
"keywords": [
"semi",
Expand Down
19 changes: 17 additions & 2 deletions packages/semi-foundation/chat/foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export interface ChatAdapter<P = Record<string, any>, S = Record<string, any>> e
notifyHintClick: (hint: string) => void;
setUploadAreaVisible: (visible: boolean) => void;
manualUpload: (e: any) => void;
getDropAreaElement: () => HTMLDivElement
getDropAreaElement: () => HTMLDivElement;
getDragStatus: () => boolean;
setDragStatus: (status: boolean) => void
}


Expand Down Expand Up @@ -265,7 +267,19 @@ export default class ChatFoundation <P = Record<string, any>, S = Record<string,
}

handleDragOver = (e: any) => {
const dragStatus = this._adapter.getDragStatus();
if (dragStatus) {
return;
}
this._adapter.setUploadAreaVisible(true);
};

handleDragStart = (e: any) => {
this._adapter.setDragStatus(true);
}

handleDragEnd = (e: any) => {
this._adapter.setDragStatus(false);
}

handleContainerDragOver = (e: any) => {
Expand All @@ -285,7 +299,8 @@ export default class ChatFoundation <P = Record<string, any>, S = Record<string,
// 鼠标移动至 container 的子元素,则不做任何操作
// If the mouse moves to the child element of container, no operation will be performed.
const dropAreaElement = this._adapter.getDropAreaElement();
if (dropAreaElement !== e.target && dropAreaElement.contains(e.target)) {
const enterTarget = e.relatedTarget;
if (dropAreaElement.contains(enterTarget)) {
return;
}
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/semi-foundation/lottie/foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface LottieAdapter<P = Record<string, any>, S = Record<string, any>>
export interface LottieBaseProps {
width?: string;
height?: string;
params: ArgsType<typeof lottie.loadAnimation>[0];
params: Partial<ArgsType<typeof lottie.loadAnimation>[0]>;
getAnimationInstance?: (instance: AnimationItem|null) => void;
getLottie?: (lottiePKG: typeof lottie) => void

Expand Down Expand Up @@ -57,4 +57,4 @@ class LottieFoundation <P = Record<string, any>, S = Record<string, any>> extend

}

export default LottieFoundation;
export default LottieFoundation;
4 changes: 2 additions & 2 deletions packages/semi-foundation/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@douyinfe/semi-foundation",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "",
"scripts": {
"build:lib": "node ./scripts/compileLib.js",
"prepublishOnly": "npm run build:lib"
},
"dependencies": {
"@douyinfe/semi-animation": "2.70.0-beta.0",
"@douyinfe/semi-animation": "2.70.1",
"@mdx-js/mdx": "^3.0.1",
"async-validator": "^3.5.0",
"classnames": "^2.2.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-icons-lab/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-icons-lab",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "semi icons lab",
"keywords": [
"semi",
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-icons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-icons",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "semi icons",
"keywords": [
"semi",
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-illustrations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-illustrations",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "semi illustrations",
"keywords": [
"semi",
Expand Down
4 changes: 2 additions & 2 deletions packages/semi-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-next",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "Plugin that support Semi Design in Next.js",
"author": "伍浩威 <[email protected]>",
"homepage": "",
Expand All @@ -22,7 +22,7 @@
"typescript": "^4"
},
"dependencies": {
"@douyinfe/semi-webpack-plugin": "2.70.0-beta.0"
"@douyinfe/semi-webpack-plugin": "2.70.1"
},
"gitHead": "eb34a4f25f002bb4cbcfa51f3df93bed868c831a"
}
2 changes: 1 addition & 1 deletion packages/semi-rspack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-rspack-plugin",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "",
"homepage": "",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-scss-compile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-scss-compile",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "compile semi scss to css",
"author": "[email protected]",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-theme-default/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-theme-default",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "semi-theme-default",
"keywords": [
"semi-theme",
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-ui/chat/chatBox/chatBoxContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const ChatBoxContent = (props: ChatBoxContentProps) => {
} else if (item.type === 'file_url') {
const { name, size, url, type } = item.file_url;
const realType = name.split('.').pop() ?? type?.split('/').pop();
return <FileAttachment key={`index`} url={name} name={name} size={size} type={realType}></FileAttachment>;
return <FileAttachment key={`index`} url={url} name={name} size={size} type={realType}></FileAttachment>;
}
return null;
});
Expand Down
8 changes: 7 additions & 1 deletion packages/semi-ui/chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const { CHAT_ALIGN, MODE, SEND_HOT_KEY, MESSAGE_STATUS } = strings;
class Chat extends BaseComponent<ChatProps, ChatState> {

static __SemiComponentName__ = "Chat";
// dragStatus: Whether the component contains the dragged object
dragStatus = false;

containerRef: React.RefObject<HTMLDivElement>;
animation: any;
Expand Down Expand Up @@ -192,7 +194,9 @@ class Chat extends BaseComponent<ChatProps, ChatState> {
},
getDropAreaElement: () => {
return this.dropAreaRef?.current;
}
},
getDragStatus: () => this.dragStatus,
setDragStatus: (status: boolean) => { this.dragStatus = status; },
};
}

Expand Down Expand Up @@ -301,6 +305,8 @@ class Chat extends BaseComponent<ChatProps, ChatState> {
className={cls(`${prefixCls}`, className)}
style={style}
onDragOver={this.foundation.handleDragOver}
onDragStart={this.foundation.handleDragStart}
onDragEnd={this.foundation.handleDragEnd}
>
{uploadAreaVisible && <div
ref={this.dropAreaRef}
Expand Down
14 changes: 7 additions & 7 deletions packages/semi-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-ui",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
"main": "lib/cjs/index.js",
"module": "lib/es/index.js",
Expand All @@ -20,12 +20,12 @@
"@dnd-kit/core": "^6.0.8",
"@dnd-kit/sortable": "^7.0.2",
"@dnd-kit/utilities": "^3.2.1",
"@douyinfe/semi-animation": "2.70.0-beta.0",
"@douyinfe/semi-animation-react": "2.70.0-beta.0",
"@douyinfe/semi-foundation": "2.70.0-beta.0",
"@douyinfe/semi-icons": "2.70.0-beta.0",
"@douyinfe/semi-illustrations": "2.70.0-beta.0",
"@douyinfe/semi-theme-default": "2.70.0-beta.0",
"@douyinfe/semi-animation": "2.70.1",
"@douyinfe/semi-animation-react": "2.70.1",
"@douyinfe/semi-foundation": "2.70.1",
"@douyinfe/semi-icons": "2.70.1",
"@douyinfe/semi-illustrations": "2.70.1",
"@douyinfe/semi-theme-default": "2.70.1",
"async-validator": "^3.5.0",
"classnames": "^2.2.6",
"copy-text-to-clipboard": "^2.1.1",
Expand Down
19 changes: 19 additions & 0 deletions packages/semi-ui/tree/_story/tree.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,17 @@ const treeDataWithIcon = [
},
];

const OneLevelData = [
{
label: '亚洲',
key: 'yazhou',
},
{
label: '北美洲',
key: 'beimeizhou',
},
]

let opts = {
content: 'Hi, Bytedance dance dance',
duration: 3,
Expand Down Expand Up @@ -3078,6 +3089,14 @@ export const ShowLine = () => {
defaultExpandAll
disableStrictly
/>
<>单选,单层节点</>
<Tree
showLine={showLine}
treeData={OneLevelData}
// value="meiguo"
defaultExpandAll
onChange={(...args) => console.log(args)}
/>
</div>
)
}
Expand Down
5 changes: 3 additions & 2 deletions packages/semi-ui/tree/treeNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState

renderArrow() {
const showIcon = !this.isLeaf();
const { loading, expanded, showLine } = this.props;
const { loading, expanded, showLine, level } = this.props;
if (loading) {
return <Spin wrapperClassName={`${prefixcls}-spin-icon`} />;
}
Expand All @@ -218,7 +218,8 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
/>
);
}
if (showLine) {
// when leaf node 's level is 0, no switcher
if (showLine && level) {
return this.renderSwitcher();
}
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-webpack-plugin",
"version": "2.70.0-beta.0",
"version": "2.70.1",
"description": "",
"author": "伍浩威 <[email protected]>",
"homepage": "",
Expand Down
Loading

0 comments on commit 90d852b

Please sign in to comment.