@rebasepro/app 0.25.0 → 0.26.0

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 (38) hide show
  1. package/README.md +1 -1
  2. package/dist/RlsSimulatorPanel-DOfmVgM3.js +403 -0
  3. package/dist/RlsSimulatorPanel-DOfmVgM3.js.map +1 -0
  4. package/dist/collections/form-layout.d.ts +30 -27
  5. package/dist/components/LanguageToggle.d.ts +9 -0
  6. package/dist/components/LoginView/index.d.ts +7 -0
  7. package/dist/components/index.d.ts +1 -0
  8. package/dist/components/studio/RlsSimulatorBar.d.ts +39 -0
  9. package/dist/components/studio/RlsSimulatorPanel.d.ts +29 -0
  10. package/dist/contexts/RlsSimulationContext.d.ts +47 -0
  11. package/dist/contexts/index.d.ts +1 -0
  12. package/dist/core/effective_role_state.d.ts +9 -0
  13. package/dist/{de-BMgOgwue.js → de-3yzzpuZj.js} +175 -1
  14. package/dist/de-3yzzpuZj.js.map +1 -0
  15. package/dist/debug.js +96 -46
  16. package/dist/{es-DSOOSgPW.js → es-mnyTaRkK.js} +175 -1
  17. package/dist/es-mnyTaRkK.js.map +1 -0
  18. package/dist/{fr-CnXidmZf.js → fr-nJHADzlI.js} +175 -1
  19. package/dist/fr-nJHADzlI.js.map +1 -0
  20. package/dist/{hi-lTvNsFMr.js → hi-B9_iunnL.js} +175 -1
  21. package/dist/hi-B9_iunnL.js.map +1 -0
  22. package/dist/hooks/useBuildEffectiveRoleController.d.ts +9 -3
  23. package/dist/hooks/usePermissions.d.ts +4 -0
  24. package/dist/hooks/useUnsavedChangesDialog.d.ts +7 -1
  25. package/dist/i18n/RebaseI18nProvider.d.ts +11 -0
  26. package/dist/index.es.js +2814 -2555
  27. package/dist/index.es.js.map +1 -1
  28. package/dist/{it-BoT_vBlx.js → it-DoEtz-OK.js} +175 -1
  29. package/dist/it-DoEtz-OK.js.map +1 -0
  30. package/dist/{pt-D9mSchbY.js → pt-DT26AmBU.js} +175 -1
  31. package/dist/pt-DT26AmBU.js.map +1 -0
  32. package/package.json +7 -7
  33. package/dist/de-BMgOgwue.js.map +0 -1
  34. package/dist/es-DSOOSgPW.js.map +0 -1
  35. package/dist/fr-CnXidmZf.js.map +0 -1
  36. package/dist/hi-lTvNsFMr.js.map +0 -1
  37. package/dist/it-BoT_vBlx.js.map +0 -1
  38. package/dist/pt-D9mSchbY.js.map +0 -1
@@ -3,6 +3,10 @@ import type { AdminCollection } from "@rebasepro/cms-types";
3
3
  /**
4
4
  * Hook to evaluate roles and permissions for the current user.
5
5
  * It abstracts away the need to pass `authController` to permission evaluation functions.
6
+ *
7
+ * While access is simulated ("Simulate access") nothing can be created, edited
8
+ * or deleted: the server refuses every write that carries a simulation
9
+ * (`SIMULATION_READ_ONLY`), so the views offer none rather than failing on save.
6
10
  */
7
11
  export declare function usePermissions(): {
8
12
  canCreate: (collection: AdminCollection<any>, path: string) => boolean;
@@ -5,8 +5,14 @@ import { UnsavedChangesDialogProps } from "../components/UnsavedChangesDialog.js
5
5
  * It automatically handles:
6
6
  * 1. Internal React Router navigation using `useBlocker`.
7
7
  * 2. External browser navigation (page refresh, tab close) using `beforeunload`.
8
+ *
9
+ * `when` may be a function, read at the moment a navigation is attempted. Pass
10
+ * one when the flag can be cleared in the same tick as the navigation it
11
+ * should let through — a save that reports the form clean and then moves on.
12
+ * A boolean is only seen once its component re-renders, which is after a
13
+ * navigation raised in that tick has already been blocked.
8
14
  */
9
- export declare function useUnsavedChangesDialog(when: boolean, onOk: () => void): {
15
+ export declare function useUnsavedChangesDialog(when: boolean | (() => boolean), onOk: () => void): {
10
16
  dialogProps: UnsavedChangesDialogProps;
11
17
  triggerDialog: () => void;
12
18
  };
@@ -1,6 +1,17 @@
1
1
  import React, { PropsWithChildren } from "react";
2
2
  import { RebaseTranslations } from "@rebasepro/cms-types";
3
3
  export declare const REBASE_LOCALE_STORAGE_KEY = "rebase_locale";
4
+ /**
5
+ * Every language the admin can be shown in: English, the ones Rebase ships,
6
+ * and any the app adds through `translations` — a language Rebase does not
7
+ * ship is a full table from the app, falling back to English key by key.
8
+ */
9
+ export declare function availableRebaseLocales(translatedLocales?: readonly string[]): string[];
10
+ /**
11
+ * The languages the admin can be switched to — what the language menu lists.
12
+ * Outside a {@link RebaseI18nProvider}, the ones Rebase ships.
13
+ */
14
+ export declare function useRebaseLocales(): string[];
4
15
  /** DeepPartial helper — allows partial overrides at any nesting level */
5
16
  type DeepPartial<T> = T extends object ? {
6
17
  [K in keyof T]?: DeepPartial<T[K]>;