@nyaruka/temba-components 0.173.0 → 0.174.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyaruka/temba-components",
3
- "version": "0.173.0",
3
+ "version": "0.174.0",
4
4
  "description": "Web components to support rapidpro and related projects",
5
5
  "author": "Nyaruka <code@nyaruka.coim>",
6
6
  "main": "dist/index.js",
@@ -2228,14 +2228,17 @@ export class ContentList<T = any> extends RapidElement {
2228
2228
  if (path.some((n: any) => n?.classList?.contains?.('check-cell'))) {
2229
2229
  return;
2230
2230
  }
2231
+ const rowHref = this.getRowHref(item);
2232
+ const href = rowHref && this.isSafeHref(rowHref) ? rowHref : null;
2233
+ // Meta/ctrl-click opens a new tab, matching ordinary links. Skip
2234
+ // RowClick entirely — host pages navigate on it unconditionally,
2235
+ // which would also swap out the current page.
2236
+ if (href && (event.metaKey || event.ctrlKey)) {
2237
+ window.open(href, '_blank');
2238
+ return;
2239
+ }
2231
2240
  this.fireCustomEvent(CustomEventType.RowClick, { item });
2232
- const href = this.getRowHref(item);
2233
- if (href && this.isSafeHref(href)) {
2234
- // Meta/ctrl-click opens a new tab, matching ordinary links.
2235
- if (event.metaKey || event.ctrlKey) {
2236
- window.open(href, '_blank');
2237
- return;
2238
- }
2241
+ if (href) {
2239
2242
  // Fire Redirected rather than assigning window.location so the
2240
2243
  // host SPA frame swaps content in place instead of doing a full
2241
2244
  // page reload — the frame listens for this event on document and
@@ -1302,16 +1302,9 @@ export class ContactChat extends ContactStoreElement {
1302
1302
  this.chat.reset();
1303
1303
  }
1304
1304
 
1305
- // a ticket-scoped chat only shows this ticket's history, so its search
1306
- // only covers this ticket's messages too. The endpoint narrows the
1307
- // search to ticket messages and drops the other tickets' matches
1308
- // itself, so its cap is no longer spent on messages this view can't
1309
- // show — matches from the contact's other tickets can still crowd out
1310
- // this one's, so the cap isn't per-ticket
1311
- let url = `/contact/chat_search/${this.currentContact.uuid}/?text=${encodeURIComponent(query)}`;
1312
- if (this.currentTicket) {
1313
- url += `&ticket=${encodeURIComponent(this.currentTicket.uuid)}`;
1314
- }
1305
+ // the chat always shows the contact's full history even when viewing
1306
+ // a ticket so search always covers all of the contact's messages
1307
+ const url = `/contact/chat_search/${this.currentContact.uuid}/?text=${encodeURIComponent(query)}`;
1315
1308
 
1316
1309
  getUrl(url)
1317
1310
  .then((response: WebResponse) => {