-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed display of conversion menu for blocks without export rule (#2799)
* Fixed display of convert menu for blocks without export rule According to the workflow script from the documentation: https://editorjs.io/tools-api/#conversionconfig * Update CHANGELOG.md * some improvements and tests --------- Co-authored-by: Peter Savchenko <[email protected]>
- Loading branch information
Showing
7 changed files
with
102 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
test/cypress/fixtures/tools/ToolWithoutConversionExport.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { ConversionConfig } from '@/types/configs/conversion-config'; | ||
import ToolMock from './ToolMock'; | ||
|
||
/** | ||
* This tool has a conversionConfig, but it doesn't have export property. | ||
* | ||
* That means that tool can be created from string, but can't be converted to string. | ||
*/ | ||
export class ToolWithoutConversionExport extends ToolMock { | ||
/** | ||
* Rules specified how our Tool can be converted to/from other Tool. | ||
*/ | ||
public static get conversionConfig(): ConversionConfig { | ||
return { | ||
import: 'text', // this tool can be created from string | ||
|
||
/** | ||
* Here is no "export" property, so this tool can't be converted to string | ||
*/ | ||
// export: (data) => data.text, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters