@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.
@@ -756,22 +756,14 @@ function getIconComponent(icon) {
756
756
  }
757
757
  function NavMain({ items }) {
758
758
  const pathname = navigation.usePathname();
759
- const router = navigation.useRouter();
760
759
  const { isMobile, setOpenMobile } = useSidebar();
761
- const isAbsoluteUrl = (url) => {
762
- return url.startsWith("http://") || url.startsWith("https://");
763
- };
764
760
  const isCrossAppPath = (url) => {
765
761
  return url.startsWith("/core") || url.startsWith("/aura");
766
762
  };
767
- const handleNavigation = (url, e) => {
763
+ const handleClick = () => {
768
764
  if (isMobile) {
769
765
  setOpenMobile(false);
770
766
  }
771
- if (isCrossAppPath(url) && !isAbsoluteUrl(url)) {
772
- e?.preventDefault();
773
- router.push(url);
774
- }
775
767
  };
776
768
  if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
777
769
  console.log("[NavMain] Received items:", {
@@ -850,18 +842,7 @@ function NavMain({ items }) {
850
842
  group.label.title
851
843
  ] }),
852
844
  group.items.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(SidebarMenu, { children: group.items.map((item) => {
853
- let isActive = item.isActive || false;
854
- if (!isActive) {
855
- if (isAbsoluteUrl(item.url)) {
856
- if (typeof window !== "undefined") {
857
- isActive = window.location.href === item.url;
858
- }
859
- } else if (isCrossAppPath(item.url)) {
860
- isActive = pathname === item.url;
861
- } else {
862
- isActive = pathname === item.url;
863
- }
864
- }
845
+ const isActive = pathname === item.url || item.isActive;
865
846
  const hasSubItems = item.items && item.items.length > 0;
866
847
  if (hasSubItems) {
867
848
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -884,48 +865,27 @@ function NavMain({ items }) {
884
865
  }
885
866
  ) }),
886
867
  /* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSub, { children: item.items?.map((subItem) => {
887
- if (isCrossAppPath(subItem.url) && !isAbsoluteUrl(subItem.url)) {
888
- return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
889
- "a",
890
- {
891
- href: subItem.url,
892
- onClick: (e) => handleNavigation(subItem.url, e),
893
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: subItem.title })
894
- }
895
- ) }) }, subItem.title);
868
+ if (isCrossAppPath(subItem.url)) {
869
+ 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);
896
870
  }
897
- return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
898
- Link__default.default,
899
- {
900
- href: subItem.url,
901
- onClick: () => handleNavigation(subItem.url),
902
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: subItem.title })
903
- }
904
- ) }) }, subItem.title);
871
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link__default.default, { href: subItem.url, onClick: handleClick, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: subItem.title }) }) }) }, subItem.title);
905
872
  }) }) })
906
873
  ] })
907
874
  },
908
875
  item.title
909
876
  );
910
877
  }
911
- if (isCrossAppPath(item.url) && !isAbsoluteUrl(item.url)) {
878
+ if (isCrossAppPath(item.url)) {
912
879
  return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsx(
913
880
  SidebarMenuButton,
914
881
  {
915
882
  asChild: true,
916
883
  tooltip: item.title,
917
884
  isActive,
918
- children: /* @__PURE__ */ jsxRuntime.jsxs(
919
- "a",
920
- {
921
- href: item.url,
922
- onClick: (e) => handleNavigation(item.url, e),
923
- children: [
924
- item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, {}),
925
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title })
926
- ]
927
- }
928
- )
885
+ children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: item.url, onClick: handleClick, children: [
886
+ item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, {}),
887
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title })
888
+ ] })
929
889
  }
930
890
  ) }, item.title);
931
891
  }
@@ -935,17 +895,10 @@ function NavMain({ items }) {
935
895
  asChild: true,
936
896
  tooltip: item.title,
937
897
  isActive,
938
- children: /* @__PURE__ */ jsxRuntime.jsxs(
939
- Link__default.default,
940
- {
941
- href: item.url,
942
- onClick: () => handleNavigation(item.url),
943
- children: [
944
- item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, {}),
945
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title })
946
- ]
947
- }
948
- )
898
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Link__default.default, { href: item.url, onClick: handleClick, children: [
899
+ item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, {}),
900
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title })
901
+ ] })
949
902
  }
950
903
  ) }, item.title);
951
904
  }) })