editorjs-text-color-plugin icon indicating copy to clipboard operation
editorjs-text-color-plugin copied to clipboard

Add ability to cache user color choices based on config

Open YoofiBP opened this issue 2 years ago • 0 comments

Hey @flaming-cl , sorry for the absence. I am resubmitting a PR to allow caching user color choices based on config as I tried ot do many months ago. I would like to address/seek some clarification from your final comment on #11 before the PR was closed.

The plugin will allow users to specify if they want the color caching to be enabled and the number of colors they want in their cache using allow allowUserCachedColors and numberOfUserCachedColors respectively. These colors will be merged with the colorCollection allowing the user to have both. When the max cache size, obtained from numberOfUserCachedColors in the config, is reached, only the cached colors are modified with the most resent placed at the top. In this way the replacement behavior is fairly predictable for users. Do let me know if you have any unanswered concerns.

YoofiBP avatar Nov 13 '23 15:11 YoofiBP