@teipublisher/pb-components 2.25.1 → 2.25.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/.github/workflows/main.yml +3 -3
- package/.github/workflows/node.js.yml +2 -2
- package/.github/workflows/release.js.yml +2 -2
- package/CHANGELOG.md +14 -0
- package/dist/{es-global-bridge-4240f389.js → es-global-bridge-d8ce175d.js} +1 -1
- package/dist/{iron-form-a25b58de.js → iron-form-7b5c5d03.js} +1 -1
- package/dist/jinn-codemirror-da0e2d1f.js +1 -0
- package/dist/{paper-checkbox-c9177e35.js → paper-checkbox-4f410b1f.js} +33 -32
- package/dist/{paper-icon-button-c15eb1cf.js → paper-icon-button-0fb125c4.js} +4 -4
- package/dist/{paper-listbox-1fc346ac.js → paper-listbox-5f42cff5.js} +1 -1
- package/dist/pb-code-editor.js +3 -3
- package/dist/pb-component-docs.js +19 -8
- package/dist/pb-components-bundle.js +94 -94
- package/dist/pb-edit-app.js +5 -5
- package/dist/pb-elements.json +50 -17
- package/dist/{pb-i18n-b62828ba.js → pb-i18n-0611135a.js} +1 -1
- package/dist/pb-leaflet-map.js +1 -1
- package/dist/pb-mei.js +6 -6
- package/dist/pb-odd-editor.js +32 -32
- package/dist/pb-tify.js +3 -3
- package/dist/{vaadin-element-mixin-96dff806.js → vaadin-element-mixin-859a0132.js} +38 -29
- package/package.json +5 -5
- package/pb-elements.json +50 -17
- package/src/pb-authority-lookup.js +29 -1
- package/src/pb-timeline.js +1 -1
- package/dist/jinn-codemirror-63cf45e9.js +0 -1
- /package/dist/{pb-mixin-e1183270.js → pb-mixin-b1caa22e.js} +0 -0
package/dist/pb-edit-app.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{p as e,w as t,h as p,c as o,L as i}from"./pb-mixin-b1caa22e.js";import{t as a}from"./pb-i18n-0611135a.js";import"./paper-listbox-5f42cff5.js";import"./paper-checkbox-4f410b1f.js";import"./iron-form-7b5c5d03.js";class n extends(e(i)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{error:{type:String},url:{type:String},templates:{type:Array},odds:{type:Array}})}constructor(){super(),this.templates=[],this.odds=[]}connectedCallback(){super.connectedCallback()}firstUpdated(){const e=this.shadowRoot.getElementById("form"),p=this.shadowRoot.getElementById("defaultView"),o=this.shadowRoot.getElementById("index"),i=this.shadowRoot.getElementById("template");this.subscribeTo("pb-i18n-update",e=>{const t=this.shadowRoot.querySelector("#defaultView paper-listbox");let p=t.selected;t.selected=void 0,t.selected=p;const o=this.shadowRoot.querySelector("#index paper-listbox");p=o.selected,o.selected=void 0,o.selected=p},[]),t("pb-page-ready",e=>{let t;t=this.minApiVersion("1.0.0")?e.endpoint+"/api/templates":e.endpoint+"/modules/lib/components-list-templates.xql",fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(e=>e.json()).then(e=>{this.templates=e}),t=this.minApiVersion("1.0.0")?e.endpoint+"/api/odd":e.endpoint+"/modules/lib/components-list-odds.xql",fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(e=>e.json()).then(e=>{this.odds=e});const p=this.shadowRoot.querySelector("form");this.minApiVersion("1.0.0")?p.action=e.endpoint+"/api/apps/generate":p.action=e.endpoint+"/modules/components-generate.xql"}),e.addEventListener("iron-form-presubmit",(function(){const e=p.selectedItem.getAttribute("value");this.request.body["default-view"]=e,this.request.body.index=o.selectedItem.getAttribute("value"),this.request.body.template=i.selectedItem.getAttribute("value")})),e.addEventListener("iron-form-response",e=>{console.log(e),e.detail.completes.then(e=>{this.emitTo("pb-end-update");const t=e.parseResponse();if(console.log("<pb-edit-app> Received response: %o",t),t.target){const e=window.location.href.replace(/^(.*)\/tei-publisher\/.*/,"$1");this.url=e+"/"+this.shadowRoot.querySelector("paper-input[name=abbrev]").value,this.error=null}else this.error=t.description;this.shadowRoot.getElementById("dialog").open()})}),e.addEventListener("iron-form-error",e=>{this.emitTo("pb-end-update"),console.log("<pb-edit-app> Received response: %o",e.detail.request.response),this.error=e.detail.request.response.description,this.shadowRoot.getElementById("dialog").open()}),e.addEventListener("iron-form-invalid",()=>this.emitTo("pb-end-update"))}_doSubmit(){this.emitTo("pb-start-update");this.shadowRoot.getElementById("form").submit()}render(){return p`
|
|
2
2
|
<iron-form id="form">
|
|
3
3
|
<form method="POST" accept="application/json" enctype="application/json">
|
|
4
4
|
<fieldset>
|
|
5
5
|
<legend>${a("document.selectODD")}</legend>
|
|
6
|
-
${this.odds.map(e=>
|
|
6
|
+
${this.odds.map(e=>p`<paper-checkbox name="odd" value="${e.name}">${e.label}</paper-checkbox>`)}
|
|
7
7
|
</fieldset>
|
|
8
8
|
<paper-input name="uri" type="url" required placeholder="https://e-editiones.org/apps/my-simple-app"
|
|
9
9
|
label="${a("appgen.uri")}" auto-validate></paper-input>
|
|
@@ -17,7 +17,7 @@ import"./paper-checkbox-c9177e35.js";import"./paper-listbox-1fc346ac.js";import{
|
|
|
17
17
|
<legend>${a("appgen.template.help")}</legend>
|
|
18
18
|
<paper-dropdown-menu id="template" label="${a("appgen.template.label")}" name="template">
|
|
19
19
|
<paper-listbox slot="dropdown-content" class="dropdown-content" attr-for-selected="value" selected="view.html">
|
|
20
|
-
${this.templates.map(e=>
|
|
20
|
+
${this.templates.map(e=>p`<paper-item value="${e.name}">${e.title}</paper-item>`)}
|
|
21
21
|
</paper-listbox>
|
|
22
22
|
</paper-dropdown-menu>
|
|
23
23
|
</fieldset>
|
|
@@ -52,7 +52,7 @@ import"./paper-checkbox-c9177e35.js";import"./paper-listbox-1fc346ac.js";import{
|
|
|
52
52
|
<paper-dialog id="dialog">
|
|
53
53
|
<h2>${a("appgen.dialog.title")}</h2>
|
|
54
54
|
<div id="dialogContent">
|
|
55
|
-
${this.error?
|
|
55
|
+
${this.error?p`<div id="error">${this.error}</div>`:p`<a href="${this.url}" target="_blank">
|
|
56
56
|
<paper-button><iron-icon icon="icons:open-in-new"></iron-icon> ${a("appgen.open")}</paper-button>
|
|
57
57
|
</a>
|
|
58
58
|
<p>${a("appgen.success")}</p>`}
|
|
@@ -61,7 +61,7 @@ import"./paper-checkbox-c9177e35.js";import"./paper-listbox-1fc346ac.js";import{
|
|
|
61
61
|
<paper-button dialog-dismiss autofocus>${a("dialogs.close")}</paper-button>
|
|
62
62
|
</div>
|
|
63
63
|
</paper-dialog>
|
|
64
|
-
`}static get styles(){return
|
|
64
|
+
`}static get styles(){return o`
|
|
65
65
|
:host {
|
|
66
66
|
display: block;
|
|
67
67
|
}
|
package/dist/pb-elements.json
CHANGED
|
@@ -630,18 +630,34 @@
|
|
|
630
630
|
"description": "A list of comma-separated stopwords which should be excluded\nwhen searching for other occurrences of an authority in the\nHTML text",
|
|
631
631
|
"type": "string"
|
|
632
632
|
},
|
|
633
|
+
{
|
|
634
|
+
"name": "auto",
|
|
635
|
+
"description": "Automatically start a lookup when the query parameter is set on initialization.",
|
|
636
|
+
"type": "boolean"
|
|
637
|
+
},
|
|
633
638
|
{
|
|
634
639
|
"name": "query",
|
|
635
640
|
"description": "The query string to be sent to the authority",
|
|
636
641
|
"type": "string",
|
|
637
642
|
"default": "\"\""
|
|
638
643
|
},
|
|
644
|
+
{
|
|
645
|
+
"name": "type",
|
|
646
|
+
"description": "The authority type to use. Should correspond to a name defined for one of the connectors.",
|
|
647
|
+
"type": "string"
|
|
648
|
+
},
|
|
639
649
|
{
|
|
640
650
|
"name": "sort-by-label",
|
|
641
651
|
"description": "Enable to alphabetically reorder authority search results by label.\nOtherwise results are shown as returned by the authority.",
|
|
642
652
|
"type": "boolean",
|
|
643
653
|
"default": "false"
|
|
644
654
|
},
|
|
655
|
+
{
|
|
656
|
+
"name": "no-occurrences",
|
|
657
|
+
"description": "Do not show occurrences count, which would be fetched from the server.",
|
|
658
|
+
"type": "boolean",
|
|
659
|
+
"default": "false"
|
|
660
|
+
},
|
|
645
661
|
{
|
|
646
662
|
"name": "group",
|
|
647
663
|
"description": "A list of space- or comma-separated group names, whose members will be\nallowed to add or edit entries in the local register (if enabled).",
|
|
@@ -687,6 +703,12 @@
|
|
|
687
703
|
"description": "A list of comma-separated stopwords which should be excluded\nwhen searching for other occurrences of an authority in the\nHTML text",
|
|
688
704
|
"type": "string"
|
|
689
705
|
},
|
|
706
|
+
{
|
|
707
|
+
"name": "autoLookup",
|
|
708
|
+
"attribute": "auto",
|
|
709
|
+
"description": "Automatically start a lookup when the query parameter is set on initialization.",
|
|
710
|
+
"type": "boolean"
|
|
711
|
+
},
|
|
690
712
|
{
|
|
691
713
|
"name": "query",
|
|
692
714
|
"attribute": "query",
|
|
@@ -695,7 +717,10 @@
|
|
|
695
717
|
"default": "\"\""
|
|
696
718
|
},
|
|
697
719
|
{
|
|
698
|
-
"name": "type"
|
|
720
|
+
"name": "type",
|
|
721
|
+
"attribute": "type",
|
|
722
|
+
"description": "The authority type to use. Should correspond to a name defined for one of the connectors.",
|
|
723
|
+
"type": "string"
|
|
699
724
|
},
|
|
700
725
|
{
|
|
701
726
|
"name": "sortByLabel",
|
|
@@ -704,6 +729,13 @@
|
|
|
704
729
|
"type": "boolean",
|
|
705
730
|
"default": "false"
|
|
706
731
|
},
|
|
732
|
+
{
|
|
733
|
+
"name": "noOccurrences",
|
|
734
|
+
"attribute": "no-occurrences",
|
|
735
|
+
"description": "Do not show occurrences count, which would be fetched from the server.",
|
|
736
|
+
"type": "boolean",
|
|
737
|
+
"default": "false"
|
|
738
|
+
},
|
|
707
739
|
{
|
|
708
740
|
"name": "group",
|
|
709
741
|
"attribute": "group",
|
|
@@ -2553,7 +2585,7 @@
|
|
|
2553
2585
|
{
|
|
2554
2586
|
"name": "pb-collapse",
|
|
2555
2587
|
"path": "./src/pb-collapse.js",
|
|
2556
|
-
"description": "A collapsible block: in collapsed state it only shows a header and expands if clicked.\nThe header should go into slot `collapse-trigger`, the content into `collapse-content`.\nExample:\n\n```html\n<pb-collapse>\n
|
|
2588
|
+
"description": "A collapsible block: in collapsed state it only shows a header and expands if clicked.\nThe header should go into slot `collapse-trigger`, the content into `collapse-content`.\nExample:\n\n```html\n<pb-collapse>\n <div slot=\"collapse-trigger\">\n Metadata\n </div>\n <pb-view slot=\"collapse-content\" src=\"document1\" subscribe=\"transcription\" xpath=\"//teiHeader\"></pb-view>\n</pb-collapse>\n```\n\nBy adding a CSS 'icon-right' to a `pb-collapse` the icon can be placed on the right side\n```\n<pb-collapse class='icon-right'>\n```",
|
|
2557
2589
|
"attributes": [
|
|
2558
2590
|
{
|
|
2559
2591
|
"name": "horizontal",
|
|
@@ -2748,7 +2780,7 @@
|
|
|
2748
2780
|
"attributes": [
|
|
2749
2781
|
{
|
|
2750
2782
|
"name": "source",
|
|
2751
|
-
"description": "A remote data source to use. The component will pass the text entered by the user\nin parameter `query`. It expects a JSON array of objects with each object describing\none item:\n\n```json\n{\n
|
|
2783
|
+
"description": "A remote data source to use. The component will pass the text entered by the user\nin parameter `query`. It expects a JSON array of objects with each object describing\none item:\n\n```json\n{\n \"text\": \"Text to show as label\",\n \"value\": \"value-to-use\"\n}\n```",
|
|
2752
2784
|
"type": "string"
|
|
2753
2785
|
},
|
|
2754
2786
|
{
|
|
@@ -2831,7 +2863,7 @@
|
|
|
2831
2863
|
{
|
|
2832
2864
|
"name": "source",
|
|
2833
2865
|
"attribute": "source",
|
|
2834
|
-
"description": "A remote data source to use. The component will pass the text entered by the user\nin parameter `query`. It expects a JSON array of objects with each object describing\none item:\n\n```json\n{\n
|
|
2866
|
+
"description": "A remote data source to use. The component will pass the text entered by the user\nin parameter `query`. It expects a JSON array of objects with each object describing\none item:\n\n```json\n{\n \"text\": \"Text to show as label\",\n \"value\": \"value-to-use\"\n}\n```",
|
|
2835
2867
|
"type": "string"
|
|
2836
2868
|
},
|
|
2837
2869
|
{
|
|
@@ -6943,7 +6975,7 @@
|
|
|
6943
6975
|
{
|
|
6944
6976
|
"name": "pb-mei",
|
|
6945
6977
|
"path": "./src/pb-mei.js",
|
|
6946
|
-
"description": "A viewer and player for MEI musical notation based on [Verovio](https://www.verovio.org/).\nSupports optional MIDI playback using [web-midi-player](https://midi.yvesgurcan.com/).\nBoth libraries are loaded dynamically when the component is used the first time.\n\nViewing options to be selected by the user can be defined via nested `pb-option` elements:\n\n```html\n<pb-mei id=\"viewer\" player url=\"http://www.marenzio.org/mei/M-06-5/M_06_5_01_S_io_parto_i_moro_e_pur_partir_conviene.mei\" \n
|
|
6978
|
+
"description": "A viewer and player for MEI musical notation based on [Verovio](https://www.verovio.org/).\nSupports optional MIDI playback using [web-midi-player](https://midi.yvesgurcan.com/).\nBoth libraries are loaded dynamically when the component is used the first time.\n\nViewing options to be selected by the user can be defined via nested `pb-option` elements:\n\n```html\n<pb-mei id=\"viewer\" player url=\"http://www.marenzio.org/mei/M-06-5/M_06_5_01_S_io_parto_i_moro_e_pur_partir_conviene.mei\" \n footer=\"none\">\n <pb-option name=\"appXPath\" on=\"./rdg[contains(@label, 'original')]\" off=\"\">Original Clefs</pb-option>\n</pb-mei>\n```\n\nThe MEI document to display can either be given directly in the `data` property or loaded from an URL\nspecified in `url`.",
|
|
6947
6979
|
"attributes": [
|
|
6948
6980
|
{
|
|
6949
6981
|
"name": "data",
|
|
@@ -8336,7 +8368,7 @@
|
|
|
8336
8368
|
},
|
|
8337
8369
|
{
|
|
8338
8370
|
"name": "unresolved",
|
|
8339
|
-
"description": "Will be set while the component is loading and unset when\nit is fully loaded. Use to avoid flash of unstyled content\nvia CSS: set `unresolved` on `pb-page` in the HTML and\nadd a CSS rule like:\n\n```css\npb-page[unresolved] {\n
|
|
8371
|
+
"description": "Will be set while the component is loading and unset when\nit is fully loaded. Use to avoid flash of unstyled content\nvia CSS: set `unresolved` on `pb-page` in the HTML and\nadd a CSS rule like:\n\n```css\npb-page[unresolved] {\n display: none;\n}\n```",
|
|
8340
8372
|
"type": "boolean",
|
|
8341
8373
|
"default": "true"
|
|
8342
8374
|
},
|
|
@@ -8464,7 +8496,7 @@
|
|
|
8464
8496
|
{
|
|
8465
8497
|
"name": "unresolved",
|
|
8466
8498
|
"attribute": "unresolved",
|
|
8467
|
-
"description": "Will be set while the component is loading and unset when\nit is fully loaded. Use to avoid flash of unstyled content\nvia CSS: set `unresolved` on `pb-page` in the HTML and\nadd a CSS rule like:\n\n```css\npb-page[unresolved] {\n
|
|
8499
|
+
"description": "Will be set while the component is loading and unset when\nit is fully loaded. Use to avoid flash of unstyled content\nvia CSS: set `unresolved` on `pb-page` in the HTML and\nadd a CSS rule like:\n\n```css\npb-page[unresolved] {\n display: none;\n}\n```",
|
|
8468
8500
|
"type": "boolean",
|
|
8469
8501
|
"default": "true"
|
|
8470
8502
|
},
|
|
@@ -8963,7 +8995,7 @@
|
|
|
8963
8995
|
{
|
|
8964
8996
|
"name": "pb-popover",
|
|
8965
8997
|
"path": "./src/pb-popover.js",
|
|
8966
|
-
"description": "Show a popover. It may either \n\n1. be attached to another element on the page which serves as a trigger. For this the\n`for` property must be specified and should contain the ID of the trigger element. \nThe whole content of the `pb-popover` element will be shown in the popup.\n\n2. if no `for` property is specified, the `pb-popover` acts itself as the trigger. The trigger\ntext is either taken from a slot named `default` - or the default slot (i.e. the content of the element).\nThe content to show in the popup should be supplied in a slot named `alternate`. It is recommended to use an\nHTML `template` to specify the alternate, so it is ignored by the browser:\n\n```html\n<pb-popover theme=\"material\">\n
|
|
8998
|
+
"description": "Show a popover. It may either \n\n1. be attached to another element on the page which serves as a trigger. For this the\n`for` property must be specified and should contain the ID of the trigger element. \nThe whole content of the `pb-popover` element will be shown in the popup.\n\n2. if no `for` property is specified, the `pb-popover` acts itself as the trigger. The trigger\ntext is either taken from a slot named `default` - or the default slot (i.e. the content of the element).\nThe content to show in the popup should be supplied in a slot named `alternate`. It is recommended to use an\nHTML `template` to specify the alternate, so it is ignored by the browser:\n\n```html\n<pb-popover theme=\"material\">\n <span slot=\"default\">ipsum dolor sit amet</span>\n <template slot=\"alternate\">\n <p>At vero eos et <strong>accusam</strong> et justo duo dolores<br>\n et ea rebum.</p>\n </template>\n</pb-popover>\n```\n\nIf you would like popovers to contain nested popovers, choose approach 1 above and use `for`.\n\nIf property `persistent` is true, the popover will be shown\non click. Otherwise display a tooltip on mouseover.\n\n`pb-popover` uses the tippy.js library for the popup.\n\n## Styling\n\nWhen showing the popup, the popup content will either be added to the parent shadow DOM - if the `pb-popover`\nis located inside the shadow DOM of another element like `pb-view`; or the document body. This has an\neffect on where CSS styles can be defined: within a `pb-view`, only the styles specified inside the\nCSS attached to the ODD are applied.",
|
|
8967
8999
|
"attributes": [
|
|
8968
9000
|
{
|
|
8969
9001
|
"name": "remote",
|
|
@@ -9886,7 +9918,7 @@
|
|
|
9886
9918
|
{
|
|
9887
9919
|
"name": "pb-select-feature",
|
|
9888
9920
|
"path": "./src/pb-select-feature.js",
|
|
9889
|
-
"description": "Similar to `pb-toggle-feature` but allows you to choose from a list of defined states instead of a simple\non/off toggle. Like `pb-toggle-feature` it can change state server-side as well as client-side. \n\nThe list of states is passed as a JSON array to property `items`:\n\n# Server-side\n\nProperties to be passed to the server are specified as follows:\n\n```javascript\n[\n
|
|
9921
|
+
"description": "Similar to `pb-toggle-feature` but allows you to choose from a list of defined states instead of a simple\non/off toggle. Like `pb-toggle-feature` it can change state server-side as well as client-side. \n\nThe list of states is passed as a JSON array to property `items`:\n\n# Server-side\n\nProperties to be passed to the server are specified as follows:\n\n```javascript\n[\n {\"name\": \"Diplomatic View\", \"properties\": {\"mode\": \"diplomatic\", \"view\": \"page\"}},\n {\"name\": \"Normalized View\", \"properties\": {\"mode\": \"norm\", \"view\": \"single\"}}\n]\n```\n\nIf the `name` property references the path to a translated label, the translation will be used instead.\n# Client-side\n\n```javascript\n[\n {\"name\": \"Diplomatic View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": false},{\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\"}]},\n {\"name\": \"Normalized View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": true},{\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\"}]},\n {\"name\": \"Plain Reading View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": true}, {\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\", \"state\": true}]}\n]\n```\n\nEach item in the `selectors` property above defines either a state or a command. *state* will simply add\na css class `.toggle` to the target element when true. If *command* is set to 'disable', it will entirely disable\nthe functionality of selected elements - provided that they are\npublisher components implementing the corresponding `command` method of `pb-mixin`.\n\nClient-side you may also pass an optional property `\"global\": true` to toggle the state of elements which reside\nin the surrounding HTML context below `pb-page` (means: elements which are not inside a `pb-view` or `pb-load`).",
|
|
9890
9922
|
"attributes": [
|
|
9891
9923
|
{
|
|
9892
9924
|
"name": "name",
|
|
@@ -10255,7 +10287,7 @@
|
|
|
10255
10287
|
{
|
|
10256
10288
|
"name": "pb-select",
|
|
10257
10289
|
"path": "./src/pb-select.js",
|
|
10258
|
-
"description": "Replacement for an HTML select element with additional features:\n\n1. item list can be loaded from remote endpoint via AJAX\n2. may contain additional nested form in the slot\n
|
|
10290
|
+
"description": "Replacement for an HTML select element with additional features:\n\n1. item list can be loaded from remote endpoint via AJAX\n2. may contain additional nested form in the slot\n named `subform`, whose values will be sent with the AJAX request",
|
|
10259
10291
|
"attributes": [
|
|
10260
10292
|
{
|
|
10261
10293
|
"name": "label",
|
|
@@ -10419,7 +10451,7 @@
|
|
|
10419
10451
|
{
|
|
10420
10452
|
"name": "pb-split-list",
|
|
10421
10453
|
"path": "./src/pb-split-list.js",
|
|
10422
|
-
"description": "Implements a list which is split into different categories \n(e.g. letters of the alphabet, countries ...).\nOnly one category is shown at a time unless the server reports\nno categories (e.g. if the number of items to display goes below\na defined threshold).\n\nThe server-side API endpoint should return a JSON object with two\nproperties:\n\n+ `categories`: an array of category descriptions: each item should \n
|
|
10454
|
+
"description": "Implements a list which is split into different categories \n(e.g. letters of the alphabet, countries ...).\nOnly one category is shown at a time unless the server reports\nno categories (e.g. if the number of items to display goes below\na defined threshold).\n\nThe server-side API endpoint should return a JSON object with two\nproperties:\n\n+ `categories`: an array of category descriptions: each item should \n be an object with two properties: `category` - containing the name of the category\n and `count` - containing a count of items available under this category.\n+ `items`: an array with the items to be shown for the currently selected\n category. Those may contain HTML markup.\n\nSample JSON object for pb-split-list\n```javascript\n{\n \"items\": [\n \"<span><a href='Abegg-Arter Carl?category=A&view=correspondents&search='>Abegg-Arter, Carl</a><span class='dates'> (1836–1912)</span></span>\",\n \"<span><a href='Abegg Hans Heinrich?category=A&view=correspondents&search='>Abegg, Hans Heinrich</a><span class='dates'> (1805–1874)</span></span>\",\n \"<span><a href='Abegg Jakob?category=A&view=correspondents&search='>Abegg, Jakob</a><span class='dates'> (1801–1871)</span></span>\",\n \"<span><a href='Abys Raget?category=A&view=correspondents&search='>Abys, Raget</a><span class='dates'> (1790–1861)</span></span>\",\n \"<span><a href='Aebli Johann Peter?category=A&view=correspondents&search='>Aebli, Johann Peter</a><span class='dates'> (1804–1879)</span></span>\",\n \"<span><a href='Aepli Arnold Otto?category=A&view=correspondents&search='>Aepli, Arnold Otto</a><span class='dates'> (1816–1897)</span></span>\",\n ...\n ],\n \"categories\": [\n {\n \"category\": \"A\",\n \"count\": 22\n },\n {\n \"category\": \"B\",\n \"count\": 77\n },\n {\n \"category\": \"C\",\n \"count\": 19\n },\n ...\n ]\n}\n```\n\nSample Usage \n```xml\n<pb-split-list url=\"api/people\" subforms=\"#options\" selected=\"A\" emit=\"transcription\" subscribe=\"transcription\"></pb-split-list>\n```\nSee https://www.briefedition.alfred-escher.ch/kontexte/personen/?category=A&search=&view=correspondents for a running sample. The source code of the webpage is here: https://github.com/stazh/briefedition-escher. Relevant files are: \n- [templates/index.html](https://github.com/stazh/briefedition-escher/blob/master/templates/index.html#L223) - usage of pb-timeline\n- [modules/custom-api.json](https://github.com/stazh/briefedition-escher/blob/master/modules/custom-api.json#L1098) - `/api/people` endpoint delivering required JSON object",
|
|
10423
10455
|
"attributes": [
|
|
10424
10456
|
{
|
|
10425
10457
|
"name": "url",
|
|
@@ -11084,7 +11116,7 @@
|
|
|
11084
11116
|
{
|
|
11085
11117
|
"name": "pb-timeline",
|
|
11086
11118
|
"path": "./src/pb-timeline.js",
|
|
11087
|
-
"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.\nExpected JSON: \n```javascript\n{\n
|
|
11119
|
+
"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.\nExpected JSON: \n```javascript\n{\n \"1852-01-14\": {\n \"count\": 1,\n \"info\": [\n \"<a href='/briefe/B0977' part='tooltip-link'>Alfred Escher an Joseph Wolfgang von Deschwanden, Belvoir (Enge, Zürich), Mittwoch, 14. Januar 1852</a>\"\n ]\n },\n\"1874-01-25\": {\n \"count\": 3,\n \"info\": [\n \"<a href='/briefe/B8140' part='tooltip-link'>Alfred Escher an Gustav von Mevissen, Zürich, Sonntag, 25. Januar 1874</a>\",\n \"<a href='/briefe/B8139' part='tooltip-link'>Alfred Escher an Theodor Weishaupt, Zürich, Sonntag, 25. Januar 1874</a>\",\n \"<a href='/briefe/B8143' part='tooltip-link'>Alfred Escher an Ludwig August Parcus, Zürich, Sonntag, 25. Januar 1874</a>\"\n ]\n }\n}\n```\nSample Usage:\n```xml\n<pb-timeline url=\"api/timeline\" scopes=\"['D', 'M', 'Y', '5Y', '10Y']\"\n resettable=\"\"\n subscribe=\"docs\" emit=\"timeline\">\n <span slot=\"label\">Angezeigter Zeitraum: </span>\n</pb-timeline>\n```\nSee https://www.briefedition.alfred-escher.ch/briefe/ for a running sample. The source code of the webpage is here: https://github.com/stazh/briefedition-escher. Relevant files are: \n- [templates/people.html](https://github.com/stazh/briefedition-escher/blob/master/templates/people.html#L91) - usage of pb-timeline\n- [modules/custom-api.json](https://github.com/stazh/briefedition-escher/blob/master/modules/custom-api.json#L1080) - `/api/timeline` endpoint delivering required JSON object",
|
|
11088
11120
|
"attributes": [
|
|
11089
11121
|
{
|
|
11090
11122
|
"name": "start-date",
|
|
@@ -11343,7 +11375,7 @@
|
|
|
11343
11375
|
{
|
|
11344
11376
|
"name": "pb-toggle-feature",
|
|
11345
11377
|
"path": "./src/pb-toggle-feature.js",
|
|
11346
|
-
"description": "Enable or disable a particular display feature by setting a predefined or custom parameter.\nToggling display features can be done server-side or client-side.\n\nIt is important that `pb-toggle-feature` emits and subscribes to the same channel as the target `pb-view`.\n\n# Server side toggling\n\nYou may set the following view parameters which correspond to the properties supported by `pb-view`:\n\n| Parameter | Description |\n| ----------------|-------------|\n| odd | the ODD to use |\n| view | the view type: 'page', 'div' or 'single' |\n| columnSeparator | CSS selector to find elements to use as column separator |\n| xpath | XPath expression to select a portion of the text for display |\n\nFor example, one may switch between page-by-page and by-division view using\n\n```html\n<pb-toggle-feature emit=\"transcription\" name=\"view\" on=\"page\" off=\"div\">Page View</pb-toggle-feature>\n```\n\nIt is also possible to set custom parameters, which will be passed to the ODD as user-defined parameters.\nThis can be used e.g. to implement different views on the text, e.g. a 'diplomatic' and a 'normalized' mode. Both\nviews would be backed by the same ODD and processing model, while the passed in parameter\ncan be used to distinguish the modes.\n\nFor example, the following snippet would result in a custom parameter called `mode` with\neither a value of `dipl` or `norm`. Within processing model predicates it could be queried as\n`$parameters?mode='norm'` to check if the normalized version should be output.\n\n```html\n<pb-toggle-feature name=\"mode\" on=\"diplomatic\" off=\"norm\">Diplomatic View</pb-toggle-feature>\n```\n\nBesides setting a single parameter, you may also set multiple\nproperties on the target `pb-view` via the `properties-on` and `properties-off`\nattributes (as an alternative to `on` and `off`). For example, in 'on' state, you may\nwant to use a different ODD and switch the view to 'page' at the same time:\n\n```html\n<pb-toggle-feature properties-on='{\"odd\": \"myodd\", \"view\": \"page\"}' properties-off='{\"odd\": \"myodd-diplomatic\", \"view\": \"div\"}'>\n
|
|
11378
|
+
"description": "Enable or disable a particular display feature by setting a predefined or custom parameter.\nToggling display features can be done server-side or client-side.\n\nIt is important that `pb-toggle-feature` emits and subscribes to the same channel as the target `pb-view`.\n\n# Server side toggling\n\nYou may set the following view parameters which correspond to the properties supported by `pb-view`:\n\n| Parameter | Description |\n| ----------------|-------------|\n| odd | the ODD to use |\n| view | the view type: 'page', 'div' or 'single' |\n| columnSeparator | CSS selector to find elements to use as column separator |\n| xpath | XPath expression to select a portion of the text for display |\n\nFor example, one may switch between page-by-page and by-division view using\n\n```html\n<pb-toggle-feature emit=\"transcription\" name=\"view\" on=\"page\" off=\"div\">Page View</pb-toggle-feature>\n```\n\nIt is also possible to set custom parameters, which will be passed to the ODD as user-defined parameters.\nThis can be used e.g. to implement different views on the text, e.g. a 'diplomatic' and a 'normalized' mode. Both\nviews would be backed by the same ODD and processing model, while the passed in parameter\ncan be used to distinguish the modes.\n\nFor example, the following snippet would result in a custom parameter called `mode` with\neither a value of `dipl` or `norm`. Within processing model predicates it could be queried as\n`$parameters?mode='norm'` to check if the normalized version should be output.\n\n```html\n<pb-toggle-feature name=\"mode\" on=\"diplomatic\" off=\"norm\">Diplomatic View</pb-toggle-feature>\n```\n\nBesides setting a single parameter, you may also set multiple\nproperties on the target `pb-view` via the `properties-on` and `properties-off`\nattributes (as an alternative to `on` and `off`). For example, in 'on' state, you may\nwant to use a different ODD and switch the view to 'page' at the same time:\n\n```html\n<pb-toggle-feature properties-on='{\"odd\": \"myodd\", \"view\": \"page\"}' properties-off='{\"odd\": \"myodd-diplomatic\", \"view\": \"div\"}'>\n Diplomatic View\n</pb-toggle-feature>\n```\n\n# Client side toggling\n\nThe component can also be used to toggle features client-side, i.e. without requiring a server-roundtrip.\nTo enable this, the `selector` property should be set to a CSS3 selector targetting the HTML elements\nto toggle. In `on` state, the selected elements will be assigned a class `.toggled`.\n\n```html\n<pb-toggle-feature name=\"normalized\" selector=\".choice,.choice-alternate,br\">Normalized View</pb-toggle-feature>\n```\n\nNote that the name attribute is still required: it is used to determine if the feature is in on or off state by\nlooking at request parameters.\n\nInstead of toggling the class, you can also completely disable the elements selected - provided that they are\npublisher components implementing the corresponding `command` method of `pb-mixin`. To disable elements instead of\ntoggling, set the `action` property to *disable*.\n\n```html\n<pb-toggle-feature name=\"plain\" selector=\".tei-foreign,pb-highlight,pb-popover\" action=\"disable\" default=\"off\">Plain Reading View</pb-toggle-feature>\n```",
|
|
11347
11379
|
"attributes": [
|
|
11348
11380
|
{
|
|
11349
11381
|
"name": "name",
|
|
@@ -11736,7 +11768,7 @@
|
|
|
11736
11768
|
"attributes": [
|
|
11737
11769
|
{
|
|
11738
11770
|
"name": "key",
|
|
11739
|
-
"description": "Configures the default annotation property containing the key for authority entries.\nDefault: 'ref', corresponding to TEI attribute
|
|
11771
|
+
"description": "Configures the default annotation property containing the key for authority entries.\nDefault: 'ref', corresponding to TEI attribute",
|
|
11740
11772
|
"type": "string",
|
|
11741
11773
|
"default": "\"ref\""
|
|
11742
11774
|
},
|
|
@@ -11914,12 +11946,13 @@
|
|
|
11914
11946
|
],
|
|
11915
11947
|
"properties": [
|
|
11916
11948
|
{
|
|
11917
|
-
"name": "annotations"
|
|
11949
|
+
"name": "annotations",
|
|
11950
|
+
"type": "array"
|
|
11918
11951
|
},
|
|
11919
11952
|
{
|
|
11920
11953
|
"name": "key",
|
|
11921
11954
|
"attribute": "key",
|
|
11922
|
-
"description": "Configures the default annotation property containing the key for authority entries.\nDefault: 'ref', corresponding to TEI attribute
|
|
11955
|
+
"description": "Configures the default annotation property containing the key for authority entries.\nDefault: 'ref', corresponding to TEI attribute",
|
|
11923
11956
|
"type": "string",
|
|
11924
11957
|
"default": "\"ref\""
|
|
11925
11958
|
},
|
|
@@ -12246,7 +12279,7 @@
|
|
|
12246
12279
|
{
|
|
12247
12280
|
"name": "pb-view",
|
|
12248
12281
|
"path": "./src/pb-view.js",
|
|
12249
|
-
"description": "This is the main component for viewing text which has been transformed via an ODD.\nThe document to be viewed is determined by the `pb-document` element the property\n`src` points to. If not overwritten, `pb-view` will use the settings defined by\nthe connected document, like view type, ODD etc.\n\n`pb-view` can display an entire document or just a fragment of it\nas defined by the properties `xpath`, `xmlId` or `nodeId`. The most common use case\nis to set `xpath` to point to a specific part of a document.\n\nNavigating to the next or previous fragment would usually be triggered by a separate\n`pb-navigation` element, which sends a `pb-navigate` event to the `pb-view`. However,\n`pb-view` also implements automatic loading of next/previous fragments if the user\nscrolls the page beyond the current viewport boudaries. To enable this, set property\n`infinite-scroll`.\n\nYou may also define optional parameters to be passed to the ODD in nested `pb-param`\ntags. These parameters can be accessed within the ODD via the `$parameters` map. For\nexample, the following snippet is being used to output breadcrumbs above the main text\nin the documentation view:\n\n```xml\n<section class=\"breadcrumbs\">\n
|
|
12282
|
+
"description": "This is the main component for viewing text which has been transformed via an ODD.\nThe document to be viewed is determined by the `pb-document` element the property\n`src` points to. If not overwritten, `pb-view` will use the settings defined by\nthe connected document, like view type, ODD etc.\n\n`pb-view` can display an entire document or just a fragment of it\nas defined by the properties `xpath`, `xmlId` or `nodeId`. The most common use case\nis to set `xpath` to point to a specific part of a document.\n\nNavigating to the next or previous fragment would usually be triggered by a separate\n`pb-navigation` element, which sends a `pb-navigate` event to the `pb-view`. However,\n`pb-view` also implements automatic loading of next/previous fragments if the user\nscrolls the page beyond the current viewport boudaries. To enable this, set property\n`infinite-scroll`.\n\nYou may also define optional parameters to be passed to the ODD in nested `pb-param`\ntags. These parameters can be accessed within the ODD via the `$parameters` map. For\nexample, the following snippet is being used to output breadcrumbs above the main text\nin the documentation view:\n\n```xml\n<section class=\"breadcrumbs\">\n <pb-view id=\"title-view1\" src=\"document1\" subscribe=\"transcription\">\n <pb-param name=\"mode\" value=\"breadcrumbs\"/>\n </pb-view>\n</section>\n```",
|
|
12250
12283
|
"attributes": [
|
|
12251
12284
|
{
|
|
12252
12285
|
"name": "odd",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{L as t,N as e,A as n,f as s}from"./pb-mixin-b1caa22e.js";const i=new Map;let a;function o(t){a=t}function r(t){return t instanceof e?t.startNode.isConnected:t instanceof n?t.committer.element.isConnected:t.element.isConnected}function c(){Object.keys(i).forEach(t=>{r(t)||i.delete(t)})}function l(t){"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t)}function d(t,e){const n=e();t.value!==n&&(t.setValue(n),t.commit())}function u(t){a=t.t,i.forEach((t,e)=>{r(e)&&d(e,t)})}function p(t,e){return a?a(t,e):t}const h=s(t=>e=>{i.set(e,t),d(e,t)}),b=(t,e)=>h(()=>p(t,e));document.addEventListener("pb-i18n-update",t=>{u(t.detail)}),setInterval(()=>l(()=>c()),6e4);class f extends t{static get properties(){return Object.assign(Object.assign({},super.properties),{},{key:{type:String},options:{type:Object},_translated:{type:String}})}constructor(){super(),this.key="missing-key",this._options=null,this._translated=null}connectedCallback(){super.connectedCallback(),this._fallback=this.innerHTML,document.addEventListener("pb-i18n-update",this._translate.bind(this)),this._translate()}set options(t){this._options=t,this._translate()}_translate(){const t=p(this.key,this._options);t&&t!==this.key?this._translated=t:this._translated=null}render(){return this._translated?this._translated:this._fallback}createRenderRoot(){return this}}customElements.define("pb-i18n",f);export{p as g,o as i,b as t};
|
package/dist/pb-leaflet-map.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{L as t,p as e,r as i,h as o,c as s}from"./pb-mixin-
|
|
1
|
+
import{L as t,p as e,r as i,h as o,c as s}from"./pb-mixin-b1caa22e.js";import"./es-global-bridge-d8ce175d.js";import{g as a}from"./pb-i18n-0611135a.js";const r=["type","url","label","base","show"];class n 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(n.properties).forEach(e=>{r.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",n);class c 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(c.properties).forEach(e=>{this[e]&&(t[e]=this[e])}),console.log("<pb-map-icon> Options: %o",t),t}}customElements.define("pb-map-icon",c);class h 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"},geoCoding:{type:Boolean,attribute:"geo-coding"},_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={},this.geoCoding=!1}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",{element: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",{element: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,t.detail.clear&&this._markerLayer.clearLayers(),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)}),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(){if(this.toggle||(this.disabled=!1),void 0!==window.L)return void this._initMap();window.ESGlobalBridge.requestAvailability();const t=i("../lib/leaflet-src.js"),e=i("../lib/leaflet.markercluster-src.js"),o=i("../lib/Control.Geocoder.min.js");window.ESGlobalBridge.instance.load("leaflet",t).then(()=>{window.ESGlobalBridge.instance.load("plugin",e).then(()=>{this.geoCoding?window.ESGlobalBridge.instance.load("geocoding",o).then(this._initMap.bind(this)):this._initMap()})})}render(){const t=i(this.cssPath);return o`
|
|
2
2
|
<link rel="Stylesheet" href="${t}/leaflet.css">
|
|
3
3
|
<link rel="Stylesheet" href="${t}/MarkerCluster.Default.css">
|
|
4
4
|
${this.geoCoding?o`<link rel="Stylesheet" href="${t}/Control.Geocoder.css">`:null}
|