@vonaffenfels/contentful-slate-editor 1.1.34 → 1.1.36

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonaffenfels/contentful-slate-editor",
3
- "version": "1.1.34",
3
+ "version": "1.1.36",
4
4
  "scripts": {
5
5
  "prepublish": "yarn run build",
6
6
  "dev": "yarn run start",
@@ -95,10 +95,10 @@
95
95
  "webpack-watch-files-plugin": "^1.2.1"
96
96
  },
97
97
  "dependencies": {
98
- "@vonaffenfels/slate-editor": "^1.1.34",
98
+ "@vonaffenfels/slate-editor": "^1.1.36",
99
99
  "webpack": "5.88.2"
100
100
  },
101
- "gitHead": "1e3ea5ff0c721c70b372b3507f1c2ee1f4ff270c",
101
+ "gitHead": "c55640e4184996f5503928a6e1f990c3b4420a52",
102
102
  "publishConfig": {
103
103
  "access": "public"
104
104
  }
@@ -11,6 +11,7 @@ import {css} from 'emotion';
11
11
  const Config = ({sdk}) => {
12
12
  const [params, setParams] = useState({
13
13
  translationService: "",
14
+ translationServiceKey: "",
14
15
  usersWithTranslation: [],
15
16
  });
16
17
  const [spaceUsers, setSpaceUsers] = useState([]);
@@ -104,6 +105,12 @@ const Config = ({sdk}) => {
104
105
  labelText="Translation Service URL"
105
106
  required
106
107
  />
108
+ <TextField
109
+ value={params.translationServiceKey}
110
+ onChange={e => onFieldChanged(e.target.value, "translationServiceKey")}
111
+ labelText="Translation Service API Key"
112
+ required
113
+ />
107
114
  </Form>
108
115
  </Workbench>
109
116
  );
@@ -27,6 +27,7 @@ export const DialogTranslation = ({
27
27
  try {
28
28
  const response = await fetch(sdk?.parameters?.installation?.translationService + "/usage", {
29
29
  method: "POST",
30
+ headers: {"X-Api-Key": sdk?.parameters?.installation?.translationServiceKey},
30
31
  body: JSON.stringify({
31
32
  editorContent: typeof content === "object" ? content : undefined,
32
33
  text: typeof content === "string" ? content : undefined,
@@ -76,6 +77,7 @@ export const DialogTranslation = ({
76
77
  try {
77
78
  const response = await fetch(sdk?.parameters?.installation?.translationService, {
78
79
  method: "POST",
80
+ headers: {"X-Api-Key": sdk?.parameters?.installation?.translationServiceKey},
79
81
  body: JSON.stringify({
80
82
  editorContent: typeof content === "object" ? content : undefined,
81
83
  text: typeof content === "string" ? content : undefined,