···5050 * Checks if the record is a pub.leaflet.document
5151 */
5252export function isLeafletDocument(
5353- record: unknown
5353+ record: unknown,
5454): record is PubLeafletDocument.Record {
5555 if (!record || typeof record !== "object") return false;
5656 const r = record as Record<string, unknown>;
···6565 * Checks if the record is a site.standard.document
6666 */
6767export function isStandardDocument(
6868- record: unknown
6868+ record: unknown,
6969): record is SiteStandardDocument.Record {
7070 if (!record || typeof record !== "object") return false;
7171 const r = record as Record<string, unknown>;
···7676 * Checks if the record is a pub.leaflet.publication
7777 */
7878export function isLeafletPublication(
7979- record: unknown
7979+ record: unknown,
8080): record is PubLeafletPublication.Record {
8181 if (!record || typeof record !== "object") return false;
8282 const r = record as Record<string, unknown>;
···9191 * Checks if the record is a site.standard.publication
9292 */
9393export function isStandardPublication(
9494- record: unknown
9494+ record: unknown,
9595): record is SiteStandardPublication.Record {
9696 if (!record || typeof record !== "object") return false;
9797 const r = record as Record<string, unknown>;
···106106 | $Typed<PubLeafletThemeColor.Rgba>
107107 | $Typed<PubLeafletThemeColor.Rgb>
108108 | { $type: string }
109109- | undefined
109109+ | undefined,
110110): { r: number; g: number; b: number } | undefined {
111111 if (!color || typeof color !== "object") return undefined;
112112 const c = color as Record<string, unknown>;
···124124 * Converts a pub.leaflet theme to a site.standard.theme.basic format
125125 */
126126export function leafletThemeToBasicTheme(
127127- theme: PubLeafletPublication.Theme | undefined
127127+ theme: PubLeafletPublication.Theme | undefined,
128128): SiteStandardThemeBasic.Main | undefined {
129129 if (!theme) return undefined;
130130131131 const background = extractRgb(theme.backgroundColor);
132132- const accent = extractRgb(theme.accentBackground) || extractRgb(theme.primary);
132132+ const accent =
133133+ extractRgb(theme.accentBackground) || extractRgb(theme.primary);
133134 const accentForeground = extractRgb(theme.accentText);
134135135136 // If we don't have the required colors, return undefined
···160161 * @param uri - Optional document URI, used to extract the rkey for the path field when normalizing pub.leaflet records
161162 * @returns A normalized document in site.standard format, or null if invalid/unrecognized
162163 */
163163-export function normalizeDocument(record: unknown, uri?: string): NormalizedDocument | null {
164164+export function normalizeDocument(
165165+ record: unknown,
166166+ uri?: string,
167167+): NormalizedDocument | null {
164168 if (!record || typeof record !== "object") return null;
165169166170 // Pass through site.standard records directly (theme is already in correct format if present)
···219223 * @returns A normalized publication in site.standard format, or null if invalid/unrecognized
220224 */
221225export function normalizePublication(
222222- record: unknown
226226+ record: unknown,
223227): NormalizedPublication | null {
224228 if (!record || typeof record !== "object") return null;
225229···268272 showComments: record.preferences.showComments,
269273 showMentions: record.preferences.showMentions,
270274 showPrevNext: record.preferences.showPrevNext,
275275+ showRecommends: record.preferences.showRecommends,
271276 }
272277 : undefined;
273278···290295 * Type guard to check if a normalized document has leaflet content
291296 */
292297export function hasLeafletContent(
293293- doc: NormalizedDocument
298298+ doc: NormalizedDocument,
294299): doc is NormalizedDocument & {
295300 content: $Typed<PubLeafletContent.Main>;
296301} {
···304309 * Gets the pages array from a normalized document, handling both formats
305310 */
306311export function getDocumentPages(
307307- doc: NormalizedDocument
312312+ doc: NormalizedDocument,
308313): PubLeafletContent.Main["pages"] | undefined {
309314 if (!doc.content) return undefined;
310315