@actuate-media/cms-admin 0.10.0 → 0.11.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.
- package/dist/AdminRoot.d.ts.map +1 -1
- package/dist/AdminRoot.js +8 -5
- package/dist/AdminRoot.js.map +1 -1
- package/dist/__tests__/layout/primitives.test.d.ts +2 -0
- package/dist/__tests__/layout/primitives.test.d.ts.map +1 -0
- package/dist/__tests__/layout/primitives.test.js +34 -0
- package/dist/__tests__/layout/primitives.test.js.map +1 -0
- package/dist/__tests__/lib/cv.test.d.ts +2 -0
- package/dist/__tests__/lib/cv.test.d.ts.map +1 -0
- package/dist/__tests__/lib/cv.test.js +66 -0
- package/dist/__tests__/lib/cv.test.js.map +1 -0
- package/dist/actuate-admin.css +1 -1
- package/dist/assets/actuate-logo.d.ts +36 -0
- package/dist/assets/actuate-logo.d.ts.map +1 -0
- package/dist/assets/actuate-logo.js +15 -0
- package/dist/assets/actuate-logo.js.map +1 -0
- package/dist/components/Breadcrumbs.js +2 -2
- package/dist/components/CommandPalette.js +10 -10
- package/dist/components/ContentOverviewChart.js +3 -3
- package/dist/components/ErrorBoundary.js +1 -1
- package/dist/components/FocalPointPicker.js +2 -2
- package/dist/components/FolderTree.js +20 -20
- package/dist/components/LivePreview.js +3 -3
- package/dist/components/LocaleSwitcher.js +1 -1
- package/dist/components/MediaPickerModal.js +4 -4
- package/dist/components/PresenceIndicator.js +1 -1
- package/dist/components/SEOConfigPanel.d.ts +2 -0
- package/dist/components/SEOConfigPanel.d.ts.map +1 -0
- package/dist/components/SEOConfigPanel.js +174 -0
- package/dist/components/SEOConfigPanel.js.map +1 -0
- package/dist/components/SEOPanel.js +9 -9
- package/dist/components/SEOPerformance.js +2 -2
- package/dist/components/SchedulePublishDialog.js +1 -1
- package/dist/components/SharePreviewLinkDialog.js +1 -1
- package/dist/components/TipTapEditor.js +5 -5
- package/dist/components/VersionHistory.js +2 -2
- package/dist/components/ui/Badge.d.ts +33 -3
- package/dist/components/ui/Badge.d.ts.map +1 -1
- package/dist/components/ui/Badge.js +42 -8
- package/dist/components/ui/Badge.js.map +1 -1
- package/dist/components/ui/Button.d.ts +19 -8
- package/dist/components/ui/Button.d.ts.map +1 -1
- package/dist/components/ui/Button.js +35 -14
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/Card.d.ts +26 -0
- package/dist/components/ui/Card.d.ts.map +1 -0
- package/dist/components/ui/Card.js +45 -0
- package/dist/components/ui/Card.js.map +1 -0
- package/dist/components/ui/DataTable.js +1 -1
- package/dist/components/ui/Input.d.ts +15 -0
- package/dist/components/ui/Input.d.ts.map +1 -0
- package/dist/components/ui/Input.js +23 -0
- package/dist/components/ui/Input.js.map +1 -0
- package/dist/components/ui/SearchInput.js +1 -1
- package/dist/components/ui/Select.d.ts +16 -0
- package/dist/components/ui/Select.d.ts.map +1 -0
- package/dist/components/ui/Select.js +25 -0
- package/dist/components/ui/Select.js.map +1 -0
- package/dist/components/ui/Toast.js +1 -1
- package/dist/components/ui/index.d.ts +10 -4
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +5 -2
- package/dist/components/ui/index.js.map +1 -1
- package/dist/fields/BlockBuilderField.js +3 -3
- package/dist/fields/DateField.js +1 -1
- package/dist/fields/RelationshipField.js +3 -3
- package/dist/fields/TextField.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/layout/Header.js +1 -1
- package/dist/layout/Layout.d.ts +14 -0
- package/dist/layout/Layout.d.ts.map +1 -1
- package/dist/layout/Layout.js +17 -11
- package/dist/layout/Layout.js.map +1 -1
- package/dist/layout/Sidebar.d.ts.map +1 -1
- package/dist/layout/Sidebar.js +21 -11
- package/dist/layout/Sidebar.js.map +1 -1
- package/dist/layout/primitives/AdminShell.d.ts +43 -0
- package/dist/layout/primitives/AdminShell.d.ts.map +1 -0
- package/dist/layout/primitives/AdminShell.js +51 -0
- package/dist/layout/primitives/AdminShell.js.map +1 -0
- package/dist/layout/primitives/Box.d.ts +19 -0
- package/dist/layout/primitives/Box.d.ts.map +1 -0
- package/dist/layout/primitives/Box.js +12 -0
- package/dist/layout/primitives/Box.js.map +1 -0
- package/dist/layout/primitives/Cluster.d.ts +27 -0
- package/dist/layout/primitives/Cluster.d.ts.map +1 -0
- package/dist/layout/primitives/Cluster.js +37 -0
- package/dist/layout/primitives/Cluster.js.map +1 -0
- package/dist/layout/primitives/Grid.d.ts +45 -0
- package/dist/layout/primitives/Grid.d.ts.map +1 -0
- package/dist/layout/primitives/Grid.js +59 -0
- package/dist/layout/primitives/Grid.js.map +1 -0
- package/dist/layout/primitives/PageContainer.d.ts +36 -0
- package/dist/layout/primitives/PageContainer.d.ts.map +1 -0
- package/dist/layout/primitives/PageContainer.js +41 -0
- package/dist/layout/primitives/PageContainer.js.map +1 -0
- package/dist/layout/primitives/Split.d.ts +34 -0
- package/dist/layout/primitives/Split.d.ts.map +1 -0
- package/dist/layout/primitives/Split.js +27 -0
- package/dist/layout/primitives/Split.js.map +1 -0
- package/dist/layout/primitives/Stack.d.ts +23 -0
- package/dist/layout/primitives/Stack.d.ts.map +1 -0
- package/dist/layout/primitives/Stack.js +34 -0
- package/dist/layout/primitives/Stack.js.map +1 -0
- package/dist/layout/primitives/index.d.ts +30 -0
- package/dist/layout/primitives/index.d.ts.map +1 -0
- package/dist/layout/primitives/index.js +22 -0
- package/dist/layout/primitives/index.js.map +1 -0
- package/dist/layout/primitives/tokens.d.ts +48 -0
- package/dist/layout/primitives/tokens.d.ts.map +1 -0
- package/dist/layout/primitives/tokens.js +54 -0
- package/dist/layout/primitives/tokens.js.map +1 -0
- package/dist/lib/cv.d.ts +53 -0
- package/dist/lib/cv.d.ts.map +1 -0
- package/dist/lib/cv.js +39 -0
- package/dist/lib/cv.js.map +1 -0
- package/dist/views/ApiKeys.js +7 -7
- package/dist/views/CollectionList.js +8 -8
- package/dist/views/Dashboard.d.ts.map +1 -1
- package/dist/views/Dashboard.js +333 -78
- package/dist/views/Dashboard.js.map +1 -1
- package/dist/views/DocumentEdit.js +3 -3
- package/dist/views/ForgotPassword.js +2 -2
- package/dist/views/FormEditor.js +5 -5
- package/dist/views/FormSubmissions.js +6 -6
- package/dist/views/Forms.js +2 -2
- package/dist/views/Login.d.ts +16 -1
- package/dist/views/Login.d.ts.map +1 -1
- package/dist/views/Login.js +17 -7
- package/dist/views/Login.js.map +1 -1
- package/dist/views/MediaBrowser.js +16 -16
- package/dist/views/PageEditor.js +2 -2
- package/dist/views/Pages.js +10 -10
- package/dist/views/PostEditor.js +2 -2
- package/dist/views/Posts.js +4 -4
- package/dist/views/Redirects.js +4 -4
- package/dist/views/ResetPassword.js +2 -2
- package/dist/views/SEO.js +6 -6
- package/dist/views/ScriptTagEditor.js +4 -4
- package/dist/views/ScriptTags.js +2 -2
- package/dist/views/Settings.d.ts.map +1 -1
- package/dist/views/Settings.js +9 -8
- package/dist/views/Settings.js.map +1 -1
- package/dist/views/SetupWizard.js +2 -2
- package/dist/views/Users.js +4 -4
- package/dist/views/page-builder/AIBlockAssist.js +1 -1
- package/dist/views/page-builder/AIGenerateDialog.js +10 -10
- package/dist/views/page-builder/BlockEditor.js +10 -10
- package/dist/views/page-builder/BlockPicker.js +4 -4
- package/dist/views/page-builder/BottomBar.js +1 -1
- package/dist/views/page-builder/BuilderToolbar.js +2 -2
- package/dist/views/page-builder/ContextPanel.js +2 -2
- package/dist/views/page-builder/DesignScore.js +9 -9
- package/dist/views/page-builder/NodeSettings.js +8 -8
- package/dist/views/page-builder/PageBuilder.js +3 -3
- package/dist/views/page-builder/PageSettings.js +1 -1
- package/dist/views/page-builder/PageTemplates.js +2 -2
- package/dist/views/page-builder/SEOPanel.js +13 -13
- package/dist/views/page-builder/SavedSections.js +5 -5
- package/dist/views/page-builder/TemplatePicker.js +2 -2
- package/dist/views/page-builder/block-renderers/CTAPreview.js +5 -5
- package/dist/views/page-builder/block-renderers/CardsPreview.js +1 -1
- package/dist/views/page-builder/block-renderers/CodePreview.js +1 -1
- package/dist/views/page-builder/block-renderers/FAQPreview.js +3 -3
- package/dist/views/page-builder/block-renderers/FallbackPreview.js +1 -1
- package/dist/views/page-builder/block-renderers/FormPreview.js +3 -3
- package/dist/views/page-builder/block-renderers/GalleryPreview.js +5 -5
- package/dist/views/page-builder/block-renderers/HeroPreview.js +3 -3
- package/dist/views/page-builder/block-renderers/ImagePreview.js +3 -3
- package/dist/views/page-builder/block-renderers/TextPreview.js +3 -3
- package/dist/views/page-builder/block-renderers/VideoPreview.js +4 -4
- package/dist/views/page-builder/canvas/BlockRenderer.js +1 -1
- package/dist/views/page-builder/canvas/BuilderCanvas.js +3 -3
- package/dist/views/page-builder/canvas/ColumnRenderer.js +2 -2
- package/dist/views/page-builder/canvas/ContainerRenderer.js +2 -2
- package/dist/views/page-builder/canvas/RowRenderer.js +2 -2
- package/dist/views/page-builder/canvas/SectionRenderer.js +2 -2
- package/package.json +6 -2
- package/src/AdminRoot.tsx +21 -11
- package/src/__tests__/layout/primitives.test.ts +37 -0
- package/src/__tests__/lib/cv.test.ts +74 -0
- package/src/assets/actuate-logo.tsx +72 -0
- package/src/components/Breadcrumbs.tsx +6 -6
- package/src/components/CommandPalette.tsx +34 -34
- package/src/components/ContentOverviewChart.tsx +3 -3
- package/src/components/ErrorBoundary.tsx +3 -3
- package/src/components/FocalPointPicker.tsx +4 -4
- package/src/components/FolderTree.tsx +38 -38
- package/src/components/LivePreview.tsx +16 -16
- package/src/components/LocaleSwitcher.tsx +7 -7
- package/src/components/MediaPickerModal.tsx +21 -21
- package/src/components/PresenceIndicator.tsx +2 -2
- package/src/components/SEOConfigPanel.tsx +582 -0
- package/src/components/SEOPanel.tsx +46 -46
- package/src/components/SEOPerformance.tsx +21 -21
- package/src/components/SchedulePublishDialog.tsx +4 -4
- package/src/components/SharePreviewLinkDialog.tsx +1 -1
- package/src/components/TipTapEditor.tsx +33 -33
- package/src/components/VersionHistory.tsx +16 -16
- package/src/components/ui/Badge.tsx +66 -14
- package/src/components/ui/Button.tsx +70 -33
- package/src/components/ui/Card.tsx +101 -0
- package/src/components/ui/DataTable.tsx +1 -1
- package/src/components/ui/Input.tsx +35 -0
- package/src/components/ui/SearchInput.tsx +4 -4
- package/src/components/ui/Select.tsx +56 -0
- package/src/components/ui/Toast.tsx +1 -1
- package/src/components/ui/index.ts +18 -4
- package/src/fields/BlockBuilderField.tsx +3 -3
- package/src/fields/DateField.tsx +1 -1
- package/src/fields/RelationshipField.tsx +10 -10
- package/src/fields/TextField.tsx +1 -1
- package/src/index.ts +28 -0
- package/src/layout/Header.tsx +28 -28
- package/src/layout/Layout.tsx +39 -46
- package/src/layout/Sidebar.tsx +37 -64
- package/src/layout/primitives/AdminShell.tsx +118 -0
- package/src/layout/primitives/Box.tsx +30 -0
- package/src/layout/primitives/Cluster.tsx +74 -0
- package/src/layout/primitives/Grid.tsx +120 -0
- package/src/layout/primitives/PageContainer.tsx +96 -0
- package/src/layout/primitives/Split.tsx +73 -0
- package/src/layout/primitives/Stack.tsx +67 -0
- package/src/layout/primitives/index.ts +36 -0
- package/src/layout/primitives/tokens.ts +76 -0
- package/src/lib/cv.ts +96 -0
- package/src/styles/build-input.css +1 -1
- package/src/views/ApiKeys.tsx +57 -57
- package/src/views/CollectionList.tsx +30 -30
- package/src/views/Dashboard.tsx +737 -186
- package/src/views/DocumentEdit.tsx +9 -9
- package/src/views/ForgotPassword.tsx +18 -18
- package/src/views/FormEditor.tsx +75 -75
- package/src/views/FormSubmissions.tsx +76 -76
- package/src/views/Forms.tsx +27 -27
- package/src/views/Login.tsx +65 -25
- package/src/views/MediaBrowser.tsx +127 -127
- package/src/views/PageEditor.tsx +25 -25
- package/src/views/Pages.tsx +59 -59
- package/src/views/PostEditor.tsx +37 -37
- package/src/views/Posts.tsx +48 -48
- package/src/views/Redirects.tsx +21 -21
- package/src/views/ResetPassword.tsx +28 -28
- package/src/views/SEO.tsx +144 -144
- package/src/views/ScriptTagEditor.tsx +24 -24
- package/src/views/ScriptTags.tsx +10 -10
- package/src/views/Settings.tsx +88 -80
- package/src/views/SetupWizard.tsx +28 -28
- package/src/views/Users.tsx +20 -20
- package/src/views/page-builder/AIBlockAssist.tsx +1 -1
- package/src/views/page-builder/AIGenerateDialog.tsx +63 -63
- package/src/views/page-builder/BlockEditor.tsx +26 -26
- package/src/views/page-builder/BlockPicker.tsx +22 -22
- package/src/views/page-builder/BottomBar.tsx +8 -8
- package/src/views/page-builder/BuilderToolbar.tsx +17 -17
- package/src/views/page-builder/ContextPanel.tsx +3 -3
- package/src/views/page-builder/DesignScore.tsx +21 -21
- package/src/views/page-builder/NodeSettings.tsx +27 -27
- package/src/views/page-builder/PageBuilder.tsx +11 -11
- package/src/views/page-builder/PageSettings.tsx +4 -4
- package/src/views/page-builder/PageTemplates.tsx +18 -18
- package/src/views/page-builder/SEOPanel.tsx +53 -53
- package/src/views/page-builder/SavedSections.tsx +37 -37
- package/src/views/page-builder/TemplatePicker.tsx +17 -17
- package/src/views/page-builder/block-renderers/CTAPreview.tsx +13 -13
- package/src/views/page-builder/block-renderers/CardsPreview.tsx +5 -5
- package/src/views/page-builder/block-renderers/CodePreview.tsx +6 -6
- package/src/views/page-builder/block-renderers/FAQPreview.tsx +13 -13
- package/src/views/page-builder/block-renderers/FallbackPreview.tsx +3 -3
- package/src/views/page-builder/block-renderers/FormPreview.tsx +20 -20
- package/src/views/page-builder/block-renderers/GalleryPreview.tsx +8 -8
- package/src/views/page-builder/block-renderers/HeroPreview.tsx +16 -16
- package/src/views/page-builder/block-renderers/ImagePreview.tsx +4 -4
- package/src/views/page-builder/block-renderers/TextPreview.tsx +14 -14
- package/src/views/page-builder/block-renderers/VideoPreview.tsx +12 -12
- package/src/views/page-builder/canvas/BlockRenderer.tsx +4 -4
- package/src/views/page-builder/canvas/BuilderCanvas.tsx +6 -6
- package/src/views/page-builder/canvas/ColumnRenderer.tsx +3 -3
- package/src/views/page-builder/canvas/ContainerRenderer.tsx +2 -2
- package/src/views/page-builder/canvas/RowRenderer.tsx +2 -2
- package/src/views/page-builder/canvas/SectionRenderer.tsx +2 -2
|
@@ -38,11 +38,11 @@ function getRingStrokeColor(score) {
|
|
|
38
38
|
function StatusIcon({ status }) {
|
|
39
39
|
switch (status) {
|
|
40
40
|
case 'good':
|
|
41
|
-
return _jsx(CheckCircle2, { size: 14, className: "text-green-500
|
|
41
|
+
return _jsx(CheckCircle2, { size: 14, className: "shrink-0 text-green-500" });
|
|
42
42
|
case 'warning':
|
|
43
|
-
return _jsx(AlertCircle, { size: 14, className: "text-amber-500
|
|
43
|
+
return _jsx(AlertCircle, { size: 14, className: "shrink-0 text-amber-500" });
|
|
44
44
|
case 'error':
|
|
45
|
-
return _jsx(XCircle, { size: 14, className: "text-red-500
|
|
45
|
+
return _jsx(XCircle, { size: 14, className: "shrink-0 text-red-500" });
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
function SeverityBadge({ severity }) {
|
|
@@ -51,7 +51,7 @@ function SeverityBadge({ severity }) {
|
|
|
51
51
|
suggestion: 'bg-amber-100 text-amber-700',
|
|
52
52
|
info: 'bg-blue-100 text-blue-700',
|
|
53
53
|
};
|
|
54
|
-
return (_jsx("span", { className: `inline-block px-1.5 py-0.5
|
|
54
|
+
return (_jsx("span", { className: `inline-block rounded px-1.5 py-0.5 text-xs font-medium ${classes[severity]}`, children: severity }));
|
|
55
55
|
}
|
|
56
56
|
function ScoreRing({ score }) {
|
|
57
57
|
const radius = 32;
|
|
@@ -60,11 +60,11 @@ function ScoreRing({ score }) {
|
|
|
60
60
|
const progress = Math.min(score, 100) / 100;
|
|
61
61
|
const dashOffset = circumference * (1 - progress);
|
|
62
62
|
const size = (radius + strokeWidth) * 2;
|
|
63
|
-
return (_jsxs("div", { className: "flex flex-col items-center gap-2", children: [_jsxs("div", { className: "relative", children: [_jsxs("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, className: "-rotate-90", children: [_jsx("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: "var(--border)", strokeWidth: strokeWidth }), _jsx("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: getRingStrokeColor(score), strokeWidth: strokeWidth, strokeDasharray: circumference, strokeDashoffset: dashOffset, strokeLinecap: "round", className: "transition-all duration-700 ease-out" })] }), _jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: _jsx("span", { className: `text-lg font-medium ${getScoreColor(score, 100)}`, children: score }) })] }), _jsx("span", { className: "text-
|
|
63
|
+
return (_jsxs("div", { className: "flex flex-col items-center gap-2", children: [_jsxs("div", { className: "relative", children: [_jsxs("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, className: "-rotate-90", children: [_jsx("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: "var(--border)", strokeWidth: strokeWidth }), _jsx("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: getRingStrokeColor(score), strokeWidth: strokeWidth, strokeDasharray: circumference, strokeDashoffset: dashOffset, strokeLinecap: "round", className: "transition-all duration-700 ease-out" })] }), _jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: _jsx("span", { className: `text-lg font-medium ${getScoreColor(score, 100)}`, children: score }) })] }), _jsx("span", { className: "text-muted-foreground text-xs", children: getScoreLabel(score) })] }));
|
|
64
64
|
}
|
|
65
65
|
function CategoryRow({ category, expanded, onToggle, }) {
|
|
66
66
|
const percentage = category.maxScore > 0 ? (category.score / category.maxScore) * 100 : 0;
|
|
67
|
-
return (_jsxs("div", { className: "border-
|
|
67
|
+
return (_jsxs("div", { className: "border-border border-b last:border-b-0", children: [_jsxs("button", { type: "button", className: "hover:bg-muted/50 flex w-full flex-col gap-2 px-4 py-3 text-left transition-colors", onClick: onToggle, "aria-expanded": expanded, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-foreground text-xs font-medium", children: category.label }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("span", { className: "text-muted-foreground text-xs", children: [category.score, "/", category.maxScore] }), expanded ? (_jsx(ChevronUp, { size: 14, className: "text-muted-foreground" })) : (_jsx(ChevronDown, { size: 14, className: "text-muted-foreground" }))] })] }), _jsx("div", { className: "bg-muted h-1.5 w-full overflow-hidden rounded-full", children: _jsx("div", { className: `h-full rounded-full transition-all duration-500 ease-out ${getBarColor(category.score, category.maxScore)}`, style: { width: `${percentage}%` } }) })] }), expanded && category.checks.length > 0 && (_jsx("div", { className: "flex flex-col gap-2 px-4 pb-3", children: category.checks.map((check) => (_jsxs("div", { className: "flex items-start gap-2 pl-1", children: [_jsx(StatusIcon, { status: check.status }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "text-foreground text-xs font-medium", children: check.label }), _jsx("span", { className: "text-muted-foreground text-xs", children: check.detail })] })] }, check.id))) }))] }));
|
|
68
68
|
}
|
|
69
69
|
function SuggestionsList({ suggestions }) {
|
|
70
70
|
const sorted = useMemo(() => {
|
|
@@ -77,7 +77,7 @@ function SuggestionsList({ suggestions }) {
|
|
|
77
77
|
}, [suggestions]);
|
|
78
78
|
if (sorted.length === 0)
|
|
79
79
|
return null;
|
|
80
|
-
return (_jsxs("div", { className: "px-4 py-3
|
|
80
|
+
return (_jsxs("div", { className: "border-border border-t px-4 py-3", children: [_jsxs("div", { className: "mb-3 flex items-center gap-2", children: [_jsx(Lightbulb, { size: 14, className: "text-muted-foreground" }), _jsx("span", { className: "text-foreground text-xs font-medium", children: "Suggestions" })] }), _jsx("div", { className: "flex flex-col gap-2.5", children: sorted.map((suggestion) => (_jsxs("div", { className: "flex items-start gap-2", children: [_jsx(SeverityBadge, { severity: suggestion.severity }), _jsx("span", { className: "text-muted-foreground text-xs leading-relaxed", children: suggestion.message })] }, suggestion.id))) })] }));
|
|
81
81
|
}
|
|
82
82
|
export function DesignScorePanel({ tree }) {
|
|
83
83
|
const analysis = useMemo(() => analyzeDesign(tree), [tree]);
|
|
@@ -86,8 +86,8 @@ export function DesignScorePanel({ tree }) {
|
|
|
86
86
|
setExpandedCategories((prev) => prev.includes(name) ? prev.filter((n) => n !== name) : [...prev, name]);
|
|
87
87
|
};
|
|
88
88
|
if (!tree.children || tree.children.length === 0) {
|
|
89
|
-
return (_jsxs("div", { className: "
|
|
89
|
+
return (_jsxs("div", { className: "flex min-h-[200px] flex-col items-center justify-center p-6 text-center", children: [_jsx(Palette, { size: 32, className: "text-muted-foreground mb-3" }), _jsx("p", { className: "text-foreground mb-1 text-sm font-medium", children: "Design Score" }), _jsx("p", { className: "text-muted-foreground text-xs", children: "Add sections to your page to see the design analysis" })] }));
|
|
90
90
|
}
|
|
91
|
-
return (_jsxs("div", { className: "flex flex-col", children: [_jsx("div", { className: "flex flex-col items-center
|
|
91
|
+
return (_jsxs("div", { className: "flex flex-col", children: [_jsx("div", { className: "border-border flex flex-col items-center border-b py-5", children: _jsx(ScoreRing, { score: analysis.score }) }), _jsx("div", { className: "flex flex-col", children: analysis.categories.map((category) => (_jsx(CategoryRow, { category: category, expanded: expandedCategories.includes(category.name), onToggle: () => toggleCategory(category.name) }, category.name))) }), _jsx(SuggestionsList, { suggestions: analysis.suggestions })] }));
|
|
92
92
|
}
|
|
93
93
|
//# sourceMappingURL=DesignScore.js.map
|
|
@@ -36,19 +36,19 @@ export function NodeSettings({ node, onUpdateSettings, onRemoveNode, onDuplicate
|
|
|
36
36
|
: node.type === 'row'
|
|
37
37
|
? 'Row'
|
|
38
38
|
: 'Column';
|
|
39
|
-
return (_jsxs("div", { className: "flex flex-col
|
|
39
|
+
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsx("div", { className: "border-border border-b p-4", children: _jsxs("p", { className: "text-foreground text-sm font-medium", children: [nodeLabel, " Settings"] }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsxs("div", { className: "space-y-4 p-4", children: [node.type === 'section' && (_jsx(SectionFields, { node: node, updateSetting: updateSetting, onAddRow: onAddRow })), node.type === 'container' && (_jsx(ContainerFields, { node: node, updateSetting: updateSetting })), node.type === 'row' && _jsx(RowFields, { node: node, updateSetting: updateSetting }), node.type === 'column' && _jsx(ColumnFields, { node: node, updateSetting: updateSetting })] }) }), _jsxs("div", { className: "border-border space-y-2 border-t p-4", children: [_jsx("p", { className: SECTION_HEADING_CLASS, children: "Actions" }), _jsxs("div", { className: "flex gap-2", children: [_jsxs("button", { type: "button", onClick: () => onMoveNodeUp(node.id), "aria-label": "Move up", className: "bg-background border-input hover:bg-accent flex flex-1 items-center justify-center gap-1.5 rounded-md border px-3 py-2 text-sm transition-colors", children: [_jsx(ArrowUp, { size: 14 }), "Up"] }), _jsxs("button", { type: "button", onClick: () => onMoveNodeDown(node.id), "aria-label": "Move down", className: "bg-background border-input hover:bg-accent flex flex-1 items-center justify-center gap-1.5 rounded-md border px-3 py-2 text-sm transition-colors", children: [_jsx(ArrowDown, { size: 14 }), "Down"] })] }), _jsxs("button", { type: "button", onClick: () => onDuplicateNode(node.id), className: "bg-background border-input hover:bg-accent flex w-full items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition-colors", children: [_jsx(Copy, { size: 14 }), "Duplicate"] }), _jsxs("button", { type: "button", onClick: handleDelete, onBlur: () => setConfirmDelete(false), className: `flex w-full items-center justify-center gap-2 rounded-md px-3 py-2 text-sm font-medium transition-colors ${confirmDelete
|
|
40
40
|
? 'bg-destructive text-destructive-foreground'
|
|
41
|
-
: 'bg-background border
|
|
41
|
+
: 'bg-background border-destructive text-destructive hover:bg-destructive/10 border'}`, children: [_jsx(Trash2, { size: 14 }), confirmDelete ? 'Click again to confirm' : 'Delete'] })] })] }));
|
|
42
42
|
}
|
|
43
43
|
function SectionFields({ node, updateSetting, onAddRow, }) {
|
|
44
44
|
const s = node.settings;
|
|
45
|
-
return (_jsxs(_Fragment, { children: [_jsx("p", { className: SECTION_HEADING_CLASS, children: "Background" }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Background Color" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("input", { type: "color", value: s.background ?? '#ffffff', onChange: (e) => updateSetting('background', e.target.value), className: "h-9 w-9 rounded-md border
|
|
45
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: SECTION_HEADING_CLASS, children: "Background" }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Background Color" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("input", { type: "color", value: s.background ?? '#ffffff', onChange: (e) => updateSetting('background', e.target.value), className: "border-input h-9 w-9 cursor-pointer rounded-md border" }), _jsx("input", { type: "text", value: s.background ?? '', onChange: (e) => updateSetting('background', e.target.value), placeholder: "transparent", className: `${INPUT_CLASS} flex-1` })] })] }), _jsx("p", { className: SECTION_HEADING_CLASS, children: "Spacing" }), _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [_jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Padding Top" }), _jsx("input", { type: "text", value: s.paddingTop ?? '', onChange: (e) => updateSetting('paddingTop', e.target.value), placeholder: "0px", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Padding Bottom" }), _jsx("input", { type: "text", value: s.paddingBottom ?? '', onChange: (e) => updateSetting('paddingBottom', e.target.value), placeholder: "0px", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Margin Top" }), _jsx("input", { type: "text", value: s.marginTop ?? '', onChange: (e) => updateSetting('marginTop', e.target.value), placeholder: "0px", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Margin Bottom" }), _jsx("input", { type: "text", value: s.marginBottom ?? '', onChange: (e) => updateSetting('marginBottom', e.target.value), placeholder: "0px", className: INPUT_CLASS })] })] }), _jsx("p", { className: SECTION_HEADING_CLASS, children: "Attributes" }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("label", { className: "text-foreground text-sm font-medium", children: "Visibility" }), _jsx(SwitchPrimitive.Root, { checked: s.visibility !== 'hidden', onCheckedChange: (checked) => updateSetting('visibility', checked ? 'visible' : 'hidden'), className: "bg-input data-[state=checked]:bg-primary relative h-5 w-9 rounded-full transition-colors", "aria-label": "Section visibility", children: _jsx(SwitchPrimitive.Thumb, { className: "bg-background block h-3.5 w-3.5 translate-x-0.5 rounded-full shadow-sm transition-transform data-[state=checked]:translate-x-[18px]" }) })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "HTML ID" }), _jsx("input", { type: "text", value: s.htmlId ?? '', onChange: (e) => updateSetting('htmlId', e.target.value), placeholder: "section-id", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "HTML Class" }), _jsx("input", { type: "text", value: s.htmlClass ?? '', onChange: (e) => updateSetting('htmlClass', e.target.value), placeholder: "my-class", className: INPUT_CLASS })] }), onAddRow && (_jsxs("button", { type: "button", onClick: () => onAddRow(node.id), className: "bg-primary text-primary-foreground hover:bg-primary/90 flex w-full items-center justify-center gap-2 rounded-md px-3 py-2 text-sm font-medium transition-colors", children: [_jsx(Plus, { size: 14 }), "Add Row"] }))] }));
|
|
46
46
|
}
|
|
47
47
|
function ContainerFields({ node, updateSetting, }) {
|
|
48
48
|
const s = node.settings;
|
|
49
49
|
return (_jsxs(_Fragment, { children: [_jsx("p", { className: SECTION_HEADING_CLASS, children: "Layout" }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Max Width" }), _jsx("input", { type: "text", value: s.maxWidth ?? '', onChange: (e) => updateSetting('maxWidth', e.target.value), placeholder: "1200px", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Alignment" }), _jsx("div", { className: "flex gap-1", children: ['left', 'center', 'right'].map((align) => {
|
|
50
50
|
const Icon = align === 'left' ? AlignLeft : align === 'center' ? AlignCenter : AlignRight;
|
|
51
|
-
return (_jsx("button", { type: "button", onClick: () => updateSetting('alignment', align), "aria-label": `Align ${align}`, className: `flex-1
|
|
51
|
+
return (_jsx("button", { type: "button", onClick: () => updateSetting('alignment', align), "aria-label": `Align ${align}`, className: `flex flex-1 items-center justify-center rounded-md border py-2 transition-colors ${s.alignment === align
|
|
52
52
|
? 'bg-primary text-primary-foreground border-primary'
|
|
53
53
|
: 'bg-background border-input hover:bg-accent'}`, children: _jsx(Icon, { size: 14 }) }, align));
|
|
54
54
|
}) })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Padding" }), _jsx("input", { type: "text", value: s.padding ?? '', onChange: (e) => updateSetting('padding', e.target.value), placeholder: "0px", className: INPUT_CLASS })] })] }));
|
|
@@ -63,18 +63,18 @@ function RowFields({ node, updateSetting, }) {
|
|
|
63
63
|
: align === 'center'
|
|
64
64
|
? Minus
|
|
65
65
|
: AlignCenter;
|
|
66
|
-
return (_jsx("button", { type: "button", onClick: () => updateSetting('verticalAlign', align), "aria-label": `Align ${align}`, className: `flex-1
|
|
66
|
+
return (_jsx("button", { type: "button", onClick: () => updateSetting('verticalAlign', align), "aria-label": `Align ${align}`, className: `flex flex-1 items-center justify-center rounded-md border py-2 text-xs transition-colors ${s.verticalAlign === align
|
|
67
67
|
? 'bg-primary text-primary-foreground border-primary'
|
|
68
68
|
: 'bg-background border-input hover:bg-accent'}`, children: _jsx(Icon, { size: 14 }) }, align));
|
|
69
|
-
}) })] }), _jsx("p", { className: SECTION_HEADING_CLASS, children: "Mobile" }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("label", { className: "text-sm font-medium
|
|
69
|
+
}) })] }), _jsx("p", { className: SECTION_HEADING_CLASS, children: "Mobile" }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("label", { className: "text-foreground text-sm font-medium", children: "Reverse on Mobile" }), _jsx(SwitchPrimitive.Root, { checked: !!s.reverseOnMobile, onCheckedChange: (checked) => updateSetting('reverseOnMobile', checked), className: "bg-input data-[state=checked]:bg-primary relative h-5 w-9 rounded-full transition-colors", "aria-label": "Reverse column order on mobile", children: _jsx(SwitchPrimitive.Thumb, { className: "bg-background block h-3.5 w-3.5 translate-x-0.5 rounded-full shadow-sm transition-transform data-[state=checked]:translate-x-[18px]" }) })] }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("label", { className: "text-foreground text-sm font-medium", children: "Wrap on Mobile" }), _jsx(SwitchPrimitive.Root, { checked: !!s.wrapOnMobile, onCheckedChange: (checked) => updateSetting('wrapOnMobile', checked), className: "bg-input data-[state=checked]:bg-primary relative h-5 w-9 rounded-full transition-colors", "aria-label": "Wrap columns on mobile", children: _jsx(SwitchPrimitive.Thumb, { className: "bg-background block h-3.5 w-3.5 translate-x-0.5 rounded-full shadow-sm transition-transform data-[state=checked]:translate-x-[18px]" }) })] }), _jsx("p", { className: SECTION_HEADING_CLASS, children: "Column Presets" }), _jsx("div", { className: "grid grid-cols-2 gap-1.5", children: COLUMN_PRESETS.map((preset) => (_jsxs("button", { type: "button", onClick: () => updateSetting('__columnPreset', preset.widths), className: "border-input bg-background hover:bg-accent rounded-md border px-2 py-2 transition-colors", children: [_jsx("div", { className: "flex h-4 gap-0.5", children: preset.widths.map((w, i) => (_jsx("div", { className: "bg-muted-foreground/30 rounded-sm", style: { flex: w } }, i))) }), _jsx("p", { className: "text-muted-foreground mt-1 text-center text-xs", children: preset.widths.join(' | ') })] }, preset.label))) })] }));
|
|
70
70
|
}
|
|
71
71
|
function ColumnFields({ node, updateSetting, }) {
|
|
72
72
|
const s = node.settings;
|
|
73
73
|
return (_jsxs(_Fragment, { children: [_jsx("p", { className: SECTION_HEADING_CLASS, children: "Size" }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Width (1-12)" }), _jsx("input", { type: "number", min: 1, max: 12, value: s.width, onChange: (e) => updateSetting('width', Number(e.target.value)), className: INPUT_CLASS })] }), _jsx("p", { className: SECTION_HEADING_CLASS, children: "Layout" }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Vertical Align" }), _jsx("div", { className: "flex gap-1", children: ['top', 'center', 'bottom'].map((align) => {
|
|
74
74
|
const Icon = align === 'top' ? ArrowUpFromLine : align === 'bottom' ? ArrowDownToLine : Minus;
|
|
75
|
-
return (_jsx("button", { type: "button", onClick: () => updateSetting('verticalAlign', align), "aria-label": `Align ${align}`, className: `flex-1
|
|
75
|
+
return (_jsx("button", { type: "button", onClick: () => updateSetting('verticalAlign', align), "aria-label": `Align ${align}`, className: `flex flex-1 items-center justify-center rounded-md border py-2 transition-colors ${s.verticalAlign === align
|
|
76
76
|
? 'bg-primary text-primary-foreground border-primary'
|
|
77
77
|
: 'bg-background border-input hover:bg-accent'}`, children: _jsx(Icon, { size: 14 }) }, align));
|
|
78
|
-
}) })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Padding" }), _jsx("input", { type: "text", value: s.padding ?? '', onChange: (e) => updateSetting('padding', e.target.value), placeholder: "0px", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Background Color" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("input", { type: "color", value: s.background ?? '#ffffff', onChange: (e) => updateSetting('background', e.target.value), className: "h-9 w-9 rounded-md border
|
|
78
|
+
}) })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Padding" }), _jsx("input", { type: "text", value: s.padding ?? '', onChange: (e) => updateSetting('padding', e.target.value), placeholder: "0px", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Background Color" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("input", { type: "color", value: s.background ?? '#ffffff', onChange: (e) => updateSetting('background', e.target.value), className: "border-input h-9 w-9 cursor-pointer rounded-md border" }), _jsx("input", { type: "text", value: s.background ?? '', onChange: (e) => updateSetting('background', e.target.value), placeholder: "transparent", className: `${INPUT_CLASS} flex-1` })] })] })] }));
|
|
79
79
|
}
|
|
80
80
|
//# sourceMappingURL=NodeSettings.js.map
|
|
@@ -116,10 +116,10 @@ export function PageBuilder({ documentId, collectionSlug, config, onNavigate })
|
|
|
116
116
|
replaceTree(generatedTree);
|
|
117
117
|
}, [replaceTree]);
|
|
118
118
|
if (loading) {
|
|
119
|
-
return (_jsx("div", { className: "h-full
|
|
119
|
+
return (_jsx("div", { className: "bg-background flex h-full items-center justify-center", children: _jsx(Loader2, { className: "text-muted-foreground animate-spin", size: 24 }) }));
|
|
120
120
|
}
|
|
121
121
|
if (loadError) {
|
|
122
|
-
return (_jsx("div", { className: "h-full
|
|
122
|
+
return (_jsx("div", { className: "bg-background flex h-full items-center justify-center", children: _jsxs("div", { className: "border-destructive/30 bg-destructive/5 flex max-w-md items-center gap-3 rounded-lg border p-4", children: [_jsx(AlertTriangle, { className: "text-destructive shrink-0", size: 20 }), _jsxs("div", { children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: "Failed to load page" }), _jsx("p", { className: "text-muted-foreground mt-1 text-sm", children: loadError })] })] }) }));
|
|
123
123
|
}
|
|
124
124
|
const canvasWidth = DEVICE_WIDTHS[deviceMode];
|
|
125
125
|
const isConstrained = deviceMode !== 'desktop';
|
|
@@ -143,6 +143,6 @@ export function PageBuilder({ documentId, collectionSlug, config, onNavigate })
|
|
|
143
143
|
...previewStyle,
|
|
144
144
|
fontFamily: previewTheme.fontFamily ?? undefined,
|
|
145
145
|
};
|
|
146
|
-
return (_jsxs(ErrorBoundary, { children: [_jsxs("div", { className: "h-full flex
|
|
146
|
+
return (_jsxs(ErrorBoundary, { children: [_jsxs("div", { className: "bg-background flex h-full flex-col overflow-hidden", children: [_jsx(BuilderToolbar, { collectionSlug: collectionSlug, pageSettings: pageSettings, status: status, dirty: dirty, saving: saving, canUndo: canUndo, canRedo: canRedo, deviceMode: deviceMode, onNavigate: onNavigate, onTitleChange: (title) => setPageSettings({ title }), onUndo: undo, onRedo: redo, onDeviceMode: setDeviceMode, onSave: handleSave, onPublish: handlePublish, onOpenAI: () => setAiDialogOpen(true) }), _jsxs("div", { className: "flex flex-1 overflow-hidden", children: [_jsx("div", { className: "bg-muted flex-1 overflow-auto", children: _jsx("div", { className: "mx-auto h-full max-w-full transition-all duration-200", style: { width: canvasWidth }, children: _jsx("div", { className: `bg-background page-builder-canvas-shell h-full ${isConstrained ? 'border-border border-x shadow-lg' : ''}`, style: canvasShellStyle, children: _jsx(BuilderCanvas, { tree: tree, selectedNodeId: selectedNodeId, showGridOverlay: showGridOverlay, deviceMode: deviceMode, onSelectNode: selectNode }) }) }) }), _jsx("div", { className: "border-border bg-card w-[35%] max-w-[420px] min-w-[280px] overflow-y-auto border-l", children: _jsx(ContextPanel, { activeTab: activeTab, onTabChange: setActiveTab, selectedNode: selectedNode, tree: tree, pageSettings: pageSettings, onUpdateSettings: updateSettings, onUpdateBlock: updateBlock, onRemoveNode: removeNodeById, onDuplicateNode: duplicateNode, onMoveNodeUp: moveNodeUp, onMoveNodeDown: moveNodeDown, onPageSettingsChange: setPageSettings, onAddRow: addRowToSection, config: config }) })] }), _jsx(BottomBar, { deviceMode: deviceMode, showGridOverlay: showGridOverlay, onAddSection: addSection, onToggleGrid: setShowGridOverlay })] }), _jsx(AIGenerateDialog, { open: aiDialogOpen, onClose: () => setAiDialogOpen(false), onAccept: handleAIAccept })] }));
|
|
147
147
|
}
|
|
148
148
|
//# sourceMappingURL=PageBuilder.js.map
|
|
@@ -22,6 +22,6 @@ export function PageSettingsEditor({ settings, onChange }) {
|
|
|
22
22
|
}, [onChange]);
|
|
23
23
|
const metaTitleLength = (settings.metaTitle ?? '').length;
|
|
24
24
|
const metaDescLength = (settings.metaDescription ?? '').length;
|
|
25
|
-
return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsx("p", { className: SECTION_HEADING_CLASS, children: "General" }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Title" }), _jsx("input", { type: "text", value: settings.title, onChange: (e) => update('title', e.target.value), placeholder: "Page title", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Slug" }), _jsx("input", { type: "text", value: settings.slug, onChange: (e) => update('slug', e.target.value), placeholder: "/page-slug", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Template" }), _jsx("input", { type: "text", value: settings.template ?? '', onChange: (e) => update('template', e.target.value), placeholder: "default", className: INPUT_CLASS, readOnly: true })] }), _jsx("p", { className: SECTION_HEADING_CLASS, children: "SEO" }), _jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between
|
|
25
|
+
return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsx("p", { className: SECTION_HEADING_CLASS, children: "General" }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Title" }), _jsx("input", { type: "text", value: settings.title, onChange: (e) => update('title', e.target.value), placeholder: "Page title", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Slug" }), _jsx("input", { type: "text", value: settings.slug, onChange: (e) => update('slug', e.target.value), placeholder: "/page-slug", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Template" }), _jsx("input", { type: "text", value: settings.template ?? '', onChange: (e) => update('template', e.target.value), placeholder: "default", className: INPUT_CLASS, readOnly: true })] }), _jsx("p", { className: SECTION_HEADING_CLASS, children: "SEO" }), _jsxs("div", { children: [_jsxs("div", { className: "mb-1 flex items-center justify-between", children: [_jsx("label", { className: "text-foreground text-sm font-medium", children: "Meta Title" }), _jsxs("span", { className: `text-xs ${metaTitleLength > 60 ? 'text-destructive' : 'text-muted-foreground'}`, children: [metaTitleLength, "/60"] })] }), _jsx("input", { type: "text", value: settings.metaTitle ?? '', onChange: (e) => update('metaTitle', e.target.value), placeholder: "SEO title", maxLength: 100, className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsxs("div", { className: "mb-1 flex items-center justify-between", children: [_jsx("label", { className: "text-foreground text-sm font-medium", children: "Meta Description" }), _jsxs("span", { className: `text-xs ${metaDescLength > 160 ? 'text-destructive' : 'text-muted-foreground'}`, children: [metaDescLength, "/160"] })] }), _jsx("textarea", { value: settings.metaDescription ?? '', onChange: (e) => update('metaDescription', e.target.value), placeholder: "Brief description for search engines", rows: 3, maxLength: 250, className: `${INPUT_CLASS} resize-y` })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "OG Image" }), _jsx("input", { type: "text", value: settings.ogImage ?? '', onChange: (e) => update('ogImage', e.target.value), placeholder: "https://example.com/image.jpg", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Focus Keyphrase" }), _jsx("input", { type: "text", value: settings.focusKeyphrase ?? '', onChange: (e) => update('focusKeyphrase', e.target.value), placeholder: "primary keyword", className: INPUT_CLASS })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL_CLASS, children: "Schema Type" }), _jsxs("select", { value: settings.schemaType ?? '', onChange: (e) => update('schemaType', e.target.value), className: INPUT_CLASS, children: [_jsx("option", { value: "", children: "Select schema type..." }), SCHEMA_TYPES.map((type) => (_jsx("option", { value: type, children: type }, type)))] })] })] }));
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=PageSettings.js.map
|
|
@@ -6,8 +6,8 @@ export function PageTemplates({ onNavigate }) {
|
|
|
6
6
|
const { data, loading, error, refetch } = useApiData('/page-templates');
|
|
7
7
|
const templates = data ?? [];
|
|
8
8
|
if (loading) {
|
|
9
|
-
return (_jsxs("div", { className: "flex h-64 items-center justify-center p-4", role: "status", "aria-live": "polite", children: [_jsx(Loader2, { className: "h-6 w-6 animate-spin
|
|
9
|
+
return (_jsxs("div", { className: "flex h-64 items-center justify-center p-4", role: "status", "aria-live": "polite", children: [_jsx(Loader2, { className: "text-primary h-6 w-6 animate-spin" }), _jsx("span", { className: "sr-only", children: "Loading page templates" })] }));
|
|
10
10
|
}
|
|
11
|
-
return (_jsxs("div", { className: "p-4 pr-8", children: [error && (_jsxs("div", { className: "mb-4 flex items-center gap-3 rounded-lg border
|
|
11
|
+
return (_jsxs("div", { className: "p-4 pr-8", children: [error && (_jsxs("div", { className: "border-border bg-card mb-4 flex items-center gap-3 rounded-lg border p-3", children: [_jsx(AlertTriangle, { className: "text-muted-foreground h-5 w-5 shrink-0" }), _jsx("span", { className: "text-foreground flex-1 text-sm", children: error }), _jsx("button", { type: "button", onClick: refetch, className: "border-border text-foreground hover:bg-accent rounded-md border px-3 py-1 text-sm", children: "Retry" })] })), _jsxs("div", { className: "mb-4 flex items-center justify-between", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-foreground mb-1 text-2xl font-medium", children: "Page Templates" }), _jsxs("p", { className: "text-muted-foreground text-sm", children: [templates.length, " saved template", templates.length === 1 ? '' : 's'] })] }), _jsxs("button", { type: "button", onClick: refetch, className: "border-border text-foreground hover:bg-accent inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium", children: [_jsx(RefreshCw, { className: "h-4 w-4" }), "Refresh"] })] }), templates.length === 0 ? (_jsxs("div", { className: "border-border bg-card rounded-lg border p-8 text-center", children: [_jsx(Layers, { className: "text-muted-foreground mx-auto mb-3 h-8 w-8" }), _jsx("h2", { className: "text-foreground mb-1 text-lg font-medium", children: "No page templates yet" }), _jsx("p", { className: "text-muted-foreground mb-4 text-sm", children: "Built-in templates are seeded by the CMS when the templates API is available." }), _jsx("button", { type: "button", onClick: () => onNavigate?.('/saved-sections'), className: "bg-primary text-primary-foreground rounded-md px-4 py-2 text-sm font-medium hover:opacity-90", children: "View Saved Sections" })] })) : (_jsx("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3", children: templates.map((template) => (_jsxs("div", { className: "border-border bg-card rounded-lg border p-4", children: [_jsxs("div", { className: "mb-3 flex items-start justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-foreground text-base font-medium", children: template.name ?? 'Untitled template' }), _jsx("p", { className: "text-muted-foreground mt-1 text-sm", children: template.description ?? 'No description provided.' })] }), template.builtIn && (_jsx("span", { className: "bg-muted text-muted-foreground rounded-full px-2 py-0.5 text-xs", children: "Built-in" }))] }), _jsxs("div", { className: "text-muted-foreground flex items-center justify-between text-sm", children: [_jsx("span", { children: template.category ?? 'content' }), _jsx("span", { children: template.updatedAt ? new Date(template.updatedAt).toLocaleDateString() : '' })] })] }, template.id))) }))] }));
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=PageTemplates.js.map
|
|
@@ -29,11 +29,11 @@ function getScoreLabel(score) {
|
|
|
29
29
|
function StatusIcon({ status }) {
|
|
30
30
|
switch (status) {
|
|
31
31
|
case 'good':
|
|
32
|
-
return _jsx(CheckCircle2, { size: 14, className: "text-green-500
|
|
32
|
+
return _jsx(CheckCircle2, { size: 14, className: "shrink-0 text-green-500" });
|
|
33
33
|
case 'warning':
|
|
34
|
-
return _jsx(AlertCircle, { size: 14, className: "text-amber-500
|
|
34
|
+
return _jsx(AlertCircle, { size: 14, className: "shrink-0 text-amber-500" });
|
|
35
35
|
case 'error':
|
|
36
|
-
return _jsx(XCircle, { size: 14, className: "text-red-500
|
|
36
|
+
return _jsx(XCircle, { size: 14, className: "shrink-0 text-red-500" });
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
function ScoreRing({ score }) {
|
|
@@ -49,13 +49,13 @@ function ScoreSummary({ checks }) {
|
|
|
49
49
|
const passed = checks.filter((c) => c.status === 'good').length;
|
|
50
50
|
const warnings = checks.filter((c) => c.status === 'warning').length;
|
|
51
51
|
const errors = checks.filter((c) => c.status === 'error').length;
|
|
52
|
-
return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(CheckCircle2, { size: 12, className: "text-green-500" }), _jsxs("span", { className: "text-
|
|
52
|
+
return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(CheckCircle2, { size: 12, className: "text-green-500" }), _jsxs("span", { className: "text-muted-foreground text-xs", children: [passed, " passed"] })] }), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(AlertCircle, { size: 12, className: "text-amber-500" }), _jsxs("span", { className: "text-muted-foreground text-xs", children: [warnings, " warnings"] })] }), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(XCircle, { size: 12, className: "text-red-500" }), _jsxs("span", { className: "text-muted-foreground text-xs", children: [errors, " issues"] })] })] }));
|
|
53
53
|
}
|
|
54
54
|
function CollapsibleSection({ title, icon: Icon, expanded, onToggle, children, }) {
|
|
55
|
-
return (_jsxs("div", { className: "border-
|
|
55
|
+
return (_jsxs("div", { className: "border-border border-b last:border-b-0", children: [_jsxs("button", { type: "button", className: "hover:bg-muted/50 flex w-full items-center justify-between px-4 py-3 text-left transition-colors", onClick: onToggle, "aria-expanded": expanded, children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Icon, { size: 14, className: "text-muted-foreground" }), _jsx("span", { className: "text-foreground text-xs font-medium", children: title })] }), expanded ? (_jsx(ChevronUp, { size: 14, className: "text-muted-foreground" })) : (_jsx(ChevronDown, { size: 14, className: "text-muted-foreground" }))] }), expanded && _jsx("div", { className: "px-4 pb-4", children: children })] }));
|
|
56
56
|
}
|
|
57
57
|
function SEOChecksList({ checks }) {
|
|
58
|
-
return (_jsx("div", { className: "flex flex-col gap-2", children: checks.map((check) => (_jsxs("div", { className: "flex items-start gap-2", children: [_jsx(StatusIcon, { status: check.status }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "text-xs font-medium
|
|
58
|
+
return (_jsx("div", { className: "flex flex-col gap-2", children: checks.map((check) => (_jsxs("div", { className: "flex items-start gap-2", children: [_jsx(StatusIcon, { status: check.status }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "text-foreground text-xs font-medium", children: check.label }), _jsx("span", { className: "text-muted-foreground text-xs", children: check.detail })] })] }, check.id))) }));
|
|
59
59
|
}
|
|
60
60
|
function ReadabilityGrid({ readability }) {
|
|
61
61
|
const fleschLabel = readability.fleschScore >= 60
|
|
@@ -63,26 +63,26 @@ function ReadabilityGrid({ readability }) {
|
|
|
63
63
|
: readability.fleschScore >= 30
|
|
64
64
|
? 'Moderate'
|
|
65
65
|
: 'Difficult';
|
|
66
|
-
return (_jsxs("div", { className: "grid grid-cols-2 gap-3", children: [_jsxs("div", { className: "bg-muted/50
|
|
66
|
+
return (_jsxs("div", { className: "grid grid-cols-2 gap-3", children: [_jsxs("div", { className: "bg-muted/50 flex flex-col gap-1 rounded-md p-3", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(BarChart3, { size: 12, className: "text-muted-foreground" }), _jsx("span", { className: "text-muted-foreground text-xs", children: "Flesch Score" })] }), _jsx("span", { className: `text-sm font-medium ${getScoreColor(readability.fleschScore)}`, children: readability.fleschScore }), _jsx("span", { className: "text-muted-foreground text-xs", children: fleschLabel })] }), _jsxs("div", { className: "bg-muted/50 flex flex-col gap-1 rounded-md p-3", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(Type, { size: 12, className: "text-muted-foreground" }), _jsx("span", { className: "text-muted-foreground text-xs", children: "Word Count" })] }), _jsx("span", { className: "text-foreground text-sm font-medium", children: readability.wordCount }), _jsx("span", { className: "text-muted-foreground text-xs", children: readability.wordCount >= 300 ? 'Good length' : 'Short' })] }), _jsxs("div", { className: "bg-muted/50 flex flex-col gap-1 rounded-md p-3", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(FileText, { size: 12, className: "text-muted-foreground" }), _jsx("span", { className: "text-muted-foreground text-xs", children: "Avg Sentence" })] }), _jsxs("span", { className: "text-foreground text-sm font-medium", children: [readability.avgSentenceLength, " words"] }), _jsx("span", { className: "text-muted-foreground text-xs", children: readability.avgSentenceLength <= 20 ? 'Good' : 'Long' })] }), _jsxs("div", { className: "bg-muted/50 flex flex-col gap-1 rounded-md p-3", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(Clock, { size: 12, className: "text-muted-foreground" }), _jsx("span", { className: "text-muted-foreground text-xs", children: "Reading Time" })] }), _jsxs("span", { className: "text-foreground text-sm font-medium", children: [readability.readingTime, " min"] }), _jsxs("span", { className: "text-muted-foreground text-xs", children: ["~", readability.wordCount, " words"] })] })] }));
|
|
67
67
|
}
|
|
68
68
|
function PerBlockHints({ hints }) {
|
|
69
|
-
return (_jsx("div", { className: "flex flex-col gap-2", children: hints.map((hint, index) => (_jsxs("div", { className: "flex items-start gap-2", children: [_jsx(StatusIcon, { status: hint.status }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "text-xs font-medium
|
|
69
|
+
return (_jsx("div", { className: "flex flex-col gap-2", children: hints.map((hint, index) => (_jsxs("div", { className: "flex items-start gap-2", children: [_jsx(StatusIcon, { status: hint.status }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "text-foreground text-xs font-medium", children: hint.label }), _jsx("span", { className: "text-muted-foreground text-xs", children: hint.detail })] })] }, `${hint.id}-${index}`))) }));
|
|
70
70
|
}
|
|
71
71
|
function BasicSEOFields({ pageSettings, onPageSettingsChange, }) {
|
|
72
72
|
const metaTitleLength = (pageSettings.metaTitle || '').length;
|
|
73
73
|
const metaDescLength = (pageSettings.metaDescription || '').length;
|
|
74
|
-
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("label", { className: "text-xs font-medium
|
|
74
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("label", { className: "text-foreground text-xs font-medium", children: "Meta Title" }), _jsxs("span", { className: `text-xs ${metaTitleLength > 60 ? 'text-red-500' : metaTitleLength > 0 ? 'text-muted-foreground' : 'text-muted-foreground'}`, children: [metaTitleLength, "/60"] })] }), _jsx("input", { type: "text", value: pageSettings.metaTitle || '', onChange: (e) => onPageSettingsChange({ metaTitle: e.target.value }), placeholder: "Page title for search engines", className: "bg-input-background border-border text-foreground placeholder:text-muted-foreground focus:ring-primary w-full rounded-md border px-3 py-2 text-sm focus:ring-1 focus:outline-none" })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("label", { className: "text-foreground text-xs font-medium", children: "Meta Description" }), _jsxs("span", { className: `text-xs ${metaDescLength > 160 ? 'text-red-500' : metaDescLength > 0 ? 'text-muted-foreground' : 'text-muted-foreground'}`, children: [metaDescLength, "/160"] })] }), _jsx("textarea", { value: pageSettings.metaDescription || '', onChange: (e) => onPageSettingsChange({ metaDescription: e.target.value }), placeholder: "Brief description of the page content", rows: 3, className: "bg-input-background border-border text-foreground placeholder:text-muted-foreground focus:ring-primary w-full resize-none rounded-md border px-3 py-2 text-sm focus:ring-1 focus:outline-none" })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("label", { className: "text-foreground text-xs font-medium", children: "Focus Keyphrase" }), _jsx("input", { type: "text", value: pageSettings.focusKeyphrase || '', onChange: (e) => onPageSettingsChange({ focusKeyphrase: e.target.value }), placeholder: "Primary keyword or phrase", className: "bg-input-background border-border text-foreground placeholder:text-muted-foreground focus:ring-primary w-full rounded-md border px-3 py-2 text-sm focus:ring-1 focus:outline-none" })] })] }));
|
|
75
75
|
}
|
|
76
76
|
function SearchPreview({ pageSettings }) {
|
|
77
77
|
const title = pageSettings.metaTitle || pageSettings.title || 'Untitled Page';
|
|
78
78
|
const description = pageSettings.metaDescription || 'No description set';
|
|
79
79
|
const slug = pageSettings.slug || 'page';
|
|
80
|
-
return (_jsxs("div", { className: "bg-background rounded-md border
|
|
80
|
+
return (_jsxs("div", { className: "bg-background border-border rounded-md border p-4", children: [_jsx("p", { className: "text-muted-foreground mb-2 text-xs", children: "Google Search Preview" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("p", { className: "text-primary truncate text-sm", children: title }), _jsxs("p", { className: "truncate text-xs text-green-600", children: ["example.com/", slug] }), _jsx("p", { className: "text-muted-foreground line-clamp-2 text-xs", children: description })] })] }));
|
|
81
81
|
}
|
|
82
82
|
function SocialPreview({ pageSettings }) {
|
|
83
83
|
const title = pageSettings.metaTitle || pageSettings.title || 'Untitled Page';
|
|
84
84
|
const description = pageSettings.metaDescription || 'No description set';
|
|
85
|
-
return (_jsxs("div", { className: "bg-background
|
|
85
|
+
return (_jsxs("div", { className: "bg-background border-border overflow-hidden rounded-md border", children: [_jsx("p", { className: "text-muted-foreground px-4 pt-3 pb-2 text-xs", children: "Open Graph Preview" }), pageSettings.ogImage && (_jsx("div", { className: "bg-muted flex h-32 w-full items-center justify-center overflow-hidden", children: _jsx("img", { src: pageSettings.ogImage, alt: "OG preview", className: "h-full w-full object-cover" }) })), !pageSettings.ogImage && (_jsx("div", { className: "bg-muted flex h-32 w-full items-center justify-center", children: _jsx(Globe, { size: 24, className: "text-muted-foreground" }) })), _jsxs("div", { className: "flex flex-col gap-1 p-3", children: [_jsx("p", { className: "text-muted-foreground text-xs uppercase", children: "example.com" }), _jsx("p", { className: "text-foreground truncate text-sm font-medium", children: title }), _jsx("p", { className: "text-muted-foreground line-clamp-2 text-xs", children: description })] })] }));
|
|
86
86
|
}
|
|
87
87
|
export function BuilderSEOPanel({ tree, pageSettings, onPageSettingsChange, selectedNodeId, }) {
|
|
88
88
|
const analysis = useMemo(() => analyzeSEO(tree, pageSettings), [tree, pageSettings]);
|
|
@@ -96,8 +96,8 @@ export function BuilderSEOPanel({ tree, pageSettings, onPageSettingsChange, sele
|
|
|
96
96
|
return analysis.perBlockHints.get(selectedNodeId) || [];
|
|
97
97
|
}, [analysis.perBlockHints, selectedNodeId]);
|
|
98
98
|
if (!tree.children || tree.children.length === 0) {
|
|
99
|
-
return (_jsxs("div", { className: "
|
|
99
|
+
return (_jsxs("div", { className: "flex min-h-[200px] flex-col items-center justify-center p-6 text-center", children: [_jsx(Search, { size: 32, className: "text-muted-foreground mb-3" }), _jsx("p", { className: "text-foreground mb-1 text-sm font-medium", children: "SEO Analysis" }), _jsx("p", { className: "text-muted-foreground text-xs", children: "Add content to your page to see SEO analysis" })] }));
|
|
100
100
|
}
|
|
101
|
-
return (_jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center gap-4 px-4 py-5
|
|
101
|
+
return (_jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "border-border flex items-center gap-4 border-b px-4 py-5", children: [_jsx(ScoreRing, { score: analysis.score }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-foreground text-xs font-medium", children: getScoreLabel(analysis.score) }), _jsx(ScoreSummary, { checks: analysis.checks })] })] }), _jsxs("div", { className: "flex flex-col", children: [_jsx(CollapsibleSection, { title: "SEO Checks", icon: Search, expanded: expandedSections.includes('checks'), onToggle: () => toggleSection('checks'), children: _jsx(SEOChecksList, { checks: analysis.checks }) }), _jsx(CollapsibleSection, { title: "Readability", icon: BarChart3, expanded: expandedSections.includes('readability'), onToggle: () => toggleSection('readability'), children: _jsx(ReadabilityGrid, { readability: analysis.readability }) }), blockHints.length > 0 && (_jsx(CollapsibleSection, { title: "Block Hints", icon: Target, expanded: expandedSections.includes('blockHints'), onToggle: () => toggleSection('blockHints'), children: _jsx(PerBlockHints, { hints: blockHints }) })), _jsx(CollapsibleSection, { title: "Basic SEO", icon: FileText, expanded: expandedSections.includes('basicSeo'), onToggle: () => toggleSection('basicSeo'), children: _jsx(BasicSEOFields, { pageSettings: pageSettings, onPageSettingsChange: onPageSettingsChange }) }), _jsx(CollapsibleSection, { title: "Search Preview", icon: Eye, expanded: expandedSections.includes('searchPreview'), onToggle: () => toggleSection('searchPreview'), children: _jsx(SearchPreview, { pageSettings: pageSettings }) }), _jsx(CollapsibleSection, { title: "Social Preview", icon: Globe, expanded: expandedSections.includes('socialPreview'), onToggle: () => toggleSection('socialPreview'), children: _jsx(SocialPreview, { pageSettings: pageSettings }) })] })] }));
|
|
102
102
|
}
|
|
103
103
|
//# sourceMappingURL=SEOPanel.js.map
|
|
@@ -116,14 +116,14 @@ export function SavedSections({ onNavigate, config }) {
|
|
|
116
116
|
}
|
|
117
117
|
}, onCancel: () => setViewState({ mode: 'list' }) }));
|
|
118
118
|
}
|
|
119
|
-
return (_jsxs("div", { className: "p-4 pr-8", children: [_jsxs("div", { className: "mb-6 flex items-center justify-between", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-medium
|
|
119
|
+
return (_jsxs("div", { className: "p-4 pr-8", children: [_jsxs("div", { className: "mb-6 flex items-center justify-between", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-foreground text-2xl font-medium", children: "Saved Sections" }), _jsx("p", { className: "text-muted-foreground mt-1 text-sm", children: "Reusable sections for the page builder" })] }), _jsxs("button", { type: "button", onClick: () => setViewState({ mode: 'create' }), className: "bg-primary text-primary-foreground hover:bg-primary/90 flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors", children: [_jsx(Plus, { size: 16 }), "Create Section"] })] }), _jsxs("div", { className: "border-border mb-4 flex items-center gap-1 border-b", children: [_jsx(CategoryTab, { label: "All", active: activeCategory === 'all', onClick: () => setActiveCategory('all') }), CATEGORIES.map((cat) => (_jsx(CategoryTab, { label: cat.charAt(0).toUpperCase() + cat.slice(1), active: activeCategory === cat, onClick: () => setActiveCategory(cat) }, cat)))] }), loading && (_jsx("div", { className: "flex items-center justify-center py-16", children: _jsx(Loader2, { className: "text-muted-foreground h-6 w-6 animate-spin" }) })), error && !loading && (_jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [_jsx(AlertTriangle, { size: 24, className: "text-destructive mb-2" }), _jsx("p", { className: "text-muted-foreground mb-3 text-sm", children: error }), _jsx("button", { type: "button", onClick: fetchSections, className: "text-foreground border-border hover:bg-accent rounded-md border px-3 py-1.5 text-sm font-medium transition-colors", children: "Retry" })] })), !loading && !error && filteredSections.length === 0 && (_jsxs("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [_jsx(Layers, { size: 32, className: "text-muted-foreground mb-3" }), _jsx("p", { className: "text-foreground mb-1 text-sm font-medium", children: "No saved sections" }), _jsx("p", { className: "text-muted-foreground mb-4 text-xs", children: activeCategory === 'all'
|
|
120
120
|
? 'Create your first reusable section to get started.'
|
|
121
|
-
: `No sections in the "${activeCategory}" category.` }), activeCategory === 'all' && (_jsxs("button", { type: "button", onClick: () => setViewState({ mode: 'create' }), className: "flex items-center gap-2 rounded-md
|
|
121
|
+
: `No sections in the "${activeCategory}" category.` }), activeCategory === 'all' && (_jsxs("button", { type: "button", onClick: () => setViewState({ mode: 'create' }), className: "bg-primary text-primary-foreground hover:bg-primary/90 flex items-center gap-2 rounded-md px-3 py-1.5 text-sm font-medium transition-colors", children: [_jsx(Plus, { size: 14 }), "Create Section"] }))] })), !loading && !error && filteredSections.length > 0 && (_jsx("div", { className: "grid grid-cols-1 gap-3 lg:grid-cols-2", children: filteredSections.map((section) => (_jsxs("div", { className: "border-border bg-card hover:border-primary/50 rounded-lg border p-4 transition-colors", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-foreground truncate text-sm font-medium", children: section.name }), section.description && (_jsx("p", { className: "text-muted-foreground mt-0.5 line-clamp-2 text-xs", children: section.description }))] }), _jsx("span", { className: `shrink-0 rounded-full px-2 py-0.5 text-xs ${CATEGORY_COLORS[section.category] ?? 'bg-muted text-muted-foreground'}`, children: section.category })] }), _jsxs("div", { className: "text-muted-foreground mt-3 flex items-center gap-4 text-xs", children: [_jsxs("span", { className: "flex items-center gap-1", children: [_jsx(Hash, { size: 12 }), section.usageCount, " use", section.usageCount !== 1 ? 's' : ''] }), _jsxs("span", { className: "flex items-center gap-1", children: [_jsx(Calendar, { size: 12 }), formatDate(section.createdAt)] }), section.tree && (_jsxs("span", { className: "flex items-center gap-1", children: [_jsx(Layers, { size: 12 }), JSON.stringify(section.tree).length > 1000 ? 'Complex' : 'Simple'] }))] }), _jsxs("div", { className: "border-border mt-3 flex items-center gap-1 border-t pt-3", children: [_jsxs("button", { type: "button", onClick: () => setViewState({ mode: 'edit', section }), className: "text-foreground hover:bg-accent flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors", "aria-label": `Edit ${section.name}`, children: [_jsx(Edit, { size: 13 }), "Edit"] }), _jsxs("button", { type: "button", onClick: () => handleDuplicate(section), className: "text-foreground hover:bg-accent flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors", "aria-label": `Duplicate ${section.name}`, children: [_jsx(Copy, { size: 13 }), "Duplicate"] }), deleteConfirmId === section.id ? (_jsxs("div", { className: "ml-auto flex items-center gap-1", children: [_jsx("span", { className: "text-destructive mr-1 text-xs", children: "Delete?" }), _jsx("button", { type: "button", onClick: () => handleDelete(section.id), className: "text-destructive-foreground bg-destructive hover:bg-destructive/90 rounded-md px-2 py-1 text-xs font-medium transition-colors", children: "Yes" }), _jsx("button", { type: "button", onClick: () => setDeleteConfirmId(null), className: "text-foreground border-border hover:bg-accent rounded-md border px-2 py-1 text-xs font-medium transition-colors", children: "No" })] })) : (_jsxs("button", { type: "button", onClick: () => setDeleteConfirmId(section.id), className: "text-destructive hover:bg-destructive/10 ml-auto flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors", "aria-label": `Delete ${section.name}`, children: [_jsx(Trash2, { size: 13 }), "Delete"] }))] })] }, section.id))) }))] }));
|
|
122
122
|
}
|
|
123
123
|
function CategoryTab({ label, active, onClick }) {
|
|
124
|
-
return (_jsx("button", { type: "button", onClick: onClick, className:
|
|
124
|
+
return (_jsx("button", { type: "button", onClick: onClick, className: `-mb-px border-b-2 px-3 py-2 text-sm transition-colors ${active
|
|
125
125
|
? 'border-primary text-foreground font-medium'
|
|
126
|
-
: '
|
|
126
|
+
: 'text-muted-foreground hover:text-foreground border-transparent'}`, children: label }));
|
|
127
127
|
}
|
|
128
128
|
function SectionForm({ initial, saving, onSave, onCancel }) {
|
|
129
129
|
const [name, setName] = useState(initial?.name ?? '');
|
|
@@ -136,6 +136,6 @@ function SectionForm({ initial, saving, onSave, onCancel }) {
|
|
|
136
136
|
onSave({ name: name.trim(), description: description.trim(), category });
|
|
137
137
|
}
|
|
138
138
|
const treeSize = initial?.tree ? JSON.stringify(initial.tree).length : null;
|
|
139
|
-
return (_jsxs("div", { className: "p-4 pr-8", children: [_jsxs("div", { className: "mb-6", children: [_jsxs("button", { type: "button", onClick: onCancel, className: "flex items-center gap-1.5 text-sm
|
|
139
|
+
return (_jsxs("div", { className: "p-4 pr-8", children: [_jsxs("div", { className: "mb-6", children: [_jsxs("button", { type: "button", onClick: onCancel, className: "text-muted-foreground hover:text-foreground mb-3 flex items-center gap-1.5 text-sm transition-colors", "aria-label": "Back to saved sections", children: [_jsx(ArrowLeft, { size: 16 }), "Back"] }), _jsx("h1", { className: "text-foreground text-2xl font-medium", children: initial ? `Edit: ${initial.name}` : 'Create Saved Section' })] }), _jsxs("form", { onSubmit: handleSubmit, className: "max-w-lg space-y-4", children: [_jsxs("div", { children: [_jsxs("label", { htmlFor: "section-name", className: "text-foreground mb-1 block text-sm font-medium", children: ["Name ", _jsx("span", { className: "text-destructive", children: "*" })] }), _jsx("input", { id: "section-name", type: "text", value: name, onChange: (e) => setName(e.target.value), required: true, placeholder: "e.g. Hero Banner", className: "bg-background border-input focus:ring-ring w-full rounded-md border px-3 py-2 text-sm focus:ring-2 focus:outline-none" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "section-description", className: "text-foreground mb-1 block text-sm font-medium", children: "Description" }), _jsx("textarea", { id: "section-description", value: description, onChange: (e) => setDescription(e.target.value), placeholder: "Optional description of this section...", rows: 3, className: "bg-background border-input focus:ring-ring w-full resize-none rounded-md border px-3 py-2 text-sm focus:ring-2 focus:outline-none" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "section-category", className: "text-foreground mb-1 block text-sm font-medium", children: "Category" }), _jsx("select", { id: "section-category", value: category, onChange: (e) => setCategory(e.target.value), className: "bg-background border-input focus:ring-ring w-full rounded-md border px-3 py-2 text-sm focus:ring-2 focus:outline-none", children: CATEGORIES.map((cat) => (_jsx("option", { value: cat, children: cat.charAt(0).toUpperCase() + cat.slice(1) }, cat))) })] }), treeSize !== null && (_jsx("div", { className: "border-border bg-muted rounded-md border p-3", children: _jsxs("p", { className: "text-muted-foreground text-xs", children: ["Section tree editing is available in the page builder. Current tree size:", ' ', (treeSize / 1024).toFixed(1), " KB"] }) })), _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [_jsxs("button", { type: "submit", disabled: saving || !name.trim(), className: "bg-primary text-primary-foreground hover:bg-primary/90 flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50", children: [saving && _jsx(Loader2, { size: 14, className: "animate-spin" }), initial ? 'Save Changes' : 'Create Section'] }), _jsx("button", { type: "button", onClick: onCancel, disabled: saving, className: "text-foreground border-border hover:bg-accent rounded-lg border px-4 py-2 text-sm font-medium transition-colors disabled:opacity-50", children: "Cancel" })] })] })] }));
|
|
140
140
|
}
|
|
141
141
|
//# sourceMappingURL=SavedSections.js.map
|
|
@@ -59,10 +59,10 @@ export function TemplatePicker({ onSelect, onClose }) {
|
|
|
59
59
|
onSelect(template.tree);
|
|
60
60
|
onClose();
|
|
61
61
|
}
|
|
62
|
-
return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center", role: "dialog", "aria-modal": "true", "aria-label": "Choose a template", children: [_jsx("div", { className: "
|
|
62
|
+
return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center", role: "dialog", "aria-modal": "true", "aria-label": "Choose a template", children: [_jsx("div", { className: "motion-safe:animate-in motion-safe:fade-in-0 absolute inset-0 bg-black/50", onClick: onClose, "aria-hidden": "true" }), _jsxs("div", { className: "bg-card border-border relative z-10 flex max-h-[80vh] w-full max-w-2xl flex-col overflow-hidden rounded-xl border shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between px-5 pt-5 pb-3", children: [_jsx("h2", { className: "text-foreground text-lg font-medium", children: "Choose a Template" }), _jsx("button", { type: "button", onClick: onClose, className: "text-muted-foreground hover:text-foreground hover:bg-accent rounded-md p-1.5 transition-colors", "aria-label": "Close", children: _jsx(X, { size: 18 }) })] }), _jsxs("div", { className: "flex-1 overflow-y-auto px-5 pb-5", children: [loading && (_jsx("div", { className: "flex items-center justify-center py-16", children: _jsx(Loader2, { className: "text-muted-foreground h-6 w-6 animate-spin" }) })), error && !loading && (_jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [_jsx(AlertTriangle, { size: 24, className: "text-destructive mb-2" }), _jsx("p", { className: "text-muted-foreground mb-3 text-sm", children: error }), _jsx("button", { type: "button", onClick: fetchTemplates, className: "text-foreground border-border hover:bg-accent rounded-md border px-3 py-1.5 text-sm font-medium transition-colors", children: "Retry" })] })), !loading && !error && (_jsxs("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-3", role: "list", "aria-label": "Available templates", children: [_jsxs("button", { type: "button", role: "listitem", onClick: handleBlankPage, className: "border-border hover:border-primary bg-card group focus:ring-ring flex cursor-pointer flex-col items-center gap-2 rounded-lg border p-4 text-left transition-colors focus:ring-2 focus:outline-none", children: [_jsx("div", { className: "bg-muted text-muted-foreground group-hover:bg-primary/10 group-hover:text-primary flex h-10 w-10 items-center justify-center rounded-md transition-colors", children: _jsx(File, { size: 20 }) }), _jsx("p", { className: "text-foreground text-center text-sm font-medium", children: "Blank Page" }), _jsx("p", { className: "text-muted-foreground text-center text-xs", children: "Start from scratch" })] }), templates.map((template) => {
|
|
63
63
|
const Icon = resolveIcon(template.category);
|
|
64
64
|
const badgeColor = resolveBadgeColor(template.category);
|
|
65
|
-
return (_jsxs("button", { type: "button", role: "listitem", onClick: () => handleTemplateSelect(template), className: "
|
|
65
|
+
return (_jsxs("button", { type: "button", role: "listitem", onClick: () => handleTemplateSelect(template), className: "border-border hover:border-primary bg-card group focus:ring-ring flex cursor-pointer flex-col items-center gap-2 rounded-lg border p-4 text-left transition-colors focus:ring-2 focus:outline-none", children: [_jsx("div", { className: "bg-accent text-foreground group-hover:bg-primary/10 group-hover:text-primary flex h-10 w-10 items-center justify-center rounded-md transition-colors", children: _jsx(Icon, { size: 20 }) }), _jsx("p", { className: "text-foreground w-full truncate text-center text-sm font-medium", children: template.name }), template.description && (_jsx("p", { className: "text-muted-foreground line-clamp-2 text-center text-xs", children: template.description })), _jsx("span", { className: `inline-block rounded-full px-2 py-0.5 text-xs ${badgeColor}`, children: template.category })] }, template.id));
|
|
66
66
|
})] }))] })] })] }));
|
|
67
67
|
}
|
|
68
68
|
//# sourceMappingURL=TemplatePicker.js.map
|
|
@@ -4,16 +4,16 @@ export function CTAPreview({ data, variant = 'banner' }) {
|
|
|
4
4
|
const heading = data.heading || '';
|
|
5
5
|
const body = data.body || '';
|
|
6
6
|
const buttonText = data.buttonText || '';
|
|
7
|
-
const button = (_jsx("span", { className: "inline-block rounded-md
|
|
7
|
+
const button = (_jsx("span", { className: "bg-primary text-primary-foreground inline-block rounded-md px-4 py-2 text-sm", children: buttonText || 'Click Here' }));
|
|
8
8
|
if (variant === 'inline') {
|
|
9
|
-
return (_jsxs("div", { className: "flex items-center justify-between gap-4 rounded-md border
|
|
9
|
+
return (_jsxs("div", { className: "border-border flex items-center justify-between gap-4 rounded-md border p-4", children: [_jsxs("div", { className: "flex-1", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: heading || _jsx("span", { className: "text-muted-foreground", children: "CTA Heading" }) }), body && _jsx("p", { className: "text-muted-foreground mt-1 text-xs", children: body })] }), button] }));
|
|
10
10
|
}
|
|
11
11
|
if (variant === 'floating') {
|
|
12
|
-
return (_jsx("div", { className: "mx-auto max-w-md rounded-lg border
|
|
12
|
+
return (_jsx("div", { className: "border-border bg-card mx-auto max-w-md rounded-lg border p-6 shadow-md", children: _jsxs("div", { className: "text-center", children: [_jsx("h3", { className: "text-foreground text-lg font-medium", children: heading || _jsx("span", { className: "text-muted-foreground", children: "CTA Heading" }) }), (body || !heading) && (_jsx("p", { className: "text-muted-foreground mt-2 text-sm", children: body || 'Supporting text for the call to action' })), _jsx("div", { className: "mt-4", children: button })] }) }));
|
|
13
13
|
}
|
|
14
14
|
if (variant === 'split') {
|
|
15
|
-
return (_jsxs("div", { className: "flex items-center gap-6 rounded-md border
|
|
15
|
+
return (_jsxs("div", { className: "border-border flex items-center gap-6 rounded-md border p-6", children: [_jsxs("div", { className: "flex-1", children: [_jsx("h3", { className: "text-foreground text-lg font-medium", children: heading || _jsx("span", { className: "text-muted-foreground", children: "CTA Heading" }) }), (body || !heading) && (_jsx("p", { className: "text-muted-foreground mt-2 text-sm", children: body || 'Supporting text for the call to action' }))] }), _jsx("div", { className: "shrink-0", children: button })] }));
|
|
16
16
|
}
|
|
17
|
-
return (_jsxs("div", { className: "
|
|
17
|
+
return (_jsxs("div", { className: "border-border bg-accent rounded-md border p-6 text-center", children: [_jsx("h3", { className: "text-foreground text-lg font-medium", children: heading || _jsx("span", { className: "text-muted-foreground", children: "CTA Heading" }) }), (body || !heading) && (_jsx("p", { className: "text-muted-foreground mt-2 text-sm", children: body || 'Supporting text for the call to action' })), _jsx("div", { className: "mt-4", children: button })] }));
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=CTAPreview.js.map
|
|
@@ -17,6 +17,6 @@ export function CardsPreview({ data, variant = 'grid-3' }) {
|
|
|
17
17
|
: variant === 'horizontal'
|
|
18
18
|
? 'flex gap-3 overflow-hidden'
|
|
19
19
|
: 'grid grid-cols-3 gap-3';
|
|
20
|
-
return (_jsx("div", { className: "rounded-md border
|
|
20
|
+
return (_jsx("div", { className: "border-border rounded-md border p-4", children: _jsx("div", { className: gridClass, children: placeholderItems.map((item, i) => (_jsxs("div", { className: `border-border bg-card flex flex-col overflow-hidden rounded-md border ${variant === 'horizontal' ? 'min-w-40' : ''}`, children: [_jsx("div", { className: "bg-muted flex h-20 items-center justify-center", children: item.image ? (_jsx("img", { src: item.image, alt: item.title || '', className: "h-full w-full object-cover" })) : (_jsx(Image, { size: 20, className: "text-muted-foreground" })) }), _jsxs("div", { className: "p-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: item.title || _jsx("span", { className: "text-muted-foreground", children: "Card Title" }) }), item.description && (_jsx("p", { className: "text-muted-foreground mt-1 line-clamp-2 text-xs", children: item.description }))] })] }, i))) }) }));
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=CardsPreview.js.map
|
|
@@ -7,6 +7,6 @@ export function CodePreview({ data, variant = 'embed' }) {
|
|
|
7
7
|
const sandboxed = data.sandboxed;
|
|
8
8
|
const truncated = content.length > 200 ? content.slice(0, 200) + '…' : content;
|
|
9
9
|
const icon = variant === 'html' ? (_jsx(Globe, { size: 14, className: "text-muted-foreground" })) : variant === 'script' ? (_jsx(Terminal, { size: 14, className: "text-muted-foreground" })) : (_jsx(Code, { size: 14, className: "text-muted-foreground" }));
|
|
10
|
-
return (_jsxs("div", { className: "overflow-hidden rounded-md border
|
|
10
|
+
return (_jsxs("div", { className: "border-border overflow-hidden rounded-md border", children: [_jsxs("div", { className: "border-border bg-card flex items-center gap-2 border-b px-3 py-2", children: [icon, _jsx("span", { className: "text-muted-foreground text-xs", children: language || variant }), sandboxed && (_jsx("span", { className: "bg-muted text-muted-foreground ml-auto rounded px-1.5 py-0.5 text-xs", children: "sandboxed" }))] }), _jsx("div", { className: "bg-card p-4", children: truncated ? (_jsx("pre", { className: "text-foreground overflow-hidden font-mono text-xs whitespace-pre-wrap", children: truncated })) : (_jsx("p", { className: "text-muted-foreground font-mono text-xs italic", children: "// Code content goes here\u2026" })) })] }));
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=CodePreview.js.map
|