-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): editor setting service #7956
Conversation
Your org has enabled the Graphite merge queue for merging into canaryAdd the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
f286f1d
to
dc3d6d3
Compare
☁️ Nx Cloud ReportCI is running/has finished running commands for commit bc86f0a. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## canary #7956 +/- ##
==========================================
+ Coverage 55.18% 55.27% +0.08%
==========================================
Files 1053 1060 +7
Lines 44677 44725 +48
Branches 5262 5272 +10
==========================================
+ Hits 24656 24722 +66
+ Misses 19643 19624 -19
- Partials 378 379 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
packages/frontend/core/src/modules/editor-settting/impls/global-state.ts
Show resolved
Hide resolved
packages/frontend/core/src/modules/editor-settting/__test__/editor-setting.spec.ts
Show resolved
Hide resolved
dc3d6d3
to
fea3451
Compare
fea3451
to
8982886
Compare
Merge activity
|
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' } } ```
8982886
to
bc86f0a
Compare
define editor setting schema in
packages/frontend/core/src/modules/editor-settting/schema.ts
e.g.
schema can be defined in a nested way. EditorSetting api is in flat way:
editorSetting api:
and use
expandFlattenObject
function can restore the flattened structure to a nested structure. nested structure is required by blocksuite