@meetelise/chat 1.53.4 → 1.53.5
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.
- package/package.json +1 -1
- package/public/dist/index.js +14 -51
- package/src/WebComponent/pubnub-media.ts +14 -55
- package/src/pubnub-chat.test.ts +3 -2
package/package.json
CHANGED
package/public/dist/index.js
CHANGED
|
@@ -6714,24 +6714,18 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6714
6714
|
style="transform: translateX(-${100*this.activeIndex}%);"
|
|
6715
6715
|
>
|
|
6716
6716
|
${this.message.media.map((e,t)=>R`
|
|
6717
|
-
<
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
</a>
|
|
6730
|
-
<div class="image-info">
|
|
6731
|
-
${e.title?R`<p class="img-header">${e.title}</p>`:""}
|
|
6732
|
-
${e.description?R`<p class="img-desc">${e.description}</p>`:""}
|
|
6733
|
-
</div>
|
|
6734
|
-
</div>
|
|
6717
|
+
<a
|
|
6718
|
+
class="image-link"
|
|
6719
|
+
href="${e.url}"
|
|
6720
|
+
target="_blank"
|
|
6721
|
+
rel="noopener noreferrer"
|
|
6722
|
+
>
|
|
6723
|
+
<img
|
|
6724
|
+
class=${ye({active:t===this.activeIndex})}
|
|
6725
|
+
src=${e.url}
|
|
6726
|
+
alt=""
|
|
6727
|
+
/>
|
|
6728
|
+
</a>
|
|
6735
6729
|
`)}
|
|
6736
6730
|
</div>
|
|
6737
6731
|
${this.message.media.length>1?R`<div class="controls">
|
|
@@ -6752,8 +6746,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6752
6746
|
/></a>`)}
|
|
6753
6747
|
</div>`:R``}};ic.styles=[Oe,Wu,u`
|
|
6754
6748
|
/* This element is a flex item in a bubble capped below the chat width.
|
|
6755
|
-
Without min-width: 0 it
|
|
6756
|
-
|
|
6749
|
+
Without min-width: 0 it can grow to all slides side by side, so the
|
|
6750
|
+
carousel spills out of the bubble and the chat. */
|
|
6757
6751
|
:host {
|
|
6758
6752
|
min-width: 0;
|
|
6759
6753
|
}
|
|
@@ -6790,14 +6784,6 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6790
6784
|
background-color: #f2f2f2;
|
|
6791
6785
|
display: block;
|
|
6792
6786
|
}
|
|
6793
|
-
.image-item {
|
|
6794
|
-
width: 100%;
|
|
6795
|
-
max-width: none;
|
|
6796
|
-
flex-shrink: 0;
|
|
6797
|
-
display: flex;
|
|
6798
|
-
flex-direction: column;
|
|
6799
|
-
gap: 10px;
|
|
6800
|
-
}
|
|
6801
6787
|
.image-link {
|
|
6802
6788
|
width: 100%;
|
|
6803
6789
|
max-width: none;
|
|
@@ -6806,7 +6792,6 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6806
6792
|
.carousel img.active {
|
|
6807
6793
|
opacity: 1;
|
|
6808
6794
|
}
|
|
6809
|
-
/* Covers the photo, not the caption, so the arrows centre on the photo. */
|
|
6810
6795
|
.controls {
|
|
6811
6796
|
position: absolute;
|
|
6812
6797
|
top: 0;
|
|
@@ -6836,28 +6821,6 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6836
6821
|
.button:hover {
|
|
6837
6822
|
background-color: rgba(0, 0, 0, 0.8);
|
|
6838
6823
|
}
|
|
6839
|
-
.image-info {
|
|
6840
|
-
display: flex;
|
|
6841
|
-
flex-direction: column;
|
|
6842
|
-
gap: 5px;
|
|
6843
|
-
}
|
|
6844
|
-
.image-info p {
|
|
6845
|
-
margin: 0;
|
|
6846
|
-
padding: 0;
|
|
6847
|
-
white-space: wrap;
|
|
6848
|
-
overflow: hidden;
|
|
6849
|
-
word-wrap: break-word;
|
|
6850
|
-
}
|
|
6851
|
-
.image-info .img-header {
|
|
6852
|
-
color: #333;
|
|
6853
|
-
font-size: 14px;
|
|
6854
|
-
}
|
|
6855
|
-
.image-info .img-desc {
|
|
6856
|
-
color: #666;
|
|
6857
|
-
font-size: 12px;
|
|
6858
|
-
max-height: 200px;
|
|
6859
|
-
overflow-y: auto;
|
|
6860
|
-
}
|
|
6861
6824
|
`],nc([ue({attribute:!0})],ic.prototype,"message",void 0),nc([ue({attribute:!0})],ic.prototype,"myPubnub",void 0),nc([ue({attribute:!0})],ic.prototype,"onMount",void 0),nc([de()],ic.prototype,"showMediaAsCarousel",void 0),nc([de()],ic.prototype,"activeIndex",void 0),ic=nc([se("pubnub-media")],ic);function rc(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function oc(e,t){ii(2,arguments);var n=ri(e),i=ri(t),r=rc(n,i),o=Math.abs(function(e,t){ii(2,arguments);var n=rr(e),i=rr(t),r=n.getTime()-zi(n),o=i.getTime()-zi(i);return Math.round((r-o)/864e5)}(n,i));n.setDate(n.getDate()-r*o);var a=r*(o-Number(rc(n,i)===-r));return 0===a?0:a}const ac=u`
|
|
6862
6825
|
#utilities-container {
|
|
6863
6826
|
position: fixed;
|
|
@@ -12,8 +12,8 @@ export class PubnubMedia extends LitElement {
|
|
|
12
12
|
pubnubChatStyles,
|
|
13
13
|
css`
|
|
14
14
|
/* This element is a flex item in a bubble capped below the chat width.
|
|
15
|
-
Without min-width: 0 it
|
|
16
|
-
|
|
15
|
+
Without min-width: 0 it can grow to all slides side by side, so the
|
|
16
|
+
carousel spills out of the bubble and the chat. */
|
|
17
17
|
:host {
|
|
18
18
|
min-width: 0;
|
|
19
19
|
}
|
|
@@ -50,14 +50,6 @@ export class PubnubMedia extends LitElement {
|
|
|
50
50
|
background-color: #f2f2f2;
|
|
51
51
|
display: block;
|
|
52
52
|
}
|
|
53
|
-
.image-item {
|
|
54
|
-
width: 100%;
|
|
55
|
-
max-width: none;
|
|
56
|
-
flex-shrink: 0;
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
gap: 10px;
|
|
60
|
-
}
|
|
61
53
|
.image-link {
|
|
62
54
|
width: 100%;
|
|
63
55
|
max-width: none;
|
|
@@ -66,7 +58,6 @@ export class PubnubMedia extends LitElement {
|
|
|
66
58
|
.carousel img.active {
|
|
67
59
|
opacity: 1;
|
|
68
60
|
}
|
|
69
|
-
/* Covers the photo, not the caption, so the arrows centre on the photo. */
|
|
70
61
|
.controls {
|
|
71
62
|
position: absolute;
|
|
72
63
|
top: 0;
|
|
@@ -96,28 +87,6 @@ export class PubnubMedia extends LitElement {
|
|
|
96
87
|
.button:hover {
|
|
97
88
|
background-color: rgba(0, 0, 0, 0.8);
|
|
98
89
|
}
|
|
99
|
-
.image-info {
|
|
100
|
-
display: flex;
|
|
101
|
-
flex-direction: column;
|
|
102
|
-
gap: 5px;
|
|
103
|
-
}
|
|
104
|
-
.image-info p {
|
|
105
|
-
margin: 0;
|
|
106
|
-
padding: 0;
|
|
107
|
-
white-space: wrap;
|
|
108
|
-
overflow: hidden;
|
|
109
|
-
word-wrap: break-word;
|
|
110
|
-
}
|
|
111
|
-
.image-info .img-header {
|
|
112
|
-
color: #333;
|
|
113
|
-
font-size: 14px;
|
|
114
|
-
}
|
|
115
|
-
.image-info .img-desc {
|
|
116
|
-
color: #666;
|
|
117
|
-
font-size: 12px;
|
|
118
|
-
max-height: 200px;
|
|
119
|
-
overflow-y: auto;
|
|
120
|
-
}
|
|
121
90
|
`,
|
|
122
91
|
];
|
|
123
92
|
|
|
@@ -173,28 +142,18 @@ export class PubnubMedia extends LitElement {
|
|
|
173
142
|
>
|
|
174
143
|
${this.message.media.map(
|
|
175
144
|
(image, index) => html`
|
|
176
|
-
<
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
</a>
|
|
189
|
-
<div class="image-info">
|
|
190
|
-
${image.title
|
|
191
|
-
? html`<p class="img-header">${image.title}</p>`
|
|
192
|
-
: ""}
|
|
193
|
-
${image.description
|
|
194
|
-
? html`<p class="img-desc">${image.description}</p>`
|
|
195
|
-
: ""}
|
|
196
|
-
</div>
|
|
197
|
-
</div>
|
|
145
|
+
<a
|
|
146
|
+
class="image-link"
|
|
147
|
+
href="${image.url}"
|
|
148
|
+
target="_blank"
|
|
149
|
+
rel="noopener noreferrer"
|
|
150
|
+
>
|
|
151
|
+
<img
|
|
152
|
+
class=${classMap({ active: index === this.activeIndex })}
|
|
153
|
+
src=${image.url}
|
|
154
|
+
alt=""
|
|
155
|
+
/>
|
|
156
|
+
</a>
|
|
198
157
|
`
|
|
199
158
|
)}
|
|
200
159
|
</div>
|
package/src/pubnub-chat.test.ts
CHANGED
|
@@ -199,8 +199,8 @@ it("keeps a photo carousel and its arrows inside the message bubble", async () =
|
|
|
199
199
|
)}`;
|
|
200
200
|
const photos: SimpleMediaChatMessage = {
|
|
201
201
|
timestamp: 100,
|
|
202
|
-
// Eight
|
|
203
|
-
//
|
|
202
|
+
// Eight photos with names and descriptions, as one floor plan can have.
|
|
203
|
+
// Their names and descriptions are not drawn.
|
|
204
204
|
media: [
|
|
205
205
|
"Living Room",
|
|
206
206
|
"Dining Area",
|
|
@@ -248,4 +248,5 @@ it("keeps a photo carousel and its arrows inside the message bubble", async () =
|
|
|
248
248
|
// Centred on the photo, not on the photo and its caption together.
|
|
249
249
|
const centreY = (box: DOMRect) => (box.top + box.bottom) / 2;
|
|
250
250
|
expect(centreY(next)).to.be.closeTo(centreY(photo), 1);
|
|
251
|
+
expect(media.shadowRoot?.textContent).not.to.contain("Living Room");
|
|
251
252
|
});
|