@kookaat/strapi-plugin-tinymce 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,22 +3,13 @@ import PropTypes from "prop-types";
|
|
|
3
3
|
import { Editor } from "@tinymce/tinymce-react";
|
|
4
4
|
import { request } from "@strapi/helper-plugin";
|
|
5
5
|
import pluginId from "../../pluginId";
|
|
6
|
-
// import taskRequests from "../../api/settings";
|
|
7
6
|
import { prefixFileUrlWithBackendUrl } from "@strapi/helper-plugin";
|
|
8
7
|
|
|
9
8
|
const TinyEditor = ({ onChange, name, value }) => {
|
|
10
9
|
const [pluginConfig, setPluginConfig] = useState();
|
|
11
|
-
// const [apiKey, setApiKey] = useState("");
|
|
12
|
-
const [loading, setLoading] = useState(true);
|
|
13
10
|
const uploadUrl = `${prefixFileUrlWithBackendUrl("/api/upload")}`;
|
|
14
11
|
|
|
15
12
|
useEffect(() => {
|
|
16
|
-
// const getApiKey = async () => {
|
|
17
|
-
// const data = await taskRequests.getSettings();
|
|
18
|
-
// if (data) {
|
|
19
|
-
// return setApiKey(data.data.apiKey);
|
|
20
|
-
// }
|
|
21
|
-
// };
|
|
22
13
|
const getPluginConfig = async () => {
|
|
23
14
|
const editor = await request(`/${pluginId}/config/editor`, {
|
|
24
15
|
method: "GET",
|
|
@@ -27,17 +18,13 @@ const TinyEditor = ({ onChange, name, value }) => {
|
|
|
27
18
|
setPluginConfig(editor);
|
|
28
19
|
}
|
|
29
20
|
};
|
|
30
|
-
// getApiKey().then(() => {
|
|
31
|
-
// setLoading(false)
|
|
32
|
-
// });
|
|
33
21
|
getPluginConfig();
|
|
34
22
|
}, []);
|
|
35
23
|
|
|
36
24
|
return (
|
|
37
|
-
|
|
25
|
+
pluginConfig ?
|
|
38
26
|
<Editor
|
|
39
27
|
tinymceScriptSrc={pluginConfig?.tinymceScriptSrc}
|
|
40
|
-
// apiKey={apiKey || ""}
|
|
41
28
|
value={value}
|
|
42
29
|
tagName={name}
|
|
43
30
|
onEditorChange={(editorContent) => {
|
package/admin/src/pluginId.js
CHANGED