@logickernel/bridge 0.11.1 → 0.11.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/next/components.cjs
CHANGED
|
@@ -13,7 +13,6 @@ var navigation = require('next/navigation');
|
|
|
13
13
|
var Link = require('next/link');
|
|
14
14
|
var CollapsiblePrimitive = require('@radix-ui/react-collapsible');
|
|
15
15
|
var react = require('next-auth/react');
|
|
16
|
-
require('jose');
|
|
17
16
|
var AvatarPrimitive = require('@radix-ui/react-avatar');
|
|
18
17
|
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
19
18
|
|
|
@@ -901,16 +900,6 @@ function NavMain({ items }) {
|
|
|
901
900
|
] }, groupIndex);
|
|
902
901
|
}) });
|
|
903
902
|
}
|
|
904
|
-
function getAuthUrl() {
|
|
905
|
-
return process.env.AUTH_URL || process.env.BASE_URL || "http://localhost:3000";
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
// src/routes.ts
|
|
909
|
-
function buildSignInUrl(callbackUrl) {
|
|
910
|
-
const authUrl = getAuthUrl();
|
|
911
|
-
const url = new URL("/core/auth/signin", authUrl);
|
|
912
|
-
return url;
|
|
913
|
-
}
|
|
914
903
|
function Avatar({
|
|
915
904
|
className,
|
|
916
905
|
...props
|
|
@@ -1074,8 +1063,7 @@ function NavUser({ user }) {
|
|
|
1074
1063
|
const displayName = user.name || user.email;
|
|
1075
1064
|
const handleSignOut = async () => {
|
|
1076
1065
|
await react.signOut({ redirect: false });
|
|
1077
|
-
|
|
1078
|
-
window.location.href = signInUrl.toString();
|
|
1066
|
+
window.location.href = "/core/auth/signin";
|
|
1079
1067
|
};
|
|
1080
1068
|
return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenu, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
|
|
1081
1069
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1137,22 +1125,23 @@ function TeamSwitcher({
|
|
|
1137
1125
|
const isMobile = sidebar?.isMobile ?? false;
|
|
1138
1126
|
const pathname = navigation.usePathname();
|
|
1139
1127
|
const router = navigation.useRouter();
|
|
1140
|
-
const pathSegments = pathname.split("/");
|
|
1141
|
-
const
|
|
1142
|
-
const
|
|
1128
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
1129
|
+
const skipSegments = ["user", "api", "auth", "dashboard", "settings", "app"];
|
|
1130
|
+
const potentialOrgId = pathSegments.length >= 1 ? pathSegments[0] : null;
|
|
1131
|
+
const pathOrgId = potentialOrgId && !skipSegments.includes(potentialOrgId) && (potentialOrgId.includes("-") || potentialOrgId.length >= 8) ? potentialOrgId : null;
|
|
1143
1132
|
const currentOrgId = organizationId || (pathOrgId && teams.some((team) => team.id === pathOrgId) ? pathOrgId : null);
|
|
1144
1133
|
const handleTeamChange = (teamId) => {
|
|
1145
1134
|
if (isMobile && sidebar?.setOpenMobile) {
|
|
1146
1135
|
sidebar.setOpenMobile(false);
|
|
1147
1136
|
}
|
|
1148
|
-
router.push(
|
|
1137
|
+
router.push(`/${teamId}/home`);
|
|
1149
1138
|
router.refresh();
|
|
1150
1139
|
};
|
|
1151
1140
|
const handleManageOrganizations = () => {
|
|
1152
1141
|
if (isMobile && sidebar?.setOpenMobile) {
|
|
1153
1142
|
sidebar.setOpenMobile(false);
|
|
1154
1143
|
}
|
|
1155
|
-
router.push("/
|
|
1144
|
+
router.push("/user/organizations");
|
|
1156
1145
|
};
|
|
1157
1146
|
const teamsWithLogo = teams.map((org) => {
|
|
1158
1147
|
const logoIcon = org.logo ? getIconComponent(org.logo) : LucideIcons.GalleryVerticalEnd;
|
|
@@ -1330,12 +1319,7 @@ function AppSidebar({
|
|
|
1330
1319
|
const currentPathname = navigation.usePathname();
|
|
1331
1320
|
const pathSegments = currentPathname.split("/").filter(Boolean);
|
|
1332
1321
|
let pathOrgId = null;
|
|
1333
|
-
if (pathSegments.length >=
|
|
1334
|
-
const potentialOrgId = pathSegments[1];
|
|
1335
|
-
if (potentialOrgId && potentialOrgId !== "user") {
|
|
1336
|
-
pathOrgId = potentialOrgId;
|
|
1337
|
-
}
|
|
1338
|
-
} else if (pathSegments.length >= 1) {
|
|
1322
|
+
if (pathSegments.length >= 1) {
|
|
1339
1323
|
const potentialOrgId = pathSegments[0];
|
|
1340
1324
|
const skipSegments = ["user", "api", "auth", "dashboard", "settings", "app"];
|
|
1341
1325
|
if (potentialOrgId && !skipSegments.includes(potentialOrgId)) {
|