bard-attachment_field 0.6.1 → 0.6.2

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: 6bef7d86b4bd8938fe4944c96dde471a868af65c72817f254bad2ef989840eb3
4
- data.tar.gz: b40d5ad52b14aa85e4a695dbc7f2aaa58cf2ae6d75b11860100a7818805a1e51
3
+ metadata.gz: 171fcac9ab96b706cf55ff53b8f7c18f48aaa29c26a166b4e53c932136071c72
4
+ data.tar.gz: 683c9604ea6c3c0214e2571dee9c66ce2008f9452b9f0e70b393500b0c40d420
5
5
  SHA512:
6
- metadata.gz: 8907713c89cfab1718f7a812a23c49b604abe65e4a613669760f63d8a22790ffaed0ac19af0682262237a9557d3c45221f7c5f4ede50255cbec48564e412418f
7
- data.tar.gz: cf825d567f49628992b93247ac2668b6adf35204dda72c0aa1701fe537bf247d9214bfb14d688e64d2e4593e70b4720dc449d3a345c1d4451ccaf62b48243395
6
+ metadata.gz: f21267ecf4f3107be7c9032212323e44b3b43b12fd30949abfdb78782b4779daa1940a7db337be51b4a9355cd6c701a9fa42765a0c1367e376217a7a2267352b
7
+ data.tar.gz: bd493292e9d8c0bff64960bef1aa95f931f334a27de8b80a243ee64b668af75d6735de34820ac0d5eeec80432b7479169bb5c1ba7c481cffa34cfe06c8335098
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.2] - 2026-07-23
4
+
5
+ ### Bug Fixes
6
+
7
+ - Clicking a `<video>` preview to play/pause no longer opens the file picker.
8
+ The click handler now stops propagation so it doesn't bubble to the
9
+ `<file-drop>` wrapper, which opens the upload dialog on click.
10
+
3
11
  ## [0.6.1] - 2026-06-24
4
12
 
5
13
  ### Bug Fixes
@@ -4087,7 +4087,7 @@ var a = proxyCustomElement(class extends H {
4087
4087
  src;
4088
4088
  filetype;
4089
4089
  render() {
4090
- return h(Host, { key: "429f17fda03ded975255da6335ba23a663ee662e", class: this.computeClass() }, this.isImage() && h("img", { key: "daa4e38cb1375db7d8852ab1cb401f048efbbdc7", src: this.src }), this.isVideo() && h("video", { key: "1b7860bc3edf2f4ba4951dd0bd8a88f14db078a0", src: this.src, onClick: n }), this.isOther() && "This file does not offer a preview", h("slot", { key: "b8a894bcc9ae11619d543b20f2bd2ee9167616d8" }));
4090
+ return h(Host, { key: "429f17fda03ded975255da6335ba23a663ee662e", class: this.computeClass() }, this.isImage() && h("img", { key: "daa4e38cb1375db7d8852ab1cb401f048efbbdc7", src: this.src }), this.isVideo() && h("video", { key: "1b7860bc3edf2f4ba4951dd0bd8a88f14db078a0", src: this.src, onClick: c }), this.isOther() && "This file does not offer a preview", h("slot", { key: "b8a894bcc9ae11619d543b20f2bd2ee9167616d8" }));
4091
4091
  }
4092
4092
  computeClass() {
4093
4093
  return this.isImage() ? "image" : this.isVideo() ? "video" : "other";
@@ -4105,8 +4105,8 @@ var a = proxyCustomElement(class extends H {
4105
4105
  return ":host{display:block;font-size:13px}img,video{max-width:100%;margin-top:10px}";
4106
4106
  }
4107
4107
  }, [769, "attachment-preview", { src: [513], filetype: [513] }]);
4108
- var n = function() {
4109
- return this.paused ? this.play() : this.pause(), false;
4108
+ var c = function(e3) {
4109
+ e3.stopPropagation(), this.paused ? this.play() : this.pause();
4110
4110
  };
4111
4111
 
4112
4112
  // dist/components/attachment-file2.js
@@ -8,4 +8,31 @@ describe('attachment-preview', () => {
8
8
  const element = await page.find('attachment-preview');
9
9
  expect(element).toHaveClass('hydrated');
10
10
  });
11
+
12
+ it('does not bubble video preview clicks to ancestor upload handlers', async () => {
13
+ const page = await newE2EPage();
14
+ await page.setContent(`
15
+ <div id="drop">
16
+ <attachment-preview filetype="video" src="data:video/mp4;base64,AAAA"></attachment-preview>
17
+ </div>
18
+ `);
19
+ await page.evaluate(() => {
20
+ (window as any).ancestorClicked = false;
21
+ document
22
+ .getElementById('drop')
23
+ .addEventListener('click', () => { (window as any).ancestorClicked = true; });
24
+ const video = document
25
+ .querySelector('attachment-preview')
26
+ .shadowRoot.querySelector('video') as any;
27
+ video.play = () => Promise.resolve();
28
+ video.pause = () => {};
29
+ });
30
+
31
+ const video = await page.find('attachment-preview >>> video');
32
+ await video.click();
33
+ await page.waitForChanges();
34
+
35
+ const ancestorClicked = await page.evaluate(() => (window as any).ancestorClicked);
36
+ expect(ancestorClicked).toBe(false);
37
+ });
11
38
  });
@@ -39,4 +39,7 @@ export class AttachmentPreview {
39
39
  }
40
40
  }
41
41
 
42
- const toggle = function() { this.paused ? this.play() : this.pause(); return false }
42
+ const toggle = function(event) {
43
+ event.stopPropagation()
44
+ this.paused ? this.play() : this.pause()
45
+ }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bard
4
4
  module AttachmentField
5
- VERSION = "0.6.1"
5
+ VERSION = "0.6.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard-attachment_field
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-06-24 00:00:00.000000000 Z
11
+ date: 2026-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activestorage