-
Notifications
You must be signed in to change notification settings - Fork 326
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
Use Lexical for method docs and node comments #9956
Conversation
app/gui2/src/util/reactivity.ts
Outdated
@@ -156,3 +157,5 @@ export function syncSet<T>(target: Set<T>, newState: Set<T>) { | |||
for (const oldKey of target) if (!newState.has(oldKey)) target.delete(oldKey) | |||
for (const newKey of newState) if (!target.has(newKey)) target.add(newKey) | |||
} | |||
|
|||
export type ToValue<T> = Parameters<typeof toValue<T>>[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already defined in placement.ts
, and I prefer the definition without using Parameters
.
return $getRoot().getTextContent() | ||
} | ||
|
||
export function useSync( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function's is very generic. Maybe rename it to useLexicalSync
for a bit more context, and add some docs.
line-height: 1.75; | ||
} | ||
|
||
h2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are those styles actually functioning? Because those are defined in scoped style block, they will only apply to vue-owned DOM nodes by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are in an unscoped block. The style block above it is scoped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I missed that. In this case I think the styles are actually too general, likely also influencing the dahsboard as well by accident. Ideally this would still be in scoped block, but within a :deep
subselector, so it is scoped to the contents of this component.
@Frizi Requesting re-review after refactor to eliminate |
line-height: 1.75; | ||
} | ||
|
||
h2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I missed that. In this case I think the styles are actually too general, likely also influencing the dahsboard as well by accident. Ideally this would still be in scoped block, but within a :deep
subselector, so it is scoped to the contents of this component.
app/gui2/src/util/reactivity.ts
Outdated
@@ -158,4 +159,5 @@ export function syncSet<T>(target: Set<T>, newState: Set<T>) { | |||
for (const newKey of newState) if (!target.has(newKey)) target.add(newKey) | |||
} | |||
|
|||
export type ToValue<T> = Parameters<typeof toValue<T>>[0] | |||
/** Type of the parameter of `toValue`. */ | |||
export type ToValue<T> = MaybeRefOrGetter<T> | ComputedRef<T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be imported in placement.ts
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#9924 removes all the redundant ToValue
implementations, I just copied the new definition in @/util/reactivity
to this PR so that I can use it while waiting for that to merge.
Use a Lexical-based markdown editor in the right dock; use a Lexical-based plain text editor for node comments.
Pull Request Description
Use a Lexical-based markdown editor in the right dock; use a Lexical-based plain text editor for node comments.
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.