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

ElementNode -> isFixedPosition #1338

Closed
zurfyx opened this issue Feb 21, 2022 · 4 comments
Closed

ElementNode -> isFixedPosition #1338

zurfyx opened this issue Feb 21, 2022 · 4 comments
Labels
Projects

Comments

@zurfyx
Copy link
Member

zurfyx commented Feb 21, 2022

In some cases we may want to have documents that resemble a sort of template. For example, the first line always being a title while the rest of the document is just a normal body.

We already support half of this feature by having a BootstrapPlugin that supports custom a custom initialization function, but to fully support this, we have to make sure that the title node can't be removed later.

The API could possibly look like that (kudos to @trueadm for the proposal):

class ElementNode {
  isFixedPosition(): boolean;
}
@zurfyx zurfyx added the feature label Feb 21, 2022
@zurfyx zurfyx added this to Future in Lexical Jun 14, 2022
@zurfyx zurfyx moved this from Future to Next (V1.0) in Lexical Jun 14, 2022
@GermanJablo
Copy link
Contributor

Interesting!
What do you think of the Prosemirror API for defining Schemas? https://prosemirror.net/docs/guide/#schema

It seems more flexible as you can define crazier things like: "I don't want more than 5 paragraphs in a row without a title in the middle" (one of the rules I have for writers at my SEO agency).

@nvegater
Copy link

What do you think of the Prosemirror API for defining Schemas?

My two cents: Very flexible but I don't think is very "react-like". The schema Object is okay, but I hope Lexical comes up with something better.
For example, a Schema FC component that takes React components as attributes, that way we can pass props to the different parts of the schema.
I think that this would be a better DX because it makes it easy to add things like dynamic templates.

@thegreatercurve
Copy link
Contributor

We are going to address this separately as part of work on schemas.

Lexical automation moved this from Next (V1.0) to Closed/Duplicate Nov 24, 2022
@GermanJablo
Copy link
Contributor

Is there a public place where it is being discussed what the possible solution will look like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Lexical
Closed/Duplicate
Development

No branches or pull requests

4 participants