@fluid-topics/ft-reader-toc 1.1.6 → 1.1.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.
|
@@ -122,7 +122,7 @@ let Oe=class extends Bt{constructor(){super(...arguments),this.renderOptions={ho
|
|
|
122
122
|
display: inline-block;
|
|
123
123
|
width: 0;
|
|
124
124
|
}
|
|
125
|
-
`;class He{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var o,i;t=this.resolvePluralKey(t,e);let r=null!==(i=null!==(o=this.labels[t])&&void 0!==o?o:this.defaultLabels[t])&&void 0!==i?i:"";return e.forEach(((t,e)=>r=r.replace(new RegExp(`\\{${e}([^}]*)\\}`,"g"),((e,o)=>this.formatValue(t,o))))),r}resolvePluralKey(t,e){for(let o of e)if("number"==typeof o){const e=`${String(t)}[\\=${o}]`;if(e in this.labels||e in this.defaultLabels)return e}return t}formatValue(t,e){return t instanceof Date?this.formatDate(t,e):null!=t?t:""}formatDate(t,e){const o=o=>(null==e?void 0:e.includes("date"))?t.toLocaleDateString(o):(null==e?void 0:e.includes("time"))?t.toLocaleTimeString(o):t.toLocaleString(o);try{return o(document.documentElement.lang)}catch(t){return o()}}}const Te=t=>{const e=null!=t?t:{};return(t,o)=>{var i;const r={hasChanged:(t,e)=>!U(t,e),attribute:!1,...e};w(r)(t,o);const n=t;n.reduxProperties=n.reduxProperties
|
|
125
|
+
`;class He{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var o,i;t=this.resolvePluralKey(t,e);let r=null!==(i=null!==(o=this.labels[t])&&void 0!==o?o:this.defaultLabels[t])&&void 0!==i?i:"";return e.forEach(((t,e)=>r=r.replace(new RegExp(`\\{${e}([^}]*)\\}`,"g"),((e,o)=>this.formatValue(t,o))))),r}resolvePluralKey(t,e){for(let o of e)if("number"==typeof o){const e=`${String(t)}[\\=${o}]`;if(e in this.labels||e in this.defaultLabels)return e}return t}formatValue(t,e){return t instanceof Date?this.formatDate(t,e):null!=t?t:""}formatDate(t,e){const o=o=>(null==e?void 0:e.includes("date"))?t.toLocaleDateString(o):(null==e?void 0:e.includes("time"))?t.toLocaleTimeString(o):t.toLocaleString(o);try{return o(document.documentElement.lang)}catch(t){return o()}}}const Te=t=>{const e=null!=t?t:{};return(t,o)=>{var i;const r={hasChanged:(t,e)=>!U(t,e),attribute:!1,...e};w(r)(t,o);const n=t.constructor;n.reduxProperties=new Map(n.reduxProperties),n.reduxProperties.set(o,{selector:null!==(i=e.selector)&&void 0!==i?i:t=>t[o],store:e.store})}};function je(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}var _e,Ge,Ve;const Ye=Symbol("internalReduxEventsUnsubscribers"),Xe=Symbol("internalStoresUnsubscribers"),Je=Symbol("internalStores");class qe extends Be{constructor(){super(...arguments),this[_e]=new Map,this[Ge]=new Map,this[Ve]=[]}get reduxConstructor(){return this.constructor}update(t){super.update(t),[...this.reduxConstructor.reduxReactiveProperties].some((e=>t.has(e)))&&this.updateFromStores()}getUnnamedStore(){if(this[Je].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Je].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Je].get(t)}addStore(t,e){var o;e=null!==(o=null!=e?e:je(t)?t.name:void 0)&&void 0!==o?o:"default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[Je].delete(e)}setupStore(t,e){this[Je].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Je].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach(((t,e)=>{const o=this.constructor.getPropertyOptions(e);if(!(null==o?void 0:o.attribute)||!this.hasAttribute("string"==typeof(null==o?void 0:o.attribute)?o.attribute:e)){const o=this.getStore(t.store);o&&(t.store?this[Xe].has(t.store):this[Xe].size>0)&&(this[e]=t.selector(o.getState(),this))}}))}subscribeToStore(t,e){var o;this[Xe].set(t,e.subscribe((()=>this.updateFromStores()))),je(e)&&e.eventBus&&(null===(o=this.reduxConstructor.reduxEventListeners)||void 0===o||o.forEach(((t,o)=>{if("function"==typeof this[o]&&(!t.store||e.name===t.store)){const i=t=>this[o](t);e.eventBus.addEventListener(t.eventName,i),this[Ye].push((()=>e.eventBus.removeEventListener(t.eventName,i)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[Xe].forEach(((t,e)=>this.unsubscribeFromStore(e))),this[Ye].forEach((t=>t())),this[Ye]=[]}unsubscribeFromStore(t){this[Xe].has(t)&&this[Xe].get(t)(),this[Xe].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}_e=Xe,Ge=Je,Ve=Ye,qe.reduxProperties=new Map,qe.reduxReactiveProperties=new Set,qe.reduxEventListeners=new Map,window.ftReduxStores||(window.ftReduxStores={});const Qe=Symbol("elementInternals");var to,eo,oo;const io=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(oo=null===(eo=null===(to=window.safari)||void 0===to?void 0:to.pushNotification)||void 0===eo?void 0:eo.toString())&&void 0!==oo?oo:""),ro=1,no=2,ao=t=>(...e)=>({_$litDirective$:t,values:e});
|
|
126
126
|
/**
|
|
127
127
|
* @license
|
|
128
128
|
* Copyright 2017 Google LLC
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-toc",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Main table of content for integrated reader",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-icon": "1.1.
|
|
23
|
-
"@fluid-topics/ft-reader-context": "1.1.
|
|
24
|
-
"@fluid-topics/ft-size-watcher": "1.1.
|
|
25
|
-
"@fluid-topics/ft-typography": "1.1.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-icon": "1.1.8",
|
|
23
|
+
"@fluid-topics/ft-reader-context": "1.1.8",
|
|
24
|
+
"@fluid-topics/ft-size-watcher": "1.1.8",
|
|
25
|
+
"@fluid-topics/ft-typography": "1.1.8",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "1.1.8",
|
|
27
27
|
"lit": "3.1.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "95fb2d06899d700513970ac830958922b98539df"
|
|
30
30
|
}
|