@lastbrain/app 2.0.24 → 2.0.35
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/analytics/registry.d.ts +7 -0
- package/dist/analytics/registry.d.ts.map +1 -0
- package/dist/analytics/registry.js +11 -0
- package/dist/auth/useAuthSession.d.ts.map +1 -1
- package/dist/auth/useAuthSession.js +85 -1
- package/dist/cli.js +19 -3
- package/dist/components/LanguageSwitcher.d.ts +3 -1
- package/dist/components/LanguageSwitcher.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher.js +134 -21
- package/dist/config/version.d.ts.map +1 -1
- package/dist/config/version.js +30 -19
- package/dist/i18n/server-lang.d.ts +1 -1
- package/dist/i18n/server-lang.d.ts.map +1 -1
- package/dist/i18n/types.d.ts +1 -1
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/i18n/useLink.d.ts.map +1 -1
- package/dist/i18n/useLink.js +15 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/layouts/AdminLayoutWithSidebar.d.ts +3 -1
- package/dist/layouts/AdminLayoutWithSidebar.d.ts.map +1 -1
- package/dist/layouts/AdminLayoutWithSidebar.js +2 -2
- package/dist/layouts/AppProviders.d.ts +9 -1
- package/dist/layouts/AppProviders.d.ts.map +1 -1
- package/dist/layouts/AppProviders.js +24 -3
- package/dist/layouts/AuthLayout.js +1 -1
- package/dist/layouts/PublicLayout.js +1 -1
- package/dist/layouts/RootLayout.d.ts.map +1 -1
- package/dist/scripts/init-app.d.ts.map +1 -1
- package/dist/scripts/init-app.js +343 -138
- package/dist/scripts/module-build.d.ts.map +1 -1
- package/dist/scripts/module-build.js +784 -59
- package/dist/scripts/module-create.d.ts.map +1 -1
- package/dist/scripts/module-create.js +227 -10
- package/dist/scripts/sitemap-flat-generator.d.ts +39 -0
- package/dist/scripts/sitemap-flat-generator.d.ts.map +1 -0
- package/dist/scripts/sitemap-flat-generator.js +231 -0
- package/dist/scripts/sitemap-manifest-generator.d.ts +59 -0
- package/dist/scripts/sitemap-manifest-generator.d.ts.map +1 -0
- package/dist/scripts/sitemap-manifest-generator.js +290 -0
- package/dist/sitemap/manifest.d.ts +8 -0
- package/dist/sitemap/manifest.d.ts.map +1 -0
- package/dist/sitemap/manifest.js +6 -0
- package/dist/styles.css +2 -2
- package/dist/templates/AuthGuidePage.js +2 -0
- package/dist/templates/DefaultDoc.d.ts.map +1 -1
- package/dist/templates/DefaultDoc.js +9 -5
- package/dist/templates/DocPage.d.ts.map +1 -1
- package/dist/templates/DocPage.js +40 -0
- package/dist/templates/MigrationsGuidePage.js +2 -0
- package/dist/templates/ModuleGuidePage.d.ts.map +1 -1
- package/dist/templates/ModuleGuidePage.js +4 -1
- package/dist/templates/SimpleHomePage.js +2 -0
- package/package.json +31 -26
- package/src/analytics/registry.ts +14 -0
- package/src/auth/useAuthSession.ts +91 -1
- package/src/cli.ts +19 -3
- package/src/components/LanguageSwitcher.tsx +183 -60
- package/src/config/version.ts +30 -19
- package/src/i18n/server-lang.ts +2 -1
- package/src/i18n/types.ts +2 -1
- package/src/i18n/useLink.ts +15 -0
- package/src/index.ts +17 -0
- package/src/layouts/AdminLayoutWithSidebar.tsx +4 -0
- package/src/layouts/AppProviders.tsx +74 -9
- package/src/layouts/AuthLayout.tsx +1 -1
- package/src/layouts/PublicLayout.tsx +1 -1
- package/src/layouts/RootLayout.tsx +0 -1
- package/src/scripts/init-app.ts +418 -149
- package/src/scripts/module-build.ts +923 -63
- package/src/scripts/module-create.ts +260 -10
- package/src/scripts/sitemap-flat-generator.ts +313 -0
- package/src/scripts/sitemap-manifest-generator.ts +476 -0
- package/src/sitemap/manifest.ts +17 -0
- package/src/templates/AuthGuidePage.tsx +1 -1
- package/src/templates/DefaultDoc.tsx +397 -6
- package/src/templates/DocPage.tsx +40 -0
- package/src/templates/MigrationsGuidePage.tsx +1 -1
- package/src/templates/ModuleGuidePage.tsx +3 -2
- package/src/templates/SimpleHomePage.tsx +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext, useMemo } from "react";
|
|
4
4
|
import { getModuleConfigs } from "../modules/module-loader";
|
|
5
5
|
import { ToastProvider, AppLinkProvider } from "@lastbrain/ui";
|
|
@@ -7,6 +7,20 @@ import { RealtimeProvider } from "@lastbrain/core";
|
|
|
7
7
|
import { useAuthSession } from "../auth/useAuthSession";
|
|
8
8
|
import { useNotifications as useNotificationsHook } from "../hooks/useNotifications";
|
|
9
9
|
import { LanguageProvider } from "../i18n/LanguageProvider";
|
|
10
|
+
// Wrapper for optional EntitlementsProvider passed via props
|
|
11
|
+
function OptionalEntitlementsWrapper({ children, EntitlementsProviderComponent, }) {
|
|
12
|
+
if (EntitlementsProviderComponent) {
|
|
13
|
+
return (_jsx(EntitlementsProviderComponent, { children: children }));
|
|
14
|
+
}
|
|
15
|
+
return _jsx(_Fragment, { children: children });
|
|
16
|
+
}
|
|
17
|
+
// Wrapper for optional AnalyticsListener
|
|
18
|
+
function OptionalAnalyticsListener({ AnalyticsListenerComponent, }) {
|
|
19
|
+
if (AnalyticsListenerComponent) {
|
|
20
|
+
return _jsx(AnalyticsListenerComponent, {});
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
10
24
|
const ModuleContext = createContext(getModuleConfigs());
|
|
11
25
|
const NotificationContext = createContext({
|
|
12
26
|
data: { notifications: [], unreadCount: 0 },
|
|
@@ -35,7 +49,7 @@ export function useNotifications() {
|
|
|
35
49
|
export function useAuth() {
|
|
36
50
|
return useContext(AuthContext);
|
|
37
51
|
}
|
|
38
|
-
export function AppProviders({ children, realtimeConfig = [], lang = "fr", translations = {}, }) {
|
|
52
|
+
export function AppProviders({ children, realtimeConfig = [], lang = "fr", translations = {}, availableLanguages = ["fr", "en"], EntitlementsProviderComponent, AnalyticsListenerComponent, }) {
|
|
39
53
|
const modules = useMemo(() => getModuleConfigs(), []);
|
|
40
54
|
const { user, loading: authLoading, isSuperAdmin } = useAuthSession();
|
|
41
55
|
// Hook de notifications seulement quand l'auth est prête
|
|
@@ -54,5 +68,12 @@ export function AppProviders({ children, realtimeConfig = [], lang = "fr", trans
|
|
|
54
68
|
// Ne retourner un objet vide que si vraiment rien n'est disponible
|
|
55
69
|
return {};
|
|
56
70
|
}, [translations]);
|
|
57
|
-
return (_jsx(LanguageProvider, { initialLang: lang, translations: memoizedTranslations, children: _jsx(AppLinkProvider, { lang: lang || "fr", children: _jsx(AuthContext.Provider, { value: authValue, children: _jsx(ModuleContext.Provider, { value: modules, children: _jsx(NotificationContext.Provider, { value: notificationsData, children: _jsxs(RealtimeProvider, { userId: user?.id, config: realtimeConfig, children: [
|
|
71
|
+
return (_jsx(LanguageProvider, { initialLang: lang, translations: memoizedTranslations, availableLanguages: availableLanguages, children: _jsx(AppLinkProvider, { lang: lang || "fr", children: _jsx(AuthContext.Provider, { value: authValue, children: _jsx(OptionalEntitlementsWrapper, { EntitlementsProviderComponent: EntitlementsProviderComponent, children: _jsx(ModuleContext.Provider, { value: modules, children: _jsx(NotificationContext.Provider, { value: notificationsData, children: _jsxs(RealtimeProvider, { userId: user?.id, config: realtimeConfig, children: [_jsx(OptionalAnalyticsListener, { AnalyticsListenerComponent: AnalyticsListenerComponent }), children, _jsx(ToastProvider, { toastProps: {
|
|
72
|
+
variant: "flat",
|
|
73
|
+
timeout: 5000,
|
|
74
|
+
shouldShowTimeoutProgress: true,
|
|
75
|
+
classNames: {
|
|
76
|
+
closeButton: "opacity-100 absolute right-4 top-1/2 -translate-y-1/2",
|
|
77
|
+
},
|
|
78
|
+
}, placement: "bottom-right", toastOffset: 5 })] }) }) }) }) }) }) }));
|
|
58
79
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export function AuthLayout({ children }) {
|
|
3
|
-
return _jsx("div", { className: "pt-
|
|
3
|
+
return _jsx("div", { className: "pt-16 px-2 md:px-5 max-w-screen", children: children });
|
|
4
4
|
}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Footer } from "@lastbrain/ui";
|
|
4
4
|
export function PublicLayout({ children, footerConfig }) {
|
|
5
|
-
return (_jsxs(_Fragment, { children: [_jsx("section", { className: "
|
|
5
|
+
return (_jsxs(_Fragment, { children: [_jsx("section", { className: " min-h-[calc(100vh)] max-w-screen", children: children }), footerConfig && _jsx(Footer, { config: footerConfig })] }));
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RootLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/RootLayout.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"RootLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/RootLayout.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,cAAmB,EACnB,IAAW,EACX,YAAiB,GAClB,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,2CAqBA"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,iBA8TpD"}
|