mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 02:20:38 +09:00
fix(ci): refresh lockfile in PR jobs
This commit is contained in:
parent
2cc2d4420d
commit
85d2c54d53
2 changed files with 47 additions and 5 deletions
|
|
@ -112,11 +112,7 @@ function buildAgentIconMask(iconName: string | null): string | null {
|
|||
if (cached) return cached;
|
||||
|
||||
const Icon = getAgentIcon(iconName);
|
||||
const iconNode = (
|
||||
Icon as unknown as {
|
||||
iconNode?: Array<[string, Record<string, string>]>;
|
||||
}
|
||||
).iconNode;
|
||||
const iconNode = resolveLucideIconNode(Icon);
|
||||
if (!Array.isArray(iconNode) || iconNode.length === 0) return null;
|
||||
|
||||
const body = iconNode.map(([tag, attrs]) => {
|
||||
|
|
@ -136,6 +132,32 @@ function buildAgentIconMask(iconName: string | null): string | null {
|
|||
return url;
|
||||
}
|
||||
|
||||
function resolveLucideIconNode(
|
||||
icon: unknown,
|
||||
): Array<[string, Record<string, string>]> | null {
|
||||
const staticIconNode = (
|
||||
icon as {
|
||||
iconNode?: Array<[string, Record<string, string>]>;
|
||||
}
|
||||
).iconNode;
|
||||
if (Array.isArray(staticIconNode) && staticIconNode.length > 0) {
|
||||
return staticIconNode;
|
||||
}
|
||||
|
||||
const render = (
|
||||
icon as {
|
||||
render?: (props: Record<string, unknown>, ref: unknown) => {
|
||||
props?: { iconNode?: Array<[string, Record<string, string>]> };
|
||||
} | null;
|
||||
}
|
||||
).render;
|
||||
const rendered = typeof render === "function" ? render({}, null) : null;
|
||||
const renderedIconNode = rendered?.props?.iconNode;
|
||||
return Array.isArray(renderedIconNode) && renderedIconNode.length > 0
|
||||
? renderedIconNode
|
||||
: null;
|
||||
}
|
||||
|
||||
function escapeAttribute(value: string): string {
|
||||
return value
|
||||
.replaceAll("&", "&")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue