feat: Support dot‑chained props for LobeHub icons

- render.js: Enhance getLobeHubIcon to parse dot‑chained props, e.g.:
  - OpenAI.Avatar.type={'platform'}
  - OpenRouter.Avatar.shape={'square'}
  - Parses booleans/numbers/strings and {…} wrappers; keeps the 2nd arg `size` unless overridden by chain props. Backward compatible.
- EditVendorModal.jsx: Update UI copy — simplify placeholder; document chain‑parameter examples in extra text with doc link.
- en.json: Fix invalid escape sequences in the new i18n string to satisfy linter.

No behavioral changes outside icon rendering; lints pass.
This commit is contained in:
t0ng7u
2025-08-10 01:18:36 +08:00
parent 459fce196f
commit 9572e16dcb
3 changed files with 64 additions and 14 deletions

View File

@@ -158,10 +158,10 @@ const EditVendorModal = ({ visible, handleClose, refresh, editingVendor }) => {
<Form.Input
field="icon"
label={t('供应商图标')}
placeholder={t('请输入图标名称OpenAI、Claude.Color')}
placeholder={t("请输入图标名称")}
extraText={
<span>
{t('图标使用@lobehub/icons库查询所有可用图标 ')}
{t('图标使用@lobehub/icons库OpenAI、Claude.Color支持链式参数OpenAI.Avatar.type={\'platform\'}、OpenRouter.Avatar.shape={\'square\'}查询所有可用图标 ')}
<Typography.Text
link={{ href: 'https://icons.lobehub.com/components/lobe-hub', target: '_blank' }}
icon={<IconLink />}