@fluid-app/portal-sdk 0.1.447 → 0.1.449
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/{ContactsScreen-CbWOdrpK.cjs → ContactsScreen-C1kfIxoL.cjs} +1 -1
- package/dist/{ContactsScreen-BMnHQQQj.cjs → ContactsScreen-CBXOEkvz.cjs} +78 -17
- package/dist/ContactsScreen-CBXOEkvz.cjs.map +1 -0
- package/dist/{ContactsScreen-Ds-J6GFM.mjs → ContactsScreen-DjMBu144.mjs} +73 -18
- package/dist/ContactsScreen-DjMBu144.mjs.map +1 -0
- package/dist/{OrdersScreen-_JbOhHSb.mjs → OrdersScreen--5B4atX4.mjs} +1 -1
- package/dist/{OrdersScreen-DRLiFoMp.cjs → OrdersScreen-C9MxM1dT.cjs} +1 -1
- package/dist/{OrdersScreen-Czu93Plh.cjs → OrdersScreen-CXMq9Orj.cjs} +4 -1
- package/dist/OrdersScreen-CXMq9Orj.cjs.map +1 -0
- package/dist/{OrdersScreen-CBghCpGM.mjs → OrdersScreen-CjTa34io.mjs} +4 -1
- package/dist/OrdersScreen-CjTa34io.mjs.map +1 -0
- package/dist/index.cjs +168 -122
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +168 -122
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
- package/dist/ContactsScreen-BMnHQQQj.cjs.map +0 -1
- package/dist/ContactsScreen-Ds-J6GFM.mjs.map +0 -1
- package/dist/OrdersScreen-CBghCpGM.mjs.map +0 -1
- package/dist/OrdersScreen-Czu93Plh.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ require("./use-optional-store-CIM4spDu.cjs");
|
|
|
7
7
|
const require_FluidProvider = require("./FluidProvider-BWqJxZRi.cjs");
|
|
8
8
|
require("./mysite-api-context-SWweFE49.cjs");
|
|
9
9
|
require("./ContactsTranslationBridge-BvkMkPED.cjs");
|
|
10
|
-
const require_ContactsScreen = require("./ContactsScreen-
|
|
10
|
+
const require_ContactsScreen = require("./ContactsScreen-CBXOEkvz.cjs");
|
|
11
11
|
require("./translation-adapter-Bi65zBvS.cjs");
|
|
12
12
|
const require_PortalTenantClientProvider = require("./PortalTenantClientProvider-Ct2vdZPi.cjs");
|
|
13
13
|
require("./registry-context-Dw3vg1Fz.cjs");
|
|
@@ -73,7 +73,7 @@ const require_SubscriptionsScreen = require("./SubscriptionsScreen-g9PPMEE5.cjs"
|
|
|
73
73
|
require("./dist-Cpt-uZEu.cjs");
|
|
74
74
|
require("./es-DgpoYsI0.cjs");
|
|
75
75
|
require("./dist-BGBmj4YO.cjs");
|
|
76
|
-
const require_OrdersScreen = require("./OrdersScreen-
|
|
76
|
+
const require_OrdersScreen = require("./OrdersScreen-CXMq9Orj.cjs");
|
|
77
77
|
const require_MySiteScreen = require("./MySiteScreen-153RP02E.cjs");
|
|
78
78
|
require("./dist-DbRyOeMz.cjs");
|
|
79
79
|
const require_ShopScreen = require("./ShopScreen-DeYgHEBX.cjs");
|
|
@@ -497,22 +497,6 @@ function useResolvedPages(navigation) {
|
|
|
497
497
|
return (0, react.useMemo)(() => resolvePages(navigation), [resolvePages, navigation]);
|
|
498
498
|
}
|
|
499
499
|
//#endregion
|
|
500
|
-
//#region ../react/src/shell/use-mobile.ts
|
|
501
|
-
const MOBILE_BREAKPOINT = 768;
|
|
502
|
-
function useIsMobile() {
|
|
503
|
-
const [isMobile, setIsMobile] = (0, react.useState)(false);
|
|
504
|
-
(0, react.useEffect)(() => {
|
|
505
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
506
|
-
const onChange = () => {
|
|
507
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
508
|
-
};
|
|
509
|
-
mql.addEventListener("change", onChange);
|
|
510
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
511
|
-
return () => mql.removeEventListener("change", onChange);
|
|
512
|
-
}, []);
|
|
513
|
-
return isMobile;
|
|
514
|
-
}
|
|
515
|
-
//#endregion
|
|
516
500
|
//#region ../react/src/shell/sidebar.tsx
|
|
517
501
|
function cn(...inputs) {
|
|
518
502
|
return (0, tailwind_merge.twMerge)((0, clsx.clsx)(inputs));
|
|
@@ -542,7 +526,7 @@ function useSidebar() {
|
|
|
542
526
|
return context;
|
|
543
527
|
}
|
|
544
528
|
const SidebarProvider = react.forwardRef(({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, viewportWidth, previewMode, useBottomNav: useBottomNavProp = false, className, style, children, ...props }, ref) => {
|
|
545
|
-
const windowIsMobile = useIsMobile();
|
|
529
|
+
const windowIsMobile = require_ContactsScreen.useIsMobile();
|
|
546
530
|
const isMobile = viewportWidth !== void 0 ? viewportWidth < 768 : windowIsMobile;
|
|
547
531
|
const isPreviewMode = viewportWidth !== void 0 || !!previewMode;
|
|
548
532
|
const [openMobile, setOpenMobile] = react.useState(false);
|
|
@@ -1404,6 +1388,32 @@ function SdkNavigation({ navItems, currentSlug, onNavigate }) {
|
|
|
1404
1388
|
}) });
|
|
1405
1389
|
}
|
|
1406
1390
|
//#endregion
|
|
1391
|
+
//#region src/shell/use-mobile-languages.ts
|
|
1392
|
+
/**
|
|
1393
|
+
* Resolve the language options to offer in the mobile switcher: the company's
|
|
1394
|
+
* enabled languages, falling back to the full supported set if that request
|
|
1395
|
+
* hasn't returned, failed, or came back empty (better to over-offer than to
|
|
1396
|
+
* strand the user with no way to switch).
|
|
1397
|
+
*/
|
|
1398
|
+
function useMobileLanguages() {
|
|
1399
|
+
const { locale, setLocale } = require_static_dict_adapter.useActiveLocale();
|
|
1400
|
+
const languagesApi = require_FluidProvider.useLanguagesApi();
|
|
1401
|
+
const { data } = (0, _tanstack_react_query.useQuery)({
|
|
1402
|
+
queryKey: require_query_keys.storeKeys.languages(),
|
|
1403
|
+
queryFn: () => languagesApi.listLanguages({ limit: 100 }),
|
|
1404
|
+
staleTime: 300 * 1e3
|
|
1405
|
+
});
|
|
1406
|
+
const enabledCodes = new Set((data?.languages ?? []).map((l) => l.code));
|
|
1407
|
+
const filtered = require_FluidProvider.SUPPORTED_LANGUAGES.filter((l) => enabledCodes.has(l.iso));
|
|
1408
|
+
const languages = filtered.length > 0 ? filtered : require_FluidProvider.SUPPORTED_LANGUAGES;
|
|
1409
|
+
return {
|
|
1410
|
+
languages,
|
|
1411
|
+
locale,
|
|
1412
|
+
setLocale,
|
|
1413
|
+
currentName: languages.find((l) => l.iso === locale)?.name ?? locale
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
//#endregion
|
|
1407
1417
|
//#region src/shell/SdkMobileProfileMenu.tsx
|
|
1408
1418
|
function getInitials(name) {
|
|
1409
1419
|
if (!name) return "U";
|
|
@@ -1414,13 +1424,19 @@ function getInitials(name) {
|
|
|
1414
1424
|
function SdkMobileProfileMenu({ onNavigate, onLogout }) {
|
|
1415
1425
|
const { isMobile, useBottomNav } = useSidebar();
|
|
1416
1426
|
const [isOpen, setIsOpen] = (0, react.useState)(false);
|
|
1427
|
+
const [view, setView] = (0, react.useState)("main");
|
|
1417
1428
|
const user = require_RepUserContext.useRepUser();
|
|
1418
1429
|
const themeMode = useThemeMode();
|
|
1430
|
+
const languages = useMobileLanguages();
|
|
1419
1431
|
const { t } = require_shell_translation_api_context.useShellTranslation();
|
|
1420
1432
|
const handleNavigate = (0, react.useCallback)((slug) => {
|
|
1421
1433
|
setIsOpen(false);
|
|
1422
1434
|
onNavigate(slug);
|
|
1423
1435
|
}, [onNavigate]);
|
|
1436
|
+
const handleOpenChange = (0, react.useCallback)((open) => {
|
|
1437
|
+
setIsOpen(open);
|
|
1438
|
+
if (!open) setView("main");
|
|
1439
|
+
}, []);
|
|
1424
1440
|
if (!isMobile || !useBottomNav) return null;
|
|
1425
1441
|
const initials = getInitials(user?.name);
|
|
1426
1442
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -1436,114 +1452,99 @@ function SdkMobileProfileMenu({ onNavigate, onLogout }) {
|
|
|
1436
1452
|
className: "flex size-8 items-center justify-center text-xs font-medium",
|
|
1437
1453
|
children: initials
|
|
1438
1454
|
})
|
|
1439
|
-
}),
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1455
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_fluid_app_ui_components_components_MobileBottomSheet.MobileBottomSheet, {
|
|
1456
|
+
open: isOpen,
|
|
1457
|
+
onOpenChange: handleOpenChange,
|
|
1458
|
+
surface: "sidebar",
|
|
1459
|
+
title: view === "language" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1460
|
+
type: "button",
|
|
1461
|
+
onClick: () => setView("main"),
|
|
1462
|
+
className: "text-foreground -ml-1 flex items-center gap-1",
|
|
1463
|
+
"aria-label": t("nav_back"),
|
|
1464
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronLeft, { className: "size-5" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("language_select") })]
|
|
1465
|
+
}) : t("profile_title"),
|
|
1466
|
+
children: view === "language" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1467
|
+
className: "flex flex-col pb-2",
|
|
1468
|
+
children: languages.languages.map((lang) => {
|
|
1469
|
+
const isActive = lang.iso === languages.locale;
|
|
1470
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1471
|
+
type: "button",
|
|
1472
|
+
onClick: () => {
|
|
1473
|
+
languages.setLocale(lang.iso);
|
|
1474
|
+
setView("main");
|
|
1475
|
+
},
|
|
1476
|
+
className: "hover:bg-sidebar-accent flex w-full items-center justify-between gap-3 rounded-lg px-3 py-3.5 text-left",
|
|
1477
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1478
|
+
className: isActive ? "text-foreground text-base font-semibold" : "text-foreground text-base",
|
|
1479
|
+
children: lang.name
|
|
1480
|
+
}), isActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "text-primary size-5 shrink-0" })]
|
|
1481
|
+
}, lang.iso);
|
|
1482
|
+
})
|
|
1483
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
1484
|
+
user && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1485
|
+
className: "border-border flex items-center gap-3 border-b px-3 py-4",
|
|
1486
|
+
children: [user.imageUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
1487
|
+
src: user.imageUrl,
|
|
1488
|
+
alt: user.name ?? t("profile_user_fallback"),
|
|
1489
|
+
className: "size-10 rounded-full object-cover"
|
|
1490
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1491
|
+
className: "bg-muted flex size-10 items-center justify-center rounded-full text-sm font-medium",
|
|
1492
|
+
children: initials
|
|
1493
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1494
|
+
className: "min-w-0 flex-1",
|
|
1495
|
+
children: [user.name && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1496
|
+
className: "text-foreground truncate text-sm font-semibold",
|
|
1497
|
+
children: user.name
|
|
1498
|
+
}), user.email && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1499
|
+
className: "text-muted-foreground truncate text-xs",
|
|
1500
|
+
children: user.email
|
|
1474
1501
|
})]
|
|
1475
|
-
})
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1502
|
+
})]
|
|
1503
|
+
}),
|
|
1504
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1505
|
+
className: "border-border border-b py-2",
|
|
1506
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1507
|
+
type: "button",
|
|
1508
|
+
onClick: () => handleNavigate("app-download"),
|
|
1509
|
+
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium",
|
|
1510
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Smartphone, { className: "size-5" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("profile_app_download") })]
|
|
1511
|
+
})
|
|
1512
|
+
}),
|
|
1513
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1514
|
+
className: "space-y-1 py-2",
|
|
1515
|
+
children: [
|
|
1516
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1479
1517
|
type: "button",
|
|
1480
|
-
onClick: () =>
|
|
1518
|
+
onClick: () => setView("language"),
|
|
1481
1519
|
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium",
|
|
1482
|
-
children: [
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1520
|
+
children: [
|
|
1521
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Globe, { className: "size-5 shrink-0" }),
|
|
1522
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("language_select") }),
|
|
1523
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1524
|
+
className: "text-muted-foreground ml-auto flex min-w-0 items-center gap-1",
|
|
1525
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1526
|
+
className: "truncate",
|
|
1527
|
+
children: languages.currentName
|
|
1528
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: "size-4 shrink-0" })]
|
|
1529
|
+
})
|
|
1530
|
+
]
|
|
1531
|
+
}),
|
|
1532
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1488
1533
|
type: "button",
|
|
1489
1534
|
onClick: themeMode.cycleMode,
|
|
1490
1535
|
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium",
|
|
1491
1536
|
children: [themeMode.mode === "dark" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Moon, { className: "size-5" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Sun, { className: "size-5" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: themeMode.mode === "light" ? t("theme_light") : t("theme_dark") })]
|
|
1492
|
-
}),
|
|
1537
|
+
}),
|
|
1538
|
+
onLogout && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1493
1539
|
type: "button",
|
|
1494
1540
|
onClick: onLogout,
|
|
1495
1541
|
className: "text-destructive hover:bg-sidebar-accent flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium",
|
|
1496
1542
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LogOut, { className: "size-5" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("logout") })]
|
|
1497
|
-
})
|
|
1498
|
-
|
|
1499
|
-
]
|
|
1500
|
-
})]
|
|
1501
|
-
})] });
|
|
1502
|
-
}
|
|
1503
|
-
//#endregion
|
|
1504
|
-
//#region src/shell/LanguageSelector.tsx
|
|
1505
|
-
function LanguageSelector() {
|
|
1506
|
-
const [open, setOpen] = (0, react.useState)(false);
|
|
1507
|
-
const { locale, setLocale } = require_static_dict_adapter.useActiveLocale();
|
|
1508
|
-
const { t } = require_shell_translation_api_context.useShellTranslation();
|
|
1509
|
-
const languagesApi = require_FluidProvider.useLanguagesApi();
|
|
1510
|
-
const { data: languagesData } = (0, _tanstack_react_query.useQuery)({
|
|
1511
|
-
queryKey: require_query_keys.storeKeys.languages(),
|
|
1512
|
-
queryFn: () => languagesApi.listLanguages({ limit: 100 }),
|
|
1513
|
-
staleTime: 300 * 1e3
|
|
1514
|
-
});
|
|
1515
|
-
const enabledCodes = new Set((languagesData?.languages ?? []).map((l) => l.code));
|
|
1516
|
-
const filtered = require_FluidProvider.SUPPORTED_LANGUAGES.filter((l) => enabledCodes.has(l.iso));
|
|
1517
|
-
const languagesToRender = filtered.length > 0 ? filtered : require_FluidProvider.SUPPORTED_LANGUAGES;
|
|
1518
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src$1.Popover, {
|
|
1519
|
-
open,
|
|
1520
|
-
onOpenChange: setOpen,
|
|
1521
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src$1.PopoverTrigger, {
|
|
1522
|
-
asChild: true,
|
|
1523
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src$1.Button, {
|
|
1524
|
-
variant: "ghost",
|
|
1525
|
-
size: "sm",
|
|
1526
|
-
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shrink-0 gap-1.5",
|
|
1527
|
-
"aria-label": t("language_select"),
|
|
1528
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Globe, { className: "size-3" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1529
|
-
className: "text-xs uppercase",
|
|
1530
|
-
children: locale.split("_")[0]
|
|
1531
|
-
})]
|
|
1543
|
+
})
|
|
1544
|
+
]
|
|
1532
1545
|
})
|
|
1533
|
-
})
|
|
1534
|
-
|
|
1535
|
-
className: "bg-popover z-50 w-56 rounded-lg p-1 shadow-lg",
|
|
1536
|
-
children: languagesToRender.map((lang) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src$1.Button, {
|
|
1537
|
-
variant: "ghost",
|
|
1538
|
-
className: "h-auto w-full justify-between px-3 py-2 text-left text-sm whitespace-normal",
|
|
1539
|
-
onClick: () => {
|
|
1540
|
-
setLocale(lang.iso);
|
|
1541
|
-
setOpen(false);
|
|
1542
|
-
},
|
|
1543
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: lang.name }), lang.iso === locale && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "size-4" })]
|
|
1544
|
-
}, lang.iso))
|
|
1545
|
-
})]
|
|
1546
|
-
});
|
|
1546
|
+
] })
|
|
1547
|
+
})] });
|
|
1547
1548
|
}
|
|
1548
1549
|
//#endregion
|
|
1549
1550
|
//#region src/shell/SdkHeader.tsx
|
|
@@ -1570,12 +1571,12 @@ function SdkHeader({ mobileTabs, currentSlug, title, onBack, onNavigate, onLogou
|
|
|
1570
1571
|
className: "text-sidebar-foreground min-w-0 flex-1 truncate text-[17px] leading-tight font-semibold tracking-[-0.01em]",
|
|
1571
1572
|
children: resolvedTitle
|
|
1572
1573
|
}) : null,
|
|
1573
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
1574
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1574
1575
|
className: "text-muted-foreground ml-auto flex flex-none items-center justify-end gap-2",
|
|
1575
|
-
children:
|
|
1576
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SdkMobileProfileMenu, {
|
|
1576
1577
|
onNavigate,
|
|
1577
1578
|
onLogout
|
|
1578
|
-
})
|
|
1579
|
+
})
|
|
1579
1580
|
})
|
|
1580
1581
|
]
|
|
1581
1582
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -1603,6 +1604,51 @@ function SdkHeader({ mobileTabs, currentSlug, title, onBack, onNavigate, onLogou
|
|
|
1603
1604
|
});
|
|
1604
1605
|
}
|
|
1605
1606
|
//#endregion
|
|
1607
|
+
//#region src/shell/LanguageSelector.tsx
|
|
1608
|
+
function LanguageSelector() {
|
|
1609
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
1610
|
+
const { locale, setLocale } = require_static_dict_adapter.useActiveLocale();
|
|
1611
|
+
const { t } = require_shell_translation_api_context.useShellTranslation();
|
|
1612
|
+
const languagesApi = require_FluidProvider.useLanguagesApi();
|
|
1613
|
+
const { data: languagesData } = (0, _tanstack_react_query.useQuery)({
|
|
1614
|
+
queryKey: require_query_keys.storeKeys.languages(),
|
|
1615
|
+
queryFn: () => languagesApi.listLanguages({ limit: 100 }),
|
|
1616
|
+
staleTime: 300 * 1e3
|
|
1617
|
+
});
|
|
1618
|
+
const enabledCodes = new Set((languagesData?.languages ?? []).map((l) => l.code));
|
|
1619
|
+
const filtered = require_FluidProvider.SUPPORTED_LANGUAGES.filter((l) => enabledCodes.has(l.iso));
|
|
1620
|
+
const languagesToRender = filtered.length > 0 ? filtered : require_FluidProvider.SUPPORTED_LANGUAGES;
|
|
1621
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src$1.Popover, {
|
|
1622
|
+
open,
|
|
1623
|
+
onOpenChange: setOpen,
|
|
1624
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src$1.PopoverTrigger, {
|
|
1625
|
+
asChild: true,
|
|
1626
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src$1.Button, {
|
|
1627
|
+
variant: "ghost",
|
|
1628
|
+
size: "sm",
|
|
1629
|
+
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shrink-0 gap-1.5",
|
|
1630
|
+
"aria-label": t("language_select"),
|
|
1631
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Globe, { className: "size-3" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1632
|
+
className: "text-xs uppercase",
|
|
1633
|
+
children: locale.split("_")[0]
|
|
1634
|
+
})]
|
|
1635
|
+
})
|
|
1636
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src$1.PopoverContent, {
|
|
1637
|
+
align: "end",
|
|
1638
|
+
className: "bg-popover z-50 w-56 rounded-lg p-1 shadow-lg",
|
|
1639
|
+
children: languagesToRender.map((lang) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src$1.Button, {
|
|
1640
|
+
variant: "ghost",
|
|
1641
|
+
className: "h-auto w-full justify-between px-3 py-2 text-left text-sm whitespace-normal",
|
|
1642
|
+
onClick: () => {
|
|
1643
|
+
setLocale(lang.iso);
|
|
1644
|
+
setOpen(false);
|
|
1645
|
+
},
|
|
1646
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: lang.name }), lang.iso === locale && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "size-4" })]
|
|
1647
|
+
}, lang.iso))
|
|
1648
|
+
})]
|
|
1649
|
+
});
|
|
1650
|
+
}
|
|
1651
|
+
//#endregion
|
|
1606
1652
|
//#region ../../company-switcher/ui/src/components/CompanyImage.tsx
|
|
1607
1653
|
function CompanyImage({ src, alt, size }) {
|
|
1608
1654
|
const [error, setError] = (0, react.useState)(false);
|
|
@@ -1809,10 +1855,10 @@ function resolveMemberTypePage(registry, memberTypeSlug, currentSlug, baseSlug)
|
|
|
1809
1855
|
//#endregion
|
|
1810
1856
|
//#region src/shell/system-screen-map.ts
|
|
1811
1857
|
const ProfileScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProfileScreen-BkzMjtjH.cjs")).then((m) => ({ default: m.ProfileScreen })));
|
|
1812
|
-
const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./OrdersScreen-
|
|
1858
|
+
const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./OrdersScreen-C9MxM1dT.cjs")).then((m) => ({ default: m.OrdersScreen })));
|
|
1813
1859
|
const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-YWbl8qCX.cjs")).then((m) => ({ default: m.SubscriptionsScreen })));
|
|
1814
1860
|
const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MessagingScreen-nkmfBY4B.cjs")).then((m) => ({ default: m.MessagingScreen })));
|
|
1815
|
-
const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-
|
|
1861
|
+
const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-C1kfIxoL.cjs")).then((m) => ({ default: m.ContactsScreen })));
|
|
1816
1862
|
const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-D5BncoY4.cjs")).then((m) => ({ default: m.ShopScreen })));
|
|
1817
1863
|
const CustomersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./CustomersScreen-BglnNB4X.cjs")).then((m) => ({ default: m.CustomersScreen })));
|
|
1818
1864
|
const ShareablesScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShareablesScreen-BIHgA14y.cjs")).then((m) => ({ default: m.ShareablesScreen })));
|
|
@@ -3723,8 +3769,8 @@ const CORE_PAGE_IDS = {
|
|
|
3723
3769
|
const screenPropertySchemas = {
|
|
3724
3770
|
ProfileScreen: () => Promise.resolve().then(() => require("./ProfileScreen-BkzMjtjH.cjs")).then((m) => m.profileScreenPropertySchema),
|
|
3725
3771
|
MessagingScreen: () => Promise.resolve().then(() => require("./MessagingScreen-nkmfBY4B.cjs")).then((m) => m.messagingScreenPropertySchema),
|
|
3726
|
-
ContactsScreen: () => Promise.resolve().then(() => require("./ContactsScreen-
|
|
3727
|
-
OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-
|
|
3772
|
+
ContactsScreen: () => Promise.resolve().then(() => require("./ContactsScreen-C1kfIxoL.cjs")).then((m) => m.contactsScreenPropertySchema),
|
|
3773
|
+
OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-C9MxM1dT.cjs")).then((m) => m.ordersScreenPropertySchema),
|
|
3728
3774
|
SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-YWbl8qCX.cjs")).then((m) => m.subscriptionsScreenPropertySchema),
|
|
3729
3775
|
CustomersScreen: () => Promise.resolve().then(() => require("./CustomersScreen-BglnNB4X.cjs")).then((m) => m.customersScreenPropertySchema),
|
|
3730
3776
|
MySiteScreen: () => Promise.resolve().then(() => require("./MySiteScreen-DBbZBYAj.cjs")).then((m) => m.mySiteScreenPropertySchema),
|