@teipublisher/pb-components 1.44.2 → 2.1.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.
- package/CHANGELOG.md +76 -0
- package/dist/demo/demos.json +6 -1
- package/dist/demo/pb-browse-docs.html +2 -1
- package/dist/demo/pb-combo-box.html +1 -1
- package/dist/demo/pb-document.html +2 -2
- package/dist/demo/pb-image-strip-standalone.html +94 -0
- package/dist/demo/pb-image-strip-view.html +92 -0
- package/dist/demo/pb-load.html +2 -2
- package/dist/demo/pb-select-feature.html +1 -1
- package/dist/demo/pb-select-feature2.html +10 -3
- package/dist/demo/pb-select-feature3.html +1 -1
- package/dist/demo/pb-select-odd.html +1 -1
- package/dist/demo/pb-table-grid.html +1 -1
- package/dist/demo/pb-tabs.html +8 -2
- package/dist/demo/pb-toggle-feature.html +2 -2
- package/dist/demo/pb-toggle-feature2.html +2 -2
- package/dist/demo/pb-toggle-feature3.html +2 -2
- package/dist/demo/pb-view.html +1 -1
- package/dist/demo/pb-view4.html +86 -0
- package/dist/pb-code-editor.js +1 -1
- package/dist/pb-component-docs.js +33 -33
- package/dist/pb-components-bundle.js +271 -261
- package/dist/pb-edit-app.js +6 -6
- package/dist/pb-elements.json +248 -29
- package/dist/{pb-i18n-3963b098.js → pb-i18n-8a90c591.js} +1 -1
- package/dist/pb-leaflet-map.js +1 -1
- package/dist/pb-mixin-8a593923.js +158 -0
- package/dist/pb-odd-editor.js +47 -47
- package/dist/{vaadin-element-mixin-08cf11b5.js → vaadin-element-mixin-672938e3.js} +18 -18
- package/i18n/common/en.json +9 -1
- package/package.json +4 -3
- package/pb-elements.json +248 -29
- package/src/dts-client.js +14 -14
- package/src/dts-select-endpoint.js +5 -5
- package/src/pb-ajax.js +4 -4
- package/src/pb-authority-lookup.js +2 -2
- package/src/pb-autocomplete.js +9 -11
- package/src/pb-blacklab-highlight.js +3 -3
- package/src/pb-browse-docs.js +44 -27
- package/src/pb-browse.js +9 -3
- package/src/pb-combo-box.js +2 -2
- package/src/pb-components.js +1 -0
- package/src/pb-document.js +15 -1
- package/src/pb-download.js +2 -2
- package/src/pb-edit-app.js +2 -2
- package/src/pb-edit-xml.js +2 -2
- package/src/pb-events.js +26 -18
- package/src/pb-facs-link.js +33 -9
- package/src/pb-facsimile.js +34 -31
- package/src/pb-grid.js +55 -53
- package/src/pb-image-strip.js +97 -0
- package/src/pb-lang.js +2 -2
- package/src/pb-link.js +10 -16
- package/src/pb-load.js +35 -25
- package/src/pb-login.js +2 -2
- package/src/pb-manage-odds.js +2 -2
- package/src/pb-markdown.js +2 -2
- package/src/pb-mei.js +2 -2
- package/src/pb-mixin.js +103 -196
- package/src/pb-odd-editor.js +2 -2
- package/src/pb-page.js +30 -21
- package/src/pb-paginate.js +24 -19
- package/src/pb-print-preview.js +2 -2
- package/src/pb-repeat.js +2 -1
- package/src/pb-search.js +34 -8
- package/src/pb-select-feature.js +62 -39
- package/src/pb-select-odd.js +8 -7
- package/src/pb-select-template.js +5 -4
- package/src/pb-select.js +31 -28
- package/src/pb-split-list.js +18 -11
- package/src/pb-table-grid.js +9 -8
- package/src/pb-tabs.js +29 -12
- package/src/pb-toggle-feature.js +51 -55
- package/src/pb-upload.js +10 -3
- package/src/pb-view.js +118 -95
- package/src/theming.js +148 -149
- package/src/urls.js +233 -0
- package/dist/pb-mixin-88125cb2.js +0 -158
package/dist/pb-edit-app.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import"./paper-checkbox-102e3b43.js";import{p as e,L as t,
|
|
1
|
+
import"./paper-checkbox-102e3b43.js";import{p as e,L as t,w as p,h as o,c as a}from"./pb-mixin-8a593923.js";import{t as i}from"./pb-i18n-8a90c591.js";import"./iron-form-9e72ac45.js";class n extends(e(t)){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"),t=this.shadowRoot.getElementById("defaultView"),o=this.shadowRoot.getElementById("index"),a=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},[]),p("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=t.selectedItem.getAttribute("value");this.request.body["default-view"]=e,this.request.body.index=o.selectedItem.getAttribute("value"),this.request.body.template=a.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 o`
|
|
2
2
|
<iron-form id="form">
|
|
3
3
|
<form method="POST" accept="application/json" enctype="application/json">
|
|
4
4
|
<fieldset>
|
|
5
5
|
<legend>${i("document.selectODD")}</legend>
|
|
6
|
-
${this.odds.map(e=>
|
|
6
|
+
${this.odds.map(e=>o`<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="${i("appgen.uri")}" auto-validate></paper-input>
|
|
@@ -17,7 +17,7 @@ import"./paper-checkbox-102e3b43.js";import{p as e,L as t,h as p,c as o}from"./p
|
|
|
17
17
|
<legend>${i("appgen.template.help")}</legend>
|
|
18
18
|
<paper-dropdown-menu id="template" label="${i("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=>o`<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-102e3b43.js";import{p as e,L as t,h as p,c as o}from"./p
|
|
|
52
52
|
<paper-dialog id="dialog">
|
|
53
53
|
<h2>${i("appgen.dialog.title")}</h2>
|
|
54
54
|
<div id="dialogContent">
|
|
55
|
-
${this.error?
|
|
55
|
+
${this.error?o`<div id="error">${this.error}</div>`:o`<a href="${this.url}" target="_blank">
|
|
56
56
|
<paper-button><iron-icon icon="icons:open-in-new"></iron-icon> ${i("appgen.open")}</paper-button>
|
|
57
57
|
</a>
|
|
58
58
|
<p>${i("appgen.success")}</p>`}
|
|
@@ -61,7 +61,7 @@ import"./paper-checkbox-102e3b43.js";import{p as e,L as t,h as p,c as o}from"./p
|
|
|
61
61
|
<paper-button dialog-dismiss autofocus>${i("dialogs.close")}</paper-button>
|
|
62
62
|
</div>
|
|
63
63
|
</paper-dialog>
|
|
64
|
-
`}static get styles(){return
|
|
64
|
+
`}static get styles(){return a`
|
|
65
65
|
:host {
|
|
66
66
|
display: block;
|
|
67
67
|
}
|
|
@@ -107,4 +107,4 @@ import"./paper-checkbox-102e3b43.js";import{p as e,L as t,h as p,c as o}from"./p
|
|
|
107
107
|
display: block;
|
|
108
108
|
flex: 1 0;
|
|
109
109
|
}
|
|
110
|
-
`}}customElements.define("pb-edit-app",
|
|
110
|
+
`}}customElements.define("pb-edit-app",n);export{n as PbEditApp};
|
package/dist/pb-elements.json
CHANGED
|
@@ -3172,6 +3172,11 @@
|
|
|
3172
3172
|
"type": "string",
|
|
3173
3173
|
"default": "\"\""
|
|
3174
3174
|
},
|
|
3175
|
+
{
|
|
3176
|
+
"name": "disable-history",
|
|
3177
|
+
"type": "boolean",
|
|
3178
|
+
"default": "false"
|
|
3179
|
+
},
|
|
3175
3180
|
{
|
|
3176
3181
|
"name": "subscribe",
|
|
3177
3182
|
"description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
|
|
@@ -3236,6 +3241,12 @@
|
|
|
3236
3241
|
"type": "string",
|
|
3237
3242
|
"default": "\"\""
|
|
3238
3243
|
},
|
|
3244
|
+
{
|
|
3245
|
+
"name": "disableHistory",
|
|
3246
|
+
"attribute": "disable-history",
|
|
3247
|
+
"type": "boolean",
|
|
3248
|
+
"default": "false"
|
|
3249
|
+
},
|
|
3239
3250
|
{
|
|
3240
3251
|
"name": "subscribe",
|
|
3241
3252
|
"attribute": "subscribe",
|
|
@@ -3901,6 +3912,16 @@
|
|
|
3901
3912
|
"type": "string",
|
|
3902
3913
|
"default": "\"mouseover\""
|
|
3903
3914
|
},
|
|
3915
|
+
{
|
|
3916
|
+
"name": "label",
|
|
3917
|
+
"type": "string",
|
|
3918
|
+
"default": "\"\""
|
|
3919
|
+
},
|
|
3920
|
+
{
|
|
3921
|
+
"name": "order",
|
|
3922
|
+
"type": "number",
|
|
3923
|
+
"default": "\"POSITIVE_INFINITY\""
|
|
3924
|
+
},
|
|
3904
3925
|
{
|
|
3905
3926
|
"name": "subscribe",
|
|
3906
3927
|
"description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
|
|
@@ -3924,7 +3945,8 @@
|
|
|
3924
3945
|
{
|
|
3925
3946
|
"name": "wait-for",
|
|
3926
3947
|
"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.",
|
|
3927
|
-
"type": "string"
|
|
3948
|
+
"type": "string",
|
|
3949
|
+
"default": "\"pb-facsimile,pb-image-strip\""
|
|
3928
3950
|
},
|
|
3929
3951
|
{
|
|
3930
3952
|
"name": "disabled",
|
|
@@ -3959,6 +3981,23 @@
|
|
|
3959
3981
|
"type": "string",
|
|
3960
3982
|
"default": "\"mouseover\""
|
|
3961
3983
|
},
|
|
3984
|
+
{
|
|
3985
|
+
"name": "label",
|
|
3986
|
+
"attribute": "label",
|
|
3987
|
+
"type": "string",
|
|
3988
|
+
"default": "\"\""
|
|
3989
|
+
},
|
|
3990
|
+
{
|
|
3991
|
+
"name": "order",
|
|
3992
|
+
"attribute": "order",
|
|
3993
|
+
"type": "number",
|
|
3994
|
+
"default": "\"POSITIVE_INFINITY\""
|
|
3995
|
+
},
|
|
3996
|
+
{
|
|
3997
|
+
"name": "default",
|
|
3998
|
+
"type": "string",
|
|
3999
|
+
"default": "\"\""
|
|
4000
|
+
},
|
|
3962
4001
|
{
|
|
3963
4002
|
"name": "subscribe",
|
|
3964
4003
|
"attribute": "subscribe",
|
|
@@ -3987,7 +4026,8 @@
|
|
|
3987
4026
|
"name": "waitFor",
|
|
3988
4027
|
"attribute": "wait-for",
|
|
3989
4028
|
"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.",
|
|
3990
|
-
"type": "string"
|
|
4029
|
+
"type": "string",
|
|
4030
|
+
"default": "\"pb-facsimile,pb-image-strip\""
|
|
3991
4031
|
},
|
|
3992
4032
|
{
|
|
3993
4033
|
"name": "disabled",
|
|
@@ -4753,7 +4793,8 @@
|
|
|
4753
4793
|
{
|
|
4754
4794
|
"name": "panels",
|
|
4755
4795
|
"description": "an array of panel items to display when the component is loaded. It should contain a\nnumber for each panel to show, indicating the ordinal position of the template within the `<pb-panel>`\nto initialize. For example, if you have two templates in `<pb-panel>`: \"transcription\" and \"translation\",\nsetting `panels=\"[0, 1]\"` will show two columns, one with the transcription, the other with the translation.\n\nPassing in a browser parameter `panels` with a comma-separated list will set this property as well.",
|
|
4756
|
-
"type": "array"
|
|
4796
|
+
"type": "array",
|
|
4797
|
+
"default": "[]"
|
|
4757
4798
|
},
|
|
4758
4799
|
{
|
|
4759
4800
|
"name": "direction",
|
|
@@ -4809,7 +4850,8 @@
|
|
|
4809
4850
|
"name": "panels",
|
|
4810
4851
|
"attribute": "panels",
|
|
4811
4852
|
"description": "an array of panel items to display when the component is loaded. It should contain a\nnumber for each panel to show, indicating the ordinal position of the template within the `<pb-panel>`\nto initialize. For example, if you have two templates in `<pb-panel>`: \"transcription\" and \"translation\",\nsetting `panels=\"[0, 1]\"` will show two columns, one with the transcription, the other with the translation.\n\nPassing in a browser parameter `panels` with a comma-separated list will set this property as well.",
|
|
4812
|
-
"type": "array"
|
|
4853
|
+
"type": "array",
|
|
4854
|
+
"default": "[]"
|
|
4813
4855
|
},
|
|
4814
4856
|
{
|
|
4815
4857
|
"name": "direction",
|
|
@@ -5076,6 +5118,130 @@
|
|
|
5076
5118
|
}
|
|
5077
5119
|
]
|
|
5078
5120
|
},
|
|
5121
|
+
{
|
|
5122
|
+
"name": "pb-image-strip",
|
|
5123
|
+
"path": "./src/pb-image-strip.js",
|
|
5124
|
+
"attributes": [
|
|
5125
|
+
{
|
|
5126
|
+
"name": "base-uri",
|
|
5127
|
+
"type": "string"
|
|
5128
|
+
},
|
|
5129
|
+
{
|
|
5130
|
+
"name": "items",
|
|
5131
|
+
"description": "Array of image",
|
|
5132
|
+
"type": "array",
|
|
5133
|
+
"default": "[]"
|
|
5134
|
+
},
|
|
5135
|
+
{
|
|
5136
|
+
"name": "image-height",
|
|
5137
|
+
"type": "number",
|
|
5138
|
+
"default": "80"
|
|
5139
|
+
},
|
|
5140
|
+
{
|
|
5141
|
+
"name": "image-width",
|
|
5142
|
+
"type": "number",
|
|
5143
|
+
"default": "64"
|
|
5144
|
+
},
|
|
5145
|
+
{
|
|
5146
|
+
"name": "subscribe",
|
|
5147
|
+
"description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
|
|
5148
|
+
"type": "string"
|
|
5149
|
+
},
|
|
5150
|
+
{
|
|
5151
|
+
"name": "subscribe-config",
|
|
5152
|
+
"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.",
|
|
5153
|
+
"type": "object"
|
|
5154
|
+
},
|
|
5155
|
+
{
|
|
5156
|
+
"name": "emit",
|
|
5157
|
+
"description": "The name of the channel to send events to.",
|
|
5158
|
+
"type": "string"
|
|
5159
|
+
},
|
|
5160
|
+
{
|
|
5161
|
+
"name": "emit-config",
|
|
5162
|
+
"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.",
|
|
5163
|
+
"type": "object"
|
|
5164
|
+
},
|
|
5165
|
+
{
|
|
5166
|
+
"name": "wait-for",
|
|
5167
|
+
"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.",
|
|
5168
|
+
"type": "string"
|
|
5169
|
+
},
|
|
5170
|
+
{
|
|
5171
|
+
"name": "disabled",
|
|
5172
|
+
"description": "Common property to disable the functionality associated with a component.\n`pb-highlight` and `pb-popover` react to this.",
|
|
5173
|
+
"type": "boolean",
|
|
5174
|
+
"default": "false"
|
|
5175
|
+
}
|
|
5176
|
+
],
|
|
5177
|
+
"properties": [
|
|
5178
|
+
{
|
|
5179
|
+
"name": "baseUri",
|
|
5180
|
+
"attribute": "base-uri",
|
|
5181
|
+
"type": "string"
|
|
5182
|
+
},
|
|
5183
|
+
{
|
|
5184
|
+
"name": "items",
|
|
5185
|
+
"attribute": "items",
|
|
5186
|
+
"description": "Array of image",
|
|
5187
|
+
"type": "array",
|
|
5188
|
+
"default": "[]"
|
|
5189
|
+
},
|
|
5190
|
+
{
|
|
5191
|
+
"name": "urls",
|
|
5192
|
+
"type": "Set<any>"
|
|
5193
|
+
},
|
|
5194
|
+
{
|
|
5195
|
+
"name": "imageHeight",
|
|
5196
|
+
"attribute": "image-height",
|
|
5197
|
+
"type": "number",
|
|
5198
|
+
"default": "80"
|
|
5199
|
+
},
|
|
5200
|
+
{
|
|
5201
|
+
"name": "imageWidth",
|
|
5202
|
+
"attribute": "image-width",
|
|
5203
|
+
"type": "number",
|
|
5204
|
+
"default": "64"
|
|
5205
|
+
},
|
|
5206
|
+
{
|
|
5207
|
+
"name": "subscribe",
|
|
5208
|
+
"attribute": "subscribe",
|
|
5209
|
+
"description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
|
|
5210
|
+
"type": "string"
|
|
5211
|
+
},
|
|
5212
|
+
{
|
|
5213
|
+
"name": "subscribeConfig",
|
|
5214
|
+
"attribute": "subscribe-config",
|
|
5215
|
+
"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.",
|
|
5216
|
+
"type": "object"
|
|
5217
|
+
},
|
|
5218
|
+
{
|
|
5219
|
+
"name": "emit",
|
|
5220
|
+
"attribute": "emit",
|
|
5221
|
+
"description": "The name of the channel to send events to.",
|
|
5222
|
+
"type": "string"
|
|
5223
|
+
},
|
|
5224
|
+
{
|
|
5225
|
+
"name": "emitConfig",
|
|
5226
|
+
"attribute": "emit-config",
|
|
5227
|
+
"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.",
|
|
5228
|
+
"type": "object"
|
|
5229
|
+
},
|
|
5230
|
+
{
|
|
5231
|
+
"name": "waitFor",
|
|
5232
|
+
"attribute": "wait-for",
|
|
5233
|
+
"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.",
|
|
5234
|
+
"type": "string"
|
|
5235
|
+
},
|
|
5236
|
+
{
|
|
5237
|
+
"name": "disabled",
|
|
5238
|
+
"attribute": "disabled",
|
|
5239
|
+
"description": "Common property to disable the functionality associated with a component.\n`pb-highlight` and `pb-popover` react to this.",
|
|
5240
|
+
"type": "boolean",
|
|
5241
|
+
"default": "false"
|
|
5242
|
+
}
|
|
5243
|
+
]
|
|
5244
|
+
},
|
|
5079
5245
|
{
|
|
5080
5246
|
"name": "pb-lang",
|
|
5081
5247
|
"path": "./src/pb-lang.js",
|
|
@@ -7996,6 +8162,11 @@
|
|
|
7996
8162
|
"type": "string",
|
|
7997
8163
|
"default": "\".\""
|
|
7998
8164
|
},
|
|
8165
|
+
{
|
|
8166
|
+
"name": "url-path",
|
|
8167
|
+
"type": "string",
|
|
8168
|
+
"default": "\"path\""
|
|
8169
|
+
},
|
|
7999
8170
|
{
|
|
8000
8171
|
"name": "api-version",
|
|
8001
8172
|
"type": "string",
|
|
@@ -8092,6 +8263,12 @@
|
|
|
8092
8263
|
"type": "string",
|
|
8093
8264
|
"default": "\".\""
|
|
8094
8265
|
},
|
|
8266
|
+
{
|
|
8267
|
+
"name": "urlPath",
|
|
8268
|
+
"attribute": "url-path",
|
|
8269
|
+
"type": "string",
|
|
8270
|
+
"default": "\"path\""
|
|
8271
|
+
},
|
|
8095
8272
|
{
|
|
8096
8273
|
"name": "apiVersion",
|
|
8097
8274
|
"attribute": "api-version",
|
|
@@ -9202,6 +9379,11 @@
|
|
|
9202
9379
|
"name": "subforms",
|
|
9203
9380
|
"type": "string"
|
|
9204
9381
|
},
|
|
9382
|
+
{
|
|
9383
|
+
"name": "name",
|
|
9384
|
+
"type": "string",
|
|
9385
|
+
"default": "\"query\""
|
|
9386
|
+
},
|
|
9205
9387
|
{
|
|
9206
9388
|
"name": "value",
|
|
9207
9389
|
"type": "string",
|
|
@@ -9227,6 +9409,11 @@
|
|
|
9227
9409
|
"type": "boolean",
|
|
9228
9410
|
"default": "false"
|
|
9229
9411
|
},
|
|
9412
|
+
{
|
|
9413
|
+
"name": "start",
|
|
9414
|
+
"type": "number",
|
|
9415
|
+
"default": "1"
|
|
9416
|
+
},
|
|
9230
9417
|
{
|
|
9231
9418
|
"name": "subscribe",
|
|
9232
9419
|
"description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
|
|
@@ -9275,6 +9462,12 @@
|
|
|
9275
9462
|
"attribute": "subforms",
|
|
9276
9463
|
"type": "string"
|
|
9277
9464
|
},
|
|
9465
|
+
{
|
|
9466
|
+
"name": "name",
|
|
9467
|
+
"attribute": "name",
|
|
9468
|
+
"type": "string",
|
|
9469
|
+
"default": "\"query\""
|
|
9470
|
+
},
|
|
9278
9471
|
{
|
|
9279
9472
|
"name": "value",
|
|
9280
9473
|
"attribute": "value",
|
|
@@ -9305,6 +9498,12 @@
|
|
|
9305
9498
|
"type": "boolean",
|
|
9306
9499
|
"default": "false"
|
|
9307
9500
|
},
|
|
9501
|
+
{
|
|
9502
|
+
"name": "start",
|
|
9503
|
+
"attribute": "start",
|
|
9504
|
+
"type": "number",
|
|
9505
|
+
"default": "1"
|
|
9506
|
+
},
|
|
9308
9507
|
{
|
|
9309
9508
|
"name": "subscribe",
|
|
9310
9509
|
"attribute": "subscribe",
|
|
@@ -9385,7 +9584,7 @@
|
|
|
9385
9584
|
{
|
|
9386
9585
|
"name": "pb-select-feature",
|
|
9387
9586
|
"path": "./src/pb-select-feature.js",
|
|
9388
|
-
"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\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 `.
|
|
9587
|
+
"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\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`).",
|
|
9389
9588
|
"attributes": [
|
|
9390
9589
|
{
|
|
9391
9590
|
"name": "name",
|
|
@@ -9511,6 +9710,9 @@
|
|
|
9511
9710
|
{
|
|
9512
9711
|
"name": "pb-toggle",
|
|
9513
9712
|
"description": "Fired when a feature is selected from the dropdown and sends the selected properties"
|
|
9713
|
+
},
|
|
9714
|
+
{
|
|
9715
|
+
"name": "pb-global-toggle"
|
|
9514
9716
|
}
|
|
9515
9717
|
]
|
|
9516
9718
|
},
|
|
@@ -10363,7 +10565,7 @@
|
|
|
10363
10565
|
{
|
|
10364
10566
|
"name": "selected",
|
|
10365
10567
|
"type": "number",
|
|
10366
|
-
"default": "
|
|
10568
|
+
"default": "0"
|
|
10367
10569
|
},
|
|
10368
10570
|
{
|
|
10369
10571
|
"name": "subscribe",
|
|
@@ -10402,7 +10604,7 @@
|
|
|
10402
10604
|
"name": "selected",
|
|
10403
10605
|
"attribute": "selected",
|
|
10404
10606
|
"type": "number",
|
|
10405
|
-
"default": "
|
|
10607
|
+
"default": "0"
|
|
10406
10608
|
},
|
|
10407
10609
|
{
|
|
10408
10610
|
"name": "subscribe",
|
|
@@ -10733,16 +10935,6 @@
|
|
|
10733
10935
|
"description": "(optional) CSS selector: selects the elements to toggle client side (sets or unsets a \nCSS class `.toggled`). Setting this property will not trigger a reload as everything is\nhandled by javascript.",
|
|
10734
10936
|
"type": "string"
|
|
10735
10937
|
},
|
|
10736
|
-
{
|
|
10737
|
-
"name": "on",
|
|
10738
|
-
"description": "Value to set the parameter to when the feature is enabled.",
|
|
10739
|
-
"type": "string"
|
|
10740
|
-
},
|
|
10741
|
-
{
|
|
10742
|
-
"name": "off",
|
|
10743
|
-
"description": "Value to set the parameter to when the feature is disabled.",
|
|
10744
|
-
"type": "string"
|
|
10745
|
-
},
|
|
10746
10938
|
{
|
|
10747
10939
|
"name": "checked",
|
|
10748
10940
|
"type": "boolean"
|
|
@@ -10753,6 +10945,18 @@
|
|
|
10753
10945
|
"type": "string",
|
|
10754
10946
|
"default": "\"on\""
|
|
10755
10947
|
},
|
|
10948
|
+
{
|
|
10949
|
+
"name": "on",
|
|
10950
|
+
"description": "Value to set the parameter to when the feature is enabled.",
|
|
10951
|
+
"type": "string",
|
|
10952
|
+
"default": "\"on\""
|
|
10953
|
+
},
|
|
10954
|
+
{
|
|
10955
|
+
"name": "off",
|
|
10956
|
+
"description": "Value to set the parameter to when the feature is disabled.",
|
|
10957
|
+
"type": "string",
|
|
10958
|
+
"default": "\"off\""
|
|
10959
|
+
},
|
|
10756
10960
|
{
|
|
10757
10961
|
"name": "action",
|
|
10758
10962
|
"description": "In combination with a selector specifies the action to be taken, currently one of\n`toggle` (default) or `disable`.",
|
|
@@ -10822,18 +11026,6 @@
|
|
|
10822
11026
|
"description": "(optional) CSS selector: selects the elements to toggle client side (sets or unsets a \nCSS class `.toggled`). Setting this property will not trigger a reload as everything is\nhandled by javascript.",
|
|
10823
11027
|
"type": "string"
|
|
10824
11028
|
},
|
|
10825
|
-
{
|
|
10826
|
-
"name": "on",
|
|
10827
|
-
"attribute": "on",
|
|
10828
|
-
"description": "Value to set the parameter to when the feature is enabled.",
|
|
10829
|
-
"type": "string"
|
|
10830
|
-
},
|
|
10831
|
-
{
|
|
10832
|
-
"name": "off",
|
|
10833
|
-
"attribute": "off",
|
|
10834
|
-
"description": "Value to set the parameter to when the feature is disabled.",
|
|
10835
|
-
"type": "string"
|
|
10836
|
-
},
|
|
10837
11029
|
{
|
|
10838
11030
|
"name": "checked",
|
|
10839
11031
|
"attribute": "checked",
|
|
@@ -10846,6 +11038,20 @@
|
|
|
10846
11038
|
"type": "string",
|
|
10847
11039
|
"default": "\"on\""
|
|
10848
11040
|
},
|
|
11041
|
+
{
|
|
11042
|
+
"name": "on",
|
|
11043
|
+
"attribute": "on",
|
|
11044
|
+
"description": "Value to set the parameter to when the feature is enabled.",
|
|
11045
|
+
"type": "string",
|
|
11046
|
+
"default": "\"on\""
|
|
11047
|
+
},
|
|
11048
|
+
{
|
|
11049
|
+
"name": "off",
|
|
11050
|
+
"attribute": "off",
|
|
11051
|
+
"description": "Value to set the parameter to when the feature is disabled.",
|
|
11052
|
+
"type": "string",
|
|
11053
|
+
"default": "\"off\""
|
|
11054
|
+
},
|
|
10849
11055
|
{
|
|
10850
11056
|
"name": "action",
|
|
10851
11057
|
"attribute": "action",
|
|
@@ -10938,6 +11144,12 @@
|
|
|
10938
11144
|
"description": "a comma-separated list of file suffixes to accept for upload\n(by default: .xml,.tei,.odd,.docx)",
|
|
10939
11145
|
"type": "string"
|
|
10940
11146
|
},
|
|
11147
|
+
{
|
|
11148
|
+
"name": "event",
|
|
11149
|
+
"description": "the event to emit when the upload has completed (default: 'pb-load')",
|
|
11150
|
+
"type": "string",
|
|
11151
|
+
"default": "\"pb-load\""
|
|
11152
|
+
},
|
|
10941
11153
|
{
|
|
10942
11154
|
"name": "subscribe",
|
|
10943
11155
|
"description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
|
|
@@ -10983,6 +11195,13 @@
|
|
|
10983
11195
|
"description": "a comma-separated list of file suffixes to accept for upload\n(by default: .xml,.tei,.odd,.docx)",
|
|
10984
11196
|
"type": "string"
|
|
10985
11197
|
},
|
|
11198
|
+
{
|
|
11199
|
+
"name": "event",
|
|
11200
|
+
"attribute": "event",
|
|
11201
|
+
"description": "the event to emit when the upload has completed (default: 'pb-load')",
|
|
11202
|
+
"type": "string",
|
|
11203
|
+
"default": "\"pb-load\""
|
|
11204
|
+
},
|
|
10986
11205
|
{
|
|
10987
11206
|
"name": "subscribe",
|
|
10988
11207
|
"attribute": "subscribe",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{f as t,L as e,N as n,A as s}from"./pb-mixin-8a593923.js";const i=new Map;let a;function r(t){a=t}function o(t){return t instanceof n?t.startNode.isConnected:t instanceof s?t.committer.element.isConnected:t.element.isConnected}function c(){Object.keys(i).forEach(t=>{o(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)=>{o(e)&&d(e,t)})}function p(t,e){return a?a(t,e):t}const h=t(t=>e=>{i.set(e,t),d(e,t)}),f=(t,e)=>h(()=>p(t,e));document.addEventListener("pb-i18n-update",t=>{u(t.detail)}),setInterval(()=>l(()=>c()),6e4);class b extends e{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()}_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",b);export{p as g,r as i,f 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 s,c as a}from"./pb-mixin-
|
|
1
|
+
import{L as t,p as e,r as i,h as s,c as a}from"./pb-mixin-8a593923.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))})}}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>
|