@manohub/icon 1.3.2 → 1.3.4

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 (246) hide show
  1. package/README.md +107 -243
  2. package/dist/glyph-modules.d.ts +12 -0
  3. package/dist/glyphs.d.ts +375 -0
  4. package/dist/icon-render.d.ts +1 -1
  5. package/dist/icon.d.ts +1 -1
  6. package/dist/index.d.ts +6 -8
  7. package/dist/index.js +608 -17
  8. package/dist/svg.d.ts +1 -0
  9. package/dist/svg.js +205 -259
  10. package/package.json +5 -23
  11. package/dist/glyphs/base/aggregate.d.ts +0 -2
  12. package/dist/glyphs/base/aggregate.js +0 -2
  13. package/dist/glyphs/base/ai.d.ts +0 -2
  14. package/dist/glyphs/base/ai.js +0 -3
  15. package/dist/glyphs/base/alert-circle.d.ts +0 -2
  16. package/dist/glyphs/base/alert-circle.js +0 -2
  17. package/dist/glyphs/base/alert.d.ts +0 -2
  18. package/dist/glyphs/base/alert.js +0 -2
  19. package/dist/glyphs/base/apps.d.ts +0 -2
  20. package/dist/glyphs/base/apps.js +0 -2
  21. package/dist/glyphs/base/archive.d.ts +0 -2
  22. package/dist/glyphs/base/archive.js +0 -2
  23. package/dist/glyphs/base/back.d.ts +0 -2
  24. package/dist/glyphs/base/back.js +0 -2
  25. package/dist/glyphs/base/braces.d.ts +0 -2
  26. package/dist/glyphs/base/braces.js +0 -2
  27. package/dist/glyphs/base/branch.d.ts +0 -2
  28. package/dist/glyphs/base/branch.js +0 -2
  29. package/dist/glyphs/base/calendar.d.ts +0 -2
  30. package/dist/glyphs/base/calendar.js +0 -2
  31. package/dist/glyphs/base/call.d.ts +0 -2
  32. package/dist/glyphs/base/call.js +0 -2
  33. package/dist/glyphs/base/check-circle.d.ts +0 -2
  34. package/dist/glyphs/base/check-circle.js +0 -2
  35. package/dist/glyphs/base/check.d.ts +0 -2
  36. package/dist/glyphs/base/check.js +0 -2
  37. package/dist/glyphs/base/chevron-down.d.ts +0 -2
  38. package/dist/glyphs/base/chevron-down.js +0 -2
  39. package/dist/glyphs/base/chevron-left.d.ts +0 -2
  40. package/dist/glyphs/base/chevron-left.js +0 -2
  41. package/dist/glyphs/base/chevron-right.d.ts +0 -2
  42. package/dist/glyphs/base/chevron-right.js +0 -2
  43. package/dist/glyphs/base/chevron-up.d.ts +0 -2
  44. package/dist/glyphs/base/chevron-up.js +0 -2
  45. package/dist/glyphs/base/chevrons-left.d.ts +0 -2
  46. package/dist/glyphs/base/chevrons-left.js +0 -4
  47. package/dist/glyphs/base/chevrons-right.d.ts +0 -2
  48. package/dist/glyphs/base/chevrons-right.js +0 -2
  49. package/dist/glyphs/base/clock.d.ts +0 -2
  50. package/dist/glyphs/base/clock.js +0 -2
  51. package/dist/glyphs/base/close-circle.d.ts +0 -2
  52. package/dist/glyphs/base/close-circle.js +0 -2
  53. package/dist/glyphs/base/close.d.ts +0 -2
  54. package/dist/glyphs/base/close.js +0 -2
  55. package/dist/glyphs/base/code.d.ts +0 -2
  56. package/dist/glyphs/base/code.js +0 -2
  57. package/dist/glyphs/base/copy.d.ts +0 -2
  58. package/dist/glyphs/base/copy.js +0 -2
  59. package/dist/glyphs/base/data.d.ts +0 -2
  60. package/dist/glyphs/base/data.js +0 -2
  61. package/dist/glyphs/base/delete.d.ts +0 -2
  62. package/dist/glyphs/base/delete.js +0 -2
  63. package/dist/glyphs/base/doc.d.ts +0 -2
  64. package/dist/glyphs/base/doc.js +0 -2
  65. package/dist/glyphs/base/download.d.ts +0 -2
  66. package/dist/glyphs/base/download.js +0 -2
  67. package/dist/glyphs/base/drag-handle.d.ts +0 -2
  68. package/dist/glyphs/base/drag-handle.js +0 -4
  69. package/dist/glyphs/base/edit.d.ts +0 -2
  70. package/dist/glyphs/base/edit.js +0 -2
  71. package/dist/glyphs/base/event.d.ts +0 -2
  72. package/dist/glyphs/base/event.js +0 -2
  73. package/dist/glyphs/base/external-link.d.ts +0 -2
  74. package/dist/glyphs/base/external-link.js +0 -2
  75. package/dist/glyphs/base/favorite-filled.d.ts +0 -2
  76. package/dist/glyphs/base/favorite-filled.js +0 -2
  77. package/dist/glyphs/base/favorite.d.ts +0 -2
  78. package/dist/glyphs/base/favorite.js +0 -2
  79. package/dist/glyphs/base/file-code.d.ts +0 -2
  80. package/dist/glyphs/base/file-code.js +0 -2
  81. package/dist/glyphs/base/file-json.d.ts +0 -2
  82. package/dist/glyphs/base/file-json.js +0 -2
  83. package/dist/glyphs/base/file-text.d.ts +0 -2
  84. package/dist/glyphs/base/file-text.js +0 -2
  85. package/dist/glyphs/base/file.d.ts +0 -2
  86. package/dist/glyphs/base/file.js +0 -2
  87. package/dist/glyphs/base/filter.d.ts +0 -2
  88. package/dist/glyphs/base/filter.js +0 -2
  89. package/dist/glyphs/base/folder-open.d.ts +0 -2
  90. package/dist/glyphs/base/folder-open.js +0 -2
  91. package/dist/glyphs/base/folder.d.ts +0 -2
  92. package/dist/glyphs/base/folder.js +0 -2
  93. package/dist/glyphs/base/gear.d.ts +0 -2
  94. package/dist/glyphs/base/gear.js +0 -2
  95. package/dist/glyphs/base/globe.d.ts +0 -2
  96. package/dist/glyphs/base/globe.js +0 -2
  97. package/dist/glyphs/base/group.d.ts +0 -2
  98. package/dist/glyphs/base/group.js +0 -2
  99. package/dist/glyphs/base/hand.d.ts +0 -2
  100. package/dist/glyphs/base/hand.js +0 -2
  101. package/dist/glyphs/base/help.d.ts +0 -2
  102. package/dist/glyphs/base/help.js +0 -2
  103. package/dist/glyphs/base/history.d.ts +0 -2
  104. package/dist/glyphs/base/history.js +0 -2
  105. package/dist/glyphs/base/home.d.ts +0 -2
  106. package/dist/glyphs/base/home.js +0 -2
  107. package/dist/glyphs/base/image.d.ts +0 -2
  108. package/dist/glyphs/base/image.js +0 -3
  109. package/dist/glyphs/base/index.d.ts +0 -228
  110. package/dist/glyphs/base/index.js +0 -232
  111. package/dist/glyphs/base/info-circle.d.ts +0 -2
  112. package/dist/glyphs/base/info-circle.js +0 -4
  113. package/dist/glyphs/base/info.d.ts +0 -2
  114. package/dist/glyphs/base/info.js +0 -8
  115. package/dist/glyphs/base/join.d.ts +0 -2
  116. package/dist/glyphs/base/join.js +0 -2
  117. package/dist/glyphs/base/key.d.ts +0 -2
  118. package/dist/glyphs/base/key.js +0 -2
  119. package/dist/glyphs/base/link.d.ts +0 -2
  120. package/dist/glyphs/base/link.js +0 -2
  121. package/dist/glyphs/base/list.d.ts +0 -2
  122. package/dist/glyphs/base/list.js +0 -2
  123. package/dist/glyphs/base/loading.d.ts +0 -2
  124. package/dist/glyphs/base/loading.js +0 -2
  125. package/dist/glyphs/base/lock.d.ts +0 -2
  126. package/dist/glyphs/base/lock.js +0 -2
  127. package/dist/glyphs/base/logout.d.ts +0 -2
  128. package/dist/glyphs/base/logout.js +0 -2
  129. package/dist/glyphs/base/maximize.d.ts +0 -2
  130. package/dist/glyphs/base/maximize.js +0 -2
  131. package/dist/glyphs/base/menu.d.ts +0 -2
  132. package/dist/glyphs/base/menu.js +0 -3
  133. package/dist/glyphs/base/minimize.d.ts +0 -2
  134. package/dist/glyphs/base/minimize.js +0 -2
  135. package/dist/glyphs/base/minus.d.ts +0 -2
  136. package/dist/glyphs/base/minus.js +0 -2
  137. package/dist/glyphs/base/more.d.ts +0 -2
  138. package/dist/glyphs/base/more.js +0 -2
  139. package/dist/glyphs/base/note.d.ts +0 -2
  140. package/dist/glyphs/base/note.js +0 -2
  141. package/dist/glyphs/base/notification.d.ts +0 -2
  142. package/dist/glyphs/base/notification.js +0 -2
  143. package/dist/glyphs/base/or.d.ts +0 -2
  144. package/dist/glyphs/base/or.js +0 -2
  145. package/dist/glyphs/base/package.d.ts +0 -2
  146. package/dist/glyphs/base/package.js +0 -2
  147. package/dist/glyphs/base/page-title.d.ts +0 -2
  148. package/dist/glyphs/base/page-title.js +0 -5
  149. package/dist/glyphs/base/pause-filled.d.ts +0 -2
  150. package/dist/glyphs/base/pause-filled.js +0 -2
  151. package/dist/glyphs/base/pause.d.ts +0 -2
  152. package/dist/glyphs/base/pause.js +0 -2
  153. package/dist/glyphs/base/play-filled.d.ts +0 -2
  154. package/dist/glyphs/base/play-filled.js +0 -2
  155. package/dist/glyphs/base/play.d.ts +0 -2
  156. package/dist/glyphs/base/play.js +0 -6
  157. package/dist/glyphs/base/plug.d.ts +0 -2
  158. package/dist/glyphs/base/plug.js +0 -2
  159. package/dist/glyphs/base/plus-circle.d.ts +0 -2
  160. package/dist/glyphs/base/plus-circle.js +0 -2
  161. package/dist/glyphs/base/plus.d.ts +0 -2
  162. package/dist/glyphs/base/plus.js +0 -2
  163. package/dist/glyphs/base/preview.d.ts +0 -2
  164. package/dist/glyphs/base/preview.js +0 -2
  165. package/dist/glyphs/base/receive.d.ts +0 -2
  166. package/dist/glyphs/base/receive.js +0 -2
  167. package/dist/glyphs/base/refresh.d.ts +0 -2
  168. package/dist/glyphs/base/refresh.js +0 -2
  169. package/dist/glyphs/base/rule.d.ts +0 -2
  170. package/dist/glyphs/base/rule.js +0 -2
  171. package/dist/glyphs/base/save.d.ts +0 -2
  172. package/dist/glyphs/base/save.js +0 -2
  173. package/dist/glyphs/base/search.d.ts +0 -2
  174. package/dist/glyphs/base/search.js +0 -2
  175. package/dist/glyphs/base/send.d.ts +0 -2
  176. package/dist/glyphs/base/send.js +0 -2
  177. package/dist/glyphs/base/settings.d.ts +0 -2
  178. package/dist/glyphs/base/settings.js +0 -2
  179. package/dist/glyphs/base/shield-alert.d.ts +0 -2
  180. package/dist/glyphs/base/shield-alert.js +0 -2
  181. package/dist/glyphs/base/shield-check.d.ts +0 -2
  182. package/dist/glyphs/base/shield-check.js +0 -2
  183. package/dist/glyphs/base/shield.d.ts +0 -2
  184. package/dist/glyphs/base/shield.js +0 -2
  185. package/dist/glyphs/base/split.d.ts +0 -2
  186. package/dist/glyphs/base/split.js +0 -2
  187. package/dist/glyphs/base/stop-filled.d.ts +0 -2
  188. package/dist/glyphs/base/stop-filled.js +0 -2
  189. package/dist/glyphs/base/stop.d.ts +0 -2
  190. package/dist/glyphs/base/stop.js +0 -2
  191. package/dist/glyphs/base/store.d.ts +0 -2
  192. package/dist/glyphs/base/store.js +0 -2
  193. package/dist/glyphs/base/sub.d.ts +0 -2
  194. package/dist/glyphs/base/sub.js +0 -2
  195. package/dist/glyphs/base/table.d.ts +0 -2
  196. package/dist/glyphs/base/table.js +0 -2
  197. package/dist/glyphs/base/tag.d.ts +0 -2
  198. package/dist/glyphs/base/tag.js +0 -2
  199. package/dist/glyphs/base/terminal.d.ts +0 -2
  200. package/dist/glyphs/base/terminal.js +0 -2
  201. package/dist/glyphs/base/tool.d.ts +0 -2
  202. package/dist/glyphs/base/tool.js +0 -2
  203. package/dist/glyphs/base/transform.d.ts +0 -2
  204. package/dist/glyphs/base/transform.js +0 -2
  205. package/dist/glyphs/base/union.d.ts +0 -2
  206. package/dist/glyphs/base/union.js +0 -2
  207. package/dist/glyphs/base/unlock.d.ts +0 -2
  208. package/dist/glyphs/base/unlock.js +0 -2
  209. package/dist/glyphs/base/upload.d.ts +0 -2
  210. package/dist/glyphs/base/upload.js +0 -2
  211. package/dist/glyphs/base/user.d.ts +0 -2
  212. package/dist/glyphs/base/user.js +0 -2
  213. package/dist/glyphs/base/users.d.ts +0 -2
  214. package/dist/glyphs/base/users.js +0 -2
  215. package/dist/glyphs/base/workbench.d.ts +0 -2
  216. package/dist/glyphs/base/workbench.js +0 -2
  217. package/dist/glyphs/business/agent.d.ts +0 -2
  218. package/dist/glyphs/business/agent.js +0 -3
  219. package/dist/glyphs/business/application.d.ts +0 -2
  220. package/dist/glyphs/business/application.js +0 -3
  221. package/dist/glyphs/business/client.d.ts +0 -2
  222. package/dist/glyphs/business/client.js +0 -3
  223. package/dist/glyphs/business/compose.d.ts +0 -2
  224. package/dist/glyphs/business/compose.js +0 -5
  225. package/dist/glyphs/business/exposure.d.ts +0 -2
  226. package/dist/glyphs/business/exposure.js +0 -3
  227. package/dist/glyphs/business/index.d.ts +0 -43
  228. package/dist/glyphs/business/index.js +0 -43
  229. package/dist/glyphs/business/log.d.ts +0 -2
  230. package/dist/glyphs/business/log.js +0 -3
  231. package/dist/glyphs/business/mcp.d.ts +0 -2
  232. package/dist/glyphs/business/mcp.js +0 -3
  233. package/dist/glyphs/business/openapi.d.ts +0 -2
  234. package/dist/glyphs/business/openapi.js +0 -3
  235. package/dist/glyphs/business/schema.d.ts +0 -2
  236. package/dist/glyphs/business/schema.js +0 -5
  237. package/dist/glyphs/business/server.d.ts +0 -2
  238. package/dist/glyphs/business/server.js +0 -3
  239. package/dist/glyphs/business/service.d.ts +0 -2
  240. package/dist/glyphs/business/service.js +0 -3
  241. package/dist/glyphs/index.d.ts +0 -150
  242. package/dist/glyphs/index.js +0 -65
  243. package/dist/icon-base.js +0 -44
  244. package/dist/icon-render.js +0 -60
  245. package/dist/icon.js +0 -52
  246. package/dist/uniquify-ids.js +0 -72
package/dist/svg.d.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  * 手工剥壳要处理「多层 `transform` 的净矩阵 / `fill-rule` / 查重」等 7 件事(三件几乎必错)。
6
6
  * 只在**构建期**用:`icon-from-svg` 读目录产出静态 `.ts` 表(片段进 git,可 review、可 diff),
7
7
  * 片段再交给 `<GlyphIcon>` 的 `glyph` / 插槽 —— 不在运行期归一(那会让每个消费方都背一遍解析器)。
8
+ * 本文件**不是公开出口**:`exports` 只有 `"."`,它只作为 `dist/svg.js` 给 `bin/icon-from-svg.mjs` 用。
8
9
  *
9
10
  * 纯字符串处理:不引 `vue`、不引 `node:*`,浏览器与 Node 都能用(读文件在 `bin/icon-from-svg.mjs`)。
10
11
  * 口径:只接收**单色**图形;渐变 / 滤镜 / 遮罩 / 多色一律拒绝(属产品专属图形,放应用侧 assets)。
package/dist/svg.js CHANGED
@@ -1,258 +1,210 @@
1
- /**
2
- * SVG 归一:把「完整 `.svg`」转成内容表要的**片段串**。
3
- *
4
- * 表里存的是片段(不含 `<svg>` 壳、不含硬编码颜色),而手上多半是设计工具导出的完整文件;
5
- * 手工剥壳要处理「多层 `transform` 的净矩阵 / `fill-rule` / 查重」等 7 件事(三件几乎必错)。
6
- * 只在**构建期**用:`icon-from-svg` 读目录产出静态 `.ts` 表(片段进 git,可 review、可 diff),
7
- * 片段再交给 `<GlyphIcon>` 的 `glyph` / 插槽 —— 不在运行期归一(那会让每个消费方都背一遍解析器)。
8
- *
9
- * 纯字符串处理:不引 `vue`、不引 `node:*`,浏览器与 Node 都能用(读文件在 `bin/icon-from-svg.mjs`)。
10
- * 口径:只接收**单色**图形;渐变 / 滤镜 / 遮罩 / 多色一律拒绝(属产品专属图形,放应用侧 assets)。
11
- */
12
- /** 可绘制的元素 */
13
- const DRAWABLE = new Set(['path', 'rect', 'circle', 'ellipse', 'polygon', 'polyline', 'line']);
14
- /** 片段里要保留的几何属性(其余属性一律丢弃:`id` / `class` / `xml-*` / `data-*` / 导出残留) */
1
+ const DRAWABLE = /* @__PURE__ */ new Set(["path", "rect", "circle", "ellipse", "polygon", "polyline", "line"]);
15
2
  const GEOMETRY = [
16
- 'd', 'x', 'y', 'width', 'height', 'rx', 'ry', 'cx', 'cy', 'r', 'points', 'x1', 'y1', 'x2', 'y2'
3
+ "d",
4
+ "x",
5
+ "y",
6
+ "width",
7
+ "height",
8
+ "rx",
9
+ "ry",
10
+ "cx",
11
+ "cy",
12
+ "r",
13
+ "points",
14
+ "x1",
15
+ "y1",
16
+ "x2",
17
+ "y2"
17
18
  ];
18
- /** 一出现就**拒绝**的元素:单色片段表达不了它们 */
19
19
  const REJECT_TAGS = {
20
- lineargradient: '线性渐变',
21
- radialgradient: '径向渐变',
22
- filter: '滤镜',
23
- mask: '蒙版',
24
- clippath: '裁剪路径',
25
- pattern: '填充图案',
26
- defs: '定义块(渐变 / 蒙版 / 符号等)',
27
- use: '引用(use)',
28
- symbol: '符号',
29
- marker: '标记',
30
- image: '位图',
31
- style: '内联样式表(片段里无法作用域隔离)'
20
+ lineargradient: "线性渐变",
21
+ radialgradient: "径向渐变",
22
+ filter: "滤镜",
23
+ mask: "蒙版",
24
+ clippath: "裁剪路径",
25
+ pattern: "填充图案",
26
+ defs: "定义块(渐变 / 蒙版 / 符号等)",
27
+ use: "引用(use)",
28
+ symbol: "符号",
29
+ marker: "标记",
30
+ image: "位图",
31
+ style: "内联样式表(片段里无法作用域隔离)"
32
32
  };
33
33
  const TAG = /<(\/?)([A-Za-z][\w:.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)(\/?)>/g;
34
- /* ============================ 小工具 ============================ */
35
34
  function parseAttrs(attrStr) {
36
- const out = {};
37
- const re = /([\w:.-]+)\s*=\s*"([^"]*)"/g;
38
- let m;
39
- while ((m = re.exec(attrStr)))
40
- out[m[1].toLowerCase()] = m[2];
41
- return out;
35
+ const out = {};
36
+ const re = /([\w:.-]+)\s*=\s*"([^"]*)"/g;
37
+ let m;
38
+ while (m = re.exec(attrStr)) out[m[1].toLowerCase()] = m[2];
39
+ return out;
42
40
  }
43
41
  const IDENTITY = [1, 0, 0, 1, 0, 0];
44
- /** 先施加 `n`、再施加 `m` */
45
42
  function mul(m, n) {
46
- return [
47
- m[0] * n[0] + m[2] * n[1],
48
- m[1] * n[0] + m[3] * n[1],
49
- m[0] * n[2] + m[2] * n[3],
50
- m[1] * n[2] + m[3] * n[3],
51
- m[0] * n[4] + m[2] * n[5] + m[4],
52
- m[1] * n[4] + m[3] * n[5] + m[5]
53
- ];
43
+ return [
44
+ m[0] * n[0] + m[2] * n[1],
45
+ m[1] * n[0] + m[3] * n[1],
46
+ m[0] * n[2] + m[2] * n[3],
47
+ m[1] * n[2] + m[3] * n[3],
48
+ m[0] * n[4] + m[2] * n[5] + m[4],
49
+ m[1] * n[4] + m[3] * n[5] + m[5]
50
+ ];
54
51
  }
55
52
  function parseTransform(str, warnings) {
56
- let m = IDENTITY;
57
- const re = /(translate|scale|matrix|rotate|skewX|skewY)\s*\(([^)]*)\)/gi;
58
- let t;
59
- while ((t = re.exec(str))) {
60
- const kind = t[1].toLowerCase();
61
- const nums = t[2].split(/[\s,]+/).filter(Boolean).map(Number);
62
- let n = null;
63
- if (kind === 'translate')
64
- n = [1, 0, 0, 1, nums[0] ?? 0, nums[1] ?? 0];
65
- else if (kind === 'scale')
66
- n = [nums[0] ?? 1, 0, 0, nums[1] ?? nums[0] ?? 1, 0, 0];
67
- else if (kind === 'matrix')
68
- n = nums;
69
- else
70
- warnings.push(`含 ${kind}() —— 该变换无法在不改写路径的前提下归一,已按原样保留`);
71
- if (n)
72
- m = mul(m, n);
73
- }
74
- return m;
53
+ let m = IDENTITY;
54
+ const re = /(translate|scale|matrix|rotate|skewX|skewY)\s*\(([^)]*)\)/gi;
55
+ let t;
56
+ while (t = re.exec(str)) {
57
+ const kind = t[1].toLowerCase();
58
+ const nums = t[2].split(/[\s,]+/).filter(Boolean).map(Number);
59
+ let n = null;
60
+ if (kind === "translate") n = [1, 0, 0, 1, nums[0] ?? 0, nums[1] ?? 0];
61
+ else if (kind === "scale") n = [nums[0] ?? 1, 0, 0, nums[1] ?? nums[0] ?? 1, 0, 0];
62
+ else if (kind === "matrix") n = nums;
63
+ else warnings.push(`含 ${kind}() —— 该变换无法在不改写路径的前提下归一,已按原样保留`);
64
+ if (n) m = mul(m, n);
65
+ }
66
+ return m;
75
67
  }
76
- /** 数字序列化:去掉浮点噪声,且不留 `1.50` 这种尾巴 */
77
68
  function num(n) {
78
- return String(Math.round(n * 1e6) / 1e6);
69
+ return String(Math.round(n * 1e6) / 1e6);
79
70
  }
80
71
  const isIdentity = (m) => m.every((v, i) => v === IDENTITY[i]);
81
72
  const sameMatrix = (a, b) => a.every((v, i) => v === b[i]);
82
- /** 矩阵 → `transform` 串(无旋转 / 斜切时写成更易读的 `translate() scale()`) */
83
73
  function matrixToTransform(m) {
84
- const [a, b, c, d, e, f] = m;
85
- if (b === 0 && c === 0) {
86
- const parts = [];
87
- if (e !== 0 || f !== 0)
88
- parts.push(`translate(${num(e)}, ${num(f)})`);
89
- if (a !== 1)
90
- parts.push(`scale(${num(a)})`);
91
- return parts.join(' ');
92
- }
93
- return `matrix(${m.map(num).join(' ')})`;
74
+ const [a, b, c, d, e, f] = m;
75
+ if (b === 0 && c === 0) {
76
+ const parts = [];
77
+ if (e !== 0 || f !== 0) parts.push(`translate(${num(e)}, ${num(f)})`);
78
+ if (a !== 1) parts.push(`scale(${num(a)})`);
79
+ return parts.join(" ");
80
+ }
81
+ return `matrix(${m.map(num).join(" ")})`;
94
82
  }
95
- /**
96
- * 完整 SVG 串 → 片段串。**入参不合法就抛错**(构建期应当直接失败,别写出半成品表)。
97
- *
98
- * 会做的事:剥壳与导出残留、合并多层 `transform`、单色归一为 `currentColor`、
99
- * 视口换算(包一层 `transform`,**不改写路径坐标**)、保住 `fill-rule`。
100
- * 拒绝的事:渐变 / 滤镜 / 蒙版 / 裁剪 / 内联样式表 / 多色 —— 报错信息里会说清是哪一个。
101
- */
102
- export function svgToFragment(svgText, options = {}) {
103
- const target = options.size ?? 24;
104
- const warnings = [];
105
- const text = svgText.replace(/^\uFEFF/, '');
106
- const openTag = text.match(/<svg\b[^>]*>/i);
107
- if (!openTag)
108
- throw new Error('不是一个 SVG 文件:找不到 <svg> 开标签');
109
- const svgAttrs = parseAttrs(openTag[0]);
110
- const viewBox = svgAttrs.viewbox ?? '';
111
- const vbNums = viewBox.split(/[\s,]+/).filter(Boolean).map(Number);
112
- const width = vbNums.length === 4 ? vbNums[2] : Number(svgAttrs.width) || 0;
113
- const height = vbNums.length === 4 ? vbNums[3] : Number(svgAttrs.height) || 0;
114
- if (!width || !height) {
115
- throw new Error('画板尺寸不明:`viewBox` 与 `width` / `height` 都没有可用的数值');
116
- }
117
- const side = Math.max(width, height);
118
- if (width !== height) {
119
- warnings.push(`画板非正方形(${num(width)}×${num(height)}),按长边 ${num(side)} 换算,短边一侧会有留白`);
83
+ function svgToFragment(svgText, options = {}) {
84
+ const target = options.size ?? 24;
85
+ const warnings = [];
86
+ const text = svgText.replace(/^\uFEFF/, "");
87
+ const openTag = text.match(/<svg\b[^>]*>/i);
88
+ if (!openTag) throw new Error("不是一个 SVG 文件:找不到 <svg> 开标签");
89
+ const svgAttrs = parseAttrs(openTag[0]);
90
+ const viewBox = svgAttrs.viewbox ?? "";
91
+ const vbNums = viewBox.split(/[\s,]+/).filter(Boolean).map(Number);
92
+ const width = vbNums.length === 4 ? vbNums[2] : Number(svgAttrs.width) || 0;
93
+ const height = vbNums.length === 4 ? vbNums[3] : Number(svgAttrs.height) || 0;
94
+ if (!width || !height) {
95
+ throw new Error("画板尺寸不明:`viewBox` 与 `width` / `height` 都没有可用的数值");
96
+ }
97
+ const side = Math.max(width, height);
98
+ if (width !== height) {
99
+ warnings.push(`画板非正方形(${num(width)}×${num(height)}),按长边 ${num(side)} 换算,短边一侧会有留白`);
100
+ }
101
+ const scale = target / side;
102
+ const inner = text.slice(text.indexOf(">", text.indexOf(openTag[0])) + 1).replace(/<\/svg\s*>[\s\S]*$/i, "");
103
+ const items = [];
104
+ const colors = /* @__PURE__ */ new Set();
105
+ const strokeWidths = /* @__PURE__ */ new Set();
106
+ let dropped = 0;
107
+ let strokeBased = false;
108
+ const root = { matrix: IDENTITY, opacity: 1 };
109
+ const stack = [root];
110
+ let m;
111
+ TAG.lastIndex = 0;
112
+ while (m = TAG.exec(inner)) {
113
+ const [, close, rawName, attrStr, selfClose] = m;
114
+ const name = rawName.toLowerCase();
115
+ if (name === "svg") throw new Error("内容里又出现一个 <svg>(嵌套 SVG 无法归一)");
116
+ const reject = REJECT_TAGS[name];
117
+ if (reject) throw new Error(`含 ${reject} <${rawName}>:单色片段表达不了,属产品专属图形,请放应用侧 assets`);
118
+ if (close) {
119
+ if (stack.length > 1) stack.pop();
120
+ continue;
120
121
  }
121
- const scale = target / side;
122
- // 只取 <svg> 标签之间的内容(外层壳与 <title> 一律不要)
123
- const inner = text.slice(text.indexOf('>', text.indexOf(openTag[0])) + 1).replace(/<\/svg\s*>[\s\S]*$/i, '');
124
- const items = [];
125
- const colors = new Set();
126
- const strokeWidths = new Set();
127
- let dropped = 0;
128
- let strokeBased = false;
129
- const root = { matrix: IDENTITY, opacity: 1 };
130
- const stack = [root];
131
- let m;
132
- TAG.lastIndex = 0;
133
- while ((m = TAG.exec(inner))) {
134
- const [, close, rawName, attrStr, selfClose] = m;
135
- const name = rawName.toLowerCase();
136
- if (name === 'svg')
137
- throw new Error('内容里又出现一个 <svg>(嵌套 SVG 无法归一)');
138
- const reject = REJECT_TAGS[name];
139
- if (reject)
140
- throw new Error(`含 ${reject} <${rawName}>:单色片段表达不了,属产品专属图形,请放应用侧 assets`);
141
- if (close) {
142
- if (stack.length > 1)
143
- stack.pop();
144
- continue;
145
- }
146
- const parent = stack[stack.length - 1];
147
- const attrs = parseAttrs(attrStr);
148
- const opacity = (attrs.opacity === undefined ? 1 : Number(attrs.opacity)) * parent.opacity;
149
- const node = {
150
- matrix: attrs.transform ? mul(parent.matrix, parseTransform(attrs.transform, warnings)) : parent.matrix,
151
- fill: attrs.fill ?? parent.fill,
152
- stroke: attrs.stroke ?? parent.stroke,
153
- fillRule: attrs['fill-rule'] ?? parent.fillRule,
154
- strokeWidth: attrs['stroke-width'] ?? parent.strokeWidth,
155
- opacity
156
- };
157
- if (DRAWABLE.has(name)) {
158
- const isPlaceholder = opacity === 0;
159
- if (isPlaceholder) {
160
- // 设计稿常见的「透明占位底」(16×16 空 rect);若它带可见子元素则不是占位,直接拦下
161
- if (!selfClose)
162
- dropped++;
163
- else
164
- dropped++;
165
- }
166
- else {
167
- items.push({ tag: name, attrs, matrix: node.matrix, fill: node.fill, stroke: node.stroke, fillRule: node.fillRule, opacity, strokeWidth: node.strokeWidth });
168
- if (node.fill && node.fill !== 'none')
169
- colors.add(node.fill);
170
- if (node.stroke && node.stroke !== 'none')
171
- colors.add(node.stroke);
172
- if (node.strokeWidth)
173
- strokeWidths.add(node.strokeWidth);
174
- }
175
- }
176
- if (!selfClose)
177
- stack.push(node);
178
- }
179
- if (!items.length)
180
- throw new Error('没扫到任何图形元素(可能全是透明占位或无内容)');
181
- const filled = items.filter((it) => (it.fill ?? 'none') !== 'none');
182
- strokeBased = filled.length === 0 && items.some((it) => (it.stroke ?? 'none') !== 'none');
183
- // 颜色:只允许「零种(完全继承)」或「一种」;两种以上就是多色图形
184
- const palette = [...colors].filter((c) => c !== 'currentColor');
185
- if (palette.length > 1) {
186
- throw new Error(`含 ${palette.length} 种颜色(${palette.join(' / ')}):多色图形请放应用侧 assets`);
187
- }
188
- if (strokeWidths.size > 1) {
189
- warnings.push(`各元素线重不一致(${[...strokeWidths].join(' / ')}),已按原值保留到片段上`);
122
+ const parent = stack[stack.length - 1];
123
+ const attrs = parseAttrs(attrStr);
124
+ const opacity = (attrs.opacity === void 0 ? 1 : Number(attrs.opacity)) * parent.opacity;
125
+ const node = {
126
+ matrix: attrs.transform ? mul(parent.matrix, parseTransform(attrs.transform, warnings)) : parent.matrix,
127
+ fill: attrs.fill ?? parent.fill,
128
+ stroke: attrs.stroke ?? parent.stroke,
129
+ fillRule: attrs["fill-rule"] ?? parent.fillRule,
130
+ strokeWidth: attrs["stroke-width"] ?? parent.strokeWidth,
131
+ opacity
132
+ };
133
+ if (DRAWABLE.has(name)) {
134
+ const isPlaceholder = opacity === 0;
135
+ if (isPlaceholder) {
136
+ if (!selfClose) dropped++;
137
+ else dropped++;
138
+ } else {
139
+ items.push({ tag: name, attrs, matrix: node.matrix, fill: node.fill, stroke: node.stroke, fillRule: node.fillRule, opacity, strokeWidth: node.strokeWidth });
140
+ if (node.fill && node.fill !== "none") colors.add(node.fill);
141
+ if (node.stroke && node.stroke !== "none") colors.add(node.stroke);
142
+ if (node.strokeWidth) strokeWidths.add(node.strokeWidth);
143
+ }
190
144
  }
191
- // 填充规则:全部一致才提到包装层,不一致就逐个写
192
- const rules = [...new Set(items.map((it) => it.fillRule ?? 'nonzero'))];
193
- if (rules.length > 1)
194
- warnings.push(`各元素 fill-rule 不一致(${rules.join(' / ')}),已逐个保留`);
195
- // 矩阵:全部一致就提到包装层(设计稿多导出一层画板偏移,净矩阵常为单位阵)
196
- const matrixes = items.map((it) => it.matrix);
197
- const uniform = matrixes.every((mm) => sameMatrix(mm, matrixes[0]));
198
- const body = items.map((it, i) => {
199
- const keep = GEOMETRY.filter((k) => it.attrs[k] !== undefined).map((k) => `${k}="${it.attrs[k]}"`);
200
- if (rules.length > 1)
201
- keep.push(`fill-rule="${it.fillRule ?? 'nonzero'}"`);
202
- if (it.opacity !== 1)
203
- keep.push(`opacity="${num(it.opacity)}"`);
204
- const geom = `<${it.tag} ${keep.join(' ')}/>`;
205
- if (uniform)
206
- return geom;
207
- // 坐标系不一致时逐个套自己的矩阵(不做展平改写,保持路径数据原样)
208
- const own = matrixToTransform(it.matrix);
209
- return own ? `<g transform="${own}">${geom}</g>` : geom;
210
- }).join('');
211
- // 包装层:外层视口换算 × (一致时)元素矩阵
212
- const viewport = [scale, 0, 0, scale, 0, 0];
213
- const wrap = uniform ? mul(viewport, matrixes[0]) : viewport;
214
- const transform = isIdentity(wrap) ? '' : ` transform="${matrixToTransform(wrap)}"`;
215
- const paint = strokeBased
216
- ? ' fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"'
217
- : ' fill="currentColor" stroke="none"';
218
- const ruleAttr = rules.length === 1 && rules[0] !== 'nonzero' ? ` fill-rule="${rules[0]}"` : '';
219
- const fragment = `<g${transform}${paint}${ruleAttr}>${body}</g>`;
220
- if (strokeBased) {
221
- const sw = strokeWidths.size === 1 ? [...strokeWidths][0] : undefined;
222
- warnings.push(`这是**描边型**图形${sw ? `(原线重 ${sw},原画板 ${num(side)} 口径)` : ''}:` +
223
- `渲染方的 <svg> 上写死 stroke-width="2",` +
224
- `${sw && Math.abs(Number(sw) * scale - 2) > 0.05 ? `此稿换算后约 ${num(Number(sw) * scale)},如需保真请在片段里显式写 stroke-width` : '如需改线重请在片段里显式写 stroke-width'}`);
145
+ if (!selfClose) stack.push(node);
146
+ }
147
+ if (!items.length) throw new Error("没扫到任何图形元素(可能全是透明占位或无内容)");
148
+ const filled = items.filter((it) => (it.fill ?? "none") !== "none");
149
+ strokeBased = filled.length === 0 && items.some((it) => (it.stroke ?? "none") !== "none");
150
+ const palette = [...colors].filter((c) => c !== "currentColor");
151
+ if (palette.length > 1) {
152
+ throw new Error(`含 ${palette.length} 种颜色(${palette.join(" / ")}):多色图形请放应用侧 assets`);
153
+ }
154
+ if (strokeWidths.size > 1) {
155
+ warnings.push(`各元素线重不一致(${[...strokeWidths].join(" / ")}),已按原值保留到片段上`);
156
+ }
157
+ const rules = [...new Set(items.map((it) => it.fillRule ?? "nonzero"))];
158
+ if (rules.length > 1) warnings.push(`各元素 fill-rule 不一致(${rules.join(" / ")}),已逐个保留`);
159
+ const matrixes = items.map((it) => it.matrix);
160
+ const uniform = matrixes.every((mm) => sameMatrix(mm, matrixes[0]));
161
+ const body = items.map((it, i) => {
162
+ const keep = GEOMETRY.filter((k) => it.attrs[k] !== void 0).map((k) => `${k}="${it.attrs[k]}"`);
163
+ if (rules.length > 1) keep.push(`fill-rule="${it.fillRule ?? "nonzero"}"`);
164
+ if (it.opacity !== 1) keep.push(`opacity="${num(it.opacity)}"`);
165
+ const geom = `<${it.tag} ${keep.join(" ")}/>`;
166
+ if (uniform) return geom;
167
+ const own = matrixToTransform(it.matrix);
168
+ return own ? `<g transform="${own}">${geom}</g>` : geom;
169
+ }).join("");
170
+ const viewport = [scale, 0, 0, scale, 0, 0];
171
+ const wrap = uniform ? mul(viewport, matrixes[0]) : viewport;
172
+ const transform = isIdentity(wrap) ? "" : ` transform="${matrixToTransform(wrap)}"`;
173
+ const paint = strokeBased ? ' fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"' : ' fill="currentColor" stroke="none"';
174
+ const ruleAttr = rules.length === 1 && rules[0] !== "nonzero" ? ` fill-rule="${rules[0]}"` : "";
175
+ const fragment = `<g${transform}${paint}${ruleAttr}>${body}</g>`;
176
+ if (strokeBased) {
177
+ const sw = strokeWidths.size === 1 ? [...strokeWidths][0] : void 0;
178
+ warnings.push(
179
+ `这是**描边型**图形${sw ? `(原线重 ${sw},原画板 ${num(side)} 口径)` : ""}:渲染方的 <svg> 上写死 stroke-width="2",${sw && Math.abs(Number(sw) * scale - 2) > 0.05 ? `此稿换算后约 ${num(Number(sw) * scale)},如需保真请在片段里显式写 stroke-width` : "如需改线重请在片段里显式写 stroke-width"}`
180
+ );
181
+ }
182
+ if (dropped) warnings.push(`丢弃了 ${dropped} 个透明元素(opacity="0",通常是设计稿的占位底)`);
183
+ return {
184
+ fragment,
185
+ warnings,
186
+ info: {
187
+ side,
188
+ viewBox,
189
+ scale,
190
+ elements: items.length,
191
+ fillRule: rules.length === 1 ? rules[0] : "mixed",
192
+ strokeBased,
193
+ strokeWidth: strokeBased && strokeWidths.size === 1 ? Number([...strokeWidths][0]) : void 0
225
194
  }
226
- if (dropped)
227
- warnings.push(`丢弃了 ${dropped} 个透明元素(opacity="0",通常是设计稿的占位底)`);
228
- return {
229
- fragment,
230
- warnings,
231
- info: {
232
- side,
233
- viewBox,
234
- scale,
235
- elements: items.length,
236
- fillRule: rules.length === 1 ? rules[0] : 'mixed',
237
- strokeBased,
238
- strokeWidth: strokeBased && strokeWidths.size === 1 ? Number([...strokeWidths][0]) : undefined
239
- }
240
- };
195
+ };
241
196
  }
242
- /**
243
- * 生成静态内容表的 TS 源码(`icon-from-svg` 的产物)。
244
- *
245
- * 生成物是**可 review 的源码**,不是运行期拼的 —— 这是本工具走构建期的全部理由。
246
- */
247
- export function buildTableSource(entries, options = {}) {
248
- const constName = options.constName ?? 'PROJECT_GLYPHS';
249
- const rows = entries.map((e) => {
250
- const notes = e.notes?.length ? e.notes.map((n) => ` // ${n}\n`).join('') : '';
251
- const source = e.source ? ` // 源文件:${e.source}\n` : '';
252
- return `${notes}${source} '${e.name}': '${e.fragment}',`;
253
- }).join('\n');
254
- return `/**
255
- * ${options.title ?? '项目自带图标字形表'}。
197
+ function buildTableSource(entries, options = {}) {
198
+ const constName = options.constName ?? "PROJECT_GLYPHS";
199
+ const rows = entries.map((e) => {
200
+ const notes = e.notes?.length ? e.notes.map((n) => ` // ${n}
201
+ `).join("") : "";
202
+ const source = e.source ? ` // 源文件:${e.source}
203
+ ` : "";
204
+ return `${notes}${source} '${e.name}': '${e.fragment}',`;
205
+ }).join("\n");
206
+ return `/**
207
+ * ${options.title ?? "项目自带图标字形表"}。
256
208
  *
257
209
  * **由 \`icon-from-svg\` 从 SVG 生成,请勿手改** —— 设计稿改了重新生成一次即可。
258
210
  * 片段口径:24 视口、单色 \`currentColor\`、坐标不重写(视口换算靠包装层 \`transform\`)。
@@ -271,31 +223,25 @@ ${rows}
271
223
  } as const
272
224
  `;
273
225
  }
274
- /* ============================ 查重 ============================ */
275
- /**
276
- * 同一图形的两条条目(命令序列逐字相同 + 所有点位移一致 ⇒ 只是画板里挪了位置)。
277
- * 设计稿常对多个菜单位复用同一图形,生成时顺带报出来:同形只留一条,另一处复用同名字形。
278
- */
279
- export function findDuplicatePairs(entries) {
280
- // 只取路径 `d` 里的坐标:整串里的数字(如包装层的 `scale(1.5)`)会让点位错配,查重就失效了
281
- const svgPaths = (s) => [...s.matchAll(/ d="([^"]+)"/g)].map((m) => m[1]);
282
- const cmds = (s) => svgPaths(s).map((p) => (p.match(/[A-Za-z]/g) ?? []).join('')).join('|');
283
- const nums = (s) => svgPaths(s).flatMap((p) => (p.match(/-?\d*\.?\d+/g) ?? []).map(Number));
284
- const info = entries.map((e) => ({ name: e.name, c: cmds(e.fragment), v: nums(e.fragment) }));
285
- const out = [];
286
- for (let i = 0; i < info.length; i++) {
287
- for (let j = i + 1; j < info.length; j++) {
288
- const a = info[i];
289
- const b = info[j];
290
- if (a.c !== b.c || a.v.length !== b.v.length || !a.v.length)
291
- continue;
292
- const deltas = new Set();
293
- for (let k = 0; k + 1 < a.v.length; k += 2) {
294
- deltas.add(`(${num(b.v[k] - a.v[k])}, ${num(b.v[k + 1] - a.v[k + 1])})`);
295
- }
296
- if (deltas.size === 1)
297
- out.push({ a: a.name, b: b.name, delta: [...deltas][0] });
298
- }
226
+ function findDuplicatePairs(entries) {
227
+ const svgPaths = (s) => [...s.matchAll(/ d="([^"]+)"/g)].map((m) => m[1]);
228
+ const cmds = (s) => svgPaths(s).map((p) => (p.match(/[A-Za-z]/g) ?? []).join("")).join("|");
229
+ const nums = (s) => svgPaths(s).flatMap((p) => (p.match(/-?\d*\.?\d+/g) ?? []).map(Number));
230
+ const info = entries.map((e) => ({ name: e.name, c: cmds(e.fragment), v: nums(e.fragment) }));
231
+ const out = [];
232
+ for (let i = 0; i < info.length; i++) {
233
+ for (let j = i + 1; j < info.length; j++) {
234
+ const a = info[i];
235
+ const b = info[j];
236
+ if (a.c !== b.c || a.v.length !== b.v.length || !a.v.length) continue;
237
+ const deltas = /* @__PURE__ */ new Set();
238
+ for (let k = 0; k + 1 < a.v.length; k += 2) {
239
+ deltas.add(`(${num(b.v[k] - a.v[k])}, ${num(b.v[k + 1] - a.v[k + 1])})`);
240
+ }
241
+ if (deltas.size === 1) out.push({ a: a.name, b: b.name, delta: [...deltas][0] });
299
242
  }
300
- return out;
243
+ }
244
+ return out;
301
245
  }
246
+
247
+ export { buildTableSource, findDuplicatePairs, svgToFragment };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@manohub/icon",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "private": false,
5
5
  "type": "module",
6
- "description": "AIHub 图标包:内置 SVG 图标内容表 + 纯字符串渲染器 + <Icon> 组件。零运行时依赖(仅 peer vue),供任意 UI 栈消费",
6
+ "description": "AIHub 图标包:独立 SVG 字形源 + 纯字符串渲染器 + <Icon> 组件。单入口、零运行时依赖(仅 peer vue)",
7
7
  "license": "UNLICENSED",
8
8
  "repository": {
9
9
  "type": "git",
@@ -27,26 +27,6 @@
27
27
  ".": {
28
28
  "types": "./dist/index.d.ts",
29
29
  "import": "./dist/index.js"
30
- },
31
- "./base": {
32
- "types": "./dist/icon-base.d.ts",
33
- "import": "./dist/icon-base.js"
34
- },
35
- "./glyphs": {
36
- "types": "./dist/glyphs/index.d.ts",
37
- "import": "./dist/glyphs/index.js"
38
- },
39
- "./glyphs/base/*": {
40
- "types": "./dist/glyphs/base/*.d.ts",
41
- "import": "./dist/glyphs/base/*.js"
42
- },
43
- "./glyphs/business/*": {
44
- "types": "./dist/glyphs/business/*.d.ts",
45
- "import": "./dist/glyphs/business/*.js"
46
- },
47
- "./svg": {
48
- "types": "./dist/svg.d.ts",
49
- "import": "./dist/svg.js"
50
30
  }
51
31
  },
52
32
  "main": "./dist/index.js",
@@ -57,11 +37,13 @@
57
37
  },
58
38
  "devDependencies": {
59
39
  "typescript": "^6.0.2",
40
+ "vite": "^7.3.6",
60
41
  "vitest": "^3.2.7",
61
42
  "vue": "^3.5.40"
62
43
  },
63
44
  "scripts": {
64
- "build": "node ../../scripts/clean-dist.mjs && tsc -p tsconfig.build.json",
45
+ "dev": "vite",
46
+ "build": "vite build && tsc -p tsconfig.build.json",
65
47
  "type-check": "tsc --noEmit -p tsconfig.json",
66
48
  "test:unit": "vitest run",
67
49
  "test:watch": "vitest"
@@ -1,2 +0,0 @@
1
- declare const aggregateGlyph = "<path d=\"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2\"/>";
2
- export default aggregateGlyph;
@@ -1,2 +0,0 @@
1
- const aggregateGlyph = '<path d="M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2"/>';
2
- export default aggregateGlyph;
@@ -1,2 +0,0 @@
1
- declare const aiGlyph = "<path d=\"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z\"/><path d=\"M20 3v4\"/><path d=\"M22 5h-4\"/><path d=\"M4 17v2\"/><path d=\"M5 18H3\"/>";
2
- export default aiGlyph;
@@ -1,3 +0,0 @@
1
- // ===== 状态 / 业务 =====
2
- const aiGlyph = '<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/><path d="M20 3v4"/><path d="M22 5h-4"/><path d="M4 17v2"/><path d="M5 18H3"/>';
3
- export default aiGlyph;
@@ -1,2 +0,0 @@
1
- declare const alertCircleGlyph = "<circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\"/><line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\"/>";
2
- export default alertCircleGlyph;
@@ -1,2 +0,0 @@
1
- const alertCircleGlyph = '<circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/>';
2
- export default alertCircleGlyph;
@@ -1,2 +0,0 @@
1
- declare const alertGlyph = "<path d=\"M12 5v9\"/><path d=\"M12 19h.01\"/>";
2
- export default alertGlyph;
@@ -1,2 +0,0 @@
1
- const alertGlyph = '<path d="M12 5v9"/><path d="M12 19h.01"/>';
2
- export default alertGlyph;
@@ -1,2 +0,0 @@
1
- declare const appsGlyph = "<g fill=\"currentColor\" stroke=\"none\"><circle cx=\"5\" cy=\"5\" r=\"1.5\"/><circle cx=\"12\" cy=\"5\" r=\"1.5\"/><circle cx=\"19\" cy=\"5\" r=\"1.5\"/><circle cx=\"5\" cy=\"12\" r=\"1.5\"/><circle cx=\"12\" cy=\"12\" r=\"1.5\"/><circle cx=\"19\" cy=\"12\" r=\"1.5\"/><circle cx=\"5\" cy=\"19\" r=\"1.5\"/><circle cx=\"12\" cy=\"19\" r=\"1.5\"/><circle cx=\"19\" cy=\"19\" r=\"1.5\"/></g>";
2
- export default appsGlyph;
@@ -1,2 +0,0 @@
1
- const appsGlyph = '<g fill="currentColor" stroke="none"><circle cx="5" cy="5" r="1.5"/><circle cx="12" cy="5" r="1.5"/><circle cx="19" cy="5" r="1.5"/><circle cx="5" cy="12" r="1.5"/><circle cx="12" cy="12" r="1.5"/><circle cx="19" cy="12" r="1.5"/><circle cx="5" cy="19" r="1.5"/><circle cx="12" cy="19" r="1.5"/><circle cx="19" cy="19" r="1.5"/></g>';
2
- export default appsGlyph;
@@ -1,2 +0,0 @@
1
- declare const archiveGlyph = "<rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\"/><path d=\"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\"/><path d=\"M10 12h4\"/>";
2
- export default archiveGlyph;
@@ -1,2 +0,0 @@
1
- const archiveGlyph = '<rect width="20" height="5" x="2" y="3" rx="1"/><path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"/><path d="M10 12h4"/>';
2
- export default archiveGlyph;