diff --git a/.github/ISSUE_TEMPLATE/1_bug_report.yml b/.github/ISSUE_TEMPLATE/1_bug_report.yml new file mode 100644 index 00000000..d181c387 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1_bug_report.yml @@ -0,0 +1,45 @@ +name: '🐛 反馈缺陷 Bug Report' +description: '反馈一个问题缺陷 | Report an bug' +title: '[Bug] ' +labels: '🐛 Bug' +body: + - type: dropdown + attributes: + label: '💻 系统环境 | Operating System' + options: + - Windows + - macOS + - Ubuntu + - Other Linux + - Other + validations: + required: true + - type: dropdown + attributes: + label: '🌐 浏览器 | Browser' + options: + - Chrome + - Edge + - Safari + - Firefox + - Other + validations: + required: true + - type: textarea + attributes: + label: '🐛 问题描述 | Bug Description' + description: A clear and concise description of the bug. + validations: + required: true + - type: textarea + attributes: + label: '🚦 期望结果 | Expected Behavior' + description: A clear and concise description of what you expected to happen. + - type: textarea + attributes: + label: '📷 复现步骤 | Recurrence Steps' + description: A clear and concise description of how to recurrence. + - type: textarea + attributes: + label: '📝 补充信息 | Additional Information' + description: If your problem needs further explanation, or if the issue you're seeing cannot be reproduced in a gist, please add more information here. diff --git a/.github/ISSUE_TEMPLATE/2_feature_request.yml b/.github/ISSUE_TEMPLATE/2_feature_request.yml new file mode 100644 index 00000000..90e6a675 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2_feature_request.yml @@ -0,0 +1,21 @@ +name: '🌠 功能需求 Feature Request' +description: '需求或建议 | Suggest an idea' +title: '[Request] ' +labels: ['Feature Request'] +body: + - type: textarea + attributes: + label: '🥰 需求描述 | Feature Description' + description: Please add a clear and concise description of the problem you are seeking to solve with this feature request. + validations: + required: true + - type: textarea + attributes: + label: '🧐 解决方案 | Proposed Solution' + description: Describe the solution you'd like in a clear and concise manner. + validations: + required: true + - type: textarea + attributes: + label: '📝 补充信息 | Additional Information' + description: Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/3_question.yml b/.github/ISSUE_TEMPLATE/3_question.yml new file mode 100644 index 00000000..f989f7d1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/3_question.yml @@ -0,0 +1,15 @@ +name: '😇 疑问或帮助 Help Wanted' +description: '疑问或需要帮助 | Need help' +title: '[Question] ' +labels: '😇 Help Wanted' +body: + - type: textarea + attributes: + label: '🧐 问题描述 | Proposed Solution' + description: A clear and concise description of the proplem. + validations: + required: true + - type: textarea + attributes: + label: '📝 补充信息 | Additional Information' + description: Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/4_other.md b/.github/ISSUE_TEMPLATE/4_other.md new file mode 100644 index 00000000..215dd1f3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/4_other.md @@ -0,0 +1,7 @@ +--- +name: '📝 其他 Other' +about: '其他问题 | Other issues' +title: '' +labels: '' +assignees: '' +--- diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..789d4bc1 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,19 @@ +#### 💻 变更类型 | Change Type + + + +- [ ] ✨ feat +- [ ] 🐛 fix +- [ ] ♻️ refactor +- [ ] 💄 style +- [ ] 🔨 chore +- [ ] ⚡️ perf +- [ ] 📝 docs + +#### 🔀 变更说明 | Description of Change + + + +#### 📝 补充信息 | Additional Information + + diff --git a/.github/workflows/contributor-help.yml b/.github/workflows/contributor-help.yml deleted file mode 100644 index a5d7f119..00000000 --- a/.github/workflows/contributor-help.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Contributor Helper - -on: - schedule: - - cron: '0 0 * * *' - -jobs: - contributor: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - - uses: actions-cool/contributor-helper@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - style: 'simple' - update-files: 'README.md' - update-places: '/' - - - name: Commit and push if changed - run: |- - git diff - git config --global user.email "actions@github.com" - git config --global user.name "github-actions" - git pull - git add -A - git commit -m "🤖 docs: Auto update contributors" || exit 0 - git push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c892af1e..e1aa8f87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,6 +36,11 @@ jobs: needs: test name: Release runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + id-token: write # to enable use of OIDC for npm provenance steps: - uses: actions/checkout@v3 with: @@ -54,6 +59,9 @@ jobs: - name: Install deps run: pnpm install + - name: Pre Build + run: pnpm run build + - name: release run: pnpm run release env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2760be00..36ef27fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,9 @@ jobs: - name: lint run: pnpm run ci + - name: build + run: pnpm run build + - name: test and coverage run: pnpm run test:coverage diff --git a/.gitignore b/.gitignore index 90e7723b..abdead2b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ server .husky/prepare-commit-msg coverage .vscode +bun.lockb \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 50774935..6e95dcd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,594 @@ # Changelog -## [Version 0.28.0](https://github.com/ant-design/pro-editor/compare/v0.27.0...v0.28.0) +## [Version 0.38.0](https://github.com/ant-design/pro-editor/compare/v0.37.0...v0.38.0) + +Released on **2024-01-02** + +#### ✨ 新特性 + +- ProEditor ConvigProvider 优化改造,Prefix 动态获取. + +
+ +
+Improvements and Fixes + +#### What's improved + +- ProEditor ConvigProvider 优化改造,Prefix 动态获取, closes [#120](https://github.com/ant-design/pro-editor/issues/120) ([54f265f](https://github.com/ant-design/pro-editor/commit/54f265f)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.37.0](https://github.com/ant-design/pro-editor/compare/v0.36.0...v0.37.0) + +Released on **2024-01-02** + +#### ✨ 新特性 + +- Add vertual list", add virtual config". + +#### 🐛 修复 + +- Update snapshot. + +
+ +
+Improvements and Fixes + +#### What's improved + +- Add vertual list" ([c8e7b76](https://github.com/ant-design/pro-editor/commit/c8e7b76)) +- Add virtual config" ([b10760f](https://github.com/ant-design/pro-editor/commit/b10760f)) + +#### What's fixed + +- Update snapshot ([6fc13ef](https://github.com/ant-design/pro-editor/commit/6fc13ef)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.36.0](https://github.com/ant-design/pro-editor/compare/v0.35.1...v0.36.0) + +Released on **2023-12-26** + +#### ✨ 新特性 + +- Add snapshot. + +#### 🐛 修复 + +- Fixed memo markdown components was not show. + +
+ +
+Improvements and Fixes + +#### What's improved + +- Add snapshot ([ec7471d](https://github.com/ant-design/pro-editor/commit/ec7471d)) + +#### What's fixed + +- Fixed memo markdown components was not show ([406359c](https://github.com/ant-design/pro-editor/commit/406359c)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 0.35.1](https://github.com/ant-design/pro-editor/compare/v0.35.0...v0.35.1) + +Released on **2023-12-26** + +#### 🐛 修复 + +- Slove Markdown Plugin problem. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- Slove Markdown Plugin problem ([107b007](https://github.com/ant-design/pro-editor/commit/107b007)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.35.0](https://github.com/ant-design/pro-editor/compare/v0.34.2...v0.35.0) + +Released on **2023-12-25** + +#### ✨ 新特性 + +- Markdown support html render. + +
+ +
+Improvements and Fixes + +#### What's improved + +- Markdown support html render ([4ad6e1f](https://github.com/ant-design/pro-editor/commit/4ad6e1f)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 0.34.2](https://github.com/ant-design/pro-editor/compare/v0.34.1...v0.34.2) + +Released on **2023-12-25** + +#### 🐛 修复 + +- Columnlist control error. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- Columnlist control error ([6b518aa](https://github.com/ant-design/pro-editor/commit/6b518aa)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 0.34.1](https://github.com/ant-design/pro-editor/compare/v0.34.0...v0.34.1) + +Released on **2023-12-22** + +#### 🐛 修复 + +- Rollback draggalPannel styles. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- Rollback draggalPannel styles ([387b457](https://github.com/ant-design/pro-editor/commit/387b457)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.34.0](https://github.com/ant-design/pro-editor/compare/v0.33.1...v0.34.0) + +Released on **2023-12-22** + +#### ✨ 新特性 + +- Use memo wrapper in markdown. + +#### 🐛 修复 + +- Update snapshot. + +
+ +
+Improvements and Fixes + +#### What's improved + +- Use memo wrapper in markdown ([7c7382f](https://github.com/ant-design/pro-editor/commit/7c7382f)) + +#### What's fixed + +- Update snapshot ([19b310b](https://github.com/ant-design/pro-editor/commit/19b310b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 0.33.1](https://github.com/ant-design/pro-editor/compare/v0.33.0...v0.33.1) + +Released on **2023-12-20** + +#### 🐛 修复 + +- Style 不要影响空状态按钮. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- Style 不要影响空状态按钮 ([9acf6a1](https://github.com/ant-design/pro-editor/commit/9acf6a1)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.33.0](https://github.com/ant-design/pro-editor/compare/v0.32.0...v0.33.0) + +Released on **2023-12-20** + +#### ✨ 新特性 + +- Add Editor Layout new Components, Change Name as EdiorLayout, header & footer config & layout type was dont, merge main, merge master & update snapshot, reflact code struct, udpate snapshot, update dingding demo & pannel config done, update pannel defaultSize, update snapshot, update snapshot, update styles & props. + +#### 🐛 修复 + +- Ci bulid fixed, ci fixed, delete console.log, merge branch, merge main, merge main, release workflow update, revert workflow, test workflow, update Layout Pannel Styles, update snapshot, update styles. + +
+ +
+Improvements and Fixes + +#### What's improved + +- Add Editor Layout new Components ([927cc46](https://github.com/ant-design/pro-editor/commit/927cc46)) +- Change Name as EdiorLayout ([c1e4c00](https://github.com/ant-design/pro-editor/commit/c1e4c00)) +- Header & footer config & layout type was dont ([5dfbdfb](https://github.com/ant-design/pro-editor/commit/5dfbdfb)) +- Merge main ([11c65d8](https://github.com/ant-design/pro-editor/commit/11c65d8)) +- Merge master & update snapshot ([fed6ff8](https://github.com/ant-design/pro-editor/commit/fed6ff8)) +- Reflact code struct ([2c78710](https://github.com/ant-design/pro-editor/commit/2c78710)) +- Udpate snapshot ([050fa45](https://github.com/ant-design/pro-editor/commit/050fa45)) +- Update dingding demo & pannel config done ([172dc14](https://github.com/ant-design/pro-editor/commit/172dc14)) +- Update pannel defaultSize ([af323ec](https://github.com/ant-design/pro-editor/commit/af323ec)) +- Update snapshot ([68de22d](https://github.com/ant-design/pro-editor/commit/68de22d)) +- Update snapshot ([5f77048](https://github.com/ant-design/pro-editor/commit/5f77048)) +- Update styles & props ([decb858](https://github.com/ant-design/pro-editor/commit/decb858)) + +#### What's fixed + +- Ci bulid fixed ([24df343](https://github.com/ant-design/pro-editor/commit/24df343)) +- Ci fixed ([be8c8c4](https://github.com/ant-design/pro-editor/commit/be8c8c4)) +- Delete console.log ([d45814c](https://github.com/ant-design/pro-editor/commit/d45814c)) +- Merge branch ([5b4c5a1](https://github.com/ant-design/pro-editor/commit/5b4c5a1)) +- Merge main ([1df83ce](https://github.com/ant-design/pro-editor/commit/1df83ce)) +- Merge main ([ae678e0](https://github.com/ant-design/pro-editor/commit/ae678e0)) +- Release workflow update ([59acc60](https://github.com/ant-design/pro-editor/commit/59acc60)) +- Revert workflow ([7785cc1](https://github.com/ant-design/pro-editor/commit/7785cc1)) +- Test workflow ([2905ee9](https://github.com/ant-design/pro-editor/commit/2905ee9)) +- Update Layout Pannel Styles ([a3144ac](https://github.com/ant-design/pro-editor/commit/a3144ac)) +- Update snapshot ([f2665ef](https://github.com/ant-design/pro-editor/commit/f2665ef)) +- Update styles ([241de5b](https://github.com/ant-design/pro-editor/commit/241de5b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.33.0-rc.1](https://github.com/ant-design/pro-editor/compare/v0.32.0...v0.33.0-rc.1) + +Released on **2023-12-20** + +#### ✨ 新特性 + +- Add Editor Layout new Components, Change Name as EdiorLayout, header & footer config & layout type was dont, merge main, merge master & update snapshot, reflact code struct, udpate snapshot, update dingding demo & pannel config done, update pannel defaultSize, update snapshot, update snapshot, update styles & props. + +#### 🐛 修复 + +- Ci bulid fixed, ci fixed, delete console.log, merge branch, merge main, merge main, release workflow update, revert workflow, test workflow, update Layout Pannel Styles, update snapshot, update styles. + +
+ +
+Improvements and Fixes + +#### What's improved + +- Add Editor Layout new Components ([927cc46](https://github.com/ant-design/pro-editor/commit/927cc46)) +- Change Name as EdiorLayout ([c1e4c00](https://github.com/ant-design/pro-editor/commit/c1e4c00)) +- Header & footer config & layout type was dont ([5dfbdfb](https://github.com/ant-design/pro-editor/commit/5dfbdfb)) +- Merge main ([11c65d8](https://github.com/ant-design/pro-editor/commit/11c65d8)) +- Merge master & update snapshot ([fed6ff8](https://github.com/ant-design/pro-editor/commit/fed6ff8)) +- Reflact code struct ([2c78710](https://github.com/ant-design/pro-editor/commit/2c78710)) +- Udpate snapshot ([050fa45](https://github.com/ant-design/pro-editor/commit/050fa45)) +- Update dingding demo & pannel config done ([172dc14](https://github.com/ant-design/pro-editor/commit/172dc14)) +- Update pannel defaultSize ([af323ec](https://github.com/ant-design/pro-editor/commit/af323ec)) +- Update snapshot ([68de22d](https://github.com/ant-design/pro-editor/commit/68de22d)) +- Update snapshot ([5f77048](https://github.com/ant-design/pro-editor/commit/5f77048)) +- Update styles & props ([decb858](https://github.com/ant-design/pro-editor/commit/decb858)) + +#### What's fixed + +- Ci bulid fixed ([24df343](https://github.com/ant-design/pro-editor/commit/24df343)) +- Ci fixed ([be8c8c4](https://github.com/ant-design/pro-editor/commit/be8c8c4)) +- Delete console.log ([d45814c](https://github.com/ant-design/pro-editor/commit/d45814c)) +- Merge branch ([5b4c5a1](https://github.com/ant-design/pro-editor/commit/5b4c5a1)) +- Merge main ([1df83ce](https://github.com/ant-design/pro-editor/commit/1df83ce)) +- Merge main ([ae678e0](https://github.com/ant-design/pro-editor/commit/ae678e0)) +- Release workflow update ([59acc60](https://github.com/ant-design/pro-editor/commit/59acc60)) +- Revert workflow ([7785cc1](https://github.com/ant-design/pro-editor/commit/7785cc1)) +- Test workflow ([2905ee9](https://github.com/ant-design/pro-editor/commit/2905ee9)) +- Update Layout Pannel Styles ([a3144ac](https://github.com/ant-design/pro-editor/commit/a3144ac)) +- Update snapshot ([f2665ef](https://github.com/ant-design/pro-editor/commit/f2665ef)) +- Update styles ([241de5b](https://github.com/ant-design/pro-editor/commit/241de5b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.32.0](https://github.com/ant-design/pro-editor/compare/v0.31.1...v0.32.0) + +Released on **2023-12-20** + +#### ✨ 新特性 + +- SortableList support handle control. + +#### 🐛 修复 + +- Fix creatorButtonProps and add demos. + +
+ +
+Improvements and Fixes + +#### What's improved + +- SortableList support handle control ([6a1ea43](https://github.com/ant-design/pro-editor/commit/6a1ea43)) + +#### What's fixed + +- Fix creatorButtonProps and add demos ([4f37d45](https://github.com/ant-design/pro-editor/commit/4f37d45)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 0.31.1](https://github.com/ant-design/pro-editor/compare/v0.31.0...v0.31.1) + +Released on **2023-12-18** + +#### 🐛 修复 + +- Fix markdown & highlight not support memo, remove demo old api. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- Fix markdown & highlight not support memo ([136850f](https://github.com/ant-design/pro-editor/commit/136850f)) +- Remove demo old api ([fd9ff8c](https://github.com/ant-design/pro-editor/commit/fd9ff8c)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.31.0](https://github.com/ant-design/pro-editor/compare/v0.30.0...v0.31.0) + +Released on **2023-12-12** + +#### ✨ 新特性 + +- Change all default size as middle & update FieldSet doc. + +
+ +
+Improvements and Fixes + +#### What's improved + +- Change all default size as middle & update FieldSet doc ([92d12aa](https://github.com/ant-design/pro-editor/commit/92d12aa)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.30.0](https://github.com/ant-design/pro-editor/compare/v0.29.2...v0.30.0) + +Released on **2023-12-06** + +#### ✨ 新特性 + +- Add Editor Layout new Components, Change Name as EdiorLayout, merge master & update snapshot, update pannel defaultSize, update snapshot, update styles & props. + +#### 🐛 修复 + +- Ci bulid fixed, merge main, release workflow update, revert workflow, test workflow, update styles. + +
+ +
+Improvements and Fixes + +#### What's improved + +- Add Editor Layout new Components ([927cc46](https://github.com/ant-design/pro-editor/commit/927cc46)) +- Change Name as EdiorLayout ([c1e4c00](https://github.com/ant-design/pro-editor/commit/c1e4c00)) +- Merge master & update snapshot ([fed6ff8](https://github.com/ant-design/pro-editor/commit/fed6ff8)) +- Update pannel defaultSize ([af323ec](https://github.com/ant-design/pro-editor/commit/af323ec)) +- Update snapshot ([5f77048](https://github.com/ant-design/pro-editor/commit/5f77048)) +- Update styles & props ([decb858](https://github.com/ant-design/pro-editor/commit/decb858)) + +#### What's fixed + +- Ci bulid fixed ([24df343](https://github.com/ant-design/pro-editor/commit/24df343)) +- Merge main ([ae678e0](https://github.com/ant-design/pro-editor/commit/ae678e0)) +- Release workflow update ([59acc60](https://github.com/ant-design/pro-editor/commit/59acc60)) +- Revert workflow ([7785cc1](https://github.com/ant-design/pro-editor/commit/7785cc1)) +- Test workflow ([2905ee9](https://github.com/ant-design/pro-editor/commit/2905ee9)) +- Update styles ([241de5b](https://github.com/ant-design/pro-editor/commit/241de5b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.30.0-rc.2](https://github.com/ant-design/pro-editor/compare/v0.30.0-rc.1...v0.30.0-rc.2) + +Released on **2023-12-05** + +#### 🐛 修复 + +- Ci bulid fixed, update styles. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- Ci bulid fixed ([24df343](https://github.com/ant-design/pro-editor/commit/24df343)) +- Update styles ([241de5b](https://github.com/ant-design/pro-editor/commit/241de5b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.30.0-rc.1](https://github.com/ant-design/pro-editor/compare/v0.29.2...v0.30.0-rc.1) + +Released on **2023-12-04** + +#### ✨ 新特性 + +- Add Editor Layout new Components, update pannel defaultSize, update snapshot, update styles & props. + +#### 🐛 修复 + +- Merge main, revert workflow, test workflow. + +
+ +
+Improvements and Fixes + +#### What's improved + +- Add Editor Layout new Components ([927cc46](https://github.com/ant-design/pro-editor/commit/927cc46)) +- Update pannel defaultSize ([af323ec](https://github.com/ant-design/pro-editor/commit/af323ec)) +- Update snapshot ([5f77048](https://github.com/ant-design/pro-editor/commit/5f77048)) +- Update styles & props ([decb858](https://github.com/ant-design/pro-editor/commit/decb858)) + +#### What's fixed + +- Merge main ([ae678e0](https://github.com/ant-design/pro-editor/commit/ae678e0)) +- Revert workflow ([7785cc1](https://github.com/ant-design/pro-editor/commit/7785cc1)) +- Test workflow ([2905ee9](https://github.com/ant-design/pro-editor/commit/2905ee9)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.29.0-rc.1](https://github.com/ant-design/pro-editor/compare/v0.28.0...v0.29.0-rc.1) + +Released on **2023-12-04** + +#### ✨ 新特性 + +- Add Editor Layout new Components, sortablelist support renderHeader", update pannel defaultSize, update snapshot. + +#### 🐛 修复 + +- Revert workflow, test workflow. + +
+ +
+Improvements and Fixes + +#### What's improved + +- Add Editor Layout new Components ([927cc46](https://github.com/ant-design/pro-editor/commit/927cc46)) +- Sortablelist support renderHeader" ([53d75fd](https://github.com/ant-design/pro-editor/commit/53d75fd)) +- Update pannel defaultSize ([af323ec](https://github.com/ant-design/pro-editor/commit/af323ec)) +- Update snapshot ([5f77048](https://github.com/ant-design/pro-editor/commit/5f77048)) + +#### What's fixed + +- Revert workflow ([7785cc1](https://github.com/ant-design/pro-editor/commit/7785cc1)) +- Test workflow ([2905ee9](https://github.com/ant-design/pro-editor/commit/2905ee9)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 0.28.0](https://github.com/ant-design/pro-editor/compare/v0.27.0...v0.28.0) Released on **2023-11-24** @@ -33,7 +621,7 @@ -## [Version 0.28.0-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.27.0...v0.28.0-alpha.1) +## [Version 0.28.0-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.27.0...v0.28.0-alpha.1) Released on **2023-11-24** @@ -66,7 +654,7 @@ -## [Version 0.27.0](https://github.com/ant-design/pro-editor/compare/v0.26.0...v0.27.0) +## [Version 0.27.0](https://github.com/ant-design/pro-editor/compare/v0.26.0...v0.27.0) Released on **2023-11-24** @@ -92,7 +680,7 @@ -## [Version 0.26.0](https://github.com/ant-design/pro-editor/compare/v0.25.0...v0.26.0) +## [Version 0.26.0](https://github.com/ant-design/pro-editor/compare/v0.25.0...v0.26.0) Released on **2023-11-22** @@ -128,7 +716,7 @@ -## [Version 0.25.0](https://github.com/ant-design/pro-editor/compare/v0.24.0...v0.25.0) +## [Version 0.25.0](https://github.com/ant-design/pro-editor/compare/v0.24.0...v0.25.0) Released on **2023-11-09** @@ -162,7 +750,7 @@ -## [Version 0.24.0](https://github.com/ant-design/pro-editor/compare/v0.23.0...v0.24.0) +## [Version 0.24.0](https://github.com/ant-design/pro-editor/compare/v0.23.0...v0.24.0) Released on **2023-11-06** @@ -190,7 +778,7 @@ -## [Version 0.23.0](https://github.com/ant-design/pro-editor/compare/v0.22.0...v0.23.0) +## [Version 0.23.0](https://github.com/ant-design/pro-editor/compare/v0.22.0...v0.23.0) Released on **2023-10-31** @@ -227,7 +815,7 @@ -## [Version 0.22.0](https://github.com/ant-design/pro-editor/compare/v0.21.0...v0.22.0) +## [Version 0.22.0](https://github.com/ant-design/pro-editor/compare/v0.21.0...v0.22.0) Released on **2023-10-31** @@ -264,7 +852,7 @@ -## [Version 0.21.0](https://github.com/ant-design/pro-editor/compare/v0.20.5...v0.21.0) +## [Version 0.21.0](https://github.com/ant-design/pro-editor/compare/v0.20.5...v0.21.0) Released on **2023-10-13** @@ -301,7 +889,7 @@ -### [Version 0.20.5](https://github.com/ant-design/pro-editor/compare/v0.20.4...v0.20.5) +### [Version 0.20.5](https://github.com/ant-design/pro-editor/compare/v0.20.4...v0.20.5) Released on **2023-09-18** @@ -316,7 +904,7 @@ #### What's fixed -- 修复 FieldTitle 样式错误, closes [#92](https://github.com/ant-design/pro-editor/issues/92) ([789172e](https://github.com/ant-design/pro-editor/commit/789172e)) +- 修复 FieldTitle 样式错误,closes [#92](https://github.com/ant-design/pro-editor/issues/92) ([789172e](https://github.com/ant-design/pro-editor/commit/789172e)) @@ -326,7 +914,7 @@ -### [Version 0.20.4](https://github.com/ant-design/pro-editor/compare/v0.20.3...v0.20.4) +### [Version 0.20.4](https://github.com/ant-design/pro-editor/compare/v0.20.3...v0.20.4) Released on **2023-09-15** @@ -351,7 +939,7 @@ -### [Version 0.20.3](https://github.com/ant-design/pro-editor/compare/v0.20.2...v0.20.3) +### [Version 0.20.3](https://github.com/ant-design/pro-editor/compare/v0.20.2...v0.20.3) Released on **2023-09-15** @@ -377,7 +965,7 @@ -### [Version 0.20.2](https://github.com/ant-design/pro-editor/compare/v0.20.1...v0.20.2) +### [Version 0.20.2](https://github.com/ant-design/pro-editor/compare/v0.20.1...v0.20.2) Released on **2023-09-13** @@ -402,7 +990,7 @@ -### [Version 0.20.1](https://github.com/ant-design/pro-editor/compare/v0.20.0...v0.20.1) +### [Version 0.20.1](https://github.com/ant-design/pro-editor/compare/v0.20.0...v0.20.1) Released on **2023-09-12** @@ -427,7 +1015,7 @@ -## [Version 0.20.0](https://github.com/ant-design/pro-editor/compare/v0.19.1...v0.20.0) +## [Version 0.20.0](https://github.com/ant-design/pro-editor/compare/v0.19.1...v0.20.0) Released on **2023-09-08** @@ -461,7 +1049,7 @@ -### [Version 0.19.1](https://github.com/ant-design/pro-editor/compare/v0.19.0...v0.19.1) +### [Version 0.19.1](https://github.com/ant-design/pro-editor/compare/v0.19.0...v0.19.1) Released on **2023-09-07** @@ -487,7 +1075,7 @@ -## [Version 0.19.0](https://github.com/ant-design/pro-editor/compare/v0.18.1...v0.19.0) +## [Version 0.19.0](https://github.com/ant-design/pro-editor/compare/v0.18.1...v0.19.0) Released on **2023-09-06** @@ -520,7 +1108,7 @@ -### [Version 0.18.1](https://github.com/ant-design/pro-editor/compare/v0.18.0...v0.18.1) +### [Version 0.18.1](https://github.com/ant-design/pro-editor/compare/v0.18.0...v0.18.1) Released on **2023-09-04** @@ -545,7 +1133,7 @@ -## [Version 0.18.0](https://github.com/ant-design/pro-editor/compare/v0.17.0...v0.18.0) +## [Version 0.18.0](https://github.com/ant-design/pro-editor/compare/v0.17.0...v0.18.0) Released on **2023-09-01** @@ -579,7 +1167,7 @@ -## [Version 0.17.0](https://github.com/ant-design/pro-editor/compare/v0.16.0...v0.17.0) +## [Version 0.17.0](https://github.com/ant-design/pro-editor/compare/v0.16.0...v0.17.0) Released on **2023-08-31** @@ -614,7 +1202,7 @@ -## [Version 0.16.0](https://github.com/ant-design/pro-editor/compare/v0.15.0...v0.16.0) +## [Version 0.16.0](https://github.com/ant-design/pro-editor/compare/v0.15.0...v0.16.0) Released on **2023-08-31** @@ -624,7 +1212,7 @@ #### 🐛 修复 -- DispatchListData error, 修复控制台报错, 去除自动生成 ID 的逻辑,改为由用户自行传递 ID. +- DispatchListData error, 修复控制台报错,去除自动生成 ID 的逻辑,改为由用户自行传递 ID.
@@ -649,7 +1237,7 @@ -## [Version 0.15.0](https://github.com/ant-design/pro-editor/compare/v0.14.1...v0.15.0) +## [Version 0.15.0](https://github.com/ant-design/pro-editor/compare/v0.14.1...v0.15.0) Released on **2023-08-30** @@ -674,13 +1262,13 @@ -### [Version 0.14.1](https://github.com/ant-design/pro-editor/compare/v0.14.0...v0.14.1) +### [Version 0.14.1](https://github.com/ant-design/pro-editor/compare/v0.14.0...v0.14.1) Released on **2023-08-29** #### 🐛 修复 -- Drag over index lost, 修复 sortableList item 样式问题 && 更新文档, 多实例时的定位错误问题. +- Drag over index lost, 修复 sortableList item 样式问题 && 更新文档,多实例时的定位错误问题.
@@ -701,13 +1289,13 @@ -## [Version 0.14.0](https://github.com/ant-design/pro-editor/compare/v0.13.1...v0.14.0) +## [Version 0.14.0](https://github.com/ant-design/pro-editor/compare/v0.13.1...v0.14.0) Released on **2023-08-29** #### ✨ 新特性 -- Auto generate id, support getItemStyles, 将创建按钮迁移到 columnList, 自定义创建按钮, 迁移 creatorButtonProps 属性到 columnList. +- Auto generate id, support getItemStyles, 将创建按钮迁移到 columnList, 自定义创建按钮,迁移 creatorButtonProps 属性到 columnList. #### 🐛 修复 @@ -740,28 +1328,28 @@ -## [Version 0.2.0](https://github.com/ant-design/pro-editor/compare/v0.1.1...v0.2.0) +## [Version 0.2.0](https://github.com/ant-design/pro-editor/compare/v0.1.1...v0.2.0) Released on **2023-08-28** #### ✨ 新特性 -- **component-asset**: CreateUseAssetStore 方法支持导出 AssetProvider, 优化 createTestAssetStore ,便于下游测试, 添加 createTestAssetStore 方法,便于下游测试. -- **pro-editor**: 增加 updateCanvasInteraction 方法, 支持 getCanvasInteraction,并调整 store set、get 命名风格, 支持撤销重做, 支持配置 ProEditorStore 在 devtools 中的名称. +- **component-asset**: CreateUseAssetStore 方法支持导出 AssetProvider, 优化 createTestAssetStore ,便于下游测试,添加 createTestAssetStore 方法,便于下游测试. +- **pro-editor**: 增加 updateCanvasInteraction 方法,支持 getCanvasInteraction,并调整 store set、get 命名风格,支持撤销重做,支持配置 ProEditorStore 在 devtools 中的名称. - **sortable-list**: 导出 SortableListDispatchPayload 类型定义. -- **sortable-tree**: 支持禁用拖拽功能, 新增 sortableRule 函数规则,控制拖动排序. -- Add ActinGroup Components, add c2d2c getDiffPropsWithSchema and getSymbolMasterNameFromProps func, add field component, add more ActionGroup api support & style update, add more antd temple components, SortableList support onChange event, support undo/redo for ProEditor, update Action Css Transition, update snapshot, 完善 AssetStore 数据链路, 实现 AssetStore 与 EditorStore 的状态自动同步, 新增 ContextMenu 组件, 新增 LevaPanel 属性面板, 重构优化 ComponentAsset store 实现,收敛 AssetStore 的定义方式. +- **sortable-tree**: 支持禁用拖拽功能,新增 sortableRule 函数规则,控制拖动排序. +- Add ActinGroup Components, add c2d2c getDiffPropsWithSchema and getSymbolMasterNameFromProps func, add field component, add more ActionGroup api support & style update, add more antd temple components, SortableList support onChange event, support undo/redo for ProEditor, update Action Css Transition, update snapshot, 完善 AssetStore 数据链路,实现 AssetStore 与 EditorStore 的状态自动同步,新增 ContextMenu 组件,新增 LevaPanel 属性面板,重构优化 ComponentAsset store 实现,收敛 AssetStore 的定义方式. #### 🐛 修复 -- **awareness**: 修正类型导出问题, 兼容服务端渲染. -- **component-asset**: 修正 AssetSchema 类型, 修正 CreateAssetStore 的类型,对齐到 ProEditorInstance, 修正类型. -- **excel-table**: 修正 Hansontable 在 server 端的兼容性问题, 修正 Hansontable 在 server 端的兼容性问题. -- **pro-editor**: 修正与 assetStore 的数据同步问题, 调整 devtools api 名称. +- **awareness**: 修正类型导出问题,兼容服务端渲染. +- **component-asset**: 修正 AssetSchema 类型,修正 CreateAssetStore 的类型,对齐到 ProEditorInstance, 修正类型. +- **excel-table**: 修正 Hansontable 在 server 端的兼容性问题,修正 Hansontable 在 server 端的兼容性问题. +- **pro-editor**: 修正与 assetStore 的数据同步问题,调整 devtools api 名称. - **sortable-list**: 兼容默认数据展示. -- **sortable-tree**: 修正 ReactNodeProps 方法类型定义, 修正 SortableTree 在 server 端的兼容性问题, 修正 SortableTree 在 server 端的兼容性问题. +- **sortable-tree**: 修正 ReactNodeProps 方法类型定义,修正 SortableTree 在 server 端的兼容性问题,修正 SortableTree 在 server 端的兼容性问题. - **use-proeditor**: 修正 togglePanelExpand 方法缺失的 bug. -- Fix avatar key, fix config update, fix Input ref props, fix miss deps, github pages css style lost, highlight scroll error, refactor with zustand v4.4 equalFn, remove lucide icon, SortableList 默认空数据处理, test case error, test snapshot udpate, update snapshot, update snapshot, update snapshot, upgrade zustand version, 优化 Input 和 InputNumber 组件的受控变更逻辑, 修正潜藏的 undo/redo bug,并补充单测, 将 antd-style 设为 peer,修正 ThemeProvider 多实例问题, 将 handsontable 模块异步导入,解决 SSR 下无法使用的问题. +- Fix avatar key, fix config update, fix Input ref props, fix miss deps, github pages css style lost, highlight scroll error, refactor with zustand v4.4 equalFn, remove lucide icon, SortableList 默认空数据处理,test case error, test snapshot udpate, update snapshot, update snapshot, update snapshot, upgrade zustand version, 优化 Input 和 InputNumber 组件的受控变更逻辑,修正潜藏的 undo/redo bug,并补充单测,将 antd-style 设为 peer,修正 ThemeProvider 多实例问题,将 handsontable 模块异步导入,解决 SSR 下无法使用的问题. #### 💄 样式 @@ -784,7 +1372,7 @@ - **pro-editor**: 支持配置 ProEditorStore 在 devtools 中的名称 ([2cedbb3](https://github.com/ant-design/pro-editor/commit/2cedbb3)) - **sortable-list**: 导出 SortableListDispatchPayload 类型定义 ([f47782b](https://github.com/ant-design/pro-editor/commit/f47782b)) - **sortable-tree**: 支持禁用拖拽功能 ([9a00235](https://github.com/ant-design/pro-editor/commit/9a00235)) -- **sortable-tree**: 新增 sortableRule 函数规则,控制拖动排序, closes [#46](https://github.com/ant-design/pro-editor/issues/46) ([e941865](https://github.com/ant-design/pro-editor/commit/e941865)) +- **sortable-tree**: 新增 sortableRule 函数规则,控制拖动排序,closes [#46](https://github.com/ant-design/pro-editor/issues/46) ([e941865](https://github.com/ant-design/pro-editor/commit/e941865)) - Add ActinGroup Components ([231d713](https://github.com/ant-design/pro-editor/commit/231d713)) - Add c2d2c getDiffPropsWithSchema and getSymbolMasterNameFromProps func, closes [#52](https://github.com/ant-design/pro-editor/issues/52) ([aa62185](https://github.com/ant-design/pro-editor/commit/aa62185)) - Add field component, closes [#49](https://github.com/ant-design/pro-editor/issues/49) ([dfdfd16](https://github.com/ant-design/pro-editor/commit/dfdfd16)) @@ -831,7 +1419,7 @@ - Update snapshot ([511defb](https://github.com/ant-design/pro-editor/commit/511defb)) - Update snapshot ([53e7dfb](https://github.com/ant-design/pro-editor/commit/53e7dfb)) - Upgrade zustand version ([1fc2daa](https://github.com/ant-design/pro-editor/commit/1fc2daa)) -- 优化 Input 和 InputNumber 组件的受控变更逻辑, closes [#45](https://github.com/ant-design/pro-editor/issues/45) ([e1c7d4f](https://github.com/ant-design/pro-editor/commit/e1c7d4f)) +- 优化 Input 和 InputNumber 组件的受控变更逻辑,closes [#45](https://github.com/ant-design/pro-editor/issues/45) ([e1c7d4f](https://github.com/ant-design/pro-editor/commit/e1c7d4f)) - 修正潜藏的 undo/redo bug,并补充单测 ([d1e3cc1](https://github.com/ant-design/pro-editor/commit/d1e3cc1)) - 将 antd-style 设为 peer,修正 ThemeProvider 多实例问题 ([4ab40d7](https://github.com/ant-design/pro-editor/commit/4ab40d7)) - 将 handsontable 模块异步导入,解决 SSR 下无法使用的问题 ([ab69afd](https://github.com/ant-design/pro-editor/commit/ab69afd)) @@ -849,7 +1437,7 @@ -## [Version 0.13.0](https://github.com/ant-design/pro-editor/compare/v0.12.1...v0.13.0) +## [Version 0.13.0](https://github.com/ant-design/pro-editor/compare/v0.12.1...v0.13.0) Released on **2023-08-23** @@ -876,7 +1464,7 @@ -### [Version 0.12.1](https://github.com/ant-design/pro-editor/compare/v0.12.0...v0.12.1) +### [Version 0.12.1](https://github.com/ant-design/pro-editor/compare/v0.12.0...v0.12.1) Released on **2023-08-22** @@ -902,7 +1490,7 @@ -## [Version 0.12.0](https://github.com/ant-design/pro-editor/compare/v0.11.0...v0.12.0) +## [Version 0.12.0](https://github.com/ant-design/pro-editor/compare/v0.11.0...v0.12.0) Released on **2023-08-15** @@ -935,7 +1523,7 @@ -## [Version 0.11.0](https://github.com/ant-design/pro-editor/compare/v0.10.0...v0.11.0) +## [Version 0.11.0](https://github.com/ant-design/pro-editor/compare/v0.10.0...v0.11.0) Released on **2023-08-14** @@ -969,7 +1557,7 @@ -## [Version 0.10.0](https://github.com/ant-design/pro-editor/compare/v0.9.0...v0.10.0) +## [Version 0.10.0](https://github.com/ant-design/pro-editor/compare/v0.9.0...v0.10.0) Released on **2023-08-01** @@ -1002,7 +1590,7 @@ -## [Version 0.9.0](https://github.com/ant-design/pro-editor/compare/v0.8.0...v0.9.0) +## [Version 0.9.0](https://github.com/ant-design/pro-editor/compare/v0.8.0...v0.9.0) Released on **2023-07-24** @@ -1027,7 +1615,7 @@ -## [Version 0.8.0](https://github.com/ant-design/pro-editor/compare/v0.7.2...v0.8.0) +## [Version 0.8.0](https://github.com/ant-design/pro-editor/compare/v0.7.2...v0.8.0) Released on **2023-07-03** @@ -1042,7 +1630,7 @@ #### What's improved -- **sortable-tree**: 新增 sortableRule 函数规则,控制拖动排序, closes [#46](https://github.com/ant-design/pro-editor/issues/46) ([9b8d127](https://github.com/ant-design/pro-editor/commit/9b8d127)) +- **sortable-tree**: 新增 sortableRule 函数规则,控制拖动排序,closes [#46](https://github.com/ant-design/pro-editor/issues/46) ([9b8d127](https://github.com/ant-design/pro-editor/commit/9b8d127)) @@ -1052,7 +1640,7 @@ -### [Version 0.7.2](https://github.com/ant-design/pro-editor/compare/v0.7.1...v0.7.2) +### [Version 0.7.2](https://github.com/ant-design/pro-editor/compare/v0.7.1...v0.7.2) Released on **2023-07-03** @@ -1077,7 +1665,7 @@ -### [Version 0.7.1](https://github.com/ant-design/pro-editor/compare/v0.7.0...v0.7.1) +### [Version 0.7.1](https://github.com/ant-design/pro-editor/compare/v0.7.0...v0.7.1) Released on **2023-07-03** @@ -1092,7 +1680,7 @@ #### What's fixed -- 优化 Input 和 InputNumber 组件的受控变更逻辑, closes [#45](https://github.com/ant-design/pro-editor/issues/45) ([e903a6b](https://github.com/ant-design/pro-editor/commit/e903a6b)) +- 优化 Input 和 InputNumber 组件的受控变更逻辑,closes [#45](https://github.com/ant-design/pro-editor/issues/45) ([e903a6b](https://github.com/ant-design/pro-editor/commit/e903a6b)) @@ -1102,7 +1690,7 @@ -## [Version 0.7.0](https://github.com/ant-design/pro-editor/compare/v0.6.0...v0.7.0) +## [Version 0.7.0](https://github.com/ant-design/pro-editor/compare/v0.6.0...v0.7.0) Released on **2023-06-25** @@ -1127,7 +1715,7 @@ -## [Version 0.6.0](https://github.com/ant-design/pro-editor/compare/v0.5.0...v0.6.0) +## [Version 0.6.0](https://github.com/ant-design/pro-editor/compare/v0.5.0...v0.6.0) Released on **2023-06-20** @@ -1152,7 +1740,7 @@ -## [Version 0.5.0](https://github.com/ant-design/pro-editor/compare/v0.4.2...v0.5.0) +## [Version 0.5.0](https://github.com/ant-design/pro-editor/compare/v0.4.2...v0.5.0) Released on **2023-06-19** @@ -1162,10 +1750,10 @@ #### 🐛 修复 -- **awareness**: 修正类型导出问题, 兼容服务端渲染. +- **awareness**: 修正类型导出问题,兼容服务端渲染. - **component-asset**: 修正 AssetSchema 类型. -- **excel-table**: 修正 Hansontable 在 server 端的兼容性问题, 修正 Hansontable 在 server 端的兼容性问题. -- **sortable-tree**: 修正 SortableTree 在 server 端的兼容性问题, 修正 SortableTree 在 server 端的兼容性问题. +- **excel-table**: 修正 Hansontable 在 server 端的兼容性问题,修正 Hansontable 在 server 端的兼容性问题. +- **sortable-tree**: 修正 SortableTree 在 server 端的兼容性问题,修正 SortableTree 在 server 端的兼容性问题. - Fix Input ref props, 将 antd-style 设为 peer,修正 ThemeProvider 多实例问题.
@@ -1197,7 +1785,7 @@ -## [Version 0.5.0-alpha.8](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.7...v0.5.0-alpha.8) +## [Version 0.5.0-alpha.8](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.7...v0.5.0-alpha.8) Released on **2023-06-18** @@ -1222,7 +1810,7 @@ -## [Version 0.5.0-alpha.7](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.6...v0.5.0-alpha.7) +## [Version 0.5.0-alpha.7](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.6...v0.5.0-alpha.7) Released on **2023-06-18** @@ -1247,7 +1835,7 @@ -## [Version 0.5.0-alpha.6](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.5...v0.5.0-alpha.6) +## [Version 0.5.0-alpha.6](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.5...v0.5.0-alpha.6) Released on **2023-06-18** @@ -1272,7 +1860,7 @@ -## [Version 0.5.0-alpha.5](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.4...v0.5.0-alpha.5) +## [Version 0.5.0-alpha.5](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.4...v0.5.0-alpha.5) Released on **2023-06-18** @@ -1297,7 +1885,7 @@ -## [Version 0.5.0-alpha.4](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.3...v0.5.0-alpha.4) +## [Version 0.5.0-alpha.4](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.3...v0.5.0-alpha.4) Released on **2023-06-18** @@ -1324,7 +1912,7 @@ -## [Version 0.5.0-alpha.3](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.2...v0.5.0-alpha.3) +## [Version 0.5.0-alpha.3](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.2...v0.5.0-alpha.3) Released on **2023-06-18** @@ -1349,7 +1937,7 @@ -## [Version 0.5.0-alpha.2](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.1...v0.5.0-alpha.2) +## [Version 0.5.0-alpha.2](https://github.com/ant-design/pro-editor/compare/v0.5.0-alpha.1...v0.5.0-alpha.2) Released on **2023-06-17** @@ -1374,7 +1962,7 @@ -## [Version 0.5.0-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.4.2-alpha.2...v0.5.0-alpha.1) +## [Version 0.5.0-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.4.2-alpha.2...v0.5.0-alpha.1) Released on **2023-06-16** @@ -1399,7 +1987,7 @@ -### [Version 0.4.2](https://github.com/ant-design/pro-editor/compare/v0.4.1...v0.4.2) +### [Version 0.4.2](https://github.com/ant-design/pro-editor/compare/v0.4.1...v0.4.2) Released on **2023-06-18** @@ -1424,7 +2012,7 @@ -### [Version 0.4.2-alpha.2](https://github.com/ant-design/pro-editor/compare/v0.4.2-alpha.1...v0.4.2-alpha.2) +### [Version 0.4.2-alpha.2](https://github.com/ant-design/pro-editor/compare/v0.4.2-alpha.1...v0.4.2-alpha.2) Released on **2023-06-16** @@ -1449,7 +2037,7 @@ -### [Version 0.4.2-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.4.1...v0.4.2-alpha.1) +### [Version 0.4.2-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.4.1...v0.4.2-alpha.1) Released on **2023-06-16** @@ -1474,7 +2062,7 @@ -### [Version 0.4.1](https://github.com/ant-design/pro-editor/compare/v0.4.0...v0.4.1) +### [Version 0.4.1](https://github.com/ant-design/pro-editor/compare/v0.4.0...v0.4.1) Released on **2023-06-15** @@ -1499,19 +2087,19 @@ -## [Version 0.4.0](https://github.com/ant-design/pro-editor/compare/v0.3.0...v0.4.0) +## [Version 0.4.0](https://github.com/ant-design/pro-editor/compare/v0.3.0...v0.4.0) Released on **2023-06-15** #### ✨ 新特性 -- **component-asset**: CreateUseAssetStore 方法支持导出 AssetProvider, 优化 createTestAssetStore ,便于下游测试, 添加 createTestAssetStore 方法,便于下游测试. -- **pro-editor**: 增加 updateCanvasInteraction 方法, 支持 getCanvasInteraction,并调整 store set、get 命名风格, 支持配置 ProEditorStore 在 devtools 中的名称. +- **component-asset**: CreateUseAssetStore 方法支持导出 AssetProvider, 优化 createTestAssetStore ,便于下游测试,添加 createTestAssetStore 方法,便于下游测试. +- **pro-editor**: 增加 updateCanvasInteraction 方法,支持 getCanvasInteraction,并调整 store set、get 命名风格,支持配置 ProEditorStore 在 devtools 中的名称. #### 🐛 修复 - **component-asset**: 修正 CreateAssetStore 的类型,对齐到 ProEditorInstance, 修正类型. -- **pro-editor**: 修正与 assetStore 的数据同步问题, 调整 devtools api 名称. +- **pro-editor**: 修正与 assetStore 的数据同步问题,调整 devtools api 名称. - **sortable-tree**: 修正 ReactNodeProps 方法类型定义.
@@ -1544,7 +2132,7 @@ -## [Version 0.4.0-alpha.8](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.7...v0.4.0-alpha.8) +## [Version 0.4.0-alpha.8](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.7...v0.4.0-alpha.8) Released on **2023-06-15** @@ -1569,7 +2157,7 @@ -## [Version 0.4.0-alpha.7](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.6...v0.4.0-alpha.7) +## [Version 0.4.0-alpha.7](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.6...v0.4.0-alpha.7) Released on **2023-06-15** @@ -1596,7 +2184,7 @@ -## [Version 0.4.0-alpha.6](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.5...v0.4.0-alpha.6) +## [Version 0.4.0-alpha.6](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.5...v0.4.0-alpha.6) Released on **2023-06-15** @@ -1621,7 +2209,7 @@ -## [Version 0.4.0-alpha.5](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.4...v0.4.0-alpha.5) +## [Version 0.4.0-alpha.5](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.4...v0.4.0-alpha.5) Released on **2023-06-15** @@ -1654,7 +2242,7 @@ -## [Version 0.4.0-alpha.4](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.3...v0.4.0-alpha.4) +## [Version 0.4.0-alpha.4](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.3...v0.4.0-alpha.4) Released on **2023-06-15** @@ -1679,7 +2267,7 @@ -## [Version 0.4.0-alpha.3](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.2...v0.4.0-alpha.3) +## [Version 0.4.0-alpha.3](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.2...v0.4.0-alpha.3) Released on **2023-06-15** @@ -1704,7 +2292,7 @@ -## [Version 0.4.0-alpha.2](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.1...v0.4.0-alpha.2) +## [Version 0.4.0-alpha.2](https://github.com/ant-design/pro-editor/compare/v0.4.0-alpha.1...v0.4.0-alpha.2) Released on **2023-06-14** @@ -1729,7 +2317,7 @@ -## [Version 0.4.0-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.3.0...v0.4.0-alpha.1) +## [Version 0.4.0-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.3.0...v0.4.0-alpha.1) Released on **2023-06-14** @@ -1762,13 +2350,13 @@ -## [Version 0.3.0](https://github.com/ant-design/pro-editor/compare/v0.2.3...v0.3.0) +## [Version 0.3.0](https://github.com/ant-design/pro-editor/compare/v0.2.3...v0.3.0) Released on **2023-06-14** #### ✨ 新特性 -- Support undo/redo for ProEditor, 完善 AssetStore 数据链路, 实现 AssetStore 与 EditorStore 的状态自动同步, 新增 ContextMenu 组件, 新增 LevaPanel 属性面板, 重构优化 ComponentAsset store 实现,收敛 AssetStore 的定义方式. +- Support undo/redo for ProEditor, 完善 AssetStore 数据链路,实现 AssetStore 与 EditorStore 的状态自动同步,新增 ContextMenu 组件,新增 LevaPanel 属性面板,重构优化 ComponentAsset store 实现,收敛 AssetStore 的定义方式. #### 🐛 修复 @@ -1812,7 +2400,7 @@ -## [Version 0.3.0-alpha.8](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.7...v0.3.0-alpha.8) +## [Version 0.3.0-alpha.8](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.7...v0.3.0-alpha.8) Released on **2023-06-14** @@ -1845,13 +2433,13 @@ -## [Version 0.3.0-alpha.7](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.6...v0.3.0-alpha.7) +## [Version 0.3.0-alpha.7](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.6...v0.3.0-alpha.7) Released on **2023-06-14** #### ✨ 新特性 -- 实现 AssetStore 与 EditorStore 的状态自动同步, 新增 LevaPanel 属性面板. +- 实现 AssetStore 与 EditorStore 的状态自动同步,新增 LevaPanel 属性面板.
@@ -1871,7 +2459,7 @@ -## [Version 0.3.0-alpha.6](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.5...v0.3.0-alpha.6) +## [Version 0.3.0-alpha.6](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.5...v0.3.0-alpha.6) Released on **2023-06-13** @@ -1896,7 +2484,7 @@ -## [Version 0.3.0-alpha.5](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.4...v0.3.0-alpha.5) +## [Version 0.3.0-alpha.5](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.4...v0.3.0-alpha.5) Released on **2023-06-13** @@ -1921,7 +2509,7 @@ -## [Version 0.3.0-alpha.4](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.3...v0.3.0-alpha.4) +## [Version 0.3.0-alpha.4](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.3...v0.3.0-alpha.4) Released on **2023-06-13** @@ -1946,7 +2534,7 @@ -## [Version 0.3.0-alpha.3](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.2...v0.3.0-alpha.3) +## [Version 0.3.0-alpha.3](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.2...v0.3.0-alpha.3) Released on **2023-06-13** @@ -1971,7 +2559,7 @@ -## [Version 0.3.0-alpha.2](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.1...v0.3.0-alpha.2) +## [Version 0.3.0-alpha.2](https://github.com/ant-design/pro-editor/compare/v0.3.0-alpha.1...v0.3.0-alpha.2) Released on **2023-06-13** @@ -1996,7 +2584,7 @@ -## [Version 0.3.0-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.2.3...v0.3.0-alpha.1) +## [Version 0.3.0-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.2.3...v0.3.0-alpha.1) Released on **2023-06-13** @@ -2029,7 +2617,7 @@ -### [Version 0.2.3](https://github.com/ant-design/pro-editor/compare/v0.2.2...v0.2.3) +### [Version 0.2.3](https://github.com/ant-design/pro-editor/compare/v0.2.2...v0.2.3) Released on **2023-06-13** @@ -2054,7 +2642,7 @@ -### [Version 0.2.2](https://github.com/ant-design/pro-editor/compare/v0.2.1...v0.2.2) +### [Version 0.2.2](https://github.com/ant-design/pro-editor/compare/v0.2.1...v0.2.2) Released on **2023-06-13** @@ -2071,7 +2659,7 @@ -### [Version 0.2.2-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.2.1...v0.2.2-alpha.1) +### [Version 0.2.2-alpha.1](https://github.com/ant-design/pro-editor/compare/v0.2.1...v0.2.2-alpha.1) Released on **2023-06-13** @@ -2088,7 +2676,7 @@ -### Version 0.2.1 +### Version 0.2.1 Released on **2023-06-12** @@ -2098,7 +2686,7 @@ #### 🐛 修复 -- Fix avatar key, github pages css style lost, SortableList 默认空数据处理, test case error, 将 handsontable 模块异步导入,解决 SSR 下无法使用的问题. +- Fix avatar key, github pages css style lost, SortableList 默认空数据处理,test case error, 将 handsontable 模块异步导入,解决 SSR 下无法使用的问题.
diff --git a/README.md b/README.md index 7ff9b5fd..78cda0d1 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,77 @@ - - -

- - - -

- -

Ant Design ProEditor

-
-🌟 An Editor UI Framework and Components - -[Changelog](./CHANGELOG.md) · [Report Bug][issues-url] · [Request Feature][issues-url] - - - -[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url] [![install size][npm-size]][npm-size-url] - -[![Test CI status][test-ci]][test-ci-url] [![Deploy CI][release-ci]][release-ci-url] [![Coverage][coverage]][codecov-url] + -[![contributors][contributors-shield]][contributors-url] [![forks][forks-shield]][forks-url] [![stargazers][stargazers-shield]][stargazers-url] [![issues][issues-shield]][issues-url] +

ProEditor

-[![ docs by dumi][dumi-url]](https://d.umijs.org/) [![Build With father][father-url]](https://github.com/umijs/father/) +The Ultimate Editor UI Framework and Components - +[![][npm-release-shield]][npm-release-link] +[![][npm-downloads-shield]][npm-downloads-link] +[![][github-releasedate-shield]][github-releasedate-link] +[![][github-action-test-shield]][github-action-test-link] +[![][github-action-release-shield]][github-action-release-link] +[![][codecov-shield]][codecov-link]
+[![][github-contributors-shield]][github-contributors-link] +[![][github-forks-shield]][github-forks-link] +[![][github-stars-shield]][github-stars-link] +[![][github-issues-shield]][github-issues-link] +[![][github-license-shield]][github-license-link]
+[![][ant-design-shield]][ant-design-link] +[![][devops-dumi-shield]][devops-dumi-link] +[![][devops-father-shield]][devops-father-link] - +English · [简体中文](./README.zh-CN.md) · [Changelog](./CHANGELOG.md) . [Report Bug][github-issues-link] · [Request Feature][github-issues-link] - +![](https://gw.alipayobjects.com/zos/kitchen/2rXP4ZVHCo/pro-editor.webp) - - - +
- +
+Table of contents - +#### TOC - +- [📦 Installation](#-installation) + - [Compile with Next.js](#compile-with-nextjs) +- [🔨 Usage](#-usage) +- [✨ Features](#-features) + - [Empowering Features of ProEditor](#empowering-features-of-proeditor) + - [Framework Architecture](#framework-architecture) +- [👀 Showcase](#-showcase) +- [🖥 Browser compatibility](#-browser-compatibility) +- [⌨️ Local Development](#️-local-development) +- [🤝 Contributing](#-contributing) +- [🛣️ Ecosystem](#️-ecosystem) - +#### - +
-## 📦 Install +## 📦 Installation -This component library is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). +> \[!IMPORTANT]\ +> This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). -Install via npm: +To install `@ant-design/pro-editor`, run the following command: ```bash -$ npm install @ant-design/pro-editor +$ pnpm install @ant-design/pro-editor ``` -Install via pnpm: +### Compile with Next.js -```bash -$ pnpm add @ant-design/pro-editor +> \[!NOTE]\ +> By work correct with Next.js SSR, add `transpilePackages: ['@ant-design/pro-editor']` to `next.config.js`. For example: + +```js +const nextConfig = { + transpilePackages: ['@ant-design/pro-editor'], +}; ``` +
+ ## 🔨 Usage ```jsx @@ -77,102 +89,193 @@ export default () => ( ); ``` -### Adapt to NextJS +
-To adapt to nextjs's SSR mode, you need to add the relevant dependencies of this package to the `transpilePackages` configuration in `next.config.js`: +## ✨ Features -```js -// next.config.js -const nextConfig = { - // ...other config - transpilePackages: ['@ant-design/pro-editor', 'leva'], -}; -``` +> \[!NOTE] +> +> Front-end component libraries have revolutionized development, boosting efficiency by orders of magnitude and elevating user experience. Yet, as mature as libraries like Ant Design (antd) and ProComponents are, one might wonder if there's any room left for innovation. -## ⌨️ Development +[![](https://next.ossinsight.io/widgets/official/compose-activity-trends/thumbnail.png?repo_id=637603722&image_size=auto&color_scheme=dark)](https://next.ossinsight.io/widgets/official/compose-activity-trends?repo_id=637603722) -```bash -$ git clone git@github.com:ant-design/pro-editor.git -$ cd pro-editor -$ npm install -$ npm start -``` +
-Open your browser and visit +### Empowering Features of ProEditor -
+> \[!NOTE] +> +> We envision ProEditor as the foundational library for editing components, akin to antd, enabling developers to easily create complex interactive components with an inherently superior user experience. This is the rationale behind the `ProEditor`. -[![][back-to-top]](#readme-top) +**Our Principles for ProEditor:** -
+- 🖐️ **Intuitive Editing**: Supports natural user interactions like multi-selection, deselection, and keyboard shortcuts, ensuring a smooth editing experience. +- ✨ **Refined by Default**: Enhances Ant Design components to deliver a superior user experience with more polish and refinement. +- 🔧 **Open Flexibility**: Provides atomic-level capabilities, offering a wide range of components, hooks, and utility functions for extensive customization and flexibility. -## 🤝 Contributing [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) +
-- [Release Guide](https://github.com/ant-design/pro-editor/wiki/release) +**UI Framework and Frontend Component Solutions in the Editor Field:** - +> \[!TIP] +> +> ProEditor concentrates on expanding the limits of the feasible and augmenting the array of tools available to developers for the construction of sophisticated, interactive, and user-centric web applications. For instance: -> 📊 Total: **7** +- 📦 **DraggablePanel**: Allows for resizable and movable panels, enhancing the interactivity of the user interface. +- 📝 **ColumnList**: Offers a user-friendly sortable list that is manageable through column definitions, simplifying complex list interactions. +- 🎨 **FreeCanvas**: Provides a zoomable canvas similar to applications like Sketch or Figma, giving users a vast space for creative design. +- 🔍 **IconPicker**: An icon selection tool that is compatible with iconfont, making it easier to integrate a wide range of icons into the design. +- 👥 **Online Collaboration**: Incorporates multi-user capabilities using technologies like yjs and zustand store, enabling real-time collaborative editing and interaction. - - - - - - - - - - - - - - - - - - - - +
+ +### Framework Architecture + +ProEditor is structured to facilitate these principles effectively. + +![][architecture] + +
+ +## 👀 Showcase + +Let's showcase some of ProEditor's signature components: + +| **DraggablePanel** | **ColumnList** | +| :-------------------------------------------------------: | :-------------------------------------------------------: | +| For resizable and movable panels | A user-friendly sortable list based on column definitions | +| ![][prevew-1] | ![][prevew-2] | +| **FreeCanvas** | **IconPicker** | +| A limitless zoomable canvas akin to Sketch or Figma | An icon selection tool compatible with iconfont | +| ![][prevew-3] | ![][prevew-4] | +| **Online Collaboration** | | +| Multi-user capabilities wrapped in yjs and zustand store. | | +| ![][prevew-5] | | + +
+ +## 🖥 Browser compatibility + +> \[!NOTE] +> +> - Modern browsers and Internet Explorer 11 (with [polyfills](https://stackoverflow.com/questions/57020976/polyfills-in-2019-for-ie11)) +> - [Electron](https://www.electronjs.org/) + +| [![edge](https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png)](http://godban.github.io/browsers-support-badges/) | [![Edge](https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png)](http://godban.github.io/browsers-support-badges/) | [![chrome](https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png)](http://godban.github.io/browsers-support-badges/) | [![safari](https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png)](http://godban.github.io/browsers-support-badges/) | [![electron_48x48](https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png)](http://godban.github.io/browsers-support-badges/) | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | + +
+ +## ⌨️ Local Development + +You can use Github Codespaces for online development: + +[![][github-codespace-shield]][github-codespace-link] + +Or clone it for local development: + +```bash +$ git clone https://github.com/ant-design/pro-editor.git +$ cd pro-editor +$ pnpm install +$ pnpm dev +``` + +
+ +## 🤝 Contributing + +> \[!IMPORTANT] +> +> Join our collaborative ecosystem. Your contributions are the heartbeat of our project. Here's how you can be an integral part of our vibrant community: + +- **Integrate and Innovate**: Incorporate Ant Design Pro, umi, and ProEditor into your projects. Your real-world usage and feedback are invaluable to us. +- **Voice Your Insights**: Encounter a glitch? Have a query? Your perspectives matter. Share them by submitting [issues][github-issues-link] and help us enhance the user experience. +- **Shape the Future**: Have code enhancements or feature ideas? We invite you to propose [pull requests][pr-welcome-link] and contribute directly to the evolution of our codebase. + +Every contribution, big or small, is celebrated. Join us in our mission to refine and elevate the world of open-source enterprise UI components. 😃 + +[![][pr-welcome-shield]][pr-welcome-link] + +
+ + + + + + + + + + + +
+


+
+ + + +
+ +
- +
-
+## 🛣️ Ecosystem -[![][back-to-top]](#readme-top) +- **[ProComponents](https://github.com/ant-design/pro-components)** - Designed for Enterprise-Level Application, Use Ant Design like a Pro!. +- **[ProEditor](https://github.com/ant-design/pro-editor)** - The Ultimate Editor UI Framework and Components. +- **[ProFlow](https://github.com/ant-design/pro-flow)** - A Flow Editor Framework base on React-Flow. +- **[ProChat](https://github.com/ant-design/pro-chat)** - Components Library for Quickly Building LLM Chat Interfaces. -
+
+ +--- #### 📝 License -Copyright © 2023 - present AFX & [Ant Digital](antdigital.com)
+Copyright © 2023 - present [AFX][ant-design-link] & [Ant Digital](https://antdigital.com).
This project is [MIT](./LICENSE) licensed. - - -[gitpod-badge]: https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod -[gitpod-url]: https://gitpod.io/#https://github.com/ant-design/@ant-design/pro-editor -[dumi-url]: https://img.shields.io/badge/docs%20by-dumi-blue -[father-url]: https://img.shields.io/badge/build%20with-father-028fe4.svg -[npm-image]: https://img.shields.io/npm/v/@ant-design/pro-editor.svg?style=flat-square&color=deepgreen&label=latest -[npm-url]: https://npmjs.org/package/@ant-design/pro-editor -[npm-size]: https://img.shields.io/bundlephobia/minzip/@ant-design/pro-editor?color=deepgreen&label=gizpped%20size&style=flat-square -[npm-size-url]: https://packagephobia.com/result?p=@ant-design/pro-editor -[coverage]: https://codecov.io/gh/ant-design/pro-editor/branch/main/graph/badge.svg -[codecov-url]: https://codecov.io/gh/ant-design/pro-editor/branch/main -[test-ci]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml/badge.svg -[test-ci-url]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml -[release-ci]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml/badge.svg -[release-ci-url]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml/ -[download-image]: https://img.shields.io/npm/dm/@ant-design/pro-editor.svg?style=flat-square -[download-url]: https://npmjs.org/package/@ant-design/pro-editor -[contributors-shield]: https://img.shields.io/github/contributors/ant-design/pro-editor.svg?style=flat -[contributors-url]: https://github.com/ant-design/pro-editor/graphs/contributors -[forks-shield]: https://img.shields.io/github/forks/ant-design/pro-editor.svg?style=flat -[forks-url]: https://github.com/ant-design/pro-editor/network/members -[stargazers-shield]: https://img.shields.io/github/stars/ant-design/pro-editor.svg?style=flat -[stargazers-url]: https://github.com/ant-design/pro-editor/stargazers -[issues-shield]: https://img.shields.io/github/issues/ant-design/pro-editor.svg?style=flat -[issues-url]: https://github.com/ant-design/pro-editor/issues/new/choose -[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square + + +[ant-design-link]: https://ant.design +[ant-design-shield]: https://img.shields.io/badge/-Ant%20Design-1677FF?labelColor=black&logo=antdesign&style=flat-square +[architecture]: https://gw.alipayobjects.com/zos/kitchen/2F0sXx1uad/architecture.webp +[codecov-link]: https://codecov.io/gh/ant-design/pro-editor +[codecov-shield]: https://img.shields.io/codecov/c/github/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square&logo=codecov&logoColor=white +[devops-dumi-link]: https://d.umijs.org/ +[devops-dumi-shield]: https://img.shields.io/badge/docs%20by-dumi-blue?color=1677FF&labelColor=black&style=flat-square +[devops-father-link]: https://github.com/umijs/father +[devops-father-shield]: https://img.shields.io/badge/build%20with-father-028fe4.svg?color=1677FF&labelColor=black&style=flat-square +[github-action-release-link]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml +[github-action-release-shield]: https://img.shields.io/github/actions/workflow/status/ant-design/pro-editor/release.yml?color=1677FF&label=release&labelColor=black&logo=githubactions&logoColor=white&style=flat-square +[github-action-test-link]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml +[github-action-test-shield]: https://img.shields.io/github/actions/workflow/status/ant-design/pro-editor/test.yml?color=1677FF&label=test&labelColor=black&logo=githubactions&logoColor=white&style=flat-square +[github-codespace-link]: https://codespaces.new/ant-design/pro-editor +[github-codespace-shield]: https://github.com/codespaces/badge.svg +[github-contributors-link]: https://github.com/ant-design/pro-editor/graphs/contributors +[github-contributors-shield]: https://img.shields.io/github/contributors/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[github-forks-link]: https://github.com/ant-design/pro-editor/network/members +[github-forks-shield]: https://img.shields.io/github/forks/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[github-issues-link]: https://github.com/ant-design/pro-editor/issues +[github-issues-shield]: https://img.shields.io/github/issues/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[github-license-link]: https://github.com/ant-design/pro-editor/blob/main/LICENSE +[github-license-shield]: https://img.shields.io/github/license/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[github-releasedate-link]: https://github.com/ant-design/pro-editor/releases +[github-releasedate-shield]: https://img.shields.io/github/release-date/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[github-stars-link]: https://github.com/ant-design/pro-editor/network/stargazers +[github-stars-shield]: https://img.shields.io/github/stars/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[npm-downloads-link]: https://www.npmjs.com/package/@ant-design/pro-editor +[npm-downloads-shield]: https://img.shields.io/npm/dt/@ant-design/pro-editor?labelColor=black&style=flat-square&color=1677FF +[npm-release-link]: https://www.npmjs.com/package/@ant-design/pro-editor +[npm-release-shield]: https://img.shields.io/npm/v/@ant-design/pro-editor?color=1677FF&labelColor=black&logo=npm&logoColor=white&style=flat-square +[pr-welcome-link]: https://github.com/ant-design/pro-editor/pulls +[pr-welcome-shield]: https://img.shields.io/badge/%E2%9D%A4%EF%B8%8F%20PR%20WELCOME-%E2%86%92-1677FF?labelColor=black&style=for-the-badge +[prevew-1]: https://gw.alipayobjects.com/zos/kitchen/sytsa4%26R%26d/1.gif +[prevew-2]: https://gw.alipayobjects.com/zos/kitchen/2DHhgqlXns/2.gif +[prevew-3]: https://gw.alipayobjects.com/zos/kitchen/KKcuxwR0Pz/3.gif +[prevew-4]: https://gw.alipayobjects.com/zos/kitchen/huuRPs3Kmk/4.gif +[prevew-5]: https://gw.alipayobjects.com/zos/kitchen/SQaNFOJbK4/5.gif diff --git a/README.zh-CN.md b/README.zh-CN.md index 97349743..e8312092 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,187 +1,281 @@ - +
-

- - - -

+ -

Ant Design ProEditor

+

ProEditor

-
+编辑器领域 UI 框架与前端组件解决方案 -🌟 An Editor UI Framework and Components +[![][npm-release-shield]][npm-release-link] +[![][npm-downloads-shield]][npm-downloads-link] +[![][github-releasedate-shield]][github-releasedate-link] +[![][github-action-test-shield]][github-action-test-link] +[![][github-action-release-shield]][github-action-release-link] +[![][codecov-shield]][codecov-link]
+[![][github-contributors-shield]][github-contributors-link] +[![][github-forks-shield]][github-forks-link] +[![][github-stars-shield]][github-stars-link] +[![][github-issues-shield]][github-issues-link] +[![][github-license-shield]][github-license-link]
+[![][ant-design-shield]][ant-design-link] +[![][devops-dumi-shield]][devops-dumi-link] +[![][devops-father-shield]][devops-father-link] -[Changelog](./CHANGELOG.md) · [Report Bug][issues-url] · [Request Feature][issues-url] +[English](./README.md)・简体中文・[Changelog](./CHANGELOG.md) . [Report Bug][github-issues-link] · [Request Feature][github-issues-link] - +![](https://gw.alipayobjects.com/zos/kitchen/2rXP4ZVHCo/pro-editor.webp) -[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url] [![install size][npm-size]][npm-size-url] +
-[![Test CI status][test-ci]][test-ci-url] [![Deploy CI][release-ci]][release-ci-url] [![Coverage][coverage]][codecov-url] +
+目录 -[![contributors][contributors-shield]][contributors-url] [![forks][forks-shield]][forks-url] [![stargazers][stargazers-shield]][stargazers-url] [![issues][issues-shield]][issues-url] +#### 目录 -[![ docs by dumi][dumi-url]](https://d.umijs.org/) [![Build With father][father-url]](https://github.com/umijs/father/) +- [📦 安装](#-安装) + - [使用 Next.js 进行编译](#使用-nextjs-进行编译) +- [🔨 使用](#-使用) +- [✨ 特性](#-特性) + - [ProEditor 的强大特性](#proeditor-的强大特性) + - [框架架构](#框架架构) +- [👀 展示](#-展示) +- [🖥 浏览器兼容性](#-浏览器兼容性) +- [⌨️ 本地开发](#️-本地开发) +- [🤝 贡献](#-贡献) +- [🛣️ 生态系统](#️-生态系统) - +#### -[gitpod-badge]: https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod -[gitpod-url]: https://gitpod.io/#https://github.com/ant-design/@ant-design/pro-editor +
- +## 📦 安装 -[dumi-url]: https://img.shields.io/badge/docs%20by-dumi-blue -[father-url]: https://img.shields.io/badge/build%20with-father-028fe4.svg +> \[!IMPORTANT]\ +> 该包仅支持 [ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)。 - +要安装 `@ant-design/pro-editor`,请运行以下命令: -[npm-image]: https://img.shields.io/npm/v/@ant-design/pro-editor.svg?style=flat-square&color=deepgreen&label=latest -[npm-url]: https://npmjs.org/package/@ant-design/pro-editor -[npm-size]: https://img.shields.io/bundlephobia/minzip/@ant-design/pro-editor?color=deepgreen&label=gizpped%20size&style=flat-square -[npm-size-url]: https://packagephobia.com/result?p=@ant-design/pro-editor +```bash +$ pnpm install @ant-design/pro-editor +``` - +### 使用 Next.js 进行编译 -[coverage]: https://codecov.io/gh/ant-design/pro-editor/branch/main/graph/badge.svg -[codecov-url]: https://codecov.io/gh/ant-design/pro-editor/branch/main +> \[!NOTE]\ +> 为了正确使用 Next.js SSR,请在 `next.config.js` 中添加 `transpilePackages: ['@ant-design/pro-editor']`。例如: - +```js +const nextConfig = { + transpilePackages: ['@ant-design/pro-editor'], +}; +``` -[test-ci]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml/badge.svg -[test-ci-url]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml -[release-ci]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml/badge.svg -[release-ci-url]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml/ -[download-image]: https://img.shields.io/npm/dm/@ant-design/pro-editor.svg?style=flat-square -[download-url]: https://npmjs.org/package/@ant-design/pro-editor +
- +## 🔨 使用 -[contributors-shield]: https://img.shields.io/github/contributors/ant-design/pro-editor.svg?style=flat -[contributors-url]: https://github.com/ant-design/pro-editor/graphs/contributors +```jsx +import { SmileOutlined } from '@ant-design/icons'; +import { ActionIcon } from '@ant-design/pro-editor'; - +export default () => ( + } + onClick={() => { + alert('触发动作'); + }} + /> +); +``` -[forks-shield]: https://img.shields.io/github/forks/ant-design/pro-editor.svg?style=flat -[forks-url]: https://github.com/ant-design/pro-editor/network/members +
- +## ✨ 特性 -[stargazers-shield]: https://img.shields.io/github/stars/ant-design/pro-editor.svg?style=flat -[stargazers-url]: https://github.com/ant-design/pro-editor/stargazers +> \[!NOTE] +> +> 前端组件库已经彻底改变了开发方式,极大地提高了效率,提升了用户体验。在各大组件库都趋于成熟的 2023 年,我们为什么要推出 ProEditor ? - +[![](https://next.ossinsight.io/widgets/official/compose-activity-trends/thumbnail.png?repo_id=637603722&image_size=auto&color_scheme=dark)](https://next.ossinsight.io/widgets/official/compose-activity-trends?repo_id=637603722) -[issues-shield]: https://img.shields.io/github/issues/ant-design/pro-editor.svg?style=flat -[issues-url]: https://github.com/ant-design/pro-editor/issues/new/choose +
-
+### ProEditor 的强大功能 -## 📦 Install +> \[!NOTE] +> +> 我们将 ProEditor 视为编辑组件的基础库,类似于 antd,使开发人员能够轻松创建具有内在卓越用户体验的复杂交互式组件。这就是 `ProEditor` 名称的理念所在。 -本组件库为 [纯 ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)。 +**我们对 ProEditor 的原则:** -使用 npm 安装: +- 🖐️ **自然编辑**:支持用户最自然的交互,包括但不限于鼠标多选、反选、快捷键等。 +- ✨ **默认精致**:在 antd 基础组件上更进一步,交互体验上达到默认精致。 +- 🔧 **灵活开放**:所有能力均支持原子化输出,包括但不限于组件、hooks、工具函数等。 -```bash -$ npm install @ant-design/pro-editor -``` +
-使用 pnpm 安装: +**编辑器领域 UI 框架与前端组件解决方案:** -```bash -$ pnpm add @ant-design/pro-editor -``` +> \[!TIP] +> +> 推动了可能性的边界,并增强了开发人员用于创建复杂、交互式和用户友好的 Web 应用程序的工具包,例如: -## 🔨 Usage +- 📦 **DraggablePanel**:允许可调整大小和可移动的面板,增强用户界面的交互性。 +- 📝 **ColumnList**:提供用户友好的可排序列表,通过列定义进行管理,简化了复杂的列表交互。 +- 🎨 **FreeCanvas**:提供类似于 Sketch 或 Figma 的可缩放画布,为用户提供创意设计的广阔空间。 +- 🔍 **IconPicker**:一个与 iconfont 兼容的图标选择工具,使集成各种图标到设计中更加容易。 +- 👥 **在线协作**:利用 yjs 和 zustand store 等技术,融合多用户功能,实现实时协作编辑和交互。 -```jsx -import { SmileOutlined } from '@ant-design/icons'; -import { ActionIcon } from '@ant-design/pro-editor'; +
-export default () => ( - } - onClick={() => { - alert('触发动作'); - }} - /> -); -``` +### 框架架构 -### 适配 NextJS +ProEditor 的架构大致如下: -为适配 nextjs 的 SSR 模式, 需要将本包的相关依赖添加到 `next.config.js` 的 `transpilePackages` 配置中: +![][architecture] -```js -// next.config.js -const nextConfig = { - // ...other config - transpilePackages: ['@ant-design/pro-editor', 'leva'], -}; -``` +
-## ⌨️ Development +## 👀 展示 -```bash -$ git clone git@github.com:ant-design/pro-editor.git -$ cd pro-editor -$ npm install -$ npm start -``` +让我们展示一些 ProEditor 的标志性组件: -Open your browser and visit http://localhost:8000 +| **DraggablePanel** | **ColumnList** | +| :----------------------------------------: | :----------------------------: | +| 可调整大小和可移动的面板 | 基于列定义的用户友好可排序列表 | +| ![][prevew-1] | ![][prevew-2] | +| **FreeCanvas** | **IconPicker** | +| 无限缩放画布,类似于 Sketch 或 Figma | 与 iconfont 兼容的图标选择工具 | +| ![][prevew-3] | ![][prevew-4] | +| **在线协作** | | +| 融合了 yjs 和 zustand store 的多用户功能。 | | +| ![][prevew-5] | | -
+
-[![][back-to-top]](#readme-top) +## 🖥 浏览器兼容性 -
+> \[!NOTE] +> +> - 现代浏览器和 Internet Explorer 11(使用[polyfills](https://stackoverflow.com/questions/57020976/polyfills-in-2019-for-ie11)) +> - [Electron](https://www.electronjs.org/) -## 🤝 Contributing [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) +| [![edge](https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png)](http://godban.github.io/browsers-support-badges/) | [![Edge](https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png)](http://godban.github.io/browsers-support-badges/) | [![chrome](https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png)](http://godban.github.io/browsers-support-badges/) | [![safari](https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png)](http://godban.github.io/browsers-support-badges/) | [![electron_48x48](https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png)](http://godban.github.io/browsers-support-badges/) | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Edge | 最近 2 个版本 | 最近 2 个版本 | 最近 2 个版本 | 最近 2 个版本 | -- [Release Guide](https://github.com/ant-design/pro-editor/wiki/release) +
- +## ⌨️ 本地开发 -> 📊 Total: **7** +您可以使用 Github Codespaces 进行在线开发: - - - - - - - - - - - - - - - - - - - - +[![][github-codespace-shield]][github-codespace-link] + +或者克隆它进行本地开发: + +```bash +$ git clone https://github.com/ant-design/pro-editor.git +$ cd pro-editor +$ pnpm install +$ pnpm dev +``` + +
+ +## 🤝 贡献 + +> \[!IMPORTANT] +> +> 加入我们的协作生态系统。您的贡献是我们项目的心脏。以下是您如何成为我们充满活力的社区的重要组成部分: + +- **整合和创新**:将 Ant Design Pro、umi 和 ProEditor 整合到您的项目中。您的实际使用和反馈对我们至关重要。 +- **发表您的见解**:遇到了问题?有疑问?您的观点很重要。通过提交[问题][github-issues-link]来分享它们,帮助我们提升用户体验。 +- **塑造未来**:有代码增强或功能想法吗?我们邀请您提出[拉取请求][pr-welcome-link],直接为我们的代码库发展做出贡献。 + +每一次贡献,无论大小,都值得庆祝。加入我们,共同致力于完善和提升开源企业 UI 组件的世界。 😃 + +[![][pr-welcome-shield]][pr-welcome-link] + +
+ + + + + + + + + + + +
+


+
+ + + +
+ +
- +
-
+## 🛣️ 生态系统 -[![][back-to-top]](#readme-top) +- **[ProComponents](https://github.com/ant-design/pro-components)** - 专为企业级应用设计,像专业人士一样使用 Ant Design! +- **[ProEditor](https://github.com/ant-design/pro-editor)** - 编辑器领域 UI 框架与前端组件解决方案。 +- **[ProFlow](https://github.com/ant-design/pro-flow)** - 基于 React-Flow 的流程编辑器框架。 +- **[ProChat](https://github.com/ant-design/pro-chat)** - 用于快速构建 LLM 聊天界面的组件库。 -
+
+ +--- #### 📝 License -Copyright © 2023 - present AFX & [Ant Digital](antdigital.com)
+Copyright © 2023 - present [AFX][ant-design-link] & [Ant Digital](https://antdigital.com).
This project is [MIT](./LICENSE) licensed. - - -[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square + + +[ant-design-link]: https://ant.design +[ant-design-shield]: https://img.shields.io/badge/-Ant%20Design-1677FF?labelColor=black&logo=antdesign&style=flat-square +[architecture]: https://gw.alipayobjects.com/zos/kitchen/2F0sXx1uad/architecture.webp +[codecov-link]: https://codecov.io/gh/ant-design/pro-editor +[codecov-shield]: https://img.shields.io/codecov/c/github/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square&logo=codecov&logoColor=white +[devops-dumi-link]: https://d.umijs.org/ +[devops-dumi-shield]: https://img.shields.io/badge/docs%20by-dumi-blue?color=1677FF&labelColor=black&style=flat-square +[devops-father-link]: https://github.com/umijs/father +[devops-father-shield]: https://img.shields.io/badge/build%20with-father-028fe4.svg?color=1677FF&labelColor=black&style=flat-square +[github-action-release-link]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml +[github-action-release-shield]: https://img.shields.io/github/actions/workflow/status/ant-design/pro-editor/release.yml?color=1677FF&label=release&labelColor=black&logo=githubactions&logoColor=white&style=flat-square +[github-action-test-link]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml +[github-action-test-shield]: https://img.shields.io/github/actions/workflow/status/ant-design/pro-editor/test.yml?color=1677FF&label=test&labelColor=black&logo=githubactions&logoColor=white&style=flat-square +[github-codespace-link]: https://codespaces.new/ant-design/pro-editor +[github-codespace-shield]: https://github.com/codespaces/badge.svg +[github-contributors-link]: https://github.com/ant-design/pro-editor/graphs/contributors +[github-contributors-shield]: https://img.shields.io/github/contributors/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[github-forks-link]: https://github.com/ant-design/pro-editor/network/members +[github-forks-shield]: https://img.shields.io/github/forks/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[github-issues-link]: https://github.com/ant-design/pro-editor/issues +[github-issues-shield]: https://img.shields.io/github/issues/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[github-license-link]: https://github.com/ant-design/pro-editor/blob/main/LICENSE +[github-license-shield]: https://img.shields.io/github/license/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[github-releasedate-link]: https://github.com/ant-design/pro-editor/releases +[github-releasedate-shield]: https://img.shields.io/github/release-date/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[github-stars-link]: https://github.com/ant-design/pro-editor/network/stargazers +[github-stars-shield]: https://img.shields.io/github/stars/ant-design/pro-editor?color=1677FF&labelColor=black&style=flat-square +[npm-downloads-link]: https://www.npmjs.com/package/@ant-design/pro-editor +[npm-downloads-shield]: https://img.shields.io/npm/dt/@ant-design/pro-editor?labelColor=black&style=flat-square&color=1677FF +[npm-release-link]: https://www.npmjs.com/package/@ant-design/pro-editor +[npm-release-shield]: https://img.shields.io/npm/v/@ant-design/pro-editor?color=1677FF&labelColor=black&logo=npm&logoColor=white&style=flat-square +[pr-welcome-link]: https://github.com/ant-design/pro-editor/pulls +[pr-welcome-shield]: https://img.shields.io/badge/%E2%9D%A4%EF%B8%8F%20PR%20WELCOME-%E2%86%92-1677FF?labelColor=black&style=for-the-badge +[prevew-1]: https://gw.alipayobjects.com/zos/kitchen/sytsa4%26R%26d/1.gif +[prevew-2]: https://gw.alipayobjects.com/zos/kitchen/2DHhgqlXns/2.gif +[prevew-3]: https://gw.alipayobjects.com/zos/kitchen/KKcuxwR0Pz/3.gif +[prevew-4]: https://gw.alipayobjects.com/zos/kitchen/huuRPs3Kmk/4.gif +[prevew-5]: https://gw.alipayobjects.com/zos/kitchen/SQaNFOJbK4/5.gif diff --git a/docs/guide/data-management.zh-CN.md b/docs/guide/data-management.zh-CN.md index 15089d1a..8019db6c 100644 --- a/docs/guide/data-management.zh-CN.md +++ b/docs/guide/data-management.zh-CN.md @@ -11,14 +11,14 @@ group: ## 概念要素 -| 概念名词 | 解释 | -| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| store | 状态库(store),包含存储应用的状态、动作。允许在应用渲染中访问和修改状态。 | -| state | 状态(state)是指应用程序的数据,存储了应用程序的当前状态,状态的变化**一定会触发应用的重新渲染**,以反映新的状态。 | -| action | 动作(action) 是一个操作函数,它描述了应用程序中发生的交互事件。动作通常是由用户交互、网络请求或定时器等触发。 action 可以是**同步**的,也可以是**异步**的。 | -| reducer | 归约器(reducer) 是一个纯函数,它接收当前状态和动作作为参数,并返回一个新的状态。它用于根据动作类型来更新应用程序的状态。Reducer 是一个纯函数,不存在副作用,因此一定是 **同步** 函数。 | -| selector | 选择器(selector) 是一个函数,用于从应用程序的状态中获取特定的数据。它接收应用程序的状态作为参数,并返回经过计算或转换后的数据。Selector 可以将状态的一部分或多个状态组合起来,以生成派生的数据。Selector 通常用于将应用程序的状态映射到组件的 props,以供组件使用。 | -| slice | 切片(slice) 是一个概念,用于表达数据模型状态的一部分。它指定了一个状态切片(slice),以及与该切片相关的 state、action、reducer 和 selector。使用 Slice 可以将大型的 Store 拆分为更小的、可维护的子类型。 | +| 概念名词 | 解释 | +| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| store | 状态库 (store),包含存储应用的状态、动作。允许在应用渲染中访问和修改状态。 | +| state | 状态 (state) 是指应用程序的数据,存储了应用程序的当前状态,状态的变化**一定会触发应用的重新渲染**,以反映新的状态。 | +| action | 动作 (action) 是一个操作函数,它描述了应用程序中发生的交互事件。动作通常是由用户交互、网络请求或定时器等触发。 action 可以是**同步**的,也可以是**异步**的。 | +| reducer | 归约器 (reducer) 是一个纯函数,它接收当前状态和动作作为参数,并返回一个新的状态。它用于根据动作类型来更新应用程序的状态。Reducer 是一个纯函数,不存在副作用,因此一定是 **同步** 函数。 | +| selector | 选择器 (selector) 是一个函数,用于从应用程序的状态中获取特定的数据。它接收应用程序的状态作为参数,并返回经过计算或转换后的数据。Selector 可以将状态的一部分或多个状态组合起来,以生成派生的数据。Selector 通常用于将应用程序的状态映射到组件的 props,以供组件使用。 | +| slice | 切片 (slice) 是一个概念,用于表达数据模型状态的一部分。它指定了一个状态切片(slice),以及与该切片相关的 state、action、reducer 和 selector。使用 Slice 可以将大型的 Store 拆分为更小的、可维护的子类型。 | ## 结构分层 @@ -26,7 +26,7 @@ group: ### 较低复杂度 -一般包含 2~5 个 state 、3 ~ 4 个 action。此时的结构一般直接一个 `store.ts` + 一个 `initialState.ts` 即可。 +一般包含 2\~5 个 state 、3 \~ 4 个 action。此时的结构一般直接一个 `store.ts` + 一个 `initialState.ts` 即可。 ```bash DataFill/store @@ -36,7 +36,7 @@ DataFill/store ### 一般复杂度 -一般复杂度存在 5 ~ 15 个 state、 5 ~ 10 个 action,可能会存在 selector 实现派生状态,也有可能存在 reducer 简化部分数据变更的复杂度。此时的结构一般为一个 `store.ts` + 一个 `initialState.ts` + 一个 `selectors.ts`/`reducer.ts`。 +一般复杂度存在 5 \~ 15 个 state、 5 \~ 10 个 action,可能会存在 selector 实现派生状态,也有可能存在 reducer 简化部分数据变更的复杂度。此时的结构一般为一个 `store.ts` + 一个 `initialState.ts` + 一个 `selectors.ts`/`reducer.ts`。 ```bash IconPicker/store @@ -56,7 +56,7 @@ SortableList/store ### 中等复杂度 -中等复杂度存在 15 ~ 30 个 state、 10 ~ 20 个 action,大概率会存在 selector 来聚合派生状态,大概率存在 reducer 简化部分数据变更的复杂度。 +中等复杂度存在 15 \~ 30 个 state、 10 \~ 20 个 action,大概率会存在 selector 来聚合派生状态,大概率存在 reducer 简化部分数据变更的复杂度。 此时结构,用单一的 action store 已经较难维护,往往会拆解出来多个 slice 用于管理不同的 action。 @@ -214,7 +214,7 @@ export const useEditorStore = createWithEqualityFn()( ); ``` -其中关键的代码是 `createStore` ,它用于聚合所有的 slice,返回一个完整的编辑器 Store 用于 store 初始化创建。 +其中关键的代码是 `createStore` , 它用于聚合所有的 slice,返回一个完整的编辑器 Store 用于 store 初始化创建。 最后使用的 `createWithEqualityFn`函数中包裹了相关的中间件,我们默认使用了 `devtools` 中间件来提供开发者工具支持,并替换默认的比较函数为 `shallow`,用于优化性能。 @@ -288,7 +288,7 @@ const crudSlice = (set, get) => ({ 而这也会相应带来若干好处: 1. **方便做受控能力**:当数据变更原子化之后,通过在 `dispatchTreeData` 最下方添加一个 `onTreeDataChange` ,即可实现数据状态的受控变更,将应用轻松转换为组件; -2. **数据变更语义化**:通过 dispatch 对应 payload 方法的命名,可以将原本比较难构造与变更的数据变更语义化,例如 `dispatchTreeData( { type: 'toggleCollapse', id:'123' })`,可以很容易理解为,将 id 为 123 的节点进行展开/收起操作; +2. **数据变更语义化**:通过 dispatch 对应 payload 方法的命名,可以将原本比较难构造与变更的数据变更语义化,例如 `dispatchTreeData( { type: 'toggleCollapse', id:'123' })`,可以很容易理解为,将 id 为 123 的节点进行展开 / 收起操作; 3. **提升状态维护性**:统一 dispatch 的数据变更心智后,我们既可以在 store 外部调用 dispatch 来变更状态,也可以在 store 内部调用,统一的心智将大大降低维护成本; ### reducer 研发 diff --git a/docs/guide/intro.en-US.md b/docs/guide/intro.en-US.md index ee0dbe32..6b7d63de 100644 --- a/docs/guide/intro.en-US.md +++ b/docs/guide/intro.en-US.md @@ -58,7 +58,7 @@ Since Next.js is a CSR/SSR isomorphic React framework, and ProEditor only provid /** @type {import('next').NextConfig} */ const nextConfig = { // Convert pure esm modules to node-compatible modules - transpilePackages: ['@ant-design/pro-editor', 'leva'], // leva is a ProEditor dependency module + transpilePackages: ['@ant-design/pro-editor'], // leva is a ProEditor dependency module }; ``` diff --git a/docs/guide/intro.zh-CN.md b/docs/guide/intro.zh-CN.md index 2188255b..bf4adde0 100644 --- a/docs/guide/intro.zh-CN.md +++ b/docs/guide/intro.zh-CN.md @@ -58,7 +58,7 @@ ProEditor 将会提供编辑场景需要的各类原子化能力,包括但不 /** @type {import('next').NextConfig} */ const nextConfig = { // 将纯 esm 模块转为 node 兼容模块 - transpilePackages: ['@ant-design/pro-editor', 'leva'], // leva 为 ProEditor 依赖模块 + transpilePackages: ['@ant-design/pro-editor'], // leva 为 ProEditor 依赖模块 }; ``` diff --git a/docs/guide/why-pro-editor.zh-CN.md b/docs/guide/why-pro-editor.zh-CN.md index 8c269558..9aaa3388 100644 --- a/docs/guide/why-pro-editor.zh-CN.md +++ b/docs/guide/why-pro-editor.zh-CN.md @@ -29,7 +29,7 @@ group: 快速上手 除了组件层面,还有诸多原子化的操作能力是当今的前端仍未系统解决的。比如快捷键、键盘方向键切换焦点、键盘与鼠标同时作用的选取(shift 多选、cmd 复选)、撤销重做、鼠标框选…… -上述用户的交互输入,在「操作系统」与大部分效率工具(文档三件套、代码编辑器、Sketch、PS )可谓是基础中的基础,而在号称“一统终端”的 Web 里却是「奢侈品」级别的能力。 +上述用户的交互输入,在「操作系统」与大部分效率工具(文档三件套、代码编辑器、Sketch、PS )可谓是基础中的基础,而在号称 “一统终端” 的 Web 里却是「奢侈品」级别的能力。 ## 🕹「编辑」领域下的 「antd」 diff --git a/docs/pro-editor/component-assets.zh-CN.md b/docs/pro-editor/component-assets.zh-CN.md index 78863daa..128caaad 100644 --- a/docs/pro-editor/component-assets.zh-CN.md +++ b/docs/pro-editor/component-assets.zh-CN.md @@ -7,7 +7,7 @@ group: 基础框架 ### 木偶模型 -高代码(props)和 低代码(配置器)的关系不是简单的一一映射,而是一种有机的组织形态,我们把它称为——木偶模型。 props 就像是木偶的线,而配置器就是木偶的控制器,它们的关系如下图所示: +高代码(props)和 低代码(配置器)的关系不是简单的一一映射,而是一种有机的组织形态,我们把它称为 —— 木偶模型。 props 就像是木偶的线,而配置器就是木偶的控制器,它们的关系如下图所示: ![image.png](https://mdn.alipayobjects.com/huamei_re70wt/afts/img/A*d8rTT4gXf-UAAAAAAAAAAAAADmuEAQ/original) diff --git a/docs/pro-editor/data-flow.zh-CN.md b/docs/pro-editor/data-flow.zh-CN.md index 95cdb1c5..16e6aace 100644 --- a/docs/pro-editor/data-flow.zh-CN.md +++ b/docs/pro-editor/data-flow.zh-CN.md @@ -19,8 +19,8 @@ ProEditor 的数据流包含两类: 容器类 Store 只存放 Editor 相关状态,例如: -- 开发者/设计师模式; -- 画布/代码的切换; +- 开发者 / 设计师模式; +- 画布 / 代码的切换; - 当前画布交互的激活信息; - 当前加载的 ComponentAsset 实例; - ... diff --git a/docs/pro-editor/demos/buttonAsset/_Panel.tsx b/docs/pro-editor/demos/buttonAsset/_Panel.tsx index b5b4804b..86f448b4 100644 --- a/docs/pro-editor/demos/buttonAsset/_Panel.tsx +++ b/docs/pro-editor/demos/buttonAsset/_Panel.tsx @@ -1,5 +1,6 @@ import { RedoOutlined, UndoOutlined } from '@ant-design/icons'; -import { LevaPanel, useProBuilderStore } from '@ant-design/pro-editor'; +import { LevaPanel } from '@ant-design/leva-panel'; +import { useProBuilderStore } from '@ant-design/pro-editor'; import { Button, Divider } from 'antd'; import isEqual from 'fast-deep-equal'; import { FC, memo } from 'react'; diff --git a/docs/pro-editor/useProEditor.zh-CN.md b/docs/pro-editor/useProEditor.zh-CN.md index a8f788b7..b0fbd730 100644 --- a/docs/pro-editor/useProEditor.zh-CN.md +++ b/docs/pro-editor/useProEditor.zh-CN.md @@ -35,8 +35,11 @@ const MyComponent = () => { 可以使用 editor 对象来访问 ProEditor 的属性和方法: - `getPresenceEditor`:获取当前 ProEditor 的 presenceEditor 对象; + - `getViewport`:获取当前 ProEditor 的 `viewport`; + - `getConfig`:获取当前 ProEditor 的 config; + - `getProps`:获取当前 ProEditor 的 props。 - 注意:以上方法返回的对象均为最新值,即每次调用都会返回最新的值。 diff --git a/docs/pro-editor/utils.en-US.md b/docs/pro-editor/utils.en-US.md deleted file mode 100644 index 94101195..00000000 --- a/docs/pro-editor/utils.en-US.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: C2D2C Helper Functions -group: - title: Utility - order: 99 ---- - -# generateJSXCode - -This method is used to concatenate component attribute configurations to generate JSX code. - -```jsx | pure -import { generateJSXCode } from '@ant-design/pro-editor'; - -const config = { - children: 'Default Button', - target: '_blank', - type: 'default', - htmlType: 'button', - danger: false, - icon: '', - size: 'middle', - loading: true, - disabled: false, - ghost: false, - block: false, -}; - -const code = generateJSXCode('Button', config); -``` - -Result: - -```jsx | pure - -``` diff --git a/docs/pro-editor/utils.zh-CN.md b/docs/pro-editor/utils.zh-CN.md deleted file mode 100644 index c05ef5ad..00000000 --- a/docs/pro-editor/utils.zh-CN.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: C2D2C 辅助函数 -group: - title: 工具类库 - order: 99 ---- - -# generateJSXCode - -该方法用于将组件属性配置拼接生成 jsx 代码。 - -```jsx | pure -import { generateJSXCode } from '@ant-design/pro-editor'; - -const config = { - children: '默认按钮', - target: '_blank', - type: 'default', - htmlType: 'button', - danger: false, - icon: '', - size: 'middle', - loading: true, - disabled: false, - ghost: false, - block: false, -}; - -const code = generateJSXCode('Button', config); -``` - -结果为: - -```jsx | pure - -``` diff --git a/docs/showcase/flow-editor.zh-CN.md b/docs/showcase/flow-editor.zh-CN.md index be49f203..fe7d0159 100644 --- a/docs/showcase/flow-editor.zh-CN.md +++ b/docs/showcase/flow-editor.zh-CN.md @@ -10,4 +10,4 @@ Flow Editor 是一套节点式运行大模型的编辑工具。 ## 访问地址 -https://github.com/ant-design/pro-flow-editor + diff --git a/docs/showcase/kitchen-color-studio.zh-CN.md b/docs/showcase/kitchen-color-studio.zh-CN.md index f297b9b5..c7d8f54a 100644 --- a/docs/showcase/kitchen-color-studio.zh-CN.md +++ b/docs/showcase/kitchen-color-studio.zh-CN.md @@ -10,4 +10,4 @@ kitchen Color Studio 是一套开源的颜色系统编辑器。 ## 访问地址 -https://github.com/ant-design/antd-color-editor + diff --git a/package.json b/package.json index 7be4cb8f..11ea2586 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ant-design/pro-editor", - "version": "0.28.0", + "version": "0.38.0", "description": "🌟 Lightweight Editor UI Framework", "homepage": "https://github.com/ant-design/pro-editor", "bugs": { @@ -62,14 +62,15 @@ "@ant-design/icons": "^5.2.6", "@ant-design/pro-components": "^2.6.43", "@antv/dw-random": "^1.1.7", - "@babel/runtime": "^7.23.4", + "@babel/runtime": "^7.23.6", "@dnd-kit/core": "^6.1.0", "@dnd-kit/modifiers": "^6.0.1", "@dnd-kit/sortable": "^7.0.2", "@dnd-kit/utilities": "^3.2.2", + "@emotion/styled": "^11.11.0", "@faker-js/faker": "^7.6.0", "@floating-ui/react": "^0.24.8", - "@mui/material": "^5.14.18", + "@mui/material": "^5.15.1", "@textea/json-viewer": "^3.2.3", "ahooks": "^3.7.8", "classnames": "^2.3.2", @@ -79,7 +80,6 @@ "fast-deep-equal": "^3.1.3", "highlight.js": "~10.5.0", "immer": "^9.0.21", - "leva": "^0.9.35", "lodash.flatten": "^4.4.0", "lodash.get": "^4.4.2", "lodash.isempty": "^4.4.0", @@ -93,7 +93,7 @@ "lodash.unionby": "^4.8.0", "lodash.uniq": "^4.5.0", "mockjs": "^1.1.0", - "nanoid": "^5.0.3", + "nanoid": "^5.0.4", "polished": "^4.2.2", "prettier": "^2.8.8", "rc-util": "^5.38.1", @@ -104,6 +104,8 @@ "react-layout-kit": "^1.7.4", "react-markdown": "^8.0.7", "react-rnd": "^10.4.1", + "react-virtualized-auto-sizer": "^1.0.20", + "react-window": "^1.8.10", "reactflow": "^11.10.1", "rehype-katex": "^6.0.3", "remark-gfm": "^3.0.1", @@ -111,54 +113,56 @@ "rxjs": "^7.8.1", "shikiji": "^0.6.13", "type-fest": "^3.13.1", - "umi-request": "^1.4.0", "use-merge-value": "^1.2.0", "yjs": "^13.6.10", - "zustand": "^4.4.6", + "zustand": "^4.4.7", "zustand-middleware-yjs": "^1.3.1", "zustand-utils": "^1.3.1" }, "devDependencies": { + "@ant-design/leva-panel": "^1.0.0", "@emotion/jest": "^11.11.0", - "@lobehub/i18n-cli": "^1.15.0", - "@testing-library/jest-dom": "^6.1.4", + "@lobehub/i18n-cli": "^1.15.3", + "@testing-library/jest-dom": "^6.1.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^14.5.1", "@types/color": "^3.0.6", "@types/json-schema": "^7.0.15", - "@types/react": "^18.2.38", - "@types/react-dom": "^18.2.17", - "@umijs/lint": "^4.0.88", + "@types/react": "^18.2.45", + "@types/react-dom": "^18.2.18", + "@types/react-window": "^1.8.8", + "@umijs/lint": "^4.0.90", "@vitest/coverage-v8": "latest", - "antd": "^5.11.4", - "antd-style": "^3.5.2", + "antd": "^5.12.5", + "antd-style": "^3.6.1", "babel-plugin-antd-style": "^1.0.4", "commitlint": "^17.8.1", "commitlint-config-gitmoji": "^2.3.1", "conventional-changelog-gitmoji-config": "^1.5.2", - "dumi": "^2.2.14", + "dumi": "^2.2.16", "dumi-theme-antd-style": "latest", - "eslint": "^8.54.0", - "father": "^4.3.7", + "eslint": "^8.56.0", + "father": "^4.3.8", "gh-pages": "^5.0.0", "glob": "^10.3.10", "husky": "^8.0.3", "jsdom": "^22.1.0", "lint-staged": "^13.3.0", "prettier-plugin-organize-imports": "^3.2.4", - "prettier-plugin-packagejson": "^2.4.6", + "prettier-plugin-packagejson": "^2.4.7", "react": "^18.2.0", "react-dom": "^18.2.0", + "rehype-raw": "^6.0.0", "rxjs-spy": "^8.0.2", "semantic-release": "^21.1.2", "semantic-release-config-gitmoji": "^1.5.3", "stylelint": "^15.11.0", - "typescript": "^5.3.2", + "typescript": "^5.3.3", "vitest": "latest", "wait-on": "^6.0.1", "y-protocols": "^1.0.6", "y-webrtc": "^10.2.6", - "y-websocket": "^1.5.0", + "y-websocket": "^1.5.1", "zundo": "beta" }, "peerDependencies": { diff --git a/src/ActionGroup/demos/basic.tsx b/src/ActionGroup/demos/basic.tsx index 961d7446..281124b8 100644 --- a/src/ActionGroup/demos/basic.tsx +++ b/src/ActionGroup/demos/basic.tsx @@ -1,6 +1,3 @@ -/** - * title: 基础使用 - */ import { ActionGroup } from '@ant-design/pro-editor'; export default () => { diff --git a/src/ActionGroup/demos/config.tsx b/src/ActionGroup/demos/config.tsx index 575c067c..3a8940fc 100644 --- a/src/ActionGroup/demos/config.tsx +++ b/src/ActionGroup/demos/config.tsx @@ -1,7 +1,3 @@ -/** - * title: 配置使用 - * description: 通过配置 `items` 渲染整个内容,你可以通过在 items 声明 type 为 divider 来渲染一个分隔符 - */ import { CopyOutlined, DragOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons'; import { ActionGroup } from '@ant-design/pro-editor'; import { message } from 'antd'; diff --git a/src/ActionGroup/demos/custom.tsx b/src/ActionGroup/demos/custom.tsx index ed50f37a..acbf7c05 100644 --- a/src/ActionGroup/demos/custom.tsx +++ b/src/ActionGroup/demos/custom.tsx @@ -1,7 +1,3 @@ -/** - * title: 自定义 - * description: 通过 `render` 可以自定义渲染特殊的操作内容 - */ import { ActionGroup, ActionIcon, ActionIconGroupItemType } from '@ant-design/pro-editor'; import { Card, Input, Rate, Switch } from 'antd'; diff --git a/src/ActionGroup/demos/dropMenu.tsx b/src/ActionGroup/demos/dropMenu.tsx index fbc44e12..a4d7a967 100644 --- a/src/ActionGroup/demos/dropMenu.tsx +++ b/src/ActionGroup/demos/dropMenu.tsx @@ -1,8 +1,3 @@ -/** - * title: dropdown - * description: 通过配置 `dropdownMenu` 可以在尾部渲染一个下拉内容 - */ - import { CopyOutlined, DragOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons'; import { ActionGroup } from '@ant-design/pro-editor'; import { message } from 'antd'; diff --git a/src/ActionGroup/demos/type.tsx b/src/ActionGroup/demos/type.tsx index 4968cfaf..97f12db6 100644 --- a/src/ActionGroup/demos/type.tsx +++ b/src/ActionGroup/demos/type.tsx @@ -1,7 +1,4 @@ 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'; diff --git a/src/ActionGroup/demos/withPanel.tsx b/src/ActionGroup/demos/withPanel.tsx index 05eefce2..8a0a12fd 100644 --- a/src/ActionGroup/demos/withPanel.tsx +++ b/src/ActionGroup/demos/withPanel.tsx @@ -1,8 +1,3 @@ -/** - * title: 浮动面板中使用 - * description: 配合 DraggablePanel 可以使得整个面板可浮动拖拽 - */ - import type { Position } from '@ant-design/pro-editor'; import { ActionGroup, DraggablePanel } from '@ant-design/pro-editor'; import { useLocalStorageState } from 'ahooks'; diff --git a/src/ActionGroup/index.en-US.md b/src/ActionGroup/index.en-US.md index 6e791016..fbb5dc18 100644 --- a/src/ActionGroup/index.en-US.md +++ b/src/ActionGroup/index.en-US.md @@ -17,7 +17,12 @@ When you need a general panel to carry a series of global tools such as "full sc ## Code Demo - + + + + + + ## API diff --git a/src/ActionGroup/index.tsx b/src/ActionGroup/index.tsx index d5297896..508fc44a 100644 --- a/src/ActionGroup/index.tsx +++ b/src/ActionGroup/index.tsx @@ -5,7 +5,7 @@ import { RedoOutlined, UndoOutlined, } from '@ant-design/icons'; -import { ActionIcon, ActionIconProps, getPrefixCls } from '@ant-design/pro-editor'; +import { ActionIcon, ActionIconProps, ConfigProvider } from '@ant-design/pro-editor'; import { Divider, Dropdown, DropdownProps } from 'antd'; import { useStyle } from './style'; @@ -123,8 +123,7 @@ const ActionGroup = (props: ActionGroupProps) => { dropdownProps, dropdownMenuTrigger, } = props; - const prefixCls = getPrefixCls('action-group'); - const { styles, cx } = useStyle({ prefixCls, direction, type }); + const { styles, cx } = useStyle({ direction, type }); const DefalutItemConfig = [ { icon: , onClick: onFullScreenClick }, @@ -200,4 +199,12 @@ const ActionGroup = (props: ActionGroupProps) => { ); }; -export { ActionGroup }; +const WrapperActionGroup = (props: ActionGroupProps) => { + return ( + + + + ); +}; + +export { WrapperActionGroup as ActionGroup }; diff --git a/src/ActionGroup/index.zh-CN.md b/src/ActionGroup/index.zh-CN.md index 760366d6..d2f8c144 100644 --- a/src/ActionGroup/index.zh-CN.md +++ b/src/ActionGroup/index.zh-CN.md @@ -15,11 +15,11 @@ demo: ## 代码演示 - - - - - + + + + + ## API diff --git a/src/ActionGroup/style.ts b/src/ActionGroup/style.ts index f1237843..d87ed196 100644 --- a/src/ActionGroup/style.ts +++ b/src/ActionGroup/style.ts @@ -1,14 +1,16 @@ import { createStyles } from '../theme'; -export const useStyle = createStyles(({ token, css, cx }, { prefixCls, type, direction }) => { +export const useStyle = createStyles(({ token, css, cx, prefixCls }, { type, direction }) => { const typeStylish = css` background-color: ${type === 'block' ? token.colorFillTertiary : token.colorFillQuaternary}; border: 1px solid ${type === 'block' ? 'transparent' : token.colorBorder}; `; + const prefix = `${prefixCls}-${token.editorPrefix}-action-group`; + return { content: cx( - `${prefixCls}-content`, + `${prefix}-content`, css` ${type !== 'pure' && typeStylish}; width: fit-content; @@ -20,7 +22,7 @@ export const useStyle = createStyles(({ token, css, cx }, { prefixCls, type, dir `, ), button: cx( - `${prefixCls}-action-btn`, + `${prefix}-action-btn`, css` box-shadow: none; border: none; diff --git a/src/ActionIcon/ActionIcon.test.tsx b/src/ActionIcon/ActionIcon.test.tsx index c9892fcf..c628ab13 100644 --- a/src/ActionIcon/ActionIcon.test.tsx +++ b/src/ActionIcon/ActionIcon.test.tsx @@ -14,6 +14,7 @@ describe('ActionIcon', () => { ); expect(container).toMatchSnapshot(); const icon = await findByTestId('smile'); - expect(icon.className.includes('studio-btn-icon')).toBeTruthy(); + expect(icon.className.includes('ant-btn-icon')).toBeTruthy(); + expect(icon.className.includes('ant-editor-icon')).toBeTruthy(); }); }); diff --git a/src/ActionIcon/ActionIcon.tsx b/src/ActionIcon/ActionIcon.tsx index 29fa842c..af30c37c 100644 --- a/src/ActionIcon/ActionIcon.tsx +++ b/src/ActionIcon/ActionIcon.tsx @@ -2,7 +2,6 @@ import type { ButtonProps, TooltipProps } from 'antd'; import { Button, Tooltip } from 'antd'; import type { CSSProperties, FC } from 'react'; import { ConfigProvider } from '../ConfigProvider'; -import { getPrefixCls } from '../theme'; import { useStyles } from './style'; /** @@ -46,7 +45,7 @@ export interface ActionIconProps extends Omit { arrow?: boolean; } -const ActionIcon: FC = ({ +const BaseActionIcon: FC = ({ placement, title, icon, @@ -54,13 +53,11 @@ const ActionIcon: FC = ({ onClick, className, arrow = false, - size, + size = 'default', tooltipDelay = 0.5, - prefixCls: customPrefixCls, ...restProps }) => { - const prefixCls = getPrefixCls('actionicon', customPrefixCls); - const { styles, theme: token, cx } = useStyles({ size, prefixCls }); + const { styles, cx } = useStyles({ size }); const Icon = ( + + columns={columns} + value={value} + onChange={(values) => { + setValue(values); + console.log('onChange', values); + }} + /> + ); }; diff --git a/src/ColumnList/demos/creatorButtonProps.tsx b/src/ColumnList/demos/creatorButtonProps.tsx index 977bcd49..b594781c 100644 --- a/src/ColumnList/demos/creatorButtonProps.tsx +++ b/src/ColumnList/demos/creatorButtonProps.tsx @@ -1,6 +1,6 @@ /** * title: 自定义初始化 - * description: 可通过 `creatorButtonProps` 来自定义初始化逻辑,id 的生成逻辑是必须的。 + * description: 可通过 `creatorButtonProps` 来自定义初始化逻辑 */ import type { ColumnItemList } from '@ant-design/pro-editor'; import { ColumnList } from '@ant-design/pro-editor'; diff --git a/src/ColumnList/demos/creatorButtonPropsFalse.tsx b/src/ColumnList/demos/creatorButtonPropsFalse.tsx new file mode 100644 index 00000000..29876060 --- /dev/null +++ b/src/ColumnList/demos/creatorButtonPropsFalse.tsx @@ -0,0 +1,68 @@ +/** + * title: 关闭添加能力 + * description: 可通过 `creatorButtonProps={false}` 来关闭添加功能,包括添加一行按钮,回车添加以及空状态添加 + */ +import type { ColumnItemList } from '@ant-design/pro-editor'; +import { ColumnList } from '@ant-design/pro-editor'; +import { tableColumnValueOptions } from './mock_data/options'; + +type SchemaItem = { + title: string; + valueType?: string; + dataIndex: string; +}; + +const INIT_VALUES = [ + { + dataIndex: 'productName', + valueType: 'text', + title: '产品名称', + color: undefined, + }, + { + dataIndex: 'productComment', + valueType: 'text', + title: '产品介绍', + color: undefined, + }, + { + dataIndex: 'orderStatus', + valueType: 'text', + title: '订单状态', + }, +]; + +/** + * 创建一个随机的索引标记符,请勿在生产环境使用 + */ +export const randomIndex = () => Math.random() * 10000; + +const columns: ColumnItemList = [ + { + title: '列标题', + dataIndex: 'title', + type: 'input', + }, + { + title: '值类型', + dataIndex: 'valueType', + type: 'select', + options: tableColumnValueOptions, + }, + { + title: '字段', + dataIndex: 'dataIndex', + type: 'select', + }, +]; + +export default () => ( + + columns={columns} + initialValues={INIT_VALUES} + onChange={(values) => { + console.log('onChange', values); + }} + creatorButtonProps={false} + /> +); diff --git a/src/ColumnList/demos/customCreate.tsx b/src/ColumnList/demos/customCreate.tsx index 23703592..36ff46dd 100644 --- a/src/ColumnList/demos/customCreate.tsx +++ b/src/ColumnList/demos/customCreate.tsx @@ -1,6 +1,6 @@ /** * title: 自定义创建逻辑 - * description: 你可以设置 `creatorButtonProps={false}` 来关闭默认的创建效果,然后自定义创建逻辑 + * description: 你可以设置 `style` 属性来隐藏默认添加按钮,然后自定义创建按钮 */ import { PlusCircleTwoTone } from '@ant-design/icons'; import type { ColumnItemList, SortableListRef } from '@ant-design/pro-editor'; @@ -58,9 +58,14 @@ const columns: ColumnItemList = [ export default () => { const ref = useRef>(null); - const handleCreate = () => { + const createNewRecord = () => { const id = `id-${randomIndex()}}`; - ref.current.addItem({ dataIndex: id, title: `new-${id}`, valueType: 'text' }); + return { dataIndex: '', title: `new-${id}`, valueType: 'text' }; + }; + + const handleCreate = () => { + const data = createNewRecord(); + ref.current.addItem(data); }; return ( @@ -93,7 +98,7 @@ export default () => { onChange={(values) => { console.log('onChange', values); }} - creatorButtonProps={false} + creatorButtonProps={{ style: { display: 'none' }, record: createNewRecord }} /> ); diff --git a/src/ColumnList/demos/empty.tsx b/src/ColumnList/demos/empty.tsx index 1291d80b..56ec1051 100644 --- a/src/ColumnList/demos/empty.tsx +++ b/src/ColumnList/demos/empty.tsx @@ -45,6 +45,7 @@ export default () => { icon={} key={'edit'} tabIndex={-1} + style={{ height: 22 }} onClick={() => message.info(field.dataIndex)} />, ]} diff --git a/src/ColumnList/demos/normal.tsx b/src/ColumnList/demos/normal.tsx index 0e7dc4d4..4e557cb6 100644 --- a/src/ColumnList/demos/normal.tsx +++ b/src/ColumnList/demos/normal.tsx @@ -11,13 +11,12 @@ type SchemaItem = { }; const initialValues = [ - { title: '序号', valueType: 'indexBorder', dataIndex: 'index' }, + { title: '序号', dataIndex: 'index' }, { title: '授权企业名称', - valueType: 'text', dataIndex: 'name', }, - { title: '被授权企业', valueType: 'text', dataIndex: 'authCompany' }, + { title: '被授权企业', dataIndex: 'authCompany' }, ]; const columns: ColumnItemList = [ @@ -45,11 +44,5 @@ export default () => ( onChange={(values) => { console.log('onChange', values); }} - creatorButtonProps={{ - record: () => ({ - valueType: 'text', - title: '示例标题', - }), - }} /> ); diff --git a/src/ColumnList/index.en-US.md b/src/ColumnList/index.en-US.md index ac01785c..489987a2 100644 --- a/src/ColumnList/index.en-US.md +++ b/src/ColumnList/index.en-US.md @@ -14,7 +14,13 @@ Generate a simple sorting list based on `schema`. ## Code Demo - + + + + + + + ## API diff --git a/src/ColumnList/index.zh-CN.md b/src/ColumnList/index.zh-CN.md index f9de3f76..d5b0dfc7 100644 --- a/src/ColumnList/index.zh-CN.md +++ b/src/ColumnList/index.zh-CN.md @@ -16,6 +16,7 @@ demo: ## 代码演示 + diff --git a/src/ColumnList/renderItem/Input.tsx b/src/ColumnList/renderItem/Input.tsx index 1ab2c724..298ce2d7 100644 --- a/src/ColumnList/renderItem/Input.tsx +++ b/src/ColumnList/renderItem/Input.tsx @@ -1,10 +1,9 @@ -import { useSortableList } from '@ant-design/pro-editor'; -import { Input, InputRef } from 'antd'; +import { CreatorButtonProps, Input, useSortableList } from '@ant-design/pro-editor'; import { createStyles } from 'antd-style'; -import { CSSProperties, memo, useEffect, useRef, useState } from 'react'; +import { CSSProperties, memo, useEffect, useRef } from 'react'; -const useStyle = createStyles(({ css, cx }, prefixCls) => { - const prefix = `${prefixCls}-content`; +const useStyle = createStyles(({ css, cx, prefixCls, token }) => { + const prefix = `${prefixCls}-${token.editorPrefix}-content`; return { input: cx( `${prefix}-tem`, @@ -20,24 +19,16 @@ interface ItemRenderProps { value: string; index: number; dragging: boolean; - prefixCls: string; style: CSSProperties; placeholder?: string; + creatorButtonProps: CreatorButtonProps | false; } const ControlInput = memo( - ({ dataIndex, placeholder, value, index, prefixCls, style, dragging }) => { + ({ dataIndex, placeholder, value, index, style, dragging, creatorButtonProps }) => { const instance = useSortableList(); - const inputRef = useRef(null); - const [innerValue, setInnerValue] = useState(value); - const [changed, setChanged] = useState(false); - const shouldChange = useRef(true); - const { styles } = useStyle(prefixCls); - - const updateTitle = () => { - instance.updateItem({ [dataIndex]: innerValue }, index); - setChanged(false); - }; + const inputRef = useRef(null); + const { styles } = useStyle(); useEffect(() => { if (dragging) { @@ -53,42 +44,31 @@ const ControlInput = memo( const handleNextFocus = () => { const value = instance.getValue() || []; // 如果是最后一个节点,按下回车后,会自动添加一个新的节点 - if (index + 1 === value.length) { - instance.addItem({ [dataIndex]: '' }); + if (index + 1 === value.length && creatorButtonProps !== false) { + const { record } = creatorButtonProps; + instance.addItem(record(value.length)); } setTimeout(() => { const nextNodeEl = document.getElementById(customListId(index + 1)); nextNodeEl?.focus(); - }, 200); + }, 0); }; return ( { - shouldChange.current = false; - }} placeholder={placeholder || '请输入'} - onCompositionEnd={() => { - shouldChange.current = true; - }} - onBlur={() => { - if (changed) updateTitle(); - }} className={styles.input} onPressEnter={() => { - if (!shouldChange.current) return; - if (changed) updateTitle(); handleNextFocus(); }} - onChange={(e) => { - setInnerValue(e.target.value); - setChanged(true); + onChange={(value) => { + instance.updateItem({ [dataIndex]: value }, index); }} /> ); diff --git a/src/ColumnList/renderItem/Select.tsx b/src/ColumnList/renderItem/Select.tsx index 53f452d1..4b618ce0 100644 --- a/src/ColumnList/renderItem/Select.tsx +++ b/src/ColumnList/renderItem/Select.tsx @@ -3,8 +3,8 @@ import { Select } from 'antd'; import { createStyles } from 'antd-style'; import { CSSProperties, memo } from 'react'; -const useStyle = createStyles(({ prefixCls: ant, css, cx }, prefixCls) => { - const prefix = `${prefixCls}-content`; +const useStyle = createStyles(({ prefixCls: ant, token, css, cx }) => { + const prefix = `${ant}-${token.editorPrefix}-content`; return { select: cx( `${prefix}-tem`, @@ -21,17 +21,16 @@ interface ItemRenderProps { dataIndex: string; value: string; index: number; - prefixCls: string; style: CSSProperties; options: ColumnItemOption[]; placeholder?: string; } const ControlSelect = memo( - ({ dataIndex, value, index, prefixCls, style, options, placeholder }) => { + ({ dataIndex, value, index, style, options, placeholder }) => { const instance = useSortableList(); - const { styles } = useStyle(prefixCls); + const { styles } = useStyle(); return (
短文本