feat(icons): split built-in sprite into per-icon SVG sources and add ticket icon

Move the 114 built-in sprite icons out of assets/js/runtime/svg-icon.js into
assets/icons/sprite/{key}.svg and generate svg-icon.js with
tools/build-svg-sprite.mjs. Add ticket-color and use it for the user center
ticket entry. Update sidebar contract tests for the creator card labels.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-28 23:59:06 +08:00
1 parent 794d981260
commit 54ea83b262
120 files changed
+326 -108

No files matched your search

@@ -155,7 +155,7 @@ test('ticket panel is registered across the user-center wiring', () => {
const sidebar = read('inc/helpers/user-center-renderers/sidebar-nav.php');
assert.ok(sidebar.includes("'label' => __('工单中心', 'aksrt')"), 'sidebar label missing');
assert.ok(sidebar.includes("'icon' => 'manual-service'"), 'sidebar icon should reuse the existing headset sprite');
assert.ok(sidebar.includes("'icon' => 'ticket-color'"), 'sidebar icon should use the built-in ticket sprite');
assert.ok(sidebar.includes("'tab' => 'tickets'"), 'sidebar tab key missing');
const helper = read('inc/helpers/aksrt-user-center.php');
@@ -78,9 +78,13 @@ test('其余侧栏部件按参考主题选型替换为 sprite 图标', () => {
assert.match(creator, /class="mb10-sm zib-widget padding-10 flex1 pointer"/);
assert.match(creator, /flex ab jsb col-ml6/);
assert.match(creator, /<i class="ml6 fa fas fa-angle-right em12"/);
for (const label of ['创作中心', '推广中心', '商品', '比例', '今日收入', '收入', '待提现', '累计佣金']) {
for (const label of ['创作中心', '推广中心', '现金收益', '积分收益', '比例', '待提现', '累计佣金']) {
assert.ok(creator.includes(`'${label}'`), `creator card missing label: ${label}`);
}
// 创作中心不再统计商品数与今日收入。
for (const label of ['商品', '今日收入', '收入']) {
assert.ok(!creator.includes(`'${label}'`), `creator card still renders label: ${label}`);
}
assert.doesNotMatch(creator, /data-onclick/);
const vip = read(sidebarDir + 'sidebar-vip.php');
@@ -148,7 +152,7 @@ test('所用 sprite key 均在前端 sprite 中定义', () => {
const sprite = read('assets/js/runtime/svg-icon.js');
const keys = [
'trend-color', 'user-auth', 'order-color', 'msg-color', 'user-color', 'security-color',
'money-color-2', 'points-color', 'merchant-color', 'money-color', 'vip_1', 'time', 'menu', 'right',
'money-color-2', 'points-color', 'merchant-color', 'money-color', 'vip_1', 'time', 'menu', 'right', 'ticket-color',
];
for (const key of keys) {
assert.match(sprite, new RegExp(`aksrt_svgs\\['${key}'\\]\\s*=`), `sprite key missing: ${key}`);