@logickernel/bridge 0.11.9 → 0.11.10
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.js
CHANGED
|
@@ -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,17 +882,19 @@ 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
|
-
|
|
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:
|
|
897
|
+
return /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: linkHref2, onClick: handleClick, className: "text-blue-500", children: /* @__PURE__ */ jsx("span", { children: subItem.title }) }) }) }, subItem.title);
|
|
891
898
|
}
|
|
892
899
|
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);
|
|
893
900
|
}) }) })
|
|
@@ -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
|
-
|
|
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:
|
|
926
|
+
children: /* @__PURE__ */ jsxs(Link, { href: linkHref, onClick: handleClick, className: "text-blue-500", children: [
|
|
918
927
|
item.icon && /* @__PURE__ */ jsx(item.icon, {}),
|
|
919
928
|
/* @__PURE__ */ jsx("span", { children: item.title })
|
|
920
929
|
] })
|