@prenta/admin 2.14.0 → 2.14.2
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.
- package/CHANGELOG.md +12 -0
- package/design-system/tokens.css +17 -2
- package/design-system/tokens.json +37 -2
- package/design-system/tokens.scss +11 -2
- package/design-system/tokens.tailwind.cjs +1 -0
- package/dist/__tests__/styles/qa-contrast.test.js +16 -9
- package/dist/__tests__/styles/qa-contrast.test.js.map +1 -1
- package/dist/__tests__/views/form-editor.render.test.js +20 -0
- package/dist/__tests__/views/form-editor.render.test.js.map +1 -1
- package/dist/__tests__/views/inbox-format.test.js +1 -1
- package/dist/__tests__/views/inbox-format.test.js.map +1 -1
- package/dist/components/CoauthorResultPopover.js +1 -1
- package/dist/components/CoauthorResultPopover.js.map +1 -1
- package/dist/components/CommentSidePanel.js +3 -3
- package/dist/components/CommentSidePanel.js.map +1 -1
- package/dist/components/forms/BlocklistDialog.d.ts.map +1 -1
- package/dist/components/forms/BlocklistDialog.js +2 -1
- package/dist/components/forms/BlocklistDialog.js.map +1 -1
- package/dist/components/forms/FormsListTable.d.ts.map +1 -1
- package/dist/components/forms/FormsListTable.js +6 -2
- package/dist/components/forms/FormsListTable.js.map +1 -1
- package/dist/components/forms/primitives.js +1 -1
- package/dist/components/seo/primitives.js +1 -1
- package/dist/components/ui/AuthorAvatar.js +1 -1
- package/dist/components/ui/AuthorAvatar.js.map +1 -1
- package/dist/components/ui/EmptyState.js +1 -1
- package/dist/components/ui/UnderlineTabs.d.ts +3 -1
- package/dist/components/ui/UnderlineTabs.d.ts.map +1 -1
- package/dist/components/ui/UnderlineTabs.js +6 -4
- package/dist/components/ui/UnderlineTabs.js.map +1 -1
- package/dist/prenta-admin.css +1 -1
- package/dist/views/FormEditor.d.ts.map +1 -1
- package/dist/views/FormEditor.js +18 -14
- package/dist/views/FormEditor.js.map +1 -1
- package/dist/views/Forms.d.ts.map +1 -1
- package/dist/views/Forms.js +2 -1
- package/dist/views/Forms.js.map +1 -1
- package/dist/views/FormsSettings.d.ts.map +1 -1
- package/dist/views/FormsSettings.js +23 -14
- package/dist/views/FormsSettings.js.map +1 -1
- package/dist/views/Login.d.ts.map +1 -1
- package/dist/views/Login.js +3 -3
- package/dist/views/Login.js.map +1 -1
- package/dist/views/MediaBrowser.js +2 -2
- package/dist/views/ResetPassword.js +1 -1
- package/dist/views/ResetPassword.js.map +1 -1
- package/dist/views/SetupWizard.js +1 -1
- package/dist/views/SetupWizard.js.map +1 -1
- package/dist/views/Users.d.ts.map +1 -1
- package/dist/views/Users.js +8 -27
- package/dist/views/Users.js.map +1 -1
- package/dist/views/entries/EntriesInbox.js +6 -6
- package/dist/views/entries/EntriesInbox.js.map +1 -1
- package/dist/views/entries/inbox-format.d.ts +1 -1
- package/dist/views/entries/inbox-format.d.ts.map +1 -1
- package/dist/views/entries/inbox-format.js +3 -4
- package/dist/views/entries/inbox-format.js.map +1 -1
- package/dist/views/page-editor/sections/SectionRenderer.js +1 -1
- package/dist/views/page-editor/sections/SectionRenderer.js.map +1 -1
- package/dist/views/settings/BrandVoiceCard.d.ts.map +1 -1
- package/dist/views/settings/BrandVoiceCard.js +1 -1
- package/dist/views/settings/BrandVoiceCard.js.map +1 -1
- package/dist/views/settings/UpdatesTab.js +1 -1
- package/dist/views/settings/UpdatesTab.js.map +1 -1
- package/dist/views/settings/brand-voice/BrandVoiceRulesSections.d.ts.map +1 -1
- package/dist/views/settings/brand-voice/BrandVoiceRulesSections.js +5 -4
- package/dist/views/settings/brand-voice/BrandVoiceRulesSections.js.map +1 -1
- package/package.json +5 -5
- package/src/__tests__/styles/qa-contrast.test.ts +30 -8
- package/src/__tests__/views/form-editor.render.test.tsx +25 -0
- package/src/__tests__/views/inbox-format.test.ts +1 -1
- package/src/components/CoauthorResultPopover.tsx +1 -1
- package/src/components/CommentSidePanel.tsx +3 -3
- package/src/components/forms/BlocklistDialog.tsx +3 -2
- package/src/components/forms/FormsListTable.tsx +9 -3
- package/src/components/forms/primitives.tsx +1 -1
- package/src/components/seo/primitives.tsx +1 -1
- package/src/components/ui/AuthorAvatar.tsx +1 -1
- package/src/components/ui/EmptyState.tsx +1 -1
- package/src/components/ui/UnderlineTabs.tsx +14 -2
- package/src/styles/prenta-tokens.css +17 -2
- package/src/views/FormEditor.tsx +126 -100
- package/src/views/Forms.tsx +3 -3
- package/src/views/FormsSettings.tsx +48 -15
- package/src/views/Login.tsx +5 -4
- package/src/views/MediaBrowser.tsx +4 -4
- package/src/views/ResetPassword.tsx +2 -2
- package/src/views/SetupWizard.tsx +2 -2
- package/src/views/Users.tsx +21 -38
- package/src/views/entries/EntriesInbox.tsx +6 -6
- package/src/views/entries/inbox-format.ts +3 -6
- package/src/views/page-editor/sections/SectionRenderer.tsx +2 -2
- package/src/views/settings/BrandVoiceCard.tsx +1 -0
- package/src/views/settings/UpdatesTab.tsx +1 -1
- package/src/views/settings/brand-voice/BrandVoiceRulesSections.tsx +26 -4
|
@@ -87,6 +87,8 @@
|
|
|
87
87
|
--tag-gray-soft: #f1f5f9;
|
|
88
88
|
|
|
89
89
|
/* Avatars */
|
|
90
|
+
/* Text on fixed avatar fills. Unlike --on-acc, stays light in every theme. */
|
|
91
|
+
--on-avatar: #ffffff;
|
|
90
92
|
--avatar-1: #2f5bea;
|
|
91
93
|
--avatar-2: #0e7490;
|
|
92
94
|
--avatar-3: #047857;
|
|
@@ -135,7 +137,11 @@
|
|
|
135
137
|
--site-bg: #ffffff;
|
|
136
138
|
--site-txt: #16181d;
|
|
137
139
|
--site-sub: #50555f;
|
|
138
|
-
|
|
140
|
+
/*
|
|
141
|
+
* Muted preview text: clears 4.5:1 on site-bg and site-alt. Handoff value:
|
|
142
|
+
* #8a8f99 — deliberately overridden.
|
|
143
|
+
*/
|
|
144
|
+
--site-muted: #676c76;
|
|
139
145
|
--site-bdr: #e3e5ea;
|
|
140
146
|
--site-alt: #f4f5f7;
|
|
141
147
|
--site-alt2: #eef0f3;
|
|
@@ -185,6 +191,11 @@
|
|
|
185
191
|
--fs-label: 10px; /* Sidebar section labels */
|
|
186
192
|
|
|
187
193
|
/* Layout */
|
|
194
|
+
--forms-card-icon: 34px; /* Form Settings SPEC section 1 card icon tile */
|
|
195
|
+
--forms-settings-width: 836px; /* Form Settings SPEC section 1, body including gutters */
|
|
196
|
+
--forms-settings-bottom: 120px; /* Form Settings SPEC section 1, save bar clearance */
|
|
197
|
+
/* Forms SPEC section 5: 820px content plus 24px padding on both sides */
|
|
198
|
+
--form-editor-settings-width: 868px;
|
|
188
199
|
--sbw: 224px; /* Sidebar expanded */
|
|
189
200
|
--sbw-col: 60px; /* Sidebar collapsed / tablet rail */
|
|
190
201
|
--tbh: 56px;
|
|
@@ -338,7 +349,11 @@
|
|
|
338
349
|
--tag-orange-soft: #431407;
|
|
339
350
|
--tag-red: #fb7185;
|
|
340
351
|
--tag-red-soft: #4c0519;
|
|
341
|
-
|
|
352
|
+
/*
|
|
353
|
+
* Blue label text: clears 4.5:1 on tag-blue-soft in Graphite. Handoff value:
|
|
354
|
+
* #60a5fa — deliberately overridden.
|
|
355
|
+
*/
|
|
356
|
+
--tag-blue: #93c5fd;
|
|
342
357
|
--tag-blue-soft: #1e3a8a;
|
|
343
358
|
--tag-pink: #f472b6;
|
|
344
359
|
--tag-pink-soft: #500724;
|
package/src/views/FormEditor.tsx
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
* routes into this editor so notifications/embed/webhooks — which need a form
|
|
21
21
|
* id — are one click away.
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import { UnderlineTabs, UnderlineTabPanel } from '../components/ui/UnderlineTabs.js'
|
|
24
|
+
import { Button } from '../components/ui/Button.js'
|
|
24
25
|
import {
|
|
25
26
|
ArrowLeft,
|
|
26
27
|
Check,
|
|
@@ -31,6 +32,11 @@ import {
|
|
|
31
32
|
Loader2,
|
|
32
33
|
MessageSquare,
|
|
33
34
|
Save,
|
|
35
|
+
Settings2,
|
|
36
|
+
Shield,
|
|
37
|
+
Mail,
|
|
38
|
+
Webhook,
|
|
39
|
+
ChartNoAxesCombined,
|
|
34
40
|
} from 'lucide-react'
|
|
35
41
|
import { useCallback, useEffect, useState } from 'react'
|
|
36
42
|
import { toast } from 'sonner'
|
|
@@ -65,13 +71,13 @@ const inputCls =
|
|
|
65
71
|
'border-border bg-input-background text-foreground focus-visible:ring-ring w-full rounded-lg border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:outline-none'
|
|
66
72
|
|
|
67
73
|
const TABS = [
|
|
68
|
-
{ id: 'general', label: 'General' },
|
|
69
|
-
{ id: 'confirmations', label: 'Confirmations' },
|
|
70
|
-
{ id: 'spam', label: 'Spam protection' },
|
|
71
|
-
{ id: 'notifications', label: 'Notifications' },
|
|
72
|
-
{ id: 'webhooks', label: 'Webhooks' },
|
|
73
|
-
{ id: 'analytics', label: 'Analytics' },
|
|
74
|
-
{ id: 'embed', label: 'Embed' },
|
|
74
|
+
{ id: 'general', icon: Settings2, label: 'General' },
|
|
75
|
+
{ id: 'confirmations', icon: Check, label: 'Confirmations' },
|
|
76
|
+
{ id: 'spam', icon: Shield, label: 'Spam protection' },
|
|
77
|
+
{ id: 'notifications', icon: Mail, label: 'Notifications' },
|
|
78
|
+
{ id: 'webhooks', icon: Webhook, label: 'Webhooks' },
|
|
79
|
+
{ id: 'analytics', icon: ChartNoAxesCombined, label: 'Analytics' },
|
|
80
|
+
{ id: 'embed', icon: Code2, label: 'Embed' },
|
|
75
81
|
] as const
|
|
76
82
|
|
|
77
83
|
interface DetailsState {
|
|
@@ -256,8 +262,8 @@ function ExistingFormEditor({
|
|
|
256
262
|
}
|
|
257
263
|
|
|
258
264
|
return (
|
|
259
|
-
<div className="bg-bg flex h-full min-h-0 flex-col">
|
|
260
|
-
<header className="border-bdr bg-sb flex h-[60px] shrink-0 items-center gap-3.5 border-b pr-4 pl-6">
|
|
265
|
+
<div className="bg-bg @container/form-editor relative flex h-full min-h-0 flex-col overflow-hidden">
|
|
266
|
+
<header className="border-bdr bg-sb flex min-h-[60px] shrink-0 items-center gap-3.5 border-b pr-4 pl-6 @max-[640px]/form-editor:flex-wrap @max-[640px]/form-editor:gap-2 @max-[640px]/form-editor:p-3">
|
|
261
267
|
<button
|
|
262
268
|
type="button"
|
|
263
269
|
onClick={() => onNavigate?.('/forms')}
|
|
@@ -291,7 +297,7 @@ function ExistingFormEditor({
|
|
|
291
297
|
Settings
|
|
292
298
|
</button>
|
|
293
299
|
</div>
|
|
294
|
-
<div className="flex flex-1 items-center justify-end gap-1.5">
|
|
300
|
+
<div className="flex flex-1 items-center justify-end gap-1.5 @max-[640px]/form-editor:basis-full">
|
|
295
301
|
{fieldsDirty || detailsDirty ? (
|
|
296
302
|
<span className="text-warn text-[12px] font-semibold">
|
|
297
303
|
{(fieldsDirty ? 1 : 0) + (detailsDirty ? 1 : 0)} unsaved
|
|
@@ -329,9 +335,8 @@ function ExistingFormEditor({
|
|
|
329
335
|
>
|
|
330
336
|
<Code2 size={15} aria-hidden />
|
|
331
337
|
</button>
|
|
332
|
-
<
|
|
338
|
+
<Button
|
|
333
339
|
type="button"
|
|
334
|
-
className={btnPrimary}
|
|
335
340
|
disabled={
|
|
336
341
|
tab === 'build'
|
|
337
342
|
? savingFields || !fieldsDirty
|
|
@@ -351,7 +356,7 @@ function ExistingFormEditor({
|
|
|
351
356
|
<Check size={15} aria-hidden />
|
|
352
357
|
)}
|
|
353
358
|
Save
|
|
354
|
-
</
|
|
359
|
+
</Button>
|
|
355
360
|
</div>
|
|
356
361
|
</header>
|
|
357
362
|
{tab === 'build' ? (
|
|
@@ -366,88 +371,109 @@ function ExistingFormEditor({
|
|
|
366
371
|
}}
|
|
367
372
|
/>
|
|
368
373
|
) : (
|
|
369
|
-
<div className="min-h-0 flex-1
|
|
370
|
-
<
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
<Tabs.Content value="confirmations" tabIndex={-1}>
|
|
398
|
-
<DetailsTab
|
|
399
|
-
part="confirmations"
|
|
400
|
-
details={details}
|
|
401
|
-
onPatch={patchDetails}
|
|
402
|
-
onSave={() => void saveDetails()}
|
|
403
|
-
saving={savingDetails}
|
|
404
|
-
/>
|
|
405
|
-
</Tabs.Content>
|
|
374
|
+
<div className="flex min-h-0 flex-1 flex-col">
|
|
375
|
+
<UnderlineTabs
|
|
376
|
+
idBase="form-editor-settings"
|
|
377
|
+
label="Form settings sections"
|
|
378
|
+
value={tab}
|
|
379
|
+
onChange={setTab}
|
|
380
|
+
collapseInactiveLabels
|
|
381
|
+
className="bg-sb px-6 @max-[640px]/form-editor:px-3"
|
|
382
|
+
tabs={TABS.map(({ icon: Icon, ...item }) => ({
|
|
383
|
+
...item,
|
|
384
|
+
icon: <Icon strokeWidth={1.75} />,
|
|
385
|
+
}))}
|
|
386
|
+
/>
|
|
387
|
+
<div className="relative min-h-0 flex-1 overflow-y-auto">
|
|
388
|
+
<div className="mx-auto w-full max-w-[var(--form-editor-settings-width)] p-6 @max-[640px]/form-editor:p-4">
|
|
389
|
+
{tab === 'general' && (
|
|
390
|
+
<UnderlineTabPanel idBase="form-editor-settings" tabId="general" tabIndex={-1}>
|
|
391
|
+
<DetailsTab
|
|
392
|
+
part="general"
|
|
393
|
+
stepCount={fields.filter((f) => f.type === 'pagebreak').length + 1}
|
|
394
|
+
details={details}
|
|
395
|
+
onPatch={patchDetails}
|
|
396
|
+
onSave={() => void saveDetails()}
|
|
397
|
+
saving={savingDetails}
|
|
398
|
+
/>
|
|
399
|
+
</UnderlineTabPanel>
|
|
400
|
+
)}
|
|
406
401
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
402
|
+
{tab === 'confirmations' && (
|
|
403
|
+
<UnderlineTabPanel
|
|
404
|
+
idBase="form-editor-settings"
|
|
405
|
+
tabId="confirmations"
|
|
406
|
+
tabIndex={-1}
|
|
407
|
+
>
|
|
408
|
+
<DetailsTab
|
|
409
|
+
part="confirmations"
|
|
410
|
+
details={details}
|
|
411
|
+
onPatch={patchDetails}
|
|
412
|
+
onSave={() => void saveDetails()}
|
|
413
|
+
saving={savingDetails}
|
|
414
|
+
/>
|
|
415
|
+
</UnderlineTabPanel>
|
|
416
|
+
)}
|
|
421
417
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
<Tabs.Content value="spam" tabIndex={-1}>
|
|
429
|
-
<div className="border-border bg-card space-y-3 rounded-lg border p-4">
|
|
430
|
-
<h2 className="text-foreground text-base font-medium">Spam protection</h2>
|
|
431
|
-
<p className="text-muted-foreground text-sm">
|
|
432
|
-
Override your global form settings for this form only. Site-wide rules are in Form
|
|
433
|
-
settings.
|
|
434
|
-
</p>
|
|
435
|
-
<button
|
|
436
|
-
type="button"
|
|
437
|
-
className={btnSecondary}
|
|
438
|
-
onClick={() => onNavigate?.('/forms/settings/spam')}
|
|
418
|
+
{tab === 'notifications' && (
|
|
419
|
+
<UnderlineTabPanel
|
|
420
|
+
idBase="form-editor-settings"
|
|
421
|
+
tabId="notifications"
|
|
422
|
+
tabIndex={-1}
|
|
439
423
|
>
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
424
|
+
<div className="border-bdr bg-card rounded-12 shadow-shd border p-5">
|
|
425
|
+
<NotificationsPanel formId={formId} fields={fields} />
|
|
426
|
+
</div>
|
|
427
|
+
</UnderlineTabPanel>
|
|
428
|
+
)}
|
|
444
429
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
430
|
+
{tab === 'analytics' && (
|
|
431
|
+
<UnderlineTabPanel idBase="form-editor-settings" tabId="analytics" tabIndex={-1}>
|
|
432
|
+
<AnalyticsTab
|
|
433
|
+
analytics={analytics}
|
|
434
|
+
onPatch={patchAnalytics}
|
|
435
|
+
onSave={() => void saveAnalytics()}
|
|
436
|
+
saving={savingAnalytics}
|
|
437
|
+
/>
|
|
438
|
+
</UnderlineTabPanel>
|
|
439
|
+
)}
|
|
440
|
+
|
|
441
|
+
{tab === 'embed' && (
|
|
442
|
+
<UnderlineTabPanel idBase="form-editor-settings" tabId="embed" tabIndex={-1}>
|
|
443
|
+
<div className="border-bdr bg-card rounded-12 shadow-shd border p-5">
|
|
444
|
+
<EmbedPanel formId={formId} slug={form.slug} status={form.status} />
|
|
445
|
+
</div>
|
|
446
|
+
</UnderlineTabPanel>
|
|
447
|
+
)}
|
|
448
|
+
|
|
449
|
+
{tab === 'spam' && (
|
|
450
|
+
<UnderlineTabPanel idBase="form-editor-settings" tabId="spam" tabIndex={-1}>
|
|
451
|
+
<div className="border-bdr bg-card rounded-12 shadow-shd space-y-3 border p-5">
|
|
452
|
+
<h2 className="text-foreground text-base font-medium">Spam protection</h2>
|
|
453
|
+
<p className="text-muted-foreground text-sm">
|
|
454
|
+
Override your global form settings for this form only. Site-wide rules are in
|
|
455
|
+
Form settings.
|
|
456
|
+
</p>
|
|
457
|
+
<button
|
|
458
|
+
type="button"
|
|
459
|
+
className={btnSecondary}
|
|
460
|
+
onClick={() => onNavigate?.('/forms/settings/spam')}
|
|
461
|
+
>
|
|
462
|
+
Open Form settings
|
|
463
|
+
</button>
|
|
464
|
+
</div>
|
|
465
|
+
</UnderlineTabPanel>
|
|
466
|
+
)}
|
|
467
|
+
|
|
468
|
+
{tab === 'webhooks' && (
|
|
469
|
+
<UnderlineTabPanel idBase="form-editor-settings" tabId="webhooks" tabIndex={-1}>
|
|
470
|
+
<div className="border-bdr bg-card rounded-12 shadow-shd border p-5">
|
|
471
|
+
<WebhooksPanel formId={formId} formSlug={form.slug} />
|
|
472
|
+
</div>
|
|
473
|
+
</UnderlineTabPanel>
|
|
474
|
+
)}
|
|
475
|
+
</div>
|
|
476
|
+
</div>
|
|
451
477
|
</div>
|
|
452
478
|
)}
|
|
453
479
|
</div>
|
|
@@ -474,12 +500,12 @@ function DetailsTab({
|
|
|
474
500
|
return (
|
|
475
501
|
<div className="space-y-4">
|
|
476
502
|
{part === 'general' ? (
|
|
477
|
-
<div className="border-
|
|
503
|
+
<div className="border-bdr bg-card rounded-12 shadow-shd border p-5">
|
|
478
504
|
<h2 className="text-foreground mb-1 text-base font-medium">General</h2>
|
|
479
505
|
<p className="text-muted-foreground mb-4 text-sm">
|
|
480
506
|
Name, status, and when the form accepts entries.
|
|
481
507
|
</p>
|
|
482
|
-
<div className="grid gap-4">
|
|
508
|
+
<div className="grid min-w-0 gap-4 @min-[641px]/form-editor:grid-cols-2">
|
|
483
509
|
<Field label="Form Name" hint="Only your team sees this.">
|
|
484
510
|
<input
|
|
485
511
|
type="text"
|
|
@@ -502,7 +528,7 @@ function DetailsTab({
|
|
|
502
528
|
<select
|
|
503
529
|
value={details.status}
|
|
504
530
|
onChange={(e) => onPatch({ status: e.target.value as FormStatus })}
|
|
505
|
-
className="border-border bg-input-background text-foreground focus-visible:ring-ring rounded-lg border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:outline-none"
|
|
531
|
+
className="border-border bg-input-background text-foreground focus-visible:ring-ring w-full min-w-0 rounded-lg border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:outline-none"
|
|
506
532
|
>
|
|
507
533
|
<option value="active">Active: accepting entries</option>
|
|
508
534
|
<option value="draft">Draft: not live yet</option>
|
|
@@ -523,14 +549,14 @@ function DetailsTab({
|
|
|
523
549
|
</div>
|
|
524
550
|
) : null}
|
|
525
551
|
{part === 'general' ? (
|
|
526
|
-
<div className="border-
|
|
552
|
+
<div className="border-bdr bg-card rounded-12 shadow-shd border p-5">
|
|
527
553
|
<h2 className="text-foreground mb-1 text-base font-medium">Steps</h2>
|
|
528
554
|
<p className="text-muted-foreground mb-4 text-sm">
|
|
529
555
|
{stepCount > 1
|
|
530
556
|
? `This form has ${stepCount} steps.`
|
|
531
557
|
: 'Add a Page break in Build to split it into steps.'}
|
|
532
558
|
</p>
|
|
533
|
-
<div className="grid gap-4">
|
|
559
|
+
<div className="grid min-w-0 gap-4 @min-[641px]/form-editor:grid-cols-2">
|
|
534
560
|
<Field label="First step title">
|
|
535
561
|
<input
|
|
536
562
|
type="text"
|
|
@@ -545,7 +571,7 @@ function DetailsTab({
|
|
|
545
571
|
<select
|
|
546
572
|
value={details.progress}
|
|
547
573
|
onChange={(e) => onPatch({ progress: e.target.value as DetailsState['progress'] })}
|
|
548
|
-
className="border-border bg-input-background text-foreground focus-visible:ring-ring rounded-lg border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:outline-none"
|
|
574
|
+
className="border-border bg-input-background text-foreground focus-visible:ring-ring w-full min-w-0 rounded-lg border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:outline-none"
|
|
549
575
|
>
|
|
550
576
|
<option value="steps">Numbered steps</option>
|
|
551
577
|
<option value="bar">Progress bar</option>
|
|
@@ -555,7 +581,7 @@ function DetailsTab({
|
|
|
555
581
|
</div>
|
|
556
582
|
</div>
|
|
557
583
|
) : (
|
|
558
|
-
<div className="border-
|
|
584
|
+
<div className="border-bdr bg-card rounded-12 shadow-shd border p-5">
|
|
559
585
|
<h2 className="text-foreground mb-1 text-base font-medium">Confirmations</h2>
|
|
560
586
|
<p className="text-muted-foreground mb-4 text-sm">What people see after they submit.</p>
|
|
561
587
|
<fieldset className="mb-4">
|
|
@@ -655,7 +681,7 @@ function AnalyticsTab({
|
|
|
655
681
|
}) {
|
|
656
682
|
return (
|
|
657
683
|
<div className="space-y-4">
|
|
658
|
-
<div className="border-
|
|
684
|
+
<div className="border-bdr bg-card rounded-12 shadow-shd border p-5">
|
|
659
685
|
<div className="flex items-center justify-between gap-3">
|
|
660
686
|
<span className="min-w-0">
|
|
661
687
|
<span className="text-foreground block text-sm font-medium">
|
package/src/views/Forms.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import { adminPortalContainer } from '../lib/portal-container.js'
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* Forms list (`/forms`, kit `Forms.html`, SPEC §1): summary chips, search,
|
|
5
7
|
* status segments with counts, a sort select, and the `.fl` row list. The
|
|
@@ -414,9 +416,7 @@ function NewFormDialog({
|
|
|
414
416
|
|
|
415
417
|
return (
|
|
416
418
|
<Dialog.Root open={open} onOpenChange={(next) => !next && onClose()}>
|
|
417
|
-
<Dialog.Portal>
|
|
418
|
-
{/* Portals render outside .prenta-admin, where --scrim/--txt are
|
|
419
|
-
undefined; same bg-black/50 as the shared Modal primitive. */}
|
|
419
|
+
<Dialog.Portal container={adminPortalContainer()}>
|
|
420
420
|
<Dialog.Overlay className="fixed inset-0 z-[300] bg-black/50" />
|
|
421
421
|
<Dialog.Content className="border-bdr bg-card text-txt shadow-shd2 fixed top-1/2 left-1/2 z-[301] w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 rounded-[14px] border p-5">
|
|
422
422
|
<div className="mb-4 flex items-start justify-between gap-3">
|
|
@@ -300,8 +300,8 @@ export function FormsSettings({
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
return (
|
|
303
|
-
<div className="flex h-full min-h-0 flex-col overflow-x-hidden overflow-y-auto">
|
|
304
|
-
<header className="px-
|
|
303
|
+
<div className="@container/forms-settings relative flex h-full min-h-0 flex-col overflow-x-hidden overflow-y-auto">
|
|
304
|
+
<header className="px-gut shrink-0 pt-5">
|
|
305
305
|
<Breadcrumb items={[{ label: 'Forms', path: '/forms' }, { label: 'Settings' }]} />
|
|
306
306
|
<h1 className="text-txt m-0 mt-2 text-[21px] font-bold tracking-[-0.5px]">Form settings</h1>
|
|
307
307
|
<p className="text-sub mt-1 max-w-[620px] text-[13px]">
|
|
@@ -310,7 +310,9 @@ export function FormsSettings({
|
|
|
310
310
|
</p>
|
|
311
311
|
</header>
|
|
312
312
|
<UnderlineTabs
|
|
313
|
-
className="mx-
|
|
313
|
+
className="mx-gut mt-4"
|
|
314
|
+
collapseInactiveLabels
|
|
315
|
+
idBase="forms-settings"
|
|
314
316
|
label="Form settings tabs"
|
|
315
317
|
value={tab}
|
|
316
318
|
onChange={(id) => go(id as TabId)}
|
|
@@ -331,7 +333,12 @@ export function FormsSettings({
|
|
|
331
333
|
}
|
|
332
334
|
})}
|
|
333
335
|
/>
|
|
334
|
-
<div
|
|
336
|
+
<div
|
|
337
|
+
role="tabpanel"
|
|
338
|
+
id={`forms-settings-panel-${tab}`}
|
|
339
|
+
aria-labelledby={`forms-settings-tab-${tab}`}
|
|
340
|
+
className="px-gut flex w-full max-w-[var(--forms-settings-width)] shrink-0 flex-col gap-4 py-5 pb-[var(--forms-settings-bottom)]"
|
|
341
|
+
>
|
|
335
342
|
{readOnly ? (
|
|
336
343
|
<p className="border-bdr bg-card text-sub flex items-center gap-2.5 rounded-[10px] border px-3.5 py-2.5 text-[13px]">
|
|
337
344
|
<Lock size={16} className="text-faint shrink-0" aria-hidden />
|
|
@@ -343,6 +350,7 @@ export function FormsSettings({
|
|
|
343
350
|
<>
|
|
344
351
|
<Card
|
|
345
352
|
title="Spam protection"
|
|
353
|
+
icon={<Shield size={18} strokeWidth={1.75} aria-hidden />}
|
|
346
354
|
description="Checks run on every submission before it reaches your inbox."
|
|
347
355
|
>
|
|
348
356
|
<Row
|
|
@@ -492,6 +500,7 @@ export function FormsSettings({
|
|
|
492
500
|
</Card>
|
|
493
501
|
<Card
|
|
494
502
|
title="AI spam review"
|
|
503
|
+
icon={<Shield size={18} strokeWidth={1.75} aria-hidden />}
|
|
495
504
|
description="Reads entries that get past the checks above and moves likely spam to the Spam folder. It never deletes anything."
|
|
496
505
|
>
|
|
497
506
|
<p
|
|
@@ -515,7 +524,10 @@ export function FormsSettings({
|
|
|
515
524
|
<Toggle
|
|
516
525
|
checked={draft.spam.ai.on}
|
|
517
526
|
onCheckedChange={(on) =>
|
|
518
|
-
setDraft({
|
|
527
|
+
setDraft({
|
|
528
|
+
...draft,
|
|
529
|
+
spam: { ...draft.spam, ai: { ...draft.spam.ai, on } },
|
|
530
|
+
})
|
|
519
531
|
}
|
|
520
532
|
aria-label="Review entries with AI"
|
|
521
533
|
/>
|
|
@@ -539,7 +551,10 @@ export function FormsSettings({
|
|
|
539
551
|
onClick={() =>
|
|
540
552
|
setDraft({
|
|
541
553
|
...draft,
|
|
542
|
-
spam: {
|
|
554
|
+
spam: {
|
|
555
|
+
...draft.spam,
|
|
556
|
+
ai: { ...draft.spam.ai, strictness: level },
|
|
557
|
+
},
|
|
543
558
|
})
|
|
544
559
|
}
|
|
545
560
|
className={`rounded-[7px] px-2.5 py-[5px] text-[12.5px] font-medium capitalize ${draft.spam.ai.strictness === level ? 'bg-card text-txt shadow-shd' : 'text-sub'}`}
|
|
@@ -586,6 +601,7 @@ export function FormsSettings({
|
|
|
586
601
|
{tab === 'defaults' ? (
|
|
587
602
|
<Card
|
|
588
603
|
title="Defaults for new forms"
|
|
604
|
+
icon={<FileText size={18} strokeWidth={1.75} aria-hidden />}
|
|
589
605
|
description="Starting values when someone creates a form. Each form can change them afterwards."
|
|
590
606
|
>
|
|
591
607
|
<Row label="Notify these addresses" help="Who gets an email for each new submission.">
|
|
@@ -659,6 +675,7 @@ export function FormsSettings({
|
|
|
659
675
|
{tab === 'retention' ? (
|
|
660
676
|
<Card
|
|
661
677
|
title="Data retention"
|
|
678
|
+
icon={<Clock size={18} strokeWidth={1.75} aria-hidden />}
|
|
662
679
|
description="How long submissions and logs are kept before they're permanently deleted."
|
|
663
680
|
>
|
|
664
681
|
{RETENTION_APPLIED ? null : (
|
|
@@ -796,7 +813,10 @@ export function FormsSettings({
|
|
|
796
813
|
<Toggle
|
|
797
814
|
checked={draft.retention.deleteFilesWithEntry}
|
|
798
815
|
onCheckedChange={(deleteFilesWithEntry) =>
|
|
799
|
-
setDraft({
|
|
816
|
+
setDraft({
|
|
817
|
+
...draft,
|
|
818
|
+
retention: { ...draft.retention, deleteFilesWithEntry },
|
|
819
|
+
})
|
|
800
820
|
}
|
|
801
821
|
aria-label="Delete uploaded files with their entry"
|
|
802
822
|
/>
|
|
@@ -900,6 +920,7 @@ function EmailDelivery({
|
|
|
900
920
|
return (
|
|
901
921
|
<Card
|
|
902
922
|
title="Email delivery"
|
|
923
|
+
icon={<Mail size={18} strokeWidth={1.75} aria-hidden />}
|
|
903
924
|
description="The account that sends notifications and confirmation emails. Shared with invites and password resets."
|
|
904
925
|
>
|
|
905
926
|
{email?.configured ? (
|
|
@@ -1006,7 +1027,7 @@ function SettingsSaveBar({
|
|
|
1006
1027
|
role={state === 'error' ? 'alert' : 'region'}
|
|
1007
1028
|
aria-label="Unsaved changes"
|
|
1008
1029
|
aria-live="polite"
|
|
1009
|
-
className={`rounded-12 sticky bottom-4 z-[var(--z-bar)] ml-auto flex w-[min(560px,calc(100%-
|
|
1030
|
+
className={`rounded-12 sticky bottom-4 z-[var(--z-bar)] ml-auto flex w-[min(560px,calc(100%-2*var(--gut)))] items-center gap-2.5 py-2.5 pr-2.5 pl-4 text-[13px] font-[550] shadow-[0_10px_30px_rgba(0,0,0,0.22)] ${tone}`}
|
|
1010
1031
|
>
|
|
1011
1032
|
<span className="flex min-w-0 flex-1 items-center gap-2">
|
|
1012
1033
|
{state === 'saved' ? <Check size={16} aria-hidden /> : null}
|
|
@@ -1060,6 +1081,7 @@ function AttributionTab({
|
|
|
1060
1081
|
<>
|
|
1061
1082
|
<Card
|
|
1062
1083
|
title="Capture"
|
|
1084
|
+
icon={<Target size={18} strokeWidth={1.75} aria-hidden />}
|
|
1063
1085
|
description="Record where each visitor came from and attach it to their submission. Works on every form automatically."
|
|
1064
1086
|
>
|
|
1065
1087
|
<AttributionStatus
|
|
@@ -1096,6 +1118,7 @@ function AttributionTab({
|
|
|
1096
1118
|
</Card>
|
|
1097
1119
|
<Card
|
|
1098
1120
|
title="Memory"
|
|
1121
|
+
icon={<Clock size={18} strokeWidth={1.75} aria-hidden />}
|
|
1099
1122
|
description="How long a visit is remembered on the visitor's device before it stops counting."
|
|
1100
1123
|
>
|
|
1101
1124
|
<WindowRow
|
|
@@ -1132,6 +1155,7 @@ function AttributionTab({
|
|
|
1132
1155
|
</Card>
|
|
1133
1156
|
<Card
|
|
1134
1157
|
title="Fields on every submission"
|
|
1158
|
+
icon={<FileText size={18} strokeWidth={1.75} aria-hidden />}
|
|
1135
1159
|
description="Read only. These are the names used in entry details, exports, notification emails, and webhooks."
|
|
1136
1160
|
>
|
|
1137
1161
|
<div className="flex flex-col gap-3.5 px-5 pt-1.5 pb-4">
|
|
@@ -1556,10 +1580,12 @@ function RecaptchaKeys({
|
|
|
1556
1580
|
}
|
|
1557
1581
|
|
|
1558
1582
|
function Card({
|
|
1583
|
+
icon,
|
|
1559
1584
|
title,
|
|
1560
1585
|
description,
|
|
1561
1586
|
children,
|
|
1562
1587
|
}: {
|
|
1588
|
+
icon: ReactNode
|
|
1563
1589
|
title: string
|
|
1564
1590
|
description: string
|
|
1565
1591
|
children: ReactNode
|
|
@@ -1570,11 +1596,16 @@ function Card({
|
|
|
1570
1596
|
aria-labelledby={id}
|
|
1571
1597
|
className="border-bdr bg-card shadow-shd overflow-hidden rounded-[12px] border"
|
|
1572
1598
|
>
|
|
1573
|
-
<header className="border-bdr border-b px-5 py-4">
|
|
1574
|
-
<
|
|
1575
|
-
{
|
|
1576
|
-
</
|
|
1577
|
-
<
|
|
1599
|
+
<header className="border-bdr flex items-start gap-3 border-b px-5 py-4">
|
|
1600
|
+
<span className="rounded-9 bg-acc-l text-acc flex h-[var(--forms-card-icon)] w-[var(--forms-card-icon)] shrink-0 items-center justify-center">
|
|
1601
|
+
{icon}
|
|
1602
|
+
</span>
|
|
1603
|
+
<div className="min-w-0">
|
|
1604
|
+
<h2 id={id} className="text-txt m-0 text-[15px] font-semibold">
|
|
1605
|
+
{title}
|
|
1606
|
+
</h2>
|
|
1607
|
+
<p className="text-sub text-sm2 m-0 mt-1">{description}</p>
|
|
1608
|
+
</div>
|
|
1578
1609
|
</header>
|
|
1579
1610
|
{children}
|
|
1580
1611
|
</section>
|
|
@@ -1583,12 +1614,14 @@ function Card({
|
|
|
1583
1614
|
|
|
1584
1615
|
function Row({ label, help, children }: { label: string; help?: string; children: ReactNode }) {
|
|
1585
1616
|
return (
|
|
1586
|
-
<div className="border-bdr grid items-center gap-5 border-b px-5 py-[15px] last:border-b-0
|
|
1617
|
+
<div className="border-bdr grid items-center gap-5 border-b px-5 py-[15px] last:border-b-0 @max-[640px]/forms-settings:gap-2.5 @min-[641px]/forms-settings:grid-cols-[minmax(0,1fr)_minmax(0,1.15fr)]">
|
|
1587
1618
|
<div>
|
|
1588
1619
|
<div className="text-txt text-[13px] font-semibold">{label}</div>
|
|
1589
1620
|
{help ? <p className="text-sub m-0 mt-1 text-[12px] leading-[1.45]">{help}</p> : null}
|
|
1590
1621
|
</div>
|
|
1591
|
-
<div className="flex flex-wrap items-center justify-end gap-2">
|
|
1622
|
+
<div className="flex min-w-0 flex-wrap items-center justify-end gap-2 @max-[640px]/forms-settings:justify-start [&>*]:max-w-full">
|
|
1623
|
+
{children}
|
|
1624
|
+
</div>
|
|
1592
1625
|
</div>
|
|
1593
1626
|
)
|
|
1594
1627
|
}
|
package/src/views/Login.tsx
CHANGED
|
@@ -407,7 +407,7 @@ export function Login({
|
|
|
407
407
|
const showBrandName = !effectiveLogo && isBranded
|
|
408
408
|
|
|
409
409
|
return (
|
|
410
|
-
<
|
|
410
|
+
<main className="bg-muted flex min-h-screen items-center justify-center px-4">
|
|
411
411
|
<div className="w-full max-w-md">
|
|
412
412
|
<div className="mb-8 text-center">
|
|
413
413
|
{showLogo &&
|
|
@@ -423,6 +423,7 @@ export function Login({
|
|
|
423
423
|
) : (
|
|
424
424
|
<PrentaBrandLogo className="mx-auto mb-4 h-14 w-auto" />
|
|
425
425
|
))}
|
|
426
|
+
{!showBrandName && <h1 className="sr-only">Sign in</h1>}
|
|
426
427
|
{showBrandName && <h1 className="text-foreground text-2xl font-medium">{brandName}</h1>}
|
|
427
428
|
<p className="text-muted-foreground mt-2">{brandTagline}</p>
|
|
428
429
|
</div>
|
|
@@ -587,8 +588,8 @@ export function Login({
|
|
|
587
588
|
<button
|
|
588
589
|
type="button"
|
|
589
590
|
onClick={() => setShowPassword(!showPassword)}
|
|
590
|
-
|
|
591
|
-
|
|
591
|
+
aria-label={showPassword ? 'Hide password' : 'Show password'}
|
|
592
|
+
className="text-muted-foreground hover:text-foreground absolute top-1/2 right-2 flex h-6 w-6 -translate-y-1/2 items-center justify-center"
|
|
592
593
|
>
|
|
593
594
|
{showPassword ? <EyeOff className="h-4 w-4" /> : <Eye className="h-4 w-4" />}
|
|
594
595
|
</button>
|
|
@@ -642,6 +643,6 @@ export function Login({
|
|
|
642
643
|
</form>
|
|
643
644
|
)}
|
|
644
645
|
</div>
|
|
645
|
-
</
|
|
646
|
+
</main>
|
|
646
647
|
)
|
|
647
648
|
}
|
|
@@ -1072,13 +1072,13 @@ export function MediaBrowser({ onNavigate, currentPath, role, config }: MediaBro
|
|
|
1072
1072
|
<div className="bg-muted mb-4 flex h-12 w-12 items-center justify-center rounded-full">
|
|
1073
1073
|
<ImageIcon className="text-muted-foreground h-6 w-6" />
|
|
1074
1074
|
</div>
|
|
1075
|
-
<
|
|
1075
|
+
<h2 className="text-foreground mb-1 text-sm font-medium">
|
|
1076
1076
|
{folderSel.type === 'smart' && folderSel.smart === 'uncategorized'
|
|
1077
1077
|
? 'No uncategorized media'
|
|
1078
1078
|
: folderSel.type === 'folder'
|
|
1079
1079
|
? 'No media in this folder'
|
|
1080
1080
|
: 'No media yet'}
|
|
1081
|
-
</
|
|
1081
|
+
</h2>
|
|
1082
1082
|
<p className="text-muted-foreground text-sm">
|
|
1083
1083
|
Upload your first file to get started.
|
|
1084
1084
|
</p>
|
|
@@ -1348,9 +1348,9 @@ export function MediaBrowser({ onNavigate, currentPath, role, config }: MediaBro
|
|
|
1348
1348
|
className="border-border bg-card mobile:w-full flex w-80 shrink-0 flex-col overflow-y-auto rounded-lg border lg:w-96"
|
|
1349
1349
|
>
|
|
1350
1350
|
<div className="border-border bg-card sticky top-0 z-10 flex items-center justify-between border-b p-4">
|
|
1351
|
-
<
|
|
1351
|
+
<h2 className="text-foreground truncate text-sm font-medium">
|
|
1352
1352
|
{activeItem.name}
|
|
1353
|
-
</
|
|
1353
|
+
</h2>
|
|
1354
1354
|
<button
|
|
1355
1355
|
type="button"
|
|
1356
1356
|
onClick={closeDetail}
|