@manohub/icon 1.1.4 → 1.2.0
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/README.md +90 -22
- package/dist/glyphs/base/ai.d.ts +2 -0
- package/dist/glyphs/base/ai.js +3 -0
- package/dist/glyphs/base/alert-circle.d.ts +2 -0
- package/dist/glyphs/base/alert-circle.js +2 -0
- package/dist/glyphs/base/alert.d.ts +2 -0
- package/dist/glyphs/base/alert.js +2 -0
- package/dist/glyphs/base/apps.d.ts +2 -0
- package/dist/glyphs/base/apps.js +2 -0
- package/dist/glyphs/base/archive.d.ts +2 -0
- package/dist/glyphs/base/archive.js +2 -0
- package/dist/glyphs/base/back.d.ts +2 -0
- package/dist/glyphs/base/back.js +2 -0
- package/dist/glyphs/base/branch.d.ts +2 -0
- package/dist/glyphs/base/branch.js +2 -0
- package/dist/glyphs/base/calendar.d.ts +2 -0
- package/dist/glyphs/base/calendar.js +2 -0
- package/dist/glyphs/base/check-circle.d.ts +2 -0
- package/dist/glyphs/base/check-circle.js +2 -0
- package/dist/glyphs/base/check.d.ts +2 -0
- package/dist/glyphs/base/check.js +2 -0
- package/dist/glyphs/base/chevron-down.d.ts +2 -0
- package/dist/glyphs/base/chevron-down.js +2 -0
- package/dist/glyphs/base/chevron-left.d.ts +2 -0
- package/dist/glyphs/base/chevron-left.js +2 -0
- package/dist/glyphs/base/chevron-right.d.ts +2 -0
- package/dist/glyphs/base/chevron-right.js +2 -0
- package/dist/glyphs/base/chevron-up.d.ts +2 -0
- package/dist/glyphs/base/chevron-up.js +2 -0
- package/dist/glyphs/base/chevrons-left.d.ts +2 -0
- package/dist/glyphs/base/chevrons-left.js +4 -0
- package/dist/glyphs/base/chevrons-right.d.ts +2 -0
- package/dist/glyphs/base/chevrons-right.js +2 -0
- package/dist/glyphs/base/clock.d.ts +2 -0
- package/dist/glyphs/base/clock.js +2 -0
- package/dist/glyphs/base/close-circle.d.ts +2 -0
- package/dist/glyphs/base/close-circle.js +2 -0
- package/dist/glyphs/base/close.d.ts +2 -0
- package/dist/glyphs/base/close.js +2 -0
- package/dist/glyphs/base/copy.d.ts +2 -0
- package/dist/glyphs/base/copy.js +2 -0
- package/dist/glyphs/base/delete.d.ts +2 -0
- package/dist/glyphs/base/delete.js +2 -0
- package/dist/glyphs/base/download.d.ts +2 -0
- package/dist/glyphs/base/download.js +2 -0
- package/dist/glyphs/base/drag-handle.d.ts +2 -0
- package/dist/glyphs/base/drag-handle.js +4 -0
- package/dist/glyphs/base/edit.d.ts +2 -0
- package/dist/glyphs/base/edit.js +2 -0
- package/dist/glyphs/base/external-link.d.ts +2 -0
- package/dist/glyphs/base/external-link.js +2 -0
- package/dist/glyphs/base/favorite-filled.d.ts +2 -0
- package/dist/glyphs/base/favorite-filled.js +2 -0
- package/dist/glyphs/base/favorite.d.ts +2 -0
- package/dist/glyphs/base/favorite.js +2 -0
- package/dist/glyphs/base/file-code.d.ts +2 -0
- package/dist/glyphs/base/file-code.js +2 -0
- package/dist/glyphs/base/file-json.d.ts +2 -0
- package/dist/glyphs/base/file-json.js +2 -0
- package/dist/glyphs/base/file-text.d.ts +2 -0
- package/dist/glyphs/base/file-text.js +2 -0
- package/dist/glyphs/base/file.d.ts +2 -0
- package/dist/glyphs/base/file.js +2 -0
- package/dist/glyphs/base/filter.d.ts +2 -0
- package/dist/glyphs/base/filter.js +2 -0
- package/dist/glyphs/base/folder-open.d.ts +2 -0
- package/dist/glyphs/base/folder-open.js +2 -0
- package/dist/glyphs/base/folder.d.ts +2 -0
- package/dist/glyphs/base/folder.js +2 -0
- package/dist/glyphs/base/help.d.ts +2 -0
- package/dist/glyphs/base/help.js +2 -0
- package/dist/glyphs/base/history.d.ts +2 -0
- package/dist/glyphs/base/history.js +2 -0
- package/dist/glyphs/base/home.d.ts +2 -0
- package/dist/glyphs/base/home.js +2 -0
- package/dist/glyphs/base/image.d.ts +2 -0
- package/dist/glyphs/base/image.js +3 -0
- package/dist/glyphs/base/index.d.ts +172 -0
- package/dist/glyphs/base/index.js +172 -0
- package/dist/glyphs/base/info-circle.d.ts +2 -0
- package/dist/glyphs/base/info-circle.js +4 -0
- package/dist/glyphs/base/info.d.ts +2 -0
- package/dist/glyphs/base/info.js +8 -0
- package/dist/glyphs/base/key.d.ts +2 -0
- package/dist/glyphs/base/key.js +2 -0
- package/dist/glyphs/base/link.d.ts +2 -0
- package/dist/glyphs/base/link.js +2 -0
- package/dist/glyphs/base/list.d.ts +2 -0
- package/dist/glyphs/base/list.js +2 -0
- package/dist/glyphs/base/loading.d.ts +2 -0
- package/dist/glyphs/base/loading.js +2 -0
- package/dist/glyphs/base/lock.d.ts +2 -0
- package/dist/glyphs/base/lock.js +2 -0
- package/dist/glyphs/base/logout.d.ts +2 -0
- package/dist/glyphs/base/logout.js +2 -0
- package/dist/glyphs/base/menu.d.ts +2 -0
- package/dist/glyphs/base/menu.js +3 -0
- package/dist/glyphs/base/minus.d.ts +2 -0
- package/dist/glyphs/base/minus.js +2 -0
- package/dist/glyphs/base/more.d.ts +2 -0
- package/dist/glyphs/base/more.js +2 -0
- package/dist/glyphs/base/notification.d.ts +2 -0
- package/dist/glyphs/base/notification.js +2 -0
- package/dist/glyphs/base/package.d.ts +2 -0
- package/dist/glyphs/base/package.js +2 -0
- package/dist/glyphs/base/page-title.d.ts +2 -0
- package/dist/glyphs/base/page-title.js +5 -0
- package/dist/glyphs/base/pause-filled.d.ts +2 -0
- package/dist/glyphs/base/pause-filled.js +2 -0
- package/dist/glyphs/base/pause.d.ts +2 -0
- package/dist/glyphs/base/pause.js +2 -0
- package/dist/glyphs/base/play-filled.d.ts +2 -0
- package/dist/glyphs/base/play-filled.js +2 -0
- package/dist/glyphs/base/play.d.ts +2 -0
- package/dist/glyphs/base/play.js +6 -0
- package/dist/glyphs/base/plug.d.ts +2 -0
- package/dist/glyphs/base/plug.js +2 -0
- package/dist/glyphs/base/plus-circle.d.ts +2 -0
- package/dist/glyphs/base/plus-circle.js +2 -0
- package/dist/glyphs/base/plus.d.ts +2 -0
- package/dist/glyphs/base/plus.js +2 -0
- package/dist/glyphs/base/preview.d.ts +2 -0
- package/dist/glyphs/base/preview.js +2 -0
- package/dist/glyphs/base/refresh.d.ts +2 -0
- package/dist/glyphs/base/refresh.js +2 -0
- package/dist/glyphs/base/save.d.ts +2 -0
- package/dist/glyphs/base/save.js +2 -0
- package/dist/glyphs/base/search.d.ts +2 -0
- package/dist/glyphs/base/search.js +2 -0
- package/dist/glyphs/base/settings.d.ts +2 -0
- package/dist/glyphs/base/settings.js +2 -0
- package/dist/glyphs/base/shield-alert.d.ts +2 -0
- package/dist/glyphs/base/shield-alert.js +2 -0
- package/dist/glyphs/base/shield-check.d.ts +2 -0
- package/dist/glyphs/base/shield-check.js +2 -0
- package/dist/glyphs/base/shield.d.ts +2 -0
- package/dist/glyphs/base/shield.js +2 -0
- package/dist/glyphs/base/table.d.ts +2 -0
- package/dist/glyphs/base/table.js +2 -0
- package/dist/glyphs/base/tag.d.ts +2 -0
- package/dist/glyphs/base/tag.js +2 -0
- package/dist/glyphs/base/terminal.d.ts +2 -0
- package/dist/glyphs/base/terminal.js +2 -0
- package/dist/glyphs/base/tool.d.ts +2 -0
- package/dist/glyphs/base/tool.js +2 -0
- package/dist/glyphs/base/unlock.d.ts +2 -0
- package/dist/glyphs/base/unlock.js +2 -0
- package/dist/glyphs/base/upload.d.ts +2 -0
- package/dist/glyphs/base/upload.js +2 -0
- package/dist/glyphs/base/user.d.ts +2 -0
- package/dist/glyphs/base/user.js +2 -0
- package/dist/glyphs/base/users.d.ts +2 -0
- package/dist/glyphs/base/users.js +2 -0
- package/dist/glyphs/base/workbench.d.ts +2 -0
- package/dist/glyphs/base/workbench.js +2 -0
- package/dist/glyphs/business/agent.d.ts +2 -0
- package/dist/glyphs/business/agent.js +3 -0
- package/dist/glyphs/business/application.d.ts +2 -0
- package/dist/glyphs/business/application.js +3 -0
- package/dist/glyphs/business/client.d.ts +2 -0
- package/dist/glyphs/business/client.js +3 -0
- package/dist/glyphs/business/compose.d.ts +2 -0
- package/dist/glyphs/business/compose.js +5 -0
- package/dist/glyphs/business/exposure.d.ts +2 -0
- package/dist/glyphs/business/exposure.js +3 -0
- package/dist/{business-glyphs.d.ts → glyphs/business/index.d.ts} +18 -1
- package/dist/glyphs/business/index.js +43 -0
- package/dist/glyphs/business/log.d.ts +2 -0
- package/dist/glyphs/business/log.js +3 -0
- package/dist/glyphs/business/mcp.d.ts +2 -0
- package/dist/glyphs/business/mcp.js +3 -0
- package/dist/glyphs/business/openapi.d.ts +2 -0
- package/dist/glyphs/business/openapi.js +3 -0
- package/dist/glyphs/business/schema.d.ts +2 -0
- package/dist/glyphs/business/schema.js +5 -0
- package/dist/glyphs/business/server.d.ts +2 -0
- package/dist/glyphs/business/server.js +3 -0
- package/dist/glyphs/business/service.d.ts +2 -0
- package/dist/glyphs/business/service.js +3 -0
- package/dist/{glyphs.d.ts → glyphs/index.d.ts} +10 -4
- package/dist/glyphs/index.js +62 -0
- package/dist/icon-base.d.ts +81 -0
- package/dist/icon-base.js +44 -0
- package/dist/icon-render.d.ts +19 -0
- package/dist/icon-render.js +55 -0
- package/dist/icon.d.ts +12 -4
- package/dist/icon.js +14 -51
- package/dist/index.d.ts +10 -4
- package/dist/index.js +10 -4
- package/dist/svg.d.ts +1 -1
- package/dist/svg.js +4 -4
- package/package.json +15 -3
- package/dist/business-glyphs.js +0 -41
- package/dist/glyphs.js +0 -159
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const serverGlyph = "<g transform=\"scale(1.5)\" fill=\"currentColor\" stroke=\"none\" fill-rule=\"evenodd\"><path d=\"M3.5,9 C4.88071187,9 6,10.1192881 6,11.5 C6,12.8807119 4.88071187,14 3.5,14 C2.11928813,14 1,12.8807119 1,11.5 C1,10.1192881 2.11928813,9 3.5,9 Z M12.1666667,9 C13.5473785,9 14.6666667,10.1192881 14.6666667,11.5 C14.6666667,12.8807119 13.5473785,14 12.1666667,14 C10.7859548,14 9.66666667,12.8807119 9.66666667,11.5 C9.66666667,10.1192881 10.7859548,9 12.1666667,9 Z M9.042,12.848 C9.21690848,12.7976019 9.40538721,12.8462386 9.53406947,12.974978 C9.66275173,13.1037173 9.71130483,13.2922176 9.66082913,13.4671037 C9.61035343,13.6419898 9.46882444,13.7756285 9.29133333,13.816 C8.33482407,14.0614139 7.3318426,14.0614139 6.37533333,13.816 C6.19784223,13.7756285 6.05631324,13.6419898 6.00583753,13.4671037 C5.95536183,13.2922176 6.00391493,13.1037173 6.1325972,12.974978 C6.26127946,12.8462386 6.44975818,12.7976019 6.62466667,12.848 C7.01959908,12.9490897 7.42566837,13.0001564 7.83333333,13 C8.2409983,13.0001564 8.64706759,12.9490897 9.042,12.848 Z M3.5,10 C2.67157288,10 2,10.6715729 2,11.5 C2,12.3284271 2.67157288,13 3.5,13 C4.32842712,13 5,12.3284271 5,11.5 C5,10.6715729 4.32842712,10 3.5,10 Z M12.1666667,10 C11.3382395,10 10.6666667,10.6715729 10.6666667,11.5 C10.6666667,12.3284271 11.3382395,13 12.1666667,13 C12.9950938,13 13.6666667,12.3284271 13.6666667,11.5 C13.6666667,10.6715729 12.9950938,10 12.1666667,10 Z M3.97466667,3.792 C4.18214383,3.61452783 4.49362474,3.63630288 4.67439099,3.84091644 C4.85515724,4.04553 4.83836433,4.35731921 4.63666667,4.54133333 C3.59467132,5.45783105 2.99824233,6.77896379 2.99999697,8.16666667 C2.99999697,8.44280904 2.77614237,8.66666667 2.49999697,8.66666667 C2.22385763,8.66666667 1.99999697,8.44280904 1.99999697,8.16666667 C1.99829314,6.49228454 2.71780523,4.89828105 3.97466667,3.792 Z M10.9922757,3.84091644 C11.1730419,3.63630288 11.4845228,3.61452783 11.692,3.792 C12.9488614,4.89828105 13.6683735,6.49228454 13.6666697,8.16666667 C13.6666697,8.44280904 13.442809,8.66666667 13.1666667,8.66666667 C12.8905243,8.66666667 12.6666667,8.44280904 12.6666667,8.16666667 C12.6684243,6.77896379 12.0719953,5.45783105 11.03,4.54133333 C10.8283023,4.35731921 10.8115094,4.04553 10.9922757,3.84091644 Z M7.83333333,1 C9.21404521,1 10.3333333,2.11928813 10.3333333,3.5 C10.3333333,4.88071187 9.21404521,6 7.83333333,6 C6.45262146,6 5.33333333,4.88071187 5.33333333,3.5 C5.33333333,2.11928813 6.45262146,1 7.83333333,1 Z M7.83333333,2 C7.00490621,2 6.33333333,2.67157288 6.33333333,3.5 C6.33333333,4.32842712 7.00490621,5 7.83333333,5 C8.66176046,5 9.33333333,4.32842712 9.33333333,3.5 C9.33333333,2.67157288 8.66176046,2 7.83333333,2 Z\"/></g>";
|
|
2
|
+
export default serverGlyph;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// MCP 服务(设计稿 icon-MCP 服务-主题色.svg,2026-09-30)
|
|
2
|
+
const serverGlyph = '<g transform="scale(1.5)" fill="currentColor" stroke="none" fill-rule="evenodd"><path d="M3.5,9 C4.88071187,9 6,10.1192881 6,11.5 C6,12.8807119 4.88071187,14 3.5,14 C2.11928813,14 1,12.8807119 1,11.5 C1,10.1192881 2.11928813,9 3.5,9 Z M12.1666667,9 C13.5473785,9 14.6666667,10.1192881 14.6666667,11.5 C14.6666667,12.8807119 13.5473785,14 12.1666667,14 C10.7859548,14 9.66666667,12.8807119 9.66666667,11.5 C9.66666667,10.1192881 10.7859548,9 12.1666667,9 Z M9.042,12.848 C9.21690848,12.7976019 9.40538721,12.8462386 9.53406947,12.974978 C9.66275173,13.1037173 9.71130483,13.2922176 9.66082913,13.4671037 C9.61035343,13.6419898 9.46882444,13.7756285 9.29133333,13.816 C8.33482407,14.0614139 7.3318426,14.0614139 6.37533333,13.816 C6.19784223,13.7756285 6.05631324,13.6419898 6.00583753,13.4671037 C5.95536183,13.2922176 6.00391493,13.1037173 6.1325972,12.974978 C6.26127946,12.8462386 6.44975818,12.7976019 6.62466667,12.848 C7.01959908,12.9490897 7.42566837,13.0001564 7.83333333,13 C8.2409983,13.0001564 8.64706759,12.9490897 9.042,12.848 Z M3.5,10 C2.67157288,10 2,10.6715729 2,11.5 C2,12.3284271 2.67157288,13 3.5,13 C4.32842712,13 5,12.3284271 5,11.5 C5,10.6715729 4.32842712,10 3.5,10 Z M12.1666667,10 C11.3382395,10 10.6666667,10.6715729 10.6666667,11.5 C10.6666667,12.3284271 11.3382395,13 12.1666667,13 C12.9950938,13 13.6666667,12.3284271 13.6666667,11.5 C13.6666667,10.6715729 12.9950938,10 12.1666667,10 Z M3.97466667,3.792 C4.18214383,3.61452783 4.49362474,3.63630288 4.67439099,3.84091644 C4.85515724,4.04553 4.83836433,4.35731921 4.63666667,4.54133333 C3.59467132,5.45783105 2.99824233,6.77896379 2.99999697,8.16666667 C2.99999697,8.44280904 2.77614237,8.66666667 2.49999697,8.66666667 C2.22385763,8.66666667 1.99999697,8.44280904 1.99999697,8.16666667 C1.99829314,6.49228454 2.71780523,4.89828105 3.97466667,3.792 Z M10.9922757,3.84091644 C11.1730419,3.63630288 11.4845228,3.61452783 11.692,3.792 C12.9488614,4.89828105 13.6683735,6.49228454 13.6666697,8.16666667 C13.6666697,8.44280904 13.442809,8.66666667 13.1666667,8.66666667 C12.8905243,8.66666667 12.6666667,8.44280904 12.6666667,8.16666667 C12.6684243,6.77896379 12.0719953,5.45783105 11.03,4.54133333 C10.8283023,4.35731921 10.8115094,4.04553 10.9922757,3.84091644 Z M7.83333333,1 C9.21404521,1 10.3333333,2.11928813 10.3333333,3.5 C10.3333333,4.88071187 9.21404521,6 7.83333333,6 C6.45262146,6 5.33333333,4.88071187 5.33333333,3.5 C5.33333333,2.11928813 6.45262146,1 7.83333333,1 Z M7.83333333,2 C7.00490621,2 6.33333333,2.67157288 6.33333333,3.5 C6.33333333,4.32842712 7.00490621,5 7.83333333,5 C8.66176046,5 9.33333333,4.32842712 9.33333333,3.5 C9.33333333,2.67157288 8.66176046,2 7.83333333,2 Z"/></g>';
|
|
3
|
+
export default serverGlyph;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const serviceGlyph = "<g transform=\"scale(1.5)\" fill=\"currentColor\" stroke=\"none\" fill-rule=\"evenodd\"><path d=\"M12.8334944,1 C13.9095704,1 14.8649175,1.68857524 15.2052026,2.70943058 C15.5454877,3.73028593 15.1943552,4.85435439 14.3334944,5.5 C15.1943552,6.14564561 15.5454877,7.26971407 15.2052026,8.29056942 C14.8649175,9.31142476 13.9095704,10 12.8334944,10 L8.6668277,10 L8.6668277,11.0693333 C9.27749437,11.242 9.75816104,11.7226667 9.9308277,12.3333333 L14.8334944,12.3333333 C15.1096367,12.3333333 15.3334944,12.557191 15.3334944,12.8333333 C15.3334944,13.1094757 15.1096367,13.3333333 14.8334944,13.3333333 L9.93149437,13.3333333 C9.707617,14.1222436 8.98722233,14.6666499 8.16716104,14.6666499 C7.34709974,14.6666499 6.62670507,14.1222436 6.4028277,13.3333333 L1.50016104,13.3333333 C1.22401866,13.3333333 1.00016104,13.1094757 1.00016104,12.8333333 C1.00016104,12.557191 1.22401866,12.3333333 1.50016104,12.3333333 L6.4028277,12.3333333 C6.5774428,11.7218927 7.05538706,11.2439484 7.6668277,11.0693333 L7.6668277,10 L3.50016104,10 C2.42408502,10 1.46873791,9.31142476 1.12845279,8.29056942 C0.788167676,7.26971407 1.13930022,6.14564561 2.00016104,5.5 C1.36981632,5.02855731 0.999108356,4.28714139 1.00016104,3.5 C1.00016104,2.11928813 2.11944916,1 3.50016104,1 L12.8334944,1 Z M8.1668277,12 C7.86910637,12 7.59400051,12.1588324 7.44513984,12.4166667 C7.29627917,12.6745009 7.29627917,12.9921658 7.44513984,13.25 C7.59400051,13.5078342 7.86910637,13.6666667 8.1668277,13.6666667 C8.62706498,13.6666667 9.000161,13.2935706 9.000161,12.8333333 C9.000161,12.3730961 8.62706498,12 8.1668277,12 Z M12.8334944,6 L3.50016107,6 C2.67173392,6 2.00016107,6.67157289 2.00016107,7.5 C2.00016107,8.32842711 2.67173392,9 3.50016107,9 L12.8334944,9 C13.6619215,9 14.3334943,8.32842711 14.3334943,7.5 C14.3334943,6.67157289 13.6619215,6 12.8334944,6 Z M4.1668277,6.83333333 C4.53501754,6.83333333 4.83349437,7.13181017 4.83349437,7.5 C4.83349437,7.86818983 4.53501754,8.16666667 4.1668277,8.16666667 C3.79863787,8.16666667 3.50016104,7.86818983 3.50016104,7.5 C3.50016104,7.13181017 3.79863787,6.83333333 4.1668277,6.83333333 Z M12.8334944,7 C13.1096367,7 13.3334944,7.22385763 13.3334944,7.5 C13.3334944,7.77614237 13.1096367,8 12.8334944,8 L8.83349437,8 C8.557352,8 8.33349437,7.77614237 8.33349437,7.5 C8.33349437,7.22385763 8.557352,7 8.83349437,7 L12.8334944,7 Z M12.8334944,2 L3.50016106,2 C2.67173392,2 2.00016106,2.67157288 2.00016106,3.5 C2.00016106,4.32842712 2.67173392,5 3.50016106,5 L12.8334944,5 C13.6619215,5 14.3334943,4.32842712 14.3334943,3.5 C14.3334943,2.67157288 13.6619215,2 12.8334944,2 Z M4.1668277,2.83333333 C4.53501754,2.83333333 4.83349437,3.13181017 4.83349437,3.5 C4.83349437,3.86818983 4.53501754,4.16666667 4.1668277,4.16666667 C3.79863787,4.16666667 3.50016104,3.86818983 3.50016104,3.5 C3.50016104,3.13181017 3.79863787,2.83333333 4.1668277,2.83333333 Z M12.8334944,3 C13.1096367,3 13.3334944,3.22385763 13.3334944,3.5 C13.3334944,3.77614237 13.1096367,4 12.8334944,4 L8.83349437,4 C8.557352,4 8.33349437,3.77614237 8.33349437,3.5 C8.33349437,3.22385763 8.557352,3 8.83349437,3 L12.8334944,3 Z\"/></g>";
|
|
2
|
+
export default serviceGlyph;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// 服务接入(设计稿 icon-服务接入.svg,2026-09-30)
|
|
2
|
+
const serviceGlyph = '<g transform="scale(1.5)" fill="currentColor" stroke="none" fill-rule="evenodd"><path d="M12.8334944,1 C13.9095704,1 14.8649175,1.68857524 15.2052026,2.70943058 C15.5454877,3.73028593 15.1943552,4.85435439 14.3334944,5.5 C15.1943552,6.14564561 15.5454877,7.26971407 15.2052026,8.29056942 C14.8649175,9.31142476 13.9095704,10 12.8334944,10 L8.6668277,10 L8.6668277,11.0693333 C9.27749437,11.242 9.75816104,11.7226667 9.9308277,12.3333333 L14.8334944,12.3333333 C15.1096367,12.3333333 15.3334944,12.557191 15.3334944,12.8333333 C15.3334944,13.1094757 15.1096367,13.3333333 14.8334944,13.3333333 L9.93149437,13.3333333 C9.707617,14.1222436 8.98722233,14.6666499 8.16716104,14.6666499 C7.34709974,14.6666499 6.62670507,14.1222436 6.4028277,13.3333333 L1.50016104,13.3333333 C1.22401866,13.3333333 1.00016104,13.1094757 1.00016104,12.8333333 C1.00016104,12.557191 1.22401866,12.3333333 1.50016104,12.3333333 L6.4028277,12.3333333 C6.5774428,11.7218927 7.05538706,11.2439484 7.6668277,11.0693333 L7.6668277,10 L3.50016104,10 C2.42408502,10 1.46873791,9.31142476 1.12845279,8.29056942 C0.788167676,7.26971407 1.13930022,6.14564561 2.00016104,5.5 C1.36981632,5.02855731 0.999108356,4.28714139 1.00016104,3.5 C1.00016104,2.11928813 2.11944916,1 3.50016104,1 L12.8334944,1 Z M8.1668277,12 C7.86910637,12 7.59400051,12.1588324 7.44513984,12.4166667 C7.29627917,12.6745009 7.29627917,12.9921658 7.44513984,13.25 C7.59400051,13.5078342 7.86910637,13.6666667 8.1668277,13.6666667 C8.62706498,13.6666667 9.000161,13.2935706 9.000161,12.8333333 C9.000161,12.3730961 8.62706498,12 8.1668277,12 Z M12.8334944,6 L3.50016107,6 C2.67173392,6 2.00016107,6.67157289 2.00016107,7.5 C2.00016107,8.32842711 2.67173392,9 3.50016107,9 L12.8334944,9 C13.6619215,9 14.3334943,8.32842711 14.3334943,7.5 C14.3334943,6.67157289 13.6619215,6 12.8334944,6 Z M4.1668277,6.83333333 C4.53501754,6.83333333 4.83349437,7.13181017 4.83349437,7.5 C4.83349437,7.86818983 4.53501754,8.16666667 4.1668277,8.16666667 C3.79863787,8.16666667 3.50016104,7.86818983 3.50016104,7.5 C3.50016104,7.13181017 3.79863787,6.83333333 4.1668277,6.83333333 Z M12.8334944,7 C13.1096367,7 13.3334944,7.22385763 13.3334944,7.5 C13.3334944,7.77614237 13.1096367,8 12.8334944,8 L8.83349437,8 C8.557352,8 8.33349437,7.77614237 8.33349437,7.5 C8.33349437,7.22385763 8.557352,7 8.83349437,7 L12.8334944,7 Z M12.8334944,2 L3.50016106,2 C2.67173392,2 2.00016106,2.67157288 2.00016106,3.5 C2.00016106,4.32842712 2.67173392,5 3.50016106,5 L12.8334944,5 C13.6619215,5 14.3334943,4.32842712 14.3334943,3.5 C14.3334943,2.67157288 13.6619215,2 12.8334944,2 Z M4.1668277,2.83333333 C4.53501754,2.83333333 4.83349437,3.13181017 4.83349437,3.5 C4.83349437,3.86818983 4.53501754,4.16666667 4.1668277,4.16666667 C3.79863787,4.16666667 3.50016104,3.86818983 3.50016104,3.5 C3.50016104,3.13181017 3.79863787,2.83333333 4.1668277,2.83333333 Z M12.8334944,3 C13.1096367,3 13.3334944,3.22385763 13.3334944,3.5 C13.3334944,3.77614237 13.1096367,4 12.8334944,4 L8.83349437,4 C8.557352,4 8.33349437,3.77614237 8.33349437,3.5 C8.33349437,3.22385763 8.557352,3 8.83349437,3 L12.8334944,3 Z"/></g>';
|
|
3
|
+
export default serviceGlyph;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from './base/index.ts';
|
|
2
|
+
export * from './business/index.ts';
|
|
1
3
|
export declare const ICON_GLYPHS: {
|
|
2
4
|
readonly application: "<g transform=\"scale(1.5)\" fill=\"currentColor\" stroke=\"none\" fill-rule=\"evenodd\"><path d=\"M11.4653333,1.00000005 C10.866,1.00000005 10.3666667,1.00000005 9.97066667,1.05333338 C9.552,1.10933338 9.174,1.23333338 8.87066667,1.53666671 C8.56666667,1.84066671 8.44266667,2.21866671 8.38666667,2.63666671 C8.33333333,3.03333338 8.33333333,3.53333338 8.33333333,4.13200005 L8.33333333,4.20133338 C8.33333333,4.80000005 8.33333333,5.30000005 8.38666667,5.69600005 C8.44266667,6.11466671 8.56666667,6.49266671 8.87066667,6.79600005 C9.174,7.10000005 9.552,7.22400005 9.97066667,7.28000005 C10.3666667,7.33333338 10.866,7.33333338 11.4653333,7.33333338 L11.5346667,7.33333338 C12.134,7.33333338 12.6333333,7.33333338 13.0293333,7.28000005 C13.448,7.22400005 13.826,7.10000005 14.1293333,6.79600005 C14.4333333,6.49266671 14.5573333,6.11466671 14.6133333,5.69600005 C14.6666667,5.30000005 14.6666667,4.80000005 14.6666667,4.20133338 L14.6666667,4.13200005 C14.6666667,3.53333338 14.6666667,3.03333338 14.6133333,2.63733338 C14.5573333,2.21866671 14.4333333,1.84066671 14.1293333,1.53733338 C13.826,1.23333338 13.448,1.10933338 13.0293333,1.05333338 C12.6333333,1.00000005 12.134,1.00000005 11.5346667,1.00000005 L11.4653333,1.00000005 Z M9.57733333,2.24400005 C9.664,2.15733338 9.796,2.08600005 10.104,2.04400005 C10.4253333,2.00133338 10.8573333,2.00000005 11.5,2.00000005 C12.1426667,2.00000005 12.5746667,2.00133338 12.8966667,2.04466671 C13.204,2.08600005 13.336,2.15733338 13.4226667,2.24466671 C13.5093333,2.33200005 13.5806667,2.46266671 13.6226667,2.77000005 C13.6653333,3.09200005 13.6666667,3.52400005 13.6666667,4.16666671 C13.6666667,4.80933338 13.6653333,5.24133338 13.622,5.56333338 C13.5806667,5.87066671 13.5093333,6.00266671 13.422,6.08933338 C13.3346667,6.17600005 13.204,6.24733338 12.8966667,6.28933338 C12.5746667,6.33200005 12.1426667,6.33333338 11.5,6.33333338 C10.8573333,6.33333338 10.4253333,6.33200005 10.1033333,6.28866671 C9.796,6.24733338 9.664,6.17600005 9.57733333,6.08866671 C9.49066667,6.00133338 9.41933333,5.87066671 9.37733333,5.56333338 C9.33466667,5.24133338 9.33333333,4.80933338 9.33333333,4.16666671 C9.33333333,3.52400005 9.33466667,3.09200005 9.37733333,2.77000005 C9.41933333,2.46266671 9.49066667,2.33066671 9.57733333,2.24400005 M4.132,8.33333338 C3.53333333,8.33333338 3.03333333,8.33333338 2.63733333,8.38666671 C2.21866667,8.44266671 1.84066667,8.56666671 1.53733333,8.87066671 C1.23333333,9.17400005 1.10933333,9.55200005 1.05333333,9.97066671 C1,10.3666667 1,10.866 1,11.4653334 L1,11.5346667 C1,12.134 1,12.6333334 1.05333333,13.0293334 C1.10933333,13.448 1.23333333,13.826 1.53666667,14.1293334 C1.84066667,14.4333334 2.21866667,14.5573334 2.63666667,14.6133334 C3.03333333,14.6666667 3.53333333,14.6666667 4.132,14.6666667 L4.20133333,14.6666667 C4.8,14.6666667 5.3,14.6666667 5.696,14.6133334 C6.11466667,14.5573334 6.49266667,14.4333334 6.796,14.1293334 C7.1,13.826 7.224,13.448 7.28,13.0293334 C7.33333333,12.6333334 7.33333333,12.134 7.33333333,11.5346667 L7.33333333,11.4653334 C7.33333333,10.866 7.33333333,10.3666667 7.28,9.97066671 C7.224,9.55200005 7.1,9.17400005 6.796,8.87066671 C6.49266667,8.56666671 6.11466667,8.44266671 5.696,8.38666671 C5.3,8.33333338 4.8,8.33333338 4.20133333,8.33333338 L4.132,8.33333338 Z M2.244,9.57733338 C2.33066667,9.49066671 2.46266667,9.41933338 2.77066667,9.37733338 C3.092,9.33466671 3.524,9.33333338 4.16666667,9.33333338 C4.80933333,9.33333338 5.24133333,9.33466671 5.56333333,9.37733338 C5.87066667,9.41933338 6.00266667,9.49066671 6.08933333,9.57733338 C6.176,9.66400005 6.24733333,9.79600005 6.28933333,10.104 C6.332,10.4253334 6.33333333,10.8573334 6.33333333,11.5 C6.33333333,12.1426667 6.332,12.5746667 6.28866667,12.8966667 C6.24733333,13.204 6.176,13.336 6.08866667,13.4226667 C6.00133333,13.5093334 5.87066667,13.5806667 5.56333333,13.6226667 C5.24133333,13.6653334 4.80933333,13.6666667 4.16666667,13.6666667 C3.524,13.6666667 3.092,13.6653334 2.77,13.622 C2.46266667,13.5806667 2.33066667,13.5093334 2.244,13.422 C2.15733333,13.3346667 2.086,13.204 2.044,12.8966667 C2.00133333,12.5746667 2,12.1426667 2,11.5 C2,10.8573334 2.00133333,10.4253334 2.04466667,10.1033334 C2.086,9.79600005 2.15733333,9.66400005 2.24466667,9.57733338 M1,4.16666671 C1,3.03532567 1.60356324,1.98992342 2.58333332,1.4242529 C3.5631034,0.858582368 4.77022993,0.858582368 5.75000001,1.4242529 C6.7297701,1.98992342 7.33333333,3.03532567 7.33333333,4.16666671 C7.33333333,5.9155684 5.91556836,7.33333333 4.16666667,7.33333333 C2.41776498,7.33333333 1,5.9155684 1,4.16666671 M4.16666667,2.00000005 C2.97004971,2.00000005 2,2.97004976 2,4.16666671 C2,5.36328367 2.97004971,6.33333338 4.16666667,6.33333338 C5.36328362,6.33333338 6.33333333,5.36328367 6.33333333,4.16666671 C6.33333333,2.97004976 5.36328362,2.00000005 4.16666667,2.00000005 M8.33333333,11.5 C8.33333333,9.75109834 9.75109829,8.33333338 11.5,8.33333338 C13.2489017,8.33333338 14.6666667,9.75109834 14.6666667,11.5 C14.6666667,13.2489018 13.2489017,14.6666667 11.5,14.6666667 C9.75109829,14.6666667 8.33333333,13.2489018 8.33333333,11.5 M11.5,9.33333338 C10.303383,9.33333338 9.33333333,10.3033831 9.33333333,11.5 C9.33333333,12.696617 10.303383,13.6666667 11.5,13.6666667 C12.696617,13.6666667 13.6666667,12.696617 13.6666667,11.5 C13.6666667,10.3033831 12.696617,9.33333338 11.5,9.33333338\"/></g>";
|
|
3
5
|
readonly client: "<g transform=\"scale(1.5)\" fill=\"currentColor\" stroke=\"none\"><path d=\"M9.9524828,1.50170191 L9.96666667,1.5 L9.98489622,1.50189773 C12.7229678,1.51898862 13.4424182,1.66399298 14.2057043,2.42793087 C15.0290505,3.25198023 15.1333333,4.02658922 15.1333333,7.33333333 L15.1333333,8.66666667 C15.1333333,11.9766763 15.029456,12.7490205 14.2054025,13.5723709 C13.4423414,14.3347809 12.7216734,14.4806252 9.99363841,14.4980371 C9.98434045,14.4997694 9.9755305,14.5 9.96666667,14.5 L9.94489789,14.4983334 C9.74126654,14.4995104 9.52657741,14.5 9.3,14.5 L6.63333333,14.5 C3.3233237,14.5 2.55097946,14.3961226 1.72762908,13.5720691 C0.930842392,12.774602 0.80747617,12.023437 0.800346181,8.97885613 L0.8,7.33333333 C0.8,4.0233237 0.903877376,3.25097946 1.72793087,2.42762908 C2.52539799,1.63084239 3.276563,1.50747617 6.32114387,1.50034618 L9.3,1.5 C9.5293954,1.5 9.74660244,1.50049892 9.9524828,1.50170191 Z M9.466,2.5 L6.34359334,2.50031934 C3.61505425,2.50662198 2.96030811,2.60991371 2.43473579,3.13503759 C1.90959032,3.65973499 1.80660076,4.31281685 1.80031828,7.04337152 L1.80031934,8.95640666 C1.80662198,11.6849457 1.90991371,12.3396919 2.43503759,12.8652642 C2.977828,13.4085181 3.65800963,13.5 6.63333333,13.5 L9.3,13.5 L9.466,13.499 L9.466,2.5 Z M10.4682383,2.50704624 L10.4678565,13.492929 C12.4701816,13.4633234 13.0347063,13.3284579 13.4985975,12.8649624 C14.023743,12.340265 14.1267326,11.6871832 14.133015,8.95662848 L14.133014,7.04359334 C14.1267113,4.31505425 14.0234196,3.66030811 13.4982957,3.13473579 C13.0351455,2.67119005 12.4719634,2.53657077 10.4682383,2.50704624 Z M6.96666667,8.83333333 C7.24280904,8.83333333 7.46666667,9.05719096 7.46666667,9.33333333 C7.46666667,9.60947571 7.24280904,9.83333333 6.96666667,9.83333333 L4.3,9.83333333 C4.02385763,9.83333333 3.8,9.60947571 3.8,9.33333333 C3.8,9.05719096 4.02385763,8.83333333 4.3,8.83333333 L6.96666667,8.83333333 Z M7.63333333,6.16666667 C7.90947571,6.16666667 8.13333333,6.39052429 8.13333333,6.66666667 C8.13333333,6.94280904 7.90947571,7.16666667 7.63333333,7.16666667 L3.63333333,7.16666667 C3.35719096,7.16666667 3.13333333,6.94280904 3.13333333,6.66666667 C3.13333333,6.39052429 3.35719096,6.16666667 3.63333333,6.16666667 L7.63333333,6.16666667 Z\"/></g>";
|
|
@@ -101,10 +103,14 @@ export interface IconRenderOptions {
|
|
|
101
103
|
strokeWidth?: number;
|
|
102
104
|
}
|
|
103
105
|
/**
|
|
104
|
-
*
|
|
105
|
-
* `innerHTML`)。属性与 `<Icon>`
|
|
106
|
-
*
|
|
107
|
-
|
|
106
|
+
* 片段 → 完整 `<svg>` 字符串(不引入 Vue):给非组件场景用(静态页 / 模板串拼接 / 别的框架的
|
|
107
|
+
* `innerHTML`)。属性与 `<Icon>` / `<GlyphIcon>` 组件逐字对齐,三版产物可直接对照。
|
|
108
|
+
* 只用一个图标时直接传 `*Glyph`(如 `renderGlyphSvg(searchGlyph)`),不会带上整张表。
|
|
109
|
+
*/
|
|
110
|
+
export declare function renderGlyphSvg(fragment: string, options?: IconRenderOptions): string;
|
|
111
|
+
/**
|
|
112
|
+
* 图标名 → 完整 `<svg>` 字符串。名字查找走整张 `ICON_GLYPHS`;只用一个图标请改用
|
|
113
|
+
* `renderGlyphSvg` + 对应的 `*Glyph`,避免把整张表带进产物。
|
|
108
114
|
*/
|
|
109
115
|
export declare function renderIconSvg(name: IconName, options?: IconRenderOptions): string;
|
|
110
116
|
/**
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 图标资产总入口:合并 `base/`(通用)与 `business/`(设计稿来源)两张表,
|
|
3
|
+
* 提供 `ICON_GLYPHS` / `IconName` / `IconNameList` 与纯字符串渲染器。
|
|
4
|
+
*
|
|
5
|
+
* 单文件子路径:`@manohub/icon/glyphs/base/<name>`、`@manohub/icon/glyphs/business/<name>`。
|
|
6
|
+
* 按名字查找的 `<Icon>` 需要整张 `ICON_GLYPHS`;只用一个图标时用 `GlyphIcon` + 对应的 `*Glyph`。
|
|
7
|
+
*
|
|
8
|
+
* 片段口径:24 网格、单色 `currentColor`;原稿 16 画板由各条目自带 `scale(1.5)`。
|
|
9
|
+
*/
|
|
10
|
+
import { BASE_GLYPHS as baseGlyphs } from "./base/index.js";
|
|
11
|
+
import { BUSINESS_GLYPHS as businessGlyphs } from "./business/index.js";
|
|
12
|
+
export * from "./base/index.js";
|
|
13
|
+
export * from "./business/index.js";
|
|
14
|
+
export const ICON_GLYPHS = {
|
|
15
|
+
...baseGlyphs,
|
|
16
|
+
...businessGlyphs,
|
|
17
|
+
};
|
|
18
|
+
export const IconNameList = /*#__PURE__*/ Object.keys(ICON_GLYPHS);
|
|
19
|
+
/** 基底内联样式:不依赖任何 CSS 框架,两种栈取值一致 */
|
|
20
|
+
const BASE_STYLE = 'display:inline-block;flex-shrink:0';
|
|
21
|
+
/**
|
|
22
|
+
* 片段 → 完整 `<svg>` 字符串(不引入 Vue):给非组件场景用(静态页 / 模板串拼接 / 别的框架的
|
|
23
|
+
* `innerHTML`)。属性与 `<Icon>` / `<GlyphIcon>` 组件逐字对齐,三版产物可直接对照。
|
|
24
|
+
* 只用一个图标时直接传 `*Glyph`(如 `renderGlyphSvg(searchGlyph)`),不会带上整张表。
|
|
25
|
+
*/
|
|
26
|
+
export function renderGlyphSvg(fragment, options = {}) {
|
|
27
|
+
const size = options.size ?? 16;
|
|
28
|
+
const style = options.style ? BASE_STYLE + ';' + options.style : BASE_STYLE;
|
|
29
|
+
const attrs = [
|
|
30
|
+
'viewBox="0 0 24 24"',
|
|
31
|
+
'data-slot="icon"',
|
|
32
|
+
'width="' + size + '"',
|
|
33
|
+
'height="' + size + '"',
|
|
34
|
+
'fill="none"',
|
|
35
|
+
'stroke="currentColor"',
|
|
36
|
+
'stroke-width="' + (options.strokeWidth ?? 2) + '"',
|
|
37
|
+
'stroke-linecap="round"',
|
|
38
|
+
'stroke-linejoin="round"',
|
|
39
|
+
'aria-hidden="true"',
|
|
40
|
+
'style="' + style + '"',
|
|
41
|
+
options.class ? 'class="' + options.class + '"' : '',
|
|
42
|
+
]
|
|
43
|
+
.filter(Boolean)
|
|
44
|
+
.join(' ');
|
|
45
|
+
return '<svg ' + attrs + '>' + fragment + '</svg>';
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 图标名 → 完整 `<svg>` 字符串。名字查找走整张 `ICON_GLYPHS`;只用一个图标请改用
|
|
49
|
+
* `renderGlyphSvg` + 对应的 `*Glyph`,避免把整张表带进产物。
|
|
50
|
+
*/
|
|
51
|
+
export function renderIconSvg(name, options = {}) {
|
|
52
|
+
return renderGlyphSvg(ICON_GLYPHS[name], options);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 取单个图标的片段串。未知名字返回空串(渲染成空图标而不抛错):消费方可能把业务侧字符串透传给
|
|
56
|
+
* `icon`,抛错会把整棵组件树带崩。拼写错误由 `IconName` 类型在编译期拦住。
|
|
57
|
+
*/
|
|
58
|
+
export function getIconGlyph(name) {
|
|
59
|
+
return ICON_GLYPHS[name] ?? '';
|
|
60
|
+
}
|
|
61
|
+
/* 自带图形不需要注册表:写进 `<Icon>` 的插槽即可(见 `../icon.js` 的组件注释)。
|
|
62
|
+
表里只放**内置**字形;项目自带的片段由项目自己持有,用 `icon-from-svg` 归一生成。 */
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<GlyphIcon>`:只吃**已归一好的字形片段**(`*Glyph` 常量)的按需组件 —— 不 import 图标表,
|
|
3
|
+
* 因此只用一个图标时不会把全部字形带进产物。
|
|
4
|
+
*
|
|
5
|
+
* 需要按名字(`IconName`)取图标时用 `./icon.ts` 的 `<Icon>`;那条路径天然需要整张表做查找。
|
|
6
|
+
*/
|
|
7
|
+
import { type ExtractPropTypes, type PropType, type SlotsType, type VNodeChild } from 'vue';
|
|
8
|
+
/** GlyphIcon 组件的 props 定义 */
|
|
9
|
+
export declare const glyphIconProps: {
|
|
10
|
+
/** 24 网格的 SVG 片段串(通常是 `import { searchGlyph } from '@manohub/icon'`) */
|
|
11
|
+
readonly glyph: {
|
|
12
|
+
readonly type: PropType<string>;
|
|
13
|
+
readonly default: undefined;
|
|
14
|
+
};
|
|
15
|
+
/** 尺寸(px),同时设置 width 与 height,默认 16 */
|
|
16
|
+
readonly size: {
|
|
17
|
+
readonly type: PropType<number | string>;
|
|
18
|
+
readonly default: 16;
|
|
19
|
+
};
|
|
20
|
+
readonly class: {
|
|
21
|
+
readonly type: StringConstructor;
|
|
22
|
+
readonly default: undefined;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/** GlyphIcon 组件 props 类型(由 glyphIconProps 经 ExtractPropTypes 解析推导) */
|
|
26
|
+
export type GlyphIconProps = ExtractPropTypes<typeof glyphIconProps>;
|
|
27
|
+
/**
|
|
28
|
+
* 按需图标组件(原生 SVG)。与 `<Icon>` 同一套容器口径,只是不按名字查表:
|
|
29
|
+
*
|
|
30
|
+
* ```tsx
|
|
31
|
+
* import { GlyphIcon, searchGlyph } from '@manohub/icon'
|
|
32
|
+
*
|
|
33
|
+
* <GlyphIcon glyph={searchGlyph} />
|
|
34
|
+
* <GlyphIcon glyph={searchGlyph} size={20} class="text-primary" />
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* - **槽里有内容就以槽为准**(胜过 `glyph`);两者都不给 → 空图标,不抛错。
|
|
38
|
+
* - 容器口径由本组件统一给(`viewBox 0 0 24 24` / `fill:none` / `stroke:currentColor` / 圆头端点 /
|
|
39
|
+
* 尺寸 / 基底内联样式),故槽里的图形请按 **24 网格**给 —— 16 画板自己包 `<g transform="scale(1.5)">`;
|
|
40
|
+
* 颜色靠 `currentColor` 继承,别写死。
|
|
41
|
+
* - `glyph` 走 `innerHTML`:内置数据是字符串常量(不含外部输入),代价是**片段必须自带合法闭合**。
|
|
42
|
+
*/
|
|
43
|
+
export declare const GlyphIcon: import("vue").DefineComponent<ExtractPropTypes<{
|
|
44
|
+
/** 24 网格的 SVG 片段串(通常是 `import { searchGlyph } from '@manohub/icon'`) */
|
|
45
|
+
readonly glyph: {
|
|
46
|
+
readonly type: PropType<string>;
|
|
47
|
+
readonly default: undefined;
|
|
48
|
+
};
|
|
49
|
+
/** 尺寸(px),同时设置 width 与 height,默认 16 */
|
|
50
|
+
readonly size: {
|
|
51
|
+
readonly type: PropType<number | string>;
|
|
52
|
+
readonly default: 16;
|
|
53
|
+
};
|
|
54
|
+
readonly class: {
|
|
55
|
+
readonly type: StringConstructor;
|
|
56
|
+
readonly default: undefined;
|
|
57
|
+
};
|
|
58
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
59
|
+
[key: string]: any;
|
|
60
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
61
|
+
/** 24 网格的 SVG 片段串(通常是 `import { searchGlyph } from '@manohub/icon'`) */
|
|
62
|
+
readonly glyph: {
|
|
63
|
+
readonly type: PropType<string>;
|
|
64
|
+
readonly default: undefined;
|
|
65
|
+
};
|
|
66
|
+
/** 尺寸(px),同时设置 width 与 height,默认 16 */
|
|
67
|
+
readonly size: {
|
|
68
|
+
readonly type: PropType<number | string>;
|
|
69
|
+
readonly default: 16;
|
|
70
|
+
};
|
|
71
|
+
readonly class: {
|
|
72
|
+
readonly type: StringConstructor;
|
|
73
|
+
readonly default: undefined;
|
|
74
|
+
};
|
|
75
|
+
}>> & Readonly<{}>, {
|
|
76
|
+
readonly size: string | number;
|
|
77
|
+
readonly class: string;
|
|
78
|
+
readonly glyph: string;
|
|
79
|
+
}, SlotsType<{
|
|
80
|
+
default?: () => VNodeChild;
|
|
81
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<GlyphIcon>`:只吃**已归一好的字形片段**(`*Glyph` 常量)的按需组件 —— 不 import 图标表,
|
|
3
|
+
* 因此只用一个图标时不会把全部字形带进产物。
|
|
4
|
+
*
|
|
5
|
+
* 需要按名字(`IconName`)取图标时用 `./icon.ts` 的 `<Icon>`;那条路径天然需要整张表做查找。
|
|
6
|
+
*/
|
|
7
|
+
import { defineComponent } from 'vue';
|
|
8
|
+
import { renderGlyphVNode } from "./icon-render.js";
|
|
9
|
+
/** GlyphIcon 组件的 props 定义 */
|
|
10
|
+
export const glyphIconProps = {
|
|
11
|
+
/** 24 网格的 SVG 片段串(通常是 `import { searchGlyph } from '@manohub/icon'`) */
|
|
12
|
+
glyph: { type: String, default: undefined },
|
|
13
|
+
/** 尺寸(px),同时设置 width 与 height,默认 16 */
|
|
14
|
+
size: {
|
|
15
|
+
type: [Number, String],
|
|
16
|
+
default: 16,
|
|
17
|
+
},
|
|
18
|
+
class: { type: String, default: undefined },
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* 按需图标组件(原生 SVG)。与 `<Icon>` 同一套容器口径,只是不按名字查表:
|
|
22
|
+
*
|
|
23
|
+
* ```tsx
|
|
24
|
+
* import { GlyphIcon, searchGlyph } from '@manohub/icon'
|
|
25
|
+
*
|
|
26
|
+
* <GlyphIcon glyph={searchGlyph} />
|
|
27
|
+
* <GlyphIcon glyph={searchGlyph} size={20} class="text-primary" />
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* - **槽里有内容就以槽为准**(胜过 `glyph`);两者都不给 → 空图标,不抛错。
|
|
31
|
+
* - 容器口径由本组件统一给(`viewBox 0 0 24 24` / `fill:none` / `stroke:currentColor` / 圆头端点 /
|
|
32
|
+
* 尺寸 / 基底内联样式),故槽里的图形请按 **24 网格**给 —— 16 画板自己包 `<g transform="scale(1.5)">`;
|
|
33
|
+
* 颜色靠 `currentColor` 继承,别写死。
|
|
34
|
+
* - `glyph` 走 `innerHTML`:内置数据是字符串常量(不含外部输入),代价是**片段必须自带合法闭合**。
|
|
35
|
+
*/
|
|
36
|
+
export const GlyphIcon = /*#__PURE__*/ defineComponent({
|
|
37
|
+
name: 'AGlyphIcon',
|
|
38
|
+
props: glyphIconProps,
|
|
39
|
+
/** **只为类型**(运行期不读):声明默认插槽,TSX 里 `<GlyphIcon><path …/></GlyphIcon>` 才通得过检查。 */
|
|
40
|
+
slots: Object,
|
|
41
|
+
setup(props, { slots }) {
|
|
42
|
+
return () => renderGlyphVNode(props.glyph ?? '', props, slots);
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组件渲染内核:把「片段串 / 默认插槽」包成那棵唯一的 `<svg>`,**不 import 图标表**。
|
|
3
|
+
*
|
|
4
|
+
* `Icon`(按名字查找)与 `GlyphIcon`(直接给片段)共用它,保证容器口径只有一套;两边的产物
|
|
5
|
+
* 又与 `glyphs/index.ts` 的 `renderGlyphSvg()`(纯字符串版)逐字对齐。
|
|
6
|
+
*/
|
|
7
|
+
import { type VNode, type VNodeChild } from 'vue';
|
|
8
|
+
/**
|
|
9
|
+
* 渲染一棵 `<svg>`:槽里有内容以槽为准(胜过传入的片段串),否则用 `html`。
|
|
10
|
+
*
|
|
11
|
+
* - 槽里全是「文本」⇒ 当片段串注入(走 `innerHTML`);只要有一个 vnode 就正常渲染。
|
|
12
|
+
* - 槽里没有内容且 `html` 为空 ⇒ 空图标,不抛错。
|
|
13
|
+
*/
|
|
14
|
+
export declare function renderGlyphVNode(html: string, props: {
|
|
15
|
+
size: number | string;
|
|
16
|
+
class?: string;
|
|
17
|
+
}, slots: {
|
|
18
|
+
default?: () => VNodeChild;
|
|
19
|
+
}): VNode;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组件渲染内核:把「片段串 / 默认插槽」包成那棵唯一的 `<svg>`,**不 import 图标表**。
|
|
3
|
+
*
|
|
4
|
+
* `Icon`(按名字查找)与 `GlyphIcon`(直接给片段)共用它,保证容器口径只有一套;两边的产物
|
|
5
|
+
* 又与 `glyphs/index.ts` 的 `renderGlyphSvg()`(纯字符串版)逐字对齐。
|
|
6
|
+
*/
|
|
7
|
+
import { h, Text } from 'vue';
|
|
8
|
+
/** 基底内联样式(不依赖任何 CSS 框架)。⚠️ 内联优先级高于 class ⇒ 消费方改不了 `display` /
|
|
9
|
+
* `flex-shrink`,要覆盖请传 `style`(Vue 会把 attrs 的 style 与本对象合并,同键以后者为准)。 */
|
|
10
|
+
const BASE_STYLE = { display: 'inline-block', flexShrink: '0' };
|
|
11
|
+
/** `<svg>` 容器属性:与 `renderGlyphSvg`(纯字符串版)逐字对齐,两版产物可直接对照 */
|
|
12
|
+
const SVG_ATTRS = {
|
|
13
|
+
viewBox: '0 0 24 24',
|
|
14
|
+
'data-slot': 'icon',
|
|
15
|
+
fill: 'none',
|
|
16
|
+
stroke: 'currentColor',
|
|
17
|
+
'stroke-width': 2,
|
|
18
|
+
'stroke-linecap': 'round',
|
|
19
|
+
'stroke-linejoin': 'round',
|
|
20
|
+
'aria-hidden': 'true',
|
|
21
|
+
};
|
|
22
|
+
const textOf = (child) => (typeof child === 'string' ? child : child.children);
|
|
23
|
+
const isText = (child) => typeof child === 'string' || (child.type === Text && typeof child.children === 'string');
|
|
24
|
+
const isBlankText = (child) => isText(child) && textOf(child).trim() === '';
|
|
25
|
+
/**
|
|
26
|
+
* 渲染一棵 `<svg>`:槽里有内容以槽为准(胜过传入的片段串),否则用 `html`。
|
|
27
|
+
*
|
|
28
|
+
* - 槽里全是「文本」⇒ 当片段串注入(走 `innerHTML`);只要有一个 vnode 就正常渲染。
|
|
29
|
+
* - 槽里没有内容且 `html` 为空 ⇒ 空图标,不抛错。
|
|
30
|
+
*/
|
|
31
|
+
export function renderGlyphVNode(html, props, slots) {
|
|
32
|
+
const slot = slots.default?.();
|
|
33
|
+
const list = Array.isArray(slot) ? slot : slot == null ? [] : [slot];
|
|
34
|
+
const children = list.filter((child) => !isBlankText(child));
|
|
35
|
+
if (children.length) {
|
|
36
|
+
const fragment = children.every((child) => isText(child))
|
|
37
|
+
? children.map((child) => textOf(child)).join('')
|
|
38
|
+
: null;
|
|
39
|
+
return fragment === null
|
|
40
|
+
? renderIconNode({ size: props.size, klass: props.class, children: children })
|
|
41
|
+
: renderIconNode({ size: props.size, klass: props.class, html: fragment });
|
|
42
|
+
}
|
|
43
|
+
return renderIconNode({ size: props.size, klass: props.class, html });
|
|
44
|
+
}
|
|
45
|
+
/** 渲染那棵唯一的 `<svg>` —— 按名字 / 片段串 / 插槽三条路共用,不会长出第二套容器口径 */
|
|
46
|
+
function renderIconNode(options) {
|
|
47
|
+
return h('svg', {
|
|
48
|
+
...SVG_ATTRS,
|
|
49
|
+
width: options.size,
|
|
50
|
+
height: options.size,
|
|
51
|
+
style: BASE_STYLE,
|
|
52
|
+
class: options.klass,
|
|
53
|
+
...(options.html === undefined ? {} : { innerHTML: options.html }),
|
|
54
|
+
}, options.html === undefined ? options.children : undefined);
|
|
55
|
+
}
|
package/dist/icon.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ExtractPropTypes, type PropType, type SlotsType, type
|
|
2
|
-
import { type IconName } from './glyphs.
|
|
1
|
+
import { type ExtractPropTypes, type PropType, type SlotsType, type VNodeChild } from 'vue';
|
|
2
|
+
import { type IconName } from './glyphs/index.ts';
|
|
3
3
|
/** Icon 组件的 props 定义 */
|
|
4
4
|
export declare const iconProps: {
|
|
5
5
|
/** 内置图标名。**不传**时以默认插槽给的图形内容为准(见组件注释) */
|
|
@@ -23,7 +23,7 @@ export type IconProps = ExtractPropTypes<typeof iconProps>;
|
|
|
23
23
|
* Icon 组件(原生 SVG)。三种用法:
|
|
24
24
|
*
|
|
25
25
|
* ```tsx
|
|
26
|
-
* <Icon name="search" /> //
|
|
26
|
+
* <Icon name="search" /> // 内置字形(按名字查表)
|
|
27
27
|
* <Icon><path d="M2 2h6v6H2z" /></Icon> // 自带图形(vnode 子节点)
|
|
28
28
|
* <Icon>{'<path d="M2 2h6v6H2z"/>'}</Icon> // 自带图形(片段串)
|
|
29
29
|
* ```
|
|
@@ -35,6 +35,14 @@ export type IconProps = ExtractPropTypes<typeof iconProps>;
|
|
|
35
35
|
* - `size` 控尺寸(默认 16,同时设 width / height),也可经 class / style 覆盖。
|
|
36
36
|
* - `name` 走 `innerHTML`:内置数据是字符串常量(不含外部输入),代价是**片段必须自带合法闭合**;
|
|
37
37
|
* 槽里的 vnode 走 Vue 正常渲染,只有「槽里全是字符串」时与 `name` 同一路径。
|
|
38
|
+
*
|
|
39
|
+
* ⚠️ **按名字查找需要整张 `ICON_GLYPHS`**。只用一个图标、又不想把全部字形打进产物时,改用
|
|
40
|
+
* `GlyphIcon` + 对应的 `*Glyph`:
|
|
41
|
+
*
|
|
42
|
+
* ```tsx
|
|
43
|
+
* import { GlyphIcon, searchGlyph } from '@manohub/icon'
|
|
44
|
+
* <GlyphIcon glyph={searchGlyph} />
|
|
45
|
+
* ```
|
|
38
46
|
*/
|
|
39
47
|
export declare const Icon: import("vue").DefineComponent<ExtractPropTypes<{
|
|
40
48
|
/** 内置图标名。**不传**时以默认插槽给的图形内容为准(见组件注释) */
|
|
@@ -51,7 +59,7 @@ export declare const Icon: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
51
59
|
readonly type: StringConstructor;
|
|
52
60
|
readonly default: undefined;
|
|
53
61
|
};
|
|
54
|
-
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
62
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
55
63
|
[key: string]: any;
|
|
56
64
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
57
65
|
/** 内置图标名。**不传**时以默认插槽给的图形内容为准(见组件注释) */
|
package/dist/icon.js
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { getIconGlyph } from
|
|
3
|
-
|
|
4
|
-
* `flex-shrink`,要覆盖请传 `style`(Vue 会把 attrs 的 style 与本对象合并,同键以后者为准)。 */
|
|
5
|
-
const BASE_STYLE = { display: 'inline-block', flexShrink: '0' };
|
|
6
|
-
/** `<svg>` 容器属性:与 `renderIconSvg`(纯字符串版)逐字对齐,两版产物可直接对照 */
|
|
7
|
-
const SVG_ATTRS = {
|
|
8
|
-
viewBox: '0 0 24 24',
|
|
9
|
-
'data-slot': 'icon',
|
|
10
|
-
fill: 'none',
|
|
11
|
-
stroke: 'currentColor',
|
|
12
|
-
'stroke-width': 2,
|
|
13
|
-
'stroke-linecap': 'round',
|
|
14
|
-
'stroke-linejoin': 'round',
|
|
15
|
-
'aria-hidden': 'true',
|
|
16
|
-
};
|
|
1
|
+
import { defineComponent } from 'vue';
|
|
2
|
+
import { getIconGlyph } from "./glyphs/index.js";
|
|
3
|
+
import { renderGlyphVNode } from "./icon-render.js";
|
|
17
4
|
/** Icon 组件的 props 定义 */
|
|
18
5
|
export const iconProps = {
|
|
19
6
|
/** 内置图标名。**不传**时以默认插槽给的图形内容为准(见组件注释) */
|
|
@@ -28,14 +15,11 @@ export const iconProps = {
|
|
|
28
15
|
},
|
|
29
16
|
class: { type: String, default: undefined },
|
|
30
17
|
};
|
|
31
|
-
const textOf = (child) => (typeof child === 'string' ? child : child.children);
|
|
32
|
-
const isText = (child) => typeof child === 'string' || (child.type === Text && typeof child.children === 'string');
|
|
33
|
-
const isBlankText = (child) => isText(child) && textOf(child).trim() === '';
|
|
34
18
|
/**
|
|
35
19
|
* Icon 组件(原生 SVG)。三种用法:
|
|
36
20
|
*
|
|
37
21
|
* ```tsx
|
|
38
|
-
* <Icon name="search" /> //
|
|
22
|
+
* <Icon name="search" /> // 内置字形(按名字查表)
|
|
39
23
|
* <Icon><path d="M2 2h6v6H2z" /></Icon> // 自带图形(vnode 子节点)
|
|
40
24
|
* <Icon>{'<path d="M2 2h6v6H2z"/>'}</Icon> // 自带图形(片段串)
|
|
41
25
|
* ```
|
|
@@ -47,43 +31,22 @@ const isBlankText = (child) => isText(child) && textOf(child).trim() === '';
|
|
|
47
31
|
* - `size` 控尺寸(默认 16,同时设 width / height),也可经 class / style 覆盖。
|
|
48
32
|
* - `name` 走 `innerHTML`:内置数据是字符串常量(不含外部输入),代价是**片段必须自带合法闭合**;
|
|
49
33
|
* 槽里的 vnode 走 Vue 正常渲染,只有「槽里全是字符串」时与 `name` 同一路径。
|
|
34
|
+
*
|
|
35
|
+
* ⚠️ **按名字查找需要整张 `ICON_GLYPHS`**。只用一个图标、又不想把全部字形打进产物时,改用
|
|
36
|
+
* `GlyphIcon` + 对应的 `*Glyph`:
|
|
37
|
+
*
|
|
38
|
+
* ```tsx
|
|
39
|
+
* import { GlyphIcon, searchGlyph } from '@manohub/icon'
|
|
40
|
+
* <GlyphIcon glyph={searchGlyph} />
|
|
41
|
+
* ```
|
|
50
42
|
*/
|
|
51
|
-
export const Icon = defineComponent({
|
|
43
|
+
export const Icon = /*#__PURE__*/ defineComponent({
|
|
52
44
|
name: 'AIcon',
|
|
53
45
|
props: iconProps,
|
|
54
46
|
/** **只为类型**(运行期不读):声明默认插槽,TSX 里 `<Icon><path …/></Icon>` 才通得过检查
|
|
55
47
|
* (不声明会报 TS2559:children 被当成不存在的 prop)。 */
|
|
56
48
|
slots: Object,
|
|
57
49
|
setup(props, { slots }) {
|
|
58
|
-
return () =>
|
|
59
|
-
const slot = slots.default?.();
|
|
60
|
-
const list = Array.isArray(slot) ? slot : slot == null ? [] : [slot];
|
|
61
|
-
const children = list.filter((child) => !isBlankText(child));
|
|
62
|
-
if (children.length) {
|
|
63
|
-
// 槽里全是「文本」⇒ 当片段串注入(与 `name` 同一条路径);只要有一个 vnode 就正常渲染
|
|
64
|
-
const fragment = children.every((child) => isText(child))
|
|
65
|
-
? children.map((child) => textOf(child)).join('')
|
|
66
|
-
: null;
|
|
67
|
-
return fragment === null
|
|
68
|
-
? renderIcon({ size: props.size, klass: props.class, children: children })
|
|
69
|
-
: renderIcon({ size: props.size, klass: props.class, html: fragment });
|
|
70
|
-
}
|
|
71
|
-
return renderIcon({
|
|
72
|
-
size: props.size,
|
|
73
|
-
klass: props.class,
|
|
74
|
-
html: props.name ? getIconGlyph(props.name) : ''
|
|
75
|
-
});
|
|
76
|
-
};
|
|
50
|
+
return () => renderGlyphVNode(props.name ? getIconGlyph(props.name) : '', props, slots);
|
|
77
51
|
},
|
|
78
52
|
});
|
|
79
|
-
/** 渲染那棵唯一的 `<svg>` —— 内置 `name` 与插槽两条路共用,不会长出第二套容器口径 */
|
|
80
|
-
function renderIcon(options) {
|
|
81
|
-
return h('svg', {
|
|
82
|
-
...SVG_ATTRS,
|
|
83
|
-
width: options.size,
|
|
84
|
-
height: options.size,
|
|
85
|
-
style: BASE_STYLE,
|
|
86
|
-
class: options.klass,
|
|
87
|
-
...(options.html === undefined ? {} : { innerHTML: options.html }),
|
|
88
|
-
}, options.html === undefined ? options.children : undefined);
|
|
89
|
-
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @manohub/icon 对外导出面(Vue 组件版入口):图标表(`ICON_GLYPHS` / `IconName` / `IconNameList`)
|
|
3
|
-
* +
|
|
3
|
+
* + 逐图标 `*Glyph` 常量 + `<Icon>`(按名字)/ `<GlyphIcon>`(按片段)组件 +
|
|
4
|
+
* 纯字符串渲染器 `renderIconSvg` / `renderGlyphSvg`。零运行时依赖(仅 peer `vue`),不含 CSS。
|
|
5
|
+
*
|
|
6
|
+
* 按需引入:`import { GlyphIcon, searchGlyph } from '@manohub/icon'` —— 未使用的 `*Glyph`、
|
|
7
|
+
* `<Icon>` 与整张 `ICON_GLYPHS` 都会在打包时被摇掉;需要完全绕开根入口时走子路径
|
|
8
|
+
* `@manohub/icon/base`(组件)+ `@manohub/icon/glyphs`(数据)。
|
|
4
9
|
*
|
|
5
10
|
* 源码是 TS 但**不含 JSX**(数据是字符串、组件用 `h()` 渲染)⇒ `tsc` 一个命令直出
|
|
6
11
|
* `dist/*.js` 与 `dist/*.d.ts`,不需要 vite 与 JSX 插件。
|
|
7
|
-
* 不用 Vue 的场景走子路径 `@manohub/icon/glyphs`(同一份数据 +
|
|
12
|
+
* 不用 Vue 的场景走子路径 `@manohub/icon/glyphs`(同一份数据 + 渲染器,不引 `vue`)。
|
|
8
13
|
*/
|
|
9
|
-
export * from './glyphs.
|
|
10
|
-
export * from './icon.
|
|
14
|
+
export * from './glyphs/index.ts';
|
|
15
|
+
export * from './icon-base.ts';
|
|
16
|
+
export * from './icon.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @manohub/icon 对外导出面(Vue 组件版入口):图标表(`ICON_GLYPHS` / `IconName` / `IconNameList`)
|
|
3
|
-
* +
|
|
3
|
+
* + 逐图标 `*Glyph` 常量 + `<Icon>`(按名字)/ `<GlyphIcon>`(按片段)组件 +
|
|
4
|
+
* 纯字符串渲染器 `renderIconSvg` / `renderGlyphSvg`。零运行时依赖(仅 peer `vue`),不含 CSS。
|
|
5
|
+
*
|
|
6
|
+
* 按需引入:`import { GlyphIcon, searchGlyph } from '@manohub/icon'` —— 未使用的 `*Glyph`、
|
|
7
|
+
* `<Icon>` 与整张 `ICON_GLYPHS` 都会在打包时被摇掉;需要完全绕开根入口时走子路径
|
|
8
|
+
* `@manohub/icon/base`(组件)+ `@manohub/icon/glyphs`(数据)。
|
|
4
9
|
*
|
|
5
10
|
* 源码是 TS 但**不含 JSX**(数据是字符串、组件用 `h()` 渲染)⇒ `tsc` 一个命令直出
|
|
6
11
|
* `dist/*.js` 与 `dist/*.d.ts`,不需要 vite 与 JSX 插件。
|
|
7
|
-
* 不用 Vue 的场景走子路径 `@manohub/icon/glyphs`(同一份数据 +
|
|
12
|
+
* 不用 Vue 的场景走子路径 `@manohub/icon/glyphs`(同一份数据 + 渲染器,不引 `vue`)。
|
|
8
13
|
*/
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
14
|
+
export * from "./glyphs/index.js";
|
|
15
|
+
export * from "./icon-base.js";
|
|
16
|
+
export * from "./icon.js";
|
package/dist/svg.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 表里存的是片段(不含 `<svg>` 壳、不含硬编码颜色),而手上多半是设计工具导出的完整文件;
|
|
5
5
|
* 手工剥壳要处理「多层 `transform` 的净矩阵 / `fill-rule` / 查重」等 7 件事(三件几乎必错)。
|
|
6
6
|
* 只在**构建期**用:`icon-from-svg` 读目录产出静态 `.ts` 表(片段进 git,可 review、可 diff),
|
|
7
|
-
* 片段再交给 `<
|
|
7
|
+
* 片段再交给 `<GlyphIcon>` 的 `glyph` / 插槽 —— 不在运行期归一(那会让每个消费方都背一遍解析器)。
|
|
8
8
|
*
|
|
9
9
|
* 纯字符串处理:不引 `vue`、不引 `node:*`,浏览器与 Node 都能用(读文件在 `bin/icon-from-svg.mjs`)。
|
|
10
10
|
* 口径:只接收**单色**图形;渐变 / 滤镜 / 遮罩 / 多色一律拒绝(属产品专属图形,放应用侧 assets)。
|
package/dist/svg.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 表里存的是片段(不含 `<svg>` 壳、不含硬编码颜色),而手上多半是设计工具导出的完整文件;
|
|
5
5
|
* 手工剥壳要处理「多层 `transform` 的净矩阵 / `fill-rule` / 查重」等 7 件事(三件几乎必错)。
|
|
6
6
|
* 只在**构建期**用:`icon-from-svg` 读目录产出静态 `.ts` 表(片段进 git,可 review、可 diff),
|
|
7
|
-
* 片段再交给 `<
|
|
7
|
+
* 片段再交给 `<GlyphIcon>` 的 `glyph` / 插槽 —— 不在运行期归一(那会让每个消费方都背一遍解析器)。
|
|
8
8
|
*
|
|
9
9
|
* 纯字符串处理:不引 `vue`、不引 `node:*`,浏览器与 Node 都能用(读文件在 `bin/icon-from-svg.mjs`)。
|
|
10
10
|
* 口径:只接收**单色**图形;渐变 / 滤镜 / 遮罩 / 多色一律拒绝(属产品专属图形,放应用侧 assets)。
|
|
@@ -257,13 +257,13 @@ export function buildTableSource(entries, options = {}) {
|
|
|
257
257
|
* **由 \`icon-from-svg\` 从 SVG 生成,请勿手改** —— 设计稿改了重新生成一次即可。
|
|
258
258
|
* 片段口径:24 视口、单色 \`currentColor\`、坐标不重写(视口换算靠包装层 \`transform\`)。
|
|
259
259
|
*
|
|
260
|
-
* 消费方式 ——
|
|
260
|
+
* 消费方式 —— 片段直接交给 \`<GlyphIcon>\`(不引图标表,见 \`@manohub/kit/CONTRACT.md\` L1.5-6 第 ③ 类):
|
|
261
261
|
*
|
|
262
262
|
* \`\`\`tsx
|
|
263
|
-
* import {
|
|
263
|
+
* import { GlyphIcon } from '@manohub/icon'
|
|
264
264
|
* import { ${constName} } from './<本文件>'
|
|
265
265
|
*
|
|
266
|
-
* <
|
|
266
|
+
* <GlyphIcon glyph={${constName}['aip-foo']} />
|
|
267
267
|
* \`\`\`
|
|
268
268
|
*/
|
|
269
269
|
export const ${constName} = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manohub/icon",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "AIHub 图标包:内置 SVG 图标内容表 + 纯字符串渲染器 + <Icon> 组件。零运行时依赖(仅 peer vue),供任意 UI 栈消费",
|
|
@@ -28,9 +28,21 @@
|
|
|
28
28
|
"types": "./dist/index.d.ts",
|
|
29
29
|
"import": "./dist/index.js"
|
|
30
30
|
},
|
|
31
|
+
"./base": {
|
|
32
|
+
"types": "./dist/icon-base.d.ts",
|
|
33
|
+
"import": "./dist/icon-base.js"
|
|
34
|
+
},
|
|
31
35
|
"./glyphs": {
|
|
32
|
-
"types": "./dist/glyphs.d.ts",
|
|
33
|
-
"import": "./dist/glyphs.js"
|
|
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"
|
|
34
46
|
},
|
|
35
47
|
"./svg": {
|
|
36
48
|
"types": "./dist/svg.d.ts",
|