@internetarchive/ia-book-actions 0.0.29-alpha10 → 0.0.29-alpha11
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
|
@@ -9,6 +9,10 @@ import CollapsibleActionGroupStyle from '../assets/styles/collapsible-action-gro
|
|
|
9
9
|
|
|
10
10
|
import { tabletContainerWidth } from '../core/config/constants.js';
|
|
11
11
|
import { purchaseIcon } from '../assets/data/purchase.js';
|
|
12
|
+
import {
|
|
13
|
+
analyticsCategories,
|
|
14
|
+
analyticsActions,
|
|
15
|
+
} from '../config/analytics-event-and-category.js';
|
|
12
16
|
import {
|
|
13
17
|
dropdownOpened,
|
|
14
18
|
dropdownClosed,
|
|
@@ -66,10 +70,15 @@ export class CollapsibleActionGroup extends ActionsHandler {
|
|
|
66
70
|
|
|
67
71
|
// dispatch this event to loan renew handler
|
|
68
72
|
dispatchAutoRenewBookEvent() {
|
|
73
|
+
const { category, action } = {
|
|
74
|
+
category: analyticsCategories.browse,
|
|
75
|
+
action: analyticsActions.browseAutoRenew,
|
|
76
|
+
};
|
|
77
|
+
|
|
69
78
|
this.dispatchEvent(
|
|
70
79
|
new CustomEvent('autoRenewLoan', {
|
|
71
80
|
detail: {
|
|
72
|
-
event: {
|
|
81
|
+
event: { category, action },
|
|
73
82
|
},
|
|
74
83
|
})
|
|
75
84
|
);
|
|
@@ -13,6 +13,7 @@ export const analyticsCategories = {
|
|
|
13
13
|
export const analyticsActions = {
|
|
14
14
|
browse: 'Borrow-1Hour',
|
|
15
15
|
browseAgain: 'Borrow-Again',
|
|
16
|
+
browseAutoRenew: 'Borrow-Auto-Renew',
|
|
16
17
|
borrow: 'Borrow-14Days',
|
|
17
18
|
waitlistJoin: 'JoinWaitlist',
|
|
18
19
|
waitlistLeave: 'LeaveWaitlist',
|
package/src/ia-book-actions.js
CHANGED
|
@@ -113,6 +113,10 @@ export default class IABookActions extends LitElement {
|
|
|
113
113
|
|
|
114
114
|
bindAutoRenewEvent() {
|
|
115
115
|
// dispatched this event from timer-countdown
|
|
116
|
+
this.addEventListener('BookReader:pageChanged', event => {
|
|
117
|
+
console.log('here: ', event)
|
|
118
|
+
})
|
|
119
|
+
|
|
116
120
|
this.addEventListener('autoRenewAttempt', async event => {
|
|
117
121
|
const isPageClick = event.detail.bookPageChange;
|
|
118
122
|
|