Skip to content

Conversation

@zorexsalvo
Copy link

@zorexsalvo zorexsalvo commented Sep 16, 2025

Changes

  • Dynamically generate column controls based on maxColumns
  • Add dynamic support to the _updateCols function

The columns tool now accepts a maxColumns parameter.
Example usage:

columns: {
  class: editorjsColumns,
  config: {
    EditorJsLibrary: EditorJS,
    tools: columnTools,
    maxColumns: 4,
  }
}

this extends the maximum number of columns a user can create to 4.

Note: PR is still in draft state.

- Added a "4 Columns" option to the column settings menu.
- Updated the _updateCols method to handle 4 columns.
- This allows users to create and manage up to 4 columns in the editor.
Allow users to select 2, 3, or 4 columns in the editor settings.
Refactored _updateCols to use the provided column count argument.
Refactor renderSettings to generate column controls dynamically based on
maxColumns. Added documentation comment for clarity and maintainability.
@calumk
Copy link
Owner

calumk commented Sep 23, 2025

Did you get this to a state where you would open a pull?

I would consider it as long as it doesn't break any existing implementations

@zorexsalvo
Copy link
Author

Hi @calumk, thanks for taking a look. It’s still in draft state as I’m still reading the Editor.js API. And yes, I made sure that it will not break any existing implementation.

@calumk
Copy link
Owner

calumk commented Sep 24, 2025

Yes the editors API is... Not the best documented!
Good luck!

@zorexsalvo zorexsalvo changed the title Refactor column settings generation to be dynamic in renderSettings Add maxColumns Configuration to Columns Tool Oct 4, 2025
@zorexsalvo zorexsalvo marked this pull request as ready for review October 4, 2025 12:02
@zorexsalvo
Copy link
Author

Hi @calumk thank you for your patience. This is now ready for review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants