mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 14:56:59 +08:00
chore: merge blocksuite source code (#9213)
This commit is contained in:
44
blocksuite/affine/model/src/consts/doc.ts
Normal file
44
blocksuite/affine/model/src/consts/doc.ts
Normal 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>;
|
||||
Reference in New Issue
Block a user