@fluid-topics/ft-reader-topic-metadata 2.1.14 → 2.1.15
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.
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<span class="ft-i18n">
|
|
147
147
|
${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
|
|
148
148
|
</span>
|
|
149
|
-
`}update(t){var r;super.update(t),["context","key","defaultMessage"].some(n=>t.has(n))&&this.context&&this.key&&this.addI18nContext(this.context,{[this.key]:(r=this.defaultMessage)!==null&&r!==void 0?r:""})}};Se.elementDefinitions={};Se.styles=rl;yr([(0,fn.redux)()],Se.prototype,"editorMode",void 0);yr([(0,pn.property)()],Se.prototype,"context",void 0);yr([(0,pn.property)()],Se.prototype,"key",void 0);yr([(0,fn.jsonProperty)([])],Se.prototype,"args",void 0);yr([(0,pn.property)()],Se.prototype,"defaultMessage",void 0);var il=y(S());var nl={"ft-i18n":Se};(0,il.customElements)(nl);var Ce=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},$=class extends cn{constructor(){super(...arguments),this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.ignoreMatchingElements=[],this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new ve.Debouncer,this.revealDebouncer=new ve.Debouncer,this.onTouch=t=>{this.isIgnored(t)||(this.show(),setTimeout(()=>window.addEventListener("touchstart",r=>{r.composedPath().includes(this.container)||this.onOut(r)},{once:!0}),100))},this.onHover=t=>{this.isIgnored(t)
|
|
149
|
+
`}update(t){var r;super.update(t),["context","key","defaultMessage"].some(n=>t.has(n))&&this.context&&this.key&&this.addI18nContext(this.context,{[this.key]:(r=this.defaultMessage)!==null&&r!==void 0?r:""})}};Se.elementDefinitions={};Se.styles=rl;yr([(0,fn.redux)()],Se.prototype,"editorMode",void 0);yr([(0,pn.property)()],Se.prototype,"context",void 0);yr([(0,pn.property)()],Se.prototype,"key",void 0);yr([(0,fn.jsonProperty)([])],Se.prototype,"args",void 0);yr([(0,pn.property)()],Se.prototype,"defaultMessage",void 0);var il=y(S());var nl={"ft-i18n":Se};(0,il.customElements)(nl);var Ce=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},$=class extends cn{constructor(){super(...arguments),this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.ignoreMatchingElements=[],this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new ve.Debouncer,this.revealDebouncer=new ve.Debouncer,this.onTouch=t=>{this.isIgnored(t)||(this.show(),setTimeout(()=>window.addEventListener("touchstart",r=>{r.composedPath().includes(this.container)||this.onOut(r)},{once:!0}),100))},this.onHover=t=>{this.isIgnored(t)?this.matchesIgnored(t)&&this.hide():this.show()},this.onFocusIn=t=>{!this.isIgnored(t)&&window.FluidTopicsA11yHints.isKeyboardNavigation&&window.FluidTopicsA11yHints.lastPressedKey==="Tab"&&this.show()},this.onOut=t=>{this.isIgnored(t)||(this.revealDebouncer.cancel(),this.hide())},this.onClick=t=>{this.isIgnored(t)||(this.revealDebouncer.cancel(),this.hide())}}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){var t,r;return ol.html`
|
|
150
150
|
<div part="container"
|
|
151
151
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}">
|
|
152
152
|
<slot part="slot"></slot>
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
</div>
|
|
162
162
|
</div>
|
|
163
163
|
</div>
|
|
164
|
-
`}setupFor(t){this.eventsTarget!==t&&(this.removeHandlers(),this.eventsTarget=t,this.eventsTarget.addEventListener("mouseover",this.onHover,{passive:!0}),this.eventsTarget.addEventListener("mouseleave",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("focusin",this.onFocusIn,{passive:!0}),this.eventsTarget.addEventListener("focusout",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("touchstart",this.onTouch,{passive:!0}),this.eventsTarget.addEventListener("click",this.onClick,{passive:!0}))}removeHandlers(){this.eventsTarget&&(this.eventsTarget.removeEventListener("mouseover",this.onHover),this.eventsTarget.removeEventListener("mouseleave",this.onOut),this.eventsTarget.removeEventListener("focusin",this.onFocusIn),this.eventsTarget.removeEventListener("focusout",this.onOut),this.eventsTarget.removeEventListener("touchstart",this.onTouch),this.eventsTarget.removeEventListener("click",this.onClick),this.eventsTarget=void 0)}defaultSetup(){this.container&&this.setupFor(this.container)}updated(t){var r,n;t.has("visible")&&(this.visible?(this.resetTooltipContent(),(r=this.tooltip)===null||r===void 0||r.showPopover()):(n=this.tooltip)===null||n===void 0||n.hidePopover()),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some(r=>t.has(r))&&this.visible&&this.positionTooltip()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.eventsTarget==null&&this.defaultSetup()})}disconnectedCallback(){super.disconnectedCallback(),this.removeHandlers()}async show(t){this.visible=!0,t!=null&&await this.hideDebounce.run(()=>{this.hide()},t)}async showTemporaryText(t,r){let n=this.manual;this.manual=!0;let i=this.text;this.text={message:t},await this.show(r),this.text=i,this.manual=n}hide(){this.visible=!1}toggle(){this.visible=!this.visible}isVisible(){return this.visible}get slottedElement(){var t;return((t=this.slotNodes)!==null&&t!==void 0?t:[]).filter(r=>r.nodeType==Node.ELEMENT_NODE)[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){let 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";break}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&Qo(this.slottedElement,this.tooltip,{placement:this.position,strategy:"fixed"}).then(({x:t,y:r})=>{this.tooltip&&(this.tooltip.style.transform=`translate(${t}px,${r}px)`)}),this.revealDebouncer.run(()=>{this.tooltipContent&&(this.tooltipContent.style.transition=`top ${ve.designSystemVariables.transitionDuration}, left ${ve.designSystemVariables.transitionDuration}`,this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")},this.manual?0:this.delay)}
|
|
164
|
+
`}setupFor(t){this.eventsTarget!==t&&(this.removeHandlers(),this.eventsTarget=t,this.eventsTarget.addEventListener("mouseover",this.onHover,{passive:!0}),this.eventsTarget.addEventListener("mouseleave",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("focusin",this.onFocusIn,{passive:!0}),this.eventsTarget.addEventListener("focusout",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("touchstart",this.onTouch,{passive:!0}),this.eventsTarget.addEventListener("click",this.onClick,{passive:!0}))}removeHandlers(){this.eventsTarget&&(this.eventsTarget.removeEventListener("mouseover",this.onHover),this.eventsTarget.removeEventListener("mouseleave",this.onOut),this.eventsTarget.removeEventListener("focusin",this.onFocusIn),this.eventsTarget.removeEventListener("focusout",this.onOut),this.eventsTarget.removeEventListener("touchstart",this.onTouch),this.eventsTarget.removeEventListener("click",this.onClick),this.eventsTarget=void 0)}defaultSetup(){this.container&&this.setupFor(this.container)}updated(t){var r,n;t.has("visible")&&(this.visible?(this.resetTooltipContent(),(r=this.tooltip)===null||r===void 0||r.showPopover()):(n=this.tooltip)===null||n===void 0||n.hidePopover()),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some(r=>t.has(r))&&this.visible&&this.positionTooltip()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.eventsTarget==null&&this.defaultSetup()})}disconnectedCallback(){super.disconnectedCallback(),this.removeHandlers()}async show(t){this.visible=!0,t!=null&&await this.hideDebounce.run(()=>{this.hide()},t)}async showTemporaryText(t,r){let n=this.manual;this.manual=!0;let i=this.text;this.text={message:t},await this.show(r),this.text=i,this.manual=n}hide(){this.visible=!1}toggle(){this.visible=!this.visible}isVisible(){return this.visible}get slottedElement(){var t;return((t=this.slotNodes)!==null&&t!==void 0?t:[]).filter(r=>r.nodeType==Node.ELEMENT_NODE)[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){let 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";break}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&Qo(this.slottedElement,this.tooltip,{placement:this.position,strategy:"fixed"}).then(({x:t,y:r})=>{this.tooltip&&(this.tooltip.style.transform=`translate(${t}px,${r}px)`)}),this.revealDebouncer.run(()=>{this.tooltipContent&&(this.tooltipContent.style.transition=`top ${ve.designSystemVariables.transitionDuration}, left ${ve.designSystemVariables.transitionDuration}`,this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")},this.manual?0:this.delay)}matchesIgnored(t){return(0,ve.eventPathContainsMatchingElement)(t,this.ignoreMatchingElements,this.eventsTarget)}isIgnored(t){return this.manual||this.matchesIgnored(t)}};$.elementDefinitions={"ft-typography":oe};$.styles=So;Ce([el()],$.prototype,"text",void 0);Ce([(0,be.property)({type:Boolean})],$.prototype,"manual",void 0);Ce([(0,be.property)({type:Boolean})],$.prototype,"inline",void 0);Ce([(0,ve.numberProperty)()],$.prototype,"delay",void 0);Ce([(0,be.property)()],$.prototype,"position",void 0);Ce([(0,ve.jsonProperty)([])],$.prototype,"ignoreMatchingElements",void 0);Ce([(0,be.queryAssignedNodes)()],$.prototype,"slotNodes",void 0);Ce([(0,be.query)(".ft-tooltip--container")],$.prototype,"container",void 0);Ce([(0,be.query)(".ft-tooltip")],$.prototype,"tooltip",void 0);Ce([(0,be.query)(".ft-tooltip--content")],$.prototype,"tooltipContent",void 0);Ce([(0,be.state)()],$.prototype,"visible",void 0);var al=y(S());var sl={"ft-tooltip":$};(0,al.customElements)(sl);var yn=y(U()),W=y(z()),zl=y(hn()),zt=y(S());var yl=y(U()),K=y(z()),gl=y(hn()),gr=y(S());var hl=y(U()),V=y(S()),cl=V.FtCssVariableFactory.extend("--ft-ripple-color","",V.designSystemVariables.colorContent),X={color:cl,backgroundColor:V.FtCssVariableFactory.extend("--ft-ripple-background-color","",cl),opacityContentOnSurfacePressed:V.FtCssVariableFactory.external(V.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:V.FtCssVariableFactory.external(V.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:V.FtCssVariableFactory.external(V.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:V.FtCssVariableFactory.external(V.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:V.FtCssVariableFactory.create("--ft-ripple-border-radius","","SIZE","0px")},ul=V.FtCssVariableFactory.extend("--ft-ripple-color","",V.designSystemVariables.colorPrimary),dl={color:ul,backgroundColor:V.FtCssVariableFactory.extend("--ft-ripple-background-color","",ul)},pl=V.FtCssVariableFactory.extend("--ft-ripple-color","",V.designSystemVariables.colorSecondary),fl={color:pl,backgroundColor:V.FtCssVariableFactory.extend("--ft-ripple-background-color","",pl)},ml=hl.css`
|
|
165
165
|
:host {
|
|
166
166
|
display: contents;
|
|
167
167
|
}
|