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

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/bookreader",
3
- "version": "5.0.0-47",
3
+ "version": "5.0.0-47-alpha4",
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,7 @@ class IABookmarks extends LitElement {
137
137
  }
138
138
 
139
139
  setup() {
140
- this.api.identifier = this.bookreader.bookId;
140
+ this.api.identifier = this.getIdentifier();
141
141
  if (this.displayMode === 'login') {
142
142
  return;
143
143
  }
@@ -145,6 +145,19 @@ class IABookmarks extends LitElement {
145
145
  this.setBREventListeners();
146
146
  }
147
147
 
148
+ /**
149
+ * get identifier for current book including sub-files
150
+ *
151
+ * @returns Identifer
152
+ */
153
+ getIdentifier() {
154
+ if (this.bookreader.bookId !== this.bookreader.subPrefix) {
155
+ return `${this.bookreader.bookId}/${this.bookreader.subPrefix}`;
156
+ }
157
+
158
+ return this.bookreader.bookId;
159
+ }
160
+
148
161
  updateDisplay() {
149
162
  if (this.displayMode === 'bookmarks') {
150
163
  this.fetchUserBookmarks();