@internetarchive/bookreader 5.0.0-47 → 5.0.0-47-alpha3

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/bookreader",
3
- "version": "5.0.0-47",
3
+ "version": "5.0.0-47-alpha3",
4
4
  "description": "The Internet Archive BookReader.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -47,11 +47,11 @@
47
47
  "@babel/plugin-proposal-decorators": "7.17.9",
48
48
  "@babel/preset-env": "7.16.11",
49
49
  "@open-wc/testing-helpers": "^2.1.3",
50
- "@types/jest": "^29.0.3",
50
+ "@types/jest": "^29.1.1",
51
51
  "@webcomponents/webcomponentsjs": "^2.6.0",
52
52
  "babel-loader": "8.2.5",
53
53
  "codecov": "^3.8.3",
54
- "concurrently": "7.2.2",
54
+ "concurrently": "7.4.0",
55
55
  "core-js": "3.22.3",
56
56
  "cpx2": "4.2.0",
57
57
  "eslint": "^7.32.0",
@@ -60,8 +60,8 @@
60
60
  "hammerjs": "^2.0.8",
61
61
  "http-server": "14.1.1",
62
62
  "iso-language-codes": "1.1.0",
63
- "jest": "^29.0.3",
64
- "jest-environment-jsdom": "^29.0.3",
63
+ "jest": "^29.1.2",
64
+ "jest-environment-jsdom": "^29.1.2",
65
65
  "jquery": "3.6.1",
66
66
  "jquery-colorbox": "1.6.4",
67
67
  "jquery-ui": "1.12.1",
@@ -137,7 +137,8 @@ class IABookmarks extends LitElement {
137
137
  }
138
138
 
139
139
  setup() {
140
- this.api.identifier = this.bookreader.bookId;
140
+ console.log(this.bookreader)
141
+ this.api.identifier = this.getIdentifier();
141
142
  if (this.displayMode === 'login') {
142
143
  return;
143
144
  }
@@ -145,6 +146,19 @@ class IABookmarks extends LitElement {
145
146
  this.setBREventListeners();
146
147
  }
147
148
 
149
+ /**
150
+ * get identifier for current book including sub-files
151
+ *
152
+ * @returns Identifer
153
+ */
154
+ getIdentifier() {
155
+ if (this.bookreader.bookId !== this.bookreader.subPrefix) {
156
+ return `${this.bookreader.bookId}/${this.bookreader.subPrefix}`;
157
+ }
158
+
159
+ return this.bookreader.bookId;
160
+ }
161
+
148
162
  updateDisplay() {
149
163
  if (this.displayMode === 'bookmarks') {
150
164
  this.fetchUserBookmarks();