feat(editor): add favicon, title, description support for footnote url reference (#11924)

Closes: [BS-3272](https://linear.app/affine-design/issue/BS-3272/footnote-适配-exa-api-返回结果)

## What's Changed

Add link preview data support (favicon, title, description) for URL references in footnotes:
- Store and display URL preview data in footnotes
- Add encoding/decoding support for favicon URLs
- Optimize link preview by using existing preview data when available
This commit is contained in:
donteatfriedrice
2025-04-23 11:57:25 +00:00
parent ff133d1267
commit db5eadb72a
7 changed files with 121 additions and 31 deletions

View File

@@ -65,6 +65,9 @@ export type ReferenceInfo = z.infer<typeof ReferenceInfoSchema>;
* 3. url: string - the url of the reference
* 4. fileName: string - the name of the attachment
* 5. fileType: string - the type of the attachment
* 6. favicon: string - the favicon of the url reference
* 7. title: string - the title of the url reference
* 8. description: string - the description of the url reference
*/
export const FootNoteReferenceParamsSchema = z.object({
type: z.enum(FootNoteReferenceTypes),
@@ -73,6 +76,9 @@ export const FootNoteReferenceParamsSchema = z.object({
fileName: z.string().optional(),
fileType: z.string().optional(),
url: z.string().optional(),
favicon: z.string().optional(),
title: z.string().optional(),
description: z.string().optional(),
});
export type FootNoteReferenceParams = z.infer<