Skip to content
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

Merged
merged 11 commits into from
May 16, 2024
Merged

Use Lexical for method docs and node comments #9956

merged 11 commits into from
May 16, 2024

Conversation

kazcw
Copy link
Contributor

@kazcw kazcw commented May 14, 2024

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:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

@kazcw kazcw self-assigned this May 14, 2024
@kazcw kazcw added the CI: No changelog needed Do not require a changelog entry for this PR. label May 14, 2024
@@ -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]
Copy link
Contributor

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(
Copy link
Contributor

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,
Copy link
Contributor

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.

Copy link
Contributor Author

@kazcw kazcw May 15, 2024

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.

Copy link
Contributor

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.

@kazcw kazcw requested a review from Frizi May 15, 2024 23:16
@kazcw
Copy link
Contributor Author

kazcw commented May 15, 2024

@Frizi Requesting re-review after refactor to eliminate lexical-vue.

line-height: 1.75;
}

h2,
Copy link
Contributor

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.

@@ -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>
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@kazcw kazcw added the CI: Ready to merge This PR is eligible for automatic merge label May 16, 2024
@kazcw kazcw linked an issue May 16, 2024 that may be closed by this pull request
@mergify mergify bot merged commit d39451d into develop May 16, 2024
35 checks passed
@mergify mergify bot deleted the wip/kw/lexical branch May 16, 2024 14:38
vitvakatu pushed a commit that referenced this pull request May 17, 2024
Use a Lexical-based markdown editor in the right dock; use a Lexical-based plain text editor for node comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate Lexical for right-dock and comments
2 participants