Commit Graph

6 Commits

Author SHA1 Message Date
Saul-Mirone c6b8f2b584 refactor(editor): flat data for table block (#10010)
close: BS-2548
2025-02-10 19:09:33 +00:00
Saul-Mirone 5b750bbba4 feat(editor): support delete in flat block proxy (#9994) 2025-02-06 16:30:06 +00:00
Saul-Mirone 1858947e0c feat(editor): flat block data (#9854)
Flat block data.

A new block type to flatten the block data

```typescript
// For developers
type Model = {
  blocks: Record<string, {
    flavour: string;
    cells: Record<string, {
      rowId: string;
      colId: string;
      text: Text;
    }>;
    cols: Record<string, {
      align: string;
    }>
    rows: Record<string, {
      backgroundColor: string;
    }>
  }>
}

// How it's saved in yjs
const yData = {
  blocks: {
    'blockId1': {
      flavour: 'affine:table',
      'prop:rows:row1:backgroundColor': 'white',
      'prop:cols:col1:align': 'left',
      'prop:cells:cell1:rowId': 'row1',
      'prop:cells:cell1:colId': 'col1',
      'prop:cells:cell1:text': YText,
      prop:children: []
    },
  }
}
```
2025-01-25 12:57:21 +00:00
Saul-Mirone 17e6e7fede fix: typo in reactive text (#9260) 2024-12-23 12:23:56 +00:00
Saul-Mirone 3a82da0e5b chore: fix eslint in blocksuite (#9232) 2024-12-20 16:48:10 +00:00
Mirone 30200ff86d chore: merge blocksuite source code (#9213) 2024-12-20 15:38:06 +08:00