@trycourier/courier-ui-inbox 1.0.12-beta → 1.0.13-beta

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/dist/index.mjs CHANGED
@@ -2778,7 +2778,6 @@ class CourierUnreadCountBadge extends CourierBaseElement {
2778
2778
  text-align: center;
2779
2779
  display: none;
2780
2780
  pointer-events: none;
2781
- min-width: 20px;
2782
2781
  }
2783
2782
 
2784
2783
  ${CourierUnreadCountBadge.id} .header {
@@ -4329,10 +4328,6 @@ class CourierInboxPopupMenu extends CourierBaseElement {
4329
4328
  __publicField(this, "_popup");
4330
4329
  __publicField(this, "_inbox");
4331
4330
  __publicField(this, "_style");
4332
- // Inbox Handlers
4333
- __publicField(this, "_onMessageClick");
4334
- __publicField(this, "_onMessageActionClick");
4335
- __publicField(this, "_onMessageLongPress");
4336
4331
  // Listeners
4337
4332
  __publicField(this, "_datastoreListener");
4338
4333
  // Factories
@@ -4380,26 +4375,6 @@ class CourierInboxPopupMenu extends CourierBaseElement {
4380
4375
  this._popup.className = "popup";
4381
4376
  this._inbox = new CourierInbox(this._themeManager);
4382
4377
  this._inbox.setAttribute("height", "100%");
4383
- if (this._inbox) {
4384
- this._inbox.onMessageClick((props) => {
4385
- if (this._onMessageClick) {
4386
- this._onMessageClick(props);
4387
- }
4388
- this.closePopup();
4389
- });
4390
- this._inbox.onMessageActionClick((props) => {
4391
- if (this._onMessageActionClick) {
4392
- this._onMessageActionClick(props);
4393
- }
4394
- this.closePopup();
4395
- });
4396
- this._inbox.onMessageLongPress((props) => {
4397
- if (this._onMessageLongPress) {
4398
- this._onMessageLongPress(props);
4399
- }
4400
- this.closePopup();
4401
- });
4402
- }
4403
4378
  this.refreshTheme();
4404
4379
  this.appendChild(this._triggerButton);
4405
4380
  this.appendChild(this._popup);
@@ -4512,13 +4487,31 @@ class CourierInboxPopupMenu extends CourierBaseElement {
4512
4487
  this.render();
4513
4488
  }
4514
4489
  onMessageClick(handler) {
4515
- this._onMessageClick = handler;
4490
+ var _a;
4491
+ (_a = this._inbox) == null ? void 0 : _a.onMessageClick((props) => {
4492
+ if (handler) {
4493
+ handler(props);
4494
+ }
4495
+ this.closePopup();
4496
+ });
4516
4497
  }
4517
4498
  onMessageActionClick(handler) {
4518
- this._onMessageActionClick = handler;
4499
+ var _a;
4500
+ (_a = this._inbox) == null ? void 0 : _a.onMessageActionClick((props) => {
4501
+ if (handler) {
4502
+ handler(props);
4503
+ }
4504
+ this.closePopup();
4505
+ });
4519
4506
  }
4520
4507
  onMessageLongPress(handler) {
4521
- this._onMessageLongPress = handler;
4508
+ var _a;
4509
+ (_a = this._inbox) == null ? void 0 : _a.onMessageLongPress((props) => {
4510
+ if (handler) {
4511
+ handler(props);
4512
+ }
4513
+ this.closePopup();
4514
+ });
4522
4515
  }
4523
4516
  isValidPosition(value) {
4524
4517
  const validPositions = [