@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.
Files changed (81) hide show
  1. package/dist/analytics/registry.d.ts +7 -0
  2. package/dist/analytics/registry.d.ts.map +1 -0
  3. package/dist/analytics/registry.js +11 -0
  4. package/dist/auth/useAuthSession.d.ts.map +1 -1
  5. package/dist/auth/useAuthSession.js +85 -1
  6. package/dist/cli.js +19 -3
  7. package/dist/components/LanguageSwitcher.d.ts +3 -1
  8. package/dist/components/LanguageSwitcher.d.ts.map +1 -1
  9. package/dist/components/LanguageSwitcher.js +134 -21
  10. package/dist/config/version.d.ts.map +1 -1
  11. package/dist/config/version.js +30 -19
  12. package/dist/i18n/server-lang.d.ts +1 -1
  13. package/dist/i18n/server-lang.d.ts.map +1 -1
  14. package/dist/i18n/types.d.ts +1 -1
  15. package/dist/i18n/types.d.ts.map +1 -1
  16. package/dist/i18n/useLink.d.ts.map +1 -1
  17. package/dist/i18n/useLink.js +15 -0
  18. package/dist/index.d.ts +3 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +4 -0
  21. package/dist/layouts/AdminLayoutWithSidebar.d.ts +3 -1
  22. package/dist/layouts/AdminLayoutWithSidebar.d.ts.map +1 -1
  23. package/dist/layouts/AdminLayoutWithSidebar.js +2 -2
  24. package/dist/layouts/AppProviders.d.ts +9 -1
  25. package/dist/layouts/AppProviders.d.ts.map +1 -1
  26. package/dist/layouts/AppProviders.js +24 -3
  27. package/dist/layouts/AuthLayout.js +1 -1
  28. package/dist/layouts/PublicLayout.js +1 -1
  29. package/dist/layouts/RootLayout.d.ts.map +1 -1
  30. package/dist/scripts/init-app.d.ts.map +1 -1
  31. package/dist/scripts/init-app.js +343 -138
  32. package/dist/scripts/module-build.d.ts.map +1 -1
  33. package/dist/scripts/module-build.js +784 -59
  34. package/dist/scripts/module-create.d.ts.map +1 -1
  35. package/dist/scripts/module-create.js +227 -10
  36. package/dist/scripts/sitemap-flat-generator.d.ts +39 -0
  37. package/dist/scripts/sitemap-flat-generator.d.ts.map +1 -0
  38. package/dist/scripts/sitemap-flat-generator.js +231 -0
  39. package/dist/scripts/sitemap-manifest-generator.d.ts +59 -0
  40. package/dist/scripts/sitemap-manifest-generator.d.ts.map +1 -0
  41. package/dist/scripts/sitemap-manifest-generator.js +290 -0
  42. package/dist/sitemap/manifest.d.ts +8 -0
  43. package/dist/sitemap/manifest.d.ts.map +1 -0
  44. package/dist/sitemap/manifest.js +6 -0
  45. package/dist/styles.css +2 -2
  46. package/dist/templates/AuthGuidePage.js +2 -0
  47. package/dist/templates/DefaultDoc.d.ts.map +1 -1
  48. package/dist/templates/DefaultDoc.js +9 -5
  49. package/dist/templates/DocPage.d.ts.map +1 -1
  50. package/dist/templates/DocPage.js +40 -0
  51. package/dist/templates/MigrationsGuidePage.js +2 -0
  52. package/dist/templates/ModuleGuidePage.d.ts.map +1 -1
  53. package/dist/templates/ModuleGuidePage.js +4 -1
  54. package/dist/templates/SimpleHomePage.js +2 -0
  55. package/package.json +31 -26
  56. package/src/analytics/registry.ts +14 -0
  57. package/src/auth/useAuthSession.ts +91 -1
  58. package/src/cli.ts +19 -3
  59. package/src/components/LanguageSwitcher.tsx +183 -60
  60. package/src/config/version.ts +30 -19
  61. package/src/i18n/server-lang.ts +2 -1
  62. package/src/i18n/types.ts +2 -1
  63. package/src/i18n/useLink.ts +15 -0
  64. package/src/index.ts +17 -0
  65. package/src/layouts/AdminLayoutWithSidebar.tsx +4 -0
  66. package/src/layouts/AppProviders.tsx +74 -9
  67. package/src/layouts/AuthLayout.tsx +1 -1
  68. package/src/layouts/PublicLayout.tsx +1 -1
  69. package/src/layouts/RootLayout.tsx +0 -1
  70. package/src/scripts/init-app.ts +418 -149
  71. package/src/scripts/module-build.ts +923 -63
  72. package/src/scripts/module-create.ts +260 -10
  73. package/src/scripts/sitemap-flat-generator.ts +313 -0
  74. package/src/scripts/sitemap-manifest-generator.ts +476 -0
  75. package/src/sitemap/manifest.ts +17 -0
  76. package/src/templates/AuthGuidePage.tsx +1 -1
  77. package/src/templates/DefaultDoc.tsx +397 -6
  78. package/src/templates/DocPage.tsx +40 -0
  79. package/src/templates/MigrationsGuidePage.tsx +1 -1
  80. package/src/templates/ModuleGuidePage.tsx +3 -2
  81. 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: [children, _jsx(ToastProvider, { placement: "bottom-right", toastOffset: 5 })] }) }) }) }) }) }));
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-4 px-2 md:px-5 max-w-screen", children: children });
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: "pt-16 min-h-[calc(100vh)] max-w-screen", children: children }), footerConfig && _jsx(Footer, { config: footerConfig })] }));
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;AAIzD,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
+ {"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,iBAkSpD"}
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"}