@ttmg/cli 0.4.0 → 0.4.1-beta.wasm1

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.
Files changed (84) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/index.js +501 -39
  3. package/dist/index.js.map +1 -1
  4. package/dist/package.json +1 -1
  5. package/dist/public/assets/{Card-BMss5cuV.js → Card-ASGGlJ8S.js} +1 -1
  6. package/dist/public/assets/Detail-DY__Zw0r.js +1 -0
  7. package/dist/public/assets/Detail-DY__Zw0r.js.br +0 -0
  8. package/dist/public/assets/MonetizationMode-sHN_4ybQ.js +1 -0
  9. package/dist/public/assets/MonetizationModeSummary-DLvyriLM.js +1 -0
  10. package/dist/public/assets/{SectionHeader-3b39hv3n.js → SectionHeader-B7dueBCf.js} +1 -1
  11. package/dist/public/assets/{Tag-B5gYnANu.js → Tag-BsX0d6UL.js} +1 -1
  12. package/dist/public/assets/{arrow-left-B3swWB64.js → arrow-left-uixm7Sd1.js} +1 -1
  13. package/dist/public/assets/{baseForm-Dsi8Ia0k.js → baseForm-C8XfTFyG.js} +1 -1
  14. package/dist/public/assets/baseForm-C8XfTFyG.js.br +0 -0
  15. package/dist/public/assets/boxes-C7RoIbId.js +1 -0
  16. package/dist/public/assets/{chevron-right-WZeuFw11.js → chevron-right-B1WBZrrD.js} +1 -1
  17. package/dist/public/assets/circle-check-wUxXeINd.js +1 -0
  18. package/dist/public/assets/{compass-CCsIev11.js → compass-VJNhHwqW.js} +1 -1
  19. package/dist/public/assets/index-BBR3CPkN.js +1 -0
  20. package/dist/public/assets/index-BBR3CPkN.js.br +0 -0
  21. package/dist/public/assets/{index-uquhwGkB.js → index-BH099q_U.js} +1 -1
  22. package/dist/public/assets/{index-ROKxx4f7.css → index-BJZ4gOGZ.css} +1 -1
  23. package/dist/public/assets/index-BJZ4gOGZ.css.br +0 -0
  24. package/dist/public/assets/{index-D0xEiy7C.js → index-BNc8JtET.js} +1 -1
  25. package/dist/public/assets/{index-JNUqDBWt.js → index-BO5MBsdm.js} +1 -1
  26. package/dist/public/assets/index-Bd-f8ERX.js +1 -0
  27. package/dist/public/assets/{index-DeL2bgxo.js → index-C1C34gtn.js} +1 -1
  28. package/dist/public/assets/index-C7Tmy9g3.js +1 -0
  29. package/dist/public/assets/index-CCKb9Y-j.js +14 -0
  30. package/dist/public/assets/index-CCKb9Y-j.js.br +0 -0
  31. package/dist/public/assets/index-CKhfKyA3.js +1 -0
  32. package/dist/public/assets/index-CKhfKyA3.js.br +0 -0
  33. package/dist/public/assets/{index-C9Un1hFP.js → index-C_npSvtQ.js} +1 -1
  34. package/dist/public/assets/{index-BOl1-Siv.css → index-DHXlsTU6.css} +1 -1
  35. package/dist/public/assets/index-DHXlsTU6.css.br +0 -0
  36. package/dist/public/assets/index-DMsjcIN8.js +1 -0
  37. package/dist/public/assets/index-DNd8ZTok.js +1 -0
  38. package/dist/public/assets/index-DNd8ZTok.js.br +0 -0
  39. package/dist/public/assets/{index-DjY3Igd6.js → index-DbxY65Om.js} +1 -1
  40. package/dist/public/assets/index-Dn5HHf-0.js +1 -0
  41. package/dist/public/assets/index-DpkktYot.css +1 -0
  42. package/dist/public/assets/index-DtoDrber.js +1 -0
  43. package/dist/public/assets/index-DtoDrber.js.br +0 -0
  44. package/dist/public/assets/index-Dx5VGEQm.css +1 -0
  45. package/dist/public/assets/{index-Cigxnpav.js → index-ZHPtAdJM.js} +1 -1
  46. package/dist/public/assets/index-ZHPtAdJM.js.br +0 -0
  47. package/dist/public/assets/{index-C9HXjiVu.js → index-ZtlCPCV9.js} +1 -1
  48. package/dist/public/assets/{index-B-AeuNlL.css → index-_6n0s04V.css} +1 -1
  49. package/dist/public/assets/index-_6n0s04V.css.br +0 -0
  50. package/dist/public/assets/{index-C2NWNiPX.js → index-a-rMUS2V.js} +1 -1
  51. package/dist/public/assets/index-bQUQ2Wmz.js +1 -0
  52. package/dist/public/assets/{index-HYSh4-Ri.js → index-qqnHwFjO.js} +1 -1
  53. package/dist/public/assets/{index-aqIfJUqW.js → index-r3aSeNL1.js} +1 -1
  54. package/dist/public/assets/{index-D1oGAPRa.js → index-s_30KWiA.js} +1 -1
  55. package/dist/public/assets/index-t4JeqZ4a.js +1 -0
  56. package/dist/public/assets/layers-Biv61qtE.js +1 -0
  57. package/dist/public/assets/{sparkles-D2QPhLAu.js → sparkles-Bv2GxrFr.js} +1 -1
  58. package/dist/public/assets/{zap-Cv4X8yRx.js → zap-CjkC_qWZ.js} +1 -1
  59. package/dist/public/index.html +2 -2
  60. package/package.json +1 -1
  61. package/dist/public/assets/Detail-Lyas-t6F.js +0 -1
  62. package/dist/public/assets/Detail-Lyas-t6F.js.br +0 -0
  63. package/dist/public/assets/MonetizationMode-DI4fy3U7.js +0 -1
  64. package/dist/public/assets/MonetizationModeSummary-B6yEB26H.js +0 -1
  65. package/dist/public/assets/baseForm-Dsi8Ia0k.js.br +0 -0
  66. package/dist/public/assets/index-B-AeuNlL.css.br +0 -0
  67. package/dist/public/assets/index-B3-gsm5-.js +0 -1
  68. package/dist/public/assets/index-B3L1GnMP.js +0 -1
  69. package/dist/public/assets/index-B3L1GnMP.js.br +0 -0
  70. package/dist/public/assets/index-B6NHbQwP.js +0 -1
  71. package/dist/public/assets/index-BJV8-tz8.js +0 -1
  72. package/dist/public/assets/index-BOl1-Siv.css.br +0 -0
  73. package/dist/public/assets/index-BqSAtEgq.js +0 -1
  74. package/dist/public/assets/index-CV2u_S0E.js +0 -1
  75. package/dist/public/assets/index-CV2u_S0E.js.br +0 -0
  76. package/dist/public/assets/index-Ci-lqt1V.js +0 -1
  77. package/dist/public/assets/index-Ci-lqt1V.js.br +0 -0
  78. package/dist/public/assets/index-Cigxnpav.js.br +0 -0
  79. package/dist/public/assets/index-DpWpqPKC.js +0 -1
  80. package/dist/public/assets/index-DpWpqPKC.js.br +0 -0
  81. package/dist/public/assets/index-Dvg_oNs7.css +0 -1
  82. package/dist/public/assets/index-DxISN0Xc.js +0 -14
  83. package/dist/public/assets/index-DxISN0Xc.js.br +0 -0
  84. package/dist/public/assets/index-ROKxx4f7.css.br +0 -0
@@ -1 +1 @@
1
- import{d as b,D as k,r as t,j as e,s as D,i as a,o as y,am as F,f as A,T as m,e as E,an as I}from"./index-DxISN0Xc.js";import{I as x,F as g}from"./baseForm-Dsi8Ia0k.js";import"./index-DpWpqPKC.js";const z=()=>{const{state:{user:f}}=b(),r=k(f),[h,i]=t.useState(!1),[j,l]=t.useState(!1),[v,c]=t.useState(""),[d,n]=t.useState(""),p=t.useRef(null),u=()=>{l(!1),n(""),c("")},C=()=>{i(!1),u(),p.current?.formApi?.reset?.()},S=()=>{r&&i(!0)},N=s=>{const o=s;if(o?.code===0)I.success({title:a("uploadPlatformSuccess"),content:e.jsxs(e.Fragment,{children:[e.jsx("div",{children:a("uploadPlatformDesc")}),e.jsx("div",{style:{marginTop:12,display:"flex",justifyContent:"flex-end"},children:e.jsx(m.Text,{link:!0,onClick:()=>{window.open(o?.data?.detail,"_blank")},children:a("viewOnPlatform")})})]}),duration:10}),i(!1),u();else{const U=o?.error?.StatusMessage||o?.detail||a("uploadPlatformFailed");n(U),l(!1)}},T=s=>{const o=s?.error?.StatusMessage||s?.response?.detail||s?.message||a("uploadPlatformFailed");n(o),l(!1)},P=()=>{l(!0),E({method:"POST",url:"/game/upload",headers:{"ttmg-game-desc":encodeURIComponent(v||"--")}}).then(s=>{N(s)}).catch(s=>{T(s)})};return e.jsxs(e.Fragment,{children:[e.jsx(D,{content:()=>r?null:e.jsx("div",{className:"uploader-login-tip",children:a("loginToUpload")}),children:e.jsxs("div",{className:y("resource-uploader",{"resource-uploader-disabled":!r}),onClick:S,children:[e.jsx(x,{size:"default"}),e.jsx("div",{className:"uploader-text",children:a("upload")})]})}),e.jsx(F,{footer:null,visible:h,onCancel:C,title:a("uploadToPlatform"),children:e.jsxs("div",{className:"uploader-modal-content",children:[j&&e.jsx("div",{className:"upload-loading-container",children:e.jsx("div",{className:"loading-spin",children:e.jsx(A,{size:"large"})})}),d&&e.jsx(m.Text,{style:{color:"var(--tt-error-text)",marginBottom:12,marginTop:12},children:d}),e.jsxs(g,{ref:p,onChange:({values:s})=>{c(s?.gameDescription||"--"),n("")},children:[e.jsx(g.TextArea,{label:a("gameAssetDescription"),placeholder:a("gameAssetDescription"),field:"gameDescription"}),e.jsxs("div",{className:"uploader-button-container",onClick:P,children:[e.jsx(x,{className:"uploader-button-icon"}),e.jsx("div",{className:"uploader-button-text",children:a("uploadGamePackageTip")})]})]})]})})]})};export{z as GameUploader};
1
+ import{d as b,l as k,r as o,j as e,q as D,i as a,A as y,a8 as A,f as F,T as m,e as E,ap as I}from"./index-CCKb9Y-j.js";import{I as x,F as g}from"./baseForm-C8XfTFyG.js";import"./index-BBR3CPkN.js";const q=()=>{const{state:{user:f}}=b(),r=k(f),[h,i]=o.useState(!1),[j,l]=o.useState(!1),[v,c]=o.useState(""),[d,n]=o.useState(""),p=o.useRef(null),u=()=>{l(!1),n(""),c("")},C=()=>{i(!1),u(),p.current?.formApi?.reset?.()},S=()=>{r&&i(!0)},N=s=>{const t=s;if(t?.code===0)I.success({title:a("uploadPlatformSuccess"),content:e.jsxs(e.Fragment,{children:[e.jsx("div",{children:a("uploadPlatformDesc")}),e.jsx("div",{style:{marginTop:12,display:"flex",justifyContent:"flex-end"},children:e.jsx(m.Text,{link:!0,onClick:()=>{window.open(t?.data?.detail,"_blank")},children:a("viewOnPlatform")})})]}),duration:10}),i(!1),u();else{const U=t?.error?.StatusMessage||t?.detail||a("uploadPlatformFailed");n(U),l(!1)}},T=s=>{const t=s?.error?.StatusMessage||s?.response?.detail||s?.message||a("uploadPlatformFailed");n(t),l(!1)},P=()=>{l(!0),E({method:"POST",url:"/game/upload",headers:{"ttmg-game-desc":encodeURIComponent(v||"--")}}).then(s=>{N(s)}).catch(s=>{T(s)})};return e.jsxs(e.Fragment,{children:[e.jsx(D,{content:()=>r?null:e.jsx("div",{className:"uploader-login-tip",children:a("loginToUpload")}),children:e.jsxs("div",{className:y("resource-uploader",{"resource-uploader-disabled":!r}),onClick:S,children:[e.jsx(x,{size:"default"}),e.jsx("div",{className:"uploader-text",children:a("upload")})]})}),e.jsx(A,{footer:null,visible:h,onCancel:C,title:a("uploadToPlatform"),children:e.jsxs("div",{className:"uploader-modal-content",children:[j&&e.jsx("div",{className:"upload-loading-container",children:e.jsx("div",{className:"loading-spin",children:e.jsx(F,{size:"large"})})}),d&&e.jsx(m.Text,{style:{color:"var(--tt-error-text)",marginBottom:12,marginTop:12},children:d}),e.jsxs(g,{ref:p,onChange:({values:s})=>{c(s?.gameDescription||"--"),n("")},children:[e.jsx(g.TextArea,{label:a("gameAssetDescription"),placeholder:a("gameAssetDescription"),field:"gameDescription"}),e.jsxs("div",{className:"uploader-button-container",onClick:P,children:[e.jsx(x,{className:"uploader-button-icon"}),e.jsx("div",{className:"uploader-button-text",children:a("uploadGamePackageTip")})]})]})]})})]})};export{q as GameUploader};
@@ -1 +1 @@
1
- import{c as i,u as d,a6 as h,r as p,j as e,i as a}from"./index-DxISN0Xc.js";import{C as l}from"./compass-CCsIev11.js";import{Z as u}from"./zap-Cv4X8yRx.js";const y=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],m=i("cloud-upload",y);const x=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],_=i("layout-dashboard",x);const k=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],g=i("qr-code",k),v=[{itemKey:"scan_qrcode",text:a("scanQRCode2Debug"),icon:g,path:"/"},{itemKey:"project_overview",text:a("projectInfo"),icon:_,path:"/project_overview"},{itemKey:"integration_assistant",text:a("integrationAssistant"),icon:l,path:"/integration_assistant"},{itemKey:"performance",text:a("performance.menu.title"),icon:u,path:"/performance"},{itemKey:"upload_publish",text:a("codePreCheck"),icon:m,path:"/upload_publish"}],w=()=>{const s=d(),r=h(),n=p.useMemo(()=>{const t=r.pathname;return t==="/"||["/basic_debug_guide","/network_diagnostics","/manual_connect","/launch_mode","/debug_setting"].includes(t)?"scan_qrcode":t.startsWith("/integration_assistant")?"integration_assistant":t==="/performance"||t==="/wasm_split"?"performance":t==="/project_overview"||t==="/project_detail"?"project_overview":t==="/upload_publish"||t==="/version_upload"||t==="/precheck_code"?"upload_publish":""},[r.pathname]);return e.jsx("nav",{className:"tt-sidebar","aria-label":"primary",children:e.jsx("ul",{className:"tt-sidebar-list",children:v.map(t=>{const c=t.icon,o=t.itemKey===n;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:o?"tt-sidebar-item tt-sidebar-item-active":"tt-sidebar-item",onClick:()=>s(t.path),"aria-current":o?"page":void 0,children:[e.jsx("span",{className:"tt-sidebar-item-icon","aria-hidden":"true",children:e.jsx(c,{size:16,strokeWidth:1.75})}),e.jsx("span",{className:"tt-sidebar-item-text",children:t.text})]})},t.itemKey)})})})};export{w as Sidebar};
1
+ import{c as i,u as d,a9 as h,r as p,j as e,i as a}from"./index-CCKb9Y-j.js";import{C as l}from"./compass-VJNhHwqW.js";import{Z as u}from"./zap-CjkC_qWZ.js";const y=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],m=i("cloud-upload",y);const x=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],_=i("layout-dashboard",x);const k=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],g=i("qr-code",k),v=[{itemKey:"scan_qrcode",text:a("scanQRCode2Debug"),icon:g,path:"/"},{itemKey:"project_overview",text:a("projectInfo"),icon:_,path:"/project_overview"},{itemKey:"integration_assistant",text:a("integrationAssistant"),icon:l,path:"/integration_assistant"},{itemKey:"performance",text:a("performance.menu.title"),icon:u,path:"/performance"},{itemKey:"upload_publish",text:a("codePreCheck"),icon:m,path:"/upload_publish"}],w=()=>{const s=d(),r=h(),n=p.useMemo(()=>{const t=r.pathname;return t==="/"||["/basic_debug_guide","/network_diagnostics","/manual_connect","/launch_mode","/debug_setting"].includes(t)?"scan_qrcode":t.startsWith("/integration_assistant")?"integration_assistant":t==="/performance"||t==="/wasm_split"||t==="/subpackage_collect"?"performance":t==="/project_overview"||t==="/project_detail"?"project_overview":t==="/upload_publish"||t==="/version_upload"||t==="/precheck_code"?"upload_publish":""},[r.pathname]);return e.jsx("nav",{className:"tt-sidebar","aria-label":"primary",children:e.jsx("ul",{className:"tt-sidebar-list",children:v.map(t=>{const c=t.icon,o=t.itemKey===n;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:o?"tt-sidebar-item tt-sidebar-item-active":"tt-sidebar-item",onClick:()=>s(t.path),"aria-current":o?"page":void 0,children:[e.jsx("span",{className:"tt-sidebar-item-icon","aria-hidden":"true",children:e.jsx(c,{size:16,strokeWidth:1.75})}),e.jsx("span",{className:"tt-sidebar-item-text",children:t.text})]})},t.itemKey)})})})};export{w as Sidebar};
@@ -0,0 +1 @@
1
+ import{u as o,i as r,O as n,U as d,j as e,P as p}from"./index-CCKb9Y-j.js";import{C as t}from"./Card-ASGGlJ8S.js";import{T as m}from"./Tag-BsX0d6UL.js";import{Z as f}from"./zap-CjkC_qWZ.js";import{L as h}from"./layers-Biv61qtE.js";import{C as x}from"./chevron-right-B1WBZrrD.js";import{B as u}from"./boxes-C7RoIbId.js";const C=()=>{const l=o(),c=[{key:"wasm_split",title:r("performance.card.wasmSplit.title"),description:r("performance.card.wasmSplit.desc"),icon:f,path:"/wasm_split",tags:[{label:"Unity",tone:"info"},{label:"Wasm",tone:"neutral"}]},{key:"subpackage_collect",title:r("performance.card.subpackageCollect.title"),description:r("performance.card.subpackageCollect.desc"),icon:h,path:"/subpackage_collect",tags:[{label:"FP/TTI",tone:"accent"},{label:"Preload",tone:"neutral"}],localDevOnly:!0}].filter(a=>!(a.experimentOnly&&!n()||a.localDevOnly&&!d()));return e.jsxs("div",{className:"perf-page",children:[e.jsx(p,{title:r("performance.overview.title"),subtitle:r("performance.overview.desc")}),e.jsx("section",{className:"perf-section",children:e.jsxs("div",{className:"perf-tool-grid",children:[c.map(a=>{const i=a.icon;return e.jsxs(t,{interactive:!0,padding:"md",className:"perf-tool-card",onClick:()=>l(a.path),role:"button",tabIndex:0,children:[e.jsxs("div",{className:"perf-tool-card-head",children:[e.jsx("span",{className:"perf-tool-card-glyph","aria-hidden":"true",children:e.jsx(i,{size:18,strokeWidth:1.75})}),e.jsx("div",{className:"perf-tool-card-titlewrap",children:e.jsxs("div",{className:"perf-tool-card-title-row",children:[e.jsx("h3",{className:"perf-tool-card-title",children:a.title}),a.tags.map(s=>e.jsx(m,{tone:s.tone??"neutral",size:"sm",variant:"outline",children:s.label},s.label))]})}),e.jsx("span",{className:"perf-tool-card-chevron","aria-hidden":"true",children:e.jsx(x,{size:16,strokeWidth:2})})]}),e.jsx("p",{className:"perf-tool-card-desc",children:a.description})]},a.key)}),e.jsx(t,{padding:"md",className:"perf-tool-card perf-tool-card-placeholder",children:e.jsxs("div",{className:"perf-tool-card-head",children:[e.jsx("span",{className:"perf-tool-card-glyph perf-tool-card-glyph-muted","aria-hidden":"true",children:e.jsx(u,{size:18,strokeWidth:1.75})}),e.jsx("div",{className:"perf-tool-card-titlewrap",children:e.jsx("div",{className:"perf-tool-card-title-row",children:e.jsx("h3",{className:"perf-tool-card-title perf-tool-card-title-muted",children:r("performance.empty.comingSoon")})})})]})})]})})]})};export{C as Performance};
@@ -1 +1 @@
1
- import{a7 as o,r as c,J as n,j as e,T as h,i as l,z as m,a8 as d,e as g}from"./index-DxISN0Xc.js";import{D as r}from"./index-BqSAtEgq.js";function u(a){return c.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},a),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m6.62 3.25.44.75H2.6C1.72 4 1 4.67 1 5.5S1.72 7 2.6 7h1.9c0 2.45 1.1 4.71 2.5 6.5-1.1.64-2.63 1-4 1a1.5 1.5 0 1 0 0 3c2.23 0 4.3-.7 6-1.88 1.4.98 3.06 1.62 4.85 1.82l-1.7 3.39a1.5 1.5 0 0 0 2.7 1.34l.58-1.17h4.14l.59 1.17a1.5 1.5 0 0 0 2.68-1.34l-4-8a1.5 1.5 0 0 0-2.68 0l-.85 1.7a1.5 1.5 0 0 0-.31-.03c-1.37 0-2.9-.36-4-1A10.7 10.7 0 0 0 13.5 7h1.9c.88 0 1.6-.67 1.6-1.5S16.28 4 15.4 4h-4.88l-1.3-2.25a1.5 1.5 0 0 0-2.6 1.5ZM7.5 7h3c0 1.69-.56 3.25-1.5 4.5A7.47 7.47 0 0 1 7.5 7Zm10 9.85L18.57 19h-2.14l1.07-2.15Z",fill:"currentColor"}))}const w=o(u,"language"),i=[{code:"zh-CN",labelKey:"langChinese",short:"中"},{code:"en-US",labelKey:"langEnglish",short:"EN"}];async function p(a){if(a!==n){d(a);try{await g({url:"/game/language",method:"POST",data:{lang:a}})}catch{}window.location.reload()}}const f=()=>{const a=i.find(t=>t.code===n)?.short??"EN";return e.jsx(r,{trigger:"hover",position:"bottomRight",render:e.jsx(e.Fragment,{children:i.map(t=>{const s=t.code===n;return e.jsxs(r.Item,{onClick:()=>{p(t.code)},className:"lang-switcher-item"+(s?" lang-switcher-item-active":""),children:[e.jsx("span",{className:"lang-switcher-item-label",children:l(t.labelKey)}),s?e.jsx(m,{className:"lang-switcher-item-check"}):null]},t.code)})}),children:e.jsxs("div",{className:"lang-switcher tt-header-chip","aria-label":l("languageSwitcherLabel"),children:[e.jsx(w,{className:"lang-switcher-icon"}),e.jsx(h.Text,{className:"lang-switcher-text",children:a})]})})};export{f as LangSwitcher};
1
+ import{aa as o,r as c,p as n,j as e,T as h,i as l,I as m,ab as d,e as g}from"./index-CCKb9Y-j.js";import{D as r}from"./index-bQUQ2Wmz.js";function u(a){return c.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},a),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m6.62 3.25.44.75H2.6C1.72 4 1 4.67 1 5.5S1.72 7 2.6 7h1.9c0 2.45 1.1 4.71 2.5 6.5-1.1.64-2.63 1-4 1a1.5 1.5 0 1 0 0 3c2.23 0 4.3-.7 6-1.88 1.4.98 3.06 1.62 4.85 1.82l-1.7 3.39a1.5 1.5 0 0 0 2.7 1.34l.58-1.17h4.14l.59 1.17a1.5 1.5 0 0 0 2.68-1.34l-4-8a1.5 1.5 0 0 0-2.68 0l-.85 1.7a1.5 1.5 0 0 0-.31-.03c-1.37 0-2.9-.36-4-1A10.7 10.7 0 0 0 13.5 7h1.9c.88 0 1.6-.67 1.6-1.5S16.28 4 15.4 4h-4.88l-1.3-2.25a1.5 1.5 0 0 0-2.6 1.5ZM7.5 7h3c0 1.69-.56 3.25-1.5 4.5A7.47 7.47 0 0 1 7.5 7Zm10 9.85L18.57 19h-2.14l1.07-2.15Z",fill:"currentColor"}))}const w=o(u,"language"),i=[{code:"zh-CN",labelKey:"langChinese",short:"中"},{code:"en-US",labelKey:"langEnglish",short:"EN"}];async function p(a){if(a!==n){d(a);try{await g({url:"/game/language",method:"POST",data:{lang:a}})}catch{}window.location.reload()}}const f=()=>{const a=i.find(t=>t.code===n)?.short??"EN";return e.jsx(r,{trigger:"hover",position:"bottomRight",render:e.jsx(e.Fragment,{children:i.map(t=>{const s=t.code===n;return e.jsxs(r.Item,{onClick:()=>{p(t.code)},className:"lang-switcher-item"+(s?" lang-switcher-item-active":""),children:[e.jsx("span",{className:"lang-switcher-item-label",children:l(t.labelKey)}),s?e.jsx(m,{className:"lang-switcher-item-check"}):null]},t.code)})}),children:e.jsxs("div",{className:"lang-switcher tt-header-chip","aria-label":l("languageSwitcherLabel"),children:[e.jsx(w,{className:"lang-switcher-icon"}),e.jsx(h.Text,{className:"lang-switcher-text",children:a})]})})};export{f as LangSwitcher};
@@ -0,0 +1 @@
1
+ import{i as e,u as F,d as q,r as o,N as x,j as l,B as w,v as I,b as v}from"./index-CCKb9Y-j.js";import{P as R}from"./index-Dn5HHf-0.js";import{F as c}from"./baseForm-C8XfTFyG.js";import"./index-BBR3CPkN.js";const N=[{label:e("scene_scan_qrcode"),value:"scan_qrcode"},{label:e("scene_search"),value:"search"},{label:e("scene_fyf_promotion_direct_feed_play"),value:"fyf_promotion_direct_feed_play"},{label:e("scene_anchor"),value:"anchor"},{label:e("scene_center"),value:"center"},{label:e("scene_ad"),value:"ads"},{label:e("scene_shortcut"),value:"desktop_shortcut"},{label:e("scene_sharing"),value:"dm_sharing"},{label:e("scene_link"),value:"minis_link"},{label:e("scene_inbox"),value:"inbox"}],D=()=>{const h=F(),{state:{launchOptions:s,selectedLaunchOption:_,packages:M},setLaunchOptions:f,setSelectedLaunchOption:g}=q(),i=o.useRef(null),d=_||x,[b,u]=o.useState(d),[m,y]=o.useState(d.id),k=M.map(n=>{if(n.type==="main")return{label:e("gameMainPackage"),value:n.name};if(n.type==="independent")return{label:`${e("independentPackage")}: ${n.name}`,value:n.name}}).filter(Boolean),j=o.useCallback(n=>{const a={...b,...n};a.pkgType==="main"&&a.independentPkg!==void 0&&(a.independentPkg=void 0,i.current&&i.current.setValues({independentPkg:void 0})),u(a)},[b]),L=o.useCallback(()=>{if(!i.current)return;const n=i.current.getValues();n.pkgType==="main"&&(n.independentPkg=void 0);const a=s.findIndex(r=>r.name===n.name&&r.id!=="created"&&r.id!=="normal");let t;a!==-1?(t=[...s],t[a]=n):(n.id=Date.now().toString(),t=[...s.slice(0,-1),n,...s.slice(-1)]),f(t),u(n),g(n),h("/")},[s,h,f,g]),S=o.useCallback(n=>{const a=s.find(t=>t.id===n);if(a){y(n);const t={...a};n==="created"?t.name="":n==="normal"&&(t.name=e("normalLaunchMode")),u(t),i.current?.setValues(t)}},[s]),C=o.useCallback(()=>{const n=m;if(["normal","created"].includes(n))return;const a=s.filter(p=>p.id!==n);f(a);const t=a.find(p=>p.id==="normal")||a.find(p=>p.id==="created")||a[0]||x,r={...t,...t.id==="created"?{name:""}:{},...t.id==="normal"?{name:e("normalLaunchMode")}:{}};g(r),y(r.id),u(r),i.current?.setValues(r)},[s,m,f,g]),V=o.useCallback(()=>{u(d),i.current?.setValues(d),h("/")},[d,h]),P=s.find(n=>n.id===m);return l.jsxs("div",{children:[l.jsx(w,{style:{marginBottom:32},fullMode:!1,icon:null,closeIcon:null,description:e("launchModeDesc"),type:"info"}),l.jsxs(c,{initValues:b,onValueChange:j,getFormApi:n=>i.current=n,style:{padding:20,border:"1px solid var(--tt-border)",borderRadius:8},onSubmit:L,children:[l.jsx(c.Select,{placeholder:e("selectLaunchMode"),rules:[{required:!0,message:e("selectLaunchMode")}],field:"id",label:e("selectLaunchMode"),optionList:s.map(n=>({label:n.name,value:n.id})),onChange:S,style:{width:"100%"},value:m}),l.jsx(c.Input,{required:!0,placeholder:e("launchModeName"),field:"name",label:e("launchModeName"),rules:[{required:!0,message:e("notEmpty")}],style:{width:"100%"},trigger:"blur"}),l.jsx(c.Select,{field:"pkgName",label:e("selectLaunchPkg"),placeholder:e("selectLaunchPkg"),rules:[{required:!0,message:e("notEmpty")}],optionList:k,style:{width:"100%"}}),l.jsx(c.Select,{field:"scene",label:e("selectScene"),rules:[{required:!0,message:e("notEmpty")}],placeholder:e("selectScene"),optionList:N,style:{width:"100%"},filter:!0}),l.jsx(c.Input,{field:"queries",label:e("launchQueries"),placeholder:e("launchQueriesDesc"),trigger:"blur",rules:[{validator:(n,a)=>{const{isValid:t,message:r}=I(a);return t?Promise.resolve():Promise.reject(r)}}],style:{width:"100%"}}),l.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:20},children:[["created","normal"].includes(m)?l.jsx(v,{style:{marginRight:12},onClick:V,children:e("cancel")}):l.jsx(R,{title:e("deleteLaunchModeConfirm",{name:P?.name??""}),onConfirm:C,position:"bottomRight",children:l.jsx(v,{type:"danger",style:{marginRight:12},children:e("delete")})}),l.jsx(v,{htmlType:"submit",type:"primary",children:e("saveAndUse")})]})]})]})};export{D as LaunchMode};