@serhii.olishevskyi/docs 1.2.1 → 1.2.3
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/{UserPopoverComponent-FZF757NQ.mjs → UserPopoverComponent-K7CJNYYL.mjs} +1 -1
- package/dist/{chunk-FYNGJLO7.mjs → chunk-FRDK4RQX.mjs} +21 -0
- package/dist/index.d.mts +40 -3
- package/dist/index.d.ts +40 -3
- package/dist/index.js +163 -9
- package/dist/index.mjs +149 -4
- package/package.json +3 -2
|
@@ -182,8 +182,28 @@ _SupabaseCacheBackend.type = "backend";
|
|
|
182
182
|
_SupabaseCacheBackend.manifest = {};
|
|
183
183
|
_SupabaseCacheBackend.isManifestLoaded = false;
|
|
184
184
|
var SupabaseCacheBackend = _SupabaseCacheBackend;
|
|
185
|
+
var customCacheBackend_default = SupabaseCacheBackend;
|
|
185
186
|
|
|
186
187
|
// src/i18n/config.ts
|
|
188
|
+
var initI18n = ({
|
|
189
|
+
supabase,
|
|
190
|
+
defaultLang = "uk",
|
|
191
|
+
fallbackLang = "en",
|
|
192
|
+
namespaces = ["common", "landing", "auth-widget", "form_components"]
|
|
193
|
+
}) => {
|
|
194
|
+
if (!i18n.isInitialized) {
|
|
195
|
+
i18n.use(new customCacheBackend_default(supabase)).use(initReactI18next).init({
|
|
196
|
+
lng: defaultLang,
|
|
197
|
+
fallbackLng: fallbackLang,
|
|
198
|
+
ns: namespaces,
|
|
199
|
+
defaultNS: "common",
|
|
200
|
+
keySeparator: false,
|
|
201
|
+
nsSeparator: ":",
|
|
202
|
+
interpolation: { escapeValue: false }
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
return i18n;
|
|
206
|
+
};
|
|
187
207
|
var config_default = i18n;
|
|
188
208
|
|
|
189
209
|
// src/context/AuthProvider.tsx
|
|
@@ -2546,6 +2566,7 @@ var UserPopoverComponent = ({
|
|
|
2546
2566
|
var UserPopoverComponent_default = UserPopoverComponent;
|
|
2547
2567
|
|
|
2548
2568
|
export {
|
|
2569
|
+
initI18n,
|
|
2549
2570
|
getDeviceId,
|
|
2550
2571
|
fetchCompanySessions,
|
|
2551
2572
|
trackUserSession,
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode } from 'react';
|
|
3
3
|
import { TextFieldProps, SelectProps, SelectChangeEvent, IconButtonProps, TooltipProps, SxProps, Theme, TypographyProps } from '@mui/material';
|
|
4
|
+
import { SystemProps } from '@mui/system';
|
|
4
5
|
import * as _supabase_supabase_js from '@supabase/supabase-js';
|
|
5
6
|
import { SupabaseClient, User, Session } from '@supabase/supabase-js';
|
|
7
|
+
import * as i18next from 'i18next';
|
|
6
8
|
|
|
7
9
|
interface UrlValue {
|
|
8
10
|
url: string;
|
|
@@ -302,6 +304,25 @@ interface ExpandableNoteComponentProps extends Omit<TypographyProps, 'children'>
|
|
|
302
304
|
label?: React__default.ReactNode;
|
|
303
305
|
}
|
|
304
306
|
|
|
307
|
+
interface PageLink {
|
|
308
|
+
text: ReactNode;
|
|
309
|
+
href?: string;
|
|
310
|
+
external?: boolean;
|
|
311
|
+
onClick?: React__default.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
312
|
+
hidden?: boolean;
|
|
313
|
+
}
|
|
314
|
+
interface PageLinkWidgetProps {
|
|
315
|
+
overrideNamespace?: string;
|
|
316
|
+
title: ReactNode;
|
|
317
|
+
subheader?: ReactNode;
|
|
318
|
+
description: ReactNode;
|
|
319
|
+
icon?: React__default.ReactElement;
|
|
320
|
+
links: PageLink[];
|
|
321
|
+
actionButtonText?: ReactNode;
|
|
322
|
+
bgcolor?: SystemProps<Theme>['bgcolor'];
|
|
323
|
+
onActionButtonClick?: () => void;
|
|
324
|
+
}
|
|
325
|
+
|
|
305
326
|
declare const UI: {
|
|
306
327
|
Inputs: {
|
|
307
328
|
TextField: React$1.FC<TextFieldComponentProps>;
|
|
@@ -324,8 +345,13 @@ declare const UI: {
|
|
|
324
345
|
ExpandableNote: React$1.FC<ExpandableNoteComponentProps>;
|
|
325
346
|
};
|
|
326
347
|
Widgets: {
|
|
327
|
-
|
|
328
|
-
|
|
348
|
+
Locales: {
|
|
349
|
+
ProtectedLanguageSelector: React$1.FC<{}>;
|
|
350
|
+
PublicLanguageSelector: React$1.FC<{}>;
|
|
351
|
+
};
|
|
352
|
+
Pages: {
|
|
353
|
+
PageLinkWidget: React$1.FC<PageLinkWidgetProps>;
|
|
354
|
+
};
|
|
329
355
|
};
|
|
330
356
|
};
|
|
331
357
|
|
|
@@ -496,6 +522,17 @@ declare const LocalizationProvider: React__default.FC<{
|
|
|
496
522
|
}>;
|
|
497
523
|
declare const useLocalization: () => LocalizationContextType;
|
|
498
524
|
|
|
525
|
+
interface I18nInitOptions {
|
|
526
|
+
supabase: SupabaseClient;
|
|
527
|
+
defaultLang?: string;
|
|
528
|
+
fallbackLang?: string;
|
|
529
|
+
namespaces?: string[];
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Инициализирует и возвращает экземпляр i18n с динамически переданным клиентом Supabase
|
|
533
|
+
*/
|
|
534
|
+
declare const initI18n: ({ supabase, defaultLang, fallbackLang, namespaces, }: I18nInitOptions) => i18next.i18n;
|
|
535
|
+
|
|
499
536
|
interface DisplayState {
|
|
500
537
|
isMobile: boolean;
|
|
501
538
|
isTablet: boolean;
|
|
@@ -655,4 +692,4 @@ declare const Hooks: {
|
|
|
655
692
|
};
|
|
656
693
|
};
|
|
657
694
|
|
|
658
|
-
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, AppSettingsProvider, AuthProvider, BreadcrumbProvider, type CompanyMember, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps, type ExpandableNoteComponentProps, type FullCompanyMemberItem, Hooks, type Language, LocalizationProvider, type Membership, type MembershipRole, type MyAvatarComponentProps, type NumberInputComponentProps, Providers, type SaveCompanyUserPayload, type SearchComponentProps, type SelectComponentProps, type SelectOption, Services, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type TextFieldComponentProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps, type UserGroupedSessions, type UserPopoverComponentProps, type UserProfile, type UserRoleChipComponentProps, type UserSessionItem, type UserSettings, UserSettingsProvider, type UserStatusChipComponentProps, type UserStatusType, defaultUserSettings, useAI, useAppSettings, useAppTheme, useAuth, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace, useUserSettings };
|
|
695
|
+
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, AppSettingsProvider, AuthProvider, BreadcrumbProvider, type CompanyMember, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps, type ExpandableNoteComponentProps, type FullCompanyMemberItem, Hooks, type Language, LocalizationProvider, type Membership, type MembershipRole, type MyAvatarComponentProps, type NumberInputComponentProps, type PageLink, type PageLinkWidgetProps, Providers, type SaveCompanyUserPayload, type SearchComponentProps, type SelectComponentProps, type SelectOption, Services, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type TextFieldComponentProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps, type UserGroupedSessions, type UserPopoverComponentProps, type UserProfile, type UserRoleChipComponentProps, type UserSessionItem, type UserSettings, UserSettingsProvider, type UserStatusChipComponentProps, type UserStatusType, defaultUserSettings, initI18n, useAI, useAppSettings, useAppTheme, useAuth, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace, useUserSettings };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode } from 'react';
|
|
3
3
|
import { TextFieldProps, SelectProps, SelectChangeEvent, IconButtonProps, TooltipProps, SxProps, Theme, TypographyProps } from '@mui/material';
|
|
4
|
+
import { SystemProps } from '@mui/system';
|
|
4
5
|
import * as _supabase_supabase_js from '@supabase/supabase-js';
|
|
5
6
|
import { SupabaseClient, User, Session } from '@supabase/supabase-js';
|
|
7
|
+
import * as i18next from 'i18next';
|
|
6
8
|
|
|
7
9
|
interface UrlValue {
|
|
8
10
|
url: string;
|
|
@@ -302,6 +304,25 @@ interface ExpandableNoteComponentProps extends Omit<TypographyProps, 'children'>
|
|
|
302
304
|
label?: React__default.ReactNode;
|
|
303
305
|
}
|
|
304
306
|
|
|
307
|
+
interface PageLink {
|
|
308
|
+
text: ReactNode;
|
|
309
|
+
href?: string;
|
|
310
|
+
external?: boolean;
|
|
311
|
+
onClick?: React__default.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
312
|
+
hidden?: boolean;
|
|
313
|
+
}
|
|
314
|
+
interface PageLinkWidgetProps {
|
|
315
|
+
overrideNamespace?: string;
|
|
316
|
+
title: ReactNode;
|
|
317
|
+
subheader?: ReactNode;
|
|
318
|
+
description: ReactNode;
|
|
319
|
+
icon?: React__default.ReactElement;
|
|
320
|
+
links: PageLink[];
|
|
321
|
+
actionButtonText?: ReactNode;
|
|
322
|
+
bgcolor?: SystemProps<Theme>['bgcolor'];
|
|
323
|
+
onActionButtonClick?: () => void;
|
|
324
|
+
}
|
|
325
|
+
|
|
305
326
|
declare const UI: {
|
|
306
327
|
Inputs: {
|
|
307
328
|
TextField: React$1.FC<TextFieldComponentProps>;
|
|
@@ -324,8 +345,13 @@ declare const UI: {
|
|
|
324
345
|
ExpandableNote: React$1.FC<ExpandableNoteComponentProps>;
|
|
325
346
|
};
|
|
326
347
|
Widgets: {
|
|
327
|
-
|
|
328
|
-
|
|
348
|
+
Locales: {
|
|
349
|
+
ProtectedLanguageSelector: React$1.FC<{}>;
|
|
350
|
+
PublicLanguageSelector: React$1.FC<{}>;
|
|
351
|
+
};
|
|
352
|
+
Pages: {
|
|
353
|
+
PageLinkWidget: React$1.FC<PageLinkWidgetProps>;
|
|
354
|
+
};
|
|
329
355
|
};
|
|
330
356
|
};
|
|
331
357
|
|
|
@@ -496,6 +522,17 @@ declare const LocalizationProvider: React__default.FC<{
|
|
|
496
522
|
}>;
|
|
497
523
|
declare const useLocalization: () => LocalizationContextType;
|
|
498
524
|
|
|
525
|
+
interface I18nInitOptions {
|
|
526
|
+
supabase: SupabaseClient;
|
|
527
|
+
defaultLang?: string;
|
|
528
|
+
fallbackLang?: string;
|
|
529
|
+
namespaces?: string[];
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Инициализирует и возвращает экземпляр i18n с динамически переданным клиентом Supabase
|
|
533
|
+
*/
|
|
534
|
+
declare const initI18n: ({ supabase, defaultLang, fallbackLang, namespaces, }: I18nInitOptions) => i18next.i18n;
|
|
535
|
+
|
|
499
536
|
interface DisplayState {
|
|
500
537
|
isMobile: boolean;
|
|
501
538
|
isTablet: boolean;
|
|
@@ -655,4 +692,4 @@ declare const Hooks: {
|
|
|
655
692
|
};
|
|
656
693
|
};
|
|
657
694
|
|
|
658
|
-
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, AppSettingsProvider, AuthProvider, BreadcrumbProvider, type CompanyMember, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps, type ExpandableNoteComponentProps, type FullCompanyMemberItem, Hooks, type Language, LocalizationProvider, type Membership, type MembershipRole, type MyAvatarComponentProps, type NumberInputComponentProps, Providers, type SaveCompanyUserPayload, type SearchComponentProps, type SelectComponentProps, type SelectOption, Services, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type TextFieldComponentProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps, type UserGroupedSessions, type UserPopoverComponentProps, type UserProfile, type UserRoleChipComponentProps, type UserSessionItem, type UserSettings, UserSettingsProvider, type UserStatusChipComponentProps, type UserStatusType, defaultUserSettings, useAI, useAppSettings, useAppTheme, useAuth, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace, useUserSettings };
|
|
695
|
+
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, AppSettingsProvider, AuthProvider, BreadcrumbProvider, type CompanyMember, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps, type ExpandableNoteComponentProps, type FullCompanyMemberItem, Hooks, type Language, LocalizationProvider, type Membership, type MembershipRole, type MyAvatarComponentProps, type NumberInputComponentProps, type PageLink, type PageLinkWidgetProps, Providers, type SaveCompanyUserPayload, type SearchComponentProps, type SelectComponentProps, type SelectOption, Services, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type TextFieldComponentProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps, type UserGroupedSessions, type UserPopoverComponentProps, type UserProfile, type UserRoleChipComponentProps, type UserSessionItem, type UserSettings, UserSettingsProvider, type UserStatusChipComponentProps, type UserStatusType, defaultUserSettings, initI18n, useAI, useAppSettings, useAppTheme, useAuth, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace, useUserSettings };
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
33
|
// src/i18n/customCacheBackend.ts
|
|
34
|
-
var _SupabaseCacheBackend, SupabaseCacheBackend;
|
|
34
|
+
var _SupabaseCacheBackend, SupabaseCacheBackend, customCacheBackend_default;
|
|
35
35
|
var init_customCacheBackend = __esm({
|
|
36
36
|
"src/i18n/customCacheBackend.ts"() {
|
|
37
37
|
"use strict";
|
|
@@ -137,17 +137,37 @@ var init_customCacheBackend = __esm({
|
|
|
137
137
|
_SupabaseCacheBackend.manifest = {};
|
|
138
138
|
_SupabaseCacheBackend.isManifestLoaded = false;
|
|
139
139
|
SupabaseCacheBackend = _SupabaseCacheBackend;
|
|
140
|
+
customCacheBackend_default = SupabaseCacheBackend;
|
|
140
141
|
}
|
|
141
142
|
});
|
|
142
143
|
|
|
143
144
|
// src/i18n/config.ts
|
|
144
|
-
var import_i18next, import_react_i18next, config_default;
|
|
145
|
+
var import_i18next, import_react_i18next, initI18n, config_default;
|
|
145
146
|
var init_config = __esm({
|
|
146
147
|
"src/i18n/config.ts"() {
|
|
147
148
|
"use strict";
|
|
148
149
|
import_i18next = __toESM(require("i18next"));
|
|
149
150
|
import_react_i18next = require("react-i18next");
|
|
150
151
|
init_customCacheBackend();
|
|
152
|
+
initI18n = ({
|
|
153
|
+
supabase,
|
|
154
|
+
defaultLang = "uk",
|
|
155
|
+
fallbackLang = "en",
|
|
156
|
+
namespaces = ["common", "landing", "auth-widget", "form_components"]
|
|
157
|
+
}) => {
|
|
158
|
+
if (!import_i18next.default.isInitialized) {
|
|
159
|
+
import_i18next.default.use(new customCacheBackend_default(supabase)).use(import_react_i18next.initReactI18next).init({
|
|
160
|
+
lng: defaultLang,
|
|
161
|
+
fallbackLng: fallbackLang,
|
|
162
|
+
ns: namespaces,
|
|
163
|
+
defaultNS: "common",
|
|
164
|
+
keySeparator: false,
|
|
165
|
+
nsSeparator: ":",
|
|
166
|
+
interpolation: { escapeValue: false }
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return import_i18next.default;
|
|
170
|
+
};
|
|
151
171
|
config_default = import_i18next.default;
|
|
152
172
|
}
|
|
153
173
|
});
|
|
@@ -2173,6 +2193,7 @@ var init_context = __esm({
|
|
|
2173
2193
|
init_TranslateText();
|
|
2174
2194
|
init_TranslationEditProvider();
|
|
2175
2195
|
init_LocalizationProvider();
|
|
2196
|
+
init_config();
|
|
2176
2197
|
init_ThemeProvider();
|
|
2177
2198
|
init_BreadcrumbProvider();
|
|
2178
2199
|
init_ToastProvider();
|
|
@@ -2761,6 +2782,7 @@ __export(index_exports, {
|
|
|
2761
2782
|
UI: () => UI,
|
|
2762
2783
|
UserSettingsProvider: () => UserSettingsProvider,
|
|
2763
2784
|
defaultUserSettings: () => defaultUserSettings,
|
|
2785
|
+
initI18n: () => initI18n,
|
|
2764
2786
|
useAI: () => useAI,
|
|
2765
2787
|
useAppSettings: () => useAppSettings,
|
|
2766
2788
|
useAppTheme: () => useAppTheme,
|
|
@@ -4378,6 +4400,132 @@ var ExpandableNoteComponent = ({
|
|
|
4378
4400
|
);
|
|
4379
4401
|
};
|
|
4380
4402
|
|
|
4403
|
+
// src/UI/widgets/page/PageLinkWidget.tsx
|
|
4404
|
+
var import_icons_material3 = require("@mui/icons-material");
|
|
4405
|
+
var import_material21 = require("@mui/material");
|
|
4406
|
+
var import_react28 = __toESM(require("react"));
|
|
4407
|
+
var import_react_router_dom = require("react-router-dom");
|
|
4408
|
+
init_context();
|
|
4409
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4410
|
+
var PageLinkWidget = ({
|
|
4411
|
+
overrideNamespace,
|
|
4412
|
+
title,
|
|
4413
|
+
subheader,
|
|
4414
|
+
description,
|
|
4415
|
+
icon,
|
|
4416
|
+
links,
|
|
4417
|
+
actionButtonText,
|
|
4418
|
+
onActionButtonClick,
|
|
4419
|
+
bgcolor
|
|
4420
|
+
}) => {
|
|
4421
|
+
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
4422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4423
|
+
import_material21.Card,
|
|
4424
|
+
{
|
|
4425
|
+
sx: (theme) => ({
|
|
4426
|
+
height: "100%",
|
|
4427
|
+
display: "flex",
|
|
4428
|
+
flexDirection: "column",
|
|
4429
|
+
boxShadow: 3,
|
|
4430
|
+
bgcolor,
|
|
4431
|
+
color: bgcolor ? typeof bgcolor === "string" && bgcolor.includes(".") ? theme.palette.getContrastText(
|
|
4432
|
+
bgcolor.split(".").reduce((acc, key) => acc[key], theme.palette)
|
|
4433
|
+
) : typeof bgcolor === "function" ? theme.palette.getContrastText(bgcolor(theme)) : theme.palette.getContrastText(bgcolor) : "text.primary"
|
|
4434
|
+
}),
|
|
4435
|
+
children: [
|
|
4436
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4437
|
+
import_material21.CardHeader,
|
|
4438
|
+
{
|
|
4439
|
+
avatar: icon ? import_react28.default.cloneElement(icon, {
|
|
4440
|
+
sx: { color: bgcolor ? "inherit" : "primary", ...icon.props.sx }
|
|
4441
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.Settings, { color: bgcolor ? "inherit" : "primary" }),
|
|
4442
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Typography, { variant: "h6", component: "div", color: "inherit", children: typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace, children: title }) : title }),
|
|
4443
|
+
subheader: subheader && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Typography, { variant: "body2", sx: { opacity: 0.8, color: "inherit" }, children: typeof subheader === "string" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace, children: subheader }) : subheader })
|
|
4444
|
+
}
|
|
4445
|
+
),
|
|
4446
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Divider, { sx: { borderColor: "inherit", opacity: 0.2 } }),
|
|
4447
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.CardContent, { sx: { flexGrow: 1 }, children: [
|
|
4448
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Typography, { variant: "body2", sx: { opacity: 0.85, color: "inherit" }, children: typeof description === "string" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace, children: description }) : description }),
|
|
4449
|
+
links && links.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.List, { dense: true, disablePadding: true, children: links.filter((f) => !f.hidden).map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4450
|
+
import_material21.ListItem,
|
|
4451
|
+
{
|
|
4452
|
+
disablePadding: true,
|
|
4453
|
+
sx: {
|
|
4454
|
+
mt: 1,
|
|
4455
|
+
// Запрещаем ListItem менять цвет фона при наведении
|
|
4456
|
+
"&:hover": {
|
|
4457
|
+
backgroundColor: "transparent"
|
|
4458
|
+
}
|
|
4459
|
+
},
|
|
4460
|
+
children: [
|
|
4461
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4462
|
+
import_material21.ListItemIcon,
|
|
4463
|
+
{
|
|
4464
|
+
sx: { minWidth: 30, cursor: "pointer", color: "inherit" },
|
|
4465
|
+
onClick: () => {
|
|
4466
|
+
if (link?.href) navigate(link.href);
|
|
4467
|
+
},
|
|
4468
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.ArrowRight, { fontSize: "small", color: "inherit" })
|
|
4469
|
+
}
|
|
4470
|
+
),
|
|
4471
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.ListItemText, { children: link.onClick ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4472
|
+
import_material21.Button,
|
|
4473
|
+
{
|
|
4474
|
+
size: "small",
|
|
4475
|
+
variant: "text",
|
|
4476
|
+
color: bgcolor ? "inherit" : "primary",
|
|
4477
|
+
onClick: link.onClick,
|
|
4478
|
+
sx: {
|
|
4479
|
+
fontWeight: 500,
|
|
4480
|
+
textTransform: "none",
|
|
4481
|
+
// Отключает автоматические заглавные буквы (UPPERCASE)
|
|
4482
|
+
padding: 0,
|
|
4483
|
+
minWidth: "auto",
|
|
4484
|
+
justifyContent: "flex-start",
|
|
4485
|
+
textAlign: "left",
|
|
4486
|
+
transition: "opacity 0.2s ease-in-out",
|
|
4487
|
+
"&:hover": {
|
|
4488
|
+
opacity: 0.75,
|
|
4489
|
+
backgroundColor: "transparent",
|
|
4490
|
+
// Убирает стандартную серую подложку при ховере кнопки
|
|
4491
|
+
textDecoration: "underline"
|
|
4492
|
+
// Эффект подчеркивания, как у ссылки
|
|
4493
|
+
}
|
|
4494
|
+
},
|
|
4495
|
+
children: link.text
|
|
4496
|
+
}
|
|
4497
|
+
) : link.href ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4498
|
+
import_material21.Link,
|
|
4499
|
+
{
|
|
4500
|
+
component: import_react_router_dom.Link,
|
|
4501
|
+
to: link.href,
|
|
4502
|
+
target: link.external ? "_blank" : "_self",
|
|
4503
|
+
rel: link.external ? "noopener noreferrer" : "",
|
|
4504
|
+
underline: "hover",
|
|
4505
|
+
color: bgcolor ? "inherit" : "primary",
|
|
4506
|
+
sx: {
|
|
4507
|
+
fontWeight: 500,
|
|
4508
|
+
display: "inline-block",
|
|
4509
|
+
transition: "opacity 0.2s ease-in-out",
|
|
4510
|
+
"&:hover": {
|
|
4511
|
+
opacity: 0.75,
|
|
4512
|
+
backgroundColor: "transparent"
|
|
4513
|
+
}
|
|
4514
|
+
},
|
|
4515
|
+
children: typeof link.text === "string" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace, children: link.text }) : link.text
|
|
4516
|
+
}
|
|
4517
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Typography, { variant: "body2", sx: { fontWeight: 500, color: "inherit" }, children: typeof link.text === "string" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace, children: link.text }) : link.text }) })
|
|
4518
|
+
]
|
|
4519
|
+
},
|
|
4520
|
+
index
|
|
4521
|
+
)) })
|
|
4522
|
+
] }),
|
|
4523
|
+
actionButtonText && onActionButtonClick && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.CardActions, { sx: { justifyContent: "flex-end", padding: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Button, { size: "small", variant: "contained", onClick: onActionButtonClick, children: typeof actionButtonText === "string" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace, children: actionButtonText }) : actionButtonText }) })
|
|
4524
|
+
]
|
|
4525
|
+
}
|
|
4526
|
+
);
|
|
4527
|
+
};
|
|
4528
|
+
|
|
4381
4529
|
// src/UI/index.ts
|
|
4382
4530
|
var UI = {
|
|
4383
4531
|
Inputs: {
|
|
@@ -4404,8 +4552,13 @@ var UI = {
|
|
|
4404
4552
|
Row: FormRow,
|
|
4405
4553
|
},*/
|
|
4406
4554
|
Widgets: {
|
|
4407
|
-
|
|
4408
|
-
|
|
4555
|
+
Locales: {
|
|
4556
|
+
ProtectedLanguageSelector: LanguageSelector,
|
|
4557
|
+
PublicLanguageSelector
|
|
4558
|
+
},
|
|
4559
|
+
Pages: {
|
|
4560
|
+
PageLinkWidget
|
|
4561
|
+
}
|
|
4409
4562
|
}
|
|
4410
4563
|
};
|
|
4411
4564
|
|
|
@@ -4432,16 +4585,16 @@ var Services = {
|
|
|
4432
4585
|
};
|
|
4433
4586
|
|
|
4434
4587
|
// src/hooks/useUserStatus.ts
|
|
4435
|
-
var
|
|
4588
|
+
var import_react29 = require("react");
|
|
4436
4589
|
init_deviceId();
|
|
4437
4590
|
init_context();
|
|
4438
4591
|
var ONLINE_THRESHOLD_MINUTES = 2;
|
|
4439
4592
|
var AWAY_THRESHOLD_MINUTES = 15;
|
|
4440
4593
|
var useUserStatus2 = (userId, initialLastSeenAt, currentAuthUserId) => {
|
|
4441
4594
|
const supabase = useSupabase();
|
|
4442
|
-
const [status, setStatus] = (0,
|
|
4443
|
-
const [lastSeen, setLastSeen] = (0,
|
|
4444
|
-
const lastSeenRef = (0,
|
|
4595
|
+
const [status, setStatus] = (0, import_react29.useState)("offline");
|
|
4596
|
+
const [lastSeen, setLastSeen] = (0, import_react29.useState)(initialLastSeenAt ?? null);
|
|
4597
|
+
const lastSeenRef = (0, import_react29.useRef)(initialLastSeenAt ?? null);
|
|
4445
4598
|
lastSeenRef.current = lastSeen;
|
|
4446
4599
|
const calculateStatus = (isOnline, lastSeenIso) => {
|
|
4447
4600
|
if (isOnline) return "online";
|
|
@@ -4457,7 +4610,7 @@ var useUserStatus2 = (userId, initialLastSeenAt, currentAuthUserId) => {
|
|
|
4457
4610
|
}
|
|
4458
4611
|
return "offline";
|
|
4459
4612
|
};
|
|
4460
|
-
(0,
|
|
4613
|
+
(0, import_react29.useEffect)(() => {
|
|
4461
4614
|
if (!userId) return;
|
|
4462
4615
|
let isMounted = true;
|
|
4463
4616
|
const isSelf = currentAuthUserId && userId === currentAuthUserId;
|
|
@@ -4547,6 +4700,7 @@ var Hooks = {
|
|
|
4547
4700
|
UI,
|
|
4548
4701
|
UserSettingsProvider,
|
|
4549
4702
|
defaultUserSettings,
|
|
4703
|
+
initI18n,
|
|
4550
4704
|
useAI,
|
|
4551
4705
|
useAppSettings,
|
|
4552
4706
|
useAppTheme,
|
package/dist/index.mjs
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
getUserLastSeenAt,
|
|
27
27
|
getUsersLastSeenMap,
|
|
28
28
|
groupSessionsByUser,
|
|
29
|
+
initI18n,
|
|
29
30
|
isCurrentSessionValid,
|
|
30
31
|
trackUserSession,
|
|
31
32
|
trackUserSessionByRoute,
|
|
@@ -42,7 +43,7 @@ import {
|
|
|
42
43
|
useTranslationEdit,
|
|
43
44
|
useTranslationNamespace,
|
|
44
45
|
useUserSettings
|
|
45
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-FRDK4RQX.mjs";
|
|
46
47
|
|
|
47
48
|
// src/UI/components/inputs/TextFieldComponent.tsx
|
|
48
49
|
import { useState } from "react";
|
|
@@ -740,7 +741,7 @@ var EmailInputComponent = ({
|
|
|
740
741
|
import { useState as useState5, useEffect as useEffect2, lazy, Suspense } from "react";
|
|
741
742
|
import { Avatar, Tooltip as Tooltip3, Typography as Typography2 } from "@mui/material";
|
|
742
743
|
import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
743
|
-
var LazyUserPopover = lazy(() => import("./UserPopoverComponent-
|
|
744
|
+
var LazyUserPopover = lazy(() => import("./UserPopoverComponent-K7CJNYYL.mjs"));
|
|
744
745
|
var getInitials = (name) => {
|
|
745
746
|
if (!name) return "?";
|
|
746
747
|
const parts = name.trim().split(" ");
|
|
@@ -1652,6 +1653,144 @@ var ExpandableNoteComponent = ({
|
|
|
1652
1653
|
);
|
|
1653
1654
|
};
|
|
1654
1655
|
|
|
1656
|
+
// src/UI/widgets/page/PageLinkWidget.tsx
|
|
1657
|
+
import { ArrowRight, Settings } from "@mui/icons-material";
|
|
1658
|
+
import {
|
|
1659
|
+
Button as Button2,
|
|
1660
|
+
Card,
|
|
1661
|
+
CardActions,
|
|
1662
|
+
CardContent,
|
|
1663
|
+
CardHeader,
|
|
1664
|
+
Divider,
|
|
1665
|
+
List,
|
|
1666
|
+
ListItem,
|
|
1667
|
+
ListItemIcon,
|
|
1668
|
+
ListItemText as ListItemText2,
|
|
1669
|
+
Typography as Typography6,
|
|
1670
|
+
Link as MuiLink
|
|
1671
|
+
} from "@mui/material";
|
|
1672
|
+
import React10 from "react";
|
|
1673
|
+
import { Link as RouterLink, useNavigate } from "react-router-dom";
|
|
1674
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1675
|
+
var PageLinkWidget = ({
|
|
1676
|
+
overrideNamespace,
|
|
1677
|
+
title,
|
|
1678
|
+
subheader,
|
|
1679
|
+
description,
|
|
1680
|
+
icon,
|
|
1681
|
+
links,
|
|
1682
|
+
actionButtonText,
|
|
1683
|
+
onActionButtonClick,
|
|
1684
|
+
bgcolor
|
|
1685
|
+
}) => {
|
|
1686
|
+
const navigate = useNavigate();
|
|
1687
|
+
return /* @__PURE__ */ jsxs10(
|
|
1688
|
+
Card,
|
|
1689
|
+
{
|
|
1690
|
+
sx: (theme) => ({
|
|
1691
|
+
height: "100%",
|
|
1692
|
+
display: "flex",
|
|
1693
|
+
flexDirection: "column",
|
|
1694
|
+
boxShadow: 3,
|
|
1695
|
+
bgcolor,
|
|
1696
|
+
color: bgcolor ? typeof bgcolor === "string" && bgcolor.includes(".") ? theme.palette.getContrastText(
|
|
1697
|
+
bgcolor.split(".").reduce((acc, key) => acc[key], theme.palette)
|
|
1698
|
+
) : typeof bgcolor === "function" ? theme.palette.getContrastText(bgcolor(theme)) : theme.palette.getContrastText(bgcolor) : "text.primary"
|
|
1699
|
+
}),
|
|
1700
|
+
children: [
|
|
1701
|
+
/* @__PURE__ */ jsx11(
|
|
1702
|
+
CardHeader,
|
|
1703
|
+
{
|
|
1704
|
+
avatar: icon ? React10.cloneElement(icon, {
|
|
1705
|
+
sx: { color: bgcolor ? "inherit" : "primary", ...icon.props.sx }
|
|
1706
|
+
}) : /* @__PURE__ */ jsx11(Settings, { color: bgcolor ? "inherit" : "primary" }),
|
|
1707
|
+
title: /* @__PURE__ */ jsx11(Typography6, { variant: "h6", component: "div", color: "inherit", children: typeof title === "string" ? /* @__PURE__ */ jsx11(TranslateText, { overrideNamespace, children: title }) : title }),
|
|
1708
|
+
subheader: subheader && /* @__PURE__ */ jsx11(Typography6, { variant: "body2", sx: { opacity: 0.8, color: "inherit" }, children: typeof subheader === "string" ? /* @__PURE__ */ jsx11(TranslateText, { overrideNamespace, children: subheader }) : subheader })
|
|
1709
|
+
}
|
|
1710
|
+
),
|
|
1711
|
+
/* @__PURE__ */ jsx11(Divider, { sx: { borderColor: "inherit", opacity: 0.2 } }),
|
|
1712
|
+
/* @__PURE__ */ jsxs10(CardContent, { sx: { flexGrow: 1 }, children: [
|
|
1713
|
+
/* @__PURE__ */ jsx11(Typography6, { variant: "body2", sx: { opacity: 0.85, color: "inherit" }, children: typeof description === "string" ? /* @__PURE__ */ jsx11(TranslateText, { overrideNamespace, children: description }) : description }),
|
|
1714
|
+
links && links.length > 0 && /* @__PURE__ */ jsx11(List, { dense: true, disablePadding: true, children: links.filter((f) => !f.hidden).map((link, index) => /* @__PURE__ */ jsxs10(
|
|
1715
|
+
ListItem,
|
|
1716
|
+
{
|
|
1717
|
+
disablePadding: true,
|
|
1718
|
+
sx: {
|
|
1719
|
+
mt: 1,
|
|
1720
|
+
// Запрещаем ListItem менять цвет фона при наведении
|
|
1721
|
+
"&:hover": {
|
|
1722
|
+
backgroundColor: "transparent"
|
|
1723
|
+
}
|
|
1724
|
+
},
|
|
1725
|
+
children: [
|
|
1726
|
+
/* @__PURE__ */ jsx11(
|
|
1727
|
+
ListItemIcon,
|
|
1728
|
+
{
|
|
1729
|
+
sx: { minWidth: 30, cursor: "pointer", color: "inherit" },
|
|
1730
|
+
onClick: () => {
|
|
1731
|
+
if (link?.href) navigate(link.href);
|
|
1732
|
+
},
|
|
1733
|
+
children: /* @__PURE__ */ jsx11(ArrowRight, { fontSize: "small", color: "inherit" })
|
|
1734
|
+
}
|
|
1735
|
+
),
|
|
1736
|
+
/* @__PURE__ */ jsx11(ListItemText2, { children: link.onClick ? /* @__PURE__ */ jsx11(
|
|
1737
|
+
Button2,
|
|
1738
|
+
{
|
|
1739
|
+
size: "small",
|
|
1740
|
+
variant: "text",
|
|
1741
|
+
color: bgcolor ? "inherit" : "primary",
|
|
1742
|
+
onClick: link.onClick,
|
|
1743
|
+
sx: {
|
|
1744
|
+
fontWeight: 500,
|
|
1745
|
+
textTransform: "none",
|
|
1746
|
+
// Отключает автоматические заглавные буквы (UPPERCASE)
|
|
1747
|
+
padding: 0,
|
|
1748
|
+
minWidth: "auto",
|
|
1749
|
+
justifyContent: "flex-start",
|
|
1750
|
+
textAlign: "left",
|
|
1751
|
+
transition: "opacity 0.2s ease-in-out",
|
|
1752
|
+
"&:hover": {
|
|
1753
|
+
opacity: 0.75,
|
|
1754
|
+
backgroundColor: "transparent",
|
|
1755
|
+
// Убирает стандартную серую подложку при ховере кнопки
|
|
1756
|
+
textDecoration: "underline"
|
|
1757
|
+
// Эффект подчеркивания, как у ссылки
|
|
1758
|
+
}
|
|
1759
|
+
},
|
|
1760
|
+
children: link.text
|
|
1761
|
+
}
|
|
1762
|
+
) : link.href ? /* @__PURE__ */ jsx11(
|
|
1763
|
+
MuiLink,
|
|
1764
|
+
{
|
|
1765
|
+
component: RouterLink,
|
|
1766
|
+
to: link.href,
|
|
1767
|
+
target: link.external ? "_blank" : "_self",
|
|
1768
|
+
rel: link.external ? "noopener noreferrer" : "",
|
|
1769
|
+
underline: "hover",
|
|
1770
|
+
color: bgcolor ? "inherit" : "primary",
|
|
1771
|
+
sx: {
|
|
1772
|
+
fontWeight: 500,
|
|
1773
|
+
display: "inline-block",
|
|
1774
|
+
transition: "opacity 0.2s ease-in-out",
|
|
1775
|
+
"&:hover": {
|
|
1776
|
+
opacity: 0.75,
|
|
1777
|
+
backgroundColor: "transparent"
|
|
1778
|
+
}
|
|
1779
|
+
},
|
|
1780
|
+
children: typeof link.text === "string" ? /* @__PURE__ */ jsx11(TranslateText, { overrideNamespace, children: link.text }) : link.text
|
|
1781
|
+
}
|
|
1782
|
+
) : /* @__PURE__ */ jsx11(Typography6, { variant: "body2", sx: { fontWeight: 500, color: "inherit" }, children: typeof link.text === "string" ? /* @__PURE__ */ jsx11(TranslateText, { overrideNamespace, children: link.text }) : link.text }) })
|
|
1783
|
+
]
|
|
1784
|
+
},
|
|
1785
|
+
index
|
|
1786
|
+
)) })
|
|
1787
|
+
] }),
|
|
1788
|
+
actionButtonText && onActionButtonClick && /* @__PURE__ */ jsx11(CardActions, { sx: { justifyContent: "flex-end", padding: 2 }, children: /* @__PURE__ */ jsx11(Button2, { size: "small", variant: "contained", onClick: onActionButtonClick, children: typeof actionButtonText === "string" ? /* @__PURE__ */ jsx11(TranslateText, { overrideNamespace, children: actionButtonText }) : actionButtonText }) })
|
|
1789
|
+
]
|
|
1790
|
+
}
|
|
1791
|
+
);
|
|
1792
|
+
};
|
|
1793
|
+
|
|
1655
1794
|
// src/UI/index.ts
|
|
1656
1795
|
var UI = {
|
|
1657
1796
|
Inputs: {
|
|
@@ -1678,8 +1817,13 @@ var UI = {
|
|
|
1678
1817
|
Row: FormRow,
|
|
1679
1818
|
},*/
|
|
1680
1819
|
Widgets: {
|
|
1681
|
-
|
|
1682
|
-
|
|
1820
|
+
Locales: {
|
|
1821
|
+
ProtectedLanguageSelector: LanguageSelector,
|
|
1822
|
+
PublicLanguageSelector
|
|
1823
|
+
},
|
|
1824
|
+
Pages: {
|
|
1825
|
+
PageLinkWidget
|
|
1826
|
+
}
|
|
1683
1827
|
}
|
|
1684
1828
|
};
|
|
1685
1829
|
|
|
@@ -1810,6 +1954,7 @@ export {
|
|
|
1810
1954
|
UI,
|
|
1811
1955
|
UserSettingsProvider,
|
|
1812
1956
|
defaultUserSettings,
|
|
1957
|
+
initI18n,
|
|
1813
1958
|
useAI,
|
|
1814
1959
|
useAppSettings,
|
|
1815
1960
|
useAppTheme,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serhii.olishevskyi/docs",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "DOCS.UA react packages",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@google/genai": "^2.27.0",
|
|
38
38
|
"@supabase/supabase-js": "^2.117.2",
|
|
39
|
-
"moment": "^2.31.0"
|
|
39
|
+
"moment": "^2.31.0",
|
|
40
|
+
"react-router-dom": "^7.18.4"
|
|
40
41
|
}
|
|
41
42
|
}
|