refactor(editor): simplify attachment and image upload handling (#11987)

Closes: [BS-3303](https://linear.app/affine-design/issue/BS-3303/改進-pack-attachment-props-流程)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Enhanced attachment and image uploads with improved file size validation and clearer notifications.
  - Upload telemetry tracking added for attachments to monitor upload success or failure.

- **Refactor**
  - Streamlined and unified the process of adding attachments and images, making uploads more reliable and efficient.
  - Parameter names updated for clarity across attachment and image insertion features.

- **Documentation**
  - Updated API documentation to reflect parameter name changes for consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
fundon
2025-04-28 07:03:30 +00:00
parent 3fdab1bec6
commit 85e40e4026
8 changed files with 250 additions and 307 deletions

View File

@@ -196,7 +196,7 @@ Array of IDs of the newly created blocks
### addSiblingBlocks()
> **addSiblingBlocks**(`targetModel`, `props`, `place`): `string`[]
> **addSiblingBlocks**(`targetModel`, `props`, `placement`): `string`[]
Add sibling blocks to the store
@@ -214,7 +214,7 @@ The target block model
Array of block properties
##### place
##### placement
Optional position to place the new blocks ('after' or 'before')