refactor(editor): add schema for value of database block properties (#10749)

This commit is contained in:
zzj3720
2025-03-11 02:12:40 +00:00
parent db707dff7f
commit 77e4b9aa8e
17 changed files with 198 additions and 172 deletions

View File

@@ -197,7 +197,7 @@ export abstract class DataSourceBase implements DataSource {
return computed(() => this.propertyReadonlyGet(propertyId));
}
abstract propertyTypeGet(propertyId: string): string;
abstract propertyTypeGet(propertyId: string): string | undefined;
propertyTypeGet$(propertyId: string): ReadonlySignal<string | undefined> {
return computed(() => this.propertyTypeGet(propertyId));

View File

@@ -1,4 +1,5 @@
import type { Disposable } from '@blocksuite/global/slot';
import type { ZodType } from 'zod';
import type { DataSource } from '../data-source/base.js';
import type { TypeInstance } from '../logical/type.js';
@@ -15,6 +16,7 @@ export type PropertyConfig<
Value = unknown,
> = {
name: string;
valueSchema: ZodType<Value>;
hide?: boolean;
fixed?: {
defaultData: Data;