AFFiNE/packages/frontend/core
EYHN bc86f0a672
feat(core): editor setting service (#7956)
define editor setting schema in `packages/frontend/core/src/modules/editor-settting/schema.ts`

e.g.

```ts
const BSEditorSettingSchema = z.object({
  connector: z.object({
    stroke: z
      .union([
        z.string(),
        z.object({
          dark: z.string(),
          light: z.string(),
        }),
      ])
      .default('#000000'), // default is necessary
  }),
});
```

schema can be defined in a nested way. EditorSetting api is in flat way:

editorSetting api:

```ts
editorSetting.settings$ === {
  'connector.stroke': '#000000'
}
editorSetting.set('connector.stroke', '#000')
```

and use `expandFlattenObject` function can restore the flattened structure to a nested structure. nested structure is required by blocksuite

```ts
editorSetting.settings$.map(expandFlattenObject) === {
  connector: {
    stroke: '#000000'
  }
}
```
2024-08-26 08:19:24 +00:00
..
public chore(core): replace ai onboarding videos (#6730) 2024-04-29 07:07:43 +00:00
src feat(core): editor setting service (#7956) 2024-08-26 08:19:24 +00:00
package.json chore: bump up @blocksuite/icons version to v2.1.64 (#7945) 2024-08-23 12:22:06 +08:00
tsconfig.json chore: remove unused y-indexeddb (#6728) 2024-04-29 09:14:42 +00:00
tsconfig.node.json refactor(infra): directory structure (#4615) 2023-10-18 15:30:08 +00:00
tsconfig.server.json refactor(infra): directory structure (#4615) 2023-10-18 15:30:08 +00:00