@ttmg/cli 0.3.7-beta.2 → 0.3.7
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/CHANGELOG.md +8 -1
- package/dist/index.js +690 -38
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/public/assets/Detail-BzyVtzyL.js +1 -0
- package/dist/public/assets/Detail-BzyVtzyL.js.br +0 -0
- package/dist/public/assets/MonetizationMode-gxP1CQqy.js +1 -0
- package/dist/public/assets/MonetizationModeSummary-CD54_ROf.js +1 -0
- package/dist/public/assets/baseForm-CB6KCNqW.css +1 -0
- package/dist/public/assets/baseForm-CB6KCNqW.css.br +0 -0
- package/dist/public/assets/baseForm-d3x5z6BS.js +10 -0
- package/dist/public/assets/baseForm-d3x5z6BS.js.br +0 -0
- package/dist/public/assets/index-07cXGo3a.js +14 -0
- package/dist/public/assets/index-07cXGo3a.js.br +0 -0
- package/dist/public/assets/{index-BswgGVlz.js → index-766JxwXs.js} +1 -1
- package/dist/public/assets/index-766JxwXs.js.br +0 -0
- package/dist/public/assets/index-88dZ53Te.css +1 -0
- package/dist/public/assets/index-88dZ53Te.css.br +0 -0
- package/dist/public/assets/index-B7M-KACw.js +1 -0
- package/dist/public/assets/{index-Cj-lTEG1.js → index-BBHUSsVA.js} +1 -1
- package/dist/public/assets/index-BBHUSsVA.js.br +0 -0
- package/dist/public/assets/{index-Sk6u8HWP.js → index-BNtIdKnQ.js} +1 -1
- package/dist/public/assets/{index-tXDZpXMk.js → index-BZOItUfZ.js} +1 -1
- package/dist/public/assets/index-BZOItUfZ.js.br +0 -0
- package/dist/public/assets/{index-D35C4ac4.js → index-Ba-my-vz.js} +1 -1
- package/dist/public/assets/index-Bf85t01Q.css +1 -0
- package/dist/public/assets/index-Bf85t01Q.css.br +0 -0
- package/dist/public/assets/{index-B0CT2rYr.js → index-Bz8ZWlHc.js} +1 -1
- package/dist/public/assets/index-C06KDNuj.css +1 -0
- package/dist/public/assets/index-C0Izps-u.js +1 -0
- package/dist/public/assets/index-C4Lcagww.js +1 -0
- package/dist/public/assets/{index-B-rc2X1H.js → index-CLDvvBgM.js} +1 -1
- package/dist/public/assets/{index-DbiZkOAh.css → index-CLgcHgzd.css} +1 -1
- package/dist/public/assets/index-CQR5bkkv.js +1 -0
- package/dist/public/assets/{index-CDrq3KnY.js → index-CYD_pNmH.js} +1 -1
- package/dist/public/assets/{index-DdH9Yin-.js → index-Cr55HKuS.js} +1 -1
- package/dist/public/assets/{index-6LE--ADL.css → index-D2LsTDVa.css} +1 -1
- package/dist/public/assets/index-D2LsTDVa.css.br +0 -0
- package/dist/public/assets/{index-C4wGgEDm.css → index-DNsJSSmy.css} +1 -1
- package/dist/public/assets/index-E142v_RY.js +1 -0
- package/dist/public/assets/index-E142v_RY.js.br +0 -0
- package/dist/public/assets/index-tOg_vZEc.js +1 -0
- package/dist/public/assets/index-utYbqRWL.js +1 -0
- package/dist/public/assets/index-utYbqRWL.js.br +0 -0
- package/dist/public/assets/{times-CCIAbLYL.js → times-BvsrZcqF.js} +1 -1
- package/dist/public/index.html +2 -2
- package/dist/scripts/docs/capture.js +12 -4
- package/dist/scripts/docs/render.js +3 -2
- package/dist/scripts/docs/server.js +71 -9
- package/package.json +1 -1
- package/dist/public/assets/Detail-BInCTDTx.js +0 -1
- package/dist/public/assets/Detail-BInCTDTx.js.br +0 -0
- package/dist/public/assets/baseForm-B7tArmif.js +0 -10
- package/dist/public/assets/baseForm-B7tArmif.js.br +0 -0
- package/dist/public/assets/baseForm-DzWBZ1nI.css +0 -1
- package/dist/public/assets/baseForm-DzWBZ1nI.css.br +0 -0
- package/dist/public/assets/index-6LE--ADL.css.br +0 -0
- package/dist/public/assets/index-BACeBrQR.css +0 -1
- package/dist/public/assets/index-BOiN8aIS.js +0 -1
- package/dist/public/assets/index-BVi9swz_.js +0 -1
- package/dist/public/assets/index-BVi9swz_.js.br +0 -0
- package/dist/public/assets/index-BlXhGm9R.js +0 -1
- package/dist/public/assets/index-BswgGVlz.js.br +0 -0
- package/dist/public/assets/index-Cj-lTEG1.js.br +0 -0
- package/dist/public/assets/index-DQqzytdw.js +0 -1
- package/dist/public/assets/index-DQqzytdw.js.br +0 -0
- package/dist/public/assets/index-DkXWo3Jg.js +0 -14
- package/dist/public/assets/index-DkXWo3Jg.js.br +0 -0
- package/dist/public/assets/index-OIQapQiA.js +0 -1
- package/dist/public/assets/index-TYa4eXxF.css +0 -1
- package/dist/public/assets/index-aD1InxYk.js +0 -1
- package/dist/public/assets/index-jaMAKGHW.css +0 -1
- package/dist/public/assets/index-tXDZpXMk.js.br +0 -0
- /package/dist/public/assets/{Detail-BaQ9eM95.css → index-BaQ9eM95.css} +0 -0
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.basic-debug-guide-page{display:flex;flex-direction:column;gap:16px;padding:16px}.basic-debug-guide-banner-copy{display:flex;flex-direction:column;gap:4px}.basic-debug-guide-hero,.basic-debug-guide-section{border:1px solid rgba(15,23,42,.08);border-radius:16px;background:#fff;box-shadow:0 8px 24px #0f172a0a}.basic-debug-guide-hero{padding:22px 24px;background:linear-gradient(180deg,#f4f8fff0,#fffffffa)}.basic-debug-guide-hero-desc{margin:
|
|
1
|
+
.basic-debug-guide-page{display:flex;flex-direction:column;gap:16px;padding:16px}.basic-debug-guide-banner-copy{display:flex;flex-direction:column;gap:4px}.basic-debug-guide-hero,.basic-debug-guide-section{border:1px solid rgba(15,23,42,.08);border-radius:16px;background:#fff;box-shadow:0 8px 24px #0f172a0a}.basic-debug-guide-hero{padding:22px 24px;background:linear-gradient(180deg,#f4f8fff0,#fffffffa)}.basic-debug-guide-hero-desc{margin:14px 0 0;color:#000000a6;line-height:1.7}.basic-debug-guide-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:20px}.basic-debug-guide-section{padding:18px 20px}.basic-debug-guide-section-head{display:flex;flex-direction:column;gap:4px}.basic-debug-guide-section-desc{color:#00000094;line-height:1.65}.basic-debug-guide-list,.basic-debug-guide-steps{display:flex;flex-direction:column;gap:12px;margin-top:16px}.basic-debug-guide-item,.basic-debug-guide-step{display:flex;align-items:flex-start;gap:12px}.basic-debug-guide-item-index,.basic-debug-guide-step-index{width:24px;height:24px;border-radius:999px;background:#1677ff1a;color:#1677ff;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;font-size:12px;font-weight:600;margin-top:1px}.basic-debug-guide-item-muted .basic-debug-guide-item-index{background:#6b72801f;color:#4b5563d1}.basic-debug-guide-item-copy{display:flex;flex-direction:column;gap:4px;min-width:0}.basic-debug-guide-item-copy .semi-typography:nth-child(2),.basic-debug-guide-step .semi-typography{color:#000000a8;line-height:1.65}.basic-debug-guide-command-list{display:flex;flex-direction:column;gap:12px;margin-top:18px;padding-top:16px;border-top:1px solid rgba(15,23,42,.06)}.basic-debug-guide-command-item{display:flex;flex-direction:column;gap:6px}.basic-debug-guide-command-item code{display:inline-flex;width:fit-content;padding:7px 10px;border-radius:8px;background:#0f172a0f;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:13px;color:#0f172ae0}@media(max-width:900px){.basic-debug-guide-page{padding:12px}.basic-debug-guide-hero,.basic-debug-guide-section{padding-left:16px;padding-right:16px}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{K as ne,r as h,h as L,n as P,R as S,v as J,x as ee,af as te,q as p,ag as M,d as N,ah as z,i as l,j as t,b as C,e as $,ai as T,a as le,c as ie,Q as oe,V as ce,aj as de}from"./index-07cXGo3a.js";import{C as ue,R as pe,F as H}from"./baseForm-d3x5z6BS.js";import{I as me}from"./times-BvsrZcqF.js";import"./index-BZOItUfZ.js";function fe(s){return h.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 4c0-1.1.9-2 2-2h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4Zm0 11c0-1.1.9-2 2-2h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5ZM15 2a2 2 0 0 0-2 2v5c0 1.1.9 2 2 2h5a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-5Zm1 12.5a1.5 1.5 0 0 1 3 0V16h1.5a1.5 1.5 0 0 1 0 3H19v1.5a1.5 1.5 0 0 1-3 0V19h-1.5a1.5 1.5 0 0 1 0-3H16v-1.5Z",fill:"currentColor"}))}const we=ne(fe,"customize"),F={PREFIX:`${L}-steps`,ITEM:`${L}-steps-item`};var W;(function(s){s.small="large",s.default="extra-large"})(W||(W={}));const A=s=>{const{prefixCls:e,className:r,size:a,title:n,description:i,status:x,style:d,active:c,done:o,icon:m,stepNumber:g,onClick:v,onChange:f,onKeyDown:b}=s,u=()=>{let j,E;if("icon"in s)S.isValidElement(m)&&(j=m);else if("status"in s)switch(x){case"error":j=S.createElement(te,{size:W[a]});break;case"wait":j=S.createElement("span",{className:`${e}-number-icon`},g);break;case"process":j=S.createElement("span",{className:`${e}-number-icon`},g),E=!0;break;case"finish":j=S.createElement(ee,{size:W[a]});break;case"warning":j=S.createElement(J,{size:W[a]});break;default:j=null;break}const re=P({[`${e}-icon`]:!0,[`${e}-custom-icon`]:"icon"in s,[`${e}-icon-process`]:E});return j?S.createElement("span",{className:re},j):null},_=P(e,`${e}-${x}`,{[`${e}-active`]:c,[`${e}-done`]:o,[`${e}-hover`]:f||s.onClick,[`${e}-clickable`]:f||v,[`${e}-${x}-hover`]:f||s.onClick},r),w=j=>{v?.(j),f?.()},k=j=>{j.key==="Enter"&&(b?.(j),f?.())};return S.createElement("div",{role:s.role,"aria-label":s["aria-label"],tabIndex:0,"aria-current":"step",className:_,style:d,onClick:j=>w(j),onKeyDown:k},S.createElement("div",{className:`${e}-container`},S.createElement("div",{className:`${e}-left`},u()),S.createElement("div",{className:`${e}-content`},S.createElement("div",{className:`${e}-title`},S.createElement("div",{className:`${e}-title-text`},n)),i&&S.createElement("div",{className:`${e}-description`},i))))};A.propTypes={prefixCls:p.string,description:p.node,icon:p.node,status:p.oneOf(["wait","process","finish","error","warning"]),title:p.node,className:p.string,style:p.object,onClick:p.func,active:p.bool,done:p.bool};A.defaultProps={prefixCls:F.ITEM,active:!1,done:!1,status:"wait",className:""};const B=s=>{const{prefixCls:e,className:r,title:a,description:n,status:i,style:x,onClick:d,icon:c,onChange:o,stepNumber:m,onKeyDown:g}=s,v=()=>{let u,_;if("icon"in s)u=c;else if("status"in s)switch(i){case"error":u=S.createElement(te,{size:"extra-large"});break;case"wait":u=m;break;case"process":u=m,_=!0;break;case"finish":u=S.createElement(ee,{size:"extra-large"});break;case"warning":u=S.createElement(J,{size:"extra-large"});break;default:u=null;break}const w=P({[`${e}-left`]:!0,[`${e}-icon`]:"icon"in s,[`${e}-plain`]:!("icon"in s),[`${e}-icon-process`]:_,[`${e}-hover`]:o||d});return u?S.createElement("div",{className:w},u):null},f=u=>{d?.(u),o?.()},b=u=>{u.key==="Enter"&&(g?.(u),o?.())};return S.createElement("div",{role:s.role,"aria-label":s["aria-label"],"aria-current":"step",tabIndex:0,className:P({[e]:!0,[`${e}-${i}`]:!!i,[`${e}-${i}-hover`]:!!i&&(o||d),[`${e}-${i}-active`]:!!i&&(o||d),[`${e}-clickable`]:o||d},r),style:x,onClick:u=>{f(u)},onKeyDown:b},v(),S.createElement("div",{className:`${e}-content`},S.createElement("div",{className:`${e}-title`,title:typeof a=="string"?a:null},S.createElement("span",{className:`${e}-title-text`},a)),S.createElement("div",{className:`${e}-description`,title:typeof n=="string"?n:null},n)))};B.propTypes={prefixCls:p.string,description:p.node,icon:p.node,status:p.oneOf(["wait","process","finish","error","warning"]),title:p.node,className:p.string,style:p.object,onClick:p.func};B.defaultProps={prefixCls:F.ITEM,status:"wait",className:""};const V=s=>{const{prefixCls:e,className:r,title:a,style:n,active:i,index:x,total:d,onClick:c,onKeyDown:o,onChange:m}=s,g=P(e,{[`${e}-active`]:i},r),v=b=>{c?.(b),m?.()},f=b=>{b.key==="Enter"&&(o?.(b),m?.())};return S.createElement("div",{role:s.role,"aria-label":s["aria-label"],"aria-current":"step",tabIndex:0,className:g,style:n,onClick:b=>v(b),onKeyDown:f},S.createElement("div",{className:`${e}-container`},S.createElement("div",{className:`${e}-content`},S.createElement("div",{className:`${e}-title`},a)),x!==d-1&&S.createElement("div",{className:`${e}-icon`},S.createElement(me,{size:"small"}))))};V.propTypes={prefixCls:p.string,title:p.node,className:p.string,style:p.object,onClick:p.func,active:p.bool};V.defaultProps={prefixCls:F.ITEM,active:!1,className:""};const se=S.createContext(null),he=s=>{const{type:e}=h.useContext(se);return(()=>{switch(e){case"fill":return S.createElement(B,Object.assign({},s));case"basic":return S.createElement(A,Object.assign({},s));case"nav":return S.createElement(V,Object.assign({},s));default:return null}})()};var ge=function(s,e){var r={};for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&e.indexOf(a)<0&&(r[a]=s[a]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(s);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(s,a[n])&&(r[a[n]]=s[a[n]]);return r};const G=s=>{const{current:e,status:r,children:a,prefixCls:n,initial:i,direction:x,className:d,style:c,onChange:o}=s,m=ge(s,["current","status","children","prefixCls","initial","direction","className","style","onChange"]),g=h.useMemo(()=>{const f=h.Children.toArray(a).filter(_=>h.isValidElement(_)),b=x==="vertical"?null:{width:`${100/f.length}%`};return h.Children.map(f,(_,w)=>{if(!_)return null;const k=i+w,j=Object.assign({stepNumber:`${k+1}`,direction:x},_.props);return r==="error"&&w===e-1&&(j.className=`${n}-next-error`),_.props.status||(k===e?j.status=r:k<e?j.status="finish":j.status="wait"),j.onChange=o?()=>{w!==e&&o(w+i)}:void 0,S.createElement(ue,{style:b},h.cloneElement(_,Object.assign({},j)))})},[a,i,n,x,r,e,o]),v=P(d,{[n]:!0,[`${n}-${x}`]:!0});return S.createElement("div",Object.assign({className:v,style:c,"aria-label":s["aria-label"]},M(m)),S.createElement(pe,{type:"flex",justify:"start"},g))};G.propTypes={prefixCls:p.string,className:p.string,style:p.object,current:p.number,initial:p.number,direction:p.oneOf(["horizontal","vertical"]),status:p.oneOf(["wait","process","finish","error","warning"])};G.defaultProps={prefixCls:F.PREFIX,current:0,direction:"horizontal",initial:0,status:"process"};var xe=function(s,e){var r={};for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&e.indexOf(a)<0&&(r[a]=s[a]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(s);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(s,a[n])&&(r[a[n]]=s[a[n]]);return r};const U=s=>{const{size:e,current:r,status:a,children:n,prefixCls:i,initial:x,direction:d,className:c,style:o,hasLine:m,onChange:g}=s,v=xe(s,["size","current","status","children","prefixCls","initial","direction","className","style","hasLine","onChange"]),f=h.useMemo(()=>{const u=h.Children.toArray(n).filter(w=>h.isValidElement(w));return h.Children.map(u,(w,k)=>{if(!w)return null;const j=x+k,E=Object.assign({stepNumber:`${j+1}`,size:e},w.props);return a==="error"&&k===r-1&&(E.className=`${i}-next-error`),w.props.status||(j===r?E.status=a:j<r?E.status="finish":E.status="wait"),E.active=j===r,E.done=j<r,E.onChange=g?()=>{k!==r&&g(k+x)}:void 0,h.cloneElement(w,Object.assign({},E))})},[n,x,i,d,a,r,e,g]),b=P(c,{[`${i}-basic`]:!0,[`${i}-${d}`]:!0,[`${i}-${e}`]:e!=="default",[`${i}-hasline`]:m});return S.createElement("div",Object.assign({"aria-label":s["aria-label"],className:b,style:o},M(v)),f)};U.propTypes={prefixCls:p.string,className:p.string,style:p.object,current:p.number,initial:p.number,direction:p.oneOf(["horizontal","vertical"]),status:p.oneOf(["wait","process","finish","error","warning"]),hasLine:p.bool};U.defaultProps={prefixCls:F.PREFIX,current:0,direction:"horizontal",size:"",initial:0,hasLine:!0,status:"process"};var be=function(s,e){var r={};for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&e.indexOf(a)<0&&(r[a]=s[a]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(s);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(s,a[n])&&(r[a[n]]=s[a[n]]);return r};const q=s=>{const{size:e,current:r,initial:a,children:n,prefixCls:i,className:x,style:d,onChange:c}=s,o=be(s,["size","current","initial","children","prefixCls","className","style","onChange"]),m=h.useMemo(()=>{const v=h.Children.toArray(n).filter(u=>h.isValidElement(u)),f=v.length;return h.Children.map(v,(u,_)=>{if(!u)return null;const w=Object.assign({index:_,total:f},u.props);return w.active=_===r,w.onChange=c?()=>{_!==r&&c(_+a)}:void 0,h.cloneElement(u,Object.assign({},w))})},[n,i,r,e,a,c]),g=P(x,{[`${i}-nav`]:!0,[`${i}-${e}`]:e!=="default"});return S.createElement("div",Object.assign({"aria-label":s["aria-label"],className:g,style:d},M(o)),m)};q.propTypes={prefixCls:p.string,className:p.string,style:p.object,current:p.number,initial:p.number,size:p.oneOf(["small","default"])};q.defaultProps={prefixCls:F.PREFIX,current:0,direction:"horizontal",size:"default",initial:0,status:"process"};var Se=function(s,e){var r={};for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&e.indexOf(a)<0&&(r[a]=s[a]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(s);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(s,a[n])&&(r[a[n]]=s[a[n]]);return r};class R extends h.Component{renderComponent(){const e=this.props,{type:r}=e,a=Se(e,["type"]);switch(r){case"fill":return S.createElement(G,Object.assign({},a));case"basic":return S.createElement(U,Object.assign({},a));case"nav":return S.createElement(q,Object.assign({},a));default:return null}}render(){const{type:e}=this.props;return S.createElement(se.Provider,{value:{type:e}},this.renderComponent())}}R.Step=he;R.propTypes={onChange:p.func,type:p.oneOf(["fill","basic","nav"]),size:p.oneOf(["small","default"])};R.defaultProps={type:"fill",size:"default"};const O={Idle:0,WasmPreparing:1,WasmPrepared:2,WasmSplitIssued:3,WasmSplitting:4,WasmSplitDone:5,WasmReadyToPrepare:6,WasmSplitPreparing:7,WasmPreparedSuccess:8,WasmCollecting:9,WasmUploadFail:-1,WasmDownloadFail:-2,WasmFileNotExist:-3,WasmSplitFail:-4,WasmSplitUpdateDBFail:-5,WasmSplitPrepareFail:-6,WasmPrepareFailed:-1};function ve({codeMd5:s,clientKey:e}){return N({url:"/game/wasm-split-config",method:"GET",data:{codeMd5:s,clientKey:e}})}function _e(s){const{codePath:e,codeMd5:r,clientKey:a,desc:n}=s;return N({url:"/game/wasm-prepare",method:"POST",data:{codePath:e,clientKey:a,codeMd5:r,desc:n}})}function Ce({codeMd5:s,clientKey:e}){return N({url:"/game/wasm-prepare-result",method:"POST",data:{codeMd5:s,clientKey:e}})}function je(s,e){const r=e?.intervalMs,a=e?.maxAttempts,n=e?.signal||new AbortController().signal;let i=0;return new Promise((x,d)=>{if(n?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const c=()=>{clearTimeout(o),d(new DOMException("Polling aborted","AbortError"))};n?.addEventListener("abort",c,{once:!0});let o;const m=async()=>{i+=1;try{const g=await Ce(s),{status:v}=g.data;if(v===O.WasmPreparedSuccess||v===O.WasmSplitDone){x(g);return}if(v<0){x(g);return}if(i>=a){d(new Error(`Polling timeout after ${a} attempts`));return}o=window.setTimeout(m,r)}catch(g){if(i>=a){d(g);return}o=window.setTimeout(m,r)}};m()})}function ye({codeMd5:s,clientKey:e,codePath:r}){return N({url:"/game/wasm-prepare-download",method:"POST",data:{codeMd5:s,clientKey:e,codePath:r}})}function ke(s){const{codeMd5:e,clientKey:r}=s;return N({url:"/game/wasm-split",method:"POST",data:{codeMd5:e,clientKey:r}})}function Ne({codeMd5:s,clientKey:e}){return N({url:"/game/wasm-split-result",method:"POST",data:{codeMd5:s,clientKey:e}})}function Ee(s,e){const r=e?.intervalMs,a=e?.maxAttempts,n=e?.signal||new AbortController().signal;let i=0;return new Promise((x,d)=>{if(n?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const c=()=>{clearTimeout(o),d(new DOMException("Polling aborted","AbortError"))};n?.addEventListener("abort",c,{once:!0});let o;const m=async()=>{i+=1;try{const g=await Ne(s),{status:v}=g.data;if(v!==O.WasmSplitDone){if(i>=a){d(new Error(`Polling timeout after ${a} attempts`));return}o=window.setTimeout(m,r);return}x(g)}catch(g){if(i>=a){d(g);return}o=window.setTimeout(m,r)}};m()})}function Pe({codeMd5:s,clientKey:e}){return N({url:"/game/wasm-split-download-result",method:"POST",data:{clientKey:e,codeMd5:s}})}function Oe(s){return N({url:"/game/wasm-split-download",method:"POST",data:s})}function ae(s){const{codeMd5:e,clientKey:r,codePath:a}=s;return N({url:"/game/wasm-split-reset",method:"POST",data:{codeMd5:e,clientKey:r,codePath:a}})}function $e({codeMd5:s,clientKey:e}){return N({url:"/game/wasm-taskinfo",method:"GET",data:{codeMd5:s,clientKey:e}})}function Re({codeMd5:s,clientKey:e}){return N({url:"/game/wasm-set-collect",method:"POST",data:{codeMd5:s,clientKey:e}})}function X(s){return N({url:"/game/wasm-collect-funcids",method:"GET",data:s})}function Te(s){return N({url:"/game/wasm-collect-info",method:"GET",data:s})}const D={container:"wasm-prepare-downloading-content",process:"wasm-prepare-downloading-text",success:"wasm-prepare-downloading-success",error:"wasm-prepare-downloading-error"},Fe=({kind:s,children:e})=>{const r={process:D.process,success:D.success,error:D.error};return t.jsx("div",{className:r[s],children:e})},Z={star_fetch_prepared_wasm_url:{kind:"process",text:"fetchDownloadUrl",showSpin:!0},fetch_prepared_wasm_url_done:{kind:"success",text:"fetchDownloadUrlSuccess",showSpin:!0},fetch_prepared_wasm_url_failed:{kind:"error",text:"fetchDownloadUrlFailed",appendError:!0},start_download_prepared_wasm:{kind:"process",text:"downloadPreparedWasmCode",showSpin:!0},download_prepared_wasm_done:{kind:"success",text:"downloadPreparedWasmCodeSuccess",showSpin:!0},download_prepared_wasm_failed:{kind:"error",text:"downloadPreparedWasmCodeFailed",appendError:!0,showRetry:!0},start_compress_prepared_wasm:{kind:"process",text:"compressPreparedWasmCode",showSpin:!0},compress_prepared_wasm_done:{kind:"success",text:"compressPreparedWasmCodeSuccess",showSpin:!0},start_write_compress_prepared_wasm:{kind:"process",text:"writeCompressPreparedWasmCode",showSpin:!0},start_update_wasm_split_config:{kind:"process",text:"updateWasmSplitConfig",showSpin:!0},update_wasm_split_config_done:{kind:"success",text:"updateWasmSplitConfigSuccess"},update_wasm_split_config_failed:{kind:"error",text:"updateWasmSplitConfigFailed",appendError:!0},default:{kind:"process",text:"processing",showSpin:!0}},We=({onCancel:s,onRetry:e,onHide:r})=>{const[a,n]=h.useState(""),[i,x]=h.useState("");h.useEffect(()=>{const m=g=>{n(g.status),x(g.errorMsg||"")};return z.on("unitySplitStatus",m),()=>{z.off("unitySplitStatus",m)}},[]);const d=h.useMemo(()=>Z[a]??Z.default,[a]),c=t.jsx($,{size:"large",color:"primary"}),o=typeof d.text=="string"?l(d.text)??d.text:"";return t.jsxs("div",{className:D.container,children:[d.showSpin&&c,!!o&&t.jsx(Fe,{kind:d.kind,children:o}),d.appendError&&!!i&&t.jsx("div",{className:D.error,children:i}),d.showRetry&&t.jsx(C,{onClick:e,children:l("retryDownload")}),t.jsx(C,{style:{marginTop:12},type:"tertiary",onClick:r,children:l("backgroundRun")})]})},De=({onSubmit:s,onCancel:e,onChange:r})=>t.jsxs(H,{style:{width:"100%",transform:"translateY(-20px)"},onChange:r,onSubmit:s,children:[t.jsx(H.TextArea,{rules:[{required:!0,message:l("inputSplitDesc")}],label:l("splitDesc"),placeholder:l("inputSplitDesc"),field:"desc"}),t.jsxs("div",{className:"wasm-prepare-form-button-container",children:[t.jsx(C,{type:"tertiary",htmlType:"submit",style:{marginRight:12},children:l("startPrepare")}),t.jsx(C,{type:"tertiary",onClick:e,children:l("cancel")})]})]}),y={init:"init",start:"start",processing:O.WasmPreparing,processingReady:O.WasmReadyToPrepare,success:O.WasmPreparedSuccess,failed:O.WasmPrepareFailed,splitDone:O.WasmSplitDone,downloading:"downloading",downloadFailed:"downloadFailed"},Q=new AbortController,Ie=({codePath:s,codeMd5:e,clientKey:r,onCancel:a,onNext:n,onHide:i})=>{const[x,d]=h.useState(""),[c,o]=h.useState({code:0,data:{status:y.init}}),m=h.useMemo(()=>c?.data?.status,[c?.data?.status]),g=()=>{Q.abort(),a(),ae({codeMd5:e,clientKey:r,codePath:s}).then(w=>{w.code===0&&o({...c,data:{...c?.data,status:y.init}})})},v=()=>{o({code:0,data:{status:y.start}}),_e({codePath:s,codeMd5:e,clientKey:r,desc:x}).then(w=>{w.code===0||w?.error?.code===10024||w?.error?.code===10028?(o({...w,data:{...w?.data,status:y.processing}}),f()):o({...c,error:w?.error||{code:-1,message:"Internal server error, please try again later..."},data:{...c?.data,status:y.failed}})})},f=()=>{je({codeMd5:e,clientKey:r},{intervalMs:500,maxAttempts:100,signal:Q.signal}).then(w=>{w.code===0?o(w):o({...c,data:{...c?.data}})})},b=()=>{o({...c,data:{...c?.data,status:"downloading"}}),ye({codePath:s,codeMd5:e,clientKey:r}).then(w=>{w.code===0?(o({...c,data:{...c?.data,status:y.success}}),n()):o({...c,data:{...c?.data,status:y.downloadFailed}})})},u=w=>{d(w?.values?.desc)};let _=null;switch(m){case y.init:_=t.jsx(De,{onSubmit:v,onCancel:a,onChange:u});break;case y.start:_=t.jsxs("div",{className:"wasm-prepare-processing-content",children:[t.jsx($,{size:"large",color:"primary"}),t.jsx("div",{className:"wasm-prepare-processing-text",children:l("startingPrepare")}),t.jsx("div",{className:"wasm-prepare-processing-cancel",children:t.jsxs(T,{children:[t.jsx(C,{type:"danger",onClick:a,children:l("cancelPrepare")}),t.jsx(C,{onClick:()=>i(),children:l("backgroundRun")})]})})]});break;case y.processing:case y.processingReady:_=t.jsxs("div",{className:"wasm-prepare-processing-content",children:[t.jsx($,{size:"large",color:"primary"}),t.jsx("div",{className:"wasm-prepare-processing-text",children:l("preparingSplit")}),t.jsx("div",{className:"wasm-prepare-processing-warning",children:l("warningDuringPreparing")}),t.jsx("div",{className:"wasm-prepare-processing-cancel",children:t.jsxs(T,{children:[t.jsx(C,{type:"tertiary",onClick:()=>{g()},children:l("cancelPrepare")}),t.jsx(C,{type:"tertiary",onClick:()=>i(),children:l("backgroundRun")})]})})]});break;case y.success:case y.splitDone:_=t.jsxs("div",{className:"wasm-prepare-success-content",children:[t.jsx("div",{className:"wasm-prepare-success-text",children:l("preparingSplitSuccess")}),t.jsx("div",{className:"wasm-prepare-success-download",children:t.jsx(C,{type:"tertiary",onClick:()=>{b()},children:l("downloadPreparedWasmCode")})})]});break;case y.downloading:_=t.jsx(We,{onHide:i});break;case y.downloadFailed:const w=c?.error?.message||"Unknown error";_=t.jsxs("div",{className:"wasm-prepare-downloadfailed-content",children:[t.jsx("div",{className:"wasm-prepare-downloadfailed-text",children:l("downloadFailed")}),t.jsx("div",{className:"wasm-prepare-downloadfailed-warning",children:w}),t.jsx(C,{onClick:b,children:l("retryDownload")})]});break;case y.failed:const k=c?.error?.message||"Unknown error";_=t.jsxs("div",{className:"wasm-prepare-failed-content",children:[t.jsx("div",{className:"wasm-prepare-failed-text",children:l("preparingSplitFailed")}),c?.data?.status===y.failed&&t.jsx("div",{className:"wasm-prepare-failed-warning",children:k}),t.jsx(C,{type:"tertiary",style:{marginTop:12},onClick:v,children:l("retryPrepare")})]});break;default:_=null}return t.jsx("div",{className:"wasm-prepare-content-container",children:_})},ze=({data:s})=>{const e={...s||{}},r=[{label:"Client key",value:"app_id"},{label:l("wasmSize"),value:"wasm_size",render:a=>`${(a/1024/1024).toFixed(2)} MB`},{label:l("totalFuncCount"),value:"total_wasm_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:l("collectedFuncCount"),value:"collected_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:"Wasm md5",value:"wasm_md5"}];return t.jsx("div",{className:"wasm-collect-status",children:r.map(a=>t.jsxs("div",{className:"wasm-collect-status-item",children:[t.jsx(le,{size:"small",className:"wasm-collect-status-item-label",children:a.label}),t.jsx("span",{className:"wasm-collect-status-item-value",children:a.render?.(e[a.value])||e[a.value]})]},a.value))})},Me=({onNext:s,codeMd5:e,clientKey:r,onHide:a})=>{const{state:{devSchema:n}}=ie(),[i,x]=h.useState("willCollect"),[d,c]=h.useState(),[o,m]=h.useState(),[g,v]=h.useState(0),f=h.useRef(null),b=h.useMemo(()=>!o||!o?.total_wasm_func_count?!1:(g||0)/(o?.total_wasm_func_count||0)>=.08,[o,g]);h.useEffect(()=>{if(i!=="collecting"){f.current&&(window.clearInterval(f.current),f.current=null);return}if(!f.current)return X({codeMd5:e,clientKey:r}).then(w=>{v(w.data?.collected_func_count||0)}).catch(console.error),f.current=window.setInterval(()=>{X({codeMd5:e,clientKey:r}).then(w=>{v(w.data?.collected_func_count||0)}).catch(w=>{console.error(w)})},2e3),()=>{f.current&&(window.clearInterval(f.current),f.current=null)}},[i,e,r]);const u=async()=>{if(i!=="collecting")try{x("startCollect");const w=await Re({codeMd5:e,clientKey:r});x("collecting"),$e({codeMd5:e,clientKey:r}).then(k=>{c(k.data)}).catch(console.error),Te({codeMd5:e,clientKey:r}).then(k=>{m(k.data||{})}).catch(console.error)}catch(w){console.error(w)}},_=()=>{f.current&&(window.clearInterval(f.current),f.current=null),x("willCollect"),s()};return t.jsxs("div",{className:"wasm-collect-content-container",children:[d&&t.jsx(ze,{data:{...d||{},total_wasm_func_count:o?.total_wasm_func_count,collected_func_count:g}}),t.jsx("div",{className:"collect-qrcode-container",children:t.jsx(oe,{value:n})}),t.jsx("div",{className:"collect-qrcode-desc",children:l("collectDesc")}),t.jsxs("div",{className:"collect-qrcode-button-container",children:[i!=="collecting"&&t.jsx(C,{loading:i==="startCollect",onClick:u,children:l("startCollect")}),i==="collecting"&&t.jsxs(T,{children:[b?t.jsx(C,{type:"tertiary",onClick:_,children:l("startSplit")}):t.jsx(ce,{content:l("cannotSplitTip"),children:t.jsx(C,{type:"tertiary",disabled:!0,children:l("startSplit")})}),t.jsx(C,{type:"tertiary",onClick:a,children:l("backgroundRun")})]})]})]})},K=({onCancel:s,onRetry:e,onHide:r,forcedStatus:a,forcedErrorMsg:n})=>{const[i,x]=h.useState(""),[d,c]=h.useState("");h.useEffect(()=>{const b=u=>{x(u.status),c(u.errorMsg||"")};return z.on("unitySplitStatus",b),()=>{z.off("unitySplitStatus",b)}},[]);const o="wasm-split-downloading-content",m="wasm-split-downloading-text",g=a||i,v=n||d;let f=null;switch(g){case"start_download_android_main_wasm":case"download_android_main_wasm_done":case"start_compress_android_main_wasm":case"compress_android_main_wasm_done":case"start_download_android_sub_wasm_code":case"download_android_sub_wasm_code_done":case"start_compress_android_sub_wasm_code":case"compress_android_sub_wasm_code_done":case"start_download_ios_main_wasm":case"download_ios_main_wasm_done":case"start_compress_ios_main_wasm":case"compress_ios_main_wasm_done":case"start_download_ios_range_json":case"download_ios_range_json_done":case"start_download_ios_js_data_br":case"download_ios_js_data_br_done":case"start_compress_ios_sub_wasm_code":case"compress_ios_sub_wasm_code_done":case"start_write_splited_wasm_br":case"write_splited_wasm_done":case"start_update_wasm_split_config":case"update_wasm_split_config_done":f=t.jsxs("div",{className:o,children:[t.jsx($,{size:"large",color:"primary"}),t.jsx("div",{className:m,children:l(g)}),t.jsxs(T,{children:[t.jsx(C,{type:"danger",onClick:s,children:l("cancelSplit")}),t.jsx(C,{onClick:r,children:l("backgroundRun")})]})]});break;case"wasm_split_failed":f=t.jsxs("div",{className:o,children:[t.jsx("div",{className:m,children:l("downloadSplitResultFailed")}),v?t.jsx("div",{className:m,children:v}):null,t.jsxs(T,{children:[t.jsx(C,{type:"primary",onClick:e,children:l("retryDownloadSplitResult")}),t.jsx(C,{type:"danger",onClick:s,children:l("cancelSplit")}),t.jsx(C,{onClick:r,children:l("backgroundRun")})]})]});break;default:f=t.jsxs("div",{className:o,children:[t.jsx($,{size:"large",color:"primary"}),t.jsx("div",{className:m,children:l("processing")})]})}return f},Y=new AbortController,Ae=({onCancel:s,onHide:e,codeMd5:r,clientKey:a})=>{const[n,i]=h.useState("spliting"),[x,d]=h.useState(),[c,o]=h.useState(""),m=()=>{Y.abort(),s()},g=()=>{o(""),i("downloadingSplitResult"),Oe(x?.result).then(u=>{u.code===0?i("downloadSuccess"):(o(u?.error?.errorMsg||u?.msg||l("downloadSplitResultFailed")),i("downloadFailed"))}).catch(u=>{o(u?.message||l("downloadSplitResultFailed")),i("downloadFailed")})},v=()=>{i("spliting"),ke({codeMd5:r,clientKey:a}).then(u=>{u.code===0&&Ee({codeMd5:r,clientKey:a},{intervalMs:1e3,maxAttempts:1e3,signal:Y.signal}).then(_=>{i("splitSuccess"),f()})}).catch(()=>{i("splitFailed")})},f=()=>{i("startGetSplitResult"),Pe({clientKey:a,codeMd5:r}).then(u=>{u.code===0?(d(u.data),i("getSplitResultSuccess")):i("getSplitResultFailed")})};h.useEffect(()=>{v()},[]);let b=null;switch(n){case"spliting":b=t.jsxs("div",{className:"wasm-split-processing",children:[t.jsx($,{size:"large",color:"primary"}),t.jsx("div",{className:"wasm-split-processing-content",children:l("splittingDesc")}),t.jsx("div",{className:"wasm-split-processing-cancel",children:t.jsxs(T,{children:[t.jsx(C,{onClick:()=>m(),type:"danger",children:l("cancelSplit")}),t.jsx(C,{onClick:()=>e(),children:l("backgroundRun")})]})})]});break;case"splitSuccess":b=t.jsx("div",{className:"wasm-split-success",children:t.jsx("div",{className:"wasm-split-success-content",children:l("getSplitResult")})});break;case"startGetSplitResult":b=t.jsxs("div",{className:"wasm-split-processing",children:[t.jsx($,{}),t.jsx("div",{className:"wasm-split-processing-content",children:l("getSplitResult")})]});break;case"getSplitResultFailed":b=t.jsxs("div",{className:"wasm-split-failed",children:[t.jsx("div",{className:"wasm-split-failed-content",children:l("getSplitResultFailed")}),t.jsx("div",{className:"wasm-split-failed-retry",children:t.jsx(C,{type:"primary",onClick:()=>f(),children:l("retryGetSplitResult")})})]});break;case"getSplitResultSuccess":b=t.jsxs("div",{className:"wasm-split-success",children:[t.jsx("div",{className:"wasm-split-success-content",children:l("splitSuccess")}),t.jsx("div",{className:"wasm-split-success-download",children:t.jsx(C,{type:"primary",onClick:()=>g(),children:l("downloadSplitResult")})})]});break;case"getDownloadResultFailed":b=t.jsxs("div",{className:"wasm-split-failed",children:[t.jsx("div",{className:"wasm-split-failed-content",children:l("getSplitResultFailed")}),t.jsx("div",{className:"wasm-split-failed-retry",children:t.jsx(C,{type:"primary",onClick:()=>f(),children:l("retryGetSplitResult")})})]});break;case"downloadingSplitResult":b=t.jsx(K,{onCancel:m,onRetry:g,onHide:e});break;case"downloadFailed":b=t.jsx(K,{onCancel:m,onRetry:g,onHide:e,forcedStatus:"wasm_split_failed",forcedErrorMsg:c});break;case"downloadSuccess":b=t.jsxs("div",{className:"wasm-split-success",children:[t.jsx("div",{className:"wasm-split-success-content",children:l("downloadSplitResultSuccess")}),t.jsx("div",{className:"wasm-split-success-tip",children:l("downloadSplitResultTip")})]});break;default:b=null}return t.jsx("div",{className:"wasm-split-content-container",children:b})},I={prepare:{number:0,title:l("splitPrepare")},collect:{number:1,title:l("splitCollect")},split:{number:2,title:l("splitCode")},rollback:{number:3,title:l("rollback")}},Be=({stage:s})=>t.jsxs(R,{type:"basic",current:I[s].number,style:{marginTop:24},children:[t.jsx(R.Step,{title:I.prepare.title}),t.jsx(R.Step,{title:I.collect.title}),t.jsx(R.Step,{title:I.split.title})]}),Ve=({onCancel:s,errorType:e,onHide:r})=>t.jsxs("div",{className:"wasm-code-split-error",children:[e==="noWasmCode"&&t.jsxs("div",{className:"wasm-code-split-error-container",children:[t.jsx("div",{className:"wasm-code-split-error-title",children:l("noWasmCode")}),t.jsx("div",{className:"wasm-code-split-error-desc",children:l("noWasmCodeDesc")})]}),e==="hasSplited"&&t.jsxs("div",{className:"wasm-code-split-error-container",children:[t.jsx("div",{className:"wasm-code-split-error-title",children:l("hasSplitedTitle")}),t.jsx("div",{className:"wasm-code-split-error-desc",children:l("hasSplitedDesc")}),t.jsxs(T,{children:[t.jsx(C,{onClick:s,children:l("cancelSplit")}),t.jsx(C,{onClick:r,children:l("backgroundRun")})]})]}),e==="noSplitConfig"&&t.jsxs("div",{className:"wasm-code-split-error-container",children:[t.jsx("div",{className:"wasm-code-split-error-title",children:l("noSplitConfigTitle")}),t.jsx("div",{className:"wasm-code-split-error-desc",children:l("noSplitConfigDesc")})]})]}),Ge=()=>t.jsxs("div",{className:"split-loading",children:[t.jsx($,{size:"large",color:"primary"}),t.jsx("div",{className:"split-loading-text",children:"正在初始化分包环境"})]}),Ue=({codeMd5:s,clientKey:e,codePath:r,onHide:a,onReset:n})=>{const[i,x]=h.useState("rollbacking"),d=()=>{x("rollbacking"),ae({codeMd5:s,clientKey:e,codePath:r}).then(m=>{m.code===0?(x("rollbackSuccess"),n()):x("rollbackFailed")})};h.useEffect(()=>{d()},[]);let c="",o=null;switch(i){case"rollbacking":c="回滚中...",o=t.jsx(C,{onClick:()=>{x("rollbackFailed")},children:"后台进行"});break;case"rollbackSuccess":c="回滚成功",o=t.jsx(C,{onClick:()=>{a()},children:"关闭"});break;case"rollbackFailed":c="回滚失败",o=t.jsx(C,{onClick:()=>{d()},children:"重试"});break}return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"wasm-split-rollback-container",children:[t.jsx("div",{className:"wasm-split-rollback-text",children:c}),o]})})};function qe({enableWasmCollect:s,enableWasmSplit:e}){return typeof s=="boolean"&&(typeof e=="string"||e===!1)?s:!1}function Le({enableWasmSplit:s,hasWasmCode:e}){return s===!0?{errorType:"hasSplited",hasError:!0}:e?{hasError:!1}:{errorType:"noWasmCode",hasError:!0}}const Ke=({codePath:s,clientKey:e,codeMd5:r})=>{const[a,n]=h.useState(!1),[i,x]=h.useState(""),[d,c]=h.useState("loading"),[o,m]=h.useState(null),g=()=>{n(!0),(!o||d==="error")&&(c("loading"),ve({codeMd5:r,clientKey:e}).then(b=>{if(b.code===0){const{errorType:u,hasError:_}=Le({enableWasmSplit:b.data.enableWasmSplit,hasWasmCode:!!s});x(u),_?(x(u),c("error")):qe(b.data)?c("collect"):c("prepare"),m(b.data)}else c("error")}))},v=()=>{n(!1)},f=()=>{c("rollback")};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:P("wasm-code-split",{}),onClick:g,children:[t.jsx(we,{size:"default"}),t.jsx("span",{className:"wasm-code-split-text",children:l("wasmSplit")})]}),t.jsxs(de,{centered:!0,keepDOM:!0,maskClosable:!1,visible:a,footer:null,style:{width:"90%"},onCancel:()=>n(!1),onOk:()=>n(!1),title:l("wasmSplit"),children:[d==="loading"&&t.jsx(Ge,{}),d==="error"&&t.jsx(Ve,{errorType:i,onCancel:f,onHide:v}),d!=="error"&&d!=="loading"&&t.jsx(Be,{stage:d}),d==="prepare"&&t.jsx(Ie,{codeMd5:r,codePath:s,clientKey:e,onCancel:()=>{n(!1)},onNext:()=>{c("collect")},onHide:v}),d==="collect"&&t.jsx(Me,{codeMd5:r,clientKey:e,onCancel:()=>{n(!1),c("prepare")},onHide:v,onNext:()=>{c("split")}}),d==="split"&&t.jsx(Ae,{codeMd5:r,clientKey:e,onCancel:f,onHide:v}),d==="rollback"&&t.jsx(Ue,{codeMd5:r,clientKey:e,codePath:s,onHide:v,onReset:()=>{c("prepare")}})]})]})};export{Ke as WasmCodeSplit};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a=[{key:"login",icon:"🔐",titleKey:"ia.menu.login",summaryKey:"ia.login.summary",sceneKey:"scene_scan_qrcode",apiTags:["tt.login","auth_code","user.info.open_id"],highlightKeys:["ia.login.highlight1","ia.login.highlight2"],prerequisiteKeys:["ia.login.prerequisite1","ia.login.prerequisite2"],stepKeys:["ia.login.step1","ia.login.step2","ia.login.step3"],tipKeys:["ia.login.tip1","ia.login.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/CG6wdxffcouMY3xIqQTlDEyWgBe?302from=wiki",target:"_blank",theme:"solid"}]},{key:"authorize",icon:"🛂",titleKey:"ia.menu.authorize",summaryKey:"ia.authorize.summary",sceneKey:"scene_scan_qrcode",apiTags:["tt.authorize","user.info.basic","access_token"],highlightKeys:["ia.authorize.highlight1","ia.authorize.highlight2"],prerequisiteKeys:["ia.authorize.prerequisite1","ia.authorize.prerequisite2"],stepKeys:["ia.authorize.step1","ia.authorize.step2","ia.authorize.step3"],tipKeys:["ia.authorize.tip1","ia.authorize.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/CewRdCPcCoxcKFxBTftlRXnSgOc",target:"_blank",theme:"solid"},{labelKey:"ia.action.goProjectDetail",type:"route",path:"/project_overview"}]},{key:"payment",icon:"💳",titleKey:"ia.menu.payment",summaryKey:"ia.payment.summary",sceneKey:"scene_scan_qrcode",apiTags:["IAP Mock","TikTok Beans","order verify"],highlightKeys:["ia.payment.highlight1","ia.payment.highlight2"],prerequisiteKeys:["ia.payment.prerequisite1","ia.payment.prerequisite2"],stepKeys:["ia.payment.step1","ia.payment.step2","ia.payment.step3"],tipKeys:["ia.payment.tip1","ia.payment.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/MYsLdpeGGoulzDxZ6VelG8Gggoe?302from=wiki",target:"_blank",theme:"solid"},{labelKey:"ia.action.goPrecheck",type:"route",path:"/upload_publish"}]},{key:"ad",icon:"📺",titleKey:"ia.menu.ad",summaryKey:"ia.ad.summary",sceneKey:"scene_ad",apiTags:["createRewardedVideoAd","createInterstitialAd","placement id"],highlightKeys:["ia.ad.highlight1","ia.ad.highlight2"],prerequisiteKeys:["ia.ad.prerequisite1","ia.ad.prerequisite2"],stepKeys:["ia.ad.step1","ia.ad.step2","ia.ad.step3"],tipKeys:["ia.ad.tip1","ia.ad.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/wiki/JTEiw409LiLkUSk2SltcsAqonkg",target:"_blank",theme:"solid"},{labelKey:"ia.action.goPrecheck",type:"route",path:"/upload_publish"}]},{key:"ui_adaptation",icon:"📱",titleKey:"ia.menu.uiAdaptation",summaryKey:"ia.uiAdaptation.summary",apiTags:["safeArea","screen adaptation","capsule button"],highlightKeys:["ia.uiAdaptation.highlight1","ia.uiAdaptation.highlight2"],prerequisiteKeys:["ia.uiAdaptation.prerequisite1","ia.uiAdaptation.prerequisite2"],stepKeys:["ia.uiAdaptation.step1","ia.uiAdaptation.step2","ia.uiAdaptation.step3"],tipKeys:["ia.uiAdaptation.tip1","ia.uiAdaptation.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/docx/Zes2dVS3ooIm55x67OhcXTxWnud",target:"_blank",theme:"solid"}]},{key:"share_message",icon:"🔗",titleKey:"ia.menu.shareMessage",summaryKey:"ia.shareMessage.summary",apiTags:["shareAppMessage","query","game basic info"],highlightKeys:["ia.shareMessage.highlight1","ia.shareMessage.highlight2"],prerequisiteKeys:["ia.shareMessage.prerequisite1","ia.shareMessage.prerequisite2"],stepKeys:["ia.shareMessage.step1","ia.shareMessage.step2","ia.shareMessage.step3"],tipKeys:["ia.shareMessage.tip1","ia.shareMessage.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/CesGdxcyJorqE1xIuf3lAXEhguh",target:"_blank",theme:"solid"}]},{key:"share_story",icon:"📣",titleKey:"ia.menu.shareStory",summaryKey:"ia.shareStory.summary",hidden:!0,apiTags:["shareToStory","query","story asset"],highlightKeys:["ia.shareStory.highlight1","ia.shareStory.highlight2"],prerequisiteKeys:["ia.shareStory.prerequisite1","ia.shareStory.prerequisite2"],stepKeys:["ia.shareStory.step1","ia.shareStory.step2","ia.shareStory.step3"],tipKeys:["ia.shareStory.tip1","ia.shareStory.tip2"],actions:[]},{key:"subpackage",icon:"📦",titleKey:"ia.menu.subpackage",summaryKey:"ia.subpackage.summary",apiTags:["preDownloadSubpackage","loadSubpackage","loadSubpackageSync"],highlightKeys:["ia.subpackage.highlight1","ia.subpackage.highlight2"],prerequisiteKeys:["ia.subpackage.prerequisite1","ia.subpackage.prerequisite2"],stepKeys:["ia.subpackage.step1","ia.subpackage.step2","ia.subpackage.step3"],tipKeys:["ia.subpackage.tip1","ia.subpackage.tip2"],actions:[]},{key:"network",icon:"🌐",titleKey:"ia.menu.network",summaryKey:"ia.network.summary",apiTags:["request","downloadFile","connectSocket"],highlightKeys:["ia.network.highlight1","ia.network.highlight2"],prerequisiteKeys:["ia.network.prerequisite1","ia.network.prerequisite2"],stepKeys:["ia.network.step1","ia.network.step2","ia.network.step3"],tipKeys:["ia.network.tip1","ia.network.tip2"],actions:[]},{key:"sidebar_revisit",icon:"🧭",titleKey:"ia.menu.sidebarRevisit",summaryKey:"ia.sidebar.summary",sceneKey:"scene_center",apiTags:["startEntranceMission","getEntranceMissionReward","canIUse"],highlightKeys:["ia.sidebar.highlight1","ia.sidebar.highlight2"],prerequisiteKeys:["ia.sidebar.prerequisite1","ia.sidebar.prerequisite2"],stepKeys:["ia.sidebar.step1","ia.sidebar.step2","ia.sidebar.step3"],tipKeys:["ia.sidebar.tip1","ia.sidebar.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/wiki/Pl9Jwg8ujiZp6ckhhQzcujujnfb",target:"_blank",theme:"solid"},{labelKey:"ia.action.goLaunchMode",type:"route",path:"/launch_mode"}]},{key:"shortcut_revisit",icon:"📌",titleKey:"ia.menu.shortcutRevisit",summaryKey:"ia.shortcut.summary",sceneKey:"scene_shortcut",apiTags:["addShortcut","getShortcutMissionReward","canIUse"],highlightKeys:["ia.shortcut.highlight1","ia.shortcut.highlight2"],prerequisiteKeys:["ia.shortcut.prerequisite1","ia.shortcut.prerequisite2"],stepKeys:["ia.shortcut.step1","ia.shortcut.step2","ia.shortcut.step3"],tipKeys:["ia.shortcut.tip1","ia.shortcut.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/wiki/AW4JwueaXiiKtTkK0c9cIo4lnud",target:"_blank",theme:"solid"},{labelKey:"ia.action.goLaunchMode",type:"route",path:"/launch_mode"}]},{key:"direct_play_card",icon:"🎯",titleKey:"ia.menu.directPlayCard",summaryKey:"ia.directPlay.summary",sceneKey:"scene_fyf_promotion_direct_feed_play",apiTags:["Play now","For You Feed","revisit"],highlightKeys:["ia.directPlay.highlight1","ia.directPlay.highlight2"],prerequisiteKeys:["ia.directPlay.prerequisite1","ia.directPlay.prerequisite2"],stepKeys:["ia.directPlay.step1","ia.directPlay.step2","ia.directPlay.step3"],tipKeys:["ia.directPlay.tip1","ia.directPlay.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/VZ3odoD8DoSxFXxANh5lLxVMgPx",target:"_blank",theme:"solid"}]}],t=a.reduce((e,i)=>(e[i.key]=i,e),{});export{t as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,B as V,i as a,r as n,x as U,T as r,y as E,a as A,u as Ee,c as Me,z as Be,g as $e,b as w,e as L,A as q,D as Oe,E as Ke,Q as qe,d as P}from"./index-07cXGo3a.js";import{F as xe}from"./baseForm-d3x5z6BS.js";import{C as je}from"./times-BvsrZcqF.js";import"./index-BZOItUfZ.js";const Ve="https://bytedance.larkoffice.com/wiki/LkihwQCMfiBpr3khwNuceCBkn3e";function He(p){return String(p).replace(/^\s*\d+\s*[\.、]\s*/,"")}const Qe=({engine:p})=>e.jsx("div",{children:[{show:!0,titleKey:"pkgSizeCheckDesc",desc:e.jsxs("div",{children:[e.jsx("span",{children:p==="unity"?a("unityPkgSizeCheckDescTip",{projectSize:"60MB"}):a("commonPkgSizeCheckDescTip",{projectSize:"30MB",mainPackageSize:"4MB",independentPackageSize:"4MB"})}),e.jsx("a",{className:"check-code-banner-doc-link",href:Ve,target:"_blank",rel:"noreferrer",children:a("uploadGame.packageSizeDoc")})]})},{show:p!=="unity",titleKey:"mandatoryApiCheck",desc:a("mandatoryApiCheckDesc")},{show:!0,titleKey:"configFileCheck",desc:e.jsxs("div",{children:[e.jsx("code",{children:"game.json"}),":",a("gameJsonCheckDesc")]})}].filter(d=>d.show).map((d,h,t)=>e.jsxs("div",{style:{marginBottom:h===t.length-1?0:8},children:[e.jsx("strong",{className:"check-code-banner-section-title",children:`${h+1}. ${He(a(d.titleKey))}`}),e.jsx("div",{className:"check-code-banner-section-desc",children:d.desc})]},d.titleKey))}),Je=({engine:p})=>e.jsx(V,{style:{marginBottom:32},fullMode:!1,icon:null,closeIcon:null,description:e.jsx(Qe,{engine:p}),type:"info"}),Ze=p=>{const{result:d}=p,h=d.every(o=>o?.passed),[t,c]=n.useState(!1);return e.jsxs("div",{className:"check-result-group",children:[h?e.jsxs("div",{className:"check-result-title",children:[e.jsx(U,{style:{color:"#4CAF50",marginRight:4,fontSize:20}}),e.jsx(r.Text,{style:{color:"#4CAF50",fontSize:20},children:a("checkConfigPassed")})]}):e.jsxs("div",{className:"check-result-title",children:[e.jsx(E,{style:{color:"#F44336",marginRight:4}}),e.jsx(r.Text,{style:{color:"#F44336",fontSize:20},children:a("checkConfigFailed")})]}),e.jsxs("div",{style:{paddingBottom:24,position:"relative"},children:[e.jsx(je,{style:{marginBottom:12},collapseHeight:150,isOpen:t,children:d.map((o,f)=>e.jsxs("div",{className:"check-result-item",children:[e.jsx(A,{color:o?.passed?"green":"red",style:{marginRight:8,flexShrink:0},children:o?.file}),e.jsx(r.Text,{style:{fontSize:14,color:o?.passed?"rgba(0, 0, 0, 0.65)":"red"},children:o?.msg}),o?.detail?.link?e.jsx("a",{href:o.detail.link,target:"_blank",rel:"noreferrer",style:{marginLeft:8,fontSize:12,color:"#1765ff"},children:o.detail.text||a("viewDoc")}):null]},f))}),t?e.jsx(r.Text,{style:{color:"grey",cursor:"pointer",fontSize:14,width:"100%",display:"block",alignItems:"center",justifyContent:"center",textAlign:"center"},onClick:()=>c(!1),children:a("closeCheckDetail")}):e.jsx(r.Text,{style:{color:"grey"},className:"show-more-text-btn",onClick:()=>c(!0),children:a("expandCheckDetail")})]})]})},We={project:a("gameProject"),main_package:a("gameMainPackage"),independent_package:a("independentPackage")},Xe=p=>{const{result:d}=p,h=d.every(t=>t?.passed);return e.jsxs("div",{className:"check-result-group",children:[h?e.jsxs("div",{className:"check-result-title",children:[e.jsx(U,{style:{color:"#4CAF50",marginRight:4,fontSize:20}}),e.jsx(r.Text,{style:{color:"#4CAF50",fontSize:20},children:a("checkPkgSizePassed")})]}):e.jsxs("div",{className:"check-result-title",children:[e.jsx(E,{style:{color:"#F44336",marginRight:4,fontSize:20}}),e.jsx(r.Text,{style:{color:"#F44336",fontSize:20},children:a("checkPkgSizeFailed")})]}),d.map((t,c)=>e.jsxs("div",{className:"check-result-item",children:[e.jsxs(A,{color:t?.passed?"green":"red",style:{marginRight:8},children:[We[t.dimension],t.dimension==="independent_package"?`: ${t.name}`:""]}),e.jsx(r.Text,{style:{fontSize:14,color:t?.passed?"rgba(0, 0, 0, 0.65)":"red"},children:t?.msg}),t?.detail?.link?e.jsx("a",{href:t.detail.link,target:"_blank",rel:"noreferrer",style:{marginLeft:8,fontSize:12,color:"#1765ff"},children:t.detail.text||a("viewDoc")}):null]},c))]})},Ye=p=>{const{result:d}=p;if(!Array.isArray(d)||d.length===0)return null;const h=d.every(o=>o?.passed),[t,c]=n.useState(!1);return e.jsxs("div",{className:"check-result-group",children:[h?e.jsxs("div",{className:"check-result-title",children:[e.jsx(U,{style:{color:"#4CAF50",marginRight:4,fontSize:20}}),e.jsx(r.Text,{style:{color:"#4CAF50",fontSize:20},children:a("checkApiSuccess")})]}):e.jsxs("div",{className:"check-result-title",children:[e.jsx(E,{style:{color:"#F44336",marginRight:4}}),e.jsx(r.Text,{style:{color:"#F44336",fontSize:20},children:a("checkApiFailed")})]}),e.jsxs("div",{style:{position:"relative"},children:[e.jsx(je,{style:{marginBottom:12},collapseHeight:150,isOpen:t,children:d.map((o,f)=>e.jsxs("div",{className:"check-result-item",children:[e.jsx(A,{color:o?.passed?"green":"red",style:{marginRight:8,flexShrink:0},children:o?.name}),e.jsxs(r.Text,{style:{fontSize:14,color:o?.passed?"rgba(0, 0, 0, 0.65)":"red"},children:[a(o?.name),o?.passed?a("integrated"):a("notIntegrated")]}),o?.detail?.link?e.jsx("a",{href:o.detail.link,target:"_blank",rel:"noreferrer",style:{marginLeft:8,fontSize:12,color:"#1765ff"},children:o.detail.text||a("viewDoc")}):null]},f))}),t?e.jsx(r.Text,{style:{color:"grey",cursor:"pointer",fontSize:14,width:"100%",display:"block",alignItems:"center",justifyContent:"center",textAlign:"center"},onClick:()=>c(!1),children:a("closeCheckDetail")}):e.jsx(r.Text,{style:{color:"grey"},className:"show-more-text-btn",onClick:()=>c(!0),children:a("expandCheckDetail")})]})]})},es=p=>{const{result:d}=p;if(!Array.isArray(d)||d.length===0)return null;const h=d.every(t=>t?.passed);return e.jsxs("div",{className:"check-result-group",children:[h?e.jsxs("div",{className:"check-result-title",children:[e.jsx(U,{style:{color:"#4CAF50",marginRight:4,fontSize:20}}),e.jsx(r.Text,{style:{color:"#4CAF50",fontSize:20},children:a("checkPerformancePassed")})]}):e.jsxs("div",{className:"check-result-title",children:[e.jsx(E,{style:{color:"#F44336",marginRight:4,fontSize:20}}),e.jsx(r.Text,{style:{color:"#F44336",fontSize:20},children:a("checkPerformanceFailed")})]}),d.map((t,c)=>e.jsxs("div",{className:"check-result-item",children:[e.jsx(A,{color:t?.passed?"green":"red",style:{marginRight:8,flexShrink:0},children:a("performanceCheck")}),e.jsx(r.Text,{style:{fontSize:14,color:t?.passed?"rgba(0, 0, 0, 0.65)":"red"},children:t?.msg}),t?.detail?.link?e.jsx("a",{href:t.detail.link,target:"_blank",rel:"noreferrer",style:{marginLeft:8,fontSize:12,color:"#1765ff"},children:t.detail.text||a("viewDoc")}):null]},c))]})},os=()=>{const p=Ee(),d=3e3,h=600*1e3,[t,c]=n.useState("idle"),[o,f]=n.useState(""),[fe,M]=n.useState(""),[T,B]=n.useState([]),[y,G]=n.useState(""),[ye,H]=n.useState({}),[Q,_]=n.useState(!1),[J,R]=n.useState(""),[ve,z]=n.useState(!1),[ke,Se]=n.useState(""),[b,Ne]=n.useState([]),[C,Z]=n.useState(!1),[S,W]=n.useState(!0),[v,we]=n.useState(!1),[X,Y]=n.useState(""),[ee,se]=n.useState(!1),[$,x]=n.useState(""),ae=n.useRef(null),{state:{engine:Te,user:re,gameDetail:le}}=Me(),k=Be(re),F=$e({errorCode:le?.has_error?le.error_code:void 0,user:re})==="noPermission",O=s=>new Promise(l=>setTimeout(l,s)),Ge=s=>s?String(s.status??s.cdn_deploy_status??s.live_status??"").toLowerCase():"",te=s=>s?String(s.status??s.cdn_deploy_status??s.live_status??""):"",D=s=>{if(Number(s?.cdn_deploy_status)===2)return"ready";const l=Ge(s);return l?["ready","success","succeeded","available"].includes(l)?"ready":l.includes("fail")||l.includes("error")||l.includes("reject")?"failed":"pending":"pending"},ie=s=>s==="preview"?4:s==="review"?3:s==="live"?2:1,be=s=>{if(!s)return[];const l=[...(s.preview_assets||[]).map(i=>({...i,source:"preview",state:D(i)})),...(s.in_review_assets||[]).map(i=>({...i,source:"review",state:D(i)})),...(s.live_assets||[]).map(i=>({...i,source:"live",state:D(i)})),...(s.assets||[]).map(i=>({...i,source:"other",state:D(i)}))].sort((i,m)=>{const j=Number(m.uploaded_at||0)-Number(i.uploaded_at||0);return j!==0?j:ie(m.source)-ie(i.source)}),u=new Map;return l.forEach(i=>{const m=String(i.asset_id||"");m&&!u.has(m)&&u.set(m,i)}),Array.from(u.values())},Ce=s=>s==="ready"?a("uploadGame.record.state.ready"):s==="failed"?a("uploadGame.record.state.failed"):a("uploadGame.record.state.pending"),De=s=>s==="preview"?a("uploadGame.record.source.preview"):s==="review"?a("uploadGame.record.source.review"):s==="live"?a("uploadGame.record.source.live"):a("uploadGame.record.source.other"),oe=s=>s?new Date(s*1e3).toLocaleString():a("uploadGame.record.metaUnknown"),Pe=s=>{if(!s)return a("uploadGame.record.metaUnknown");const l=s/1024/1024;return`${l>=10?l.toFixed(0):l.toFixed(1)} MB`},de=s=>{if(s.version)return`v${s.version}`;const l=String(s.asset_id||"");return l?`${l.slice(0,6)}...${l.slice(-4)}`:a("uploadGame.record.metaUnknown")},Ae=s=>`${de(s)} · ${Ce(s.state)} · ${oe(s.uploaded_at)}`,_e=s=>s?[s.preview_assets||[],s.in_review_assets||[],s.live_assets||[],s.assets||[]].flat().filter(Boolean):[],ne=async()=>{if(!k||F){B([]),G(""),R(""),_(!1);return}_(!0),R("");try{const s=await P({method:"POST",url:"/game/assets"});if(s?.code!==0||!s?.data)throw new Error(a("uploadGame.record.loadFailed"));const l=be(s.data);B(l);const u=(y&&l.some(i=>String(i.asset_id)===String(y))?y:"")||"";G(String(u||""))}catch(s){R(s instanceof Error?s.message:a("uploadGame.record.loadFailed"))}finally{_(!1)}},Re=async(s,l)=>{for(;Date.now()<l;){const u=await P({method:"POST",url:"/game/assets",data:{assetId:s,includePending:!0}}),m=_e(u?.data).find(j=>String(j.asset_id)===String(s))||null;if(m){const j=te(m);j&&M(j);const he=D(m);if(he==="ready")return{ok:!0,asset:m};if(he==="failed")return{ok:!1,asset:m}}await O(d)}return{ok:!1,asset:null}},ce=async(s,l)=>{for(;Date.now()<l;){const u=await P({method:"POST",url:"/game/asset/preview-url",data:{assetId:s}});if(u?.code===0&&u?.data?.preview_url)return u.data.preview_url;await O(d)}return""},ze=()=>{W(!0),Z(!1),P({url:"/game/check",method:"GET"}).then(s=>{Ne(s?.data||[])}).catch(()=>{Z(!0)}).finally(()=>{W(!1)})};n.useEffect(()=>{ze()},[]),n.useEffect(()=>{if(!k||F){B([]),G(""),R(""),_(!1);return}ne()},[k,F]);const ue=b.filter(s=>s?.type==="config"),pe=b.filter(s=>s?.type==="size"),me=b.filter(s=>s?.type==="api"),ge=b.filter(s=>s?.type==="performance"),K=b.some(s=>!s?.passed),Fe=[{key:"performance",title:a("uploadGame.group.performance"),items:ge},{key:"size",title:a("uploadGame.group.size"),items:pe},{key:"api",title:a("uploadGame.group.api"),items:me},{key:"config",title:a("uploadGame.group.config"),items:ue}].filter(s=>s.items.length>0).flatMap(s=>s.items.filter(l=>!l?.passed).map(l=>({groupTitle:s.title,message:l?.msg||a("uploadGame.unknownIssue"),link:l?.detail?.link,linkText:l?.detail?.text}))),Ie=s=>t==="uploading"?s===0?"current":"pending":t==="checkingAsset"?s===0?"done":s===1?"current":"pending":t==="resolvingPreview"?s<=1?"done":s===2?"current":"pending":"pending",Le=[a("uploadGame.progress.step1"),a("uploadGame.progress.step2"),a("uploadGame.progress.step3")],N=()=>{we(s=>!s)},g=T.find(s=>String(s.asset_id)===String(y))||null,I=y&&ye[String(y)]||"";n.useEffect(()=>{if(!g||g.state!=="ready"){z(!1);return}const s=String(g.asset_id);if(I){z(!1);return}let l=!1;return(async()=>{z(!0);const i=await ce(s,Date.now()+h);l||(i&&H(m=>({...m,[s]:i})),z(!1))})(),()=>{l=!0}},[g,I]);const Ue=()=>{if(!X.trim()){x(a("needDesc"));return}se(!0),c("uploading"),x(""),f(""),M(""),P({method:"POST",url:"/game/upload",headers:{"ttmg-game-desc":encodeURIComponent(X||"--")}}).then(async s=>{if(s?.code===0){await O(500),f(s?.data?.detail||"");const l=s?.data?.asset_id?String(s.data.asset_id):"",u=Date.now()+h;if(!l){c("failure"),x(a("uploadGame.failure.missingAssetId"));return}c("checkingAsset");const i=await Re(l,u);if(!i.ok){c("failure"),x(i.asset?a("uploadGame.failure.assetStatus",{status:te(i.asset)||"-"}):a("uploadGame.failure.assetTimeout"));return}c("resolvingPreview");const m=await ce(l,u);if(!m){c("failure"),x(a("uploadGame.failure.previewTimeout"));return}H(j=>({...j,[l]:m})),Se(l),G(""),Y(""),ae.current?.formApi?.reset?.(),await ne(),c("idle")}else c("idle"),x(s?.error?.StatusMessage||s?.detail||a("uploadPlatformFailed"))}).catch(s=>{c("idle"),x(s?.error?.StatusMessage||s?.response?.detail||s?.message||a("uploadPlatformFailed"))}).finally(()=>{se(!1)})};if(F){const s=["projectInfo.error.permission.stepCheckAccount","projectInfo.error.permission.stepApply","projectInfo.error.permission.stepRestart"];return e.jsx("div",{className:"upload-game-page",children:e.jsxs("section",{className:"upload-game-guard",children:[e.jsxs("div",{className:"upload-game-guard-banner",children:[e.jsx(r.Text,{strong:!0,children:a("projectInfo.error.permission.title")}),e.jsx(r.Text,{children:a("projectInfo.error.permission.desc")})]}),e.jsxs("div",{className:"upload-game-guard-card",children:[e.jsxs("div",{className:"upload-game-guard-head",children:[e.jsx(r.Text,{strong:!0,children:a("projectInfo.error.stepTitle")}),e.jsx(r.Text,{className:"upload-game-form-head-desc",children:a("projectInfo.error.helpPermissionDesc")})]}),e.jsx("div",{className:"upload-game-guard-steps",children:s.map((l,u)=>e.jsxs("div",{className:"upload-game-guard-step",children:[e.jsx("span",{className:"upload-game-guard-step-index",children:u+1}),e.jsx(r.Text,{children:a(l)})]},l))}),e.jsx("div",{className:"upload-game-guard-actions",children:e.jsx(w,{theme:"light",onClick:()=>p("/basic_debug_guide"),children:a("basicDebugGuide.entryAction")})})]})]})})}return e.jsxs("div",{className:"upload-game-page",children:[e.jsx("section",{className:"upload-game-guide-card",children:e.jsxs("div",{className:"upload-game-guide",children:[e.jsxs("div",{className:"upload-game-guide-copy",children:[e.jsx(r.Text,{strong:!0,children:a("uploadGame.guide.title")}),e.jsx(r.Paragraph,{className:"upload-game-guide-desc",children:a("uploadGame.guide.desc")})]}),e.jsx("div",{className:"upload-game-guide-steps",children:[{title:a("uploadGame.guide.precheck.title"),desc:a("uploadGame.guide.precheck.desc")},{title:a("uploadGame.guide.version.title"),desc:a("uploadGame.guide.version.desc")},{title:a("uploadGame.guide.preview.title"),desc:a("uploadGame.guide.preview.desc")}].map((s,l)=>e.jsxs("div",{className:"upload-game-guide-step",children:[e.jsx("span",{className:"upload-game-guide-step-index",children:l+1}),e.jsxs("div",{className:"upload-game-guide-step-copy",children:[e.jsx(r.Text,{strong:!0,children:s.title}),e.jsx(r.Text,{type:"tertiary",children:s.desc})]})]},s.title))})]})}),e.jsxs("section",{className:"upload-game-hero",children:[S?e.jsxs("div",{className:"upload-game-summary-panel upload-game-summary-panel-neutral",children:[e.jsxs("div",{className:"upload-game-summary-copy",children:[e.jsx(r.Text,{strong:!0,children:a("uploadGame.summary.checkingTitle")}),e.jsx(r.Text,{style:{color:"rgba(0, 0, 0, 0.45)"},children:a("uploadGame.summary.checkingDesc")})]}),e.jsx(L,{size:"small"})]}):null,!S&&C?e.jsxs("div",{className:"upload-game-summary-panel upload-game-summary-panel-warn",children:[e.jsxs("div",{className:"upload-game-summary-copy",children:[e.jsx(r.Text,{strong:!0,children:a("uploadGame.summary.failedTitle")}),e.jsx(r.Text,{style:{color:"rgba(0, 0, 0, 0.45)"},children:a("uploadGame.checkFetchFailed")})]}),e.jsxs("span",{className:"upload-game-summary-action",role:"button",tabIndex:0,onClick:N,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),N())},children:[e.jsx(q,{style:{transform:v?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}}),e.jsx(r.Text,{children:a(v?"uploadGame.hideDetails":"uploadGame.showDetails")})]})]}):null,k?null:e.jsxs("div",{className:"upload-game-inline-notice",children:[e.jsx("div",{className:"upload-game-inline-notice-icon",children:e.jsx(Oe,{})}),e.jsxs("div",{className:"upload-game-inline-notice-copy",children:[e.jsx(r.Text,{strong:!0,children:a("uploadGame.loginNoticeTitle")}),e.jsx(r.Text,{children:a("loginToUpload")}),e.jsx("div",{className:"upload-game-inline-notice-action",children:e.jsx(w,{theme:"light",onClick:()=>p("/basic_debug_guide"),children:a("basicDebugGuide.entryAction")})})]})]}),!S&&!C&&K?e.jsxs("div",{className:"upload-game-summary-panel upload-game-summary-panel-warn",children:[e.jsxs("div",{className:"upload-game-summary-copy",children:[e.jsx(r.Text,{strong:!0,children:a("uploadGame.issueTitle")}),e.jsx(r.Text,{style:{color:"rgba(0, 0, 0, 0.45)"},children:a("uploadGame.issueDesc")})]}),e.jsxs("span",{className:"upload-game-summary-action",role:"button",tabIndex:0,onClick:N,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),N())},children:[e.jsx(q,{style:{transform:v?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}}),e.jsx(r.Text,{children:a(v?"uploadGame.hideDetails":"uploadGame.showDetails")})]})]}):null,!S&&!C&&!K?e.jsxs("div",{className:"upload-game-summary-panel upload-game-summary-panel-ok",children:[e.jsxs("div",{className:"upload-game-summary-copy",children:[e.jsx(r.Text,{strong:!0,children:a("uploadGame.readyTitle")}),e.jsx(r.Text,{style:{color:"rgba(0, 0, 0, 0.45)"},children:a("uploadGame.readyDesc")})]}),e.jsxs("span",{className:"upload-game-summary-action",role:"button",tabIndex:0,onClick:N,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),N())},children:[e.jsx(q,{style:{transform:v?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}}),e.jsx(r.Text,{children:a(v?"uploadGame.hideDetails":"uploadGame.showDetails")})]})]}):null,v?e.jsxs("div",{className:"upload-game-inline-detail",children:[e.jsx(r.Paragraph,{className:"upload-game-inline-detail-desc",children:a("uploadGame.detailDesc")}),e.jsx("div",{className:"upload-game-check-body",children:S?e.jsx("div",{className:"upload-game-loading",children:e.jsx(L,{})}):e.jsxs(e.Fragment,{children:[e.jsx(Je,{engine:Te}),e.jsx(es,{result:ge}),e.jsx(Xe,{result:pe}),e.jsx(Ye,{result:me}),e.jsx(Ze,{result:ue})]})})]}):null,C?e.jsx(V,{type:"warning",description:a("uploadGame.checkFetchFailed"),style:{marginTop:16}}):null,!S&&!C&&K?e.jsx("div",{className:"upload-game-issue-list",children:Fe.slice(0,4).map((s,l)=>e.jsxs("div",{className:"upload-game-issue-item",children:[e.jsx(A,{color:"red",children:s.groupTitle}),e.jsx(r.Text,{className:"upload-game-issue-text",children:s.message}),s.link?e.jsx("a",{href:s.link,target:"_blank",rel:"noreferrer",children:s.linkText||a("viewDoc")}):null]},`${s.groupTitle}-${l}`))}):null,e.jsxs("div",{className:"upload-game-form-wrapper upload-game-form-wrapper-main",children:[t==="idle"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"upload-game-form-head",children:[e.jsx(r.Text,{strong:!0,children:a("gameAssetDescription")}),e.jsx(r.Text,{className:"upload-game-form-head-desc",children:a("uploadGame.uploadDescHint")})]}),e.jsx(xe,{ref:ae,onChange:({values:s})=>{Y(s?.gameDescription||""),x("")},children:e.jsx(xe.TextArea,{noLabel:!0,placeholder:a("gameAssetDescription"),field:"gameDescription",disabled:!k})}),$&&e.jsx(r.Text,{type:"danger",style:{display:"block",marginBottom:8},children:$}),e.jsx(w,{theme:"solid",type:"primary",disabled:!k||ee,loading:ee,onClick:Ue,style:{width:"100%",height:40},children:a("uploadToPlatform")})]}):null,t==="uploading"||t==="checkingAsset"||t==="resolvingPreview"?e.jsxs("div",{className:"upload-game-progress-card",children:[e.jsxs("div",{className:"upload-game-progress-head",children:[e.jsxs("div",{className:"upload-game-progress-badge",children:[e.jsx("span",{className:"upload-game-progress-badge-dot"}),e.jsx(r.Text,{children:t==="uploading"?a("uploadGame.progress.badgeUploading"):t==="checkingAsset"?a("uploadGame.progress.badgeChecking"):a("uploadGame.progress.badgePreview")})]}),e.jsx("div",{className:"upload-game-progress-bar"})]}),e.jsxs("div",{className:"upload-game-progress-copy",children:[e.jsx(r.Title,{heading:5,children:t==="uploading"?a("uploadGame.progress.title"):t==="checkingAsset"?a("uploadGame.progress.assetTitle"):a("uploadGame.progress.previewTitle")}),e.jsx(r.Paragraph,{className:"upload-game-form-head-desc",children:t==="uploading"?a("uploadGame.progress.desc"):t==="checkingAsset"?a("uploadGame.progress.assetDesc",{status:fe||a("uploadGame.progress.statusPending")}):a("uploadGame.progress.previewDesc")}),e.jsx("div",{className:"upload-game-progress-steps",children:Le.map((s,l)=>{const u=Ie(l);return e.jsxs("div",{className:`upload-game-progress-step upload-game-progress-step-${u}`,children:[e.jsx("span",{className:"upload-game-progress-step-dot",children:l+1}),e.jsx("span",{className:"upload-game-progress-step-label",children:s})]},s)})})]})]}):null,t==="failure"?e.jsxs("div",{className:"upload-game-failure-card",children:[e.jsx(r.Title,{heading:5,children:a("uploadGame.failure.title")}),e.jsx(r.Paragraph,{className:"upload-game-form-head-desc",children:$||a("uploadPlatformFailed")}),e.jsxs("div",{className:"upload-game-success-actions",children:[o?e.jsx(w,{theme:"light",onClick:()=>window.open(o,"_blank"),children:a("viewOnPlatform")}):null,e.jsx(w,{theme:"solid",type:"primary",onClick:()=>{c("idle"),x(""),f(""),M("")},children:a("uploadGame.failure.retry")})]})]}):null]}),k?e.jsxs("div",{className:"upload-game-records",children:[e.jsx("div",{className:"upload-game-records-head",children:e.jsxs("div",{className:"upload-game-records-copy",children:[e.jsx(r.Text,{children:a("uploadGame.record.title")}),e.jsx(r.Text,{className:"upload-game-form-head-desc",children:a("uploadGame.record.desc")})]})}),J?e.jsx(V,{type:"warning",description:J,style:{marginTop:12}}):null,Q&&!T.length?e.jsxs("div",{className:"upload-game-records-empty",children:[e.jsx(L,{size:"small"}),e.jsx(r.Text,{children:a("uploadGame.record.loading")})]}):null,!Q&&!T.length?e.jsx("div",{className:"upload-game-records-empty",children:e.jsx(r.Text,{children:a("uploadGame.record.empty")})}):null,T.length?e.jsxs("div",{className:"upload-game-records-layout",children:[e.jsx("div",{className:"upload-game-records-toolbar",children:e.jsx(Ke,{value:y,className:"upload-game-record-select",placeholder:a("uploadGame.record.selectPlaceholder"),allowClear:!0,optionList:T.slice(0,12).map(s=>({value:String(s.asset_id),label:Ae(s)})),onChange:s=>G(String(s||""))})}),g?e.jsxs("div",{className:"upload-game-record-detail",children:[e.jsx("div",{className:"upload-game-record-detail-head",children:e.jsx("div",{className:"upload-game-record-detail-copy",children:e.jsx(r.Text,{strong:!0,children:a("uploadGame.record.detailTitle",{version:de(g)})})})}),e.jsxs("div",{className:"upload-game-record-detail-body",children:[e.jsxs("div",{className:"upload-game-record-detail-main",children:[e.jsxs("div",{className:"upload-game-record-detail-meta",children:[e.jsxs("div",{className:"upload-game-record-detail-row",children:[e.jsx(r.Text,{type:"tertiary",children:a("uploadGame.record.metaUploadedAt")}),e.jsx(r.Text,{children:oe(g.uploaded_at)})]}),e.jsxs("div",{className:"upload-game-record-detail-row",children:[e.jsx(r.Text,{type:"tertiary",children:a("uploadGame.record.metaAssetId")}),e.jsx(r.Text,{children:g.asset_id||a("uploadGame.record.metaUnknown")})]}),e.jsxs("div",{className:"upload-game-record-detail-row",children:[e.jsx(r.Text,{type:"tertiary",children:a("uploadGame.record.metaSource")}),e.jsx(r.Text,{children:De(g.source)})]}),e.jsxs("div",{className:"upload-game-record-detail-row",children:[e.jsx(r.Text,{type:"tertiary",children:a("uploadGame.record.metaSize")}),e.jsx(r.Text,{children:Pe(g.size)})]})]}),e.jsxs("div",{className:"upload-game-record-detail-note",children:[e.jsx(r.Text,{type:"tertiary",children:a("gameAssetDescription")}),e.jsx(r.Paragraph,{children:g.desc||a("uploadGame.record.noDesc")})]})]}),e.jsx("div",{className:"upload-game-record-preview",children:g.state==="ready"?I?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"upload-game-record-qr-box",children:e.jsx(qe,{value:I,size:132})}),e.jsx(r.Text,{className:"upload-game-success-qr-caption",children:a("uploadGame.record.previewHint")})]}):e.jsx("div",{className:"upload-game-record-qr-box upload-game-record-qr-box-muted",children:ve?e.jsxs("div",{className:"upload-game-record-preview-loading",children:[e.jsx(L,{size:"small"}),e.jsx(r.Text,{children:a("uploadGame.record.previewLoading")})]}):e.jsx(r.Text,{type:"tertiary",children:a("uploadGame.record.previewUnavailable")})}):e.jsx("div",{className:"upload-game-record-qr-box upload-game-record-qr-box-muted",children:e.jsx(r.Text,{type:"tertiary",children:g.state==="failed"?a("uploadGame.record.failedDesc"):a("uploadGame.record.pendingDesc")})})})]}),String(g.asset_id)===String(ke)&&o?e.jsx("div",{className:"upload-game-success-actions",children:e.jsx(w,{theme:"light",onClick:()=>window.open(o,"_blank"),children:a("viewOnPlatform")})}):null]}):null]}):null]}):null]})]})};export{os as CheckCode};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K,r as
|
|
1
|
+
import{K,r as P,bN as X,by as G,bX as L,bY as N,bZ as V,bf as $,b_ as U,b$ as Y,bh as Z,c0 as W,ak as A,k as J,h as Q,m as j,R as m,Z as M,n as ee,s as te,q as d,c1 as se,c2 as ie}from"./index-07cXGo3a.js";function re(r){return P.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},r),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.44 19.8a1.5 1.5 0 0 1 0-2.13l5.66-5.65-5.66-5.66a1.5 1.5 0 1 1 2.12-2.12l6.72 6.72a1.5 1.5 0 0 1 0 2.12L9.56 19.8a1.5 1.5 0 0 1-2.12 0Z",fill:"currentColor"}))}const Re=K(re,"chevron_right");var b,S;function ne(){if(S)return b;S=1;var r=X(),e=1/0,s=17976931348623157e292;function i(t){if(!t)return t===0?t:0;if(t=r(t),t===e||t===-e){var a=t<0?-1:1;return a*s}return t===t?t:0}return b=i,b}var R,E;function ae(){if(E)return R;E=1;var r=ne();function e(s){var i=r(s),t=i%1;return i===i?t?i-t:i:0}return R=e,R}var v,k;function oe(){if(k)return v;k=1;var r=G(),e=L(),s=N();function i(t,a,o){for(var n=-1,h=a.length,l={};++n<h;){var p=a[n],u=r(t,p);o(u,p)&&e(l,s(p,t),u)}return l}return v=i,v}var I,D;function he(){if(D)return I;D=1;function r(e,s){return e!=null&&s in Object(e)}return I=r,I}var _,y;function ue(){if(y)return _;y=1;var r=N(),e=V(),s=$(),i=U(),t=Y(),a=Z();function o(n,h,l){h=r(h,n);for(var p=-1,u=h.length,f=!1;++p<u;){var g=a(h[p]);if(!(f=n!=null&&l(n,g)))break;n=n[g]}return f||++p!=u?f:(u=n==null?0:n.length,!!u&&t(u)&&i(g,u)&&(s(n)||e(n)))}return _=o,_}var O,x;function de(){if(x)return O;x=1;var r=he(),e=ue();function s(i,t){return i!=null&&e(i,t,r)}return O=s,O}var T,w;function pe(){if(w)return T;w=1;var r=oe(),e=de();function s(i,t){return r(i,t,function(a,o){return e(i,o)})}return T=s,T}var q,C;function le(){if(C)return q;C=1;var r=pe(),e=W(),s=e(function(i,t){return i==null?{}:r(i,t)});return q=s,q}var ce=le();const B=A(ce);class fe extends J{constructor(e){super(Object.assign({},e)),this.updateDOMInRenderTree=s=>{this._adapter.setDOMInRenderTree(s)},this.updateDOMHeight=s=>{this._adapter.setDOMHeight(s)},this.updateVisible=s=>{this._adapter.setVisible(s)},this.updateIsTransitioning=s=>{this._adapter.setIsTransitioning(s)}}}const F={PREFIX:`${Q}-collapsible`};class c extends j{constructor(e){super(e),this.domRef=m.createRef(),this.hasBeenRendered=!1,this.handleResize=s=>{const i=s[0];if(i){const t=c.getEntryInfo(i);this.foundation.updateDOMHeight(t.height),this.foundation.updateDOMInRenderTree(t.isShown)}},this.isChildrenInRenderTree=()=>this.domRef.current?this.domRef.current.offsetHeight>0:!1,this.state={domInRenderTree:!1,domHeight:0,visible:this.props.isOpen,isTransitioning:!1},this.foundation=new fe(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setDOMInRenderTree:e=>{this.state.domInRenderTree!==e&&this.setState({domInRenderTree:e})},setDOMHeight:e=>{this.state.domHeight!==e&&this.setState({domHeight:e})},setVisible:e=>{this.state.visible!==e&&this.setState({visible:e})},setIsTransitioning:e=>{this.state.isTransitioning!==e&&this.setState({isTransitioning:e})}})}componentDidMount(){super.componentDidMount(),this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.domRef.current);const e=this.isChildrenInRenderTree();this.foundation.updateDOMInRenderTree(e),e&&this.foundation.updateDOMHeight(this.domRef.current.scrollHeight)}componentDidUpdate(e,s,i){const t=Object.keys(B(this.props,["reCalcKey","isOpen"])).filter(o=>!M(this.props[o],e[o])),a=Object.keys(B(this.state,["domInRenderTree"])).filter(o=>!M(this.state[o],s[o]));t.includes("reCalcKey")&&this.foundation.updateDOMHeight(this.domRef.current.scrollHeight),a.includes("domInRenderTree")&&this.state.domInRenderTree&&this.foundation.updateDOMHeight(this.domRef.current.scrollHeight),t.includes("isOpen")&&(this.props.isOpen||!this.props.motion)&&this.foundation.updateVisible(this.props.isOpen),this.props.motion&&e.isOpen!==this.props.isOpen&&this.foundation.updateIsTransitioning(!0)}componentWillUnmount(){super.componentWillUnmount(),this.resizeObserver.disconnect()}render(){const e=Object.assign({overflow:"hidden",height:this.props.isOpen?this.state.domHeight:this.props.collapseHeight,opacity:this.props.isOpen||!this.props.fade||this.props.collapseHeight!==0?1:0,transitionDuration:`${this.props.motion&&this.state.isTransitioning?this.props.duration:0}ms`},this.props.style),s=ee(`${F.PREFIX}-wrapper`,{[`${F.PREFIX}-transition`]:this.props.motion&&this.state.isTransitioning},this.props.className),i=this.props.keepDOM&&(this.props.lazyRender?this.hasBeenRendered:!0)||this.props.collapseHeight!==0||this.state.visible||this.props.isOpen;return i&&!this.hasBeenRendered&&(this.hasBeenRendered=!0),m.createElement("div",Object.assign({className:s,style:e,onTransitionEnd:()=>{var t,a;this.props.isOpen||this.foundation.updateVisible(!1),this.foundation.updateIsTransitioning(!1),(a=(t=this.props).onMotionEnd)===null||a===void 0||a.call(t)}},this.getDataAttr(this.props)),m.createElement("div",{"x-semi-prop":"children",ref:this.domRef,style:{overflow:"hidden"},id:this.props.id},i&&this.props.children))}}c.__SemiComponentName__="Collapsible";c.defaultProps=te(c.__SemiComponentName__,{isOpen:!1,duration:250,motion:!0,keepDOM:!1,lazyRender:!1,collapseHeight:0,fade:!1});c.getEntryInfo=r=>{let e;r.borderBoxSize?e=!(r.borderBoxSize[0].blockSize===0&&r.borderBoxSize[0].inlineSize===0):e=!(r.contentRect.height===0&&r.contentRect.width===0);let s=0;return r.borderBoxSize?s=Math.ceil(r.borderBoxSize[0].blockSize):s=r.target.clientHeight,{isShown:e,height:s}};c.propTypes={motion:d.bool,children:d.node,isOpen:d.bool,duration:d.number,keepDOM:d.bool,collapseHeight:d.number,style:d.object,className:d.string,reCalcKey:d.oneOfType([d.string,d.number])};var H,z;function ge(){if(z)return H;z=1;var r=se(),e=ie(),s=ae(),i=9007199254740991,t=4294967295,a=Math.min;function o(n,h){if(n=s(n),n<1||n>i)return[];var l=t,p=a(n,t);h=e(h),n-=t;for(var u=r(p,h);++l<n;)h(l);return u}return H=o,H}var me=ge();const ve=A(me);export{c as C,Re as I,ve as _,B as a,ue as b,de as c,ae as r};
|
package/dist/public/index.html
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
rel="stylesheet"
|
|
13
13
|
/>
|
|
14
14
|
<title>TikTok Mini Games DevTool</title>
|
|
15
|
-
<script type="module" crossorigin src="/assets/index-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
15
|
+
<script type="module" crossorigin src="/assets/index-07cXGo3a.js"></script>
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D2LsTDVa.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="root"></div>
|
|
@@ -213,11 +213,12 @@ async function main() {
|
|
|
213
213
|
]);
|
|
214
214
|
|
|
215
215
|
for (const locale of locales.map(normalizeLang)) {
|
|
216
|
+
const baseHeaders = {
|
|
217
|
+
'Accept-Language': locale,
|
|
218
|
+
'X-TTMG-Docs-Lang': locale,
|
|
219
|
+
};
|
|
216
220
|
await Network.setExtraHTTPHeaders({
|
|
217
|
-
headers:
|
|
218
|
-
'Accept-Language': locale,
|
|
219
|
-
'X-TTMG-Docs-Lang': locale,
|
|
220
|
-
},
|
|
221
|
+
headers: baseHeaders,
|
|
221
222
|
});
|
|
222
223
|
await Emulation.setLocaleOverride({ locale });
|
|
223
224
|
|
|
@@ -228,6 +229,13 @@ async function main() {
|
|
|
228
229
|
|
|
229
230
|
for (const recipe of recipes) {
|
|
230
231
|
const viewport = recipe.viewport || { width: 1440, height: 1400 };
|
|
232
|
+
const requestHeaders = {
|
|
233
|
+
...baseHeaders,
|
|
234
|
+
...(recipe.requestHeaders || {}),
|
|
235
|
+
};
|
|
236
|
+
await Network.setExtraHTTPHeaders({
|
|
237
|
+
headers: requestHeaders,
|
|
238
|
+
});
|
|
231
239
|
await setViewport(Emulation, viewport.width, viewport.height);
|
|
232
240
|
await navigateAndWait(client, Page, `${baseUrl}${recipe.route}`);
|
|
233
241
|
await waitForSelector(Runtime, recipe.waitFor.selector, recipe.waitFor.timeoutMs || 20000);
|
|
@@ -120,6 +120,7 @@ function renderFaqSection(title, items = []) {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
function renderMarkdown({ recipes, guideTitle, guideSections, guideFaqs = {} }) {
|
|
123
|
+
const screenshotCount = recipes.length;
|
|
123
124
|
const zhSection = renderLocaleSection({
|
|
124
125
|
recipes,
|
|
125
126
|
locale: 'zh-CN',
|
|
@@ -140,14 +141,14 @@ function renderMarkdown({ recipes, guideTitle, guideSections, guideFaqs = {} })
|
|
|
140
141
|
return [
|
|
141
142
|
`# ${guideTitle}`,
|
|
142
143
|
'',
|
|
143
|
-
|
|
144
|
+
`本指南面向外部开发者,整体分为“通用调试能力说明”和“Unity 调试说明”两部分,并补充 ${screenshotCount} 个关键页面的截图说明。`,
|
|
144
145
|
'',
|
|
145
146
|
'- 适用对象:第一次接触 TikTok 小游戏调试工具,或需要快速回顾常用操作的开发者。',
|
|
146
147
|
'- 结构说明:先看通用调试能力,再按需查看 Unity 调试专项内容。',
|
|
147
148
|
'- 阅读方式:建议先看中文,再按需查看英文对照。',
|
|
148
149
|
'- 截图仅用于说明页面布局与关键入口,实际文案可能随版本更新有细微差异。',
|
|
149
150
|
'',
|
|
150
|
-
|
|
151
|
+
`This guide is written for external developers and is organized into two parts: general debugging capabilities and Unity debugging guidance, followed by annotated screenshots for ${screenshotCount} key pages.`,
|
|
151
152
|
'',
|
|
152
153
|
'- Audience: developers who are new to the TikTok mini-game debugging tool or want a quick refresher on the core workflow.',
|
|
153
154
|
'- Structure: read the general debugging section first, then move to the Unity-specific section when needed.',
|
|
@@ -28,6 +28,10 @@ function resolveLang(req) {
|
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
function resolveScenario(req) {
|
|
32
|
+
return String(req.query.scenario || req.headers['x-ttmg-docs-scenario'] || 'default');
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
function isLocaleMap(value) {
|
|
32
36
|
if (!value || Array.isArray(value) || typeof value !== 'object') {
|
|
33
37
|
return false;
|
|
@@ -54,17 +58,32 @@ function localizeValue(value, lang) {
|
|
|
54
58
|
);
|
|
55
59
|
}
|
|
56
60
|
|
|
57
|
-
function readFixture(fixturesDir, fileName, lang) {
|
|
58
|
-
const fixturePath = path.join(fixturesDir, fileName);
|
|
59
|
-
const raw = fs.readFileSync(fixturePath, 'utf8');
|
|
60
|
-
return localizeValue(JSON.parse(raw), lang);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
61
|
function readRawFixture(fixturesDir, fileName) {
|
|
64
62
|
const fixturePath = path.join(fixturesDir, fileName);
|
|
65
63
|
return JSON.parse(fs.readFileSync(fixturePath, 'utf8'));
|
|
66
64
|
}
|
|
67
65
|
|
|
66
|
+
function pickScenarioFixture(rawFixture, scenario) {
|
|
67
|
+
if (!rawFixture || typeof rawFixture !== 'object' || Array.isArray(rawFixture)) {
|
|
68
|
+
return rawFixture;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (!rawFixture.default && !rawFixture.scenarios) {
|
|
72
|
+
return rawFixture;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
rawFixture?.scenarios?.[scenario] ||
|
|
77
|
+
rawFixture?.default ||
|
|
78
|
+
rawFixture
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function readScenarioFixture(fixturesDir, fileName, lang, scenario = 'default') {
|
|
83
|
+
const rawFixture = readRawFixture(fixturesDir, fileName);
|
|
84
|
+
return localizeValue(pickScenarioFixture(rawFixture, scenario), lang);
|
|
85
|
+
}
|
|
86
|
+
|
|
68
87
|
function createOrigin(req) {
|
|
69
88
|
return `${req.protocol}://${req.get('host')}`;
|
|
70
89
|
}
|
|
@@ -111,7 +130,8 @@ app.get('/__docs/blank', (_req, res) => {
|
|
|
111
130
|
|
|
112
131
|
app.get('/game/config', (req, res) => {
|
|
113
132
|
const lang = resolveLang(req);
|
|
114
|
-
const
|
|
133
|
+
const scenario = resolveScenario(req);
|
|
134
|
+
const fixture = readScenarioFixture(fixturesDir, 'game-config.json', lang, scenario);
|
|
115
135
|
fixture.data.lang = lang;
|
|
116
136
|
fixture.data.nodeStaticBaseUrl = `${createOrigin(req)}/game/files`;
|
|
117
137
|
res.json(fixture);
|
|
@@ -128,13 +148,55 @@ app.post('/game/config-fillback', (req, res) => {
|
|
|
128
148
|
|
|
129
149
|
app.get('/game/detail', (req, res) => {
|
|
130
150
|
const lang = resolveLang(req);
|
|
131
|
-
const
|
|
151
|
+
const scenario = resolveScenario(req);
|
|
152
|
+
const fixture = readScenarioFixture(fixturesDir, 'game-detail.json', lang, scenario);
|
|
132
153
|
res.json(fixture);
|
|
133
154
|
});
|
|
134
155
|
|
|
135
156
|
app.get('/game/check', (req, res) => {
|
|
136
157
|
const lang = resolveLang(req);
|
|
137
|
-
const
|
|
158
|
+
const scenario = resolveScenario(req);
|
|
159
|
+
const fixture = readScenarioFixture(fixturesDir, 'game-check.json', lang, scenario);
|
|
160
|
+
res.json(fixture);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
app.post('/game/assets', (req, res) => {
|
|
164
|
+
const lang = resolveLang(req);
|
|
165
|
+
const scenario = resolveScenario(req);
|
|
166
|
+
const fixture = readScenarioFixture(fixturesDir, 'game-assets.json', lang, scenario);
|
|
167
|
+
res.json(fixture);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
app.post('/game/asset/preview-url', (req, res) => {
|
|
171
|
+
const lang = resolveLang(req);
|
|
172
|
+
const scenario = resolveScenario(req);
|
|
173
|
+
const fixture = readScenarioFixture(fixturesDir, 'game-assets.json', lang, scenario);
|
|
174
|
+
const previewUrlMap = fixture?.meta?.previewUrlMap || {};
|
|
175
|
+
const assetId = String(req.body?.assetId || '');
|
|
176
|
+
const previewUrl = assetId ? previewUrlMap[assetId] || '' : '';
|
|
177
|
+
res.json({
|
|
178
|
+
code: previewUrl ? 0 : 1,
|
|
179
|
+
data: previewUrl ? { preview_url: previewUrl } : {},
|
|
180
|
+
error: previewUrl ? undefined : { errorMsg: `Preview URL not found for asset ${assetId}` },
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
app.post('/game/direct-feed-card/list', (req, res) => {
|
|
185
|
+
const lang = resolveLang(req);
|
|
186
|
+
const scenario = resolveScenario(req);
|
|
187
|
+
const fixture = readScenarioFixture(fixturesDir, 'direct-feed-cards.json', lang, scenario);
|
|
188
|
+
res.json(fixture);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
app.post('/game/direct-feed-card/scenarios', (req, res) => {
|
|
192
|
+
const lang = resolveLang(req);
|
|
193
|
+
const scenario = resolveScenario(req);
|
|
194
|
+
const fixture = readScenarioFixture(
|
|
195
|
+
fixturesDir,
|
|
196
|
+
'direct-feed-card-scenarios.json',
|
|
197
|
+
lang,
|
|
198
|
+
scenario,
|
|
199
|
+
);
|
|
138
200
|
res.json(fixture);
|
|
139
201
|
});
|
|
140
202
|
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as ie,m as ne,R as j,n as re,T as r,d as D,u as R,c as W,r as d,i as t,j as e,H as P,b as T,B as A,e as le,E as U,Q as ce,N as Y,J as de,a as q}from"./index-DkXWo3Jg.js";import{c as oe}from"./index-OIQapQiA.js";const ge={PREFIX:`${ie}-empty`};var pe=function(s,c){var i={};for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&c.indexOf(l)<0&&(i[l]=s[l]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,l=Object.getOwnPropertySymbols(s);o<l.length;o++)c.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(s,l[o])&&(i[l[o]]=s[l[o]]);return i};const w=ge.PREFIX;class J extends ne{constructor(c){super(c),this.observe=i=>{for(const l of i)l.type==="attributes"&&l.attributeName==="theme-mode"&&this.updateMode()},this.updateMode=()=>{const i=this.body.getAttribute("theme-mode");i!==this.state.mode&&this.setState({mode:i})},this.state={mode:null}}componentDidMount(){if(this.props.darkModeImage){this.body=window.document.body,this.updateMode();const c={attributes:!0,childList:!1,subtree:!1};this.observer=new MutationObserver(this.observe),this.observer.observe(this.body,c)}}componentWillUnmount(){this.observer&&this.observer.disconnect()}render(){const c=this.props,{className:i,image:l,description:o,style:y,title:a,imageStyle:_,children:x,layout:v,darkModeImage:g}=c,f=pe(c,["className","image","description","style","title","imageStyle","children","layout","darkModeImage"]),h=typeof o=="string"?o:"empty",p=this.state.mode==="dark"&&g?g:l;let N=null;typeof p=="string"?N=j.createElement("img",{alt:h,src:p}):p&&"id"in p?N=j.createElement("svg",{"aria-hidden":"true"},j.createElement("use",{xlinkHref:`#${p.id}`})):N=p;const C=re(i,w,{[`${w}-${v}`]:v}),S=N?{heading:4}:{heading:6,style:{fontWeight:400}};return j.createElement("div",Object.assign({className:C,style:y},this.getDataAttr(f)),j.createElement("div",{className:`${w}-image`,style:_,"x-semi-prop":"image,darkModeImage"},N),j.createElement("div",{className:`${w}-content`},a?j.createElement(r.Title,Object.assign({},S,{className:`${w}-title`,"x-semi-prop":"title"}),a):null,o?j.createElement("div",{className:`${w}-description`,"x-semi-prop":"description"},o):null,x?j.createElement("div",{className:`${w}-footer`,"x-semi-prop":"children"},x):null))}}J.defaultProps={layout:"vertical"};function ue(s={}){return D({url:"/game/direct-feed-card/list",method:"POST",data:s})}function he(s){return D({url:"/game/direct-feed-card/asset-preview",method:"POST",data:s})}function me(s={}){return D({url:"/game/assets",method:"POST",data:s})}const ye="fyf_promotion_direct_feed_play",H="direct-play-debug";function O(s,c){if(typeof s=="string"&&s.trim())return s;if(s&&typeof s=="object"){const i=s;if(i.errorMsg)return i.errorMsg;if(i.StatusMessage)return i.StatusMessage;if(i.message)return i.message}return c}function xe(s){return s?s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(2)} MB`:"-"}function je(s){return s?new Date(s*1e3).toLocaleString():"-"}function ve(s){return s==="preview"?t("ia.directPlay.stage2.assetGroup.preview"):s==="live"?t("ia.directPlay.stage2.assetGroup.live"):t("ia.directPlay.stage2.assetGroup.review")}function fe(s){return{...s||Y,scene:ye}}function Ne(s){return s.pkgType==="independent"?s.independentPkg||s.pkgName||t("independentPackage"):t("gameMainPackage")}function X(s){return!s||s==="__GAME__"?t("gameMainPackage"):s}const be=()=>{const s=R(),{state:{selectedLaunchOption:c,gameDetail:i,launchOptions:l},setLaunchOptions:o,setSelectedLaunchOption:y}=W(),[a,_]=d.useState([]),[x,v]=d.useState([]),[g,f]=d.useState(""),[h,p]=d.useState(""),[N,C]=d.useState(""),[S,F]=d.useState(""),[G,E]=d.useState(""),[z,V]=d.useState(!0),[Z,Q]=d.useState(!1),K=d.useMemo(()=>fe(c),[c]),b=d.useMemo(()=>({appId:i?.app_id,clientKey:i?.client_key,miniGameId:i?.app_id}),[i?.app_id,i?.client_key]),I=d.useMemo(()=>a.find(n=>n.content_id===g)||null,[a,g]),M=d.useMemo(()=>x.find(n=>n.asset_id===h)||null,[x,h]),ee=d.useMemo(()=>x.map(n=>({label:`${n.file_name||n.asset_id} · v${n.version||"-"}`,value:n.asset_id})),[x]),te=d.useMemo(()=>a.map(n=>({label:`${n.card_name} · ${n.scenario||"-"} · ${X(n.sub_pkg)}`,value:n.content_id})),[a]),B=d.useCallback(async()=>{V(!0),F("");try{const[n,m]=await Promise.all([ue({appId:b.appId,clientKey:b.clientKey}),me({appId:b.appId,miniGameId:b.miniGameId,clientKey:b.clientKey})]);if(n?.error||n?.code!==0||!n?.data)throw new Error(O(n?.error,t("ia.directPlay.stage2.loadCardsFailed")));if(m?.error||m?.code!==0||!m?.data)throw new Error(O(m?.error,t("ia.directPlay.stage2.loadAssetsFailed")));const k=n.data.cards||[],$=(m.data.preview_assets||[]).map(u=>({...u,group:"preview"}));_(k),v($),f(u=>u&&k.some(L=>L.content_id===u)?u:k[0]?.content_id||""),p(u=>u&&$.some(L=>L.asset_id===u)?u:$[0]?.asset_id||"")}catch(n){F(O(n,t("ia.directPlay.stage2.loadResourcesFailed")))}finally{V(!1)}},[b.appId,b.clientKey,b.miniGameId]);d.useEffect(()=>{B()},[B]);const se=d.useCallback(()=>{const n={...K,id:H,name:t("ia.directPlay.stage1.generatedModeName")},m=l.filter(u=>u.id!==H),k=m.findIndex(u=>u.id==="created"),$=k>=0?[...m.slice(0,k),n,...m.slice(k)]:[...m,n];o($),y(n),s("/")},[l,s,o,y,K]),ae=d.useCallback(async()=>{if(!g||!h){E(t("ia.directPlay.stage2.selectRequired"));return}Q(!0),E("");try{const n=await he({assetId:h,contentId:g});if(n?.error||n?.code!==0||!n?.data?.preview_url)throw new Error(O(n?.error,t("ia.directPlay.stage2.previewFailed")));C(n.data.preview_url)}catch(n){C(""),E(O(n,t("ia.directPlay.stage2.previewFailed")))}finally{Q(!1)}},[h,g]);return e.jsxs("div",{className:"integration-assistant-direct-play-grid",children:[e.jsxs(P,{className:"integration-assistant-direct-play-card",bordered:!0,children:[e.jsx("div",{className:"integration-assistant-section-head",children:e.jsxs("div",{children:[e.jsx(r.Title,{heading:5,children:t("ia.directPlay.stage1.title")}),e.jsx(r.Paragraph,{className:"integration-assistant-section-desc",children:t("ia.directPlay.stage1.desc")})]})}),e.jsxs("div",{className:"integration-assistant-direct-play-summary",children:[e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(r.Text,{strong:!0,children:t("ia.directPlay.stage1.modeName")}),e.jsx(r.Text,{children:t("ia.directPlay.stage1.modeValue")})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(r.Text,{strong:!0,children:t("ia.directPlay.stage1.scene")}),e.jsx(r.Text,{children:t("scene_fyf_promotion_direct_feed_play")})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(r.Text,{strong:!0,children:t("ia.directPlay.stage1.package")}),e.jsx(r.Text,{children:Ne(K)})]})]}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(T,{theme:"solid",onClick:se,children:t("ia.directPlay.stage1.createQr")})})]}),e.jsxs(P,{className:"integration-assistant-direct-play-card",bordered:!0,children:[e.jsx("div",{className:"integration-assistant-section-head",children:e.jsxs("div",{children:[e.jsx(r.Title,{heading:5,children:t("ia.directPlay.stage2.title")}),e.jsx(r.Paragraph,{className:"integration-assistant-section-desc",children:t("ia.directPlay.stage2.desc")})]})}),e.jsx(A,{fullMode:!1,bordered:!1,closeIcon:null,type:"info",description:t("ia.directPlay.stage2.banner")}),S?e.jsx(A,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:S}):null,G?e.jsx(A,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:G}):null,z?e.jsx("div",{className:"integration-assistant-direct-play-loading",children:e.jsx(le,{size:"large"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"integration-assistant-direct-play-form",children:[e.jsxs("div",{children:[e.jsx(r.Text,{strong:!0,children:t("ia.directPlay.stage2.cardSelect")}),e.jsx(U,{className:"integration-assistant-direct-play-select",value:g||void 0,optionList:te,onChange:n=>f(n),placeholder:t("ia.directPlay.stage2.cardSelect")})]}),e.jsxs("div",{children:[e.jsx(r.Text,{strong:!0,children:t("ia.directPlay.stage2.assetSelect")}),e.jsx(U,{className:"integration-assistant-direct-play-select",value:h||void 0,optionList:ee,onChange:n=>p(n),placeholder:t("ia.directPlay.stage2.assetSelect")})]})]}),e.jsxs("div",{className:"integration-assistant-direct-play-details",children:[e.jsxs("div",{className:"integration-assistant-direct-play-panel",children:[e.jsx(r.Text,{strong:!0,children:t("ia.directPlay.stage2.selectedCard")}),I?e.jsxs("ul",{className:"integration-assistant-detail-list",children:[e.jsx("li",{children:`${t("ia.directPlay.stage2.cardName")}${I.card_name}`}),e.jsx("li",{children:`${t("ia.directPlay.stage2.cardDesc")}${I.card_desc||"-"}`}),e.jsx("li",{children:`${t("ia.directPlay.stage2.cardScenario")}${I.scenario||"-"}`}),e.jsx("li",{children:`${t("ia.directPlay.stage2.cardPackage")}${X(I.sub_pkg)}`}),e.jsx("li",{children:`${t("ia.directPlay.stage2.cardQueries")}${I.params||"-"}`})]}):e.jsx(r.Paragraph,{className:"integration-assistant-section-desc",children:t("ia.directPlay.stage2.emptyCard")})]}),e.jsxs("div",{className:"integration-assistant-direct-play-panel",children:[e.jsx(r.Text,{strong:!0,children:t("ia.directPlay.stage2.selectedAsset")}),M?e.jsxs("ul",{className:"integration-assistant-detail-list",children:[e.jsx("li",{children:`${t("ia.directPlay.stage2.assetGroup")}${ve(M.group)}`}),e.jsx("li",{children:`${t("ia.directPlay.stage2.assetFile")}${M.file_name||"-"}`}),e.jsx("li",{children:`${t("ia.directPlay.stage2.assetVersion")}${M.version||"-"}`}),e.jsx("li",{children:`${t("ia.directPlay.stage2.assetSize")}${xe(M.file_size)}`}),e.jsx("li",{children:`${t("ia.directPlay.stage2.assetUploaded")}${je(M.uploaded_at)}`})]}):e.jsx(r.Paragraph,{className:"integration-assistant-section-desc",children:t("ia.directPlay.stage2.emptyAsset")})]})]}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(T,{theme:"solid",loading:Z,onClick:ae,children:t("ia.directPlay.stage2.generate")})}),N?e.jsxs("div",{className:"integration-assistant-direct-play-preview",children:[e.jsx("div",{className:"integration-assistant-direct-play-qr",children:e.jsx(ce,{value:N,size:180})}),e.jsx("div",{className:"integration-assistant-direct-play-preview-content",children:e.jsx(r.Text,{className:"integration-assistant-section-desc",children:t("ia.directPlay.stage2.qrDesc")})})]}):null]})]})]})},Pe={sidebar_revisit:{modeId:"sidebar-revisit-debug",scene:"center",sceneKey:"scene_center",titleKey:"ia.revisit.sidebar.panel.title",descKey:"ia.revisit.sidebar.panel.desc",modeValueKey:"ia.revisit.sidebar.panel.modeValue",generatedModeNameKey:"ia.revisit.sidebar.panel.generatedModeName",signalValueKey:"ia.revisit.sidebar.panel.signalValue",createQrKey:"ia.revisit.sidebar.panel.createQr"},shortcut_revisit:{modeId:"shortcut-revisit-debug",scene:"desktop_shortcut",sceneKey:"scene_shortcut",titleKey:"ia.revisit.shortcut.panel.title",descKey:"ia.revisit.shortcut.panel.desc",modeValueKey:"ia.revisit.shortcut.panel.modeValue",generatedModeNameKey:"ia.revisit.shortcut.panel.generatedModeName",signalValueKey:"ia.revisit.shortcut.panel.signalValue",createQrKey:"ia.revisit.shortcut.panel.createQr"}};function _e(s,c){return{...s||Y,scene:c}}function ke(s){return s.pkgType==="independent"?s.independentPkg||s.pkgName||t("independentPackage"):t("gameMainPackage")}const we=({capabilityKey:s})=>{const c=R(),{state:{selectedLaunchOption:i,launchOptions:l},setLaunchOptions:o,setSelectedLaunchOption:y}=W(),a=Pe[s],_=d.useMemo(()=>_e(i,a.scene),[a.scene,i]),x=d.useCallback(()=>{const v={..._,id:a.modeId,name:t(a.generatedModeNameKey)},g=l.filter(p=>p.id!==a.modeId),f=g.findIndex(p=>p.id==="created"),h=f>=0?[...g.slice(0,f),v,...g.slice(f)]:[...g,v];o(h),y(v),c("/")},[a.generatedModeNameKey,a.modeId,l,c,_,o,y]);return e.jsx("div",{className:"integration-assistant-direct-play-grid",children:e.jsxs(P,{className:"integration-assistant-direct-play-card",bordered:!0,children:[e.jsx("div",{className:"integration-assistant-section-head",children:e.jsxs("div",{children:[e.jsx(r.Title,{heading:5,children:t(a.titleKey)}),e.jsx(r.Paragraph,{className:"integration-assistant-section-desc",children:t(a.descKey)})]})}),e.jsxs("div",{className:"integration-assistant-direct-play-summary",children:[e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(r.Text,{strong:!0,children:t("ia.revisit.panel.modeName")}),e.jsx(r.Text,{children:t(a.modeValueKey)})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(r.Text,{strong:!0,children:t("ia.revisit.panel.scene")}),e.jsx(r.Text,{children:t(a.sceneKey)})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(r.Text,{strong:!0,children:t("ia.revisit.panel.launchParams")}),e.jsx(r.Text,{children:`scene=${a.scene}`})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(r.Text,{strong:!0,children:t("ia.revisit.panel.package")}),e.jsx(r.Text,{children:ke(_)})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(r.Text,{strong:!0,children:t("ia.revisit.panel.signal")}),e.jsx(r.Text,{children:t(a.signalValueKey)})]})]}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(T,{theme:"solid",onClick:x,children:t(a.createQrKey)})})]})})},Te=()=>{const s=R(),{capabilityKey:c}=de(),i=c?oe[c]:void 0,l=a=>t(a),o=i?.actions.filter(a=>a.labelKey==="ia.action.openCapabilityDoc")||[],y=a=>{if(a.type==="external"&&a.href){window.open(a.href,a.target||"_blank","noopener,noreferrer");return}a.type==="route"&&a.path&&s(a.path)};return!i||i.hidden?e.jsx("div",{className:"integration-assistant-page integration-assistant-detail-page",children:e.jsxs(P,{bordered:!0,children:[e.jsx(J,{description:t("ia.detail.notFound")}),e.jsx("div",{className:"integration-assistant-detail-backalone",children:e.jsx(T,{onClick:()=>s("/integration_assistant"),children:t("ia.detail.backToMap")})})]})}):e.jsxs("div",{className:"integration-assistant-page integration-assistant-detail-page",children:[e.jsx("div",{className:"integration-assistant-detail-backalone",children:e.jsx(T,{theme:"borderless",onClick:()=>s("/integration_assistant"),children:t("ia.detail.backToMap")})}),e.jsx(P,{className:"integration-assistant-detail-hero",bordered:!1,children:e.jsxs("div",{className:"integration-assistant-detail-hero-content",children:[e.jsxs("div",{className:"integration-assistant-detail-title-row",children:[e.jsx("div",{className:"integration-assistant-map-icon","aria-hidden":"true",children:i.icon}),e.jsxs("div",{children:[e.jsx(r.Title,{heading:3,className:"integration-assistant-title",children:l(i.titleKey)}),e.jsx(r.Paragraph,{className:"integration-assistant-subtitle",children:l(i.summaryKey)})]})]}),e.jsxs("div",{className:"integration-assistant-map-meta",children:[i.sceneKey&&e.jsx(q,{color:"blue",children:`${t("ia.sceneLabel")}${l(i.sceneKey)}`}),i.apiTags.map(a=>e.jsx("span",{children:e.jsx(q,{children:a})},a))]}),e.jsx("div",{className:"integration-assistant-actions",children:o.map(a=>e.jsx(T,{theme:a.theme||"light",onClick:()=>y(a),children:l(a.labelKey)},`${a.type}:${a.path||a.href||a.labelKey}`))})]})}),e.jsxs("div",{className:"integration-assistant-detail-grid",children:[e.jsxs(P,{className:"integration-assistant-detail-card",bordered:!0,children:[e.jsx(r.Title,{heading:5,children:t("ia.section.prerequisites")}),e.jsx("ul",{className:"integration-assistant-detail-list",children:i.prerequisiteKeys.map(a=>e.jsx("li",{children:l(a)},a))})]}),e.jsxs(P,{className:"integration-assistant-detail-card",bordered:!0,children:[e.jsx(r.Title,{heading:5,children:t("ia.section.steps")}),e.jsx("ol",{className:"integration-assistant-detail-list ordered",children:i.stepKeys.map(a=>e.jsx("li",{children:l(a)},a))})]}),e.jsxs(P,{className:"integration-assistant-detail-card",bordered:!0,children:[e.jsx(r.Title,{heading:5,children:t("ia.section.tips")}),e.jsx("ul",{className:"integration-assistant-detail-list",children:i.tipKeys.map(a=>e.jsx("li",{children:l(a)},a))})]})]}),i.key==="direct_play_card"?e.jsx(be,{}):null,i.key==="sidebar_revisit"||i.key==="shortcut_revisit"?e.jsx(we,{capabilityKey:i.key}):null]})};export{Te as IntegrationAssistantDetail};
|
|
Binary file
|