Skip to content

Commit 81cc6d1

Browse files
Version Packages (#199)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 68b8620 commit 81cc6d1

3 files changed

Lines changed: 33 additions & 32 deletions

File tree

.changeset/tiny-peas-join.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/core/CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# @tailor-platform/app-shell
22

3+
## 0.36.0
4+
5+
### Minor Changes
6+
7+
- e2a6f81: Add `Attachment` component and `useAttachment` hook for ERP attachment workflows with drag-and-drop upload, image/file previews, and per-item `Download`/`Delete` actions.
8+
9+
Use `useAttachment` to manage upload/delete state locally and flush operations to your backend on submit via `applyChanges`. Spread the returned `props` directly onto `<Attachment />`.
10+
11+
```tsx
12+
import { Attachment, useAttachment } from "@tailor-platform/app-shell";
13+
import type { AttachmentOperation } from "@tailor-platform/app-shell";
14+
15+
const { props, applyChanges } = useAttachment({
16+
initialItems: existingAttachments,
17+
accept: "image/*,.pdf",
18+
});
19+
20+
async function handleSubmit() {
21+
// The component is agnostic to backend shape — run all operations in parallel.
22+
await applyChanges((operations) =>
23+
Promise.all(
24+
operations.map((op) => {
25+
if (op.type === "upload") return uploadToServer(op.file);
26+
if (op.type === "delete") return deleteFromServer(op.item.id);
27+
})
28+
)
29+
);
30+
}
31+
32+
<Attachment {...props} uploadLabel="Upload" onDownload={handleDownload} />;
33+
```
34+
335
## 0.35.1
436

537
### Patch Changes

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailor-platform/app-shell",
3-
"version": "0.35.1",
3+
"version": "0.36.0",
44
"description": "An opinionated React application framework for building ERP applications on Tailor Platform",
55
"keywords": [
66
"app-shell",

0 commit comments

Comments
 (0)