@teipublisher/pb-components 2.12.6 → 2.12.8
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 +15 -0
- package/dist/pb-code-editor.js +1 -1
- package/dist/pb-components-bundle.js +5 -5
- package/dist/pb-edit-app.js +1 -1
- package/dist/pb-elements.json +18 -10
- package/dist/pb-i18n-375ccc5c.js +1 -0
- package/dist/pb-mei.js +1 -1
- package/dist/pb-odd-editor.js +1 -1
- package/dist/{vaadin-element-mixin-660b2157.js → vaadin-element-mixin-ec93018d.js} +1 -1
- package/i18n/common/en.json +4 -1
- package/package.json +1 -1
- package/pb-elements.json +18 -10
- package/src/pb-authority-lookup.js +1 -1
- package/src/pb-combo-box.js +17 -2
- package/src/pb-i18n.js +7 -2
- package/src/pb-view-annotate.js +9 -0
- package/dist/pb-i18n-9000294c.js +0 -1
package/dist/pb-edit-app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./paper-checkbox-c9177e35.js";import"./paper-listbox-1fc346ac.js";import{p as e,L as t,w as p,h as o,c as i}from"./pb-mixin-d61c06b6.js";import{t as a}from"./pb-i18n-
|
|
1
|
+
import"./paper-checkbox-c9177e35.js";import"./paper-listbox-1fc346ac.js";import{p as e,L as t,w as p,h as o,c as i}from"./pb-mixin-d61c06b6.js";import{t as a}from"./pb-i18n-375ccc5c.js";import"./iron-form-a25b58de.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"),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},[]),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=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 o`
|
|
2
2
|
<iron-form id="form">
|
|
3
3
|
<form method="POST" accept="application/json" enctype="application/json">
|
|
4
4
|
<fieldset>
|
package/dist/pb-elements.json
CHANGED
|
@@ -2761,6 +2761,10 @@
|
|
|
2761
2761
|
}
|
|
2762
2762
|
],
|
|
2763
2763
|
"properties": [
|
|
2764
|
+
{
|
|
2765
|
+
"name": "value",
|
|
2766
|
+
"type": "string | string[] | null"
|
|
2767
|
+
},
|
|
2764
2768
|
{
|
|
2765
2769
|
"name": "renderItem",
|
|
2766
2770
|
"description": "Set a javascript function to be called whenever an item\nneeds to be rendered. The function will be passed the data\nobject of the current item as argument.",
|
|
@@ -5090,31 +5094,31 @@
|
|
|
5090
5094
|
"path": "./src/pb-i18n.js",
|
|
5091
5095
|
"description": "Insert translated text somewhere on an HTML page. If no translation is found,\ndisplay the contained content.",
|
|
5092
5096
|
"attributes": [
|
|
5097
|
+
{
|
|
5098
|
+
"name": "options",
|
|
5099
|
+
"description": "Optional interpolation parameters to be passed to the\ntranslation function",
|
|
5100
|
+
"type": "object"
|
|
5101
|
+
},
|
|
5093
5102
|
{
|
|
5094
5103
|
"name": "key",
|
|
5095
5104
|
"description": "The i18n key to use for looking up the translation.",
|
|
5096
5105
|
"type": "string",
|
|
5097
5106
|
"default": "\"missing-key\""
|
|
5098
|
-
}
|
|
5107
|
+
}
|
|
5108
|
+
],
|
|
5109
|
+
"properties": [
|
|
5099
5110
|
{
|
|
5100
5111
|
"name": "options",
|
|
5112
|
+
"attribute": "options",
|
|
5101
5113
|
"description": "Optional interpolation parameters to be passed to the\ntranslation function",
|
|
5102
5114
|
"type": "object"
|
|
5103
|
-
}
|
|
5104
|
-
],
|
|
5105
|
-
"properties": [
|
|
5115
|
+
},
|
|
5106
5116
|
{
|
|
5107
5117
|
"name": "key",
|
|
5108
5118
|
"attribute": "key",
|
|
5109
5119
|
"description": "The i18n key to use for looking up the translation.",
|
|
5110
5120
|
"type": "string",
|
|
5111
5121
|
"default": "\"missing-key\""
|
|
5112
|
-
},
|
|
5113
|
-
{
|
|
5114
|
-
"name": "options",
|
|
5115
|
-
"attribute": "options",
|
|
5116
|
-
"description": "Optional interpolation parameters to be passed to the\ntranslation function",
|
|
5117
|
-
"type": "object"
|
|
5118
5122
|
}
|
|
5119
5123
|
]
|
|
5120
5124
|
},
|
|
@@ -11947,6 +11951,10 @@
|
|
|
11947
11951
|
}
|
|
11948
11952
|
],
|
|
11949
11953
|
"events": [
|
|
11954
|
+
{
|
|
11955
|
+
"name": "pb-annotations-loaded",
|
|
11956
|
+
"description": "fired after text was loaded and annotations were drawn"
|
|
11957
|
+
},
|
|
11950
11958
|
{
|
|
11951
11959
|
"name": "pb-selection-changed",
|
|
11952
11960
|
"description": "fired when user selects text"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as t,L as e,N as n,A as s}from"./pb-mixin-d61c06b6.js";const i=new Map;let a;function o(t){a=t}function r(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=>{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=t(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 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()}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};
|