bard-attachment_field 0.5.7 → 0.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +20 -0
- data/app/assets/javascripts/input-attachment.js +396 -368
- data/input-attachment/bun.lockb +0 -0
- data/input-attachment/package.json +1 -1
- data/input-attachment/src/components/attachment-file/attachment-file.spec.tsx +22 -0
- data/input-attachment/src/components/attachment-file/attachment-file.tsx +3 -1
- data/input-attachment/src/components/attachment-file/readme.md +2 -0
- data/input-attachment/src/components/input-attachment/input-attachment.tsx +4 -0
- data/input-attachment/src/components.d.ts +6 -0
- data/lib/bard/attachment_field/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f03200d473a693885b813d0990c78f6d06c7a3ef6ba6a9b88acdac3769379344
|
|
4
|
+
data.tar.gz: e343b3122f95ef094f1060e73661d4a06ca07d0d4f3f041f3388271193a9aea5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d8d24848b191cbd2699095a94c512d5eb44c710ee0d36cd167719ae2865f0350b7a701727b19dc84172e35d7f2997e9bc06aaec341be120d1adb21f13bcbd2b
|
|
7
|
+
data.tar.gz: ad571bce098435bec2bb4f05197aca1ab0ee9db13ee4325ae0c0aa02d157758ba071c61fc4d819b06b63def46ca39df0936f0faf13feac50c6d4e8bece325b66
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.0] - 2026-06-11
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- `<attachment-file>` accepts optional `href` and `download` attributes for its
|
|
8
|
+
download link, falling back to `src` and `filename`. Lets block-rendered
|
|
9
|
+
fields point the preview at a small image while the download link fetches
|
|
10
|
+
the original file.
|
|
11
|
+
|
|
3
12
|
## [0.5.5] - 2026-06-06
|
|
4
13
|
|
|
5
14
|
### Bug Fixes
|
data/README.md
CHANGED
|
@@ -73,6 +73,26 @@ Pass a block to render your own children inside the `<input-attachment>` element
|
|
|
73
73
|
<% end %>
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
`src` powers both the preview and the download link. When `src` points at a
|
|
77
|
+
smaller preview image, set `href` to point the download link at the original
|
|
78
|
+
file instead, and optionally `download` to control the downloaded filename:
|
|
79
|
+
|
|
80
|
+
```erb
|
|
81
|
+
<%= form.attachment_field :image do |options| %>
|
|
82
|
+
<% if @post.image.attached? %>
|
|
83
|
+
<attachment-file
|
|
84
|
+
name="<%= options["name"] %>"
|
|
85
|
+
src="<%= url_for @post.image.variant(:thumb) %>"
|
|
86
|
+
href="<%= rails_blob_path @post.image, disposition: :attachment %>"
|
|
87
|
+
download="<%= @post.image.filename %>"
|
|
88
|
+
filename="<%= @post.image.filename %>"
|
|
89
|
+
value="<%= @post.image.signed_id %>"
|
|
90
|
+
preview="true"
|
|
91
|
+
filetype="image"></attachment-file>
|
|
92
|
+
<% end %>
|
|
93
|
+
<% end %>
|
|
94
|
+
```
|
|
95
|
+
|
|
76
96
|
## Development
|
|
77
97
|
|
|
78
98
|
This project has two parts: the Ruby gem and the Stencil web components in `input-attachment/`.
|