From 332efc750608b0f779073a05ce96f0c0d5ebbd44 Mon Sep 17 00:00:00 2001 From: kmiit <2421768138@qq.com> Date: Sat, 6 Sep 2025 15:52:05 +0000 Subject: [PATCH 1/3] icon: Add a module to convert Compose ImageVector to SVG --- docs/iconGen/build.gradle.kts | 31 ++++ .../top/yukonga/miuix/docs/icongen/Main.kt | 142 ++++++++++++++++++ settings.gradle.kts | 1 + 3 files changed, 174 insertions(+) create mode 100644 docs/iconGen/build.gradle.kts create mode 100644 docs/iconGen/src/main/kotlin/top/yukonga/miuix/docs/icongen/Main.kt diff --git a/docs/iconGen/build.gradle.kts b/docs/iconGen/build.gradle.kts new file mode 100644 index 00000000..e3641eca --- /dev/null +++ b/docs/iconGen/build.gradle.kts @@ -0,0 +1,31 @@ +// Copyright 2025, miuix-kotlin-multiplatform contributors +// SPDX-License-Identifier: Apache-2.0 + +plugins { kotlin("jvm") } + +java { toolchain.languageVersion = JavaLanguageVersion.of(21) } + +dependencies { implementation(project(":miuix")) } + +val iconsSourceDir = rootProject.layout.projectDirectory.dir("miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/icon").asFile +val outputDir = layout.buildDirectory.dir("generated-svg") + +tasks.register("generateSvg") { + group = "iconGen" + description = "Generate SVGs from Compose ImageVector definitions" + dependsOn(tasks.named("classes")) + classpath = sourceSets.main.get().runtimeClasspath + mainClass.set("top.yukonga.miuix.docs.icongen.MainKt") + val lightColor = project.findProperty("iconLightColor")?.toString() ?: "#000000" + val darkColor = project.findProperty("iconDarkColor")?.toString() ?: "#FFFFFF" + val preserve = project.findProperty("iconPreserveColors")?.toString()?.equals("true", true) == true + outputs.dir(outputDir) + doFirst { outputDir.get().asFile.mkdirs() } + args = listOf( + "--src", iconsSourceDir.absolutePath, + "--out", outputDir.get().asFile.absolutePath, + "--light", lightColor, + "--dark", darkColor, + "--preserve-colors", preserve.toString() + ) +} diff --git a/docs/iconGen/src/main/kotlin/top/yukonga/miuix/docs/icongen/Main.kt b/docs/iconGen/src/main/kotlin/top/yukonga/miuix/docs/icongen/Main.kt new file mode 100644 index 00000000..379cdcb1 --- /dev/null +++ b/docs/iconGen/src/main/kotlin/top/yukonga/miuix/docs/icongen/Main.kt @@ -0,0 +1,142 @@ +package top.yukonga.miuix.docs.icongen + +import java.io.File + +/** Simple CLI entry that converts Compose vector icon definitions to SVG files. */ +fun main(args: Array) { + // Simple linear parse: --key value or --flag (value true) + val map = mutableMapOf() + var i = 0 + while (i < args.size) { + val a = args[i] + if (a.startsWith("--")) { + val key = a + val next = args.getOrNull(i + 1) + if (next != null && !next.startsWith("--")) { + map[key] = next; i += 2 + } else { + map[key] = "true"; i += 1 + } + } else i++ + } + val srcDir = map["--src"] ?: error("--src required") + val outDir = map["--out"] ?: error("--out required") + val light = map["--light"] ?: "#000000" + val dark = map["--dark"] ?: "#FFFFFF" + val preserveColors = map["--preserve-colors"]?.equals("true", true) == true + + val src = File(srcDir) + val dest = File(outDir) + if (!src.isDirectory) error("Source directory not found: $src") + if (!dest.exists()) dest.mkdirs() + + val ktFiles = src.walkTopDown().filter { it.isFile && it.extension == "kt" && it.name != "MiuixIcon.kt" } + var count = 0 + ktFiles.forEach { file -> + val content = file.readText() + val builderRegex = Regex("ImageVector\\.Builder\\(\\s*\\\"([^\\\"]+)\\\"\\s*,\\s*([0-9.]+)f?\\.dp\\s*,\\s*([0-9.]+)f?\\.dp\\s*,\\s*([0-9.]+)f\\s*,\\s*([0-9.]+)f") + val builderMatch = builderRegex.find(content) + val iconName = builderMatch?.groupValues?.getOrNull(1) ?: file.nameWithoutExtension + val viewportWidth = builderMatch?.groupValues?.getOrNull(4)?.toFloatOrNull() ?: 24f + val viewportHeight = builderMatch?.groupValues?.getOrNull(5)?.toFloatOrNull() ?: 24f + val pathBlocks = Regex("path\\((.*?)\\) *\\{(.*?)\\}", setOf(RegexOption.DOT_MATCHES_ALL)).findAll(content) + data class SvgPath( + val d: String, + val evenOdd: Boolean, + val fillAlpha: Float?, + val fill: String?, + val stroke: String?, + val strokeWidth: String?, + val strokeAlpha: Float?, + val strokeLineCap: String?, + val strokeLineJoin: String?, + val strokeMiterLimit: String? + ) + val paths = mutableListOf() + pathBlocks.forEach { m -> + val header = m.groupValues[1] + val body = m.groupValues[2] + val evenOdd = header.contains("EvenOdd") || header.contains("PathFillType.EvenOdd") + val fillAlpha = Regex("fillAlpha *= *(\\d*\\.?\\d+)f").find(header)?.groupValues?.getOrNull(1)?.toFloatOrNull() + fun parseColor(kind: String): String? { + val regex = Regex("$kind *= *SolidColor\\(Color\\.([A-Za-z]+)\\)") + val named = regex.find(header)?.groupValues?.getOrNull(1) + if (named != null) return when (named) { "White" -> "#FFFFFF"; "Black" -> "#000000"; "Transparent" -> "none"; else -> null } + val hexRegex = Regex("$kind *= *SolidColor\\(Color\\((0x[0-9A-Fa-f]{8})\\)\\)") + val hexMatch = hexRegex.find(header)?.groupValues?.getOrNull(1) + if (hexMatch != null) { + val value = hexMatch.removePrefix("0x") + val a = value.substring(0,2); val r = value.substring(2,4); val g = value.substring(4,6); val b = value.substring(6,8) + return if (a.equals("FF", true)) "#$r$g$b" else "#$r$g$b$a" + } + return null + } + val fillColor = parseColor("fill") + val strokeColor = parseColor("stroke") + val strokeAlpha = Regex("strokeAlpha *= *(\\d*\\.?\\d+)f").find(header)?.groupValues?.getOrNull(1)?.toFloatOrNull() + val strokeWidth = Regex("strokeLineWidth *= *(\\d*\\.?\\d+)f").find(header)?.groupValues?.getOrNull(1) + val strokeLineCap = Regex("strokeLineCap *= *([A-Za-z.]+)").find(header)?.groupValues?.getOrNull(1)?.substringAfterLast('.') + val strokeLineJoin = Regex("strokeLineJoin *= *([A-Za-z.]+)").find(header)?.groupValues?.getOrNull(1)?.substringAfterLast('.') + val strokeMiterLimit = Regex("strokeLineMiter *= *(\\d*\\.?\\d+)f").find(header)?.groupValues?.getOrNull(1) + val sb = StringBuilder() + val moveRegex = Regex("moveTo\\((.*?)f, (.*?)f\\)"); val lineToRegex = Regex("lineTo\\((.*?)f, (.*?)f\\)"); val curveToRegex = Regex("curveTo\\((.*?)f, (.*?)f, (.*?)f, (.*?)f, (.*?)f, (.*?)f\\)") + val moveRelRegex = Regex("moveToRelative\\((.*?)f, (.*?)f\\)"); val lineRelRegex = Regex("lineToRelative\\((.*?)f, (.*?)f\\)"); val curveRelRegex = Regex("curveToRelative\\((.*?)f, (.*?)f, (.*?)f, (.*?)f, (.*?)f, (.*?)f\\)") + val hLineRegex = Regex("horizontalLineTo\\((.*?)f\\)"); val vLineRegex = Regex("verticalLineTo\\((.*?)f\\)"); val hLineRelRegex = Regex("horizontalLineToRelative\\((.*?)f\\)"); val vLineRelRegex = Regex("verticalLineToRelative\\((.*?)f\\)") + val quadRegex = Regex("quadTo\\((.*?)f, (.*?)f, (.*?)f, (.*?)f\\)"); val quadRelRegex = Regex("quadToRelative\\((.*?)f, (.*?)f, (.*?)f, (.*?)f\\)") + val rCurveRegex = Regex("reflectiveCurveTo\\((.*?)f, (.*?)f, (.*?)f, (.*?)f\\)"); val rCurveRelRegex = Regex("reflectiveCurveToRelative\\((.*?)f, (.*?)f, (.*?)f, (.*?)f\\)") + val rQuadRegex = Regex("reflectiveQuadTo\\((.*?)f, (.*?)f\\)"); val rQuadRelRegex = Regex("reflectiveQuadToRelative\\((.*?)f, (.*?)f\\)"); val closeRegex = Regex("close\\(\\)") + body.lineSequence().forEach { line -> + moveRegex.findAll(line).forEach { r -> sb.append("M${r.groupValues[1]} ${r.groupValues[2]} ") } + lineToRegex.findAll(line).forEach { r -> sb.append("L${r.groupValues[1]} ${r.groupValues[2]} ") } + curveToRegex.findAll(line).forEach { r -> sb.append("C${r.groupValues[1]} ${r.groupValues[2]} ${r.groupValues[3]} ${r.groupValues[4]} ${r.groupValues[5]} ${r.groupValues[6]} ") } + moveRelRegex.findAll(line).forEach { r -> sb.append("m${r.groupValues[1]} ${r.groupValues[2]} ") } + lineRelRegex.findAll(line).forEach { r -> sb.append("l${r.groupValues[1]} ${r.groupValues[2]} ") } + curveRelRegex.findAll(line).forEach { r -> sb.append("c${r.groupValues[1]} ${r.groupValues[2]} ${r.groupValues[3]} ${r.groupValues[4]} ${r.groupValues[5]} ${r.groupValues[6]} ") } + hLineRegex.findAll(line).forEach { r -> sb.append("H${r.groupValues[1]} ") } + vLineRegex.findAll(line).forEach { r -> sb.append("V${r.groupValues[1]} ") } + hLineRelRegex.findAll(line).forEach { r -> sb.append("h${r.groupValues[1]} ") } + vLineRelRegex.findAll(line).forEach { r -> sb.append("v${r.groupValues[1]} ") } + quadRegex.findAll(line).forEach { r -> sb.append("Q${r.groupValues[1]} ${r.groupValues[2]} ${r.groupValues[3]} ${r.groupValues[4]} ") } + quadRelRegex.findAll(line).forEach { r -> sb.append("q${r.groupValues[1]} ${r.groupValues[2]} ${r.groupValues[3]} ${r.groupValues[4]} ") } + rCurveRegex.findAll(line).forEach { r -> sb.append("S${r.groupValues[1]} ${r.groupValues[2]} ${r.groupValues[3]} ${r.groupValues[4]} ") } + rCurveRelRegex.findAll(line).forEach { r -> sb.append("s${r.groupValues[1]} ${r.groupValues[2]} ${r.groupValues[3]} ${r.groupValues[4]} ") } + rQuadRegex.findAll(line).forEach { r -> sb.append("T${r.groupValues[1]} ${r.groupValues[2]} ") } + rQuadRelRegex.findAll(line).forEach { r -> sb.append("t${r.groupValues[1]} ${r.groupValues[2]} ") } + if (closeRegex.containsMatchIn(line)) sb.append("Z ") + } + val d = sb.toString().trim() + if (d.isNotBlank()) paths += SvgPath(d, evenOdd, fillAlpha, fillColor, strokeColor, strokeWidth, strokeAlpha, strokeLineCap, strokeLineJoin, strokeMiterLimit) + } + if (paths.isEmpty()) return@forEach + fun num(v: Float): String = if (v % 1f == 0f) v.toInt().toString() else v.toString().trimEnd('0').trimEnd('.') + val svg = buildString { + appendLine("") + appendLine("") + appendLine(" ") + paths.forEach { sp -> + val rule = if (sp.evenOdd) " fill-rule=\"evenodd\" clip-rule=\"evenodd\"" else "" + val alphaAttr = if (sp.fillAlpha != null && sp.fillAlpha < 0.999f) " fill-opacity=\"${"%.3f".format(sp.fillAlpha)}\"" else "" + val fillValue = if (preserveColors) { + when (sp.fill) { null -> "currentColor"; else -> sp.fill } + } else { + when (sp.fill) { null, "#FFFFFF", "#000000" -> "currentColor"; "none" -> "none"; else -> sp.fill } + } + val fillAttr = " fill=\"$fillValue\"" + val strokeAttr = sp.stroke?.let { col -> val value = if (!preserveColors && (col == "#FFFFFF" || col == "#000000")) "currentColor" else col; " stroke=\"$value\"" } ?: "" + val strokeWidthAttr = sp.strokeWidth?.let { " stroke-width=\"$it\"" } ?: "" + val strokeAlphaAttr = sp.strokeAlpha?.let { if (it < 0.999f) " stroke-opacity=\"${"%.3f".format(it)}\"" else "" } ?: "" + val lineCapAttr = sp.strokeLineCap?.let { " stroke-linecap=\"${it.lowercase()}\"" } ?: "" + val lineJoinAttr = sp.strokeLineJoin?.let { " stroke-linejoin=\"${it.lowercase()}\"" } ?: "" + val miterAttr = sp.strokeMiterLimit?.let { " stroke-miterlimit=\"$it\"" } ?: "" + appendLine(" ") + } + appendLine("") + } + val relativeDir = file.relativeTo(src).parentFile + val outDir = File(dest, relativeDir.path) + outDir.mkdirs() + File(outDir, iconName + ".svg").writeText(svg) + count++ + } + println("[iconGen] Generated $count SVG(s) into $dest") +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 2fe00ab0..3144605e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -47,3 +47,4 @@ rootProject.name = "miuix" include(":miuix") include(":example") include(":docs:demo") +include(":docs:iconGen") From de69fe04dce1923c9baf22b4d0d47edbc0c7d6db Mon Sep 17 00:00:00 2001 From: kmiit <2421768138@qq.com> Date: Sat, 6 Sep 2025 19:15:18 +0000 Subject: [PATCH 2/3] docs: Add preview for icons --- docs/.vitepress/theme/style/img.css | 6 ++ docs/.vitepress/theme/style/index.css | 3 +- docs/guide/icons.md | 92 ++++++++++++++------------- docs/zh_CN/guide/icons.md | 92 ++++++++++++++------------- 4 files changed, 106 insertions(+), 87 deletions(-) create mode 100644 docs/.vitepress/theme/style/img.css diff --git a/docs/.vitepress/theme/style/img.css b/docs/.vitepress/theme/style/img.css new file mode 100644 index 00000000..c08043d4 --- /dev/null +++ b/docs/.vitepress/theme/style/img.css @@ -0,0 +1,6 @@ +td img { + display: block; + margin-left: auto; + margin-right: auto; + width: 24px; +} diff --git a/docs/.vitepress/theme/style/index.css b/docs/.vitepress/theme/style/index.css index 8dc53f20..9cc9dc2e 100644 --- a/docs/.vitepress/theme/style/index.css +++ b/docs/.vitepress/theme/style/index.css @@ -1,3 +1,4 @@ @import './var.css'; @import './blur.css'; -@import './hidden.css'; \ No newline at end of file +@import './hidden.css'; +@import './img.css'; \ No newline at end of file diff --git a/docs/guide/icons.md b/docs/guide/icons.md index 34bd0d62..cf321a68 100644 --- a/docs/guide/icons.md +++ b/docs/guide/icons.md @@ -41,56 +41,62 @@ The Miuix icon system currently includes the following main categories: Basic icons include commonly used basic UI elements such as arrows and checkmarks. These icons are also used in Miuix's own components. Below is the complete list: -- `Check`: Checkmark icon -- `ArrowUpDown`: Up and down arrow icon -- `ArrowUpDownIntegrated`: Integrated up and down arrow icon -- `ArrowRight`: Right arrow icon +| Preview | Icon Name | Description | +|---------------------------------------------------------------------------|-------------------------|-----------------------------------| +| | `Check` | Checkmark icon | +| | `ArrowUpDown` | Up and down arrow icon | +| | `ArrowUpDownIntegrated` | Integrated up and down arrow icon | +| | `ArrowRight` | Right arrow icon | +| | `Search` | Search icon | +| | `SearchCleanup` | Search cleanup icon | ### Useful Icons Useful icons include a large number of functional icons suitable for various application scenarios. Below is the complete list: -| Icon Name | Description | Common Usage | -| ----------------- | ------------------------ | ------------------------------------ | -| `AddSecret` | Add encrypted content | Add passwords, private items, etc. | -| `Back` | Back icon | Navigate back to the previous screen | -| `Blocklist` | Blocklist icon | Block users, add to blacklist | -| `Cancel` | Cancel icon | Cancel operations, close dialogs | -| `Copy` | Copy icon | Copy content to clipboard | -| `Cut` | Cut icon | Cut content to clipboard | -| `Delete` | Delete icon | Delete items, content, or files | -| `Edit` | Edit icon | Edit content, modify information | -| `ImmersionMore` | Immersive more options | Show more options in immersive mode | -| `Info` | Info icon | Show detailed information, tips | -| `Like` | Like icon | Like, favorite functionality | -| `More` | More icon | Show more options or menus | -| `Move` | Move icon | Move items to other locations | -| `NavigatorSwitch` | Navigation switch icon | Switch navigation views | -| `New` | New icon | Create new content, files, or items | -| `Order` | Order icon | Sort content | -| `Paste` | Paste icon | Paste content from clipboard | -| `Personal` | Personal/user icon | Personal information, user page | -| `Play` | Play icon | Play media content | -| `Reboot` | Reboot icon | Restart app or system | -| `Refresh` | Refresh icon | Refresh content or page | -| `Remove` | Remove icon | Remove items (soft delete) | -| `RemoveBlocklist` | Remove blocklist icon | Unblock | -| `RemoveSecret` | Remove encrypted content | Remove encrypted items | -| `Rename` | Rename icon | Rename files or items | -| `Restore` | Restore icon | Restore deleted content | -| `Save` | Save icon | Save content or changes | -| `Scan` | Scan icon | Scan QR codes, etc. | -| `Search` | Search icon | Search content | -| `SelectAll` | Select all icon | Select all items | -| `Settings` | Settings icon | App or system settings | -| `Share` | Share icon | Share content to other platforms | -| `Stick` | Stick icon | Pin content to the top | -| `Unlike` | Unlike icon | Unlike or unfavorite | -| `Unstick` | Unpin content | Unpin content | -| `Update` | Update icon | Update apps or content | +| Preview | Icon Name | Description | Common Usage | +|-------------------------------------------------|-------------------|--------------------------|--------------------------------------| +| | `AddSecret` | Add encrypted content | Add passwords, private items, etc. | +| | `Back` | Back icon | Navigate back to the previous screen | +| | `Blocklist` | Blocklist icon | Block users, add to blacklist | +| | `Cancel` | Cancel icon | Cancel operations, close dialogs | +| | `Copy` | Copy icon | Copy content to clipboard | +| | `Cut` | Cut icon | Cut content to clipboard | +| | `Delete` | Delete icon | Delete items, content, or files | +| | `Edit` | Edit icon | Edit content, modify information | +| | `ImmersionMore` | Immersive more options | Show more options in immersive mode | +| | `Info` | Info icon | Show detailed information, tips | +| | `Like` | Like icon | Like, favorite functionality | +| | `More` | More icon | Show more options or menus | +| | `Move` | Move icon | Move items to other locations | +| | `NavigatorSwitch` | Navigation switch icon | Switch navigation views | +| | `New` | New icon | Create new content, files, or items | +| | `Order` | Order icon | Sort content | +| | `Paste` | Paste icon | Paste content from clipboard | +| | `Personal` | Personal/user icon | Personal information, user page | +| | `Play` | Play icon | Play media content | +| | `Reboot` | Reboot icon | Restart app or system | +| | `Refresh` | Refresh icon | Refresh content or page | +| | `Remove` | Remove icon | Remove items (soft delete) | +| | `RemoveBlocklist` | Remove blocklist icon | Unblock | +| | `RemoveSecret` | Remove encrypted content | Remove encrypted items | +| | `Rename` | Rename icon | Rename files or items | +| | `Restore` | Restore icon | Restore deleted content | +| | `Save` | Save icon | Save content or changes | +| | `Scan` | Scan icon | Scan QR codes, etc. | +| | `Search` | Search icon | Search content | +| | `SelectAll` | Select all icon | Select all items | +| | `Settings` | Settings icon | App or system settings | +| | `Share` | Share icon | Share content to other platforms | +| | `Stick` | Stick icon | Pin content to the top | +| | `Unlike` | Unlike icon | Unlike or unfavorite | +| | `Unstick` | Unpin content | Unpin content | +| | `Update` | Update icon | Update apps or content | ### Other Icons The "Other" category includes icons for specific scenarios. -- `GitHub`: GitHub icon +| Preview | Icon Name | Description | +|---------------------------------------|-----------|-------------| +| | `GitHub` | GitHub icon | diff --git a/docs/zh_CN/guide/icons.md b/docs/zh_CN/guide/icons.md index d080409d..716a804d 100644 --- a/docs/zh_CN/guide/icons.md +++ b/docs/zh_CN/guide/icons.md @@ -41,56 +41,62 @@ Miuix 图标系统目前包含以下几个主要分类: 基础图标包含一些常用的基本界面元素,如箭头、勾选等,这些图标在 Miuix 本身的组件中也会使用到。以下是完整的列表: -- `Check`: 勾选图标 -- `ArrowUpDown`: 上下箭头图标 -- `ArrowUpDownIntegrated`: 集成的上下箭头图标 -- `ArrowRight`: 向右箭头图标 +| 预览 | 图标名 | 描述 | +|---------------------------------------------------------------------------|-------------------------|-----------| +| | `Check` | 勾选图标 | +| | `ArrowUpDown` | 上下箭头图标 | +| | `ArrowUpDownIntegrated` | 集成的上下箭头图标 | +| | `ArrowRight` | 向右箭头图标 | +| | `Search` | 搜索图标 | +| | `SearchCleanup` | 清空搜索图标 | ### Useful(实用图标) 实用图标包含大量常用的功能性图标,适用于各种应用场景。以下是完整的列表: -| 图标名 | 描述 | 常见用途 | -| ----------------- | ------------------ | -------------------------------- | -| `AddSecret` | 添加加密内容图标 | 添加密码、隐私项等需要加密的内容 | -| `Back` | 返回图标 | 导航返回上一级界面 | -| `Blocklist` | 黑名单图标 | 拉黑用户、添加屏蔽项 | -| `Cancel` | 取消图标 | 取消操作、关闭弹窗 | -| `Copy` | 复制图标 | 复制内容到剪贴板 | -| `Cut` | 剪切图标 | 剪切内容到剪贴板 | -| `Delete` | 删除图标 | 删除项目、内容或文件 | -| `Edit` | 编辑图标 | 编辑内容、修改信息 | -| `ImmersionMore` | 沉浸式更多选项图标 | 沉浸模式下显示更多选项 | -| `Info` | 信息图标 | 显示详细信息、提示 | -| `Like` | 喜欢图标 | 点赞、收藏功能 | -| `More` | 更多图标 | 显示更多选项或菜单 | -| `Move` | 移动图标 | 移动项目到其他位置 | -| `NavigatorSwitch` | 导航切换图标 | 切换导航视图 | -| `New` | 新建图标 | 创建新内容、文件或项目 | -| `Order` | 排序图标 | 内容排序 | -| `Paste` | 粘贴图标 | 从剪贴板粘贴内容 | -| `Personal` | 个人/用户图标 | 个人信息、用户页面 | -| `Play` | 播放图标 | 播放媒体内容 | -| `Reboot` | 重启图标 | 重启应用或系统 | -| `Refresh` | 刷新图标 | 刷新内容或页面 | -| `Remove` | 移除图标 | 移除项目(轻微删除) | -| `RemoveBlocklist` | 移除黑名单图标 | 解除屏蔽 | -| `RemoveSecret` | 移除加密内容图标 | 移除加密项 | -| `Rename` | 重命名图标 | 重命名文件或项目 | -| `Restore` | 恢复图标 | 恢复删除的内容 | -| `Save` | 保存图标 | 保存内容或更改 | -| `Scan` | 扫描图标 | 扫描二维码等 | -| `Search` | 搜索图标 | 搜索内容 | -| `SelectAll` | 全选图标 | 选择所有项目 | -| `Settings` | 设置图标 | 应用或系统设置 | -| `Share` | 分享图标 | 分享内容到其他平台 | -| `Stick` | 置顶图标 | 将内容置顶 | -| `Unlike` | 取消喜欢图标 | 取消点赞或收藏 | -| `Unstick` | 取消置顶图标 | 取消内容置顶 | -| `Update` | 更新图标 | 更新应用或内容 | +| 预览 | 图标名 | 描述 | 常见用途 | +|-------------------------------------------------|-------------------|-----------|------------------| +| | `AddSecret` | 添加加密内容图标 | 添加密码、隐私项等需要加密的内容 | +| | `Back` | 返回图标 | 导航返回上一级界面 | +| | `Blocklist` | 黑名单图标 | 拉黑用户、添加屏蔽项 | +| | `Cancel` | 取消图标 | 取消操作、关闭弹窗 | +| | `Copy` | 复制图标 | 复制内容到剪贴板 | +| | `Cut` | 剪切图标 | 剪切内容到剪贴板 | +| | `Delete` | 删除图标 | 删除项目、内容或文件 | +| | `Edit` | 编辑图标 | 编辑内容、修改信息 | +| | `ImmersionMore` | 沉浸式更多选项图标 | 沉浸模式下显示更多选项 | +| | `Info` | 信息图标 | 显示详细信息、提示 | +| | `Like` | 喜欢图标 | 点赞、收藏功能 | +| | `More` | 更多图标 | 显示更多选项或菜单 | +| | `Move` | 移动图标 | 移动项目到其他位置 | +| | `NavigatorSwitch` | 导航切换图标 | 切换导航视图 | +| | `New` | 新建图标 | 创建新内容、文件或项目 | +| | `Order` | 排序图标 | 内容排序 | +| | `Paste` | 粘贴图标 | 从剪贴板粘贴内容 | +| | `Personal` | 个人/用户图标 | 个人信息、用户页面 | +| | `Play` | 播放图标 | 播放媒体内容 | +| | `Reboot` | 重启图标 | 重启应用或系统 | +| | `Refresh` | 刷新图标 | 刷新内容或页面 | +| | `Remove` | 移除图标 | 移除项目(轻微删除) | +| | `RemoveBlocklist` | 移除黑名单图标 | 解除屏蔽 | +| | `RemoveSecret` | 移除加密内容图标 | 移除加密项 | +| | `Rename` | 重命名图标 | 重命名文件或项目 | +| | `Restore` | 恢复图标 | 恢复删除的内容 | +| | `Save` | 保存图标 | 保存内容或更改 | +| | `Scan` | 扫描图标 | 扫描二维码等 | +| | `Search` | 搜索图标 | 搜索内容 | +| | `SelectAll` | 全选图标 | 选择所有项目 | +| | `Settings` | 设置图标 | 应用或系统设置 | +| | `Share` | 分享图标 | 分享内容到其他平台 | +| | `Stick` | 置顶图标 | 将内容置顶 | +| | `Unlike` | 取消喜欢图标 | 取消点赞或收藏 | +| | `Unstick` | 取消置顶图标 | 取消内容置顶 | +| | `Update` | 更新图标 | 更新应用或内容 | ### Other(其他图标) 其他类别包含一些特定场景的图标。 -- `GitHub`: GitHub 图标 +| 预览 | 图标名 | 描述 | +|---------------------------------------|----------|-----------| +| | `GitHub` | GitHub 图标 | From c97dd613ccc619a6dce1234b4e824ca4b41e7d5b Mon Sep 17 00:00:00 2001 From: Kmiit Date: Sun, 7 Sep 2025 12:07:50 +0800 Subject: [PATCH 3/3] ci: Build icons for docs --- .github/workflows/docs.yml | 2 ++ .gitignore | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3678ffc6..5b455c4f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -38,6 +38,8 @@ jobs: ./gradlew :docs:demo:jsBrowserDistribution mkdir -p ./docs/public/compose mv ./docs/demo/build/dist/js/productionExecutable/* ./docs/public/compose + ./gradlew :docs:iconGen:generateSvg + mv ./docs/iconGen/build/generated-svg/icons ./docs/public/icons cd ./docs yarn install yarn docs:build diff --git a/.gitignore b/.gitignore index 88307464..78af02de 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ docs/.vitepress/dist docs/.vitepress/cache docs/public/dokka docs/public/compose +docs/public/icons