@lastbrain/app 0.1.46 → 1.0.1
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/app-shell/layout.d.ts +1 -1
- package/dist/app-shell/layout.d.ts.map +1 -1
- package/dist/app-shell/layout.js +1 -1
- package/dist/components/NotificationContainer.js +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -19
- package/dist/layouts/AdminLayoutWithSidebar.d.ts +3 -2
- package/dist/layouts/AdminLayoutWithSidebar.d.ts.map +1 -1
- package/dist/layouts/AdminLayoutWithSidebar.js +5 -5
- package/dist/layouts/AppProviders.d.ts +1 -1
- package/dist/layouts/AppProviders.d.ts.map +1 -1
- package/dist/layouts/AppProviders.js +3 -3
- package/dist/layouts/AuthLayoutWithSidebar.d.ts +7 -4
- package/dist/layouts/AuthLayoutWithSidebar.d.ts.map +1 -1
- package/dist/layouts/AuthLayoutWithSidebar.js +5 -5
- package/dist/layouts/PublicLayoutWithSidebar.js +2 -2
- package/dist/layouts/RootLayout.js +1 -1
- package/dist/scripts/init-app.d.ts.map +1 -1
- package/dist/scripts/init-app.js +488 -50
- package/dist/scripts/module-add.js +1 -1
- package/dist/scripts/module-build.d.ts.map +1 -1
- package/dist/scripts/module-build.js +36 -15
- package/dist/scripts/module-create.js +8 -8
- package/dist/scripts/module-delete.d.ts.map +1 -1
- package/dist/scripts/module-delete.js +1 -1
- package/dist/templates/DefaultDoc.js +2 -2
- package/dist/templates/DocPage.js +1 -1
- package/dist/templates/DocsPageWithModules.js +1 -1
- package/dist/types/menu.d.ts +23 -0
- package/dist/types/menu.d.ts.map +1 -0
- package/dist/types/menu.js +1 -0
- package/package.json +11 -3
- package/src/app-shell/layout.tsx +1 -1
- package/src/components/NotificationContainer.tsx +1 -1
- package/src/index.ts +24 -19
- package/src/layouts/AdminLayoutWithSidebar.tsx +11 -3
- package/src/layouts/AppProviders.tsx +4 -4
- package/src/layouts/AuthLayoutWithSidebar.tsx +18 -4
- package/src/layouts/PublicLayoutWithSidebar.tsx +2 -2
- package/src/layouts/RootLayout.tsx +1 -1
- package/src/scripts/init-app.ts +514 -60
- package/src/scripts/module-add.ts +1 -1
- package/src/scripts/module-build.ts +46 -22
- package/src/scripts/module-create.ts +8 -8
- package/src/scripts/module-delete.ts +1 -4
- package/src/templates/DefaultDoc.tsx +2 -2
- package/src/templates/DocPage.tsx +1 -1
- package/src/templates/DocsPageWithModules.tsx +1 -1
- package/src/types/menu.ts +18 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/app-shell/layout.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/app-shell/layout.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,eAAe,UAAU,CAAC"}
|
package/dist/app-shell/layout.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Notification } from "@lastbrain/ui";
|
|
4
|
-
import { useNotifications } from "../layouts/AppProviders
|
|
4
|
+
import { useNotifications } from "../layouts/AppProviders";
|
|
5
5
|
export function NotificationContainer() {
|
|
6
6
|
const { data, loading, markAsRead, markAllAsRead, deleteNotification } = useNotifications();
|
|
7
7
|
return (_jsx(Notification, { notifications: data.notifications, unreadCount: data.unreadCount, loading: loading, onMarkAsRead: markAsRead, onMarkAllAsRead: markAllAsRead, onDelete: deleteNotification }));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export { AppProviders, useAuth, useModules, useNotifications as useNotificationsContext, } from "./layouts/AppProviders
|
|
2
|
-
export { useNotifications } from "./hooks/useNotifications
|
|
3
|
-
export { NotificationContainer } from "./components/NotificationContainer
|
|
4
|
-
export { useAuthSession } from "./auth/useAuthSession
|
|
5
|
-
export { signOut, signIn } from "./auth/authHelpers
|
|
6
|
-
export { RootLayout } from "./layouts/RootLayout
|
|
7
|
-
export { PublicLayout } from "./layouts/PublicLayout
|
|
8
|
-
export { PublicLayoutWithSidebar } from "./layouts/PublicLayoutWithSidebar
|
|
9
|
-
export { AuthLayout } from "./layouts/AuthLayout
|
|
10
|
-
export { AuthLayoutWithSidebar } from "./layouts/AuthLayoutWithSidebar
|
|
11
|
-
export { AdminLayout } from "./layouts/AdminLayout
|
|
12
|
-
export { AdminLayoutWithSidebar } from "./layouts/AdminLayoutWithSidebar
|
|
13
|
-
export { getModuleConfigs } from "./modules/module-loader
|
|
1
|
+
export { AppProviders, useAuth, useModules, useNotifications as useNotificationsContext, } from "./layouts/AppProviders";
|
|
2
|
+
export { useNotifications } from "./hooks/useNotifications";
|
|
3
|
+
export { NotificationContainer } from "./components/NotificationContainer";
|
|
4
|
+
export { useAuthSession } from "./auth/useAuthSession";
|
|
5
|
+
export { signOut, signIn } from "./auth/authHelpers";
|
|
6
|
+
export { RootLayout } from "./layouts/RootLayout";
|
|
7
|
+
export { PublicLayout } from "./layouts/PublicLayout";
|
|
8
|
+
export { PublicLayoutWithSidebar } from "./layouts/PublicLayoutWithSidebar";
|
|
9
|
+
export { AuthLayout } from "./layouts/AuthLayout";
|
|
10
|
+
export { AuthLayoutWithSidebar, type AuthLayoutWithSidebarProps, type MenuIgnored, type MenuCustom, } from "./layouts/AuthLayoutWithSidebar";
|
|
11
|
+
export { AdminLayout } from "./layouts/AdminLayout";
|
|
12
|
+
export { AdminLayoutWithSidebar } from "./layouts/AdminLayoutWithSidebar";
|
|
13
|
+
export { getModuleConfigs } from "./modules/module-loader";
|
|
14
14
|
export { AppAside } from "@lastbrain/ui";
|
|
15
15
|
export type { AppAsideMenuItem, AppAsideMenuConfig } from "@lastbrain/ui";
|
|
16
|
-
export { SimpleHomePage } from "./templates/SimpleHomePage
|
|
17
|
-
export { DocPage } from "./templates/DocPage
|
|
18
|
-
export { SimpleDocPage } from "./templates/SimpleDocPage
|
|
19
|
-
export { ModuleGuidePage } from "./templates/ModuleGuidePage
|
|
20
|
-
export { AuthGuidePage } from "./templates/AuthGuidePage
|
|
21
|
-
export { MigrationsGuidePage } from "./templates/MigrationsGuidePage
|
|
16
|
+
export { SimpleHomePage } from "./templates/SimpleHomePage";
|
|
17
|
+
export { DocPage } from "./templates/DocPage";
|
|
18
|
+
export { SimpleDocPage } from "./templates/SimpleDocPage";
|
|
19
|
+
export { ModuleGuidePage } from "./templates/ModuleGuidePage";
|
|
20
|
+
export { AuthGuidePage } from "./templates/AuthGuidePage";
|
|
21
|
+
export { MigrationsGuidePage } from "./templates/MigrationsGuidePage";
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,OAAO,EACP,UAAU,EACV,gBAAgB,IAAI,uBAAuB,GAC5C,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,OAAO,EACP,UAAU,EACV,gBAAgB,IAAI,uBAAuB,GAC5C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAG1E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export { AppProviders, useAuth, useModules, useNotifications as useNotificationsContext, } from "./layouts/AppProviders
|
|
2
|
-
export { useNotifications } from "./hooks/useNotifications
|
|
3
|
-
export { NotificationContainer } from "./components/NotificationContainer
|
|
4
|
-
export { useAuthSession } from "./auth/useAuthSession
|
|
5
|
-
export { signOut, signIn } from "./auth/authHelpers
|
|
6
|
-
export { RootLayout } from "./layouts/RootLayout
|
|
7
|
-
export { PublicLayout } from "./layouts/PublicLayout
|
|
8
|
-
export { PublicLayoutWithSidebar } from "./layouts/PublicLayoutWithSidebar
|
|
9
|
-
export { AuthLayout } from "./layouts/AuthLayout
|
|
10
|
-
export { AuthLayoutWithSidebar } from "./layouts/AuthLayoutWithSidebar
|
|
11
|
-
export { AdminLayout } from "./layouts/AdminLayout
|
|
12
|
-
export { AdminLayoutWithSidebar } from "./layouts/AdminLayoutWithSidebar
|
|
13
|
-
export { getModuleConfigs } from "./modules/module-loader
|
|
1
|
+
export { AppProviders, useAuth, useModules, useNotifications as useNotificationsContext, } from "./layouts/AppProviders";
|
|
2
|
+
export { useNotifications } from "./hooks/useNotifications";
|
|
3
|
+
export { NotificationContainer } from "./components/NotificationContainer";
|
|
4
|
+
export { useAuthSession } from "./auth/useAuthSession";
|
|
5
|
+
export { signOut, signIn } from "./auth/authHelpers";
|
|
6
|
+
export { RootLayout } from "./layouts/RootLayout";
|
|
7
|
+
export { PublicLayout } from "./layouts/PublicLayout";
|
|
8
|
+
export { PublicLayoutWithSidebar } from "./layouts/PublicLayoutWithSidebar";
|
|
9
|
+
export { AuthLayout } from "./layouts/AuthLayout";
|
|
10
|
+
export { AuthLayoutWithSidebar, } from "./layouts/AuthLayoutWithSidebar";
|
|
11
|
+
export { AdminLayout } from "./layouts/AdminLayout";
|
|
12
|
+
export { AdminLayoutWithSidebar } from "./layouts/AdminLayoutWithSidebar";
|
|
13
|
+
export { getModuleConfigs } from "./modules/module-loader";
|
|
14
14
|
// Components
|
|
15
15
|
export { AppAside } from "@lastbrain/ui";
|
|
16
16
|
// Templates de pages (starter + docs)
|
|
17
|
-
export { SimpleHomePage } from "./templates/SimpleHomePage
|
|
18
|
-
export { DocPage } from "./templates/DocPage
|
|
19
|
-
export { SimpleDocPage } from "./templates/SimpleDocPage
|
|
20
|
-
export { ModuleGuidePage } from "./templates/ModuleGuidePage
|
|
21
|
-
export { AuthGuidePage } from "./templates/AuthGuidePage
|
|
22
|
-
export { MigrationsGuidePage } from "./templates/MigrationsGuidePage
|
|
17
|
+
export { SimpleHomePage } from "./templates/SimpleHomePage";
|
|
18
|
+
export { DocPage } from "./templates/DocPage";
|
|
19
|
+
export { SimpleDocPage } from "./templates/SimpleDocPage";
|
|
20
|
+
export { ModuleGuidePage } from "./templates/ModuleGuidePage";
|
|
21
|
+
export { AuthGuidePage } from "./templates/AuthGuidePage";
|
|
22
|
+
export { MigrationsGuidePage } from "./templates/MigrationsGuidePage";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type MenuConfig } from "@lastbrain/ui";
|
|
1
|
+
import { type MenuConfig, type MenuItem } from "@lastbrain/ui";
|
|
2
2
|
interface AdminLayoutWithSidebarProps {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
menuConfig?: MenuConfig;
|
|
5
5
|
className?: string;
|
|
6
|
+
menuCustom?: MenuItem[];
|
|
6
7
|
}
|
|
7
|
-
export declare function AdminLayoutWithSidebar({ children, menuConfig, className, }: AdminLayoutWithSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function AdminLayoutWithSidebar({ children, menuConfig, className, menuCustom, }: AdminLayoutWithSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=AdminLayoutWithSidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminLayoutWithSidebar.d.ts","sourceRoot":"","sources":["../../src/layouts/AdminLayoutWithSidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"AdminLayoutWithSidebar.d.ts","sourceRoot":"","sources":["../../src/layouts/AdminLayoutWithSidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,QAAQ,EACd,MAAM,eAAe,CAAC;AAKvB,UAAU,2BAA2B;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;CACzB;AAED,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,UAAU,EACV,SAAc,EACd,UAAU,GACX,EAAE,2BAA2B,2CAkG7B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { AdminLayout } from "./AdminLayout
|
|
4
|
-
import { AppAside, AppAsideSkeleton } from "@lastbrain/ui";
|
|
5
|
-
import { useAuthSession } from "../auth/useAuthSession
|
|
3
|
+
import { AdminLayout } from "./AdminLayout";
|
|
4
|
+
import { AppAside, AppAsideSkeleton, } from "@lastbrain/ui";
|
|
5
|
+
import { useAuthSession } from "../auth/useAuthSession";
|
|
6
6
|
import { usePathname } from "next/navigation";
|
|
7
7
|
import { useEffect, useState } from "react";
|
|
8
|
-
export function AdminLayoutWithSidebar({ children, menuConfig, className = "", }) {
|
|
8
|
+
export function AdminLayoutWithSidebar({ children, menuConfig, className = "", menuCustom, }) {
|
|
9
9
|
const { isSuperAdmin, loading, user } = useAuthSession();
|
|
10
10
|
const pathname = usePathname();
|
|
11
11
|
const [isCollapsed, setIsCollapsed] = useState(() => {
|
|
@@ -58,5 +58,5 @@ export function AdminLayoutWithSidebar({ children, menuConfig, className = "", }
|
|
|
58
58
|
safeMenuConfig.public.length > 0);
|
|
59
59
|
// Afficher le skeleton pendant le chargement de la session ou si pas de menuConfig valide
|
|
60
60
|
const shouldShowSkeleton = loading || !hasValidMenuConfig;
|
|
61
|
-
return (_jsxs("div", { className: "flex min-h-screen", children: [shouldShowSkeleton ? (_jsx(AppAsideSkeleton, { className: className, isAdminSection: isAdminSection })) : (_jsx(AppAside, { menuConfig: safeMenuConfig, isSuperAdmin: isSuperAdmin, isAuthenticated: !!user, className: className })), _jsx("div", { className: `flex-1 transition-all duration-300 ${!mounted ? "lg:ml-72" : isCollapsed ? "lg:ml-20" : "lg:ml-72"}`, children: _jsx(AdminLayout, { children: children }) })] }));
|
|
61
|
+
return (_jsxs("div", { className: "flex min-h-screen", children: [shouldShowSkeleton ? (_jsx(AppAsideSkeleton, { className: className, isAdminSection: isAdminSection })) : (_jsx(AppAside, { menuConfig: safeMenuConfig, isSuperAdmin: isSuperAdmin, isAuthenticated: !!user, className: className, ...(menuCustom ? { menuCustom } : {}) })), _jsx("div", { className: `flex-1 transition-all duration-300 ${!mounted ? "lg:ml-72" : isCollapsed ? "lg:ml-20" : "lg:ml-72"}`, children: _jsx(AdminLayout, { children: children }) })] }));
|
|
62
62
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { User } from "@supabase/supabase-js";
|
|
2
2
|
import type { ModuleRealtimeConfig } from "@lastbrain/core";
|
|
3
|
-
import type { NotificationsData } from "../hooks/useNotifications
|
|
3
|
+
import type { NotificationsData } from "../hooks/useNotifications";
|
|
4
4
|
export declare function useModules(): import("@lastbrain/core").ModuleBuildConfig[];
|
|
5
5
|
export declare function useNotifications(): {
|
|
6
6
|
data: NotificationsData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppProviders.d.ts","sourceRoot":"","sources":["../../src/layouts/AppProviders.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AppProviders.d.ts","sourceRoot":"","sources":["../../src/layouts/AppProviders.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAuCnE,wBAAgB,UAAU,kDAEzB;AAED,wBAAgB,gBAAgB;UAvCxB,iBAAiB;aACd,OAAO;WACT,MAAM,GAAG,IAAI;aACX,MAAM,OAAO,CAAC,IAAI,CAAC;gBAChB,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;mBAC1B,MAAM,OAAO,CAAC,IAAI,CAAC;wBACd,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;aACxC,OAAO;eACL,OAAO;oBACF,OAAO;yBACF,OAAO;EA+B7B;AAED,wBAAgB,OAAO;UAjBf,IAAI,GAAG,IAAI;aACR,OAAO;kBACF,OAAO;EAiBtB;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,cAAmB,GACpB,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACzC,2CA4BA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext, useMemo } from "react";
|
|
4
|
-
import { getModuleConfigs } from "../modules/module-loader
|
|
4
|
+
import { getModuleConfigs } from "../modules/module-loader";
|
|
5
5
|
import { ToastProvider } from "@lastbrain/ui";
|
|
6
6
|
import { RealtimeProvider } from "@lastbrain/core";
|
|
7
|
-
import { useAuthSession } from "../auth/useAuthSession
|
|
8
|
-
import { useNotifications as useNotificationsHook } from "../hooks/useNotifications
|
|
7
|
+
import { useAuthSession } from "../auth/useAuthSession";
|
|
8
|
+
import { useNotifications as useNotificationsHook } from "../hooks/useNotifications";
|
|
9
9
|
const ModuleContext = createContext(getModuleConfigs());
|
|
10
10
|
const NotificationContext = createContext({
|
|
11
11
|
data: { notifications: [], unreadCount: 0 },
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { type MenuConfig } from "@lastbrain/ui";
|
|
2
|
-
|
|
1
|
+
import { type MenuConfig, type MenuItem } from "@lastbrain/ui";
|
|
2
|
+
import type { MenuIgnored, MenuCustom } from "../types/menu";
|
|
3
|
+
export type { MenuIgnored, MenuCustom };
|
|
4
|
+
export interface AuthLayoutWithSidebarProps {
|
|
3
5
|
children: React.ReactNode;
|
|
4
6
|
menuConfig?: MenuConfig;
|
|
5
7
|
className?: string;
|
|
8
|
+
menuIgnored?: MenuIgnored;
|
|
9
|
+
menuCustom?: MenuItem[];
|
|
6
10
|
}
|
|
7
|
-
export declare function AuthLayoutWithSidebar({ children, menuConfig, className, }: AuthLayoutWithSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
11
|
+
export declare function AuthLayoutWithSidebar({ children, menuConfig, className, menuIgnored, menuCustom, }: AuthLayoutWithSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
9
12
|
//# sourceMappingURL=AuthLayoutWithSidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthLayoutWithSidebar.d.ts","sourceRoot":"","sources":["../../src/layouts/AuthLayoutWithSidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"AuthLayoutWithSidebar.d.ts","sourceRoot":"","sources":["../../src/layouts/AuthLayoutWithSidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,QAAQ,EACd,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG7D,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;AAExC,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;CACzB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,UAAU,EACV,SAAc,EACd,WAAW,EACX,UAAU,GACX,EAAE,0BAA0B,2CAiG5B"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { AuthLayout } from "./AuthLayout
|
|
4
|
-
import { AppAside, AppAsideSkeleton } from "@lastbrain/ui";
|
|
5
|
-
import { useAuthSession } from "../auth/useAuthSession
|
|
3
|
+
import { AuthLayout } from "./AuthLayout";
|
|
4
|
+
import { AppAside, AppAsideSkeleton, } from "@lastbrain/ui";
|
|
5
|
+
import { useAuthSession } from "../auth/useAuthSession";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
|
-
export function AuthLayoutWithSidebar({ children, menuConfig, className = "", }) {
|
|
7
|
+
export function AuthLayoutWithSidebar({ children, menuConfig, className = "", menuIgnored, menuCustom, }) {
|
|
8
8
|
const { isSuperAdmin, loading, user } = useAuthSession();
|
|
9
9
|
const [isCollapsed, setIsCollapsed] = useState(() => {
|
|
10
10
|
if (typeof window !== "undefined") {
|
|
@@ -56,5 +56,5 @@ export function AuthLayoutWithSidebar({ children, menuConfig, className = "", })
|
|
|
56
56
|
safeMenuConfig.public.length > 0);
|
|
57
57
|
// Afficher le skeleton pendant le chargement de la session ou si pas de menuConfig valide
|
|
58
58
|
const shouldShowSkeleton = loading || !hasValidMenuConfig;
|
|
59
|
-
return (_jsxs("div", { className: "flex min-h-screen", children: [shouldShowSkeleton ? (_jsx(AppAsideSkeleton, { className: className, isAdminSection: isAdminSection })) : (_jsx(AppAside, { menuConfig: safeMenuConfig, isSuperAdmin: isSuperAdmin, isAuthenticated: !!user, className: className })), _jsx("div", { className: `flex-1 transition-all duration-300 ${!mounted ? "lg:ml-72" : isCollapsed ? "lg:ml-20" : "lg:ml-72"}`, children: _jsx(AuthLayout, { children: children }) })] }));
|
|
59
|
+
return (_jsxs("div", { className: "flex min-h-screen", children: [shouldShowSkeleton ? (_jsx(AppAsideSkeleton, { className: className, isAdminSection: isAdminSection })) : (_jsx(AppAside, { menuConfig: safeMenuConfig, isSuperAdmin: isSuperAdmin, isAuthenticated: !!user, className: className, ...(menuIgnored ? { menuIgnored } : {}), ...(menuCustom ? { menuCustom } : {}) })), _jsx("div", { className: `flex-1 transition-all duration-300 ${!mounted ? "lg:ml-72" : isCollapsed ? "lg:ml-20" : "lg:ml-72"}`, children: _jsx(AuthLayout, { children: children }) })] }));
|
|
60
60
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { PublicLayout } from "./PublicLayout
|
|
3
|
+
import { PublicLayout } from "./PublicLayout";
|
|
4
4
|
import { AppAside, AppAsideSkeleton } from "@lastbrain/ui";
|
|
5
|
-
import { useAuthSession } from "../auth/useAuthSession
|
|
5
|
+
import { useAuthSession } from "../auth/useAuthSession";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
7
|
export function PublicLayoutWithSidebar({ children, menuConfig, className = "", }) {
|
|
8
8
|
const { user, loading } = useAuthSession();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { ThemeProvider } from "next-themes";
|
|
4
|
-
import { AppProviders } from "./AppProviders
|
|
4
|
+
import { AppProviders } from "./AppProviders";
|
|
5
5
|
// Note: L'app Next.js doit importer son propre globals.css dans son layout
|
|
6
6
|
// Note: La configuration realtime doit être fournie par l'app qui utilise ce layout
|
|
7
7
|
export function RootLayout({ children, realtimeConfig = [], }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-app.d.ts","sourceRoot":"","sources":["../../src/scripts/init-app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init-app.d.ts","sourceRoot":"","sources":["../../src/scripts/init-app.ts"],"names":[],"mappings":"AAWA,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,iBAkSpD"}
|