UNPKG

@techdocs/cli

Version:

Utility CLI for managing TechDocs sites in Backstage.

2 lines • 9.5 kB
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["7346"],{41433(e,t,r){r.d(t,{A:()=>h});var l=r(89575),n=r(39850),o=r(14041),i=r(36274),a=r(49839),c=r(50222),s=r(7031),u=r(20098),d=o.createElement(a.A,{fontSize:"small"}),f=o.createElement(c.A,{fontSize:"small"}),v=o.forwardRef(function(e,t){var r=e.classes,a=e.className,c=e.direction,s=e.orientation,v=e.disabled,h=(0,n.A)(e,["classes","className","direction","orientation","disabled"]);return o.createElement(u.A,(0,l.A)({component:"div",className:(0,i.A)(r.root,a,v&&r.disabled,"vertical"===s&&r.vertical),ref:t,role:null,tabIndex:null},h),"left"===c?d:f)});let h=(0,s.A)({root:{width:40,flexShrink:0,opacity:.8,"&$disabled":{opacity:0}},vertical:{width:"100%",height:40,"& svg":{transform:"rotate(90deg)"}},disabled:{}},{name:"MuiTabScrollButton"})(v)},74953(e,t,r){r.d(t,{A:()=>x});var l,n=r(89575),o=r(39850),i=r(24586),a=r(14041);r(26948);var c=r(36274),s=r(2589),u=r(82431);function d(){if(l)return l;var e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),l="reverse",e.scrollLeft>0?l="default":(e.scrollLeft=1,0===e.scrollLeft&&(l="negative")),document.body.removeChild(e),l}function f(e,t){var r=e.scrollLeft;if("rtl"!==t)return r;switch(d()){case"negative":return e.scrollWidth-e.clientWidth+r;case"reverse":return e.scrollWidth-e.clientWidth-r;default:return r}}function v(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}var h={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function m(e){var t=e.onChange,r=(0,o.A)(e,["onChange"]),l=a.useRef(),i=a.useRef(null),c=function(){l.current=i.current.offsetHeight-i.current.clientHeight};return a.useEffect(function(){var e=(0,s.A)(function(){var e=l.current;c(),e!==l.current&&t(l.current)});return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}},[t]),a.useEffect(function(){c(),t(l.current)},[t]),a.createElement("div",(0,n.A)({style:h,ref:i},r))}var p=r(7031),b=r(11192),A=a.forwardRef(function(e,t){var r=e.classes,l=e.className,i=e.color,s=e.orientation,u=(0,o.A)(e,["classes","className","color","orientation"]);return a.createElement("span",(0,n.A)({className:(0,c.A)(r.root,r["color".concat((0,b.A)(i))],l,"vertical"===s&&r.vertical),ref:t},u))});let g=(0,p.A)(function(e){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},colorPrimary:{backgroundColor:e.palette.primary.main},colorSecondary:{backgroundColor:e.palette.secondary.main},vertical:{height:"100%",width:2,right:0}}},{name:"PrivateTabIndicator"})(A);var w=r(41433),E=r(70020),C=r(54917),y=a.forwardRef(function(e,t){var r,l,h,p=e["aria-label"],b=e["aria-labelledby"],A=e.action,y=e.centered,x=e.children,S=e.classes,k=e.className,B=e.component,L=e.indicatorColor,N=e.onChange,M=e.orientation,W=void 0===M?"horizontal":M,z=e.ScrollButtonComponent,R=void 0===z?w.A:z,T=e.scrollButtons,F=void 0===T?"auto":T,D=e.selectionFollowsFocus,H=e.TabIndicatorProps,I=void 0===H?{}:H,P=e.TabScrollButtonProps,_=e.textColor,q=void 0===_?"inherit":_,K=e.value,V=e.variant,X=void 0===V?"standard":V,j=(0,o.A)(e,["aria-label","aria-labelledby","action","centered","children","classes","className","component","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant"]),O=(0,C.A)(),U="scrollable"===X,$="rtl"===O.direction,G="vertical"===W,J=G?"scrollTop":"scrollLeft",Q=G?"top":"left",Y=G?"bottom":"right",Z=G?"clientHeight":"clientWidth",ee=G?"height":"width",et=a.useState(!1),er=et[0],el=et[1],en=a.useState({}),eo=en[0],ei=en[1],ea=a.useState({start:!1,end:!1}),ec=ea[0],es=ea[1],eu=a.useState({overflow:"hidden",marginBottom:null}),ed=eu[0],ef=eu[1],ev=new Map,eh=a.useRef(null),em=a.useRef(null),ep=function(){var e,t,r=eh.current;if(r){var l=r.getBoundingClientRect();e={clientWidth:r.clientWidth,scrollLeft:r.scrollLeft,scrollTop:r.scrollTop,scrollLeftNormalized:f(r,O.direction),scrollWidth:r.scrollWidth,top:l.top,bottom:l.bottom,left:l.left,right:l.right}}if(r&&!1!==K){var n=em.current.children;if(n.length>0){var o=n[ev.get(K)];t=o?o.getBoundingClientRect():null}}return{tabsMeta:e,tabMeta:t}},eb=(0,E.A)(function(){var e,t=ep(),r=t.tabsMeta,l=t.tabMeta,n=0;if(l&&r)if(G)n=l.top-r.top+r.scrollTop;else{var o=$?r.scrollLeftNormalized+r.clientWidth-r.scrollWidth:r.scrollLeft;n=l.left-r.left+o}var a=(e={},(0,i.A)(e,Q,n),(0,i.A)(e,ee,l?l[ee]:0),e);if(isNaN(eo[Q])||isNaN(eo[ee]))ei(a);else{var c=Math.abs(eo[Q]-a[Q]),s=Math.abs(eo[ee]-a[ee]);(c>=1||s>=1)&&ei(a)}}),eA=function(e){!function(e,t,r){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=l.ease,i=void 0===o?v:o,a=l.duration,c=void 0===a?300:a,s=null,u=t[e],d=!1;u===r?n(Error("Element already at target position")):requestAnimationFrame(function l(o){if(d)return void n(Error("Animation cancelled"));null===s&&(s=o);var a=Math.min(1,(o-s)/c);(t[e]=i(a)*(r-u)+u,a>=1)?requestAnimationFrame(function(){n(null)}):requestAnimationFrame(l)})}(J,eh.current,e)},eg=function(e){var t=eh.current[J];G?t+=e:(t+=e*($?-1:1),t*=$&&"reverse"===d()?-1:1),eA(t)},ew=a.useCallback(function(e){ef({overflow:null,marginBottom:-e})},[]),eE=(0,E.A)(function(){var e=ep(),t=e.tabsMeta,r=e.tabMeta;r&&t&&(r[Q]<t[Q]?eA(t[J]+(r[Q]-t[Q])):r[Y]>t[Y]&&eA(t[J]+(r[Y]-t[Y])))}),eC=(0,E.A)(function(){if(U&&"off"!==F){var e,t,r=eh.current,l=r.scrollTop,n=r.scrollHeight,o=r.clientHeight,i=r.scrollWidth,a=r.clientWidth;if(G)e=l>1,t=l<n-o-1;else{var c=f(eh.current,O.direction);e=$?c<i-a-1:c>1,t=$?c>1:c<i-a-1}(e!==ec.start||t!==ec.end)&&es({start:e,end:t})}});a.useEffect(function(){var e=(0,s.A)(function(){eb(),eC()}),t=(0,u.A)(eh.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}},[eb,eC]);var ey=a.useCallback((0,s.A)(function(){eC()}));a.useEffect(function(){return function(){ey.clear()}},[ey]),a.useEffect(function(){el(!0)},[]),a.useEffect(function(){eb(),eC()}),a.useEffect(function(){eE()},[eE,eo]),a.useImperativeHandle(A,function(){return{updateIndicator:eb,updateScrollButtons:eC}},[eb,eC]);var ex=a.createElement(g,(0,n.A)({className:S.indicator,orientation:W,color:void 0===L?"secondary":L},I,{style:(0,n.A)({},eo,I.style)})),eS=0,ek=a.Children.map(x,function(e){if(!a.isValidElement(e))return null;var t=void 0===e.props.value?eS:e.props.value;ev.set(t,eS);var r=t===K;return eS+=1,a.cloneElement(e,{fullWidth:"fullWidth"===X,indicator:r&&!er&&ex,selected:r,selectionFollowsFocus:D,onChange:N,textColor:q,value:t})}),eB=((r={}).scrollbarSizeListener=U?a.createElement(m,{className:S.scrollable,onChange:ew}):null,l=ec.start||ec.end,r.scrollButtonStart=(h=U&&("auto"===F&&l||"desktop"===F||"on"===F))?a.createElement(R,(0,n.A)({orientation:W,direction:$?"right":"left",onClick:function(){eg(-eh.current[Z])},disabled:!ec.start,className:(0,c.A)(S.scrollButtons,"on"!==F&&S.scrollButtonsDesktop)},P)):null,r.scrollButtonEnd=h?a.createElement(R,(0,n.A)({orientation:W,direction:$?"left":"right",onClick:function(){eg(eh.current[Z])},disabled:!ec.end,className:(0,c.A)(S.scrollButtons,"on"!==F&&S.scrollButtonsDesktop)},P)):null,r);return a.createElement(void 0===B?"div":B,(0,n.A)({className:(0,c.A)(S.root,k,G&&S.vertical),ref:t},j),eB.scrollButtonStart,eB.scrollbarSizeListener,a.createElement("div",{className:(0,c.A)(S.scroller,U?S.scrollable:S.fixed),style:ed,ref:eh,onScroll:ey},a.createElement("div",{"aria-label":p,"aria-labelledby":b,className:(0,c.A)(S.flexContainer,G&&S.flexContainerVertical,void 0!==y&&y&&!U&&S.centered),onKeyDown:function(e){var t=e.target;if("tab"===t.getAttribute("role")){var r=null,l="vertical"!==W?"ArrowLeft":"ArrowUp",n="vertical"!==W?"ArrowRight":"ArrowDown";switch("vertical"!==W&&"rtl"===O.direction&&(l="ArrowRight",n="ArrowLeft"),e.key){case l:r=t.previousElementSibling||em.current.lastChild;break;case n:r=t.nextElementSibling||em.current.firstChild;break;case"Home":r=em.current.firstChild;break;case"End":r=em.current.lastChild}null!==r&&(r.focus(),e.preventDefault())}},ref:em,role:"tablist"},ek),er&&ex),eB.scrollButtonEnd)});let x=(0,p.A)(function(e){return{root:{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},vertical:{flexDirection:"column"},flexContainer:{display:"flex"},flexContainerVertical:{flexDirection:"column"},centered:{justifyContent:"center"},scroller:{position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},fixed:{overflowX:"hidden",width:"100%"},scrollable:{overflowX:"scroll",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},scrollButtons:{},scrollButtonsDesktop:(0,i.A)({},e.breakpoints.down("xs"),{display:"none"}),indicator:{}}},{name:"MuiTabs"})(y)},49839(e,t,r){r.d(t,{A:()=>n});var l=r(14041);let n=(0,r(38483).A)(l.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft")},50222(e,t,r){r.d(t,{A:()=>n});var l=r(14041);let n=(0,r(38483).A)(l.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight")}}]); //# sourceMappingURL=7346.83cd59830e4d.chunk.js.map