@rine-kit/presentation 0.2.1 → 0.2.2
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/src/builders/pubg.js +12 -2
- package/package.json +1 -1
|
@@ -361,6 +361,8 @@ export function buildPubgMatchReviewPresentation(input) {
|
|
|
361
361
|
const summary = typeof analysis.summary === 'string' && analysis.summary.trim()
|
|
362
362
|
? analysis.summary
|
|
363
363
|
: '本场复盘事实已生成。';
|
|
364
|
+
const weaponRows = Array.isArray(data.weaponBreakdown) ? data.weaponBreakdown : [];
|
|
365
|
+
const weaponText = weaponRows.map(item => record(item)).filter(row => typeof row.weapon === 'string' && typeof row.kills === 'number').map(row => `${text(row.playerName, '未知玩家')} · ${row.weapon}:${row.kills} 杀,${row.knocks} 倒地`);
|
|
364
366
|
const mapName = typeof match.mapName === 'string' ? match.mapName : '未知地图';
|
|
365
367
|
const ordinal = numberOrNull(match.ordinal);
|
|
366
368
|
const candidate = {
|
|
@@ -378,7 +380,7 @@ export function buildPubgMatchReviewPresentation(input) {
|
|
|
378
380
|
keyMoments,
|
|
379
381
|
highlights,
|
|
380
382
|
improvements,
|
|
381
|
-
analysis: summary,
|
|
383
|
+
analysis: [summary, ...weaponText].join('\n'),
|
|
382
384
|
evidenceRefs: evidence,
|
|
383
385
|
};
|
|
384
386
|
return assertValid(validatePubgMatchReviewPresentation(candidate, known));
|
|
@@ -437,6 +439,14 @@ export function buildPubgPeriodReviewPresentation(input) {
|
|
|
437
439
|
const wrapper = record(item);
|
|
438
440
|
return textItems(record(record(wrapper.data ?? wrapper).derivedAnalysis).awards, [...known]);
|
|
439
441
|
});
|
|
442
|
+
const weaponSummary = record(data.weaponSummary);
|
|
443
|
+
const weaponTotals = Array.isArray(weaponSummary.totals) ? weaponSummary.totals.map(item => record(item)) : [];
|
|
444
|
+
const weaponLines = weaponTotals.filter(row => typeof row.weapon === 'string' && typeof row.kills === 'number').map(row => `${text(row.playerName, '未知玩家')} · ${row.weapon}:${row.kills} 杀,${row.knocks} 倒地`);
|
|
445
|
+
const weaponMatches = Array.isArray(weaponSummary.matches) ? weaponSummary.matches.map(item => record(item)) : [];
|
|
446
|
+
const weaponMatchLines = weaponMatches.flatMap(match => {
|
|
447
|
+
const rows = Array.isArray(match.weapons) ? match.weapons.map(item => record(item)) : [];
|
|
448
|
+
return rows.filter(row => typeof row.weapon === 'string' && typeof row.kills === 'number').map(row => `${text(match.mapName, '未知地图')} ${text(match.startedAt, '')} · ${text(row.playerName, '未知玩家')} · ${row.weapon}:${row.kills} 杀`);
|
|
449
|
+
});
|
|
440
450
|
const summaryValue = data.summary;
|
|
441
451
|
const summary = typeof summaryValue === 'string' && summaryValue.trim()
|
|
442
452
|
? summaryValue
|
|
@@ -452,7 +462,7 @@ export function buildPubgPeriodReviewPresentation(input) {
|
|
|
452
462
|
? { displayDate: stringOrNull(period.displayDate) }
|
|
453
463
|
: {}),
|
|
454
464
|
},
|
|
455
|
-
summary,
|
|
465
|
+
summary: [summary, ...(weaponSummary.complete === false ? ['武器统计覆盖不完整,不能视为总数。'] : []), ...weaponLines, ...weaponMatchLines].join('\n'),
|
|
456
466
|
orderedMatches: matches,
|
|
457
467
|
highlights: textItems(data.highlights, [...known, ...(input.evidenceRefs?.matchIds ?? [])])
|
|
458
468
|
.concat(reviewItems)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rine-kit/presentation",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "PUBG reply presentation: contracts, builders and renderers (Markdown / messenger-neutral) used by the PUBG domain. Extracted from Lab.",
|
|
6
6
|
"license": "MIT",
|