drawui-core 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 +20 -0
- package/dist/index.cjs +22 -22
- package/dist/index.d.cts +287 -12
- package/dist/index.d.ts +287 -12
- package/dist/index.js +22 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
配套 React 封装见 [drawui-react](https://www.npmjs.com/package/drawui-react)。
|
|
8
8
|
|
|
9
|
+
> 🛠 **图片上传对接**(接 OSS / 自建后端)请看 [IMAGE_UPLOAD.md](./IMAGE_UPLOAD.md):含 30 MB 体积上限、60 s 超时、两种通道(`ImageUploadConfig` 与 `ImageUploader` 函数)、OSS CORS 与 STS 直传示例。
|
|
10
|
+
|
|
9
11
|
## 安装
|
|
10
12
|
|
|
11
13
|
```bash
|
|
@@ -61,6 +63,15 @@ interface EditorOptions {
|
|
|
61
63
|
|
|
62
64
|
## 更新日志
|
|
63
65
|
|
|
66
|
+
### v0.5.0
|
|
67
|
+
|
|
68
|
+
> 主题:**图片上传通道**(OSS / 自建后端友好)
|
|
69
|
+
|
|
70
|
+
- 🛡️ **单张图片体积上限 30 MB**:超过上限直接拒绝(抛 `image.tooLarge`),不会真的发请求;接入方可按需通过 `ImageUploadConfig.maxSizeBytes` 自定义。
|
|
71
|
+
- ⏱ **上传超时 30 s → 60 s**:默认 `timeoutMs` 从 30000 调整为 60000;同样支持 `ImageUploadConfig.timeoutMs` 自定义。
|
|
72
|
+
- 🧰 **新增 `ImageUploader` 函数通道**(优先级高于配置):需要自定义上传逻辑(OSS STS 直传、分片、压缩、重试、并发限流)时,传一个 `(file: File) => Promise<string>` 给 `imageUpload` 即可。
|
|
73
|
+
- 📄 **新增 [`IMAGE_UPLOAD.md`](./IMAGE_UPLOAD.md)**:接入方对接指南 —— 两条通道对比、调用链速览、10 个最容易踩的坑、上线前自检 checklist。
|
|
74
|
+
|
|
64
75
|
### v0.4.2
|
|
65
76
|
|
|
66
77
|
- 🖱️ **右键菜单所需能力全部内置**:`Editor` 新增一整套编辑操作 API —— `getSelectedShapes()` / `deleteSelected()` / `copySelected()` / `copySelectedAsImage()` / `paste()` / `duplicateSelected()` / `hasClipboard()` / `copyStyle()` / `pasteStyle()` / `hasCopiedStyle()` / `flipSelected('horizontal' | 'vertical')` / `rotateSelected90()` / `setSelectedShapesLocked()` / `setShapeLocked()` / `isShapeLocked()` / `bringToFront()` / `sendToBack()` / `bringForward()` / `sendBackward()`,全部走 `commitHistory()`,可撤销。同时内置对应快捷键(`Ctrl+C` / `Ctrl+Shift+C` / `Ctrl+V` / `Ctrl+D` / `Ctrl+Alt+C` / `Ctrl+Alt+V` / `Ctrl+Alt+L` / `Shift+H` / `Shift+V`)。
|
|
@@ -238,6 +249,15 @@ interface EditorOptions {
|
|
|
238
249
|
|
|
239
250
|
## Changelog
|
|
240
251
|
|
|
252
|
+
### v0.5.0
|
|
253
|
+
|
|
254
|
+
> Theme: **Image upload channel** (OSS / custom backend friendly)
|
|
255
|
+
|
|
256
|
+
- 🛡️ **30 MB per-image size cap**: oversized images are rejected before any request is sent (throws `image.tooLarge`); the cap can be overridden via `ImageUploadConfig.maxSizeBytes`.
|
|
257
|
+
- ⏱ **Upload timeout 30 s → 60 s**: default `timeoutMs` bumped from 30000 to 60000; still overridable per-config.
|
|
258
|
+
- 🧰 **New `ImageUploader` function channel** (takes priority over config): pass a `(file: File) => Promise<string>` to `imageUpload` whenever you need custom upload logic (OSS STS direct upload, chunking, compression, retries, concurrency limits).
|
|
259
|
+
- 📄 **New [`IMAGE_UPLOAD.md`](./IMAGE_UPLOAD.md)**: integration guide for hosts — both channels, call chain, 10 common OSS pitfalls, pre-release checklist.
|
|
260
|
+
|
|
241
261
|
### v0.4.2
|
|
242
262
|
|
|
243
263
|
- 🖱️ **Everything a context menu needs, built into `Editor`**: `getSelectedShapes()` / `deleteSelected()` / `copySelected()` / `copySelectedAsImage()` / `paste()` / `duplicateSelected()` / `hasClipboard()` / `copyStyle()` / `pasteStyle()` / `hasCopiedStyle()` / `flipSelected('horizontal' | 'vertical')` / `rotateSelected90()` / `setSelectedShapesLocked()` / `setShapeLocked()` / `isShapeLocked()` / `bringToFront()` / `sendToBack()` / `bringForward()` / `sendBackward()` — all through `commitHistory()`, so every one of them is undoable. Matching shortcuts ship too (`Ctrl+C` / `Ctrl+Shift+C` / `Ctrl+V` / `Ctrl+D` / `Ctrl+Alt+C` / `Ctrl+Alt+V` / `Ctrl+Alt+L` / `Shift+H` / `Shift+V`).
|