This repository has been archived by the owner on Dec 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: updates to allow Strapi v4 functionality
BREAKING CHANGE: This update refactors the plugin to work in Strapi v4. This code will not work in Strapi v3. At this time, the Image tool is not functioning. The link tool works, but thumbnails are being blocked by Strapi 4's contentSecurityPolicy. The current workaround for this is to replace the 'strapi::security' default export in ./config/middlewares.js to the following code (do this at your own risk): "{ name: 'strapi::security', config: { contentSecurityPolicy: false }, }," I've yet to find a solution that can be baked into the plugin itself. I have also added "auth: false" to the routes config so that it is not necessary to give authenticated and public permissions to the plugin. This may need to be removed if it is seen as a security risk. Custom styles have been added to Wysiwyg/wrapper.js for headers (H1-H6) because Strapi resets styles and there is no styling for the plugin without them. I have updated editorjs to 2.23.2 and several other of the plugins (see package.json). I've also added @buffetjs/core and @buffetjs/styles to package.json because the library is not in Strapi now. I also removed "axios" because that library is in Strapi. I updated node to the following: "node": ">=10.16.0 <=16.x.x"
- Loading branch information
Jason Skipper
committed
Feb 23, 2022
1 parent
9a70744
commit 72b4913
Showing
17 changed files
with
1,212 additions
and
233 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,74 @@ | ||
import styled from 'styled-components'; | ||
import { Box } from "@strapi/design-system/Box"; | ||
|
||
const Wrapper = styled.div` | ||
padding-bottom: 2.8rem; | ||
font-size: 1.3rem; | ||
font-family: 'Lato'; | ||
label { | ||
display: block; | ||
margin-bottom: 1rem; | ||
} | ||
&.bordered { | ||
.editorWrapper { | ||
border-color: red; | ||
} | ||
} | ||
> div + p { | ||
width: 100%; | ||
padding-top: 12px; | ||
font-size: 1.2rem; | ||
line-height: normal; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
margin-bottom: -9px; | ||
} | ||
const Wrapper = styled(Box)` | ||
@media (min-width: 651px) { | ||
.codex-editor--narrow .codex-editor__redactor { | ||
margin-right: 0; | ||
} | ||
} | ||
.codex-editor { | ||
padding: 1rem; | ||
} | ||
*:focus-visible { | ||
outline: none; | ||
} | ||
h1 { | ||
font-size: 2.5rem; | ||
font-weight: bold; | ||
} | ||
h2 { | ||
font-size: 1.5em; | ||
font-weight: bold; | ||
} | ||
h3 { | ||
font-size: 1.17em; | ||
font-weight: bold; | ||
} | ||
h4 { | ||
font-size: 1em; | ||
font-weight: bold; | ||
} | ||
h5 { | ||
font-size: .83em; | ||
font-weight: bold; | ||
} | ||
h6 { | ||
font-size: .67em; | ||
font-weight: bold; | ||
} | ||
padding-bottom: 2.8rem; | ||
font-size: 1rem; | ||
font-family: "Lato"; | ||
label { | ||
display: block; | ||
margin-bottom: 1rem; | ||
} | ||
&.bordered { | ||
.editorWrapper { | ||
border-color: red; | ||
} | ||
} | ||
> div + p { | ||
width: 100%; | ||
padding-top: 12px; | ||
font-size: 1.2rem; | ||
line-height: normal; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
margin-bottom: -9px; | ||
} | ||
div, | ||
pre, | ||
code { | ||
::-webkit-scrollbar { | ||
height: 5px; | ||
width: 5px; | ||
cursor: default; | ||
} | ||
} | ||
div, | ||
pre, | ||
code { | ||
::-webkit-scrollbar { | ||
height: 5px; | ||
width: 5px; | ||
cursor: default; | ||
} | ||
} | ||
`; | ||
|
||
export default Wrapper; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
const pluginPkg = require('../../package.json'); | ||
const pluginId = pluginPkg.name.replace( | ||
/*const pluginId = pluginPkg.name.replace( | ||
/^strapi-plugin-/i, | ||
'' | ||
); | ||
);*/ | ||
const pluginId = pluginPkg.name; | ||
|
||
module.exports = pluginId; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.