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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '012936d871893ab9a4a5e630e81937115a339a28913a50dc017b30d628eb08ff'
4
- data.tar.gz: 0da30b3c4a8c3dd7e6002cb244d633a17807feac33c0e18d10843d32ebcf11b4
3
+ metadata.gz: f03200d473a693885b813d0990c78f6d06c7a3ef6ba6a9b88acdac3769379344
4
+ data.tar.gz: e343b3122f95ef094f1060e73661d4a06ca07d0d4f3f041f3388271193a9aea5
5
5
  SHA512:
6
- metadata.gz: a1f5949622f30d7a89d362398f623c37893b689764d87618250377f5010ee359a4274d3f501046929ef9d6304956c67a3cce2dea0ab51a5c1a9da0de78b07fca
7
- data.tar.gz: 793c2bab2fe0530a31bec1a9d9a5a3c65e15df8003133f2d3950549ab2906c0a48cb0b6325f2558bd66d83c753c63125a16b2301991a2e464753bd641b702631
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/`.