@ttmg/cli 0.3.6-beta.3 → 0.3.7-beta.1
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 +4 -1
- package/dist/index.js +551 -66
- package/dist/index.js.map +1 -1
- package/dist/package.json +2 -2
- package/dist/public/assets/Detail-BInCTDTx.js +1 -0
- package/dist/public/assets/Detail-BInCTDTx.js.br +0 -0
- package/dist/public/assets/Detail-BaQ9eM95.css +1 -0
- package/dist/public/assets/{baseForm-Dnb99UJB.js → baseForm-B7tArmif.js} +4 -4
- package/dist/public/assets/baseForm-B7tArmif.js.br +0 -0
- package/dist/public/assets/{index-UihZn1LL.css → index-6LE--ADL.css} +1 -1
- package/dist/public/assets/index-6LE--ADL.css.br +0 -0
- package/dist/public/assets/index-AtMMzkp0.css +1 -0
- package/dist/public/assets/index-B-rc2X1H.js +1 -0
- package/dist/public/assets/index-B0CT2rYr.js +1 -0
- package/dist/public/assets/index-BACeBrQR.css +1 -0
- package/dist/public/assets/index-BOiN8aIS.js +1 -0
- package/dist/public/assets/index-BVi9swz_.js +1 -0
- package/dist/public/assets/index-BVi9swz_.js.br +0 -0
- package/dist/public/assets/index-BlXhGm9R.js +1 -0
- package/dist/public/assets/{index-BkiB8M4Y.css → index-BnU4EHWL.css} +1 -1
- package/dist/public/assets/index-BnU4EHWL.css.br +0 -0
- package/dist/public/assets/index-BswgGVlz.js +1 -0
- package/dist/public/assets/index-BswgGVlz.js.br +0 -0
- package/dist/public/assets/index-C4wGgEDm.css +1 -0
- package/dist/public/assets/{index-DHyyb3Gw.js → index-CDrq3KnY.js} +1 -1
- package/dist/public/assets/index-CH7igbHY.css +1 -0
- package/dist/public/assets/index-Cj-lTEG1.js +1 -0
- package/dist/public/assets/index-Cj-lTEG1.js.br +0 -0
- package/dist/public/assets/index-D35C4ac4.js +1 -0
- package/dist/public/assets/index-DQqzytdw.js +1 -0
- package/dist/public/assets/index-DQqzytdw.js.br +0 -0
- package/dist/public/assets/index-DbiZkOAh.css +1 -0
- package/dist/public/assets/{index-CqK4Ymjd.js → index-DdH9Yin-.js} +1 -1
- package/dist/public/assets/index-DkXWo3Jg.js +14 -0
- package/dist/public/assets/index-DkXWo3Jg.js.br +0 -0
- package/dist/public/assets/index-OIQapQiA.js +1 -0
- package/dist/public/assets/{index-BGkIaNEY.js → index-Sk6u8HWP.js} +1 -1
- package/dist/public/assets/index-TYa4eXxF.css +1 -0
- package/dist/public/assets/{index-DKKMC8UM.js → index-aD1InxYk.js} +1 -1
- package/dist/public/assets/index-jaMAKGHW.css +1 -0
- package/dist/public/assets/{index-C5pU_dUf.js → index-tXDZpXMk.js} +1 -1
- package/dist/public/assets/index-tXDZpXMk.js.br +0 -0
- package/dist/public/assets/times-CCIAbLYL.js +1 -0
- package/dist/public/index.html +2 -2
- package/dist/scripts/docs/capture.js +255 -0
- package/dist/scripts/docs/render.js +199 -0
- package/dist/scripts/docs/server.js +164 -0
- package/package.json +2 -2
- package/dist/public/assets/baseForm-Dnb99UJB.js.br +0 -0
- package/dist/public/assets/index-B8aFXzhN.js +0 -1
- package/dist/public/assets/index-BB5kLk47.css +0 -1
- package/dist/public/assets/index-BaXjsvp9.js +0 -1
- package/dist/public/assets/index-BedicqfR.css +0 -1
- package/dist/public/assets/index-BkiB8M4Y.css.br +0 -0
- package/dist/public/assets/index-BmSg7a2H.js +0 -14
- package/dist/public/assets/index-BmSg7a2H.js.br +0 -0
- package/dist/public/assets/index-Bovw-Ai8.js +0 -1
- package/dist/public/assets/index-Bovw-Ai8.js.br +0 -0
- package/dist/public/assets/index-Bq6YxKLX.css +0 -1
- package/dist/public/assets/index-BwbPFgZF.css +0 -1
- package/dist/public/assets/index-C5pU_dUf.js.br +0 -0
- package/dist/public/assets/index-C8f539tK.css +0 -1
- package/dist/public/assets/index-CJtCELuI.js +0 -1
- package/dist/public/assets/index-CPEErQsP.js +0 -1
- package/dist/public/assets/index-CkcOz6VJ.js +0 -1
- package/dist/public/assets/index-D0piMtcL.js +0 -1
- package/dist/public/assets/index-DNZgHncv.js +0 -1
- package/dist/public/assets/index-DhmPFuxl.css +0 -1
- package/dist/public/assets/index-OPfpZTmc.js +0 -1
- package/dist/public/assets/index-OPfpZTmc.js.br +0 -0
- package/dist/public/assets/index-UihZn1LL.css.br +0 -0
- package/dist/public/assets/index-vPoeqDW1.js +0 -1
- package/dist/public/assets/index-vPoeqDW1.js.br +0 -0
- package/dist/public/assets/index-yh4tKekV.css +0 -1
- package/dist/public/assets/isPlainObject-CKjwQ9bg.js +0 -1
- package/dist/public/assets/times-BsXqTKq4.js +0 -1
- /package/dist/public/assets/{index-C7C5ulLg.css → times-C7C5ulLg.css} +0 -0
|
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_detail"}]},{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:"/version_upload"}]},{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:"/version_upload"}]},{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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,T as s,i as c,
|
|
1
|
+
import{j as e,T as s,i as c,A as o}from"./index-DkXWo3Jg.js";import{D as n}from"./index-D35C4ac4.js";const a=[{node:"item",name:c("quickStart"),link:"https://bytedance.sg.larkoffice.com/docx/MarqdNvQLoihvjxN4rFllgjBgwb"},{node:"item",name:c("jsApiList"),link:"https://bytedance.larkoffice.com/wiki/GQscwDOQSiPxyjkbzyfckh2pnDg"},{node:"item",name:c("advancedGuide"),link:"https://bytedance.larkoffice.com/wiki/AGqRwu0qQiXZpVkkToUcRP99nwc"},{node:"item",name:c("faq"),link:"https://bytedance.larkoffice.com/wiki/O6aWwFhDBiEglwkcnJ4ccJpdnmb"}],m=()=>e.jsx(n,{trigger:"hover",position:"bottomRight",render:e.jsx(e.Fragment,{children:a.map(i=>e.jsx(n.Item,{onClick:()=>{window.open(i.link)},children:i.name},i.name))}),children:e.jsxs("div",{className:"access-docs",children:[e.jsx(s.Text,{className:"access-docs-text",type:"primary",children:c("docs")}),e.jsx(o,{className:"access-docs-icon"})]})});export{m as AccessDocs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.integration-assistant-page{width:100%;padding-bottom:24px;box-sizing:border-box}.integration-assistant-detail-page{padding-top:12px;padding-bottom:24px}.integration-assistant-hero,.integration-assistant-detail-hero{background:linear-gradient(135deg,#f6f8ff,#fcfdff);overflow:visible}.integration-assistant-detail-hero :where(.semi-card-body){overflow:visible}.integration-assistant-detail-hero-content{display:flex;flex-direction:column;align-items:flex-start;gap:16px;width:100%;padding-bottom:8px}.integration-assistant-map-layout{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:auto;gap:16px}.integration-assistant-map-tile{border-radius:20px;border:1px solid rgba(28,31,35,.08);box-shadow:0 12px 32px #0f172a0d;overflow:hidden}.integration-assistant-map-intro{grid-column:span 12;display:flex;align-items:flex-start;justify-content:flex-start;padding:24px 26px;border-radius:24px;border:1px solid rgba(22,119,255,.1);background:radial-gradient(circle at top right,rgba(22,119,255,.12),transparent 28%),linear-gradient(135deg,#f4f8fffa,#fffffffa);box-shadow:0 16px 40px #0f172a0f}.integration-assistant-map-section{--ia-section-accent: rgba(22, 119, 255, .14);--ia-section-bg: linear-gradient(180deg, rgba(244, 247, 255, .96) 0%, rgba(255, 255, 255, .98) 100%);padding:16px;color:#111827f0;display:flex;flex-direction:column;gap:12px;background:var(--ia-section-bg);border:1px solid var(--ia-section-accent);box-shadow:0 12px 28px #0f172a0d}.integration-assistant-map-section-identity{--ia-section-accent: rgba(78, 93, 255, .14);--ia-section-bg: linear-gradient(180deg, rgba(242, 245, 255, .98) 0%, rgba(255, 255, 255, .98) 100%);grid-column:span 6}.integration-assistant-map-section-monetization{--ia-section-accent: rgba(29, 161, 109, .14);--ia-section-bg: linear-gradient(180deg, rgba(242, 251, 246, .98) 0%, rgba(255, 255, 255, .98) 100%);grid-column:span 6}.integration-assistant-map-section-share{--ia-section-accent: rgba(255, 126, 76, .16);--ia-section-bg: linear-gradient(180deg, rgba(255, 246, 240, .98) 0%, rgba(255, 255, 255, .98) 100%);grid-column:span 6}.integration-assistant-map-section-growth{--ia-section-accent: rgba(138, 92, 246, .15);--ia-section-bg: linear-gradient(180deg, rgba(247, 243, 255, .98) 0%, rgba(255, 255, 255, .98) 100%);grid-column:span 6}.integration-assistant-map-section-ui{grid-column:span 6}.integration-assistant-map-section-foundation{--ia-section-accent: rgba(18, 117, 240, .14);--ia-section-bg: linear-gradient(180deg, rgba(241, 248, 255, .98) 0%, rgba(255, 255, 255, .98) 100%);grid-column:span 6}.integration-assistant-map-tile-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.integration-assistant-map-intro-copy{display:flex;flex-direction:column;gap:8px;min-width:0}.integration-assistant-map-section-grid{display:grid;gap:10px}.integration-assistant-map-section-grid-one{grid-template-columns:1fr;grid-auto-rows:auto}.integration-assistant-map-section-grid-two{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:auto}.integration-assistant-map-section-grid-growth{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:auto}.integration-assistant-capability-tile{width:100%;padding:14px;text-align:left;border:1px solid rgba(255,255,255,.5);border-radius:12px;background:#ffffffeb;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background-color .18s ease;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:10px}.integration-assistant-capability-tile:hover{transform:translateY(-2px);box-shadow:0 12px 28px #0f172a1a;border-color:#1677ff3d;background:#fffffffa}.integration-assistant-capability-tile-wide{grid-column:span 2}.integration-assistant-capability-tile-main{min-width:0;width:100%;display:flex;flex-direction:column;gap:8px}.integration-assistant-capability-icon{width:36px;height:36px;border-radius:12px;background:#1677ff14;display:inline-flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}.integration-assistant-capability-head{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px}.integration-assistant-capability-title-row{min-width:0;display:flex;align-items:center;gap:10px}.integration-assistant-capability-arrow{color:#1677ffc7;font-size:16px;font-weight:700}.integration-assistant-capability-tags{display:flex;flex-wrap:wrap;gap:6px}.integration-assistant-capability-tag{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border-radius:999px;background:#0f172a0d;color:#0f172aa8;font-size:12px}.integration-assistant-capability-summary{margin:0;color:#000000ad;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.integration-assistant-capability-footer{width:100%;padding-top:8px;border-top:1px solid rgba(15,23,42,.06)}.integration-assistant-capability-cta{color:#1677ff;font-weight:600}.integration-assistant-title,.integration-assistant-map-title,.integration-assistant-section-head .semi-typography,.integration-assistant-map-head .semi-typography{margin-bottom:0}.integration-assistant-subtitle,.integration-assistant-section-desc,.integration-assistant-map-summary,.integration-assistant-env-item-desc{margin-bottom:0;color:#000000a6;line-height:1.65}.integration-assistant-map-section .integration-assistant-section-desc{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.integration-assistant-map-section-head{display:flex;flex-direction:column;gap:6px}.integration-assistant-map-section-title,.integration-assistant-capability-title{margin-bottom:0;line-height:1.35}.integration-assistant-capability-title{font-size:18px}.integration-assistant-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.integration-assistant-map-card{display:flex;flex-direction:column;min-height:0}.integration-assistant-map-card-head,.integration-assistant-detail-title-row{display:flex;align-items:flex-start;gap:14px}.integration-assistant-map-icon{width:44px;height:44px;border-radius:14px;background:#1677ff14;display:inline-flex;align-items:center;justify-content:center;font-size:22px;flex-shrink:0}.integration-assistant-map-meta,.integration-assistant-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;min-width:0}.integration-assistant-map-highlights,.integration-assistant-detail-list{margin:12px 0 0;padding-left:20px;color:#000000b8;line-height:1.7}.integration-assistant-map-highlights li+li,.integration-assistant-detail-list li+li{margin-top:6px}.integration-assistant-map-footer{margin-top:12px;padding-top:0}.integration-assistant-detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:16px}.integration-assistant-detail-card{min-height:100%}.integration-assistant-detail-list.ordered{padding-left:22px}.integration-assistant-detail-backalone{margin:0 0 12px}.integration-assistant-direct-play-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.integration-assistant-direct-play-card{min-height:100%}.integration-assistant-direct-play-summary,.integration-assistant-direct-play-form,.integration-assistant-direct-play-details{display:flex;flex-direction:column;gap:12px;margin-top:16px}.integration-assistant-direct-play-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:12px;background:#fafbfc;border:1px solid rgba(28,31,35,.08)}.integration-assistant-direct-play-select{width:100%;margin-top:8px}.integration-assistant-direct-play-panel{padding:14px 16px;border-radius:12px;background:#fafbfc;border:1px solid rgba(28,31,35,.08)}.integration-assistant-direct-play-loading{min-height:240px;display:flex;align-items:center;justify-content:center}.integration-assistant-direct-play-banner{margin-top:12px}.integration-assistant-direct-play-preview{margin-top:16px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:20px;border-radius:14px;background:#1677ff0a;border:1px solid rgba(22,119,255,.12);min-height:260px}.integration-assistant-direct-play-qr{width:280px;display:flex;flex-direction:column;align-items:center;justify-content:center;flex-shrink:0}.integration-assistant-direct-play-preview-content{flex:1;min-width:0;display:flex;align-items:center;padding-left:24px;border-left:1px dashed rgba(22,119,255,.18)}@media(max-width:1200px){.integration-assistant-map-layout,.integration-assistant-detail-grid,.integration-assistant-direct-play-grid,.integration-assistant-map-section-grid-one,.integration-assistant-map-section-grid-two,.integration-assistant-map-section-grid-growth{grid-template-columns:1fr}.integration-assistant-map-intro,.integration-assistant-map-section-identity,.integration-assistant-map-section-monetization,.integration-assistant-map-section-growth,.integration-assistant-map-section-share,.integration-assistant-map-section-ui,.integration-assistant-map-section-foundation,.integration-assistant-capability-tile-wide{grid-column:span 1}}@media(max-width:900px){.integration-assistant-map-intro,.integration-assistant-map-section{padding:18px}.integration-assistant-direct-play-preview{flex-direction:column;align-items:flex-start}.integration-assistant-direct-play-qr{width:100%}.integration-assistant-direct-play-preview-content{width:100%;padding-left:0;padding-top:16px;border-left:none;border-top:1px dashed rgba(22,119,255,.18)}.integration-assistant-direct-play-row{flex-direction:column}}@media(max-width:900px){.integration-assistant-map-tile-head{flex-direction:column;align-items:flex-start}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{u as t,r as a,j as n,b as c,i as o,H as r,M as i}from"./index-DkXWo3Jg.js";const d=()=>{const e=t();return a.useEffect(()=>{const s=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=s}},[]),n.jsxs("div",{className:"manual-connect-container",children:[n.jsx("div",{className:"manual-connect-back",children:n.jsx(c,{onClick:()=>e("/network_diagnostics"),children:o("back")})}),n.jsx(r,{title:o("netDiagManualBindEntry"),children:n.jsx(i,{onClose:()=>e("/network_diagnostics"),onSuccess:()=>e("/network_diagnostics")})})]})};export{d as ManualConnect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.upload-game-page{width:100%;display:flex;flex-direction:column;gap:16px;padding-bottom:24px;box-sizing:border-box}.upload-game-hero,.upload-game-section{border:1px solid rgba(28,31,35,.08);border-radius:12px;padding:16px;background:#fff}.upload-game-hero{border-color:#1677ff29;box-shadow:0 8px 24px #1677ff0f}.upload-game-guard{display:flex;flex-direction:column;gap:16px}.upload-game-guard-banner{display:flex;flex-direction:column;gap:6px;padding:14px 16px;border-radius:12px;border:1px solid rgba(250,173,20,.18);background:linear-gradient(180deg,#fffae6f2,#fff7d6e0)}.upload-game-guard-banner .semi-typography:nth-child(2){color:#000000a8;line-height:1.65}.upload-game-guard-card{padding:18px 20px;border-radius:12px;border:1px solid rgba(15,23,42,.08);background:#fff}.upload-game-guard-head{display:flex;flex-direction:column;gap:4px}.upload-game-guard-steps{display:flex;flex-direction:column;gap:12px;margin-top:16px}.upload-game-guard-step{display:flex;align-items:flex-start;gap:12px}.upload-game-guard-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}.upload-game-guard-actions{margin-top:18px}.upload-game-summary-panel{display:flex;align-items:center;justify-content:space-between;gap:16px;border-radius:10px;padding:14px 16px}.upload-game-summary-copy{display:flex;flex-direction:column;gap:4px;min-width:0}.upload-game-summary-action{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;color:#000000a6;cursor:pointer;-webkit-user-select:none;user-select:none}.upload-game-summary-action:hover{color:#1677ff}.upload-game-summary-action .semi-typography{color:inherit}.upload-game-summary-panel-ok{background:#52c41a0f;border:1px solid rgba(82,196,26,.12)}.upload-game-summary-panel-warn{background:#ff4d4f0d;border:1px solid rgba(255,77,79,.12)}.upload-game-summary-panel-neutral{background:#1677ff0d;border:1px solid rgba(22,119,255,.1)}.upload-game-inline-notice{display:flex;align-items:flex-start;gap:12px;margin-bottom:16px;padding:12px 14px;border:1px solid rgba(250,173,20,.18);border-radius:10px;background:linear-gradient(180deg,#fffae6f2,#fff7d6e0)}.upload-game-inline-notice-icon{width:24px;height:24px;border-radius:999px;background:#faad1424;color:#d48806;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:1px}.upload-game-inline-notice-copy{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}.upload-game-inline-notice-copy .semi-typography:nth-child(2){color:#000000ad;line-height:1.65}.upload-game-inline-notice-action{margin-top:10px}.upload-game-issue-list{display:flex;flex-direction:column;gap:8px;margin-top:16px}.upload-game-issue-item{display:flex;align-items:flex-start;gap:8px}.upload-game-issue-item .semi-tag{flex-shrink:0}.upload-game-issue-text{min-width:0;flex:1}.upload-game-section-header-right{display:flex;align-items:center;gap:8px}.upload-game-check-body{margin-top:16px}.upload-game-inline-detail{margin-top:14px;padding-top:16px;border-top:1px solid rgba(15,23,42,.06)}.upload-game-inline-detail-desc{margin:0;color:#00000073}.upload-game-loading{display:flex;align-items:center;justify-content:center;padding:32px 0}.upload-game-records{margin-top:16px;padding-top:16px;border-top:1px solid rgba(15,23,42,.06)}.upload-game-records-head{display:flex;align-items:flex-start;gap:12px}.upload-game-records-copy{display:flex;flex-direction:column;gap:4px;min-width:0}.upload-game-records-empty{display:flex;align-items:center;justify-content:center;gap:8px;min-height:120px;margin-top:12px;border:1px dashed rgba(15,23,42,.1);border-radius:12px;background:#f8fafccc;color:#00000073}.upload-game-records-layout{display:flex;flex-direction:column;gap:10px;margin-top:12px}.upload-game-records-toolbar{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap}.upload-game-record-select{width:min(100%,560px)}.upload-game-record-detail{padding-top:12px;border-top:1px solid rgba(15,23,42,.06)}.upload-game-record-detail-head{display:flex;align-items:flex-start;gap:8px}.upload-game-record-detail-copy{min-width:0}.upload-game-record-detail-copy .semi-typography-title{margin-bottom:4px}.upload-game-record-detail-body{display:grid;grid-template-columns:minmax(0,1fr) 176px;gap:20px;margin-top:12px}.upload-game-record-preview{display:flex;flex-direction:column;align-items:center;justify-content:flex-start}.upload-game-record-qr-box{width:156px;height:156px;border-radius:12px;border:1px solid rgba(15,23,42,.08);background:#fff;display:flex;align-items:center;justify-content:center;padding:10px}.upload-game-record-qr-box-muted{background:#f8fafceb}.upload-game-record-preview-loading{display:flex;flex-direction:column;align-items:center;gap:8px}.upload-game-record-detail-main{display:flex;flex-direction:column;gap:14px;min-width:0}.upload-game-record-detail-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 20px}.upload-game-record-detail-row{display:flex;flex-direction:column;gap:2px;min-width:0}.upload-game-record-detail-note{padding-top:12px;border-top:1px solid rgba(15,23,42,.06);color:#000000a6}.upload-game-record-detail-note .semi-typography-paragraph{margin:4px 0 0}.upload-game-form-wrapper{margin-top:16px}.upload-game-form-wrapper-main{margin-top:12px;padding-top:12px;border-top:1px solid rgba(15,23,42,.06)}.upload-game-progress-card,.upload-game-success-card,.upload-game-failure-card{display:flex;flex-direction:column;gap:16px;align-items:stretch;padding:20px;border-radius:14px;border:1px solid rgba(22,119,255,.08);background:#1677ff08}.upload-game-failure-card{display:block;border-color:#ff4d4f29;background:#ff4d4f08}.upload-game-progress-head{display:flex;align-items:center;gap:12px}.upload-game-progress-badge{display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:999px;background:#1677ff14;color:#1677ff;flex-shrink:0}.upload-game-progress-badge-dot{width:8px;height:8px;border-radius:999px;background:currentColor;animation:upload-game-progress-pulse 1.2s ease-in-out infinite}.upload-game-progress-badge .semi-typography{color:inherit}.upload-game-progress-bar{position:relative;flex:1;height:6px;border-radius:999px;overflow:hidden;background:#1677ff14}.upload-game-progress-bar:after{content:"";position:absolute;inset:0;width:35%;border-radius:inherit;background:linear-gradient(90deg,#1677ff33,#1677ff,#1677ff33);animation:upload-game-progress-slide 1.6s ease-in-out infinite}.upload-game-progress-copy,.upload-game-success-content{min-width:0;flex:1}.upload-game-progress-copy .semi-typography,.upload-game-success-content .semi-typography{margin-bottom:0}.upload-game-progress-steps{display:flex;flex-direction:column;gap:10px;margin-top:14px}.upload-game-progress-step{display:flex;align-items:center;gap:10px}.upload-game-progress-step-dot{width:24px;height:24px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;border:1px solid rgba(15,23,42,.12);color:#00000073;background:#fff}.upload-game-progress-step-label{color:#00000073}.upload-game-progress-step-done .upload-game-progress-step-dot{border-color:#52c41a3d;color:#389e0d;background:#52c41a14}.upload-game-progress-step-current .upload-game-progress-step-dot{border-color:#1677ff3d;color:#1677ff;background:#1677ff14}.upload-game-progress-step-done .upload-game-progress-step-label,.upload-game-progress-step-current .upload-game-progress-step-label{color:#000000d1}.upload-game-success-qr{width:220px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.upload-game-success-qr-box,.upload-game-success-qr-placeholder{width:188px;height:188px;border-radius:12px;background:#fff;border:1px solid rgba(15,23,42,.08);display:flex;align-items:center;justify-content:center}.upload-game-success-qr-caption{margin-top:10px;text-align:center;color:#00000073}.upload-game-success-actions{display:flex;align-items:center;gap:8px;margin-top:12px;flex-wrap:wrap}.upload-game-success-content .semi-typography-title{margin-bottom:4px}@keyframes upload-game-progress-slide{0%{transform:translate(-110%)}to{transform:translate(320%)}}@keyframes upload-game-progress-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.75)}}.upload-game-form-head{display:flex;flex-direction:column;gap:4px;margin-bottom:8px}.upload-game-form-head-desc{color:#00000073}.upload-game-form-wrapper .semi-form-field{margin-bottom:10px}.upload-game-form-wrapper .semi-form-field-label{display:none}.check-result-group{margin-bottom:18px}.check-result-title{display:flex;align-items:center;font-weight:500;margin-bottom:8px}.check-result-item{display:flex;align-items:center;padding:8px}.show-more-text-btn{position:absolute;left:0;bottom:0;right:0;display:block;padding:24px;border:none;border-radius:2px;cursor:pointer;font-size:14px;text-align:center;text-decoration:none;transition:all .3s ease;background-image:linear-gradient(to top,#fff,#ffffffb3);-webkit-backdrop-filter:blur(10px);box-shadow:0 0 #0003}@media(max-width:960px){.upload-game-summary-panel,.upload-game-records-head,.upload-game-record-detail-head,.upload-game-records-toolbar{flex-direction:column;align-items:flex-start}.upload-game-records-layout,.upload-game-record-detail-body,.upload-game-record-detail-meta{grid-template-columns:1fr}.upload-game-progress-card,.upload-game-success-card{align-items:stretch}.upload-game-success-qr{width:100%}.upload-game-issue-item{flex-wrap:wrap}}.check-code-banner-section{padding:12px 24px}.check-code-banner-section-title{font-size:16px;font-weight:500;line-height:24px;color:#222}.check-code-banner-section-desc{padding-bottom:8px;padding-left:12px;padding-top:8px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as U,r as T,bi as K,bj as H,ah as J,B as R,a as L,aA as _,G as Q,R as o,c as P,q as I,P as t,b as M,aE as j,az as ee,U as te}from"./index-BmSg7a2H.js";function ae(u){return T.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},u),T.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const se=U(ae,"checkbox_indeterminate");function ne(u){return T.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},u),T.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const re=U(ne,"checkbox_tick");var $,w;function ie(){if(w)return $;w=1;var u=K(),e=H(),a="[object Boolean]";function s(r){return r===!0||r===!1||e(r)&&u(r)==a}return $=s,$}var oe=ie();const de=J(oe),G={PREFIX:`${R}-checkbox`,INPUT:`${R}-checkbox-input`,WRAPPER:""},le={PREFIX:`${R}-checkboxGroup`},p={DIRECTION_SET:["horizontal","vertical"],TYPE_DEFAULT:"default",TYPE_CARD:"card",TYPE_PURECARD:"pureCard",DEFAULT_DIRECTION:"vertical"};class ce extends L{constructor(e){super(Object.assign({},e)),this.clickState=!1,this.handleFocusVisible=a=>{const{target:s}=a;try{if(this.clickState){this.clickState=!1;return}s.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch{_(!0,"Warning: [Semi Checkbox] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this.clickState=!1,this._adapter.setFocusVisible(!1)}}init(){const{children:e,extra:a,extraId:s,addonId:r}=this.getProps();e&&!r&&this._adapter.setAddonId(),a&&!s&&this._adapter.setExtraId()}notifyChange(e,a){const s=this._adapter.generateEvent(e,a);this._adapter.notifyChange(s)}handleChange(e){if(this.getProp("disabled"))return;if(e?.type==="click"&&(this.clickState=!0),this._adapter.focusCheckboxEntity(),this._adapter.getIsInGroup()){this._adapter.getGroupDisabled()||this.handleChangeInGroup(e);return}const l=!this.getState("checked");this._isControlledComponent("checked")?this.notifyChange(l,e):(this.setChecked(l),this.notifyChange(l,e))}handleChangeInGroup(e){const{value:a}=this.getProps(),l=!this._adapter.getGroupValue().includes(a),c=this._adapter.generateEvent(l,e);this._adapter.notifyChange(c),this._adapter.notifyGroupChange(c)}handleEnterPress(e){Q(e)&&this.handleChange(e)}setChecked(e){this._adapter.setNativeControlChecked(e)}destroy(){}}const N=o.createContext({});class A extends T.PureComponent{blur(){this.inputEntity.blur()}focus(){const{preventScroll:e}=this.props;this.inputEntity.focus({preventScroll:e})}render(){const{indeterminate:e,checked:a,disabled:s,prefixCls:r,name:l,isPureCardType:c,addonId:E,extraId:x,focusInner:f,onInputFocus:g,onInputBlur:m}=this.props,h=r||G.PREFIX,v=P({[`${h}-inner`]:!0,[`${h}-inner-checked`]:!!a,[`${h}-inner-pureCardType`]:c},G.WRAPPER),k=P({[`${h}-inner-display`]:!0,[`${h}-focus`]:f,[`${h}-focus-border`]:f&&!a}),C=a?o.createElement(re,null):e?o.createElement(se,null):null,i={type:"checkbox","aria-label":this.props["aria-label"],"aria-disabled":s,"aria-checked":a,"aria-labelledby":E,"aria-describedby":x||this.props["aria-describedby"],"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-required":this.props["aria-required"],className:G.INPUT,onChange:I,checked:a,disabled:s,onFocus:g,onBlur:m};return l&&(i.name=l),o.createElement("span",{className:v},o.createElement("input",Object.assign({},i,{ref:b=>{this.inputEntity=b}})),o.createElement("span",{className:k},C))}}A.contextType=N;A.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,checked:t.bool,disabled:t.bool,onChange:t.func,children:t.node,grouped:t.bool,value:t.any,isPureCardType:t.bool,addonId:t.string,extraId:t.string,focusInner:t.bool,onInputFocus:t.func,onInputBlur:t.func,preventScroll:t.bool};A.defaultProps={onChange:I};class y extends M{get adapter(){return Object.assign(Object.assign({},super.adapter),{setNativeControlChecked:e=>{this.setState({checked:e})},notifyChange:e=>{const{onChange:a}=this.props;a&&a(e)},generateEvent:(e,a)=>{const{props:s}=this;return{target:Object.assign(Object.assign({},s),{checked:e}),stopPropagation:()=>{a.stopPropagation()},preventDefault:()=>{a.preventDefault()},nativeEvent:{stopImmediatePropagation:()=>{a.nativeEvent&&typeof a.nativeEvent.stopImmediatePropagation=="function"&&a.nativeEvent.stopImmediatePropagation()}}}},getIsInGroup:()=>this.isInGroup(),getGroupValue:()=>this.context&&this.context.checkboxGroup.value||[],notifyGroupChange:e=>{this.context.checkboxGroup.onChange(e)},getGroupDisabled:()=>this.context&&this.context.checkboxGroup.disabled,setAddonId:()=>{this.setState({addonId:j({prefix:"addon"})})},setExtraId:()=>{this.setState({extraId:j({prefix:"extra"})})},setFocusVisible:e=>{this.setState({focusVisible:e})},focusCheckboxEntity:()=>{this.focus()}})}constructor(e){super(e),this.handleChange=s=>this.foundation.handleChange(s),this.handleEnterPress=s=>this.foundation.handleEnterPress(s),this.handleFocusVisible=s=>{this.foundation.handleFocusVisible(s)},this.handleBlur=s=>{this.foundation.handleBlur()};const a=!1;this.state={checked:e.checked||e.defaultChecked||a,addonId:e.addonId,extraId:e.extraId,focusVisible:!1},this.checkboxEntity=null,this.foundation=new ce(this.adapter)}componentDidUpdate(e){this.props.checked!==e.checked&&(ee(this.props.checked)?this.foundation.setChecked(!1):de(this.props.checked)&&this.foundation.setChecked(this.props.checked))}isInGroup(){return!!(this.context&&this.context.checkboxGroup&&"value"in this.props)}focus(){this.checkboxEntity&&this.checkboxEntity.focus()}blur(){this.checkboxEntity&&this.checkboxEntity.blur()}render(){const{disabled:e,style:a,prefixCls:s,className:r,indeterminate:l,children:c,onMouseEnter:E,onMouseLeave:x,extra:f,value:g,role:m,tabIndex:h,id:v,type:k}=this.props,{checked:C,addonId:i,extraId:b,focusVisible:F}=this.state,n={checked:C,disabled:e},B=this.isInGroup();if(B){if(this.context.checkboxGroup.value){const Z=(this.context.checkboxGroup.value||[]).includes(g);n.checked=Z}this.context.checkboxGroup.disabled&&(n.disabled=this.context.checkboxGroup.disabled||this.props.disabled);const{isCardType:D,isPureCardType:z}=this.context.checkboxGroup;n.isCardType=D,n.isPureCardType=z,n.name=this.context.checkboxGroup.name}else n.isPureCardType=k===p.TYPE_PURECARD,n.isCardType=k===p.TYPE_CARD||n.isPureCardType;const d=s||G.PREFIX,O=n.isCardType||n.isPureCardType,q=P(d,{[`${d}-disabled`]:n.disabled,[`${d}-indeterminate`]:l,[`${d}-checked`]:n.checked,[`${d}-unChecked`]:!n.checked,[`${d}-cardType`]:n.isCardType,[`${d}-cardType_disabled`]:n.disabled&&n.isCardType,[`${d}-cardType_enable`]:!(n.disabled&&n.isCardType),[`${d}-cardType_checked`]:n.isCardType&&n.checked&&!n.disabled,[`${d}-cardType_checked_disabled`]:n.isCardType&&n.checked&&n.disabled,[r]:!!r,[`${d}-focus`]:F&&O}),Y=P(`${d}-extra`,{[`${d}-cardType_extra_noChildren`]:n.isCardType&&!c});B&&this.context.checkboxGroup.name;const W=this.props["x-semi-children-alias"]||"children",X=()=>!c&&!f?null:o.createElement("div",{className:`${d}-content`},c?o.createElement("span",{id:i,className:`${d}-addon`,"x-semi-prop":W},c):null,f?o.createElement("div",{id:b,className:Y,"x-semi-prop":"extra"},f):null);return o.createElement("span",Object.assign({role:m,tabIndex:h,style:a,className:q,id:v,onMouseEnter:E,onMouseLeave:x,onClick:this.handleChange,onKeyPress:this.handleEnterPress,"aria-labelledby":this.props["aria-labelledby"]},this.getDataAttr(this.props)),o.createElement(A,Object.assign({},this.props,n,{addonId:c&&i,extraId:f&&b,isPureCardType:n.isPureCardType,ref:D=>{this.checkboxEntity=D},focusInner:F&&!O,onInputFocus:this.handleFocusVisible,onInputBlur:this.handleBlur})),X())}}y.contextType=N;y.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,checked:t.bool,defaultChecked:t.bool,disabled:t.bool,indeterminate:t.bool,onChange:t.func,value:t.any,style:t.object,className:t.string,prefixCls:t.string,onMouseEnter:t.func,onMouseLeave:t.func,extra:t.node,index:t.number,"aria-label":t.string,tabIndex:t.number,preventScroll:t.bool,type:t.string};y.defaultProps={defaultChecked:!1,indeterminate:!1,onChange:I,onMouseEnter:I,onMouseLeave:I,type:"default"};y.elementType="Checkbox";class S extends L{static get checkboxGroupDefaultAdapter(){return{}}constructor(e){super(Object.assign(Object.assign({},S.checkboxGroupDefaultAdapter),e))}init(){const{defaultValue:e,value:a}=this.getProps();typeof e<"u"&&!Array.isArray(e)&&_(!0,"Warning: [Semi CheckboxGroup] defaultValue should be an Array"),typeof a<"u"&&!Array.isArray(a)&&_(!0,"Warning: [Semi CheckboxGroup] value should be an Array")}notifyChange(e){this._adapter.notifyChange(e)}handleChange(e){const a=this.getState("value");let s=[];Array.isArray(a)||(s=[a]),e.target.checked?s=[...a,e.target.value]:s=a.filter((l,c)=>l!==e.target.value),"value"in this.getProps()?this.notifyChange(s):(this._adapter.updateGroupValue(s),this.notifyChange(s))}getFormatName(){return this.getProp("name")||"default"}handlePropValueChange(e){Array.isArray(e)?this._adapter.updateGroupValue(e):(typeof e>"u"&&this._adapter.updateGroupValue([]),_(!0,"Warning: [Semi CheckboxGroup] value should be an Array"))}destroy(){}}class V extends M{get adapter(){return Object.assign(Object.assign({},super.adapter),{updateGroupValue:e=>{this.setState({value:e})},notifyChange:e=>{this.props.onChange&&this.props.onChange(e)}})}constructor(e){super(e),this.state={value:e.value||e.defaultValue},this.foundation=new S(this.adapter),this.onChange=this.onChange.bind(this)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){te(e.value,this.props.value)||this.foundation.handlePropValueChange(this.props.value)}componentWillUnmount(){this.foundation.destroy()}onChange(e){this.foundation.handleChange(e)}render(){const{children:e,options:a,prefixCls:s,direction:r,className:l,id:c,style:E,type:x,disabled:f}=this.props,g=x===p.TYPE_PURECARD,m=x===p.TYPE_CARD||g,h=s||le.PREFIX,v=P({[h]:!0,[`${h}-wrapper`]:!0,[`${h}-${r}`]:r,[`${h}-${r}-cardType`]:r&&m,[`${h}-${r}-pureCardType`]:r&&g},l),k=this.state.value.slice();let C;return a?C=(a||[]).map((i,b)=>typeof i=="string"?o.createElement(y,{role:"listitem",key:b,disabled:this.props.disabled,value:i,prefixCls:s},i):o.createElement(y,{role:"listitem",key:b,disabled:i.disabled||this.props.disabled,value:i.value,prefixCls:s,extra:i.extra,className:i.className,style:i.style,onChange:i.onChange},i.label)):e&&(C=o.Children.toArray(e).map((i,b)=>o.cloneElement(i,{key:b,role:"listitem"}))),o.createElement("div",Object.assign({id:c,role:"list","aria-label":this.props["aria-label"],className:v,style:E,"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"]},this.getDataAttr(this.props)),o.createElement(N.Provider,{value:{checkboxGroup:{onChange:this.onChange,value:k,disabled:this.props.disabled,name:this.foundation.getFormatName(),isCardType:m,isPureCardType:g}}},C))}}V.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,defaultValue:t.array,disabled:t.bool,name:t.string,options:t.array,value:t.array,onChange:t.func,children:t.node,prefixCls:t.string,direction:t.oneOf(p.DIRECTION_SET),className:t.string,type:t.oneOf([p.TYPE_DEFAULT,p.TYPE_CARD,p.TYPE_PURECARD]),style:t.object};V.defaultProps={disabled:!1,onChange:()=>{},type:p.TYPE_DEFAULT,defaultValue:[],direction:p.DEFAULT_DIRECTION};class he extends y{}he.Group=V;export{he as C,de as _,y as a,V as b};
|
|
1
|
+
import{K as U,r as T,bm as z,bn as H,al as J,h as R,k as L,aE as _,U as Q,R as o,n as P,t as I,q as t,m as M,aI as j,aD as ee,Z as te}from"./index-DkXWo3Jg.js";function ae(u){return T.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},u),T.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const se=U(ae,"checkbox_indeterminate");function ne(u){return T.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},u),T.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const re=U(ne,"checkbox_tick");var $,w;function ie(){if(w)return $;w=1;var u=z(),e=H(),a="[object Boolean]";function s(r){return r===!0||r===!1||e(r)&&u(r)==a}return $=s,$}var oe=ie();const de=J(oe),G={PREFIX:`${R}-checkbox`,INPUT:`${R}-checkbox-input`,WRAPPER:""},le={PREFIX:`${R}-checkboxGroup`},p={DIRECTION_SET:["horizontal","vertical"],TYPE_DEFAULT:"default",TYPE_CARD:"card",TYPE_PURECARD:"pureCard",DEFAULT_DIRECTION:"vertical"};class ce extends L{constructor(e){super(Object.assign({},e)),this.clickState=!1,this.handleFocusVisible=a=>{const{target:s}=a;try{if(this.clickState){this.clickState=!1;return}s.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch{_(!0,"Warning: [Semi Checkbox] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this.clickState=!1,this._adapter.setFocusVisible(!1)}}init(){const{children:e,extra:a,extraId:s,addonId:r}=this.getProps();e&&!r&&this._adapter.setAddonId(),a&&!s&&this._adapter.setExtraId()}notifyChange(e,a){const s=this._adapter.generateEvent(e,a);this._adapter.notifyChange(s)}handleChange(e){if(this.getProp("disabled"))return;if(e?.type==="click"&&(this.clickState=!0),this._adapter.focusCheckboxEntity(),this._adapter.getIsInGroup()){this._adapter.getGroupDisabled()||this.handleChangeInGroup(e);return}const l=!this.getState("checked");this._isControlledComponent("checked")?this.notifyChange(l,e):(this.setChecked(l),this.notifyChange(l,e))}handleChangeInGroup(e){const{value:a}=this.getProps(),l=!this._adapter.getGroupValue().includes(a),c=this._adapter.generateEvent(l,e);this._adapter.notifyChange(c),this._adapter.notifyGroupChange(c)}handleEnterPress(e){Q(e)&&this.handleChange(e)}setChecked(e){this._adapter.setNativeControlChecked(e)}destroy(){}}const N=o.createContext({});class A extends T.PureComponent{blur(){this.inputEntity.blur()}focus(){const{preventScroll:e}=this.props;this.inputEntity.focus({preventScroll:e})}render(){const{indeterminate:e,checked:a,disabled:s,prefixCls:r,name:l,isPureCardType:c,addonId:E,extraId:x,focusInner:f,onInputFocus:g,onInputBlur:m}=this.props,h=r||G.PREFIX,v=P({[`${h}-inner`]:!0,[`${h}-inner-checked`]:!!a,[`${h}-inner-pureCardType`]:c},G.WRAPPER),k=P({[`${h}-inner-display`]:!0,[`${h}-focus`]:f,[`${h}-focus-border`]:f&&!a}),C=a?o.createElement(re,null):e?o.createElement(se,null):null,i={type:"checkbox","aria-label":this.props["aria-label"],"aria-disabled":s,"aria-checked":a,"aria-labelledby":E,"aria-describedby":x||this.props["aria-describedby"],"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-required":this.props["aria-required"],className:G.INPUT,onChange:I,checked:a,disabled:s,onFocus:g,onBlur:m};return l&&(i.name=l),o.createElement("span",{className:v},o.createElement("input",Object.assign({},i,{ref:b=>{this.inputEntity=b}})),o.createElement("span",{className:k},C))}}A.contextType=N;A.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,checked:t.bool,disabled:t.bool,onChange:t.func,children:t.node,grouped:t.bool,value:t.any,isPureCardType:t.bool,addonId:t.string,extraId:t.string,focusInner:t.bool,onInputFocus:t.func,onInputBlur:t.func,preventScroll:t.bool};A.defaultProps={onChange:I};class y extends M{get adapter(){return Object.assign(Object.assign({},super.adapter),{setNativeControlChecked:e=>{this.setState({checked:e})},notifyChange:e=>{const{onChange:a}=this.props;a&&a(e)},generateEvent:(e,a)=>{const{props:s}=this;return{target:Object.assign(Object.assign({},s),{checked:e}),stopPropagation:()=>{a.stopPropagation()},preventDefault:()=>{a.preventDefault()},nativeEvent:{stopImmediatePropagation:()=>{a.nativeEvent&&typeof a.nativeEvent.stopImmediatePropagation=="function"&&a.nativeEvent.stopImmediatePropagation()}}}},getIsInGroup:()=>this.isInGroup(),getGroupValue:()=>this.context&&this.context.checkboxGroup.value||[],notifyGroupChange:e=>{this.context.checkboxGroup.onChange(e)},getGroupDisabled:()=>this.context&&this.context.checkboxGroup.disabled,setAddonId:()=>{this.setState({addonId:j({prefix:"addon"})})},setExtraId:()=>{this.setState({extraId:j({prefix:"extra"})})},setFocusVisible:e=>{this.setState({focusVisible:e})},focusCheckboxEntity:()=>{this.focus()}})}constructor(e){super(e),this.handleChange=s=>this.foundation.handleChange(s),this.handleEnterPress=s=>this.foundation.handleEnterPress(s),this.handleFocusVisible=s=>{this.foundation.handleFocusVisible(s)},this.handleBlur=s=>{this.foundation.handleBlur()};const a=!1;this.state={checked:e.checked||e.defaultChecked||a,addonId:e.addonId,extraId:e.extraId,focusVisible:!1},this.checkboxEntity=null,this.foundation=new ce(this.adapter)}componentDidUpdate(e){this.props.checked!==e.checked&&(ee(this.props.checked)?this.foundation.setChecked(!1):de(this.props.checked)&&this.foundation.setChecked(this.props.checked))}isInGroup(){return!!(this.context&&this.context.checkboxGroup&&"value"in this.props)}focus(){this.checkboxEntity&&this.checkboxEntity.focus()}blur(){this.checkboxEntity&&this.checkboxEntity.blur()}render(){const{disabled:e,style:a,prefixCls:s,className:r,indeterminate:l,children:c,onMouseEnter:E,onMouseLeave:x,extra:f,value:g,role:m,tabIndex:h,id:v,type:k}=this.props,{checked:C,addonId:i,extraId:b,focusVisible:F}=this.state,n={checked:C,disabled:e},O=this.isInGroup();if(O){if(this.context.checkboxGroup.value){const K=(this.context.checkboxGroup.value||[]).includes(g);n.checked=K}this.context.checkboxGroup.disabled&&(n.disabled=this.context.checkboxGroup.disabled||this.props.disabled);const{isCardType:D,isPureCardType:Z}=this.context.checkboxGroup;n.isCardType=D,n.isPureCardType=Z,n.name=this.context.checkboxGroup.name}else n.isPureCardType=k===p.TYPE_PURECARD,n.isCardType=k===p.TYPE_CARD||n.isPureCardType;const d=s||G.PREFIX,B=n.isCardType||n.isPureCardType,q=P(d,{[`${d}-disabled`]:n.disabled,[`${d}-indeterminate`]:l,[`${d}-checked`]:n.checked,[`${d}-unChecked`]:!n.checked,[`${d}-cardType`]:n.isCardType,[`${d}-cardType_disabled`]:n.disabled&&n.isCardType,[`${d}-cardType_enable`]:!(n.disabled&&n.isCardType),[`${d}-cardType_checked`]:n.isCardType&&n.checked&&!n.disabled,[`${d}-cardType_checked_disabled`]:n.isCardType&&n.checked&&n.disabled,[r]:!!r,[`${d}-focus`]:F&&B}),Y=P(`${d}-extra`,{[`${d}-cardType_extra_noChildren`]:n.isCardType&&!c});O&&this.context.checkboxGroup.name;const W=this.props["x-semi-children-alias"]||"children",X=()=>!c&&!f?null:o.createElement("div",{className:`${d}-content`},c?o.createElement("span",{id:i,className:`${d}-addon`,"x-semi-prop":W},c):null,f?o.createElement("div",{id:b,className:Y,"x-semi-prop":"extra"},f):null);return o.createElement("span",Object.assign({role:m,tabIndex:h,style:a,className:q,id:v,onMouseEnter:E,onMouseLeave:x,onClick:this.handleChange,onKeyPress:this.handleEnterPress,"aria-labelledby":this.props["aria-labelledby"]},this.getDataAttr(this.props)),o.createElement(A,Object.assign({},this.props,n,{addonId:c&&i,extraId:f&&b,isPureCardType:n.isPureCardType,ref:D=>{this.checkboxEntity=D},focusInner:F&&!B,onInputFocus:this.handleFocusVisible,onInputBlur:this.handleBlur})),X())}}y.contextType=N;y.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,checked:t.bool,defaultChecked:t.bool,disabled:t.bool,indeterminate:t.bool,onChange:t.func,value:t.any,style:t.object,className:t.string,prefixCls:t.string,onMouseEnter:t.func,onMouseLeave:t.func,extra:t.node,index:t.number,"aria-label":t.string,tabIndex:t.number,preventScroll:t.bool,type:t.string};y.defaultProps={defaultChecked:!1,indeterminate:!1,onChange:I,onMouseEnter:I,onMouseLeave:I,type:"default"};y.elementType="Checkbox";class S extends L{static get checkboxGroupDefaultAdapter(){return{}}constructor(e){super(Object.assign(Object.assign({},S.checkboxGroupDefaultAdapter),e))}init(){const{defaultValue:e,value:a}=this.getProps();typeof e<"u"&&!Array.isArray(e)&&_(!0,"Warning: [Semi CheckboxGroup] defaultValue should be an Array"),typeof a<"u"&&!Array.isArray(a)&&_(!0,"Warning: [Semi CheckboxGroup] value should be an Array")}notifyChange(e){this._adapter.notifyChange(e)}handleChange(e){const a=this.getState("value");let s=[];Array.isArray(a)||(s=[a]),e.target.checked?s=[...a,e.target.value]:s=a.filter((l,c)=>l!==e.target.value),"value"in this.getProps()?this.notifyChange(s):(this._adapter.updateGroupValue(s),this.notifyChange(s))}getFormatName(){return this.getProp("name")||"default"}handlePropValueChange(e){Array.isArray(e)?this._adapter.updateGroupValue(e):(typeof e>"u"&&this._adapter.updateGroupValue([]),_(!0,"Warning: [Semi CheckboxGroup] value should be an Array"))}destroy(){}}class V extends M{get adapter(){return Object.assign(Object.assign({},super.adapter),{updateGroupValue:e=>{this.setState({value:e})},notifyChange:e=>{this.props.onChange&&this.props.onChange(e)}})}constructor(e){super(e),this.state={value:e.value||e.defaultValue},this.foundation=new S(this.adapter),this.onChange=this.onChange.bind(this)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){te(e.value,this.props.value)||this.foundation.handlePropValueChange(this.props.value)}componentWillUnmount(){this.foundation.destroy()}onChange(e){this.foundation.handleChange(e)}render(){const{children:e,options:a,prefixCls:s,direction:r,className:l,id:c,style:E,type:x,disabled:f}=this.props,g=x===p.TYPE_PURECARD,m=x===p.TYPE_CARD||g,h=s||le.PREFIX,v=P({[h]:!0,[`${h}-wrapper`]:!0,[`${h}-${r}`]:r,[`${h}-${r}-cardType`]:r&&m,[`${h}-${r}-pureCardType`]:r&&g},l),k=this.state.value.slice();let C;return a?C=(a||[]).map((i,b)=>typeof i=="string"?o.createElement(y,{role:"listitem",key:b,disabled:this.props.disabled,value:i,prefixCls:s},i):o.createElement(y,{role:"listitem",key:b,disabled:i.disabled||this.props.disabled,value:i.value,prefixCls:s,extra:i.extra,className:i.className,style:i.style,onChange:i.onChange},i.label)):e&&(C=o.Children.toArray(e).map((i,b)=>o.cloneElement(i,{key:b,role:"listitem"}))),o.createElement("div",Object.assign({id:c,role:"list","aria-label":this.props["aria-label"],className:v,style:E,"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"]},this.getDataAttr(this.props)),o.createElement(N.Provider,{value:{checkboxGroup:{onChange:this.onChange,value:k,disabled:this.props.disabled,name:this.foundation.getFormatName(),isCardType:m,isPureCardType:g}}},C))}}V.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,defaultValue:t.array,disabled:t.bool,name:t.string,options:t.array,value:t.array,onChange:t.func,children:t.node,prefixCls:t.string,direction:t.oneOf(p.DIRECTION_SET),className:t.string,type:t.oneOf([p.TYPE_DEFAULT,p.TYPE_CARD,p.TYPE_PURECARD]),style:t.object};V.defaultProps={disabled:!1,onChange:()=>{},type:p.TYPE_DEFAULT,defaultValue:[],direction:p.DEFAULT_DIRECTION};class he extends y{}he.Group=V;export{he as C,de as _,y as a,V as b};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{K,r as H,bP as X,bz as G,bZ as L,b_ as A,b$ as V,bg as $,c0 as U,c1 as Z,bi as W,c2 as Y,al as N,k as J,h as Q,m as j,R as m,Z as M,n as ee,s as te,q as d,c3 as se,c4 as ie}from"./index-DkXWo3Jg.js";function re(r){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},r),H.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,D;function oe(){if(D)return v;D=1;var r=G(),e=L(),s=A();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,k;function he(){if(k)return I;k=1;function r(e,s){return e!=null&&s in Object(e)}return I=r,I}var _,x;function ue(){if(x)return _;x=1;var r=A(),e=V(),s=$(),i=U(),t=Z(),a=W();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,y;function de(){if(y)return O;y=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=Y(),s=e(function(i,t){return i==null?{}:r(i,t)});return q=s,q}var ce=le();const B=N(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 z={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(`${z.PREFIX}-wrapper`,{[`${z.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 P,F;function ge(){if(F)return P;F=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 P=o,P}var me=ge();const ve=N(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-DkXWo3Jg.js"></script>
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/index-6LE--ADL.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="root"></div>
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { pathToFileURL } = require('url');
|
|
4
|
+
const chromeLauncher = require('chrome-launcher');
|
|
5
|
+
const CDP = require('chrome-remote-interface');
|
|
6
|
+
|
|
7
|
+
function parseArgs(argv) {
|
|
8
|
+
return argv.reduce((acc, arg) => {
|
|
9
|
+
if (!arg.startsWith('--')) {
|
|
10
|
+
return acc;
|
|
11
|
+
}
|
|
12
|
+
const [key, value] = arg.slice(2).split('=');
|
|
13
|
+
acc[key] = value === undefined ? true : value;
|
|
14
|
+
return acc;
|
|
15
|
+
}, {});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function normalizeLang(value) {
|
|
19
|
+
return String(value || '').toLowerCase().includes('en') ? 'en-US' : 'zh-CN';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function isLocaleMap(value) {
|
|
23
|
+
if (!value || Array.isArray(value) || typeof value !== 'object') {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const keys = Object.keys(value);
|
|
27
|
+
return keys.length > 0 && keys.every(key => key === 'zh-CN' || key === 'en-US');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function localizeValue(value, lang) {
|
|
31
|
+
if (Array.isArray(value)) {
|
|
32
|
+
return value.map(item => localizeValue(item, lang));
|
|
33
|
+
}
|
|
34
|
+
if (!value || typeof value !== 'object') {
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
if (isLocaleMap(value)) {
|
|
38
|
+
return value[lang] ?? value['zh-CN'] ?? value['en-US'] ?? '';
|
|
39
|
+
}
|
|
40
|
+
return Object.fromEntries(
|
|
41
|
+
Object.entries(value).map(([key, nestedValue]) => [key, localizeValue(nestedValue, lang)]),
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function escapeForEval(value) {
|
|
46
|
+
return JSON.stringify(value).replace(/<\//g, '<\\/');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function wait(ms) {
|
|
50
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function waitForLoadEvent(client, timeoutMs = 30000) {
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
const timer = setTimeout(() => {
|
|
56
|
+
reject(new Error(`Timed out waiting for load event after ${timeoutMs}ms`));
|
|
57
|
+
}, timeoutMs);
|
|
58
|
+
client.once('Page.loadEventFired', () => {
|
|
59
|
+
clearTimeout(timer);
|
|
60
|
+
resolve();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function navigateAndWait(client, Page, url, timeoutMs = 30000) {
|
|
66
|
+
const loadPromise = waitForLoadEvent(client, timeoutMs);
|
|
67
|
+
await Page.navigate({ url });
|
|
68
|
+
await loadPromise;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function waitForSelector(Runtime, selector, timeoutMs = 20000) {
|
|
72
|
+
const startedAt = Date.now();
|
|
73
|
+
const expression = `Boolean(document.querySelector(${JSON.stringify(selector)}))`;
|
|
74
|
+
while (Date.now() - startedAt < timeoutMs) {
|
|
75
|
+
const evaluation = await Runtime.evaluate({
|
|
76
|
+
expression,
|
|
77
|
+
returnByValue: true,
|
|
78
|
+
awaitPromise: true,
|
|
79
|
+
});
|
|
80
|
+
if (evaluation?.result?.value) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
await wait(200);
|
|
84
|
+
}
|
|
85
|
+
throw new Error(`Timed out waiting for selector: ${selector}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function setViewport(Emulation, width, height) {
|
|
89
|
+
await Emulation.setDeviceMetricsOverride({
|
|
90
|
+
width,
|
|
91
|
+
height,
|
|
92
|
+
deviceScaleFactor: 1,
|
|
93
|
+
mobile: false,
|
|
94
|
+
screenWidth: width,
|
|
95
|
+
screenHeight: height,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function seedLocalStorage(Runtime, storageMap) {
|
|
100
|
+
await Runtime.evaluate({
|
|
101
|
+
expression: `(() => {
|
|
102
|
+
const values = ${escapeForEval(storageMap)};
|
|
103
|
+
Object.entries(values).forEach(([key, value]) => {
|
|
104
|
+
localStorage.setItem(key, String(value));
|
|
105
|
+
});
|
|
106
|
+
return true;
|
|
107
|
+
})()`,
|
|
108
|
+
returnByValue: true,
|
|
109
|
+
awaitPromise: true,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
async function stabilizePage(Runtime) {
|
|
114
|
+
await Runtime.evaluate({
|
|
115
|
+
expression: `(() => {
|
|
116
|
+
const styleId = '__ttmg_docs_capture_style__';
|
|
117
|
+
let style = document.getElementById(styleId);
|
|
118
|
+
if (!style) {
|
|
119
|
+
style = document.createElement('style');
|
|
120
|
+
style.id = styleId;
|
|
121
|
+
document.head.appendChild(style);
|
|
122
|
+
}
|
|
123
|
+
style.textContent = [
|
|
124
|
+
'* { animation: none !important; transition: none !important; }',
|
|
125
|
+
'.semi-notification, .semi-toast, .semi-portal { display: none !important; }',
|
|
126
|
+
'.header-content-left > .semi-tag { display: none !important; }',
|
|
127
|
+
'.header-content-left .version-tag, .header-content-left .status-tag { display: none !important; }',
|
|
128
|
+
'.header-content-left { gap: 0 !important; }'
|
|
129
|
+
].join(' ');
|
|
130
|
+
return true;
|
|
131
|
+
})()`,
|
|
132
|
+
returnByValue: true,
|
|
133
|
+
awaitPromise: true,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
async function captureFullPage(Page, Emulation, outputPath, viewport) {
|
|
138
|
+
const metrics = await Page.getLayoutMetrics();
|
|
139
|
+
const width = Math.max(viewport.width, Math.ceil(metrics.contentSize.width || viewport.width));
|
|
140
|
+
const height = Math.max(viewport.height, Math.ceil(metrics.contentSize.height || viewport.height));
|
|
141
|
+
const safeHeight = Math.min(height, 16000);
|
|
142
|
+
|
|
143
|
+
await setViewport(Emulation, width, safeHeight);
|
|
144
|
+
|
|
145
|
+
const screenshot = await Page.captureScreenshot({
|
|
146
|
+
format: 'png',
|
|
147
|
+
fromSurface: true,
|
|
148
|
+
captureBeyondViewport: true,
|
|
149
|
+
clip: {
|
|
150
|
+
x: 0,
|
|
151
|
+
y: 0,
|
|
152
|
+
width,
|
|
153
|
+
height: safeHeight,
|
|
154
|
+
scale: 1,
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
fs.writeFileSync(outputPath, screenshot.data, 'base64');
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async function loadRecipes(recipesPath) {
|
|
162
|
+
const module = await import(pathToFileURL(recipesPath).href);
|
|
163
|
+
return {
|
|
164
|
+
recipes: module.recipes || module.default || [],
|
|
165
|
+
locales: module.locales || ['zh-CN', 'en-US'],
|
|
166
|
+
defaultLocalStorage: module.defaultLocalStorage || {},
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
async function main() {
|
|
171
|
+
const args = parseArgs(process.argv.slice(2));
|
|
172
|
+
const baseUrl = args['base-url'];
|
|
173
|
+
const recipesPath = path.resolve(args.recipes);
|
|
174
|
+
const outputDir = path.resolve(args['output-dir']);
|
|
175
|
+
|
|
176
|
+
if (!baseUrl) {
|
|
177
|
+
throw new Error('Missing required argument: --base-url');
|
|
178
|
+
}
|
|
179
|
+
if (!args.recipes) {
|
|
180
|
+
throw new Error('Missing required argument: --recipes');
|
|
181
|
+
}
|
|
182
|
+
if (!args['output-dir']) {
|
|
183
|
+
throw new Error('Missing required argument: --output-dir');
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const { recipes, locales, defaultLocalStorage } = await loadRecipes(recipesPath);
|
|
187
|
+
const assetsDir = path.join(outputDir, 'assets');
|
|
188
|
+
fs.mkdirSync(assetsDir, { recursive: true });
|
|
189
|
+
|
|
190
|
+
const chrome = await chromeLauncher.launch({
|
|
191
|
+
chromeFlags: [
|
|
192
|
+
'--headless=new',
|
|
193
|
+
'--disable-gpu',
|
|
194
|
+
'--hide-scrollbars',
|
|
195
|
+
'--no-first-run',
|
|
196
|
+
'--no-default-browser-check',
|
|
197
|
+
'--disable-background-networking',
|
|
198
|
+
'--disable-renderer-backgrounding',
|
|
199
|
+
],
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
let client;
|
|
203
|
+
try {
|
|
204
|
+
client = await CDP({ port: chrome.port });
|
|
205
|
+
const { Page, Runtime, Network, Emulation } = client;
|
|
206
|
+
await Promise.all([
|
|
207
|
+
Page.enable(),
|
|
208
|
+
Runtime.enable(),
|
|
209
|
+
Network.enable(),
|
|
210
|
+
Emulation.setDefaultBackgroundColorOverride({
|
|
211
|
+
color: { r: 255, g: 255, b: 255, a: 1 },
|
|
212
|
+
}),
|
|
213
|
+
]);
|
|
214
|
+
|
|
215
|
+
for (const locale of locales.map(normalizeLang)) {
|
|
216
|
+
await Network.setExtraHTTPHeaders({
|
|
217
|
+
headers: {
|
|
218
|
+
'Accept-Language': locale,
|
|
219
|
+
'X-TTMG-Docs-Lang': locale,
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
await Emulation.setLocaleOverride({ locale });
|
|
223
|
+
|
|
224
|
+
const localizedStorage = localizeValue(defaultLocalStorage, locale);
|
|
225
|
+
await setViewport(Emulation, 1440, 1400);
|
|
226
|
+
await navigateAndWait(client, Page, `${baseUrl}/__docs/blank`);
|
|
227
|
+
await seedLocalStorage(Runtime, localizedStorage);
|
|
228
|
+
|
|
229
|
+
for (const recipe of recipes) {
|
|
230
|
+
const viewport = recipe.viewport || { width: 1440, height: 1400 };
|
|
231
|
+
await setViewport(Emulation, viewport.width, viewport.height);
|
|
232
|
+
await navigateAndWait(client, Page, `${baseUrl}${recipe.route}`);
|
|
233
|
+
await waitForSelector(Runtime, recipe.waitFor.selector, recipe.waitFor.timeoutMs || 20000);
|
|
234
|
+
await stabilizePage(Runtime);
|
|
235
|
+
await wait(500);
|
|
236
|
+
|
|
237
|
+
const fileName = `${recipe.id}.${locale}.png`;
|
|
238
|
+
const outputPath = path.join(assetsDir, fileName);
|
|
239
|
+
await captureFullPage(Page, Emulation, outputPath, viewport);
|
|
240
|
+
console.log(`[ttmg-docs] captured ${fileName}`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
} finally {
|
|
244
|
+
if (client) {
|
|
245
|
+
await client.close();
|
|
246
|
+
}
|
|
247
|
+
await chrome.kill();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
main().catch(error => {
|
|
252
|
+
console.error('[ttmg-docs] capture failed');
|
|
253
|
+
console.error(error);
|
|
254
|
+
process.exit(1);
|
|
255
|
+
});
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { pathToFileURL } = require('url');
|
|
4
|
+
|
|
5
|
+
function parseArgs(argv) {
|
|
6
|
+
return argv.reduce((acc, arg) => {
|
|
7
|
+
if (!arg.startsWith('--')) {
|
|
8
|
+
return acc;
|
|
9
|
+
}
|
|
10
|
+
const [key, value] = arg.slice(2).split('=');
|
|
11
|
+
acc[key] = value === undefined ? true : value;
|
|
12
|
+
return acc;
|
|
13
|
+
}, {});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async function loadRecipes(recipesPath) {
|
|
17
|
+
const module = await import(pathToFileURL(recipesPath).href);
|
|
18
|
+
return {
|
|
19
|
+
recipes: module.recipes || module.default || [],
|
|
20
|
+
locales: module.locales || ['zh-CN', 'en-US'],
|
|
21
|
+
guideTitle: module.guideTitle || 'TikTok 小游戏调试工具使用指南',
|
|
22
|
+
guideSections: module.guideSections || {},
|
|
23
|
+
guideFaqs: module.guideFaqs || {},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function buildManifest({ recipes, locales, outputDir, guideTitle, guideSections, guideFaqs }) {
|
|
28
|
+
return {
|
|
29
|
+
title: guideTitle,
|
|
30
|
+
generatedAt: new Date().toISOString(),
|
|
31
|
+
outputDir,
|
|
32
|
+
locales,
|
|
33
|
+
guideSections,
|
|
34
|
+
guideFaqs,
|
|
35
|
+
pages: recipes.map(recipe => ({
|
|
36
|
+
id: recipe.id,
|
|
37
|
+
route: recipe.route,
|
|
38
|
+
captureMode: recipe.captureMode,
|
|
39
|
+
waitFor: recipe.waitFor,
|
|
40
|
+
notes: recipe.notes,
|
|
41
|
+
screenshots: locales.map(locale => ({
|
|
42
|
+
locale,
|
|
43
|
+
path: `assets/${recipe.id}.${locale}.png`,
|
|
44
|
+
})),
|
|
45
|
+
})),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function renderLocaleBlock(locale, recipe) {
|
|
50
|
+
const note = recipe.notes[locale];
|
|
51
|
+
const purposeLabel = locale === 'zh-CN' ? '页面说明' : 'What this page is for';
|
|
52
|
+
const screenshotLabel = locale === 'zh-CN' ? '截图' : 'Screenshot';
|
|
53
|
+
const entryLabel = locale === 'zh-CN' ? '适用场景' : 'When to use';
|
|
54
|
+
const stepsLabel = locale === 'zh-CN' ? '操作步骤' : 'How to use it';
|
|
55
|
+
const checksLabel = locale === 'zh-CN' ? '建议重点查看' : 'What to check';
|
|
56
|
+
const tipsLabel = locale === 'zh-CN' ? '提示' : 'Tip';
|
|
57
|
+
const imagePath = `./assets/${recipe.id}.${locale}.png`;
|
|
58
|
+
const punctuation = locale === 'zh-CN' ? ':' : ': ';
|
|
59
|
+
|
|
60
|
+
return [
|
|
61
|
+
`## ${note.title}`,
|
|
62
|
+
'',
|
|
63
|
+
`- ${purposeLabel}${punctuation}${note.purpose}`,
|
|
64
|
+
`- ${entryLabel}${punctuation}${note.whenToUse}`,
|
|
65
|
+
...note.highlights.map(item => `- ${item}`),
|
|
66
|
+
`- ${stepsLabel}${punctuation}`,
|
|
67
|
+
...note.steps.map((item, index) => ` ${index + 1}. ${item}`),
|
|
68
|
+
`- ${checksLabel}${punctuation}`,
|
|
69
|
+
...note.keyChecks.map(item => ` - ${item}`),
|
|
70
|
+
`- ${tipsLabel}${punctuation}${note.tip}`,
|
|
71
|
+
`- ${screenshotLabel}${punctuation}`,
|
|
72
|
+
'',
|
|
73
|
+
``,
|
|
74
|
+
'',
|
|
75
|
+
].join('\n');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function renderLocaleSection({ recipes, locale, heading, guideSections = [] }) {
|
|
79
|
+
return [
|
|
80
|
+
`# ${heading}`,
|
|
81
|
+
'',
|
|
82
|
+
renderGuideSections(guideSections),
|
|
83
|
+
'',
|
|
84
|
+
...recipes.map(recipe => renderLocaleBlock(locale, recipe)),
|
|
85
|
+
].join('\n');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function renderGuideSections(sections = []) {
|
|
89
|
+
return sections
|
|
90
|
+
.map(section => [
|
|
91
|
+
`## ${section.title}`,
|
|
92
|
+
'',
|
|
93
|
+
...section.summary.map(item => `- ${item}`),
|
|
94
|
+
'',
|
|
95
|
+
...section.commands.map(command => [
|
|
96
|
+
`### ${command.title}`,
|
|
97
|
+
'',
|
|
98
|
+
`- ${command.description}`,
|
|
99
|
+
'',
|
|
100
|
+
`\`${command.command}\``,
|
|
101
|
+
'',
|
|
102
|
+
].join('\n')),
|
|
103
|
+
...section.points.map(item => `- ${item}`),
|
|
104
|
+
'',
|
|
105
|
+
].join('\n'))
|
|
106
|
+
.join('\n');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function renderFaqSection(title, items = []) {
|
|
110
|
+
return [
|
|
111
|
+
`## ${title}`,
|
|
112
|
+
'',
|
|
113
|
+
...items.map(item => [
|
|
114
|
+
`### ${item.question}`,
|
|
115
|
+
'',
|
|
116
|
+
...item.answer.map(line => `- ${line}`),
|
|
117
|
+
'',
|
|
118
|
+
].join('\n')),
|
|
119
|
+
].join('\n');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function renderMarkdown({ recipes, guideTitle, guideSections, guideFaqs = {} }) {
|
|
123
|
+
const zhSection = renderLocaleSection({
|
|
124
|
+
recipes,
|
|
125
|
+
locale: 'zh-CN',
|
|
126
|
+
heading: '中文',
|
|
127
|
+
guideSections: guideSections['zh-CN'],
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const enSection = renderLocaleSection({
|
|
131
|
+
recipes,
|
|
132
|
+
locale: 'en-US',
|
|
133
|
+
heading: 'English',
|
|
134
|
+
guideSections: guideSections['en-US'],
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const zhFaqSection = renderFaqSection('常见问题', guideFaqs['zh-CN']);
|
|
138
|
+
const enFaqSection = renderFaqSection('FAQ', guideFaqs['en-US']);
|
|
139
|
+
|
|
140
|
+
return [
|
|
141
|
+
`# ${guideTitle}`,
|
|
142
|
+
'',
|
|
143
|
+
'本指南面向外部开发者,整体分为“通用调试能力说明”和“Unity 调试说明”两部分,并补充 4 个核心页面的截图说明。',
|
|
144
|
+
'',
|
|
145
|
+
'- 适用对象:第一次接触 TikTok 小游戏调试工具,或需要快速回顾常用操作的开发者。',
|
|
146
|
+
'- 结构说明:先看通用调试能力,再按需查看 Unity 调试专项内容。',
|
|
147
|
+
'- 阅读方式:建议先看中文,再按需查看英文对照。',
|
|
148
|
+
'- 截图仅用于说明页面布局与关键入口,实际文案可能随版本更新有细微差异。',
|
|
149
|
+
'',
|
|
150
|
+
'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 the 4 core pages.',
|
|
151
|
+
'',
|
|
152
|
+
'- Audience: developers who are new to the TikTok mini-game debugging tool or want a quick refresher on the core workflow.',
|
|
153
|
+
'- Structure: read the general debugging section first, then move to the Unity-specific section when needed.',
|
|
154
|
+
'- Reading tip: start with the Chinese section, then use the English section as needed.',
|
|
155
|
+
'- Screenshots are provided to explain layout and entry points; minor wording may change in future versions.',
|
|
156
|
+
'',
|
|
157
|
+
zhSection,
|
|
158
|
+
'',
|
|
159
|
+
zhFaqSection,
|
|
160
|
+
'',
|
|
161
|
+
enSection,
|
|
162
|
+
'',
|
|
163
|
+
enFaqSection,
|
|
164
|
+
].join('\n');
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async function main() {
|
|
168
|
+
const args = parseArgs(process.argv.slice(2));
|
|
169
|
+
const recipesPath = path.resolve(args.recipes);
|
|
170
|
+
const outputDir = path.resolve(args['output-dir']);
|
|
171
|
+
|
|
172
|
+
if (!args.recipes) {
|
|
173
|
+
throw new Error('Missing required argument: --recipes');
|
|
174
|
+
}
|
|
175
|
+
if (!args['output-dir']) {
|
|
176
|
+
throw new Error('Missing required argument: --output-dir');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const { recipes, locales, guideTitle, guideSections, guideFaqs } = await loadRecipes(recipesPath);
|
|
180
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
181
|
+
|
|
182
|
+
const manifest = buildManifest({ recipes, locales, outputDir, guideTitle, guideSections, guideFaqs });
|
|
183
|
+
const markdown = renderMarkdown({ recipes, locales, guideTitle, guideSections, guideFaqs });
|
|
184
|
+
|
|
185
|
+
fs.writeFileSync(
|
|
186
|
+
path.join(outputDir, 'manifest.json'),
|
|
187
|
+
`${JSON.stringify(manifest, null, 2)}\n`,
|
|
188
|
+
'utf8',
|
|
189
|
+
);
|
|
190
|
+
fs.writeFileSync(path.join(outputDir, 'index.md'), `${markdown}\n`, 'utf8');
|
|
191
|
+
|
|
192
|
+
console.log(`[ttmg-docs] rendered manifest and markdown into ${outputDir}`);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
main().catch(error => {
|
|
196
|
+
console.error('[ttmg-docs] render failed');
|
|
197
|
+
console.error(error);
|
|
198
|
+
process.exit(1);
|
|
199
|
+
});
|