@ttmg/cli 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/public/assets/Detail-1nSjYvRw.js +1 -0
- package/dist/public/assets/Detail-1nSjYvRw.js.br +0 -0
- package/dist/public/assets/MonetizationMode-hwWN5zUT.js +1 -0
- package/dist/public/assets/MonetizationModeSummary-BmvxAKbI.js +1 -0
- package/dist/public/assets/{SectionHeader-CCjfBKcF.js → SectionHeader-BL_bJf61.js} +1 -1
- package/dist/public/assets/{Tag-DON36Of0.js → Tag-B4bSl-_E.js} +1 -1
- package/dist/public/assets/{baseForm-B3oZF8Vp.js → baseForm-zW5Gb1OH.js} +3 -3
- package/dist/public/assets/baseForm-zW5Gb1OH.js.br +0 -0
- package/dist/public/assets/col-vAurEPaC.js +1 -0
- package/dist/public/assets/{compass-bMD5nDM8.js → compass-DEadzu-v.js} +1 -1
- package/dist/public/assets/{index-BKOO94x-.css → index-3FxbJxwu.css} +1 -1
- package/dist/public/assets/index-BCdOYP-_.js +1 -0
- package/dist/public/assets/{index-DH7hBDqZ.js → index-BJmPZor5.js} +1 -1
- package/dist/public/assets/{index-V1Go68Vw.css → index-BRJFt3oz.css} +1 -1
- package/dist/public/assets/index-BRJFt3oz.css.br +0 -0
- package/dist/public/assets/{index-DaOr2P0A.js → index-BXllV1mP.js} +1 -1
- package/dist/public/assets/index-BXllV1mP.js.br +0 -0
- package/dist/public/assets/index-BdixrK5I.css +1 -0
- package/dist/public/assets/index-BdixrK5I.css.br +0 -0
- package/dist/public/assets/{index-CKUVWl_O.css → index-BlG-Rcwd.css} +1 -1
- package/dist/public/assets/{index-CdJUBcSF.js → index-Bpx0cjfq.js} +1 -1
- package/dist/public/assets/index-BuiCnshQ.js +1 -0
- package/dist/public/assets/{index-Cf8aH-xI.js → index-C2jjb4tf.js} +1 -1
- package/dist/public/assets/index-C5k1IRcX.js +1 -0
- package/dist/public/assets/index-C5k1IRcX.js.br +0 -0
- package/dist/public/assets/{index-D4lGRib1.js → index-CHODjAYV.js} +1 -1
- package/dist/public/assets/index-CaArjQkD.js +1 -0
- package/dist/public/assets/index-CaArjQkD.js.br +0 -0
- package/dist/public/assets/index-ChtjciM4.js +1 -0
- package/dist/public/assets/index-ChtjciM4.js.br +0 -0
- package/dist/public/assets/{index-B4j49Ts7.js → index-CozQgXOx.js} +1 -1
- package/dist/public/assets/index-CozQgXOx.js.br +0 -0
- package/dist/public/assets/index-Cw4SLGVh.js +1 -0
- package/dist/public/assets/index-Czg0RYGI.css +1 -0
- package/dist/public/assets/index-Czg0RYGI.css.br +0 -0
- package/dist/public/assets/index-DBDUeSB8.css +1 -0
- package/dist/public/assets/index-DBDUeSB8.css.br +0 -0
- package/dist/public/assets/{index-RYY-l6Oq.css → index-DM7Cg9s9.css} +1 -1
- package/dist/public/assets/index-DVDX92Zz.js +1 -0
- package/dist/public/assets/{index-bASdAMHs.js → index-Db3F1FgQ.js} +1 -1
- package/dist/public/assets/{index-FYgsnJbm.js → index-Dd2Oev0p.js} +1 -1
- package/dist/public/assets/index-DfVst8q1.css +1 -0
- package/dist/public/assets/{index-Ca-cQ1Oq.js → index-DhK1XTMu.js} +1 -1
- package/dist/public/assets/{index-Dv0bhjYp.js → index-Dj0vBPuW.js} +1 -1
- package/dist/public/assets/{index-BzEQAUVA.js → index-Do7tPKef.js} +1 -1
- package/dist/public/assets/index-DpnThngH.js +1 -0
- package/dist/public/assets/index-DyHfBQPm.js +1 -0
- package/dist/public/assets/index-P3QtE2VP.js +1 -0
- package/dist/public/assets/index-P3QtE2VP.js.br +0 -0
- package/dist/public/assets/{index-CAoj7RMM.js → index-QtH0wQu1.js} +1 -1
- package/dist/public/assets/index-qycdeV7S.js +1 -0
- package/dist/public/assets/index-qycdeV7S.js.br +0 -0
- package/dist/public/assets/{index-VzIFpCiL.js → index-vuGJOmRn.js} +1 -1
- package/dist/public/assets/index-wqj8y8SZ.js +21 -0
- package/dist/public/assets/index-wqj8y8SZ.js.br +0 -0
- package/dist/public/assets/layers-DDrUeTNf.js +1 -0
- package/dist/public/assets/{list-checks-B6t2uu5m.js → list-checks-C4ci4EKo.js} +1 -1
- package/dist/public/assets/{sparkles-pLu1TMVV.js → sparkles-PwlPP_sT.js} +1 -1
- package/dist/public/assets/{triangle-alert-Dm4_sEwV.js → triangle-alert-BAadCxAv.js} +1 -1
- package/dist/public/assets/{zap-tefJh46p.js → zap-CgIIDLY4.js} +1 -1
- package/dist/public/index.html +2 -2
- package/dist/scripts/docs/capture.js +7 -1
- package/dist/scripts/docs/render.js +89 -6
- package/dist/scripts/docs/scenarios/devtool-guide.mjs +148 -29
- package/package.json +1 -1
- package/dist/public/assets/Detail-DNF1PK-R.js +0 -1
- package/dist/public/assets/Detail-DNF1PK-R.js.br +0 -0
- package/dist/public/assets/MonetizationMode-C59U6Ari.js +0 -1
- package/dist/public/assets/MonetizationModeSummary-BR2LJFsU.js +0 -1
- package/dist/public/assets/baseForm-B3oZF8Vp.js.br +0 -0
- package/dist/public/assets/boxes-EbMNfQ6U.js +0 -1
- package/dist/public/assets/chevron-right-CsmjM7t0.js +0 -1
- package/dist/public/assets/col-DWGIx7fj.js +0 -1
- package/dist/public/assets/index-B4j49Ts7.js.br +0 -0
- package/dist/public/assets/index-B5JnznvI.js +0 -1
- package/dist/public/assets/index-BCV7VBUL.js +0 -1
- package/dist/public/assets/index-BCV7VBUL.js.br +0 -0
- package/dist/public/assets/index-BPqSXmk6.js +0 -1
- package/dist/public/assets/index-Bn_Zugqv.js +0 -1
- package/dist/public/assets/index-Bn_Zugqv.js.br +0 -0
- package/dist/public/assets/index-BtO50Nho.js +0 -1
- package/dist/public/assets/index-BtO50Nho.js.br +0 -0
- package/dist/public/assets/index-CMwzPrAh.css +0 -1
- package/dist/public/assets/index-CMwzPrAh.css.br +0 -0
- package/dist/public/assets/index-D5-FwYf-.js +0 -1
- package/dist/public/assets/index-D5-FwYf-.js.br +0 -0
- package/dist/public/assets/index-DOMxPC_v.css +0 -1
- package/dist/public/assets/index-DOMxPC_v.css.br +0 -0
- package/dist/public/assets/index-DRr-Punk.js +0 -1
- package/dist/public/assets/index-DV0N-QmJ.js +0 -1
- package/dist/public/assets/index-DV0N-QmJ.js.br +0 -0
- package/dist/public/assets/index-DXEfgIqc.js +0 -1
- package/dist/public/assets/index-DaOr2P0A.js.br +0 -0
- package/dist/public/assets/index-Dx-boSFk.js +0 -1
- package/dist/public/assets/index-Dx5VGEQm.css +0 -1
- package/dist/public/assets/index-V1Go68Vw.css.br +0 -0
- package/dist/public/assets/index-VvBtuIHK.css +0 -1
- package/dist/public/assets/index-VvBtuIHK.css.br +0 -0
- package/dist/public/assets/index-VvUpVuij.js +0 -21
- package/dist/public/assets/index-VvUpVuij.js.br +0 -0
- package/dist/public/assets/index-q7fKJFmZ.js +0 -1
- package/dist/public/assets/layers-C8HCSIXn.js +0 -1
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a}from"./index-wqj8y8SZ.js";const o=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],c=a("chevron-right",o);const e=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],h=a("layers",e);export{c as C,h as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./index-
|
|
1
|
+
import{c}from"./index-wqj8y8SZ.js";const e=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],t=c("list-checks",e);export{t as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a}from"./index-
|
|
1
|
+
import{c as a}from"./index-wqj8y8SZ.js";const e=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],l=a("sparkles",e);export{l as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./index-
|
|
1
|
+
import{c as e}from"./index-wqj8y8SZ.js";const a=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],o=e("triangle-alert",a);export{o as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a}from"./index-
|
|
1
|
+
import{c as a}from"./index-wqj8y8SZ.js";const o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],e=a("zap",o);export{e as Z};
|
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-wqj8y8SZ.js"></script>
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BRJFt3oz.css">
|
|
17
17
|
</head>
|
|
18
18
|
<!--
|
|
19
19
|
Theme attributes (`theme-mode` for Semi UI + `data-theme` for our
|
|
@@ -271,6 +271,12 @@ function getRecipeWaitFor(recipe) {
|
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
function createLocalizedRecipeUrl(baseUrl, route, locale) {
|
|
275
|
+
const url = new URL(route, baseUrl);
|
|
276
|
+
url.searchParams.set('docLang', locale);
|
|
277
|
+
return url.toString();
|
|
278
|
+
}
|
|
279
|
+
|
|
274
280
|
async function main() {
|
|
275
281
|
const args = parseArgs(process.argv.slice(2));
|
|
276
282
|
const baseUrl = args['base-url'];
|
|
@@ -365,7 +371,7 @@ async function main() {
|
|
|
365
371
|
headers: requestHeaders,
|
|
366
372
|
});
|
|
367
373
|
await setViewport(Emulation, viewport.width, viewport.height);
|
|
368
|
-
await navigateAndWait(client, Page,
|
|
374
|
+
await navigateAndWait(client, Page, createLocalizedRecipeUrl(baseUrl, recipe.route, locale));
|
|
369
375
|
await waitForSelector(Runtime, waitFor.selector, waitFor.timeoutMs || 20000);
|
|
370
376
|
await stabilizePage(Runtime);
|
|
371
377
|
await wait(500);
|
|
@@ -294,6 +294,7 @@ function renderCommand({ title, description, command }, headingLevel = 3) {
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
const zhSectionNumbers = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'];
|
|
297
|
+
const enSectionNumbers = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X'];
|
|
297
298
|
|
|
298
299
|
function formatSectionTitle(locale, index, title) {
|
|
299
300
|
if (!index) {
|
|
@@ -302,7 +303,7 @@ function formatSectionTitle(locale, index, title) {
|
|
|
302
303
|
if (locale === 'zh-CN') {
|
|
303
304
|
return `${zhSectionNumbers[index - 1] || index}、${title}`;
|
|
304
305
|
}
|
|
305
|
-
return `${index}. ${title}`;
|
|
306
|
+
return `${enSectionNumbers[index - 1] || index}. ${title}`;
|
|
306
307
|
}
|
|
307
308
|
|
|
308
309
|
function renderGettingStarted(locale, sectionIndex) {
|
|
@@ -375,6 +376,7 @@ function renderIntro(locale, sectionIndex) {
|
|
|
375
376
|
'- 如果你只是想把项目跑起来,先看“开始之前”和“开始调试”。',
|
|
376
377
|
'- 如果你要确认项目配置是否完整,看“项目概览”。',
|
|
377
378
|
'- 如果你要接入登录、分享、广告、内购、直玩卡等平台能力,看“接入助手”。',
|
|
379
|
+
'- 如果你要优化 Unity Wasm 或了解待开放的非 Unity 子包收集,看“性能优化”。',
|
|
378
380
|
'- 如果你准备提交预览版本,看“上传发布”。',
|
|
379
381
|
'',
|
|
380
382
|
].join('\n');
|
|
@@ -388,6 +390,7 @@ function renderIntro(locale, sectionIndex) {
|
|
|
388
390
|
'- To get the project running, start with “Before You Start” and “Start Debugging”.',
|
|
389
391
|
'- To verify project setup, read “Project Overview”.',
|
|
390
392
|
'- To integrate login, sharing, ads, IAP, direct-play cards, or other platform capabilities, read “Integration Assistant”.',
|
|
393
|
+
'- To optimize Unity Wasm or preview the coming-soon non-Unity subpackage flow, read “Performance Optimization”.',
|
|
391
394
|
'- To prepare a preview build, read “Upload & Publish”.',
|
|
392
395
|
'',
|
|
393
396
|
].join('\n');
|
|
@@ -474,6 +477,39 @@ function renderIntegrationAssistantSection({ recipes, locale, sectionIndex }) {
|
|
|
474
477
|
].join('\n');
|
|
475
478
|
}
|
|
476
479
|
|
|
480
|
+
function renderPerformanceOptimizationSection({ recipes, locale, sectionIndex }) {
|
|
481
|
+
const subpackage = getRecipeById(recipes, 'subpackage-collect');
|
|
482
|
+
const wasm = getRecipeById(recipes, 'wasm-split');
|
|
483
|
+
|
|
484
|
+
if (locale === 'zh-CN') {
|
|
485
|
+
return [
|
|
486
|
+
`## ${formatSectionTitle(locale, sectionIndex, '性能优化')}`,
|
|
487
|
+
'',
|
|
488
|
+
'### 如何选择',
|
|
489
|
+
'',
|
|
490
|
+
'- 非 Unity 小游戏可先了解“子包收集(待开放)”,并阅读[子包收集使用指南](https://bytedance.my.larkoffice.com/docx/MIyMdmzb0oOQAKxNHGNmR5hDyAh)。正式开放后,DevTool 会按真实启动路径采集预下载子包,并生成预加载配置。',
|
|
491
|
+
'- Unity 小游戏继续使用“Wasm 分包”,将 Wasm 代码拆分为按需加载的子包。',
|
|
492
|
+
'- 两条链路面向不同运行时,不能混用。当前子包收集仅展示入口和边界,不代表能力已经正式开放。',
|
|
493
|
+
'',
|
|
494
|
+
subpackage ? renderRecipeBlock(locale, subpackage, 3) : '',
|
|
495
|
+
wasm ? renderRecipeBlock(locale, wasm, 3) : '',
|
|
496
|
+
].join('\n');
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
return [
|
|
500
|
+
`## ${formatSectionTitle(locale, sectionIndex, 'Performance Optimization')}`,
|
|
501
|
+
'',
|
|
502
|
+
'### Choose the Right Flow',
|
|
503
|
+
'',
|
|
504
|
+
'- Non-Unity mini games can preview Subpackage Collection (Coming Soon) and read the [Subpackage Collection Guide](https://bytedance.my.larkoffice.com/docx/MIyMdmzb0oOQAKxNHGNmR5hDyAh). After release, DevTool will capture subpackages downloaded along the real startup path and generate preload configuration.',
|
|
505
|
+
'- Unity mini games should continue to use Wasm Split to move Wasm code into on-demand subpackages.',
|
|
506
|
+
'- These flows target different runtimes and are not interchangeable. The current Subpackage Collection page previews the entry and boundaries; it does not mean the feature is generally available.',
|
|
507
|
+
'',
|
|
508
|
+
subpackage ? renderRecipeBlock(locale, subpackage, 3) : '',
|
|
509
|
+
wasm ? renderRecipeBlock(locale, wasm, 3) : '',
|
|
510
|
+
].join('\n');
|
|
511
|
+
}
|
|
512
|
+
|
|
477
513
|
function renderUploadPublishSection({ recipes, locale, sectionIndex }) {
|
|
478
514
|
const upload = getRecipeById(recipes, 'upload-publish');
|
|
479
515
|
const restricted = getRecipeById(recipes, 'upload-game-restricted');
|
|
@@ -576,7 +612,8 @@ function renderSidebarModules({ recipes, locale }) {
|
|
|
576
612
|
recipes: [byId('project-detail')].filter(Boolean),
|
|
577
613
|
}),
|
|
578
614
|
renderIntegrationAssistantSection({ recipes, locale, sectionIndex: 5 }),
|
|
579
|
-
|
|
615
|
+
renderPerformanceOptimizationSection({ recipes, locale, sectionIndex: 6 }),
|
|
616
|
+
renderUploadPublishSection({ recipes, locale, sectionIndex: 7 }),
|
|
580
617
|
].join('\n');
|
|
581
618
|
}
|
|
582
619
|
|
|
@@ -602,7 +639,8 @@ function renderSidebarModules({ recipes, locale }) {
|
|
|
602
639
|
recipes: [byId('project-detail')].filter(Boolean),
|
|
603
640
|
}),
|
|
604
641
|
renderIntegrationAssistantSection({ recipes, locale, sectionIndex: 5 }),
|
|
605
|
-
|
|
642
|
+
renderPerformanceOptimizationSection({ recipes, locale, sectionIndex: 6 }),
|
|
643
|
+
renderUploadPublishSection({ recipes, locale, sectionIndex: 7 }),
|
|
606
644
|
].join('\n');
|
|
607
645
|
}
|
|
608
646
|
|
|
@@ -619,26 +657,71 @@ function renderFaqSection(title, items = []) {
|
|
|
619
657
|
].join('\n');
|
|
620
658
|
}
|
|
621
659
|
|
|
660
|
+
function renderReferencesSection(locale, sectionIndex) {
|
|
661
|
+
if (locale === 'zh-CN') {
|
|
662
|
+
return [
|
|
663
|
+
`## ${formatSectionTitle(locale, sectionIndex, '更多参考')}`,
|
|
664
|
+
'',
|
|
665
|
+
'- [子包收集使用指南](https://bytedance.my.larkoffice.com/docx/MIyMdmzb0oOQAKxNHGNmR5hDyAh)',
|
|
666
|
+
'- [Unity Wasm 分包指南](https://bytedance.larkoffice.com/wiki/DZDzwzYdDiJpBSkrhcTcWailnuh)',
|
|
667
|
+
'- [Unity 插件更新说明](https://bytedance.larkoffice.com/wiki/OyGMwHVW9iSeneknlOcc2qb6nUh)',
|
|
668
|
+
'- [小游戏运行时与 JSAPI 参考](https://bytedance.larkoffice.com/wiki/GQscwDOQSiPxyjkbzyfckh2pnDg)',
|
|
669
|
+
'',
|
|
670
|
+
].join('\n');
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
return [
|
|
674
|
+
`## ${formatSectionTitle(locale, sectionIndex, 'More References')}`,
|
|
675
|
+
'',
|
|
676
|
+
'- [Subpackage Collection Guide](https://bytedance.my.larkoffice.com/docx/MIyMdmzb0oOQAKxNHGNmR5hDyAh)',
|
|
677
|
+
'- [Unity Wasm Split Guide](https://bytedance.larkoffice.com/wiki/DZDzwzYdDiJpBSkrhcTcWailnuh)',
|
|
678
|
+
'- [Unity Plugin Update Guide](https://bytedance.larkoffice.com/wiki/OyGMwHVW9iSeneknlOcc2qb6nUh)',
|
|
679
|
+
'- [Mini-game Runtime and JSAPI Reference](https://bytedance.larkoffice.com/wiki/GQscwDOQSiPxyjkbzyfckh2pnDg)',
|
|
680
|
+
'',
|
|
681
|
+
].join('\n');
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
function renderNavigation(guideSections = {}) {
|
|
685
|
+
const zh = ['导读', ...(guideSections['zh-CN'] || []), '常见问题', '更多参考'];
|
|
686
|
+
const en = ['Overview', ...(guideSections['en-US'] || []), 'FAQ', 'More References'];
|
|
687
|
+
|
|
688
|
+
return [
|
|
689
|
+
'## 选择语言和模块 / Choose Language and Section',
|
|
690
|
+
'',
|
|
691
|
+
'- 中文',
|
|
692
|
+
...zh.map((item, index) => ` - ${formatSectionTitle('zh-CN', index + 1, item)}`),
|
|
693
|
+
'- English',
|
|
694
|
+
...en.map((item, index) => ` - ${formatSectionTitle('en-US', index + 1, item)}`),
|
|
695
|
+
'',
|
|
696
|
+
].join('\n');
|
|
697
|
+
}
|
|
698
|
+
|
|
622
699
|
function renderMarkdown({ recipes, guideTitle, guideSections, guideFaqs = {} }) {
|
|
623
|
-
const zhFaqSection = renderFaqSection(formatSectionTitle('zh-CN',
|
|
624
|
-
const enFaqSection = renderFaqSection(formatSectionTitle('en-US',
|
|
700
|
+
const zhFaqSection = renderFaqSection(formatSectionTitle('zh-CN', 8, '常见问题'), guideFaqs['zh-CN']);
|
|
701
|
+
const enFaqSection = renderFaqSection(formatSectionTitle('en-US', 8, 'FAQ'), guideFaqs['en-US']);
|
|
625
702
|
|
|
626
703
|
return [
|
|
627
704
|
`# ${guideTitle}`,
|
|
628
705
|
'',
|
|
706
|
+
renderNavigation(guideSections),
|
|
707
|
+
'# 中文',
|
|
708
|
+
'',
|
|
629
709
|
renderIntro('zh-CN', 1),
|
|
630
710
|
renderGettingStarted('zh-CN', 2),
|
|
631
711
|
renderSidebarModules({ recipes, locale: 'zh-CN' }),
|
|
632
712
|
'',
|
|
633
713
|
zhFaqSection,
|
|
634
714
|
'',
|
|
635
|
-
'
|
|
715
|
+
renderReferencesSection('zh-CN', 9),
|
|
716
|
+
'# English',
|
|
636
717
|
'',
|
|
637
718
|
renderIntro('en-US', 1),
|
|
638
719
|
renderGettingStarted('en-US', 2),
|
|
639
720
|
renderSidebarModules({ recipes, locale: 'en-US' }),
|
|
640
721
|
'',
|
|
641
722
|
enFaqSection,
|
|
723
|
+
'',
|
|
724
|
+
renderReferencesSection('en-US', 9),
|
|
642
725
|
].join('\n');
|
|
643
726
|
}
|
|
644
727
|
|
|
@@ -12,11 +12,9 @@ export const guideSource = {
|
|
|
12
12
|
documentId: 'EDxrdwTxfoekL0x3c1xlNj2ygRe',
|
|
13
13
|
observedRevisionId: 2821,
|
|
14
14
|
outline: [
|
|
15
|
-
'中文 / English',
|
|
16
|
-
'开始之前 / Before You Start',
|
|
17
15
|
'使用链路 / Usage Flow',
|
|
18
|
-
'
|
|
19
|
-
'
|
|
16
|
+
'关键步骤 / Key Steps',
|
|
17
|
+
'性能优化 / Performance Optimization',
|
|
20
18
|
'常见问题 / FAQ',
|
|
21
19
|
'更多参考 / More References',
|
|
22
20
|
],
|
|
@@ -113,14 +111,35 @@ export const screenshotInventory = [
|
|
|
113
111
|
id: 'subpackage.collect-ready',
|
|
114
112
|
recipeId: 'subpackage-collect',
|
|
115
113
|
guideSection: 'Performance optimization',
|
|
114
|
+
publishInGuide: true,
|
|
115
|
+
purpose: 'pending-open subpackage collection entry and requirements',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: 'subpackage.collecting',
|
|
119
|
+
recipeId: 'subpackage-collect-collecting',
|
|
120
|
+
guideSection: 'Subpackage Collection (dedicated guide)',
|
|
121
|
+
publishInGuide: false,
|
|
122
|
+
purpose: 'device-connected collection state with current subpackage results',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'subpackage.ready',
|
|
126
|
+
recipeId: 'subpackage-collect-ready',
|
|
127
|
+
guideSection: 'Subpackage Collection (dedicated guide)',
|
|
128
|
+
publishInGuide: false,
|
|
129
|
+
purpose: 'interactive state received and Finish collection unlocked',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: 'subpackage.success',
|
|
133
|
+
recipeId: 'subpackage-collect-success',
|
|
134
|
+
guideSection: 'Subpackage Collection (dedicated guide)',
|
|
116
135
|
publishInGuide: false,
|
|
117
|
-
purpose: '
|
|
136
|
+
purpose: 'configuration written and collected subpackages confirmed',
|
|
118
137
|
},
|
|
119
138
|
{
|
|
120
139
|
id: 'wasm.prepare',
|
|
121
140
|
recipeId: 'wasm-split',
|
|
122
141
|
guideSection: 'Performance optimization',
|
|
123
|
-
publishInGuide:
|
|
142
|
+
publishInGuide: true,
|
|
124
143
|
purpose: 'Unity Wasm split prerequisites and flow',
|
|
125
144
|
},
|
|
126
145
|
];
|
|
@@ -166,7 +185,8 @@ const zhFaqs = [
|
|
|
166
185
|
{
|
|
167
186
|
question: 'Unity 和非 Unity 的分包能力有什么区别?',
|
|
168
187
|
answer: [
|
|
169
|
-
'
|
|
188
|
+
'子包收集目前是待开放功能,正式开放前不要把它作为通用 DevTool 链路使用;Unity 小游戏仍使用 Wasm 分包链路。',
|
|
189
|
+
'后续子包收集开放后,会面向非 Unity 小游戏采集启动阶段预下载的子包,并转换为预加载配置。',
|
|
170
190
|
'Unity 由于 wasmcode 形态暂不能完整预先检查,当前仍需要继续调研并关注页面里的 Wasm Code Split 提示。',
|
|
171
191
|
],
|
|
172
192
|
},
|
|
@@ -206,7 +226,8 @@ const enFaqs = [
|
|
|
206
226
|
{
|
|
207
227
|
question: 'How are Unity and non-Unity subpackage flows different?',
|
|
208
228
|
answer: [
|
|
209
|
-
'
|
|
229
|
+
'Subpackage Collection is currently a coming-soon feature and should not be treated as a general DevTool workflow before it is officially opened. Unity mini games should still use the Wasm Split flow.',
|
|
230
|
+
'After Subpackage Collection is opened, it will target non-Unity mini games and collect subpackages downloaded during startup for preload configuration.',
|
|
210
231
|
'Because Unity uses wasmcode, full precheck is not available yet and still needs investigation. Watch the Wasm Code Split prompts on the page.',
|
|
211
232
|
],
|
|
212
233
|
},
|
|
@@ -223,18 +244,16 @@ export const guideSections = {
|
|
|
223
244
|
'开始调试',
|
|
224
245
|
'项目概览',
|
|
225
246
|
'接入助手',
|
|
226
|
-
'上传发布',
|
|
227
|
-
'网络诊断',
|
|
228
247
|
'性能优化',
|
|
248
|
+
'上传发布',
|
|
229
249
|
],
|
|
230
250
|
'en-US': [
|
|
231
251
|
'Before you start',
|
|
232
252
|
'Start debugging',
|
|
233
253
|
'Project overview',
|
|
234
254
|
'Integration assistant',
|
|
235
|
-
'Upload & publish',
|
|
236
|
-
'Network diagnostics',
|
|
237
255
|
'Performance optimization',
|
|
256
|
+
'Upload & publish',
|
|
238
257
|
],
|
|
239
258
|
};
|
|
240
259
|
|
|
@@ -569,10 +588,10 @@ export const recipes = [
|
|
|
569
588
|
page: 'Upload & Publish',
|
|
570
589
|
productArea: 'release',
|
|
571
590
|
route: '/upload_publish?docMode=1&docScenario=upload.permission-restricted',
|
|
572
|
-
selector: '.
|
|
591
|
+
selector: '.error-display',
|
|
573
592
|
viewport: tallViewport,
|
|
574
593
|
capture: {
|
|
575
|
-
selector: '.
|
|
594
|
+
selector: '.error-display',
|
|
576
595
|
viewport: tallViewport,
|
|
577
596
|
mode: 'fullPage',
|
|
578
597
|
},
|
|
@@ -687,59 +706,159 @@ export const recipes = [
|
|
|
687
706
|
page: 'Subpackage Collection',
|
|
688
707
|
productArea: 'performance',
|
|
689
708
|
route: '/subpackage_collect?docMode=1&docScenario=subpackage.collect-ready',
|
|
690
|
-
selector: '
|
|
709
|
+
selector: '[data-doc-shot="subpackage-entry"]',
|
|
691
710
|
viewport: tallViewport,
|
|
692
711
|
capture: {
|
|
693
|
-
selector: '
|
|
712
|
+
selector: '[data-doc-shot="subpackage-entry"]',
|
|
694
713
|
viewport: tallViewport,
|
|
695
714
|
mode: 'fullPage',
|
|
696
715
|
},
|
|
697
716
|
fixture: {
|
|
698
717
|
kind: 'runtime',
|
|
699
718
|
scenario: 'non-unity-game-collect-ready',
|
|
700
|
-
required: ['subpackageEntries', '
|
|
719
|
+
required: ['subpackageEntries', 'tiktokRegion'],
|
|
701
720
|
},
|
|
702
721
|
doc: {
|
|
703
722
|
section: 'Performance optimization',
|
|
704
723
|
anchor: 'subpackage-collection',
|
|
705
|
-
intent: '
|
|
724
|
+
intent: 'introduce the subpackage collection entry and its requirements',
|
|
706
725
|
},
|
|
707
726
|
acceptance: [
|
|
727
|
+
'entry requirements are visible before the collection workflow starts',
|
|
728
|
+
'reportScene({sceneId:9999}) is presented as a required game-code integration before collection',
|
|
708
729
|
'Unity projects do not show the collection operation area',
|
|
709
|
-
'requirements
|
|
730
|
+
'requirements state that US-region accounts cannot collect functions',
|
|
710
731
|
'collection status and upload progress stay in the same state module',
|
|
711
732
|
],
|
|
712
733
|
notes: notes(
|
|
713
734
|
{
|
|
714
|
-
title: '
|
|
715
|
-
purpose: '
|
|
716
|
-
whenToUse: '
|
|
735
|
+
title: '子包收集(待开放)',
|
|
736
|
+
purpose: '正式开放后,DevTool 会记录真实启动过程中被预下载的子包,并把结果转换为预加载配置,帮助非 Unity 小游戏减少首屏等待。',
|
|
737
|
+
whenToUse: '当前用于提前了解功能入口、适用范围和未来操作流程;正式开放后,非 Unity 小游戏可在需要优化冷启动时使用。',
|
|
717
738
|
steps: [
|
|
718
|
-
'
|
|
739
|
+
'等待功能正式开放;当前页面仅用于预览能力和接入要求。',
|
|
740
|
+
'开放后,在「性能优化」中进入「收集子包」。',
|
|
741
|
+
'开始收集前,在游戏代码中接入 `TTMinis.game.reportScene`,并在可交互时传入 `sceneId: 9999`。',
|
|
742
|
+
'确认手机 TikTok 登录的是非 US 地区账号。',
|
|
719
743
|
'扫码后按真实启动路径操作游戏。',
|
|
720
|
-
'
|
|
744
|
+
'调试页面收到 `reportScene({sceneId:9999})` 后,检查结果并完成收集。',
|
|
721
745
|
],
|
|
722
746
|
keyChecks: [
|
|
747
|
+
'当前是待开放功能,不能作为正式生产流程使用。',
|
|
748
|
+
'`reportScene({sceneId:9999})` 是代码必接项;未收到上报时不能完成收集。',
|
|
723
749
|
'US 账号无法收集函数,需要直接提示。',
|
|
724
750
|
'Unity 小游戏不支持该收集链路。',
|
|
725
751
|
],
|
|
726
752
|
},
|
|
727
753
|
{
|
|
728
|
-
title: 'Subpackage Collection',
|
|
729
|
-
purpose: '
|
|
730
|
-
whenToUse: 'Use
|
|
754
|
+
title: 'Subpackage Collection (Coming Soon)',
|
|
755
|
+
purpose: 'After release, DevTool will record subpackages downloaded during a real startup run and convert the result into preload configuration to reduce first-screen waiting for non-Unity mini games.',
|
|
756
|
+
whenToUse: 'Use the current page to preview the entry, scope, and future workflow. After official release, non-Unity mini games can use it for cold-start optimization.',
|
|
731
757
|
steps: [
|
|
732
|
-
'
|
|
758
|
+
'Wait for the feature to be officially released. The current page is a preview of the capability and requirements.',
|
|
759
|
+
'After release, open Subpackage Collection from Performance optimization.',
|
|
760
|
+
'Before collection, integrate `TTMinis.game.reportScene` in the game code and pass `sceneId: 9999` when the game becomes interactive.',
|
|
761
|
+
'Confirm that TikTok on the phone is signed in with a non-US account.',
|
|
733
762
|
'Scan and operate the game through the real startup path.',
|
|
734
|
-
'After the
|
|
763
|
+
'After the debug page receives `reportScene({sceneId:9999})`, review the result and finish collection.',
|
|
735
764
|
],
|
|
736
765
|
keyChecks: [
|
|
766
|
+
'This feature is coming soon and is not yet a production workflow.',
|
|
767
|
+
'`reportScene({sceneId:9999})` is required in game code; collection cannot finish until the report is received.',
|
|
737
768
|
'US accounts cannot collect functions and must be called out directly.',
|
|
738
769
|
'Unity mini-games are not supported by this collection flow.',
|
|
739
770
|
],
|
|
740
771
|
},
|
|
741
772
|
),
|
|
742
773
|
}),
|
|
774
|
+
recipe({
|
|
775
|
+
id: 'subpackage-collect-collecting',
|
|
776
|
+
title: 'Subpackage collection in progress',
|
|
777
|
+
page: 'Subpackage Collection',
|
|
778
|
+
productArea: 'performance',
|
|
779
|
+
route: '/subpackage_collect?docMode=1&docScenario=subpackage.collecting',
|
|
780
|
+
selector: '[data-doc-shot="subpackage-collecting"]',
|
|
781
|
+
viewport: tallViewport,
|
|
782
|
+
capture: {
|
|
783
|
+
selector: '[data-doc-shot="subpackage-collecting"]',
|
|
784
|
+
viewport: tallViewport,
|
|
785
|
+
mode: 'fullPage',
|
|
786
|
+
},
|
|
787
|
+
fixture: {
|
|
788
|
+
kind: 'runtime',
|
|
789
|
+
scenario: 'non-unity-game-collecting',
|
|
790
|
+
required: ['subpackageEntries', 'deviceConnected', 'collectedSubpackages'],
|
|
791
|
+
},
|
|
792
|
+
doc: {
|
|
793
|
+
section: 'Subpackage Collection',
|
|
794
|
+
anchor: 'follow-startup-path',
|
|
795
|
+
intent: 'show the real-device collection state and the current result list',
|
|
796
|
+
},
|
|
797
|
+
acceptance: [
|
|
798
|
+
'device-connected collecting state is visible',
|
|
799
|
+
'collected subpackages are visible without a real device or QR payload',
|
|
800
|
+
'the screen remains scoped to the non-Unity collection workflow',
|
|
801
|
+
],
|
|
802
|
+
}),
|
|
803
|
+
recipe({
|
|
804
|
+
id: 'subpackage-collect-ready',
|
|
805
|
+
title: 'Subpackage collection ready to finish',
|
|
806
|
+
page: 'Subpackage Collection',
|
|
807
|
+
productArea: 'performance',
|
|
808
|
+
route: '/subpackage_collect?docMode=1&docScenario=subpackage.ready',
|
|
809
|
+
selector: '[data-doc-shot="subpackage-ready"]',
|
|
810
|
+
viewport: tallViewport,
|
|
811
|
+
capture: {
|
|
812
|
+
selector: '[data-doc-shot="subpackage-ready"]',
|
|
813
|
+
viewport: tallViewport,
|
|
814
|
+
mode: 'fullPage',
|
|
815
|
+
},
|
|
816
|
+
fixture: {
|
|
817
|
+
kind: 'runtime',
|
|
818
|
+
scenario: 'non-unity-game-report-scene-received',
|
|
819
|
+
required: ['subpackageEntries', 'reportSceneReceived', 'collectedSubpackages'],
|
|
820
|
+
},
|
|
821
|
+
doc: {
|
|
822
|
+
section: 'Subpackage Collection',
|
|
823
|
+
anchor: 'report-interactive-state',
|
|
824
|
+
intent: 'show that reportScene unlocks Finish collection',
|
|
825
|
+
},
|
|
826
|
+
acceptance: [
|
|
827
|
+
'reportScene completion state is visible',
|
|
828
|
+
'Finish collection is unlocked only after reportScene({sceneId:9999}) is received',
|
|
829
|
+
'current results can be reviewed before configuration is written',
|
|
830
|
+
'no real account, device address, or QR payload is visible',
|
|
831
|
+
],
|
|
832
|
+
}),
|
|
833
|
+
recipe({
|
|
834
|
+
id: 'subpackage-collect-success',
|
|
835
|
+
title: 'Subpackage collection configuration written',
|
|
836
|
+
page: 'Subpackage Collection',
|
|
837
|
+
productArea: 'performance',
|
|
838
|
+
route: '/subpackage_collect?docMode=1&docScenario=subpackage.success',
|
|
839
|
+
selector: '[data-doc-shot="subpackage-success"]',
|
|
840
|
+
viewport: tallViewport,
|
|
841
|
+
capture: {
|
|
842
|
+
selector: '[data-doc-shot="subpackage-success"]',
|
|
843
|
+
viewport: tallViewport,
|
|
844
|
+
mode: 'fullPage',
|
|
845
|
+
},
|
|
846
|
+
fixture: {
|
|
847
|
+
kind: 'runtime',
|
|
848
|
+
scenario: 'non-unity-game-config-written',
|
|
849
|
+
required: ['subpackageEntries', 'writtenPreloadConfig'],
|
|
850
|
+
},
|
|
851
|
+
doc: {
|
|
852
|
+
section: 'Subpackage Collection',
|
|
853
|
+
anchor: 'finish-collection',
|
|
854
|
+
intent: 'show the final configuration-written state',
|
|
855
|
+
},
|
|
856
|
+
acceptance: [
|
|
857
|
+
'configuration-written result is visible',
|
|
858
|
+
'result list can be reviewed without a real project',
|
|
859
|
+
'recollect and entry-switch actions remain secondary to the result',
|
|
860
|
+
],
|
|
861
|
+
}),
|
|
743
862
|
recipe({
|
|
744
863
|
id: 'wasm-split',
|
|
745
864
|
title: 'Wasm split',
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as aa,b as F,f as pe,u as Ae,r as n,i as a,j as e,p as ta,k as sa,T as l,C as Z,B as w,m as C,d as ia,n as we,Q as ra,N as Oe,q as na,A as ca,P as la}from"./index-VvUpVuij.js";import{E as da}from"./index-bASdAMHs.js";import{S as le}from"./SectionHeader-CCjfBKcF.js";import{C as W,T as oa}from"./Tag-DON36Of0.js";import{P as ua}from"./index-CAoj7RMM.js";import{F as L}from"./baseForm-B3oZF8Vp.js";import{c as pa,i as ga}from"./index-D4lGRib1.js";import{L as ma}from"./list-checks-B6t2uu5m.js";import{S as ya}from"./sparkles-pLu1TMVV.js";import"./col-DWGIx7fj.js";import"./index-DaOr2P0A.js";const ha=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],xa=aa("book-open",ha);function fa(t={}){return F({url:"/game/direct-feed-card/list",method:"POST",data:t})}function ja(t={}){return F({url:"/game/direct-feed-card/scenarios",method:"POST",data:t})}function _a(t){return F({url:"/game/direct-feed-card/create",method:"POST",data:t})}function Pa(t){return F({url:"/game/direct-feed-card/asset-preview",method:"POST",data:t})}function ba(t){return F({url:"/game/direct-feed-card/status",method:"POST",data:t})}function va(t={}){return F({url:"/game/assets",method:"POST",data:t})}const Na="fyf_promotion_direct_feed_play",De="direct-play-debug",de="__create_direct_play_card__",oe="recover_stamina_dynamic",Sa=0,ee=1,Ca=2,U=String(Ca),Ta={cardName:"",cardDesc:"",cardType:U,scenario:oe,subPkg:"__GAME__",params:""};function T(t,c){if(typeof t=="string"&&t.trim())return t;if(t&&typeof t=="object"){const i=t;if(i.errorMsg)return i.errorMsg;if(i.StatusMessage)return i.StatusMessage;if(i.message)return i.message}return c}function Ia(t){return t?t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(2)} MB`:"-"}function ka(t){return t?new Date(t*1e3).toLocaleString():"-"}function Ea(t){return t==="preview"?a("ia.directPlay.stage2.assetGroup.preview"):t==="live"?a("ia.directPlay.stage2.assetGroup.live"):a("ia.directPlay.stage2.assetGroup.review")}function wa(t){return{...t||Oe,scene:Na}}function Da(t){return t.pkgType==="independent"?t.independentPkg||t.pkgName||a("independentPackage"):a("gameMainPackage")}function J(t){return!t||t==="__GAME__"?a("gameMainPackage"):t}function $e(t){const c=String(t||"").trim();return c?c==="reward_issue_static"||c==="reward_issue_dynamic"?a("ia.directPlay.stage2.create.scenario.rewardIssue"):c==="recover_stamina_static"||c==="recover_stamina_dynamic"||c==="strength_recovery"?a("ia.directPlay.stage2.create.scenario.recoverStamina"):c==="unlock_level_static"||c==="unlock_level_dynamic"?a("ia.directPlay.stage2.create.scenario.unlockLevel"):c==="recall_scenario"?a("ia.directPlay.stage2.create.scenario.rewardIssue"):"":""}function R(t,c){if(!t)return"-";const i=$e(t);return i||(c?.[t]?c[t]:t)}function La(t){const c=String(t||"").trim();if(c.endsWith("_static"))return 1;if(c.endsWith("_dynamic"))return 2}function Le(t,c){const i=Number(c),g=t.cardType===void 0?La(t.value):Number(t.cardType);return g===void 0||g===i}function Me(t,c){const i=new Set;return t.filter(g=>{const _=R(g.value,c);return i.has(_)?!1:(i.add(_),!0)})}function Ma(t){return t?Number(t.audit_status)===1?a("ia.directPlay.stage2.cardStatus.approved"):Number(t.audit_status)===0||Number(t.status)===0?a("ia.directPlay.stage2.cardStatus.pending"):"":""}function ue(t){return Number(t?.status)===ee}function Aa(t){return t?ue(t)?a("ia.directPlay.stage3.cardStatus.online"):a("ia.directPlay.stage3.cardStatus.notOnline"):"-"}function Oa(t,c){const i=t?.direct_feed_card||{},g=String(t?.content_id||i.content_id||"").trim();return g?{audit_status:Number(i.audit_status??1),status:Number(i.status??1),content_id:g,card_name:String(i.card_name||c.cardName),card_desc:String(i.card_desc||c.cardDesc),card_type:Number(i.card_type??c.cardType),scenario:String(i.scenario||c.scenario),sub_pkg:String(i.sub_pkg||c.subPkg),params:String(i.params||c.params||""),priority:i.priority===void 0?void 0:Number(i.priority)}:null}function X(){return[{value:oe,label:R(oe)}]}const $a=()=>{const t=pe(),{state:{selectedLaunchOption:c,gameDetail:i,launchOptions:g,packages:_},setLaunchOptions:d,setSelectedLaunchOption:p}=Ae(),[I,B]=n.useState([]),[k,M]=n.useState([]),[P,V]=n.useState("select"),[j,Q]=n.useState(""),[A,ge]=n.useState(""),[me,Y]=n.useState(""),[ye,he]=n.useState(""),[xe,G]=n.useState(""),[fe,ae]=n.useState(""),[je,te]=n.useState(""),[_e,z]=n.useState(""),[Pe,se]=n.useState(""),[be,ve]=n.useState(!0),[Ke,Ne]=n.useState(!1),[Re,Se]=n.useState(!1),[Ce,Te]=n.useState(!1),[Ie,ie]=n.useState(U),[O,ke]=n.useState(X),E=n.useRef(null),re=n.useMemo(()=>wa(c),[c]),m=n.useMemo(()=>({appId:i?.app_id,clientKey:i?.client_key,miniGameId:i?.app_id}),[i?.app_id,i?.client_key]),u=n.useMemo(()=>I.find(s=>s.content_id===j)||null,[I,j]),$=n.useMemo(()=>k.find(s=>s.asset_id===A)||null,[k,A]),N=n.useMemo(()=>O.reduce((s,r)=>(r?.value&&(s[r.value]=$e(r.value)||(r.label&&r.label!==r.value?r.label:r.value)),s),{}),[O]),H=n.useMemo(()=>{const s=O.filter(o=>Le(o,Ie)),r=s.length>0?s:X();return Me(r,N).map(o=>({...o,label:R(o.value,N)}))},[Ie,N,O]),Fe=n.useMemo(()=>k.map(s=>({label:`${s.file_name||s.asset_id} · v${s.version||"-"}`,value:s.asset_id})),[k]),Ve=n.useMemo(()=>[{label:a("ia.directPlay.stage2.create.option"),value:de},...I.map(s=>({label:`${s.card_name} · ${R(s.scenario,N)} · ${J(s.sub_pkg)}`,value:s.content_id}))],[I,N]),Ge=n.useMemo(()=>[{label:a("ia.directPlay.stage2.create.cardType.fixed"),value:"1"},{label:a("ia.directPlay.stage2.create.cardType.dynamic"),value:"2"}],[]),qe=n.useMemo(()=>{const s=new Set(["__GAME__"]);return(_||[]).forEach(r=>{r?.type==="independent"&&r.name&&s.add(r.name)}),g.forEach(r=>{r.pkgType==="independent"&&r.independentPkg&&s.add(r.independentPkg)}),Array.from(s).map(r=>({label:J(r),value:r}))},[g,_]),Ue=n.useMemo(()=>e.jsxs("span",{className:"integration-assistant-direct-play-label-with-info",children:[e.jsx("span",{children:a("ia.directPlay.stage2.create.cardType")}),e.jsx(ta,{position:"top",trigger:"hover",showArrow:!0,content:e.jsxs("div",{className:"integration-assistant-direct-play-info-popover",children:[e.jsx(l.Text,{children:a("ia.directPlay.stage2.create.cardType.dynamicDesc")}),e.jsx(l.Text,{children:a("ia.directPlay.stage2.create.cardType.fixedDesc")})]}),children:e.jsx("span",{className:"integration-assistant-direct-play-info-icon","aria-label":"card type info",children:e.jsx(sa,{})})})]}),[]),Be=n.useCallback(s=>{const r=String(s||U);ie(r);const o=O.filter(h=>Le(h,r)),f=o.length>0?Me(o,N):X(),x=f[0]?.value,b=E.current?.getValue?.("scenario"),S=f.some(h=>h.value===b);E.current?.setValue?.("cardType",r),x&&!S&&E.current?.setValue?.("scenario",x)},[N,O]),D=n.useCallback(async s=>{ve(!0),he("");try{const[r,o,f]=await Promise.allSettled([fa({appId:m.appId,clientKey:m.clientKey}),va({appId:m.appId,miniGameId:m.miniGameId,clientKey:m.clientKey}),ja({appId:m.appId,clientKey:m.clientKey})]),x=r.status==="fulfilled"?r.value:null,b=o.status==="fulfilled"?o.value:null,S=f.status==="fulfilled"?f.value:null;if(r.status==="rejected"||x?.error||x?.code!==0||!x?.data)throw new Error(T(x?.error,a("ia.directPlay.stage2.loadCardsFailed")));if(o.status==="rejected"||b?.error||b?.code!==0||!b?.data)throw new Error(T(b?.error,a("ia.directPlay.stage2.loadAssetsFailed")));const h=x.data.cards||[],q=(b.data.preview_assets||[]).map(y=>({...y,group:"preview"}));B(h),M(q),S?.code===0&&S.data?.scenarios?.length?ke(S.data.scenarios):ke(y=>y.length>0?y:X()),Q(y=>{if(s?.contentId&&h.some(v=>v.content_id===s.contentId))return s.contentId;if(s?.cardName){const v=h.find(ce=>ce.card_name===s.cardName);if(v?.content_id)return v.content_id}return y&&h.some(v=>v.content_id===y)?y:h[0]?.content_id||""}),ge(y=>y&&q.some(v=>v.asset_id===y)?y:q[0]?.asset_id||"")}catch(r){he(T(r,a("ia.directPlay.stage2.loadResourcesFailed")))}finally{ve(!1)}},[m.appId,m.clientKey,m.miniGameId]);n.useEffect(()=>{D()},[D]),n.useEffect(()=>{z(""),se("")},[j]),n.useEffect(()=>{const s=H[0]?.value;if(!s)return;const r=E.current?.getValue?.("scenario");H.some(f=>f.value===r)||E.current?.setValue?.("scenario",s)},[H]);const Qe=n.useCallback(()=>{const s={...re,id:De,name:a("ia.directPlay.stage1.generatedModeName")},r=g.filter(x=>x.id!==De),o=r.findIndex(x=>x.id==="created"),f=o>=0?[...r.slice(0,o),s,...r.slice(o)]:[...r,s];d(f),p(s),t("/")},[g,t,d,p,re]),Ye=n.useCallback(async()=>{try{const s=await E.current?.validate(),r=String(s?.cardName||"").trim(),o=String(s?.cardDesc||"").trim(),f=String(s?.scenario||"").trim(),x=String(s?.subPkg||"__GAME__").trim()||"__GAME__",b=String(s?.params||"").trim(),S=Number(s?.cardType||0);if(!r||!o||!f||!S)return;Se(!0),ae(""),te("");const h=await _a({appId:m.appId,clientKey:m.clientKey,directFeedCard:{cardName:r,cardDesc:o,cardType:S,scenario:f,subPkg:x,params:b||void 0}});if(h?.error||h?.code!==0)throw new Error(T(h?.error,a("ia.directPlay.stage2.create.failed")));const q=String(h?.data?.content_id||h?.data?.direct_feed_card?.content_id||""),y=Oa(h?.data,{cardName:r,cardDesc:o,cardType:S,scenario:f,subPkg:x,params:b});await D({contentId:q,cardName:r}),y&&(B(v=>{const ce=v.filter(ea=>ea.content_id!==y.content_id);return[y,...ce]}),Q(y.content_id)),V("select"),te(a("ia.directPlay.stage2.create.success")),G(""),Y(""),E.current?.reset?.(),ie(U)}catch(s){if(s?.name==="ValidateError")return;ae(T(s,a("ia.directPlay.stage2.create.failed")))}finally{Se(!1)}},[D,m.appId,m.clientKey]),ze=n.useCallback(s=>{if(s===de){V("create"),Q(""),G(""),Y("");return}V("select"),Q(s||"")},[]),He=n.useCallback(async()=>{if(!u?.content_id){z(a("ia.directPlay.stage3.selectRequired"));return}const s=ue(u)?Sa:ee,r=s===ee?a("ia.directPlay.stage3.publishFailed"):a("ia.directPlay.stage3.offlineFailed");Te(!0),z(""),se("");try{const o=await ba({appId:m.appId,clientKey:m.clientKey,contentStatus:{[u.content_id]:s}});if(o?.error||o?.code!==0)throw new Error(T(o?.error,r));await D({contentId:u.content_id}),se(s===ee?a("ia.directPlay.stage3.publishSuccess"):a("ia.directPlay.stage3.offlineSuccess"))}catch(o){z(T(o,r))}finally{Te(!1)}},[D,m.appId,m.clientKey,u]),We=n.useCallback(async()=>{if(!j||!A){G(a("ia.directPlay.stage2.selectRequired"));return}Ne(!0),G("");try{const s=await Pa({assetId:A,contentId:j});if(s?.error||s?.code!==0||!s?.data?.preview_url)throw new Error(T(s?.error,a("ia.directPlay.stage2.previewFailed")));Y(s.data.preview_url)}catch(s){Y(""),G(T(s,a("ia.directPlay.stage2.previewFailed")))}finally{Ne(!1)}},[A,j]),Je=be||Ce,Xe=P==="select",Ze=!!u?.content_id,ne=ue(u),Ee=Je||!Xe||!Ze;return e.jsxs("div",{className:"integration-assistant-direct-play-grid",children:[e.jsxs(Z,{className:"integration-assistant-direct-play-card",bordered:!0,children:[e.jsx("div",{className:"integration-assistant-section-head",children:e.jsxs("div",{children:[e.jsx(l.Title,{heading:5,children:a("ia.directPlay.stage1.title")}),e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage1.desc")})]})}),e.jsxs("div",{className:"integration-assistant-direct-play-summary",children:[e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage1.modeName")}),e.jsx(l.Text,{children:a("ia.directPlay.stage1.modeValue")})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage1.scene")}),e.jsx(l.Text,{children:a("scene_fyf_promotion_direct_feed_play")})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage1.package")}),e.jsx(l.Text,{children:Da(re)})]})]}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(w,{theme:"solid",onClick:Qe,children:a("ia.directPlay.stage1.createQr")})})]}),e.jsxs(Z,{className:"integration-assistant-direct-play-card",bordered:!0,children:[e.jsx(C,{className:"integration-assistant-direct-play-banner integration-assistant-direct-play-banner-top",fullMode:!1,bordered:!1,closeIcon:null,type:"info",description:a("ia.directPlay.stage2.banner")}),e.jsx("div",{className:"integration-assistant-section-head",children:e.jsxs("div",{className:"integration-assistant-direct-play-stage-head",children:[e.jsx(l.Title,{heading:5,children:a("ia.directPlay.stage2.title")}),e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage2.desc")})]})}),e.jsx(C,{className:"integration-assistant-direct-play-banner integration-assistant-direct-play-banner-inline",fullMode:!1,bordered:!1,closeIcon:null,type:"warning",description:a("ia.directPlay.versionNotice")}),ye?e.jsx(C,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:ye}):null,xe?e.jsx(C,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:xe}):null,fe?e.jsx(C,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:fe}):null,je?e.jsx(C,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"success",description:je}):null,be?e.jsx("div",{className:"integration-assistant-direct-play-loading",children:e.jsx(ia,{size:"large"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"integration-assistant-direct-play-form",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"integration-assistant-direct-play-field-head",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage2.cardSelect")}),e.jsx(w,{theme:"borderless",onClick:()=>D(),children:a("ia.directPlay.stage2.refresh")})]}),e.jsx(we,{className:"integration-assistant-direct-play-select",value:P==="create"?de:j||void 0,optionList:Ve,onChange:s=>ze(s),placeholder:a("ia.directPlay.stage2.cardSelect")})]}),P==="select"?e.jsxs("div",{children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage2.assetSelect")}),e.jsx(we,{className:"integration-assistant-direct-play-select",value:A||void 0,optionList:Fe,onChange:s=>ge(s),placeholder:a("ia.directPlay.stage2.assetSelect")})]}):null]}),P==="create"?e.jsx("div",{className:"integration-assistant-direct-play-create-wrap",children:e.jsxs("div",{className:"integration-assistant-direct-play-panel",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage2.create.title")}),e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage2.create.desc")}),e.jsx(L,{className:"integration-assistant-direct-play-create-form",initValues:Ta,getFormApi:s=>{E.current=s},onValueChange:s=>{if(ae(""),te(""),s&&typeof s=="object"&&"cardType"in s){const r=String(s.cardType||U);ie(r)}},children:e.jsxs("div",{className:"integration-assistant-direct-play-create-grid",children:[e.jsx(L.Input,{field:"cardName",label:a("ia.directPlay.stage2.create.cardName"),placeholder:a("ia.directPlay.stage2.create.cardNamePlaceholder"),rules:[{required:!0,message:a("notEmpty")}]}),e.jsx(L.Select,{field:"cardType",label:Ue,optionList:Ge,onChange:Be,rules:[{required:!0,message:a("notEmpty")}]}),e.jsx(L.Input,{field:"cardDesc",label:a("ia.directPlay.stage2.create.cardDesc"),placeholder:a("ia.directPlay.stage2.create.cardDescPlaceholder"),rules:[{required:!0,message:a("notEmpty")}]}),e.jsx(L.Select,{field:"subPkg",label:a("ia.directPlay.stage2.create.subPkg"),optionList:qe,rules:[{required:!0,message:a("notEmpty")}]}),e.jsx(L.Select,{field:"scenario",label:a("ia.directPlay.stage2.create.scenario"),optionList:H,rules:[{required:!0,message:a("notEmpty")}]}),e.jsx(L.Input,{field:"params",label:a("ia.directPlay.stage2.create.params"),placeholder:a("ia.directPlay.stage2.create.paramsPlaceholder")})]})}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(w,{theme:"solid",type:"primary",loading:Re,onClick:Ye,children:a("ia.directPlay.stage2.create.submit")})})]})}):null,P==="select"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"integration-assistant-direct-play-details",children:[e.jsxs("div",{className:"integration-assistant-direct-play-panel",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage2.selectedCard")}),u?e.jsxs("ul",{className:"integration-assistant-detail-list",children:[e.jsx("li",{children:`${a("ia.directPlay.stage2.cardName")}${u.card_name}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardContentId")}${u.content_id||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardDesc")}${u.card_desc||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardScenario")}${R(u.scenario,N)}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardStatus")}${Ma(u)||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardPackage")}${J(u.sub_pkg)}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardQueries")}${u.params||"-"}`})]}):e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage2.emptyCard")})]}),e.jsxs("div",{className:"integration-assistant-direct-play-panel",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage2.selectedAsset")}),$?e.jsxs("ul",{className:"integration-assistant-detail-list",children:[e.jsx("li",{children:`${a("ia.directPlay.stage2.assetGroup")}${Ea($.group)}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.assetFile")}${$.file_name||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.assetVersion")}${$.version||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.assetSize")}${Ia($.file_size)}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.assetUploaded")}${ka($.uploaded_at)}`})]}):e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage2.emptyAsset")})]})]}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(w,{theme:"solid",loading:Ke,onClick:We,children:a("ia.directPlay.stage2.generate")})})]}):null,P==="select"&&me?e.jsxs("div",{className:"integration-assistant-direct-play-preview",children:[e.jsx("div",{className:"integration-assistant-direct-play-qr",children:e.jsx(ra,{value:me,size:180})}),e.jsx("div",{className:"integration-assistant-direct-play-preview-content",children:e.jsx(l.Text,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage2.qrDesc")})})]}):null]})]}),e.jsxs(Z,{className:"integration-assistant-direct-play-card integration-assistant-direct-play-card-wide",bordered:!0,children:[e.jsx(C,{className:"integration-assistant-direct-play-banner integration-assistant-direct-play-banner-top",fullMode:!1,bordered:!1,closeIcon:null,type:"warning",description:a("ia.directPlay.stage3.banner")}),e.jsx("div",{className:"integration-assistant-section-head",children:e.jsxs("div",{className:"integration-assistant-direct-play-stage-head",children:[e.jsx(l.Title,{heading:5,children:a("ia.directPlay.stage3.title")}),e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage3.desc")})]})}),_e?e.jsx(C,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:_e}):null,Pe?e.jsx(C,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"success",description:Pe}):null,e.jsxs("div",{className:"integration-assistant-direct-play-panel integration-assistant-direct-play-stage3-panel",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage3.selectedCard")}),u?e.jsxs("ul",{className:"integration-assistant-detail-list",children:[e.jsx("li",{children:`${a("ia.directPlay.stage2.cardName")}${u.card_name}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardContentId")}${u.content_id||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardDesc")}${u.card_desc||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardScenario")}${R(u.scenario,N)}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardPackage")}${J(u.sub_pkg)}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardQueries")}${u.params||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage3.publishStatus")}${Aa(u)}`})]}):e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage3.emptyCard")})]}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(ua,{title:a(ne?"ia.directPlay.stage3.offlineConfirmTitle":"ia.directPlay.stage3.confirmTitle",{name:u?.card_name||"-",contentId:u?.content_id||"-"}),onConfirm:He,position:"topLeft",disabled:Ee,children:e.jsx(w,{theme:"solid",type:ne?"danger":"primary",loading:Ce,disabled:Ee,children:ne?a("ia.directPlay.stage3.offline"):a("ia.directPlay.stage3.publish")})})})]})]})},Ka={sidebar_revisit:{modeId:"sidebar-revisit-debug",scene:"center",sceneKey:"scene_center",titleKey:"ia.revisit.sidebar.panel.title",descKey:"ia.revisit.sidebar.panel.desc",modeValueKey:"ia.revisit.sidebar.panel.modeValue",generatedModeNameKey:"ia.revisit.sidebar.panel.generatedModeName",signalValueKey:"ia.revisit.sidebar.panel.signalValue",createQrKey:"ia.revisit.sidebar.panel.createQr"},shortcut_revisit:{modeId:"shortcut-revisit-debug",scene:"desktop_shortcut",sceneKey:"scene_shortcut",titleKey:"ia.revisit.shortcut.panel.title",descKey:"ia.revisit.shortcut.panel.desc",modeValueKey:"ia.revisit.shortcut.panel.modeValue",generatedModeNameKey:"ia.revisit.shortcut.panel.generatedModeName",signalValueKey:"ia.revisit.shortcut.panel.signalValue",createQrKey:"ia.revisit.shortcut.panel.createQr"}};function Ra(t,c){return{...t||Oe,scene:c}}function Fa(t){return t.pkgType==="independent"?t.independentPkg||t.pkgName||a("independentPackage"):a("gameMainPackage")}const Va=({capabilityKey:t})=>{const c=pe(),{state:{selectedLaunchOption:i,launchOptions:g},setLaunchOptions:_,setSelectedLaunchOption:d}=Ae(),p=Ka[t],I=n.useMemo(()=>Ra(i,p.scene),[p.scene,i]),B=n.useCallback(()=>{const k={...I,id:p.modeId,name:a(p.generatedModeNameKey)},M=g.filter(j=>j.id!==p.modeId),P=M.findIndex(j=>j.id==="created"),V=P>=0?[...M.slice(0,P),k,...M.slice(P)]:[...M,k];_(V),d(k),c("/")},[p.generatedModeNameKey,p.modeId,g,c,I,_,d]);return e.jsx("div",{className:"integration-assistant-direct-play-grid",children:e.jsxs(Z,{className:"integration-assistant-direct-play-card",bordered:!0,children:[e.jsx("div",{className:"integration-assistant-section-head",children:e.jsxs("div",{children:[e.jsx(l.Title,{heading:5,children:a(p.titleKey)}),e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a(p.descKey)})]})}),e.jsxs("div",{className:"integration-assistant-direct-play-summary",children:[e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.revisit.panel.modeName")}),e.jsx(l.Text,{children:a(p.modeValueKey)})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.revisit.panel.scene")}),e.jsx(l.Text,{children:a(p.sceneKey)})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.revisit.panel.launchParams")}),e.jsx(l.Text,{children:`scene=${p.scene}`})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.revisit.panel.package")}),e.jsx(l.Text,{children:Fa(I)})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.revisit.panel.signal")}),e.jsx(l.Text,{children:a(p.signalValueKey)})]})]}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(w,{theme:"solid",onClick:B,children:a(p.createQrKey)})})]})})},K=t=>a(t),Za=()=>{const t=pe(),{capabilityKey:c}=na(),i=c?pa[c]:void 0;n.useEffect(()=>{i?.customPath&&t(i.customPath,{replace:!0})},[i,t]);const g=i?.actions.filter(d=>d.labelKey==="ia.action.openCapabilityDoc")||[],_=d=>{if(d.type==="external"&&d.href){window.open(d.href,d.target||"_blank","noopener,noreferrer");return}d.type==="route"&&d.path&&t(d.path)};return!i||ga(i)?e.jsx("div",{className:"ia-page ia-page-detail",children:e.jsxs(W,{padding:"lg",children:[e.jsx(da,{description:a("ia.detail.notFound")}),e.jsx("div",{className:"ia-back-row",children:e.jsx(w,{onClick:()=>t("/integration_assistant"),children:a("ia.detail.backToMap")})})]})}):e.jsxs("div",{className:"ia-page ia-page-detail",children:[e.jsxs("button",{type:"button",className:"ia-back-link",onClick:()=>t("/integration_assistant"),children:[e.jsx(ca,{size:14,strokeWidth:2}),e.jsx("span",{children:a("ia.detail.backToMap")})]}),e.jsx(la,{title:e.jsxs("span",{className:"ia-detail-title-row",children:[e.jsx("span",{className:"ia-detail-glyph","aria-hidden":"true",children:i.icon}),e.jsx("span",{children:K(i.titleKey)})]}),subtitle:K(i.summaryKey),action:g.length?e.jsx("div",{className:"ia-detail-actions",children:g.map(d=>e.jsx(w,{theme:d.theme||"solid",type:"primary",onClick:()=>_(d),children:K(d.labelKey)},`${d.type}:${d.path||d.href||d.labelKey}`))}):null}),i.apiTags.length?e.jsx("div",{className:"ia-detail-tags",children:i.apiTags.map(d=>e.jsx(oa,{tone:"neutral",size:"sm",children:e.jsx("code",{className:"ia-detail-tag-code",children:d})},d))}):null,e.jsxs("div",{className:"ia-detail-grid",children:[e.jsxs(W,{padding:"md",children:[e.jsx(le,{icon:xa,title:a("ia.section.prerequisites"),as:"h3"}),e.jsx("ul",{className:"ia-detail-list",children:i.prerequisiteKeys.map(d=>e.jsxs("li",{className:"ia-detail-list-item",children:[e.jsx("span",{className:"ia-detail-list-bullet","aria-hidden":"true"}),e.jsx("span",{children:K(d)})]},d))})]}),e.jsxs(W,{padding:"md",children:[e.jsx(le,{icon:ma,title:a("ia.section.steps"),as:"h3"}),e.jsx("ol",{className:"ia-detail-steps",children:i.stepKeys.map((d,p)=>e.jsxs("li",{className:"ia-detail-step",children:[e.jsx("span",{className:"ia-detail-step-index",children:p+1}),e.jsx("span",{className:"ia-detail-step-text",children:K(d)})]},d))})]}),e.jsxs(W,{padding:"md",children:[e.jsx(le,{icon:ya,title:a("ia.section.tips"),as:"h3"}),e.jsx("ul",{className:"ia-detail-list",children:i.tipKeys.map(d=>e.jsxs("li",{className:"ia-detail-list-item",children:[e.jsx("span",{className:"ia-detail-list-bullet","aria-hidden":"true"}),e.jsx("span",{children:K(d)})]},d))})]})]}),i.key==="direct_play_card"?e.jsx($a,{}):null,i.key==="sidebar_revisit"||i.key==="shortcut_revisit"?e.jsx(Va,{capabilityKey:i.key}):null]})};export{Za as IntegrationAssistantDetail};
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as l,q as d,r as m,j as i,i as s,B as p,A as x,P as j}from"./index-VvUpVuij.js";import{E as u}from"./index-bASdAMHs.js";import{S as o}from"./SectionHeader-CCjfBKcF.js";import{C as b,T as y}from"./Tag-DON36Of0.js";import{b as g,f as h,C as c,M as v,c as f,a as M}from"./MonetizationModeSummary-BR2LJFsU.js";import"./index-D4lGRib1.js";import{C}from"./compass-bMD5nDM8.js";import"./chevron-right-CsmjM7t0.js";import"./layers-C8HCSIXn.js";const t=e=>s(e),A=()=>{const e=l(),{modeKey:n}=d(),a=n?g[n]:void 0,r=m.useMemo(()=>h,[]);return a?i.jsxs("div",{className:"ia-page ia-page-detail",children:[i.jsxs("button",{type:"button",className:"ia-back-link",onClick:()=>e("/integration_assistant"),children:[i.jsx(x,{size:14,strokeWidth:2}),i.jsx("span",{children:s("ia.detail.backToMap")})]}),i.jsx(j,{title:t(a.titleKey),subtitle:t(a.summaryKey),action:i.jsx(y,{tone:"accent",size:"md",children:t(a.titleKey)})}),i.jsxs("section",{className:"ia-section",children:[i.jsx(o,{icon:c,title:s("ia.monetization.core.title"),subtitle:t(a.descriptionKey)}),i.jsx(v,{mode:a,clickableTags:!0})]}),i.jsxs("section",{className:"ia-section",children:[i.jsx(o,{icon:c,title:s("ia.monetization.core.title")}),i.jsx(f,{capabilityKeys:a.capabilityKeys,capabilityRequirementMap:a.capabilityRequirementMap,columns:2})]}),i.jsxs("section",{className:"ia-section",children:[i.jsx(o,{icon:C,title:s("ia.overview.groups.title"),subtitle:s("ia.overview.groups.desc")}),i.jsx("div",{className:"ia-section-stack",children:i.jsx(M,{sections:r})})]})]}):i.jsx("div",{className:"ia-page ia-page-detail",children:i.jsxs(b,{padding:"lg",children:[i.jsx(u,{description:s("ia.detail.notFound")}),i.jsx("div",{className:"ia-back-row",children:i.jsx(p,{onClick:()=>e("/integration_assistant"),children:s("ia.detail.backToMap")})})]})})};export{A as IntegrationAssistantMonetizationMode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as j,f as z,j as e,i as s,r as x,B as q}from"./index-VvUpVuij.js";import{S as _}from"./SectionHeader-CCjfBKcF.js";import{C as N,T as g}from"./Tag-DON36Of0.js";import{c as b,i as v}from"./index-D4lGRib1.js";import{C as M}from"./chevron-right-CsmjM7t0.js";import{L as R}from"./layers-C8HCSIXn.js";const $=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],S=j("chevron-down",$);const T=[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]],V=j("coins",T),L=[{key:"iaa",titleKey:"ia.monetization.mode.iaa.title",summaryKey:"ia.monetization.mode.iaa.summary",descriptionKey:"ia.monetization.mode.iaa.desc",capabilityKeys:["login","authorize","ad"],capabilityRequirementMap:{login:"required",authorize:"optional",ad:"required"},supportCapabilityKeys:["network","sidebar_revisit","shortcut_revisit"],experimentalCapabilityKeys:["direct_play_card"]},{key:"iap",titleKey:"ia.monetization.mode.iap.title",summaryKey:"ia.monetization.mode.iap.summary",descriptionKey:"ia.monetization.mode.iap.desc",capabilityKeys:["login","authorize","payment"],capabilityRequirementMap:{login:"required",authorize:"optional",payment:"required"},supportCapabilityKeys:["network","sidebar_revisit","shortcut_revisit"],experimentalCapabilityKeys:["direct_play_card"]},{key:"iaap",titleKey:"ia.monetization.mode.iaap.title",summaryKey:"ia.monetization.mode.iaap.summary",descriptionKey:"ia.monetization.mode.iaap.desc",capabilityKeys:["login","authorize","ad","payment"],capabilityRequirementMap:{login:"required",authorize:"optional",ad:"required",payment:"required"},supportCapabilityKeys:["network","sidebar_revisit","shortcut_revisit"],experimentalCapabilityKeys:["direct_play_card"]}],A=L.reduce((a,o)=>(a[o.key]=o,a),{}),E=[{key:"growth",titleKey:"ia.overview.section.growth.title",descriptionKey:"ia.overview.section.growth.desc",capabilityKeys:["sidebar_revisit","shortcut_revisit","direct_play_card"],capabilityRequirementMap:{sidebar_revisit:"required",shortcut_revisit:"required",direct_play_card:"experimental"},sectionClassName:"integration-assistant-map-section-growth",gridClassName:"integration-assistant-map-section-grid-two",defaultCollapsed:!0},{key:"share",titleKey:"ia.overview.section.share.title",descriptionKey:"ia.overview.section.share.desc",capabilityKeys:["share_message","share_story"],capabilityRequirementMap:{share_message:"recommended"},sectionClassName:"integration-assistant-map-section-share",gridClassName:"integration-assistant-map-section-grid-two",defaultCollapsed:!0},{key:"foundation",titleKey:"ia.overview.section.foundation.title",descriptionKey:"ia.overview.section.foundation.desc",capabilityKeys:["ui_adaptation","subpackage","network"],capabilityRequirementMap:{ui_adaptation:"recommended",subpackage:"basic",network:"basic"},sectionClassName:"integration-assistant-map-section-foundation",gridClassName:"integration-assistant-map-section-grid-two",defaultCollapsed:!0}],J=[{key:"identity",titleKey:"ia.overview.section.identity.title",descriptionKey:"ia.overview.section.identity.desc",capabilityKeys:["login","authorize"],capabilityRequirementMap:{login:"required",authorize:"optional"},sectionClassName:"integration-assistant-map-section-identity",gridClassName:"integration-assistant-map-section-grid-two",defaultCollapsed:!0},{key:"monetization",titleKey:"ia.overview.section.monetization.title",descriptionKey:"ia.overview.section.monetization.desc",capabilityKeys:["payment","ad"],sectionClassName:"integration-assistant-map-section-monetization",gridClassName:"integration-assistant-map-section-grid-two",defaultCollapsed:!0},...E],K=a=>s(a),H=a=>a==="required"?s("ia.requirement.required"):a==="optional"?s("ia.requirement.optional"):a==="recommended"?s("ia.requirement.recommended"):a==="basic"?s("ia.requirement.basic"):s("ia.requirement.experimental"),D={required:"accent",recommended:"success",basic:"info",experimental:"warn",optional:"neutral"},I=({capabilityKeys:a,columns:o="auto",capabilityRequirementMap:m})=>{const u=z(),i=a.map(t=>b[t]).filter(t=>!v(t));if(!i.length)return null;const l=i.length===1?"ia-cap-grid-cols-1":`ia-cap-grid-cols-${o}`;return e.jsx("div",{className:`ia-cap-grid ${l}`,children:i.map(t=>{const r=m?.[t.key];return e.jsxs(N,{padding:"md",interactive:!0,onClick:()=>u(t.customPath||`/integration_assistant/${t.key}`),role:"button",tabIndex:0,className:"ia-cap-card",children:[e.jsxs("header",{className:"ia-cap-card-head",children:[e.jsx("span",{className:"ia-cap-card-glyph","aria-hidden":"true",children:t.icon}),e.jsx("div",{className:"ia-cap-card-titlewrap",children:e.jsxs("div",{className:"ia-cap-card-title-row",children:[e.jsx("h4",{className:"ia-cap-card-title",children:K(t.titleKey)}),r?e.jsx(g,{tone:D[r],size:"sm",children:H(r)}):null]})}),e.jsx("span",{className:"ia-cap-card-chevron","aria-hidden":"true",children:e.jsx(M,{size:14,strokeWidth:2})})]}),e.jsx("p",{className:"ia-cap-card-summary",children:K(t.summaryKey)}),t.apiTags.length?e.jsx("div",{className:"ia-cap-card-tags",children:t.apiTags.slice(0,2).map(d=>e.jsx(g,{tone:"neutral",size:"sm",children:e.jsx("code",{className:"ia-detail-tag-code",children:d})},d))}):null]},t.key)})})},k=a=>s(a),Q=({sections:a})=>{const[o,m]=x.useState({}),u=x.useMemo(()=>a.map(i=>`${i.key}:${i.defaultCollapsed?1:0}:${i.collapsible===!1?0:1}`).join("|"),[a]);return x.useEffect(()=>{m(i=>a.reduce((l,t)=>(l[t.key]=i[t.key]??t.defaultCollapsed??!1,l),{}))},[u,a]),e.jsx(e.Fragment,{children:a.map(i=>{const l=i.capabilityKeys.map(c=>b[c]).filter(c=>!v(c));if(l.length===0)return null;const t=i.collapsible!==!1,r=t?o[i.key]:!1,d=!i.hideHeader,p=l.length===1?1:i.gridClassName.includes("two")?2:i.gridClassName.includes("growth")?3:"auto",n=()=>m(c=>({...c,[i.key]:!c[i.key]}));return e.jsxs(N,{padding:"md",className:"ia-section-card",children:[d?e.jsx(_,{icon:R,title:k(i.titleKey),subtitle:k(i.descriptionKey),action:t?e.jsx(q,{className:"ia-section-toggle",theme:"borderless",size:"small",onClick:n,"aria-expanded":!r,icon:e.jsx(S,{size:14,strokeWidth:2,style:{transform:r?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.18s ease"}}),children:r?s("netDiagExpand"):s("netDiagCollapse")}):void 0}):null,r?null:e.jsx(I,{capabilityKeys:i.capabilityKeys,columns:p,capabilityRequirementMap:i.capabilityRequirementMap})]},i.key)})})},w=a=>s(a),U=({mode:a,compact:o=!1,clickableTags:m=!1})=>{const u=z(),i=n=>!v(b[n]),l=a.capabilityKeys.filter(n=>a.capabilityRequirementMap[n]==="required"&&i(n)),t=a.capabilityKeys.filter(n=>a.capabilityRequirementMap[n]==="optional"&&i(n)),r=a.supportCapabilityKeys.filter(i),d=a.experimentalCapabilityKeys.filter(i),p=(n,c="neutral",C="solid")=>n.map(y=>{const f=w(b[y].titleKey);return m?e.jsx("button",{type:"button",className:"ia-mode-tag-button",onClick:()=>u(`/integration_assistant/${y}`),children:e.jsx(g,{tone:c,variant:C,size:"sm",children:f})},`${a.key}-${y}`):e.jsx(g,{tone:c,variant:C,size:"sm",children:f},`${a.key}-${y}`)});return e.jsxs("div",{className:`ia-mode-summary ${o?"ia-mode-summary-compact":""}`,children:[e.jsx("p",{className:"ia-mode-summary-text",children:w(a.summaryKey)}),e.jsxs("div",{className:"ia-mode-summary-list",children:[e.jsx(h,{label:s("ia.monetization.meta.required"),children:p(l,"accent")}),t.length?e.jsx(h,{label:s("ia.monetization.meta.optional"),children:p(t,"neutral","outline")}):null,r.length?e.jsx(h,{label:s("ia.monetization.meta.support"),children:p(r)}):null,d.length?e.jsx(h,{label:s("ia.monetization.meta.experimental"),children:p(d,"warn")}):null]})]})},h=({label:a,children:o})=>e.jsxs("div",{className:"ia-mode-summary-row",children:[e.jsx("span",{className:"ia-mode-summary-label",children:a}),e.jsx("div",{className:"ia-mode-summary-tags",children:o})]});export{V as C,U as M,Q as a,A as b,I as c,E as f,L as m,J as o};
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as a}from"./index-VvUpVuij.js";const e=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],d=a("boxes",e);export{d as B};
|