@alepha/react 0.12.0 → 0.13.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 (85) hide show
  1. package/dist/auth/chunk-DhGyd7sr.js +28 -0
  2. package/dist/auth/index.browser.js +394 -114
  3. package/dist/auth/index.browser.js.map +1 -1
  4. package/dist/auth/index.cjs +80 -1927
  5. package/dist/auth/index.cjs.map +1 -1
  6. package/dist/auth/index.d.cts +1130 -420
  7. package/dist/auth/index.d.ts +1130 -420
  8. package/dist/auth/index.js +72 -1918
  9. package/dist/auth/index.js.map +1 -1
  10. package/dist/core/chunk-DhGyd7sr.js +28 -0
  11. package/dist/core/index.browser.js +79 -79
  12. package/dist/core/index.browser.js.map +1 -1
  13. package/dist/core/index.cjs +89 -85
  14. package/dist/core/index.cjs.map +1 -1
  15. package/dist/core/index.d.cts +1654 -154
  16. package/dist/core/index.d.ts +1654 -154
  17. package/dist/core/index.js +79 -79
  18. package/dist/core/index.js.map +1 -1
  19. package/dist/form/chunk-DhGyd7sr.js +28 -0
  20. package/dist/form/index.cjs +28 -8
  21. package/dist/form/index.cjs.map +1 -1
  22. package/dist/form/index.d.cts +215 -7
  23. package/dist/form/index.d.ts +215 -7
  24. package/dist/form/index.js +18 -3
  25. package/dist/form/index.js.map +1 -1
  26. package/dist/head/chunk-DhGyd7sr.js +28 -0
  27. package/dist/head/index.browser.js +385 -59
  28. package/dist/head/index.browser.js.map +1 -1
  29. package/dist/head/index.cjs +12 -8
  30. package/dist/head/index.cjs.map +1 -1
  31. package/dist/head/index.d.cts +1230 -24
  32. package/dist/head/index.d.ts +1230 -29
  33. package/dist/head/index.js +2 -2
  34. package/dist/head/index.js.map +1 -1
  35. package/dist/i18n/chunk-DhGyd7sr.js +28 -0
  36. package/dist/i18n/index.cjs +33 -20
  37. package/dist/i18n/index.cjs.map +1 -1
  38. package/dist/i18n/index.d.cts +282 -13
  39. package/dist/i18n/index.d.ts +282 -13
  40. package/dist/i18n/index.js +23 -14
  41. package/dist/i18n/index.js.map +1 -1
  42. package/dist/websocket/index.cjs +21 -8
  43. package/dist/websocket/index.cjs.map +1 -1
  44. package/dist/websocket/index.js +11 -2
  45. package/dist/websocket/index.js.map +1 -1
  46. package/package.json +7 -6
  47. package/src/auth/index.browser.ts +3 -6
  48. package/src/auth/index.shared.ts +0 -1
  49. package/src/auth/index.ts +3 -16
  50. package/src/auth/providers/ReactAuthProvider.ts +1 -614
  51. package/src/auth/services/ReactAuth.ts +6 -17
  52. package/src/core/descriptors/$page.ts +1 -1
  53. package/src/core/index.browser.ts +1 -0
  54. package/src/core/index.native.ts +21 -0
  55. package/src/core/index.shared-router.ts +15 -0
  56. package/src/core/index.shared.ts +0 -14
  57. package/src/core/index.ts +1 -0
  58. package/src/core/services/ReactRouter.ts +2 -2
  59. package/src/form/errors/FormValidationError.ts +20 -0
  60. package/src/form/hooks/useForm.ts +1 -1
  61. package/src/form/index.ts +1 -0
  62. package/src/head/providers/BrowserHeadProvider.ts +1 -1
  63. package/src/i18n/descriptors/$dictionary.ts +7 -3
  64. package/src/i18n/providers/I18nProvider.ts +9 -10
  65. package/src/websocket/hooks/useRoom.tsx +21 -2
  66. package/dist/auth/index.d.cts.map +0 -1
  67. package/dist/auth/index.d.ts.map +0 -1
  68. package/dist/core/index.d.cts.map +0 -1
  69. package/dist/core/index.d.ts.map +0 -1
  70. package/dist/form/index.d.cts.map +0 -1
  71. package/dist/form/index.d.ts.map +0 -1
  72. package/dist/head/index.d.cts.map +0 -1
  73. package/dist/head/index.d.ts.map +0 -1
  74. package/dist/i18n/index.d.cts.map +0 -1
  75. package/dist/i18n/index.d.ts.map +0 -1
  76. package/dist/websocket/index.d.cts.map +0 -1
  77. package/dist/websocket/index.d.ts.map +0 -1
  78. package/src/auth/descriptors/$auth.ts +0 -436
  79. package/src/auth/descriptors/$authApple.ts +0 -8
  80. package/src/auth/descriptors/$authGithub.ts +0 -81
  81. package/src/auth/descriptors/$authGoogle.ts +0 -38
  82. package/src/auth/errors/SessionExpiredError.ts +0 -6
  83. package/src/auth/schemas/tokenResponseSchema.ts +0 -11
  84. package/src/auth/schemas/tokensSchema.ts +0 -21
  85. package/src/auth/schemas/userinfoResponseSchema.ts +0 -10
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@alepha/react",
3
3
  "description": "React components and hooks for building Alepha applications.",
4
- "version": "0.12.0",
4
+ "author": "Nicolas Foures",
5
+ "version": "0.13.0",
5
6
  "type": "module",
6
7
  "engines": {
7
8
  "node": ">=22.0.0"
@@ -22,15 +23,15 @@
22
23
  "devDependencies": {
23
24
  "@testing-library/dom": "^10.4.1",
24
25
  "@testing-library/react": "^16.3.0",
25
- "@types/react": "^19.2.5",
26
- "alepha": "0.12.0",
26
+ "@types/react": "^19.2.7",
27
+ "@types/react-dom": "^19.2.3",
28
+ "alepha": "0.13.0",
27
29
  "jsdom": "^27.2.0",
28
- "openid-client": "^6.8.1",
29
30
  "react": "^19.2.0",
30
- "vitest": "^4.0.9"
31
+ "vitest": "^4.0.14"
31
32
  },
32
33
  "peerDependencies": {
33
- "alepha": "0.12.0",
34
+ "alepha": "0.13.0",
34
35
  "react": "^19.2.0"
35
36
  },
36
37
  "scripts": {
@@ -1,16 +1,13 @@
1
- import { $module, type Alepha } from "alepha";
1
+ import { $module } from "alepha";
2
2
  import { ReactAuth } from "./services/ReactAuth.ts";
3
3
 
4
4
  // ---------------------------------------------------------------------------------------------------------------------
5
5
 
6
- export * from "./index.shared";
6
+ export * from "./index.shared.ts";
7
7
 
8
8
  // ---------------------------------------------------------------------------------------------------------------------
9
9
 
10
10
  export const AlephaReactAuth = $module({
11
11
  name: "alepha.react.auth",
12
- descriptors: [],
13
- register: (alepha: Alepha) => {
14
- alepha.with(ReactAuth);
15
- },
12
+ services: [ReactAuth],
16
13
  });
@@ -1,3 +1,2 @@
1
- export * from "./errors/SessionExpiredError.ts";
2
1
  export * from "./hooks/useAuth.ts";
3
2
  export * from "./services/ReactAuth.ts";
package/src/auth/index.ts CHANGED
@@ -1,31 +1,18 @@
1
1
  import { AlephaReact } from "@alepha/react";
2
2
  import { $module } from "alepha";
3
3
  import type { UserAccount } from "alepha/security";
4
- import { AlephaServerCookies } from "alepha/server/cookies";
5
- import { $auth } from "./descriptors/$auth.ts";
6
4
  import { ReactAuthProvider } from "./providers/ReactAuthProvider.ts";
7
5
  import { ReactAuth } from "./services/ReactAuth.ts";
6
+ import { $auth, AlephaServerAuth } from "alepha/server/auth";
7
+ import { AlephaServerLinks } from "alepha/server/links";
8
8
 
9
9
  // ---------------------------------------------------------------------------------------------------------------------
10
10
 
11
- export * from "./descriptors/$auth.ts";
12
- export * from "./descriptors/$authGithub.ts";
13
- export * from "./descriptors/$authGoogle.ts";
14
11
  export * from "./index.shared.ts";
15
12
  export * from "./providers/ReactAuthProvider.ts";
16
13
 
17
14
  // ---------------------------------------------------------------------------------------------------------------------
18
15
 
19
- declare module "alepha" {
20
- export interface State {
21
- /**
22
- * The authenticated user account attached to the server request state.
23
- *
24
- * @internal
25
- */
26
- "alepha.server.request.user"?: UserAccount;
27
- }
28
- }
29
16
  declare module "@alepha/react" {
30
17
  interface ReactRouterState {
31
18
  user?: UserAccount;
@@ -43,5 +30,5 @@ declare module "@alepha/react" {
43
30
  export const AlephaReactAuth = $module({
44
31
  name: "alepha.react.auth",
45
32
  descriptors: [$auth],
46
- services: [AlephaReact, AlephaServerCookies, ReactAuthProvider, ReactAuth],
33
+ services: [AlephaReact, AlephaServerLinks, AlephaServerAuth, ReactAuthProvider, ReactAuth],
47
34
  });