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
@@ -0,0 +1,24 @@
import { t } from '../../core/logical/type-presets.js';
import { propertyType } from '../../core/property/property-config.js';
export const progressPropertyType = propertyType('progress');
export const progressPropertyModelConfig =
progressPropertyType.modelConfig<number>({
name: 'Progress',
type: () => t.number.instance(),
defaultData: () => ({}),
cellToString: ({ value }) => value?.toString() ?? '',
cellFromString: ({ value }) => {
const num = value ? Number(value) : NaN;
return {
value: isNaN(num) ? null : num,
};
},
cellToJson: ({ value }) => value ?? null,
cellFromJson: ({ value }) => {
if (typeof value !== 'number') return undefined;
return value;
},
isEmpty: () => false,
});