DEV: Trigger an app event when a card is shown (#14399)

DEV: Trigger an app event when a card is shown (#14399)

This replaces the unused lastEvent field with an app event trigger.

diff --git a/app/assets/javascripts/discourse/app/mixins/card-contents-base.js b/app/assets/javascripts/discourse/app/mixins/card-contents-base.js
index 299d27f..813995f 100644
--- a/app/assets/javascripts/discourse/app/mixins/card-contents-base.js
+++ b/app/assets/javascripts/discourse/app/mixins/card-contents-base.js
@@ -54,7 +54,7 @@ export default Mixin.create({
       return false;
     }
 
-    this.set("lastEvent", event);
+    this.appEvents.trigger("card:show", username, target, event);
 
     const currentUsername = this.username;
     if (username === currentUsername || this.loading === username) {
@@ -304,7 +304,6 @@ export default Mixin.create({
       visible: false,
       username: null,
       loading: null,
-      lastEvent: null,
       cardTarget: null,
       post: null,
       isFixed: false,
@@ -317,6 +316,7 @@ export default Mixin.create({
     }
 
     this._hide();
+    this.appEvents.trigger("card:hide");
   },
 
   willDestroyElement() {

GitHub sha: bba973f0d5db1a6a6eadc0fa3d65b78e1b6bcd87

This commit appears in #14399 which was approved by CvX. It was merged by nbianca.