forked from farhoodlabs/paperclip
fix(ci): refresh lockfile in PR jobs
This commit is contained in:
@@ -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("&", "&")
|
||||
|
||||
Reference in New Issue
Block a user