@xcpcio/board-app 0.35.1 → 0.37.0
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/assets/Board-1e98f0f2.js +3 -0
- package/dist/assets/Board-605f814f.css +1 -0
- package/dist/assets/{DataSourceInput.vue_vue_type_script_setup_true_lang-91587e20.js → DataSourceInput.vue_vue_type_script_setup_true_lang-02455050.js} +1 -1
- package/dist/assets/{TheInput.vue_vue_type_script_setup_true_lang-2e96dd27.js → TheInput.vue_vue_type_script_setup_true_lang-a031bfb6.js} +1 -1
- package/dist/assets/{_...all_-4cfeab5e.js → _...all_-fb6fc8ba.js} +1 -1
- package/dist/assets/{_name_-151eba7a.js → _name_-735c6fb7.js} +1 -1
- package/dist/assets/{about-9991c833.js → about-eb27e531.js} +1 -1
- package/dist/assets/{board-faa56130.js → board-e67f6116.js} +1 -1
- package/dist/assets/{board-layout-21a342d8.js → board-layout-e7a2768f.js} +1 -1
- package/dist/assets/{headless-44a48547.js → headless-6d929d05.js} +1 -1
- package/dist/assets/{home-c1a1f4de.js → home-71038d6b.js} +1 -1
- package/dist/assets/{index-bed92a26.css → index-03c128b2.css} +2 -2
- package/dist/assets/{index-767cb3c2.js → index-0d087976.js} +1 -1
- package/dist/assets/{index-c9c87d2c.js → index-1304674a.js} +79 -79
- package/dist/assets/{index-763127d7.js → index-616a2412.js} +1 -1
- package/dist/assets/{index-layout-44b87b20.js → index-layout-0bd56ff5.js} +1 -1
- package/dist/assets/{test-7b7edbfe.js → test-052ab1ce.js} +1 -1
- package/dist/assets/{useQueryBoardData-2e551ef1.js → useQueryBoardData-67124d23.js} +1 -1
- package/dist/assets/{user-8345d559.js → user-0363fa4d.js} +1 -1
- package/dist/assets/{virtual_pwa-register-db66d448.js → virtual_pwa-register-1b1003e5.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +3 -3
- package/src/auto-imports.d.ts +6 -0
- package/src/components/board/AnimatedSubmissionBlock.vue +85 -0
- package/src/components/board/AnimatedSubmissionsModal.vue +79 -76
- package/src/components/board/Board.vue +43 -19
- package/src/components/board/Progress.vue +2 -2
- package/src/components/board/TeamUI.vue +1 -1
- package/src/components.d.ts +1 -0
- package/src/composables/color.ts +17 -1
- package/src/composables/type.ts +13 -0
- package/src/styles/color.css +10 -0
- package/dist/assets/Board-4ff7c54d.js +0 -3
- package/dist/assets/Board-dd357633.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as w,s as h,i,v as L,o,c as t,l as e,n as V,d as s,x as D,t as v,m as y,h as F,B as C,u as R,w as A,j as O,y as q,z as M,A as Q,k as X,F as I,D as G,E as H,R as J,b as B,a as K,q as S}from"./index-
|
|
1
|
+
import{g as w,s as h,i,v as L,o,c as t,l as e,n as V,d as s,x as D,t as v,m as y,h as F,B as C,u as R,w as A,j as O,y as q,z as M,A as Q,k as X,F as I,D as G,E as H,R as J,b as B,a as K,q as S}from"./index-1304674a.js";import{u as P}from"./useQueryBoardData-67124d23.js";import{g as W,_ as Y}from"./DataSourceInput.vue_vue_type_script_setup_true_lang-02455050.js";import"./TheInput.vue_vue_type_script_setup_true_lang-a031bfb6.js";const Z={flex:"","flex-1":"","flex-col":"","justify-center":"","items-start":""},ee={class:"resolver-team-name",truncate:"","overflow-hidden":""},oe=s("div",{flex:"","flex-row":"","text-sm":"","items-start":"","gap-x-2":""},null,-1),te={"w-32":"",flex:"","flex-shrink-0":"","flex-row":"","justify-start":"","items-center":""},se=w({__name:"BalloonBlock",props:{index:{},balloon:{}},setup(m){const n=m,u=h(()=>n.index),a=h(()=>n.balloon),l=i(null),r=L(l);function x(c){return[c.location,c.organization,c.name].filter(k=>k).join(" - ")}const f=h(()=>a.value.problem.balloonColor);return(c,p)=>(o(),t("div",{ref_key:"el",ref:l,"h-24":""},[e(r)?(o(),t("div",{key:0,"h-24":"",flex:"","flex-row":"","gap-x-4":"","font-mono":"","text-4xl":"",class:V([e(u)%2===0?"bg-resolver-bg-zero":"bg-resolver-bg-one"])},[s("div",{"w-20":"",flex:"","flex-shrink-0":"","justify-center":"","items-center":"",style:D({backgroundColor:e(f).background_color})},[s("div",{style:D({color:e(f).color})},v(e(a).problem.label),5)],4),s("div",Z,[s("div",ee,v(x(e(a).team)),1),oe]),s("div",te,v(e(a).submission.timestampToMinute),1)],2)):y("",!0)],512))}}),ne={class:"bg-[#323443]","text-gray-200":""},ae={key:0},le={flex:"","flex-col":"","justify-center":"","items-center":"","w-screen":"","h-screen":"","text-xl":"",italic:""},re={key:0},ce={key:1},ie={flex:"","flex-col":"","justify-between":""},ue=w({__name:"Balloon",props:{dataSourceUrl:null},setup(m){const n=m,u=F(C),{t:a}=R(),l=i(!1),r=i({}),x=i([]),f=i([]),c=i({}),p=i(new Date);function k(){const d=new J(r.value,x.value,f.value);d.buildBalloons(),c.value=d}const{data:_,isError:N,error:T}=P(n.dataSourceUrl,p);A(_,async()=>{var d,g,b;_.value===null||_.value===void 0||(r.value=O((d=_.value)==null?void 0:d.contest),u.value=`${r.value.name} | ${C}`,x.value=q((g=_.value)==null?void 0:g.teams),f.value=M((b=_.value)==null?void 0:b.submissions),k(),l.value=!0)});const U=h(()=>c.value.balloons.sort(Q.compare).reverse().slice(0,256)),z=setInterval(()=>{p.value=new Date},1e3);return X(()=>{clearInterval(z)}),(d,g)=>{const b=se;return o(),t("div",ne,[e(l)?(o(),t("div",ce,[s("div",ie,[(o(!0),t(I,null,G(e(U),($,E)=>(o(),H(b,{key:$.key,index:E,balloon:$},null,8,["index","balloon"]))),128))])])):(o(),t("div",ae,[s("div",le,[s("div",null,v(e(a)("common.loading"))+"... ",1),e(N)?(o(),t("div",re,v(e(T)),1)):y("",!0)])]))])}}}),_e={key:0},de={"mt-20":""},me={key:1},fe=w({__name:"CustomBalloon",setup(m){const n=W();return(u,a)=>{const l=Y,r=ue;return o(),t(I,null,[e(n).length===0?(o(),t("div",_e,[s("div",de,[B(l)])])):y("",!0),e(n).length>0?(o(),t("div",me,[B(r,{"data-source-url":e(n)},null,8,["data-source-url"])])):y("",!0)],64)}}}),j={};function ve(m,n){const u=fe;return o(),t("div",null,[B(u)])}typeof S=="function"&&S(j);const ye=K(j,[["render",ve]]);export{ye as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,r as a,o as c,c as r,b as e,d as _,F as m,e as p,f as l}from"./index-
|
|
1
|
+
import{a as s,r as a,o as c,c as r,b as e,d as _,F as m,e as p,f as l}from"./index-1304674a.js";const i={},d={class:"lg:mt-[-52px]","py-2":"","text-gray-700":"","dark:text-gray-200":""};function u(x,f){const o=p,t=a("RouterView"),n=l;return c(),r(m,null,[e(o,{width:"sm:w-[1024px] lg:w-screen"}),_("main",d,[e(t),e(n,{class:"sm:w-[1024px] lg:w-screen"})])],64)}const w=s(i,[["render",u]]);export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as m}from"./TheInput.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{_ as m}from"./TheInput.vue_vue_type_script_setup_true_lang-a031bfb6.js";import{g as _,i as p,G as f,u as h,o as b,c as v,d as e,t as n,l as o,b as y,H as x,I as g,q as l}from"./index-1304674a.js";import{u as w}from"./user-0363fa4d.js";const V={flex:"","flex-col":"","justify-center":"","items-center":""},k=e("div",{"text-4xl":""},[e("div",{"i-carbon-campsite":""})],-1),I=e("p",null,[e("a",{rel:"noreferrer",href:"https://github.com/antfu/vitesse",target:"_blank"}," Vitesse ")],-1),B={"text-sm":"","opacity-75":""},C=e("div",{"py-4":""},null,-1),K={"w-48":""},N={class:"hidden",for:"input"},R=["disabled"],U=_({name:"IndexPage",__name:"test",setup(S){const r=w(),t=p(r.savedName),c=f();function a(){t.value&&c.push(`/hi/${encodeURIComponent(t.value)}`)}const{t:s}=h();return($,i)=>{const u=m;return b(),v("div",V,[k,I,e("p",null,[e("em",B,n(o(s)("intro.desc")),1)]),C,e("div",K,[y(u,{modelValue:o(t),"onUpdate:modelValue":i[0]||(i[0]=d=>x(t)?t.value=d:null),placeholder:o(s)("intro.whats-your-name"),autocomplete:"false",onKeydown:g(a,["enter"])},null,8,["modelValue","placeholder","onKeydown"]),e("label",N,n(o(s)("intro.whats-your-name")),1)]),e("div",null,[e("button",{"m-3":"","text-sm":"",btn:"",disabled:!o(t),onClick:a},n(o(s)("button.go")),9,R)])])}}});typeof l=="function"&&l(U);export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{an as M,ao as S,ap as K,aq as U,ar as D,as as B,at as W,au as V,av as A,aw as z,ax as N,ay as H,az as $,aA as G,s as P,aB as Y,w as b,aC as x,aD as _,aE as J,aF as X,aG as Z,l as C,aH as ee,aI as te}from"./index-c9c87d2c.js";class se extends M{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),k(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){const s=this.options,n=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),S(s,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),this.updateQuery();const i=this.hasListeners();i&&q(this.currentQuery,n,this.options,s)&&this.executeFetch(),this.updateResult(t),i&&(this.currentQuery!==n||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.updateStaleTimeout();const u=this.computeRefetchInterval();i&&(this.currentQuery!==n||this.options.enabled!==s.enabled||u!==this.currentRefetchInterval)&&this.updateRefetchInterval(u)}getOptimisticResult(e){const t=this.client.getQueryCache().build(this.client,e),s=this.createResult(t,e);return ie(this,s,e)&&(this.currentResult=s,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),s}getCurrentResult(){return this.currentResult}trackResult(e){const t={};return Object.keys(e).forEach(s=>{Object.defineProperty(t,s,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(s),e[s])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){const t=this.client.defaultQueryOptions(e),s=this.client.getQueryCache().build(this.client,t);return s.isFetchingOptimistic=!0,s.fetch().then(()=>this.createResult(s,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:(t=e.cancelRefetch)!=null?t:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(K)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),U||this.currentResult.isStale||!D(this.options.staleTime))return;const t=B(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},t)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(U||this.options.enabled===!1||!D(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||W.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){const s=this.currentQuery,n=this.options,i=this.currentResult,u=this.currentResultState,a=this.currentResultOptions,l=e!==s,h=l?e.state:this.currentQueryInitialState,c=l?this.currentResult:this.previousQueryResult,{state:o}=e;let{dataUpdatedAt:d,error:R,errorUpdatedAt:m,fetchStatus:v,status:f}=o,w=!1,F=!1,y;if(t._optimisticResults){const p=this.hasListeners(),O=!p&&k(e,t),L=p&&q(e,s,t,n);(O||L)&&(v=V(e.options.networkMode)?"fetching":"paused",d||(f="loading")),t._optimisticResults==="isRestoring"&&(v="idle")}if(t.keepPreviousData&&!o.dataUpdatedAt&&c!=null&&c.isSuccess&&f!=="error")y=c.data,d=c.dataUpdatedAt,f=c.status,w=!0;else if(t.select&&typeof o.data<"u")if(i&&o.data===(u==null?void 0:u.data)&&t.select===this.selectFn)y=this.selectResult;else try{this.selectFn=t.select,y=t.select(o.data),y=A(i==null?void 0:i.data,y,t),this.selectResult=y,this.selectError=null}catch(p){this.selectError=p}else y=o.data;if(typeof t.placeholderData<"u"&&typeof y>"u"&&f==="loading"){let p;if(i!=null&&i.isPlaceholderData&&t.placeholderData===(a==null?void 0:a.placeholderData))p=i.data;else if(p=typeof t.placeholderData=="function"?t.placeholderData():t.placeholderData,t.select&&typeof p<"u")try{p=t.select(p),this.selectError=null}catch(O){this.selectError=O}typeof p<"u"&&(f="success",y=A(i==null?void 0:i.data,p,t),F=!0)}this.selectError&&(R=this.selectError,y=this.selectResult,m=Date.now(),f="error");const Q=v==="fetching",g=f==="loading",I=f==="error";return{status:f,fetchStatus:v,isLoading:g,isSuccess:f==="success",isError:I,isInitialLoading:g&&Q,data:y,dataUpdatedAt:d,error:R,errorUpdatedAt:m,failureCount:o.fetchFailureCount,failureReason:o.fetchFailureReason,errorUpdateCount:o.errorUpdateCount,isFetched:o.dataUpdateCount>0||o.errorUpdateCount>0,isFetchedAfterMount:o.dataUpdateCount>h.dataUpdateCount||o.errorUpdateCount>h.errorUpdateCount,isFetching:Q,isRefetching:Q&&!g,isLoadingError:I&&o.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:F,isPreviousData:w,isRefetchError:I&&o.dataUpdatedAt!==0,isStale:T(e,t),refetch:this.refetch,remove:this.remove}}updateResult(e){const t=this.currentResult,s=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,S(s,t))return;this.currentResult=s;const n={cache:!0},i=()=>{if(!t)return!0;const{notifyOnChangeProps:u}=this.options,a=typeof u=="function"?u():u;if(a==="all"||!a&&!this.trackedProps.size)return!0;const l=new Set(a??this.trackedProps);return this.options.useErrorBoundary&&l.add("error"),Object.keys(this.currentResult).some(h=>{const c=h;return this.currentResult[c]!==t[c]&&l.has(c)})};(e==null?void 0:e.listeners)!==!1&&i()&&(n.listeners=!0),this.notify({...n,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const t={};e.type==="success"?t.onSuccess=!e.manual:e.type==="error"&&!z(e.error)&&(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){N.batch(()=>{if(e.onSuccess){var t,s,n,i;(t=(s=this.options).onSuccess)==null||t.call(s,this.currentResult.data),(n=(i=this.options).onSettled)==null||n.call(i,this.currentResult.data,null)}else if(e.onError){var u,a,l,h;(u=(a=this.options).onError)==null||u.call(a,this.currentResult.error),(l=(h=this.options).onSettled)==null||l.call(h,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:c})=>{c(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function re(r,e){return e.enabled!==!1&&!r.state.dataUpdatedAt&&!(r.state.status==="error"&&e.retryOnMount===!1)}function k(r,e){return re(r,e)||r.state.dataUpdatedAt>0&&E(r,e,e.refetchOnMount)}function E(r,e,t){if(e.enabled!==!1){const s=typeof t=="function"?t(r):t;return s==="always"||s!==!1&&T(r,e)}return!1}function q(r,e,t,s){return t.enabled!==!1&&(r!==e||s.enabled===!1)&&(!t.suspense||r.state.status!=="error")&&T(r,t)}function T(r,e){return r.isStaleByTime(e.staleTime)}function ie(r,e,t){return t.keepPreviousData?!1:t.placeholderData!==void 0?e.isPlaceholderData:!S(r.getCurrentResult(),e)}function ne(r=""){var e;if(!((e=H())==null?void 0:e.proxy))throw new Error("vue-query hooks can only be used inside setup() function.");const s=G(r),n=$(s);if(!n)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return n}function ue(r,e,t={},s={}){var n;const i=P(()=>ae(e,t,s)),u=(n=i.value.queryClient)!=null?n:ne(i.value.queryClientKey),a=P(()=>{const d=u.defaultQueryOptions(i.value);return d._optimisticResults=u.isRestoring.value?"isRestoring":"optimistic",d}),l=new r(u,a.value),h=Y(l.getCurrentResult());let c=()=>{};b(u.isRestoring,d=>{d||(c(),c=l.subscribe(R=>{x(h,R)}))},{immediate:!0}),b(a,()=>{l.setOptions(a.value),x(h,l.getCurrentResult())}),_(()=>{c()});const o=()=>new Promise((d,R)=>{let m=()=>{};const v=()=>{if(a.value.enabled!==!1){const f=l.getOptimisticResult(a.value);f.isStale?(m(),l.fetchOptimistic(a.value).then(d,R)):(m(),d(f))}};v(),m=b(a,v,{deep:!0})});return b(()=>h.error,d=>{if(h.isError&&!h.isFetching&&J(a.value.useErrorBoundary,[d,l.getCurrentQuery()]))throw d}),{...X(Z(h)),suspense:o}}function ae(r,e={},t={}){const s=C(r),n=C(e),i=C(t);let u=s;return ee(s)?typeof n=="function"?u={...i,queryKey:s,queryFn:n}:u={...n,queryKey:s}:u=s,te(u)}function ce(r,e,t){const s=ue(se,r,e,t);return{...s,refetch:s.refetch.value,remove:s.remove.value}}const le=3,j=30*1e3;async function oe(r,e){const t=r.startsWith("/")?r.slice(1):r;let s=`${window.DATA_HOST}${t}`;r.startsWith("http")&&(s=r),s.endsWith("/")&&(s=s.slice(0,-1));const n=await fetch(`${s}/config.json?t=${e??0}`),i=await fetch(`${s}/team.json?t=${e??0}`),u=await fetch(`${s}/run.json?t=${e??0}`),{status:a,statusText:l}=n;if(a>=300||a<200)throw new Error(`fetch data failed. [status=${a}] [statusText=${l}]`);return Promise.all([n.json(),i.json(),u.json()]).then(c=>({contest:c[0],teams:c[1],submissions:c[2]}))}function fe(r,e){return ce({queryKey:[r,e.value.getTime()],queryFn:()=>oe(r,e.value.getTime()),retry:le,staleTime:j,refetchInterval:j})}export{fe as u};
|
|
1
|
+
import{aq as K,ar as S,as as M,at as U,au as D,av as B,aw as W,ax as V,ay as A,az as z,aA as N,aB as H,aC as $,aD as G,s as P,aE as J,w as b,aF as x,aG as Y,aH as _,aI as X,aJ as Z,l as C,aK as ee,aL as te}from"./index-1304674a.js";class se extends K{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),k(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){const s=this.options,n=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),S(s,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),this.updateQuery();const i=this.hasListeners();i&&q(this.currentQuery,n,this.options,s)&&this.executeFetch(),this.updateResult(t),i&&(this.currentQuery!==n||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.updateStaleTimeout();const u=this.computeRefetchInterval();i&&(this.currentQuery!==n||this.options.enabled!==s.enabled||u!==this.currentRefetchInterval)&&this.updateRefetchInterval(u)}getOptimisticResult(e){const t=this.client.getQueryCache().build(this.client,e),s=this.createResult(t,e);return ie(this,s,e)&&(this.currentResult=s,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),s}getCurrentResult(){return this.currentResult}trackResult(e){const t={};return Object.keys(e).forEach(s=>{Object.defineProperty(t,s,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(s),e[s])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){const t=this.client.defaultQueryOptions(e),s=this.client.getQueryCache().build(this.client,t);return s.isFetchingOptimistic=!0,s.fetch().then(()=>this.createResult(s,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:(t=e.cancelRefetch)!=null?t:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(M)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),U||this.currentResult.isStale||!D(this.options.staleTime))return;const t=B(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},t)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(U||this.options.enabled===!1||!D(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||W.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){const s=this.currentQuery,n=this.options,i=this.currentResult,u=this.currentResultState,a=this.currentResultOptions,l=e!==s,h=l?e.state:this.currentQueryInitialState,c=l?this.currentResult:this.previousQueryResult,{state:o}=e;let{dataUpdatedAt:d,error:R,errorUpdatedAt:m,fetchStatus:v,status:f}=o,w=!1,F=!1,y;if(t._optimisticResults){const p=this.hasListeners(),O=!p&&k(e,t),j=p&&q(e,s,t,n);(O||j)&&(v=V(e.options.networkMode)?"fetching":"paused",d||(f="loading")),t._optimisticResults==="isRestoring"&&(v="idle")}if(t.keepPreviousData&&!o.dataUpdatedAt&&c!=null&&c.isSuccess&&f!=="error")y=c.data,d=c.dataUpdatedAt,f=c.status,w=!0;else if(t.select&&typeof o.data<"u")if(i&&o.data===(u==null?void 0:u.data)&&t.select===this.selectFn)y=this.selectResult;else try{this.selectFn=t.select,y=t.select(o.data),y=A(i==null?void 0:i.data,y,t),this.selectResult=y,this.selectError=null}catch(p){this.selectError=p}else y=o.data;if(typeof t.placeholderData<"u"&&typeof y>"u"&&f==="loading"){let p;if(i!=null&&i.isPlaceholderData&&t.placeholderData===(a==null?void 0:a.placeholderData))p=i.data;else if(p=typeof t.placeholderData=="function"?t.placeholderData():t.placeholderData,t.select&&typeof p<"u")try{p=t.select(p),this.selectError=null}catch(O){this.selectError=O}typeof p<"u"&&(f="success",y=A(i==null?void 0:i.data,p,t),F=!0)}this.selectError&&(R=this.selectError,y=this.selectResult,m=Date.now(),f="error");const Q=v==="fetching",g=f==="loading",I=f==="error";return{status:f,fetchStatus:v,isLoading:g,isSuccess:f==="success",isError:I,isInitialLoading:g&&Q,data:y,dataUpdatedAt:d,error:R,errorUpdatedAt:m,failureCount:o.fetchFailureCount,failureReason:o.fetchFailureReason,errorUpdateCount:o.errorUpdateCount,isFetched:o.dataUpdateCount>0||o.errorUpdateCount>0,isFetchedAfterMount:o.dataUpdateCount>h.dataUpdateCount||o.errorUpdateCount>h.errorUpdateCount,isFetching:Q,isRefetching:Q&&!g,isLoadingError:I&&o.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:F,isPreviousData:w,isRefetchError:I&&o.dataUpdatedAt!==0,isStale:T(e,t),refetch:this.refetch,remove:this.remove}}updateResult(e){const t=this.currentResult,s=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,S(s,t))return;this.currentResult=s;const n={cache:!0},i=()=>{if(!t)return!0;const{notifyOnChangeProps:u}=this.options,a=typeof u=="function"?u():u;if(a==="all"||!a&&!this.trackedProps.size)return!0;const l=new Set(a??this.trackedProps);return this.options.useErrorBoundary&&l.add("error"),Object.keys(this.currentResult).some(h=>{const c=h;return this.currentResult[c]!==t[c]&&l.has(c)})};(e==null?void 0:e.listeners)!==!1&&i()&&(n.listeners=!0),this.notify({...n,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const t={};e.type==="success"?t.onSuccess=!e.manual:e.type==="error"&&!z(e.error)&&(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){N.batch(()=>{if(e.onSuccess){var t,s,n,i;(t=(s=this.options).onSuccess)==null||t.call(s,this.currentResult.data),(n=(i=this.options).onSettled)==null||n.call(i,this.currentResult.data,null)}else if(e.onError){var u,a,l,h;(u=(a=this.options).onError)==null||u.call(a,this.currentResult.error),(l=(h=this.options).onSettled)==null||l.call(h,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:c})=>{c(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function re(r,e){return e.enabled!==!1&&!r.state.dataUpdatedAt&&!(r.state.status==="error"&&e.retryOnMount===!1)}function k(r,e){return re(r,e)||r.state.dataUpdatedAt>0&&E(r,e,e.refetchOnMount)}function E(r,e,t){if(e.enabled!==!1){const s=typeof t=="function"?t(r):t;return s==="always"||s!==!1&&T(r,e)}return!1}function q(r,e,t,s){return t.enabled!==!1&&(r!==e||s.enabled===!1)&&(!t.suspense||r.state.status!=="error")&&T(r,t)}function T(r,e){return r.isStaleByTime(e.staleTime)}function ie(r,e,t){return t.keepPreviousData?!1:t.placeholderData!==void 0?e.isPlaceholderData:!S(r.getCurrentResult(),e)}function ne(r=""){var e;if(!((e=H())==null?void 0:e.proxy))throw new Error("vue-query hooks can only be used inside setup() function.");const s=G(r),n=$(s);if(!n)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return n}function ue(r,e,t={},s={}){var n;const i=P(()=>ae(e,t,s)),u=(n=i.value.queryClient)!=null?n:ne(i.value.queryClientKey),a=P(()=>{const d=u.defaultQueryOptions(i.value);return d._optimisticResults=u.isRestoring.value?"isRestoring":"optimistic",d}),l=new r(u,a.value),h=J(l.getCurrentResult());let c=()=>{};b(u.isRestoring,d=>{d||(c(),c=l.subscribe(R=>{x(h,R)}))},{immediate:!0}),b(a,()=>{l.setOptions(a.value),x(h,l.getCurrentResult())}),Y(()=>{c()});const o=()=>new Promise((d,R)=>{let m=()=>{};const v=()=>{if(a.value.enabled!==!1){const f=l.getOptimisticResult(a.value);f.isStale?(m(),l.fetchOptimistic(a.value).then(d,R)):(m(),d(f))}};v(),m=b(a,v,{deep:!0})});return b(()=>h.error,d=>{if(h.isError&&!h.isFetching&&_(a.value.useErrorBoundary,[d,l.getCurrentQuery()]))throw d}),{...X(Z(h)),suspense:o}}function ae(r,e={},t={}){const s=C(r),n=C(e),i=C(t);let u=s;return ee(s)?typeof n=="function"?u={...i,queryKey:s,queryFn:n}:u={...n,queryKey:s}:u=s,te(u)}function ce(r,e,t){const s=ue(se,r,e,t);return{...s,refetch:s.refetch.value,remove:s.remove.value}}const le=3,L=30*1e3;async function oe(r,e){const t=r.startsWith("/")?r.slice(1):r;let s=`${window.DATA_HOST}${t}`;r.startsWith("http")&&(s=r),s.endsWith("/")&&(s=s.slice(0,-1));const n=await fetch(`${s}/config.json?t=${e??0}`),i=await fetch(`${s}/team.json?t=${e??0}`),u=await fetch(`${s}/run.json?t=${e??0}`),{status:a,statusText:l}=n;if(a>=300||a<200)throw new Error(`fetch data failed. [status=${a}] [statusText=${l}]`);return Promise.all([n.json(),i.json(),u.json()]).then(c=>({contest:c[0],teams:c[1],submissions:c[2]}))}function fe(r,e){return ce({queryKey:[r,e.value.getTime()],queryFn:()=>oe(r,e.value.getTime()),retry:le,staleTime:L,refetchInterval:L})}export{fe as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aN as m,i as r,s as t}from"./index-1304674a.js";const l=m("user",()=>{const e=r(""),s=r(new Set),o=t(()=>Array.from(s.value)),u=t(()=>o.value.filter(a=>a!==e.value));function n(a){e.value&&s.value.add(e.value),e.value=a}return{setNewName:n,otherNames:u,savedName:e}});export{l as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as u}from"./index-
|
|
1
|
+
import{_ as u}from"./index-1304674a.js";function p(d={}){const{immediate:l=!1,onNeedRefresh:v,onOfflineReady:t,onRegistered:r,onRegisteredSW:o,onRegisterError:s}=d;let i,n;const c=async(a=!0)=>{await n};async function f(){if("serviceWorker"in navigator){const{Workbox:a}=await u(()=>import("./workbox-window.prod.es5-a7b12eab.js"),[],import.meta.url);i=new a("/sw.js",{scope:"/",type:"classic"}),i.addEventListener("activated",e=>{(e.isUpdate||e.isExternal)&&window.location.reload()}),i.addEventListener("installed",e=>{e.isUpdate||t==null||t()}),i.register({immediate:l}).then(e=>{o?o("/sw.js",e):r==null||r(e)}).catch(e=>{s==null||s(e)})}}return n=f(),c}export{p as registerSW};
|
package/dist/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"><link rel="apple-touch-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"><link rel="apple-touch-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.37.0/dist/balloon-192x192.png"><link rel="mask-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.37.0/dist/balloon-512x512.svg" color="#00aba9"><meta name="msapplication-TileColor" content="#00aba9"><script>function normalizePath(_){for(;_.endsWith("/");)_=_.slice(0,-1);return`${_}/`}{let _="__CDN_HOST__";_=normalizePath(_),window.CDN_HOST=_}try{let _=__DATA_HOST__;_=normalizePath(_),window.DATA_HOST=_}catch(_){window.DATA_HOST="/data/"}try{let _=__DATA_REGION__;window.DATA_REGION=_}catch(_){window.DATA_REGION="CN"}try{let _=__DEFAULT_LANG__;window.DEFAULT_LANG=_}catch(_){window.DEFAULT_LANG="en"}</script><script>!function(){const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,t=localStorage.getItem("vueuse-color-scheme")||"auto";("dark"===t||e&&"light"!==t)&&document.documentElement.classList.toggle("dark",!0)}()</script><script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.37.0/dist/assets/index-1304674a.js"></script><link rel="manifest" href="/manifest.webmanifest"><style></style></head><body class="font-sans"><div id="app"></div><noscript>This website requires JavaScript to function properly. Please enable JavaScript to continue.</noscript><script>try{var umamiJSUrl=__UMAMI_JS_URL__,umamiWebsiteId=__UMAMI_WEBSITE_ID__;!function(){var e=document.createElement("script");e.src=umamiJSUrl,e.defer=!0,e.setAttribute("data-website-id",umamiWebsiteId);var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()}catch(e){}try{var plausibleJSUrl=__PLAUSIBLE_JS_URL__,plausibleDataDomain=__PLAUSIBLE_DATA_DOMAIN__;!function(){var e=document.createElement("script");e.src=plausibleJSUrl,e.defer=!0,e.setAttribute("data-domain",plausibleDataDomain);var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()}catch(e){}try{var baiduAnalyticsId=__BAIDU_ANALYTICS_ID__,_hmt=_hmt||[];!function(){var e=document.createElement("script");e.src=`https://hm.baidu.com/hm.js?${baiduAnalyticsId}`;var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()}catch(e){}try{var googleAnalyticsId=__GOOGLE_ANALYTICS_ID__;!function(){var e,t,a,r,c,n;location.port||(e=window,t=document,a="script",r="ga",e.GoogleAnalyticsObject=r,e[r]=e[r]||function(){(e[r].q=e[r].q||[]).push(arguments)},e[r].l=1*new Date,c=t.createElement(a),n=t.getElementsByTagName(a)[0],c.async=1,c.src="//www.google-analytics.com/analytics.js",n.parentNode.insertBefore(c,n),ga("create",`${googleAnalyticsId}`,"auto"),ga("send","pageview"))}()}catch(e){}</script></body></html>
|
package/dist/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let s,e={};const l=(l,n)=>(l=new URL(l+".js",n).href,e[l]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()})).then((()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s})));self.define=(n,r)=>{const i=s||("document"in self?document.currentScript.src:"")||location.href;if(e[i])return;let u={};const a=s=>l(s,i),t={module:{uri:i},exports:u,require:a};e[i]=Promise.all(n.map((s=>t[s]||a(s)))).then((s=>(r(...s),u)))}}define(["./workbox-b8d87ee1"],(function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/_...all_-
|
|
1
|
+
if(!self.define){let s,e={};const l=(l,n)=>(l=new URL(l+".js",n).href,e[l]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()})).then((()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s})));self.define=(n,r)=>{const i=s||("document"in self?document.currentScript.src:"")||location.href;if(e[i])return;let u={};const a=s=>l(s,i),t={module:{uri:i},exports:u,require:a};e[i]=Promise.all(n.map((s=>t[s]||a(s)))).then((s=>(r(...s),u)))}}define(["./workbox-b8d87ee1"],(function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/_...all_-fb6fc8ba.js",revision:null},{url:"assets/_name_-735c6fb7.js",revision:null},{url:"assets/about-eb27e531.js",revision:null},{url:"assets/Board-1e98f0f2.js",revision:null},{url:"assets/Board-605f814f.css",revision:null},{url:"assets/board-e67f6116.js",revision:null},{url:"assets/board-layout-e7a2768f.js",revision:null},{url:"assets/DataSourceInput.vue_vue_type_script_setup_true_lang-02455050.js",revision:null},{url:"assets/en-06ebe6c4.js",revision:null},{url:"assets/headless-6d929d05.js",revision:null},{url:"assets/home-71038d6b.js",revision:null},{url:"assets/index-03c128b2.css",revision:null},{url:"assets/index-0d087976.js",revision:null},{url:"assets/index-1304674a.js",revision:null},{url:"assets/index-39ee8a2c.css",revision:null},{url:"assets/index-616a2412.js",revision:null},{url:"assets/index-layout-0bd56ff5.js",revision:null},{url:"assets/test-052ab1ce.js",revision:null},{url:"assets/TheInput.vue_vue_type_script_setup_true_lang-a031bfb6.js",revision:null},{url:"assets/useQueryBoardData-67124d23.js",revision:null},{url:"assets/user-0363fa4d.js",revision:null},{url:"assets/virtual_pwa-register-1b1003e5.js",revision:null},{url:"assets/workbox-window.prod.es5-a7b12eab.js",revision:null},{url:"assets/zh-CN-d316b26d.js",revision:null},{url:"index.html",revision:"2eba9a1b8adf0e79a2842f723f9e4fdd"},{url:"favicon.svg",revision:"5a744f4ccbb122d4a0575be779ddcd43"},{url:"safari-pinned-tab.svg",revision:"5eaf74d1c43d30e0af743b68a3f48504"},{url:"balloon2-192x192.png",revision:"c857ae6d9dfae118ab4397d4358422bd"},{url:"balloon2-512x512.png",revision:"065594f4f743fe3884793c03d3fe7d9e"},{url:"manifest.webmanifest",revision:"3082e8d8ebc9619c6c1055ff243a02a8"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcpcio/board-app",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.37.0",
|
|
5
5
|
"description": "XCPCIO Board App",
|
|
6
6
|
"author": "Dup4 <lyuzhi.pan@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"vue-router": "^4.2.4",
|
|
54
54
|
"vue-search-select": "^3.1.2",
|
|
55
55
|
"vue-toast-notification": "^3",
|
|
56
|
-
"@xcpcio/core": "0.
|
|
57
|
-
"@xcpcio/types": "0.
|
|
56
|
+
"@xcpcio/core": "0.37.0",
|
|
57
|
+
"@xcpcio/types": "0.37.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@antfu/eslint-config": "^0.39.8",
|
package/src/auto-imports.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ declare global {
|
|
|
8
8
|
const BALLOON_TITLE_SUFFIX: typeof import('./composables/constant')['BALLOON_TITLE_SUFFIX']
|
|
9
9
|
const COUNTDOWN_TITLE_SUFFIX: typeof import('./composables/constant')['COUNTDOWN_TITLE_SUFFIX']
|
|
10
10
|
const EffectScope: typeof import('vue')['EffectScope']
|
|
11
|
+
const LastBlockDisplayType: typeof import('./composables/type')['LastBlockDisplayType']
|
|
11
12
|
const Pagination: typeof import('./composables/pagination')['Pagination']
|
|
12
13
|
const RESOLVER_TITLE_SUFFIX: typeof import('./composables/constant')['RESOLVER_TITLE_SUFFIX']
|
|
13
14
|
const TITLE_SUFFIX: typeof import('./composables/constant')['TITLE_SUFFIX']
|
|
@@ -48,6 +49,7 @@ declare global {
|
|
|
48
49
|
const getLocalStorageKeyForFilterTeams: typeof import('./composables/useLocalStorage')['getLocalStorageKeyForFilterTeams']
|
|
49
50
|
const getMedalColor: typeof import('./composables/color')['getMedalColor']
|
|
50
51
|
const getProblemChart: typeof import('./composables/statistics')['getProblemChart']
|
|
52
|
+
const getStandingsStatusColor: typeof import('./composables/color')['getStandingsStatusColor']
|
|
51
53
|
const getSubmitChart: typeof import('./composables/statistics')['getSubmitChart']
|
|
52
54
|
const getTeamChart: typeof import('./composables/statistics')['getTeamChart']
|
|
53
55
|
const getTeamPlaceChart: typeof import('./composables/statistics')['getTeamPlaceChart']
|
|
@@ -324,6 +326,7 @@ declare module 'vue' {
|
|
|
324
326
|
readonly BALLOON_TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['BALLOON_TITLE_SUFFIX']>
|
|
325
327
|
readonly COUNTDOWN_TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['COUNTDOWN_TITLE_SUFFIX']>
|
|
326
328
|
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
|
329
|
+
readonly LastBlockDisplayType: UnwrapRef<typeof import('./composables/type')['LastBlockDisplayType']>
|
|
327
330
|
readonly Pagination: UnwrapRef<typeof import('./composables/pagination')['Pagination']>
|
|
328
331
|
readonly RESOLVER_TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['RESOLVER_TITLE_SUFFIX']>
|
|
329
332
|
readonly TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['TITLE_SUFFIX']>
|
|
@@ -360,6 +363,7 @@ declare module 'vue' {
|
|
|
360
363
|
readonly getLocalStorageKeyForFilterTeams: UnwrapRef<typeof import('./composables/useLocalStorage')['getLocalStorageKeyForFilterTeams']>
|
|
361
364
|
readonly getMedalColor: UnwrapRef<typeof import('./composables/color')['getMedalColor']>
|
|
362
365
|
readonly getProblemChart: UnwrapRef<typeof import('./composables/statistics')['getProblemChart']>
|
|
366
|
+
readonly getStandingsStatusColor: UnwrapRef<typeof import('./composables/color')['getStandingsStatusColor']>
|
|
363
367
|
readonly getSubmitChart: UnwrapRef<typeof import('./composables/statistics')['getSubmitChart']>
|
|
364
368
|
readonly getTeamChart: UnwrapRef<typeof import('./composables/statistics')['getTeamChart']>
|
|
365
369
|
readonly getTeamPlaceChart: UnwrapRef<typeof import('./composables/statistics')['getTeamPlaceChart']>
|
|
@@ -626,6 +630,7 @@ declare module '@vue/runtime-core' {
|
|
|
626
630
|
readonly BALLOON_TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['BALLOON_TITLE_SUFFIX']>
|
|
627
631
|
readonly COUNTDOWN_TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['COUNTDOWN_TITLE_SUFFIX']>
|
|
628
632
|
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
|
633
|
+
readonly LastBlockDisplayType: UnwrapRef<typeof import('./composables/type')['LastBlockDisplayType']>
|
|
629
634
|
readonly Pagination: UnwrapRef<typeof import('./composables/pagination')['Pagination']>
|
|
630
635
|
readonly RESOLVER_TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['RESOLVER_TITLE_SUFFIX']>
|
|
631
636
|
readonly TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['TITLE_SUFFIX']>
|
|
@@ -662,6 +667,7 @@ declare module '@vue/runtime-core' {
|
|
|
662
667
|
readonly getLocalStorageKeyForFilterTeams: UnwrapRef<typeof import('./composables/useLocalStorage')['getLocalStorageKeyForFilterTeams']>
|
|
663
668
|
readonly getMedalColor: UnwrapRef<typeof import('./composables/color')['getMedalColor']>
|
|
664
669
|
readonly getProblemChart: UnwrapRef<typeof import('./composables/statistics')['getProblemChart']>
|
|
670
|
+
readonly getStandingsStatusColor: UnwrapRef<typeof import('./composables/color')['getStandingsStatusColor']>
|
|
665
671
|
readonly getSubmitChart: UnwrapRef<typeof import('./composables/statistics')['getSubmitChart']>
|
|
666
672
|
readonly getTeamChart: UnwrapRef<typeof import('./composables/statistics')['getTeamChart']>
|
|
667
673
|
readonly getTeamPlaceChart: UnwrapRef<typeof import('./composables/statistics')['getTeamPlaceChart']>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { SubmissionStatusToSimpleString } from "@xcpcio/types";
|
|
3
|
+
|
|
4
|
+
import { getMedalColor } from "~/composables/color";
|
|
5
|
+
import type { AnimatedSubmissionBlockItem } from "~/composables/type";
|
|
6
|
+
import { LastBlockDisplayType } from "~/composables/type";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
item: AnimatedSubmissionBlockItem,
|
|
10
|
+
lastBlockDisplayType: LastBlockDisplayType,
|
|
11
|
+
}>();
|
|
12
|
+
|
|
13
|
+
const item = computed(() => props.item);
|
|
14
|
+
|
|
15
|
+
function getLastBlockDisplayContent() {
|
|
16
|
+
const s = item.value.submission;
|
|
17
|
+
|
|
18
|
+
if (props.lastBlockDisplayType === LastBlockDisplayType.SUBMISSION_STATUS) {
|
|
19
|
+
return SubmissionStatusToSimpleString[s.status];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (props.lastBlockDisplayType === LastBlockDisplayType.SUBMIT_TIMESTAMP) {
|
|
23
|
+
return s.timestampToMinute;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<div
|
|
30
|
+
h-7 w-124
|
|
31
|
+
text-gray-200
|
|
32
|
+
font-mono
|
|
33
|
+
flex flex-row
|
|
34
|
+
justify-center items-center
|
|
35
|
+
class="bg-resolver-bg-zero"
|
|
36
|
+
>
|
|
37
|
+
<div
|
|
38
|
+
h-full w-10
|
|
39
|
+
:style="getMedalColor(item.team)"
|
|
40
|
+
flex
|
|
41
|
+
justify-center items-center
|
|
42
|
+
>
|
|
43
|
+
<div>
|
|
44
|
+
{{ item.team.rank }}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div
|
|
49
|
+
h-full w-92
|
|
50
|
+
pl-1
|
|
51
|
+
truncate
|
|
52
|
+
>
|
|
53
|
+
{{ item.displayName }}
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div
|
|
57
|
+
h-full w-4
|
|
58
|
+
>
|
|
59
|
+
{{ item.team.solvedProblemNum }}
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div
|
|
63
|
+
h-full w-6
|
|
64
|
+
border-b-3
|
|
65
|
+
flex justify-center
|
|
66
|
+
:style="{
|
|
67
|
+
borderColor: item.problem.balloonColor.background_color,
|
|
68
|
+
}"
|
|
69
|
+
>
|
|
70
|
+
{{ item.problem.label }}
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<div
|
|
74
|
+
h-full w-12
|
|
75
|
+
flex justify-center
|
|
76
|
+
font-sans font-medium
|
|
77
|
+
text-zinc-800
|
|
78
|
+
:style="{
|
|
79
|
+
backgroundColor: getStandingsStatusColor(item.submission),
|
|
80
|
+
}"
|
|
81
|
+
>
|
|
82
|
+
{{ getLastBlockDisplayContent() }}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { Rank } from "@xcpcio/core";
|
|
3
3
|
import { Submission } from "@xcpcio/core";
|
|
4
|
-
import { SubmissionStatusToSimpleString } from "@xcpcio/types";
|
|
5
4
|
|
|
6
|
-
import {
|
|
5
|
+
import type { AnimatedSubmissionBlockItem } from "~/composables/type";
|
|
6
|
+
import { LastBlockDisplayType } from "~/composables/type";
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
9
9
|
rank: Rank,
|
|
10
10
|
}>();
|
|
11
11
|
|
|
12
|
-
interface Item {
|
|
13
|
-
submission: Submission,
|
|
14
|
-
team: Team,
|
|
15
|
-
problem: Problem,
|
|
16
|
-
displayName: string,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
12
|
const rank = computed(() => props.rank);
|
|
20
13
|
const submissions = computed(() => {
|
|
21
14
|
const ss = rank.value.getSubmissions().sort(Submission.compare).reverse();
|
|
22
15
|
|
|
23
|
-
|
|
16
|
+
let allCnt = 0;
|
|
17
|
+
const allNeed = 10;
|
|
18
|
+
const allRes: AnimatedSubmissionBlockItem[] = [];
|
|
24
19
|
|
|
25
|
-
let
|
|
26
|
-
const
|
|
27
|
-
|
|
20
|
+
let acceptedCnt = 0;
|
|
21
|
+
const acceptedNeed = 6;
|
|
22
|
+
const acceptedRes: AnimatedSubmissionBlockItem[] = [];
|
|
23
|
+
|
|
24
|
+
for (let i = 0; i < ss.length && (acceptedCnt < acceptedNeed || allCnt < allNeed); i++) {
|
|
28
25
|
const s = ss[i];
|
|
29
26
|
const teamId = s.teamId;
|
|
30
27
|
const problemId = s.problemId;
|
|
@@ -50,17 +47,39 @@ const submissions = computed(() => {
|
|
|
50
47
|
displayName = `${team.organization} - ${displayName}`;
|
|
51
48
|
}
|
|
52
49
|
|
|
53
|
-
|
|
50
|
+
const item: AnimatedSubmissionBlockItem = {
|
|
54
51
|
submission: s,
|
|
55
52
|
team,
|
|
56
53
|
problem,
|
|
57
54
|
displayName,
|
|
58
|
-
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
if (allCnt < allNeed) {
|
|
58
|
+
allRes.push(item);
|
|
59
|
+
++allCnt;
|
|
60
|
+
}
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
if (s.isSolved && acceptedCnt < acceptedNeed) {
|
|
63
|
+
acceptedRes.push(item);
|
|
64
|
+
++acceptedCnt;
|
|
65
|
+
}
|
|
61
66
|
}
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
acceptedRes.reverse();
|
|
69
|
+
allRes.reverse();
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
acceptedRes,
|
|
73
|
+
allRes,
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const acceptedSubmissions = computed(() => {
|
|
78
|
+
return submissions.value.acceptedRes;
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const allSubmissions = computed(() => {
|
|
82
|
+
return submissions.value.allRes;
|
|
64
83
|
});
|
|
65
84
|
</script>
|
|
66
85
|
|
|
@@ -68,77 +87,61 @@ const submissions = computed(() => {
|
|
|
68
87
|
<div
|
|
69
88
|
absolute fixed z-99
|
|
70
89
|
bottom-4 left-4
|
|
71
|
-
opacity-
|
|
90
|
+
opacity-80
|
|
72
91
|
>
|
|
73
92
|
<div
|
|
74
93
|
flex flex-col
|
|
75
94
|
>
|
|
76
95
|
<div>
|
|
77
|
-
<
|
|
78
|
-
v-for="s in submissions"
|
|
79
|
-
:key="s.id"
|
|
80
|
-
>
|
|
96
|
+
<TransitionGroup name="list" tag="ul">
|
|
81
97
|
<div
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
bg-slate-800 text-gray-200
|
|
85
|
-
font-mono
|
|
86
|
-
flex flex-row
|
|
87
|
-
justify-center items-center
|
|
98
|
+
v-for="s in acceptedSubmissions"
|
|
99
|
+
:key="s.submission.id"
|
|
88
100
|
>
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
|
-
<div
|
|
101
|
-
pl-1
|
|
102
|
-
w-80
|
|
103
|
-
truncate
|
|
104
|
-
>
|
|
105
|
-
{{ s.displayName }}
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
<div
|
|
109
|
-
w-5
|
|
110
|
-
>
|
|
111
|
-
{{ s.team.solvedProblemNum }}
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
<div
|
|
115
|
-
w-8
|
|
116
|
-
border-b-4
|
|
117
|
-
flex justify-center
|
|
118
|
-
:style="{
|
|
119
|
-
borderColor: s.problem.balloonColor.background_color,
|
|
120
|
-
}"
|
|
121
|
-
>
|
|
122
|
-
{{ s.problem.label }}
|
|
123
|
-
</div>
|
|
101
|
+
<AnimatedSubmissionBlock
|
|
102
|
+
:item="s"
|
|
103
|
+
:last-block-display-type="LastBlockDisplayType.SUBMIT_TIMESTAMP"
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
</TransitionGroup>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
124
109
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
110
|
+
<div
|
|
111
|
+
flex flex-col
|
|
112
|
+
mt-6
|
|
113
|
+
>
|
|
114
|
+
<div>
|
|
115
|
+
<TransitionGroup name="list" tag="ul">
|
|
116
|
+
<div
|
|
117
|
+
v-for="s in allSubmissions"
|
|
118
|
+
:key="s.submission.id"
|
|
119
|
+
>
|
|
120
|
+
<div>
|
|
121
|
+
<AnimatedSubmissionBlock
|
|
122
|
+
:item="s"
|
|
123
|
+
:last-block-display-type="LastBlockDisplayType.SUBMISSION_STATUS"
|
|
124
|
+
/>
|
|
134
125
|
</div>
|
|
135
126
|
</div>
|
|
136
|
-
</
|
|
127
|
+
</TransitionGroup>
|
|
137
128
|
</div>
|
|
138
129
|
</div>
|
|
139
130
|
</div>
|
|
140
131
|
</template>
|
|
141
132
|
|
|
142
|
-
<style scoped
|
|
143
|
-
|
|
133
|
+
<style scoped>
|
|
134
|
+
.list-enter-active {
|
|
135
|
+
transition: all 2s ease;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.list-leave-active {
|
|
139
|
+
transition: all 0.75s ease;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.list-enter-from,
|
|
143
|
+
.list-leave-to {
|
|
144
|
+
opacity: 0;
|
|
145
|
+
transform: translateX(-30px);
|
|
146
|
+
}
|
|
144
147
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import _ from "lodash";
|
|
3
3
|
import { useRouteQuery } from "@vueuse/router";
|
|
4
|
-
import { onKeyStroke } from "@vueuse/core";
|
|
4
|
+
import { onKeyStroke, useIntervalFn, useNow } from "@vueuse/core";
|
|
5
5
|
|
|
6
6
|
import { Rank, RankOptions, createContest, createSubmissions, createTeams, getTimeDiff } from "@xcpcio/core";
|
|
7
7
|
import type { Contest, Submissions, Teams } from "@xcpcio/core";
|
|
@@ -23,7 +23,7 @@ const contestData = ref({} as Contest);
|
|
|
23
23
|
const teamsData = ref([] as Teams);
|
|
24
24
|
const submissionsData = ref([] as Submissions);
|
|
25
25
|
const rank = ref({} as Rank);
|
|
26
|
-
const now =
|
|
26
|
+
const now = useNow();
|
|
27
27
|
const rankOptions = ref(new RankOptions());
|
|
28
28
|
|
|
29
29
|
const enableAutoScroll = ref(false);
|
|
@@ -60,15 +60,28 @@ function onChangeCurrentGroup(nextGroup: string) {
|
|
|
60
60
|
rankOptions.value.setGroup(currentGroupFromRouteQuery.value);
|
|
61
61
|
})();
|
|
62
62
|
|
|
63
|
+
const replayStartTime = useRouteQuery("replay-start-time", 0, { transform: Number });
|
|
64
|
+
|
|
65
|
+
const isReBuildRank = ref(false);
|
|
63
66
|
function reBuildRank(options = { force: false }) {
|
|
64
67
|
if (enableAutoScroll.value && options.force === false) {
|
|
65
68
|
return;
|
|
66
69
|
}
|
|
67
70
|
|
|
71
|
+
if (isReBuildRank.value === true) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
isReBuildRank.value = true;
|
|
76
|
+
|
|
68
77
|
const newRank = new Rank(contestData.value, teamsData.value, submissionsData.value);
|
|
69
78
|
newRank.options = _.cloneDeep(rankOptions.value);
|
|
79
|
+
newRank.setReplayTime(replayStartTime.value);
|
|
80
|
+
|
|
70
81
|
newRank.buildRank();
|
|
71
82
|
rank.value = newRank;
|
|
83
|
+
|
|
84
|
+
isReBuildRank.value = false;
|
|
72
85
|
}
|
|
73
86
|
|
|
74
87
|
const { data, isError, error } = useQueryBoardData(props.dataSourceUrl ?? route.path, now);
|
|
@@ -92,27 +105,43 @@ watch(data, async () => {
|
|
|
92
105
|
firstLoaded.value = true;
|
|
93
106
|
});
|
|
94
107
|
|
|
95
|
-
|
|
96
|
-
watch(rankOptions.value, () => {
|
|
108
|
+
function dynamicReBuildRank() {
|
|
97
109
|
if (firstLoaded.value === false) {
|
|
98
110
|
return;
|
|
99
111
|
}
|
|
100
112
|
|
|
113
|
+
reBuildRank();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
watch(rankOptions.value, () => {
|
|
101
117
|
if (!rank.value.options.isNeedReBuildRank(rankOptions.value)) {
|
|
102
118
|
rank.value.options = _.cloneDeep(rankOptions.value);
|
|
103
119
|
return;
|
|
104
120
|
}
|
|
105
121
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
122
|
+
dynamicReBuildRank();
|
|
123
|
+
});
|
|
109
124
|
|
|
110
|
-
|
|
125
|
+
{
|
|
126
|
+
const { pause, resume } = useIntervalFn(() => {
|
|
127
|
+
dynamicReBuildRank();
|
|
128
|
+
}, 1000);
|
|
129
|
+
|
|
130
|
+
function onChange() {
|
|
131
|
+
if (replayStartTime.value === 0) {
|
|
132
|
+
pause();
|
|
133
|
+
} else {
|
|
134
|
+
dynamicReBuildRank();
|
|
135
|
+
resume();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
111
138
|
|
|
112
|
-
|
|
139
|
+
onChange();
|
|
113
140
|
|
|
114
|
-
|
|
115
|
-
|
|
141
|
+
watch(replayStartTime, () => {
|
|
142
|
+
onChange();
|
|
143
|
+
});
|
|
144
|
+
}
|
|
116
145
|
|
|
117
146
|
const typeMenuList = ref<Array<Item>>([
|
|
118
147
|
{
|
|
@@ -231,12 +260,12 @@ onKeyStroke("S", (_e) => {
|
|
|
231
260
|
}, { dedupe: false });
|
|
232
261
|
|
|
233
262
|
const startTime = computed(() => {
|
|
234
|
-
const time = rank.value.contest.
|
|
263
|
+
const time = rank.value.contest.getStartTime().format("YYYY-MM-DD HH:mm:ss");
|
|
235
264
|
return `${t("standings.start_time")}${t("common.colon")}${time}`;
|
|
236
265
|
});
|
|
237
266
|
|
|
238
267
|
const endTime = computed(() => {
|
|
239
|
-
const time = rank.value.contest.
|
|
268
|
+
const time = rank.value.contest.getEndTime().format("YYYY-MM-DD HH:mm:ss");
|
|
240
269
|
return `${t("standings.end_time")}${t("common.colon")}${time}`;
|
|
241
270
|
});
|
|
242
271
|
|
|
@@ -262,12 +291,7 @@ const pausedTime = computed(() => {
|
|
|
262
291
|
return getTimeDiff(rank.value.options.timestamp);
|
|
263
292
|
});
|
|
264
293
|
|
|
265
|
-
const setNowIntervalId = setInterval(() => {
|
|
266
|
-
now.value = new Date();
|
|
267
|
-
}, 1000);
|
|
268
|
-
|
|
269
294
|
onUnmounted(() => {
|
|
270
|
-
clearInterval(setNowIntervalId);
|
|
271
295
|
clearAutoScrollInterval();
|
|
272
296
|
});
|
|
273
297
|
|
|
@@ -340,7 +364,7 @@ const widthClass = "sm:w-[1260px] xl:w-screen";
|
|
|
340
364
|
<div class="w-[92%]">
|
|
341
365
|
<div class="flex font-bold font-mono">
|
|
342
366
|
<div class="float-left">
|
|
343
|
-
{{ startTime }}<sup class="pl-0.5">{{ rank.contest.
|
|
367
|
+
{{ startTime }}<sup class="pl-0.5">{{ rank.contest.getStartTime().format("z") }}</sup>
|
|
344
368
|
</div>
|
|
345
369
|
<div class="flex-1">
|
|
346
370
|
<ContestStateBadge
|
|
@@ -117,8 +117,8 @@ function startDrag(event: MouseEvent) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
function getTimeScroll() {
|
|
120
|
-
const startTime = props.rank!.contest.
|
|
121
|
-
const endTime = props.rank!.contest.
|
|
120
|
+
const startTime = props.rank!.contest.getStartTime();
|
|
121
|
+
const endTime = props.rank!.contest.getEndTime();
|
|
122
122
|
|
|
123
123
|
const gap = endTime.unix() - startTime.unix();
|
|
124
124
|
const target = Math.floor(gap * barWidth.value * 0.01);
|