@serhii.olishevskyi/docs 1.0.0 → 1.0.2

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.js CHANGED
@@ -32,15 +32,16 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  AIProvider: () => AIProvider,
34
34
  BreadcrumbProvider: () => BreadcrumbProvider,
35
- CardForm: () => CardForm,
36
35
  ConfirmationProvider: () => ConfirmationProvider,
37
36
  LocalizationProvider: () => LocalizationProvider,
37
+ Providers: () => Providers,
38
38
  SupabaseProvider: () => SupabaseProvider,
39
39
  ThemeProvider: () => ThemeProvider,
40
40
  ToastProvider: () => ToastProvider,
41
41
  TranslateProvider: () => TranslateProvider,
42
42
  TranslateText: () => TranslateText,
43
43
  TranslationEditProvider: () => TranslationEditProvider,
44
+ UI: () => UI,
44
45
  useAI: () => useAI,
45
46
  useAppTheme: () => useAppTheme,
46
47
  useBreadcrumb: () => useBreadcrumb,
@@ -53,7 +54,7 @@ __export(index_exports, {
53
54
  });
54
55
  module.exports = __toCommonJS(index_exports);
55
56
 
56
- // src/UI/components/inputs/TextfieldComponent.tsx
57
+ // src/UI/components/inputs/TextFieldComponent.tsx
57
58
  var import_react8 = require("react");
58
59
  var import_material4 = require("@mui/material");
59
60
  var import_Lock = __toESM(require("@mui/icons-material/Lock"));
@@ -62,8 +63,8 @@ var import_Check = __toESM(require("@mui/icons-material/Check"));
62
63
  var import_Clear = __toESM(require("@mui/icons-material/Clear"));
63
64
  var import_Translate3 = __toESM(require("@mui/icons-material/Translate"));
64
65
 
65
- // src/UI/components/inputs/TranslatableTooltip.tsx
66
- var import_material = require("@mui/material");
66
+ // src/UI/components/data.display/TranslatableTooltipComponent.tsx
67
+ var import_material3 = require("@mui/material");
67
68
 
68
69
  // src/context/TranslationEditProvider.tsx
69
70
  var import_react3 = require("react");
@@ -2576,39 +2577,19 @@ var useTranslationEdit = () => {
2576
2577
  return context;
2577
2578
  };
2578
2579
 
2579
- // src/UI/components/inputs/TranslatableTooltip.tsx
2580
- var import_jsx_runtime4 = require("react/jsx-runtime");
2581
- var TranslatableTooltip = ({
2582
- title,
2583
- disableSpan,
2584
- children,
2585
- ...props
2586
- }) => {
2587
- const { isTranslationMode } = useTranslationEdit();
2588
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2589
- import_material.Tooltip,
2590
- {
2591
- title,
2592
- slotProps: {
2593
- popper: {
2594
- sx: isTranslationMode ? {
2595
- pointerEvents: "auto",
2596
- // Разрешаем клики внутри тултипа
2597
- "& .MuiTooltip-tooltip": {
2598
- pointerEvents: "auto"
2599
- }
2600
- } : void 0
2601
- }
2602
- },
2603
- leaveDelay: isTranslationMode ? 1e3 : 100,
2604
- ...props,
2605
- children: disableSpan ? children : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children })
2606
- }
2607
- );
2608
- };
2580
+ // src/i18n/TranslateText.tsx
2581
+ var import_react7 = require("react");
2582
+ var import_react_i18next2 = require("react-i18next");
2583
+ var import_material2 = require("@mui/material");
2584
+ var import_Translate2 = __toESM(require("@mui/icons-material/Translate"));
2585
+ var import_Launch = __toESM(require("@mui/icons-material/Launch"));
2609
2586
 
2610
- // src/UI/components/inputs/TextfieldComponent.tsx
2611
- var import_react_i18next3 = require("react-i18next");
2587
+ // src/i18n/TranslationDialog.tsx
2588
+ var import_react5 = require("react");
2589
+ var import_material = require("@mui/material");
2590
+ var import_AutoFixHigh = __toESM(require("@mui/icons-material/AutoFixHigh"));
2591
+ var import_Translate = __toESM(require("@mui/icons-material/Translate"));
2592
+ var import_Lightbulb = __toESM(require("@mui/icons-material/Lightbulb"));
2612
2593
 
2613
2594
  // src/services/translation.service.ts
2614
2595
  var translationService = {
@@ -2669,24 +2650,10 @@ ${params.contextHint ? `Context Hint: "${params.contextHint}"` : ""}`;
2669
2650
  }
2670
2651
  };
2671
2652
 
2672
- // src/i18n/TranslateText.tsx
2673
- var import_react7 = require("react");
2674
- var import_react_i18next2 = require("react-i18next");
2675
- var import_material3 = require("@mui/material");
2676
- var import_Translate2 = __toESM(require("@mui/icons-material/Translate"));
2677
- var import_Launch = __toESM(require("@mui/icons-material/Launch"));
2678
-
2679
- // src/i18n/TranslationDialog.tsx
2680
- var import_react5 = require("react");
2681
- var import_material2 = require("@mui/material");
2682
- var import_AutoFixHigh = __toESM(require("@mui/icons-material/AutoFixHigh"));
2683
- var import_Translate = __toESM(require("@mui/icons-material/Translate"));
2684
- var import_Lightbulb = __toESM(require("@mui/icons-material/Lightbulb"));
2685
-
2686
2653
  // src/context/AIProvider.tsx
2687
2654
  var import_react4 = require("react");
2688
2655
  var import_genai = require("@google/genai");
2689
- var import_jsx_runtime5 = require("react/jsx-runtime");
2656
+ var import_jsx_runtime4 = require("react/jsx-runtime");
2690
2657
  var AIContext = (0, import_react4.createContext)(null);
2691
2658
  var AIProvider = ({
2692
2659
  children,
@@ -2769,7 +2736,7 @@ var AIProvider = ({
2769
2736
  }
2770
2737
  };
2771
2738
  }, [apiKey, provider, modelName]);
2772
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AIContext.Provider, { value: contextValue, children });
2739
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AIContext.Provider, { value: contextValue, children });
2773
2740
  };
2774
2741
  var useAI = () => {
2775
2742
  const context = (0, import_react4.useContext)(AIContext);
@@ -2780,7 +2747,7 @@ var useAI = () => {
2780
2747
  };
2781
2748
 
2782
2749
  // src/i18n/TranslationDialog.tsx
2783
- var import_jsx_runtime6 = require("react/jsx-runtime");
2750
+ var import_jsx_runtime5 = require("react/jsx-runtime");
2784
2751
  var TranslationDialog = ({
2785
2752
  open,
2786
2753
  onClose,
@@ -2894,8 +2861,8 @@ var TranslationDialog = ({
2894
2861
  onClose();
2895
2862
  };
2896
2863
  const isBusy = loading || saving || isTranslatingAll || translatingCode !== null;
2897
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
2898
- import_material2.Dialog,
2864
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2865
+ import_material.Dialog,
2899
2866
  {
2900
2867
  open,
2901
2868
  onClose: handleClose,
@@ -2904,26 +2871,26 @@ var TranslationDialog = ({
2904
2871
  onClick: (e) => e.stopPropagation(),
2905
2872
  onMouseDown: (e) => e.stopPropagation(),
2906
2873
  children: [
2907
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material2.DialogTitle, { sx: { pb: 1, display: "flex", justifyContent: "space-between", alignItems: "flex-start" }, children: [
2908
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material2.Box, { children: [
2874
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material.DialogTitle, { sx: { pb: 1, display: "flex", justifyContent: "space-between", alignItems: "flex-start" }, children: [
2875
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material.Box, { children: [
2909
2876
  "Context Translation",
2910
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material2.Typography, { component: "div", variant: "subtitle2", color: "text.secondary", sx: { wordBreak: "break-all", mt: 0.5 }, children: [
2877
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material.Typography, { component: "div", variant: "subtitle2", color: "text.secondary", sx: { wordBreak: "break-all", mt: 0.5 }, children: [
2911
2878
  "Original: ",
2912
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("strong", { children: [
2879
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("strong", { children: [
2913
2880
  '"',
2914
2881
  translationKey,
2915
2882
  '"'
2916
2883
  ] })
2917
2884
  ] })
2918
2885
  ] }),
2919
- !loading && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2920
- import_material2.Button,
2886
+ !loading && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2887
+ import_material.Button,
2921
2888
  {
2922
2889
  type: "button",
2923
2890
  size: "small",
2924
2891
  variant: "outlined",
2925
2892
  color: "secondary",
2926
- startIcon: isTranslatingAll ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material2.CircularProgress, { size: 16, color: "inherit" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Translate.default, { fontSize: "small" }),
2893
+ startIcon: isTranslatingAll ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material.CircularProgress, { size: 16, color: "inherit" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Translate.default, { fontSize: "small" }),
2927
2894
  onClick: handleTranslateAll,
2928
2895
  disabled: isBusy,
2929
2896
  sx: { flexShrink: 0, ml: 2, whiteSpace: "nowrap" },
@@ -2931,16 +2898,16 @@ var TranslationDialog = ({
2931
2898
  }
2932
2899
  )
2933
2900
  ] }),
2934
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material2.DialogContent, { dividers: true, sx: { pt: 2 }, children: [
2935
- error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material2.Alert, { severity: "error", onClose: () => setError(null), sx: { mb: 2 }, children: error }),
2936
- loading ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material2.Box, { sx: { display: "flex", justifyContent: "center", py: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material2.CircularProgress, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material2.Box, { sx: { display: "flex", flexDirection: "column", gap: 2.5 }, children: [
2937
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material2.Paper, { variant: "outlined", sx: { p: 2, bgcolor: "action.hover", borderRadius: 2 }, children: [
2938
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material2.Box, { sx: { display: "flex", alignItems: "center", gap: 1, mb: 1 }, children: [
2939
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Lightbulb.default, { color: "warning", fontSize: "small" }),
2940
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material2.Typography, { variant: "subtitle2", sx: { fontWeight: 600 }, children: "Context Hint / Clarification" })
2901
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material.DialogContent, { dividers: true, sx: { pt: 2 }, children: [
2902
+ error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material.Alert, { severity: "error", onClose: () => setError(null), sx: { mb: 2 }, children: error }),
2903
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material.Box, { sx: { display: "flex", justifyContent: "center", py: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material.CircularProgress, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material.Box, { sx: { display: "flex", flexDirection: "column", gap: 2.5 }, children: [
2904
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material.Paper, { variant: "outlined", sx: { p: 2, bgcolor: "action.hover", borderRadius: 2 }, children: [
2905
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material.Box, { sx: { display: "flex", alignItems: "center", gap: 1, mb: 1 }, children: [
2906
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Lightbulb.default, { color: "warning", fontSize: "small" }),
2907
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material.Typography, { variant: "subtitle2", sx: { fontWeight: 600 }, children: "Context Hint / Clarification" })
2941
2908
  ] }),
2942
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2943
- import_material2.TextField,
2909
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2910
+ import_material.TextField,
2944
2911
  {
2945
2912
  fullWidth: true,
2946
2913
  multiline: true,
@@ -2954,9 +2921,9 @@ var TranslationDialog = ({
2954
2921
  }
2955
2922
  )
2956
2923
  ] }),
2957
- languages.map((lang) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material2.Box, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [
2958
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2959
- import_material2.Box,
2924
+ languages.map((lang) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material.Box, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [
2925
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2926
+ import_material.Box,
2960
2927
  {
2961
2928
  sx: {
2962
2929
  width: 32,
@@ -2970,8 +2937,8 @@ var TranslationDialog = ({
2970
2937
  dangerouslySetInnerHTML: { __html: lang.svg_flag }
2971
2938
  }
2972
2939
  ),
2973
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2974
- import_material2.TextField,
2940
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2941
+ import_material.TextField,
2975
2942
  {
2976
2943
  fullWidth: true,
2977
2944
  label: lang.name,
@@ -2982,23 +2949,23 @@ var TranslationDialog = ({
2982
2949
  disabled: isBusy
2983
2950
  }
2984
2951
  ),
2985
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material2.Tooltip, { title: "Translate with context hint", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2986
- import_material2.IconButton,
2952
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material.Tooltip, { title: "Translate with context hint", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2953
+ import_material.IconButton,
2987
2954
  {
2988
2955
  type: "button",
2989
2956
  color: "primary",
2990
2957
  disabled: isBusy,
2991
2958
  onClick: (e) => handleAutoTranslate(e, lang.code),
2992
- children: translatingCode === lang.code ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material2.CircularProgress, { size: 20, color: "inherit" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_AutoFixHigh.default, { fontSize: "small" })
2959
+ children: translatingCode === lang.code ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material.CircularProgress, { size: 20, color: "inherit" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_AutoFixHigh.default, { fontSize: "small" })
2993
2960
  }
2994
2961
  ) }) })
2995
2962
  ] }, lang.code))
2996
2963
  ] })
2997
2964
  ] }),
2998
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material2.DialogActions, { sx: { px: 3, py: 2 }, children: [
2999
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material2.Button, { onClick: onClose, disabled: isBusy, color: "inherit", type: "button", children: "Cancel" }),
3000
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3001
- import_material2.Button,
2965
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material.DialogActions, { sx: { px: 3, py: 2 }, children: [
2966
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material.Button, { onClick: onClose, disabled: isBusy, color: "inherit", type: "button", children: "Cancel" }),
2967
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2968
+ import_material.Button,
3002
2969
  {
3003
2970
  onClick: handleSaveAll,
3004
2971
  variant: "contained",
@@ -3015,13 +2982,13 @@ var TranslationDialog = ({
3015
2982
 
3016
2983
  // src/context/TranslateProvider.tsx
3017
2984
  var import_react6 = require("react");
3018
- var import_jsx_runtime7 = require("react/jsx-runtime");
2985
+ var import_jsx_runtime6 = require("react/jsx-runtime");
3019
2986
  var TranslationNamespaceContext = (0, import_react6.createContext)({
3020
2987
  namespace: "common"
3021
2988
  // значение по умолчанию
3022
2989
  });
3023
2990
  var TranslateProvider = ({ namespace, children }) => {
3024
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TranslationNamespaceContext.Provider, { value: { namespace }, children });
2991
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TranslationNamespaceContext.Provider, { value: { namespace }, children });
3025
2992
  };
3026
2993
  var useTranslationNamespace = (overrideNamespace) => {
3027
2994
  const context = (0, import_react6.useContext)(TranslationNamespaceContext);
@@ -3029,12 +2996,13 @@ var useTranslationNamespace = (overrideNamespace) => {
3029
2996
  };
3030
2997
 
3031
2998
  // src/i18n/TranslateText.tsx
3032
- var import_jsx_runtime8 = require("react/jsx-runtime");
2999
+ var import_jsx_runtime7 = require("react/jsx-runtime");
3033
3000
  var TranslateText = ({
3001
+ overrideNamespace,
3034
3002
  children,
3035
3003
  values
3036
3004
  }) => {
3037
- const namespace = useTranslationNamespace();
3005
+ const namespace = useTranslationNamespace(overrideNamespace);
3038
3006
  const { t: t2, i18n } = (0, import_react_i18next2.useTranslation)(namespace);
3039
3007
  const { isTranslationMode, canEdit } = useTranslationEdit();
3040
3008
  const supabase = useSupabase();
@@ -3048,7 +3016,7 @@ var TranslateText = ({
3048
3016
  };
3049
3017
  }, []);
3050
3018
  if (!canEdit || !isTranslationMode) {
3051
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: translatedValue });
3019
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: translatedValue });
3052
3020
  }
3053
3021
  const handleSaveTranslations = async (newValues, contextHint) => {
3054
3022
  const upsertData = Object.entries(newValues).map(([langCode, text]) => ({
@@ -3090,9 +3058,9 @@ var TranslateText = ({
3090
3058
  setAnchorEl(null);
3091
3059
  };
3092
3060
  const open = Boolean(anchorEl);
3093
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
3094
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3095
- import_material3.Box,
3061
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3062
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3063
+ import_material2.Box,
3096
3064
  {
3097
3065
  component: "span",
3098
3066
  onMouseEnter: handleMouseEnter,
@@ -3122,15 +3090,15 @@ var TranslateText = ({
3122
3090
  children: translatedValue
3123
3091
  }
3124
3092
  ),
3125
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3126
- import_material3.Popper,
3093
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3094
+ import_material2.Popper,
3127
3095
  {
3128
3096
  open,
3129
3097
  anchorEl,
3130
3098
  placement: "bottom-start",
3131
3099
  style: { zIndex: 1300 },
3132
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3133
- import_material3.Paper,
3100
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3101
+ import_material2.Paper,
3134
3102
  {
3135
3103
  elevation: 4,
3136
3104
  onMouseEnter: () => {
@@ -3143,11 +3111,11 @@ var TranslateText = ({
3143
3111
  minWidth: 140,
3144
3112
  boxShadow: "0px 10px 15px -3px rgba(0,0,0,0.1)"
3145
3113
  },
3146
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.MenuList, { dense: true, sx: { py: 0.5 }, children: [
3147
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.MenuItem, { onClick: handleOpenDialog, sx: { py: 0.8, px: 1.5 }, children: [
3148
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.ListItemIcon, { sx: { minWidth: "28px !important" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_Translate2.default, { fontSize: "small", sx: { color: "#d97706" } }) }),
3149
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3150
- import_material3.ListItemText,
3114
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.MenuList, { dense: true, sx: { py: 0.5 }, children: [
3115
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.MenuItem, { onClick: handleOpenDialog, sx: { py: 0.8, px: 1.5 }, children: [
3116
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.ListItemIcon, { sx: { minWidth: "28px !important" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Translate2.default, { fontSize: "small", sx: { color: "#d97706" } }) }),
3117
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3118
+ import_material2.ListItemText,
3151
3119
  {
3152
3120
  primary: "Localization",
3153
3121
  slotProps: {
@@ -3162,10 +3130,10 @@ var TranslateText = ({
3162
3130
  }
3163
3131
  )
3164
3132
  ] }),
3165
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.MenuItem, { onClick: handleLaunchAction, sx: { py: 0.8, px: 1.5 }, children: [
3166
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.ListItemIcon, { sx: { minWidth: "28px !important" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_Launch.default, { fontSize: "small", color: "secondary" }) }),
3167
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3168
- import_material3.ListItemText,
3133
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.MenuItem, { onClick: handleLaunchAction, sx: { py: 0.8, px: 1.5 }, children: [
3134
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.ListItemIcon, { sx: { minWidth: "28px !important" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Launch.default, { fontSize: "small", color: "secondary" }) }),
3135
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3136
+ import_material2.ListItemText,
3169
3137
  {
3170
3138
  primary: "Launch action",
3171
3139
  slotProps: {
@@ -3185,7 +3153,7 @@ var TranslateText = ({
3185
3153
  )
3186
3154
  }
3187
3155
  ),
3188
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { display: "inline" }, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3156
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { display: "inline" }, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3189
3157
  TranslationDialog,
3190
3158
  {
3191
3159
  open: isDialogOpen,
@@ -3198,9 +3166,44 @@ var TranslateText = ({
3198
3166
  ] });
3199
3167
  };
3200
3168
 
3201
- // src/UI/components/inputs/TextfieldComponent.tsx
3169
+ // src/UI/components/data.display/TranslatableTooltipComponent.tsx
3170
+ var import_jsx_runtime8 = require("react/jsx-runtime");
3171
+ var TranslatableTooltipComponent = ({
3172
+ overrideNamespace,
3173
+ title,
3174
+ disableSpan,
3175
+ children,
3176
+ ...props
3177
+ }) => {
3178
+ const { isTranslationMode } = useTranslationEdit();
3179
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3180
+ import_material3.Tooltip,
3181
+ {
3182
+ title: typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TranslateText, { overrideNamespace, children: title }) : title,
3183
+ slotProps: {
3184
+ popper: {
3185
+ sx: isTranslationMode ? {
3186
+ pointerEvents: "auto",
3187
+ // Разрешаем клики внутри тултипа
3188
+ "& .MuiTooltip-tooltip": {
3189
+ pointerEvents: "auto"
3190
+ }
3191
+ } : void 0
3192
+ }
3193
+ },
3194
+ leaveDelay: isTranslationMode ? 1e3 : 100,
3195
+ ...props,
3196
+ children: disableSpan ? children : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children })
3197
+ }
3198
+ );
3199
+ };
3200
+
3201
+ // src/UI/components/inputs/TextFieldComponent.tsx
3202
+ var import_react_i18next3 = require("react-i18next");
3202
3203
  var import_jsx_runtime9 = require("react/jsx-runtime");
3203
- var TextfieldComponent = ({
3204
+ var TextFieldComponent = ({
3205
+ overrideNamespace,
3206
+ label,
3204
3207
  value = "",
3205
3208
  onChange,
3206
3209
  disabled = false,
@@ -3270,6 +3273,7 @@ var TextfieldComponent = ({
3270
3273
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3271
3274
  import_material4.TextField,
3272
3275
  {
3276
+ label: typeof label === "string" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslateText, { overrideNamespace, children: label }) : label,
3273
3277
  value,
3274
3278
  onChange,
3275
3279
  disabled,
@@ -3292,7 +3296,7 @@ var TextfieldComponent = ({
3292
3296
  ...slotProps?.input || {},
3293
3297
  readOnly: isReadOnly,
3294
3298
  endAdornment: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material4.InputAdornment, { position: "end", sx: { gap: 0.5 }, children: [
3295
- hasValue && !isLocked && !disableClearButton && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslatableTooltip, { title: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslateText, { children: clearTooltip }), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3299
+ hasValue && !isLocked && !disableClearButton && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslateText, { overrideNamespace, children: clearTooltip }), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3296
3300
  import_material4.IconButton,
3297
3301
  {
3298
3302
  size: "small",
@@ -3302,7 +3306,7 @@ var TextfieldComponent = ({
3302
3306
  children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_Clear.default, { fontSize: "small" })
3303
3307
  }
3304
3308
  ) }),
3305
- hasValue && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslatableTooltip, { title: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslateText, { children: copied ? copiedTooltip : copyTooltip }), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3309
+ hasValue && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslateText, { overrideNamespace, children: copied ? copiedTooltip : copyTooltip }), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3306
3310
  import_material4.IconButton,
3307
3311
  {
3308
3312
  size: "small",
@@ -3352,7 +3356,7 @@ var TextfieldComponent = ({
3352
3356
  )
3353
3357
  }
3354
3358
  ) }),
3355
- isLocked && showLock && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslatableTooltip, { title: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslateText, { children: lockTooltip }), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3359
+ isLocked && showLock && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TranslateText, { overrideNamespace, children: lockTooltip }), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3356
3360
  import_material4.IconButton,
3357
3361
  {
3358
3362
  size: "small",
@@ -3414,6 +3418,7 @@ var import_Add = __toESM(require("@mui/icons-material/Add"));
3414
3418
  var import_Remove = __toESM(require("@mui/icons-material/Remove"));
3415
3419
  var import_jsx_runtime10 = require("react/jsx-runtime");
3416
3420
  var NumberInputComponent = ({
3421
+ overrideNamespace,
3417
3422
  value,
3418
3423
  onChange,
3419
3424
  allowNegative = true,
@@ -3547,9 +3552,10 @@ var NumberInputComponent = ({
3547
3552
  const isDecrementDisabled = disabled || effectiveMin !== void 0 && !isNaN(currentNumeric) && currentNumeric <= effectiveMin;
3548
3553
  const isIncrementDisabled = disabled || maxValue !== void 0 && !isNaN(currentNumeric) && currentNumeric >= maxValue;
3549
3554
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3550
- TextfieldComponent,
3555
+ TextFieldComponent,
3551
3556
  {
3552
3557
  ...props,
3558
+ overrideNamespace,
3553
3559
  type: "text",
3554
3560
  disabled,
3555
3561
  value: formatDisplayValue(inputValue),
@@ -3611,11 +3617,267 @@ var NumberInputComponent = ({
3611
3617
  );
3612
3618
  };
3613
3619
 
3620
+ // src/UI/components/inputs/UrlComponent.tsx
3621
+ var import_react10 = require("react");
3622
+ var import_material6 = require("@mui/material");
3623
+ var import_Link = __toESM(require("@mui/icons-material/Link"));
3624
+ var import_Launch2 = __toESM(require("@mui/icons-material/Launch"));
3625
+ var import_ContentCopy2 = __toESM(require("@mui/icons-material/ContentCopy"));
3626
+ var import_Check2 = __toESM(require("@mui/icons-material/Check"));
3627
+ var import_EditNote = __toESM(require("@mui/icons-material/EditNote"));
3628
+ var import_Lock2 = __toESM(require("@mui/icons-material/Lock"));
3629
+ var import_jsx_runtime11 = require("react/jsx-runtime");
3630
+ function UrlComponent({
3631
+ overrideNamespace,
3632
+ label,
3633
+ value,
3634
+ onChange,
3635
+ disabled = false,
3636
+ readOnly = false,
3637
+ required = false,
3638
+ error = false,
3639
+ helperText = "",
3640
+ description = "",
3641
+ fullWidth = true,
3642
+ openInNewTab = true,
3643
+ showLock = true,
3644
+ lockTooltip = "Field is not editable",
3645
+ sx
3646
+ }) {
3647
+ const [copied, setCopied] = (0, import_react10.useState)(false);
3648
+ const [anchorEl, setAnchorEl] = (0, import_react10.useState)(null);
3649
+ const isViewMode = disabled || readOnly;
3650
+ const currentUrl = typeof value === "object" && value !== null ? value.url || "" : value || "";
3651
+ const currentTitle = typeof value === "object" && value !== null ? value.title || "" : "";
3652
+ const getFormattedUrl = (val) => {
3653
+ if (!val) return "";
3654
+ const trimmed = val.trim();
3655
+ if (trimmed.match(/^[a-zA-Z]+:\/\//)) {
3656
+ return trimmed;
3657
+ }
3658
+ return `https://${trimmed}`;
3659
+ };
3660
+ const finalUrl = getFormattedUrl(currentUrl);
3661
+ const targetAttribute = openInNewTab ? "_blank" : "_self";
3662
+ const displayLabelText = currentTitle.trim() || currentUrl;
3663
+ const handleUrlChange = (newUrl) => {
3664
+ onChange?.({ url: newUrl, title: currentTitle });
3665
+ };
3666
+ const handleTitleChange = (newTitle) => {
3667
+ onChange?.({ url: currentUrl, title: newTitle });
3668
+ };
3669
+ const handleCopy = (e) => {
3670
+ e.stopPropagation();
3671
+ if (!finalUrl) return;
3672
+ navigator.clipboard.writeText(finalUrl);
3673
+ setCopied(true);
3674
+ setTimeout(() => setCopied(false), 2e3);
3675
+ };
3676
+ const handleOpenLink = (e) => {
3677
+ e.stopPropagation();
3678
+ if (finalUrl) {
3679
+ window.open(finalUrl, targetAttribute, openInNewTab ? "noopener,noreferrer" : void 0);
3680
+ }
3681
+ };
3682
+ const handleInputClick = (e) => {
3683
+ if (isViewMode && finalUrl) {
3684
+ handleOpenLink(e);
3685
+ }
3686
+ };
3687
+ const handleOpenTitleMenu = (e) => {
3688
+ e.stopPropagation();
3689
+ setAnchorEl(e.currentTarget);
3690
+ };
3691
+ const handleCloseTitleMenu = () => {
3692
+ setAnchorEl(null);
3693
+ };
3694
+ const isTitlePopoverOpen = Boolean(anchorEl);
3695
+ const displayHelperText = error ? helperText : description || helperText;
3696
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
3697
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3698
+ import_material6.TextField,
3699
+ {
3700
+ label: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TranslateText, { overrideNamespace, children: label }),
3701
+ type: isViewMode ? "text" : "url",
3702
+ value: isViewMode ? displayLabelText : currentUrl,
3703
+ onChange: (e) => handleUrlChange(e.target.value),
3704
+ required,
3705
+ error,
3706
+ disabled,
3707
+ margin: "dense",
3708
+ helperText: displayHelperText,
3709
+ fullWidth,
3710
+ placeholder: "example.com",
3711
+ sx: {
3712
+ "& .MuiInputLabel-asterisk": {
3713
+ color: "red",
3714
+ fontSize: "1.5rem"
3715
+ },
3716
+ "& .MuiInputBase-input": {
3717
+ color: isViewMode && finalUrl ? "primary.main" : void 0,
3718
+ textDecoration: isViewMode && finalUrl ? "underline" : "none",
3719
+ cursor: isViewMode && finalUrl ? "pointer" : void 0,
3720
+ fontWeight: isViewMode && finalUrl ? 500 : void 0
3721
+ },
3722
+ ...sx
3723
+ },
3724
+ slotProps: {
3725
+ htmlInput: {
3726
+ readOnly,
3727
+ onClick: handleInputClick
3728
+ },
3729
+ input: {
3730
+ startAdornment: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material6.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Link.default, { fontSize: "small", color: isViewMode && finalUrl ? "primary" : "action" }) }),
3731
+ endAdornment: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_material6.InputAdornment, { position: "end", sx: { gap: 0.5 }, children: [
3732
+ !isViewMode && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material6.Tooltip, { title: currentTitle ? `Title: "${currentTitle}"` : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Set link title" }), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3733
+ import_material6.IconButton,
3734
+ {
3735
+ size: "small",
3736
+ onClick: handleOpenTitleMenu,
3737
+ color: currentTitle ? "primary" : "default",
3738
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_EditNote.default, { fontSize: "small" })
3739
+ }
3740
+ ) }),
3741
+ finalUrl && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material6.Tooltip, { title: copied ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Copied!" }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Copy link" }), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material6.IconButton, { size: "small", onClick: handleCopy, color: copied ? "success" : "default", children: copied ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Check2.default, { fontSize: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ContentCopy2.default, { fontSize: "small" }) }) }),
3742
+ isViewMode && showLock && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material6.Tooltip, { title: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TranslateText, { overrideNamespace, children: lockTooltip }), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3743
+ import_material6.IconButton,
3744
+ {
3745
+ size: "small",
3746
+ disabled: true,
3747
+ edge: "end",
3748
+ "aria-label": "locked input",
3749
+ sx: {
3750
+ "&.Mui-disabled": {
3751
+ color: "text.secondary"
3752
+ }
3753
+ },
3754
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Lock2.default, { fontSize: "small" })
3755
+ }
3756
+ ) }),
3757
+ finalUrl && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material6.Tooltip, { title: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Open link" }), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material6.IconButton, { size: "small", onClick: handleOpenLink, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Launch2.default, { fontSize: "small", color: isViewMode ? "primary" : "action" }) }) })
3758
+ ] })
3759
+ }
3760
+ }
3761
+ }
3762
+ ),
3763
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3764
+ import_material6.Popover,
3765
+ {
3766
+ open: isTitlePopoverOpen,
3767
+ anchorEl,
3768
+ onClose: handleCloseTitleMenu,
3769
+ anchorOrigin: {
3770
+ vertical: "bottom",
3771
+ horizontal: "right"
3772
+ },
3773
+ transformOrigin: {
3774
+ vertical: "top",
3775
+ horizontal: "right"
3776
+ },
3777
+ slotProps: {
3778
+ paper: { sx: { p: 2, width: 280 } }
3779
+ },
3780
+ children: [
3781
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material6.Typography, { variant: "subtitle2", sx: { mb: 1, fontWeight: "bold" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Link Title (Anchor)" }) }),
3782
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_material6.Typography, { variant: "caption", color: "text.secondary", sx: { mb: 1.5, display: "block" }, children: [
3783
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Specify the text to display instead of the URL address" }),
3784
+ ":"
3785
+ ] }),
3786
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3787
+ import_material6.TextField,
3788
+ {
3789
+ size: "small",
3790
+ fullWidth: true,
3791
+ placeholder: "e.g. Instruction",
3792
+ value: currentTitle,
3793
+ onChange: (e) => handleTitleChange(e.target.value),
3794
+ autoFocus: true,
3795
+ onKeyDown: (e) => {
3796
+ if (e.key === "Enter") {
3797
+ e.preventDefault();
3798
+ handleCloseTitleMenu();
3799
+ }
3800
+ }
3801
+ }
3802
+ ),
3803
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material6.Box, { sx: { display: "flex", justifyContent: "flex-end", mt: 1.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material6.Button, { size: "small", variant: "contained", onClick: handleCloseTitleMenu, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Done" }) }) })
3804
+ ]
3805
+ }
3806
+ )
3807
+ ] });
3808
+ }
3809
+
3810
+ // src/UI/components/inputs/EmailInputComponent.tsx
3811
+ var import_react11 = require("react");
3812
+ var import_jsx_runtime12 = require("react/jsx-runtime");
3813
+ var EMAIL_REGEX = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
3814
+ var EmailInputComponent = ({
3815
+ value = "",
3816
+ onChange,
3817
+ onBlur,
3818
+ error: externalError,
3819
+ helperText: externalHelperText,
3820
+ invalidEmailError = "Invalid email address",
3821
+ disableValidation = false,
3822
+ onValidationChange,
3823
+ ...props
3824
+ }) => {
3825
+ const [internalError, setInternalError] = (0, import_react11.useState)(null);
3826
+ const validateEmail = (val) => {
3827
+ if (disableValidation) return true;
3828
+ const stringVal = String(val ?? "").trim();
3829
+ if (!stringVal) {
3830
+ setInternalError(null);
3831
+ onValidationChange?.(true);
3832
+ return true;
3833
+ }
3834
+ const isValid = EMAIL_REGEX.test(stringVal);
3835
+ const errorMessage = isValid ? null : invalidEmailError;
3836
+ setInternalError(errorMessage);
3837
+ onValidationChange?.(isValid);
3838
+ return isValid;
3839
+ };
3840
+ const handleChange = (e) => {
3841
+ const newValue = e.target.value;
3842
+ if (internalError) {
3843
+ validateEmail(newValue);
3844
+ }
3845
+ if (onChange) {
3846
+ onChange(e);
3847
+ }
3848
+ };
3849
+ const handleBlur = (e) => {
3850
+ validateEmail(e.target.value);
3851
+ if (onBlur) {
3852
+ onBlur(e);
3853
+ }
3854
+ };
3855
+ const hasError = Boolean(externalError || internalError);
3856
+ const displayHelperText = externalHelperText || internalError || void 0;
3857
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3858
+ TextFieldComponent,
3859
+ {
3860
+ type: "email",
3861
+ value,
3862
+ onChange: handleChange,
3863
+ onBlur: handleBlur,
3864
+ error: hasError,
3865
+ helperText: displayHelperText,
3866
+ ...props
3867
+ }
3868
+ );
3869
+ };
3870
+
3614
3871
  // src/UI/index.ts
3615
- var CardForm = {
3872
+ var UI = {
3616
3873
  Inputs: {
3617
- TextField: TextfieldComponent,
3618
- NumberField: NumberInputComponent
3874
+ TextField: TextFieldComponent,
3875
+ NumberField: NumberInputComponent,
3876
+ EmailField: EmailInputComponent,
3877
+ Url: UrlComponent
3878
+ },
3879
+ DataDisplay: {
3880
+ TranslatableTooltip: TranslatableTooltipComponent
3619
3881
  }
3620
3882
  /*Layout: {
3621
3883
  Row: FormRow,
@@ -3623,10 +3885,10 @@ var CardForm = {
3623
3885
  };
3624
3886
 
3625
3887
  // src/context/LocalizationProvider.tsx
3626
- var import_react10 = require("react");
3888
+ var import_react12 = require("react");
3627
3889
  var import_react_i18next4 = require("react-i18next");
3628
3890
  var import_moment_with_locales = __toESM(require("moment/min/moment-with-locales"));
3629
- var import_jsx_runtime11 = require("react/jsx-runtime");
3891
+ var import_jsx_runtime13 = require("react/jsx-runtime");
3630
3892
  var DEFAULT_DATETIME_FORMATS = {
3631
3893
  uk: "DD.MM.YYYY, HH:mm",
3632
3894
  de: "DD.MM.YYYY, HH:mm",
@@ -3651,14 +3913,14 @@ var DEFAULT_TIME_FORMATS = {
3651
3913
  fr: "HH:mm:ss",
3652
3914
  it: "HH:mm:ss"
3653
3915
  };
3654
- var LocalizationContext = (0, import_react10.createContext)(void 0);
3916
+ var LocalizationContext = (0, import_react12.createContext)(void 0);
3655
3917
  var LocalizationProvider = ({ children }) => {
3656
3918
  const supabase = useSupabase();
3657
3919
  const { i18n } = (0, import_react_i18next4.useTranslation)();
3658
- const [languages, setLanguages] = (0, import_react10.useState)([]);
3659
- const [isLoadingLangs, setIsLoadingLangs] = (0, import_react10.useState)(true);
3660
- const [languagesError, setLanguagesError] = (0, import_react10.useState)(null);
3661
- (0, import_react10.useEffect)(() => {
3920
+ const [languages, setLanguages] = (0, import_react12.useState)([]);
3921
+ const [isLoadingLangs, setIsLoadingLangs] = (0, import_react12.useState)(true);
3922
+ const [languagesError, setLanguagesError] = (0, import_react12.useState)(null);
3923
+ (0, import_react12.useEffect)(() => {
3662
3924
  let isMounted = true;
3663
3925
  const fetchLanguages = async () => {
3664
3926
  try {
@@ -3720,7 +3982,7 @@ var LocalizationProvider = ({ children }) => {
3720
3982
  const changeLanguage2 = async (lang) => {
3721
3983
  await i18n.changeLanguage(lang);
3722
3984
  };
3723
- const value = (0, import_react10.useMemo)(
3985
+ const value = (0, import_react12.useMemo)(
3724
3986
  () => ({
3725
3987
  currentLang,
3726
3988
  languages,
@@ -3737,10 +3999,10 @@ var LocalizationProvider = ({ children }) => {
3737
3999
  }),
3738
4000
  [currentLang, languages, isLoadingLangs, languagesError]
3739
4001
  );
3740
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LocalizationContext.Provider, { value, children });
4002
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LocalizationContext.Provider, { value, children });
3741
4003
  };
3742
4004
  var useLocalization = () => {
3743
- const context = (0, import_react10.useContext)(LocalizationContext);
4005
+ const context = (0, import_react12.useContext)(LocalizationContext);
3744
4006
  if (!context) {
3745
4007
  throw new Error("useLocalization must be used within a LocalizationProvider");
3746
4008
  }
@@ -3748,9 +4010,9 @@ var useLocalization = () => {
3748
4010
  };
3749
4011
 
3750
4012
  // src/context/ThemeProvider.tsx
3751
- var import_react11 = require("react");
3752
- var import_material6 = require("@mui/material");
3753
- var import_jsx_runtime12 = require("react/jsx-runtime");
4013
+ var import_react13 = require("react");
4014
+ var import_material7 = require("@mui/material");
4015
+ var import_jsx_runtime14 = require("react/jsx-runtime");
3754
4016
  var DEFAULT_LIGHT_COLORS = {
3755
4017
  primary: "#1976d2",
3756
4018
  secondary: "#9c27b0",
@@ -3795,7 +4057,7 @@ var INITIAL_THEME_CONFIG = {
3795
4057
  var buildMuiTheme = (config) => {
3796
4058
  const currentMode = config.mode;
3797
4059
  const currentColors = config.colors?.[currentMode] || (currentMode === "light" ? DEFAULT_LIGHT_COLORS : DEFAULT_DARK_COLORS);
3798
- return (0, import_material6.createTheme)({
4060
+ return (0, import_material7.createTheme)({
3799
4061
  palette: {
3800
4062
  mode: currentMode,
3801
4063
  primary: {
@@ -3880,14 +4142,14 @@ var buildMuiTheme = (config) => {
3880
4142
  }
3881
4143
  });
3882
4144
  };
3883
- var ThemeContext = (0, import_react11.createContext)(void 0);
4145
+ var ThemeContext = (0, import_react13.createContext)(void 0);
3884
4146
  var THEME_STORAGE_KEY = "docsua_custom_theme_config";
3885
4147
  var THEME_MODE_STORAGE_KEY = "docsua_custom_theme_mode";
3886
4148
  var ThemeProvider = ({ children }) => {
3887
4149
  const supabase = useSupabase();
3888
4150
  const { user, isAuthenticated, loading: isAuthLoading } = useAuth();
3889
4151
  const userId = user?.id;
3890
- const [themeConfig, setThemeConfig] = (0, import_react11.useState)(() => {
4152
+ const [themeConfig, setThemeConfig] = (0, import_react13.useState)(() => {
3891
4153
  const saved = localStorage.getItem(THEME_STORAGE_KEY);
3892
4154
  if (saved) {
3893
4155
  try {
@@ -3897,7 +4159,7 @@ var ThemeProvider = ({ children }) => {
3897
4159
  }
3898
4160
  return INITIAL_THEME_CONFIG;
3899
4161
  });
3900
- (0, import_react11.useEffect)(() => {
4162
+ (0, import_react13.useEffect)(() => {
3901
4163
  if (isAuthLoading) return;
3902
4164
  if (isAuthenticated && userId) {
3903
4165
  const fetchActiveTheme = async () => {
@@ -3931,7 +4193,7 @@ var ThemeProvider = ({ children }) => {
3931
4193
  localStorage.removeItem(THEME_MODE_STORAGE_KEY);
3932
4194
  }
3933
4195
  }, [isAuthenticated, isAuthLoading, userId]);
3934
- (0, import_react11.useEffect)(() => {
4196
+ (0, import_react13.useEffect)(() => {
3935
4197
  if (isAuthenticated) {
3936
4198
  localStorage.setItem(THEME_STORAGE_KEY, JSON.stringify(themeConfig));
3937
4199
  localStorage.setItem(THEME_MODE_STORAGE_KEY, themeConfig.mode);
@@ -3944,21 +4206,21 @@ var ThemeProvider = ({ children }) => {
3944
4206
  const toggleTheme = () => {
3945
4207
  setMode(mode === "light" ? "dark" : "light");
3946
4208
  };
3947
- const theme = (0, import_react11.useMemo)(() => buildMuiTheme(themeConfig), [themeConfig]);
4209
+ const theme = (0, import_react13.useMemo)(() => buildMuiTheme(themeConfig), [themeConfig]);
3948
4210
  const displayState = {
3949
- isMobile: (0, import_material6.useMediaQuery)(theme.breakpoints.down("sm")),
3950
- isTablet: (0, import_material6.useMediaQuery)(theme.breakpoints.between("sm", "md")),
3951
- isDesktop: (0, import_material6.useMediaQuery)(theme.breakpoints.between("md", "lg")),
3952
- isWideDesktop: (0, import_material6.useMediaQuery)(theme.breakpoints.between("lg", "xl")),
3953
- isSuperWideDesktop: (0, import_material6.useMediaQuery)(theme.breakpoints.up("xl"))
4211
+ isMobile: (0, import_material7.useMediaQuery)(theme.breakpoints.down("sm")),
4212
+ isTablet: (0, import_material7.useMediaQuery)(theme.breakpoints.between("sm", "md")),
4213
+ isDesktop: (0, import_material7.useMediaQuery)(theme.breakpoints.between("md", "lg")),
4214
+ isWideDesktop: (0, import_material7.useMediaQuery)(theme.breakpoints.between("lg", "xl")),
4215
+ isSuperWideDesktop: (0, import_material7.useMediaQuery)(theme.breakpoints.up("xl"))
3954
4216
  };
3955
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ThemeContext.Provider, { value: { mode, toggleTheme, setMode, theme, themeConfig, setThemeConfig, displayState }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_material6.ThemeProvider, { theme, children: [
3956
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material6.CssBaseline, {}),
4217
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ThemeContext.Provider, { value: { mode, toggleTheme, setMode, theme, themeConfig, setThemeConfig, displayState }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_material7.ThemeProvider, { theme, children: [
4218
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material7.CssBaseline, {}),
3957
4219
  children
3958
4220
  ] }) });
3959
4221
  };
3960
4222
  var useAppTheme = () => {
3961
- const context = (0, import_react11.useContext)(ThemeContext);
4223
+ const context = (0, import_react13.useContext)(ThemeContext);
3962
4224
  if (!context) {
3963
4225
  throw new Error("useAppTheme should be used within the ThemeProvider");
3964
4226
  }
@@ -3966,53 +4228,53 @@ var useAppTheme = () => {
3966
4228
  };
3967
4229
 
3968
4230
  // src/context/BreadcrumbProvider.tsx
3969
- var import_react12 = require("react");
3970
- var import_jsx_runtime13 = require("react/jsx-runtime");
3971
- var BreadcrumbContext = (0, import_react12.createContext)({
4231
+ var import_react14 = require("react");
4232
+ var import_jsx_runtime15 = require("react/jsx-runtime");
4233
+ var BreadcrumbContext = (0, import_react14.createContext)({
3972
4234
  breadcrumbTitles: {},
3973
4235
  setBreadcrumbTitle: () => {
3974
4236
  }
3975
4237
  });
3976
4238
  var BreadcrumbProvider = ({ children }) => {
3977
- const [breadcrumbTitles, setBreadcrumbTitles] = (0, import_react12.useState)({});
4239
+ const [breadcrumbTitles, setBreadcrumbTitles] = (0, import_react14.useState)({});
3978
4240
  const setBreadcrumbTitle = (path, title) => {
3979
4241
  setBreadcrumbTitles((prev) => {
3980
4242
  if (prev[path] === title) return prev;
3981
4243
  return { ...prev, [path]: title };
3982
4244
  });
3983
4245
  };
3984
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BreadcrumbContext.Provider, { value: { breadcrumbTitles, setBreadcrumbTitle }, children });
4246
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(BreadcrumbContext.Provider, { value: { breadcrumbTitles, setBreadcrumbTitle }, children });
3985
4247
  };
3986
- var useBreadcrumb = () => (0, import_react12.useContext)(BreadcrumbContext);
4248
+ var useBreadcrumb = () => (0, import_react14.useContext)(BreadcrumbContext);
3987
4249
 
3988
4250
  // src/context/ToastProvider.tsx
3989
- var import_react13 = require("react");
3990
- var import_material7 = require("@mui/material");
3991
- var import_jsx_runtime14 = require("react/jsx-runtime");
3992
- var ToastContext = (0, import_react13.createContext)(void 0);
4251
+ var import_react15 = require("react");
4252
+ var import_material8 = require("@mui/material");
4253
+ var import_jsx_runtime16 = require("react/jsx-runtime");
4254
+ var ToastContext = (0, import_react15.createContext)(void 0);
3993
4255
  var ToastProvider = ({ children }) => {
3994
- const [toast, setToast] = (0, import_react13.useState)(null);
3995
- const showToast = (0, import_react13.useCallback)((text, type = "info") => {
4256
+ const [toast, setToast] = (0, import_react15.useState)(null);
4257
+ const showToast = (0, import_react15.useCallback)((text, type = "info") => {
3996
4258
  setToast({ text, type });
3997
4259
  }, []);
3998
- const hideToast = (0, import_react13.useCallback)(() => {
4260
+ const hideToast = (0, import_react15.useCallback)(() => {
3999
4261
  setToast(null);
4000
4262
  }, []);
4001
- const contextValue = (0, import_react13.useMemo)(() => ({
4263
+ const contextValue = (0, import_react15.useMemo)(() => ({
4002
4264
  showToast,
4003
4265
  hideToast
4004
4266
  }), [showToast, hideToast]);
4005
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(ToastContext.Provider, { value: contextValue, children: [
4267
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(ToastContext.Provider, { value: contextValue, children: [
4006
4268
  children,
4007
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4008
- import_material7.Snackbar,
4269
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4270
+ import_material8.Snackbar,
4009
4271
  {
4010
4272
  open: Boolean(toast),
4011
4273
  autoHideDuration: 3500,
4012
4274
  onClose: hideToast,
4013
4275
  anchorOrigin: { vertical: "bottom", horizontal: "center" },
4014
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4015
- import_material7.Alert,
4276
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4277
+ import_material8.Alert,
4016
4278
  {
4017
4279
  severity: toast?.type || "info",
4018
4280
  variant: "filled",
@@ -4025,7 +4287,7 @@ var ToastProvider = ({ children }) => {
4025
4287
  ] });
4026
4288
  };
4027
4289
  var useToast = () => {
4028
- const context = (0, import_react13.useContext)(ToastContext);
4290
+ const context = (0, import_react15.useContext)(ToastContext);
4029
4291
  if (!context) {
4030
4292
  throw new Error("useToast must be used within a ToastProvider");
4031
4293
  }
@@ -4033,22 +4295,22 @@ var useToast = () => {
4033
4295
  };
4034
4296
 
4035
4297
  // src/context/ConfirmationProvider.tsx
4036
- var import_react14 = require("react");
4037
- var import_material8 = require("@mui/material");
4298
+ var import_react16 = require("react");
4299
+ var import_material9 = require("@mui/material");
4038
4300
  var import_icons_material = require("@mui/icons-material");
4039
- var import_jsx_runtime15 = require("react/jsx-runtime");
4040
- var ConfirmContext = (0, import_react14.createContext)(null);
4301
+ var import_jsx_runtime17 = require("react/jsx-runtime");
4302
+ var ConfirmContext = (0, import_react16.createContext)(null);
4041
4303
  var SEVERITY_ICONS = {
4042
- error: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_material.Error, { color: "error", sx: { fontSize: 40 } }),
4043
- warning: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_material.WarningAmberOutlined, { color: "warning", sx: { fontSize: 40 } }),
4044
- info: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_material.InfoOutlined, { color: "info", sx: { fontSize: 40 } }),
4045
- success: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_material.CheckCircleOutlined, { color: "success", sx: { fontSize: 40 } })
4304
+ error: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons_material.Error, { color: "error", sx: { fontSize: 40 } }),
4305
+ warning: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons_material.WarningAmberOutlined, { color: "warning", sx: { fontSize: 40 } }),
4306
+ info: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons_material.InfoOutlined, { color: "info", sx: { fontSize: 40 } }),
4307
+ success: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons_material.CheckCircleOutlined, { color: "success", sx: { fontSize: 40 } })
4046
4308
  };
4047
4309
  var ConfirmationProvider = ({ children }) => {
4048
- const [open, setOpen] = (0, import_react14.useState)(false);
4049
- const [options, setOptions] = (0, import_react14.useState)(null);
4050
- const [resolver, setResolver] = (0, import_react14.useState)(null);
4051
- const confirm = (0, import_react14.useCallback)((opts) => {
4310
+ const [open, setOpen] = (0, import_react16.useState)(false);
4311
+ const [options, setOptions] = (0, import_react16.useState)(null);
4312
+ const [resolver, setResolver] = (0, import_react16.useState)(null);
4313
+ const confirm = (0, import_react16.useCallback)((opts) => {
4052
4314
  setOptions(opts);
4053
4315
  setOpen(true);
4054
4316
  return new Promise((resolve) => {
@@ -4062,10 +4324,10 @@ var ConfirmationProvider = ({ children }) => {
4062
4324
  }
4063
4325
  };
4064
4326
  const severityType = options?.type || "info";
4065
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(ConfirmContext.Provider, { value: { confirm }, children: [
4327
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(ConfirmContext.Provider, { value: { confirm }, children: [
4066
4328
  children,
4067
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
4068
- import_material8.Dialog,
4329
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
4330
+ import_material9.Dialog,
4069
4331
  {
4070
4332
  open,
4071
4333
  onClose: () => handleClose("cancel"),
@@ -4074,38 +4336,38 @@ var ConfirmationProvider = ({ children }) => {
4074
4336
  disableEnforceFocus: true,
4075
4337
  disableRestoreFocus: true,
4076
4338
  children: [
4077
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_material8.DialogTitle, { sx: { display: "flex", alignItems: "center", gap: 1.5, pb: 1 }, children: [
4339
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material9.DialogTitle, { sx: { display: "flex", alignItems: "center", gap: 1.5, pb: 1 }, children: [
4078
4340
  SEVERITY_ICONS[severityType],
4079
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_material8.Box, { component: "span", sx: { fontWeight: 600 }, children: options?.title || /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TranslateText, { children: "Confirmation" }) })
4341
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material9.Box, { component: "span", sx: { fontWeight: 600 }, children: options?.title || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TranslateText, { children: "Confirmation" }) })
4080
4342
  ] }),
4081
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_material8.DialogContent, { sx: { py: 2 }, dividers: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_material8.DialogContentText, { color: "text.secondary", children: options?.message }) }),
4082
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_material8.DialogActions, { sx: { pt: 2, px: 2, justifyContent: "flex-end", gap: 1 }, children: [
4083
- (options?.showCancelButton ?? true) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4084
- import_material8.Button,
4343
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material9.DialogContent, { sx: { py: 2 }, dividers: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material9.DialogContentText, { color: "text.secondary", children: options?.message }) }),
4344
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material9.DialogActions, { sx: { pt: 2, px: 2, justifyContent: "flex-end", gap: 1 }, children: [
4345
+ (options?.showCancelButton ?? true) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4346
+ import_material9.Button,
4085
4347
  {
4086
4348
  onClick: () => handleClose("cancel"),
4087
4349
  color: "inherit",
4088
4350
  variant: "text",
4089
- children: options?.cancelText || /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TranslateText, { children: "Cancel" })
4351
+ children: options?.cancelText || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TranslateText, { children: "Cancel" })
4090
4352
  }
4091
4353
  ),
4092
- options?.showNoButton && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4093
- import_material8.Button,
4354
+ options?.showNoButton && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4355
+ import_material9.Button,
4094
4356
  {
4095
4357
  onClick: () => handleClose("no"),
4096
4358
  color: "inherit",
4097
4359
  variant: "outlined",
4098
- children: options?.noText || /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TranslateText, { children: "No" })
4360
+ children: options?.noText || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TranslateText, { children: "No" })
4099
4361
  }
4100
4362
  ),
4101
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4102
- import_material8.Button,
4363
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4364
+ import_material9.Button,
4103
4365
  {
4104
4366
  onClick: () => handleClose("yes"),
4105
4367
  color: options?.confirmColor || (severityType === "error" ? "error" : "primary"),
4106
4368
  variant: "contained",
4107
4369
  autoFocus: true,
4108
- children: options?.confirmText || /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TranslateText, { children: "Yes" })
4370
+ children: options?.confirmText || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TranslateText, { children: "Yes" })
4109
4371
  }
4110
4372
  )
4111
4373
  ] })
@@ -4115,25 +4377,39 @@ var ConfirmationProvider = ({ children }) => {
4115
4377
  ] });
4116
4378
  };
4117
4379
  var useConfirmation = () => {
4118
- const context = (0, import_react14.useContext)(ConfirmContext);
4380
+ const context = (0, import_react16.useContext)(ConfirmContext);
4119
4381
  if (!context) {
4120
4382
  throw new Error("useConfirm must be used within a ConfirmProvider");
4121
4383
  }
4122
4384
  return context.confirm;
4123
4385
  };
4386
+
4387
+ // src/context/index.ts
4388
+ var Providers = {
4389
+ Supabase: SupabaseProvider,
4390
+ Translate: TranslateProvider,
4391
+ TranslationEdit: TranslationEditProvider,
4392
+ Localization: LocalizationProvider,
4393
+ Theme: ThemeProvider,
4394
+ Breadcrumb: BreadcrumbProvider,
4395
+ Toast: ToastProvider,
4396
+ Confirmation: ConfirmationProvider,
4397
+ AI: AIProvider
4398
+ };
4124
4399
  // Annotate the CommonJS export names for ESM import in node:
4125
4400
  0 && (module.exports = {
4126
4401
  AIProvider,
4127
4402
  BreadcrumbProvider,
4128
- CardForm,
4129
4403
  ConfirmationProvider,
4130
4404
  LocalizationProvider,
4405
+ Providers,
4131
4406
  SupabaseProvider,
4132
4407
  ThemeProvider,
4133
4408
  ToastProvider,
4134
4409
  TranslateProvider,
4135
4410
  TranslateText,
4136
4411
  TranslationEditProvider,
4412
+ UI,
4137
4413
  useAI,
4138
4414
  useAppTheme,
4139
4415
  useBreadcrumb,