@fluid-topics/ft-reader-toc 1.0.47 → 1.0.49

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.
@@ -93,7 +93,7 @@ var vt,xt;let yt=class extends R{constructor(){super(...arguments),this.renderOp
93
93
  display: inline-block;
94
94
  width: 0;
95
95
  }
96
- `;class zt{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var i,o;t=this.resolvePluralKey(t,e);let n=null!==(o=null!==(i=this.labels[t])&&void 0!==i?i:this.defaultLabels[t])&&void 0!==o?o:"";return e.forEach(((t,e)=>n=n.replace(new RegExp(`\\{${e}([^}]*)\\}`,"g"),((e,i)=>this.formatValue(t,i))))),n}resolvePluralKey(t,e){for(let i of e)if("number"==typeof i){const e=`${String(t)}[\\=${i}]`;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 i=i=>(null==e?void 0:e.includes("date"))?t.toLocaleDateString(i):(null==e?void 0:e.includes("time"))?t.toLocaleTimeString(i):t.toLocaleString(i);try{return i(document.documentElement.lang)}catch(t){return i()}}}var At,Ut,jt;const Ft=t=>{const e=null!=t?t:{};return(t,i)=>{var n;const s={hasChanged:(t,e)=>!h(t,e),attribute:!1,...e};o(s)(t,i);const r=t;r.reduxProperties=r.reduxProperties||new Map,r.reduxProperties.set(i,{selector:null!==(n=e.selector)&&void 0!==n?n:t=>t[i],store:e.store})}},Lt=Symbol("internalReduxEventsUnsubscribers"),It=Symbol("internalStoresUnsubscribers"),Tt=Symbol("internalStores");class Bt extends Et{constructor(){super(...arguments),this[At]=new Map,this[Ut]=new Map,this[jt]=[]}updated(t){var e;super.updated(t),(null===(e=this.reduxReactiveProperties)||void 0===e?void 0:e.some((e=>t.has(e))))&&this.updateFromStores()}getUnnamedStore(){if(this[Tt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Tt].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Tt].get(t)}addStore(t,e){var i;e=null!==(i=null!=e?e:Pt(t)?t.name:void 0)&&void 0!==i?i:"default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[Tt].delete(e)}setupStore(t,e){this[Tt].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Tt].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const i=this.constructor.getPropertyOptions(e);if(!(null==i?void 0:i.attribute)||!this.hasAttribute("string"==typeof(null==i?void 0:i.attribute)?i.attribute:e)){const i=this.getStore(t.store);i&&(t.store?this[It].has(t.store):this[It].size>0)&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){var i;this[It].set(t,e.subscribe((()=>this.updateFromStores()))),Pt(e)&&e.eventBus&&(null===(i=this.reduxEventListeners)||void 0===i||i.forEach(((t,i)=>{if("function"==typeof this[i]&&(!t.store||e.name===t.store)){const o=t=>this[i](t);e.eventBus.addEventListener(t.eventName,o),this[Lt].push((()=>e.eventBus.removeEventListener(t.eventName,o)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[It].forEach(((t,e)=>this.unsubscribeFromStore(e))),this[Lt].forEach((t=>t())),this[Lt]=[]}unsubscribeFromStore(t){this[It].has(t)&&this[It].get(t)(),this[It].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}function Pt(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}var _t,Dt,Wt;At=It,Ut=Tt,jt=Lt;const Ht=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(Wt=null===(Dt=null===(_t=window.safari)||void 0===_t?void 0:_t.pushNotification)||void 0===Dt?void 0:Dt.toString())&&void 0!==Wt?Wt:""),Kt=1,Zt=2,Vt=t=>(...e)=>({_$litDirective$:t,values:e});
96
+ `;class zt{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var i,o;t=this.resolvePluralKey(t,e);let n=null!==(o=null!==(i=this.labels[t])&&void 0!==i?i:this.defaultLabels[t])&&void 0!==o?o:"";return e.forEach(((t,e)=>n=n.replace(new RegExp(`\\{${e}([^}]*)\\}`,"g"),((e,i)=>this.formatValue(t,i))))),n}resolvePluralKey(t,e){for(let i of e)if("number"==typeof i){const e=`${String(t)}[\\=${i}]`;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 i=i=>(null==e?void 0:e.includes("date"))?t.toLocaleDateString(i):(null==e?void 0:e.includes("time"))?t.toLocaleTimeString(i):t.toLocaleString(i);try{return i(document.documentElement.lang)}catch(t){return i()}}}function At(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}var Ut,jt,Ft;const Lt=Symbol("internalReduxEventsUnsubscribers"),It=Symbol("internalStoresUnsubscribers"),Tt=Symbol("internalStores");class Bt extends Et{constructor(){super(...arguments),this[Ut]=new Map,this[jt]=new Map,this[Ft]=[]}updated(t){var e;super.updated(t),(null===(e=this.reduxReactiveProperties)||void 0===e?void 0:e.some((e=>t.has(e))))&&this.updateFromStores()}getUnnamedStore(){if(this[Tt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Tt].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Tt].get(t)}addStore(t,e){var i;e=null!==(i=null!=e?e:At(t)?t.name:void 0)&&void 0!==i?i:"default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[Tt].delete(e)}setupStore(t,e){this[Tt].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Tt].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const i=this.constructor.getPropertyOptions(e);if(!(null==i?void 0:i.attribute)||!this.hasAttribute("string"==typeof(null==i?void 0:i.attribute)?i.attribute:e)){const i=this.getStore(t.store);i&&(t.store?this[It].has(t.store):this[It].size>0)&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){var i;this[It].set(t,e.subscribe((()=>this.updateFromStores()))),At(e)&&e.eventBus&&(null===(i=this.reduxEventListeners)||void 0===i||i.forEach(((t,i)=>{if("function"==typeof this[i]&&(!t.store||e.name===t.store)){const o=t=>this[i](t);e.eventBus.addEventListener(t.eventName,o),this[Lt].push((()=>e.eventBus.removeEventListener(t.eventName,o)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[It].forEach(((t,e)=>this.unsubscribeFromStore(e))),this[Lt].forEach((t=>t())),this[Lt]=[]}unsubscribeFromStore(t){this[It].has(t)&&this[It].get(t)(),this[It].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}Ut=It,jt=Tt,Ft=Lt,window.ftReduxStores||(window.ftReduxStores={});const Pt=t=>{const e=null!=t?t:{};return(t,i)=>{var n;const s={hasChanged:(t,e)=>!h(t,e),attribute:!1,...e};o(s)(t,i);const r=t;r.reduxProperties=r.reduxProperties||new Map,r.reduxProperties.set(i,{selector:null!==(n=e.selector)&&void 0!==n?n:t=>t[i],store:e.store})}};var _t,Dt,Wt;const Ht=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(Wt=null===(Dt=null===(_t=window.safari)||void 0===_t?void 0:_t.pushNotification)||void 0===Dt?void 0:Dt.toString())&&void 0!==Wt?Wt:""),Kt=1,Zt=2,Vt=t=>(...e)=>({_$litDirective$:t,values:e});
97
97
  /**
98
98
  * @license
99
99
  * Copyright 2017 Google LLC
@@ -837,4 +837,4 @@ function(t,e,i){let o,n=t;return"object"==typeof t?(n=t.slot,o=t):o={flatten:e},
837
837
  </div>
838
838
  `:Q}
839
839
  </div>
840
- `}buildAutomaticallyExpandedNodes(t){var e,i;let o=new Set(this.autoCollapse?[]:this.automaticallyExpandedNodes);for(let n of t){let t=n;for(;t&&!o.has(t);)o.add(t),this.manuallyCollapsedNodes.delete(t),t=null===(i=null===(e=this.service)||void 0===e?void 0:e.getTocNodeNow(t))||void 0===i?void 0:i.parentTocId}return o}manuallyToggle(t,e){e?(this.manuallyCollapsedNodes.add(t),this.manuallyExpandedNodes.delete(t)):(this.manuallyExpandedNodes.add(t),this.manuallyCollapsedNodes.delete(t)),this.requestUpdate()}onViewportSizeChange(t){this.viewportSize=t.detail.category}toggleExpandCollapseAll(){this.expandAll=!this.expandAll,this.automaticallyExpandedNodes=new Set,this.manuallyExpandedNodes=new Set,this.manuallyCollapsedNodes=new Set}getExpandCollapseAllTooltipPosition(){switch(this.expandCollapseAllAlignment){case"right":return"left";case"left":return"right";default:return"bottom"}}}Io.elementDefinitions={"ft-button":Eo,"ft-reader-internal-link":Ii,"ft-size-watcher":Ao,"ft-typography":Ui},Io.styles=Fo,Lo([o({type:Boolean})],Io.prototype,"expanded",void 0),Lo([o()],Io.prototype,"iconVariant",void 0),Lo([o()],Io.prototype,"collapseIcon",void 0),Lo([o()],Io.prototype,"expandIcon",void 0),Lo([o({type:Boolean})],Io.prototype,"expandCollapseAll",void 0),Lo([o({type:Boolean})],Io.prototype,"expandCollapseAllHideLabel",void 0),Lo([o({type:Boolean})],Io.prototype,"expandCollapseAllTrailingIcon",void 0),Lo([o()],Io.prototype,"expandCollapseAllAlignment",void 0),Lo([o({type:Boolean})],Io.prototype,"expandCollapseAllHideIcon",void 0),Lo([o()],Io.prototype,"expandCollapseAllIconVariant",void 0),Lo([o()],Io.prototype,"collapseAllIcon",void 0),Lo([o()],Io.prototype,"expandAllIcon",void 0),Lo([o({type:Boolean})],Io.prototype,"autoCollapse",void 0),Lo([o()],Io.prototype,"scope",void 0),Lo([o({type:Boolean})],Io.prototype,"hideIfEmpty",void 0),Lo([o({type:Boolean,reflect:!0})],Io.prototype,"empty",void 0),Lo([p({})],Io.prototype,"labels",void 0),Lo([Ft({selector:(t,e)=>{var i,o,n;return e.isCurrentPageToc?(null===(i=t.paginationConfiguration)||void 0===i?void 0:i.splitCurrentPageToc)?null===(o=t.currentPage)||void 0===o?void 0:o.toc:void 0:(null===(n=t.paginationConfiguration)||void 0===n?void 0:n.splitCurrentPageToc)?t.pagesToc:t.toc}})],Io.prototype,"toc",void 0),Lo([Ft({selector:t=>{var e;return null===(e=t.paginationConfiguration)||void 0===e?void 0:e.splitCurrentPageToc}})],Io.prototype,"splitToc",void 0),Lo([Ft()],Io.prototype,"currentPage",void 0),Lo([Ft({selector:(t,e)=>{var i,o;return(null===(i=t.paginationConfiguration)||void 0===i?void 0:i.splitCurrentPageToc)&&!e.isCurrentPageToc?[null===(o=t.currentPage)||void 0===o?void 0:o.rootTocId]:t.visibleTopics}})],Io.prototype,"highlightedTocIds",void 0),Lo([n({hasChanged:(t,e)=>!h(t,e)})],Io.prototype,"automaticallyExpandedNodes",void 0),Lo([n({hasChanged:(t,e)=>!h(t,e)})],Io.prototype,"manuallyExpandedNodes",void 0),Lo([n({hasChanged:(t,e)=>!h(t,e)})],Io.prototype,"manuallyCollapsedNodes",void 0),Lo([n()],Io.prototype,"expandAll",void 0),Lo([n()],Io.prototype,"viewportSize",void 0),c("ft-reader-toc")(Io),t.DEFAULT_LABELS=Uo,t.FtReaderToc=Io,t.FtReaderTocCssVariables=jo,t.styles=Fo}({});
840
+ `}buildAutomaticallyExpandedNodes(t){var e,i;let o=new Set(this.autoCollapse?[]:this.automaticallyExpandedNodes);for(let n of t){let t=n;for(;t&&!o.has(t);)o.add(t),this.manuallyCollapsedNodes.delete(t),t=null===(i=null===(e=this.service)||void 0===e?void 0:e.getTocNodeNow(t))||void 0===i?void 0:i.parentTocId}return o}manuallyToggle(t,e){e?(this.manuallyCollapsedNodes.add(t),this.manuallyExpandedNodes.delete(t)):(this.manuallyExpandedNodes.add(t),this.manuallyCollapsedNodes.delete(t)),this.requestUpdate()}onViewportSizeChange(t){this.viewportSize=t.detail.category}toggleExpandCollapseAll(){this.expandAll=!this.expandAll,this.automaticallyExpandedNodes=new Set,this.manuallyExpandedNodes=new Set,this.manuallyCollapsedNodes=new Set}getExpandCollapseAllTooltipPosition(){switch(this.expandCollapseAllAlignment){case"right":return"left";case"left":return"right";default:return"bottom"}}}Io.elementDefinitions={"ft-button":Eo,"ft-reader-internal-link":Ii,"ft-size-watcher":Ao,"ft-typography":Ui},Io.styles=Fo,Lo([o({type:Boolean})],Io.prototype,"expanded",void 0),Lo([o()],Io.prototype,"iconVariant",void 0),Lo([o()],Io.prototype,"collapseIcon",void 0),Lo([o()],Io.prototype,"expandIcon",void 0),Lo([o({type:Boolean})],Io.prototype,"expandCollapseAll",void 0),Lo([o({type:Boolean})],Io.prototype,"expandCollapseAllHideLabel",void 0),Lo([o({type:Boolean})],Io.prototype,"expandCollapseAllTrailingIcon",void 0),Lo([o()],Io.prototype,"expandCollapseAllAlignment",void 0),Lo([o({type:Boolean})],Io.prototype,"expandCollapseAllHideIcon",void 0),Lo([o()],Io.prototype,"expandCollapseAllIconVariant",void 0),Lo([o()],Io.prototype,"collapseAllIcon",void 0),Lo([o()],Io.prototype,"expandAllIcon",void 0),Lo([o({type:Boolean})],Io.prototype,"autoCollapse",void 0),Lo([o()],Io.prototype,"scope",void 0),Lo([o({type:Boolean})],Io.prototype,"hideIfEmpty",void 0),Lo([o({type:Boolean,reflect:!0})],Io.prototype,"empty",void 0),Lo([p({})],Io.prototype,"labels",void 0),Lo([Pt({selector:(t,e)=>{var i,o,n;return e.isCurrentPageToc?(null===(i=t.paginationConfiguration)||void 0===i?void 0:i.splitCurrentPageToc)?null===(o=t.currentPage)||void 0===o?void 0:o.toc:void 0:(null===(n=t.paginationConfiguration)||void 0===n?void 0:n.splitCurrentPageToc)?t.pagesToc:t.toc}})],Io.prototype,"toc",void 0),Lo([Pt({selector:t=>{var e;return null===(e=t.paginationConfiguration)||void 0===e?void 0:e.splitCurrentPageToc}})],Io.prototype,"splitToc",void 0),Lo([Pt()],Io.prototype,"currentPage",void 0),Lo([Pt({selector:(t,e)=>{var i,o;return(null===(i=t.paginationConfiguration)||void 0===i?void 0:i.splitCurrentPageToc)&&!e.isCurrentPageToc?[null===(o=t.currentPage)||void 0===o?void 0:o.rootTocId]:t.visibleTopics}})],Io.prototype,"highlightedTocIds",void 0),Lo([n({hasChanged:(t,e)=>!h(t,e)})],Io.prototype,"automaticallyExpandedNodes",void 0),Lo([n({hasChanged:(t,e)=>!h(t,e)})],Io.prototype,"manuallyExpandedNodes",void 0),Lo([n({hasChanged:(t,e)=>!h(t,e)})],Io.prototype,"manuallyCollapsedNodes",void 0),Lo([n()],Io.prototype,"expandAll",void 0),Lo([n()],Io.prototype,"viewportSize",void 0),c("ft-reader-toc")(Io),t.DEFAULT_LABELS=Uo,t.FtReaderToc=Io,t.FtReaderTocCssVariables=jo,t.styles=Fo}({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-toc",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
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.0.47",
23
- "@fluid-topics/ft-reader-context": "1.0.47",
24
- "@fluid-topics/ft-size-watcher": "1.0.47",
25
- "@fluid-topics/ft-typography": "1.0.47",
26
- "@fluid-topics/ft-wc-utils": "1.0.47",
22
+ "@fluid-topics/ft-icon": "1.0.49",
23
+ "@fluid-topics/ft-reader-context": "1.0.49",
24
+ "@fluid-topics/ft-size-watcher": "1.0.49",
25
+ "@fluid-topics/ft-typography": "1.0.49",
26
+ "@fluid-topics/ft-wc-utils": "1.0.49",
27
27
  "lit": "2.7.2"
28
28
  },
29
- "gitHead": "6313471d9f5ceea14a13311e9a6cc24b6fa6f044"
29
+ "gitHead": "77eac237aeec17a50f5bcc09890746d9a9f097f0"
30
30
  }