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 +4 -4
- data/CHANGELOG.md +8 -0
- data/app/assets/javascripts/input-attachment.js +3 -3
- data/input-attachment/src/components/attachment-preview/attachment-preview.e2e.ts +27 -0
- data/input-attachment/src/components/attachment-preview/attachment-preview.tsx +4 -1
- 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: 171fcac9ab96b706cf55ff53b8f7c18f48aaa29c26a166b4e53c932136071c72
|
|
4
|
+
data.tar.gz: 683c9604ea6c3c0214e2571dee9c66ce2008f9452b9f0e70b393500b0c40d420
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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:
|
|
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
|
|
4109
|
-
|
|
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
|
});
|
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.
|
|
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-
|
|
11
|
+
date: 2026-07-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activestorage
|