@actuate-media/cms-admin 0.14.1 → 0.16.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 +148 -2
- package/dist/AdminRoot.js.map +1 -1
- package/dist/__tests__/components/posts-badges.test.d.ts +2 -0
- package/dist/__tests__/components/posts-badges.test.d.ts.map +1 -0
- package/dist/__tests__/components/posts-badges.test.js +68 -0
- package/dist/__tests__/components/posts-badges.test.js.map +1 -0
- package/dist/__tests__/layout/sidebar-posts.test.d.ts +2 -0
- package/dist/__tests__/layout/sidebar-posts.test.d.ts.map +1 -0
- package/dist/__tests__/layout/sidebar-posts.test.js +162 -0
- package/dist/__tests__/layout/sidebar-posts.test.js.map +1 -0
- package/dist/__tests__/lib/page-editor-service.test.d.ts +2 -0
- package/dist/__tests__/lib/page-editor-service.test.d.ts.map +1 -0
- package/dist/__tests__/lib/page-editor-service.test.js +137 -0
- package/dist/__tests__/lib/page-editor-service.test.js.map +1 -0
- package/dist/__tests__/lib/pages-service.test.d.ts +2 -0
- package/dist/__tests__/lib/pages-service.test.d.ts.map +1 -0
- package/dist/__tests__/lib/pages-service.test.js +140 -0
- package/dist/__tests__/lib/pages-service.test.js.map +1 -0
- package/dist/__tests__/lib/post-editor-service.test.d.ts +2 -0
- package/dist/__tests__/lib/post-editor-service.test.d.ts.map +1 -0
- package/dist/__tests__/lib/post-editor-service.test.js +185 -0
- package/dist/__tests__/lib/post-editor-service.test.js.map +1 -0
- package/dist/__tests__/lib/posts-service.test.d.ts +2 -0
- package/dist/__tests__/lib/posts-service.test.d.ts.map +1 -0
- package/dist/__tests__/lib/posts-service.test.js +244 -0
- package/dist/__tests__/lib/posts-service.test.js.map +1 -0
- package/dist/__tests__/views/posts-list-view.test.d.ts +2 -0
- package/dist/__tests__/views/posts-list-view.test.d.ts.map +1 -0
- package/dist/__tests__/views/posts-list-view.test.js +98 -0
- package/dist/__tests__/views/posts-list-view.test.js.map +1 -0
- package/dist/actuate-admin.css +1 -1
- package/dist/components/pages/tag-badges.d.ts +21 -0
- package/dist/components/pages/tag-badges.d.ts.map +1 -0
- package/dist/components/pages/tag-badges.js +56 -0
- package/dist/components/pages/tag-badges.js.map +1 -0
- package/dist/components/posts/badges.d.ts +25 -0
- package/dist/components/posts/badges.d.ts.map +1 -0
- package/dist/components/posts/badges.js +123 -0
- package/dist/components/posts/badges.js.map +1 -0
- package/dist/components/posts/icons.d.ts +12 -0
- package/dist/components/posts/icons.d.ts.map +1 -0
- package/dist/components/posts/icons.js +26 -0
- package/dist/components/posts/icons.js.map +1 -0
- package/dist/layout/Header.d.ts +14 -1
- package/dist/layout/Header.d.ts.map +1 -1
- package/dist/layout/Header.js +10 -3
- package/dist/layout/Header.js.map +1 -1
- package/dist/layout/Layout.d.ts.map +1 -1
- package/dist/layout/Layout.js +78 -2
- package/dist/layout/Layout.js.map +1 -1
- package/dist/layout/Sidebar.d.ts +16 -0
- package/dist/layout/Sidebar.d.ts.map +1 -1
- package/dist/layout/Sidebar.js +176 -49
- package/dist/layout/Sidebar.js.map +1 -1
- package/dist/lib/page-editor-service.d.ts +45 -0
- package/dist/lib/page-editor-service.d.ts.map +1 -0
- package/dist/lib/page-editor-service.js +153 -0
- package/dist/lib/page-editor-service.js.map +1 -0
- package/dist/lib/pages-service.d.ts +143 -0
- package/dist/lib/pages-service.d.ts.map +1 -0
- package/dist/lib/pages-service.js +444 -0
- package/dist/lib/pages-service.js.map +1 -0
- package/dist/lib/post-editor-service.d.ts +57 -0
- package/dist/lib/post-editor-service.d.ts.map +1 -0
- package/dist/lib/post-editor-service.js +234 -0
- package/dist/lib/post-editor-service.js.map +1 -0
- package/dist/lib/posts-service.d.ts +73 -0
- package/dist/lib/posts-service.d.ts.map +1 -0
- package/dist/lib/posts-service.js +245 -0
- package/dist/lib/posts-service.js.map +1 -0
- package/dist/lib/preview-link.d.ts +32 -0
- package/dist/lib/preview-link.d.ts.map +1 -0
- package/dist/lib/preview-link.js +40 -0
- package/dist/lib/preview-link.js.map +1 -0
- package/dist/router/index.d.ts +1 -0
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js +9 -1
- package/dist/router/index.js.map +1 -1
- package/dist/views/Dashboard.d.ts.map +1 -1
- package/dist/views/Dashboard.js +147 -62
- package/dist/views/Dashboard.js.map +1 -1
- package/dist/views/Pages/PageTagManager.d.ts +14 -0
- package/dist/views/Pages/PageTagManager.d.ts.map +1 -0
- package/dist/views/Pages/PageTagManager.js +145 -0
- package/dist/views/Pages/PageTagManager.js.map +1 -0
- package/dist/views/Pages/PagesListView.d.ts +18 -0
- package/dist/views/Pages/PagesListView.d.ts.map +1 -0
- package/dist/views/Pages/PagesListView.js +287 -0
- package/dist/views/Pages/PagesListView.js.map +1 -0
- package/dist/views/Posts/NewPostPicker.d.ts +16 -0
- package/dist/views/Posts/NewPostPicker.d.ts.map +1 -0
- package/dist/views/Posts/NewPostPicker.js +59 -0
- package/dist/views/Posts/NewPostPicker.js.map +1 -0
- package/dist/views/Posts/NewPostTypeInstructions.d.ts +18 -0
- package/dist/views/Posts/NewPostTypeInstructions.d.ts.map +1 -0
- package/dist/views/Posts/NewPostTypeInstructions.js +147 -0
- package/dist/views/Posts/NewPostTypeInstructions.js.map +1 -0
- package/dist/views/Posts/PostTypesView.d.ts +26 -0
- package/dist/views/Posts/PostTypesView.d.ts.map +1 -0
- package/dist/views/Posts/PostTypesView.js +52 -0
- package/dist/views/Posts/PostTypesView.js.map +1 -0
- package/dist/views/Posts/PostsListView.d.ts +25 -0
- package/dist/views/Posts/PostsListView.d.ts.map +1 -0
- package/dist/views/Posts/PostsListView.js +239 -0
- package/dist/views/Posts/PostsListView.js.map +1 -0
- package/dist/views/Posts/post-type-presets.d.ts +32 -0
- package/dist/views/Posts/post-type-presets.d.ts.map +1 -0
- package/dist/views/Posts/post-type-presets.js +72 -0
- package/dist/views/Posts/post-type-presets.js.map +1 -0
- package/dist/views/page-builder/Widgets.d.ts +13 -0
- package/dist/views/page-builder/Widgets.d.ts.map +1 -0
- package/dist/views/page-builder/Widgets.js +15 -0
- package/dist/views/page-builder/Widgets.js.map +1 -0
- package/dist/views/page-editor/AddSectionModal.d.ts +20 -0
- package/dist/views/page-editor/AddSectionModal.d.ts.map +1 -0
- package/dist/views/page-editor/AddSectionModal.js +22 -0
- package/dist/views/page-editor/AddSectionModal.js.map +1 -0
- package/dist/views/page-editor/EditorCanvas.d.ts +18 -0
- package/dist/views/page-editor/EditorCanvas.d.ts.map +1 -0
- package/dist/views/page-editor/EditorCanvas.js +64 -0
- package/dist/views/page-editor/EditorCanvas.js.map +1 -0
- package/dist/views/page-editor/EditorTopBar.d.ts +30 -0
- package/dist/views/page-editor/EditorTopBar.d.ts.map +1 -0
- package/dist/views/page-editor/EditorTopBar.js +42 -0
- package/dist/views/page-editor/EditorTopBar.js.map +1 -0
- package/dist/views/page-editor/PagePreview.d.ts +13 -0
- package/dist/views/page-editor/PagePreview.d.ts.map +1 -0
- package/dist/views/page-editor/PagePreview.js +37 -0
- package/dist/views/page-editor/PagePreview.js.map +1 -0
- package/dist/views/page-editor/PageSectionEditor.d.ts +16 -0
- package/dist/views/page-editor/PageSectionEditor.d.ts.map +1 -0
- package/dist/views/page-editor/PageSectionEditor.js +272 -0
- package/dist/views/page-editor/PageSectionEditor.js.map +1 -0
- package/dist/views/page-editor/PageSettingsModal.d.ts +12 -0
- package/dist/views/page-editor/PageSettingsModal.d.ts.map +1 -0
- package/dist/views/page-editor/PageSettingsModal.js +52 -0
- package/dist/views/page-editor/PageSettingsModal.js.map +1 -0
- package/dist/views/page-editor/SectionInspector.d.ts +17 -0
- package/dist/views/page-editor/SectionInspector.d.ts.map +1 -0
- package/dist/views/page-editor/SectionInspector.js +98 -0
- package/dist/views/page-editor/SectionInspector.js.map +1 -0
- package/dist/views/page-editor/SectionsPanel.d.ts +15 -0
- package/dist/views/page-editor/SectionsPanel.d.ts.map +1 -0
- package/dist/views/page-editor/SectionsPanel.js +43 -0
- package/dist/views/page-editor/SectionsPanel.js.map +1 -0
- package/dist/views/page-editor/ValidationSummary.d.ts +9 -0
- package/dist/views/page-editor/ValidationSummary.d.ts.map +1 -0
- package/dist/views/page-editor/ValidationSummary.js +10 -0
- package/dist/views/page-editor/ValidationSummary.js.map +1 -0
- package/dist/views/page-editor/section-icons.d.ts +4 -0
- package/dist/views/page-editor/section-icons.d.ts.map +1 -0
- package/dist/views/page-editor/section-icons.js +20 -0
- package/dist/views/page-editor/section-icons.js.map +1 -0
- package/dist/views/page-editor/section-types.d.ts +11 -0
- package/dist/views/page-editor/section-types.d.ts.map +1 -0
- package/dist/views/page-editor/section-types.js +10 -0
- package/dist/views/page-editor/section-types.js.map +1 -0
- package/dist/views/page-editor/sections/ArticleBodySection.d.ts +13 -0
- package/dist/views/page-editor/sections/ArticleBodySection.d.ts.map +1 -0
- package/dist/views/page-editor/sections/ArticleBodySection.js +23 -0
- package/dist/views/page-editor/sections/ArticleBodySection.js.map +1 -0
- package/dist/views/page-editor/sections/AuthorBioSection.d.ts +8 -0
- package/dist/views/page-editor/sections/AuthorBioSection.d.ts.map +1 -0
- package/dist/views/page-editor/sections/AuthorBioSection.js +21 -0
- package/dist/views/page-editor/sections/AuthorBioSection.js.map +1 -0
- package/dist/views/page-editor/sections/ByTheNumbersSection.d.ts +5 -0
- package/dist/views/page-editor/sections/ByTheNumbersSection.d.ts.map +1 -0
- package/dist/views/page-editor/sections/ByTheNumbersSection.js +10 -0
- package/dist/views/page-editor/sections/ByTheNumbersSection.js.map +1 -0
- package/dist/views/page-editor/sections/CtaBannerSection.d.ts +5 -0
- package/dist/views/page-editor/sections/CtaBannerSection.d.ts.map +1 -0
- package/dist/views/page-editor/sections/CtaBannerSection.js +10 -0
- package/dist/views/page-editor/sections/CtaBannerSection.js.map +1 -0
- package/dist/views/page-editor/sections/FeatureHighlightSection.d.ts +5 -0
- package/dist/views/page-editor/sections/FeatureHighlightSection.d.ts.map +1 -0
- package/dist/views/page-editor/sections/FeatureHighlightSection.js +18 -0
- package/dist/views/page-editor/sections/FeatureHighlightSection.js.map +1 -0
- package/dist/views/page-editor/sections/GallerySection.d.ts +6 -0
- package/dist/views/page-editor/sections/GallerySection.d.ts.map +1 -0
- package/dist/views/page-editor/sections/GallerySection.js +17 -0
- package/dist/views/page-editor/sections/GallerySection.js.map +1 -0
- package/dist/views/page-editor/sections/HeroBannerSection.d.ts +5 -0
- package/dist/views/page-editor/sections/HeroBannerSection.d.ts.map +1 -0
- package/dist/views/page-editor/sections/HeroBannerSection.js +11 -0
- package/dist/views/page-editor/sections/HeroBannerSection.js.map +1 -0
- package/dist/views/page-editor/sections/MissionSection.d.ts +6 -0
- package/dist/views/page-editor/sections/MissionSection.d.ts.map +1 -0
- package/dist/views/page-editor/sections/MissionSection.js +12 -0
- package/dist/views/page-editor/sections/MissionSection.js.map +1 -0
- package/dist/views/page-editor/sections/PullQuoteSection.d.ts +6 -0
- package/dist/views/page-editor/sections/PullQuoteSection.d.ts.map +1 -0
- package/dist/views/page-editor/sections/PullQuoteSection.js +13 -0
- package/dist/views/page-editor/sections/PullQuoteSection.js.map +1 -0
- package/dist/views/page-editor/sections/RelatedPostsSection.d.ts +12 -0
- package/dist/views/page-editor/sections/RelatedPostsSection.d.ts.map +1 -0
- package/dist/views/page-editor/sections/RelatedPostsSection.js +23 -0
- package/dist/views/page-editor/sections/RelatedPostsSection.js.map +1 -0
- package/dist/views/page-editor/sections/SectionRenderer.d.ts +22 -0
- package/dist/views/page-editor/sections/SectionRenderer.d.ts.map +1 -0
- package/dist/views/page-editor/sections/SectionRenderer.js +52 -0
- package/dist/views/page-editor/sections/SectionRenderer.js.map +1 -0
- package/dist/views/page-editor/sections/index.d.ts +14 -0
- package/dist/views/page-editor/sections/index.d.ts.map +1 -0
- package/dist/views/page-editor/sections/index.js +12 -0
- package/dist/views/page-editor/sections/index.js.map +1 -0
- package/dist/views/page-editor/sections/parts.d.ts +55 -0
- package/dist/views/page-editor/sections/parts.d.ts.map +1 -0
- package/dist/views/page-editor/sections/parts.js +60 -0
- package/dist/views/page-editor/sections/parts.js.map +1 -0
- package/dist/views/page-editor/viewports.d.ts +14 -0
- package/dist/views/page-editor/viewports.d.ts.map +1 -0
- package/dist/views/page-editor/viewports.js +12 -0
- package/dist/views/page-editor/viewports.js.map +1 -0
- package/dist/views/post-editor/PostEditorCanvas.d.ts +21 -0
- package/dist/views/post-editor/PostEditorCanvas.d.ts.map +1 -0
- package/dist/views/post-editor/PostEditorCanvas.js +58 -0
- package/dist/views/post-editor/PostEditorCanvas.js.map +1 -0
- package/dist/views/post-editor/PostFieldsModal.d.ts +12 -0
- package/dist/views/post-editor/PostFieldsModal.d.ts.map +1 -0
- package/dist/views/post-editor/PostFieldsModal.js +53 -0
- package/dist/views/post-editor/PostFieldsModal.js.map +1 -0
- package/dist/views/post-editor/PostHeader.d.ts +15 -0
- package/dist/views/post-editor/PostHeader.d.ts.map +1 -0
- package/dist/views/post-editor/PostHeader.js +27 -0
- package/dist/views/post-editor/PostHeader.js.map +1 -0
- package/dist/views/post-editor/PostHeaderPanel.d.ts +11 -0
- package/dist/views/post-editor/PostHeaderPanel.d.ts.map +1 -0
- package/dist/views/post-editor/PostHeaderPanel.js +21 -0
- package/dist/views/post-editor/PostHeaderPanel.js.map +1 -0
- package/dist/views/post-editor/PostPreview.d.ts +14 -0
- package/dist/views/post-editor/PostPreview.d.ts.map +1 -0
- package/dist/views/post-editor/PostPreview.js +53 -0
- package/dist/views/post-editor/PostPreview.js.map +1 -0
- package/dist/views/post-editor/PostSectionEditor.d.ts +17 -0
- package/dist/views/post-editor/PostSectionEditor.d.ts.map +1 -0
- package/dist/views/post-editor/PostSectionEditor.js +290 -0
- package/dist/views/post-editor/PostSectionEditor.js.map +1 -0
- package/dist/views/post-editor/PostTemplateEditor.d.ts +9 -0
- package/dist/views/post-editor/PostTemplateEditor.d.ts.map +1 -0
- package/dist/views/post-editor/PostTemplateEditor.js +144 -0
- package/dist/views/post-editor/PostTemplateEditor.js.map +1 -0
- package/package.json +2 -2
- package/src/AdminRoot.tsx +213 -2
- package/src/__tests__/components/posts-badges.test.tsx +77 -0
- package/src/__tests__/layout/sidebar-posts.test.ts +179 -0
- package/src/__tests__/lib/page-editor-service.test.ts +173 -0
- package/src/__tests__/lib/pages-service.test.ts +157 -0
- package/src/__tests__/lib/post-editor-service.test.ts +215 -0
- package/src/__tests__/lib/posts-service.test.ts +279 -0
- package/src/__tests__/views/posts-list-view.test.ts +110 -0
- package/src/components/pages/tag-badges.tsx +104 -0
- package/src/components/posts/badges.tsx +170 -0
- package/src/components/posts/icons.ts +40 -0
- package/src/layout/Header.tsx +90 -43
- package/src/layout/Layout.tsx +166 -1
- package/src/layout/Sidebar.tsx +287 -101
- package/src/lib/page-editor-service.ts +233 -0
- package/src/lib/pages-service.ts +599 -0
- package/src/lib/post-editor-service.ts +342 -0
- package/src/lib/posts-service.ts +366 -0
- package/src/lib/preview-link.ts +63 -0
- package/src/router/index.ts +10 -1
- package/src/views/Dashboard.tsx +270 -131
- package/src/views/Pages/PageTagManager.tsx +436 -0
- package/src/views/Pages/PagesListView.tsx +944 -0
- package/src/views/Posts/NewPostPicker.tsx +147 -0
- package/src/views/Posts/NewPostTypeInstructions.tsx +344 -0
- package/src/views/Posts/PostTypesView.tsx +194 -0
- package/src/views/Posts/PostsListView.tsx +869 -0
- package/src/views/Posts/post-type-presets.ts +105 -0
- package/src/views/page-builder/Widgets.tsx +44 -0
- package/src/views/page-editor/AddSectionModal.tsx +56 -0
- package/src/views/page-editor/EditorCanvas.tsx +127 -0
- package/src/views/page-editor/EditorTopBar.tsx +233 -0
- package/src/views/page-editor/PagePreview.tsx +96 -0
- package/src/views/page-editor/PageSectionEditor.tsx +476 -0
- package/src/views/page-editor/PageSettingsModal.tsx +154 -0
- package/src/views/page-editor/SectionInspector.tsx +599 -0
- package/src/views/page-editor/SectionsPanel.tsx +270 -0
- package/src/views/page-editor/ValidationSummary.tsx +53 -0
- package/src/views/page-editor/section-icons.ts +33 -0
- package/src/views/page-editor/section-types.ts +27 -0
- package/src/views/page-editor/sections/ArticleBodySection.tsx +57 -0
- package/src/views/page-editor/sections/AuthorBioSection.tsx +61 -0
- package/src/views/page-editor/sections/ByTheNumbersSection.tsx +41 -0
- package/src/views/page-editor/sections/CtaBannerSection.tsx +29 -0
- package/src/views/page-editor/sections/FeatureHighlightSection.tsx +63 -0
- package/src/views/page-editor/sections/GallerySection.tsx +54 -0
- package/src/views/page-editor/sections/HeroBannerSection.tsx +44 -0
- package/src/views/page-editor/sections/MissionSection.tsx +22 -0
- package/src/views/page-editor/sections/PullQuoteSection.tsx +27 -0
- package/src/views/page-editor/sections/RelatedPostsSection.tsx +55 -0
- package/src/views/page-editor/sections/SectionRenderer.tsx +102 -0
- package/src/views/page-editor/sections/index.ts +13 -0
- package/src/views/page-editor/sections/parts.tsx +113 -0
- package/src/views/page-editor/viewports.ts +25 -0
- package/src/views/post-editor/PostEditorCanvas.tsx +123 -0
- package/src/views/post-editor/PostFieldsModal.tsx +196 -0
- package/src/views/post-editor/PostHeader.tsx +87 -0
- package/src/views/post-editor/PostHeaderPanel.tsx +107 -0
- package/src/views/post-editor/PostPreview.tsx +114 -0
- package/src/views/post-editor/PostSectionEditor.tsx +506 -0
- package/src/views/post-editor/PostTemplateEditor.tsx +347 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { Eye, EyeOff, Plus, X } from 'lucide-react';
|
|
5
|
+
import { MediaPickerModal } from '../../components/MediaPickerModal.js';
|
|
6
|
+
import { getSectionType } from './section-types.js';
|
|
7
|
+
const LABEL = 'text-foreground mb-1 block text-xs font-medium';
|
|
8
|
+
const INPUT = 'border-input bg-input-background text-foreground focus-visible:ring-ring w-full rounded-md border px-2.5 py-1.5 text-sm focus-visible:ring-2 focus-visible:outline-none';
|
|
9
|
+
export function SectionInspector({ section, canEdit, onClose, onContentChange, onSettingsChange, onMetaChange, onToggleVisibility, }) {
|
|
10
|
+
const def = getSectionType(section.sectionType);
|
|
11
|
+
// Escape closes the inspector.
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
function onKey(e) {
|
|
14
|
+
if (e.key === 'Escape')
|
|
15
|
+
onClose();
|
|
16
|
+
}
|
|
17
|
+
document.addEventListener('keydown', onKey);
|
|
18
|
+
return () => document.removeEventListener('keydown', onKey);
|
|
19
|
+
}, [onClose]);
|
|
20
|
+
return (_jsxs("aside", { role: "dialog", "aria-label": `Edit ${section.name}`, className: "bg-card border-border flex h-full w-80 shrink-0 flex-col border-l", children: [_jsxs("div", { className: "border-border flex items-center justify-between border-b px-4 py-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("h2", { className: "text-foreground truncate text-sm font-medium", children: section.name }), _jsx("p", { className: "text-muted-foreground text-xs", children: def?.name ?? 'Section' })] }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close inspector", className: "text-muted-foreground hover:text-foreground hover:bg-accent rounded p-1", children: _jsx(X, { className: "h-4 w-4", "aria-hidden": true }) })] }), _jsxs("div", { className: "flex-1 space-y-6 overflow-y-auto p-4", children: [!canEdit && (_jsx("p", { className: "border-border bg-muted text-muted-foreground rounded-md border p-2 text-xs", children: "You have read-only access to this page." })), _jsxs("fieldset", { disabled: !canEdit, className: "space-y-3", children: [_jsx("legend", { className: "text-muted-foreground mb-2 text-[10px] font-semibold tracking-wider uppercase", children: "Content" }), def?.fields.map((field) => (_jsx(ContentField, { field: field, value: section.content[field.key], onChange: (v) => onContentChange({ [field.key]: v }) }, field.key)))] }), _jsxs("fieldset", { disabled: !canEdit, className: "space-y-3", children: [_jsx("legend", { className: "text-muted-foreground mb-2 text-[10px] font-semibold tracking-wider uppercase", children: "Section settings" }), _jsxs("div", { children: [_jsx("label", { className: LABEL, htmlFor: "insp-name", children: "Section name" }), _jsx("input", { id: "insp-name", className: INPUT, value: section.name, onChange: (e) => onMetaChange({ name: e.target.value }) })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL, htmlFor: "insp-internal", children: "Internal label" }), _jsx("input", { id: "insp-internal", className: INPUT, placeholder: "Team-only note (optional)", value: section.internalLabel ?? '', onChange: (e) => onMetaChange({ internalLabel: e.target.value }) })] }), _jsxs("button", { type: "button", onClick: onToggleVisibility, disabled: !canEdit, "aria-pressed": !section.visible, className: "border-border text-foreground hover:bg-accent flex w-full items-center justify-between rounded-md border px-2.5 py-1.5 text-sm disabled:opacity-50", children: [_jsxs("span", { className: "flex items-center gap-2", children: [section.visible ? (_jsx(Eye, { className: "h-4 w-4", "aria-hidden": true })) : (_jsx(EyeOff, { className: "h-4 w-4", "aria-hidden": true })), section.visible ? 'Visible on page' : 'Hidden from page'] }), _jsx("span", { className: "text-muted-foreground text-xs", children: section.visible ? 'Hide' : 'Show' })] })] }), _jsxs("fieldset", { disabled: !canEdit, className: "space-y-3", children: [_jsx("legend", { className: "text-muted-foreground mb-2 text-[10px] font-semibold tracking-wider uppercase", children: "Appearance" }), _jsxs("div", { children: [_jsx("label", { className: LABEL, htmlFor: "insp-bg", children: "Background" }), _jsxs("select", { id: "insp-bg", className: INPUT, value: section.settings.backgroundType ?? 'none', onChange: (e) => onSettingsChange({
|
|
21
|
+
backgroundType: e.target.value,
|
|
22
|
+
}), children: [_jsx("option", { value: "none", children: "White" }), _jsx("option", { value: "solid", children: "Solid color" }), _jsx("option", { value: "gradient", children: "Gradient" })] })] }), section.settings.backgroundType && section.settings.backgroundType !== 'none' && (_jsxs("div", { children: [_jsx("label", { className: LABEL, htmlFor: "insp-bgcolor", children: "Color" }), _jsxs("select", { id: "insp-bgcolor", className: INPUT, value: section.settings.backgroundColor ?? 'purple', onChange: (e) => onSettingsChange({ backgroundColor: e.target.value }), children: [_jsx("option", { value: "purple", children: "Purple" }), _jsx("option", { value: "muted", children: "Light gray" })] })] })), _jsxs("div", { children: [_jsx("label", { className: LABEL, htmlFor: "insp-pad", children: "Spacing" }), _jsxs("select", { id: "insp-pad", className: INPUT, value: section.settings.paddingY ?? 'lg', onChange: (e) => onSettingsChange({ paddingY: e.target.value }), children: [_jsx("option", { value: "sm", children: "Small" }), _jsx("option", { value: "md", children: "Medium" }), _jsx("option", { value: "lg", children: "Large" }), _jsx("option", { value: "xl", children: "Extra large" })] })] })] }), _jsxs("fieldset", { disabled: !canEdit, className: "space-y-3", children: [_jsx("legend", { className: "text-muted-foreground mb-2 text-[10px] font-semibold tracking-wider uppercase", children: "Advanced" }), _jsxs("div", { children: [_jsx("label", { className: LABEL, htmlFor: "insp-anchor", children: "Anchor ID" }), _jsx("input", { id: "insp-anchor", className: INPUT, placeholder: "e.g. features", value: section.settings.anchorId ?? '', onChange: (e) => onSettingsChange({ anchorId: e.target.value }) })] }), _jsxs("div", { children: [_jsx("label", { className: LABEL, htmlFor: "insp-css", children: "CSS class" }), _jsx("input", { id: "insp-css", className: INPUT, placeholder: "custom-class", value: section.settings.cssClass ?? '', onChange: (e) => onSettingsChange({ cssClass: e.target.value }) })] })] })] })] }));
|
|
23
|
+
}
|
|
24
|
+
// ─── Field renderers ─────────────────────────────────────────────────
|
|
25
|
+
function ContentField({ field, value, onChange, }) {
|
|
26
|
+
const id = `insp-field-${field.key}`;
|
|
27
|
+
const text = typeof value === 'string' ? value : '';
|
|
28
|
+
if (field.type === 'stats') {
|
|
29
|
+
return _jsx(StatsField, { label: field.label, value: value, onChange: onChange });
|
|
30
|
+
}
|
|
31
|
+
if (field.type === 'gallery') {
|
|
32
|
+
return _jsx(GalleryField, { label: field.label, value: value, onChange: onChange });
|
|
33
|
+
}
|
|
34
|
+
if (field.type === 'boolean') {
|
|
35
|
+
return _jsx(BooleanField, { id: id, field: field, value: value === true, onChange: onChange });
|
|
36
|
+
}
|
|
37
|
+
if (field.type === 'relationship') {
|
|
38
|
+
return _jsx(RelationshipField, { id: id, field: field, value: value, onChange: onChange });
|
|
39
|
+
}
|
|
40
|
+
if (field.type === 'media') {
|
|
41
|
+
return _jsx(MediaField, { id: id, field: field, value: text, onChange: onChange });
|
|
42
|
+
}
|
|
43
|
+
if (field.type === 'select') {
|
|
44
|
+
return (_jsxs("div", { children: [_jsx("label", { className: LABEL, htmlFor: id, children: field.label }), _jsx("select", { id: id, className: INPUT, value: text, onChange: (e) => onChange(e.target.value), children: field.options?.map((o) => (_jsx("option", { value: o.value, children: o.label }, o.value))) })] }));
|
|
45
|
+
}
|
|
46
|
+
if (field.type === 'textarea' || field.type === 'richText') {
|
|
47
|
+
return (_jsxs("div", { children: [_jsxs("label", { className: LABEL, htmlFor: id, children: [field.label, field.required && _jsx("span", { className: "text-destructive ml-0.5", children: "*" })] }), _jsx("textarea", { id: id, className: `${INPUT} resize-y ${field.type === 'richText' ? 'min-h-[140px]' : 'min-h-[72px]'}`, value: text, placeholder: field.placeholder, onChange: (e) => onChange(e.target.value) }), field.help && _jsx("p", { className: "text-muted-foreground mt-1 text-xs", children: field.help })] }));
|
|
48
|
+
}
|
|
49
|
+
return (_jsxs("div", { children: [_jsxs("label", { className: LABEL, htmlFor: id, children: [field.label, field.required && _jsx("span", { className: "text-destructive ml-0.5", children: "*" })] }), _jsx("input", { id: id, type: field.type === 'url' ? 'url' : 'text', className: INPUT, value: text, placeholder: field.placeholder, onChange: (e) => onChange(e.target.value) }), field.help && _jsx("p", { className: "text-muted-foreground mt-1 text-xs", children: field.help })] }));
|
|
50
|
+
}
|
|
51
|
+
function MediaField({ id, field, value, onChange, }) {
|
|
52
|
+
const [open, setOpen] = useState(false);
|
|
53
|
+
return (_jsxs("div", { children: [_jsx("label", { className: LABEL, htmlFor: id, children: field.label }), _jsxs("div", { className: "flex gap-2", children: [_jsx("input", { id: id, className: `${INPUT} flex-1`, placeholder: "https://\u2026", value: value, onChange: (e) => onChange(e.target.value) }), _jsx("button", { type: "button", onClick: () => setOpen(true), className: "bg-accent text-foreground border-border hover:bg-accent/80 rounded-md border px-3 py-1.5 text-xs font-medium", children: "Browse" })] }), value && (_jsx("div", { className: "border-border bg-muted mt-2 overflow-hidden rounded-md border", children: _jsx("img", { src: value, alt: "", className: "h-28 w-full object-contain" }) })), _jsx(MediaPickerModal, { open: open, onClose: () => setOpen(false), onSelect: (url) => {
|
|
54
|
+
onChange(url);
|
|
55
|
+
setOpen(false);
|
|
56
|
+
}, accept: "image/*" })] }));
|
|
57
|
+
}
|
|
58
|
+
function BooleanField({ id, field, value, onChange, }) {
|
|
59
|
+
return (_jsxs("div", { children: [_jsxs("button", { type: "button", id: id, role: "switch", "aria-checked": value, onClick: () => onChange(!value), className: "border-border text-foreground hover:bg-accent flex w-full items-center justify-between rounded-md border px-2.5 py-1.5 text-sm", children: [_jsx("span", { children: field.label }), _jsx("span", { "aria-hidden": true, className: `relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors ${value ? 'bg-primary' : 'bg-muted'}`, children: _jsx("span", { className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${value ? 'translate-x-4' : 'translate-x-0.5'}` }) })] }), field.help && _jsx("p", { className: "text-muted-foreground mt-1 text-xs", children: field.help })] }));
|
|
60
|
+
}
|
|
61
|
+
function RelationshipField({ id, field, value, onChange, }) {
|
|
62
|
+
// Stored as an array of slugs; edited as a newline/comma-separated list
|
|
63
|
+
// so authors can hand-pick referenced documents without a live picker.
|
|
64
|
+
const slugs = Array.isArray(value) ? value : [];
|
|
65
|
+
const text = slugs.join('\n');
|
|
66
|
+
return (_jsxs("div", { children: [_jsx("label", { className: LABEL, htmlFor: id, children: field.label }), _jsx("textarea", { id: id, className: `${INPUT} min-h-[72px] resize-y`, placeholder: "one-slug-per-line", value: text, onChange: (e) => onChange(e.target.value
|
|
67
|
+
.split(/[\n,]/)
|
|
68
|
+
.map((s) => s.trim())
|
|
69
|
+
.filter(Boolean)) }), field.help && _jsx("p", { className: "text-muted-foreground mt-1 text-xs", children: field.help })] }));
|
|
70
|
+
}
|
|
71
|
+
function GalleryField({ label, value, onChange, }) {
|
|
72
|
+
const rows = Array.isArray(value) ? value : [];
|
|
73
|
+
function update(index, patch) {
|
|
74
|
+
onChange(rows.map((r, i) => (i === index ? { ...r, ...patch } : r)));
|
|
75
|
+
}
|
|
76
|
+
function remove(index) {
|
|
77
|
+
onChange(rows.filter((_, i) => i !== index));
|
|
78
|
+
}
|
|
79
|
+
function add() {
|
|
80
|
+
onChange([...rows, { url: '', alt: '', caption: '' }]);
|
|
81
|
+
}
|
|
82
|
+
return (_jsxs("div", { children: [_jsx("span", { className: LABEL, children: label }), _jsx("div", { className: "space-y-3", children: rows.map((row, i) => (_jsxs("div", { className: "border-border rounded-md border p-2", children: [_jsxs("div", { className: "mb-2 flex items-center justify-between", children: [_jsxs("span", { className: "text-muted-foreground text-xs", children: ["Image ", i + 1] }), _jsx("button", { type: "button", onClick: () => remove(i), "aria-label": `Remove image ${i + 1}`, className: "text-muted-foreground hover:text-destructive rounded p-0.5", children: _jsx(X, { className: "h-3.5 w-3.5", "aria-hidden": true }) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("input", { className: INPUT, placeholder: "Image URL (https://\u2026)", value: row.url ?? '', onChange: (e) => update(i, { url: e.target.value }), "aria-label": `Image ${i + 1} URL` }), _jsx("input", { className: INPUT, placeholder: "Alt text (for accessibility)", value: row.alt ?? '', onChange: (e) => update(i, { alt: e.target.value }), "aria-label": `Image ${i + 1} alt text` })] })] }, i))) }), _jsxs("button", { type: "button", onClick: add, className: "border-border text-foreground hover:bg-accent mt-2 flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed px-2 py-1.5 text-xs font-medium", children: [_jsx(Plus, { className: "h-3.5 w-3.5", "aria-hidden": true }), "Add image"] })] }));
|
|
83
|
+
}
|
|
84
|
+
function StatsField({ label, value, onChange, }) {
|
|
85
|
+
const rows = Array.isArray(value) ? value : [];
|
|
86
|
+
function update(index, patch) {
|
|
87
|
+
const next = rows.map((r, i) => (i === index ? { ...r, ...patch } : r));
|
|
88
|
+
onChange(next);
|
|
89
|
+
}
|
|
90
|
+
function remove(index) {
|
|
91
|
+
onChange(rows.filter((_, i) => i !== index));
|
|
92
|
+
}
|
|
93
|
+
function add() {
|
|
94
|
+
onChange([...rows, { value: '', label: '', description: '' }]);
|
|
95
|
+
}
|
|
96
|
+
return (_jsxs("div", { children: [_jsx("span", { className: LABEL, children: label }), _jsx("div", { className: "space-y-3", children: rows.map((row, i) => (_jsxs("div", { className: "border-border rounded-md border p-2", children: [_jsxs("div", { className: "mb-2 flex items-center justify-between", children: [_jsxs("span", { className: "text-muted-foreground text-xs", children: ["Stat ", i + 1] }), _jsx("button", { type: "button", onClick: () => remove(i), "aria-label": `Remove stat ${i + 1}`, className: "text-muted-foreground hover:text-destructive rounded p-0.5", children: _jsx(X, { className: "h-3.5 w-3.5", "aria-hidden": true }) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("input", { className: INPUT, placeholder: "Value (e.g. 99.99%)", value: row.value ?? '', onChange: (e) => update(i, { value: e.target.value }), "aria-label": `Stat ${i + 1} value` }), _jsx("input", { className: INPUT, placeholder: "Label (e.g. Uptime)", value: row.label ?? '', onChange: (e) => update(i, { label: e.target.value }), "aria-label": `Stat ${i + 1} label` })] })] }, i))) }), _jsxs("button", { type: "button", onClick: add, className: "border-border text-foreground hover:bg-accent mt-2 flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed px-2 py-1.5 text-xs font-medium", children: [_jsx(Plus, { className: "h-3.5 w-3.5", "aria-hidden": true }), "Add stat"] })] }));
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=SectionInspector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SectionInspector.js","sourceRoot":"","sources":["../../../src/views/page-editor/SectionInspector.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAA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,GACjC,EACF,gBACE,SAAS,EAAE,KAAK,EAChB,WAAW,EAAC,qBAAqB,EACjC,KAAK,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,EACtB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,gBACzC,QAAQ,CAAC,GAAG,CAAC,QAAQ,GACjC,IACE,KA3BE,CAAC,CA4BL,CACP,CAAC,GACE,EACN,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EACZ,SAAS,EAAC,oKAAoK,aAE9K,KAAC,IAAI,IAAC,SAAS,EAAC,aAAa,wBAAe,gBAErC,IACL,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PageSection } from '../../lib/page-editor-service.js';
|
|
2
|
+
interface SectionsPanelProps {
|
|
3
|
+
sections: PageSection[];
|
|
4
|
+
selectedId: string | null;
|
|
5
|
+
canEdit: boolean;
|
|
6
|
+
onSelect: (id: string) => void;
|
|
7
|
+
onReorder: (orderedIds: string[]) => void;
|
|
8
|
+
onToggleVisibility: (id: string) => void;
|
|
9
|
+
onDuplicate: (id: string) => void;
|
|
10
|
+
onRequestDelete: (id: string) => void;
|
|
11
|
+
onAdd: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function SectionsPanel({ sections, selectedId, canEdit, onSelect, onReorder, onToggleVisibility, onDuplicate, onRequestDelete, onAdd, }: SectionsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=SectionsPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SectionsPanel.d.ts","sourceRoot":"","sources":["../../../src/views/page-editor/SectionsPanel.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAGnE,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACzC,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,UAAU,EACV,OAAO,EACP,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,KAAK,GACN,EAAE,kBAAkB,2CAgFpB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Copy, Eye, EyeOff, GripVertical, MoreVertical, Plus, Trash2, } from 'lucide-react';
|
|
4
|
+
import { DndContext, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors, } from '@dnd-kit/core';
|
|
5
|
+
import { SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy, } from '@dnd-kit/sortable';
|
|
6
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
7
|
+
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
8
|
+
import { sectionIconFor } from './section-icons.js';
|
|
9
|
+
export function SectionsPanel({ sections, selectedId, canEdit, onSelect, onReorder, onToggleVisibility, onDuplicate, onRequestDelete, onAdd, }) {
|
|
10
|
+
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 4 } }), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
|
|
11
|
+
function handleDragEnd(event) {
|
|
12
|
+
const { active, over } = event;
|
|
13
|
+
if (!over || active.id === over.id)
|
|
14
|
+
return;
|
|
15
|
+
const ids = sections.map((s) => s.id);
|
|
16
|
+
const from = ids.indexOf(String(active.id));
|
|
17
|
+
const to = ids.indexOf(String(over.id));
|
|
18
|
+
if (from === -1 || to === -1)
|
|
19
|
+
return;
|
|
20
|
+
const next = ids.slice();
|
|
21
|
+
const [moved] = next.splice(from, 1);
|
|
22
|
+
next.splice(to, 0, moved);
|
|
23
|
+
onReorder(next);
|
|
24
|
+
}
|
|
25
|
+
return (_jsxs("aside", { className: "bg-card border-border flex h-full w-72 shrink-0 flex-col border-r", "aria-label": "Page sections", children: [_jsx("div", { className: "border-border flex items-center justify-between border-b px-4 py-3", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("h2", { className: "text-foreground text-sm font-medium", children: "Sections" }), _jsx("span", { className: "bg-muted text-muted-foreground rounded-full px-2 py-0.5 text-xs font-medium tabular-nums", children: sections.length })] }) }), _jsx("div", { className: "flex-1 overflow-y-auto p-2", children: sections.length === 0 ? (_jsx("p", { className: "text-muted-foreground px-2 py-6 text-center text-sm", children: "No sections yet. Add one below to get started." })) : (_jsx(DndContext, { sensors: sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, children: _jsx(SortableContext, { items: sections.map((s) => s.id), strategy: verticalListSortingStrategy, children: _jsx("ul", { className: "space-y-1", children: sections.map((section) => (_jsx(SortableSectionItem, { section: section, selected: section.id === selectedId, canEdit: canEdit, onSelect: onSelect, onToggleVisibility: onToggleVisibility, onDuplicate: onDuplicate, onRequestDelete: onRequestDelete }, section.id))) }) }) })) }), _jsx("div", { className: "border-border border-t p-3", children: _jsxs("button", { type: "button", onClick: onAdd, disabled: !canEdit, className: "border-border text-foreground hover:bg-accent flex w-full items-center justify-center gap-2 rounded-lg border border-dashed px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50", children: [_jsx(Plus, { className: "h-4 w-4", "aria-hidden": true }), "Add Section"] }) })] }));
|
|
26
|
+
}
|
|
27
|
+
function SortableSectionItem({ section, selected, canEdit, onSelect, onToggleVisibility, onDuplicate, onRequestDelete, }) {
|
|
28
|
+
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
|
|
29
|
+
id: section.id,
|
|
30
|
+
disabled: !canEdit,
|
|
31
|
+
});
|
|
32
|
+
const Icon = sectionIconFor(section.sectionType);
|
|
33
|
+
const style = {
|
|
34
|
+
transform: CSS.Transform.toString(transform),
|
|
35
|
+
transition,
|
|
36
|
+
zIndex: isDragging ? 10 : undefined,
|
|
37
|
+
};
|
|
38
|
+
return (_jsx("li", { ref: setNodeRef, style: style, children: _jsxs("div", { className: `group flex items-center gap-2 rounded-lg border px-2 py-2 ${selected ? 'border-primary bg-accent' : 'hover:bg-accent/60 border-transparent'} ${isDragging ? 'shadow-md' : ''}`, children: [_jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground shrink-0 cursor-grab touch-none disabled:cursor-not-allowed disabled:opacity-40", "aria-label": `Drag to reorder ${section.name}`, disabled: !canEdit, ...attributes, ...listeners, children: _jsx(GripVertical, { className: "h-4 w-4", "aria-hidden": true }) }), _jsxs("button", { type: "button", onClick: () => onSelect(section.id), className: "flex min-w-0 flex-1 items-center gap-2 text-left", children: [_jsx("span", { className: "bg-muted text-muted-foreground flex h-7 w-7 shrink-0 items-center justify-center rounded-md", children: _jsx(Icon, { className: "h-4 w-4", "aria-hidden": true }) }), _jsx("span", { className: `truncate text-sm ${section.visible ? 'text-foreground' : 'text-muted-foreground line-through'}`, children: section.name })] }), _jsx("button", { type: "button", onClick: () => onToggleVisibility(section.id), disabled: !canEdit, "aria-pressed": !section.visible, "aria-label": section.visible ? `Hide ${section.name}` : `Show ${section.name}`, className: "text-muted-foreground hover:text-foreground shrink-0 rounded p-1 disabled:opacity-40", children: section.visible ? (_jsx(Eye, { className: "h-4 w-4", "aria-hidden": true })) : (_jsx(EyeOff, { className: "h-4 w-4", "aria-hidden": true })) }), _jsxs(DropdownMenu.Root, { children: [_jsx(DropdownMenu.Trigger, { asChild: true, children: _jsx("button", { type: "button", disabled: !canEdit, "aria-label": `More actions for ${section.name}`, className: "text-muted-foreground hover:text-foreground shrink-0 rounded p-1 disabled:opacity-40", children: _jsx(MoreVertical, { className: "h-4 w-4", "aria-hidden": true }) }) }), _jsx(DropdownMenu.Portal, { children: _jsxs(DropdownMenu.Content, { align: "end", sideOffset: 4, className: "border-border bg-popover z-[70] min-w-44 rounded-lg border p-1 shadow-md", children: [_jsx(MenuItem, { onSelect: () => onDuplicate(section.id), icon: Copy, children: "Duplicate" }), _jsx(DropdownMenu.Separator, { className: "bg-border my-1 h-px" }), _jsx(MenuItem, { onSelect: () => onRequestDelete(section.id), icon: Trash2, destructive: true, children: "Delete" })] }) })] })] }) }));
|
|
39
|
+
}
|
|
40
|
+
function MenuItem({ children, icon: Icon, onSelect, destructive, }) {
|
|
41
|
+
return (_jsxs(DropdownMenu.Item, { onSelect: onSelect, className: `flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none ${destructive ? 'text-destructive focus:bg-destructive/10' : 'text-foreground focus:bg-accent'}`, children: [_jsx(Icon, { className: "h-4 w-4", "aria-hidden": true }), children] }));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=SectionsPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SectionsPanel.js","sourceRoot":"","sources":["../../../src/views/page-editor/SectionsPanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACL,IAAI,EACJ,GAAG,EACH,MAAM,EACN,YAAY,EAEZ,YAAY,EACZ,IAAI,EACJ,MAAM,GACP,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,E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,aAEpF,KAAC,QAAQ,IAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,0BAElD,EACX,KAAC,YAAY,CAAC,SAAS,IAAC,SAAS,EAAC,qBAAqB,GAAG,EAC1D,KAAC,QAAQ,IAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,6BAErE,IACU,GACH,IACJ,IAChB,GACH,CACN,CAAA;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,EAChB,QAAQ,EACR,IAAI,EAAE,IAAI,EACV,QAAQ,EACR,WAAW,GAMZ;IACC,OAAO,CACL,MAAC,YAAY,CAAC,IAAI,IAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,sFACT,WAAW,CAAC,CAAC,CAAC,0CAA0C,CAAC,CAAC,CAAC,iCAC7D,EAAE,aAEF,KAAC,IAAI,IAAC,SAAS,EAAC,SAAS,wBAAe,EACvC,QAAQ,IACS,CACrB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ValidationSummaryProps {
|
|
2
|
+
errors: string[];
|
|
3
|
+
warnings: string[];
|
|
4
|
+
onDismiss: () => void;
|
|
5
|
+
}
|
|
6
|
+
/** Inline banner listing blocking errors (and non-blocking warnings). */
|
|
7
|
+
export declare function ValidationSummary({ errors, warnings, onDismiss }: ValidationSummaryProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=ValidationSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidationSummary.d.ts","sourceRoot":"","sources":["../../../src/views/page-editor/ValidationSummary.tsx"],"names":[],"mappings":"AAIA,UAAU,sBAAsB;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,sBAAsB,kDAyCxF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { TriangleAlert, X } from 'lucide-react';
|
|
4
|
+
/** Inline banner listing blocking errors (and non-blocking warnings). */
|
|
5
|
+
export function ValidationSummary({ errors, warnings, onDismiss }) {
|
|
6
|
+
if (errors.length === 0 && warnings.length === 0)
|
|
7
|
+
return null;
|
|
8
|
+
return (_jsx("div", { role: "alert", className: "border-destructive/30 bg-destructive/5 mx-4 mt-3 rounded-lg border p-3", children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx(TriangleAlert, { className: "text-destructive mt-0.5 h-4 w-4 shrink-0", "aria-hidden": true }), _jsxs("div", { className: "min-w-0 flex-1", children: [errors.length > 0 && (_jsxs(_Fragment, { children: [_jsxs("p", { className: "text-foreground text-sm font-medium", children: ["Resolve ", errors.length, " issue", errors.length === 1 ? '' : 's', " before publishing"] }), _jsx("ul", { className: "text-muted-foreground mt-1 list-disc space-y-0.5 pl-4 text-xs", children: errors.map((e, i) => (_jsx("li", { children: e }, `e-${i}`))) })] })), warnings.length > 0 && (_jsx("ul", { className: "text-muted-foreground mt-2 list-disc space-y-0.5 pl-4 text-xs", children: warnings.map((w, i) => (_jsx("li", { children: w }, `w-${i}`))) }))] }), _jsx("button", { type: "button", onClick: onDismiss, "aria-label": "Dismiss", className: "text-muted-foreground hover:text-foreground rounded p-0.5", children: _jsx(X, { className: "h-4 w-4", "aria-hidden": true }) })] }) }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ValidationSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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,SAAS,EAAC,2DAA2D,YAErE,KAAC,CAAC,IAAC,SAAS,EAAC,SAAS,wBAAe,GAC9B,IACL,GACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-icons.d.ts","sourceRoot":"","sources":["../../../src/views/page-editor/section-icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,UAAU,EAMhB,MAAM,cAAc,CAAA;AAgBrB,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAG9D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AlignLeft, BarChart3, Images, LayoutGrid, LayoutTemplate, Megaphone, PanelsTopLeft, Quote, Type, User, } from 'lucide-react';
|
|
2
|
+
import { getSectionType } from './section-types.js';
|
|
3
|
+
const SECTION_ICONS = {
|
|
4
|
+
'layout-template': LayoutTemplate,
|
|
5
|
+
'align-left': AlignLeft,
|
|
6
|
+
'panels-top-left': PanelsTopLeft,
|
|
7
|
+
'bar-chart-3': BarChart3,
|
|
8
|
+
megaphone: Megaphone,
|
|
9
|
+
text: Type,
|
|
10
|
+
quote: Quote,
|
|
11
|
+
user: User,
|
|
12
|
+
'layout-grid': LayoutGrid,
|
|
13
|
+
images: Images,
|
|
14
|
+
};
|
|
15
|
+
/** Resolve a lucide icon for a section type id (with a safe fallback). */
|
|
16
|
+
export function sectionIconFor(sectionType) {
|
|
17
|
+
const name = getSectionType(sectionType)?.icon;
|
|
18
|
+
return (name && SECTION_ICONS[name]) || LayoutTemplate;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=section-icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-icons.js","sourceRoot":"","sources":["../../../src/views/page-editor/section-icons.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,MAAM,EACN,UAAU,EACV,cAAc,EAEd,SAAS,EACT,aAAa,EACb,KAAK,EACL,IAAI,EACJ,IAAI,GACL,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,aAAa,GAA+B;IAChD,iBAAiB,EAAE,cAAc;IACjC,YAAY,EAAE,SAAS;IACvB,iBAAiB,EAAE,aAAa;IAChC,aAAa,EAAE,SAAS;IACxB,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,aAAa,EAAE,UAAU;IACzB,MAAM,EAAE,MAAM;CACf,CAAA;AAED,0EAA0E;AAC1E,MAAM,UAAU,cAAc,CAAC,WAAmB;IAChD,MAAM,IAAI,GAAG,cAAc,CAAC,WAAW,CAAC,EAAE,IAAI,CAAA;IAC9C,OAAO,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,cAAc,CAAA;AACxD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section-type registry for the flat, section-based Page Editor.
|
|
3
|
+
*
|
|
4
|
+
* The definitions now live in `@actuate-media/cms-core/page-sections` so the
|
|
5
|
+
* admin editor, the REST API, and the MCP server validate against ONE source
|
|
6
|
+
* of truth. This module re-exports them to preserve the historical import
|
|
7
|
+
* path (`../views/page-editor/section-types.js`) used across the editor.
|
|
8
|
+
*/
|
|
9
|
+
export { SECTION_TYPES, SECTION_TYPE_LIST, getSectionType, getSectionTypesForScope, sectionTypeLabel, isKnownSectionType, } from '@actuate-media/cms-core/page-sections';
|
|
10
|
+
export type { SectionTypeId, SectionScope, SectionFieldType, SectionFieldDef, SectionSettings, SectionTypeDef, PostHeaderConfig, PostTemplate, } from '@actuate-media/cms-core/page-sections';
|
|
11
|
+
//# sourceMappingURL=section-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-types.d.ts","sourceRoot":"","sources":["../../../src/views/page-editor/section-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,uCAAuC,CAAA;AAE9C,YAAY,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,YAAY,GACb,MAAM,uCAAuC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section-type registry for the flat, section-based Page Editor.
|
|
3
|
+
*
|
|
4
|
+
* The definitions now live in `@actuate-media/cms-core/page-sections` so the
|
|
5
|
+
* admin editor, the REST API, and the MCP server validate against ONE source
|
|
6
|
+
* of truth. This module re-exports them to preserve the historical import
|
|
7
|
+
* path (`../views/page-editor/section-types.js`) used across the editor.
|
|
8
|
+
*/
|
|
9
|
+
export { SECTION_TYPES, SECTION_TYPE_LIST, getSectionType, getSectionTypesForScope, sectionTypeLabel, isKnownSectionType, } from '@actuate-media/cms-core/page-sections';
|
|
10
|
+
//# sourceMappingURL=section-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-types.js","sourceRoot":"","sources":["../../../src/views/page-editor/section-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,uCAAuC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PageSection } from '../../../lib/page-editor-service.js';
|
|
2
|
+
import { type PostRenderContext } from './parts.js';
|
|
3
|
+
/**
|
|
4
|
+
* Renders the post's main body. When `source === 'field'` it shows the
|
|
5
|
+
* post's own Body field (passed via context); otherwise it renders the
|
|
6
|
+
* section's own `body` copy. Body text is treated as plain paragraphs split
|
|
7
|
+
* on blank lines — the renderer never injects raw HTML.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ArticleBodySection({ section, context, }: {
|
|
10
|
+
section: PageSection;
|
|
11
|
+
context?: PostRenderContext;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=ArticleBodySection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleBodySection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/ArticleBodySection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAa,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,OAAO,GACR,EAAE;IACD,OAAO,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAC5B,2CAyCA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { bool, str } from './parts.js';
|
|
3
|
+
/**
|
|
4
|
+
* Renders the post's main body. When `source === 'field'` it shows the
|
|
5
|
+
* post's own Body field (passed via context); otherwise it renders the
|
|
6
|
+
* section's own `body` copy. Body text is treated as plain paragraphs split
|
|
7
|
+
* on blank lines — the renderer never injects raw HTML.
|
|
8
|
+
*/
|
|
9
|
+
export function ArticleBodySection({ section, context, }) {
|
|
10
|
+
const c = section.content;
|
|
11
|
+
const source = str(c, 'source', 'field');
|
|
12
|
+
const raw = source === 'field' ? (context?.body ?? '') : str(c, 'body');
|
|
13
|
+
const wide = str(c, 'width', 'normal') === 'wide';
|
|
14
|
+
const showToc = bool(c, 'showToc');
|
|
15
|
+
const paragraphs = raw
|
|
16
|
+
.split(/\n{2,}/)
|
|
17
|
+
.map((p) => p.trim())
|
|
18
|
+
.filter(Boolean);
|
|
19
|
+
return (_jsxs("div", { className: `mx-auto px-6 ${wide ? 'max-w-4xl' : 'max-w-2xl'}`, children: [showToc && (_jsxs("div", { className: "mb-8 rounded-lg border border-zinc-200 bg-zinc-50 p-4", children: [_jsx("p", { className: "text-xs font-semibold tracking-wider text-zinc-500 uppercase", children: "On this page" }), _jsx("p", { className: "mt-1 text-sm text-zinc-400", children: "A table of contents will be generated from the body headings." })] })), paragraphs.length > 0 ? (_jsx("div", { className: "space-y-4", children: paragraphs.map((p, i) => (_jsx("p", { className: "text-base leading-relaxed text-zinc-700", children: p }, i))) })) : (_jsx("p", { className: "text-base leading-relaxed text-zinc-400 italic", children: source === 'field'
|
|
20
|
+
? "This will show the post's Body content."
|
|
21
|
+
: 'Add body copy in the inspector.' }))] }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ArticleBodySection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleBodySection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/ArticleBodySection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAA0B,MAAM,YAAY,CAAA;AAE9D;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,OAAO,EACP,OAAO,GAIR;IACC,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAA;IACzB,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IACxC,MAAM,GAAG,GAAG,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IACvE,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,MAAM,CAAA;IACjD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IAElC,MAAM,UAAU,GAAG,GAAG;SACnB,KAAK,CAAC,QAAQ,CAAC;SACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAA;IAElB,OAAO,CACL,eAAK,SAAS,EAAE,gBAAgB,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAAE,aAC/D,OAAO,IAAI,CACV,eAAK,SAAS,EAAC,uDAAuD,aACpE,YAAG,SAAS,EAAC,8DAA8D,6BAEvE,EACJ,YAAG,SAAS,EAAC,4BAA4B,8EAErC,IACA,CACP,EACA,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACvB,cAAK,SAAS,EAAC,WAAW,YACvB,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACxB,YAAW,SAAS,EAAC,yCAAyC,YAC3D,CAAC,IADI,CAAC,CAEL,CACL,CAAC,GACE,CACP,CAAC,CAAC,CAAC,CACF,YAAG,SAAS,EAAC,gDAAgD,YAC1D,MAAM,KAAK,OAAO;oBACjB,CAAC,CAAC,yCAAyC;oBAC3C,CAAC,CAAC,iCAAiC,GACnC,CACL,IACG,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PageSection } from '../../../lib/page-editor-service.js';
|
|
2
|
+
import { type PostRenderContext } from './parts.js';
|
|
3
|
+
/** A short author biography block, driven by the post's author context. */
|
|
4
|
+
export declare function AuthorBioSection({ section, context, }: {
|
|
5
|
+
section: PageSection;
|
|
6
|
+
context?: PostRenderContext;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=AuthorBioSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorBioSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/AuthorBioSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAa,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9D,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,OAAO,GACR,EAAE;IACD,OAAO,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAC5B,2CAkDA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { bool, str } from './parts.js';
|
|
3
|
+
/** A short author biography block, driven by the post's author context. */
|
|
4
|
+
export function AuthorBioSection({ section, context, }) {
|
|
5
|
+
const c = section.content;
|
|
6
|
+
const heading = str(c, 'heading', 'About the author');
|
|
7
|
+
const showAvatar = bool(c, 'showAvatar', true);
|
|
8
|
+
const showSocial = bool(c, 'showSocial', true);
|
|
9
|
+
const name = context?.author?.name || 'Author name';
|
|
10
|
+
const bio = context?.author?.bio || "The author's bio will appear here once it is set on their profile.";
|
|
11
|
+
const avatarUrl = context?.author?.avatarUrl;
|
|
12
|
+
const initials = name
|
|
13
|
+
.split(/\s+/)
|
|
14
|
+
.map((p) => p[0] ?? '')
|
|
15
|
+
.join('')
|
|
16
|
+
.slice(0, 2)
|
|
17
|
+
.toUpperCase();
|
|
18
|
+
return (_jsx("div", { className: "mx-auto max-w-3xl px-6", children: _jsxs("div", { className: "flex items-start gap-4 rounded-xl border border-zinc-200 bg-zinc-50 p-5", children: [showAvatar &&
|
|
19
|
+
(avatarUrl ? (_jsx("img", { src: avatarUrl, alt: name, className: "h-14 w-14 shrink-0 rounded-full object-cover" })) : (_jsx("span", { className: "flex h-14 w-14 shrink-0 items-center justify-center rounded-full bg-violet-100 text-sm font-medium text-violet-700", children: initials || '?' }))), _jsxs("div", { className: "min-w-0", children: [heading && (_jsx("p", { className: "text-xs font-semibold tracking-wider text-zinc-500 uppercase", children: heading })), _jsx("p", { className: "mt-0.5 text-base font-medium text-zinc-900", children: name }), _jsx("p", { className: "mt-1 text-sm leading-relaxed text-zinc-600", children: bio }), showSocial && (_jsxs("div", { className: "mt-2 flex gap-3 text-sm text-violet-600", children: [_jsx("span", { children: "Twitter" }), _jsx("span", { children: "LinkedIn" })] }))] })] }) }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=AuthorBioSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorBioSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/AuthorBioSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAA0B,MAAM,YAAY,CAAA;AAE9D,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,EAC/B,OAAO,EACP,OAAO,GAIR;IACC,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAA;IACzB,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,kBAAkB,CAAC,CAAA;IACrD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;IAC9C,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;IAE9C,MAAM,IAAI,GAAG,OAAO,EAAE,MAAM,EAAE,IAAI,IAAI,aAAa,CAAA;IACnD,MAAM,GAAG,GACP,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,oEAAoE,CAAA;IAC9F,MAAM,SAAS,GAAG,OAAO,EAAE,MAAM,EAAE,SAAS,CAAA;IAC5C,MAAM,QAAQ,GAAG,IAAI;SAClB,KAAK,CAAC,KAAK,CAAC;SACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACtB,IAAI,CAAC,EAAE,CAAC;SACR,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACX,WAAW,EAAE,CAAA;IAEhB,OAAO,CACL,cAAK,SAAS,EAAC,wBAAwB,YACrC,eAAK,SAAS,EAAC,yEAAyE,aACrF,UAAU;oBACT,CAAC,SAAS,CAAC,CAAC,CAAC,CACX,cACE,GAAG,EAAE,SAAS,EACd,GAAG,EAAE,IAAI,EACT,SAAS,EAAC,8CAA8C,GACxD,CACH,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,oHAAoH,YACjI,QAAQ,IAAI,GAAG,GACX,CACR,CAAC,EACJ,eAAK,SAAS,EAAC,SAAS,aACrB,OAAO,IAAI,CACV,YAAG,SAAS,EAAC,8DAA8D,YACxE,OAAO,GACN,CACL,EACD,YAAG,SAAS,EAAC,4CAA4C,YAAE,IAAI,GAAK,EACpE,YAAG,SAAS,EAAC,4CAA4C,YAAE,GAAG,GAAK,EAClE,UAAU,IAAI,CACb,eAAK,SAAS,EAAC,yCAAyC,aACtD,qCAAoB,EACpB,sCAAqB,IACjB,CACP,IACG,IACF,GACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ByTheNumbersSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/ByTheNumbersSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAStE,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,2CA+BxE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { str } from './parts.js';
|
|
3
|
+
export function ByTheNumbersSection({ section }) {
|
|
4
|
+
const c = section.content;
|
|
5
|
+
const heading = str(c, 'heading');
|
|
6
|
+
const body = str(c, 'body');
|
|
7
|
+
const stats = Array.isArray(c.stats) ? c.stats : [];
|
|
8
|
+
return (_jsxs("div", { className: "mx-auto max-w-5xl px-6 text-center", children: [heading && (_jsx("h2", { className: "text-2xl font-semibold tracking-tight text-zinc-900 sm:text-3xl", children: heading })), body && _jsx("p", { className: "mx-auto mt-4 max-w-2xl text-base text-zinc-600", children: body }), stats.length > 0 && (_jsx("dl", { className: "mt-10 grid grid-cols-1 gap-8 sm:grid-cols-3", children: stats.map((s, i) => (_jsxs("div", { children: [_jsx("dt", { className: "text-4xl font-semibold tracking-tight text-violet-600", children: String(s.value ?? '') }), _jsx("dd", { className: "mt-2 text-sm font-medium text-zinc-700", children: String(s.label ?? '') }), s.description ? (_jsx("dd", { className: "mt-1 text-xs text-zinc-500", children: String(s.description) })) : null] }, i))) }))] }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ByTheNumbersSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ByTheNumbersSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/ByTheNumbersSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAQhC,MAAM,UAAU,mBAAmB,CAAC,EAAE,OAAO,EAA4B;IACvE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAA;IACzB,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IACjC,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,KAAgB,CAAC,CAAC,CAAC,EAAE,CAAA;IAE/D,OAAO,CACL,eAAK,SAAS,EAAC,oCAAoC,aAChD,OAAO,IAAI,CACV,aAAI,SAAS,EAAC,iEAAiE,YAC5E,OAAO,GACL,CACN,EACA,IAAI,IAAI,YAAG,SAAS,EAAC,gDAAgD,YAAE,IAAI,GAAK,EAChF,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,aAAI,SAAS,EAAC,6CAA6C,YACxD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACnB,0BACE,aAAI,SAAS,EAAC,uDAAuD,YAClE,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,GACnB,EACL,aAAI,SAAS,EAAC,wCAAwC,YAAE,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,GAAM,EAClF,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CACf,aAAI,SAAS,EAAC,4BAA4B,YAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,GAAM,CACxE,CAAC,CAAC,CAAC,IAAI,KAPA,CAAC,CAQL,CACP,CAAC,GACC,CACN,IACG,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CtaBannerSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/CtaBannerSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAGtE,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,2CAyBrE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PreviewButton, isDarkBackground, str } from './parts.js';
|
|
3
|
+
export function CtaBannerSection({ section }) {
|
|
4
|
+
const c = section.content;
|
|
5
|
+
const dark = isDarkBackground(section.settings);
|
|
6
|
+
const heading = str(c, 'heading');
|
|
7
|
+
const body = str(c, 'body');
|
|
8
|
+
return (_jsxs("div", { className: "mx-auto max-w-3xl px-6 text-center", children: [_jsx("h2", { className: "text-2xl font-semibold tracking-tight sm:text-3xl", children: heading }), body && (_jsx("p", { className: `mx-auto mt-3 max-w-xl text-base ${dark ? 'text-violet-100' : 'text-zinc-600'}`, children: body })), _jsx("div", { className: "mt-6 flex justify-center", children: _jsx(PreviewButton, { label: str(c, 'buttonLabel'), href: str(c, 'buttonUrl'), tone: dark ? 'onDark' : 'primary' }) })] }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=CtaBannerSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CtaBannerSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/CtaBannerSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAEjE,MAAM,UAAU,gBAAgB,CAAC,EAAE,OAAO,EAA4B;IACpE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAA;IACzB,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC/C,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IACjC,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IAE3B,OAAO,CACL,eAAK,SAAS,EAAC,oCAAoC,aACjD,aAAI,SAAS,EAAC,mDAAmD,YAAE,OAAO,GAAM,EAC/E,IAAI,IAAI,CACP,YACE,SAAS,EAAE,mCAAmC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,eAAe,EAAE,YAEzF,IAAI,GACH,CACL,EACD,cAAK,SAAS,EAAC,0BAA0B,YACvC,KAAC,aAAa,IACZ,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,aAAa,CAAC,EAC5B,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,EACzB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GACjC,GACE,IACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureHighlightSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/FeatureHighlightSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAGtE,wBAAgB,uBAAuB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,2CA0D5E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ImageIcon } from 'lucide-react';
|
|
3
|
+
import { PreviewButton, str } from './parts.js';
|
|
4
|
+
export function FeatureHighlightSection({ section }) {
|
|
5
|
+
const c = section.content;
|
|
6
|
+
const label = str(c, 'label');
|
|
7
|
+
const heading = str(c, 'heading');
|
|
8
|
+
const body = str(c, 'body');
|
|
9
|
+
const imageUrl = str(c, 'imageUrl');
|
|
10
|
+
const imageAlt = str(c, 'imageAlt');
|
|
11
|
+
const imageLeft = str(c, 'imagePosition', 'right') === 'left';
|
|
12
|
+
const text = (_jsxs("div", { className: "flex-1", children: [label && (_jsx("span", { className: "mb-3 inline-block rounded bg-violet-600 px-2 py-0.5 text-xs font-medium text-white", children: label })), _jsx("h2", { className: "text-2xl font-semibold tracking-tight text-zinc-900 sm:text-3xl", children: heading }), body && _jsx("p", { className: "mt-4 text-base leading-relaxed text-zinc-600", children: body }), _jsx("div", { className: "mt-6", children: _jsx(PreviewButton, { label: str(c, 'buttonLabel'), href: str(c, 'buttonUrl'), tone: "primary" }) })] }));
|
|
13
|
+
const media = (_jsx("div", { className: "flex-1", children: imageUrl ? (
|
|
14
|
+
// Admin-only preview; next/image isn't in scope here.
|
|
15
|
+
_jsx("img", { src: imageUrl, alt: imageAlt, className: "aspect-[4/3] w-full rounded-xl object-cover" })) : (_jsx("div", { className: "flex aspect-[4/3] w-full items-center justify-center rounded-xl bg-violet-50", children: _jsx(ImageIcon, { className: "h-10 w-10 text-violet-300", "aria-hidden": true }) })) }));
|
|
16
|
+
return (_jsx("div", { className: "mx-auto max-w-5xl px-6", children: _jsx("div", { className: "flex flex-col items-center gap-10 md:flex-row", children: imageLeft ? (_jsxs(_Fragment, { children: [media, text] })) : (_jsxs(_Fragment, { children: [text, media] })) }) }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=FeatureHighlightSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureHighlightSection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/FeatureHighlightSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,UAAU,uBAAuB,CAAC,EAAE,OAAO,EAA4B;IAC3E,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAA;IACzB,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;IAC7B,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IACjC,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IAC3B,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAA;IACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAA;IACnC,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,KAAK,MAAM,CAAA;IAE7D,MAAM,IAAI,GAAG,CACX,eAAK,SAAS,EAAC,QAAQ,aACpB,KAAK,IAAI,CACR,eAAM,SAAS,EAAC,oFAAoF,YACjG,KAAK,GACD,CACR,EACD,aAAI,SAAS,EAAC,iEAAiE,YAAE,OAAO,GAAM,EAC7F,IAAI,IAAI,YAAG,SAAS,EAAC,8CAA8C,YAAE,IAAI,GAAK,EAC/E,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,aAAa,IAAC,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,IAAI,EAAC,SAAS,GAAG,GACrF,IACF,CACP,CAAA;IAED,MAAM,KAAK,GAAG,CACZ,cAAK,SAAS,EAAC,QAAQ,YACpB,QAAQ,CAAC,CAAC,CAAC;QACV,sDAAsD;QACtD,cACE,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,QAAQ,EACb,SAAS,EAAC,6CAA6C,GACvD,CACH,CAAC,CAAC,CAAC,CACF,cAAK,SAAS,EAAC,8EAA8E,YAC3F,KAAC,SAAS,IAAC,SAAS,EAAC,2BAA2B,wBAAe,GAC3D,CACP,GACG,CACP,CAAA;IAED,OAAO,CACL,cAAK,SAAS,EAAC,wBAAwB,YACrC,cAAK,SAAS,EAAC,+CAA+C,YAC3D,SAAS,CAAC,CAAC,CAAC,CACX,8BACG,KAAK,EACL,IAAI,IACJ,CACJ,CAAC,CAAC,CAAC,CACF,8BACG,IAAI,EACJ,KAAK,IACL,CACJ,GACG,GACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PageSection } from '../../../lib/page-editor-service.js';
|
|
2
|
+
/** A responsive image grid with captions. */
|
|
3
|
+
export declare function GallerySection({ section }: {
|
|
4
|
+
section: PageSection;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=GallerySection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GallerySection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/GallerySection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAStE,6CAA6C;AAC7C,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,2CA2CnE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { str } from './parts.js';
|
|
3
|
+
/** A responsive image grid with captions. */
|
|
4
|
+
export function GallerySection({ section }) {
|
|
5
|
+
const c = section.content;
|
|
6
|
+
const heading = str(c, 'heading');
|
|
7
|
+
const columns = Number.parseInt(str(c, 'columns', '3'), 10) || 3;
|
|
8
|
+
const images = Array.isArray(c.images) ? c.images : [];
|
|
9
|
+
const withUrl = images.filter((img) => img && typeof img.url === 'string' && img.url);
|
|
10
|
+
const cols = columns === 2
|
|
11
|
+
? 'sm:grid-cols-2'
|
|
12
|
+
: columns === 4
|
|
13
|
+
? 'sm:grid-cols-2 lg:grid-cols-4'
|
|
14
|
+
: 'sm:grid-cols-3';
|
|
15
|
+
return (_jsxs("div", { className: "mx-auto max-w-5xl px-6", children: [heading && (_jsx("h2", { className: "mb-6 text-2xl font-semibold tracking-tight text-zinc-900", children: heading })), withUrl.length > 0 ? (_jsx("div", { className: `grid grid-cols-1 gap-3 ${cols}`, children: withUrl.map((img, i) => (_jsxs("figure", { className: "overflow-hidden rounded-lg border border-zinc-200", children: [_jsx("img", { src: img.url, alt: img.alt ?? '', className: "aspect-square w-full object-cover" }), img.caption && (_jsx("figcaption", { className: "px-2 py-1.5 text-xs text-zinc-500", children: img.caption }))] }, i))) })) : (_jsx("div", { className: `grid grid-cols-1 gap-3 ${cols}`, children: Array.from({ length: columns }, (_, i) => (_jsx("div", { className: "aspect-square rounded-lg bg-zinc-100", "aria-hidden": true }, i))) }))] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=GallerySection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GallerySection.js","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/GallerySection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAQhC,6CAA6C;AAC7C,MAAM,UAAU,cAAc,CAAC,EAAE,OAAO,EAA4B;IAClE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAA;IACzB,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IACjC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAA;IAChE,MAAM,MAAM,GAAmB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,MAAyB,CAAC,CAAC,CAAC,EAAE,CAAA;IAC1F,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,OAAO,GAAG,CAAC,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAErF,MAAM,IAAI,GACR,OAAO,KAAK,CAAC;QACX,CAAC,CAAC,gBAAgB;QAClB,CAAC,CAAC,OAAO,KAAK,CAAC;YACb,CAAC,CAAC,+BAA+B;YACjC,CAAC,CAAC,gBAAgB,CAAA;IAExB,OAAO,CACL,eAAK,SAAS,EAAC,wBAAwB,aACpC,OAAO,IAAI,CACV,aAAI,SAAS,EAAC,0DAA0D,YAAE,OAAO,GAAM,CACxF,EACA,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACpB,cAAK,SAAS,EAAE,0BAA0B,IAAI,EAAE,YAC7C,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACvB,kBAAgB,SAAS,EAAC,mDAAmD,aAC3E,cACE,GAAG,EAAE,GAAG,CAAC,GAAG,EACZ,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,EAClB,SAAS,EAAC,mCAAmC,GAC7C,EACD,GAAG,CAAC,OAAO,IAAI,CACd,qBAAY,SAAS,EAAC,mCAAmC,YAAE,GAAG,CAAC,OAAO,GAAc,CACrF,KARU,CAAC,CASL,CACV,CAAC,GACE,CACP,CAAC,CAAC,CAAC,CACF,cAAK,SAAS,EAAE,0BAA0B,IAAI,EAAE,YAC7C,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACzC,cAAa,SAAS,EAAC,sCAAsC,yBAAnD,CAAC,CAAiE,CAC7E,CAAC,GACE,CACP,IACG,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeroBannerSection.d.ts","sourceRoot":"","sources":["../../../../src/views/page-editor/sections/HeroBannerSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAGtE,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,2CAwCtE"}
|