@logickernel/bridge 0.9.6 → 0.9.8
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.
|
@@ -75,7 +75,7 @@ declare function useNavigation({ organizationId, apiBaseUrl, enabled, }?: UseNav
|
|
|
75
75
|
interface NavMainProps {
|
|
76
76
|
items: NavigationItem[];
|
|
77
77
|
}
|
|
78
|
-
declare function NavMain({ items }: NavMainProps): react_jsx_runtime.JSX.Element;
|
|
78
|
+
declare function NavMain({ items }: NavMainProps): react_jsx_runtime.JSX.Element | null;
|
|
79
79
|
|
|
80
80
|
interface NavUserProps {
|
|
81
81
|
user: User;
|
|
@@ -75,7 +75,7 @@ declare function useNavigation({ organizationId, apiBaseUrl, enabled, }?: UseNav
|
|
|
75
75
|
interface NavMainProps {
|
|
76
76
|
items: NavigationItem[];
|
|
77
77
|
}
|
|
78
|
-
declare function NavMain({ items }: NavMainProps): react_jsx_runtime.JSX.Element;
|
|
78
|
+
declare function NavMain({ items }: NavMainProps): react_jsx_runtime.JSX.Element | null;
|
|
79
79
|
|
|
80
80
|
interface NavUserProps {
|
|
81
81
|
user: User;
|
package/dist/next/components.js
CHANGED
|
@@ -728,6 +728,17 @@ function getIconComponent(icon) {
|
|
|
728
728
|
}
|
|
729
729
|
function NavMain({ items }) {
|
|
730
730
|
const pathname = usePathname();
|
|
731
|
+
if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
|
|
732
|
+
console.log("[NavMain] Received items:", {
|
|
733
|
+
itemsCount: items.length,
|
|
734
|
+
items: items.map((item) => ({
|
|
735
|
+
title: item.title,
|
|
736
|
+
url: item.url,
|
|
737
|
+
icon: item.icon,
|
|
738
|
+
hasSubItems: !!(item.items && item.items.length > 0)
|
|
739
|
+
}))
|
|
740
|
+
});
|
|
741
|
+
}
|
|
731
742
|
const groups = [];
|
|
732
743
|
let currentGroup = {
|
|
733
744
|
items: []
|
|
@@ -755,54 +766,88 @@ function NavMain({ items }) {
|
|
|
755
766
|
if (currentGroup.items.length > 0 || currentGroup.label) {
|
|
756
767
|
groups.push(currentGroup);
|
|
757
768
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
group
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
+
if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
|
|
770
|
+
console.log("[NavMain] Groups:", {
|
|
771
|
+
groupsCount: groups.length,
|
|
772
|
+
groups: groups.map((group) => ({
|
|
773
|
+
hasLabel: !!group.label,
|
|
774
|
+
labelTitle: group.label?.title,
|
|
775
|
+
itemsCount: group.items.length,
|
|
776
|
+
items: group.items.map((item) => item.title)
|
|
777
|
+
}))
|
|
778
|
+
});
|
|
779
|
+
const firstGroup = groups.length > 0 ? groups[0] : null;
|
|
780
|
+
console.log("[NavMain] Will render:", {
|
|
781
|
+
groupsLength: groups.length,
|
|
782
|
+
willRender: groups.length > 0,
|
|
783
|
+
firstGroupHasItems: firstGroup ? firstGroup.items.length > 0 : false,
|
|
784
|
+
firstGroupHasLabel: !!firstGroup?.label
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
if (groups.length === 0) {
|
|
788
|
+
if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
|
|
789
|
+
console.warn("[NavMain] No groups to render, returning null");
|
|
790
|
+
}
|
|
791
|
+
return null;
|
|
792
|
+
}
|
|
793
|
+
return /* @__PURE__ */ jsx(Fragment, { children: groups.map((group, groupIndex) => {
|
|
794
|
+
if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
|
|
795
|
+
console.log(`[NavMain] Rendering group ${groupIndex}:`, {
|
|
796
|
+
hasLabel: !!group.label,
|
|
797
|
+
itemsCount: group.items.length,
|
|
798
|
+
willRenderLabel: !!group.label,
|
|
799
|
+
willRenderItems: group.items.length > 0
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
return /* @__PURE__ */ jsxs(SidebarGroup, { children: [
|
|
803
|
+
group.label && /* @__PURE__ */ jsxs(SidebarGroupLabel, { children: [
|
|
804
|
+
group.label.icon && /* @__PURE__ */ jsx(group.label.icon, { className: "mr-2" }),
|
|
805
|
+
group.label.title
|
|
806
|
+
] }),
|
|
807
|
+
group.items.length > 0 && /* @__PURE__ */ jsx(SidebarMenu, { children: group.items.map((item) => {
|
|
808
|
+
const isActive = pathname === item.url || item.isActive;
|
|
809
|
+
const hasSubItems = item.items && item.items.length > 0;
|
|
810
|
+
if (hasSubItems) {
|
|
811
|
+
return /* @__PURE__ */ jsx(
|
|
812
|
+
Collapsible,
|
|
813
|
+
{
|
|
814
|
+
asChild: true,
|
|
815
|
+
defaultOpen: isActive,
|
|
816
|
+
className: "group/collapsible",
|
|
817
|
+
children: /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [
|
|
818
|
+
/* @__PURE__ */ jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
819
|
+
SidebarMenuButton,
|
|
820
|
+
{
|
|
821
|
+
tooltip: item.title,
|
|
822
|
+
isActive,
|
|
823
|
+
children: [
|
|
824
|
+
item.icon && /* @__PURE__ */ jsx(item.icon, {}),
|
|
825
|
+
/* @__PURE__ */ jsx("span", { children: item.title }),
|
|
826
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
827
|
+
]
|
|
828
|
+
}
|
|
829
|
+
) }),
|
|
830
|
+
/* @__PURE__ */ jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.items?.map((subItem) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: subItem.url, children: /* @__PURE__ */ jsx("span", { children: subItem.title }) }) }) }, subItem.title)) }) })
|
|
831
|
+
] })
|
|
832
|
+
},
|
|
833
|
+
item.title
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(
|
|
837
|
+
SidebarMenuButton,
|
|
769
838
|
{
|
|
770
839
|
asChild: true,
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
children: /* @__PURE__ */ jsxs(
|
|
774
|
-
/* @__PURE__ */ jsx(
|
|
775
|
-
|
|
776
|
-
{
|
|
777
|
-
tooltip: item.title,
|
|
778
|
-
isActive,
|
|
779
|
-
children: [
|
|
780
|
-
item.icon && /* @__PURE__ */ jsx(item.icon, {}),
|
|
781
|
-
/* @__PURE__ */ jsx("span", { children: item.title }),
|
|
782
|
-
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
783
|
-
]
|
|
784
|
-
}
|
|
785
|
-
) }),
|
|
786
|
-
/* @__PURE__ */ jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.items?.map((subItem) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: subItem.url, children: /* @__PURE__ */ jsx("span", { children: subItem.title }) }) }) }, subItem.title)) }) })
|
|
840
|
+
tooltip: item.title,
|
|
841
|
+
isActive,
|
|
842
|
+
children: /* @__PURE__ */ jsxs(Link, { href: item.url, children: [
|
|
843
|
+
item.icon && /* @__PURE__ */ jsx(item.icon, {}),
|
|
844
|
+
/* @__PURE__ */ jsx("span", { children: item.title })
|
|
787
845
|
] })
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
SidebarMenuButton,
|
|
794
|
-
{
|
|
795
|
-
asChild: true,
|
|
796
|
-
tooltip: item.title,
|
|
797
|
-
isActive,
|
|
798
|
-
children: /* @__PURE__ */ jsxs(Link, { href: item.url, children: [
|
|
799
|
-
item.icon && /* @__PURE__ */ jsx(item.icon, {}),
|
|
800
|
-
/* @__PURE__ */ jsx("span", { children: item.title })
|
|
801
|
-
] })
|
|
802
|
-
}
|
|
803
|
-
) }, item.title);
|
|
804
|
-
}) })
|
|
805
|
-
] }, groupIndex)) });
|
|
846
|
+
}
|
|
847
|
+
) }, item.title);
|
|
848
|
+
}) })
|
|
849
|
+
] }, groupIndex);
|
|
850
|
+
}) });
|
|
806
851
|
}
|
|
807
852
|
function Avatar({
|
|
808
853
|
className,
|