diver_down 0.0.1.alpha3 → 0.0.1.alpha5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/diver_down/helper.rb +12 -1
- data/lib/diver_down/trace/session.rb +1 -1
- data/lib/diver_down/version.rb +1 -1
- data/lib/diver_down/web/action.rb +1 -0
- data/lib/diver_down/web/module_store.rb +7 -1
- data/web/assets/bundle.js +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d5ffbc4ef413edc539a3334e4b705600a2662a37bb08a292787225ba810d875
|
4
|
+
data.tar.gz: 444f687a0aa2dbc3b6b91fa248d937f282a286bb6d8709a0ec9b04312fec942a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 350384f94a2c60506fffe52d43bdd705bf048cf6d62dfdd60f3d315fe89e9647896f1b9fc6491dc5bfeccd475c970580bd1ee4599e843a79e8bfd17d4d1f0764
|
7
|
+
data.tar.gz: e16ffe92d2df53c258e7fc4a295411f7f35611334af421d9e78b7fcc1b9e7b77190cdf568ca3fd0fa82a0340cd04175e2bb631cdfee3467bfdc31eb6f687e7c8
|
data/lib/diver_down/helper.rb
CHANGED
@@ -28,7 +28,11 @@ module DiverDown
|
|
28
28
|
# @return [Module, Class]
|
29
29
|
def self.resolve_module(obj)
|
30
30
|
if module?(obj) # Do not call method of this
|
31
|
-
|
31
|
+
if module_subclass?(obj)
|
32
|
+
obj.class
|
33
|
+
else
|
34
|
+
resolve_singleton_class(obj)
|
35
|
+
end
|
32
36
|
else
|
33
37
|
k = INSTANCE_CLASS_QUERY.bind_call(obj)
|
34
38
|
resolve_singleton_class(k)
|
@@ -62,5 +66,12 @@ module DiverDown
|
|
62
66
|
def self.constantize(str)
|
63
67
|
::ActiveSupport::Inflector.constantize(str)
|
64
68
|
end
|
69
|
+
|
70
|
+
# FIXME: I don't know the best way to determine which class inherits from Module.
|
71
|
+
# @return [Boolean]
|
72
|
+
def self.module_subclass?(mod)
|
73
|
+
mod.ancestors.size == 1 &&
|
74
|
+
mod.class < Module
|
75
|
+
end
|
65
76
|
end
|
66
77
|
end
|
data/lib/diver_down/version.rb
CHANGED
data/web/assets/bundle.js
CHANGED
@@ -352,7 +352,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
352
352
|
height: calc(100% - 60px);
|
353
353
|
`,q6=We(pt)`
|
354
354
|
display: block;
|
355
|
-
`;var J6=Object.defineProperty,A6=(e,t,r)=>t in e?J6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bu=(e,t,r)=>(A6(e,typeof t!="symbol"?t+"":t,r),r),kp=new Map,wu=new WeakMap,m1=0,eD=void 0;function tD(e){return e?(wu.has(e)||(m1+=1,wu.set(e,m1.toString())),wu.get(e)):"0"}function rD(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?tD(e.root):e[t]}`).toString()}function nD(e){const t=rD(e);let r=kp.get(t);if(!r){const n=new Map;let o;const i=new IntersectionObserver(a=>{a.forEach(s=>{var l;const u=s.isIntersecting&&o.some(f=>s.intersectionRatio>=f);e.trackVisibility&&typeof s.isVisible>"u"&&(s.isVisible=u),(l=n.get(s.target))==null||l.forEach(f=>{f(u,s)})})},e);o=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:i,elements:n},kp.set(t,r)}return r}function oD(e,t,r={},n=eD){if(typeof window.IntersectionObserver>"u"&&n!==void 0){const l=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:typeof r.threshold=="number"?r.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:o,observer:i,elements:a}=nD(r),s=a.get(e)||[];return a.has(e)||a.set(e,s),s.push(t),i.observe(e),function(){s.splice(s.indexOf(t),1),s.length===0&&(a.delete(e),i.unobserve(e)),a.size===0&&(i.disconnect(),kp.delete(o))}}function iD(e){return typeof e.children!="function"}var aD=class extends g.Component{constructor(e){super(e),bu(this,"node",null),bu(this,"_unobserveCb",null),bu(this,"handleNode",t=>{this.node&&(this.unobserve(),!t&&!this.props.triggerOnce&&!this.props.skip&&this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=t||null,this.observeNode()}),bu(this,"handleChange",(t,r)=>{t&&this.props.triggerOnce&&this.unobserve(),iD(this.props)||this.setState({inView:t,entry:r}),this.props.onChange&&this.props.onChange(t,r)}),this.state={inView:!!e.initialInView,entry:void 0}}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(e){(e.rootMargin!==this.props.rootMargin||e.root!==this.props.root||e.threshold!==this.props.threshold||e.skip!==this.props.skip||e.trackVisibility!==this.props.trackVisibility||e.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;const{threshold:e,root:t,rootMargin:r,trackVisibility:n,delay:o,fallbackInView:i}=this.props;this._unobserveCb=oD(this.node,this.handleChange,{threshold:e,root:t,rootMargin:r,trackVisibility:n,delay:o},i)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:e}=this.props;if(typeof e=="function"){const{inView:p,entry:y}=this.state;return e({inView:p,entry:y,ref:this.handleNode})}const{as:t,triggerOnce:r,threshold:n,root:o,rootMargin:i,onChange:a,skip:s,trackVisibility:l,delay:u,initialInView:f,fallbackInView:d,...m}=this.props;return g.createElement(t||"div",{ref:this.handleNode,...m},e)}};const g1=O.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),$d={dedupe:!0},sD=(e,t,r)=>{const{cache:n,compare:o,suspense:i,fallbackData:a,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:d,keepPreviousData:m}=r,[p,y,x,R]=rn.get(n),[v,b]=bo(e),E=g.useRef(!1),k=g.useRef(!1),_=g.useRef(v),T=g.useRef(t),L=g.useRef(r),I=()=>L.current,W=()=>I().isVisible()&&I().isOnline(),[D,G,j,Y]=Wn(n,v),B=g.useRef({}).current,$=pe(a)?r.fallback[v]:a,M=(te,oe)=>{for(const ne in B){const fe=ne;if(fe==="data"){if(!o(te[fe],oe[fe])&&(!pe(te[fe])||!o(ae,oe[fe])))return!1}else if(oe[fe]!==te[fe])return!1}return!0},U=g.useMemo(()=>{const te=!v||!t?!1:pe(s)?I().isPaused()||i?!1:pe(l)?!0:l:s,oe=se=>{const Re=Mr(se);return delete Re._k,te?{isValidating:!0,isLoading:!0,...Re}:Re},ne=D(),fe=Y(),me=oe(ne),S=ne===fe?me:oe(fe);let he=me;return[()=>{const se=oe(D());return M(se,he)?(he.data=se.data,he.isLoading=se.isLoading,he.isValidating=se.isValidating,he.error=se.error,he):(he=se,se)},()=>S]},[n,v]),P=vf.useSyncExternalStore(g.useCallback(te=>j(v,(oe,ne)=>{M(ne,oe)||te()}),[n,v]),U[0],U[1]),z=!E.current,Q=p[v]&&p[v].length>0,J=P.data,q=pe(J)?$:J,ie=P.error,Z=g.useRef(q),ae=m?pe(J)?Z.current:J:q,ce=Q&&!pe(ie)?!1:z&&!pe(s)?s:I().isPaused()?!1:i?pe(q)?!1:l:pe(q)||l,ge=!!(v&&t&&z&&ce),xe=pe(P.isValidating)?ge:P.isValidating,_e=pe(P.isLoading)?ge:P.isLoading,le=g.useCallback(async te=>{const oe=T.current;if(!v||!oe||k.current||I().isPaused())return!1;let ne,fe,me=!0;const S=te||{},he=!x[v]||!S.dedupe,se=()=>$i?!k.current&&v===_.current&&E.current:v===_.current,Re={isValidating:!1,isLoading:!1},gt=()=>{G(Re)},Ae=()=>{const Te=x[v];Te&&Te[1]===fe&&delete x[v]},qe={isValidating:!0};pe(D().data)&&(qe.isLoading=!0);try{if(he&&(G(qe),r.loadingTimeout&&pe(D().data)&&setTimeout(()=>{me&&se()&&I().onLoadingSlow(v,r)},r.loadingTimeout),x[v]=[oe(b),Bi()]),[ne,fe]=x[v],ne=await ne,he&&setTimeout(Ae,r.dedupingInterval),!x[v]||x[v][1]!==fe)return he&&se()&&I().onDiscarded(v),!1;Re.error=rt;const Te=y[v];if(!pe(Te)&&(fe<=Te[0]||fe<=Te[1]||Te[1]===0))return gt(),he&&se()&&I().onDiscarded(v),!1;const Ne=D().data;Re.data=o(Ne,ne)?Ne:ne,he&&se()&&I().onSuccess(ne,v,r)}catch(Te){Ae();const Ne=I(),{shouldRetryOnError:yt}=Ne;Ne.isPaused()||(Re.error=Te,he&&se()&&(Ne.onError(Te,v,Ne),(yt===!0||sr(yt)&&yt(Te))&&(!I().revalidateOnFocus||!I().revalidateOnReconnect||W())&&Ne.onErrorRetry(Te,v,Ne,Rt=>{const Ve=p[v];Ve&&Ve[0]&&Ve[0](gr.ERROR_REVALIDATE_EVENT,Rt)},{retryCount:(S.retryCount||0)+1,dedupe:!0})))}return me=!1,gt(),!0},[v,n]),Ee=g.useCallback((...te)=>wf(n,_.current,...te),[]);if(Gr(()=>{T.current=t,L.current=r,pe(J)||(Z.current=J)}),Gr(()=>{if(!v)return;const te=le.bind(rt,$d);let oe=0;const fe=og(v,p,(me,S={})=>{if(me==gr.FOCUS_EVENT){const he=Date.now();I().revalidateOnFocus&&he>oe&&W()&&(oe=he+I().focusThrottleInterval,te())}else if(me==gr.RECONNECT_EVENT)I().revalidateOnReconnect&&W()&&te();else{if(me==gr.MUTATE_EVENT)return le();if(me==gr.ERROR_REVALIDATE_EVENT)return le(S)}});return k.current=!1,_.current=v,E.current=!0,G({_k:b}),ce&&(pe(q)||vo?te():tg(te)),()=>{k.current=!0,fe()}},[v]),Gr(()=>{let te;function oe(){const fe=sr(u)?u(D().data):u;fe&&te!==-1&&(te=setTimeout(ne,fe))}function ne(){!D().error&&(f||I().isVisible())&&(d||I().isOnline())?le($d).then(oe):oe()}return oe(),()=>{te&&(clearTimeout(te),te=-1)}},[u,f,d,v]),g.useDebugValue(ae),i&&pe(q)&&v){if(!$i&&vo)throw new Error("Fallback data is required when using suspense in SSR.");T.current=t,L.current=r,k.current=!1;const te=R[v];if(!pe(te)){const oe=Ee(te);g1(oe)}if(pe(ie)){const oe=le($d);pe(ae)||(oe.status="fulfilled",oe.value=!0),g1(oe)}else throw ie}return{mutate:Ee,get data(){return B.data=!0,ae},get error(){return B.error=!0,ie},get isValidating(){return B.isValidating=!0,xe},get isLoading(){return B.isLoading=!0,_e}}};Ea.defineProperty(rg,"defaultValue",{value:Ef});const lD=ng(sD),uD=e=>bo(e?e(0,null):null)[0],Bd=Promise.resolve(),cD=e=>(t,r,n)=>{const o=g.useRef(!1),{cache:i,initialSize:a=1,revalidateAll:s=!1,persistSize:l=!1,revalidateFirstPage:u=!0,revalidateOnMount:f=!1,parallel:d=!1}=n,[,,,m]=rn.get(xf);let p;try{p=uD(t),p&&(p=O2+p)}catch{}const[y,x,R]=Wn(i,p),v=g.useCallback(()=>pe(y()._l)?a:y()._l,[i,p,a]);vf.useSyncExternalStore(g.useCallback(I=>p?R(p,()=>{I()}):()=>{},[i,p]),v,v);const b=g.useCallback(()=>{const I=y()._l;return pe(I)?a:I},[p,a]),E=g.useRef(b());Gr(()=>{if(!o.current){o.current=!0;return}p&&x({_l:l?E.current:b()})},[p,i]);const k=f&&!o.current,_=e(p,async I=>{const W=y()._i,D=y()._r;x({_r:rt});const G=[],j=b(),[Y]=Wn(i,I),B=Y().data,$=[];let M=null;for(let U=0;U<j;++U){const[P,z]=bo(t(U,d?null:M));if(!P)break;const[Q,J]=Wn(i,P);let q=Q().data;const ie=s||W||pe(q)||u&&!U&&!pe(B)||k||B&&!pe(B[U])&&!n.compare(B[U],q);if(r&&(typeof D=="function"?D(q,z):ie)){const Z=async()=>{if(!(P in m))q=await r(z);else{const ce=m[P];delete m[P],q=await ce}J({data:q,_k:z}),G[U]=q};d?$.push(Z):await Z()}else G[U]=q;d||(M=q)}return d&&await Promise.all($.map(U=>U())),x({_i:rt}),G},n),T=g.useCallback(function(I,W){const D=typeof W=="boolean"?{revalidate:W}:W||{},G=D.revalidate!==!1;return p?(G&&(pe(I)?x({_i:!0,_r:D.revalidate}):x({_i:!1,_r:D.revalidate})),arguments.length?_.mutate(I,{...D,revalidate:G}):_.mutate()):Bd},[p,i]),L=g.useCallback(I=>{if(!p)return Bd;const[,W]=Wn(i,p);let D;if(sr(I)?D=I(b()):typeof I=="number"&&(D=I),typeof D!="number")return Bd;W({_l:D}),E.current=D;const G=[],[j]=Wn(i,p);let Y=null;for(let B=0;B<D;++B){const[$]=bo(t(B,Y)),[M]=Wn(i,$),U=$?M().data:rt;if(pe(U))return T(j().data);G.push(U),Y=U}return T(G)},[p,i,T,b]);return{size:b(),setSize:L,mutate:T,get data(){return _.data},get error(){return _.error},get isValidating(){return _.isValidating},get isLoading(){return _.isLoading}}},fD=R2(lD,cD),y1=100,dD=(e,t=!1)=>{var d,m;const r=(p,y)=>{if(y&&y.length===0)return null;const x={per:y1,page:p+1,definition_group:e.definitionGroup,title:e.title,source:e.source};return`${Le.api.definitions.index()}?${ja(x)}`},n=g.useCallback(async p=>(await si(p)).definitions.map(x=>({id:x.id,definitionGroup:x.definition_group,title:x.title})),[]),{data:o,isLoading:i,size:a,setSize:s,isValidating:l}=fD(r,n,{keepPreviousData:t}),u=!!(((d=o==null?void 0:o[0])==null?void 0:d.length)===0||o&&((m=o==null?void 0:o[(o==null?void 0:o.length)-1])==null?void 0:m.length)<y1);return{definitions:(o??[]).flat(),isLoading:i,size:a,setSize:s,isValidating:l,isReachingEnd:u}},hD=({isOpen:e,onClickClose:t,searchDefinitionsOptions:r,setSearchDefinitionsOptions:n})=>{const[o,i]=g.useState(r),a=()=>{t(),i(r)},s=()=>{n(o),t()},l=g.useCallback(m=>{i(p=>({...p,definitionGroup:m.target.value}))},[i]),u=g.useCallback(m=>{i(p=>({...p,title:m.target.value}))},[i]),f=g.useCallback(m=>{i(p=>({...p,source:m.target.value}))},[i]),d=g.useCallback(m=>{i(p=>({...p,folding:m.target.checked}))},[i]);return N.jsx(o2,{title:"Configure Search Options",decorators:{closeButtonLabel:()=>"Close"},actionText:"Save",actionTheme:"primary",isOpen:e,onClickAction:s,onClickClose:a,onClickOverlay:a,width:"500px",children:N.jsx(pD,{children:N.jsx(Ze,{gap:1.5,children:N.jsxs(Ze,{gap:1.5,children:[N.jsx("p",{children:"Configure settings related to the display of definitions."}),N.jsxs(Ze,{gap:1.5,children:[N.jsx($o,{title:"Filtering definition group",helpMessage:"Refine the definition with a definition group",children:N.jsx(Ri,{name:"definitionGroup",type:"text",onChange:l,value:o.definitionGroup})}),N.jsx($o,{title:"Filtering title",helpMessage:"Refine the definition with a title",children:N.jsx(Ri,{name:"title",type:"text",onChange:u,value:o.title})}),N.jsx($o,{title:"Filtering source",helpMessage:"Refine the definition with a source",children:N.jsx(Ri,{name:"source",type:"text",onChange:f,value:o.source})}),N.jsx($o,{title:"Fold Definitions",helpMessage:"Folding the same definition_group",children:N.jsx(xa,{name:"folding",onChange:d,checked:o.folding})})]})]})})})})},pD=We(jt)`
|
355
|
+
`;var J6=Object.defineProperty,A6=(e,t,r)=>t in e?J6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bu=(e,t,r)=>(A6(e,typeof t!="symbol"?t+"":t,r),r),kp=new Map,wu=new WeakMap,m1=0,eD=void 0;function tD(e){return e?(wu.has(e)||(m1+=1,wu.set(e,m1.toString())),wu.get(e)):"0"}function rD(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?tD(e.root):e[t]}`).toString()}function nD(e){const t=rD(e);let r=kp.get(t);if(!r){const n=new Map;let o;const i=new IntersectionObserver(a=>{a.forEach(s=>{var l;const u=s.isIntersecting&&o.some(f=>s.intersectionRatio>=f);e.trackVisibility&&typeof s.isVisible>"u"&&(s.isVisible=u),(l=n.get(s.target))==null||l.forEach(f=>{f(u,s)})})},e);o=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:i,elements:n},kp.set(t,r)}return r}function oD(e,t,r={},n=eD){if(typeof window.IntersectionObserver>"u"&&n!==void 0){const l=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:typeof r.threshold=="number"?r.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:o,observer:i,elements:a}=nD(r),s=a.get(e)||[];return a.has(e)||a.set(e,s),s.push(t),i.observe(e),function(){s.splice(s.indexOf(t),1),s.length===0&&(a.delete(e),i.unobserve(e)),a.size===0&&(i.disconnect(),kp.delete(o))}}function iD(e){return typeof e.children!="function"}var aD=class extends g.Component{constructor(e){super(e),bu(this,"node",null),bu(this,"_unobserveCb",null),bu(this,"handleNode",t=>{this.node&&(this.unobserve(),!t&&!this.props.triggerOnce&&!this.props.skip&&this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=t||null,this.observeNode()}),bu(this,"handleChange",(t,r)=>{t&&this.props.triggerOnce&&this.unobserve(),iD(this.props)||this.setState({inView:t,entry:r}),this.props.onChange&&this.props.onChange(t,r)}),this.state={inView:!!e.initialInView,entry:void 0}}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(e){(e.rootMargin!==this.props.rootMargin||e.root!==this.props.root||e.threshold!==this.props.threshold||e.skip!==this.props.skip||e.trackVisibility!==this.props.trackVisibility||e.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;const{threshold:e,root:t,rootMargin:r,trackVisibility:n,delay:o,fallbackInView:i}=this.props;this._unobserveCb=oD(this.node,this.handleChange,{threshold:e,root:t,rootMargin:r,trackVisibility:n,delay:o},i)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:e}=this.props;if(typeof e=="function"){const{inView:p,entry:y}=this.state;return e({inView:p,entry:y,ref:this.handleNode})}const{as:t,triggerOnce:r,threshold:n,root:o,rootMargin:i,onChange:a,skip:s,trackVisibility:l,delay:u,initialInView:f,fallbackInView:d,...m}=this.props;return g.createElement(t||"div",{ref:this.handleNode,...m},e)}};const g1=O.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),$d={dedupe:!0},sD=(e,t,r)=>{const{cache:n,compare:o,suspense:i,fallbackData:a,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:d,keepPreviousData:m}=r,[p,y,x,R]=rn.get(n),[v,b]=bo(e),E=g.useRef(!1),k=g.useRef(!1),_=g.useRef(v),T=g.useRef(t),L=g.useRef(r),I=()=>L.current,W=()=>I().isVisible()&&I().isOnline(),[D,G,j,Y]=Wn(n,v),B=g.useRef({}).current,$=pe(a)?r.fallback[v]:a,M=(te,oe)=>{for(const ne in B){const fe=ne;if(fe==="data"){if(!o(te[fe],oe[fe])&&(!pe(te[fe])||!o(ae,oe[fe])))return!1}else if(oe[fe]!==te[fe])return!1}return!0},U=g.useMemo(()=>{const te=!v||!t?!1:pe(s)?I().isPaused()||i?!1:pe(l)?!0:l:s,oe=se=>{const Re=Mr(se);return delete Re._k,te?{isValidating:!0,isLoading:!0,...Re}:Re},ne=D(),fe=Y(),me=oe(ne),S=ne===fe?me:oe(fe);let he=me;return[()=>{const se=oe(D());return M(se,he)?(he.data=se.data,he.isLoading=se.isLoading,he.isValidating=se.isValidating,he.error=se.error,he):(he=se,se)},()=>S]},[n,v]),P=vf.useSyncExternalStore(g.useCallback(te=>j(v,(oe,ne)=>{M(ne,oe)||te()}),[n,v]),U[0],U[1]),z=!E.current,Q=p[v]&&p[v].length>0,J=P.data,q=pe(J)?$:J,ie=P.error,Z=g.useRef(q),ae=m?pe(J)?Z.current:J:q,ce=Q&&!pe(ie)?!1:z&&!pe(s)?s:I().isPaused()?!1:i?pe(q)?!1:l:pe(q)||l,ge=!!(v&&t&&z&&ce),xe=pe(P.isValidating)?ge:P.isValidating,_e=pe(P.isLoading)?ge:P.isLoading,le=g.useCallback(async te=>{const oe=T.current;if(!v||!oe||k.current||I().isPaused())return!1;let ne,fe,me=!0;const S=te||{},he=!x[v]||!S.dedupe,se=()=>$i?!k.current&&v===_.current&&E.current:v===_.current,Re={isValidating:!1,isLoading:!1},gt=()=>{G(Re)},Ae=()=>{const Te=x[v];Te&&Te[1]===fe&&delete x[v]},qe={isValidating:!0};pe(D().data)&&(qe.isLoading=!0);try{if(he&&(G(qe),r.loadingTimeout&&pe(D().data)&&setTimeout(()=>{me&&se()&&I().onLoadingSlow(v,r)},r.loadingTimeout),x[v]=[oe(b),Bi()]),[ne,fe]=x[v],ne=await ne,he&&setTimeout(Ae,r.dedupingInterval),!x[v]||x[v][1]!==fe)return he&&se()&&I().onDiscarded(v),!1;Re.error=rt;const Te=y[v];if(!pe(Te)&&(fe<=Te[0]||fe<=Te[1]||Te[1]===0))return gt(),he&&se()&&I().onDiscarded(v),!1;const Ne=D().data;Re.data=o(Ne,ne)?Ne:ne,he&&se()&&I().onSuccess(ne,v,r)}catch(Te){Ae();const Ne=I(),{shouldRetryOnError:yt}=Ne;Ne.isPaused()||(Re.error=Te,he&&se()&&(Ne.onError(Te,v,Ne),(yt===!0||sr(yt)&&yt(Te))&&(!I().revalidateOnFocus||!I().revalidateOnReconnect||W())&&Ne.onErrorRetry(Te,v,Ne,Rt=>{const Ve=p[v];Ve&&Ve[0]&&Ve[0](gr.ERROR_REVALIDATE_EVENT,Rt)},{retryCount:(S.retryCount||0)+1,dedupe:!0})))}return me=!1,gt(),!0},[v,n]),Ee=g.useCallback((...te)=>wf(n,_.current,...te),[]);if(Gr(()=>{T.current=t,L.current=r,pe(J)||(Z.current=J)}),Gr(()=>{if(!v)return;const te=le.bind(rt,$d);let oe=0;const fe=og(v,p,(me,S={})=>{if(me==gr.FOCUS_EVENT){const he=Date.now();I().revalidateOnFocus&&he>oe&&W()&&(oe=he+I().focusThrottleInterval,te())}else if(me==gr.RECONNECT_EVENT)I().revalidateOnReconnect&&W()&&te();else{if(me==gr.MUTATE_EVENT)return le();if(me==gr.ERROR_REVALIDATE_EVENT)return le(S)}});return k.current=!1,_.current=v,E.current=!0,G({_k:b}),ce&&(pe(q)||vo?te():tg(te)),()=>{k.current=!0,fe()}},[v]),Gr(()=>{let te;function oe(){const fe=sr(u)?u(D().data):u;fe&&te!==-1&&(te=setTimeout(ne,fe))}function ne(){!D().error&&(f||I().isVisible())&&(d||I().isOnline())?le($d).then(oe):oe()}return oe(),()=>{te&&(clearTimeout(te),te=-1)}},[u,f,d,v]),g.useDebugValue(ae),i&&pe(q)&&v){if(!$i&&vo)throw new Error("Fallback data is required when using suspense in SSR.");T.current=t,L.current=r,k.current=!1;const te=R[v];if(!pe(te)){const oe=Ee(te);g1(oe)}if(pe(ie)){const oe=le($d);pe(ae)||(oe.status="fulfilled",oe.value=!0),g1(oe)}else throw ie}return{mutate:Ee,get data(){return B.data=!0,ae},get error(){return B.error=!0,ie},get isValidating(){return B.isValidating=!0,xe},get isLoading(){return B.isLoading=!0,_e}}};Ea.defineProperty(rg,"defaultValue",{value:Ef});const lD=ng(sD),uD=e=>bo(e?e(0,null):null)[0],Bd=Promise.resolve(),cD=e=>(t,r,n)=>{const o=g.useRef(!1),{cache:i,initialSize:a=1,revalidateAll:s=!1,persistSize:l=!1,revalidateFirstPage:u=!0,revalidateOnMount:f=!1,parallel:d=!1}=n,[,,,m]=rn.get(xf);let p;try{p=uD(t),p&&(p=O2+p)}catch{}const[y,x,R]=Wn(i,p),v=g.useCallback(()=>pe(y()._l)?a:y()._l,[i,p,a]);vf.useSyncExternalStore(g.useCallback(I=>p?R(p,()=>{I()}):()=>{},[i,p]),v,v);const b=g.useCallback(()=>{const I=y()._l;return pe(I)?a:I},[p,a]),E=g.useRef(b());Gr(()=>{if(!o.current){o.current=!0;return}p&&x({_l:l?E.current:b()})},[p,i]);const k=f&&!o.current,_=e(p,async I=>{const W=y()._i,D=y()._r;x({_r:rt});const G=[],j=b(),[Y]=Wn(i,I),B=Y().data,$=[];let M=null;for(let U=0;U<j;++U){const[P,z]=bo(t(U,d?null:M));if(!P)break;const[Q,J]=Wn(i,P);let q=Q().data;const ie=s||W||pe(q)||u&&!U&&!pe(B)||k||B&&!pe(B[U])&&!n.compare(B[U],q);if(r&&(typeof D=="function"?D(q,z):ie)){const Z=async()=>{if(!(P in m))q=await r(z);else{const ce=m[P];delete m[P],q=await ce}J({data:q,_k:z}),G[U]=q};d?$.push(Z):await Z()}else G[U]=q;d||(M=q)}return d&&await Promise.all($.map(U=>U())),x({_i:rt}),G},n),T=g.useCallback(function(I,W){const D=typeof W=="boolean"?{revalidate:W}:W||{},G=D.revalidate!==!1;return p?(G&&(pe(I)?x({_i:!0,_r:D.revalidate}):x({_i:!1,_r:D.revalidate})),arguments.length?_.mutate(I,{...D,revalidate:G}):_.mutate()):Bd},[p,i]),L=g.useCallback(I=>{if(!p)return Bd;const[,W]=Wn(i,p);let D;if(sr(I)?D=I(b()):typeof I=="number"&&(D=I),typeof D!="number")return Bd;W({_l:D}),E.current=D;const G=[],[j]=Wn(i,p);let Y=null;for(let B=0;B<D;++B){const[$]=bo(t(B,Y)),[M]=Wn(i,$),U=$?M().data:rt;if(pe(U))return T(j().data);G.push(U),Y=U}return T(G)},[p,i,T,b]);return{size:b(),setSize:L,mutate:T,get data(){return _.data},get error(){return _.error},get isValidating(){return _.isValidating},get isLoading(){return _.isLoading}}},fD=R2(lD,cD),y1=100,dD=(e,t=!1)=>{var d,m;const r=(p,y)=>{if(y&&y.length===0)return null;const x={per:y1,page:p+1,definition_group:e.definitionGroup,title:e.title,source:e.source};return`${Le.api.definitions.index()}?${ja(x)}`},n=g.useCallback(async p=>(await si(p)).definitions.map(x=>({id:x.id,definitionGroup:x.definition_group,title:x.title,sourcesCount:x.sources_count})),[]),{data:o,isLoading:i,size:a,setSize:s,isValidating:l}=fD(r,n,{keepPreviousData:t}),u=!!(((d=o==null?void 0:o[0])==null?void 0:d.length)===0||o&&((m=o==null?void 0:o[(o==null?void 0:o.length)-1])==null?void 0:m.length)<y1);return{definitions:(o??[]).flat(),isLoading:i,size:a,setSize:s,isValidating:l,isReachingEnd:u}},hD=({isOpen:e,onClickClose:t,searchDefinitionsOptions:r,setSearchDefinitionsOptions:n})=>{const[o,i]=g.useState(r),a=()=>{t(),i(r)},s=()=>{n(o),t()},l=g.useCallback(m=>{i(p=>({...p,definitionGroup:m.target.value}))},[i]),u=g.useCallback(m=>{i(p=>({...p,title:m.target.value}))},[i]),f=g.useCallback(m=>{i(p=>({...p,source:m.target.value}))},[i]),d=g.useCallback(m=>{i(p=>({...p,folding:m.target.checked}))},[i]);return N.jsx(o2,{title:"Configure Search Options",decorators:{closeButtonLabel:()=>"Close"},actionText:"Save",actionTheme:"primary",isOpen:e,onClickAction:s,onClickClose:a,onClickOverlay:a,width:"500px",children:N.jsx(pD,{children:N.jsx(Ze,{gap:1.5,children:N.jsxs(Ze,{gap:1.5,children:[N.jsx("p",{children:"Configure settings related to the display of definitions."}),N.jsxs(Ze,{gap:1.5,children:[N.jsx($o,{title:"Filtering definition group",helpMessage:"Refine the definition with a definition group",children:N.jsx(Ri,{name:"definitionGroup",type:"text",onChange:l,value:o.definitionGroup})}),N.jsx($o,{title:"Filtering title",helpMessage:"Refine the definition with a title",children:N.jsx(Ri,{name:"title",type:"text",onChange:u,value:o.title})}),N.jsx($o,{title:"Filtering source",helpMessage:"Refine the definition with a source",children:N.jsx(Ri,{name:"source",type:"text",onChange:f,value:o.source})}),N.jsx($o,{title:"Fold Definitions",helpMessage:"Folding the same definition_group",children:N.jsx(xa,{name:"folding",onChange:d,checked:o.folding})})]})]})})})})},pD=We(jt)`
|
356
356
|
padding: ${ai.XS};
|
357
357
|
`;function mE(){const e=P2(gE.displayName||"SideNav");return g.useMemo(()=>({wrapper:e(),item:e("item"),itemTitle:e("itemTitle")}),[e])}const mD=g.forwardRef((e,t)=>{const{title:r,prefix:n,isSelected:o=!1,size:i,onClick:a}=e,s=mE(),l=a?f=>a(f):void 0,u=`${o?"selected":""} ${s.item}`;return N.jsx(gD,{ref:t,className:u,children:N.jsxs(yD,{className:i,onClick:l,children:[n&&N.jsx(vD,{children:n}),N.jsx("span",{className:s.itemTitle,children:r})]})})}),gD=We.li`
|
358
358
|
color: ${qt.TEXT_BLACK};
|
@@ -404,7 +404,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
404
404
|
background-color: ${qt.COLUMN};
|
405
405
|
list-style: none;
|
406
406
|
padding: 0;
|
407
|
-
`,wD=(e,t)=>e.reduce((r,n)=>{const o=t(n);return r[o]=r[o]??[],r[o].push(n),r},{}),xu="_____null_____",xD=g.forwardRef((e,t)=>{const{definitions:r,inView:n,loadNextPage:o,selectedDefinitionIds:i,setSelectedDefinitionIds:a,folding:s,isReachingEnd:l}=e;g.useEffect(()=>{n&&o()},[n,o]);const u=g.useMemo(()=>{const f=wD(r,m=>m.definitionGroup??xu),d=[];return Object.keys(f).forEach(m=>{const p=f[m];if(m!==xu){const y=p.map(({id:v})=>v),x=y.every(v=>i.includes(v)),R=v=>{v.preventDefault(),a(x?b=>b.filter(E=>!y.includes(E)):b=>[...new Set([...b,...y])])};d.push({key:`definition-group-${m}`,title:m,isSelected:x,onClick:R,prefix:N.jsx(xa,{checked:x,onClick:R})})}(!s||m===xu)&&p.forEach(y=>{const x=v=>{v.stopPropagation(),a(b=>b.includes(y.id)?b.filter(E=>E!==y.id):[...b,y.id])},R=i.includes(y.id);d.push({key:`definition-${y.id}`,title
|
407
|
+
`,wD=(e,t)=>e.reduce((r,n)=>{const o=t(n);return r[o]=r[o]??[],r[o].push(n),r},{}),xu="_____null_____",xD=g.forwardRef((e,t)=>{const{definitions:r,inView:n,loadNextPage:o,selectedDefinitionIds:i,setSelectedDefinitionIds:a,folding:s,isReachingEnd:l}=e;g.useEffect(()=>{n&&o()},[n,o]);const u=g.useMemo(()=>{const f=wD(r,m=>m.definitionGroup??xu),d=[];return Object.keys(f).forEach(m=>{const p=f[m];if(m!==xu){const y=p.map(({id:v})=>v),x=y.every(v=>i.includes(v)),R=v=>{v.preventDefault(),a(x?b=>b.filter(E=>!y.includes(E)):b=>[...new Set([...b,...y])])};d.push({key:`definition-group-${m}`,title:m,isSelected:x,onClick:R,prefix:N.jsx(xa,{checked:x,onClick:R})})}(!s||m===xu)&&p.forEach(y=>{const x=v=>{v.stopPropagation(),a(b=>b.includes(y.id)?b.filter(E=>E!==y.id):[...b,y.id])},R=i.includes(y.id);d.push({key:`definition-${y.id}`,title:`(${y.sourcesCount}) ${y.title}`,isSelected:R,onClick:x,prefix:N.jsxs(N.Fragment,{children:[m===xu?null:N.jsx(SD,{className:"side-nav-indent"}),N.jsx(xa,{checked:R,onClick:x})]})})})}),d.length>0&&(d[d.length-1].ref=t),l&&d.push({key:"definition-reaching-end",title:"--- Reached the end ---",isSelected:!1,onClick:()=>{}}),d},[r,i,t,a,s,l]);return N.jsx(ED,{size:"s",items:u})}),ED=We(gE)`
|
408
408
|
background-color: ${qt.WHITE};
|
409
409
|
text-wrap: nowrap;
|
410
410
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diver_down
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.alpha5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alpaca-tc
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
|
-
rubygems_version: 3.5.
|
107
|
+
rubygems_version: 3.5.9
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: dynamically analyze application dependencies and generate a comprehensive
|