@cundi/refine-xaf 1.0.3 → 1.0.4

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/dist/index.mjs CHANGED
@@ -719,11 +719,207 @@ var validatePasswordStrength = (password) => {
719
719
  return { isValid: true, message: "Password is strong" };
720
720
  };
721
721
 
722
+ // src/i18n/index.ts
723
+ var en = {
724
+ pages: {
725
+ login: {
726
+ title: "Sign in to your account",
727
+ buttons: {
728
+ submit: "Sign in"
729
+ }
730
+ }
731
+ },
732
+ buttons: {
733
+ create: "Create",
734
+ edit: "Edit",
735
+ delete: "Delete",
736
+ save: "Save",
737
+ cancel: "Cancel",
738
+ refresh: "Refresh",
739
+ list: "List",
740
+ logout: "Logout"
741
+ },
742
+ actions: {
743
+ create: "Create",
744
+ edit: "Edit",
745
+ show: "Show",
746
+ list: "List",
747
+ delete: "Delete"
748
+ },
749
+ components: {
750
+ header: {
751
+ theme: {
752
+ light: "Light Mode",
753
+ dark: "Dark Mode"
754
+ },
755
+ language: {
756
+ en: "English",
757
+ "zh-TW": "Traditional Chinese"
758
+ },
759
+ menu: {
760
+ changePhoto: "Change Photo",
761
+ manageAccount: "Manage Account in Keycloak",
762
+ changePassword: "Change Password",
763
+ logout: "Logout"
764
+ }
765
+ },
766
+ base64Upload: {
767
+ upload: "Upload"
768
+ },
769
+ relatedList: {
770
+ addDetail: "Add Detail",
771
+ actions: "Actions",
772
+ manageDetail: "Manage Detail",
773
+ deleteConfirm: "Are you sure you want to delete this detail?"
774
+ },
775
+ smartList: {
776
+ search: "Search...",
777
+ refresh: "Refresh",
778
+ columns: "Columns",
779
+ selectColumns: "Select Columns",
780
+ reset: "Reset"
781
+ },
782
+ tiptapEditor: {
783
+ placeholder: "Write something...",
784
+ textColor: "Text Color",
785
+ highlight: "Highlight",
786
+ insertTable: "Insert Table",
787
+ deleteTable: "Delete Table",
788
+ emoji: "Emoji",
789
+ addRowBefore: "Add Row Before",
790
+ addRowAfter: "Add Row After",
791
+ deleteRow: "Delete Row",
792
+ addColumnBefore: "Add Column Before",
793
+ addColumnAfter: "Add Column After",
794
+ deleteColumn: "Delete Column",
795
+ math: "Math (LaTeX)",
796
+ youtube: "YouTube",
797
+ enterYoutubeUrl: "Enter YouTube URL"
798
+ }
799
+ },
800
+ common: {
801
+ actions: {
802
+ create: "Create",
803
+ edit: "Edit",
804
+ delete: "Delete",
805
+ save: "Save",
806
+ cancel: "Cancel"
807
+ }
808
+ },
809
+ sider: {
810
+ dashboard: "Dashboard",
811
+ dataTypeExamples: "Data Type Examples",
812
+ tiptapExamples: "Tiptap Examples",
813
+ users: "Users",
814
+ roles: "Roles",
815
+ settings: "Settings"
816
+ }
817
+ };
818
+ var zhTW = {
819
+ pages: {
820
+ login: {
821
+ title: "\u767B\u5165\u60A8\u7684\u5E33\u6236",
822
+ buttons: {
823
+ submit: "\u767B\u5165"
824
+ }
825
+ }
826
+ },
827
+ buttons: {
828
+ create: "\u65B0\u589E",
829
+ edit: "\u7DE8\u8F2F",
830
+ delete: "\u522A\u9664",
831
+ save: "\u5132\u5B58",
832
+ cancel: "\u53D6\u6D88",
833
+ refresh: "\u91CD\u65B0\u6574\u7406",
834
+ list: "\u5217\u8868",
835
+ logout: "\u767B\u51FA"
836
+ },
837
+ actions: {
838
+ create: "\u65B0\u589E",
839
+ edit: "\u7DE8\u8F2F",
840
+ show: "\u986F\u793A",
841
+ list: "\u5217\u8868",
842
+ delete: "\u522A\u9664"
843
+ },
844
+ components: {
845
+ header: {
846
+ theme: {
847
+ light: "\u5207\u63DB\u70BA\u4EAE\u8272\u6A21\u5F0F",
848
+ dark: "\u5207\u63DB\u70BA\u6697\u8272\u6A21\u5F0F"
849
+ },
850
+ language: {
851
+ en: "English",
852
+ "zh-TW": "\u7E41\u9AD4\u4E2D\u6587"
853
+ },
854
+ menu: {
855
+ changePhoto: "\u66F4\u63DB\u982D\u50CF",
856
+ manageAccount: "\u5728 Keycloak \u7BA1\u7406\u5E33\u865F",
857
+ changePassword: "\u8B8A\u66F4\u5BC6\u78BC",
858
+ logout: "\u767B\u51FA"
859
+ }
860
+ },
861
+ base64Upload: {
862
+ upload: "\u4E0A\u50B3"
863
+ },
864
+ relatedList: {
865
+ addDetail: "\u65B0\u589E\u660E\u7D30",
866
+ actions: "\u64CD\u4F5C",
867
+ manageDetail: "\u7BA1\u7406\u660E\u7D30",
868
+ deleteConfirm: "\u60A8\u78BA\u5B9A\u8981\u522A\u9664\u6B64\u9805\u76EE\u55CE\uFF1F"
869
+ },
870
+ smartList: {
871
+ search: "\u641C\u5C0B...",
872
+ refresh: "\u91CD\u65B0\u6574\u7406",
873
+ columns: "\u6B04\u4F4D",
874
+ selectColumns: "\u9078\u64C7\u6B04\u4F4D",
875
+ reset: "\u91CD\u7F6E"
876
+ },
877
+ tiptapEditor: {
878
+ placeholder: "\u8F38\u5165\u5167\u5BB9...",
879
+ textColor: "\u6587\u5B57\u984F\u8272",
880
+ highlight: "\u87A2\u5149\u7B46",
881
+ insertTable: "\u63D2\u5165\u8868\u683C",
882
+ deleteTable: "\u522A\u9664\u8868\u683C",
883
+ emoji: "\u8868\u60C5\u7B26\u865F",
884
+ addRowBefore: "\u5728\u4E0A\u65B9\u63D2\u5165\u5217",
885
+ addRowAfter: "\u5728\u4E0B\u65B9\u63D2\u5165\u5217",
886
+ deleteRow: "\u522A\u9664\u5217",
887
+ addColumnBefore: "\u5728\u5DE6\u65B9\u63D2\u5165\u6B04",
888
+ addColumnAfter: "\u5728\u53F3\u65B9\u63D2\u5165\u6B04",
889
+ deleteColumn: "\u522A\u9664\u6B04",
890
+ math: "\u6578\u5B78\u516C\u5F0F (LaTeX)",
891
+ youtube: "YouTube \u5F71\u7247",
892
+ enterYoutubeUrl: "\u8F38\u5165 YouTube \u7DB2\u5740"
893
+ }
894
+ },
895
+ common: {
896
+ actions: {
897
+ create: "\u65B0\u589E",
898
+ edit: "\u7DE8\u8F2F",
899
+ delete: "\u522A\u9664",
900
+ save: "\u5132\u5B58",
901
+ cancel: "\u53D6\u6D88"
902
+ }
903
+ },
904
+ sider: {
905
+ dashboard: "\u5100\u8868\u677F",
906
+ dataTypeExamples: "\u8CC7\u6599\u985E\u578B\u7BC4\u4F8B",
907
+ tiptapExamples: "Tiptap \u7BC4\u4F8B",
908
+ users: "\u4F7F\u7528\u8005",
909
+ roles: "\u89D2\u8272",
910
+ settings: "\u8A2D\u5B9A"
911
+ }
912
+ };
913
+ var refineXafTranslations = {
914
+ en,
915
+ "zh-TW": zhTW
916
+ };
917
+
722
918
  // src/components/Header.tsx
723
919
  import React3, { useState as useState2, useEffect as useEffect2 } from "react";
724
920
  import { useLogout, useGetIdentity, useInvalidate, useUpdatePassword } from "@refinedev/core";
725
921
  import { Layout, Button, Space, Typography, Avatar, theme as theme2, Dropdown, Modal, Form, Input, message } from "antd/lib";
726
- import { LogoutOutlined, UserOutlined, DownOutlined, SunOutlined, MoonOutlined, CameraOutlined, LockOutlined, ThunderboltOutlined } from "@ant-design/icons";
922
+ import { LogoutOutlined, UserOutlined, DownOutlined, SunOutlined, MoonOutlined, CameraOutlined, LockOutlined, ThunderboltOutlined, GlobalOutlined } from "@ant-design/icons";
727
923
 
728
924
  // src/contexts/color-mode.tsx
729
925
  import React, {
@@ -790,7 +986,9 @@ var useColorMode = () => {
790
986
  // src/components/Base64Upload.tsx
791
987
  import React2 from "react";
792
988
  import { Upload } from "antd/lib";
989
+ import { useTranslation } from "react-i18next";
793
990
  var Base64Upload = ({ value, onChange }) => {
991
+ const { t } = useTranslation();
794
992
  return /* @__PURE__ */ React2.createElement(
795
993
  Upload,
796
994
  {
@@ -808,11 +1006,12 @@ var Base64Upload = ({ value, onChange }) => {
808
1006
  return false;
809
1007
  }
810
1008
  },
811
- value ? /* @__PURE__ */ React2.createElement("img", { src: `data:image/png;base64,${value}`, alt: "avatar", style: { width: "100%" } }) : /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("div", { style: { marginTop: 8 } }, "Upload"))
1009
+ value ? /* @__PURE__ */ React2.createElement("img", { src: `data:image/png;base64,${value}`, alt: "avatar", style: { width: "100%" } }) : /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("div", { style: { marginTop: 8 } }, t("components.base64Upload.upload", "Upload")))
812
1010
  );
813
1011
  };
814
1012
 
815
1013
  // src/components/Header.tsx
1014
+ import { useTranslation as useTranslation2 } from "react-i18next";
816
1015
  var { Text } = Typography;
817
1016
  var { useToken } = theme2;
818
1017
  var Header = () => {
@@ -822,6 +1021,11 @@ var Header = () => {
822
1021
  const { mode, setMode } = useColorMode();
823
1022
  const { token } = useToken();
824
1023
  const invalidate = useInvalidate();
1024
+ const { t: translate, i18n } = useTranslation2();
1025
+ const currentLocale = i18n.language;
1026
+ const handleLanguageChange = (lang) => {
1027
+ i18n.changeLanguage(lang);
1028
+ };
825
1029
  const [authProvider2, setAuthProvider] = useState2(null);
826
1030
  useEffect2(() => {
827
1031
  if (user) {
@@ -892,7 +1096,7 @@ var Header = () => {
892
1096
  },
893
1097
  {
894
1098
  key: "change-photo",
895
- label: "Change Photo",
1099
+ label: translate("components.header.menu.changePhoto", "Change Photo"),
896
1100
  icon: /* @__PURE__ */ React3.createElement(CameraOutlined, null),
897
1101
  onClick: () => {
898
1102
  photoForm.setFieldsValue({ Photo: user?.avatar?.replace("data:image/png;base64,", "") });
@@ -901,7 +1105,7 @@ var Header = () => {
901
1105
  },
902
1106
  {
903
1107
  key: "change-password",
904
- label: authProvider2 === "keycloak" ? "Manage Account in Keycloak" : "Change Password",
1108
+ label: authProvider2 === "keycloak" ? translate("components.header.menu.manageAccount", "Manage Account in Keycloak") : translate("components.header.menu.changePassword", "Change Password"),
905
1109
  icon: /* @__PURE__ */ React3.createElement(LockOutlined, null),
906
1110
  onClick: () => {
907
1111
  if (authProvider2 === "keycloak") {
@@ -920,13 +1124,13 @@ var Header = () => {
920
1124
  },
921
1125
  {
922
1126
  key: "theme",
923
- label: mode === "light" ? "Dark Theme" : "Light Theme",
1127
+ label: mode === "light" ? translate("components.header.theme.dark", "Dark Theme") : translate("components.header.theme.light", "Light Theme"),
924
1128
  icon: mode === "light" ? /* @__PURE__ */ React3.createElement(MoonOutlined, null) : /* @__PURE__ */ React3.createElement(SunOutlined, null),
925
1129
  onClick: () => setMode(mode === "light" ? "dark" : "light")
926
1130
  },
927
1131
  {
928
1132
  key: "logout",
929
- label: "Logout",
1133
+ label: translate("components.header.menu.logout", "Logout"),
930
1134
  icon: /* @__PURE__ */ React3.createElement(LogoutOutlined, null),
931
1135
  onClick: () => logout()
932
1136
  }
@@ -946,7 +1150,29 @@ var Header = () => {
946
1150
  zIndex: 1
947
1151
  }
948
1152
  },
949
- /* @__PURE__ */ React3.createElement(Space, null, /* @__PURE__ */ React3.createElement(Dropdown, { menu: { items: menuItems }, trigger: ["click"] }, /* @__PURE__ */ React3.createElement(Button, { type: "text", style: { height: 48 } }, /* @__PURE__ */ React3.createElement(Space, null, /* @__PURE__ */ React3.createElement(Avatar, { src: user?.avatar, alt: user?.name, icon: /* @__PURE__ */ React3.createElement(UserOutlined, null) }), /* @__PURE__ */ React3.createElement(Text, null, user?.name), /* @__PURE__ */ React3.createElement(DownOutlined, { style: { fontSize: 12 } }))))),
1153
+ /* @__PURE__ */ React3.createElement(Space, null, /* @__PURE__ */ React3.createElement(
1154
+ Dropdown,
1155
+ {
1156
+ menu: {
1157
+ items: [
1158
+ {
1159
+ key: "en",
1160
+ label: translate("components.header.language.en", "English"),
1161
+ onClick: () => handleLanguageChange("en"),
1162
+ disabled: currentLocale === "en"
1163
+ },
1164
+ {
1165
+ key: "zh-TW",
1166
+ label: translate("components.header.language.zh-TW", "\u7E41\u9AD4\u4E2D\u6587"),
1167
+ onClick: () => handleLanguageChange("zh-TW"),
1168
+ disabled: currentLocale === "zh-TW"
1169
+ }
1170
+ ]
1171
+ },
1172
+ trigger: ["click"]
1173
+ },
1174
+ /* @__PURE__ */ React3.createElement(Button, { type: "text", icon: /* @__PURE__ */ React3.createElement(GlobalOutlined, null) }, currentLocale === "zh-TW" ? "\u7E41\u9AD4\u4E2D\u6587" : "English", " ", /* @__PURE__ */ React3.createElement(DownOutlined, null))
1175
+ ), /* @__PURE__ */ React3.createElement(Dropdown, { menu: { items: menuItems }, trigger: ["click"] }, /* @__PURE__ */ React3.createElement(Button, { type: "text", style: { height: 48 } }, /* @__PURE__ */ React3.createElement(Space, null, /* @__PURE__ */ React3.createElement(Avatar, { src: user?.avatar, alt: user?.name, icon: /* @__PURE__ */ React3.createElement(UserOutlined, null) }), /* @__PURE__ */ React3.createElement(Text, null, user?.name), /* @__PURE__ */ React3.createElement(DownOutlined, { style: { fontSize: 12 } }))))),
950
1176
  /* @__PURE__ */ React3.createElement(
951
1177
  Modal,
952
1178
  {
@@ -989,11 +1215,13 @@ import {
989
1215
  } from "@refinedev/antd";
990
1216
  import { Table, Form as Form2, Input as Input2, Popover, Checkbox, Button as Button2, Space as Space2 } from "antd/lib";
991
1217
  import { SettingOutlined, ReloadOutlined, SearchOutlined } from "@ant-design/icons";
1218
+ import { useTranslation as useTranslation3 } from "react-i18next";
992
1219
  var SmartList = ({
993
1220
  children,
994
1221
  resource,
995
1222
  searchFields
996
1223
  }) => {
1224
+ const { t } = useTranslation3();
997
1225
  const { tableProps, searchFormProps, tableQuery, setFilters } = useTable({
998
1226
  resource,
999
1227
  syncWithLocation: true,
@@ -1064,7 +1292,7 @@ var SmartList = ({
1064
1292
  setVisibleColumns(defaultVisible);
1065
1293
  localStorage.removeItem(`table-columns-${resource}`);
1066
1294
  };
1067
- const content = /* @__PURE__ */ React4.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, /* @__PURE__ */ React4.createElement("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "4px" } }, /* @__PURE__ */ React4.createElement("span", { style: { fontWeight: 500 } }, "Select Columns"), /* @__PURE__ */ React4.createElement(Button2, { size: "small", type: "link", onClick: handleResetColumns, style: { padding: 0 } }, "Reset")), columns.filter((col) => col.dataIndex !== "actions").map((col) => /* @__PURE__ */ React4.createElement(
1295
+ const content = /* @__PURE__ */ React4.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, /* @__PURE__ */ React4.createElement("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "4px" } }, /* @__PURE__ */ React4.createElement("span", { style: { fontWeight: 500 } }, t("components.smartList.selectColumns", "Select Columns")), /* @__PURE__ */ React4.createElement(Button2, { size: "small", type: "link", onClick: handleResetColumns, style: { padding: 0 } }, t("components.smartList.reset", "Reset"))), columns.filter((col) => col.dataIndex !== "actions").map((col) => /* @__PURE__ */ React4.createElement(
1068
1296
  Checkbox,
1069
1297
  {
1070
1298
  key: col.key,
@@ -1085,7 +1313,7 @@ var SmartList = ({
1085
1313
  return /* @__PURE__ */ React4.createElement(List, null, /* @__PURE__ */ React4.createElement("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: 20 } }, /* @__PURE__ */ React4.createElement(Form2, { ...searchFormProps, layout: "inline" }, /* @__PURE__ */ React4.createElement(Form2.Item, { name: "search" }, /* @__PURE__ */ React4.createElement(
1086
1314
  Input2,
1087
1315
  {
1088
- placeholder: "Search...",
1316
+ placeholder: t("components.smartList.search", "Search..."),
1089
1317
  style: { width: 300 },
1090
1318
  allowClear: true,
1091
1319
  suffix: /* @__PURE__ */ React4.createElement(
@@ -1114,7 +1342,7 @@ var SmartList = ({
1114
1342
  }
1115
1343
  }
1116
1344
  }
1117
- ))), /* @__PURE__ */ React4.createElement(Space2, null, /* @__PURE__ */ React4.createElement(Button2, { icon: /* @__PURE__ */ React4.createElement(ReloadOutlined, null), onClick: () => tableQuery?.refetch() }, "Refresh"), /* @__PURE__ */ React4.createElement(Popover, { content, title: "Columns", trigger: "click", placement: "bottomRight" }, /* @__PURE__ */ React4.createElement(Button2, { icon: /* @__PURE__ */ React4.createElement(SettingOutlined, null) }, "Columns")))), /* @__PURE__ */ React4.createElement(Table, { ...tableProps, rowKey: "Oid" }, filteredChildren));
1345
+ ))), /* @__PURE__ */ React4.createElement(Space2, null, /* @__PURE__ */ React4.createElement(Button2, { icon: /* @__PURE__ */ React4.createElement(ReloadOutlined, null), onClick: () => tableQuery?.refetch() }, t("components.smartList.refresh", "Refresh")), /* @__PURE__ */ React4.createElement(Popover, { content, title: t("components.smartList.columns", "Columns"), trigger: "click", placement: "bottomRight" }, /* @__PURE__ */ React4.createElement(Button2, { icon: /* @__PURE__ */ React4.createElement(SettingOutlined, null) }, t("components.smartList.columns", "Columns"))))), /* @__PURE__ */ React4.createElement(Table, { ...tableProps, rowKey: "Oid" }, filteredChildren));
1118
1346
  };
1119
1347
 
1120
1348
  // src/components/RelatedList.tsx
@@ -1123,6 +1351,7 @@ import { Table as Table2, Button as Button3, Space as Space3, Modal as Modal2, F
1123
1351
  import { EditOutlined, DeleteOutlined, PlusOutlined } from "@ant-design/icons";
1124
1352
  import { useModalForm } from "@refinedev/antd";
1125
1353
  import { useDelete } from "@refinedev/core";
1354
+ import { useTranslation as useTranslation4 } from "react-i18next";
1126
1355
  var DetailModal = ({
1127
1356
  modalForm,
1128
1357
  mode,
@@ -1168,9 +1397,12 @@ var RelatedList = ({
1168
1397
  dataSource,
1169
1398
  onMutationSuccess,
1170
1399
  FormFields,
1171
- modalTitle = "Manage Detail",
1400
+ modalTitle,
1172
1401
  children
1173
1402
  }) => {
1403
+ const { t } = useTranslation4();
1404
+ const defaultTitle = t("components.relatedList.manageDetail", "Manage Detail");
1405
+ const finalModalTitle = modalTitle || defaultTitle;
1174
1406
  const createModalForm = useModalForm({
1175
1407
  resource,
1176
1408
  action: "create",
@@ -1185,7 +1417,7 @@ var RelatedList = ({
1185
1417
  });
1186
1418
  const { mutate: deleteMutate } = useDelete();
1187
1419
  const handleDelete = (id) => {
1188
- if (confirm("Are you sure you want to delete this detail?")) {
1420
+ if (confirm(t("components.relatedList.deleteConfirm", "Are you sure you want to delete this detail?"))) {
1189
1421
  deleteMutate({
1190
1422
  resource,
1191
1423
  id,
@@ -1204,7 +1436,7 @@ var RelatedList = ({
1204
1436
  disabled: !masterId,
1205
1437
  "data-testid": "add-detail-btn"
1206
1438
  },
1207
- "Add Detail"
1439
+ t("components.relatedList.addDetail", "Add Detail")
1208
1440
  )), /* @__PURE__ */ React5.createElement(
1209
1441
  Table2,
1210
1442
  {
@@ -1218,7 +1450,7 @@ var RelatedList = ({
1218
1450
  /* @__PURE__ */ React5.createElement(
1219
1451
  Table2.Column,
1220
1452
  {
1221
- title: "Actions",
1453
+ title: t("components.relatedList.actions", "Actions"),
1222
1454
  key: "actions",
1223
1455
  width: 120,
1224
1456
  render: (_, record) => /* @__PURE__ */ React5.createElement(Space3, null, /* @__PURE__ */ React5.createElement(
@@ -1244,7 +1476,7 @@ var RelatedList = ({
1244
1476
  {
1245
1477
  modalForm: createModalForm,
1246
1478
  mode: "create",
1247
- modalTitle,
1479
+ modalTitle: finalModalTitle,
1248
1480
  FormFields,
1249
1481
  masterField,
1250
1482
  masterId
@@ -1254,7 +1486,7 @@ var RelatedList = ({
1254
1486
  {
1255
1487
  modalForm: editModalForm,
1256
1488
  mode: "edit",
1257
- modalTitle,
1489
+ modalTitle: finalModalTitle,
1258
1490
  FormFields,
1259
1491
  masterField,
1260
1492
  masterId
@@ -1264,6 +1496,7 @@ var RelatedList = ({
1264
1496
 
1265
1497
  // src/components/TiptapEditor.tsx
1266
1498
  import React6, { useEffect as useEffect4 } from "react";
1499
+ import { useTranslation as useTranslation5 } from "react-i18next";
1267
1500
  import { useEditor, EditorContent } from "@tiptap/react";
1268
1501
  import StarterKit from "@tiptap/starter-kit";
1269
1502
  import Image from "@tiptap/extension-image";
@@ -18510,6 +18743,7 @@ import {
18510
18743
  } from "@ant-design/icons";
18511
18744
  var TiptapEditor = ({ value, onChange, disabled }) => {
18512
18745
  const { token } = theme3.useToken();
18746
+ const { t } = useTranslation5();
18513
18747
  const editor = useEditor({
18514
18748
  extensions: [
18515
18749
  StarterKit,
@@ -18540,7 +18774,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18540
18774
  TextStyle,
18541
18775
  Color,
18542
18776
  index_default.configure({
18543
- placeholder: "Write something..."
18777
+ placeholder: t("components.tiptapEditor.placeholder", "Write something...")
18544
18778
  })
18545
18779
  ],
18546
18780
  content: value,
@@ -18625,7 +18859,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18625
18859
  onClick: () => editor.chain().focus().toggleHighlight().run(),
18626
18860
  disabled,
18627
18861
  size: "small",
18628
- title: "Highlight"
18862
+ title: t("components.tiptapEditor.highlight", "Highlight")
18629
18863
  }
18630
18864
  ), /* @__PURE__ */ React6.createElement(
18631
18865
  ColorPicker,
@@ -18643,7 +18877,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18643
18877
  icon: /* @__PURE__ */ React6.createElement(FontColorsOutlined, { style: { color: editor.getAttributes("textStyle").color } }),
18644
18878
  disabled,
18645
18879
  size: "small",
18646
- title: "Text Color"
18880
+ title: t("components.tiptapEditor.textColor", "Text Color")
18647
18881
  }
18648
18882
  )
18649
18883
  ), /* @__PURE__ */ React6.createElement(
@@ -18708,7 +18942,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18708
18942
  onClick: () => editor.chain().focus().toggleMath().run(),
18709
18943
  disabled,
18710
18944
  size: "small",
18711
- title: "Math (LaTeX)"
18945
+ title: t("components.tiptapEditor.math", "Math (LaTeX)")
18712
18946
  }
18713
18947
  ), /* @__PURE__ */ React6.createElement(
18714
18948
  Button4,
@@ -18716,14 +18950,14 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18716
18950
  type: editor.isActive("youtube") ? "primary" : "text",
18717
18951
  icon: /* @__PURE__ */ React6.createElement(YoutubeOutlined, null),
18718
18952
  onClick: () => {
18719
- const url = window.prompt("Enter YouTube URL");
18953
+ const url = window.prompt(t("components.tiptapEditor.enterYoutubeUrl", "Enter YouTube URL"));
18720
18954
  if (url) {
18721
18955
  editor.commands.setYoutubeVideo({ src: url });
18722
18956
  }
18723
18957
  },
18724
18958
  disabled,
18725
18959
  size: "small",
18726
- title: "YouTube"
18960
+ title: t("components.tiptapEditor.youtube", "YouTube")
18727
18961
  }
18728
18962
  ), /* @__PURE__ */ React6.createElement(
18729
18963
  Button4,
@@ -18733,7 +18967,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18733
18967
  onClick: () => editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run(),
18734
18968
  disabled,
18735
18969
  size: "small",
18736
- title: "Insert Table"
18970
+ title: t("components.tiptapEditor.insertTable", "Insert Table")
18737
18971
  }
18738
18972
  ), /* @__PURE__ */ React6.createElement(
18739
18973
  Button4,
@@ -18743,7 +18977,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18743
18977
  onClick: () => editor.chain().focus().deleteTable().run(),
18744
18978
  disabled: !editor.can().deleteTable() || disabled,
18745
18979
  size: "small",
18746
- title: "Delete Table"
18980
+ title: t("components.tiptapEditor.deleteTable", "Delete Table")
18747
18981
  }
18748
18982
  ), /* @__PURE__ */ React6.createElement(
18749
18983
  Popover2,
@@ -18768,7 +19002,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18768
19002
  icon: /* @__PURE__ */ React6.createElement(SmileOutlined, null),
18769
19003
  disabled,
18770
19004
  size: "small",
18771
- title: "Emoji"
19005
+ title: t("components.tiptapEditor.emoji", "Emoji")
18772
19006
  }
18773
19007
  )
18774
19008
  ), editor.isActive("table") && /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(
@@ -18779,7 +19013,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18779
19013
  onClick: () => editor.chain().focus().addRowBefore().run(),
18780
19014
  disabled,
18781
19015
  size: "small",
18782
- title: "Add Row Before"
19016
+ title: t("components.tiptapEditor.addRowBefore", "Add Row Before")
18783
19017
  }
18784
19018
  ), /* @__PURE__ */ React6.createElement(
18785
19019
  Button4,
@@ -18789,7 +19023,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18789
19023
  onClick: () => editor.chain().focus().addRowAfter().run(),
18790
19024
  disabled,
18791
19025
  size: "small",
18792
- title: "Add Row After"
19026
+ title: t("components.tiptapEditor.addRowAfter", "Add Row After")
18793
19027
  }
18794
19028
  ), /* @__PURE__ */ React6.createElement(
18795
19029
  Button4,
@@ -18799,7 +19033,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18799
19033
  onClick: () => editor.chain().focus().deleteRow().run(),
18800
19034
  disabled: !editor.can().deleteRow() || disabled,
18801
19035
  size: "small",
18802
- title: "Delete Row"
19036
+ title: t("components.tiptapEditor.deleteRow", "Delete Row")
18803
19037
  }
18804
19038
  ), /* @__PURE__ */ React6.createElement(
18805
19039
  Button4,
@@ -18809,7 +19043,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18809
19043
  onClick: () => editor.chain().focus().addColumnBefore().run(),
18810
19044
  disabled,
18811
19045
  size: "small",
18812
- title: "Add Column Before"
19046
+ title: t("components.tiptapEditor.addColumnBefore", "Add Column Before")
18813
19047
  }
18814
19048
  ), /* @__PURE__ */ React6.createElement(
18815
19049
  Button4,
@@ -18819,7 +19053,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18819
19053
  onClick: () => editor.chain().focus().addColumnAfter().run(),
18820
19054
  disabled,
18821
19055
  size: "small",
18822
- title: "Add Column After"
19056
+ title: t("components.tiptapEditor.addColumnAfter", "Add Column After")
18823
19057
  }
18824
19058
  ), /* @__PURE__ */ React6.createElement(
18825
19059
  Button4,
@@ -18829,7 +19063,7 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
18829
19063
  onClick: () => editor.chain().focus().deleteColumn().run(),
18830
19064
  disabled: !editor.can().deleteColumn() || disabled,
18831
19065
  size: "small",
18832
- title: "Delete Column"
19066
+ title: t("components.tiptapEditor.deleteColumn", "Delete Column")
18833
19067
  }
18834
19068
  ))), /* @__PURE__ */ React6.createElement(Space4, { style: { marginLeft: "auto" } }, /* @__PURE__ */ React6.createElement(
18835
19069
  Button4,
@@ -19771,6 +20005,7 @@ export {
19771
20005
  httpClient,
19772
20006
  keycloakService,
19773
20007
  parseJwt,
20008
+ refineXafTranslations,
19774
20009
  useColorMode,
19775
20010
  useModelTypes,
19776
20011
  validatePasswordStrength
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cundi/refine-xaf",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Integration SDK for XAF backend and Refine frontend",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -77,6 +77,8 @@
77
77
  "@tiptap/starter-kit": "^3.13.0",
78
78
  "classnames": "^2.5.1",
79
79
  "emoji-picker-react": "^4.16.1",
80
- "katex": "^0.16.27"
80
+ "i18next": "^25.7.3",
81
+ "katex": "^0.16.27",
82
+ "react-i18next": "^16.5.0"
81
83
  }
82
84
  }