@internetarchive/ia-book-actions 0.0.29-alpha19 → 0.0.29-alpha20
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/demo/index.html +3 -4
- package/package.json +2 -2
- package/src/ia-book-actions.js +14 -10
package/demo/index.html
CHANGED
|
@@ -127,10 +127,9 @@
|
|
|
127
127
|
iaBookActions.returnUrl = 'https://openlibrary.org';
|
|
128
128
|
iaBookActions.localCache = localCache;
|
|
129
129
|
iaBookActions.loanRenewConfig = {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
pageChangedInLast: 15, // within last 15 second/minute
|
|
130
|
+
totalTime: 40, // 60 second = 1 min
|
|
131
|
+
autoCheckAt: 35, // totalTime - 10th minute
|
|
132
|
+
pageChangedInLast: 5, // within last 15 second/minute
|
|
134
133
|
};
|
|
135
134
|
|
|
136
135
|
let lendingStatus1 = iaBookActions.lendingStatus;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@internetarchive/ia-book-actions",
|
|
3
|
-
"version": "0.0.29-
|
|
3
|
+
"version": "0.0.29-alpha20",
|
|
4
4
|
"description": "Bookreader actions for borrowable book",
|
|
5
5
|
"author": "Internet Archive",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@internetarchive/local-cache": "^0.2.0",
|
|
23
23
|
"@internetarchive/modal-manager": "^0.2.1",
|
|
24
24
|
"@internetarchive/shared-resize-observer": "^0.2.0",
|
|
25
|
-
"@internetarchive/toast-manager": "0.0.1-
|
|
25
|
+
"@internetarchive/toast-manager": "0.0.1-alpha5",
|
|
26
26
|
"lit": "^2.2.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
package/src/ia-book-actions.js
CHANGED
|
@@ -153,16 +153,21 @@ export default class IABookActions extends LitElement {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
async showToastMessage() {
|
|
156
|
-
let
|
|
157
|
-
if (!
|
|
158
|
-
|
|
156
|
+
let toastTemplate = this.shadowRoot.querySelector('toast-template');
|
|
157
|
+
if (!toastTemplate) {
|
|
158
|
+
toastTemplate = document.createElement('toast-template');
|
|
159
159
|
}
|
|
160
|
-
this.shadowRoot.appendChild(toastManager)
|
|
161
160
|
|
|
162
|
-
|
|
163
|
-
// await document.body.appendChild(
|
|
161
|
+
await this.shadowRoot.appendChild(toastTemplate)
|
|
162
|
+
// await document.body.appendChild(toastTemplate);
|
|
164
163
|
|
|
165
|
-
|
|
164
|
+
const config = new ToastConfig();
|
|
165
|
+
config.texts = this.loanRenewResult?.texts;
|
|
166
|
+
config.dismisOnClick = true;
|
|
167
|
+
|
|
168
|
+
toastTemplate.showToast({
|
|
169
|
+
config
|
|
170
|
+
});
|
|
166
171
|
}
|
|
167
172
|
|
|
168
173
|
async browseHasExpired() {
|
|
@@ -533,10 +538,9 @@ export default class IABookActions extends LitElement {
|
|
|
533
538
|
}
|
|
534
539
|
|
|
535
540
|
toast-template {
|
|
536
|
-
--toastHeightFromTop: 22%;
|
|
537
|
-
--toastBGColor: #333333;
|
|
538
|
-
--toastFontColor: #ffffff;
|
|
539
541
|
--toastTopMargin: 80px;
|
|
542
|
+
--toastBGColor: #333;
|
|
543
|
+
--toastFontColor: #fff;
|
|
540
544
|
}
|
|
541
545
|
`;
|
|
542
546
|
}
|