@teipublisher/pb-components 2.12.5 → 2.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5090,31 +5090,31 @@
5090
5090
  "path": "./src/pb-i18n.js",
5091
5091
  "description": "Insert translated text somewhere on an HTML page. If no translation is found,\ndisplay the contained content.",
5092
5092
  "attributes": [
5093
+ {
5094
+ "name": "options",
5095
+ "description": "Optional interpolation parameters to be passed to the\ntranslation function",
5096
+ "type": "object"
5097
+ },
5093
5098
  {
5094
5099
  "name": "key",
5095
5100
  "description": "The i18n key to use for looking up the translation.",
5096
5101
  "type": "string",
5097
5102
  "default": "\"missing-key\""
5098
- },
5103
+ }
5104
+ ],
5105
+ "properties": [
5099
5106
  {
5100
5107
  "name": "options",
5108
+ "attribute": "options",
5101
5109
  "description": "Optional interpolation parameters to be passed to the\ntranslation function",
5102
5110
  "type": "object"
5103
- }
5104
- ],
5105
- "properties": [
5111
+ },
5106
5112
  {
5107
5113
  "name": "key",
5108
5114
  "attribute": "key",
5109
5115
  "description": "The i18n key to use for looking up the translation.",
5110
5116
  "type": "string",
5111
5117
  "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
5118
  }
5119
5119
  ]
5120
5120
  },
@@ -5642,6 +5642,10 @@
5642
5642
  "name": "hash",
5643
5643
  "type": "string"
5644
5644
  },
5645
+ {
5646
+ "name": "xpath",
5647
+ "type": "string"
5648
+ },
5645
5649
  {
5646
5650
  "name": "path",
5647
5651
  "description": "Browse to a different document",
@@ -5718,6 +5722,11 @@
5718
5722
  "attribute": "hash",
5719
5723
  "type": "string"
5720
5724
  },
5725
+ {
5726
+ "name": "xpath",
5727
+ "attribute": "xpath",
5728
+ "type": "string"
5729
+ },
5721
5730
  {
5722
5731
  "name": "path",
5723
5732
  "attribute": "path",
@@ -11938,6 +11947,10 @@
11938
11947
  }
11939
11948
  ],
11940
11949
  "events": [
11950
+ {
11951
+ "name": "pb-annotations-loaded",
11952
+ "description": "fired after text was loaded and annotations were drawn"
11953
+ },
11941
11954
  {
11942
11955
  "name": "pb-selection-changed",
11943
11956
  "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};