@abyss-project/commons-front-core 3.3.1 → 4.0.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 (103) hide show
  1. package/dist/{CookieConsentSettings.component-tRVw_4zH.js → CookieConsentSettings.component-B06_BnQP.js} +2703 -2118
  2. package/dist/auth/client/auth-bridge.d.ts +51 -0
  3. package/dist/auth/client/auth-client.d.ts +125 -0
  4. package/dist/auth/client/auth-client.spec.d.ts +1 -0
  5. package/dist/auth/client/capacitor-bridge.d.ts +16 -0
  6. package/dist/auth/client/index.d.ts +6 -0
  7. package/dist/auth/client/native-bridge.d.ts +53 -0
  8. package/dist/auth/client/native-bridge.spec.d.ts +1 -0
  9. package/dist/auth/client/token-storage.d.ts +31 -0
  10. package/dist/auth/client/web-bridge.d.ts +13 -0
  11. package/dist/auth/client/web-bridge.spec.d.ts +1 -0
  12. package/dist/auth/components/AuthFlow/AuthFlow.component.d.ts +30 -0
  13. package/dist/auth/components/AuthFlow/AuthFlow.component.spec.d.ts +1 -0
  14. package/dist/auth/components/AuthFlow/auth-flow.types.d.ts +62 -0
  15. package/dist/auth/components/AuthFlow/steps/CodeStep.component.d.ts +17 -0
  16. package/dist/auth/components/AuthFlow/steps/EmailStep.component.d.ts +22 -0
  17. package/dist/auth/components/AuthFlow/steps/MfaEnrollmentStep.component.d.ts +13 -0
  18. package/dist/auth/components/AuthFlow/steps/MfaStep.component.d.ts +20 -0
  19. package/dist/auth/components/AuthFlow/steps/PasskeyNudgeStep.component.d.ts +11 -0
  20. package/dist/auth/components/AuthFlow/steps/PasswordStep.component.d.ts +17 -0
  21. package/dist/auth/components/AuthFlow/steps/SignupStep.component.d.ts +24 -0
  22. package/dist/auth/components/AuthFlow/steps/steps.autocomplete.spec.d.ts +1 -0
  23. package/dist/auth/components/AuthProviderButtons/AuthProviderButtons.component.d.ts +30 -0
  24. package/dist/auth/components/MfaRequirementBanner/MfaRequirementBanner.component.d.ts +12 -0
  25. package/dist/auth/components/MfaRequirementBanner/MfaRequirementBanner.component.spec.d.ts +1 -0
  26. package/dist/auth/components/ReauthDialog/AuthReauthHost.component.d.ts +8 -0
  27. package/dist/auth/components/ReauthDialog/ReauthDialog.component.d.ts +22 -0
  28. package/dist/auth/components/ReauthDialog/ReauthDialog.component.spec.d.ts +1 -0
  29. package/dist/auth/components/SecuritySettings/SecuritySettings.component.d.ts +7 -0
  30. package/dist/auth/components/SecuritySettings/SecuritySettings.component.spec.d.ts +1 -0
  31. package/dist/auth/components/SecuritySettings/sections/EmailSection.component.d.ts +6 -0
  32. package/dist/auth/components/SecuritySettings/sections/PasskeysSection.component.d.ts +10 -0
  33. package/dist/auth/components/SecuritySettings/sections/PasswordSection.component.d.ts +9 -0
  34. package/dist/auth/components/SecuritySettings/sections/RecoveryCodesSection.component.d.ts +10 -0
  35. package/dist/auth/components/SecuritySettings/sections/SecuritySection.component.d.ts +26 -0
  36. package/dist/auth/components/SecuritySettings/sections/SessionsSection.component.d.ts +8 -0
  37. package/dist/auth/components/SecuritySettings/sections/TotpSection.component.d.ts +11 -0
  38. package/dist/auth/components/SecuritySettings/sections/use-section-action.hook.d.ts +9 -0
  39. package/dist/auth/components/index.d.ts +11 -0
  40. package/dist/auth/components/shared/AuthStepFrame.component.d.ts +19 -0
  41. package/dist/auth/components/shared/OneTimeCodeField.component.d.ts +17 -0
  42. package/dist/auth/components/shared/RecoveryCodesPanel.component.d.ts +12 -0
  43. package/dist/auth/components/shared/TotpSetupPanel.component.d.ts +14 -0
  44. package/dist/auth/components/shared/auth-errors.d.ts +42 -0
  45. package/dist/auth/components/shared/mfa-status-events.d.ts +2 -0
  46. package/dist/auth/components/shared/passkey-ceremonies.d.ts +17 -0
  47. package/dist/auth/components/shared/use-async-resource.hook.d.ts +18 -0
  48. package/dist/auth/components/shared/use-offline.hook.d.ts +2 -0
  49. package/dist/auth/components/shared/use-passkey-name.hook.d.ts +5 -0
  50. package/dist/auth/components/test-support/auth-sdk.mock.d.ts +57 -0
  51. package/dist/auth/components/test-support/auth-test-harness.d.ts +48 -0
  52. package/dist/auth/index.d.ts +2 -0
  53. package/dist/auth/react/AuthProvider.component.d.ts +15 -0
  54. package/dist/auth/react/AuthProvider.component.spec.d.ts +1 -0
  55. package/dist/auth/react/use-auth.hook.d.ts +3 -0
  56. package/dist/auth-client.d.ts +2 -0
  57. package/dist/auth-client.js +26 -0
  58. package/dist/auth-native.d.ts +2 -0
  59. package/dist/auth-native.js +84 -0
  60. package/dist/components/Layouts/AbyssHeader/AbyssHeader.component.spec.d.ts +1 -0
  61. package/dist/components/Layouts/AbyssLayoutProvider/AbyssLayoutProvider.component.d.ts +2 -3
  62. package/dist/components/Layouts/AbyssLayoutProvider/abyss-layout.store.d.ts +1 -1
  63. package/dist/components/Support/SupportTicketDetail.mobile-layout.spec.d.ts +1 -0
  64. package/dist/components/Utils/AbyssFamilyMenuSection/AbyssFamilyMenuSection.d.ts +0 -9
  65. package/dist/cookie-consent.js +1 -1
  66. package/dist/hooks/use-rich-intl.hook.d.ts +654 -4
  67. package/dist/{index-CXnNeiXz.js → index-B99FVtM1.js} +2 -2
  68. package/dist/{index-CTBDkBPe.js → index-BAiia-Dl.js} +4 -4
  69. package/dist/{index-DkMLpgfq.js → index-BI56obfe.js} +1 -1
  70. package/dist/{index-b3WuxsCC.js → index-BLjfAtDQ.js} +2 -2
  71. package/dist/{index-BhUOByTM.js → index-BQMgvLh9.js} +4 -4
  72. package/dist/{index-BGceZbVS.js → index-BU5c0hG9.js} +3 -3
  73. package/dist/{index-B_fO6ea8.js → index-B_rGVaUU.js} +2 -2
  74. package/dist/{index-DpY3X6GK.js → index-BokeagcV.js} +3 -3
  75. package/dist/{index-DYR_WGV_.js → index-C36LEiRs.js} +2 -2
  76. package/dist/{index-CkY3F8ms.js → index-C4fkwJmM.js} +2 -2
  77. package/dist/{index-BNpq4Ojx.js → index-COBKSaJ6.js} +2 -2
  78. package/dist/{index-DcM1fPMt.js → index-CQcl-JnX.js} +2 -2
  79. package/dist/{index-DhYVV6dR.js → index-Cp_oEtd_.js} +33234 -30050
  80. package/dist/{index-CE15DcVv.js → index-D1vKJSB3.js} +3 -3
  81. package/dist/index-D7cgykJH.js +324 -0
  82. package/dist/{index-IivE7b0n.js → index-DA5MOwJ6.js} +2 -2
  83. package/dist/{index-CaK1xV4R.js → index-DAEl7d3x.js} +2 -2
  84. package/dist/{index-C3Tr9CAs.js → index-DPDhWaXC.js} +2 -2
  85. package/dist/{index-Cyj-5x-K.js → index-Dy57KM7a.js} +2 -2
  86. package/dist/{index-DGqe7jH3.js → index-QsS__hk5.js} +3 -3
  87. package/dist/{index-CND94AUq.js → index-cHPTPlez.js} +2 -2
  88. package/dist/{index-ZRHnQY06.js → index-pmj-p-Pq.js} +2 -2
  89. package/dist/{index-DzwmloOq.js → index-rgzxHuXo.js} +4 -4
  90. package/dist/index.d.ts +1 -0
  91. package/dist/index.js +273 -242
  92. package/dist/token-storage-D3e11ePD.js +38 -0
  93. package/dist/translations/en.d.ts +289 -0
  94. package/dist/translations/fr.d.ts +289 -0
  95. package/dist/translations/translations-parity.spec.d.ts +1 -0
  96. package/dist/use-auth.hook-B_TU5W3g.js +391 -0
  97. package/dist/utils/billing.utils.d.ts +2 -2
  98. package/dist/utils/cookie.utils.d.ts +1 -1
  99. package/dist/utils/space-display-name.utils.d.ts +2 -2
  100. package/package.json +32 -10
  101. package/scripts/check-auth-entry-isolation.cjs +140 -0
  102. package/vite.config.ts +24 -1
  103. package/vitest.config.ts +1 -1
package/vite.config.ts CHANGED
@@ -20,6 +20,11 @@ export default defineConfig({
20
20
  // its own, older `@abyss-project/main`, which has no such entry — so this package carries
21
21
  // its own copy, compiled from the single source in abyss_main_core.
22
22
  '@abyss-project/main/plan-name': resolve(__dirname, '../abyss_main_core/src/plan-name/index.ts'),
23
+ // Same for the metric labels: the invoices and the quota dialog read one table.
24
+ '@abyss-project/main/billing-metric-label': resolve(
25
+ __dirname,
26
+ '../abyss_main_core/src/billing-metric-label/index.ts',
27
+ ),
23
28
  },
24
29
  },
25
30
  build: {
@@ -32,6 +37,20 @@ export default defineConfig({
32
37
  entry: {
33
38
  index: resolve(__dirname, 'src/index.ts'),
34
39
  'cookie-consent': resolve(__dirname, 'src/components/CookieConsent/index.ts'),
40
+ // The native auth bridge, out of the main barrel: the only importer of the optional peer
41
+ // `@abyss-project/capacitor-auth`, which a web-only consumer does not install.
42
+ 'auth-native': resolve(__dirname, 'src/auth/client/capacitor-bridge.ts'),
43
+ // The session-only auth surface (client, bridges, token storage, `<AuthProvider>`,
44
+ // `useAuth`), out of the main barrel: an app's auth bootstrap module (created once, at
45
+ // cold start and in every test that re-imports it) never needs the screens
46
+ // (`AuthFlow`, `SecuritySettings`…) and their dependencies (MUI, pdf.js, milkdown, nivo).
47
+ // Checked by `scripts/check-auth-entry-isolation.cjs` (run from `build`): #510 task 14d.
48
+ // Entry key `auth-client`, not `auth`: `vite-plugin-dts` mirrors `src/auth/` into
49
+ // `dist/auth/` (the full barrel's own type resolution for `export * from './auth'`); a
50
+ // same-named root file `dist/auth.d.ts` would win module resolution over that directory
51
+ // and silently swap the full barrel's own `./auth` export for this narrow one. The public
52
+ // subpath stays `./auth` (package.json `exports`) — only the dist filename differs.
53
+ 'auth-client': resolve(__dirname, 'src/auth/client/index.ts'),
35
54
  },
36
55
  formats: ['es'],
37
56
  fileName: (_format, entryName) => `${entryName}.js`,
@@ -44,6 +63,8 @@ export default defineConfig({
44
63
  const exactNames = [
45
64
  'react', 'react-dom', 'react-intl', 'react-router-dom',
46
65
  'pdfjs-dist', 'pdf-lib',
66
+ // A dependency, resolved by the consumer: one WebAuthn copy per app.
67
+ '@simplewebauthn/browser',
47
68
  'osx-temperature-sensor', 'fs', 'path', 'os',
48
69
  ];
49
70
  if (exactNames.includes(id)) return true;
@@ -61,7 +82,9 @@ export default defineConfig({
61
82
  if (id === '@mui/x-date-pickers/PickersDay') return false;
62
83
  // Bundled on purpose, see `resolve.alias` above.
63
84
  if (id === '@abyss-project/main/plan-name') return false;
64
- // Scoped-package prefixes (these always end with '/')
85
+ if (id === '@abyss-project/main/billing-metric-label') return false;
86
+ // Scoped-package prefixes (these always end with '/'). `@abyss-project/` keeps
87
+ // `@abyss-project/capacitor-auth` external: imported lazily by the `auth-native` entry only.
65
88
  const scopedPrefixes = ['@mui/', '@emotion/', '@abyss-project/', '@tanstack/'];
66
89
  return scopedPrefixes.some((prefix) => id.startsWith(prefix));
67
90
  },
package/vitest.config.ts CHANGED
@@ -13,7 +13,7 @@ export default mergeConfig(
13
13
  include: ['src/**/*.spec.ts', 'src/**/*.spec.tsx'],
14
14
  globals: false,
15
15
  passWithNoTests: true,
16
- // Tests change process.env through `vi.stubEnv` only (lint rule in .eslintrc.js, card #612):
16
+ // Tests change process.env through `vi.stubEnv` only (lint rule in .eslintrc.cjs, card #612):
17
17
  // every stub is undone before the next test, absence included.
18
18
  unstubEnvs: true,
19
19
  },