@translationstudio/translationstudio-strapi-extension 2.1.0 → 4.0.1
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/README.md +1 -1
- package/dist/Types.d.ts +36 -0
- package/dist/_chunks/App-5ldte7Ku.js +331 -0
- package/dist/_chunks/App-DQUxEmfa.mjs +331 -0
- package/dist/_chunks/HistoryPage-C1EG7XIt.js +1082 -0
- package/dist/_chunks/HistoryPage-Cwm3HJc9.mjs +1082 -0
- package/dist/_chunks/index-DF5d8Feh.mjs +835 -0
- package/dist/_chunks/index-DkASHLO0.js +834 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/src/components/BulkTranslationMenu.d.ts +3 -0
- package/dist/admin/src/components/BulkTranslationPanel.d.ts +3 -0
- package/dist/admin/src/components/EntryHistory.d.ts +3 -0
- package/dist/admin/src/components/HistoryIcon.d.ts +2 -0
- package/dist/admin/src/components/HistoryMenu.d.ts +2 -0
- package/dist/admin/src/components/LoadingSpinner.d.ts +4 -0
- package/dist/admin/src/components/SettingsIcon.d.ts +2 -0
- package/dist/admin/src/components/TranslationstudioLogo.d.ts +2 -0
- package/dist/admin/src/components/utils/alertUtils.d.ts +13 -0
- package/dist/admin/src/components/utils/dateUtils.d.ts +1 -0
- package/dist/admin/src/components/utils/emailUtils.d.ts +2 -0
- package/dist/admin/src/components/utils/entryUtils.d.ts +2 -0
- package/dist/admin/src/components/utils/filterAndTransformContentTypes.d.ts +2 -0
- package/dist/admin/src/components/utils/formatDate.d.ts +1 -0
- package/dist/admin/src/components/utils/getEntryHelper.d.ts +3 -0
- package/dist/admin/src/components/utils/handleHistoryResponse.d.ts +5 -0
- package/dist/admin/src/components/utils/historyDataUtils.d.ts +13 -0
- package/dist/admin/src/components/utils/historyStatusUtils.d.ts +7 -0
- package/dist/admin/src/components/utils/searchUtils.d.ts +2 -0
- package/dist/admin/src/components/utils/sortUtils.d.ts +9 -0
- package/dist/admin/src/components/utils/statusHelper.d.ts +6 -0
- package/dist/admin/src/components/utils/theme.d.ts +15 -0
- package/dist/admin/src/components/utils/translationUtils.d.ts +5 -0
- package/dist/admin/src/components/utils/useDebounce.d.ts +1 -0
- package/dist/admin/src/pages/HistoryPage.d.ts +2 -0
- package/dist/server/index.js +50 -29
- package/dist/server/index.mjs +50 -29
- package/dist/server/src/controllers/controller.d.ts +1 -1
- package/dist/server/src/controllers/index.d.ts +1 -1
- package/dist/server/src/index.d.ts +2 -4
- package/dist/server/src/services/functions/importData/transformFieldsToData.d.ts +1 -1
- package/dist/server/src/services/index.d.ts +1 -3
- package/dist/server/src/services/service.d.ts +1 -3
- package/package.json +23 -21
- package/dist/_chunks/App-Hb9oaG2M.mjs +0 -337
- package/dist/_chunks/App-v67y1hUs.js +0 -337
- package/dist/_chunks/index-BgsAgrFL.mjs +0 -345
- package/dist/_chunks/index-ehPijnQ-.js +0 -344
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ Follow these steps:
|
|
|
24
24
|
2. run `npm install` (if there are errors, add `--legacy-peer-deps`)
|
|
25
25
|
3. run `npm run watch:link` in this folder
|
|
26
26
|
4. Create a new strapi project and enter the folder
|
|
27
|
-
5. run `npx yalc add --link
|
|
27
|
+
5. run `npx yalc add --link @translationstudio/translationstudio-strapi-extension`
|
|
28
28
|
6. start strapi in development mode
|
|
29
29
|
|
|
30
30
|
### Publish package update
|
package/dist/Types.d.ts
CHANGED
|
@@ -143,3 +143,39 @@ export interface ImportPayload {
|
|
|
143
143
|
keep?: TranslatedDocumentReplaceFields;
|
|
144
144
|
}[];
|
|
145
145
|
}
|
|
146
|
+
export interface HistoryItem {
|
|
147
|
+
'time-intranslation': number;
|
|
148
|
+
'project-name': string;
|
|
149
|
+
'time-imported': number;
|
|
150
|
+
'element-uid': string;
|
|
151
|
+
'target-language': string;
|
|
152
|
+
'time-updated': number;
|
|
153
|
+
'element-name': string;
|
|
154
|
+
'time-requested': number;
|
|
155
|
+
}
|
|
156
|
+
export interface ContentType {
|
|
157
|
+
uid: string;
|
|
158
|
+
displayName: string;
|
|
159
|
+
kind: string;
|
|
160
|
+
}
|
|
161
|
+
export interface Entry {
|
|
162
|
+
id: string;
|
|
163
|
+
documentId: string;
|
|
164
|
+
title?: string;
|
|
165
|
+
name?: string;
|
|
166
|
+
headline?: string;
|
|
167
|
+
[key: string]: any;
|
|
168
|
+
}
|
|
169
|
+
export interface BulkTranslationMenuProps {
|
|
170
|
+
historyData: HistoryItem[];
|
|
171
|
+
isLoadingHistory: boolean;
|
|
172
|
+
onTranslationComplete?: () => void;
|
|
173
|
+
}
|
|
174
|
+
export interface BulkTranslationPanelProps {
|
|
175
|
+
contentType: ContentType | undefined;
|
|
176
|
+
selectedEntries: string[];
|
|
177
|
+
onTranslationComplete: () => void;
|
|
178
|
+
}
|
|
179
|
+
export interface EntryHistoryProps {
|
|
180
|
+
entryUid?: string;
|
|
181
|
+
}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const admin = require("@strapi/strapi/admin");
|
|
5
|
+
const reactRouterDom = require("react-router-dom");
|
|
6
|
+
const designSystem = require("@strapi/design-system");
|
|
7
|
+
const react = require("react");
|
|
8
|
+
const index = require("./index-DkASHLO0.js");
|
|
9
|
+
const apiService = {
|
|
10
|
+
async loadLicense(get) {
|
|
11
|
+
try {
|
|
12
|
+
const response = await get("/translationstudio/getLicense");
|
|
13
|
+
return response.data?.license || "";
|
|
14
|
+
} catch (err) {
|
|
15
|
+
console.error(err);
|
|
16
|
+
return "";
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
async loadDevUrl(get) {
|
|
20
|
+
try {
|
|
21
|
+
const response = await get("/translationstudio/devurl");
|
|
22
|
+
return response.data?.url || "";
|
|
23
|
+
} catch (err) {
|
|
24
|
+
console.error(err);
|
|
25
|
+
return "";
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
async updateDevUrl(post, url) {
|
|
29
|
+
try {
|
|
30
|
+
const response = await post("/translationstudio/devurl", { url });
|
|
31
|
+
return response.data?.success || false;
|
|
32
|
+
} catch (err) {
|
|
33
|
+
console.error(err);
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const styles = {
|
|
39
|
+
textInput: {
|
|
40
|
+
width: "90%",
|
|
41
|
+
display: "inline-block"
|
|
42
|
+
},
|
|
43
|
+
button: {
|
|
44
|
+
backgroundColor: "#e94642",
|
|
45
|
+
border: "none",
|
|
46
|
+
paddingTop: "0.6em",
|
|
47
|
+
paddingBottom: "0.6em"
|
|
48
|
+
},
|
|
49
|
+
tab: {
|
|
50
|
+
color: "#e94642",
|
|
51
|
+
cursor: "pointer",
|
|
52
|
+
textDecoration: "none",
|
|
53
|
+
fontSize: "18px",
|
|
54
|
+
fontWeight: "600"
|
|
55
|
+
},
|
|
56
|
+
activeTab: {
|
|
57
|
+
textDecoration: "underline"
|
|
58
|
+
},
|
|
59
|
+
inactiveTab: {
|
|
60
|
+
opacity: 0.7
|
|
61
|
+
},
|
|
62
|
+
alert: {
|
|
63
|
+
position: "fixed",
|
|
64
|
+
top: "10%",
|
|
65
|
+
left: "50%",
|
|
66
|
+
transform: "translate(-50%, -50%)",
|
|
67
|
+
zIndex: 10,
|
|
68
|
+
minWidth: "400px",
|
|
69
|
+
maxWidth: "90%"
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const SettingsPage = () => {
|
|
73
|
+
const [licenseValue, setLicenseValue] = react.useState("");
|
|
74
|
+
const [tokenValue, setTokenValue] = react.useState("");
|
|
75
|
+
const [devUrl, setDevUrl] = react.useState("");
|
|
76
|
+
const [isLoading, setIsLoading] = react.useState(true);
|
|
77
|
+
const [isLoadingToken, setIsLoadingToken] = react.useState(false);
|
|
78
|
+
const [showDevOptions, setShowDevOptions] = react.useState(false);
|
|
79
|
+
const [showAlert, setShowAlert] = react.useState(false);
|
|
80
|
+
const [alertType, setAlertType] = react.useState("success");
|
|
81
|
+
const [alertMessage, setAlertMessage] = react.useState("");
|
|
82
|
+
const { get, post } = admin.getFetchClient();
|
|
83
|
+
const displayAlert = react.useCallback((variant, message) => {
|
|
84
|
+
const defaultMessage = variant === "success" ? "License saved" : "Error saving license";
|
|
85
|
+
setAlertType(variant);
|
|
86
|
+
setAlertMessage(message || defaultMessage);
|
|
87
|
+
setShowAlert(true);
|
|
88
|
+
setTimeout(() => setShowAlert(false), 5e3);
|
|
89
|
+
}, []);
|
|
90
|
+
react.useEffect(() => {
|
|
91
|
+
const loadInitialData = async () => {
|
|
92
|
+
setIsLoading(true);
|
|
93
|
+
try {
|
|
94
|
+
const [license, devUrlData] = await Promise.all([
|
|
95
|
+
apiService.loadLicense(get),
|
|
96
|
+
apiService.loadDevUrl(get)
|
|
97
|
+
]);
|
|
98
|
+
if (license) setLicenseValue(license);
|
|
99
|
+
if (devUrlData) {
|
|
100
|
+
setDevUrl(devUrlData);
|
|
101
|
+
setShowDevOptions(true);
|
|
102
|
+
}
|
|
103
|
+
} catch (err) {
|
|
104
|
+
console.error("Failed to load initial data:", err);
|
|
105
|
+
} finally {
|
|
106
|
+
setIsLoading(false);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
loadInitialData();
|
|
110
|
+
}, [setIsLoading, setDevUrl, setLicenseValue, setShowDevOptions]);
|
|
111
|
+
react.useEffect(() => {
|
|
112
|
+
const fetchToken = async () => {
|
|
113
|
+
setIsLoadingToken(true);
|
|
114
|
+
try {
|
|
115
|
+
const response = await get("/translationstudio/getToken");
|
|
116
|
+
setTokenValue(response.data?.token || "");
|
|
117
|
+
} catch (err) {
|
|
118
|
+
console.error(err);
|
|
119
|
+
} finally {
|
|
120
|
+
setIsLoadingToken(false);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
fetchToken();
|
|
124
|
+
}, []);
|
|
125
|
+
const handleLicenseChange = react.useCallback((e) => {
|
|
126
|
+
setLicenseValue(e.target.value.trim());
|
|
127
|
+
}, []);
|
|
128
|
+
const handleSaveLicense = react.useCallback(async () => {
|
|
129
|
+
try {
|
|
130
|
+
await post("/translationstudio/setLicense", { license: licenseValue });
|
|
131
|
+
displayAlert("success");
|
|
132
|
+
} catch (err) {
|
|
133
|
+
console.error(err);
|
|
134
|
+
displayAlert("danger");
|
|
135
|
+
}
|
|
136
|
+
}, [post, licenseValue, displayAlert]);
|
|
137
|
+
const handleGenerateToken = react.useCallback(async () => {
|
|
138
|
+
setIsLoadingToken(true);
|
|
139
|
+
try {
|
|
140
|
+
const response = await post("/translationstudio/generateToken");
|
|
141
|
+
if (response.data?.token) {
|
|
142
|
+
setTokenValue(response.data.token);
|
|
143
|
+
}
|
|
144
|
+
} catch (err) {
|
|
145
|
+
console.error(err);
|
|
146
|
+
} finally {
|
|
147
|
+
setIsLoadingToken(false);
|
|
148
|
+
}
|
|
149
|
+
}, [post]);
|
|
150
|
+
const handleUpdateUrl = react.useCallback(async () => {
|
|
151
|
+
setIsLoading(true);
|
|
152
|
+
try {
|
|
153
|
+
await apiService.updateDevUrl(post, devUrl);
|
|
154
|
+
if (devUrl === "") setShowDevOptions(false);
|
|
155
|
+
} finally {
|
|
156
|
+
setIsLoading(false);
|
|
157
|
+
}
|
|
158
|
+
}, [post, devUrl]);
|
|
159
|
+
const handleDevOptionsToggle = react.useCallback(
|
|
160
|
+
(val) => {
|
|
161
|
+
if (val) {
|
|
162
|
+
setShowDevOptions(val);
|
|
163
|
+
} else {
|
|
164
|
+
apiService.updateDevUrl(post, "").finally(() => setShowDevOptions(val));
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
[post]
|
|
168
|
+
);
|
|
169
|
+
const ActionButton = ({
|
|
170
|
+
onClick,
|
|
171
|
+
disabled,
|
|
172
|
+
loading,
|
|
173
|
+
children,
|
|
174
|
+
icon
|
|
175
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
176
|
+
designSystem.Button,
|
|
177
|
+
{
|
|
178
|
+
onClick,
|
|
179
|
+
disabled,
|
|
180
|
+
loading,
|
|
181
|
+
style: styles.button,
|
|
182
|
+
size: "L",
|
|
183
|
+
startIcon: icon,
|
|
184
|
+
children
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
const LinkText = ({ href, children }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
188
|
+
"a",
|
|
189
|
+
{
|
|
190
|
+
href,
|
|
191
|
+
target: "_blank",
|
|
192
|
+
rel: "noopener noreferrer",
|
|
193
|
+
style: { textDecoration: "none", color: "#e94642" },
|
|
194
|
+
children
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { children: [
|
|
198
|
+
showAlert && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: styles.alert, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Alert, { closeLabel: "Close", variant: alertType, onClose: () => setShowAlert(false), children: alertMessage }) }),
|
|
199
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 10, style: { minHeight: "90vh", marginTop: "5vh" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { children: [
|
|
200
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { textAlign: "right", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
201
|
+
"picture",
|
|
202
|
+
{
|
|
203
|
+
style: {
|
|
204
|
+
width: "150px",
|
|
205
|
+
height: "auto",
|
|
206
|
+
display: "inline-block"
|
|
207
|
+
},
|
|
208
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index.TranslationstudioLogo, {})
|
|
209
|
+
}
|
|
210
|
+
) }) }),
|
|
211
|
+
/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
212
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 12, style: { paddingTop: "2em" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", children: "translationstudio License" }) }),
|
|
213
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 12, style: { paddingBottom: "1em" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "charlie", children: [
|
|
214
|
+
"You can create or revoke a license at",
|
|
215
|
+
" ",
|
|
216
|
+
/* @__PURE__ */ jsxRuntime.jsx(LinkText, { href: "https://account.translationstudio.tech/", children: "account.translationstudio.tech" })
|
|
217
|
+
] }) }),
|
|
218
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 10, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "block", width: "95%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
219
|
+
designSystem.TextInput,
|
|
220
|
+
{
|
|
221
|
+
name: "jwt-token",
|
|
222
|
+
label: "JWT Token",
|
|
223
|
+
placeholder: "Paste your Strapi translationstudio license into this field and click save to apply it to this project",
|
|
224
|
+
value: licenseValue,
|
|
225
|
+
onChange: handleLicenseChange,
|
|
226
|
+
disabled: isLoading,
|
|
227
|
+
style: styles.textInput
|
|
228
|
+
}
|
|
229
|
+
) }) }),
|
|
230
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 2, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
231
|
+
ActionButton,
|
|
232
|
+
{
|
|
233
|
+
onClick: handleSaveLicense,
|
|
234
|
+
disabled: isLoading,
|
|
235
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
236
|
+
"path",
|
|
237
|
+
{
|
|
238
|
+
d: "M21,20V8.414a1,1,0,0,0-.293-.707L16.293,3.293A1,1,0,0,0,15.586,3H4A1,1,0,0,0,3,4V20a1,1,0,0,0,1,1H20A1,1,0,0,0,21,20ZM9,8h6V6h1v3H8V6H9ZM8,18V14h8v4Z",
|
|
239
|
+
fill: "currentColor"
|
|
240
|
+
}
|
|
241
|
+
) }),
|
|
242
|
+
children: "Save license"
|
|
243
|
+
}
|
|
244
|
+
) }),
|
|
245
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 12, style: { paddingTop: "3em" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", children: "Authorize translationstudio requests" }) }),
|
|
246
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 12, style: { paddingBottom: "1em" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "charlie", children: "When translationstudio connects with this plugin it will use the following access key to authorize itself." }) }),
|
|
247
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 10, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "block", width: "95%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
248
|
+
designSystem.TextInput,
|
|
249
|
+
{
|
|
250
|
+
name: "access-token",
|
|
251
|
+
label: "Access Key",
|
|
252
|
+
placeholder: "Generate an access key to validate incoming requests",
|
|
253
|
+
value: tokenValue,
|
|
254
|
+
onChange: () => {
|
|
255
|
+
},
|
|
256
|
+
disabled: true,
|
|
257
|
+
style: styles.textInput
|
|
258
|
+
}
|
|
259
|
+
) }) }),
|
|
260
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 2, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
261
|
+
ActionButton,
|
|
262
|
+
{
|
|
263
|
+
onClick: handleGenerateToken,
|
|
264
|
+
disabled: isLoadingToken,
|
|
265
|
+
loading: isLoadingToken,
|
|
266
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
267
|
+
"path",
|
|
268
|
+
{
|
|
269
|
+
d: "M12 4V1L8 5L12 9V6C15.31 6 18 8.69 18 12C18 13.01 17.75 13.97 17.3 14.8L18.76 16.26C19.54 15.03 20 13.57 20 12C20 7.58 16.42 4 12 4ZM12 18C8.69 18 6 15.31 6 12C6 10.99 6.25 10.03 6.7 9.2L5.24 7.74C4.46 8.97 4 10.43 4 12C4 16.42 7.58 20 12 20V23L16 19L12 15V18Z",
|
|
270
|
+
fill: "currentColor"
|
|
271
|
+
}
|
|
272
|
+
) }),
|
|
273
|
+
children: isLoadingToken ? "Generating..." : tokenValue ? "New access key" : "Create access key"
|
|
274
|
+
}
|
|
275
|
+
) }),
|
|
276
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 12, style: { paddingTop: "5em" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", children: "Customization" }) }),
|
|
277
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 12, style: { paddingBottom: "1em" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "charlie", children: "You will not need these settings, but you might want to customize your translationstudio instance." }) }),
|
|
278
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
279
|
+
designSystem.Switch,
|
|
280
|
+
{
|
|
281
|
+
checked: showDevOptions,
|
|
282
|
+
onCheckedChange: () => handleDevOptionsToggle(!showDevOptions),
|
|
283
|
+
onLabel: "Use custom translationstudio URL",
|
|
284
|
+
offLabel: "Custom translationstudio URL is currently disabled (default)",
|
|
285
|
+
visibleLabels: true
|
|
286
|
+
}
|
|
287
|
+
) }),
|
|
288
|
+
showDevOptions && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
289
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 12, style: { paddingTop: "2em" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", children: "Use custom translationstudio URL." }) }),
|
|
290
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 12, style: { paddingBottom: "1em" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", children: "This is usually only necessary for development purposes." }) }),
|
|
291
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 10, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "block", width: "95%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
292
|
+
designSystem.TextInput,
|
|
293
|
+
{
|
|
294
|
+
onChange: (e) => setDevUrl(e.target.value.trim()),
|
|
295
|
+
name: "devurl",
|
|
296
|
+
label: "Custom translationstudio url",
|
|
297
|
+
placeholder: "Paste your custom translationstudio url here",
|
|
298
|
+
value: devUrl,
|
|
299
|
+
style: styles.textInput
|
|
300
|
+
}
|
|
301
|
+
) }) }),
|
|
302
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 2, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
303
|
+
ActionButton,
|
|
304
|
+
{
|
|
305
|
+
onClick: handleUpdateUrl,
|
|
306
|
+
disabled: isLoading,
|
|
307
|
+
loading: isLoading,
|
|
308
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 5V19L19 12L8 5Z", fill: "currentColor" }) }),
|
|
309
|
+
children: "Update URL"
|
|
310
|
+
}
|
|
311
|
+
) })
|
|
312
|
+
] }),
|
|
313
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { xs: 12, style: { paddingTop: "4em" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "sigma", style: { textAlign: "right" }, children: [
|
|
314
|
+
"If you do not have a translationstudio account, please create one at",
|
|
315
|
+
" ",
|
|
316
|
+
/* @__PURE__ */ jsxRuntime.jsx(LinkText, { href: "https://account.translationstudio.tech/", children: "account.translationstudio.tech" }),
|
|
317
|
+
". You can find further information at",
|
|
318
|
+
" ",
|
|
319
|
+
/* @__PURE__ */ jsxRuntime.jsx(LinkText, { href: "https://www.translationstudio.tech/", children: "translationstudio.tech" })
|
|
320
|
+
] }) })
|
|
321
|
+
] })
|
|
322
|
+
] }) })
|
|
323
|
+
] });
|
|
324
|
+
};
|
|
325
|
+
const App = () => {
|
|
326
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
|
|
327
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: /* @__PURE__ */ jsxRuntime.jsx(SettingsPage, {}) }),
|
|
328
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "*", element: /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Error, {}) })
|
|
329
|
+
] });
|
|
330
|
+
};
|
|
331
|
+
exports.App = App;
|