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: #11 add settings to the plugin #33

Open
wants to merge 89 commits into
base: main
Choose a base branch
from

Conversation

SalahAdDin
Copy link

What does it do?

It adds settings routes, configuration, services, and controllers for loading default and saved settings.

Why is it needed?

Content managers want to customize the editor toolbar and features, so we give them a mechanism for doing that.

How to test it?

Add the desired settings on your plugin notification(plugin.ts):

export default {
  "richtext-editor": {
    enabled: true,
    resolve: "./node_modules/strapi-plugin-rich-text",
    config: {
      headings: ["h2", "h3", "h4", "h4", "h5", "h6"],
      other: {
        wordcount: true,
        saveJson: true,
      },
    },
  },
};

Run the project and go to the content type, choose any of the created entities, and check the editor toolbar.

You can go to settings and look for RichText Editor settings, check your desired settings on the page, modify them, save them, and check on the content type entities that your changes are reflected.

Notes

  • Loading settings duplicate the fetching times by two, and there are already to fetches there.
    Screenshot_20240830_185857
    Screenshot_20240830_185948
  • Adding a loading component was required since returning a null value when loading breaks the rendering.
    Screenshot_20240830_190001
  • Config validation could be handled by using any library like Valibot.

fix: adding scroll to editor content
chore: adding localization to the editor
feat: #10 add code and code block to the editor
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.

1 participant