@teipublisher/pb-components 2.19.1 → 2.19.3
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/CHANGELOG.md +14 -0
- package/dist/pb-components-bundle.js +2 -2
- package/dist/pb-elements.json +1 -1
- package/dist/pb-tify.js +1 -1
- package/lib/openseadragon.min.js +75 -4
- package/lib/read-me-osd.md +12 -0
- package/package.json +1 -1
- package/pb-elements.json +1 -1
- package/src/pb-facsimile.js +7 -9
- package/src/pb-tify.js +5 -5
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## Openseadragon
|
|
2
|
+
|
|
3
|
+
We are using our own patched version of OSD from https://github.com/Jinntec/openseadragon
|
|
4
|
+
|
|
5
|
+
Reason:
|
|
6
|
+
OSD removes all body children when going to fullscreen. This creates issues with `<pb-page>` also be gone so display is empty after existing full-screen.
|
|
7
|
+
|
|
8
|
+
Fork is up-to-date with upstream OSD 4.1.1
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
package/package.json
CHANGED
package/pb-elements.json
CHANGED
|
@@ -4415,7 +4415,7 @@
|
|
|
4415
4415
|
},
|
|
4416
4416
|
{
|
|
4417
4417
|
"name": "pb-load-facsimile",
|
|
4418
|
-
"description": "When received, adds an image to the current image sequence. Emitted by
|
|
4418
|
+
"description": "When received, adds an image to the current image sequence. Emitted by\n`pb-facs-link`. The event detail should contain an object with the properties `url`, `order` and `element`,\nwhere `url` is the relative or absolute URL to the image, `order` is an integer specifying the position at which\nthe image should be inserted in the list, and `element` points to the `pb-facs-link` element triggering the event."
|
|
4419
4419
|
},
|
|
4420
4420
|
{
|
|
4421
4421
|
"name": "pb-show-annotation",
|
package/src/pb-facsimile.js
CHANGED
|
@@ -7,7 +7,7 @@ import { resolveURL } from './utils.js';
|
|
|
7
7
|
* View zoomable images using a IIIF server.
|
|
8
8
|
*
|
|
9
9
|
* @fires pb-start-update - When received, resets the facsimile viewer
|
|
10
|
-
* @fires pb-load-facsimile - When received, adds an image to the current image sequence. Emitted by
|
|
10
|
+
* @fires pb-load-facsimile - When received, adds an image to the current image sequence. Emitted by
|
|
11
11
|
* `pb-facs-link`. The event detail should contain an object with the properties `url`, `order` and `element`,
|
|
12
12
|
* where `url` is the relative or absolute URL to the image, `order` is an integer specifying the position at which
|
|
13
13
|
* the image should be inserted in the list, and `element` points to the `pb-facs-link` element triggering the event.
|
|
@@ -41,7 +41,7 @@ export class PbFacsimile extends pbMixin(LitElement) {
|
|
|
41
41
|
type: Boolean,
|
|
42
42
|
attribute: 'show-navigator'
|
|
43
43
|
},
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
/** If true then the 'previous" and 'next' button is displayed switch between images. */
|
|
46
46
|
showSequenceMode: {
|
|
47
47
|
type: Boolean,
|
|
@@ -173,16 +173,16 @@ export class PbFacsimile extends pbMixin(LitElement) {
|
|
|
173
173
|
this.subscribeTo('pb-start-update', this._clearAll.bind(this));
|
|
174
174
|
this.subscribeTo('pb-load-facsimile', (e) => {
|
|
175
175
|
const { element, order } = e.detail
|
|
176
|
-
const itemOrder = this._facsimiles.map(item => item.getOrder ? item.getOrder() : Number.POSITIVE_INFINITY )
|
|
176
|
+
const itemOrder = this._facsimiles.map(item => item.getOrder ? item.getOrder() : Number.POSITIVE_INFINITY )
|
|
177
177
|
const insertAt = itemOrder.reduce((result, next, index) => {
|
|
178
178
|
if (order < next) return result;
|
|
179
179
|
if (order === next) return index;
|
|
180
180
|
return index + 1;
|
|
181
181
|
}, 0)
|
|
182
|
-
|
|
182
|
+
|
|
183
183
|
this._facsimiles.splice(insertAt, 0, element)
|
|
184
184
|
this.loaded = this._facsimiles.length > 0;
|
|
185
|
-
|
|
185
|
+
|
|
186
186
|
this._facsimileObserver()
|
|
187
187
|
});
|
|
188
188
|
this.subscribeTo('pb-show-annotation', this._showAnnotationListener.bind(this));
|
|
@@ -236,7 +236,7 @@ export class PbFacsimile extends pbMixin(LitElement) {
|
|
|
236
236
|
const options = {
|
|
237
237
|
element: this.shadowRoot.getElementById('viewer'),
|
|
238
238
|
prefixUrl,
|
|
239
|
-
preserveViewport: true,
|
|
239
|
+
preserveViewport: true,
|
|
240
240
|
showZoomControl: true,
|
|
241
241
|
sequenceMode: this.showSequenceMode,
|
|
242
242
|
showHomeControl: this.showHomeControl,
|
|
@@ -271,10 +271,8 @@ export class PbFacsimile extends pbMixin(LitElement) {
|
|
|
271
271
|
to full-page functionality. Standard OSD completely deletes all body children disconnecting all event-handlers
|
|
272
272
|
that have been there. This solution just uses style.display to hide/show. Former display value of pb-page
|
|
273
273
|
will be preserved.
|
|
274
|
-
|
|
275
|
-
Current limitation: this solution assumes that a pb-page element exists and is an immediate child of body.
|
|
276
274
|
*/
|
|
277
|
-
this.ownerPage =
|
|
275
|
+
this.ownerPage = document.querySelector('pb-page');
|
|
278
276
|
if(this.ownerPage){
|
|
279
277
|
this.pbPageDisplay = window.getComputedStyle(this.ownerPage).getPropertyValue('display');
|
|
280
278
|
this.viewer.addHandler('full-screen', (ev) => {
|
package/src/pb-tify.js
CHANGED
|
@@ -59,6 +59,11 @@ export class PbTify extends pbMixin(LitElement) {
|
|
|
59
59
|
|
|
60
60
|
_injectStylesheet(this.cssPath);
|
|
61
61
|
|
|
62
|
+
this._container = document.createElement('div');
|
|
63
|
+
this._container.style.height = '100%';
|
|
64
|
+
this._container.style.width = '100%';
|
|
65
|
+
this.appendChild(this._container);
|
|
66
|
+
|
|
62
67
|
this.subscribeTo('pb-show-annotation', (ev) => {
|
|
63
68
|
if (ev.detail) {
|
|
64
69
|
this._initialPages = ev.detail.order ? Number(ev.detail.order) : Number.POSITIVE_INFINITY;
|
|
@@ -81,11 +86,6 @@ export class PbTify extends pbMixin(LitElement) {
|
|
|
81
86
|
super.firstUpdated();
|
|
82
87
|
|
|
83
88
|
waitOnce('pb-page-ready', () => {
|
|
84
|
-
this._container = document.createElement('div');
|
|
85
|
-
this._container.style.height = '100%';
|
|
86
|
-
this._container.style.width = '100%';
|
|
87
|
-
this.appendChild(this._container);
|
|
88
|
-
|
|
89
89
|
this._initViewer();
|
|
90
90
|
});
|
|
91
91
|
}
|