@opencompass-fe/oc-webkit-eval 0.3.0 → 0.3.3
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/components/footer/footer.js +1 -1
- package/dist/components/header/components/create-online-evaluation/component/evaluation-button/evaluation-button.js +1 -1
- package/dist/components/header/components/create-online-evaluation/component/pre-create-evaluation/index.js +1 -1
- package/dist/components/header/header.js +1 -1
- package/dist/components/header/secondHeader.js +1 -1
- package/dist/components/side-nav/side-nav.js +1 -1
- package/dist/google-log/home.js +1 -1
- package/dist/helper/rankRoute.js +1 -0
- package/dist/index.js +1 -1
- package/dist/types/helper/rankRoute.d.ts +32 -0
- package/dist/types/index.d.ts +7 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import f from"../../assets/svg/footer/zhihu.svg.js";import v from"../../assets/svg/footer/github.svg.js";import d from"../../assets/svg/footer/twitter.svg.js";import C from"../../assets/svg/footer/wechat.svg.js";import{Popover as h}from"antd";import s from"./footer.module.less.js";import e,{useContext as
|
|
1
|
+
import f from"../../assets/svg/footer/zhihu.svg.js";import v from"../../assets/svg/footer/github.svg.js";import d from"../../assets/svg/footer/twitter.svg.js";import C from"../../assets/svg/footer/wechat.svg.js";import{Popover as h}from"antd";import s from"./footer.module.less.js";import e,{useContext as l,useEffect as k,useMemo as E}from"react";import{OcContext as N}from"../../providers/OcContext.js";import{OcConfigContext as w}from"../../providers/OcConfigContext.js";import j from"../header/hooks/useUrl.js";import x from"classnames";import O from"../../assets/svg/blueNewLogo.svg.js";import L from"../../assets/svg/blueNewLogoEn.svg.js";const y=o=>{const{setConfig:r,config:c}=l(w),{locales:n}=l(N),{locale:m}=c;k(()=>{r(o)},[o]);const{urls:i}=j(),a=(t,u)=>{u?window.open(t):window.location.href=t},g=[{img:f,link:"https://www.zhihu.com/people/jue-qi-36-21",outlink:!0},{img:v,link:"https://github.com/open-compass",outlink:!0},{img:d,link:"https://x.com/OpenCompassX",outlink:!0}],p=E(()=>m==="en-US"?L:O,[m]);return e.createElement("div",{className:x(s.footer,o.isSticky&&s.stickyFooter,o.customClassname)},e.createElement("img",{className:s.left,src:p,alt:""}),e.createElement("div",{className:s.center},e.createElement("span",null,"\xA9 2023-2025 OpenCompass All Rights Reserved"),e.createElement("div",{className:s.columnLine}),e.createElement("span",{className:s.icp,onClick:()=>{window.open("https://beian.miit.gov.cn/#/Integrated/index")}},"\u6CAAICP\u59072021009351\u53F7-23"),e.createElement("div",{className:s.columnLine}),e.createElement("span",{className:s.link,onClick:()=>a(`${i==null?void 0:i.VITE_COMPASS_URL}old-policy`)},n==null?void 0:n.agreement)),e.createElement("div",{className:s.right},g.map(t=>e.createElement("div",{key:t.link,onClick:()=>a(t.link,t.outlink),className:s.logo},e.createElement("img",{src:t.img,alt:""}))),e.createElement(h,{content:e.createElement("img",{src:"https://opencompass.oss-cn-shanghai.aliyuncs.com/image/qrcode_compass.png",className:s.qrCode,alt:"qrCode"})},e.createElement("div",{className:s.logo},e.createElement("img",{src:C,alt:""})))))};export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o,{useContext as
|
|
1
|
+
import o,{useContext as d,useState as u}from"react";import N from"./evaluation-button.module.less.js";import T from"../create-evaluation/create-evaluation.js";import b from"../pre-create-evaluation/index.js";import{OcContext as h}from"../../../../../../providers/OcContext.js";import P from"../../../../hooks/useUrl.js";import{OcConfigContext as A}from"../../../../../../providers/OcConfigContext.js";import{buildRankUrl as f}from"../../../../../../helper/rankRoute.js";const I=({onclick:p,children:e,style:E,text:m})=>{const{urls:t}=P(),{locales:i}=d(h),{config:O}=d(A),{locale:s,isNew:c=!1}=O,[k,a]=u(!1),[r,g]=u(0),R=()=>{r===0&&(window.location.href=f(t==null?void 0:t.VITE_RANK_URL,"/create/quick",{isNew:c,lang:s})),r===1&&(window.location.href=f(t==null?void 0:t.VITE_RANK_URL,"/create/ability",{isNew:c,lang:s})),r===2&&(window.location.href=f(t==null?void 0:t.VITE_RANK_URL,"/create/custom",{isNew:c,lang:s})),a(!1)},w=()=>{a(!1)},_=l=>{g(l)},j=()=>{n(!0),a(!1)},[x,n]=u(!1),U=()=>{n(!1)},y=()=>{n(!1),a(!0)};return i?o.createElement(o.Fragment,null,m?o.createElement("div",{style:E,className:N.reviewButton,onClick:l=>{n(!0),p&&p(l)}},m):e&&o.cloneElement(e,{onClick:l=>{var v,C;n(!0),((v=e==null?void 0:e.props)==null?void 0:v.onclick)&&((C=e==null?void 0:e.props)==null||C.onclick(l))}}),o.createElement(b,{open:x,onCancel:U,title:i.createOnlineEvaluation,llmClick:y}),o.createElement(T,{goPrevStep:j,open:k,onOk:R,onCancel:w,title:i.createOnlineEvaluation,onTypeChange:_,type:r})):null};export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r,{useContext as
|
|
1
|
+
import r,{useContext as l,useMemo as d}from"react";import{Modal as f}from"antd";import n from"./index.module.less.js";import v from"../../../../../../assets/svg/llm-evaluation.svg.js";import j from"../../../../../../assets/svg/mm-evaluation.svg.js";import{OcContext as g}from"../../../../../../providers/OcContext.js";import E from"../../../../hooks/useUrl.js";import{OcConfigContext as _}from"../../../../../../providers/OcConfigContext.js";import"classnames";import"../../../../firstHeader.module.less.js";import"../../../../../../extraComponents/icon-font/index.js";import"../../../../secondHeader.js";import"react-router-dom";import{buildRankUrl as x}from"../../../../../../helper/rankRoute.js";import"@ant-design/icons";import{evaluationTypeEnum as C}from"../../../../../../constants/enums.js";import"../../../../../../mobile/components/top-nav/top-nav.module.less.js";import"../../../../../top-nav/shared.js";import"../../../../../top-nav/top-nav.module.less.js";import"react-device-detect";import"../evaluation-button/evaluation-button.module.less.js";import"../create-evaluation/create-evaluation.js";import"../../../../../side-nav/side-nav.module.less.js";import"../../../../../footer/footer.module.less.js";import"../../../../../dropdown/dropdown.module.less.js";import"ahooks";import"../../../../../footer-expansion/footer-expansion.module.less.js";import"../../../../../md-render/index.js";import"../../../../../../helper/index.js";var O=Object.defineProperty,i=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,c=(t,e,o)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,h=(t,e)=>{for(var o in e||(e={}))w.call(e,o)&&c(t,o,e[o]);if(i)for(var o of i(e))y.call(e,o)&&c(t,o,e[o]);return t};const k=t=>{const{locales:e}=l(g),{urls:o}=E(),{config:p}=l(_),{locale:a,isNew:m=!1}=p,u=d(()=>[{icon:v,name:e.llmEvaluation,click:()=>{t.llmClick()}},{icon:j,name:e.mmEvaluation,click:()=>{window.open(x(o.VITE_RANK_URL,"/create/custom",{isNew:m,lang:a,searchParams:{type:C.mm}}),"self")}}],[t,o,a,m]);return r.createElement(r.Fragment,null,r.createElement(f,h({centered:!0,className:n.modal,width:800,footer:[r.createElement("button",{key:"cancel",className:n.cancel,onClick:t.onCancel},e.cancel)]},t),r.createElement("div",{className:n.container},u.map(s=>r.createElement("div",{className:n.content,onClick:s.click},r.createElement("img",{src:s.icon}),r.createElement("span",null,s.name))))))};export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n,{useContext as R,useState as H,useEffect as T,useMemo as d}from"react";import{Dropdown as P,message as X}from"antd";import{goCommon as E,goOCHome as Z}from"../../google-log/home.js";import y from"classnames";import{OcContext as ee}from"../../providers/OcContext.js";import{OcConfigContext as te}from"../../providers/OcConfigContext.js";import oe from"./hooks/useUrl.js";import o from"./firstHeader.module.less.js";import ne from"../../assets/svg/newLogo.svg.js";import le from"../../assets/svg/newLogoEn.svg.js";import k from"../../extraComponents/icon-font/index.js";import re from"../../assets/svg/blueNewLogo.svg.js";import ie from"../../assets/svg/blueNewLogoEn.svg.js";import V from"./secondHeader.js";import{useLocation as ae}from"react-router-dom";import{buildRankUrl as x,buildHubUrl as se,buildDataUrl as ce}from"../../helper/rankRoute.js";import"@ant-design/icons";import{webTypeEnum as i,langTypeEnum as L}from"../../constants/enums.js";import"../../mobile/components/top-nav/top-nav.module.less.js";import"../top-nav/shared.js";import"../top-nav/top-nav.module.less.js";import"react-device-detect";import"./components/create-online-evaluation/component/evaluation-button/evaluation-button.module.less.js";import"./components/create-online-evaluation/component/create-evaluation/create-evaluation.js";import"./components/create-online-evaluation/component/pre-create-evaluation/index.module.less.js";import"../side-nav/side-nav.module.less.js";import"../footer/footer.module.less.js";import"../dropdown/dropdown.module.less.js";import"ahooks";import"../footer-expansion/footer-expansion.module.less.js";import"../md-render/index.js";import"../../helper/index.js";var ue=Object.defineProperty,me=Object.defineProperties,de=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,ve=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,$=(s,e,c)=>e in s?ue(s,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):s[e]=c,z=(s,e)=>{for(var c in e||(e={}))ve.call(e,c)&&$(s,c,e[c]);if(F)for(var c of F(e))fe.call(e,c)&&$(s,c,e[c]);return s},G=(s,e)=>me(s,de(e)),pe=(s,e,c)=>new Promise((v,a)=>{var B=m=>{try{t(c.next(m))}catch(b){a(b)}},u=m=>{try{t(c.throw(m))}catch(b){a(b)}},t=m=>m.done?v(m.value):Promise.resolve(m.value).then(B,u);t((c=c.apply(s,e)).next())});const he=64,ge=57;let q,I=0;const Ee=s=>{const{locales:e}=R(ee),{setConfig:c,config:v}=R(te),{locale:a,setLocale:B}=v,{pathname:u}=ae(),{urls:t}=oe(),{handleUnauth:m,logout:b,userInfo:U,jumpLogin:K,webType:l,isDefaultShowSecondMenu:M,isNew:_=!1}=s,[C,w]=H(!1),[f,A]=H(!0);T(()=>{c(s)},[s]),T(()=>{M&&w(!0)},[M]);const O=d(()=>[{title:{"zh-CN":"\u5927\u6A21\u578B\u8BC4\u6D4B","en-US":"LLM"},key:"large-model",href:`${t==null?void 0:t.VITE_COMPASS_URL}large-model`,onClick:E,isActive:u.startsWith("/large-model")||u.startsWith("/arena")||u.startsWith("/doc")||u.startsWith("/rule")||u.startsWith("/policy")||window.location.href.startsWith(t==null?void 0:t.VITE_RANK_URL)||window.location.href.startsWith(t==null?void 0:t.VITE_HUB_URL)||window.location.href.startsWith(t==null?void 0:t.VITE_DOC_URL)||window.location.href.startsWith(t==null?void 0:t.VITE_SPECIAL_LIST_URL)||window.location.href.startsWith(t==null?void 0:t.VITE_DATA_URL)},{title:{"zh-CN":"\u79D1\u5B66\u667A\u80FD\u8BC4\u6D4B","en-US":"Scientific Intelligence"},key:"Intern-Discovery-Eval",href:`${t==null?void 0:t.VITE_COMPASS_URL}Intern-Discovery-Eval`,onClick:E,isActive:u.startsWith("/Intern-Discovery-Eval")},{title:{"zh-CN":"\u5177\u8EAB\u667A\u80FD\u8BC4\u6D4B","en-US":"Embodied Intelligence"},key:"Embodied-Intelligence",href:`${t==null?void 0:t.VITE_COMPASS_URL}embodied-intelligence`,onClick:E,isActive:u.startsWith("/embodied-intelligence")},{title:{"zh-CN":"\u5B89\u5168\u8BC4\u6D4B","en-US":"Safety"},key:"security-evaluation",href:`${t==null?void 0:t.VITE_COMPASS_URL}safety`,onClick:E,isActive:u.startsWith("/safety")},{title:{"zh-CN":"AI \u8BA1\u7B97\u7CFB\u7EDF\u8BC4\u6D4B","en-US":"AI Computing System"},key:"computing-system-evaluation",href:`${t==null?void 0:t.VITE_COMPASS_URL}computing-system`,onClick:E,isActive:u.startsWith("/computing-system")||u.startsWith("/evaluation-plan")},{title:{"zh-CN":"\u5782\u7C7B\u9886\u57DF\u8BC4\u6D4B","en-US":"Industry Verticals"},key:"Vertical-domain-evaluation",href:`${t==null?void 0:t.VITE_COMPASS_URL}ecosystem/finance`,onClick:E,isActive:u.startsWith("/ecosystem/finance")}],[t,u,window.location]),Y=r=>pe(void 0,[r],function*({key:W}){if(W==="logout")try{yield b()}catch(g){X.error("request error!")}finally{m(),window.location.reload()}}),p=d(()=>l!==i.miniWeb&&l!==i.lightMiniWeb,[l]),J=d(()=>[{label:n.createElement("div",null,e==null?void 0:e.finance," ",n.createElement(k,{type:"icon-GotoOutline"})),key:"https://cnfinbench.opencompass.org.cn/"},{label:n.createElement("div",null,e==null?void 0:e.medical," ",n.createElement(k,{type:"icon-GotoOutline"})),key:"https://medbench.opencompass.org.cn/home"}],[e,t]),D=d(()=>l===i.blueWeb||l===i.miniWeb||l===i.transparentWeb?a==="en-US"?le:ne:a==="en-US"?ie:re,[l,a]),Q=({key:r})=>{r.startsWith(t==null?void 0:t.VITE_COMPASS_URL)?location.href=r:window.open(r)},h=d(()=>!!(v.navMenuList&&v.navMenuList.length>1||!v.navMenuList),[v.navMenuList]),N=d(()=>[{key:"myEvaluation",label:n.createElement("a",{href:x(t==null?void 0:t.VITE_RANK_URL,"/online-evaluation",{isNew:_,lang:a})},e==null?void 0:e.myEvaluation)},{key:"myBenchmark",label:n.createElement("a",{href:se(t==null?void 0:t.VITE_HUB_URL,"/benchmarks",{isNew:_,lang:a})},e==null?void 0:e.myBenchmark)},{key:"myModel",label:n.createElement("a",{href:x(t==null?void 0:t.VITE_RANK_URL,"/models",{isNew:_,lang:a})},e==null?void 0:e.myModel)},{key:"collaboration",label:n.createElement("a",{className:o.collaboration,href:ce(t==null?void 0:t.VITE_DATA_URL,"/data-list",{isNew:_,lang:a})},e==null?void 0:e.commitRecord)},{key:"user-center",label:n.createElement("a",{href:`${t==null?void 0:t.VITE_SSO_URL}/usercenter?lang=${a}`,target:"_blank",rel:"noreferrer"},e==null?void 0:e.userCenter)},{key:"logout",label:e==null?void 0:e.logout}],[e==null?void 0:e.myEvaluation,e==null?void 0:e.logout,e==null?void 0:e.userCenter,e==null?void 0:e.myBenchmark,e==null?void 0:e.myModel,a,t,_]),j=d(()=>n.createElement("header",{className:y(o.firstHeader,C&&h&&p&&o.animateHide,!C&&p&&o.animateShow,l===i.lightWeb&&o.lightHeader,l===i.lightMiniWeb&&o.lightHeader,l===i.miniWeb&&o.miniWeb,!f&&l===i.miniWeb&&o.blackMiniWeb,l===i.transparentWeb&&!f&&o.blueBackHeaderBox,l===i.lightWeb&&!f&&o.lightBackHeader,a==="en-US"&&o.enHeader)},n.createElement("a",{className:o.logo,href:`${t==null?void 0:t.VITE_COMPASS_URL}old-home?lang=${a}`,onClick:r=>{r.preventDefault(),Z(a,"header",`${t==null?void 0:t.VITE_COMPASS_URL}old-home`)}},n.createElement("img",{src:D,alt:"logo"})),n.createElement("div",{className:o.rightBox},O.map(r=>r.key==="Vertical-domain-evaluation"?n.createElement(P,{placement:"bottom",overlayClassName:o.whiteCustomDropdown,menu:{items:J,onClick:Q}},n.createElement("a",{key:r.key,className:y(o.firstMenuItem,r.isActive&&o.activeMenu),target:"_self",rel:"noreferrer"},r.title[a])):n.createElement("a",{key:r.key,className:y(o.firstMenuItem,r.isActive&&o.activeMenu),target:"_self",rel:"noreferrer",onClick:W=>{W.preventDefault(),r.onClick&&r.onClick(a,"header",r.href)}},r.title[a])),n.createElement("div",{onClick:()=>B(a===L.zh?L.en:L.zh),className:o.lang},n.createElement(k,{type:a!=="zh-CN"?"icon-zhongyingqiehuanyingTranslateE":"icon-zhongyingqiehuanzhongTranslateC"})),n.createElement("div",{className:o.userWrapper},U&&U.token?n.createElement(P,{overlayClassName:o.userInfoDropdown,menu:{items:N,onClick:Y}},n.createElement("div",{className:o.avatar},n.createElement(k,{type:l===i.lightMiniWeb||l===i.lightWeb?"icon-a-Frame1321316814":"icon-a-Frame1321316813"}))):n.createElement("a",{className:y(o.loginBtn),onClick:()=>{let r=K();r&&(window.location.href=r)}},e==null?void 0:e.login)))),[C,l,p,D,e,f,O,N,h,t,U]),S=d(()=>h?he:ge,[h]);return T(()=>{console.log("scrollOffset",S);const r=W=>{let g=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;window.clearTimeout(q),q=setTimeout(function(){g===0?(w(!1),A(!0)):(A(!1),g>I+S+5?(console.log("\u5411\u4E0B\u6EDA\u52A8"),g>=I&&w(!0)):g<I-S-5&&w(!1)),I=g},50)};return window.addEventListener("scroll",r),()=>{window.removeEventListener("scroll",r)}},[window.location.pathname,l,h,S]),n.createElement(n.Fragment,null,C&&p?h?n.createElement(V,G(z({},s),{isTop:!1,isScrollDown:C})):n.createElement("div",{className:y(o.headerBox,o.onlyFirstHeaderBox,l===i.lightWeb&&o.lightHeadBox,l===i.lightMiniWeb&&o.lightMiniWeb,l===i.miniWeb&&o.miniWeb,l===i.transparentWeb&&o.transparentWeb)},j):n.createElement("div",{className:y(o.headerBox,!p&&o.onlyFirstHeaderBox,l===i.lightWeb&&o.lightHeadBox,l===i.lightMiniWeb&&o.lightMiniWeb,l===i.miniWeb&&o.miniWeb,l===i.transparentWeb&&o.transparentWeb,l===i.lightWeb&&!f&&o.lightBackHeadBox)},j,p&&n.createElement(V,G(z({},s),{isTop:f,isScrollDown:!1}))))};export{Ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n,{useContext as
|
|
1
|
+
import n,{useContext as S,useState as L,useRef as j,useEffect as R,useMemo as I}from"react";import B from"../../extraComponents/button/button.js";import{goCommon as D,goHub as W,goRank as V,goRules as x,goKit as H,goData as M,goOCHome as O,clickArena as z,goAnnualBenchmark as P,clickContributeBenchmarks as K}from"../../google-log/home.js";import t from"./header.module.less.js";import F from"./components/create-online-evaluation/component/evaluation-button/evaluation-button.js";import"./components/create-online-evaluation/component/create-evaluation/create-evaluation.js";import"antd";import"./components/create-online-evaluation/component/pre-create-evaluation/index.module.less.js";import{OcContext as Y}from"../../providers/OcContext.js";import G from"./hooks/useUrl.js";import{OcConfigContext as Z}from"../../providers/OcConfigContext.js";import s from"classnames";import"./firstHeader.module.less.js";import q from"../../assets/svg/newLogo.svg.js";import J from"../../assets/svg/newLogoEn.svg.js";import Q from"../../extraComponents/icon-font/index.js";import X from"../../assets/svg/blueNewLogo.svg.js";import ee from"../../assets/svg/blueNewLogoEn.svg.js";import{useLocation as te}from"react-router-dom";import"@ant-design/icons";import{webTypeEnum as m}from"../../constants/enums.js";import"../../mobile/components/top-nav/top-nav.module.less.js";import"../top-nav/shared.js";import"../top-nav/top-nav.module.less.js";import"react-device-detect";import"../side-nav/side-nav.module.less.js";import"../footer/footer.module.less.js";import"../dropdown/dropdown.module.less.js";import{useSize as oe}from"ahooks";import"../footer-expansion/footer-expansion.module.less.js";import"../md-render/index.js";import"../../helper/index.js";import"./components/create-online-evaluation/component/sidebar/sidebar.module.less.js";import ne from"../../assets/svg/left-wing.svg.js";import ae from"../../assets/svg/right-wing.svg.js";import le from"../../assets/svg/arrow.svg.js";var f;(function(r){r.llm="large-model",r.aiComputingSystem="computing-system",r.embodiedIntelligence="embodied-intelligence",r.industryVerticals="ecosystem/finance",r.safety="safety",r.safetyRank="safety-rank",r.rankDetail="safety/rank",r.evaluationPlan="evaluation-plan"})(f||(f={}));const U="YearEvaluationNotion",se=r=>{const{webType:i,navMenuList:h,isLLM:v,isTop:g,isScrollDown:c}=r,{locales:l}=S(Y),{config:w}=S(Z),[u,p]=L(!1),[N,E]=L(!1),{urls:e}=G(),{pathname:C}=te(),{locale:a}=w,_=j(),d=oe(_);R(()=>{if(a==="zh-CN"){p(!1);return}c?(d==null?void 0:d.width)<1665?p(!0):p(!1):(d==null?void 0:d.width)<1464?p(!0):p(!1)},[d==null?void 0:d.width,c,a]);const k=I(()=>Array.isArray(h)&&h.length>0?h:[{title:{zh:"\u9879\u76EE\u4ECB\u7ECD",en:"Introduction"},key:"largeModel",href:`${e==null?void 0:e.VITE_COMPASS_URL}${f.llm}`,onClick:D,isActive:C.startsWith(f.llm)},{title:{zh:"\u8BC4\u6D4B\u96C6\u793E\u533A",en:"CompassHub"},key:"CompassHub",href:e==null?void 0:e.VITE_HUB_URL,onClick:W,isActive:location.href.startsWith(e==null?void 0:e.VITE_HUB_URL)},{title:{zh:"\u8BC4\u6D4B\u699C\u5355",en:"CompassRank"},key:"CompassRank",href:`${e==null?void 0:e.VITE_RANK_URL}/old-home`,onClick:V,isActive:location.href.startsWith(e==null?void 0:e.VITE_RANK_URL)||location.href.startsWith(e==null?void 0:e.VITE_SPECIAL_LIST_URL)},{title:{zh:"\u699C\u5355\u89C4\u5219",en:"Rules"},key:"Rules",href:`${e==null?void 0:e.VITE_COMPASS_URL}old-rule`,onClick:x,isActive:location.href.startsWith(`${e==null?void 0:e.VITE_COMPASS_URL}old-rule`)},{title:{zh:"\u8BC4\u6D4B\u5DE5\u5177",en:"CompassKit"},key:"CompassKit",isExternal:!0,href:{zh:"https://github.com/open-compass/",en:"https://github.com/open-compass/"},onClick:H,isActive:!1},{title:{zh:"\u4F7F\u7528\u6307\u5357",en:"Docs"},key:"Docs",isExternal:!0,href:{zh:`${e==null?void 0:e.VITE_DOC_URL_ZH}`,en:`${e==null?void 0:e.VITE_DOC_URL}`},isActive:location.href.startsWith(e==null?void 0:e.VITE_DOC_URL)},{title:{zh:"\u6D66\u6C5F\u79D1\u5B66\u8BC4\u6D4B\u5171\u521B\u8BA1\u5212",en:"AI4S Program"},key:"collaboration",href:`${e==null?void 0:e.VITE_DATA_URL}/old-home`,onClick:M,isActive:location.href.startsWith(`${e==null?void 0:e.VITE_DATA_URL}`)}],[e,C,h,location.href]),A=I(()=>i===m.blueWeb||i===m.miniWeb||i===m.transparentWeb?a==="en-US"?J:q:a==="en-US"?ee:X,[i,a]),T=o=>{window.open(o)};return R(()=>{!v||!localStorage.getItem(`${U}`)&&location.href.startsWith(e==null?void 0:e.VITE_HUB_URL)&&(E(!1),localStorage.setItem(`${U}`,"1"))},[v,e]),n.createElement("header",{className:s(t.header,a==="en-US"&&c&&t.enHeader,t.secondMenu,a!=="en-US"&&c&&t.zhHeader,i!==m.lightWeb&&c&&t.topSecondMenu,i===m.lightWeb&&c&&t.topSecondMenuHub,i===m.lightWeb&&t.lightSecondMenu,i===m.transparentWeb&&!g&&!c&&t.blueBackSecondHeaderBox,i===m.lightWeb&&!g&&!c&&t.lightBackSecondMenu),ref:_},n.createElement("div",{className:t.headerLeft},c&&n.createElement("a",{className:t.logo,href:`${e==null?void 0:e.VITE_COMPASS_URL}old-home?lang=${a}`,onClick:o=>{o.preventDefault(),O(a,"header",`${e==null?void 0:e.VITE_COMPASS_URL}old-home`)}},n.createElement("img",{src:A,alt:"logo"})),n.createElement("div",{className:t.menus},k==null?void 0:k.map(o=>n.createElement("a",{key:o.key,className:s(t.menuItem,o.isActive&&t.activeMenuItem),style:{fontWeight:o.href===window.location.origin?600:400},target:o.isExternal?"_blank":"_self",href:`${o.href}${o.isExternal?"":`?lang=${a}`}`,rel:"noreferrer",onClick:$=>{var b,y;$.preventDefault(),o.isExternal?T(a==="zh-CN"?`${(b=o.href)==null?void 0:b.zh}`:`${(y=o.href)==null?void 0:y.en}`):o.onClick&&o.onClick(a,o.key,o.href)}},(o==null?void 0:o.customNode)&&(o==null?void 0:o.customNode),o.title[a==null?void 0:a.split("-")[0]],o.isExternal&&n.createElement(Q,{type:"icon-GotoOutline",style:{marginLeft:4,fontSize:"16px"}}))),v&&n.createElement(n.Fragment,null,n.createElement("a",{className:s(t.menuItem,location.href.startsWith((e==null?void 0:e.VITE_COMPASS_URL)+"arena")&&t.activeMenuItem),href:`${e==null?void 0:e.VITE_COMPASS_URL}arena?lang=${a}`,target:"_blank",rel:"noreferrer",onClick:o=>{o.preventDefault(),z(a,{key:"llm"},e==null?void 0:e.VITE_COMPASS_URL)}},n.createElement("div",{className:t.arenaWords},l==null?void 0:l.arena))),v&&n.createElement("div",{onClick:()=>{P(a,"CompassHub",`${e==null?void 0:e.VITE_HUB_URL}/2025-annual-benchmark`)},className:s(t.yearEvaluation,u&&t.wrapYearEvaluation)},n.createElement("div",{className:t.innerBtn},n.createElement("img",{src:ne,className:s(u?t.wrapLeftWing:t.leftWing,t.wing)}),n.createElement("img",{src:ae,className:s(u?t.wrapRightWing:t.rightWing,t.wing)})),n.createElement("div",{className:s(u&&t.wrapStyle,t.innerYearEvaluation)},l==null?void 0:l.yearEvaluation),N&&n.createElement(n.Fragment,null,n.createElement("img",{src:le,className:s(u&&t.wrapArrow,t.arrow)}),n.createElement("div",{className:s(u&&t.wrapModalContainer,t.modalContainer)},n.createElement("span",{className:t.title},l==null?void 0:l.yearEvaluationTitle),n.createElement("div",{className:t.body},l==null?void 0:l.yearEvaluationDesc),n.createElement("div",{className:t.footer},n.createElement(B,{className:t.knownButton,type:"primary",onClick:o=>{o.stopPropagation(),E(!1)}},l==null?void 0:l.yearEvaluationKnown))))))),v&&n.createElement("div",{className:t.headerRight},n.createElement("a",{href:`${e==null?void 0:e.VITE_HUB_URL}/dataset-submit?lang=${a}`,className:s(t.addDatasetBtn,t.contributeBtn,u&&t.wrapBtn),onClick:o=>{o.preventDefault(),K(a,e==null?void 0:e.VITE_HUB_URL)}},l==null?void 0:l.contributeBenchmarks),n.createElement(F,null,n.createElement("div",{className:s(u&&t.wrapBtn,t.addDatasetBtn)},l==null?void 0:l.onlineEvaluation))))};export{f as BigCompassModuleEnum,se as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n,{useContext as
|
|
1
|
+
import n,{useContext as m,useEffect as E,useMemo as f}from"react";import{OcConfigContext as N}from"../../providers/OcConfigContext.js";import a from"./side-nav.module.less.js";import h from"../header/hooks/useUrl.js";import r from"classnames";import d from"../../extraComponents/icon-font/index.js";import{OcContext as R}from"../../providers/OcContext.js";import{getRankRoutePath as v,buildRankUrl as C,getHubRoutePath as b,buildHubUrl as U,getDataRoutePath as _,buildDataUrl as y}from"../../helper/rankRoute.js";const B=c=>{const{setConfig:k,config:p}=m(N),{locales:l}=m(R);E(()=>{k(c)},[c]);const{urls:e}=h(),{locale:o,isNew:t=!1}=p,u=f(()=>[{title:l==null?void 0:l.onlineEvaluation,subMenus:[{icon:"icon-OC_MyEvaluation",title:{"en-US":"Evaluation","zh-CN":"\u6211\u7684\u8BC4\u6D4B"},key:v("/online-evaluation",t),navigate:C(e==null?void 0:e.VITE_RANK_URL,"/online-evaluation",{isNew:t,lang:o})},{icon:"icon-OC_Benchmark",title:{"en-US":"Benchmark","zh-CN":"\u6211\u7684\u8BC4\u6D4B\u96C6"},key:b("/benchmarks",t),navigate:U(e==null?void 0:e.VITE_HUB_URL,"/benchmarks",{isNew:t,lang:o})},{icon:"icon-moxingModel",title:{"en-US":"Model","zh-CN":"\u6211\u7684\u6A21\u578B"},key:v("/models",t),navigate:C(e==null?void 0:e.VITE_RANK_URL,"/models",{isNew:t,lang:o})}]},{title:l==null?void 0:l.scienceCommit,subMenus:[{icon:"icon-tijiaojiluSubmission",title:{"en-US":"Submission Record","zh-CN":"\u63D0\u4EA4\u8BB0\u5F55"},key:_("/data-list",t),navigate:y(e==null?void 0:e.VITE_DATA_URL,"/data-list",{isNew:t,lang:o})}]}],[o,e,l,t]),g=()=>window.open(`${e==null?void 0:e.VITE_RANK_URL}/feedback?lang=${o}`);return n.createElement("div",{className:a.menu},u==null?void 0:u.map(i=>n.createElement("div",{key:i==null?void 0:i.title,className:r(a.menuItem)},n.createElement("div",{className:a.title},i.title),i.subMenus.map(s=>n.createElement("div",{className:r(a.subMenu,window.location.pathname.includes(s.key)&&a.active),onClick:()=>window.location.replace(s.navigate)},n.createElement(d,{className:a.icon,type:s.icon}),n.createElement("span",{className:a.subMenuTitle},s.title[o]))))),n.createElement("div",{className:a.menuFooter,onClick:g},n.createElement(d,{type:"icon-FeedbackOutlined"}),n.createElement("span",null,o==="zh-CN"?"\u610F\u89C1\u53CD\u9988":"Feedback")))};export{B as default};
|
package/dist/google-log/home.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=(o,n,e)=>{window.gtag("event","go_OC",{event_source:n}),window.location.href=`${e}?lang=${o}`},
|
|
1
|
+
const t=(o,n,e)=>{window.gtag("event","go_OC",{event_source:n}),window.location.href=`${e}?lang=${o}`},c=(o,n,e)=>{window.gtag("go_rank",{event_source:n});const a=e.replace(/\/$/,"").replace(/\/old-home$/,"");window.location.href=`${a}/old-home?lang=${o}`},l=(o,n,e)=>{window.gtag("go_hub",{event_source:n}),window.location.href=`${e}?lang=${o}`},r=(o,n,e)=>{window.gtag("go_hub",{event_source:n}),window.location.href=`${e}?lang=${o}`},g=(o,n,e)=>{window.gtag("go_kit",{event_source:n}),window.open(`${e}?lang=${o}`)},i=(o,n)=>{window.gtag("contribute_benchmarks",{event_source:"header"}),window.location.href=`${n}/dataset-submit?lang=${o}`},w=(o,n,e)=>{window.gtag("go_rules",{event_source:n});const a=e.replace(/\/$/,"").replace(/\/old-rule$/,"");window.location.href=`${a}/old-rule?lang=${o}`},s=(o,n,e)=>{window.gtag("click_arena",{event_source:"rank-header"}),n==="mm"?window.open(`${e}arena/multimodal?lang=${o}`):window.open(`${e}arena?lang=${o}`)},d=(o,n,e)=>{window.gtag("go_collaboration",{event_source:"collaboration"});const a=e.replace(/\/$/,"").replace(/\/old-home$/,"");window.location.href=`${a}/old-home?lang=${o}`},$=(o,n,e)=>{window.gtag("go_collaboration",{event_source:n}),window.location.href=`${e}?lang=${o}`},u=(o,n,e)=>{window.gtag("goInternDiscoveryEvalKit",{event_source:n}),window.open(`${e}?lang=${o}`)};export{s as clickArena,i as clickContributeBenchmarks,r as goAnnualBenchmark,$ as goCommon,d as goData,l as goHub,u as goInternDiscoveryEvalKit,g as goKit,t as goOCHome,c as goRank,w as goRules};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const c=(e,t=!1)=>t?e:e.replace(/^\/evaluation-result/,"/old-evaluation-result").replace(/^\/online-evaluation/,"/old-online-evaluation").replace(/^\/models/,"/old-models").replace(/^\/create/,"/old-create"),i=(e,t=!1)=>t?e:e.replace(/^\/benchmarks/,"/old-benchmarks"),d=(e,t=!1)=>t?e:e.replace(/^\/data-list/,"/old-data-list"),l=(e,t,r,n)=>{const{isNew:f=!1,lang:o,searchParams:s}=n!=null?n:{},b=r(t,f),a=new URLSearchParams;o&&a.set("lang",o),s&&Object.entries(s).forEach(([m,g])=>{a.set(m,g)});const u=a.toString();return`${e}${b}${u?`?${u}`:""}`},h=(e,t,r)=>l(e,t,c,r),P=(e,t,r)=>l(e,t,i,r),R=(e,t,r)=>l(e,t,d,r);export{R as buildDataUrl,P as buildHubUrl,h as buildRankUrl,d as getDataRoutePath,i as getHubRoutePath,c as getRankRoutePath};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as OcHeader}from"./components/header/index.js";export{default as OcTopNav}from"./components/top-nav/index.js";export{default as OcOnlineEvaluation}from"./components/online-evaluation/index.js";export{default as OcSideNav}from"./components/side-nav/index.js";export{default as OcFooter}from"./components/footer/index.js";export{default as OcDropdown}from"./components/dropdown/dropdown.js";export{goData,goHub,goInternDiscoveryEvalKit,goKit,goOCHome,goRank,goRules}from"./google-log/home.js";export{default as OcFooterExpansion}from"./components/footer-expansion/index.js";export{default as OcMdRender}from"./components/md-render/index.js";export{envTypeEnum,evaluationTypeEnum,langTypeEnum,topNavActiveKeyEnum,webTypeEnum}from"./constants/enums.js";export{TOP_NAV_LOCALE_STORAGE_KEY}from"./constants/storage.js";export{getMenuData}from"./helper/index.js";
|
|
1
|
+
export{default as OcHeader}from"./components/header/index.js";export{default as OcTopNav}from"./components/top-nav/index.js";export{default as OcOnlineEvaluation}from"./components/online-evaluation/index.js";export{default as OcSideNav}from"./components/side-nav/index.js";export{default as OcFooter}from"./components/footer/index.js";export{default as OcDropdown}from"./components/dropdown/dropdown.js";export{goData,goHub,goInternDiscoveryEvalKit,goKit,goOCHome,goRank,goRules}from"./google-log/home.js";export{default as OcFooterExpansion}from"./components/footer-expansion/index.js";export{default as OcMdRender}from"./components/md-render/index.js";export{envTypeEnum,evaluationTypeEnum,langTypeEnum,topNavActiveKeyEnum,webTypeEnum}from"./constants/enums.js";export{TOP_NAV_LOCALE_STORAGE_KEY}from"./constants/storage.js";export{getMenuData}from"./helper/index.js";export{buildDataUrl,buildHubUrl,buildRankUrl,getDataRoutePath,getHubRoutePath,getRankRoutePath}from"./helper/rankRoute.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 根据 isNew 返回 Rank 站点路由路径。
|
|
3
|
+
* isNew 为 true 时使用新路由;为 false 时使用 old- 前缀路由,默认 false。
|
|
4
|
+
*/
|
|
5
|
+
declare const getRankRoutePath: (path: string, isNew?: boolean) => string;
|
|
6
|
+
/**
|
|
7
|
+
* 根据 isNew 返回 Hub 站点路由路径。
|
|
8
|
+
* isNew 为 true 时使用新路由;为 false 时使用 old- 前缀路由,默认 false。
|
|
9
|
+
*/
|
|
10
|
+
declare const getHubRoutePath: (path: string, isNew?: boolean) => string;
|
|
11
|
+
/**
|
|
12
|
+
* 根据 isNew 返回 Data 站点路由路径。
|
|
13
|
+
* isNew 为 true 时使用新路由;为 false 时使用 old- 前缀路由,默认 false。
|
|
14
|
+
*/
|
|
15
|
+
declare const getDataRoutePath: (path: string, isNew?: boolean) => string;
|
|
16
|
+
declare const buildRankUrl: (rankBaseUrl: string, path: string, options?: {
|
|
17
|
+
isNew?: boolean;
|
|
18
|
+
lang?: string;
|
|
19
|
+
searchParams?: Record<string, string>;
|
|
20
|
+
}) => string;
|
|
21
|
+
declare const buildHubUrl: (hubBaseUrl: string, path: string, options?: {
|
|
22
|
+
isNew?: boolean;
|
|
23
|
+
lang?: string;
|
|
24
|
+
searchParams?: Record<string, string>;
|
|
25
|
+
}) => string;
|
|
26
|
+
declare const buildDataUrl: (dataBaseUrl: string, path: string, options?: {
|
|
27
|
+
isNew?: boolean;
|
|
28
|
+
lang?: string;
|
|
29
|
+
searchParams?: Record<string, string>;
|
|
30
|
+
}) => string;
|
|
31
|
+
|
|
32
|
+
export { buildDataUrl, buildHubUrl, buildRankUrl, getDataRoutePath, getHubRoutePath, getRankRoutePath };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { envTypeEnum, langTypeEnum, webTypeEnum, topNavActiveKeyEnum } from './c
|
|
|
11
11
|
export { envTypeEnum, evaluationTypeEnum, langTypeEnum, topNavActiveKeyEnum, webTypeEnum } from './constants/enums.js';
|
|
12
12
|
export { TOP_NAV_LOCALE_STORAGE_KEY } from './constants/storage.js';
|
|
13
13
|
export { getMenuData } from './helper/index.js';
|
|
14
|
+
export { buildDataUrl, buildHubUrl, buildRankUrl, getDataRoutePath, getHubRoutePath, getRankRoutePath } from './helper/rankRoute.js';
|
|
14
15
|
|
|
15
16
|
interface DefaultRespDTO<T> {
|
|
16
17
|
msgCode: number;
|
|
@@ -79,17 +80,23 @@ interface HeaderProps {
|
|
|
79
80
|
navMenuList?: SubMenu[];
|
|
80
81
|
isLLM: boolean;
|
|
81
82
|
isDefaultShowSecondMenu?: boolean;
|
|
83
|
+
/** true 使用新路由;false 使用 old- 前缀路由,默认 false */
|
|
84
|
+
isNew?: boolean;
|
|
82
85
|
}
|
|
83
86
|
interface OnlineEvaluationProps {
|
|
84
87
|
envType: envTypeEnum;
|
|
85
88
|
webType: webTypeEnum;
|
|
86
89
|
locale: langTypeEnum;
|
|
87
90
|
children?: React.ReactElement;
|
|
91
|
+
/** true 使用新路由;false 使用 old- 前缀路由,默认 false */
|
|
92
|
+
isNew?: boolean;
|
|
88
93
|
}
|
|
89
94
|
interface SideNavProps {
|
|
90
95
|
locale: langTypeEnum;
|
|
91
96
|
envType: envTypeEnum;
|
|
92
97
|
children?: React.ReactElement;
|
|
98
|
+
/** true 使用新路由;false 使用 old- 前缀路由,默认 false */
|
|
99
|
+
isNew?: boolean;
|
|
93
100
|
}
|
|
94
101
|
type TopNavLinkTarget = '_self' | '_blank';
|
|
95
102
|
interface DropdownItem {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencompass-fe/oc-webkit-eval",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Provide some common components for oc",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"dev": "cross-env NODE_ENV=developemnt rollup -m -c rollup.config.js -w",
|
|
17
17
|
"build": "rimraf dist && rimraf es && cross-env NODE_ENV=production rollup -c rollup.config.js",
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
"test": "tsc --project ./tsconfig.test.json && jest",
|
|
20
20
|
"lint": "eslint 'src/**/*.{ts,tsx,js,jsx}' && npm run build:type",
|
|
21
21
|
"lint:fix": "eslint src/**/*.{ts,tsx,js,jsx} --fix",
|