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

Feat (Conversion-config): pass target tool config to the conversionConfig.import method #2848

Merged
merged 7 commits into from
Oct 17, 2024

Conversation

e11sy
Copy link
Contributor

@e11sy e11sy commented Oct 16, 2024

Problem

In some tools (for example nested-list), tool config should be respected on conversion, but this functionality was unreachable since config is passed to the tool in constructor and conversionConfig is static and not related to the tool instance

Solution

Pass target tool config on the conversionConfig.import method inside of the Editor BlockManager

Changes

  • Now convertStringToBlockData method passes target tool config the import method
  • Fixed types in convesion config file (somehow imprort could return function that returns string, but import should return method that would return ToolData) this caused just type error that never been reached because types were actually ignored
  • Added test that checks, that import method actualy gets passed config

- Now `convertStringToBlockData` method passes target tool config the import method
- Fixed types in convesion config file (somehow imprort could return function that returns string, but import should return method that would return ToolData) this caused just type error that never been reached because types were actually ignored
- Added test that checks, that import method actualy gets passed config
src/components/modules/blockManager.ts Show resolved Hide resolved
src/components/utils/blocks.ts Outdated Show resolved Hide resolved
test/cypress/tests/api/blocks.cy.ts Outdated Show resolved Hide resolved
types/configs/conversion-config.ts Show resolved Hide resolved
@neSpecc neSpecc merged commit da4257a into next Oct 17, 2024
6 checks passed
@neSpecc neSpecc deleted the pass-config-on-tool-conversion branch October 17, 2024 16:38
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