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

Add more configuration for heading in INSERT_TABLE_COMMAND #3843

Conversation

Sebastien-Ahkrin
Copy link
Contributor

The idea behind this changement is to allow the user of the API to choice if the header will be only row, column or Both.

For example:

function onClick() {
  activeEditor.dispatchCommand(INSERT_TABLE_COMMAND, {
    columns,
    includeHeaders: true,
    rows,
  });
}

This will make the header as column and row like before.
image

but, if you add columns and row as an object for includeHeaders like that:

function onClick() {
  activeEditor.dispatchCommand(INSERT_TABLE_COMMAND, {
    columns,
    includeHeaders: {columns: false, rows: true},
    rows,
  });
}

CleanShot 2023-02-07 at 17 10 42

Or like that if you make columns as true and rows as false
image

Do this functionnality looks good for you ?

@vercel
Copy link

vercel bot commented Feb 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
lexical ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 7, 2023 at 4:15PM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 7, 2023 at 4:15PM (UTC)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 7, 2023
Copy link
Contributor

@thegreatercurve thegreatercurve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semantics might be slightly odd as you'd always expect includeHeaders to be a boolean, but it's probably not worth introducing a breaking change over.

@Sebastien-Ahkrin
Copy link
Contributor Author

The semantics might be slightly odd as you'd always expect includeHeaders to be a boolean, but it's probably not worth introducing a breaking change over.

yeah, i choosed to only add a type with "boolean" included. becausei think it would be bad for every user to fix the breaking changes. Tell me if i have to change something ! :)

@thegreatercurve thegreatercurve merged commit 75844c3 into facebook:main Feb 8, 2023
@thegreatercurve thegreatercurve mentioned this pull request Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants