@littlebox/strapi-suite 1.0.50 → 1.0.52

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 (35) hide show
  1. package/dist/_chunks/{App-CUhT6I0p.js → App-C-h--Kv_.js} +565 -36
  2. package/dist/_chunks/{App-CVOV2lQP.mjs → App-C1HyspTk.mjs} +558 -29
  3. package/dist/_chunks/{SlugInput-Cy1-zfz_.js → SlugInput-3gkr6B0t.js} +3 -4
  4. package/dist/_chunks/{SlugInput-DDRjbmRt.mjs → SlugInput-CU9_b0dd.mjs} +1 -2
  5. package/dist/_chunks/{en-CGJcJfk1.js → en-CLNZnNeq.js} +30 -0
  6. package/dist/_chunks/{en-CRSiVe4w.mjs → en-F6RYx79c.mjs} +30 -0
  7. package/dist/_chunks/{index-B0aQw-t1.js → index-60sq8G6p.js} +667 -20
  8. package/dist/_chunks/{index-fPknNRw6.mjs → index-DQ3vX9So.mjs} +639 -9
  9. package/dist/admin/index.js +1 -1
  10. package/dist/admin/index.mjs +2 -2
  11. package/dist/admin/src/components/DocumentTranslateBox.d.ts +5 -0
  12. package/dist/admin/src/components/DocumentTranslateModal.d.ts +11 -0
  13. package/dist/admin/src/components/TranslationAiModal.d.ts +8 -0
  14. package/dist/admin/src/components/TranslationSettingsModal.d.ts +6 -0
  15. package/dist/admin/src/contexts/settings.d.ts +1 -0
  16. package/dist/admin/src/core/config.d.ts +1 -0
  17. package/dist/admin/src/core/gateways/aiGateway.d.ts +19 -0
  18. package/dist/admin/src/core/gateways/documentGateway.d.ts +15 -0
  19. package/dist/admin/src/core/gateways/translationGateway.d.ts +13 -0
  20. package/dist/admin/src/core/usecases/translateDocument.d.ts +33 -0
  21. package/dist/admin/src/core/usecases/translateWithAi.d.ts +17 -0
  22. package/dist/admin/src/core/utils/documentFields.d.ts +23 -0
  23. package/dist/server/index.js +386 -79
  24. package/dist/server/index.mjs +386 -79
  25. package/dist/server/src/config/index.d.ts +4 -0
  26. package/dist/server/src/controllers/index.d.ts +6 -0
  27. package/dist/server/src/controllers/modules/ai-translation.d.ts +7 -0
  28. package/dist/server/src/controllers/modules/translation.d.ts +1 -0
  29. package/dist/server/src/index.d.ts +22 -1
  30. package/dist/server/src/services/app/setting.d.ts +3 -1
  31. package/dist/server/src/services/index.d.ts +16 -1
  32. package/dist/server/src/services/modules/ai-translation.d.ts +35 -0
  33. package/package.json +1 -1
  34. package/dist/_chunks/convertToSlug-B-OmazDp.js +0 -83
  35. package/dist/_chunks/convertToSlug-Bht0pDyl.mjs +0 -84
@@ -4,12 +4,11 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const reactRouterDom = require("react-router-dom");
5
5
  const React = require("react");
6
6
  const designSystem = require("@strapi/design-system");
7
- const index = require("./index-B0aQw-t1.js");
7
+ const index = require("./index-60sq8G6p.js");
8
8
  const icons = require("@strapi/icons");
9
9
  const reactIntl = require("react-intl");
10
10
  const styled = require("styled-components");
11
11
  const symbols = require("@strapi/icons/symbols");
12
- const convertToSlug = require("./convertToSlug-B-OmazDp.js");
13
12
  const core = require("@dnd-kit/core");
14
13
  const sortable = require("@dnd-kit/sortable");
15
14
  const modifiers = require("@dnd-kit/modifiers");
@@ -58,7 +57,8 @@ function SettingsProvider({ children }) {
58
57
  SettingsContext.Provider,
59
58
  {
60
59
  value: {
61
- provide
60
+ provide,
61
+ refresh: fetch
62
62
  },
63
63
  children: [
64
64
  !fetchInProgress && children,
@@ -722,7 +722,7 @@ const HomePage = () => {
722
722
  style: { marginRight: "10px" },
723
723
  endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ExternalLink, {}),
724
724
  onClick: () => window.open("https://www.npmjs.com/package/@littlebox/strapi-suite", "_blank"),
725
- children: "v1.0.50"
725
+ children: "v1.0.52"
726
726
  }
727
727
  ),
728
728
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -941,7 +941,7 @@ const ConfirmModal = ({ open, title, text, confirm, cancel }) => {
941
941
  ] }) }) })
942
942
  ] }) }) });
943
943
  };
944
- const BoxInput$7 = styled__default.default(designSystem.Box)`
944
+ const BoxInput$9 = styled__default.default(designSystem.Box)`
945
945
  & > div {
946
946
  width: 100%;
947
947
  }
@@ -1049,7 +1049,7 @@ const SlugSettingsModal = ({ open, close, defaultLocale }) => {
1049
1049
  })
1050
1050
  }
1051
1051
  ),
1052
- /* @__PURE__ */ jsxRuntime.jsx(BoxInput$7, { style: { flex: 1, display: "flex", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1052
+ /* @__PURE__ */ jsxRuntime.jsx(BoxInput$9, { style: { flex: 1, display: "flex", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1053
1053
  designSystem.SingleSelect,
1054
1054
  {
1055
1055
  onChange: (value) => handleChangeSelectedContent(value),
@@ -1063,7 +1063,7 @@ const SlugSettingsModal = ({ open, close, defaultLocale }) => {
1063
1063
  ),
1064
1064
  defaultMessage: "Home page slug strategy"
1065
1065
  }) }),
1066
- /* @__PURE__ */ jsxRuntime.jsx(BoxInput$7, { style: { flex: 1, display: "flex", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
1066
+ /* @__PURE__ */ jsxRuntime.jsx(BoxInput$9, { style: { flex: 1, display: "flex", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
1067
1067
  designSystem.SingleSelect,
1068
1068
  {
1069
1069
  onChange: (value) => setSelectedStrategy(value),
@@ -1171,7 +1171,7 @@ const SlugSettingsPage = () => {
1171
1171
  });
1172
1172
  }
1173
1173
  async function fetchLocales() {
1174
- const fetchLocales2 = new convertToSlug.FetchLocales();
1174
+ const fetchLocales2 = new index.FetchLocales();
1175
1175
  const fetchLocalesOutput = await fetchLocales2.execute();
1176
1176
  const defaultLocale2 = fetchLocalesOutput.find((locale) => locale.isDefault);
1177
1177
  setI18nLocales(fetchLocalesOutput);
@@ -1553,7 +1553,7 @@ const AttributeSettingsPage = () => {
1553
1553
  });
1554
1554
  }
1555
1555
  async function fetchLocales() {
1556
- const fetchLocales2 = new convertToSlug.FetchLocales();
1556
+ const fetchLocales2 = new index.FetchLocales();
1557
1557
  const fetchLocalesOutput = await fetchLocales2.execute();
1558
1558
  setI18nLocales(fetchLocalesOutput);
1559
1559
  }
@@ -1928,7 +1928,7 @@ let CreateMenu$1 = class CreateMenu {
1928
1928
  await this.menuGateway.create(params);
1929
1929
  }
1930
1930
  };
1931
- const BoxInput$6 = styled__default.default(designSystem.Box)`
1931
+ const BoxInput$8 = styled__default.default(designSystem.Box)`
1932
1932
  & > div {
1933
1933
  width: 100%;
1934
1934
  }
@@ -1991,7 +1991,7 @@ const MenuCreateModal = ({ open, close, locale, currentRecords }) => {
1991
1991
  id: index.getTranslation(`module.${module2}.modal.create.input.title`),
1992
1992
  defaultMessage: "Title"
1993
1993
  }) }),
1994
- /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$6, { style: { flex: 1, display: "flex", width: "100%", marginRight: "10px" }, children: [
1994
+ /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$8, { style: { flex: 1, display: "flex", width: "100%", marginRight: "10px" }, children: [
1995
1995
  /* @__PURE__ */ jsxRuntime.jsx(
1996
1996
  designSystem.TextInput,
1997
1997
  {
@@ -2024,7 +2024,7 @@ const MenuCreateModal = ({ open, close, locale, currentRecords }) => {
2024
2024
  }
2025
2025
  ),
2026
2026
  /* @__PURE__ */ jsxRuntime.jsxs(
2027
- BoxInput$6,
2027
+ BoxInput$8,
2028
2028
  {
2029
2029
  style: {
2030
2030
  flex: 1,
@@ -2045,7 +2045,7 @@ const MenuCreateModal = ({ open, close, locale, currentRecords }) => {
2045
2045
  value: formUid,
2046
2046
  hasError: submitted && (isEmpty(formUid) || uidExist),
2047
2047
  onChange: (e) => {
2048
- const convertedText = convertToSlug.convertToSlug(e.target.value);
2048
+ const convertedText = index.convertToSlug(e.target.value);
2049
2049
  setFormUid(convertedText);
2050
2050
  checkUidExist(e.target.value);
2051
2051
  }
@@ -2092,7 +2092,7 @@ class DuplicateMenu {
2092
2092
  await this.menuGateway.duplicate(documentId, locale);
2093
2093
  }
2094
2094
  }
2095
- const BoxInput$5 = styled__default.default(designSystem.Box)`
2095
+ const BoxInput$7 = styled__default.default(designSystem.Box)`
2096
2096
  & > div {
2097
2097
  width: 100%;
2098
2098
  }
@@ -2139,7 +2139,7 @@ const MenuDuplicateModal = ({ open, close, documentId, locales }) => {
2139
2139
  id: index.getTranslation(`module.${module2}.duplicate.input.title`),
2140
2140
  defaultMessage: "Select language"
2141
2141
  }) }),
2142
- /* @__PURE__ */ jsxRuntime.jsx(BoxInput$5, { style: { flex: 1, display: "flex", width: "100%", marginRight: "10px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
2142
+ /* @__PURE__ */ jsxRuntime.jsx(BoxInput$7, { style: { flex: 1, display: "flex", width: "100%", marginRight: "10px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
2143
2143
  designSystem.SingleSelect,
2144
2144
  {
2145
2145
  onChange: (value) => setSelectedLocale(value),
@@ -2196,7 +2196,7 @@ const MenuSettingsPage = () => {
2196
2196
  });
2197
2197
  }
2198
2198
  async function fetchLocales() {
2199
- const fetchLocales2 = new convertToSlug.FetchLocales();
2199
+ const fetchLocales2 = new index.FetchLocales();
2200
2200
  const fetchLocalesOutput = await fetchLocales2.execute();
2201
2201
  setI18nLocales(fetchLocalesOutput);
2202
2202
  }
@@ -2846,7 +2846,7 @@ const TabBodyContainer = ({ value, children }) => {
2846
2846
  Tab.Header = TabHeaderContainer;
2847
2847
  Tab.Item = TabItemContainer;
2848
2848
  Tab.Body = TabBodyContainer;
2849
- const BoxInput$4 = styled__default.default(designSystem.Box)`
2849
+ const BoxInput$6 = styled__default.default(designSystem.Box)`
2850
2850
  & > div {
2851
2851
  width: 100%;
2852
2852
  }
@@ -2968,7 +2968,7 @@ function MenuEditItem(props) {
2968
2968
  id: index.getTranslation(`module.${module2}.edit.input.title`),
2969
2969
  defaultMessage: "Title"
2970
2970
  }) }) }),
2971
- /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$4, { style: { flex: 1, display: "flex", width: "100%" }, children: [
2971
+ /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$6, { style: { flex: 1, display: "flex", width: "100%" }, children: [
2972
2972
  /* @__PURE__ */ jsxRuntime.jsx(
2973
2973
  designSystem.TextInput,
2974
2974
  {
@@ -2989,7 +2989,7 @@ function MenuEditItem(props) {
2989
2989
  id: index.getTranslation(`module.${module2}.edit.input.url`),
2990
2990
  defaultMessage: "Url"
2991
2991
  }) }) }),
2992
- /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$4, { style: { flex: 1, display: "flex", width: "100%" }, children: [
2992
+ /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$6, { style: { flex: 1, display: "flex", width: "100%" }, children: [
2993
2993
  /* @__PURE__ */ jsxRuntime.jsx(
2994
2994
  designSystem.TextInput,
2995
2995
  {
@@ -3016,7 +3016,7 @@ function MenuEditItem(props) {
3016
3016
  defaultMessage: "Content"
3017
3017
  }) }) }),
3018
3018
  /* @__PURE__ */ jsxRuntime.jsxs(
3019
- BoxInput$4,
3019
+ BoxInput$6,
3020
3020
  {
3021
3021
  style: { flex: 1, display: "flex", flexDirection: "column", width: "100%" },
3022
3022
  children: [
@@ -3058,7 +3058,7 @@ function MenuEditItem(props) {
3058
3058
  id: index.getTranslation(`module.${module2}.edit.input.target`),
3059
3059
  defaultMessage: "Target"
3060
3060
  }) }) }),
3061
- /* @__PURE__ */ jsxRuntime.jsx(BoxInput$4, { style: { flex: 1, display: "flex", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
3061
+ /* @__PURE__ */ jsxRuntime.jsx(BoxInput$6, { style: { flex: 1, display: "flex", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
3062
3062
  designSystem.SingleSelect,
3063
3063
  {
3064
3064
  onChange: (value) => {
@@ -3261,7 +3261,7 @@ function MenuEditItem(props) {
3261
3261
  }
3262
3262
  ) });
3263
3263
  }
3264
- const BoxInput$3 = styled__default.default(designSystem.Box)`
3264
+ const BoxInput$5 = styled__default.default(designSystem.Box)`
3265
3265
  & > div {
3266
3266
  width: 100%;
3267
3267
  }
@@ -3294,6 +3294,13 @@ function MenuDragDrop(props) {
3294
3294
  setUidExist(!!uidExist2);
3295
3295
  return !!uidExist2;
3296
3296
  }
3297
+ function reindexOrder(items2) {
3298
+ return items2.map((item, index2) => ({
3299
+ ...item,
3300
+ order: index2 + 1,
3301
+ children: item.children && item.children.length > 0 ? reindexOrder(item.children) : []
3302
+ }));
3303
+ }
3297
3304
  async function handlerForm() {
3298
3305
  const uidExist2 = checkUidExist(formUid);
3299
3306
  if (!uidExist2 && isNotEmpty(formTitle) && isNotEmpty(formUid) && itemsAreValid) {
@@ -3301,7 +3308,7 @@ function MenuDragDrop(props) {
3301
3308
  props.onSaveEvent({
3302
3309
  uid: formUid,
3303
3310
  title: formTitle,
3304
- children: items
3311
+ children: reindexOrder(items)
3305
3312
  });
3306
3313
  } else {
3307
3314
  props.onSaveEvent(null);
@@ -3458,7 +3465,7 @@ function MenuDragDrop(props) {
3458
3465
  id: index.getTranslation(`module.${module2}.edit.input.title`),
3459
3466
  defaultMessage: "Title"
3460
3467
  }) }) }),
3461
- /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$3, { style: { flex: 1, display: "flex", width: "100%", marginRight: "10px" }, children: [
3468
+ /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$5, { style: { flex: 1, display: "flex", width: "100%", marginRight: "10px" }, children: [
3462
3469
  /* @__PURE__ */ jsxRuntime.jsx(
3463
3470
  designSystem.TextInput,
3464
3471
  {
@@ -3491,7 +3498,7 @@ function MenuDragDrop(props) {
3491
3498
  defaultMessage: "UID"
3492
3499
  }) }) }),
3493
3500
  /* @__PURE__ */ jsxRuntime.jsxs(
3494
- BoxInput$3,
3501
+ BoxInput$5,
3495
3502
  {
3496
3503
  style: {
3497
3504
  flex: 1,
@@ -3512,7 +3519,7 @@ function MenuDragDrop(props) {
3512
3519
  value: formUid,
3513
3520
  hasError: isEmpty(formUid) || uidExist,
3514
3521
  onChange: (e) => {
3515
- const convertedText = convertToSlug.convertToSlug(e.target.value);
3522
+ const convertedText = index.convertToSlug(e.target.value);
3516
3523
  setFormUid(convertedText);
3517
3524
  checkUidExist(e.target.value);
3518
3525
  }
@@ -3792,7 +3799,7 @@ let EditParameter$1 = class EditParameter {
3792
3799
  await this.parameterGateway.edit(documentId, params);
3793
3800
  }
3794
3801
  };
3795
- const BoxInput$2 = styled__default.default(designSystem.Box)`
3802
+ const BoxInput$4 = styled__default.default(designSystem.Box)`
3796
3803
  & > div {
3797
3804
  width: 100%;
3798
3805
  }
@@ -3886,7 +3893,7 @@ const ParameterHandleDataModal = ({ open, close, data, currentRecords }) => {
3886
3893
  }
3887
3894
  ),
3888
3895
  /* @__PURE__ */ jsxRuntime.jsxs(
3889
- BoxInput$2,
3896
+ BoxInput$4,
3890
3897
  {
3891
3898
  style: {
3892
3899
  flex: 1,
@@ -3907,7 +3914,7 @@ const ParameterHandleDataModal = ({ open, close, data, currentRecords }) => {
3907
3914
  value: form.uid,
3908
3915
  hasError: submitted && (isEmpty(form.uid) || uidExist),
3909
3916
  onChange: (e) => {
3910
- const convertedText = convertToSlug.convertToSlug(e.target.value);
3917
+ const convertedText = index.convertToSlug(e.target.value);
3911
3918
  setForm({ ...form, uid: convertedText });
3912
3919
  checkUidExist(e.target.value);
3913
3920
  }
@@ -3929,7 +3936,7 @@ const ParameterHandleDataModal = ({ open, close, data, currentRecords }) => {
3929
3936
  defaultMessage: "Value"
3930
3937
  }) }) }),
3931
3938
  /* @__PURE__ */ jsxRuntime.jsxs(
3932
- BoxInput$2,
3939
+ BoxInput$4,
3933
3940
  {
3934
3941
  style: {
3935
3942
  flex: 1,
@@ -3962,7 +3969,7 @@ const ParameterHandleDataModal = ({ open, close, data, currentRecords }) => {
3962
3969
  defaultMessage: "Private"
3963
3970
  }) }) }),
3964
3971
  /* @__PURE__ */ jsxRuntime.jsx(
3965
- BoxInput$2,
3972
+ BoxInput$4,
3966
3973
  {
3967
3974
  style: {
3968
3975
  flex: 1,
@@ -4368,7 +4375,7 @@ class EditParameter2 {
4368
4375
  await this.translationGateway.edit(uid, params);
4369
4376
  }
4370
4377
  }
4371
- const BoxInput$1 = styled__default.default(designSystem.Box)`
4378
+ const BoxInput$3 = styled__default.default(designSystem.Box)`
4372
4379
  flex: 1;
4373
4380
  display: flex;
4374
4381
  width: 100%;
@@ -4479,7 +4486,7 @@ const TranslationHandleDataModal = ({
4479
4486
  })
4480
4487
  }
4481
4488
  ),
4482
- /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$1, { children: [
4489
+ /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$3, { children: [
4483
4490
  /* @__PURE__ */ jsxRuntime.jsx(
4484
4491
  designSystem.TextInput,
4485
4492
  {
@@ -4545,7 +4552,7 @@ const TranslationHandleDataModal = ({
4545
4552
  children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: key })
4546
4553
  }
4547
4554
  ),
4548
- /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$1, { children: [
4555
+ /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$3, { children: [
4549
4556
  /* @__PURE__ */ jsxRuntime.jsx(
4550
4557
  designSystem.TextInput,
4551
4558
  {
@@ -4589,6 +4596,487 @@ const TranslationHandleDataModal = ({
4589
4596
  ] })
4590
4597
  ] }) }) });
4591
4598
  };
4599
+ const BoxInput$2 = styled__default.default(designSystem.Box)`
4600
+ flex: 1;
4601
+ display: flex;
4602
+ width: 100%;
4603
+ flex-direction: column;
4604
+ & > div {
4605
+ width: 100%;
4606
+ }
4607
+ `;
4608
+ const TranslationSettingsModal = ({ open, close }) => {
4609
+ const [module2] = React.useState(index.config.uuid.modules.translation);
4610
+ const [hidden, setHidden] = React.useState(true);
4611
+ const [aiEnabled, setAiEnabled] = React.useState(false);
4612
+ const [aiApiKey, setAiApiKey] = React.useState("");
4613
+ const [aiModel, setAiModel] = React.useState(index.AI_TRANSLATION_DEFAULT_MODEL);
4614
+ const [storedApiKey, setStoredApiKey] = React.useState("");
4615
+ const [saveInProgress, setSaveInProgress] = React.useState(false);
4616
+ const { formatMessage } = reactIntl.useIntl();
4617
+ const settings = useSettings();
4618
+ async function updateSetting(property, value) {
4619
+ const updateSetting2 = new UpdateSetting();
4620
+ await updateSetting2.execute({ property, module: module2, value });
4621
+ }
4622
+ async function save() {
4623
+ if (saveInProgress) return;
4624
+ setSaveInProgress(true);
4625
+ await updateSetting("aiEnabled", aiEnabled);
4626
+ await updateSetting("aiModel", aiModel.trim() || index.AI_TRANSLATION_DEFAULT_MODEL);
4627
+ if (aiApiKey.trim().length > 0) {
4628
+ await updateSetting("aiApiKey", aiApiKey.trim());
4629
+ }
4630
+ await settings.refresh();
4631
+ setAiApiKey("");
4632
+ setSaveInProgress(false);
4633
+ close();
4634
+ }
4635
+ React.useEffect(() => {
4636
+ if (!open) {
4637
+ setHidden(true);
4638
+ return;
4639
+ }
4640
+ const current = settings.provide(module2);
4641
+ setAiEnabled(!!current.aiEnabled);
4642
+ setAiModel(current.aiModel || index.AI_TRANSLATION_DEFAULT_MODEL);
4643
+ setStoredApiKey(current.aiApiKey || "");
4644
+ setAiApiKey("");
4645
+ setHidden(false);
4646
+ }, [open]);
4647
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hidden && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { defaultOpen: true, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
4648
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { style: { textAlign: "left" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { style: { width: "100%", justifyContent: "space-between" }, children: [
4649
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: formatMessage({
4650
+ id: index.getTranslation(`module.${module2}.modal.settings.title`),
4651
+ defaultMessage: "Settings"
4652
+ }) }),
4653
+ !saveInProgress && /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { variant: "tertiary", onClick: close, label: "Close", borderWidth: 0, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {}) })
4654
+ ] }) }),
4655
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { display: "flex", flexDirection: "column", width: "100%" }, children: [
4656
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", style: { paddingBottom: "5px" }, children: formatMessage({
4657
+ id: index.getTranslation(`module.${module2}.modal.settings.input.ai-enabled.title`),
4658
+ defaultMessage: "Translate with artificial intelligence"
4659
+ }) }),
4660
+ /* @__PURE__ */ jsxRuntime.jsx(
4661
+ designSystem.Typography,
4662
+ {
4663
+ variant: "pi",
4664
+ style: { paddingBottom: "5px", color: "#a5a5ba", display: "flex" },
4665
+ children: formatMessage({
4666
+ id: index.getTranslation(
4667
+ `module.${module2}.modal.settings.input.ai-enabled.description`
4668
+ ),
4669
+ defaultMessage: "Enable the OpenAI powered translation of the entries of this module"
4670
+ })
4671
+ }
4672
+ ),
4673
+ /* @__PURE__ */ jsxRuntime.jsx(
4674
+ designSystem.Toggle,
4675
+ {
4676
+ onLabel: "True",
4677
+ offLabel: "False",
4678
+ checked: aiEnabled,
4679
+ onChange: (e) => setAiEnabled(e.target.checked)
4680
+ }
4681
+ ),
4682
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", style: { paddingBottom: "5px", paddingTop: "24px" }, children: formatMessage({
4683
+ id: index.getTranslation(`module.${module2}.modal.settings.input.ai-api-key.title`),
4684
+ defaultMessage: "OpenAI API key"
4685
+ }) }),
4686
+ /* @__PURE__ */ jsxRuntime.jsx(
4687
+ designSystem.Typography,
4688
+ {
4689
+ variant: "pi",
4690
+ style: { paddingBottom: "5px", color: "#a5a5ba", display: "flex" },
4691
+ children: formatMessage({
4692
+ id: index.getTranslation(
4693
+ `module.${module2}.modal.settings.input.ai-api-key.description`
4694
+ ),
4695
+ defaultMessage: "The key is stored on the server and is never shown again. Leave it empty to keep the current one"
4696
+ })
4697
+ }
4698
+ ),
4699
+ /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$2, { children: [
4700
+ /* @__PURE__ */ jsxRuntime.jsx(
4701
+ designSystem.TextInput,
4702
+ {
4703
+ type: "password",
4704
+ style: { width: "100%" },
4705
+ autoComplete: "new-password",
4706
+ "aria-label": formatMessage({
4707
+ id: index.getTranslation(`module.${module2}.modal.settings.input.ai-api-key.title`),
4708
+ defaultMessage: "OpenAI API key"
4709
+ }),
4710
+ placeholder: storedApiKey || formatMessage({
4711
+ id: index.getTranslation(
4712
+ `module.${module2}.modal.settings.input.ai-api-key.placeholder`
4713
+ ),
4714
+ defaultMessage: "No API key set"
4715
+ }),
4716
+ value: aiApiKey,
4717
+ onChange: (e) => setAiApiKey(e.target.value)
4718
+ }
4719
+ ),
4720
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {}),
4721
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
4722
+ ] }),
4723
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", style: { paddingBottom: "5px", paddingTop: "24px" }, children: formatMessage({
4724
+ id: index.getTranslation(`module.${module2}.modal.settings.input.ai-model.title`),
4725
+ defaultMessage: "OpenAI model"
4726
+ }) }),
4727
+ /* @__PURE__ */ jsxRuntime.jsx(
4728
+ designSystem.Typography,
4729
+ {
4730
+ variant: "pi",
4731
+ style: { paddingBottom: "5px", color: "#a5a5ba", display: "flex" },
4732
+ children: formatMessage({
4733
+ id: index.getTranslation(`module.${module2}.modal.settings.input.ai-model.description`),
4734
+ defaultMessage: "The model used to generate the translations"
4735
+ })
4736
+ }
4737
+ ),
4738
+ /* @__PURE__ */ jsxRuntime.jsxs(BoxInput$2, { children: [
4739
+ /* @__PURE__ */ jsxRuntime.jsx(
4740
+ designSystem.TextInput,
4741
+ {
4742
+ style: { width: "100%" },
4743
+ "aria-label": formatMessage({
4744
+ id: index.getTranslation(`module.${module2}.modal.settings.input.ai-model.title`),
4745
+ defaultMessage: "OpenAI model"
4746
+ }),
4747
+ placeholder: index.AI_TRANSLATION_DEFAULT_MODEL,
4748
+ value: aiModel,
4749
+ onChange: (e) => setAiModel(e.target.value)
4750
+ }
4751
+ ),
4752
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {}),
4753
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
4754
+ ] }),
4755
+ /* @__PURE__ */ jsxRuntime.jsxs(
4756
+ designSystem.Card,
4757
+ {
4758
+ shadow: false,
4759
+ style: {
4760
+ marginTop: "20px",
4761
+ padding: "10px",
4762
+ display: "flex",
4763
+ alignItems: "center"
4764
+ },
4765
+ children: [
4766
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", fill: "none", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx(
4767
+ "path",
4768
+ {
4769
+ fill: "#7b79ff",
4770
+ d: "M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12 12-5.383 12-12S18.617 0 12 0Zm1.154 18.456h-2.308V16.15h2.308v2.307Zm-.23-3.687h-1.847l-.346-9.23h2.538l-.346 9.23Z"
4771
+ }
4772
+ ) }),
4773
+ /* @__PURE__ */ jsxRuntime.jsx(
4774
+ designSystem.Typography,
4775
+ {
4776
+ variant: "pi",
4777
+ style: { color: "#a5a5ba", display: "flex", marginLeft: "10px" },
4778
+ children: formatMessage({
4779
+ id: index.getTranslation(`module.${module2}.modal.settings.hint`),
4780
+ defaultMessage: "Each translation is billed by OpenAI on the account that owns the API key"
4781
+ })
4782
+ }
4783
+ )
4784
+ ]
4785
+ }
4786
+ )
4787
+ ] }) }),
4788
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { style: { justifyContent: "end" }, children: [
4789
+ saveInProgress && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true }),
4790
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { style: { marginRight: "5px" }, onClick: save, disabled: saveInProgress, children: formatMessage({
4791
+ id: index.getTranslation(`module.${module2}.modal.settings.button.save`),
4792
+ defaultMessage: "Save"
4793
+ }) })
4794
+ ] })
4795
+ ] }) }) });
4796
+ };
4797
+ class TranslateWithAi {
4798
+ translationGateway;
4799
+ constructor() {
4800
+ this.translationGateway = index.Registry.getInstance().inject("translationGateway");
4801
+ }
4802
+ async execute(input) {
4803
+ return await this.translationGateway.aiTranslate(input);
4804
+ }
4805
+ }
4806
+ const BoxInput$1 = styled__default.default(designSystem.Box)`
4807
+ flex: 1;
4808
+ display: flex;
4809
+ width: 100%;
4810
+ flex-direction: column;
4811
+ & > div {
4812
+ width: 100%;
4813
+ }
4814
+ `;
4815
+ const TranslationAiModal = ({ open, locales, close }) => {
4816
+ const [module2] = React.useState(index.config.uuid.modules.translation);
4817
+ const [hidden, setHidden] = React.useState(true);
4818
+ const [sourceLocale, setSourceLocale] = React.useState();
4819
+ const [targetLocales, setTargetLocales] = React.useState([]);
4820
+ const [overwrite, setOverwrite] = React.useState(false);
4821
+ const [translateInProgress, setTranslateInProgress] = React.useState(false);
4822
+ const [result, setResult] = React.useState();
4823
+ const [error, setError] = React.useState("");
4824
+ const { formatMessage } = reactIntl.useIntl();
4825
+ function changeSourceLocale(code) {
4826
+ setSourceLocale(code);
4827
+ setTargetLocales([]);
4828
+ setResult(void 0);
4829
+ setError("");
4830
+ }
4831
+ function toggleTargetLocale(code) {
4832
+ if (targetLocales.includes(code)) {
4833
+ setTargetLocales(targetLocales.filter((locale) => locale !== code));
4834
+ return;
4835
+ }
4836
+ setTargetLocales([...targetLocales, code]);
4837
+ }
4838
+ function selectAllTargetLocales() {
4839
+ const available = locales.filter((locale) => locale.code !== sourceLocale).map((locale) => locale.code);
4840
+ setTargetLocales(targetLocales.length === available.length ? [] : available);
4841
+ }
4842
+ async function translate() {
4843
+ if (translateInProgress || !sourceLocale || targetLocales.length === 0) return;
4844
+ setTranslateInProgress(true);
4845
+ setResult(void 0);
4846
+ setError("");
4847
+ try {
4848
+ const translateWithAi = new TranslateWithAi();
4849
+ const output = await translateWithAi.execute({ sourceLocale, targetLocales, overwrite });
4850
+ setResult(output);
4851
+ } catch (e) {
4852
+ setError(
4853
+ e?.response?.data?.error?.message || e?.message || formatMessage({
4854
+ id: index.getTranslation(`module.${module2}.modal.ai.error`),
4855
+ defaultMessage: "The translation request failed"
4856
+ })
4857
+ );
4858
+ }
4859
+ setTranslateInProgress(false);
4860
+ }
4861
+ function handleClose() {
4862
+ if (translateInProgress) return;
4863
+ const refresh = !!result && result.translated > 0;
4864
+ setSourceLocale(void 0);
4865
+ setTargetLocales([]);
4866
+ setOverwrite(false);
4867
+ setResult(void 0);
4868
+ setError("");
4869
+ close(refresh);
4870
+ }
4871
+ React.useEffect(() => {
4872
+ if (!open) {
4873
+ setHidden(true);
4874
+ return;
4875
+ }
4876
+ const defaultLocale = locales.find((locale) => locale.isDefault);
4877
+ setSourceLocale(defaultLocale?.code);
4878
+ setTargetLocales([]);
4879
+ setOverwrite(false);
4880
+ setResult(void 0);
4881
+ setError("");
4882
+ setHidden(false);
4883
+ }, [open]);
4884
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hidden && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { defaultOpen: true, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
4885
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { style: { textAlign: "left" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { style: { width: "100%", justifyContent: "space-between" }, children: [
4886
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: formatMessage({
4887
+ id: index.getTranslation(`module.${module2}.modal.ai.title`),
4888
+ defaultMessage: "Translate with AI"
4889
+ }) }),
4890
+ !translateInProgress && /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { variant: "tertiary", onClick: handleClose, label: "Close", borderWidth: 0, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {}) })
4891
+ ] }) }),
4892
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { display: "flex", flexDirection: "column", width: "100%" }, children: [
4893
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", style: { paddingBottom: "5px" }, children: formatMessage({
4894
+ id: index.getTranslation(`module.${module2}.modal.ai.input.source.title`),
4895
+ defaultMessage: "Base language"
4896
+ }) }),
4897
+ /* @__PURE__ */ jsxRuntime.jsx(
4898
+ designSystem.Typography,
4899
+ {
4900
+ variant: "pi",
4901
+ style: { paddingBottom: "5px", color: "#a5a5ba", display: "flex" },
4902
+ children: formatMessage({
4903
+ id: index.getTranslation(`module.${module2}.modal.ai.input.source.description`),
4904
+ defaultMessage: "The language the entries are translated from"
4905
+ })
4906
+ }
4907
+ ),
4908
+ /* @__PURE__ */ jsxRuntime.jsx(BoxInput$1, { children: /* @__PURE__ */ jsxRuntime.jsx(
4909
+ designSystem.SingleSelect,
4910
+ {
4911
+ onChange: (value) => changeSourceLocale(value),
4912
+ value: sourceLocale,
4913
+ disabled: translateInProgress,
4914
+ children: locales.map((locale, index2) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: locale.code, children: locale.name }, index2))
4915
+ }
4916
+ ) }),
4917
+ sourceLocale && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4918
+ /* @__PURE__ */ jsxRuntime.jsxs(
4919
+ designSystem.Flex,
4920
+ {
4921
+ style: {
4922
+ justifyContent: "space-between",
4923
+ alignItems: "end",
4924
+ paddingTop: "24px",
4925
+ paddingBottom: "5px"
4926
+ },
4927
+ children: [
4928
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: formatMessage({
4929
+ id: index.getTranslation(`module.${module2}.modal.ai.input.targets.title`),
4930
+ defaultMessage: "Languages to translate to"
4931
+ }) }),
4932
+ /* @__PURE__ */ jsxRuntime.jsx(
4933
+ designSystem.Button,
4934
+ {
4935
+ variant: "tertiary",
4936
+ size: "S",
4937
+ onClick: selectAllTargetLocales,
4938
+ disabled: translateInProgress,
4939
+ children: formatMessage({
4940
+ id: index.getTranslation(`module.${module2}.modal.ai.input.targets.select-all`),
4941
+ defaultMessage: "Select all"
4942
+ })
4943
+ }
4944
+ )
4945
+ ]
4946
+ }
4947
+ ),
4948
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: locales.filter((locale) => locale.code !== sourceLocale).map((locale) => /* @__PURE__ */ jsxRuntime.jsx(
4949
+ designSystem.Checkbox,
4950
+ {
4951
+ checked: targetLocales.includes(locale.code),
4952
+ disabled: translateInProgress,
4953
+ onCheckedChange: () => toggleTargetLocale(locale.code),
4954
+ children: locale.name
4955
+ },
4956
+ locale.code
4957
+ )) }),
4958
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", style: { paddingBottom: "5px", paddingTop: "24px" }, children: formatMessage({
4959
+ id: index.getTranslation(`module.${module2}.modal.ai.input.overwrite.title`),
4960
+ defaultMessage: "Overwrite existing translations"
4961
+ }) }),
4962
+ /* @__PURE__ */ jsxRuntime.jsx(
4963
+ designSystem.Typography,
4964
+ {
4965
+ variant: "pi",
4966
+ style: { paddingBottom: "5px", color: "#a5a5ba", display: "flex" },
4967
+ children: formatMessage({
4968
+ id: index.getTranslation(`module.${module2}.modal.ai.input.overwrite.description`),
4969
+ defaultMessage: "When disabled only the missing translations are generated"
4970
+ })
4971
+ }
4972
+ ),
4973
+ /* @__PURE__ */ jsxRuntime.jsx(
4974
+ designSystem.Toggle,
4975
+ {
4976
+ onLabel: "True",
4977
+ offLabel: "False",
4978
+ checked: overwrite,
4979
+ disabled: translateInProgress,
4980
+ onChange: (e) => setOverwrite(e.target.checked)
4981
+ }
4982
+ )
4983
+ ] }),
4984
+ translateInProgress && /* @__PURE__ */ jsxRuntime.jsxs(
4985
+ designSystem.Card,
4986
+ {
4987
+ shadow: false,
4988
+ style: {
4989
+ marginTop: "20px",
4990
+ padding: "10px",
4991
+ display: "flex",
4992
+ alignItems: "center"
4993
+ },
4994
+ children: [
4995
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true }),
4996
+ /* @__PURE__ */ jsxRuntime.jsx(
4997
+ designSystem.Typography,
4998
+ {
4999
+ variant: "pi",
5000
+ style: { color: "#a5a5ba", display: "flex", marginLeft: "10px" },
5001
+ children: formatMessage({
5002
+ id: index.getTranslation(`module.${module2}.modal.ai.progress`),
5003
+ defaultMessage: "Translating. This can take a few minutes, please keep this window open"
5004
+ })
5005
+ }
5006
+ )
5007
+ ]
5008
+ }
5009
+ ),
5010
+ result && !translateInProgress && /* @__PURE__ */ jsxRuntime.jsxs(
5011
+ designSystem.Card,
5012
+ {
5013
+ shadow: false,
5014
+ style: {
5015
+ marginTop: "20px",
5016
+ padding: "10px",
5017
+ display: "flex",
5018
+ flexDirection: "column",
5019
+ alignItems: "start",
5020
+ gap: "5px"
5021
+ },
5022
+ children: [
5023
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: { display: "flex" }, children: formatMessage(
5024
+ {
5025
+ id: index.getTranslation(`module.${module2}.modal.ai.result`),
5026
+ defaultMessage: "{translated} translated, {skipped} skipped, {failed} failed"
5027
+ },
5028
+ {
5029
+ translated: result.translated,
5030
+ skipped: result.skipped,
5031
+ failed: result.failed
5032
+ }
5033
+ ) }),
5034
+ result.errors.map((message, index2) => /* @__PURE__ */ jsxRuntime.jsx(
5035
+ designSystem.Typography,
5036
+ {
5037
+ variant: "pi",
5038
+ style: { color: "#ee5e52", display: "flex" },
5039
+ children: message
5040
+ },
5041
+ index2
5042
+ ))
5043
+ ]
5044
+ }
5045
+ ),
5046
+ error && !translateInProgress && /* @__PURE__ */ jsxRuntime.jsx(
5047
+ designSystem.Card,
5048
+ {
5049
+ shadow: false,
5050
+ style: {
5051
+ marginTop: "20px",
5052
+ padding: "10px",
5053
+ display: "flex",
5054
+ alignItems: "center"
5055
+ },
5056
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: { color: "#ee5e52", display: "flex" }, children: error })
5057
+ }
5058
+ )
5059
+ ] }) }),
5060
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { style: { justifyContent: "end", gap: "5px" }, children: [
5061
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: handleClose, disabled: translateInProgress, children: formatMessage({
5062
+ id: index.getTranslation(`app.modal.confirm.button.cancel`),
5063
+ defaultMessage: "Cancel"
5064
+ }) }),
5065
+ /* @__PURE__ */ jsxRuntime.jsx(
5066
+ designSystem.Button,
5067
+ {
5068
+ style: { marginRight: "5px" },
5069
+ onClick: translate,
5070
+ disabled: translateInProgress || !sourceLocale || targetLocales.length === 0,
5071
+ children: formatMessage({
5072
+ id: index.getTranslation(`module.${module2}.modal.ai.button.translate`),
5073
+ defaultMessage: "Translate"
5074
+ })
5075
+ }
5076
+ )
5077
+ ] })
5078
+ ] }) }) });
5079
+ };
4592
5080
  const CustomCard = styled__default.default(designSystem.Card)`
4593
5081
  min-width: 32px;
4594
5082
  height: 32px;
@@ -4609,6 +5097,8 @@ const TranslationSettingsPage = () => {
4609
5097
  const [selectedRecords, setSelectedRecords] = React.useState([]);
4610
5098
  const [selectedRecord, setSelectedRecord] = React.useState();
4611
5099
  const [showHandleDataModal, setShowHandleDataModal] = React.useState(false);
5100
+ const [showSettingsModal, setShowSettingsModal] = React.useState(false);
5101
+ const [showAiModal, setShowAiModal] = React.useState(false);
4612
5102
  const [searchTerm, setSearchTerm] = React.useState("");
4613
5103
  const { formatMessage } = reactIntl.useIntl();
4614
5104
  const settings = useSettings();
@@ -4645,7 +5135,7 @@ const TranslationSettingsPage = () => {
4645
5135
  return Object.values(groupedMap);
4646
5136
  }
4647
5137
  async function fetchLocales() {
4648
- const fetchLocales2 = new convertToSlug.FetchLocales();
5138
+ const fetchLocales2 = new index.FetchLocales();
4649
5139
  const fetchLocalesOutput = await fetchLocales2.execute();
4650
5140
  setI18nLocales(fetchLocalesOutput);
4651
5141
  }
@@ -4745,6 +5235,31 @@ const TranslationSettingsPage = () => {
4745
5235
  children: formatMessage({ id: index.getTranslation("app.create-new-entry") })
4746
5236
  }
4747
5237
  ),
5238
+ settings.provide(module2).aiEnabled && /* @__PURE__ */ jsxRuntime.jsx(
5239
+ designSystem.Button,
5240
+ {
5241
+ variant: "secondary",
5242
+ size: "S",
5243
+ style: { marginRight: "10px" },
5244
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Sparkle, {}),
5245
+ onClick: () => setShowAiModal(true),
5246
+ children: formatMessage({
5247
+ id: index.getTranslation(`module.${module2}.button.translate-with-ai`),
5248
+ defaultMessage: "Translate with AI"
5249
+ })
5250
+ }
5251
+ ),
5252
+ /* @__PURE__ */ jsxRuntime.jsx(
5253
+ designSystem.Button,
5254
+ {
5255
+ variant: "secondary",
5256
+ size: "S",
5257
+ style: { marginRight: "10px" },
5258
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.BulletList, {}),
5259
+ onClick: () => setShowSettingsModal(true),
5260
+ children: formatMessage({ id: index.getTranslation("app.settings") })
5261
+ }
5262
+ ),
4748
5263
  !settings.provide(module2).active && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "danger", size: "S", onClick: () => toggleState(true), children: formatMessage({ id: index.getTranslation("app.disabled") }) }),
4749
5264
  settings.provide(module2).active && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { size: "S", onClick: () => toggleState(false), children: formatMessage({ id: index.getTranslation("app.enabled") }) })
4750
5265
  ]
@@ -4953,6 +5468,20 @@ const TranslationSettingsPage = () => {
4953
5468
  }
4954
5469
  }
4955
5470
  ),
5471
+ /* @__PURE__ */ jsxRuntime.jsx(TranslationSettingsModal, { open: showSettingsModal, close: () => setShowSettingsModal(false) }),
5472
+ /* @__PURE__ */ jsxRuntime.jsx(
5473
+ TranslationAiModal,
5474
+ {
5475
+ open: showAiModal,
5476
+ locales: i18nLocales,
5477
+ close: (refresh) => {
5478
+ setShowAiModal(false);
5479
+ if (refresh) {
5480
+ fetchRecords();
5481
+ }
5482
+ }
5483
+ }
5484
+ ),
4956
5485
  /* @__PURE__ */ jsxRuntime.jsx(
4957
5486
  TranslationHandleDataModal,
4958
5487
  {
@@ -5114,7 +5643,7 @@ const TemplateHandleDataModal = ({ open, close, data, currentRecords }) => {
5114
5643
  value: form.uid,
5115
5644
  hasError: submitted && (isEmpty(form.uid) || uidExist),
5116
5645
  onChange: (e) => {
5117
- const convertedText = convertToSlug.convertToSlug(e.target.value);
5646
+ const convertedText = index.convertToSlug(e.target.value);
5118
5647
  setForm({ ...form, uid: convertedText });
5119
5648
  checkUidExist(e.target.value);
5120
5649
  }