AFFiNE/packages/frontend
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
..
admin chore: bump up all non-major dependencies (#7953) 2024-08-23 14:42:36 +00:00
component fix: remove unused variables (#7968) 2024-08-26 14:23:56 +08:00
core feat(core): editor setting service (#7956) 2024-08-26 08:19:24 +00:00
electron fix: remove unused variables (#7968) 2024-08-26 14:23:56 +08:00
electron-api chore: bump up electron version to v32 (#7927) 2024-08-21 08:38:21 +00:00
graphql feat(component): mobile menu support (#7892) 2024-08-21 09:05:05 +00:00
i18n chore(core): add Display bi-directional links setting row ui (#7954) 2024-08-26 06:25:32 +00:00
mobile feat: init mobile entry (#7905) 2024-08-21 13:17:35 +00:00
native chore: bump up all non-major dependencies (#7925) 2024-08-22 04:12:23 +00:00
templates chore: bump base version to 0.16.0 2024-08-09 18:30:07 +08:00
web chore: bump electron version (#7922) 2024-08-19 14:24:34 +00:00