chore: merge blocksuite source code (#9213)

This commit is contained in:
Mirone
2024-12-20 15:38:06 +08:00
committed by GitHub
parent 2c9ef916f4
commit 30200ff86d
2031 changed files with 238888 additions and 229 deletions

View File

@@ -0,0 +1,44 @@
import { z } from 'zod';
export type DocMode = 'edgeless' | 'page';
export const DocModes = ['edgeless', 'page'] as const;
/**
* Custom title and description information.
*
* Supports the following blocks:
*
* 1. Inline View: `AffineReference` - title
* 2. Card View: `EmbedLinkedDocBlock` - title & description
* 3. Embed View: `EmbedSyncedDocBlock` - title
*/
export const AliasInfoSchema = z
.object({
title: z.string(),
description: z.string(),
})
.partial();
export type AliasInfo = z.infer<typeof AliasInfoSchema>;
export const ReferenceParamsSchema = z
.object({
mode: z.enum(DocModes),
blockIds: z.string().array(),
elementIds: z.string().array(),
databaseId: z.string().optional(),
databaseRowId: z.string().optional(),
})
.partial();
export type ReferenceParams = z.infer<typeof ReferenceParamsSchema>;
export const ReferenceInfoSchema = z
.object({
pageId: z.string(),
params: ReferenceParamsSchema.optional(),
})
.merge(AliasInfoSchema);
export type ReferenceInfo = z.infer<typeof ReferenceInfoSchema>;