@fluid-topics/ft-reader-toc 1.1.4 → 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.
- package/build/ft-reader-toc.light.js +2 -2
- package/build/ft-reader-toc.min.js +283 -278
- package/package.json +7 -7
|
@@ -521,7 +521,7 @@ const V=Symbol.for(""),X=t=>{if(t?.r===V)return t?._$litStatic$},q=t=>({_$litSta
|
|
|
521
521
|
<div class="ft-ripple--background"></div>
|
|
522
522
|
<div class="ft-ripple--effect"></div>
|
|
523
523
|
</div>
|
|
524
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var o,e;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(o=this.target)||void 0===o||o.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,o;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(null!==(o=this.target)&&void 0!==o?o:e)}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const o=(...t)=>o=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(o)},e=o("mouseup","contextmenu"),r=o("touchend","touchcancel"),i=t=>{["Enter"," "].includes(t.key)&&o("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",r),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",i),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",r),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",i),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const o=t,e=t;let r,i;return null!=o.x?({x:r,y:i}=o):null!=e.touches&&(r=e.touches[0].clientX,i=e.touches[0].clientY),{x:r,y:i}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let o of t.composedPath()){if(o===this.target)break;if("hasAttribute"in o&&o.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}}ie.elementDefinitions={},ie.styles=jo,re([n.property({type:Boolean})],ie.prototype,"primary",void 0),re([n.property({type:Boolean})],ie.prototype,"secondary",void 0),re([n.property({type:Boolean})],ie.prototype,"unbounded",void 0),re([n.property({type:Boolean})],ie.prototype,"activated",void 0),re([n.property({type:Boolean})],ie.prototype,"selected",void 0),re([n.property({type:Boolean})],ie.prototype,"disabled",void 0),re([n.state()],ie.prototype,"hovered",void 0),re([n.state()],ie.prototype,"focused",void 0),re([n.state()],ie.prototype,"pressed",void 0),re([n.state()],ie.prototype,"rippling",void 0),re([n.state()],ie.prototype,"originX",void 0),re([n.state()],ie.prototype,"originY",void 0),re([n.query(".ft-ripple")],ie.prototype,"ripple",void 0),re([n.query(".ft-ripple--effect")],ie.prototype,"rippleEffect",void 0),o.customElement("ft-ripple")(ie);const ae=o.FtCssVariableFactory.create("--ft-tooltip-distance","","SIZE","4px"),ne=o.FtCssVariableFactory.create("--ft-tooltip-color","","COLOR","#FFFFFF"),le=o.FtCssVariableFactory.create("--ft-tooltip-background-color","","COLOR","#666666"),ce=o.FtCssVariableFactory.create("--ft-tooltip-z-index","","NUMBER","100"),se=o.FtCssVariableFactory.external(o.designSystemVariables.borderRadiusS,"Design system"),pe=o.FtCssVariableFactory.create("--ft-tooltip-max-width","","SIZE","150px"),fe=e.css`
|
|
524
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var o,e;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(o=this.target)||void 0===o||o.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,o;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(null!==(o=this.target)&&void 0!==o?o:e)}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const o=(...t)=>o=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(o)},e=o("mouseup","contextmenu"),r=o("touchend","touchcancel"),i=t=>{["Enter"," "].includes(t.key)&&o("keyup")(t)},a={passive:!0};t.addEventListener("mouseover",this.startHover,a),t.addEventListener("mousemove",this.moveRipple,a),t.addEventListener("mouseleave",this.endHover,a),t.addEventListener("mousedown",e,a),t.addEventListener("touchstart",r,a),t.addEventListener("touchmove",this.moveRipple,a),t.addEventListener("keydown",i,a),t.addEventListener("focus",this.startFocus,a),t.addEventListener("blur",this.endFocus,a),t.addEventListener("focusin",this.startFocus,a),t.addEventListener("focusout",this.endFocus,a),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover,a),t.removeEventListener("mousemove",this.moveRipple,a),t.removeEventListener("mouseleave",this.endHover,a),t.removeEventListener("mousedown",e,a),t.removeEventListener("touchstart",r,a),t.removeEventListener("touchmove",this.moveRipple,a),t.removeEventListener("keydown",i,a),t.removeEventListener("focus",this.startFocus,a),t.removeEventListener("blur",this.endFocus,a),t.removeEventListener("focusin",this.startFocus,a),t.removeEventListener("focusout",this.endFocus,a),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const o=t,e=t;let r,i;return null!=o.x?({x:r,y:i}=o):null!=e.touches&&(r=e.touches[0].clientX,i=e.touches[0].clientY),{x:r,y:i}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let o of t.composedPath()){if(o===this.target)break;if("hasAttribute"in o&&o.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}}ie.elementDefinitions={},ie.styles=jo,re([n.property({type:Boolean})],ie.prototype,"primary",void 0),re([n.property({type:Boolean})],ie.prototype,"secondary",void 0),re([n.property({type:Boolean})],ie.prototype,"unbounded",void 0),re([n.property({type:Boolean})],ie.prototype,"activated",void 0),re([n.property({type:Boolean})],ie.prototype,"selected",void 0),re([n.property({type:Boolean})],ie.prototype,"disabled",void 0),re([n.state()],ie.prototype,"hovered",void 0),re([n.state()],ie.prototype,"focused",void 0),re([n.state()],ie.prototype,"pressed",void 0),re([n.state()],ie.prototype,"rippling",void 0),re([n.state()],ie.prototype,"originX",void 0),re([n.state()],ie.prototype,"originY",void 0),re([n.query(".ft-ripple")],ie.prototype,"ripple",void 0),re([n.query(".ft-ripple--effect")],ie.prototype,"rippleEffect",void 0),o.customElement("ft-ripple")(ie);const ae=o.FtCssVariableFactory.create("--ft-tooltip-distance","","SIZE","4px"),ne=o.FtCssVariableFactory.create("--ft-tooltip-color","","COLOR","#FFFFFF"),le=o.FtCssVariableFactory.create("--ft-tooltip-background-color","","COLOR","#666666"),ce=o.FtCssVariableFactory.create("--ft-tooltip-z-index","","NUMBER","100"),se=o.FtCssVariableFactory.external(o.designSystemVariables.borderRadiusS,"Design system"),pe=o.FtCssVariableFactory.create("--ft-tooltip-max-width","","SIZE","150px"),fe=e.css`
|
|
525
525
|
.ft-tooltip--container {
|
|
526
526
|
display: block;
|
|
527
527
|
}
|
|
@@ -568,7 +568,7 @@ const V=Symbol.for(""),X=t=>{if(t?.r===V)return t?._$litStatic$},q=t=>({_$litSta
|
|
|
568
568
|
</div>
|
|
569
569
|
</div>
|
|
570
570
|
</div>
|
|
571
|
-
`}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="",pr(this.slottedElement,this.tooltip,{middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(o){const{x:e,y:r,placement:i}=o,{mainAxis:a=!0,crossAxis:n=!1,limiter:l={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...c}=ve(t,o),s={x:e,y:r},p=await Le(o,c),f=$e(Ne(i)),d=we(f);let h=s[d],y=s[f];if(a){const t="y"===d?"bottom":"right";h=Oe(h+p["y"===d?"top":"left"],h,h-p[t])}if(n){const t="y"===f?"bottom":"right";y=Oe(y+p["y"===f?"top":"left"],y,y-p[t])}const g=l.fn({...o,[d]:h,[f]:y});return{...g,data:{x:g.x-e,y:g.y-r}}}}),We({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))}}dr.elementDefinitions={"ft-typography":Co},dr.styles=fe,fr([n.property()],dr.prototype,"text",void 0),fr([n.property({type:Boolean})],dr.prototype,"manual",void 0),fr([n.property({type:Boolean})],dr.prototype,"inline",void 0),fr([n.property({type:Number})],dr.prototype,"delay",void 0),fr([n.property()],dr.prototype,"position",void 0),fr([n.queryAssignedNodes()],dr.prototype,"slotNodes",void 0),fr([n.query(".ft-tooltip--container")],dr.prototype,"container",void 0),fr([n.query(".ft-tooltip")],dr.prototype,"tooltip",void 0),fr([n.query(".ft-tooltip--content")],dr.prototype,"tooltipContent",void 0),fr([n.state()],dr.prototype,"visible",void 0),o.customElement("ft-tooltip")(dr);class hr extends o.FtLitElement{render(){return e.html`
|
|
571
|
+
`}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="",pr(this.slottedElement,this.tooltip,{middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(o){const{x:e,y:r,placement:i}=o,{mainAxis:a=!0,crossAxis:n=!1,limiter:l={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...c}=ve(t,o),s={x:e,y:r},p=await Le(o,c),f=$e(Ne(i)),d=we(f);let h=s[d],y=s[f];if(a){const t="y"===d?"bottom":"right";h=Oe(h+p["y"===d?"top":"left"],h,h-p[t])}if(n){const t="y"===f?"bottom":"right";y=Oe(y+p["y"===f?"top":"left"],y,y-p[t])}const g=l.fn({...o,[d]:h,[f]:y});return{...g,data:{x:g.x-e,y:g.y-r}}}}),We({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))}}dr.elementDefinitions={"ft-typography":Co},dr.styles=fe,fr([n.property()],dr.prototype,"text",void 0),fr([n.property({type:Boolean})],dr.prototype,"manual",void 0),fr([n.property({type:Boolean})],dr.prototype,"inline",void 0),fr([n.property({type:Number})],dr.prototype,"delay",void 0),fr([n.property()],dr.prototype,"position",void 0),fr([n.queryAssignedNodes()],dr.prototype,"slotNodes",void 0),fr([n.query(".ft-tooltip--container")],dr.prototype,"container",void 0),fr([n.query(".ft-tooltip")],dr.prototype,"tooltip",void 0),fr([n.query(".ft-tooltip--content")],dr.prototype,"tooltipContent",void 0),fr([n.state()],dr.prototype,"visible",void 0),fr([n.eventOptions({passive:!0})],dr.prototype,"onTouch",null),fr([n.eventOptions({passive:!0})],dr.prototype,"onHover",null),fr([n.eventOptions({passive:!0})],dr.prototype,"onOut",null),o.customElement("ft-tooltip")(dr);class hr extends o.FtLitElement{render(){return e.html`
|
|
572
572
|
<div class="ft-loader">
|
|
573
573
|
<div></div>
|
|
574
574
|
<div></div>
|