@translationstudio/translationstudio-strapi-extension 2.0.2 → 4.0.0

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.
Files changed (46) hide show
  1. package/README.md +1 -1
  2. package/dist/Types.d.ts +36 -0
  3. package/dist/_chunks/App-BR-y9Q87.js +331 -0
  4. package/dist/_chunks/App-Cc3EklWX.mjs +331 -0
  5. package/dist/_chunks/HistoryPage-BG_RchOk.js +1057 -0
  6. package/dist/_chunks/HistoryPage-CSMW8AED.mjs +1057 -0
  7. package/dist/_chunks/index-B9kFLfY3.js +834 -0
  8. package/dist/_chunks/index-ChM8Lw4L.mjs +835 -0
  9. package/dist/admin/index.js +2 -344
  10. package/dist/admin/index.mjs +2 -344
  11. package/dist/admin/src/components/BulkTranslationMenu.d.ts +3 -0
  12. package/dist/admin/src/components/BulkTranslationPanel.d.ts +3 -0
  13. package/dist/admin/src/components/EntryHistory.d.ts +3 -0
  14. package/dist/admin/src/components/HistoryIcon.d.ts +2 -0
  15. package/dist/admin/src/components/HistoryMenu.d.ts +2 -0
  16. package/dist/admin/src/components/LoadingSpinner.d.ts +4 -0
  17. package/dist/admin/src/components/SettingsIcon.d.ts +2 -0
  18. package/dist/admin/src/components/TranslationstudioLogo.d.ts +2 -0
  19. package/dist/admin/src/components/utils/alertUtils.d.ts +13 -0
  20. package/dist/admin/src/components/utils/dateUtils.d.ts +1 -0
  21. package/dist/admin/src/components/utils/emailUtils.d.ts +2 -0
  22. package/dist/admin/src/components/utils/entryUtils.d.ts +2 -0
  23. package/dist/admin/src/components/utils/filterAndTransformContentTypes.d.ts +2 -0
  24. package/dist/admin/src/components/utils/formatDate.d.ts +1 -0
  25. package/dist/admin/src/components/utils/getEntryHelper.d.ts +3 -0
  26. package/dist/admin/src/components/utils/handleHistoryResponse.d.ts +5 -0
  27. package/dist/admin/src/components/utils/historyDataUtils.d.ts +13 -0
  28. package/dist/admin/src/components/utils/historyStatusUtils.d.ts +7 -0
  29. package/dist/admin/src/components/utils/searchUtils.d.ts +2 -0
  30. package/dist/admin/src/components/utils/sortUtils.d.ts +9 -0
  31. package/dist/admin/src/components/utils/statusHelper.d.ts +6 -0
  32. package/dist/admin/src/components/utils/theme.d.ts +15 -0
  33. package/dist/admin/src/components/utils/translationUtils.d.ts +5 -0
  34. package/dist/admin/src/components/utils/useDebounce.d.ts +1 -0
  35. package/dist/admin/src/pages/HistoryPage.d.ts +2 -0
  36. package/dist/server/index.js +50 -29
  37. package/dist/server/index.mjs +50 -29
  38. package/dist/server/src/controllers/controller.d.ts +1 -1
  39. package/dist/server/src/controllers/index.d.ts +1 -1
  40. package/dist/server/src/index.d.ts +2 -4
  41. package/dist/server/src/services/functions/importData/transformFieldsToData.d.ts +1 -1
  42. package/dist/server/src/services/index.d.ts +1 -3
  43. package/dist/server/src/services/service.d.ts +1 -3
  44. package/package.json +23 -21
  45. package/dist/_chunks/App-C5dxwMbx.js +0 -342
  46. package/dist/_chunks/App-DxAbaDu8.mjs +0 -342
@@ -1,342 +0,0 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { getFetchClient, Page } from "@strapi/strapi/admin";
3
- import { Routes, Route } from "react-router-dom";
4
- import { Main, Box, Alert, Grid, Typography, TextInput, Button, Switch } from "@strapi/design-system";
5
- import { useState, useEffect } from "react";
6
- import { ArrowClockwise, Play } from "@strapi/icons";
7
- const TSlogoFarbig = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201444.47%20635.72'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:%23e94642;}.cls-2{fill:%23231f20;}.cls-3{fill:%23a51d78;}%3c/style%3e%3c/defs%3e%3cpath%20class='cls-2'%20d='M1151.68,294.37c34.28,0,50.11,19.74,50.11,59.01v56.4c0,6.94-3.91,10.85-10.85,10.85h-2.6c-6.94,0-10.84-3.9-10.84-10.85v-54.45c0-27.12-10.41-39.91-33.41-39.91s-32.97,15.4-32.97,42.74v51.63c0,6.94-3.91,10.85-10.85,10.85h-2.6c-6.94,0-10.85-3.9-10.85-10.85v-102.39c0-6.94,3.91-10.85,10.85-10.85h2.6c6.94,0,10.85,3.91,10.85,10.85v12.34c5.64-14.39,19.73-25.36,40.56-25.36h0Z'/%3e%3cpath%20class='cls-2'%20d='M0,313.78v55.76c0,37.96,14.53,51.2,46.42,51.2h0c1.96,0,4.12-.03,6.29-.22,6.9-.65,9.8-4.45,9.11-11.07-.61-5.88-4.99-8.24-11.71-8.24-18.88,0-25.6-8.9-25.6-34.49v-52.94h25.81c6.94,0,10.85-3.47,10.85-9.54s-3.9-9.33-10.85-9.33H24.51v-15.83c0-7.59-4.34-11.28-11.93-9.55l-3.04,.65c-6.29,1.3-9.54,5.21-9.54,11.71v31.89Z'/%3e%3cpath%20class='cls-2'%20d='M139.49,295.02c7.38,0,11.06,4.77,10.2,11.71l-.22,1.74c-.65,6.94-4.77,9.54-11.93,9.54-20.39,.43-30.16,15.19-30.16,41.22v50.55c0,6.94-3.9,10.85-10.85,10.85h-2.6c-6.94,0-10.85-3.9-10.85-10.85v-102.39c0-6.94,3.9-10.85,10.85-10.85h2.6c6.94,0,10.85,3.69,10.85,10.41v10.41c3.91-11.07,13.89-22.34,32.1-22.34h0Z'/%3e%3cpath%20class='cls-2'%20d='M259.67,358.59c0-27.12-15.84-43.82-38.83-43.82s-38.4,16.49-38.4,43.82,15.62,44.04,38.83,44.04,38.4-16.7,38.4-44.04m-101.53,0c0-42.74,26.03-64.43,56.84-64.43,19.52,0,36.88,9.54,44.04,26.69v-13.45c0-6.94,3.9-10.85,10.85-10.85h2.6c6.94,0,10.85,3.9,10.85,10.85v102.18c0,6.94-3.9,10.85-10.85,10.85h-2.6c-6.94,0-10.85-3.9-10.85-10.85v-12.58c-6.94,16.7-24.51,26.47-43.82,26.47-30.81,0-57.06-21.91-57.06-64.87'/%3e%3cpath%20class='cls-2'%20d='M380.06,294.37c34.28,0,50.11,19.74,50.11,59.01v56.4c0,6.94-3.91,10.85-10.85,10.85h-2.6c-6.94,0-10.85-3.9-10.85-10.85v-54.45c0-27.12-10.41-39.91-33.41-39.91s-32.98,15.4-32.98,42.74v51.63c0,6.94-3.9,10.85-10.85,10.85h-2.6c-6.94,0-10.85-3.9-10.85-10.85v-102.39c0-6.94,3.91-10.85,10.85-10.85h2.6c6.94,0,10.85,3.91,10.85,10.85v12.34c5.64-14.39,19.73-25.36,40.57-25.36h0Z'/%3e%3cpath%20class='cls-2'%20d='M508.94,422.81c-20.8,0-42.78-8.33-53.19-21.48-4.44-5.61-2.26-11.49,4.99-13.67l2.17-.65c4.75-1.43,8.02-1.28,14.32,4.36,8.65,7.74,20.41,10.61,31.71,10.61,18.05,0,28.81-6.44,28.81-17.36,0-28.63-80.45-5.9-80.45-54.24,0-22.87,23.1-36.01,49.75-36.01,16.09,0,36.22,6.5,47,17.79,5.1,5.33,3.34,11.34-3.68,13.45l-2.17,.65c-5.86,1.76-8.85-.39-14.53-3.84-8.11-4.92-16.87-8.09-26.22-8.09-15.64,0-26.27,5.18-26.27,14.91,0,27.74,81.1,4.51,81.1,54.72,0,23.06-22.28,38.83-53.32,38.83h0Z'/%3e%3cpath%20class='cls-2'%20d='M585.05,409.79v-142.75c0-6.94,3.9-10.85,10.85-10.85h2.82c6.94,0,10.85,3.9,10.85,10.85v142.75c0,6.94-3.91,10.85-10.85,10.85h-2.82c-6.94,0-10.85-3.91-10.85-10.85'/%3e%3cpath%20class='cls-2'%20d='M737.56,358.59c0-27.12-15.84-43.82-38.84-43.82s-38.4,16.49-38.4,43.82,15.62,44.04,38.83,44.04,38.4-16.7,38.4-44.04m-101.53,0c0-42.74,26.03-64.43,56.84-64.43,19.52,0,36.88,9.54,44.04,26.69v-13.45c0-6.94,3.9-10.85,10.85-10.85h2.6c6.94,0,10.85,3.9,10.85,10.85v102.18c0,6.94-3.9,10.85-10.85,10.85h-2.6c-6.94,0-10.85-3.9-10.85-10.85v-12.58c-6.94,16.7-24.51,26.47-43.82,26.47-30.81,0-57.06-21.91-57.06-64.87'/%3e%3cpath%20class='cls-2'%20d='M800.25,315.42v55.76c0,37.96,14.53,51.2,46.42,51.2h0c1.95,0,4.12-.03,6.29-.22,6.89-.65,9.8-4.45,9.11-11.07-.61-5.88-4.99-8.24-11.71-8.24-18.87,0-25.6-8.9-25.6-34.49v-52.94h25.81c6.94,0,10.85-3.47,10.85-9.55s-3.91-9.33-10.85-9.33h-25.81v-15.83c0-7.59-4.34-11.28-11.93-9.54l-3.04,.65c-6.29,1.3-9.55,5.21-9.55,11.71v31.89Z'/%3e%3cpath%20class='cls-2'%20d='M883.72,409.79v-102.4c0-6.94,3.83-10.85,10.65-10.85h2.77c6.82,0,10.65,3.9,10.65,10.85v102.4c0,6.94-3.83,10.85-10.65,10.85h-2.77c-6.81,0-10.65-3.91-10.65-10.85m-2.05-142.96c0-8.24,6.08-13.02,14.32-13.02,7.59,0,14.32,4.77,14.32,13.02s-6.72,13.02-14.32,13.02c-8.24,0-14.32-4.77-14.32-13.02'/%3e%3cpath%20class='cls-2'%20d='M1036.06,358.59c0-27.12-15.62-43.82-38.62-43.82s-38.4,16.49-38.4,43.82,15.4,44.04,38.61,44.04,38.4-16.7,38.4-44.04m-101.31,0c0-44.69,31.02-64.43,62.69-64.43s62.91,19.74,62.91,64.43-31.02,64.87-62.7,64.87-62.91-19.74-62.91-64.87'/%3e%3cpath%20class='cls-2'%20d='M555.77,635.72c-20.98,0-43.14-8.4-53.65-21.66-4.48-5.66-2.27-11.59,5.03-13.78l2.19-.66c4.79-1.44,8.09-1.29,14.43,4.4,8.73,7.81,20.59,10.69,31.98,10.69,18.2,0,29.05-6.49,29.05-17.5,0-28.88-81.14-5.95-81.14-54.7,0-23.07,23.3-36.31,50.17-36.31,16.23,0,36.53,6.55,47.41,17.94,5.14,5.38,3.37,11.43-3.72,13.56l-2.19,.66c-5.91,1.77-8.92-.39-14.66-3.87-8.18-4.96-17.02-8.16-26.45-8.16-15.78,0-26.5,5.22-26.5,15.04,0,27.98,81.79,4.55,81.79,55.18,0,23.26-22.47,39.16-53.78,39.16h0Z'/%3e%3cpath%20class='cls-2'%20d='M639.98,526.42v56.23c0,38.29,14.66,51.63,46.82,51.63h0c1.97,0,4.16-.03,6.34-.22,6.96-.66,9.89-4.49,9.19-11.16-.61-5.93-5.03-8.31-11.81-8.31-19.03,0-25.82-8.97-25.82-34.79v-53.38h26.03c7,0,10.94-3.5,10.94-9.63s-3.94-9.41-10.94-9.41h-26.03v-15.97c0-7.66-4.38-11.38-12.03-9.63l-3.06,.66c-6.34,1.31-9.63,5.25-9.63,11.81v32.16Z'/%3e%3cpath%20class='cls-2'%20d='M826.59,508.39c7,0,10.94,3.94,10.94,10.94v103.27c0,7-3.94,10.94-10.94,10.94h-2.62c-7,0-10.94-3.94-10.94-10.94v-12.45c-5.69,14.51-19.9,25.57-40.91,25.57-34.57,0-50.54-19.91-50.54-59.51v-56.89c0-7,3.94-10.93,10.94-10.93h2.63c7,0,10.94,3.93,10.94,10.93v54.92c0,27.35,10.5,40.26,33.69,40.26s33.26-15.53,33.26-43.1v-52.07c0-7,3.94-10.93,10.94-10.93h2.62Z'/%3e%3cpath%20class='cls-2'%20d='M967.71,570.31c0-27.35-15.75-44.19-39.16-44.19s-38.72,16.63-38.72,44.19,15.75,44.41,39.16,44.41,38.72-16.85,38.72-44.41m-102.39,0c0-43.1,26.25-64.98,57.32-64.98,19.69,0,37.41,9.63,44.41,26.91v-54.26c0-7,3.94-10.94,10.94-10.94h2.62c7,0,10.94,3.94,10.94,10.94v143.74c0,7-3.94,10.94-10.94,10.94h-2.62c-7,0-10.94-3.94-10.94-10.94v-12.69c-7,16.85-24.72,26.69-44.19,26.69-31.07,0-57.54-22.09-57.54-65.41'/%3e%3cpath%20class='cls-2'%20d='M1023.66,623.38v-103.27c0-7,3.87-10.94,10.74-10.94h2.79c6.87,0,10.74,3.94,10.74,10.94v103.27c0,7-3.87,10.94-10.74,10.94h-2.79c-6.87,0-10.74-3.94-10.74-10.94m-2.07-144.18c0-8.31,6.13-13.13,14.44-13.13,7.66,0,14.44,4.81,14.44,13.13s-6.78,13.13-14.44,13.13c-8.31,0-14.44-4.81-14.44-13.13'/%3e%3cpath%20class='cls-2'%20d='M1177.29,570.31c0-27.35-15.75-44.19-38.94-44.19s-38.72,16.63-38.72,44.19,15.53,44.41,38.94,44.41,38.72-16.85,38.72-44.41m-102.17,0c0-45.07,31.29-64.98,63.23-64.98s63.45,19.91,63.45,64.98-31.29,65.41-63.23,65.41-63.45-19.91-63.45-65.41'/%3e%3cpath%20class='cls-3'%20d='M1366.99,177.21c7.75,6.65,16.32,15.32,24.3,26.23,19.82,27.08,29.56,59.09,28.94,95.13-.29,16.74-3.42,30.61-9.31,41.23-.55,1-1.14,1.99-1.74,2.94-1.17,1.86-2.46,3.67-3.82,5.37-3.28,4.11-7.15,7.78-11.48,10.91-.85,.61-1.73,1.21-2.61,1.79-1.77,1.14-3.63,2.22-5.54,3.2-2.85,1.46-5.89,2.76-9.03,3.84-2.08,.72-4.25,1.36-6.44,1.91-6.58,1.65-13.54,2.48-20.67,2.48-19.29,0-36.82-6.22-49.35-17.5-14.34-12.91-21.61-31.67-21.61-55.75,0-30.01,11.74-53.91,31.41-63.94,15.09-7.69,29.61-15.71,41.22-29.17,7.24-8.39,12.46-17.89,15.72-28.67m-14.08-37.87c-3.24,0-6.11,2.04-6.11,5.55h0c.97,42.1-22.01,55.46-47.74,68.58-26.46,13.49-44.63,43.79-44.63,85.51,0,66.7,47.26,97.47,95.17,97.47,8.98,0,17.93-1.05,26.54-3.2,2.87-.72,5.7-1.56,8.49-2.52,4.18-1.45,8.24-3.17,12.16-5.18,2.61-1.34,5.16-2.81,7.63-4.41,1.24-.8,2.45-1.63,3.65-2.49,5.98-4.32,11.44-9.45,16.21-15.43,1.91-2.39,3.71-4.92,5.39-7.58,.84-1.33,1.65-2.7,2.42-4.1,7.76-14,11.99-31.44,12.35-52.56,1.63-95.85-61.94-144.16-87.99-158.76-.99-.56-2.19-.88-3.54-.88h0Z'/%3e%3cpath%20class='cls-1'%20d='M1234.82,24.21c19.29,0,36.82,6.22,49.35,17.5,14.34,12.91,21.61,31.67,21.61,55.75,0,30.01-11.74,53.91-31.41,63.94-15.09,7.69-29.61,15.71-41.22,29.17-7.24,8.39-12.46,17.89-15.72,28.67-7.75-6.65-16.32-15.32-24.3-26.23-19.82-27.08-29.56-59.09-28.94-95.13,.29-16.74,3.42-30.61,9.31-41.23,.55-1,1.14-1.98,1.74-2.93,1.17-1.86,2.46-3.67,3.82-5.37,3.28-4.11,7.15-7.78,11.48-10.91,.85-.61,1.73-1.21,2.61-1.79,1.77-1.14,3.63-2.22,5.54-3.2,2.85-1.46,5.89-2.76,9.03-3.84,2.08-.72,4.25-1.36,6.44-1.91,6.58-1.65,13.54-2.48,20.67-2.48m0-24.21c-8.98,0-17.93,1.05-26.54,3.2-2.87,.72-5.7,1.56-8.49,2.52-4.18,1.45-8.24,3.17-12.16,5.18-2.61,1.34-5.16,2.81-7.63,4.41-1.24,.8-2.45,1.63-3.65,2.49-5.98,4.32-11.44,9.45-16.21,15.43-1.91,2.39-3.71,4.92-5.39,7.58-.84,1.33-1.65,2.7-2.42,4.1-7.76,14-11.99,31.44-12.35,52.56-1.63,95.85,61.94,144.16,87.99,158.76,.99,.56,2.19,.88,3.54,.88,3.24,0,6.11-2.04,6.11-5.55h0c-.97-42.1,22.01-55.46,47.74-68.58,26.46-13.49,44.63-43.79,44.63-85.51,0-66.7-47.26-97.47-95.17-97.47h0Z'/%3e%3c/svg%3e";
8
- async function loadLicense(fnGet) {
9
- try {
10
- const response = await fnGet("/translationstudio/getLicense");
11
- if (typeof response.data?.license === "string")
12
- return response.data.license;
13
- } catch (err) {
14
- console.error(err);
15
- }
16
- return "";
17
- }
18
- async function loadDevUrl(fnGet) {
19
- try {
20
- const response = await fnGet("/translationstudio/devurl");
21
- if (typeof response.data?.url === "string")
22
- return response.data.url;
23
- } catch (err) {
24
- console.error(err);
25
- }
26
- return "";
27
- }
28
- async function updateDevlUrl(fnPost, url) {
29
- try {
30
- const response = await fnPost("/translationstudio/devurl", { url });
31
- if (typeof response.data?.success === "boolean")
32
- return response.data.success;
33
- } catch (err) {
34
- console.error(err);
35
- }
36
- return false;
37
- }
38
- const TextareaStyle = {
39
- color: "grey",
40
- width: "100%",
41
- display: "block",
42
- backgroundColor: "#f6f6f6",
43
- cursor: "default"
44
- };
45
- const BUttonStyle = { backgroundColor: "#e94642", border: "none", paddingTop: "0.6em", paddingBottom: "0.6em" };
46
- const SettingsPage = () => {
47
- const [licenseValue, setLicenseValue] = useState("");
48
- const [isLoading, setIsLoading] = useState(true);
49
- const [tokenValue, setTokenValue] = useState("");
50
- const [isLoadingToken, setIsLoadingToken] = useState(false);
51
- const [showDevOptions, setShowDevOptions] = useState(false);
52
- const [showAlert, setShowAlert] = useState(false);
53
- const [alertType, setAlertType] = useState("success");
54
- const [alertMessage, setAlertMessage] = useState("");
55
- const [devUrl, setDevUrl] = useState("");
56
- const { get, post } = getFetchClient();
57
- useEffect(() => {
58
- const getLicense = async () => {
59
- setIsLoading(true);
60
- const license = await loadLicense(get);
61
- if (license)
62
- setLicenseValue(license);
63
- const dUrl = await loadDevUrl(get);
64
- if (dUrl) {
65
- console.log(dUrl);
66
- setDevUrl(dUrl);
67
- setShowDevOptions(true);
68
- }
69
- setIsLoading(false);
70
- };
71
- getLicense();
72
- }, [setLicenseValue, setDevUrl, setIsLoading, setShowDevOptions]);
73
- useEffect(() => {
74
- const fetchToken = async () => {
75
- setIsLoadingToken(true);
76
- try {
77
- const response = await get("/translationstudio/getToken");
78
- if (response.data.token) {
79
- setTokenValue(response.data.token);
80
- } else {
81
- setTokenValue("");
82
- }
83
- } catch (err) {
84
- console.error(err);
85
- } finally {
86
- setIsLoadingToken(false);
87
- }
88
- };
89
- fetchToken();
90
- }, []);
91
- const handleLicenseChange = (e) => {
92
- setLicenseValue(e.target.value.trim());
93
- };
94
- const handleUpdateUrl = async function() {
95
- setIsLoading(true);
96
- updateDevlUrl(post, devUrl).then(() => {
97
- if (devUrl === "")
98
- setShowDevOptions(false);
99
- }).finally(() => setIsLoading(false));
100
- };
101
- const handleSaveLicense = async () => {
102
- try {
103
- const response = await post("/translationstudio/setLicense", { license: licenseValue });
104
- if (response) {
105
- displayAlert("success");
106
- return;
107
- }
108
- } catch (err) {
109
- console.error(err);
110
- }
111
- displayAlert("danger");
112
- };
113
- const displayAlert = (variant) => {
114
- let message = variant === "success" ? "License saved" : "Error saving license";
115
- setAlertType(variant);
116
- setAlertMessage(message);
117
- setShowAlert(true);
118
- setTimeout(() => {
119
- setShowAlert(false);
120
- }, 5e3);
121
- };
122
- const handleGenerateToken = async () => {
123
- setIsLoadingToken(true);
124
- try {
125
- const response = await post("/translationstudio/generateToken");
126
- if (response.data?.token) {
127
- setTokenValue(response.data.token);
128
- }
129
- } catch (err) {
130
- console.error(err);
131
- } finally {
132
- setIsLoadingToken(false);
133
- }
134
- };
135
- const onChangeDevOptions = function(val) {
136
- if (val)
137
- setShowDevOptions(val);
138
- else
139
- updateDevlUrl(post, "").finally(() => setShowDevOptions(val));
140
- };
141
- return /* @__PURE__ */ jsxs(Main, { children: [
142
- showAlert && /* @__PURE__ */ jsx(
143
- Box,
144
- {
145
- style: {
146
- position: "fixed",
147
- top: "10%",
148
- left: "50%",
149
- transform: "translate(-50%, -50%)",
150
- zIndex: 10,
151
- minWidth: "400px",
152
- maxWidth: "90%"
153
- },
154
- children: /* @__PURE__ */ jsx(Alert, { closeLabel: "Close", variant: alertType, onClose: () => setShowAlert(false), children: alertMessage })
155
- }
156
- ),
157
- /* @__PURE__ */ jsx(
158
- Box,
159
- {
160
- padding: 10,
161
- style: {
162
- minHeight: "90vh",
163
- marginTop: "5vh",
164
- backgroundColor: "white",
165
- color: "grey"
166
- },
167
- children: /* @__PURE__ */ jsxs(Grid.Root, { children: [
168
- /* @__PURE__ */ jsx(Grid.Item, { xs: 12, children: /* @__PURE__ */ jsx(Box, { style: { textAlign: "right", width: "100%" }, children: /* @__PURE__ */ jsx(
169
- "img",
170
- {
171
- src: TSlogoFarbig,
172
- alt: "Translation Studio Logo",
173
- style: {
174
- width: "300px",
175
- height: "auto",
176
- display: "inline-block"
177
- }
178
- }
179
- ) }) }),
180
- /* @__PURE__ */ jsx(Grid.Item, { xs: 12, style: { paddingTop: "2em" }, children: /* @__PURE__ */ jsx(Typography, { variant: "beta", style: { width: "100%" }, children: "translationstudio License" }) }),
181
- /* @__PURE__ */ jsx(Grid.Item, { xs: 12, style: { paddingBottom: "1em" }, children: /* @__PURE__ */ jsxs(Typography, { variant: "charlie", style: { width: "100%" }, children: [
182
- "You can create or revoke a license at",
183
- " ",
184
- /* @__PURE__ */ jsx(
185
- "a",
186
- {
187
- href: "https://account.translationstudio.tech/",
188
- target: "_blank",
189
- rel: "noopener noreferrer",
190
- style: { textDecoration: "none", color: "#e94642" },
191
- children: "account.translationstudio.tech"
192
- }
193
- )
194
- ] }) }),
195
- /* @__PURE__ */ jsx(Grid.Item, { xs: 10, children: /* @__PURE__ */ jsx(Box, { style: { width: "100%" }, children: /* @__PURE__ */ jsx(
196
- TextInput,
197
- {
198
- name: "jwt-token",
199
- label: "JWT Token",
200
- placeholder: "Paste your Strapi translationstudio license into this field and click save to apply it to this project",
201
- "aria-label": "Strapi license Input",
202
- value: licenseValue,
203
- onChange: handleLicenseChange,
204
- disabled: isLoading,
205
- style: TextareaStyle
206
- }
207
- ) }) }),
208
- /* @__PURE__ */ jsx(Grid.Item, { xs: 2, children: /* @__PURE__ */ jsx(
209
- Button,
210
- {
211
- onClick: handleSaveLicense,
212
- disabled: isLoading,
213
- style: BUttonStyle,
214
- size: "L",
215
- startIcon: /* @__PURE__ */ jsx(
216
- "svg",
217
- {
218
- width: "20",
219
- height: "20",
220
- viewBox: "0 0 24 24",
221
- fill: "none",
222
- xmlns: "http://www.w3.org/2000/svg",
223
- children: /* @__PURE__ */ jsx(
224
- "path",
225
- {
226
- 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",
227
- fill: "currentColor"
228
- }
229
- )
230
- }
231
- ),
232
- children: "Save license"
233
- }
234
- ) }),
235
- /* @__PURE__ */ jsx(Grid.Item, { xs: 12, style: { paddingTop: "3em" }, children: /* @__PURE__ */ jsx(Typography, { variant: "beta", children: "Authorize translationstudio requests" }) }),
236
- /* @__PURE__ */ jsx(Grid.Item, { xs: 12, style: { paddingBottom: "1em" }, children: /* @__PURE__ */ jsx(Typography, { variant: "charlie", style: { width: "100%" }, children: "When translationstudio connects with this plugin it will use the following access key to authorize itself." }) }),
237
- /* @__PURE__ */ jsx(Grid.Item, { xs: 10, children: /* @__PURE__ */ jsx(Box, { style: { width: "100%" }, children: /* @__PURE__ */ jsx(
238
- TextInput,
239
- {
240
- name: "access-token",
241
- label: "Access Key",
242
- placeholder: "Generate an access key to validate incoming requests",
243
- "aria-label": "Access Key Input",
244
- value: tokenValue,
245
- onChange: () => {
246
- },
247
- disabled: true,
248
- style: TextareaStyle
249
- }
250
- ) }) }),
251
- /* @__PURE__ */ jsx(Grid.Item, { xs: 2, children: /* @__PURE__ */ jsx(
252
- Button,
253
- {
254
- onClick: handleGenerateToken,
255
- style: BUttonStyle,
256
- disabled: isLoadingToken,
257
- loading: isLoadingToken,
258
- size: "L",
259
- startIcon: /* @__PURE__ */ jsx(ArrowClockwise, {}),
260
- children: isLoadingToken ? "Generating..." : tokenValue ? "New access key" : "Create access key"
261
- }
262
- ) }),
263
- /* @__PURE__ */ jsx(Grid.Item, { xs: 12, style: { paddingTop: "5em" }, children: /* @__PURE__ */ jsx(Typography, { variant: "beta", children: "Customization" }) }),
264
- /* @__PURE__ */ jsx(Grid.Item, { xs: 12, style: { paddingBottom: "1em" }, children: /* @__PURE__ */ jsx(Typography, { variant: "charlie", style: { width: "100%" }, children: "You will not need these settings, but you might want to customize your translationstudio instance." }) }),
265
- /* @__PURE__ */ jsx(Grid.Item, { xs: 12, children: /* @__PURE__ */ jsx(
266
- Switch,
267
- {
268
- checked: showDevOptions,
269
- onCheckedChange: () => onChangeDevOptions(!showDevOptions),
270
- onLabel: "Use custom translationstudio URL",
271
- offLabel: "Custom translationstudio URL is currently disabled (default)",
272
- visibleLabels: true
273
- }
274
- ) }),
275
- showDevOptions && /* @__PURE__ */ jsxs(Fragment, { children: [
276
- /* @__PURE__ */ jsx(Grid.Item, { xs: 12, style: { paddingTop: "2em" }, children: /* @__PURE__ */ jsx(Typography, { variant: "beta", children: "Use custom translationstudio URL." }) }),
277
- /* @__PURE__ */ jsx(Grid.Item, { xs: 12, style: { paddingBottom: "1em" }, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", children: "This is usually only necessary for development purposes." }) }),
278
- /* @__PURE__ */ jsx(Grid.Item, { xs: 10, children: /* @__PURE__ */ jsx(Box, { style: { width: "100%" }, children: /* @__PURE__ */ jsx(
279
- TextInput,
280
- {
281
- onChange: (e) => setDevUrl(e.target.value.trim()),
282
- name: "devurl",
283
- label: "Custom translationstudio url",
284
- placeholder: "Paste your custom translationstudio url here",
285
- "aria-label": "translationstudio custom url",
286
- value: devUrl,
287
- style: TextareaStyle
288
- }
289
- ) }) }),
290
- /* @__PURE__ */ jsx(Grid.Item, { xs: 2, children: /* @__PURE__ */ jsx(
291
- Button,
292
- {
293
- onClick: handleUpdateUrl,
294
- style: BUttonStyle,
295
- disabled: isLoadingToken,
296
- loading: isLoadingToken,
297
- startIcon: /* @__PURE__ */ jsx(Play, {}),
298
- size: "L",
299
- children: "Update URL"
300
- }
301
- ) })
302
- ] }),
303
- /* @__PURE__ */ jsx(Grid.Item, { xs: 12, style: { paddingTop: "4em" }, children: /* @__PURE__ */ jsxs(Typography, { variant: "sigma", style: { width: "100%", textAlign: "right" }, children: [
304
- "If you do not have a translationstudio account, please create one at",
305
- " ",
306
- /* @__PURE__ */ jsx(
307
- "a",
308
- {
309
- href: "https://account.translationstudio.tech/",
310
- target: "_blank",
311
- rel: "noopener noreferrer",
312
- style: { textDecoration: "none", color: "#e94642" },
313
- children: "account.translationstudio.tech"
314
- }
315
- ),
316
- ". You can find further information at ",
317
- /* @__PURE__ */ jsx(
318
- "a",
319
- {
320
- href: "https://www.translationstudio.tech/",
321
- target: "_blank",
322
- rel: "noopener noreferrer",
323
- style: { textDecoration: "none", color: "#e94642" },
324
- children: "translationstudio.tech"
325
- }
326
- ),
327
- " "
328
- ] }) })
329
- ] })
330
- }
331
- )
332
- ] });
333
- };
334
- const App = () => {
335
- return /* @__PURE__ */ jsxs(Routes, { children: [
336
- /* @__PURE__ */ jsx(Route, { index: true, element: /* @__PURE__ */ jsx(SettingsPage, {}) }),
337
- /* @__PURE__ */ jsx(Route, { path: "*", element: /* @__PURE__ */ jsx(Page.Error, {}) })
338
- ] });
339
- };
340
- export {
341
- App
342
- };