@ttmg/cli 0.4.2 → 0.4.4-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.
Files changed (106) hide show
  1. package/CHANGELOG.md +277 -0
  2. package/dist/index.js +38 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/package.json +5 -3
  5. package/dist/public/assets/Detail-5RBwvI1M.js +1 -0
  6. package/dist/public/assets/Detail-5RBwvI1M.js.br +0 -0
  7. package/dist/public/assets/MonetizationMode-BNWhLbH4.js +1 -0
  8. package/dist/public/assets/MonetizationModeSummary-3IFhpJtg.js +1 -0
  9. package/dist/public/assets/{SectionHeader-CCjfBKcF.js → SectionHeader-4yiyPOgU.js} +1 -1
  10. package/dist/public/assets/{Tag-DON36Of0.js → Tag-BEGC7xBm.js} +1 -1
  11. package/dist/public/assets/{baseForm-B3oZF8Vp.js → baseForm-B46NsqNV.js} +3 -3
  12. package/dist/public/assets/baseForm-B46NsqNV.js.br +0 -0
  13. package/dist/public/assets/col-DYNqjxgf.js +1 -0
  14. package/dist/public/assets/{compass-bMD5nDM8.js → compass-CDbv_4WN.js} +1 -1
  15. package/dist/public/assets/{index-Ca-cQ1Oq.js → index-0ZXvsv6N.js} +1 -1
  16. package/dist/public/assets/{index-BKOO94x-.css → index-3FxbJxwu.css} +1 -1
  17. package/dist/public/assets/index-B51es4GH.js +1 -0
  18. package/dist/public/assets/{index-V1Go68Vw.css → index-BRJFt3oz.css} +1 -1
  19. package/dist/public/assets/index-BRJFt3oz.css.br +0 -0
  20. package/dist/public/assets/{index-CdJUBcSF.js → index-BRLaHgvx.js} +1 -1
  21. package/dist/public/assets/index-BYIujYdU.js +21 -0
  22. package/dist/public/assets/index-BYIujYdU.js.br +0 -0
  23. package/dist/public/assets/index-BbwnUecN.js +1 -0
  24. package/dist/public/assets/index-BbwnUecN.js.br +0 -0
  25. package/dist/public/assets/index-BdixrK5I.css +1 -0
  26. package/dist/public/assets/index-BdixrK5I.css.br +0 -0
  27. package/dist/public/assets/{index-CKUVWl_O.css → index-BlG-Rcwd.css} +1 -1
  28. package/dist/public/assets/{index-DaOr2P0A.js → index-Bv29rr8X.js} +1 -1
  29. package/dist/public/assets/index-Bv29rr8X.js.br +0 -0
  30. package/dist/public/assets/index-C4FIEYze.js +1 -0
  31. package/dist/public/assets/{index-BzEQAUVA.js → index-CFIXkzUa.js} +1 -1
  32. package/dist/public/assets/index-CLjbrJ-V.js +1 -0
  33. package/dist/public/assets/index-CLjbrJ-V.js.br +0 -0
  34. package/dist/public/assets/index-CMymGpPM.js +1 -0
  35. package/dist/public/assets/index-CjpmMeus.js +1 -0
  36. package/dist/public/assets/index-Czg0RYGI.css +1 -0
  37. package/dist/public/assets/index-Czg0RYGI.css.br +0 -0
  38. package/dist/public/assets/index-D7Ic_K5L.js +1 -0
  39. package/dist/public/assets/{index-Dv0bhjYp.js → index-D7Min-ID.js} +1 -1
  40. package/dist/public/assets/index-DBDUeSB8.css +1 -0
  41. package/dist/public/assets/index-DBDUeSB8.css.br +0 -0
  42. package/dist/public/assets/{index-RYY-l6Oq.css → index-DM7Cg9s9.css} +1 -1
  43. package/dist/public/assets/{index-DH7hBDqZ.js → index-DZen0tWD.js} +1 -1
  44. package/dist/public/assets/{index-B4j49Ts7.js → index-De6aUXHS.js} +1 -1
  45. package/dist/public/assets/index-De6aUXHS.js.br +0 -0
  46. package/dist/public/assets/index-DfVst8q1.css +1 -0
  47. package/dist/public/assets/{index-FYgsnJbm.js → index-DotB5V_j.js} +1 -1
  48. package/dist/public/assets/{index-Cf8aH-xI.js → index-DyFkQnHH.js} +1 -1
  49. package/dist/public/assets/{index-CAoj7RMM.js → index-FFm0ULGJ.js} +1 -1
  50. package/dist/public/assets/index-UhNVLNJV.js +1 -0
  51. package/dist/public/assets/index-UhNVLNJV.js.br +0 -0
  52. package/dist/public/assets/index-XHO2ciZ_.js +1 -0
  53. package/dist/public/assets/index-XHO2ciZ_.js.br +0 -0
  54. package/dist/public/assets/{index-VzIFpCiL.js → index-fYRa-mFF.js} +1 -1
  55. package/dist/public/assets/index-k7bnci5q.js +1 -0
  56. package/dist/public/assets/index-knleXaJV.js +1 -0
  57. package/dist/public/assets/index-knleXaJV.js.br +0 -0
  58. package/dist/public/assets/{index-bASdAMHs.js → index-orYk2UId.js} +1 -1
  59. package/dist/public/assets/{index-D4lGRib1.js → index-vdqYVp2k.js} +1 -1
  60. package/dist/public/assets/layers-DFzVcSdo.js +1 -0
  61. package/dist/public/assets/{list-checks-B6t2uu5m.js → list-checks-sBbjrB9b.js} +1 -1
  62. package/dist/public/assets/{sparkles-pLu1TMVV.js → sparkles-kUOwqZbi.js} +1 -1
  63. package/dist/public/assets/{triangle-alert-Dm4_sEwV.js → triangle-alert-DEb521qR.js} +1 -1
  64. package/dist/public/assets/{zap-tefJh46p.js → zap-4GR910dG.js} +1 -1
  65. package/dist/public/index.html +2 -2
  66. package/dist/scripts/docs/capture.js +7 -1
  67. package/dist/scripts/docs/render.js +89 -6
  68. package/dist/scripts/docs/scenarios/devtool-guide.mjs +148 -29
  69. package/package.json +5 -3
  70. package/dist/public/assets/Detail-DNF1PK-R.js +0 -1
  71. package/dist/public/assets/Detail-DNF1PK-R.js.br +0 -0
  72. package/dist/public/assets/MonetizationMode-C59U6Ari.js +0 -1
  73. package/dist/public/assets/MonetizationModeSummary-BR2LJFsU.js +0 -1
  74. package/dist/public/assets/baseForm-B3oZF8Vp.js.br +0 -0
  75. package/dist/public/assets/boxes-EbMNfQ6U.js +0 -1
  76. package/dist/public/assets/chevron-right-CsmjM7t0.js +0 -1
  77. package/dist/public/assets/col-DWGIx7fj.js +0 -1
  78. package/dist/public/assets/index-B4j49Ts7.js.br +0 -0
  79. package/dist/public/assets/index-B5JnznvI.js +0 -1
  80. package/dist/public/assets/index-BCV7VBUL.js +0 -1
  81. package/dist/public/assets/index-BCV7VBUL.js.br +0 -0
  82. package/dist/public/assets/index-BPqSXmk6.js +0 -1
  83. package/dist/public/assets/index-Bn_Zugqv.js +0 -1
  84. package/dist/public/assets/index-Bn_Zugqv.js.br +0 -0
  85. package/dist/public/assets/index-BtO50Nho.js +0 -1
  86. package/dist/public/assets/index-BtO50Nho.js.br +0 -0
  87. package/dist/public/assets/index-CMwzPrAh.css +0 -1
  88. package/dist/public/assets/index-CMwzPrAh.css.br +0 -0
  89. package/dist/public/assets/index-D5-FwYf-.js +0 -1
  90. package/dist/public/assets/index-D5-FwYf-.js.br +0 -0
  91. package/dist/public/assets/index-DOMxPC_v.css +0 -1
  92. package/dist/public/assets/index-DOMxPC_v.css.br +0 -0
  93. package/dist/public/assets/index-DRr-Punk.js +0 -1
  94. package/dist/public/assets/index-DV0N-QmJ.js +0 -1
  95. package/dist/public/assets/index-DV0N-QmJ.js.br +0 -0
  96. package/dist/public/assets/index-DXEfgIqc.js +0 -1
  97. package/dist/public/assets/index-DaOr2P0A.js.br +0 -0
  98. package/dist/public/assets/index-Dx-boSFk.js +0 -1
  99. package/dist/public/assets/index-Dx5VGEQm.css +0 -1
  100. package/dist/public/assets/index-V1Go68Vw.css.br +0 -0
  101. package/dist/public/assets/index-VvBtuIHK.css +0 -1
  102. package/dist/public/assets/index-VvBtuIHK.css.br +0 -0
  103. package/dist/public/assets/index-VvUpVuij.js +0 -21
  104. package/dist/public/assets/index-VvUpVuij.js.br +0 -0
  105. package/dist/public/assets/index-q7fKJFmZ.js +0 -1
  106. package/dist/public/assets/layers-C8HCSIXn.js +0 -1
@@ -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
- renderUploadPublishSection({ recipes, locale, sectionIndex: 6 }),
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
- renderUploadPublishSection({ recipes, locale, sectionIndex: 6 }),
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', 7, '常见问题'), guideFaqs['zh-CN']);
624
- const enFaqSection = renderFaqSection(formatSectionTitle('en-US', 7, 'FAQ'), guideFaqs['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
- '# TikTok Mini Game Debugging Tool Guide',
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
- '关键模块 / Key Modules',
19
- '模式边界 / Mode Boundaries',
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: 'non-Unity subpackage collection prerequisites and flow',
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: false,
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
- ' Unity 小游戏使用“子包收集”采集启动阶段预下载的子包;Unity 小游戏使用 Wasm 分包链路。',
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
- 'Non-Unity mini-games use Subpackage Collection to collect subpackages downloaded during startup. Unity mini-games use the Wasm Split flow.',
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: '.upload-game-page',
591
+ selector: '.error-display',
573
592
  viewport: tallViewport,
574
593
  capture: {
575
- selector: '.upload-game-page',
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: '.subpkg-page',
709
+ selector: '[data-doc-shot="subpackage-entry"]',
691
710
  viewport: tallViewport,
692
711
  capture: {
693
- selector: '.subpkg-page',
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', 'clientVersion', 'tiktokRegion'],
719
+ required: ['subpackageEntries', 'tiktokRegion'],
701
720
  },
702
721
  doc: {
703
722
  section: 'Performance optimization',
704
723
  anchor: 'subpackage-collection',
705
- intent: 'collect startup subpackages for preload configuration',
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 mention non-US TikTok account and client support version',
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: ' Unity 小游戏需要优化首屏冷启动、沉淀预加载配置时使用。',
735
+ title: '子包收集(待开放)',
736
+ purpose: '正式开放后,DevTool 会记录真实启动过程中被预下载的子包,并把结果转换为预加载配置,帮助非 Unity 小游戏减少首屏等待。',
737
+ whenToUse: '当前用于提前了解功能入口、适用范围和未来操作流程;正式开放后,非 Unity 小游戏可在需要优化冷启动时使用。',
717
738
  steps: [
718
- '确认 TikTok 客户端版本和账号地区满足要求。',
739
+ '等待功能正式开放;当前页面仅用于预览能力和接入要求。',
740
+ '开放后,在「性能优化」中进入「收集子包」。',
741
+ '开始收集前,在游戏代码中接入 `TTMinis.game.reportScene`,并在可交互时传入 `sceneId: 9999`。',
742
+ '确认手机 TikTok 登录的是非 US 地区账号。',
719
743
  '扫码后按真实启动路径操作游戏。',
720
- '进入可交互后触发 `reportScene({sceneId:9999})` 完成收集。',
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: 'Collect subpackages downloaded during startup and convert them into preload configuration.',
730
- whenToUse: 'Use it for non-Unity mini-games that need to optimize cold start and generate preload configuration.',
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
- 'Confirm that the TikTok client version and account region meet the requirement.',
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 game becomes interactive, call `reportScene({sceneId:9999})` to finish collection.',
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,20 +1,22 @@
1
1
  {
2
2
  "name": "@ttmg/cli",
3
- "version": "0.4.2",
3
+ "version": "0.4.4-beta.1",
4
4
  "description": "TikTok Mini Game Command Line Tool",
5
5
  "license": "ISC",
6
6
  "bin": {
7
- "ttmg": "./dist/index.js"
7
+ "ttmg": "dist/index.js"
8
8
  },
9
9
  "files": [
10
10
  "dist"
11
11
  ],
12
12
  "publishConfig": {
13
- "access": "public"
13
+ "access": "public",
14
+ "registry": "https://registry.npmjs.org/"
14
15
  },
15
16
  "scripts": {
16
17
  "prepublish": "npm run build",
17
18
  "build": "node scripts/build.js",
19
+ "publish:beta": "npm publish --registry=https://registry.npmjs.org/ --access public --tag beta",
18
20
  "setup": "node scripts/setup.js",
19
21
  "reset:local-state": "node scripts/resetLocalState.js",
20
22
  "dev:link": "npm run build && npm link",
@@ -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};
@@ -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};
@@ -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};
@@ -1 +0,0 @@
1
- import{c as o}from"./index-VvUpVuij.js";const t=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],e=o("chevron-right",t);export{e as C};
@@ -1 +0,0 @@
1
- import{t as E,R as b,cd as _,z as P,H as r}from"./index-VvUpVuij.js";const R={PREFIX:`${E}`};var N=function(o,t){var n={};for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&t.indexOf(e)<0&&(n[e]=o[e]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,e=Object.getOwnPropertySymbols(o);s<e.length;s++)t.indexOf(e[s])<0&&Object.prototype.propertyIsEnumerable.call(o,e[s])&&(n[e[s]]=o[e[s]]);return n};const w=["xxl","xl","lg","md","sm","xs"],v=b.createContext(null),C={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"};class $ extends b.Component{constructor(){super(...arguments),this.state={screens:{xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}},this.unRegisters=[]}componentDidMount(){this.unRegisters=Object.keys(C).map(t=>_(C[t],{match:()=>{typeof this.props.gutter=="object"&&this.setState(n=>({screens:Object.assign(Object.assign({},n.screens),{[t]:!0})}))},unmatch:()=>{typeof this.props.gutter=="object"&&this.setState(n=>({screens:Object.assign(Object.assign({},n.screens),{[t]:!1})}))}}))}componentWillUnmount(){this.unRegisters.forEach(t=>t())}getGutter(){const{gutter:t=0}=this.props,n=[0,0];return(Array.isArray(t)?t.slice(0,2):[t,0]).forEach((s,c)=>{if(typeof s=="object")for(let u=0;u<w.length;u++){const f=w[u];if(this.state.screens[f]&&s[f]!==void 0){n[c]=s[f];break}}else n[c]=s||0}),n}render(){const t=this.props,{prefixCls:n,type:e,justify:s,align:c,className:u,style:f,children:x}=t,y=N(t,["prefixCls","type","justify","align","className","style","children"]),i=this.getGutter(),d=`${n}-row`,a=P({[d]:e!=="flex",[`${d}-${e}`]:e,[`${d}-${e}-${s}`]:e&&s,[`${d}-${e}-${c}`]:e&&c},u),O=Object.assign(Object.assign(Object.assign({},i[0]>0?{marginLeft:i[0]/-2,marginRight:i[0]/-2}:{}),i[1]>0?{marginTop:i[1]/-2,marginBottom:i[1]/-2}:{}),f),g=Object.assign({},y);return delete g.gutter,b.createElement(v.Provider,{value:{gutters:i}},b.createElement("div",Object.assign({},g,{className:a,style:O,"x-semi-prop":"children"}),x))}}$.propTypes={type:r.oneOf(["flex"]),align:r.oneOf(["top","middle","bottom"]),justify:r.oneOf(["start","end","center","space-around","space-between"]),className:r.string,style:r.object,children:r.node,gutter:r.oneOfType([r.object,r.number,r.array]),prefixCls:r.string};$.defaultProps={prefixCls:R.PREFIX};$.RowContext={gutters:r.any};var S=function(o,t){var n={};for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&t.indexOf(e)<0&&(n[e]=o[e]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,e=Object.getOwnPropertySymbols(o);s<e.length;s++)t.indexOf(e[s])<0&&Object.prototype.propertyIsEnumerable.call(o,e[s])&&(n[e[s]]=o[e[s]]);return n};const h=r.oneOfType([r.object,r.number]);class j extends b.Component{render(){const{props:t}=this,{prefixCls:n,span:e,order:s,offset:c,push:u,pull:f,className:x,children:y}=t,i=S(t,["prefixCls","span","order","offset","push","pull","className","children"]);let d={};const a=`${n}-col`;["xs","sm","md","lg","xl","xxl"].forEach(p=>{let l={};typeof t[p]=="number"?l.span=t[p]:typeof t[p]=="object"&&(l=t[p]||{}),delete i[p],d=Object.assign(Object.assign({},d),{[`${a}-${p}-${l.span}`]:l.span!==void 0,[`${a}-${p}-order-${l.order}`]:l.order||l.order===0,[`${a}-${p}-offset-${l.offset}`]:l.offset||l.offset===0,[`${a}-${p}-push-${l.push}`]:l.push||l.push===0,[`${a}-${p}-pull-${l.pull}`]:l.pull||l.pull===0})});const O=P(a,{[`${a}-${e}`]:e!==void 0,[`${a}-order-${s}`]:s,[`${a}-offset-${c}`]:c,[`${a}-push-${u}`]:u,[`${a}-pull-${f}`]:f},x,d);let{style:g}=i,m;try{m=this.context.gutters}catch{throw new Error("please make sure <Col> inside <Row>")}return g=Object.assign(Object.assign(Object.assign({},m[0]>0?{paddingLeft:m[0]/2,paddingRight:m[0]/2}:{}),m[1]>0?{paddingTop:m[1]/2,paddingBottom:m[1]/2}:{}),g),b.createElement("div",Object.assign({},i,{style:g,className:O,"x-semi-prop":"children"}),y)}}j.contextType=v;j.propTypes={span:r.number,order:r.number,offset:r.number,push:r.number,pull:r.number,className:r.string,children:r.node,xs:h,sm:h,md:h,lg:h,xl:h,xxl:h,prefixCls:r.string};j.defaultProps={prefixCls:R.PREFIX};export{j as C,$ as R};
@@ -1 +0,0 @@
1
- import{f as a,u as l,h as c,j as s,p as t,ce as i,i as o,T as n,B as d}from"./index-VvUpVuij.js";const g=()=>{const r=a(),{state:{user:e}}=l();return c(e)?s.jsx(t,{position:"bottom",content:s.jsx("div",{className:"login-user-popover",children:e?.email||e?.user_id}),children:s.jsx(i,{color:"amber",style:{flexShrink:0},alt:e?.email||e?.user_id||void 0,size:"small",children:(e?.email||e?.user_id||"?").trim()[0]?.toUpperCase()||"?"})}):s.jsx(t,{position:"bottom",trigger:"hover",content:s.jsxs("div",{className:"not-login-status-popover",children:[s.jsxs("div",{className:"not-login-status-popover-copy",children:[s.jsx(n.Text,{strong:!0,children:o("notLogin")}),s.jsx(n.Text,{children:o("notLoginTip")}),s.jsx("code",{className:"not-login-status-command",children:"ttmg login"})]}),s.jsx("div",{className:"not-login-status-popover-actions",children:s.jsx(d,{size:"small",theme:"light",onClick:()=>r("/basic_debug_guide"),children:o("basicDebugGuide.entryAction")})})]}),children:s.jsx(i,{color:"grey",style:{flexShrink:0},size:"small",children:o("notLogin")})})};export{g as LoginStatus};