Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/react-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
git add packages/semi-ui-19
git commit --no-verify -m "chore: semi-ui-19-related"
npm config set registry=https://registry.npmjs.org/
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN_NEW }}
npm whoami
DIST_TAG=latest
if [[ ${{ github.event.inputs.release_type }} == 'beta' ]]; then
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.89.0"
"version": "2.89.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.89.0",
"version": "2.89.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.89.0",
"@douyinfe/semi-animation-styled": "2.89.0",
"@douyinfe/semi-animation": "2.89.1",
"@douyinfe/semi-animation-styled": "2.89.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.89.0",
"version": "2.89.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.89.0",
"version": "2.89.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.89.0",
"version": "2.89.1",
"description": "semi ui eslint plugin",
"keywords": [
"semi",
Expand Down
53 changes: 28 additions & 25 deletions packages/semi-foundation/aiChatInput/foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,36 +276,39 @@ export default class AIChatInputFoundation extends BaseFoundation<AIChatInputAda
return validRichText || validAttachment;
}

handleStopGenerate = () => {
const { generating } = this.getProps();
generating && this._adapter.notifyStopGenerate();
}

handleSend = () => {
const { generating, transformer } = this.getProps();
if (generating) {
this._adapter.notifyStopGenerate();
return;
} else {
if (!this.canSend()) {
return;
}
const references = this.getProp('references');
const { attachments } = this.getStates();
const editor = this._adapter.getEditor();
let richTextResult = [];
if (editor) {
const json = editor.getJSON?.();
richTextResult = transformJSONResult(json, transformer);
}
// close popup layer for template/skill/suggestion
this.setState({
templateVisible: false,
skillVisible: false,
suggestionVisible: false,
});
this._adapter.notifyMessageSend({
references,
attachments,
inputContents: richTextResult,
setup: this._adapter.getConfigureValue() ?? {}
});
}
if (!this.canSend()) {
return;
}
const references = this.getProp('references');
const { attachments } = this.getStates();
const editor = this._adapter.getEditor();
let richTextResult = [];
if (editor) {
const json = editor.getJSON?.();
richTextResult = transformJSONResult(json, transformer);
}
// close popup layer for template/skill/suggestion
this.setState({
templateVisible: false,
skillVisible: false,
suggestionVisible: false,
});
this._adapter.notifyMessageSend({
references,
attachments,
inputContents: richTextResult,
setup: this._adapter.getConfigureValue() ?? {}
});
}

handleContainerMouseDown = (e: React.MouseEvent) => {
Expand Down
6 changes: 3 additions & 3 deletions packages/semi-foundation/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@douyinfe/semi-foundation",
"version": "2.89.0",
"version": "2.89.1",
"description": "",
"scripts": {
"build:lib": "node ./scripts/compileLib.js",
"prepublishOnly": "npm run build:lib"
},
"dependencies": {
"@douyinfe/semi-animation": "2.89.0",
"@douyinfe/semi-json-viewer-core": "2.89.0",
"@douyinfe/semi-animation": "2.89.1",
"@douyinfe/semi-json-viewer-core": "2.89.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.89.0",
"version": "2.89.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.89.0",
"version": "2.89.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.89.0",
"version": "2.89.1",
"description": "semi illustrations",
"keywords": [
"semi",
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-json-viewer-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@douyinfe/semi-json-viewer-core",
"version": "2.89.0",
"version": "2.89.1",
"description": "",
"main": "lib/index.js",
"module": "lib/index.js",
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.89.0",
"version": "2.89.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.89.0"
"@douyinfe/semi-webpack-plugin": "2.89.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.89.0",
"version": "2.89.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.89.0",
"version": "2.89.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.89.0",
"version": "2.89.1",
"description": "semi-theme-default",
"keywords": [
"semi-theme",
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-ui/aiChatInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ class AIChatInput extends BaseComponent<AIChatInputProps, AIChatInputState> {
[`${prefixCls}-footer-action-stop`]: generating,
[`${prefixCls}-footer-action-send-disabled`]: !generating && !canSend,
})}
onClick={this.foundation.handleSend}
onClick={generating ? this.foundation.handleStopGenerate : this.foundation.handleSend}
>
{generating ? <IconStop /> : <IconArrowUp />}
</button>;
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.89.0",
"version": "2.89.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.89.0",
"@douyinfe/semi-animation-react": "2.89.0",
"@douyinfe/semi-foundation": "2.89.0",
"@douyinfe/semi-icons": "2.89.0",
"@douyinfe/semi-illustrations": "2.89.0",
"@douyinfe/semi-theme-default": "2.89.0",
"@douyinfe/semi-animation": "2.89.1",
"@douyinfe/semi-animation-react": "2.89.1",
"@douyinfe/semi-foundation": "2.89.1",
"@douyinfe/semi-icons": "2.89.1",
"@douyinfe/semi-illustrations": "2.89.1",
"@douyinfe/semi-theme-default": "2.89.1",
"@tiptap/core": "^3.10.7",
"@tiptap/extension-document": "^3.10.7",
"@tiptap/extension-hard-break": "^3.10.7",
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.89.0",
"version": "2.89.1",
"description": "",
"author": "伍浩威 <[email protected]>",
"homepage": "",
Expand Down
16 changes: 16 additions & 0 deletions semi-playground-for-ai/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Local
.DS_Store
*.local
*.log*

# Dist
node_modules
dist/

# Profile
.rspack-profile-*/

# IDE
.vscode/*
!.vscode/extensions.json
.idea
13 changes: 13 additions & 0 deletions semi-playground-for-ai/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# AGENTS.md

You are an expert in JavaScript, Rspack, and web application development. You write maintainable, performant, and accessible code.

## Commands

- `npm run dev` - Start the dev server
- `npm run build` - Build the app for production
- `npm run preview` - Preview the production build locally

## Docs

- Rspack: <https://rspack.rs/llms.txt>
41 changes: 41 additions & 0 deletions semi-playground-for-ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Semi Design Playground for AI

这是一个用于 AI 开发和测试 Semi Design 组件的 playground 项目。

## 特性

- 直接引用外部仓库 `packages/` 目录下的 Semi Design 源码
- 修改源码后实时热更新,无需重新编译
- 基于 Rspack 构建,启动快速

## 使用方法

```bash
# 安装依赖
npm install

# 启动开发服务器
npm run dev
```

## 如何引用组件

直接像使用 npm 包一样引用即可,rspack 会自动解析到源码目录:

```tsx
import { Button, Input, Select } from '@douyinfe/semi-ui';
import { IconSearch } from '@douyinfe/semi-icons';
```

## 支持的包

- `@douyinfe/semi-ui` → `packages/semi-ui`
- `@douyinfe/semi-foundation` → `packages/semi-foundation`
- `@douyinfe/semi-icons` → `packages/semi-icons/src`
- `@douyinfe/semi-icons-lab` → `packages/semi-icons-lab/src`
- `@douyinfe/semi-illustrations` → `packages/semi-illustrations/src`
- `@douyinfe/semi-theme-default` → `packages/semi-theme-default`
- `@douyinfe/semi-animation` → `packages/semi-animation`
- `@douyinfe/semi-animation-react` → `packages/semi-animation-react`
- `@douyinfe/semi-animation-styled` → `packages/semi-animation-styled`
- `@douyinfe/semi-json-viewer-core` → `packages/semi-json-viewer-core/src`
12 changes: 12 additions & 0 deletions semi-playground-for-ai/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/react.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Rspack + React + TS</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
25 changes: 25 additions & 0 deletions semi-playground-for-ai/loaders/semi-react19-loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* 将 semi-ui 源码中的 React 18 代码切换为 React 19 代码
*
* 源码中使用特殊注释标记:
* - REACT_18_START ... REACT_18_END 包裹 React 18 代码
* - REACT_19_START ... REACT_19_END 包裹 React 19 代码(默认被注释)
*/
module.exports = function semiReact19Loader(source) {
// 删除 REACT_18 代码块(包括标记)
let result = source.replace(
/\/\*\s*REACT_18_START\s*\*\/[\s\S]*?\/\*\s*REACT_18_END\s*\*\//g,
''
);

// 取消注释 REACT_19 代码块
result = result.replace(
/\/\*\s*REACT_19_START\s*\*\/([\s\S]*?)\/\*\s*REACT_19_END\s*\*\//g,
(match, code) => {
// 移除每行开头的 // 注释
return code.replace(/^\s*\/\/\s?/gm, '');
}
);

return result;
};
25 changes: 25 additions & 0 deletions semi-playground-for-ai/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "semi-playground-for-ai",
"private": true,
"version": "1.0.0",
"scripts": {
"dev": "rspack dev",
"build": "rspack build",
"preview": "rspack preview"
},
"dependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@rspack/cli": "^1.6.8",
"@rspack/core": "^1.6.8",
"@rspack/plugin-react-refresh": "^1.5.3",
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.1",
"react-refresh": "^0.18.0",
"sass": "1.54.9",
"sass-loader": "^13.3.2",
"typescript": "^5.9.3"
}
}
Loading
Loading