@internetarchive/ia-book-actions 0.0.1 → 0.0.2-7.1
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/README.md +93 -47
- package/assets/ia-book-action-screen.png +0 -0
- package/assets/ia-book-title-screen.png +0 -0
- package/demo/index.html +108 -55
- package/package.json +13 -12
- package/src/assets/data/archive-logo.js +32 -0
- package/src/assets/data/dropdown-arrow.js +1 -1
- package/src/assets/data/lending-get-status-service.js +2 -337
- package/src/assets/data/purchase.js +1 -1
- package/src/assets/styles/collapsible-action-group.js +90 -32
- package/src/assets/styles/ia-button.js +75 -33
- package/src/components/book-title-bar.js +93 -0
- package/src/components/collapsible-action-group.js +81 -51
- package/src/components/info-icon.js +6 -10
- package/src/components/text-group.js +1 -1
- package/src/core/config/analytics-event-and-category.js +4 -2
- package/src/core/config/url-helper.js +2 -1
- package/src/core/services/actions-config.js +27 -14
- package/src/core/services/actions-handler/actions-handler-service.js +48 -36
- package/src/core/services/actions-handler/actions-handler.js +152 -37
- package/src/core/services/doc-cookies.js +83 -0
- package/src/core/services/get-lending-actions.js +70 -55
- package/src/core/services/loan-token-poller.js +100 -0
- package/src/ia-book-actions.js +307 -33
- package/test/components/book-title-bar.test.js +39 -0
- package/test/components/collapsible-action-group.test.js +51 -3
- package/test/core/services/get-lending-actions.test.js +116 -55
- package/test/core/services/loan-token-poller.test.js +46 -0
- package/test/ia-book-actions.test.js +185 -3
- package/web-test-runner.config.mjs +1 -1
package/README.md
CHANGED
|
@@ -1,69 +1,115 @@
|
|
|
1
|
-
|
|
1
|
+
# Component for lendable and embed items
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The book action button component build on LitElement with support for custom content and light DOM elements.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Usage
|
|
8
|
-
|
|
9
|
-
1. Click the "Use this Template" button in GitHub to create a new repository based on this one.
|
|
10
|
-
2. Clone your new repo and update the things below.
|
|
11
|
-
|
|
12
|
-
### Things to update in your copy
|
|
13
|
-
1. Remove this section
|
|
14
|
-
2. Search for the strings `your-webcomponent` and `YourWebComponent` and those are most of the spots that need to be updated.
|
|
15
|
-
3. `README.md` (this file). Update the readme in general, but also the badge URLs
|
|
16
|
-
4. `package.json` Update the name and description
|
|
17
|
-
5. Rename the `your-webcomponent.ts` and its associated `.test` file
|
|
18
|
-
6. Update `.travis.yml` with the proper secure key. See the [Travis docs](https://blog.travis-ci.com/2014-03-13-slack-notifications/) for more information.
|
|
19
|
-
|
|
20
|
-
## Local Demo with `web-dev-server`
|
|
5
|
+
## Installation
|
|
21
6
|
```bash
|
|
22
|
-
yarn
|
|
7
|
+
yarn install --save @internetarchive/ia-book-actions
|
|
23
8
|
```
|
|
24
|
-
To run a local development server that serves the basic demo located in `demo/index.html`
|
|
25
9
|
|
|
26
|
-
##
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
10
|
+
## Usage of Book Actions
|
|
11
|
+
```html
|
|
12
|
+
<!-- index.html -->
|
|
13
|
+
<style>
|
|
14
|
+
html {
|
|
15
|
+
font-size: 10px;
|
|
16
|
+
/* This is to match petabox's base font size */
|
|
17
|
+
}
|
|
18
|
+
body {
|
|
19
|
+
margin: 0;
|
|
20
|
+
text-align: center;
|
|
21
|
+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
22
|
+
}
|
|
23
|
+
#demo {
|
|
24
|
+
height: 50px;
|
|
25
|
+
}
|
|
26
|
+
ia-book-actions {
|
|
27
|
+
--white: #fff;
|
|
28
|
+
--black: #000;
|
|
29
|
+
--primaryBGColor: var(--black);
|
|
30
|
+
--secondaryBGColor: #222;
|
|
31
|
+
--tertiaryBGColor: #333;
|
|
32
|
+
--primaryTextColor: var(--white);
|
|
33
|
+
--primaryCTAFill: #194880;
|
|
34
|
+
--primaryCTABorder: #c5d1df;
|
|
35
|
+
--secondaryCTAFill: #333;
|
|
36
|
+
--secondaryCTABorder: #999;
|
|
37
|
+
--secondaryCTAFillRGB: 51, 51, 51;
|
|
38
|
+
--primaryErrorCTAFill: #e51c26;
|
|
39
|
+
--primaryErrorCTABorder: #f8c6c8;
|
|
40
|
+
--primaryCTAFillRGB: 25, 72, 128;
|
|
41
|
+
--primaryErrorCTAFillRGB: 229, 28, 38;
|
|
42
|
+
--primaryDisableCTAFill: #767676;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
45
|
+
|
|
46
|
+
<ia-book-actions></ia-book-actions>
|
|
47
|
+
|
|
48
|
+
<script type="module">
|
|
49
|
+
import '@internetarchive/ia-book-actions.js';
|
|
50
|
+
import { ModalConfig } from '@internetarchive/modal-manager';
|
|
51
|
+
import {
|
|
52
|
+
defaultLendingStatus,
|
|
53
|
+
canBrowseAndBorrow,
|
|
54
|
+
} from '../src/assets/data/lending-get-status-service.js';
|
|
55
|
+
|
|
56
|
+
let iaBookActions = document.querySelector('ia-book-actions');
|
|
57
|
+
iaBookActions.userid = '@neeraj-archive';
|
|
58
|
+
iaBookActions.identifier = 'naturalhistoryof00unse_4111';
|
|
59
|
+
iaBookActions.bookTitle = 'This is test title for any book';
|
|
60
|
+
iaBookActions.lendingStatus = {}; // lendinStatus in json
|
|
61
|
+
iaBookActions.bwbPurchaseUrl = 'https://bwb.com/produce/123';
|
|
62
|
+
iaBookActions.barType = ''; // title|action
|
|
63
|
+
</script>
|
|
30
64
|
```
|
|
31
65
|
|
|
32
|
-
|
|
66
|
+

|
|
33
67
|
|
|
34
|
-
|
|
35
|
-
|
|
68
|
+
## Usage of Book Title
|
|
69
|
+
```html
|
|
70
|
+
<!-- along with above properties, set barType to 'title' -->
|
|
71
|
+
<script type="module">
|
|
72
|
+
iaBookActions.barType = 'title'; // title|action
|
|
73
|
+
</script>
|
|
36
74
|
```
|
|
75
|
+

|
|
37
76
|
|
|
38
|
-
|
|
39
|
-
To scan the project for linting errors, run
|
|
40
|
-
```bash
|
|
41
|
-
yarn run lint
|
|
42
|
-
```
|
|
77
|
+
### Config Options
|
|
43
78
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
79
|
+
All of the config options:
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
let iaBookActions = document.querySelector('ia-book-actions');
|
|
83
|
+
const modalConfig = new ModalConfig(); // to show info/error modal
|
|
84
|
+
|
|
85
|
+
// set defaultLendingStatus for unavailable (without borrowables) book
|
|
86
|
+
iaBookActions.userid = '@jack';
|
|
87
|
+
iaBookActions.identifier = 'jack-sparrow';
|
|
88
|
+
iaBookActions.bookTitle = 'Contemporary Black biography. Volume 39 : profiles from the interContemporary Black biography. Volume 39';
|
|
89
|
+
iaBookActions.lendingStatus = {active_borrows: 0, active_browses: 0}, // complete lendingStatus object
|
|
90
|
+
iaBookActions.bwbPurchaseUrl = ''; // BWB purchase URl if any
|
|
91
|
+
iaBookActions.barType = '';
|
|
92
|
+
iaBookActions.modalConfig = modalConfig;
|
|
47
93
|
```
|
|
94
|
+
|
|
95
|
+
# Development
|
|
96
|
+
|
|
97
|
+
## Prerequisite
|
|
48
98
|
```bash
|
|
49
|
-
yarn
|
|
99
|
+
yarn install
|
|
50
100
|
```
|
|
51
101
|
|
|
52
|
-
|
|
102
|
+
## Start Development Server
|
|
53
103
|
```bash
|
|
54
|
-
yarn
|
|
104
|
+
yarn start
|
|
55
105
|
```
|
|
56
106
|
|
|
57
|
-
|
|
107
|
+
## Testing
|
|
58
108
|
```bash
|
|
59
|
-
yarn
|
|
109
|
+
yarn test
|
|
60
110
|
```
|
|
111
|
+
|
|
112
|
+
## Linting
|
|
61
113
|
```bash
|
|
62
|
-
yarn
|
|
114
|
+
yarn lint
|
|
63
115
|
```
|
|
64
|
-
|
|
65
|
-
## Tooling configs
|
|
66
|
-
|
|
67
|
-
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
68
|
-
|
|
69
|
-
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
Binary file
|
|
Binary file
|
package/demo/index.html
CHANGED
|
@@ -71,6 +71,14 @@
|
|
|
71
71
|
float: left;
|
|
72
72
|
margin: 2px;
|
|
73
73
|
}
|
|
74
|
+
|
|
75
|
+
body.modal-manager-open {
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
modal-manager[mode='closed'] {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
74
82
|
</style>
|
|
75
83
|
</head>
|
|
76
84
|
|
|
@@ -83,13 +91,9 @@
|
|
|
83
91
|
import '../src/ia-book-actions.js';
|
|
84
92
|
import {
|
|
85
93
|
defaultLendingStatus,
|
|
86
|
-
canBrowse,
|
|
87
|
-
browsed,
|
|
88
94
|
canBrowseAndBorrow,
|
|
89
|
-
browsedAndBorrow,
|
|
90
|
-
canBrowseAndBorrowod,
|
|
91
|
-
canBrowseAndJoinWaitlistForBorrow,
|
|
92
95
|
} from '../src/assets/data/lending-get-status-service.js';
|
|
96
|
+
import { ModalConfig } from '@internetarchive/modal-manager';
|
|
93
97
|
|
|
94
98
|
const userid = '@neeraj-archive';
|
|
95
99
|
const identifier = 'naturalhistoryof00unse_4111';
|
|
@@ -97,70 +101,126 @@
|
|
|
97
101
|
|
|
98
102
|
let iaBookActions = document.querySelector('ia-book-actions');
|
|
99
103
|
|
|
104
|
+
// for debugging
|
|
105
|
+
window.iaBookActions = iaBookActions;
|
|
106
|
+
|
|
107
|
+
const modalConfig = new ModalConfig();
|
|
108
|
+
modalConfig.headerColor = '#d9534f';
|
|
109
|
+
|
|
110
|
+
let lendingBarPostInit = function lendingBarPostInit() {
|
|
111
|
+
setTimeout(function() {}, 100);
|
|
112
|
+
}
|
|
113
|
+
|
|
100
114
|
// set defaultLendingStatus for unavailable (without borrowables) book
|
|
101
|
-
iaBookActions.userid =
|
|
115
|
+
iaBookActions.userid = userid;
|
|
102
116
|
iaBookActions.identifier = identifier;
|
|
103
|
-
iaBookActions.
|
|
117
|
+
iaBookActions.bookTitle = 'Contemporary Black biography. Volume 39 : profiles from the interContemporary Black biography. Volume 39';
|
|
118
|
+
iaBookActions.lendingStatus = canBrowseAndBorrow;
|
|
104
119
|
iaBookActions.bwbPurchaseUrl = '';
|
|
120
|
+
iaBookActions.modalConfig = modalConfig;
|
|
121
|
+
iaBookActions.lendingBarPostInit = lendingBarPostInit;
|
|
122
|
+
iaBookActions.tokenDelay = 2000; // 2 seconds
|
|
123
|
+
iaBookActions.returnUrl = 'https://openlibrary.org';
|
|
124
|
+
|
|
125
|
+
let lendingStatus1 = iaBookActions.lendingStatus;
|
|
126
|
+
|
|
127
|
+
document.querySelectorAll('.titleBar input[type=checkbox]').forEach((item) => {
|
|
128
|
+
item.addEventListener('click', (e) => {
|
|
129
|
+
if (e.target.checked) {
|
|
130
|
+
iaBookActions.barType = 'title';
|
|
131
|
+
} else {
|
|
132
|
+
iaBookActions.barType = 'action';
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
document.querySelectorAll('.errorEnable input[type=checkbox]').forEach((item) => {
|
|
138
|
+
if (window.location.href.indexOf('?error=true') !== -1) {
|
|
139
|
+
item.checked = true;
|
|
140
|
+
}
|
|
141
|
+
item.addEventListener('click', (e) => {
|
|
142
|
+
var searchParams = new URLSearchParams(window.location.search);
|
|
143
|
+
var separate = '';
|
|
144
|
+
if (e.target.checked) {
|
|
145
|
+
separate = '?';
|
|
146
|
+
searchParams.set('error', true);
|
|
147
|
+
} else {
|
|
148
|
+
separate = '';
|
|
149
|
+
searchParams.delete('error');
|
|
150
|
+
}
|
|
105
151
|
|
|
152
|
+
if (history.pushState) {
|
|
153
|
+
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + separate + searchParams;
|
|
154
|
+
window.history.pushState({path:newurl},'',newurl);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
|
|
106
160
|
document.querySelectorAll('.userState input[type=checkbox]').forEach((item) => {
|
|
107
161
|
item.addEventListener('click', (e) => {
|
|
108
|
-
let lendingStatus1 = defaultLendingStatus;
|
|
109
162
|
if (e.target.checked) {
|
|
110
163
|
if (e.target.value === 'isAdmin') lendingStatus1.isAdmin = true;
|
|
111
164
|
if (e.target.value === 'isLoggedIn') iaBookActions.userid = '@neeraj';
|
|
112
|
-
}
|
|
113
|
-
if (e.target.checked === false) {
|
|
165
|
+
} else {
|
|
114
166
|
if (e.target.value === 'isAdmin') lendingStatus1.isAdmin = false;
|
|
115
167
|
if (e.target.value === 'isLoggedIn') iaBookActions.userid = '';
|
|
116
168
|
}
|
|
117
|
-
|
|
169
|
+
let lending = {...defaultLendingStatus, ...lendingStatus1};
|
|
170
|
+
iaBookActions.lendingStatus = lending;
|
|
118
171
|
});
|
|
119
172
|
});
|
|
120
173
|
|
|
121
|
-
|
|
122
174
|
document.querySelectorAll('.printDisabled input[type=checkbox]').forEach((item) => {
|
|
123
|
-
const is_printdisabled = false;
|
|
124
|
-
const user_is_printdisabled = false;
|
|
125
175
|
item.addEventListener('click', (e) => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
lendingStatus1.
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
lendingStatus1.user_is_printdisabled =
|
|
176
|
+
if (e.target.checked) {
|
|
177
|
+
if (e.target.value === 'is_printdisabled') lendingStatus1.is_printdisabled = true;
|
|
178
|
+
if (e.target.value === 'user_is_printdisabled') lendingStatus1.user_is_printdisabled = true;
|
|
179
|
+
} else {
|
|
180
|
+
if (e.target.value === 'is_printdisabled') lendingStatus1.is_printdisabled = false;
|
|
181
|
+
if (e.target.value === 'user_is_printdisabled') lendingStatus1.user_is_printdisabled = false;
|
|
132
182
|
}
|
|
133
183
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
184
|
+
let lending = {...defaultLendingStatus, ...lendingStatus1};
|
|
185
|
+
iaBookActions.lendingStatus = lending;
|
|
137
186
|
});
|
|
138
187
|
});
|
|
139
188
|
|
|
140
189
|
document.querySelectorAll('.availableToBrowse input[type=radio]').forEach((item) => {
|
|
141
190
|
item.addEventListener('click', (e) => {
|
|
142
|
-
let lendingStatus1 = defaultLendingStatus;
|
|
143
|
-
|
|
144
191
|
if (e.target.value === 'user_has_browsed') {
|
|
145
192
|
lendingStatus1.user_has_browsed = true;
|
|
146
193
|
lendingStatus1.available_to_browse = false;
|
|
194
|
+
lendingStatus1.secondsLeftOnLoan = 10;
|
|
195
|
+
lendingStatus1.browsingExpired = false;
|
|
196
|
+
} else if(e.target.value === 'browsingExpired') {
|
|
197
|
+
lendingStatus1.user_has_browsed = true;
|
|
198
|
+
lendingStatus1.available_to_browse = false;
|
|
199
|
+
lendingStatus1.secondsLeftOnLoan = 0;
|
|
200
|
+
lendingStatus1.browsingExpired = true;
|
|
147
201
|
} else if (e.target.value === 'available_to_browse') {
|
|
148
202
|
lendingStatus1.available_to_browse = true;
|
|
149
203
|
lendingStatus1.user_has_browsed = false;
|
|
150
204
|
}
|
|
151
|
-
|
|
205
|
+
|
|
206
|
+
let lending = {...defaultLendingStatus, ...lendingStatus1};
|
|
207
|
+
iaBookActions.lendingStatus = lending;
|
|
152
208
|
});
|
|
153
209
|
});
|
|
154
210
|
|
|
155
211
|
document.querySelectorAll('.availableToBorrow input[type=radio]').forEach((item) => {
|
|
156
212
|
item.addEventListener('click', (e) => {
|
|
157
|
-
let lendingStatus1 = defaultLendingStatus;
|
|
158
|
-
|
|
159
213
|
if (e.target.value === 'available_to_borrow') {
|
|
160
214
|
lendingStatus1.available_to_borrow = true;
|
|
161
215
|
lendingStatus1.user_on_waitlist = false;
|
|
162
216
|
lendingStatus1.available_to_waitlist = false;
|
|
163
217
|
lendingStatus1.user_has_borrowed = false;
|
|
218
|
+
} else if (e.target.value === 'user_can_claim_waitlist') {
|
|
219
|
+
lendingStatus1.available_to_borrow = true;
|
|
220
|
+
lendingStatus1.user_on_waitlist = true;
|
|
221
|
+
lendingStatus1.user_can_claim_waitlist = true;
|
|
222
|
+
lendingStatus1.user_has_borrowed = false;
|
|
223
|
+
lendingStatus1.available_to_waitlist = false;
|
|
164
224
|
} else if (e.target.value === 'user_on_waitlist') {
|
|
165
225
|
lendingStatus1.available_to_borrow = false;
|
|
166
226
|
lendingStatus1.user_on_waitlist = true;
|
|
@@ -178,7 +238,8 @@
|
|
|
178
238
|
lendingStatus1.user_has_borrowed = true;
|
|
179
239
|
}
|
|
180
240
|
|
|
181
|
-
|
|
241
|
+
let lending = {...defaultLendingStatus, ...lendingStatus1};
|
|
242
|
+
iaBookActions.lendingStatus = lending;
|
|
182
243
|
});
|
|
183
244
|
});
|
|
184
245
|
|
|
@@ -196,8 +257,22 @@
|
|
|
196
257
|
|
|
197
258
|
<div>
|
|
198
259
|
<fieldset>
|
|
199
|
-
<legend>Dev
|
|
260
|
+
<legend>Dev testing for book title bar</legend>
|
|
261
|
+
<table class="initial">
|
|
262
|
+
<tr>
|
|
263
|
+
<td class="titleBar">
|
|
264
|
+
<label><input type="checkbox" name="title" value="title" />Title Bar</label>
|
|
265
|
+
</td>
|
|
266
|
+
</tr>
|
|
267
|
+
</table>
|
|
268
|
+
</fieldset>
|
|
269
|
+
|
|
270
|
+
<fieldset>
|
|
271
|
+
<legend>Dev testing for book action bar</legend>
|
|
200
272
|
<table class="initial">
|
|
273
|
+
<tr colspan='5'>
|
|
274
|
+
<td class="errorEnable"><label><input type="checkbox" name="errorEnable" value="errorEnable" />Do you want to see error response?</label></td>
|
|
275
|
+
</tr>
|
|
201
276
|
<tr>
|
|
202
277
|
<td class="userState">
|
|
203
278
|
<label><input type="checkbox" name="user" value="isAdmin" />isAdmin</label>
|
|
@@ -210,15 +285,17 @@
|
|
|
210
285
|
<td class="availableToBrowse">
|
|
211
286
|
<label><input type="radio" name="browse" value="available_to_browse" />available_to_browse</label>
|
|
212
287
|
<label><input type="radio" name="browse" value="user_has_browsed" />user_has_browsed</label>
|
|
288
|
+
<label><input type="radio" name="browse" value="browsingExpired" />browsingExpired</label>
|
|
213
289
|
</td>
|
|
214
290
|
<td class="availableToBorrow">
|
|
215
291
|
<label><input type="radio" name="borrow" value="available_to_borrow" />available_to_borrow</label>
|
|
216
292
|
<label><input type="radio" name="borrow" value="user_on_waitlist" />user_on_waitlist</label>
|
|
293
|
+
<label><input type="radio" name="borrow" value="user_can_claim_waitlist" />user_can_claim_waitlist</label>
|
|
217
294
|
<label><input type="radio" name="borrow" value="available_to_waitlist" />available_to_waitlist</label>
|
|
218
295
|
<label><input type="radio" name="borrow" value="user_has_borrowed" />user_has_borrowed</label>
|
|
219
296
|
</td>
|
|
220
297
|
<td class="purchase">
|
|
221
|
-
<label><input type="checkbox" name="purchase" value="purchase" />purchase
|
|
298
|
+
<label><input type="checkbox" name="purchase" value="purchase" />purchase</label>
|
|
222
299
|
</td>
|
|
223
300
|
|
|
224
301
|
<td class="reflect">
|
|
@@ -229,30 +306,6 @@
|
|
|
229
306
|
</td>
|
|
230
307
|
</tr>
|
|
231
308
|
</table>
|
|
232
|
-
|
|
233
|
-
<table class="mode" style="display: none;">
|
|
234
|
-
<tr>
|
|
235
|
-
<td>
|
|
236
|
-
<label><input type="radio" name="contact" value="canBrowse" />CanBrowse</label>
|
|
237
|
-
</td>
|
|
238
|
-
<td>
|
|
239
|
-
<label><input type="radio" name="contact" value="browsed" />browsed</label>
|
|
240
|
-
</td>
|
|
241
|
-
<td>
|
|
242
|
-
<label><input type="radio" name="contact" value="canBrowseAndBorrow" />canBrowseAndBorrow</label>
|
|
243
|
-
</td>
|
|
244
|
-
<td>
|
|
245
|
-
<label><input type="radio" name="contact" value="browsedAndBorrow" />browsedAndBorrow</label>
|
|
246
|
-
</td>
|
|
247
|
-
<td>
|
|
248
|
-
<label><input type="radio" name="contact" value="canBrowseAndBorrowod" />canBrowseAndBorrowod</label>
|
|
249
|
-
</td>
|
|
250
|
-
<td>
|
|
251
|
-
<label><input type="radio" name="contact"
|
|
252
|
-
id="canBrowseAndJoinWaitlistForBorrow" value="canBrowseAndJoinWaitlistForBorrow" />canBrowseAndJoinWaitlistForBorrow</label>
|
|
253
|
-
</td>
|
|
254
|
-
</tr>
|
|
255
|
-
</table>
|
|
256
309
|
</fieldset>
|
|
257
310
|
</div>
|
|
258
311
|
</body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@internetarchive/ia-book-actions",
|
|
3
|
-
"version": "0.0.1",
|
|
3
|
+
"version": "0.0.27.1",
|
|
4
4
|
"description": "Bookreader actions for borrowable book",
|
|
5
5
|
"author": "Internet Archive",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -13,23 +13,24 @@
|
|
|
13
13
|
"start": "web-dev-server",
|
|
14
14
|
"lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.js\" --check --ignore-path .gitignore",
|
|
15
15
|
"format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore",
|
|
16
|
-
"test": "yarn run lint &&
|
|
17
|
-
"test:fast": "web-test-runner --coverage",
|
|
18
|
-
"test:watch": "web-test-runner --watch"
|
|
16
|
+
"test": "yarn run lint && yarn test:fast",
|
|
17
|
+
"test:fast": "web-test-runner --coverage --playwright --browsers chromium firefox webkit",
|
|
18
|
+
"test:watch": "web-test-runner --watch --playwright --browsers chromium firefox webkit"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@internetarchive/
|
|
22
|
-
"@internetarchive/
|
|
23
|
-
"@internetarchive/
|
|
24
|
-
"
|
|
25
|
-
"lit
|
|
26
|
-
"resize-observer-polyfill": "^1.5.1"
|
|
21
|
+
"@internetarchive/icon-info": "^1.2.6",
|
|
22
|
+
"@internetarchive/local-cache": "^0.2.0",
|
|
23
|
+
"@internetarchive/modal-manager": "^0.2.1",
|
|
24
|
+
"@internetarchive/shared-resize-observer": "^0.2.0",
|
|
25
|
+
"lit": "^2.2.1"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
28
|
"@open-wc/eslint-config": "^4.2.0",
|
|
30
29
|
"@open-wc/testing": "^2.0.0",
|
|
31
30
|
"@web/dev-server": "^0.1.1",
|
|
32
|
-
"@web/
|
|
31
|
+
"@web/dev-server-esbuild": "^0.2.16",
|
|
32
|
+
"@web/test-runner": "^0.11.7",
|
|
33
|
+
"@web/test-runner-playwright": "^0.8.8",
|
|
33
34
|
"eslint": "^7.32.0",
|
|
34
35
|
"eslint-config-prettier": "^6.11.0",
|
|
35
36
|
"eslint-plugin-import": "^2.22.1",
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"husky": "^1.0.0",
|
|
40
41
|
"lint-staged": "^10.0.0",
|
|
41
42
|
"prettier": "^2.0.4",
|
|
42
|
-
"sinon": "^
|
|
43
|
+
"sinon": "^13.0.2"
|
|
43
44
|
},
|
|
44
45
|
"eslintConfig": {
|
|
45
46
|
"extends": [
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
|
|
3
|
+
export const archiveLogo = html`
|
|
4
|
+
<svg
|
|
5
|
+
class="ia-logo"
|
|
6
|
+
width="26"
|
|
7
|
+
height="26"
|
|
8
|
+
viewBox="0 0 27 30"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
aria-labelledby="logoTitleID logoDescID"
|
|
11
|
+
>
|
|
12
|
+
<title id="logoTitleID">Internet Archive logo</title>
|
|
13
|
+
<desc id="logoDescID">
|
|
14
|
+
A line drawing of the Internet Archive headquarters building façade.
|
|
15
|
+
</desc>
|
|
16
|
+
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
17
|
+
<mask id="mask-2" fill="white">
|
|
18
|
+
<path
|
|
19
|
+
d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z"
|
|
20
|
+
id="path-1"
|
|
21
|
+
></path>
|
|
22
|
+
</mask>
|
|
23
|
+
<use fill="#FFFFFF" xlink:href="#path-1"></use>
|
|
24
|
+
<g mask="url(#mask-2)" fill="#FFFFFF">
|
|
25
|
+
<path
|
|
26
|
+
d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z"
|
|
27
|
+
id="swatch"
|
|
28
|
+
></path>
|
|
29
|
+
</g>
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
32
|
+
`;
|