@viswa-test/test-citation 0.0.157 → 0.0.159
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/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/types/src/CommonConstants/CommonConstants.d.ts +3026 -2091
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState as e,useRef as n,useCallback as
|
|
1
|
+
import{useState as e,useRef as n,useCallback as t,useEffect as r}from"react";import{DEVIATION_BADGE_SEPARATOR as i,smoothScrollTo as l,resetClauseHighlight as u}from"../CognitiveComparehelpers.js";var o=function(o){var c=o.maintainRelativeOrder,d=o.proposedSections,s=o.existingSections,v=o.leftContainerRef,a=o.rightContainerRef,p=o.scrollContainerRef,g=o.sectionLeftRefs,f=o.sectionRightRefs,h=o.subSectionLeftRefs,R=o.subSectionRightRefs,S=o.lhsBadgeRefs,y=o.rhsBadgeRefs,m=o.sectionRowRefs,B=o.sectionRightRowRefs,x=o.rhsTopSpacerRef,C=o.rhsBottomSpacerRef,T=o.lhsTopSpacerRef,b=o.lhsBottomSpacerRef,A=o.calculateLinesRef,w=o.setConnectedSections,I=o.setConnectedLines,L=o.cachedConnectedPositions,F=o.closeMoreFunctionsPopup,N=o.setErrorToast;o.moreFunctions,o.closeSummaryPopup;var E=e(!1),q=E[0],H=E[1],P=e(!1),M=P[0],z=P[1],V=e(!1),j=V[0],k=V[1],O=e(!1),D=O[0],G=O[1],J=e(null),K=J[0],Q=J[1],U=n(!1),W=n(null),X=n(!1),Y=n(null),Z=n(null),$=n(null),_=n(new Set),ee=function(){_.current.forEach(function(e){u(e)}),_.current.clear()},ne=function(e,n,t){var r,l,u,o,c,d,s,p,x,C,T,b,A=null,w=null,I=null,L=null,F=null,N=null,E=function(e,n){if(!e||!n)return!0;var t=e.getBoundingClientRect(),r=n.getBoundingClientRect();return t.bottom>=r.top&&t.top<=r.bottom};if(e){var q=n.split(i),H="".concat(q[0]).concat(i).concat(q[1]);A=(null===(r=h.current[q[2]])||void 0===r?void 0:r.current)||(null===(l=g.current[Number(q[2])])||void 0===l?void 0:l.current)||null,w=(null===(u=R.current[q[3]])||void 0===u?void 0:u.current)||(null===(o=f.current[Number(q[3])])||void 0===o?void 0:o.current)||null,I=(null===(c=S.current[H])||void 0===c?void 0:c.current)||A,L=(null===(d=y.current[H])||void 0===d?void 0:d.current)||w}else{var P=Number(n),M=null!==t?Number(t):P;A=(null===(s=g.current[P])||void 0===s?void 0:s.current)||null,w=(null===(p=f.current[M])||void 0===p?void 0:p.current)||null,F=(null===(x=S.current[P])||void 0===x?void 0:x.current)||null,N=(null===(C=y.current[M])||void 0===C?void 0:C.current)||null,I=F||(null===(T=m.current[P])||void 0===T?void 0:T.current)||A,L=N||(null===(b=B.current[M])||void 0===b?void 0:b.current)||w}if(A&&(A.style.paddingTop="0px"),w&&(w.style.paddingTop="0px"),e||(F&&(F.style.marginTop="0px"),N&&(N.style.marginTop="0px")),!e&&F&&N){var z=v.current,V=a.current;if(!E(F,z)||!E(N,V))return;var j=F.getBoundingClientRect(),k=N.getBoundingClientRect(),O=j.top-k.top;if(Math.abs(O)>32)return;O>0&&(N.style.marginTop="".concat(O,"px"))}else if(I&&L&&A&&w){j=I.getBoundingClientRect(),k=L.getBoundingClientRect();(O=j.top-k.top)>0&&(w.style.paddingTop="".concat(O,"px"))}},te=t(function(){var e,n,t,r,l,u,o,c,d=Y.current,s=Z.current;if(null!==d)if("string"==typeof d&&d.includes(i)){var v=d.split(i),a=(null===(e=h.current[v[2]])||void 0===e?void 0:e.current)||(null===(n=g.current[Number(v[2])])||void 0===n?void 0:n.current)||null,p=(null===(t=R.current[v[3]])||void 0===t?void 0:t.current)||(null===(r=f.current[Number(v[3])])||void 0===r?void 0:r.current)||null;a&&(a.style.paddingTop="0px"),p&&(p.style.paddingTop="0px")}else{a=(null===(l=g.current[d])||void 0===l?void 0:l.current)||null,p=(null===(u=f.current[null!=s?s:d])||void 0===u?void 0:u.current)||null;a&&(a.style.paddingTop="0px"),p&&(p.style.paddingTop="0px");var m=(null===(o=S.current[d])||void 0===o?void 0:o.current)||null,B=(null===(c=y.current[null!=s?s:d])||void 0===c?void 0:c.current)||null;m&&(m.style.marginTop="0px"),B&&(B.style.marginTop="0px")}x.current&&(x.current.style.height="0px"),C.current&&(C.current.style.height="0px"),T.current&&(T.current.style.height="0px"),b.current&&(b.current.style.height="0px")},[]);r(function(){X.current=q},[q]),r(function(){Y.current=K},[K]);var re=t(function(){ee(),H(!1),X.current=!1,W.current=null,te(),Q(null),Y.current=null,Z.current=null,z(!1),G(!1)},[te]),ie=t(function(e,n,t){var r,u,o=null===(r=null==t?void 0:t.toggleIfSame)||void 0===r||r,h=null==t?void 0:t.onReady,R=null!==(u=null==t?void 0:t.sourceSide)&&void 0!==u?u:"left";if(F(),null!=e)if(n)N("No counterpart exists for this section.");else{ee();var E=q&&K===e;q&&null!==K&&te(),E&&o?re():(w(new Set([e])),I([]),L.current=[],G(!0),U.current=!0,Q(e),Y.current=e,H(!0),X.current=!0,z(!1),x.current&&(x.current.style.height="0px"),C.current&&(C.current.style.height="0px"),T.current&&(T.current.style.height="0px"),b.current&&(b.current.style.height="0px"),requestAnimationFrame(function(){var n,t,r,u,o,T,b,w,I="string"==typeof e&&e.includes(i),L=null,F=null,N=null;if(I){var E=e.split(i),q="".concat(E[0]).concat(i).concat(E[1]);L=(null===(n=S.current[q])||void 0===n?void 0:n.current)||null,F=(null===(t=y.current[q])||void 0===t?void 0:t.current)||null,N=F?e:null}else if(L=(null===(r=g.current[e])||void 0===r?void 0:r.current)||(null===(u=m.current[e])||void 0===u?void 0:u.current)||null,c){var H=d[e],P=(null==H?void 0:H.refIndexes)||[];if(P.length>0){var M=P[0],V=s.findIndex(function(e){return e.selfIndex===M});-1!==V&&(F=(null===(b=f.current[V])||void 0===b?void 0:b.current)||(null===(w=B.current[V])||void 0===w?void 0:w.current)||null,N=V)}}else F=(null===(o=f.current[e])||void 0===o?void 0:o.current)||(null===(T=B.current[e])||void 0===T?void 0:T.current)||null,N=F?e:null;Z.current=N;var j=v.current,k=a.current,O=function(){ne(I,e,N),z(!0),A.current&&A.current(),U.current=!1,"right"===R&&k?k.dispatchEvent(new Event("scroll")):j&&j.dispatchEvent(new Event("scroll")),G(!1),null==h||h()};if(!L||!j)return U.current=!1,G(!1),void(null==h||h());if(F&&k){if(!c){var D=0;D="right"===R?F?F.getBoundingClientRect().top:0:L?L.getBoundingClientRect().top:0;var J=p.current,K=(null==J?void 0:J.getBoundingClientRect().top)||0,Q=J?J.scrollTop+D-K-150:0;return J?void l(J,Q,200,O):void O()}var W=L.getBoundingClientRect().top-j.getBoundingClientRect().top+j.scrollTop,X=F.getBoundingClientRect().top-k.getBoundingClientRect().top+k.scrollTop,Y=200;if("left"===R){var $=X-(W-j.scrollTop);$<0&&x.current&&(x.current.style.height="".concat(Math.abs($),"px")),requestAnimationFrame(function(){var e,n=k.scrollHeight-k.clientHeight;if($<0)e=0;else{if($>n){var t=$-n;return C.current&&(C.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){l(k,$,Y,O)})}e=$}l(k,e,Y,O)})}else{var _=W-(X-k.scrollTop);requestAnimationFrame(function(){var e,n=j.scrollHeight-j.clientHeight;if(_<0)e=0;else{if(_>n)return void requestAnimationFrame(function(){return l(j,n,Y,O)});e=_}l(j,e,Y,O)})}}else O()}))}},[K,F,s,q,c,d,te,re]);return{isSideBySide:q,setIsSideBySide:H,isArrowVisible:M,setIsArrowVisible:z,isResizing:j,setIsResizing:k,isSideBySideLoading:D,setIsSideBySideLoading:G,activeSideBySideSection:K,setActiveSideBySideSection:Q,scrollLock:U,sideBySideCacheRef:W,isSideBySideRef:X,activeSideBySideSectionRef:Y,activeSideBySideRightSectionRef:Z,sideBySideLineRef:$,highlightedClauseRefs:_,clearClauseHighlight:ee,applyAlignmentPadding:ne,resetSideBySide:re,activateSideBySide:ie}};export{o as useSideBySide};
|
|
2
2
|
//# sourceMappingURL=useSideBySide.js.map
|