@fluid-topics/ft-reader-title 1.1.3 → 1.1.5

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.
@@ -67,7 +67,7 @@ class yo extends Lt{constructor(){super(...arguments),this.renderOptions={host:t
67
67
  * @license
68
68
  * Copyright 2019 Google LLC
69
69
  * SPDX-License-Identifier: BSD-3-Clause
70
- */class Co extends yo{createRenderRoot(){const t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach((([o,e])=>t.registry.define(o,e))));const o={...t.shadowRootOptions,customElements:t.registry},e=this.renderOptions.creationScope=this.attachShadow(o);return((t,o)=>{vo?t.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):o.forEach((o=>{const e=document.createElement("style"),r=xo.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=o.cssText,t.appendChild(e)}))})(e,t.elementStyles),e}}var wo,Ro=function(t,o,e,r){for(var i,a=arguments.length,n=a<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(i=t[s])&&(n=(a<3?i(n):a>3?i(o,e,n):i(o,e))||n);return a>3&&n&&Object.defineProperty(o,e,n),n};const Uo=Symbol("constructorPrototype"),Eo=Symbol("constructorName"),Io=Symbol("exportpartsDebouncer");class Wo extends Co{constructor(){super(),this[wo]=new R(5),this[Eo]=this.constructor.name,this[Uo]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Eo]&&Object.setPrototypeOf(this,this[Uo])}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var o,e;if((null!==(e=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==e?e:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this[Io].run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var o,e,r,i,a,n;const s=t=>null!=t&&t.trim().length>0,c=t.filter(s).map((t=>t.trim()));if(0===c.length)return void this.removeAttribute("exportparts");const l=new Set;for(let t of null!==(e=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelectorAll("[part],[exportparts]"))&&void 0!==e?e:[]){const o=null!==(i=null===(r=t.getAttribute("part"))||void 0===r?void 0:r.split(" "))&&void 0!==i?i:[],e=null!==(n=null===(a=t.getAttribute("exportparts"))||void 0===a?void 0:a.split(",").map((t=>t.split(":")[1])))&&void 0!==n?n:[];new Array(...o,...e).filter(s).map((t=>t.trim())).forEach((t=>l.add(t)))}if(0===l.size)return void this.removeAttribute("exportparts");const p=[...l.values()].flatMap((t=>c.map((o=>`${t}:${o}--${t}`))));this.setAttribute("exportparts",[...this.part,...p].join(", "))}}wo=Io,Ro([C()],Wo.prototype,"exportpartsPrefix",void 0),Ro([function(t,o){const e=()=>JSON.parse(JSON.stringify(t));return C({type:Object,converter:{fromAttribute:t=>{if(null==t)return e();try{return JSON.parse(t)}catch{return e()}},toAttribute:t=>JSON.stringify(t)},hasChanged:(t,o)=>!U(t,o),...null!=o?o:{}})}([])],Wo.prototype,"exportpartsPrefixes",void 0),Ro([C()],Wo.prototype,"customStylesheet",void 0);const Lo=bo.create("--ft-utils-highlight-html-background-color","","COLOR","#FFF26E");function $o(t){var o;return null!==(o=null==t?void 0:t.isFtReduxStore)&&void 0!==o&&o}var ko,Ko,Zo;gt`
70
+ */class Co extends yo{createRenderRoot(){const t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach((([o,e])=>t.registry.define(o,e))));const o={...t.shadowRootOptions,customElements:t.registry},e=this.renderOptions.creationScope=this.attachShadow(o);return((t,o)=>{vo?t.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):o.forEach((o=>{const e=document.createElement("style"),r=xo.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=o.cssText,t.appendChild(e)}))})(e,t.elementStyles),e}}var wo,Ro=function(t,o,e,r){for(var i,a=arguments.length,n=a<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(i=t[s])&&(n=(a<3?i(n):a>3?i(o,e,n):i(o,e))||n);return a>3&&n&&Object.defineProperty(o,e,n),n};const Uo=Symbol("constructorPrototype"),Eo=Symbol("constructorName"),Io=Symbol("exportpartsDebouncer");class Wo extends Co{constructor(){super(),this[wo]=new R(5),this[Eo]=this.constructor.name,this[Uo]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Eo]&&Object.setPrototypeOf(this,this[Uo])}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var o,e;if((null!==(e=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==e?e:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this[Io].run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var o,e,r,i,a,n;const s=t=>null!=t&&t.trim().length>0,c=t.filter(s).map((t=>t.trim()));if(0===c.length)return void this.removeAttribute("exportparts");const l=new Set;for(let t of null!==(e=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelectorAll("[part],[exportparts]"))&&void 0!==e?e:[]){const o=null!==(i=null===(r=t.getAttribute("part"))||void 0===r?void 0:r.split(" "))&&void 0!==i?i:[],e=null!==(n=null===(a=t.getAttribute("exportparts"))||void 0===a?void 0:a.split(",").map((t=>t.split(":")[1])))&&void 0!==n?n:[];new Array(...o,...e).filter(s).map((t=>t.trim())).forEach((t=>l.add(t)))}if(0===l.size)return void this.removeAttribute("exportparts");const p=[...l.values()].flatMap((t=>c.map((o=>`${t}:${o}--${t}`))));this.setAttribute("exportparts",[...this.part,...p].join(", "))}}wo=Io,Ro([C()],Wo.prototype,"exportpartsPrefix",void 0),Ro([function(t,o){const e=()=>JSON.parse(JSON.stringify(t));return C({type:Object,converter:{fromAttribute:t=>{if(null==t)return e();try{return JSON.parse(t)}catch{return e()}},toAttribute:t=>JSON.stringify(t)},hasChanged:(t,o)=>!U(t,o),...null!=o?o:{}})}([])],Wo.prototype,"exportpartsPrefixes",void 0),Ro([C()],Wo.prototype,"customStylesheet",void 0);const Lo=bo.create("--ft-utils-highlight-html-background-color","","COLOR","#FFF26E");gt`
71
71
  .highlight-html-match {
72
72
  background: ${Lo};
73
73
  }
@@ -103,7 +103,7 @@ class yo extends Lt{constructor(){super(...arguments),this.renderOptions={host:t
103
103
  display: inline-block;
104
104
  width: 0;
105
105
  }
106
- `;const Fo=Symbol("internalReduxEventsUnsubscribers"),zo=Symbol("internalStoresUnsubscribers"),Ao=Symbol("internalStores");class Mo extends Wo{constructor(){super(...arguments),this[ko]=new Map,this[Ko]=new Map,this[Zo]=[]}update(t){var o;super.update(t),(null===(o=this.reduxReactiveProperties)||void 0===o?void 0:o.some((o=>t.has(o))))&&this.updateFromStores()}getUnnamedStore(){if(this[Ao].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ao].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Ao].get(t)}addStore(t,o){var e;o=null!==(e=null!=o?o:$o(t)?t.name:void 0)&&void 0!==e?e:"default-store",this.unsubscribeFromStore(o),this.setupStore(o,t)}removeStore(t){const o="string"==typeof t?t:t.name;this.unsubscribeFromStore(o),this[Ao].delete(o)}setupStore(t,o){this[Ao].set(t,o),this.subscribeToStore(t,o),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Ao].forEach(((t,o)=>this.subscribeToStore(o,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,o)=>{const e=this.constructor.getPropertyOptions(o);if(!(null==e?void 0:e.attribute)||!this.hasAttribute("string"==typeof(null==e?void 0:e.attribute)?e.attribute:o)){const e=this.getStore(t.store);e&&(t.store?this[zo].has(t.store):this[zo].size>0)&&(this[o]=t.selector(e.getState(),this))}}))}subscribeToStore(t,o){var e;this[zo].set(t,o.subscribe((()=>this.updateFromStores()))),$o(o)&&o.eventBus&&(null===(e=this.reduxEventListeners)||void 0===e||e.forEach(((t,e)=>{if("function"==typeof this[e]&&(!t.store||o.name===t.store)){const r=t=>this[e](t);o.eventBus.addEventListener(t.eventName,r),this[Fo].push((()=>o.eventBus.removeEventListener(t.eventName,r)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[zo].forEach(((t,o)=>this.unsubscribeFromStore(o))),this[Fo].forEach((t=>t())),this[Fo]=[]}unsubscribeFromStore(t){this[zo].has(t)&&this[zo].get(t)(),this[zo].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}ko=zo,Ko=Ao,Zo=Fo,window.ftReduxStores||(window.ftReduxStores={});var Do,Bo,Po;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Bo=null===(Do=window.safari)||void 0===Do?void 0:Do.pushNotification)||void 0===Bo||Bo.toString()),function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"}(Po||(Po={}));var Ho=function(t,o,e,r){for(var i,a=arguments.length,n=a<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(i=t[s])&&(n=(a<3?i(n):a>3?i(o,e,n):i(o,e))||n);return a>3&&n&&Object.defineProperty(o,e,n),n};class _o extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const To=Symbol("registerInterval");class Go extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[To]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[To]):this.dispatchEvent(new _o)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o=To,Ho([w()],e.prototype,"stateManager",void 0),e}(Mo)){}
106
+ `;function $o(t){var o;return null!==(o=null==t?void 0:t.isFtReduxStore)&&void 0!==o&&o}var ko,Ko,Zo;const Fo=Symbol("internalReduxEventsUnsubscribers"),zo=Symbol("internalStoresUnsubscribers"),Ao=Symbol("internalStores");class Mo extends Wo{constructor(){super(...arguments),this[ko]=new Map,this[Ko]=new Map,this[Zo]=[]}update(t){var o;super.update(t),(null===(o=this.reduxReactiveProperties)||void 0===o?void 0:o.some((o=>t.has(o))))&&this.updateFromStores()}getUnnamedStore(){if(this[Ao].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ao].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Ao].get(t)}addStore(t,o){var e;o=null!==(e=null!=o?o:$o(t)?t.name:void 0)&&void 0!==e?e:"default-store",this.unsubscribeFromStore(o),this.setupStore(o,t)}removeStore(t){const o="string"==typeof t?t:t.name;this.unsubscribeFromStore(o),this[Ao].delete(o)}setupStore(t,o){this[Ao].set(t,o),this.subscribeToStore(t,o),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Ao].forEach(((t,o)=>this.subscribeToStore(o,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,o)=>{const e=this.constructor.getPropertyOptions(o);if(!(null==e?void 0:e.attribute)||!this.hasAttribute("string"==typeof(null==e?void 0:e.attribute)?e.attribute:o)){const e=this.getStore(t.store);e&&(t.store?this[zo].has(t.store):this[zo].size>0)&&(this[o]=t.selector(e.getState(),this))}}))}subscribeToStore(t,o){var e;this[zo].set(t,o.subscribe((()=>this.updateFromStores()))),$o(o)&&o.eventBus&&(null===(e=this.reduxEventListeners)||void 0===e||e.forEach(((t,e)=>{if("function"==typeof this[e]&&(!t.store||o.name===t.store)){const r=t=>this[e](t);o.eventBus.addEventListener(t.eventName,r),this[Fo].push((()=>o.eventBus.removeEventListener(t.eventName,r)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[zo].forEach(((t,o)=>this.unsubscribeFromStore(o))),this[Fo].forEach((t=>t())),this[Fo]=[]}unsubscribeFromStore(t){this[zo].has(t)&&this[zo].get(t)(),this[zo].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}var Do,Bo,Po;ko=zo,Ko=Ao,Zo=Fo,window.ftReduxStores||(window.ftReduxStores={}),navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Bo=null===(Do=window.safari)||void 0===Do?void 0:Do.pushNotification)||void 0===Bo||Bo.toString()),function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"}(Po||(Po={}));var Ho=function(t,o,e,r){for(var i,a=arguments.length,n=a<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(i=t[s])&&(n=(a<3?i(n):a>3?i(o,e,n):i(o,e))||n);return a>3&&n&&Object.defineProperty(o,e,n),n};class _o extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const To=Symbol("registerInterval");class Go extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[To]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[To]):this.dispatchEvent(new _o)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o=To,Ho([w()],e.prototype,"stateManager",void 0),e}(Mo)){}
107
107
  /**
108
108
  * @license
109
109
  * Copyright 2020 Google LLC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-title",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Title for integrated reader",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,9 +19,9 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-reader-context": "1.1.3",
23
- "@fluid-topics/ft-wc-utils": "1.1.3",
22
+ "@fluid-topics/ft-reader-context": "1.1.5",
23
+ "@fluid-topics/ft-wc-utils": "1.1.5",
24
24
  "lit": "3.1.0"
25
25
  },
26
- "gitHead": "0d44a470e710f185c37e42ee87be4481a3bdf793"
26
+ "gitHead": "334ea71061e13d064f1f59b0f75d84c46d32d860"
27
27
  }