@logickernel/bridge 0.11.4 → 0.11.5

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.
@@ -727,22 +727,14 @@ function getIconComponent(icon) {
727
727
  }
728
728
  function NavMain({ items }) {
729
729
  const pathname = usePathname();
730
- const router = useRouter();
731
730
  const { isMobile, setOpenMobile } = useSidebar();
732
- const isAbsoluteUrl = (url) => {
733
- return url.startsWith("http://") || url.startsWith("https://");
734
- };
735
731
  const isCrossAppPath = (url) => {
736
732
  return url.startsWith("/core") || url.startsWith("/aura");
737
733
  };
738
- const handleNavigation = (url, e) => {
734
+ const handleClick = () => {
739
735
  if (isMobile) {
740
736
  setOpenMobile(false);
741
737
  }
742
- if (isCrossAppPath(url) && !isAbsoluteUrl(url)) {
743
- e?.preventDefault();
744
- router.push(url);
745
- }
746
738
  };
747
739
  if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
748
740
  console.log("[NavMain] Received items:", {
@@ -821,18 +813,7 @@ function NavMain({ items }) {
821
813
  group.label.title
822
814
  ] }),
823
815
  group.items.length > 0 && /* @__PURE__ */ jsx(SidebarMenu, { children: group.items.map((item) => {
824
- let isActive = item.isActive || false;
825
- if (!isActive) {
826
- if (isAbsoluteUrl(item.url)) {
827
- if (typeof window !== "undefined") {
828
- isActive = window.location.href === item.url;
829
- }
830
- } else if (isCrossAppPath(item.url)) {
831
- isActive = pathname === item.url;
832
- } else {
833
- isActive = pathname === item.url;
834
- }
835
- }
816
+ const isActive = pathname === item.url || item.isActive;
836
817
  const hasSubItems = item.items && item.items.length > 0;
837
818
  if (hasSubItems) {
838
819
  return /* @__PURE__ */ jsx(
@@ -855,48 +836,27 @@ function NavMain({ items }) {
855
836
  }
856
837
  ) }),
857
838
  /* @__PURE__ */ jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.items?.map((subItem) => {
858
- if (isCrossAppPath(subItem.url) && !isAbsoluteUrl(subItem.url)) {
859
- return /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx(
860
- "a",
861
- {
862
- href: subItem.url,
863
- onClick: (e) => handleNavigation(subItem.url, e),
864
- children: /* @__PURE__ */ jsx("span", { children: subItem.title })
865
- }
866
- ) }) }, subItem.title);
839
+ if (isCrossAppPath(subItem.url)) {
840
+ 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);
867
841
  }
868
- return /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx(
869
- Link,
870
- {
871
- href: subItem.url,
872
- onClick: () => handleNavigation(subItem.url),
873
- children: /* @__PURE__ */ jsx("span", { children: subItem.title })
874
- }
875
- ) }) }, subItem.title);
842
+ return /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: subItem.url, onClick: handleClick, children: /* @__PURE__ */ jsx("span", { children: subItem.title }) }) }) }, subItem.title);
876
843
  }) }) })
877
844
  ] })
878
845
  },
879
846
  item.title
880
847
  );
881
848
  }
882
- if (isCrossAppPath(item.url) && !isAbsoluteUrl(item.url)) {
849
+ if (isCrossAppPath(item.url)) {
883
850
  return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(
884
851
  SidebarMenuButton,
885
852
  {
886
853
  asChild: true,
887
854
  tooltip: item.title,
888
855
  isActive,
889
- children: /* @__PURE__ */ jsxs(
890
- "a",
891
- {
892
- href: item.url,
893
- onClick: (e) => handleNavigation(item.url, e),
894
- children: [
895
- item.icon && /* @__PURE__ */ jsx(item.icon, {}),
896
- /* @__PURE__ */ jsx("span", { children: item.title })
897
- ]
898
- }
899
- )
856
+ children: /* @__PURE__ */ jsxs("a", { href: item.url, onClick: handleClick, children: [
857
+ item.icon && /* @__PURE__ */ jsx(item.icon, {}),
858
+ /* @__PURE__ */ jsx("span", { children: item.title })
859
+ ] })
900
860
  }
901
861
  ) }, item.title);
902
862
  }
@@ -906,17 +866,10 @@ function NavMain({ items }) {
906
866
  asChild: true,
907
867
  tooltip: item.title,
908
868
  isActive,
909
- children: /* @__PURE__ */ jsxs(
910
- Link,
911
- {
912
- href: item.url,
913
- onClick: () => handleNavigation(item.url),
914
- children: [
915
- item.icon && /* @__PURE__ */ jsx(item.icon, {}),
916
- /* @__PURE__ */ jsx("span", { children: item.title })
917
- ]
918
- }
919
- )
869
+ children: /* @__PURE__ */ jsxs(Link, { href: item.url, onClick: handleClick, children: [
870
+ item.icon && /* @__PURE__ */ jsx(item.icon, {}),
871
+ /* @__PURE__ */ jsx("span", { children: item.title })
872
+ ] })
920
873
  }
921
874
  ) }, item.title);
922
875
  }) })