@teipublisher/pb-components 1.32.1 → 1.34.0

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.
@@ -1328,6 +1328,12 @@
1328
1328
  "type": "string",
1329
1329
  "default": "\"title\""
1330
1330
  },
1331
+ {
1332
+ "name": "static",
1333
+ "description": "If set, rewrite URLs to load pages as static HTML files,\nso no TEI Publisher instance is required",
1334
+ "type": "boolean",
1335
+ "default": "false"
1336
+ },
1331
1337
  {
1332
1338
  "name": "url",
1333
1339
  "description": "The URL for the AJAX request. If a relative URL is passed, it will be resolved\nagainst the current API endpoint.",
@@ -1497,6 +1503,13 @@
1497
1503
  "type": "string",
1498
1504
  "default": "\"title\""
1499
1505
  },
1506
+ {
1507
+ "name": "static",
1508
+ "attribute": "static",
1509
+ "description": "If set, rewrite URLs to load pages as static HTML files,\nso no TEI Publisher instance is required",
1510
+ "type": "boolean",
1511
+ "default": "false"
1512
+ },
1500
1513
  {
1501
1514
  "name": "url",
1502
1515
  "attribute": "url",
@@ -4605,6 +4618,11 @@
4605
4618
  "type": "boolean",
4606
4619
  "default": "false"
4607
4620
  },
4621
+ {
4622
+ "name": "disable-clustering-at",
4623
+ "description": "Limits up to which zoom level markers are arranged into clusters.\nUsing a higher zoom level here will result in more markers to be shown.\n\nRequires `cluster` option to be enabled.",
4624
+ "type": "number"
4625
+ },
4608
4626
  {
4609
4627
  "name": "subscribe",
4610
4628
  "description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
@@ -4708,6 +4726,12 @@
4708
4726
  "type": "boolean",
4709
4727
  "default": "false"
4710
4728
  },
4729
+ {
4730
+ "name": "disableClusteringAt",
4731
+ "attribute": "disable-clustering-at",
4732
+ "description": "Limits up to which zoom level markers are arranged into clusters.\nUsing a higher zoom level here will result in more markers to be shown.\n\nRequires `cluster` option to be enabled.",
4733
+ "type": "number"
4734
+ },
4711
4735
  {
4712
4736
  "name": "subscribe",
4713
4737
  "attribute": "subscribe",
@@ -4753,15 +4777,15 @@
4753
4777
  },
4754
4778
  {
4755
4779
  "name": "pb-update-map",
4756
- "description": "When received, redraws the map to fit markers passed in with the event"
4780
+ "description": "When received, redraws the map to fit markers passed in with the event.\nEvent details should include an array of locations, see `pb-geolocation` event below."
4757
4781
  },
4758
4782
  {
4759
4783
  "name": "pb-update",
4760
- "description": "When received, redraws the map to show markers for all pb-geolocation elements"
4784
+ "description": "When received, redraws the map to show markers for all pb-geolocation elements found in the content of the pb-view"
4761
4785
  },
4762
4786
  {
4763
4787
  "name": "pb-geolocation",
4764
- "description": "When received, focuses the map on the geocoordinates passed in with the event"
4788
+ "description": "When received, focuses the map on the geocoordinates passed in with the event.\nThe event details should include an object:\n```\n{\ncoordinates: {\n latitude: Number,\n longitude: Number\n},\nlabel: string - the label to show on mouseover,\nzoom: Number - fixed zoom level to zoom to,\nfitBounds: Boolean - if true, recompute current zoom level to show all markers\n}\n```"
4765
4789
  }
4766
4790
  ],
4767
4791
  "slots": [
@@ -9460,6 +9484,254 @@
9460
9484
  }
9461
9485
  ]
9462
9486
  },
9487
+ {
9488
+ "name": "pb-timeline",
9489
+ "path": "./src/pb-timeline.js",
9490
+ "description": "A timeline component to display time series data in a bar chart like view.\n\nTime series data can be displayed in one of 6 different scales:\n\n- by decade (10Y)\n- by 5 years (5Y)\n- by years (Y)\n- by month (M)\n- by week (W)\n- by day (D)\n\nThe endpoint is expected to return a JSON object. Each property should either be a date or the special\nmarker `?`, which indicates undated resources.\nThe value associated with each entry\nshould either correspond to a count of resources or an object with properties `count` and `info`. \n`info` should be an array, containing HTML to be shown in a list within the tooltips.",
9491
+ "attributes": [
9492
+ {
9493
+ "name": "start-date",
9494
+ "description": "start date for timeline to display",
9495
+ "type": "string",
9496
+ "default": "\"\""
9497
+ },
9498
+ {
9499
+ "name": "end-date",
9500
+ "description": "endDate for timeline to display",
9501
+ "type": "string",
9502
+ "default": "\"\""
9503
+ },
9504
+ {
9505
+ "name": "scope",
9506
+ "description": "The scope for the timeline. Must be one of the pre-defined scopes.\nIf not set, the component automatically tries to determine the best scope fitting the\ngiven time series.",
9507
+ "type": "string",
9508
+ "default": "\"\""
9509
+ },
9510
+ {
9511
+ "name": "scopes",
9512
+ "description": "The scopes to consider for automatic scoping.\n\nDefaults to [\"D\", \"W\", \"M\", \"Y\", \"5Y\", \"10Y\"]",
9513
+ "type": "array",
9514
+ "default": "[\"D\",\"W\",\"M\",\"Y\",\"5Y\",\"10Y\"]"
9515
+ },
9516
+ {
9517
+ "name": "url",
9518
+ "description": "Endpoint to load timeline data from. Expects response to be an\nobject with key value pairs for (date, hits).\n\nWill be reloaded whenever 'start-date' or 'end-date' attributes change.",
9519
+ "type": "string",
9520
+ "default": "\"\""
9521
+ },
9522
+ {
9523
+ "name": "auto",
9524
+ "description": "If set, data will be retrieved automatically on first load.",
9525
+ "type": "boolean",
9526
+ "default": "false"
9527
+ },
9528
+ {
9529
+ "name": "resettable",
9530
+ "type": "boolean",
9531
+ "default": "false"
9532
+ },
9533
+ {
9534
+ "name": "subscribe",
9535
+ "description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
9536
+ "type": "string"
9537
+ },
9538
+ {
9539
+ "name": "subscribe-config",
9540
+ "description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to listen to.",
9541
+ "type": "object"
9542
+ },
9543
+ {
9544
+ "name": "emit",
9545
+ "description": "The name of the channel to send events to.",
9546
+ "type": "string"
9547
+ },
9548
+ {
9549
+ "name": "emit-config",
9550
+ "description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to be dispatched.",
9551
+ "type": "object"
9552
+ },
9553
+ {
9554
+ "name": "wait-for",
9555
+ "description": "A selector pointing to other components this component depends on.\nWhen method `wait` is called, it will wait until all referenced\ncomponents signal with a `pb-ready` event that they are ready and listening\nto events.",
9556
+ "type": "string"
9557
+ },
9558
+ {
9559
+ "name": "disabled",
9560
+ "description": "Common property to disable the functionality associated with a component.\n`pb-highlight` and `pb-popover` react to this.",
9561
+ "type": "boolean",
9562
+ "default": "false"
9563
+ }
9564
+ ],
9565
+ "properties": [
9566
+ {
9567
+ "name": "label"
9568
+ },
9569
+ {
9570
+ "name": "maxHeight",
9571
+ "type": "number",
9572
+ "default": "80"
9573
+ },
9574
+ {
9575
+ "name": "multiplier",
9576
+ "type": "number",
9577
+ "default": "0.75"
9578
+ },
9579
+ {
9580
+ "name": "mousedown",
9581
+ "type": "boolean",
9582
+ "default": "false"
9583
+ },
9584
+ {
9585
+ "name": "startDate",
9586
+ "attribute": "start-date",
9587
+ "description": "start date for timeline to display",
9588
+ "type": "string",
9589
+ "default": "\"\""
9590
+ },
9591
+ {
9592
+ "name": "endDate",
9593
+ "attribute": "end-date",
9594
+ "description": "endDate for timeline to display",
9595
+ "type": "string",
9596
+ "default": "\"\""
9597
+ },
9598
+ {
9599
+ "name": "scope",
9600
+ "attribute": "scope",
9601
+ "description": "The scope for the timeline. Must be one of the pre-defined scopes.\nIf not set, the component automatically tries to determine the best scope fitting the\ngiven time series.",
9602
+ "type": "string",
9603
+ "default": "\"\""
9604
+ },
9605
+ {
9606
+ "name": "scopes",
9607
+ "attribute": "scopes",
9608
+ "description": "The scopes to consider for automatic scoping.\n\nDefaults to [\"D\", \"W\", \"M\", \"Y\", \"5Y\", \"10Y\"]",
9609
+ "type": "array",
9610
+ "default": "[\"D\",\"W\",\"M\",\"Y\",\"5Y\",\"10Y\"]"
9611
+ },
9612
+ {
9613
+ "name": "url",
9614
+ "attribute": "url",
9615
+ "description": "Endpoint to load timeline data from. Expects response to be an\nobject with key value pairs for (date, hits).\n\nWill be reloaded whenever 'start-date' or 'end-date' attributes change.",
9616
+ "type": "string",
9617
+ "default": "\"\""
9618
+ },
9619
+ {
9620
+ "name": "auto",
9621
+ "attribute": "auto",
9622
+ "description": "If set, data will be retrieved automatically on first load.",
9623
+ "type": "boolean",
9624
+ "default": "false"
9625
+ },
9626
+ {
9627
+ "name": "resettable",
9628
+ "attribute": "resettable",
9629
+ "type": "boolean",
9630
+ "default": "false"
9631
+ },
9632
+ {
9633
+ "name": "subscribe",
9634
+ "attribute": "subscribe",
9635
+ "description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
9636
+ "type": "string"
9637
+ },
9638
+ {
9639
+ "name": "subscribeConfig",
9640
+ "attribute": "subscribe-config",
9641
+ "description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to listen to.",
9642
+ "type": "object"
9643
+ },
9644
+ {
9645
+ "name": "emit",
9646
+ "attribute": "emit",
9647
+ "description": "The name of the channel to send events to.",
9648
+ "type": "string"
9649
+ },
9650
+ {
9651
+ "name": "emitConfig",
9652
+ "attribute": "emit-config",
9653
+ "description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to be dispatched.",
9654
+ "type": "object"
9655
+ },
9656
+ {
9657
+ "name": "waitFor",
9658
+ "attribute": "wait-for",
9659
+ "description": "A selector pointing to other components this component depends on.\nWhen method `wait` is called, it will wait until all referenced\ncomponents signal with a `pb-ready` event that they are ready and listening\nto events.",
9660
+ "type": "string"
9661
+ },
9662
+ {
9663
+ "name": "disabled",
9664
+ "attribute": "disabled",
9665
+ "description": "Common property to disable the functionality associated with a component.\n`pb-highlight` and `pb-popover` react to this.",
9666
+ "type": "boolean",
9667
+ "default": "false"
9668
+ }
9669
+ ],
9670
+ "events": [
9671
+ {
9672
+ "name": "pb-timeline-date-changed",
9673
+ "description": "Triggered when user clicks on a single entry"
9674
+ },
9675
+ {
9676
+ "name": "pb-timeline-daterange-changed",
9677
+ "description": "Triggered when user selects a range of entries"
9678
+ },
9679
+ {
9680
+ "name": "pb-timeline-reset-selection",
9681
+ "description": "Requests that the timeline is reset to initial state"
9682
+ },
9683
+ {
9684
+ "name": "pb-timeline-loaded",
9685
+ "description": "Timeline was loaded"
9686
+ }
9687
+ ],
9688
+ "slots": [
9689
+ {
9690
+ "name": "label",
9691
+ "description": "Inserted before the label showing the currently displayed time range"
9692
+ }
9693
+ ],
9694
+ "cssProperties": [
9695
+ {
9696
+ "name": "--pb-timeline-height"
9697
+ },
9698
+ {
9699
+ "name": "--pb-timeline-padding"
9700
+ },
9701
+ {
9702
+ "name": "--pb-timeline-color-highlight"
9703
+ },
9704
+ {
9705
+ "name": "--pb-timeline-color-light"
9706
+ },
9707
+ {
9708
+ "name": "--pb-timeline-color-dark"
9709
+ },
9710
+ {
9711
+ "name": "--pb-timeline-color-selected"
9712
+ },
9713
+ {
9714
+ "name": "--pb-timeline-color-bin"
9715
+ },
9716
+ {
9717
+ "name": "--pb-timeline-title-font-size"
9718
+ },
9719
+ {
9720
+ "name": "--pb-timeline-tooltip-font-size"
9721
+ }
9722
+ ],
9723
+ "cssParts": [
9724
+ {
9725
+ "name": "label"
9726
+ },
9727
+ {
9728
+ "name": "tooltip"
9729
+ },
9730
+ {
9731
+ "name": "title"
9732
+ }
9733
+ ]
9734
+ },
9463
9735
  {
9464
9736
  "name": "pb-toggle-feature",
9465
9737
  "path": "./src/pb-toggle-feature.js",
@@ -9950,6 +10222,12 @@
9950
10222
  "description": "If set to the name of an event, the content of the pb-view will not be replaced\nimmediately upon updates. Instead, an event is emitted, which contains the new content\nin property `root`. An event handler intercepting the event can thus modify the content.\nOnce it is done, it should pass the modified content to the callback function provided\nin the event detail under the name `render`. See the demo for an example.",
9951
10223
  "type": "string"
9952
10224
  },
10225
+ {
10226
+ "name": "static",
10227
+ "description": "If set, rewrite URLs to load pages as static HTML files,\nso no TEI Publisher instance is required. Use this in combination with\n[tei-publisher-static](https://github.com/eeditiones/tei-publisher-static).",
10228
+ "type": "boolean",
10229
+ "default": "false"
10230
+ },
9953
10231
  {
9954
10232
  "name": "subscribe",
9955
10233
  "description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
@@ -10145,6 +10423,13 @@
10145
10423
  "description": "If set to the name of an event, the content of the pb-view will not be replaced\nimmediately upon updates. Instead, an event is emitted, which contains the new content\nin property `root`. An event handler intercepting the event can thus modify the content.\nOnce it is done, it should pass the modified content to the callback function provided\nin the event detail under the name `render`. See the demo for an example.",
10146
10424
  "type": "string"
10147
10425
  },
10426
+ {
10427
+ "name": "static",
10428
+ "attribute": "static",
10429
+ "description": "If set, rewrite URLs to load pages as static HTML files,\nso no TEI Publisher instance is required. Use this in combination with\n[tei-publisher-static](https://github.com/eeditiones/tei-publisher-static).",
10430
+ "type": "boolean",
10431
+ "default": "false"
10432
+ },
10148
10433
  {
10149
10434
  "name": "subscribe",
10150
10435
  "attribute": "subscribe",
@@ -10401,6 +10686,12 @@
10401
10686
  "description": "If set to the name of an event, the content of the pb-view will not be replaced\nimmediately upon updates. Instead, an event is emitted, which contains the new content\nin property `root`. An event handler intercepting the event can thus modify the content.\nOnce it is done, it should pass the modified content to the callback function provided\nin the event detail under the name `render`. See the demo for an example.",
10402
10687
  "type": "string"
10403
10688
  },
10689
+ {
10690
+ "name": "static",
10691
+ "description": "If set, rewrite URLs to load pages as static HTML files,\nso no TEI Publisher instance is required. Use this in combination with\n[tei-publisher-static](https://github.com/eeditiones/tei-publisher-static).",
10692
+ "type": "boolean",
10693
+ "default": "false"
10694
+ },
10404
10695
  {
10405
10696
  "name": "subscribe",
10406
10697
  "description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
@@ -10579,6 +10870,13 @@
10579
10870
  "description": "If set to the name of an event, the content of the pb-view will not be replaced\nimmediately upon updates. Instead, an event is emitted, which contains the new content\nin property `root`. An event handler intercepting the event can thus modify the content.\nOnce it is done, it should pass the modified content to the callback function provided\nin the event detail under the name `render`. See the demo for an example.",
10580
10871
  "type": "string"
10581
10872
  },
10873
+ {
10874
+ "name": "static",
10875
+ "attribute": "static",
10876
+ "description": "If set, rewrite URLs to load pages as static HTML files,\nso no TEI Publisher instance is required. Use this in combination with\n[tei-publisher-static](https://github.com/eeditiones/tei-publisher-static).",
10877
+ "type": "boolean",
10878
+ "default": "false"
10879
+ },
10582
10880
  {
10583
10881
  "name": "subscribe",
10584
10882
  "attribute": "subscribe",
@@ -1,4 +1,4 @@
1
- import{L as t,p as e,r as a,h as i,c as s}from"./pb-mixin-ae9e2885.js";import"./es-global-bridge-6abe3a88.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))})}}customElements.define("pb-map-layer",r);class l 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},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}connectedCallback(){super.connectedCallback(),this._layers=this.querySelectorAll("pb-map-layer"),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._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),a=L.marker(e).addTo(this._markerLayer);t.label&&a.bindTooltip(t.label),t.popup&&a.bindPopup(t.popup),a.addEventListener("click",()=>{this.emitTo("pb-leaflet-marker-click",t)})}),this._fitBounds()}),this.subscribeTo("pb-geolocation",t=>{if(t.detail.coordinates){if(this.latitude=t.detail.coordinates.latitude,this.longitude=t.detail.coordinates.longitude,t.detail.zoom&&(this.zoom=t.detail.zoom),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),e.addTo(this._markerLayer),t.detail.fitBounds&&this._fitBounds(),console.log("<pb-leaflet-map> added marker")}this.toggle&&(this.disabled=!1),this._locationChanged(this.latitude,this.longitude,this.zoom)}})}firstUpdated(){this.toggle||(this.disabled=!1),window.ESGlobalBridge.requestAvailability();const t=a("../lib/leaflet-src.js"),e=a("../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=a(this.cssPath);return i`
1
+ import{L as t,p as e,r as i,h as a,c as s}from"./pb-mixin-ae9e2885.js";import"./es-global-bridge-6abe3a88.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))})}}customElements.define("pb-map-layer",r);class l 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}connectedCallback(){super.connectedCallback(),this._layers=this.querySelectorAll("pb-map-layer"),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._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._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),e.addTo(this._markerLayer),t.detail.fitBounds&&this._fitBounds(),console.log("<pb-leaflet-map> added marker")}this.toggle&&(this.disabled=!1),this._locationChanged(this.latitude,this.longitude,t.detail.zoom)}})}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 a`
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>
@@ -21,4 +21,4 @@ import{L as t,p as e,r as a,h as i,c as s}from"./pb-mixin-ae9e2885.js";import"./
21
21
  text-decoration: none;
22
22
  cursor: pointer;
23
23
  }
24
- `}_initMap(){if(this._map)return;L.Icon.Default.imagePath=a(this.imagesPath);const t=L.CRS[this.crs]||L.CRS.EPSG3857;if(this._map=L.map(this.shadowRoot.getElementById("map"),{zoom:this.zoom,center:L.latLng(this.latitude,this.longitude),crs:t}),this._configureLayers(),this.cluster?this._markerLayer=L.markerClusterGroup():this._markerLayer=L.layerGroup(),this._markerLayer.addTo(this._map),this.signalReady(),L.control.scale().addTo(this._map),this.toggle){let t;L.Control.CloseButton=L.Control.extend({options:{position:"topright"},onAdd:e=>(t=L.DomUtil.create("div"),t.className="close",t.innerHTML="X",L.DomEvent.on(t,"click",this._hide.bind(this)),t),onRemove:e=>{L.DomEvent.off(t,"click",this._hide.bind(this))}}),L.control.closeButton=t=>new L.Control.CloseButton(t),L.control.closeButton({position:"topright"}).addTo(this._map)}}_configureLayers(){if(0===this._layers.length)return void L.tileLayer("https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token={accessToken}",{attribution:'© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a></strong>',maxZoom:18,zoomOffset:-1,tileSize:512,accessToken:this.accessToken}).addTo(this._map);const t=L.control.layers(null,null,{collapsed:!1});this._layers.forEach(e=>{let a;switch(e.type){case"geojson":e.data().then(i=>{a=L.geoJSON([i]),this._addLayer(e,a,t)});break;default:a=L.tileLayer(e.url,e.options),this._addLayer(e,a,t)}}),this._layers.length>1&&t.addTo(this._map),this._layers=null}_addLayer(t,e,a){t.show&&e.addTo(this._map),t.label&&(t.base?a.addBaseLayer(e,t.label):a.addOverlay(e,t.label))}_fitBounds(){if(!this.fitMarkers)return;const t=L.latLngBounds();let e=0;this._markerLayer.eachLayer(a=>{t.extend(a.getLatLng()),e+=1}),0===e?this._map.fitWorld():1===e?this._map.fitBounds(t,{maxZoom:this.zoom}):this._map.fitBounds(t)}_locationChanged(t,e,a){if(this._map){const i=L.latLng([t,e]);this._markerLayer.eachLayer(t=>{t.getLatLng().equals(i)&&t.openTooltip()}),this.noScroll||this._map.setView(i,a)}}_hasMarker(t,e){const a=L.latLng([t,e]);let i=!1;return this._markerLayer.eachLayer(t=>{t instanceof L.Marker&&t.getLatLng().equals(a)&&(i=!0)}),i}_hide(){this.disabled=!0}}customElements.define("pb-leaflet-map",l);export{l as PbLeafletMap};
24
+ `}_initMap(){if(this._map)return;L.Icon.Default.imagePath=i(this.imagesPath);const t=L.CRS[this.crs]||L.CRS.EPSG3857;if(this._map=L.map(this.shadowRoot.getElementById("map"),{zoom:this.zoom,center:L.latLng(this.latitude,this.longitude),crs:t}),this._configureLayers(),this.cluster){const t={};this.disableClusteringAt&&(t.disableClusteringAtZoom=this.disableClusteringAt),this._markerLayer=L.markerClusterGroup(t)}else this._markerLayer=L.layerGroup();if(this._markerLayer.addTo(this._map),this.signalReady(),L.control.scale().addTo(this._map),this.toggle){let t;L.Control.CloseButton=L.Control.extend({options:{position:"topright"},onAdd:e=>(t=L.DomUtil.create("div"),t.className="close",t.innerHTML="X",L.DomEvent.on(t,"click",this._hide.bind(this)),t),onRemove:e=>{L.DomEvent.off(t,"click",this._hide.bind(this))}}),L.control.closeButton=t=>new L.Control.CloseButton(t),L.control.closeButton({position:"topright"}).addTo(this._map)}}_configureLayers(){if(0===this._layers.length)return void L.tileLayer("https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token={accessToken}",{attribution:'© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a></strong>',maxZoom:18,zoomOffset:-1,tileSize:512,accessToken:this.accessToken}).addTo(this._map);const t=L.control.layers(null,null,{collapsed:!1});this._layers.forEach(e=>{let i;switch(e.type){case"geojson":e.data().then(a=>{i=L.geoJSON([a]),this._addLayer(e,i,t)});break;default:i=L.tileLayer(e.url,e.options),this._addLayer(e,i,t)}}),this._layers.length>1&&t.addTo(this._map),this._layers=null}_addLayer(t,e,i){t.show&&e.addTo(this._map),t.label&&(t.base?i.addBaseLayer(e,t.label):i.addOverlay(e,t.label))}_fitBounds(){if(!this.fitMarkers)return;const t=L.latLngBounds();let e=0;this._markerLayer.eachLayer(i=>{t.extend(i.getLatLng()),e+=1}),0===e?this._map.fitWorld():1===e?this._map.fitBounds(t,{maxZoom:this.zoom}):this._map.fitBounds(t)}_locationChanged(t,e,i){if(this._map){const a=L.latLng([t,e]);this._markerLayer.eachLayer(t=>{t.getLatLng().equals(a)&&(i&&!this.noScroll?(t.openTooltip(),this._map.setView(a,i)):this.cluster?this._markerLayer.zoomToShowLayer(t,()=>t.openTooltip()):(t.openTooltip(),this._map.setView(a,this.zoom)))})}}_hasMarker(t,e){const i=L.latLng([t,e]);let a=!1;return this._markerLayer.eachLayer(t=>{t instanceof L.Marker&&t.getLatLng().equals(i)&&(a=!0)}),a}_hide(){this.disabled=!0}}customElements.define("pb-leaflet-map",l);export{l as PbLeafletMap};
@@ -274,5 +274,9 @@
274
274
  "output": "Trainingsausgabe",
275
275
  "prepare": "Trainingsdaten vorbereiten",
276
276
  "start": "Ausführen"
277
+ },
278
+ "timeline": {
279
+ "unknown": "undatiert",
280
+ "clear": "Zeitraum zurücksetzen"
277
281
  }
278
282
  }
@@ -274,5 +274,9 @@
274
274
  "output": "Training Output",
275
275
  "prepare": "Preparing training data",
276
276
  "start": "Run"
277
+ },
278
+ "timeline": {
279
+ "unknown": "undated",
280
+ "clear": "Clear date selection"
277
281
  }
278
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teipublisher/pb-components",
3
- "version": "1.32.1",
3
+ "version": "1.34.0",
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",