@fluid-topics/ft-reader-metadata 1.1.12 → 1.1.13

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.
@@ -161,7 +161,7 @@ const Y=Symbol.for(""),V=t=>{if(t?.r===Y)return t?._$litStatic$},X=t=>({_$litSta
161
161
  @focusin=${this.onHover}
162
162
  @focusout=${this.onOut}
163
163
  @touchstart=${this.onTouch}>
164
- <slot part="slot"></slot>
164
+ <slot part="slot" @click=${this.onClick}></slot>
165
165
  <div part="tooltip" role="tooltip" inert
166
166
  class="ft-tooltip ft-tooltip--${this.validPosition}"
167
167
  ?hidden=${!this.visible}>
@@ -171,7 +171,7 @@ const Y=Symbol.for(""),V=t=>{if(t?.r===Y)return t?._$litStatic$},X=t=>({_$litSta
171
171
  </div>
172
172
  </div>
173
173
  </div>
174
- `}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",Ce(this.slottedElement,this.tooltip,{platform:{...$e,getOffsetParent:t=>$e.getOffsetParent(t,we)},middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(o){const{x:e,y:r,placement:i}=o,{mainAxis:n=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...c}=Zo(t,o),p={x:e,y:r},s=await Mo(o,c),f=Ho(Bo(i)),d=Do(f);let h=p[d],g=p[f];if(n){const t="y"===d?"bottom":"right";h=Ko(h+s["y"===d?"top":"left"],h,h-s[t])}if(a){const t="y"===f?"bottom":"right";g=Ko(g+s["y"===f?"top":"left"],g,g-s[t])}const y=l.fn({...o,[d]:h,[f]:g});return{...y,data:{x:y.x-e,y:y.y-r}}}}),Yo({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}ke.elementDefinitions={"ft-typography":xo},ke.styles=wo,Re([r.property()],ke.prototype,"text",void 0),Re([r.property({type:Boolean})],ke.prototype,"manual",void 0),Re([r.property({type:Boolean})],ke.prototype,"inline",void 0),Re([r.property({type:Number})],ke.prototype,"delay",void 0),Re([r.property()],ke.prototype,"position",void 0),Re([r.queryAssignedNodes()],ke.prototype,"slotNodes",void 0),Re([r.query(".ft-tooltip--container")],ke.prototype,"container",void 0),Re([r.query(".ft-tooltip")],ke.prototype,"tooltip",void 0),Re([r.query(".ft-tooltip--content")],ke.prototype,"tooltipContent",void 0),Re([r.state()],ke.prototype,"visible",void 0),Re([r.eventOptions({passive:!0})],ke.prototype,"onTouch",null),Re([r.eventOptions({passive:!0})],ke.prototype,"onHover",null),Re([r.eventOptions({passive:!0})],ke.prototype,"onOut",null),o.customElement("ft-tooltip")(ke);const Ue=o.FtCssVariableFactory.extend("--ft-ripple-color","",o.designSystemVariables.colorContent),Ee={color:Ue,backgroundColor:o.FtCssVariableFactory.extend("--ft-ripple-background-color","",Ue),opacityContentOnSurfacePressed:o.FtCssVariableFactory.external(o.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:o.FtCssVariableFactory.external(o.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:o.FtCssVariableFactory.external(o.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:o.FtCssVariableFactory.external(o.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:o.FtCssVariableFactory.create("--ft-ripple-border-radius","","SIZE","0px")},We=o.FtCssVariableFactory.extend("--ft-ripple-color","",o.designSystemVariables.colorPrimary),Le=We,ze=o.FtCssVariableFactory.extend("--ft-ripple-background-color","",We),Ke=o.FtCssVariableFactory.extend("--ft-ripple-color","",o.designSystemVariables.colorSecondary),Ze=Ke,Be=o.FtCssVariableFactory.extend("--ft-ripple-background-color","",Ke),Fe=e.css`
174
+ `}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",Ce(this.slottedElement,this.tooltip,{platform:{...$e,getOffsetParent:t=>$e.getOffsetParent(t,we)},middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(o){const{x:e,y:r,placement:i}=o,{mainAxis:n=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...c}=Zo(t,o),p={x:e,y:r},s=await Mo(o,c),f=Ho(Bo(i)),d=Do(f);let h=p[d],g=p[f];if(n){const t="y"===d?"bottom":"right";h=Ko(h+s["y"===d?"top":"left"],h,h-s[t])}if(a){const t="y"===f?"bottom":"right";g=Ko(g+s["y"===f?"top":"left"],g,g-s[t])}const y=l.fn({...o,[d]:h,[f]:g});return{...y,data:{x:y.x-e,y:y.y-r}}}}),Yo({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}onClick(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}ke.elementDefinitions={"ft-typography":xo},ke.styles=wo,Re([r.property()],ke.prototype,"text",void 0),Re([r.property({type:Boolean})],ke.prototype,"manual",void 0),Re([r.property({type:Boolean})],ke.prototype,"inline",void 0),Re([r.property({type:Number})],ke.prototype,"delay",void 0),Re([r.property()],ke.prototype,"position",void 0),Re([r.queryAssignedNodes()],ke.prototype,"slotNodes",void 0),Re([r.query(".ft-tooltip--container")],ke.prototype,"container",void 0),Re([r.query(".ft-tooltip")],ke.prototype,"tooltip",void 0),Re([r.query(".ft-tooltip--content")],ke.prototype,"tooltipContent",void 0),Re([r.state()],ke.prototype,"visible",void 0),Re([r.eventOptions({passive:!0})],ke.prototype,"onTouch",null),Re([r.eventOptions({passive:!0})],ke.prototype,"onHover",null),Re([r.eventOptions({passive:!0})],ke.prototype,"onOut",null),Re([r.eventOptions({passive:!0})],ke.prototype,"onClick",null),o.customElement("ft-tooltip")(ke);const Ue=o.FtCssVariableFactory.extend("--ft-ripple-color","",o.designSystemVariables.colorContent),Ee={color:Ue,backgroundColor:o.FtCssVariableFactory.extend("--ft-ripple-background-color","",Ue),opacityContentOnSurfacePressed:o.FtCssVariableFactory.external(o.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:o.FtCssVariableFactory.external(o.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:o.FtCssVariableFactory.external(o.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:o.FtCssVariableFactory.external(o.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:o.FtCssVariableFactory.create("--ft-ripple-border-radius","","SIZE","0px")},We=o.FtCssVariableFactory.extend("--ft-ripple-color","",o.designSystemVariables.colorPrimary),Le=We,ze=o.FtCssVariableFactory.extend("--ft-ripple-background-color","",We),Ke=o.FtCssVariableFactory.extend("--ft-ripple-color","",o.designSystemVariables.colorSecondary),Ze=Ke,Be=o.FtCssVariableFactory.extend("--ft-ripple-background-color","",Ke),Fe=e.css`
175
175
  :host {
176
176
  display: contents;
177
177
  }
@@ -280,7 +280,7 @@ class bo extends zt{constructor(){super(...arguments),this.renderOptions={host:t
280
280
  @focusin=${this.onHover}
281
281
  @focusout=${this.onOut}
282
282
  @touchstart=${this.onTouch}>
283
- <slot part="slot"></slot>
283
+ <slot part="slot" @click=${this.onClick}></slot>
284
284
  <div part="tooltip" role="tooltip" inert
285
285
  class="ft-tooltip ft-tooltip--${this.validPosition}"
286
286
  ?hidden=${!this.visible}>
@@ -290,7 +290,7 @@ class bo extends zt{constructor(){super(...arguments),this.renderOptions={host:t
290
290
  </div>
291
291
  </div>
292
292
  </div>
293
- `}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",Er(this.slottedElement,this.tooltip,{platform:{...Rr,getOffsetParent:t=>Rr.getOffsetParent(t,kr)},middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(o){const{x:e,y:i,placement:r}=o,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...l}=Ai(t,o),c={x:e,y:i},p=await Vi(o,l),f=ji(Mi(r)),h=Pi(f);let d=c[h],u=c[f];if(n){const t="y"===h?"bottom":"right";d=Bi(d+p["y"===h?"top":"left"],d,d-p[t])}if(a){const t="y"===f?"bottom":"right";u=Bi(u+p["y"===f?"top":"left"],u,u-p[t])}const y=s.fn({...o,[h]:d,[f]:u});return{...y,data:{x:y.x-e,y:y.y-i}}}}),qi({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}Lr.elementDefinitions={"ft-typography":Si},Lr.styles=ki,Ir([C()],Lr.prototype,"text",void 0),Ir([C({type:Boolean})],Lr.prototype,"manual",void 0),Ir([C({type:Boolean})],Lr.prototype,"inline",void 0),Ir([C({type:Number})],Lr.prototype,"delay",void 0),Ir([C()],Lr.prototype,"position",void 0),Ir([function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([name])");return E(0,0,{get(){const o=this.renderRoot?.querySelector(r);return o?.assignedNodes(t)??[]}})}}()],Lr.prototype,"slotNodes",void 0),Ir([k(".ft-tooltip--container")],Lr.prototype,"container",void 0),Ir([k(".ft-tooltip")],Lr.prototype,"tooltip",void 0),Ir([k(".ft-tooltip--content")],Lr.prototype,"tooltipContent",void 0),Ir([$()],Lr.prototype,"visible",void 0),Ir([R({passive:!0})],Lr.prototype,"onTouch",null),Ir([R({passive:!0})],Lr.prototype,"onHover",null),Ir([R({passive:!0})],Lr.prototype,"onOut",null),I("ft-tooltip")(Lr);
293
+ `}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",Er(this.slottedElement,this.tooltip,{platform:{...Rr,getOffsetParent:t=>Rr.getOffsetParent(t,kr)},middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(o){const{x:e,y:i,placement:r}=o,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...l}=Ai(t,o),c={x:e,y:i},p=await Vi(o,l),f=ji(Mi(r)),h=Pi(f);let d=c[h],u=c[f];if(n){const t="y"===h?"bottom":"right";d=Bi(d+p["y"===h?"top":"left"],d,d-p[t])}if(a){const t="y"===f?"bottom":"right";u=Bi(u+p["y"===f?"top":"left"],u,u-p[t])}const y=s.fn({...o,[h]:d,[f]:u});return{...y,data:{x:y.x-e,y:y.y-i}}}}),qi({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}onClick(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}Lr.elementDefinitions={"ft-typography":Si},Lr.styles=ki,Ir([C()],Lr.prototype,"text",void 0),Ir([C({type:Boolean})],Lr.prototype,"manual",void 0),Ir([C({type:Boolean})],Lr.prototype,"inline",void 0),Ir([C({type:Number})],Lr.prototype,"delay",void 0),Ir([C()],Lr.prototype,"position",void 0),Ir([function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([name])");return E(0,0,{get(){const o=this.renderRoot?.querySelector(r);return o?.assignedNodes(t)??[]}})}}()],Lr.prototype,"slotNodes",void 0),Ir([k(".ft-tooltip--container")],Lr.prototype,"container",void 0),Ir([k(".ft-tooltip")],Lr.prototype,"tooltip",void 0),Ir([k(".ft-tooltip--content")],Lr.prototype,"tooltipContent",void 0),Ir([$()],Lr.prototype,"visible",void 0),Ir([R({passive:!0})],Lr.prototype,"onTouch",null),Ir([R({passive:!0})],Lr.prototype,"onHover",null),Ir([R({passive:!0})],Lr.prototype,"onOut",null),Ir([R({passive:!0})],Lr.prototype,"onClick",null),I("ft-tooltip")(Lr);
294
294
  /**
295
295
  * @license
296
296
  * Copyright 2017 Google LLC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-metadata",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "Metadata for integrated reader",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,11 +19,11 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-chip": "1.1.12",
23
- "@fluid-topics/ft-reader-context": "1.1.12",
24
- "@fluid-topics/ft-tooltip": "1.1.12",
25
- "@fluid-topics/ft-wc-utils": "1.1.12",
22
+ "@fluid-topics/ft-chip": "1.1.13",
23
+ "@fluid-topics/ft-reader-context": "1.1.13",
24
+ "@fluid-topics/ft-tooltip": "1.1.13",
25
+ "@fluid-topics/ft-wc-utils": "1.1.13",
26
26
  "lit": "3.1.0"
27
27
  },
28
- "gitHead": "81a42d69a8e10526af88b3c220eff325cbc33c3c"
28
+ "gitHead": "6678af642af51eb1590bccbeeb0de8cbc5938ab1"
29
29
  }