drawui-react 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  **简体中文** | [繁體中文](#繁體中文) | [English](#english) | [日本語](#日本語) | [한국어](#한국어) | [Deutsch](#deutsch) | [Français](#français)
4
4
 
5
- 基于 [drawui-core](https://www.npmjs.com/package/drawui-core) 的 React 封装,提供开箱即用的画布组件。
5
+ 基于 [drawui-core](https://www.npmjs.com/package/drawui-core) 的 React 封装,提供开箱即用的画布组件。
6
+
7
+ > 🛠 **图片上传对接**(接 OSS / 自建后端)请看 [`../core/IMAGE_UPLOAD.md`](../core/IMAGE_UPLOAD.md):含 `imageUpload` prop 的两种通道(`ImageUploadConfig` 与 `ImageUploader` 函数)、30 MB 体积上限、60 s 超时、OSS CORS 与 STS 直传示例。
6
8
 
7
9
  ## 安装
8
10
 
@@ -59,6 +61,16 @@ export function App() {
59
61
 
60
62
  ## 更新日志
61
63
 
64
+ ### v0.5.0
65
+
66
+ > 主题:**图片上传通道**(OSS / 自建后端友好)
67
+
68
+ - 🛡️ **单张图片体积上限 30 MB**:超过上限直接拒绝(抛 `image.tooLarge`),不会真的发请求;接入方可按需通过 `imageUpload.maxSizeBytes` 自定义。
69
+ - ⏱ **上传超时 30 s → 60 s**:默认 `timeoutMs` 从 30000 调整为 60000。
70
+ - 🧰 **`imageUpload` 现在支持两种通道**:`ImageUploadConfig`(配 `{ url, method, headers, responseUrlPath, timeoutMs, maxSizeBytes }`)或 `ImageUploader` 函数(`(file: File) => Promise<string>`),函数优先级高于配置。
71
+ - 🌐 **多语言新增 `image.tooLarge` 文案**:7 种语言全部同步,体积超限时 toast 用对应语言提示用户。
72
+ - 📄 **图片上传对接指南**:[`../core/IMAGE_UPLOAD.md`](../core/IMAGE_UPLOAD.md)。
73
+
62
74
  ### v0.4.2
63
75
 
64
76
  - 🖱️ **画布右键菜单(新增 `ContextMenu` 组件)**:选中图形右键弹出飞书式菜单 —— 复制 / 复制为图片 / 粘贴 / 创建副本 / **层级**(置于顶层 / 上移一层 / 下移一层 / 置于底层,悬停展开子菜单)/ 复制样式 / 粘贴样式 / 水平翻转 / 垂直翻转 / 旋转 / **成组 · 解组** / 锁定 / 删除,每项带快捷键标注,无操作能力的项自动置灰;空白处右键只显示「粘贴」,右键锁定的图形只显示「解锁 / 解组」。菜单自动贴边避让视口,点击外部或 `Esc` 关闭,文案随语言切换(7 种语言已补齐)。
@@ -225,6 +237,16 @@ export function App() {
225
237
 
226
238
  ## Changelog
227
239
 
240
+ ### v0.5.0
241
+
242
+ > Theme: **Image upload channel** (OSS / custom backend friendly)
243
+
244
+ - 🛡️ **30 MB per-image size cap**: oversized images are rejected before any request is sent (throws `image.tooLarge`); overridable via `imageUpload.maxSizeBytes`.
245
+ - ⏱ **Upload timeout 30 s → 60 s**: default `timeoutMs` bumped from 30000 to 60000.
246
+ - 🧰 **`imageUpload` now accepts two channels**: `ImageUploadConfig` (with `{ url, method, headers, responseUrlPath, timeoutMs, maxSizeBytes }`) **or** an `ImageUploader` function (`(file: File) => Promise<string>`); the function takes priority over the config.
247
+ - 🌐 **`image.tooLarge` localized**: added in all 7 supported languages so the size-cap toast always uses the user's language.
248
+ - 📄 **Image upload integration guide**: see [`../core/IMAGE_UPLOAD.md`](../core/IMAGE_UPLOAD.md).
249
+
228
250
  ### v0.4.2
229
251
 
230
252
  - 🖱️ **Canvas context menu (new `ContextMenu` component)**: right-clicking a selected shape opens a Feishu-style menu — copy / copy as image / paste / duplicate / **layer** (hover to expand: bring to front / forward / backward / send to back) / copy style / paste style / flip horizontal / flip vertical / rotate / **group · ungroup** / lock / delete, each with its shortcut, unavailable entries greyed out. Right-clicking empty space shows only "Paste"; right-clicking a locked shape shows only "Unlock / Ungroup". The menu clamps itself into the viewport and closes on outside click or `Esc`; all copy is translated into 7 languages.