@logickernel/bridge 0.11.9 → 0.12.0

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.
@@ -789,6 +789,11 @@ function NavMain({ items }) {
789
789
  }
790
790
  return false;
791
791
  };
792
+ const stripContextFromUrl = (url) => {
793
+ const urlContext = getContextFromPath(url);
794
+ if (!urlContext) return url;
795
+ return url.substring(urlContext.length) || "/";
796
+ };
792
797
  const handleClick = (e) => {
793
798
  if (isMobile) {
794
799
  setOpenMobile(false);
@@ -906,19 +911,21 @@ function NavMain({ items }) {
906
911
  ) }),
907
912
  /* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSub, { children: item.items?.map((subItem) => {
908
913
  const useLink2 = shouldUseLink(subItem.url);
914
+ const linkHref2 = useLink2 ? stripContextFromUrl(subItem.url) : subItem.url;
909
915
  if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
910
916
  console.log("[NavMain] SubItem navigation:", {
911
917
  title: subItem.title,
912
- url: subItem.url,
918
+ originalUrl: subItem.url,
919
+ linkHref: linkHref2,
913
920
  currentContext: getCurrentContext(),
914
921
  useLink: useLink2,
915
922
  willReload: !useLink2
916
923
  });
917
924
  }
918
925
  if (useLink2) {
919
- return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link__default.default, { href: subItem.url, onClick: handleClick, className: "text-blue-500", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: subItem.title }) }) }) }, subItem.title);
926
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link__default.default, { href: linkHref2, onClick: handleClick, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: subItem.title }) }) }) }, subItem.title);
920
927
  }
921
- return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: subItem.url, className: "text-red-500", onClick: handleClick, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: subItem.title }) }) }) }, subItem.title);
928
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: subItem.url, onClick: handleClick, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: subItem.title }) }) }) }, subItem.title);
922
929
  }) }) })
923
930
  ] })
924
931
  },
@@ -926,10 +933,12 @@ function NavMain({ items }) {
926
933
  );
927
934
  }
928
935
  const useLink = shouldUseLink(item.url);
936
+ const linkHref = useLink ? stripContextFromUrl(item.url) : item.url;
929
937
  if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
930
938
  console.log("[NavMain] Item navigation:", {
931
939
  title: item.title,
932
- url: item.url,
940
+ originalUrl: item.url,
941
+ linkHref,
933
942
  currentContext: getCurrentContext(),
934
943
  currentPathname: pathname,
935
944
  useLink,
@@ -943,7 +952,7 @@ function NavMain({ items }) {
943
952
  asChild: true,
944
953
  tooltip: item.title,
945
954
  isActive,
946
- children: /* @__PURE__ */ jsxRuntime.jsxs(Link__default.default, { href: item.url, onClick: handleClick, className: "text-blue-500", children: [
955
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Link__default.default, { href: linkHref, onClick: handleClick, children: [
947
956
  item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, {}),
948
957
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title })
949
958
  ] })
@@ -956,7 +965,7 @@ function NavMain({ items }) {
956
965
  asChild: true,
957
966
  tooltip: item.title,
958
967
  isActive,
959
- children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: item.url, className: "text-red-500", onClick: handleClick, children: [
968
+ children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: item.url, onClick: handleClick, children: [
960
969
  item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, {}),
961
970
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title })
962
971
  ] })