@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.
@@ -760,6 +760,11 @@ function NavMain({ items }) {
760
760
  }
761
761
  return false;
762
762
  };
763
+ const stripContextFromUrl = (url) => {
764
+ const urlContext = getContextFromPath(url);
765
+ if (!urlContext) return url;
766
+ return url.substring(urlContext.length) || "/";
767
+ };
763
768
  const handleClick = (e) => {
764
769
  if (isMobile) {
765
770
  setOpenMobile(false);
@@ -877,19 +882,21 @@ function NavMain({ items }) {
877
882
  ) }),
878
883
  /* @__PURE__ */ jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.items?.map((subItem) => {
879
884
  const useLink2 = shouldUseLink(subItem.url);
885
+ const linkHref2 = useLink2 ? stripContextFromUrl(subItem.url) : subItem.url;
880
886
  if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
881
887
  console.log("[NavMain] SubItem navigation:", {
882
888
  title: subItem.title,
883
- url: subItem.url,
889
+ originalUrl: subItem.url,
890
+ linkHref: linkHref2,
884
891
  currentContext: getCurrentContext(),
885
892
  useLink: useLink2,
886
893
  willReload: !useLink2
887
894
  });
888
895
  }
889
896
  if (useLink2) {
890
- return /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: subItem.url, onClick: handleClick, className: "text-blue-500", children: /* @__PURE__ */ jsx("span", { children: subItem.title }) }) }) }, subItem.title);
897
+ return /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: linkHref2, onClick: handleClick, children: /* @__PURE__ */ jsx("span", { children: subItem.title }) }) }) }, subItem.title);
891
898
  }
892
- return /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx("a", { href: subItem.url, className: "text-red-500", onClick: handleClick, children: /* @__PURE__ */ jsx("span", { children: subItem.title }) }) }) }, subItem.title);
899
+ return /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx("a", { href: subItem.url, onClick: handleClick, children: /* @__PURE__ */ jsx("span", { children: subItem.title }) }) }) }, subItem.title);
893
900
  }) }) })
894
901
  ] })
895
902
  },
@@ -897,10 +904,12 @@ function NavMain({ items }) {
897
904
  );
898
905
  }
899
906
  const useLink = shouldUseLink(item.url);
907
+ const linkHref = useLink ? stripContextFromUrl(item.url) : item.url;
900
908
  if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
901
909
  console.log("[NavMain] Item navigation:", {
902
910
  title: item.title,
903
- url: item.url,
911
+ originalUrl: item.url,
912
+ linkHref,
904
913
  currentContext: getCurrentContext(),
905
914
  currentPathname: pathname,
906
915
  useLink,
@@ -914,7 +923,7 @@ function NavMain({ items }) {
914
923
  asChild: true,
915
924
  tooltip: item.title,
916
925
  isActive,
917
- children: /* @__PURE__ */ jsxs(Link, { href: item.url, onClick: handleClick, className: "text-blue-500", children: [
926
+ children: /* @__PURE__ */ jsxs(Link, { href: linkHref, onClick: handleClick, children: [
918
927
  item.icon && /* @__PURE__ */ jsx(item.icon, {}),
919
928
  /* @__PURE__ */ jsx("span", { children: item.title })
920
929
  ] })
@@ -927,7 +936,7 @@ function NavMain({ items }) {
927
936
  asChild: true,
928
937
  tooltip: item.title,
929
938
  isActive,
930
- children: /* @__PURE__ */ jsxs("a", { href: item.url, className: "text-red-500", onClick: handleClick, children: [
939
+ children: /* @__PURE__ */ jsxs("a", { href: item.url, onClick: handleClick, children: [
931
940
  item.icon && /* @__PURE__ */ jsx(item.icon, {}),
932
941
  /* @__PURE__ */ jsx("span", { children: item.title })
933
942
  ] })