Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Lack of instruction for installation #27

Closed
Kaherdin opened this issue Mar 9, 2022 · 11 comments · Fixed by #20
Closed

Lack of instruction for installation #27

Kaherdin opened this issue Mar 9, 2022 · 11 comments · Fixed by #20

Comments

@Kaherdin
Copy link

Kaherdin commented Mar 9, 2022

Hello,

I'm using strapi V4 and I'm trying to install make this plugin works, but I cannot !
I think you should add more documentations, even an example.

Should I need to enable the plugin in plugin.js ?
editorjs: { enabled: true, },

Should I install @editorjs/editorjs as dependencie ?

Thanks
@Kaherdin
Copy link
Author

Kaherdin commented Mar 9, 2022

Okay, I've installed the beta (npm install strapi-plugin-react-editorjs@2.0.0-beta.1)from jaskipper. Thanks a lot for that.

But I still get an error with axios missing when I'm trying to copy/past an image by url.
I see that you fix that in a commit, but I didn't work.

Neither that the image upload plugin too : https://snipboard.io/jQepzP.jpg
Can you help me ?

@jaskipper
Copy link
Contributor

jaskipper commented Mar 10, 2022

Hi @Kaherdin. At this time, the newest changes that I've incorporated are not in the beta, so if you install from npm/yarn, it won't have the latest changes (@melishev, it would be great if you could look at this and accept the pull request).

The way you can use my latest changes would be the following:

  1. If this plugin is already installed via yarn or npm, uninstall:
yarn remove strapi-plugin-react-editorjs
# or
npm uninstall strapi-plugin-react-editorjs
  1. Go to the ./src/plugins folder (create it if it doesn't exist) and clone the project:
git clone --single-branch --branch beta-v4 https://github.com/jaskipper/strapi-plugin-react-editorjs.git
  1. Go into the plugin and install dependencies:
    • cd strapi-plugin-react-editorjs
    • yarn install or npm install
  2. In an editor add the following code into the main Strapi v4 ./config/plugins.js file (create the file if it doesn't exist)
module.exports = ({ env }) => ({
  // ...
  'react-editorjs': {
    enabled: true,
    resolve: './src/plugins/strapi-plugin-react-editorjs'
  },
  // ...
})

In order for Strapi to show the Link Tool thumbnails correctly, you will need to edit the 'strapi::security' line in ./config/middlewares.js. Change that line to the following (do this at your own risk).

module.exports = [
  // ...
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        directives: {
          'img-src': ['*'],
        },
      }
    },
  },
  // ...
];

@melishev
Copy link
Owner

@jaskipper - Thanks for your answer and help to the community
@Kaherdin - Yes, the current version of the beta is a little unstable (that's why it is beta), in the coming days we will release a new update that will fix many bugs

@melishev melishev linked a pull request Mar 11, 2022 that will close this issue
@melishev
Copy link
Owner

melishev commented Mar 13, 2022

@Kaherdin
Well, the bot didn't send out an automatic beta update message, so I do it. Please check if your issue is fixed in the new beta version⚠️.

@Kaherdin
Copy link
Author

Thanks !! The version 2.0.0-beta.2 is working fine with v4 ! I'm struggling to customize it, it didn't work anymore with strapi V4 to make a copy of customTools to extensions folder.

@jaskipper
Copy link
Contributor

jaskipper commented Mar 17, 2022

Hi @Kaherdin. So glad to hear that it is working well! Yes, the old way of customizing doesn't work in v4. I've written some instructions in the beta readme on how to customize in v4. See the section "How to extend/develop this plugin (optional)" here: https://github.com/melishev/strapi-plugin-react-editorjs/tree/beta. You'll need to clone the beta branch. If I find a better way, I'll update. If anyone else knows a better way, let us know!

@Kaherdin
Copy link
Author

Yes, I will use patch-package for this. I really think it's easier.
I wanted to add more addon, like ColorPlugin, what I did :

  1. Make my modification in /node_modules/strapi-plugin-react-editorjs/.../customTools.js
  2. npx patch-package strapi-plugin-react-editorjs
  3. And then, on build on my server, I run npx patch-package

@jaskipper
Copy link
Contributor

@Kaherdin - Interesting. I'll check that out. I'm assuming changes don't persist if you were to update to a newer version that comes out in the future, is that right?

@Kaherdin
Copy link
Author

It will generate a diff and also check if there is an update and/or conflict. So it can work with newer version

@jaskipper
Copy link
Contributor

@Kaherdin, awesome! I still would like to find a way that is similar to how it was done in Strapi 3. However using patch-package does sound easier and promising. Thanks for the info!

@melishev
Copy link
Owner

Well, since this issue has been resolved, then I will close it, if there are problems on this topic again, feel free to write about it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants