@sesionario/blocks 1.17.0 → 1.17.1
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.cjs +59 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -16
- package/dist/index.d.ts +7 -16
- package/dist/index.js +60 -52
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1746,7 +1746,7 @@ function PlatformNavbar({
|
|
|
1746
1746
|
innerClassName
|
|
1747
1747
|
),
|
|
1748
1748
|
children: [
|
|
1749
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: logo }),
|
|
1749
|
+
logo != null && logo !== false ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: logo }) : null,
|
|
1750
1750
|
leading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: leading }) : null,
|
|
1751
1751
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1752
1752
|
"div",
|
|
@@ -1831,11 +1831,6 @@ var defaultLabels3 = {
|
|
|
1831
1831
|
personalProfile: "Personal profile",
|
|
1832
1832
|
activity: "Activity",
|
|
1833
1833
|
professionalProfile: "Professional profile",
|
|
1834
|
-
mainApp: "Main app",
|
|
1835
|
-
orgManagement: "Organization management",
|
|
1836
|
-
backoffice: "Backoffice",
|
|
1837
|
-
memberOrgs: "My organizations",
|
|
1838
|
-
managementOrgs: "Management team",
|
|
1839
1834
|
showMoreOrgs: "Show more",
|
|
1840
1835
|
showLessOrgs: "Show less",
|
|
1841
1836
|
manageOrg: "Manage organization",
|
|
@@ -1914,9 +1909,9 @@ function LanguageThemeSubs({
|
|
|
1914
1909
|
const themeValue = theme ?? "system";
|
|
1915
1910
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1916
1911
|
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSub, { children: [
|
|
1917
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
|
|
1918
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1919
|
-
|
|
1912
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSubTrigger, { className: "gap-2 [&>svg:last-child]:ml-0", children: [
|
|
1913
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.language }),
|
|
1914
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Languages, { className: "size-4" })
|
|
1920
1915
|
] }),
|
|
1921
1916
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSubContent, { className: "min-w-40", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1922
1917
|
DropdownMenuRadioGroup,
|
|
@@ -1928,9 +1923,9 @@ function LanguageThemeSubs({
|
|
|
1928
1923
|
) })
|
|
1929
1924
|
] }),
|
|
1930
1925
|
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSub, { children: [
|
|
1931
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
|
|
1932
|
-
|
|
1933
|
-
|
|
1926
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSubTrigger, { className: "gap-2 [&>svg:last-child]:ml-0", children: [
|
|
1927
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.theme }),
|
|
1928
|
+
themeValue === "light" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { className: "size-4" }) : themeValue === "dark" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Moon, { className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Monitor, { className: "size-4" })
|
|
1934
1929
|
] }),
|
|
1935
1930
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSubContent, { className: "min-w-40", children: /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuRadioGroup, { value: themeValue, onValueChange: setTheme, children: [
|
|
1936
1931
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuRadioItem, { value: "system", children: labels.themeSystem }),
|
|
@@ -1964,14 +1959,14 @@ function OrgMenuRows({
|
|
|
1964
1959
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1965
1960
|
"div",
|
|
1966
1961
|
{
|
|
1967
|
-
className: "relative
|
|
1962
|
+
className: "relative",
|
|
1968
1963
|
"data-testid": `platform-account-org-${org.id}`,
|
|
1969
1964
|
children: [
|
|
1970
1965
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1971
1966
|
DropdownMenuItem,
|
|
1972
1967
|
{
|
|
1973
1968
|
asChild: true,
|
|
1974
|
-
className: cn("
|
|
1969
|
+
className: cn("gap-2", org.canManage && "pr-9"),
|
|
1975
1970
|
children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: orgHomeHref, children: [
|
|
1976
1971
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1977
1972
|
MenuAvatar,
|
|
@@ -1981,7 +1976,7 @@ function OrgMenuRows({
|
|
|
1981
1976
|
sizeClass: "size-6"
|
|
1982
1977
|
}
|
|
1983
1978
|
),
|
|
1984
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: org.name })
|
|
1979
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: org.name })
|
|
1985
1980
|
] })
|
|
1986
1981
|
}
|
|
1987
1982
|
),
|
|
@@ -1989,8 +1984,8 @@ function OrgMenuRows({
|
|
|
1989
1984
|
DropdownMenuItem,
|
|
1990
1985
|
{
|
|
1991
1986
|
asChild: true,
|
|
1992
|
-
className: "absolute right-
|
|
1993
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: manageHref, "aria-label": labels.manageOrg, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-
|
|
1987
|
+
className: "absolute right-0.5 top-1/2 size-7 -translate-y-1/2 p-0",
|
|
1988
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: manageHref, "aria-label": labels.manageOrg, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-4" }) })
|
|
1994
1989
|
}
|
|
1995
1990
|
) : null
|
|
1996
1991
|
]
|
|
@@ -1998,7 +1993,7 @@ function OrgMenuRows({
|
|
|
1998
1993
|
org.id
|
|
1999
1994
|
);
|
|
2000
1995
|
}),
|
|
2001
|
-
collapsible ? /* @__PURE__ */ jsxRuntime.
|
|
1996
|
+
collapsible ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2002
1997
|
DropdownMenuItem,
|
|
2003
1998
|
{
|
|
2004
1999
|
className: "gap-2",
|
|
@@ -2006,13 +2001,10 @@ function OrgMenuRows({
|
|
|
2006
2001
|
event.preventDefault();
|
|
2007
2002
|
setExpanded((value) => !value);
|
|
2008
2003
|
},
|
|
2009
|
-
children:
|
|
2010
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2011
|
-
|
|
2012
|
-
]
|
|
2013
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "size-4" }),
|
|
2014
|
-
labels.showMoreOrgs
|
|
2015
|
-
] })
|
|
2004
|
+
children: [
|
|
2005
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: expanded ? labels.showLessOrgs : labels.showMoreOrgs }),
|
|
2006
|
+
expanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "size-4" })
|
|
2007
|
+
]
|
|
2016
2008
|
}
|
|
2017
2009
|
) : null
|
|
2018
2010
|
]
|
|
@@ -2023,7 +2015,6 @@ function PlatformAccountMenu({
|
|
|
2023
2015
|
variant = "platform",
|
|
2024
2016
|
isPending = false,
|
|
2025
2017
|
user = null,
|
|
2026
|
-
isAdmin = false,
|
|
2027
2018
|
verificationStatus = "unverified",
|
|
2028
2019
|
urls,
|
|
2029
2020
|
memberOrgs = [],
|
|
@@ -2047,6 +2038,7 @@ function PlatformAccountMenu({
|
|
|
2047
2038
|
() => mergePlatformAccountOrgs(memberOrgs, manageableOrgs),
|
|
2048
2039
|
[memberOrgs, manageableOrgs]
|
|
2049
2040
|
);
|
|
2041
|
+
const hasOrgs = mergedOrgs.length > 0;
|
|
2050
2042
|
const loginHref = `${urls.authAppUrl}${urls.loginPath ?? "/login"}`;
|
|
2051
2043
|
const accountHref = `${urls.authAppUrl}${urls.accountPath ?? "/account"}`;
|
|
2052
2044
|
const activityHref = `${urls.authAppUrl}${urls.activityPath ?? "/account/activity"}`;
|
|
@@ -2126,37 +2118,36 @@ function PlatformAccountMenu({
|
|
|
2126
2118
|
] }),
|
|
2127
2119
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
|
|
2128
2120
|
variant === "platform" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2121
|
+
hasOrgs ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2122
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2123
|
+
OrgMenuRows,
|
|
2124
|
+
{
|
|
2125
|
+
orgs: mergedOrgs,
|
|
2126
|
+
appUrl: urls.appUrl,
|
|
2127
|
+
adminUrl: urls.adminUrl,
|
|
2128
|
+
labels
|
|
2129
|
+
}
|
|
2130
|
+
),
|
|
2131
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {})
|
|
2132
|
+
] }) : null,
|
|
2129
2133
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: accountHref, children: [
|
|
2130
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2131
|
-
|
|
2134
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.personalProfile }),
|
|
2135
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "size-4" })
|
|
2132
2136
|
] }) }),
|
|
2133
2137
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: activityHref, children: [
|
|
2134
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2135
|
-
|
|
2138
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.activity }),
|
|
2139
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Activity, { className: "size-4" })
|
|
2136
2140
|
] }) }),
|
|
2137
2141
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: profileHref, children: [
|
|
2138
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2139
|
-
|
|
2142
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.professionalProfile }),
|
|
2143
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "size-4" })
|
|
2140
2144
|
] }) }),
|
|
2141
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2142
|
-
OrgMenuRows,
|
|
2143
|
-
{
|
|
2144
|
-
orgs: mergedOrgs,
|
|
2145
|
-
appUrl: urls.appUrl,
|
|
2146
|
-
adminUrl: urls.adminUrl,
|
|
2147
|
-
labels
|
|
2148
|
-
}
|
|
2149
|
-
),
|
|
2150
2145
|
extraItems,
|
|
2151
|
-
isAdmin && urls.backofficeUrl ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: urls.backofficeUrl, children: [
|
|
2152
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.LayoutDashboard, { className: "size-4" }),
|
|
2153
|
-
labels.backoffice
|
|
2154
|
-
] }) }) : null,
|
|
2155
2146
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {})
|
|
2156
2147
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2157
2148
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: accountHref, children: [
|
|
2158
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2159
|
-
|
|
2149
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.accountSettings }),
|
|
2150
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-4" })
|
|
2160
2151
|
] }) }),
|
|
2161
2152
|
extraItems,
|
|
2162
2153
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {})
|
|
@@ -2181,8 +2172,8 @@ function PlatformAccountMenu({
|
|
|
2181
2172
|
void handleSignOut();
|
|
2182
2173
|
},
|
|
2183
2174
|
children: [
|
|
2184
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2185
|
-
|
|
2175
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: signingOut ? labels.signingOut : labels.signOut }),
|
|
2176
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { className: "size-4" })
|
|
2186
2177
|
]
|
|
2187
2178
|
}
|
|
2188
2179
|
)
|
|
@@ -2198,8 +2189,8 @@ function PlatformAccountMenu({
|
|
|
2198
2189
|
),
|
|
2199
2190
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
|
|
2200
2191
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: loginHref, children: [
|
|
2201
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2202
|
-
|
|
2192
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.signIn }),
|
|
2193
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogIn, { className: "size-4" })
|
|
2203
2194
|
] }) })
|
|
2204
2195
|
] })
|
|
2205
2196
|
}
|
|
@@ -7272,6 +7263,7 @@ function SupportMessengerProvider({
|
|
|
7272
7263
|
className
|
|
7273
7264
|
}) {
|
|
7274
7265
|
const isMobile = useMediaQuery2("(max-width: 767px)");
|
|
7266
|
+
const dockRef = React7.useRef(null);
|
|
7275
7267
|
const [listOpen, setListOpen] = React7.useState(false);
|
|
7276
7268
|
const [threads, setThreads] = React7.useState([]);
|
|
7277
7269
|
const [mobileThreadKey, setMobileThreadKey] = React7.useState(null);
|
|
@@ -7279,6 +7271,7 @@ function SupportMessengerProvider({
|
|
|
7279
7271
|
() => items.reduce((sum, item) => sum + (item.unreadCount ?? 0), 0),
|
|
7280
7272
|
[items]
|
|
7281
7273
|
);
|
|
7274
|
+
const isDesktopOpen = !isMobile && (listOpen || threads.length > 0);
|
|
7282
7275
|
React7.useEffect(() => {
|
|
7283
7276
|
if (!forceMinimized) return;
|
|
7284
7277
|
setListOpen(false);
|
|
@@ -7321,6 +7314,20 @@ function SupportMessengerProvider({
|
|
|
7321
7314
|
setThreads([]);
|
|
7322
7315
|
setMobileThreadKey(null);
|
|
7323
7316
|
}, []);
|
|
7317
|
+
React7.useEffect(() => {
|
|
7318
|
+
if (!isDesktopOpen) return;
|
|
7319
|
+
function onPointerDown(event) {
|
|
7320
|
+
const target = event.target;
|
|
7321
|
+
if (!(target instanceof Node)) return;
|
|
7322
|
+
if (dockRef.current?.contains(target)) return;
|
|
7323
|
+
if (target instanceof Element && target.closest('[data-slot="popover-content"]')) {
|
|
7324
|
+
return;
|
|
7325
|
+
}
|
|
7326
|
+
closeAll();
|
|
7327
|
+
}
|
|
7328
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
7329
|
+
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
7330
|
+
}, [isDesktopOpen, closeAll]);
|
|
7324
7331
|
const ctx = React7.useMemo(
|
|
7325
7332
|
() => ({
|
|
7326
7333
|
listOpen,
|
|
@@ -7364,6 +7371,7 @@ function SupportMessengerProvider({
|
|
|
7364
7371
|
enabled ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7365
7372
|
"div",
|
|
7366
7373
|
{
|
|
7374
|
+
ref: dockRef,
|
|
7367
7375
|
className: cn(
|
|
7368
7376
|
"pointer-events-none fixed right-4 bottom-4 z-50 flex flex-col items-end gap-3",
|
|
7369
7377
|
className
|