@teipublisher/pb-components 2.10.6 → 2.10.7
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 +7 -0
- package/dist/demo/pb-facsimile-2.html +1 -1
- package/dist/es-global-bridge-4240f389.js +5 -0
- package/dist/pb-components-bundle.js +119 -119
- package/dist/pb-elements.json +2 -13
- package/dist/pb-leaflet-map.js +1 -1
- package/package.json +7 -7
- package/pb-elements.json +2 -13
- package/src/pb-facsimile.js +4 -6
- package/src/pb-view.js +6 -3
- package/dist/es-global-bridge-5c039c0b.js +0 -5
package/dist/pb-elements.json
CHANGED
|
@@ -4145,11 +4145,6 @@
|
|
|
4145
4145
|
"type": "number",
|
|
4146
4146
|
"default": "0.2"
|
|
4147
4147
|
},
|
|
4148
|
-
{
|
|
4149
|
-
"name": "src",
|
|
4150
|
-
"type": "string",
|
|
4151
|
-
"default": "\"\""
|
|
4152
|
-
},
|
|
4153
4148
|
{
|
|
4154
4149
|
"name": "prefix-url",
|
|
4155
4150
|
"description": "Path pointing to the location of openseadragon user interface images.",
|
|
@@ -4293,12 +4288,6 @@
|
|
|
4293
4288
|
"type": "number",
|
|
4294
4289
|
"default": "0.2"
|
|
4295
4290
|
},
|
|
4296
|
-
{
|
|
4297
|
-
"name": "src",
|
|
4298
|
-
"attribute": "src",
|
|
4299
|
-
"type": "string",
|
|
4300
|
-
"default": "\"\""
|
|
4301
|
-
},
|
|
4302
4291
|
{
|
|
4303
4292
|
"name": "prefixUrl",
|
|
4304
4293
|
"attribute": "prefix-url",
|
|
@@ -4357,8 +4346,8 @@
|
|
|
4357
4346
|
"description": "When received, resets the facsimile viewer"
|
|
4358
4347
|
},
|
|
4359
4348
|
{
|
|
4360
|
-
"name": "pb-
|
|
4361
|
-
"description": "
|
|
4349
|
+
"name": "pb-load-facsimile",
|
|
4350
|
+
"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."
|
|
4362
4351
|
},
|
|
4363
4352
|
{
|
|
4364
4353
|
"name": "pb-show-annotation",
|
package/dist/pb-leaflet-map.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{L as t,p as e,r as i,h as s,c as a}from"./pb-mixin-d61c06b6.js";import"./es-global-bridge-
|
|
1
|
+
import{L as t,p as e,r as i,h as s,c as a}from"./pb-mixin-d61c06b6.js";import"./es-global-bridge-4240f389.js";const o=["type","url","label","base","show"];class r extends t{static get properties(){return{type:{type:String},url:{type:String},base:{type:Boolean},show:{type:Boolean},label:{type:String},attribution:{type:String},minZoom:{type:Number,attribute:"min-zoom"},maxZoom:{type:Number,attribute:"max-zoom"},zoomOffset:{type:Number,attribute:"zoom-offset"},opacity:{type:Number},tileSize:{type:Number},id:{type:String},accessToken:{type:String,attribute:"access-token"}}}constructor(){super(),this.type="tile",this.url=null}get options(){const t={};return Object.keys(r.properties).forEach(e=>{o.indexOf(e)<0&&this[e]&&(t[e]=this[e])}),console.log("<pb-leaflet-map-layer> Options: %o",t),t}async data(){return new Promise(t=>{fetch(this.url).then(t=>t.json()).then(e=>t(e))})}}function l(t,e){try{return t.split(/\s*,\s*/).map(t=>parseInt(t,10))}catch(e){return console.error("<pb-map-icon> Invalid size specified: "+t),null}}customElements.define("pb-map-layer",r);class n extends t{static get properties(){return{name:{type:String},iconUrl:{type:String,attribute:"icon-url"},iconSize:{type:Array,converter:l,attribute:"icon-size"},iconAnchor:{type:Array,converter:l,attribute:"icon-anchor"},shadowUrl:{type:String,attribute:"shadow-url"},shadowSize:{type:Array,converter:l,attribute:"shadow-size"},shadowAnchor:{type:Array,converter:l,attribute:"shadow-anchor"},popupAncor:{type:Array,converter:l,attribute:"popup-anchor"}}}constructor(){super(),this.name="default",this.type="image",this.iconUrl=null}get options(){const t={};return Object.keys(n.properties).forEach(e=>{this[e]&&(t[e]=this[e])}),console.log("<pb-map-icon> Options: %o",t),t}}customElements.define("pb-map-icon",n);class c extends(e(t)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{latitude:{type:Number},longitude:{type:Number},zoom:{type:Number},crs:{type:String},fitMarkers:{type:Boolean,attribute:"fit-markers"},cluster:{type:Boolean},disableClusteringAt:{type:Number,attribute:"disable-clustering-at"},noScroll:{type:Boolean,attribute:"no-scroll"},accessToken:{type:String,attribute:"access-token"},toggle:{type:Boolean},imagesPath:{type:String,attribute:"images-path"},cssPath:{type:String,attribute:"css-path"},_map:{type:Object}})}constructor(){super(),this.latitude=51.505,this.longitude=-.09,this.zoom=15,this.crs="EPSG3857",this.accessToken="",this.imagesPath="../images/leaflet/",this.cssPath="../css/leaflet",this.toggle=!1,this.noScroll=!1,this.disabled=!0,this.cluster=!1,this.fitMarkers=!1,this.disableClusteringAt=null,this._icons={}}connectedCallback(){super.connectedCallback(),this._layers=this.querySelectorAll("pb-map-layer"),this._markers=this.querySelectorAll("pb-map-icon"),this.subscribeTo("pb-update-map",t=>{this._markerLayer.clearLayers(),t.detail.forEach(t=>{const e=L.marker([t.latitude,t.longitude]);t.label&&e.bindTooltip(t.label),e.addEventListener("click",()=>{this.emitTo("pb-leaflet-marker-click",t)}),e.bindTooltip(t.label),this.setMarkerIcon(e),this._markerLayer.addLayer(e)}),this._fitBounds()}),this.subscribeTo("pb-update",t=>{this._markerLayer.clearLayers();t.detail.root.querySelectorAll("pb-geolocation").forEach(t=>{const e=L.latLng(t.latitude,t.longitude),i=L.marker(e).addTo(this._markerLayer);t.label&&i.bindTooltip(t.label),t.popup&&i.bindPopup(t.popup),i.addEventListener("click",()=>{this.emitTo("pb-leaflet-marker-click",t)}),this.setMarkerIcon(i)}),this._fitBounds()}),this.subscribeTo("pb-geolocation",t=>{if(t.detail.coordinates){if(this.latitude=t.detail.coordinates.latitude,this.longitude=t.detail.coordinates.longitude,this._hasMarker(this.latitude,this.longitude))console.log("<pb-leaflet-map> Marker already added to map");else{const e=L.marker([this.latitude,this.longitude]);e.addEventListener("click",()=>{this.emitTo("pb-leaflet-marker-click",t.detail.element)}),t.detail.label&&e.bindTooltip(t.detail.label),t.detail.popup&&e.bindPopup(t.detail.popup),this.setMarkerIcon(e),e.addTo(this._markerLayer),t.detail.fitBounds&&this._fitBounds(),console.log("<pb-leaflet-map> added marker")}this.toggle&&(this.disabled=!1);const e=t.detail.event;this._locationChanged(this.latitude,this.longitude,t.detail.zoom,e)}})}get map(){return this._map}setMarkerIcon(t){this._icons&&this._icons.default&&t.setIcon(this._icons.default)}firstUpdated(){this.toggle||(this.disabled=!1),window.ESGlobalBridge.requestAvailability();const t=i("../lib/leaflet-src.js"),e=i("../lib/leaflet.markercluster-src.js");window.ESGlobalBridge.instance.load("leaflet",t).then(()=>window.ESGlobalBridge.instance.load("plugin",e)),window.addEventListener("es-bridge-plugin-loaded",this._initMap.bind(this),{once:!0})}render(){const t=i(this.cssPath);return s`
|
|
2
2
|
<link rel="Stylesheet" href="${t}/leaflet.css">
|
|
3
3
|
<link rel="Stylesheet" href="${t}/MarkerCluster.Default.css">
|
|
4
4
|
<div id="map" style="height: 100%; width: 100%"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teipublisher/pb-components",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.7",
|
|
4
4
|
"description": "Collection of webcomponents underlying TEI Publisher",
|
|
5
5
|
"repository": "https://github.com/eeditiones/tei-publisher-components.git",
|
|
6
6
|
"main": "index.html",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@babel/runtime": "7.11.2",
|
|
40
40
|
"@cwmr/paper-autocomplete": "^4.0.0",
|
|
41
41
|
"@jinntec/jinn-codemirror": "^1.13.5",
|
|
42
|
-
"@lrnwebcomponents/es-global-bridge": "^
|
|
42
|
+
"@lrnwebcomponents/es-global-bridge": "^7.0.4",
|
|
43
43
|
"@polymer/app-layout": "^3.1.0",
|
|
44
44
|
"@polymer/iron-ajax": "^3.0.1",
|
|
45
45
|
"@polymer/iron-collapse": "^3.0.1",
|
|
@@ -77,16 +77,16 @@
|
|
|
77
77
|
"i18next-chained-backend": "^2.0.1",
|
|
78
78
|
"i18next-xhr-backend": "^3.2.2",
|
|
79
79
|
"js-cookie": "^2.2.1",
|
|
80
|
-
"leaflet": "^1.
|
|
80
|
+
"leaflet": "^1.9.4",
|
|
81
81
|
"leaflet.markercluster": "^1.5.3",
|
|
82
82
|
"lit-element": "^2.5.1",
|
|
83
83
|
"lit-html": "^1.3.0",
|
|
84
84
|
"marked": "^1.2.0",
|
|
85
|
-
"pagedjs": "^0.4.
|
|
85
|
+
"pagedjs": "^0.4.3",
|
|
86
86
|
"path-to-regexp": "^6.2.1",
|
|
87
|
-
"prismjs": "^1.
|
|
87
|
+
"prismjs": "^1.29.0",
|
|
88
88
|
"tify": "^0.28.1",
|
|
89
|
-
"tippy.js": "^6.
|
|
89
|
+
"tippy.js": "^6.3.7",
|
|
90
90
|
"tom-select": "^2.2.2",
|
|
91
91
|
"uniqolor": "^1.1.0",
|
|
92
92
|
"web-animations-js": "^2.3.2"
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"karma": "^6.4.1",
|
|
110
110
|
"lint-staged": "^10.4.0",
|
|
111
111
|
"recursive-copy": "^2.0.14",
|
|
112
|
-
"rimraf": "^
|
|
112
|
+
"rimraf": "^5.0.1",
|
|
113
113
|
"rollup": "^1.21.0",
|
|
114
114
|
"rollup-plugin-analyzer": "^3.2.3",
|
|
115
115
|
"rollup-plugin-babel": "^4.4.0",
|
package/pb-elements.json
CHANGED
|
@@ -4145,11 +4145,6 @@
|
|
|
4145
4145
|
"type": "number",
|
|
4146
4146
|
"default": "0.2"
|
|
4147
4147
|
},
|
|
4148
|
-
{
|
|
4149
|
-
"name": "src",
|
|
4150
|
-
"type": "string",
|
|
4151
|
-
"default": "\"\""
|
|
4152
|
-
},
|
|
4153
4148
|
{
|
|
4154
4149
|
"name": "prefix-url",
|
|
4155
4150
|
"description": "Path pointing to the location of openseadragon user interface images.",
|
|
@@ -4293,12 +4288,6 @@
|
|
|
4293
4288
|
"type": "number",
|
|
4294
4289
|
"default": "0.2"
|
|
4295
4290
|
},
|
|
4296
|
-
{
|
|
4297
|
-
"name": "src",
|
|
4298
|
-
"attribute": "src",
|
|
4299
|
-
"type": "string",
|
|
4300
|
-
"default": "\"\""
|
|
4301
|
-
},
|
|
4302
4291
|
{
|
|
4303
4292
|
"name": "prefixUrl",
|
|
4304
4293
|
"attribute": "prefix-url",
|
|
@@ -4357,8 +4346,8 @@
|
|
|
4357
4346
|
"description": "When received, resets the facsimile viewer"
|
|
4358
4347
|
},
|
|
4359
4348
|
{
|
|
4360
|
-
"name": "pb-
|
|
4361
|
-
"description": "
|
|
4349
|
+
"name": "pb-load-facsimile",
|
|
4350
|
+
"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."
|
|
4362
4351
|
},
|
|
4363
4352
|
{
|
|
4364
4353
|
"name": "pb-show-annotation",
|
package/src/pb-facsimile.js
CHANGED
|
@@ -7,7 +7,10 @@ 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-
|
|
10
|
+
* @fires pb-load-facsimile - When received, adds an image to the current image sequence. Emitted by
|
|
11
|
+
* `pb-facs-link`. The event detail should contain an object with the properties `url`, `order` and `element`,
|
|
12
|
+
* where `url` is the relative or absolute URL to the image, `order` is an integer specifying the position at which
|
|
13
|
+
* the image should be inserted in the list, and `element` points to the `pb-facs-link` element triggering the event.
|
|
11
14
|
* @fires pb-show-annotation - When received, sets up the viewer to select a particular image and highlight coordinates
|
|
12
15
|
* @fires pb-facsimile-status - Indicates the status of loading an image into the viewer. The status is indicated
|
|
13
16
|
* by the `status` property in event.detail as follows: `loading` - image was requested; `loaded` - image is displayed;
|
|
@@ -24,10 +27,6 @@ export class PbFacsimile extends pbMixin(LitElement) {
|
|
|
24
27
|
static get properties() {
|
|
25
28
|
return {
|
|
26
29
|
...super.properties,
|
|
27
|
-
// Image source
|
|
28
|
-
src: {
|
|
29
|
-
type: String
|
|
30
|
-
},
|
|
31
30
|
/**
|
|
32
31
|
* Set to false to prevent the appearance of the default navigation controls.
|
|
33
32
|
* Note that if set to false, the customs buttons set by the options
|
|
@@ -159,7 +158,6 @@ export class PbFacsimile extends pbMixin(LitElement) {
|
|
|
159
158
|
this.constrainDuringPan = false;
|
|
160
159
|
this.referenceStrip = false;
|
|
161
160
|
this.referenceStripSizeRatio = 0.2;
|
|
162
|
-
this.src = '';
|
|
163
161
|
this.prefixUrl = '../images/openseadragon/';
|
|
164
162
|
this.loaded = false;
|
|
165
163
|
}
|
package/src/pb-view.js
CHANGED
|
@@ -575,6 +575,8 @@ export class PbView extends themableMixin(pbMixin(LitElement)) {
|
|
|
575
575
|
}
|
|
576
576
|
if (ev.detail.id) {
|
|
577
577
|
this.xmlId = ev.detail.id;
|
|
578
|
+
} else if (ev.detail.id == null) {
|
|
579
|
+
this.xmlId = null;
|
|
578
580
|
}
|
|
579
581
|
this.odd = ev.detail.odd || this.odd;
|
|
580
582
|
if (ev.detail.columnSeparator !== undefined) {
|
|
@@ -783,7 +785,6 @@ export class PbView extends themableMixin(pbMixin(LitElement)) {
|
|
|
783
785
|
this.previousId = resp.previousId;
|
|
784
786
|
this.nodeId = resp.root;
|
|
785
787
|
this.switchView = resp.switchView;
|
|
786
|
-
this.xmlId = null;
|
|
787
788
|
|
|
788
789
|
this.updateComplete.then(() => {
|
|
789
790
|
const view = this.shadowRoot.getElementById('view');
|
|
@@ -1102,7 +1103,8 @@ export class PbView extends themableMixin(pbMixin(LitElement)) {
|
|
|
1102
1103
|
root: this.previousId ? null : this.previous
|
|
1103
1104
|
});
|
|
1104
1105
|
}
|
|
1105
|
-
this.
|
|
1106
|
+
this.xmlId = this.previousId;
|
|
1107
|
+
this._load(this.xmlId ? null : this.previous, direction);
|
|
1106
1108
|
}
|
|
1107
1109
|
} else if (this.next) {
|
|
1108
1110
|
if (!this.disableHistory && !this.map) {
|
|
@@ -1111,7 +1113,8 @@ export class PbView extends themableMixin(pbMixin(LitElement)) {
|
|
|
1111
1113
|
root: this.nextId ? null : this.next
|
|
1112
1114
|
});
|
|
1113
1115
|
}
|
|
1114
|
-
this.
|
|
1116
|
+
this.xmlId = this.nextId;
|
|
1117
|
+
this._load(this.xmlId ? null : this.next, direction);
|
|
1115
1118
|
}
|
|
1116
1119
|
}
|
|
1117
1120
|
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2018 The Pennsylvania State University
|
|
3
|
-
* @license Apache-2.0, see License.md for full text.
|
|
4
|
-
*/
|
|
5
|
-
class o{constructor(){this.load=(o,i,e=!1)=>{let l=window.ESGlobalBridge.imports&&window.ESGlobalBridge.imports[o];if(!(!e&&window.ESGlobalBridge.webpack&&window.ESGlobalBridge.webpack[o])&&!l)return new Promise((e,l)=>{const d=document.createElement("script");d.src=i,d.setAttribute("data-name",o),window.ESGlobalBridge.imports[o]=i,d.onload=()=>{e(window.ESGlobalBridge.imports[o]),window.ESGlobalBridge.imports[o]=!0,setTimeout(()=>{const e=new CustomEvent(`es-bridge-${o}-loaded`,{bubbles:!0,cancelable:!0,detail:{name:o,location:i}});document.dispatchEvent(e)},100)},d.onerror=()=>{l(new Error(`Failed to load ${o} script with location ${i}.`)),delete window.ESGlobalBridge.imports[o],window.ESGlobalBridge.imports[o]=!1},document.documentElement.appendChild(d)})}}}window.ESGlobalBridge=window.ESGlobalBridge||{},window.ESGlobalBridge.imports=window.ESGlobalBridge.imports||{},window.ESGlobalBridge.requestAvailability=()=>(window.ESGlobalBridge.instance||(window.ESGlobalBridge.instance=new o),window.ESGlobalBridge);window.ESGlobalBridge.requestAvailability();
|