@aphexcms/cms-core 11.2.1 → 12.0.0-next.20261109083516

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 (244) hide show
  1. package/dist/admin/client-auth.svelte.d.ts +120 -0
  2. package/dist/admin/client-auth.svelte.d.ts.map +1 -0
  3. package/dist/admin/client-auth.svelte.js +14 -0
  4. package/dist/admin/client-config.d.ts +72 -0
  5. package/dist/admin/client-config.d.ts.map +1 -0
  6. package/dist/admin/client-config.js +1 -0
  7. package/dist/admin/settings-header-actions.d.ts +12 -0
  8. package/dist/admin/settings-header-actions.d.ts.map +1 -0
  9. package/dist/admin/settings-header-actions.js +1 -0
  10. package/dist/admin/view-data.d.ts +189 -0
  11. package/dist/admin/view-data.d.ts.map +1 -0
  12. package/dist/admin/view-data.js +1 -0
  13. package/dist/admin.css +6 -0
  14. package/dist/api/invitations.d.ts +2 -2
  15. package/dist/api/invitations.d.ts.map +1 -1
  16. package/dist/api/organizations.d.ts +13 -3
  17. package/dist/api/organizations.d.ts.map +1 -1
  18. package/dist/api/organizations.js +11 -1
  19. package/dist/api/user.d.ts +6 -1
  20. package/dist/api/user.d.ts.map +1 -1
  21. package/dist/api/user.js +7 -0
  22. package/dist/app-augment.d.ts +2 -3
  23. package/dist/app-augment.d.ts.map +1 -1
  24. package/dist/app.d.ts +1 -1
  25. package/dist/auth/auth-errors.d.ts +6 -0
  26. package/dist/auth/auth-errors.d.ts.map +1 -1
  27. package/dist/auth/auth-errors.js +8 -0
  28. package/dist/auth/auth-hooks.d.ts.map +1 -1
  29. package/dist/auth/auth-hooks.js +36 -17
  30. package/dist/auth/invitation-email.d.ts +9 -0
  31. package/dist/auth/invitation-email.d.ts.map +1 -0
  32. package/dist/auth/invitation-email.js +49 -0
  33. package/dist/auth/pages.d.ts +16 -0
  34. package/dist/auth/pages.d.ts.map +1 -0
  35. package/dist/auth/pages.js +23 -0
  36. package/dist/auth/provider.d.ts +31 -1
  37. package/dist/auth/provider.d.ts.map +1 -1
  38. package/dist/client/index.d.ts +5 -0
  39. package/dist/client/index.d.ts.map +1 -1
  40. package/dist/client/index.js +9 -0
  41. package/dist/client/ui.d.ts +17 -0
  42. package/dist/client/ui.d.ts.map +1 -1
  43. package/dist/client/ui.js +27 -0
  44. package/dist/components/AdminApp.svelte +7 -4
  45. package/dist/components/AdminApp.svelte.d.ts.map +1 -1
  46. package/dist/components/AphexStudio.svelte +268 -0
  47. package/dist/components/AphexStudio.svelte.d.ts +16 -0
  48. package/dist/components/AphexStudio.svelte.d.ts.map +1 -0
  49. package/dist/components/admin/AccountSettings.svelte +339 -0
  50. package/dist/components/admin/AccountSettings.svelte.d.ts +8 -0
  51. package/dist/components/admin/AccountSettings.svelte.d.ts.map +1 -0
  52. package/dist/components/admin/AccountSettingsView.svelte +61 -0
  53. package/dist/components/admin/AccountSettingsView.svelte.d.ts +19 -0
  54. package/dist/components/admin/AccountSettingsView.svelte.d.ts.map +1 -0
  55. package/dist/components/admin/ApiKeysSettings.svelte +435 -0
  56. package/dist/components/admin/ApiKeysSettings.svelte.d.ts +15 -0
  57. package/dist/components/admin/ApiKeysSettings.svelte.d.ts.map +1 -0
  58. package/dist/components/admin/AuthPageShell.svelte +32 -0
  59. package/dist/components/admin/AuthPageShell.svelte.d.ts +16 -0
  60. package/dist/components/admin/AuthPageShell.svelte.d.ts.map +1 -0
  61. package/dist/components/admin/CreateOrganization.svelte +158 -0
  62. package/dist/components/admin/CreateOrganization.svelte.d.ts +11 -0
  63. package/dist/components/admin/CreateOrganization.svelte.d.ts.map +1 -0
  64. package/dist/components/admin/DeleteAccountSettings.svelte +124 -0
  65. package/dist/components/admin/DeleteAccountSettings.svelte.d.ts +7 -0
  66. package/dist/components/admin/DeleteAccountSettings.svelte.d.ts.map +1 -0
  67. package/dist/components/admin/DeleteOrganizationSettings.svelte +123 -0
  68. package/dist/components/admin/DeleteOrganizationSettings.svelte.d.ts +11 -0
  69. package/dist/components/admin/DeleteOrganizationSettings.svelte.d.ts.map +1 -0
  70. package/dist/components/admin/DocumentEditor.svelte +108 -36
  71. package/dist/components/admin/DocumentEditor.svelte.d.ts.map +1 -1
  72. package/dist/components/admin/GeneralSettings.svelte +45 -0
  73. package/dist/components/admin/GeneralSettings.svelte.d.ts +10 -0
  74. package/dist/components/admin/GeneralSettings.svelte.d.ts.map +1 -0
  75. package/dist/components/admin/GodModeView.svelte +112 -0
  76. package/dist/components/admin/GodModeView.svelte.d.ts +9 -0
  77. package/dist/components/admin/GodModeView.svelte.d.ts.map +1 -0
  78. package/dist/components/admin/InvitationsView.svelte +277 -0
  79. package/dist/components/admin/InvitationsView.svelte.d.ts +11 -0
  80. package/dist/components/admin/InvitationsView.svelte.d.ts.map +1 -0
  81. package/dist/components/admin/InviteView.svelte +98 -0
  82. package/dist/components/admin/InviteView.svelte.d.ts +9 -0
  83. package/dist/components/admin/InviteView.svelte.d.ts.map +1 -0
  84. package/dist/components/admin/LoginView.svelte +478 -0
  85. package/dist/components/admin/LoginView.svelte.d.ts +5 -0
  86. package/dist/components/admin/LoginView.svelte.d.ts.map +1 -0
  87. package/dist/components/admin/MembersSettings.svelte +661 -0
  88. package/dist/components/admin/MembersSettings.svelte.d.ts +8 -0
  89. package/dist/components/admin/MembersSettings.svelte.d.ts.map +1 -0
  90. package/dist/components/admin/OrganizationSettings.svelte +367 -0
  91. package/dist/components/admin/OrganizationSettings.svelte.d.ts +9 -0
  92. package/dist/components/admin/OrganizationSettings.svelte.d.ts.map +1 -0
  93. package/dist/components/admin/OrganizationsList.svelte +92 -0
  94. package/dist/components/admin/OrganizationsList.svelte.d.ts +8 -0
  95. package/dist/components/admin/OrganizationsList.svelte.d.ts.map +1 -0
  96. package/dist/components/admin/OrganizationsView.svelte +31 -0
  97. package/dist/components/admin/OrganizationsView.svelte.d.ts +9 -0
  98. package/dist/components/admin/OrganizationsView.svelte.d.ts.map +1 -0
  99. package/dist/components/admin/PasswordInput.svelte +43 -0
  100. package/dist/components/admin/PasswordInput.svelte.d.ts +8 -0
  101. package/dist/components/admin/PasswordInput.svelte.d.ts.map +1 -0
  102. package/dist/components/admin/PasswordSettings.svelte +179 -0
  103. package/dist/components/admin/PasswordSettings.svelte.d.ts +4 -0
  104. package/dist/components/admin/PasswordSettings.svelte.d.ts.map +1 -0
  105. package/dist/components/admin/PreferencesSettings.svelte +80 -0
  106. package/dist/components/admin/PreferencesSettings.svelte.d.ts +20 -0
  107. package/dist/components/admin/PreferencesSettings.svelte.d.ts.map +1 -0
  108. package/dist/components/admin/ResetPasswordView.svelte +117 -0
  109. package/dist/components/admin/ResetPasswordView.svelte.d.ts +9 -0
  110. package/dist/components/admin/ResetPasswordView.svelte.d.ts.map +1 -0
  111. package/dist/components/admin/RolesSettings.svelte +360 -0
  112. package/dist/components/admin/RolesSettings.svelte.d.ts +11 -0
  113. package/dist/components/admin/RolesSettings.svelte.d.ts.map +1 -0
  114. package/dist/components/admin/SchemaField.svelte +12 -2
  115. package/dist/components/admin/SchemaField.svelte.d.ts.map +1 -1
  116. package/dist/components/admin/SettingsHeaderActions.svelte +25 -0
  117. package/dist/components/admin/SettingsHeaderActions.svelte.d.ts +8 -0
  118. package/dist/components/admin/SettingsHeaderActions.svelte.d.ts.map +1 -0
  119. package/dist/components/admin/SettingsShell.svelte +136 -0
  120. package/dist/components/admin/SettingsShell.svelte.d.ts +9 -0
  121. package/dist/components/admin/SettingsShell.svelte.d.ts.map +1 -0
  122. package/dist/components/admin/TwoFactorChallengeView.svelte +377 -0
  123. package/dist/components/admin/TwoFactorChallengeView.svelte.d.ts +11 -0
  124. package/dist/components/admin/TwoFactorChallengeView.svelte.d.ts.map +1 -0
  125. package/dist/components/admin/TwoFactorSettings.svelte +436 -0
  126. package/dist/components/admin/TwoFactorSettings.svelte.d.ts +7 -0
  127. package/dist/components/admin/TwoFactorSettings.svelte.d.ts.map +1 -0
  128. package/dist/components/admin/fields/ImageField.svelte +4 -2
  129. package/dist/components/admin/fields/SlugField.svelte +3 -1
  130. package/dist/components/admin/fields/SlugField.svelte.d.ts.map +1 -1
  131. package/dist/components/admin/fields/richtext/PortableTextImageView.svelte +3 -2
  132. package/dist/components/admin/fields/richtext/RichtextField.svelte +54 -7
  133. package/dist/components/admin/fields/richtext/RichtextField.svelte.d.ts.map +1 -1
  134. package/dist/components/layout/sidebar/NavUser.svelte +2 -2
  135. package/dist/config.d.ts +2 -1
  136. package/dist/config.d.ts.map +1 -1
  137. package/dist/db/interfaces/document.d.ts +15 -2
  138. package/dist/db/interfaces/document.d.ts.map +1 -1
  139. package/dist/db/interfaces/index.d.ts +1 -1
  140. package/dist/db/interfaces/index.d.ts.map +1 -1
  141. package/dist/email/index.d.ts +1 -0
  142. package/dist/email/index.d.ts.map +1 -1
  143. package/dist/email/index.js +2 -0
  144. package/dist/email/interfaces/email.d.ts +2 -0
  145. package/dist/email/interfaces/email.d.ts.map +1 -1
  146. package/dist/email/link-email.d.ts +15 -0
  147. package/dist/email/link-email.d.ts.map +1 -0
  148. package/dist/email/link-email.js +30 -0
  149. package/dist/field-validation/date-utils.d.ts.map +1 -1
  150. package/dist/field-validation/date-utils.js +4 -2
  151. package/dist/field-validation/utils.d.ts +42 -2
  152. package/dist/field-validation/utils.d.ts.map +1 -1
  153. package/dist/field-validation/utils.js +176 -14
  154. package/dist/graphql/index.d.ts.map +1 -1
  155. package/dist/graphql/index.js +1 -1
  156. package/dist/hooks.d.ts +6 -3
  157. package/dist/hooks.d.ts.map +1 -1
  158. package/dist/hooks.js +53 -17
  159. package/dist/jobs/recurring.d.ts +4 -1
  160. package/dist/jobs/recurring.d.ts.map +1 -1
  161. package/dist/jobs/recurring.js +28 -0
  162. package/dist/local-api/auth-helpers.d.ts +4 -4
  163. package/dist/local-api/auth-helpers.js +4 -4
  164. package/dist/local-api/collection-api.d.ts +10 -1
  165. package/dist/local-api/collection-api.d.ts.map +1 -1
  166. package/dist/local-api/collection-api.js +40 -12
  167. package/dist/local-api/index.d.ts +1 -1
  168. package/dist/local-api/index.d.ts.map +1 -1
  169. package/dist/local-api/index.js +12 -6
  170. package/dist/local-api/types.d.ts +1 -1
  171. package/dist/mcp/tools.d.ts.map +1 -1
  172. package/dist/mcp/tools.js +3 -1
  173. package/dist/preview/perspective.d.ts +1 -1
  174. package/dist/preview/perspective.js +1 -1
  175. package/dist/resolve-config.d.ts +22 -0
  176. package/dist/resolve-config.d.ts.map +1 -0
  177. package/dist/resolve-config.js +106 -0
  178. package/dist/routes/assets-cdn.d.ts +7 -2
  179. package/dist/routes/assets-cdn.d.ts.map +1 -1
  180. package/dist/routes/assets-cdn.js +11 -5
  181. package/dist/server/api/index.d.ts +1 -2
  182. package/dist/server/api/index.d.ts.map +1 -1
  183. package/dist/server/api/index.js +12 -3
  184. package/dist/server/api/openapi/registry.d.ts.map +1 -1
  185. package/dist/server/api/openapi/registry.js +70 -0
  186. package/dist/server/api/routes/api-keys.d.ts +4 -0
  187. package/dist/server/api/routes/api-keys.d.ts.map +1 -0
  188. package/dist/server/api/routes/api-keys.js +88 -0
  189. package/dist/server/api/routes/documents-by-id.d.ts.map +1 -1
  190. package/dist/server/api/routes/documents-by-id.js +16 -1
  191. package/dist/server/api/routes/documents-publish.d.ts.map +1 -1
  192. package/dist/server/api/routes/documents-publish.js +11 -1
  193. package/dist/server/api/routes/documents.d.ts.map +1 -1
  194. package/dist/server/api/routes/documents.js +16 -2
  195. package/dist/server/api/routes/instance-settings.d.ts +4 -0
  196. package/dist/server/api/routes/instance-settings.d.ts.map +1 -0
  197. package/dist/server/api/routes/instance-settings.js +47 -0
  198. package/dist/server/api/routes/invitations.d.ts +9 -0
  199. package/dist/server/api/routes/invitations.d.ts.map +1 -0
  200. package/dist/server/api/routes/invitations.js +79 -0
  201. package/dist/server/api/routes/organizations-invitations.d.ts +0 -6
  202. package/dist/server/api/routes/organizations-invitations.d.ts.map +1 -1
  203. package/dist/server/api/routes/organizations-invitations.js +6 -7
  204. package/dist/server/api/routes/organizations-team.d.ts +14 -0
  205. package/dist/server/api/routes/organizations-team.d.ts.map +1 -0
  206. package/dist/server/api/routes/organizations-team.js +36 -0
  207. package/dist/server/api/routes/organizations.d.ts.map +1 -1
  208. package/dist/server/api/routes/organizations.js +35 -9
  209. package/dist/server/core-routes.d.ts +8 -0
  210. package/dist/server/core-routes.d.ts.map +1 -0
  211. package/dist/server/core-routes.js +67 -0
  212. package/dist/server/index.d.ts +5 -1
  213. package/dist/server/index.d.ts.map +1 -1
  214. package/dist/server/index.js +7 -1
  215. package/dist/server/pages/admin.d.ts +24 -0
  216. package/dist/server/pages/admin.d.ts.map +1 -0
  217. package/dist/server/pages/admin.js +468 -0
  218. package/dist/server/queries/organization-team.d.ts +14 -0
  219. package/dist/server/queries/organization-team.d.ts.map +1 -0
  220. package/dist/server/queries/organization-team.js +65 -0
  221. package/dist/server/queries/pending-invitations.d.ts +8 -0
  222. package/dist/server/queries/pending-invitations.d.ts.map +1 -0
  223. package/dist/server/queries/pending-invitations.js +24 -0
  224. package/dist/types/api-key.d.ts +18 -0
  225. package/dist/types/api-key.d.ts.map +1 -0
  226. package/dist/types/api-key.js +1 -0
  227. package/dist/types/auth.d.ts +35 -0
  228. package/dist/types/auth.d.ts.map +1 -1
  229. package/dist/types/capabilities.d.ts +1 -2
  230. package/dist/types/capabilities.d.ts.map +1 -1
  231. package/dist/types/config.d.ts +124 -4
  232. package/dist/types/config.d.ts.map +1 -1
  233. package/dist/types/filters.d.ts +1 -1
  234. package/dist/types/index.d.ts +1 -0
  235. package/dist/types/index.d.ts.map +1 -1
  236. package/dist/types/index.js +1 -0
  237. package/dist/types/organization.d.ts +30 -0
  238. package/dist/types/organization.d.ts.map +1 -1
  239. package/dist/utils/preview.d.ts +8 -1
  240. package/dist/utils/preview.d.ts.map +1 -1
  241. package/dist/utils/preview.js +35 -0
  242. package/dist/vite/index.d.ts.map +1 -1
  243. package/dist/vite/index.js +46 -39
  244. package/package.json +19 -29
@@ -0,0 +1,436 @@
1
+ <script lang="ts">
2
+ import { Button } from '@aphexcms/ui/shadcn/button';
3
+ import PasswordInput from './PasswordInput.svelte';
4
+ import { Label } from '@aphexcms/ui/shadcn/label';
5
+ import { Badge } from '@aphexcms/ui/shadcn/badge';
6
+ import * as Card from '@aphexcms/ui/shadcn/card';
7
+ import * as InputOTP from '@aphexcms/ui/shadcn/input-otp';
8
+ import { ShieldCheck, ShieldOff, Copy, Download } from '@lucide/svelte';
9
+ import { toast } from 'svelte-sonner';
10
+ import { readable } from 'svelte/store';
11
+ import { useAdminAuthClient, type AdminSessionState } from '../../admin/client-auth.svelte';
12
+
13
+ /**
14
+ * Opt-in TOTP enrolment for the signed-in user.
15
+ *
16
+ * The enrol → verify split is the auth provider's, and it's the right one:
17
+ * `enable` hands back a secret and backup codes but leaves `twoFactorEnabled`
18
+ * false until a real code from the authenticator comes back. So a user who
19
+ * closes this panel halfway through — or scans the QR into an app that never
20
+ * syncs — is not locked out of their own account.
21
+ *
22
+ * Auth operations go through the host-provided admin auth client (the
23
+ * provider-agnostic client-side seam), not a hard Better Auth dependency.
24
+ */
25
+
26
+ /**
27
+ * Whether this instance offers the authenticator app at all. Drives enrolment:
28
+ * with it off, turning 2FA on is a single password confirmation and codes
29
+ * arrive by email instead of from a scanned QR.
30
+ */
31
+ let { totpAvailable = true }: { totpAvailable?: boolean } = $props();
32
+
33
+ const auth = useAdminAuthClient();
34
+ // A still, empty session when no client is provided, so the panel renders a
35
+ // disabled state instead of subscribing to a store that doesn't exist.
36
+ const session = auth ? auth.useSession() : readable<AdminSessionState>({ data: null });
37
+
38
+ // `undefined` while the session is still loading, so the panel can show a
39
+ // placeholder instead of flashing "not enabled" at someone who has it on.
40
+ const enabled = $derived($session.data?.user?.twoFactorEnabled ?? undefined);
41
+
42
+ type Step = 'idle' | 'password' | 'verify' | 'disable' | 'regenerate';
43
+
44
+ let step: Step = $state('idle');
45
+ let password = $state('');
46
+ let code = $state('');
47
+ let busy = $state(false);
48
+
49
+ // Enrolment material, held only for the length of the flow — the secret is
50
+ // never retrievable again without the password, and the backup codes are
51
+ // shown once.
52
+ let qrDataUrl = $state('');
53
+ let totpSecret = $state('');
54
+ let backupCodes: string[] = $state([]);
55
+
56
+ function reset() {
57
+ step = 'idle';
58
+ password = '';
59
+ code = '';
60
+ qrDataUrl = '';
61
+ totpSecret = '';
62
+ backupCodes = [];
63
+ }
64
+
65
+ function errorMessage(error: { message?: string } | null | undefined, fallback: string) {
66
+ return error?.message || fallback;
67
+ }
68
+
69
+ /**
70
+ * Pull the session again, bypassing the cookie cache.
71
+ *
72
+ * The client already refetches after any `/two-factor/*` call, but that request
73
+ * is served from the signed session cookie, which is cached for ~60s and isn't
74
+ * rewritten when 2FA is enabled or disabled. So the "refreshed" session still
75
+ * says what it said before, and this panel goes on claiming 2FA is on for a
76
+ * minute after it was switched off. Asking for an uncached read is what
77
+ * actually moves `twoFactorEnabled`.
78
+ */
79
+ async function refreshSession() {
80
+ await $session.refetch?.({ query: { disableCookieCache: true } });
81
+ }
82
+
83
+ async function startEnrolment(e: SubmitEvent) {
84
+ e.preventDefault();
85
+ if (!auth) return;
86
+ busy = true;
87
+ try {
88
+ const result = await auth.twoFactor.enable({ password });
89
+
90
+ if (result.error || !result.data) {
91
+ toast.error(errorMessage(result.error, 'Could not start setup'));
92
+ return;
93
+ }
94
+
95
+ backupCodes = result.data.backupCodes;
96
+ password = '';
97
+
98
+ // With TOTP switched off there is no authenticator to scan into and
99
+ // nothing to prove, so the server enables on the spot
100
+ // (`skipVerificationOnEnable`) and the QR step would be a dead end.
101
+ // Codes arrive by email from here on; the backup codes still matter.
102
+ if (!totpAvailable) {
103
+ await refreshSession();
104
+ step = 'idle';
105
+ toast.success('Two-factor authentication is on — codes will be emailed to you');
106
+ return;
107
+ }
108
+
109
+ // Imported here rather than at the top so it lands in its own lazy chunk
110
+ // (~23KB) instead of the admin's shared one — this is the only place in
111
+ // the app that ever draws a QR code, and only after a click.
112
+ const QRCode = (await import('qrcode')).default;
113
+ qrDataUrl = await QRCode.toDataURL(result.data.totpURI, { margin: 1, width: 240 });
114
+ // Shown as text for authenticator apps that can't use a camera.
115
+ totpSecret = new URL(result.data.totpURI).searchParams.get('secret') ?? '';
116
+
117
+ step = 'verify';
118
+ } catch (error) {
119
+ toast.error(error instanceof Error ? error.message : 'Could not start setup');
120
+ } finally {
121
+ busy = false;
122
+ }
123
+ }
124
+
125
+ function handleConfirm(e: SubmitEvent) {
126
+ e.preventDefault();
127
+ confirmEnrolment();
128
+ }
129
+
130
+ async function confirmEnrolment() {
131
+ // `onComplete` fires as soon as the sixth digit lands, so guard against
132
+ // re-entry while the previous attempt is still in flight.
133
+ if (busy || !auth || code.trim().length !== 6) return;
134
+
135
+ busy = true;
136
+ try {
137
+ const result = await auth.twoFactor.verifyTotp({ code: code.trim() });
138
+
139
+ if (result.error) {
140
+ toast.error(
141
+ errorMessage(
142
+ result.error,
143
+ 'That code is not valid. Codes expire every 30 seconds — try the current one.'
144
+ )
145
+ );
146
+ code = '';
147
+ return;
148
+ }
149
+
150
+ await refreshSession();
151
+ toast.success('Two-factor authentication is on');
152
+ reset();
153
+ } catch (error) {
154
+ toast.error(error instanceof Error ? error.message : 'Could not verify the code');
155
+ } finally {
156
+ busy = false;
157
+ }
158
+ }
159
+
160
+ async function disable(e: SubmitEvent) {
161
+ e.preventDefault();
162
+ if (!auth) return;
163
+ busy = true;
164
+ try {
165
+ const result = await auth.twoFactor.disable({ password });
166
+
167
+ if (result.error) {
168
+ toast.error(errorMessage(result.error, 'Could not turn off two-factor'));
169
+ return;
170
+ }
171
+
172
+ await refreshSession();
173
+ toast.success('Two-factor authentication is off');
174
+ reset();
175
+ } catch (error) {
176
+ toast.error(error instanceof Error ? error.message : 'Could not turn off two-factor');
177
+ } finally {
178
+ busy = false;
179
+ }
180
+ }
181
+
182
+ async function regenerate(e: SubmitEvent) {
183
+ e.preventDefault();
184
+ if (!auth) return;
185
+ busy = true;
186
+ try {
187
+ const result = await auth.twoFactor.generateBackupCodes({ password });
188
+
189
+ if (result.error || !result.data) {
190
+ toast.error(errorMessage(result.error, 'Could not generate new backup codes'));
191
+ return;
192
+ }
193
+
194
+ backupCodes = result.data.backupCodes;
195
+ password = '';
196
+ // Back to the resting state, but keep `backupCodes` — the panel above the
197
+ // buttons is the only place the new set is ever shown.
198
+ step = 'idle';
199
+ toast.success('New backup codes generated — the old ones no longer work');
200
+ } catch (error) {
201
+ toast.error(error instanceof Error ? error.message : 'Could not generate new backup codes');
202
+ } finally {
203
+ busy = false;
204
+ }
205
+ }
206
+
207
+ async function copyBackupCodes() {
208
+ try {
209
+ await navigator.clipboard.writeText(backupCodes.join('\n'));
210
+ toast.success('Backup codes copied');
211
+ } catch {
212
+ toast.error('Could not copy — select and copy them manually');
213
+ }
214
+ }
215
+
216
+ function downloadBackupCodes() {
217
+ const blob = new Blob([`${backupCodes.join('\n')}\n`], { type: 'text/plain' });
218
+ const url = URL.createObjectURL(blob);
219
+ const link = document.createElement('a');
220
+ link.href = url;
221
+ link.download = 'aphex-backup-codes.txt';
222
+ link.click();
223
+ URL.revokeObjectURL(url);
224
+ }
225
+ </script>
226
+
227
+ <Card.Root>
228
+ <Card.Header class="flex flex-row items-start justify-between gap-4">
229
+ <div class="space-y-1.5">
230
+ <Card.Title>Two-Factor Authentication</Card.Title>
231
+ <Card.Description>
232
+ Ask for a code from an authenticator app on top of your password.
233
+ </Card.Description>
234
+ </div>
235
+ {#if enabled !== undefined}
236
+ <Badge variant={enabled ? 'default' : 'outline'} class="shrink-0 px-2.5 py-1 text-xs">
237
+ {enabled ? 'On' : 'Off'}
238
+ </Badge>
239
+ {/if}
240
+ </Card.Header>
241
+
242
+ <Card.Content>
243
+ {#if !auth}
244
+ <p class="text-muted-foreground text-sm">
245
+ Two-factor management isn't available in this deployment.
246
+ </p>
247
+ {:else if enabled === undefined}
248
+ <div class="bg-muted/40 h-10 animate-pulse rounded-md"></div>
249
+ {:else if enabled}
250
+ <div class="space-y-4">
251
+ <div class="flex items-start gap-3">
252
+ <ShieldCheck class="mt-0.5 h-5 w-5 shrink-0 text-green-600 dark:text-green-500" />
253
+ <p class="text-muted-foreground text-sm">
254
+ Signing in on a new device asks for a six-digit code from your authenticator app.
255
+ </p>
256
+ </div>
257
+
258
+ {#if backupCodes.length}
259
+ {@render codesPanel()}
260
+ {/if}
261
+
262
+ {#if step === 'disable' || step === 'regenerate'}
263
+ <form onsubmit={step === 'disable' ? disable : regenerate} class="space-y-3">
264
+ <div class="space-y-2">
265
+ <Label for="tf-password">Confirm your password</Label>
266
+ <PasswordInput
267
+ id="tf-password"
268
+ bind:value={password}
269
+ required
270
+ autocomplete="current-password"
271
+ disabled={busy}
272
+ />
273
+ <p class="text-muted-foreground text-xs">
274
+ {step === 'disable'
275
+ ? 'Turning this off removes your authenticator and all backup codes.'
276
+ : 'Generating new codes immediately invalidates the previous set.'}
277
+ </p>
278
+ </div>
279
+ <div class="flex gap-2">
280
+ <Button
281
+ type="submit"
282
+ variant={step === 'disable' ? 'destructive' : 'default'}
283
+ disabled={busy || !password}
284
+ >
285
+ {#if busy}
286
+ Working…
287
+ {:else if step === 'disable'}
288
+ Turn off two-factor
289
+ {:else}
290
+ Generate new codes
291
+ {/if}
292
+ </Button>
293
+ <Button type="button" variant="ghost" disabled={busy} onclick={reset}>Cancel</Button>
294
+ </div>
295
+ </form>
296
+ {:else}
297
+ <div class="flex flex-wrap gap-2">
298
+ <Button
299
+ type="button"
300
+ variant="outline"
301
+ onclick={() => {
302
+ backupCodes = [];
303
+ step = 'regenerate';
304
+ }}
305
+ >
306
+ Generate new backup codes
307
+ </Button>
308
+ <Button
309
+ type="button"
310
+ variant="ghost"
311
+ class="text-destructive hover:text-destructive"
312
+ onclick={() => {
313
+ backupCodes = [];
314
+ step = 'disable';
315
+ }}
316
+ >
317
+ <ShieldOff class="mr-2 h-4 w-4" />
318
+ Turn off
319
+ </Button>
320
+ </div>
321
+ {/if}
322
+ </div>
323
+ {:else if step === 'idle'}
324
+ <div class="space-y-4">
325
+ <p class="text-muted-foreground text-sm">
326
+ You'll scan a QR code with an authenticator app — 1Password, Bitwarden, Google
327
+ Authenticator, or any other — and enter a six-digit code to confirm it works.
328
+ </p>
329
+ <Button type="button" onclick={() => (step = 'password')}>
330
+ <ShieldCheck class="mr-2 h-4 w-4" />
331
+ Set up two-factor
332
+ </Button>
333
+ </div>
334
+ {:else if step === 'password'}
335
+ <form onsubmit={startEnrolment} class="space-y-3">
336
+ <div class="space-y-2">
337
+ <Label for="tf-password">Confirm your password</Label>
338
+ <PasswordInput
339
+ id="tf-password"
340
+ bind:value={password}
341
+ required
342
+ autocomplete="current-password"
343
+ disabled={busy}
344
+ />
345
+ </div>
346
+ <div class="flex gap-2">
347
+ <Button type="submit" disabled={busy || !password}>
348
+ {busy ? 'Working…' : 'Continue'}
349
+ </Button>
350
+ <Button type="button" variant="ghost" disabled={busy} onclick={reset}>Cancel</Button>
351
+ </div>
352
+ </form>
353
+ {:else if step === 'verify'}
354
+ <div class="space-y-5">
355
+ <div class="flex flex-col gap-4 sm:flex-row sm:items-start">
356
+ {#if qrDataUrl}
357
+ <img
358
+ src={qrDataUrl}
359
+ alt="QR code for your authenticator app"
360
+ class="bg-background h-[180px] w-[180px] shrink-0 rounded-lg border p-2"
361
+ />
362
+ {/if}
363
+ <div class="min-w-0 flex-1 space-y-2">
364
+ <p class="text-sm font-medium">1. Scan this with your authenticator app</p>
365
+ {#if totpSecret}
366
+ <p class="text-muted-foreground text-xs">Can't scan? Enter this key manually:</p>
367
+ <code class="bg-muted block rounded px-2 py-1.5 font-mono text-xs break-all">
368
+ {totpSecret}
369
+ </code>
370
+ {/if}
371
+ </div>
372
+ </div>
373
+
374
+ <div class="space-y-2">
375
+ <p class="text-sm font-medium">2. Save your backup codes</p>
376
+ {@render codesPanel()}
377
+ </div>
378
+
379
+ <form onsubmit={handleConfirm} class="space-y-3">
380
+ <div class="space-y-2">
381
+ <Label for="tf-code">3. Enter the six-digit code to finish</Label>
382
+ <InputOTP.Root
383
+ inputId="tf-code"
384
+ maxlength={6}
385
+ value={code}
386
+ onValueChange={(next) => (code = next.replace(/\D/g, ''))}
387
+ onComplete={confirmEnrolment}
388
+ pasteTransformer={(text) => text.replace(/\D/g, '')}
389
+ disabled={busy}
390
+ inputmode="numeric"
391
+ autocomplete="one-time-code"
392
+ >
393
+ {#snippet children({ cells })}
394
+ <InputOTP.Group>
395
+ {#each cells as cell, i (i)}
396
+ <InputOTP.Slot {cell} />
397
+ {/each}
398
+ </InputOTP.Group>
399
+ {/snippet}
400
+ </InputOTP.Root>
401
+ </div>
402
+ <div class="flex gap-2">
403
+ <Button type="submit" disabled={busy || code.trim().length !== 6}>
404
+ {busy ? 'Verifying…' : 'Turn on two-factor'}
405
+ </Button>
406
+ <Button type="button" variant="ghost" disabled={busy} onclick={reset}>Cancel</Button>
407
+ </div>
408
+ </form>
409
+ </div>
410
+ {/if}
411
+ </Card.Content>
412
+ </Card.Root>
413
+
414
+ {#snippet codesPanel()}
415
+ <div class="bg-muted/40 space-y-3 rounded-lg border p-4">
416
+ <p class="text-muted-foreground text-xs">
417
+ Each code works once, and they're shown only now. Keep them somewhere you can reach without
418
+ your phone.
419
+ </p>
420
+ <ul class="grid grid-cols-2 gap-1.5 font-mono text-sm sm:grid-cols-3">
421
+ {#each backupCodes as backupCode (backupCode)}
422
+ <li class="bg-background rounded border px-2 py-1 text-center">{backupCode}</li>
423
+ {/each}
424
+ </ul>
425
+ <div class="flex flex-wrap gap-2">
426
+ <Button type="button" variant="outline" size="sm" onclick={copyBackupCodes}>
427
+ <Copy class="mr-2 h-3.5 w-3.5" />
428
+ Copy
429
+ </Button>
430
+ <Button type="button" variant="outline" size="sm" onclick={downloadBackupCodes}>
431
+ <Download class="mr-2 h-3.5 w-3.5" />
432
+ Download
433
+ </Button>
434
+ </div>
435
+ </div>
436
+ {/snippet}
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ totpAvailable?: boolean;
3
+ };
4
+ declare const TwoFactorSettings: import("svelte").Component<$$ComponentProps, {}, "">;
5
+ type TwoFactorSettings = ReturnType<typeof TwoFactorSettings>;
6
+ export default TwoFactorSettings;
7
+ //# sourceMappingURL=TwoFactorSettings.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TwoFactorSettings.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/admin/TwoFactorSettings.svelte.ts"],"names":[],"mappings":"AAgBC,KAAK,gBAAgB,GAAI;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AA0YtD,QAAA,MAAM,iBAAiB,sDAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
@@ -447,8 +447,10 @@
447
447
  <!-- Image preview with controls -->
448
448
  <div class="border-border overflow-hidden rounded-md border {validationClasses}">
449
449
  <div class="group relative">
450
- <!-- Image preview (Sanity-style aspect ratio ~2.75:1) -->
451
- <div class="bg-muted flex items-center justify-center" style="aspect-ratio: 2.75 / 1;">
450
+ <!-- Image preview: a fixed height rather than an aspect ratio, so a small
451
+ or square image (a logo, an icon) isn't stretched into a huge, mostly
452
+ empty box on a wide panel. -->
453
+ <div class="bg-muted flex items-center justify-center" style="height: 260px;">
452
454
  {#if loadingAsset}
453
455
  <div class="text-muted-foreground flex flex-col items-center gap-2">
454
456
  <div class="border-primary h-8 w-8 animate-spin rounded-full border-b-2"></div>
@@ -73,7 +73,9 @@
73
73
  Generate
74
74
  </Button>
75
75
  </div>
76
- {#if sourceValue}
76
+ {#if readonly}
77
+ <!-- No hint: the Generate button above is disabled, so there is nothing to click. -->
78
+ {:else if sourceValue}
77
79
  <p class="text-muted-foreground text-xs">
78
80
  Click "Generate" to create slug from {sourceField}: "{sourceValue}"
79
81
  </p>
@@ -1 +1 @@
1
- {"version":3,"file":"SlugField.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/admin/fields/SlugField.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIvD,UAAU,KAAK;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,GAAG,CAAC;IACX,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AA+DF,QAAA,MAAM,SAAS,2CAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"SlugField.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/admin/fields/SlugField.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIvD,UAAU,KAAK;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,GAAG,CAAC;IACX,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAiEF,QAAA,MAAM,SAAS,2CAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
@@ -70,6 +70,7 @@
70
70
  .image-block-view {
71
71
  position: relative;
72
72
  width: 100%;
73
+ height: 260px;
73
74
  display: flex;
74
75
  align-items: center;
75
76
  justify-content: center;
@@ -92,8 +93,8 @@
92
93
  matches nothing. Namespaced enough not to collide. */
93
94
  :global(.image-block-img) {
94
95
  display: block;
95
- max-width: 100%;
96
- max-height: 400px;
96
+ width: 100%;
97
+ height: 100%;
97
98
  object-fit: contain;
98
99
  }
99
100
 
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { onMount, onDestroy } from 'svelte';
3
- import { Editor } from '@tiptap/core';
3
+ import { Editor, getSchema } from '@tiptap/core';
4
4
  import { StarterKit } from '@tiptap/starter-kit';
5
5
  import Link from '@tiptap/extension-link';
6
6
  import Underline from '@tiptap/extension-underline';
@@ -76,6 +76,15 @@
76
76
  let element = $state<HTMLElement>();
77
77
  let editor = $state<Editor | null>(null);
78
78
  let editorState = $state(0);
79
+ // Stored content this field's current config can't represent. TipTap's answer
80
+ // is to open an empty document with only a console warning, and the first
81
+ // keystroke would then autosave that over the real draft (aphex #334).
82
+ let contentBlocked = $state(false);
83
+
84
+ function reportBlockedContent(cause: unknown) {
85
+ contentBlocked = true;
86
+ console.error(`[RichtextField] "${field.name}" holds content its config can't show`, cause);
87
+ }
79
88
  let internalVersion = 0;
80
89
  let isSyncingFromParent = false;
81
90
 
@@ -501,7 +510,12 @@
501
510
  })
502
511
  ]
503
512
  : []),
504
- ...(hasCustomTypes
513
+ // Images are inserted as a `portableTextObject` node too (see
514
+ // handleInsertImageBlock), so the node type must exist whenever the field
515
+ // offers images — not only when it has *other* custom object types. Without
516
+ // this a `block + image` field shows the image button but throws
517
+ // "Unknown node type: portableTextObject" on insert.
518
+ ...(hasCustomTypes || hasImageBlock
505
519
  ? [
506
520
  PortableTextObject.configure({
507
521
  onEdit: handleEditBlock,
@@ -529,16 +543,24 @@
529
543
  lastSyncedVersion = 0;
530
544
  editorJustCreated = true;
531
545
  expanded = false;
546
+ contentBlocked = false;
547
+ let unreadable = false;
548
+ try {
549
+ getSchema(extensions).nodeFromJSON(tiptapDoc);
550
+ } catch (cause) {
551
+ unreadable = true;
552
+ reportBlockedContent(cause);
553
+ }
532
554
  editor = new Editor({
533
555
  element,
534
- editable: !readonly,
556
+ editable: !readonly && !unreadable,
535
557
  extensions,
536
558
  content: tiptapDoc,
537
559
  editorProps: {
538
560
  transformPastedHTML: sanitizePastedHTML
539
561
  },
540
562
  onUpdate: ({ editor: e }) => {
541
- if (isSyncingFromParent) return;
563
+ if (isSyncingFromParent || contentBlocked) return;
542
564
  internalVersion++;
543
565
  const json = e.getJSON();
544
566
  const pt = tiptapToPortableText(json);
@@ -687,7 +709,21 @@
687
709
  // "changed" for some docs (notably lists + links) — which triggers a destructive
688
710
  // replaceWith that resets the caret and makes links impossible to click. Round-tripping
689
711
  // the incoming doc through `nodeFromJSON().toJSON()` normalizes both sides identically.
690
- const incomingDoc = editor.state.schema.nodeFromJSON(tiptapDoc);
712
+ let incomingDoc;
713
+ try {
714
+ incomingDoc = editor.state.schema.nodeFromJSON(tiptapDoc);
715
+ } catch (cause) {
716
+ if (!contentBlocked) {
717
+ editor.setEditable(false, false);
718
+ reportBlockedContent(cause);
719
+ }
720
+ return;
721
+ }
722
+ // A readable value arrived (a restored version, say), so editing is safe again.
723
+ if (contentBlocked) {
724
+ contentBlocked = false;
725
+ editor.setEditable(!readonly, false);
726
+ }
691
727
  if (
692
728
  JSON.stringify(stripVolatileMarks(incomingDoc.toJSON())) ===
693
729
  JSON.stringify(stripVolatileMarks(editor.getJSON()))
@@ -954,7 +990,7 @@
954
990
  ? `position: fixed; top: ${containerBounds.top}px; left: ${containerBounds.left}px; width: ${containerBounds.width}px; height: ${containerBounds.height}px; z-index: 50;`
955
991
  : ''}
956
992
  >
957
- {#if editor && !readonly}
993
+ {#if editor && !readonly && !contentBlocked}
958
994
  <!-- svelte-ignore a11y_no_static_element_interactions -->
959
995
  <Tooltip.Provider>
960
996
  <!--
@@ -1194,7 +1230,18 @@
1194
1230
  </Tooltip.Provider>
1195
1231
  {/if}
1196
1232
 
1197
- <div bind:this={element} class="richtext-content"></div>
1233
+ {#if contentBlocked}
1234
+ <div role="alert" class="text-destructive p-3 text-sm">
1235
+ This text can't be shown because this field's settings changed after it was written. Your
1236
+ saved text is safe, and editing is locked here so it can't be overwritten. Please ask your web
1237
+ team to look at it.
1238
+ </div>
1239
+ {/if}
1240
+ <div
1241
+ bind:this={element}
1242
+ class="richtext-content"
1243
+ style:display={contentBlocked ? 'none' : undefined}
1244
+ ></div>
1198
1245
 
1199
1246
  {#if linkMode === 'preview'}
1200
1247
  <div
@@ -1 +1 @@
1
- {"version":3,"file":"RichtextField.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/admin/fields/richtext/RichtextField.svelte.ts"],"names":[],"mappings":"AA4BA,OAAO,EAGL,KAAK,iBAAiB,EACtB,MAAM,4BAA4B,CAAC;AASrC,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAc,MAAM,2BAA2B,CAAC;AAYzF,UAAU,KAAK;IACd,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5C,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AAgpCF,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"RichtextField.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/admin/fields/richtext/RichtextField.svelte.ts"],"names":[],"mappings":"AA4BA,OAAO,EAGL,KAAK,iBAAiB,EACtB,MAAM,4BAA4B,CAAC;AASrC,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAc,MAAM,2BAA2B,CAAC;AAYzF,UAAU,KAAK;IACd,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5C,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AA2rCF,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -87,12 +87,12 @@
87
87
  <Settings class="mr-2 h-4 w-4" />
88
88
  <span>Account Settings</span>
89
89
  </DropdownMenuItem>
90
- <DropdownMenuItem class="cursor-pointer" onclick={() => goto('/invitations')}>
90
+ <DropdownMenuItem class="cursor-pointer" onclick={() => goto('/admin/invitations')}>
91
91
  <Mail class="mr-2 h-4 w-4" />
92
92
  <span>Invitations</span>
93
93
  </DropdownMenuItem>
94
94
  {#if user.role === 'super_admin'}
95
- <DropdownMenuItem class="cursor-pointer" onclick={() => goto('/god-mode')}>
95
+ <DropdownMenuItem class="cursor-pointer" onclick={() => goto('/admin/god-mode')}>
96
96
  <Shield class="mr-2 h-4 w-4" />
97
97
  <span>God Mode</span>
98
98
  </DropdownMenuItem>
package/dist/config.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- import type { CMSConfig } from './types/index.js';
1
+ import type { CMSConfig, CMSConfigInput } from './types/index.js';
2
2
  export declare function createCMSConfig(config: CMSConfig): CMSConfig;
3
+ export declare function createCMSConfig(config: CMSConfigInput): CMSConfigInput;
3
4
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/lib/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK/C,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CAuC5D"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/lib/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAO/D,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;AAC9D,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAAC"}