@fluid-topics/ft-reader-topic-context 1.0.55 → 1.0.56

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.
@@ -13,7 +13,7 @@ export declare class FtReaderTopicContext extends FtReaderComponent implements F
13
13
  protected render(): import("lit-html").TemplateResult<1>;
14
14
  private registerComponent;
15
15
  register(component: FtReaderTopicComponentInterface): void;
16
- protected updated(changedProperties: PropertyValues): void;
16
+ protected update(changedProperties: PropertyValues): void;
17
17
  private setTocNode;
18
18
  disconnectedCallback(): void;
19
19
  }
@@ -36,8 +36,8 @@ class FtReaderTopicContext extends FtReaderComponent {
36
36
  component.tocNode = this.tocNode;
37
37
  component.disableContextInteractions = this.disableContextInteractions;
38
38
  }
39
- updated(changedProperties) {
40
- super.updated(changedProperties);
39
+ update(changedProperties) {
40
+ super.update(changedProperties);
41
41
  if (["mapId", "tocId", "stateManager"].some(p => changedProperties.has(p))) {
42
42
  this.setTocNode();
43
43
  }
@@ -3,4 +3,4 @@
3
3
  <article id=${this.tocId}>
4
4
  <slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
5
5
  </article>
6
- `}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}updated(t){super.updated(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}l.styles=i,d([e.redux({selector:t=>{var e;return null===(e=t.map)||void 0===e?void 0:e.id}})],l.prototype,"mapId",void 0),d([r.property()],l.prototype,"tocId",void 0),d([r.property({type:Boolean})],l.prototype,"disableContextInteractions",void 0),d([r.state()],l.prototype,"tocNode",void 0),e.customElement("ft-reader-topic-context")(l),t.FtReaderTopicContext=l,t.FtReaderTopicContextCssVariables={},t.styles=i}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
6
+ `}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}update(t){super.update(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}l.styles=i,d([e.redux({selector:t=>{var e;return null===(e=t.map)||void 0===e?void 0:e.id}})],l.prototype,"mapId",void 0),d([r.property()],l.prototype,"tocId",void 0),d([r.property({type:Boolean})],l.prototype,"disableContextInteractions",void 0),d([r.state()],l.prototype,"tocNode",void 0),e.customElement("ft-reader-topic-context")(l),t.FtReaderTopicContext=l,t.FtReaderTopicContextCssVariables={},t.styles=i}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
@@ -84,9 +84,9 @@ var lt,ht;class ct extends S{constructor(){super(...arguments),this.renderOption
84
84
  display: inline-block;
85
85
  width: 0;
86
86
  }
87
- `;const St=Symbol("internalReduxEventsUnsubscribers"),Ct=Symbol("internalStoresUnsubscribers"),Et=Symbol("internalStores");class Rt extends wt{constructor(){super(...arguments),this[gt]=new Map,this[Ot]=new Map,this[Nt]=[]}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[Et].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Et].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Et].get(t)}addStore(t,e){var i;e=null!==(i=null!=e?e:yt(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[Et].delete(e)}setupStore(t,e){this[Et].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Et].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[Ct].has(t.store):this[Ct].size>0)&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){var i;this[Ct].set(t,e.subscribe((()=>this.updateFromStores()))),yt(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 s=t=>this[i](t);e.eventBus.addEventListener(t.eventName,s),this[St].push((()=>e.eventBus.removeEventListener(t.eventName,s)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[Ct].forEach(((t,e)=>this.unsubscribeFromStore(e))),this[St].forEach((t=>t())),this[St]=[]}unsubscribeFromStore(t){this[Ct].has(t)&&this[Ct].get(t)(),this[Ct].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}gt=Ct,Ot=Et,Nt=St,window.ftReduxStores||(window.ftReduxStores={});var Mt,Ut;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Ut=null===(Mt=window.safari)||void 0===Mt?void 0:Mt.pushNotification)||void 0===Ut||Ut.toString());const kt=p`
87
+ `;const St=Symbol("internalReduxEventsUnsubscribers"),Ct=Symbol("internalStoresUnsubscribers"),Et=Symbol("internalStores");class Rt extends wt{constructor(){super(...arguments),this[gt]=new Map,this[Ot]=new Map,this[Nt]=[]}update(t){var e;super.update(t),(null===(e=this.reduxReactiveProperties)||void 0===e?void 0:e.some((e=>t.has(e))))&&this.updateFromStores()}getUnnamedStore(){if(this[Et].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Et].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Et].get(t)}addStore(t,e){var i;e=null!==(i=null!=e?e:yt(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[Et].delete(e)}setupStore(t,e){this[Et].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Et].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[Ct].has(t.store):this[Ct].size>0)&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){var i;this[Ct].set(t,e.subscribe((()=>this.updateFromStores()))),yt(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 s=t=>this[i](t);e.eventBus.addEventListener(t.eventName,s),this[St].push((()=>e.eventBus.removeEventListener(t.eventName,s)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[Ct].forEach(((t,e)=>this.unsubscribeFromStore(e))),this[St].forEach((t=>t())),this[St]=[]}unsubscribeFromStore(t){this[Ct].has(t)&&this[Ct].get(t)(),this[Ct].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}gt=Ct,Ot=Et,Nt=St,window.ftReduxStores||(window.ftReduxStores={});var Mt,Ut;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Ut=null===(Mt=window.safari)||void 0===Mt?void 0:Mt.pushNotification)||void 0===Ut||Ut.toString());const kt=p`
88
88
  `;var $t=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ft extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const jt=Symbol("registerInterval");class At extends(function(t){var e;class i extends t{constructor(){super(...arguments),this[e]=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[jt]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[jt]):this.dispatchEvent(new Ft)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=jt,$t([o()],i.prototype,"stateManager",void 0),i}(Rt)){}var Lt,Bt=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Tt extends At{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return z`
89
89
  <article id=${this.tocId}>
90
90
  <slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
91
91
  </article>
92
- `}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}updated(t){super.updated(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}Tt.styles=kt,Bt([(t=>{const e=null!=t?t:{};return(t,i)=>{var o;const n={hasChanged:(t,e)=>!r(t,e),attribute:!1,...e};s(n)(t,i);const a=t;a.reduxProperties=a.reduxProperties||new Map,a.reduxProperties.set(i,{selector:null!==(o=e.selector)&&void 0!==o?o:t=>t[i],store:e.store})}})({selector:t=>{var e;return null===(e=t.map)||void 0===e?void 0:e.id}})],Tt.prototype,"mapId",void 0),Bt([s()],Tt.prototype,"tocId",void 0),Bt([s({type:Boolean})],Tt.prototype,"disableContextInteractions",void 0),Bt([o()],Tt.prototype,"tocNode",void 0),(Lt="ft-reader-topic-context",t=>{window.customElements.get(Lt)||window.customElements.define(Lt,t)})(Tt),t.FtReaderTopicContext=Tt,t.FtReaderTopicContextCssVariables={},t.styles=kt}({});
92
+ `}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}update(t){super.update(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}Tt.styles=kt,Bt([(t=>{const e=null!=t?t:{};return(t,i)=>{var o;const n={hasChanged:(t,e)=>!r(t,e),attribute:!1,...e};s(n)(t,i);const a=t;a.reduxProperties=a.reduxProperties||new Map,a.reduxProperties.set(i,{selector:null!==(o=e.selector)&&void 0!==o?o:t=>t[i],store:e.store})}})({selector:t=>{var e;return null===(e=t.map)||void 0===e?void 0:e.id}})],Tt.prototype,"mapId",void 0),Bt([s()],Tt.prototype,"tocId",void 0),Bt([s({type:Boolean})],Tt.prototype,"disableContextInteractions",void 0),Bt([o()],Tt.prototype,"tocNode",void 0),(Lt="ft-reader-topic-context",t=>{window.customElements.get(Lt)||window.customElements.define(Lt,t)})(Tt),t.FtReaderTopicContext=Tt,t.FtReaderTopicContextCssVariables={},t.styles=kt}({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-topic-context",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
4
4
  "description": "Context block for integrated reader topic components.",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,8 +19,8 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-wc-utils": "1.0.55",
22
+ "@fluid-topics/ft-wc-utils": "1.0.56",
23
23
  "lit": "2.7.2"
24
24
  },
25
- "gitHead": "4eca32ed1fec3fd25b6d76b26895a6318cfa8ca2"
25
+ "gitHead": "da00d6ea6bfc74fef8c6687f383355e35a26289b"
26
26
  }