@burdenoff/microfe-product 2026.525.6 → 2026.527.1
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/product/pages/ContentPageViewPage.js +1 -0
- package/dist/product/pages/ContentPageViewPage.js.map +1 -1
- package/dist/product/pages/ProductCatalogPage.js +4 -2
- package/dist/product/pages/ProductCatalogPage.js.map +1 -1
- package/dist/product/pages/ProductViewPage.js +3 -2
- package/dist/product/pages/ProductViewPage.js.map +1 -1
- package/dist/product/providers/ProductUserProvider.js +1 -1
- package/dist/product/providers/ProductUserProvider.js.map +1 -1
- package/dist/product-management/ProductManagementRoot.js +6 -2
- package/dist/product-management/ProductManagementRoot.js.map +1 -1
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js +1 -1
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js +1 -0
- package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js +6 -3
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js +1 -0
- package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js +8 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js +1 -1
- package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js +1 -0
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js +3 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js +8 -2
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js +1 -0
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js +3 -0
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js +1 -0
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js +8 -1
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js.map +1 -1
- package/dist/product-management/modules/products/components/ProductForm.js +355 -350
- package/dist/product-management/modules/products/components/ProductForm.js.map +1 -1
- package/dist/product-management/modules/products/components/ProductPlans.js +8 -1
- package/dist/product-management/modules/products/components/ProductPlans.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductCreatePage.js +1 -0
- package/dist/product-management/modules/products/pages/ProductCreatePage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductDetailPage.js +6 -2
- package/dist/product-management/modules/products/pages/ProductDetailPage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductEditPage.js +1 -0
- package/dist/product-management/modules/products/pages/ProductEditPage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductsListPage.js +11 -4
- package/dist/product-management/modules/products/pages/ProductsListPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/components/ShortcutForm.js +2 -2
- package/dist/product-management/modules/shortcuts/components/ShortcutForm.js.map +1 -1
- package/dist/product-management/modules/shortcuts/components/ShortcutKeyBadge.js +1 -1
- package/dist/product-management/modules/shortcuts/components/ShortcutKeyBadge.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js +1 -0
- package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js +4 -0
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js +1 -0
- package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js +9 -0
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js.map +1 -1
- package/dist/product-management/providers/ProductConsoleProvider.js +1 -1
- package/dist/product-management/providers/ProductConsoleProvider.js.map +1 -1
- package/dist/product-management/shared/components/AuditHistoryTab.js +1 -1
- package/dist/product-management/shared/components/AuditHistoryTab.js.map +1 -1
- package/dist/product-management/shared/components/feedback/EmptyState.js +1 -0
- package/dist/product-management/shared/components/feedback/EmptyState.js.map +1 -1
- package/dist/product-management/shared/components/feedback/ErrorState.js +2 -1
- package/dist/product-management/shared/components/feedback/ErrorState.js.map +1 -1
- package/dist/product-management/shared/components/input/SearchInput.js +1 -0
- package/dist/product-management/shared/components/input/SearchInput.js.map +1 -1
- package/dist/product-management/shared/utils/exportUtils.js.map +1 -1
- package/package.json +1 -1
- package/dist/product-management/shared/index.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageForm.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/components/ContentPageForm.tsx"],"sourcesContent":["import { useState, useRef, useCallback } from 'react';\nimport { TagInput } from '../../../shared/components/input/TagInput';\nimport { ProductCombobox } from '../../../shared/components/input/ProductCombobox';\nimport {\n Loader2,\n Eye,\n EyeOff,\n Bold,\n Italic,\n Heading,\n List,\n ListOrdered,\n Link,\n Code,\n Quote,\n} from 'lucide-react';\nimport { ZodError } from 'zod';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport type { ProductContentPage, CreateContentPageInput, UpdateContentPageInput } from '../types';\nimport { createContentPageSchema, updateContentPageSchema } from '../schemas';\n\ninterface ContentPageFormProps {\n contentPage?: ProductContentPage | null;\n onSubmit: (data: CreateContentPageInput | UpdateContentPageInput) => Promise<void>;\n onCancel: () => void;\n loading?: boolean;\n}\n\n/**\n * Simple markdown-to-HTML renderer.\n * Converts common markdown syntax to HTML using regex replacements.\n * No external libraries required.\n */\nfunction renderMarkdown(md: string): string {\n let html = md;\n\n // Escape HTML entities first to prevent XSS\n html = html.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n\n // Code blocks (fenced with ```)\n html = html.replace(/```(\\w*)\\n([\\s\\S]*?)```/g, (_match, _lang, code) => {\n return `<pre class=\"bg-gray-900 text-gray-100 rounded-lg p-4 overflow-x-auto my-3\"><code>${code.trim()}</code></pre>`;\n });\n\n // Inline code\n html = html.replace(\n /`([^`]+)`/g,\n '<code class=\"bg-gray-200 dark:bg-gray-700 px-1.5 py-0.5 rounded text-sm\">$1</code>'\n );\n\n // Headings (h1 - h6)\n html = html.replace(/^###### (.+)$/gm, '<h6 class=\"text-sm font-semibold mt-4 mb-2\">$1</h6>');\n html = html.replace(/^##### (.+)$/gm, '<h5 class=\"text-sm font-bold mt-4 mb-2\">$1</h5>');\n html = html.replace(/^#### (.+)$/gm, '<h4 class=\"text-base font-bold mt-4 mb-2\">$1</h4>');\n html = html.replace(/^### (.+)$/gm, '<h3 class=\"text-lg font-bold mt-4 mb-2\">$1</h3>');\n html = html.replace(/^## (.+)$/gm, '<h2 class=\"text-xl font-bold mt-5 mb-2\">$1</h2>');\n html = html.replace(/^# (.+)$/gm, '<h1 class=\"text-2xl font-bold mt-6 mb-3\">$1</h1>');\n\n // Bold & Italic combined\n html = html.replace(/\\*\\*\\*(.+?)\\*\\*\\*/g, '<strong><em>$1</em></strong>');\n // Bold\n html = html.replace(/\\*\\*(.+?)\\*\\*/g, '<strong>$1</strong>');\n // Italic\n html = html.replace(/\\*(.+?)\\*/g, '<em>$1</em>');\n\n // Links: [text](url)\n html = html.replace(\n /\\[([^\\]]+)\\]\\(([^)]+)\\)/g,\n '<a href=\"$2\" class=\"text-blue-500 underline hover:text-blue-700\" target=\"_blank\" rel=\"noopener noreferrer\">$1</a>'\n );\n\n // Blockquotes (supports multi-line consecutive > lines)\n html = html.replace(\n /^> (.+)$/gm,\n '<blockquote class=\"border-l-4 border-gray-300 pl-4 italic text-gray-600 my-2\">$1</blockquote>'\n );\n\n // Unordered lists: detect consecutive lines starting with \"- \"\n html = html.replace(/(^- .+$(\\n^- .+$)*)/gm, (block) => {\n const items = block\n .split('\\n')\n .map((line) => `<li class=\"ml-4\">${line.replace(/^- /, '')}</li>`)\n .join('\\n');\n return `<ul class=\"list-disc list-inside my-2\">\\n${items}\\n</ul>`;\n });\n\n // Ordered lists: detect consecutive lines starting with \"N. \"\n html = html.replace(/(^\\d+\\. .+$(\\n^\\d+\\. .+$)*)/gm, (block) => {\n const items = block\n .split('\\n')\n .map((line) => `<li class=\"ml-4\">${line.replace(/^\\d+\\. /, '')}</li>`)\n .join('\\n');\n return `<ol class=\"list-decimal list-inside my-2\">\\n${items}\\n</ol>`;\n });\n\n // Horizontal rule\n html = html.replace(/^---$/gm, '<hr class=\"my-4 border-gray-300\" />');\n\n // Paragraphs: wrap remaining bare lines in <p> tags\n // Split by double newlines for paragraph breaks\n html = html\n .split(/\\n\\n+/)\n .map((block) => {\n const trimmed = block.trim();\n if (!trimmed) return '';\n // Don't wrap blocks that already start with HTML tags\n if (/^<(h[1-6]|ul|ol|pre|blockquote|hr|div)/.test(trimmed)) {\n return trimmed;\n }\n return `<p class=\"my-2 leading-relaxed\">${trimmed.replace(/\\n/g, '<br />')}</p>`;\n })\n .join('\\n');\n\n return html;\n}\n\ntype ToolbarAction = {\n label: string;\n icon: React.ComponentType<{ size?: number }>;\n prefix: string;\n suffix: string;\n placeholder: string;\n block?: boolean;\n};\n\nconst TOOLBAR_ACTIONS: ToolbarAction[] = [\n { label: 'Bold', icon: Bold, prefix: '**', suffix: '**', placeholder: 'bold text' },\n { label: 'Italic', icon: Italic, prefix: '*', suffix: '*', placeholder: 'italic text' },\n {\n label: 'Heading',\n icon: Heading,\n prefix: '## ',\n suffix: '',\n placeholder: 'Heading',\n block: true,\n },\n {\n label: 'Bullet List',\n icon: List,\n prefix: '- ',\n suffix: '',\n placeholder: 'List item',\n block: true,\n },\n {\n label: 'Numbered List',\n icon: ListOrdered,\n prefix: '1. ',\n suffix: '',\n placeholder: 'List item',\n block: true,\n },\n { label: 'Link', icon: Link, prefix: '[', suffix: '](url)', placeholder: 'link text' },\n {\n label: 'Code Block',\n icon: Code,\n prefix: '```\\n',\n suffix: '\\n```',\n placeholder: 'code',\n block: true,\n },\n { label: 'Quote', icon: Quote, prefix: '> ', suffix: '', placeholder: 'quote text', block: true },\n];\n\n// Page types that expose the extra \"Article Details\" section (excerpt,\n// thumbnail, author, publish date, …). Set-based so adding e.g. 'docs'\n// later is a one-token change rather than growing a boolean chain.\nconst DETAIL_PAGE_TYPES = new Set<string>(['blog', 'press']);\n\nexport function ContentPageForm({\n contentPage,\n onSubmit,\n onCancel,\n loading,\n}: ContentPageFormProps) {\n const tr = useTr();\n const [formData, setFormData] = useState({\n slug: contentPage?.slug || '',\n title: contentPage?.title || '',\n content: contentPage?.content || '',\n contentFormat: contentPage?.contentFormat || 'markdown',\n seoTitle: contentPage?.seoTitle || '',\n seoDescription: contentPage?.seoDescription || '',\n seoKeywords: contentPage?.seoKeywords || '',\n isPublished: contentPage?.isPublished ?? false,\n visibility: contentPage?.visibility ?? 'PUBLIC',\n sortOrder: contentPage?.sortOrder ?? 0,\n productId: contentPage?.productId || '',\n excerpt: contentPage?.excerpt || '',\n thumbnail: contentPage?.thumbnail || '',\n author: contentPage?.author || '',\n publishedAt: contentPage?.publishedAt ? contentPage.publishedAt.slice(0, 16) : '',\n readingTime: contentPage?.readingTime ?? 0,\n featured: contentPage?.featured ?? false,\n category: contentPage?.category || '',\n });\n\n const [tags, setTags] = useState<string[]>(contentPage?.tags ?? []);\n\n // Page Type drives the primary tag (so it can't be forgotten) and which\n // sections show. Derived from existing tags when editing.\n const PRIMARY_TYPE_TAGS = ['blog', 'legal', 'docs', 'press', 'page'];\n const initialType =\n (contentPage?.tags ?? []).find((t) => PRIMARY_TYPE_TAGS.includes(t)) || 'page';\n const [pageType, setPageType] = useState<string>(initialType);\n\n const changePageType = (next: string) => {\n setPageType(next);\n setTags((prev) => {\n const withoutPrimary = prev.filter((t) => !PRIMARY_TYPE_TAGS.includes(t));\n return [next, ...withoutPrimary];\n });\n };\n\n const [errors, setErrors] = useState<Record<string, string>>({});\n const [showPreview, setShowPreview] = useState(false);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const validate = () => {\n try {\n const schema = contentPage ? updateContentPageSchema : createContentPageSchema;\n const dataToValidate: Record<string, unknown> = { ...formData };\n // Convert sortOrder to number for validation\n dataToValidate.sortOrder =\n typeof formData.sortOrder === 'string'\n ? parseInt(formData.sortOrder as string, 10) || 0\n : formData.sortOrder;\n // Strip empty optional strings so Zod doesn't complain\n if (!dataToValidate.seoTitle) delete dataToValidate.seoTitle;\n if (!dataToValidate.seoDescription) delete dataToValidate.seoDescription;\n if (!dataToValidate.seoKeywords) delete dataToValidate.seoKeywords;\n if (!dataToValidate.productId) delete dataToValidate.productId;\n if (!dataToValidate.contentFormat) dataToValidate.contentFormat = 'markdown';\n if (!dataToValidate.excerpt) delete dataToValidate.excerpt;\n if (!dataToValidate.thumbnail) delete dataToValidate.thumbnail;\n if (!dataToValidate.author) delete dataToValidate.author;\n if (!dataToValidate.publishedAt) delete dataToValidate.publishedAt;\n if (!dataToValidate.readingTime) delete dataToValidate.readingTime;\n if (!dataToValidate.category) delete dataToValidate.category;\n\n schema.parse(dataToValidate);\n setErrors({});\n return true;\n } catch (error) {\n if (error instanceof ZodError) {\n const newErrors: Record<string, string> = {};\n error.issues.forEach((issue) => {\n const path = issue.path.join('.');\n newErrors[path] = issue.message;\n });\n setErrors(newErrors);\n }\n return false;\n }\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (!validate()) {\n return;\n }\n\n const sortOrderNum =\n typeof formData.sortOrder === 'string'\n ? parseInt(formData.sortOrder as string, 10) || 0\n : formData.sortOrder;\n\n // Guarantee exactly one primary type tag matching the selected Page Type,\n // even if the user never touched the dropdown.\n const finalTags = [pageType, ...tags.filter((t) => !PRIMARY_TYPE_TAGS.includes(t))];\n\n const submitData = contentPage\n ? {\n // Update only changed fields\n title: formData.title !== contentPage.title ? formData.title : undefined,\n content: formData.content !== contentPage.content ? formData.content : undefined,\n contentFormat:\n formData.contentFormat !== contentPage.contentFormat\n ? formData.contentFormat\n : undefined,\n seoTitle:\n formData.seoTitle !== (contentPage.seoTitle || '')\n ? formData.seoTitle || undefined\n : undefined,\n seoDescription:\n formData.seoDescription !== (contentPage.seoDescription || '')\n ? formData.seoDescription || undefined\n : undefined,\n seoKeywords:\n formData.seoKeywords !== (contentPage.seoKeywords || '')\n ? formData.seoKeywords || undefined\n : undefined,\n isPublished:\n formData.isPublished !== contentPage.isPublished ? formData.isPublished : undefined,\n visibility:\n formData.visibility !== contentPage.visibility ? formData.visibility : undefined,\n sortOrder: sortOrderNum !== contentPage.sortOrder ? sortOrderNum : undefined,\n productId:\n formData.productId !== (contentPage.productId || '')\n ? formData.productId || undefined\n : undefined,\n tags: finalTags,\n excerpt: formData.excerpt || undefined,\n thumbnail: formData.thumbnail || undefined,\n author: formData.author || undefined,\n publishedAt: formData.publishedAt\n ? new Date(formData.publishedAt).toISOString()\n : undefined,\n readingTime: formData.readingTime || undefined,\n featured: formData.featured,\n category: formData.category || undefined,\n }\n : {\n // Create with all fields\n slug: formData.slug,\n title: formData.title,\n content: formData.content,\n contentFormat: formData.contentFormat || 'markdown',\n seoTitle: formData.seoTitle || undefined,\n seoDescription: formData.seoDescription || undefined,\n seoKeywords: formData.seoKeywords || undefined,\n isPublished: formData.isPublished,\n visibility: formData.visibility,\n sortOrder: sortOrderNum,\n productId: formData.productId || undefined,\n tags: finalTags,\n excerpt: formData.excerpt || undefined,\n thumbnail: formData.thumbnail || undefined,\n author: formData.author || undefined,\n publishedAt: formData.publishedAt\n ? new Date(formData.publishedAt).toISOString()\n : undefined,\n readingTime: formData.readingTime || undefined,\n featured: formData.featured,\n category: formData.category || undefined,\n };\n\n await onSubmit(submitData);\n };\n\n const insertMarkdown = useCallback(\n (action: ToolbarAction) => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n\n const { selectionStart, selectionEnd } = textarea;\n const currentContent = formData.content;\n const selectedText = currentContent.substring(selectionStart, selectionEnd);\n const textToWrap = selectedText || action.placeholder;\n\n let insertion: string;\n let newCursorStart: number;\n let newCursorEnd: number;\n\n if (action.block && selectionStart > 0 && currentContent[selectionStart - 1] !== '\\n') {\n // For block-level elements, ensure they start on a new line\n insertion = `\\n${action.prefix}${textToWrap}${action.suffix}`;\n } else {\n insertion = `${action.prefix}${textToWrap}${action.suffix}`;\n }\n\n const before = currentContent.substring(0, selectionStart);\n const after = currentContent.substring(selectionEnd);\n const newContent = before + insertion + after;\n\n setFormData((prev) => ({ ...prev, content: newContent }));\n\n // Calculate new cursor position to select the inserted text\n const prefixLen = insertion.indexOf(textToWrap);\n newCursorStart = selectionStart + prefixLen;\n newCursorEnd = newCursorStart + textToWrap.length;\n\n // Restore focus and selection after state update\n requestAnimationFrame(() => {\n textarea.focus();\n textarea.setSelectionRange(newCursorStart, newCursorEnd);\n });\n },\n [formData.content]\n );\n\n const inputClassName = `\n w-full px-3 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n placeholder:text-text-tertiary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n disabled:bg-muted disabled:cursor-not-allowed\n transition-all duration-200\n `;\n\n const toolbarButtonClassName = `\n inline-flex items-center justify-center\n w-8 h-8\n rounded\n text-text-secondary\n hover:bg-muted hover:text-text-primary\n transition-all duration-150\n disabled:opacity-50 disabled:cursor-not-allowed\n `;\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-6 animate-in fade-in duration-300\">\n {/* Basic Information Section */}\n <div className=\"space-y-4\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('contentPages.basicInformation', 'Basic Information')}\n </h3>\n\n {/* Page Type */}\n <div>\n <label htmlFor=\"pageType\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.pageType', 'Page Type')}\n </label>\n <select\n id=\"pageType\"\n value={pageType}\n onChange={(e) => changePageType(e.target.value)}\n className={inputClassName}\n disabled={loading}\n >\n <option value=\"blog\">{tr('contentPages.typeBlog', 'Blog Post')}</option>\n <option value=\"legal\">{tr('contentPages.typeLegal', 'Legal')}</option>\n <option value=\"docs\">{tr('contentPages.typeDocs', 'Documentation')}</option>\n <option value=\"press\">{tr('contentPages.typePress', 'Press Release')}</option>\n <option value=\"page\">{tr('contentPages.typePage', 'General Page')}</option>\n </select>\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'contentPages.pageTypeHint',\n 'Sets the primary tag and which fields apply. Blog Posts and Press Releases get the extra Article Details section below.'\n )}\n </p>\n </div>\n\n {/* Slug */}\n <div>\n <label htmlFor=\"slug\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.slug', 'Slug')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"slug\"\n type=\"text\"\n value={formData.slug}\n onChange={(e) =>\n setFormData({\n ...formData,\n slug: e.target.value.toLowerCase().replace(/\\s+/g, '-'),\n })\n }\n className={inputClassName}\n placeholder=\"page-slug\"\n disabled={loading || !!contentPage}\n required={!contentPage}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'contentPages.slugHint',\n 'Lowercase letters, numbers, and hyphens only. Cannot be changed after creation.'\n )}\n </p>\n {errors.slug && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.slug}</p>\n )}\n </div>\n\n {/* Title */}\n <div>\n <label htmlFor=\"title\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.pageTitle', 'Title')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"title\"\n type=\"text\"\n value={formData.title}\n onChange={(e) => setFormData({ ...formData, title: e.target.value })}\n className={inputClassName}\n placeholder={tr('contentPages.enterPageTitle', 'Enter page title')}\n disabled={loading}\n required\n />\n {errors.title && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.title}</p>\n )}\n </div>\n </div>\n\n {/* Content Editor Section */}\n <div className=\"space-y-4 pt-4 border-t border-default\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('contentPages.contentEditor', 'Content Editor')}\n </h3>\n\n {/* Editor Toolbar & Tabs */}\n <div className=\"border border-default rounded-lg overflow-hidden\">\n {/* Top bar: Toolbar + Toggle */}\n <div className=\"flex items-center justify-between bg-muted px-2 py-1.5 border-b border-default\">\n {/* Formatting Toolbar */}\n <div className=\"flex items-center gap-0.5\">\n {TOOLBAR_ACTIONS.map((action) => {\n const IconComponent = action.icon;\n return (\n <button\n key={action.label}\n type=\"button\"\n title={action.label}\n onClick={() => insertMarkdown(action)}\n disabled={loading || showPreview}\n className={toolbarButtonClassName}\n >\n <IconComponent size={16} />\n </button>\n );\n })}\n </div>\n\n {/* Edit / Preview Toggle */}\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => setShowPreview(false)}\n className={`\n inline-flex items-center gap-1.5 px-3 py-1 rounded text-xs font-medium\n transition-all duration-150\n ${\n !showPreview\n ? 'bg-surface text-text-primary shadow-sm'\n : 'text-text-tertiary hover:text-text-secondary'\n }\n `}\n >\n <EyeOff size={14} />\n {tr('contentPages.editMode', 'Edit')}\n </button>\n <button\n type=\"button\"\n onClick={() => setShowPreview(true)}\n className={`\n inline-flex items-center gap-1.5 px-3 py-1 rounded text-xs font-medium\n transition-all duration-150\n ${\n showPreview\n ? 'bg-surface text-text-primary shadow-sm'\n : 'text-text-tertiary hover:text-text-secondary'\n }\n `}\n >\n <Eye size={14} />\n {tr('contentPages.previewMode', 'Preview')}\n </button>\n </div>\n </div>\n\n {/* Editor / Preview Panels */}\n <div className=\"relative\">\n {/* Edit Panel */}\n {!showPreview && (\n <textarea\n ref={textareaRef}\n id=\"content\"\n value={formData.content}\n onChange={(e) => setFormData({ ...formData, content: e.target.value })}\n className={`\n w-full px-4 py-3\n min-h-[400px]\n bg-surface\n text-text-primary\n placeholder:text-text-tertiary\n focus:outline-none\n disabled:bg-muted disabled:cursor-not-allowed\n font-mono text-sm\n resize-y\n transition-all duration-200\n `}\n placeholder={tr(\n 'contentPages.writeContentPlaceholder',\n 'Write your content in markdown...'\n )}\n disabled={loading}\n />\n )}\n\n {/* Preview Panel */}\n {showPreview && (\n <div\n className=\"\n w-full px-4 py-3\n min-h-[400px]\n bg-surface\n text-text-primary\n overflow-y-auto\n prose-like\n \"\n dangerouslySetInnerHTML={{\n __html: formData.content\n ? renderMarkdown(formData.content)\n : '<p class=\"text-gray-400 italic\">Nothing to preview yet. Start writing in the editor.</p>',\n }}\n />\n )}\n </div>\n </div>\n\n {errors.content && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.content}</p>\n )}\n </div>\n\n {/* SEO Metadata Section */}\n <div className=\"space-y-4 pt-4 border-t border-default\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('contentPages.seoMetadata', 'SEO Metadata')}\n </h3>\n\n {/* SEO Title */}\n <div>\n <label htmlFor=\"seoTitle\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.seoTitle', 'SEO Title')}\n </label>\n <input\n id=\"seoTitle\"\n type=\"text\"\n value={formData.seoTitle}\n onChange={(e) => setFormData({ ...formData, seoTitle: e.target.value })}\n className={inputClassName}\n placeholder={tr('contentPages.seoTitlePlaceholder', 'Page title for search engines')}\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {formData.seoTitle.length}/100 characters\n </p>\n {errors.seoTitle && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.seoTitle}</p>\n )}\n </div>\n\n {/* SEO Description */}\n <div>\n <label\n htmlFor=\"seoDescription\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('contentPages.seoDescription', 'SEO Description')}\n </label>\n <textarea\n id=\"seoDescription\"\n value={formData.seoDescription}\n onChange={(e) => setFormData({ ...formData, seoDescription: e.target.value })}\n rows={3}\n className={inputClassName}\n placeholder={tr(\n 'contentPages.seoDescriptionPlaceholder',\n 'Brief description for search engine results'\n )}\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {formData.seoDescription.length}/300 characters\n </p>\n {errors.seoDescription && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.seoDescription}</p>\n )}\n </div>\n\n {/* SEO Keywords */}\n <div>\n <label htmlFor=\"seoKeywords\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.seoKeywords', 'SEO Keywords')}\n </label>\n <input\n id=\"seoKeywords\"\n type=\"text\"\n value={formData.seoKeywords}\n onChange={(e) => setFormData({ ...formData, seoKeywords: e.target.value })}\n className={inputClassName}\n placeholder=\"keyword1, keyword2, keyword3\"\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n Comma-separated keywords. {formData.seoKeywords.length}/200 characters\n </p>\n {errors.seoKeywords && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.seoKeywords}</p>\n )}\n </div>\n </div>\n\n {/* Extra detail fields — Blog Posts & Press Releases */}\n {DETAIL_PAGE_TYPES.has(pageType) && (\n <div className=\"space-y-4 pt-4 border-t border-default\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('contentPages.extraDetailFields', 'Article Details')}\n </h3>\n <p className=\"text-xs text-text-tertiary\">\n Optional details for blog posts and press releases — summary, hero image, author,\n publish date, category.\n </p>\n\n {/* Excerpt */}\n <div>\n <label htmlFor=\"excerpt\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.excerpt', 'Excerpt')}\n </label>\n <textarea\n id=\"excerpt\"\n value={formData.excerpt}\n onChange={(e) => setFormData({ ...formData, excerpt: e.target.value })}\n rows={2}\n className={inputClassName}\n placeholder=\"Short summary shown on listing cards\"\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {formData.excerpt.length}/500 characters\n </p>\n </div>\n\n {/* Thumbnail */}\n <div>\n <label htmlFor=\"thumbnail\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.thumbnail', 'Thumbnail URL')}\n </label>\n <input\n id=\"thumbnail\"\n type=\"url\"\n value={formData.thumbnail}\n onChange={(e) => setFormData({ ...formData, thumbnail: e.target.value })}\n className={inputClassName}\n placeholder=\"https://images.unsplash.com/...\"\n disabled={loading}\n />\n {formData.thumbnail && (\n <div\n className=\"mt-2 rounded-lg overflow-hidden border border-default\"\n style={{ maxWidth: 320 }}\n >\n <img src={formData.thumbnail} alt=\"Thumbnail preview\" className=\"w-full h-auto\" />\n </div>\n )}\n </div>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {/* Author */}\n <div>\n <label htmlFor=\"author\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.author', 'Author')}\n </label>\n <input\n id=\"author\"\n type=\"text\"\n value={formData.author}\n onChange={(e) => setFormData({ ...formData, author: e.target.value })}\n className={inputClassName}\n placeholder=\"Author name\"\n disabled={loading}\n />\n </div>\n\n {/* Category */}\n <div>\n <label\n htmlFor=\"category\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('contentPages.category', 'Category')}\n </label>\n <input\n id=\"category\"\n type=\"text\"\n value={formData.category}\n onChange={(e) => setFormData({ ...formData, category: e.target.value })}\n className={inputClassName}\n placeholder=\"Engineering, Product, Company\"\n disabled={loading}\n />\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {/* Published At */}\n <div>\n <label\n htmlFor=\"publishedAt\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('contentPages.publishedAt', 'Publish Date')}\n </label>\n <input\n id=\"publishedAt\"\n type=\"datetime-local\"\n value={formData.publishedAt}\n onChange={(e) => setFormData({ ...formData, publishedAt: e.target.value })}\n className={inputClassName}\n disabled={loading}\n />\n </div>\n\n {/* Reading Time */}\n <div>\n <label\n htmlFor=\"readingTime\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('contentPages.readingTime', 'Reading Time (min)')}\n </label>\n <input\n id=\"readingTime\"\n type=\"number\"\n min={0}\n max={999}\n value={formData.readingTime}\n onChange={(e) =>\n setFormData({ ...formData, readingTime: parseInt(e.target.value, 10) || 0 })\n }\n className={inputClassName}\n placeholder=\"5\"\n disabled={loading}\n />\n </div>\n </div>\n\n {/* Featured Toggle */}\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={formData.featured}\n onClick={() => setFormData({ ...formData, featured: !formData.featured })}\n disabled={loading}\n className={`\n relative inline-flex h-6 w-11 shrink-0\n cursor-pointer rounded-full\n border-2 border-transparent\n transition-colors duration-200 ease-in-out\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] focus:ring-offset-2\n disabled:opacity-50 disabled:cursor-not-allowed\n ${formData.featured ? 'bg-[var(--color-action-primary-bg)]' : 'bg-gray-300 dark:bg-gray-600'}\n `}\n >\n <span\n className={`\n pointer-events-none inline-block h-5 w-5\n transform rounded-full bg-white shadow ring-0\n transition duration-200 ease-in-out\n ${formData.featured ? 'translate-x-5' : 'translate-x-0'}\n `}\n />\n </button>\n <label className=\"text-sm font-medium text-text-primary\">\n {formData.featured\n ? tr('contentPages.featured', 'Featured')\n : tr('contentPages.notFeatured', 'Not Featured')}\n </label>\n </div>\n </div>\n )}\n\n {/* Publishing Section */}\n <div className=\"space-y-4 pt-4 border-t border-default\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('contentPages.publishing', 'Publishing')}\n </h3>\n\n {/* Is Published Toggle */}\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={formData.isPublished}\n onClick={() => setFormData({ ...formData, isPublished: !formData.isPublished })}\n disabled={loading}\n className={`\n relative inline-flex h-6 w-11 shrink-0\n cursor-pointer rounded-full\n border-2 border-transparent\n transition-colors duration-200 ease-in-out\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] focus:ring-offset-2\n disabled:opacity-50 disabled:cursor-not-allowed\n ${formData.isPublished ? 'bg-[var(--color-action-primary-bg)]' : 'bg-gray-300 dark:bg-gray-600'}\n `}\n >\n <span\n className={`\n pointer-events-none inline-block h-5 w-5\n transform rounded-full bg-white shadow ring-0\n transition duration-200 ease-in-out\n ${formData.isPublished ? 'translate-x-5' : 'translate-x-0'}\n `}\n />\n </button>\n <label className=\"text-sm font-medium text-text-primary\">\n {formData.isPublished\n ? tr('contentPages.published', 'Published')\n : tr('contentPages.draft', 'Draft')}\n </label>\n </div>\n {errors.isPublished && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.isPublished}</p>\n )}\n\n {/* Visibility */}\n <div>\n <label htmlFor=\"visibility\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.visibility', 'Visibility')}\n </label>\n <select\n id=\"visibility\"\n value={formData.visibility}\n onChange={(e) =>\n setFormData({\n ...formData,\n visibility: e.target.value as typeof formData.visibility,\n })\n }\n className={inputClassName}\n disabled={loading}\n >\n <option value=\"PUBLIC\">\n {tr('contentPages.visibilityPublic', 'Public — visible to everyone')}\n </option>\n <option value=\"AUTHENTICATED\">\n {tr('contentPages.visibilityAuthenticated', 'Authenticated — signed-in users only')}\n </option>\n <option value=\"INTERNAL\">\n {tr('contentPages.visibilityInternal', 'Internal — staff/admin only')}\n </option>\n </select>\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'contentPages.visibilityHint',\n 'Public is required for blog posts and legal pages to appear on the website.'\n )}\n </p>\n {errors.visibility && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.visibility}</p>\n )}\n </div>\n\n {/* Sort Order */}\n <div>\n <label htmlFor=\"sortOrder\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.sortOrder', 'Sort Order')}\n </label>\n <input\n id=\"sortOrder\"\n type=\"number\"\n min={0}\n value={formData.sortOrder}\n onChange={(e) =>\n setFormData({\n ...formData,\n sortOrder: parseInt(e.target.value, 10) || 0,\n })\n }\n className={inputClassName}\n placeholder=\"0\"\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr('contentPages.sortOrderHint', 'Lower numbers appear first. Default is 0.')}\n </p>\n {errors.sortOrder && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.sortOrder}</p>\n )}\n </div>\n\n {/* Product ID (optional association) */}\n <div>\n <label htmlFor=\"productId\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.productId', 'Product ID')}\n </label>\n <ProductCombobox\n id=\"productId\"\n value={formData.productId}\n onChange={(id) => setFormData({ ...formData, productId: id })}\n disabled={loading}\n placeholder={tr('contentPages.productIdPlaceholder', 'Optional product association')}\n error={errors.productId}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'contentPages.productIdHint',\n 'Associate this content page with a specific product.'\n )}\n </p>\n {errors.productId && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.productId}</p>\n )}\n </div>\n </div>\n\n {/* Tags Section */}\n <div className=\"space-y-4 pt-4 border-t border-default\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">Tags</h3>\n <TagInput value={tags} onChange={setTags} disabled={loading} />\n <p className=\"text-xs text-text-tertiary\">Press Enter or comma to add a tag.</p>\n </div>\n\n {/* Form Actions */}\n <div className=\"flex gap-3 pt-4 border-t border-default\">\n <button\n type=\"submit\"\n disabled={loading}\n className=\"\n inline-flex items-center gap-2 px-6 py-2.5\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90 hover:scale-[1.02]\n transition-all duration-200\n font-medium\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n {loading && <Loader2 size={16} className=\"animate-spin\" />}\n {contentPage\n ? tr('contentPages.updateContentPage', 'Update Content Page')\n : tr('contentPages.createContentPage', 'Create Content Page')}\n </button>\n\n <button\n type=\"button\"\n onClick={onCancel}\n disabled={loading}\n className=\"\n px-6 py-2.5\n bg-transparent\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-muted\n transition-all duration-200\n font-medium\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n {tr('productCommon.cancel', 'Cancel')}\n </button>\n </div>\n </form>\n );\n}\n"],"mappings":";;;;;;;;;AAiCA,SAAS,EAAe,GAAoB;CAC1C,IAAI,IAAO;AA+EX,QA5EA,IAAO,EAAK,QAAQ,MAAM,QAAQ,CAAC,QAAQ,MAAM,OAAO,CAAC,QAAQ,MAAM,OAAO,EAG9E,IAAO,EAAK,QAAQ,6BAA6B,GAAQ,GAAO,MACvD,oFAAoF,EAAK,MAAM,CAAC,eACvG,EAGF,IAAO,EAAK,QACV,cACA,uFACD,EAGD,IAAO,EAAK,QAAQ,mBAAmB,wDAAsD,EAC7F,IAAO,EAAK,QAAQ,kBAAkB,oDAAkD,EACxF,IAAO,EAAK,QAAQ,iBAAiB,sDAAoD,EACzF,IAAO,EAAK,QAAQ,gBAAgB,oDAAkD,EACtF,IAAO,EAAK,QAAQ,eAAe,oDAAkD,EACrF,IAAO,EAAK,QAAQ,cAAc,qDAAmD,EAGrF,IAAO,EAAK,QAAQ,sBAAsB,+BAA+B,EAEzE,IAAO,EAAK,QAAQ,kBAAkB,sBAAsB,EAE5D,IAAO,EAAK,QAAQ,cAAc,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AC,KAAD;OAAG,WAAU;iBAAiD,EAAO;OAAc,CAAA;MAEjF,EAAA,CAAA;KAGN,kBAAC,OAAD,EAAA,UAAA;MACE,kBAAC,SAAD;OAAO,SAAQ;OAAY,WAAU;iBAClC,EAAG,0BAA0B,aAAa;OACrC,CAAA;MACR,kBAAC,GAAD;OACE,IAAG;OACH,OAAO,EAAS;OAChB,WAAW,MAAO,EAAY;QAAE,GAAG;QAAU,WAAW;QAAI,CAAC;OAC7D,UAAU;OACV,aAAa,EAAG,qCAAqC,+BAA+B;OACpF,OAAO,EAAO;OACd,CAAA;MACF,kBAAC,KAAD;OAAG,WAAU;iBACV,EACC,8BACA,uDACD;OACC,CAAA;MACH,EAAO,aACN,kBAAC,KAAD;OAAG,WAAU;iBAAiD,EAAO;OAAc,CAAA;MAEjF,EAAA,CAAA;KACF;;GAGN,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,MAAD;MAAI,WAAU;gBAAqE;MAAS,CAAA;KAC5F,kBAAC,GAAD;MAAU,OAAO;MAAM,UAAU;MAAS,UAAU;MAAW,CAAA;KAC/D,kBAAC,KAAD;MAAG,WAAU;gBAA6B;MAAsC,CAAA;KAC5E;;GAGN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,UAAD;KACE,MAAK;KACL,UAAU;KACV,WAAU;eAHZ,CAcG,KAAW,kBAAC,GAAD;MAAS,MAAM;MAAI,WAAU;MAAiB,CAAA,EACzD,IACG,EAAG,kCAAkC,sBAAsB,GAC3D,EAAG,kCAAkC,sBAAsB,CACxD;QAET,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,UAAU;KACV,WAAU;eAYT,EAAG,wBAAwB,SAAS;KAC9B,CAAA,CACL;;GACD"}
|
|
1
|
+
{"version":3,"file":"ContentPageForm.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/components/ContentPageForm.tsx"],"sourcesContent":["import { useState, useRef, useCallback } from 'react';\nimport { TagInput } from '../../../shared/components/input/TagInput';\nimport { ProductCombobox } from '../../../shared/components/input/ProductCombobox';\nimport {\n Loader2,\n Eye,\n EyeOff,\n Bold,\n Italic,\n Heading,\n List,\n ListOrdered,\n Link,\n Code,\n Quote,\n} from 'lucide-react';\nimport { ZodError } from 'zod';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport type { ProductContentPage, CreateContentPageInput, UpdateContentPageInput } from '../types';\nimport { createContentPageSchema, updateContentPageSchema } from '../schemas';\n\ninterface ContentPageFormProps {\n contentPage?: ProductContentPage | null;\n onSubmit: (data: CreateContentPageInput | UpdateContentPageInput) => Promise<void>;\n onCancel: () => void;\n loading?: boolean;\n}\n\n/**\n * Simple markdown-to-HTML renderer.\n * Converts common markdown syntax to HTML using regex replacements.\n * No external libraries required.\n */\nfunction renderMarkdown(md: string): string {\n let html = md;\n\n // Escape HTML entities first to prevent XSS\n html = html.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n\n // Code blocks (fenced with ```)\n html = html.replace(/```(\\w*)\\n([\\s\\S]*?)```/g, (_match, _lang, code) => {\n return `<pre class=\"bg-gray-900 text-gray-100 rounded-lg p-4 overflow-x-auto my-3\"><code>${code.trim()}</code></pre>`;\n });\n\n // Inline code\n html = html.replace(\n /`([^`]+)`/g,\n '<code class=\"bg-gray-200 dark:bg-gray-700 px-1.5 py-0.5 rounded text-sm\">$1</code>'\n );\n\n // Headings (h1 - h6)\n html = html.replace(/^###### (.+)$/gm, '<h6 class=\"text-sm font-semibold mt-4 mb-2\">$1</h6>');\n html = html.replace(/^##### (.+)$/gm, '<h5 class=\"text-sm font-bold mt-4 mb-2\">$1</h5>');\n html = html.replace(/^#### (.+)$/gm, '<h4 class=\"text-base font-bold mt-4 mb-2\">$1</h4>');\n html = html.replace(/^### (.+)$/gm, '<h3 class=\"text-lg font-bold mt-4 mb-2\">$1</h3>');\n html = html.replace(/^## (.+)$/gm, '<h2 class=\"text-xl font-bold mt-5 mb-2\">$1</h2>');\n html = html.replace(/^# (.+)$/gm, '<h1 class=\"text-2xl font-bold mt-6 mb-3\">$1</h1>');\n\n // Bold & Italic combined\n html = html.replace(/\\*\\*\\*(.+?)\\*\\*\\*/g, '<strong><em>$1</em></strong>');\n // Bold\n html = html.replace(/\\*\\*(.+?)\\*\\*/g, '<strong>$1</strong>');\n // Italic\n html = html.replace(/\\*(.+?)\\*/g, '<em>$1</em>');\n\n // Links: [text](url)\n html = html.replace(\n /\\[([^\\]]+)\\]\\(([^)]+)\\)/g,\n '<a href=\"$2\" class=\"text-blue-500 underline hover:text-blue-700\" target=\"_blank\" rel=\"noopener noreferrer\">$1</a>'\n );\n\n // Blockquotes (supports multi-line consecutive > lines)\n html = html.replace(\n /^> (.+)$/gm,\n '<blockquote class=\"border-l-4 border-gray-300 pl-4 italic text-gray-600 my-2\">$1</blockquote>'\n );\n\n // Unordered lists: detect consecutive lines starting with \"- \"\n html = html.replace(/(^- .+$(\\n^- .+$)*)/gm, (block) => {\n const items = block\n .split('\\n')\n .map((line) => `<li class=\"ml-4\">${line.replace(/^- /, '')}</li>`)\n .join('\\n');\n return `<ul class=\"list-disc list-inside my-2\">\\n${items}\\n</ul>`;\n });\n\n // Ordered lists: detect consecutive lines starting with \"N. \"\n html = html.replace(/(^\\d+\\. .+$(\\n^\\d+\\. .+$)*)/gm, (block) => {\n const items = block\n .split('\\n')\n .map((line) => `<li class=\"ml-4\">${line.replace(/^\\d+\\. /, '')}</li>`)\n .join('\\n');\n return `<ol class=\"list-decimal list-inside my-2\">\\n${items}\\n</ol>`;\n });\n\n // Horizontal rule\n html = html.replace(/^---$/gm, '<hr class=\"my-4 border-gray-300\" />');\n\n // Paragraphs: wrap remaining bare lines in <p> tags\n // Split by double newlines for paragraph breaks\n html = html\n .split(/\\n\\n+/)\n .map((block) => {\n const trimmed = block.trim();\n if (!trimmed) return '';\n // Don't wrap blocks that already start with HTML tags\n if (/^<(h[1-6]|ul|ol|pre|blockquote|hr|div)/.test(trimmed)) {\n return trimmed;\n }\n return `<p class=\"my-2 leading-relaxed\">${trimmed.replace(/\\n/g, '<br />')}</p>`;\n })\n .join('\\n');\n\n return html;\n}\n\ntype ToolbarAction = {\n label: string;\n icon: React.ComponentType<{ size?: number }>;\n prefix: string;\n suffix: string;\n placeholder: string;\n block?: boolean;\n};\n\nconst TOOLBAR_ACTIONS: ToolbarAction[] = [\n { label: 'Bold', icon: Bold, prefix: '**', suffix: '**', placeholder: 'bold text' },\n { label: 'Italic', icon: Italic, prefix: '*', suffix: '*', placeholder: 'italic text' },\n {\n label: 'Heading',\n icon: Heading,\n prefix: '## ',\n suffix: '',\n placeholder: 'Heading',\n block: true,\n },\n {\n label: 'Bullet List',\n icon: List,\n prefix: '- ',\n suffix: '',\n placeholder: 'List item',\n block: true,\n },\n {\n label: 'Numbered List',\n icon: ListOrdered,\n prefix: '1. ',\n suffix: '',\n placeholder: 'List item',\n block: true,\n },\n { label: 'Link', icon: Link, prefix: '[', suffix: '](url)', placeholder: 'link text' },\n {\n label: 'Code Block',\n icon: Code,\n prefix: '```\\n',\n suffix: '\\n```',\n placeholder: 'code',\n block: true,\n },\n { label: 'Quote', icon: Quote, prefix: '> ', suffix: '', placeholder: 'quote text', block: true },\n];\n\n// Page types that expose the extra \"Article Details\" section (excerpt,\n// thumbnail, author, publish date, …). Set-based so adding e.g. 'docs'\n// later is a one-token change rather than growing a boolean chain.\nconst DETAIL_PAGE_TYPES = new Set<string>(['blog', 'press']);\n\nexport function ContentPageForm({\n contentPage,\n onSubmit,\n onCancel,\n loading,\n}: ContentPageFormProps) {\n const tr = useTr();\n const [formData, setFormData] = useState({\n slug: contentPage?.slug || '',\n title: contentPage?.title || '',\n content: contentPage?.content || '',\n contentFormat: contentPage?.contentFormat || 'markdown',\n seoTitle: contentPage?.seoTitle || '',\n seoDescription: contentPage?.seoDescription || '',\n seoKeywords: contentPage?.seoKeywords || '',\n isPublished: contentPage?.isPublished ?? false,\n visibility: contentPage?.visibility ?? 'PUBLIC',\n sortOrder: contentPage?.sortOrder ?? 0,\n productId: contentPage?.productId || '',\n excerpt: contentPage?.excerpt || '',\n thumbnail: contentPage?.thumbnail || '',\n author: contentPage?.author || '',\n publishedAt: contentPage?.publishedAt ? contentPage.publishedAt.slice(0, 16) : '',\n readingTime: contentPage?.readingTime ?? 0,\n featured: contentPage?.featured ?? false,\n category: contentPage?.category || '',\n });\n\n const [tags, setTags] = useState<string[]>(contentPage?.tags ?? []);\n\n // Page Type drives the primary tag (so it can't be forgotten) and which\n // sections show. Derived from existing tags when editing.\n const PRIMARY_TYPE_TAGS = ['blog', 'legal', 'docs', 'press', 'page'];\n const initialType =\n (contentPage?.tags ?? []).find((t) => PRIMARY_TYPE_TAGS.includes(t)) || 'page';\n const [pageType, setPageType] = useState<string>(initialType);\n\n const changePageType = (next: string) => {\n setPageType(next);\n setTags((prev) => {\n const withoutPrimary = prev.filter((t) => !PRIMARY_TYPE_TAGS.includes(t));\n return [next, ...withoutPrimary];\n });\n };\n\n const [errors, setErrors] = useState<Record<string, string>>({});\n const [showPreview, setShowPreview] = useState(false);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const validate = () => {\n try {\n const schema = contentPage ? updateContentPageSchema : createContentPageSchema;\n const dataToValidate: Record<string, unknown> = { ...formData };\n // Convert sortOrder to number for validation\n dataToValidate.sortOrder =\n typeof formData.sortOrder === 'string'\n ? parseInt(formData.sortOrder as string, 10) || 0\n : formData.sortOrder;\n // Strip empty optional strings so Zod doesn't complain\n if (!dataToValidate.seoTitle) delete dataToValidate.seoTitle;\n if (!dataToValidate.seoDescription) delete dataToValidate.seoDescription;\n if (!dataToValidate.seoKeywords) delete dataToValidate.seoKeywords;\n if (!dataToValidate.productId) delete dataToValidate.productId;\n if (!dataToValidate.contentFormat) dataToValidate.contentFormat = 'markdown';\n if (!dataToValidate.excerpt) delete dataToValidate.excerpt;\n if (!dataToValidate.thumbnail) delete dataToValidate.thumbnail;\n if (!dataToValidate.author) delete dataToValidate.author;\n if (!dataToValidate.publishedAt) delete dataToValidate.publishedAt;\n if (!dataToValidate.readingTime) delete dataToValidate.readingTime;\n if (!dataToValidate.category) delete dataToValidate.category;\n\n schema.parse(dataToValidate);\n setErrors({});\n return true;\n } catch (error) {\n if (error instanceof ZodError) {\n const newErrors: Record<string, string> = {};\n error.issues.forEach((issue) => {\n const path = issue.path.join('.');\n newErrors[path] = issue.message;\n });\n setErrors(newErrors);\n }\n return false;\n }\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (!validate()) {\n return;\n }\n\n const sortOrderNum =\n typeof formData.sortOrder === 'string'\n ? parseInt(formData.sortOrder as string, 10) || 0\n : formData.sortOrder;\n\n // Guarantee exactly one primary type tag matching the selected Page Type,\n // even if the user never touched the dropdown.\n const finalTags = [pageType, ...tags.filter((t) => !PRIMARY_TYPE_TAGS.includes(t))];\n\n const submitData = contentPage\n ? {\n // Update only changed fields\n title: formData.title !== contentPage.title ? formData.title : undefined,\n content: formData.content !== contentPage.content ? formData.content : undefined,\n contentFormat:\n formData.contentFormat !== contentPage.contentFormat\n ? formData.contentFormat\n : undefined,\n seoTitle:\n formData.seoTitle !== (contentPage.seoTitle || '')\n ? formData.seoTitle || undefined\n : undefined,\n seoDescription:\n formData.seoDescription !== (contentPage.seoDescription || '')\n ? formData.seoDescription || undefined\n : undefined,\n seoKeywords:\n formData.seoKeywords !== (contentPage.seoKeywords || '')\n ? formData.seoKeywords || undefined\n : undefined,\n isPublished:\n formData.isPublished !== contentPage.isPublished ? formData.isPublished : undefined,\n visibility:\n formData.visibility !== contentPage.visibility ? formData.visibility : undefined,\n sortOrder: sortOrderNum !== contentPage.sortOrder ? sortOrderNum : undefined,\n productId:\n formData.productId !== (contentPage.productId || '')\n ? formData.productId || undefined\n : undefined,\n tags: finalTags,\n excerpt: formData.excerpt || undefined,\n thumbnail: formData.thumbnail || undefined,\n author: formData.author || undefined,\n publishedAt: formData.publishedAt\n ? new Date(formData.publishedAt).toISOString()\n : undefined,\n readingTime: formData.readingTime || undefined,\n featured: formData.featured,\n category: formData.category || undefined,\n }\n : {\n // Create with all fields\n slug: formData.slug,\n title: formData.title,\n content: formData.content,\n contentFormat: formData.contentFormat || 'markdown',\n seoTitle: formData.seoTitle || undefined,\n seoDescription: formData.seoDescription || undefined,\n seoKeywords: formData.seoKeywords || undefined,\n isPublished: formData.isPublished,\n visibility: formData.visibility,\n sortOrder: sortOrderNum,\n productId: formData.productId || undefined,\n tags: finalTags,\n excerpt: formData.excerpt || undefined,\n thumbnail: formData.thumbnail || undefined,\n author: formData.author || undefined,\n publishedAt: formData.publishedAt\n ? new Date(formData.publishedAt).toISOString()\n : undefined,\n readingTime: formData.readingTime || undefined,\n featured: formData.featured,\n category: formData.category || undefined,\n };\n\n await onSubmit(submitData);\n };\n\n const insertMarkdown = useCallback(\n (action: ToolbarAction) => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n\n const { selectionStart, selectionEnd } = textarea;\n const currentContent = formData.content;\n const selectedText = currentContent.substring(selectionStart, selectionEnd);\n const textToWrap = selectedText || action.placeholder;\n\n let insertion: string;\n let newCursorStart: number;\n let newCursorEnd: number;\n\n if (action.block && selectionStart > 0 && currentContent[selectionStart - 1] !== '\\n') {\n // For block-level elements, ensure they start on a new line\n insertion = `\\n${action.prefix}${textToWrap}${action.suffix}`;\n } else {\n insertion = `${action.prefix}${textToWrap}${action.suffix}`;\n }\n\n const before = currentContent.substring(0, selectionStart);\n const after = currentContent.substring(selectionEnd);\n const newContent = before + insertion + after;\n\n setFormData((prev) => ({ ...prev, content: newContent }));\n\n // Calculate new cursor position to select the inserted text\n const prefixLen = insertion.indexOf(textToWrap);\n newCursorStart = selectionStart + prefixLen;\n newCursorEnd = newCursorStart + textToWrap.length;\n\n // Restore focus and selection after state update\n requestAnimationFrame(() => {\n textarea.focus();\n textarea.setSelectionRange(newCursorStart, newCursorEnd);\n });\n },\n [formData.content]\n );\n\n const inputClassName = `\n w-full px-3 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n placeholder:text-text-tertiary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n disabled:bg-muted disabled:cursor-not-allowed\n transition-all duration-200\n `;\n\n const toolbarButtonClassName = `\n inline-flex items-center justify-center\n w-8 h-8\n rounded\n text-text-secondary\n hover:bg-muted hover:text-text-primary\n transition-all duration-150\n disabled:opacity-50 disabled:cursor-not-allowed\n `;\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-6 animate-in fade-in duration-300\">\n {/* Basic Information Section */}\n <div className=\"space-y-4\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('contentPages.basicInformation', 'Basic Information')}\n </h3>\n\n {/* Page Type */}\n <div>\n <label htmlFor=\"pageType\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.pageType', 'Page Type')}\n </label>\n <select\n id=\"pageType\"\n value={pageType}\n onChange={(e) => changePageType(e.target.value)}\n className={inputClassName}\n disabled={loading}\n >\n <option value=\"blog\">{tr('contentPages.typeBlog', 'Blog Post')}</option>\n <option value=\"legal\">{tr('contentPages.typeLegal', 'Legal')}</option>\n <option value=\"docs\">{tr('contentPages.typeDocs', 'Documentation')}</option>\n <option value=\"press\">{tr('contentPages.typePress', 'Press Release')}</option>\n <option value=\"page\">{tr('contentPages.typePage', 'General Page')}</option>\n </select>\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'contentPages.pageTypeHint',\n 'Sets the primary tag and which fields apply. Blog Posts and Press Releases get the extra Article Details section below.'\n )}\n </p>\n </div>\n\n {/* Slug */}\n <div>\n <label htmlFor=\"slug\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.slug', 'Slug')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"slug\"\n type=\"text\"\n value={formData.slug}\n onChange={(e) =>\n setFormData({\n ...formData,\n slug: e.target.value.toLowerCase().replace(/\\s+/g, '-'),\n })\n }\n className={inputClassName}\n placeholder=\"page-slug\"\n disabled={loading || !!contentPage}\n required={!contentPage}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'contentPages.slugHint',\n 'Lowercase letters, numbers, and hyphens only. Cannot be changed after creation.'\n )}\n </p>\n {errors.slug && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.slug}</p>\n )}\n </div>\n\n {/* Title */}\n <div>\n <label htmlFor=\"title\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.pageTitle', 'Title')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"title\"\n type=\"text\"\n value={formData.title}\n onChange={(e) => setFormData({ ...formData, title: e.target.value })}\n className={inputClassName}\n placeholder={tr('contentPages.enterPageTitle', 'Enter page title')}\n disabled={loading}\n required\n />\n {errors.title && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.title}</p>\n )}\n </div>\n </div>\n\n {/* Content Editor Section */}\n <div className=\"space-y-4 pt-4 border-t border-default\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('contentPages.contentEditor', 'Content Editor')}\n </h3>\n\n {/* Editor Toolbar & Tabs */}\n <div className=\"border border-default rounded-lg overflow-hidden\">\n {/* Top bar: Toolbar + Toggle */}\n <div className=\"flex items-center justify-between bg-muted px-2 py-1.5 border-b border-default\">\n {/* Formatting Toolbar */}\n <div className=\"flex items-center gap-0.5\">\n {TOOLBAR_ACTIONS.map((action) => {\n const IconComponent = action.icon;\n return (\n <button\n key={action.label}\n type=\"button\"\n title={action.label}\n onClick={() => insertMarkdown(action)}\n disabled={loading || showPreview}\n className={toolbarButtonClassName}\n >\n <IconComponent size={16} />\n </button>\n );\n })}\n </div>\n\n {/* Edit / Preview Toggle */}\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => setShowPreview(false)}\n className={`\n inline-flex items-center gap-1.5 px-3 py-1 rounded text-xs font-medium\n transition-all duration-150\n ${\n !showPreview\n ? 'bg-surface text-text-primary shadow-sm'\n : 'text-text-tertiary hover:text-text-secondary'\n }\n `}\n >\n <EyeOff size={14} />\n {tr('contentPages.editMode', 'Edit')}\n </button>\n <button\n type=\"button\"\n onClick={() => setShowPreview(true)}\n className={`\n inline-flex items-center gap-1.5 px-3 py-1 rounded text-xs font-medium\n transition-all duration-150\n ${\n showPreview\n ? 'bg-surface text-text-primary shadow-sm'\n : 'text-text-tertiary hover:text-text-secondary'\n }\n `}\n >\n <Eye size={14} />\n {tr('contentPages.previewMode', 'Preview')}\n </button>\n </div>\n </div>\n\n {/* Editor / Preview Panels */}\n <div className=\"relative\">\n {/* Edit Panel */}\n {!showPreview && (\n <textarea\n ref={textareaRef}\n id=\"content\"\n value={formData.content}\n onChange={(e) => setFormData({ ...formData, content: e.target.value })}\n className={`\n w-full px-4 py-3\n min-h-[400px]\n bg-surface\n text-text-primary\n placeholder:text-text-tertiary\n focus:outline-none\n disabled:bg-muted disabled:cursor-not-allowed\n font-mono text-sm\n resize-y\n transition-all duration-200\n `}\n placeholder={tr(\n 'contentPages.writeContentPlaceholder',\n 'Write your content in markdown...'\n )}\n disabled={loading}\n />\n )}\n\n {/* Preview Panel */}\n {showPreview && (\n <div\n className=\"\n w-full px-4 py-3\n min-h-[400px]\n bg-surface\n text-text-primary\n overflow-y-auto\n prose-like\n \"\n dangerouslySetInnerHTML={{\n __html: formData.content\n ? renderMarkdown(formData.content)\n : '<p class=\"text-gray-400 italic\">Nothing to preview yet. Start writing in the editor.</p>',\n }}\n />\n )}\n </div>\n </div>\n\n {errors.content && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.content}</p>\n )}\n </div>\n\n {/* SEO Metadata Section */}\n <div className=\"space-y-4 pt-4 border-t border-default\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('contentPages.seoMetadata', 'SEO Metadata')}\n </h3>\n\n {/* SEO Title */}\n <div>\n <label htmlFor=\"seoTitle\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.seoTitle', 'SEO Title')}\n </label>\n <input\n id=\"seoTitle\"\n type=\"text\"\n value={formData.seoTitle}\n onChange={(e) => setFormData({ ...formData, seoTitle: e.target.value })}\n className={inputClassName}\n placeholder={tr('contentPages.seoTitlePlaceholder', 'Page title for search engines')}\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {formData.seoTitle.length}/100 characters\n </p>\n {errors.seoTitle && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.seoTitle}</p>\n )}\n </div>\n\n {/* SEO Description */}\n <div>\n <label\n htmlFor=\"seoDescription\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('contentPages.seoDescription', 'SEO Description')}\n </label>\n <textarea\n id=\"seoDescription\"\n value={formData.seoDescription}\n onChange={(e) => setFormData({ ...formData, seoDescription: e.target.value })}\n rows={3}\n className={inputClassName}\n placeholder={tr(\n 'contentPages.seoDescriptionPlaceholder',\n 'Brief description for search engine results'\n )}\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {formData.seoDescription.length}/300 characters\n </p>\n {errors.seoDescription && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.seoDescription}</p>\n )}\n </div>\n\n {/* SEO Keywords */}\n <div>\n <label htmlFor=\"seoKeywords\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.seoKeywords', 'SEO Keywords')}\n </label>\n <input\n id=\"seoKeywords\"\n type=\"text\"\n value={formData.seoKeywords}\n onChange={(e) => setFormData({ ...formData, seoKeywords: e.target.value })}\n className={inputClassName}\n placeholder=\"keyword1, keyword2, keyword3\"\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n Comma-separated keywords. {formData.seoKeywords.length}/200 characters\n </p>\n {errors.seoKeywords && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.seoKeywords}</p>\n )}\n </div>\n </div>\n\n {/* Extra detail fields — Blog Posts & Press Releases */}\n {DETAIL_PAGE_TYPES.has(pageType) && (\n <div className=\"space-y-4 pt-4 border-t border-default\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('contentPages.extraDetailFields', 'Article Details')}\n </h3>\n <p className=\"text-xs text-text-tertiary\">\n Optional details for blog posts and press releases: summary, hero image, author,\n publish date, category.\n </p>\n\n {/* Excerpt */}\n <div>\n <label htmlFor=\"excerpt\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.excerpt', 'Excerpt')}\n </label>\n <textarea\n id=\"excerpt\"\n value={formData.excerpt}\n onChange={(e) => setFormData({ ...formData, excerpt: e.target.value })}\n rows={2}\n className={inputClassName}\n placeholder=\"Short summary shown on listing cards\"\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {formData.excerpt.length}/500 characters\n </p>\n </div>\n\n {/* Thumbnail */}\n <div>\n <label htmlFor=\"thumbnail\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.thumbnail', 'Thumbnail URL')}\n </label>\n <input\n id=\"thumbnail\"\n type=\"url\"\n value={formData.thumbnail}\n onChange={(e) => setFormData({ ...formData, thumbnail: e.target.value })}\n className={inputClassName}\n placeholder=\"https://images.unsplash.com/...\"\n disabled={loading}\n />\n {formData.thumbnail && (\n <div\n className=\"mt-2 rounded-lg overflow-hidden border border-default\"\n style={{ maxWidth: 320 }}\n >\n <img src={formData.thumbnail} alt=\"Thumbnail preview\" className=\"w-full h-auto\" />\n </div>\n )}\n </div>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {/* Author */}\n <div>\n <label htmlFor=\"author\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.author', 'Author')}\n </label>\n <input\n id=\"author\"\n type=\"text\"\n value={formData.author}\n onChange={(e) => setFormData({ ...formData, author: e.target.value })}\n className={inputClassName}\n placeholder=\"Author name\"\n disabled={loading}\n />\n </div>\n\n {/* Category */}\n <div>\n <label\n htmlFor=\"category\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('contentPages.category', 'Category')}\n </label>\n <input\n id=\"category\"\n type=\"text\"\n value={formData.category}\n onChange={(e) => setFormData({ ...formData, category: e.target.value })}\n className={inputClassName}\n placeholder=\"Engineering, Product, Company\"\n disabled={loading}\n />\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {/* Published At */}\n <div>\n <label\n htmlFor=\"publishedAt\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('contentPages.publishedAt', 'Publish Date')}\n </label>\n <input\n id=\"publishedAt\"\n type=\"datetime-local\"\n value={formData.publishedAt}\n onChange={(e) => setFormData({ ...formData, publishedAt: e.target.value })}\n className={inputClassName}\n disabled={loading}\n />\n </div>\n\n {/* Reading Time */}\n <div>\n <label\n htmlFor=\"readingTime\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('contentPages.readingTime', 'Reading Time (min)')}\n </label>\n <input\n id=\"readingTime\"\n type=\"number\"\n min={0}\n max={999}\n value={formData.readingTime}\n onChange={(e) =>\n setFormData({ ...formData, readingTime: parseInt(e.target.value, 10) || 0 })\n }\n className={inputClassName}\n placeholder=\"5\"\n disabled={loading}\n />\n </div>\n </div>\n\n {/* Featured Toggle */}\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={formData.featured}\n onClick={() => setFormData({ ...formData, featured: !formData.featured })}\n disabled={loading}\n className={`\n relative inline-flex h-6 w-11 shrink-0\n cursor-pointer rounded-full\n border-2 border-transparent\n transition-colors duration-200 ease-in-out\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] focus:ring-offset-2\n disabled:opacity-50 disabled:cursor-not-allowed\n ${formData.featured ? 'bg-[var(--color-action-primary-bg)]' : 'bg-gray-300 dark:bg-gray-600'}\n `}\n >\n <span\n className={`\n pointer-events-none inline-block h-5 w-5\n transform rounded-full bg-white shadow ring-0\n transition duration-200 ease-in-out\n ${formData.featured ? 'translate-x-5' : 'translate-x-0'}\n `}\n />\n </button>\n <label className=\"text-sm font-medium text-text-primary\">\n {formData.featured\n ? tr('contentPages.featured', 'Featured')\n : tr('contentPages.notFeatured', 'Not Featured')}\n </label>\n </div>\n </div>\n )}\n\n {/* Publishing Section */}\n <div className=\"space-y-4 pt-4 border-t border-default\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('contentPages.publishing', 'Publishing')}\n </h3>\n\n {/* Is Published Toggle */}\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={formData.isPublished}\n onClick={() => setFormData({ ...formData, isPublished: !formData.isPublished })}\n disabled={loading}\n className={`\n relative inline-flex h-6 w-11 shrink-0\n cursor-pointer rounded-full\n border-2 border-transparent\n transition-colors duration-200 ease-in-out\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] focus:ring-offset-2\n disabled:opacity-50 disabled:cursor-not-allowed\n ${formData.isPublished ? 'bg-[var(--color-action-primary-bg)]' : 'bg-gray-300 dark:bg-gray-600'}\n `}\n >\n <span\n className={`\n pointer-events-none inline-block h-5 w-5\n transform rounded-full bg-white shadow ring-0\n transition duration-200 ease-in-out\n ${formData.isPublished ? 'translate-x-5' : 'translate-x-0'}\n `}\n />\n </button>\n <label className=\"text-sm font-medium text-text-primary\">\n {formData.isPublished\n ? tr('contentPages.published', 'Published')\n : tr('contentPages.draft', 'Draft')}\n </label>\n </div>\n {errors.isPublished && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.isPublished}</p>\n )}\n\n {/* Visibility */}\n <div>\n <label htmlFor=\"visibility\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.visibility', 'Visibility')}\n </label>\n <select\n id=\"visibility\"\n value={formData.visibility}\n onChange={(e) =>\n setFormData({\n ...formData,\n visibility: e.target.value as typeof formData.visibility,\n })\n }\n className={inputClassName}\n disabled={loading}\n >\n <option value=\"PUBLIC\">\n {tr('contentPages.visibilityPublic', 'Public — visible to everyone')}\n </option>\n <option value=\"AUTHENTICATED\">\n {tr('contentPages.visibilityAuthenticated', 'Authenticated — signed-in users only')}\n </option>\n <option value=\"INTERNAL\">\n {tr('contentPages.visibilityInternal', 'Internal — staff/admin only')}\n </option>\n </select>\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'contentPages.visibilityHint',\n 'Public is required for blog posts and legal pages to appear on the website.'\n )}\n </p>\n {errors.visibility && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.visibility}</p>\n )}\n </div>\n\n {/* Sort Order */}\n <div>\n <label htmlFor=\"sortOrder\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.sortOrder', 'Sort Order')}\n </label>\n <input\n id=\"sortOrder\"\n type=\"number\"\n min={0}\n value={formData.sortOrder}\n onChange={(e) =>\n setFormData({\n ...formData,\n sortOrder: parseInt(e.target.value, 10) || 0,\n })\n }\n className={inputClassName}\n placeholder=\"0\"\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr('contentPages.sortOrderHint', 'Lower numbers appear first. Default is 0.')}\n </p>\n {errors.sortOrder && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.sortOrder}</p>\n )}\n </div>\n\n {/* Product ID (optional association) */}\n <div>\n <label htmlFor=\"productId\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('contentPages.productId', 'Product ID')}\n </label>\n <ProductCombobox\n id=\"productId\"\n value={formData.productId}\n onChange={(id) => setFormData({ ...formData, productId: id })}\n disabled={loading}\n placeholder={tr('contentPages.productIdPlaceholder', 'Optional product association')}\n error={errors.productId}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'contentPages.productIdHint',\n 'Associate this content page with a specific product.'\n )}\n </p>\n {errors.productId && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.productId}</p>\n )}\n </div>\n </div>\n\n {/* Tags Section */}\n <div className=\"space-y-4 pt-4 border-t border-default\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">Tags</h3>\n <TagInput value={tags} onChange={setTags} disabled={loading} />\n <p className=\"text-xs text-text-tertiary\">Press Enter or comma to add a tag.</p>\n </div>\n\n {/* Form Actions */}\n <div className=\"flex gap-3 pt-4 border-t border-default\">\n <button\n type=\"submit\"\n disabled={loading}\n className=\"\n inline-flex items-center gap-2 px-6 py-2.5\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90 hover:scale-[1.02]\n transition-all duration-200\n font-medium\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n {loading && <Loader2 size={16} className=\"animate-spin\" />}\n {contentPage\n ? tr('contentPages.updateContentPage', 'Update Content Page')\n : tr('contentPages.createContentPage', 'Create Content Page')}\n </button>\n\n <button\n type=\"button\"\n onClick={onCancel}\n disabled={loading}\n className=\"\n px-6 py-2.5\n bg-transparent\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-muted\n transition-all duration-200\n font-medium\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n {tr('productCommon.cancel', 'Cancel')}\n </button>\n </div>\n </form>\n );\n}\n"],"mappings":";;;;;;;;;AAiCA,SAAS,EAAe,GAAoB;CAC1C,IAAI,IAAO;AA+EX,QA5EA,IAAO,EAAK,QAAQ,MAAM,QAAQ,CAAC,QAAQ,MAAM,OAAO,CAAC,QAAQ,MAAM,OAAO,EAG9E,IAAO,EAAK,QAAQ,6BAA6B,GAAQ,GAAO,MACvD,oFAAoF,EAAK,MAAM,CAAC,eACvG,EAGF,IAAO,EAAK,QACV,cACA,uFACD,EAGD,IAAO,EAAK,QAAQ,mBAAmB,wDAAsD,EAC7F,IAAO,EAAK,QAAQ,kBAAkB,oDAAkD,EACxF,IAAO,EAAK,QAAQ,iBAAiB,sDAAoD,EACzF,IAAO,EAAK,QAAQ,gBAAgB,oDAAk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T,EAAG,wBAAwB,SAAS;KAC9B,CAAA,CACL;;GACD"}
|
|
@@ -33,6 +33,7 @@ function c() {
|
|
|
33
33
|
className: "mb-6",
|
|
34
34
|
children: [
|
|
35
35
|
/* @__PURE__ */ s("button", {
|
|
36
|
+
type: "button",
|
|
36
37
|
onClick: _,
|
|
37
38
|
className: "\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n ",
|
|
38
39
|
children: [/* @__PURE__ */ o(a, { size: 20 }), /* @__PURE__ */ o("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageCreatePage.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPageCreatePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { ArrowLeft } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useCreateContentPage } from '../hooks/useContentPages';\nimport { ContentPageForm } from '../components/ContentPageForm';\nimport type { CreateContentPageInput, UpdateContentPageInput } from '../types';\n\nexport function ContentPageCreatePage() {\n const { navigate, basePath = '/products' } = useProductConsole();\n const contentPagesBasePath = `${basePath}/content-pages`;\n const { createContentPage, loading } = useCreateContentPage();\n const tr = useTr();\n const [error, setError] = useState<string | null>(null);\n\n const handleSubmit = async (data: CreateContentPageInput | UpdateContentPageInput) => {\n try {\n setError(null);\n const createData = data as CreateContentPageInput;\n const result = await createContentPage(createData);\n\n // Generated hooks (v3-style codegen) return GraphQL errors in `result.errors`\n // instead of throwing. Surface them inline so submit doesn't silently succeed.\n if (result.errors && result.errors.length > 0) {\n setError(result.errors[0]?.message ?? 'Failed to create content page');\n return;\n }\n\n if (result.data?.createContentPage) {\n navigate(`${contentPagesBasePath}/${result.data.createContentPage.id}`);\n return;\n }\n\n setError('Failed to create content page');\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to create content page';\n setError(message);\n console.error('Failed to create content page:', err);\n }\n };\n\n const handleCancel = () => {\n navigate(contentPagesBasePath);\n };\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n <div className=\"mb-6\">\n <button\n onClick={handleCancel}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('contentPages.backToContentPages', 'Back to Content Pages')}\n </span>\n </button>\n\n <h1 className=\"text-3xl font-bold text-text-primary mb-2\">\n {tr('contentPages.createContentPage', 'Create Content Page')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('contentPages.createContentPageSubtitle', 'Add a new content page')}\n </p>\n </div>\n\n {error && (\n <div className=\"mb-6 p-4 bg-[var(--color-status-error-subtle)] border border-[var(--color-status-error-border)] rounded-lg\">\n <p className=\"text-sm text-[var(--color-status-error)]\">{error}</p>\n </div>\n )}\n\n <div className=\"max-w-2xl\">\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)]\">\n <ContentPageForm onSubmit={handleSubmit} onCancel={handleCancel} loading={loading} />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAQA,SAAgB,IAAwB;CACtC,IAAM,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAuB,GAAG,EAAS,iBACnC,EAAE,sBAAmB,eAAY,GAAsB,EACvD,IAAK,GAAO,EACZ,CAAC,GAAO,KAAY,EAAwB,KAAK,EAEjD,IAAe,OAAO,MAA0D;AACpF,MAAI;AACF,KAAS,KAAK;GAEd,IAAM,IAAS,MAAM,EAAkB,EAAW;AAIlD,OAAI,EAAO,UAAU,EAAO,OAAO,SAAS,GAAG;AAC7C,MAAS,EAAO,OAAO,IAAI,WAAW,gCAAgC;AACtE;;AAGF,OAAI,EAAO,MAAM,mBAAmB;AAClC,MAAS,GAAG,EAAqB,GAAG,EAAO,KAAK,kBAAkB,KAAK;AACvE;;AAGF,KAAS,gCAAgC;WAClC,GAAK;AAGZ,GADA,EADgB,aAAe,QAAQ,EAAI,UAAU,gCACpC,EACjB,QAAQ,MAAM,kCAAkC,EAAI;;IAIlD,UAAqB;AACzB,IAAS,EAAqB;;AAGhC,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,UAAD;
|
|
1
|
+
{"version":3,"file":"ContentPageCreatePage.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPageCreatePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { ArrowLeft } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useCreateContentPage } from '../hooks/useContentPages';\nimport { ContentPageForm } from '../components/ContentPageForm';\nimport type { CreateContentPageInput, UpdateContentPageInput } from '../types';\n\nexport function ContentPageCreatePage() {\n const { navigate, basePath = '/products' } = useProductConsole();\n const contentPagesBasePath = `${basePath}/content-pages`;\n const { createContentPage, loading } = useCreateContentPage();\n const tr = useTr();\n const [error, setError] = useState<string | null>(null);\n\n const handleSubmit = async (data: CreateContentPageInput | UpdateContentPageInput) => {\n try {\n setError(null);\n const createData = data as CreateContentPageInput;\n const result = await createContentPage(createData);\n\n // Generated hooks (v3-style codegen) return GraphQL errors in `result.errors`\n // instead of throwing. Surface them inline so submit doesn't silently succeed.\n if (result.errors && result.errors.length > 0) {\n setError(result.errors[0]?.message ?? 'Failed to create content page');\n return;\n }\n\n if (result.data?.createContentPage) {\n navigate(`${contentPagesBasePath}/${result.data.createContentPage.id}`);\n return;\n }\n\n setError('Failed to create content page');\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to create content page';\n setError(message);\n console.error('Failed to create content page:', err);\n }\n };\n\n const handleCancel = () => {\n navigate(contentPagesBasePath);\n };\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n <div className=\"mb-6\">\n <button type=\"button\"\n onClick={handleCancel}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('contentPages.backToContentPages', 'Back to Content Pages')}\n </span>\n </button>\n\n <h1 className=\"text-3xl font-bold text-text-primary mb-2\">\n {tr('contentPages.createContentPage', 'Create Content Page')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('contentPages.createContentPageSubtitle', 'Add a new content page')}\n </p>\n </div>\n\n {error && (\n <div className=\"mb-6 p-4 bg-[var(--color-status-error-subtle)] border border-[var(--color-status-error-border)] rounded-lg\">\n <p className=\"text-sm text-[var(--color-status-error)]\">{error}</p>\n </div>\n )}\n\n <div className=\"max-w-2xl\">\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)]\">\n <ContentPageForm onSubmit={handleSubmit} onCancel={handleCancel} loading={loading} />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAQA,SAAgB,IAAwB;CACtC,IAAM,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAuB,GAAG,EAAS,iBACnC,EAAE,sBAAmB,eAAY,GAAsB,EACvD,IAAK,GAAO,EACZ,CAAC,GAAO,KAAY,EAAwB,KAAK,EAEjD,IAAe,OAAO,MAA0D;AACpF,MAAI;AACF,KAAS,KAAK;GAEd,IAAM,IAAS,MAAM,EAAkB,EAAW;AAIlD,OAAI,EAAO,UAAU,EAAO,OAAO,SAAS,GAAG;AAC7C,MAAS,EAAO,OAAO,IAAI,WAAW,gCAAgC;AACtE;;AAGF,OAAI,EAAO,MAAM,mBAAmB;AAClC,MAAS,GAAG,EAAqB,GAAG,EAAO,KAAK,kBAAkB,KAAK;AACvE;;AAGF,KAAS,gCAAgC;WAClC,GAAK;AAGZ,GADA,EADgB,aAAe,QAAQ,EAAI,UAAU,gCACpC,EACjB,QAAQ,MAAM,kCAAkC,EAAI;;IAIlD,UAAqB;AACzB,IAAS,EAAqB;;AAGhC,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,UAAD;MAAQ,MAAK;MACX,SAAS;MACT,WAAU;gBAFZ,CASE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA,EACvB,kBAAC,QAAD;OAAM,WAAU;iBACb,EAAG,mCAAmC,wBAAwB;OAC1D,CAAA,CACA;;KAET,kBAAC,MAAD;MAAI,WAAU;gBACX,EAAG,kCAAkC,sBAAsB;MACzD,CAAA;KACL,kBAAC,KAAD;MAAG,WAAU;gBACV,EAAG,0CAA0C,yBAAyB;MACrE,CAAA;KACA;;GAEL,KACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,KAAD;KAAG,WAAU;eAA4C;KAAU,CAAA;IAC/D,CAAA;GAGR,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD;MAAiB,UAAU;MAAc,UAAU;MAAuB;MAAW,CAAA;KACjF,CAAA;IACF,CAAA;GACF"}
|
|
@@ -55,6 +55,7 @@ function C() {
|
|
|
55
55
|
children: [/* @__PURE__ */ b("div", {
|
|
56
56
|
className: "mb-6",
|
|
57
57
|
children: [/* @__PURE__ */ b("button", {
|
|
58
|
+
type: "button",
|
|
58
59
|
onClick: () => w(E),
|
|
59
60
|
className: "\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n ",
|
|
60
61
|
children: [/* @__PURE__ */ y(f, { size: 20 }), /* @__PURE__ */ y("span", {
|
|
@@ -66,7 +67,7 @@ function C() {
|
|
|
66
67
|
children: [/* @__PURE__ */ b("div", {
|
|
67
68
|
className: "flex items-center gap-4",
|
|
68
69
|
children: [/* @__PURE__ */ y("div", {
|
|
69
|
-
className: "
|
|
70
|
+
className: "size-16 rounded-lg bg-[var(--color-status-info-subtle)] flex items-center justify-center",
|
|
70
71
|
children: /* @__PURE__ */ y(m, {
|
|
71
72
|
size: 32,
|
|
72
73
|
className: "text-[var(--color-status-info)]"
|
|
@@ -84,10 +85,12 @@ function C() {
|
|
|
84
85
|
}), /* @__PURE__ */ b("div", {
|
|
85
86
|
className: "flex gap-2",
|
|
86
87
|
children: [/* @__PURE__ */ b("button", {
|
|
88
|
+
type: "button",
|
|
87
89
|
onClick: () => w(`${E}/${C}/edit`),
|
|
88
90
|
className: "\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-muted\n transition-all duration-200\n font-medium\n ",
|
|
89
91
|
children: [/* @__PURE__ */ y(p, { size: 16 }), "Edit Page"]
|
|
90
92
|
}), /* @__PURE__ */ b("button", {
|
|
93
|
+
type: "button",
|
|
91
94
|
onClick: N,
|
|
92
95
|
disabled: j,
|
|
93
96
|
className: "\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-status-error-subtle)]\n text-[var(--color-status-error)]\n border border-[var(--color-status-error-border)]\n rounded-lg\n hover:opacity-80\n transition-all duration-200\n font-medium\n disabled:opacity-50\n ",
|
|
@@ -203,10 +206,10 @@ function C() {
|
|
|
203
206
|
className: "text-sm text-text-primary mt-1",
|
|
204
207
|
children: /* @__PURE__ */ y("div", {
|
|
205
208
|
className: "flex flex-wrap gap-1.5 mt-1",
|
|
206
|
-
children: D.seoKeywords.split(",").map((e
|
|
209
|
+
children: D.seoKeywords.split(",").map((e) => /* @__PURE__ */ y("span", {
|
|
207
210
|
className: "\n inline-flex px-2 py-0.5\n bg-muted\n text-text-secondary\n rounded-md text-xs font-medium\n ",
|
|
208
211
|
children: e.trim()
|
|
209
|
-
},
|
|
212
|
+
}, e.trim()))
|
|
210
213
|
})
|
|
211
214
|
})] })
|
|
212
215
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageDetailPage.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPageDetailPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport { ArrowLeft, Edit, Trash2, FileText, Globe, Package } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useContentPage, useDeleteContentPage } from '../hooks/useContentPages';\nimport { ContentPageStatusBadge } from '../components/ContentPageStatusBadge';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport { TagList } from '../../../shared/components/TagList';\nimport { AuditHistoryTab } from '../../../shared/components/AuditHistoryTab';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\n\n/**\n * Simple markdown renderer for content preview\n * Converts basic markdown syntax to HTML\n */\nfunction renderMarkdown(content: string): string {\n return (\n content\n // Headers\n .replace(/^### (.+)$/gm, '<h3 class=\"text-lg font-semibold mt-4 mb-2\">$1</h3>')\n .replace(/^## (.+)$/gm, '<h2 class=\"text-xl font-semibold mt-5 mb-2\">$1</h2>')\n .replace(/^# (.+)$/gm, '<h1 class=\"text-2xl font-bold mt-6 mb-3\">$1</h1>')\n // Bold and italic\n .replace(/\\*\\*(.+?)\\*\\*/g, '<strong>$1</strong>')\n .replace(/\\*(.+?)\\*/g, '<em>$1</em>')\n // Inline code\n .replace(\n /`(.+?)`/g,\n '<code class=\"px-1.5 py-0.5 bg-muted rounded text-sm font-mono\">$1</code>'\n )\n // Code blocks\n .replace(/```[\\s\\S]*?```/g, (match) => {\n const code = match.replace(/```\\w*\\n?/, '').replace(/\\n?```$/, '');\n return `<pre class=\"bg-muted rounded-lg p-4 overflow-x-auto my-3\"><code class=\"text-sm font-mono\">${code}</code></pre>`;\n })\n // Links\n .replace(\n /\\[(.+?)\\]\\((.+?)\\)/g,\n '<a href=\"$2\" class=\"text-[var(--color-status-info)] underline\">$1</a>'\n )\n // Unordered lists\n .replace(/^- (.+)$/gm, '<li class=\"ml-4 list-disc\">$1</li>')\n // Paragraphs (double newline)\n .replace(/\\n\\n/g, '</p><p class=\"mb-3\">')\n // Single newlines\n .replace(/\\n/g, '<br/>')\n );\n}\n\n/**\n * Content Page Detail Page\n * Shows comprehensive content page information\n */\nexport function ContentPageDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const contentPagesBasePath = `${basePath}/content-pages`;\n const { contentPage, loading, error } = useContentPage(id!);\n const { deleteContentPage, loading: deleteLoading } = useDeleteContentPage();\n const tr = useTr();\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const message = tr(\n 'contentPages.confirmDelete',\n 'Are you sure you want to delete this content page?'\n );\n const native = await nativeConfirm({\n title: 'Delete content page',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok = native === null ? window.confirm(message) : native;\n if (!ok) return;\n\n try {\n await deleteContentPage(id!);\n void nativeNotify('success');\n navigate(contentPagesBasePath);\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete content page:', error);\n }\n };\n\n if (loading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('contentPages.loadingContentPage', 'Loading content page...')} />\n </div>\n );\n }\n\n if (error || !contentPage) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={\n error?.message || tr('contentPages.contentPageNotFound', 'Content page not found')\n }\n action={{\n label: tr('contentPages.backToContentPages', 'Back to Content Pages'),\n onClick: () => navigate(contentPagesBasePath),\n }}\n />\n </div>\n );\n }\n\n const formatDate = (dateString: string | null) => {\n if (!dateString) return '—';\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n };\n\n const hasSeo = contentPage.seoTitle || contentPage.seoDescription || contentPage.seoKeywords;\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <button\n onClick={() => navigate(contentPagesBasePath)}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('contentPages.backToContentPages', 'Back to Content Pages')}\n </span>\n </button>\n\n <div className=\"flex items-start justify-between\">\n <div className=\"flex items-center gap-4\">\n <div className=\"w-16 h-16 rounded-lg bg-[var(--color-status-info-subtle)] flex items-center justify-center\">\n <FileText size={32} className=\"text-[var(--color-status-info)]\" />\n </div>\n\n <div>\n <div className=\"flex items-center gap-3 mb-2\">\n <h1 className=\"text-3xl font-bold text-text-primary\">{contentPage.title}</h1>\n <ContentPageStatusBadge isPublished={contentPage.isPublished} />\n </div>\n <p className=\"text-text-secondary\">/{contentPage.slug}</p>\n </div>\n </div>\n\n <div className=\"flex gap-2\">\n <button\n onClick={() => navigate(`${contentPagesBasePath}/${id}/edit`)}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-muted\n transition-all duration-200\n font-medium\n \"\n >\n <Edit size={16} />\n Edit Page\n </button>\n\n <button\n onClick={handleDelete}\n disabled={deleteLoading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-status-error-subtle)]\n text-[var(--color-status-error)]\n border border-[var(--color-status-error-border)]\n rounded-lg\n hover:opacity-80\n transition-all duration-200\n font-medium\n disabled:opacity-50\n \"\n >\n <Trash2 size={16} />\n Delete\n </button>\n </div>\n </div>\n </div>\n\n {/* Content */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n {/* Content Preview */}\n <div className=\"lg:col-span-2 bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.contentPreview', 'Content Preview')}\n </h2>\n <div\n className=\"prose prose-sm max-w-none text-text-secondary leading-relaxed\"\n dangerouslySetInnerHTML={{\n __html:\n contentPage.contentFormat === 'markdown'\n ? renderMarkdown(contentPage.content)\n : contentPage.content,\n }}\n />\n </div>\n\n {/* Metadata */}\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.metadata', 'Metadata')}\n </h2>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.slug', 'Slug')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">{contentPage.slug}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.version', 'Version')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">v{contentPage.version}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.contentFormat', 'Content Format')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 capitalize\">\n {contentPage.contentFormat}\n </dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.sortOrder', 'Sort Order')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">{contentPage.sortOrder}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.created', 'Created')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.createdAt)}\n </dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.lastUpdated', 'Last Updated')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.updatedAt)}\n </dd>\n </div>\n {contentPage.lastUpdated && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.contentLastUpdated', 'Content Last Updated')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.lastUpdated)}\n </dd>\n </div>\n )}\n </dl>\n </div>\n\n {/* SEO Information */}\n {hasSeo && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Globe size={20} className=\"text-text-secondary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('contentPages.seoInformation', 'SEO Information')}\n </h2>\n </div>\n <dl className=\"space-y-3\">\n {contentPage.seoTitle && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoTitle', 'SEO Title')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.seoTitle}</dd>\n </div>\n )}\n {contentPage.seoDescription && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoDescription', 'SEO Description')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.seoDescription}</dd>\n </div>\n )}\n {contentPage.seoKeywords && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoKeywords', 'SEO Keywords')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n <div className=\"flex flex-wrap gap-1.5 mt-1\">\n {contentPage.seoKeywords.split(',').map((keyword, index) => (\n <span\n key={index}\n className=\"\n inline-flex px-2 py-0.5\n bg-muted\n text-text-secondary\n rounded-md text-xs font-medium\n \"\n >\n {keyword.trim()}\n </span>\n ))}\n </div>\n </dd>\n </div>\n )}\n </dl>\n </div>\n )}\n\n {/* Product Association */}\n {contentPage.productId && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Package size={20} className=\"text-text-secondary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('contentPages.productAssociation', 'Product Association')}\n </h2>\n </div>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productId', 'Product ID')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">\n {contentPage.productId}\n </dd>\n </div>\n {contentPage.product && (\n <>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productName', 'Product Name')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.product.name}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productSlug', 'Product Slug')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">\n /{contentPage.product.slug}\n </dd>\n </div>\n </>\n )}\n </dl>\n </div>\n )}\n\n {/* Tags */}\n {contentPage.tags && contentPage.tags.length > 0 && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.tags', 'Tags')}\n </h2>\n <TagList tags={contentPage.tags} />\n </div>\n )}\n\n {/* Activity History */}\n <div className=\"lg:col-span-2 bg-surface border border-default rounded-lg shadow-[var(--shadow-elevation-1)]\">\n <h2 className=\"text-lg font-semibold text-text-primary p-6 pb-0\">\n {tr('contentPages.activityHistory', 'Activity History')}\n </h2>\n <AuditHistoryTab resourceId={contentPage.id} resourceType=\"ProductContentPage\" />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,SAAS,EAAe,GAAyB;AAC/C,QACE,EAEG,QAAQ,gBAAgB,wDAAsD,CAC9E,QAAQ,eAAe,wDAAsD,CAC7E,QAAQ,cAAc,qDAAmD,CAEzE,QAAQ,kBAAkB,sBAAsB,CAChD,QAAQ,cAAc,cAAc,CAEp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C,mBAAmB;MACpD,CAAA,EACL,kBAAC,GAAD;MAAiB,YAAY,EAAY;MAAI,cAAa;MAAuB,CAAA,CAC7E;;IACF;KACF"}
|
|
1
|
+
{"version":3,"file":"ContentPageDetailPage.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPageDetailPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport { ArrowLeft, Edit, Trash2, FileText, Globe, Package } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useContentPage, useDeleteContentPage } from '../hooks/useContentPages';\nimport { ContentPageStatusBadge } from '../components/ContentPageStatusBadge';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport { TagList } from '../../../shared/components/TagList';\nimport { AuditHistoryTab } from '../../../shared/components/AuditHistoryTab';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\n\n/**\n * Simple markdown renderer for content preview\n * Converts basic markdown syntax to HTML\n */\nfunction renderMarkdown(content: string): string {\n return (\n content\n // Headers\n .replace(/^### (.+)$/gm, '<h3 class=\"text-lg font-semibold mt-4 mb-2\">$1</h3>')\n .replace(/^## (.+)$/gm, '<h2 class=\"text-xl font-semibold mt-5 mb-2\">$1</h2>')\n .replace(/^# (.+)$/gm, '<h1 class=\"text-2xl font-bold mt-6 mb-3\">$1</h1>')\n // Bold and italic\n .replace(/\\*\\*(.+?)\\*\\*/g, '<strong>$1</strong>')\n .replace(/\\*(.+?)\\*/g, '<em>$1</em>')\n // Inline code\n .replace(\n /`(.+?)`/g,\n '<code class=\"px-1.5 py-0.5 bg-muted rounded text-sm font-mono\">$1</code>'\n )\n // Code blocks\n .replace(/```[\\s\\S]*?```/g, (match) => {\n const code = match.replace(/```\\w*\\n?/, '').replace(/\\n?```$/, '');\n return `<pre class=\"bg-muted rounded-lg p-4 overflow-x-auto my-3\"><code class=\"text-sm font-mono\">${code}</code></pre>`;\n })\n // Links\n .replace(\n /\\[(.+?)\\]\\((.+?)\\)/g,\n '<a href=\"$2\" class=\"text-[var(--color-status-info)] underline\">$1</a>'\n )\n // Unordered lists\n .replace(/^- (.+)$/gm, '<li class=\"ml-4 list-disc\">$1</li>')\n // Paragraphs (double newline)\n .replace(/\\n\\n/g, '</p><p class=\"mb-3\">')\n // Single newlines\n .replace(/\\n/g, '<br/>')\n );\n}\n\n/**\n * Content Page Detail Page\n * Shows comprehensive content page information\n */\nexport function ContentPageDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const contentPagesBasePath = `${basePath}/content-pages`;\n const { contentPage, loading, error } = useContentPage(id!);\n const { deleteContentPage, loading: deleteLoading } = useDeleteContentPage();\n const tr = useTr();\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const message = tr(\n 'contentPages.confirmDelete',\n 'Are you sure you want to delete this content page?'\n );\n const native = await nativeConfirm({\n title: 'Delete content page',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok = native === null ? window.confirm(message) : native;\n if (!ok) return;\n\n try {\n await deleteContentPage(id!);\n void nativeNotify('success');\n navigate(contentPagesBasePath);\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete content page:', error);\n }\n };\n\n if (loading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('contentPages.loadingContentPage', 'Loading content page...')} />\n </div>\n );\n }\n\n if (error || !contentPage) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={\n error?.message || tr('contentPages.contentPageNotFound', 'Content page not found')\n }\n action={{\n label: tr('contentPages.backToContentPages', 'Back to Content Pages'),\n onClick: () => navigate(contentPagesBasePath),\n }}\n />\n </div>\n );\n }\n\n const formatDate = (dateString: string | null) => {\n if (!dateString) return '—';\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n };\n\n const hasSeo = contentPage.seoTitle || contentPage.seoDescription || contentPage.seoKeywords;\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <button type=\"button\"\n onClick={() => navigate(contentPagesBasePath)}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('contentPages.backToContentPages', 'Back to Content Pages')}\n </span>\n </button>\n\n <div className=\"flex items-start justify-between\">\n <div className=\"flex items-center gap-4\">\n <div className=\"size-16 rounded-lg bg-[var(--color-status-info-subtle)] flex items-center justify-center\">\n <FileText size={32} className=\"text-[var(--color-status-info)]\" />\n </div>\n\n <div>\n <div className=\"flex items-center gap-3 mb-2\">\n <h1 className=\"text-3xl font-bold text-text-primary\">{contentPage.title}</h1>\n <ContentPageStatusBadge isPublished={contentPage.isPublished} />\n </div>\n <p className=\"text-text-secondary\">/{contentPage.slug}</p>\n </div>\n </div>\n\n <div className=\"flex gap-2\">\n <button type=\"button\"\n onClick={() => navigate(`${contentPagesBasePath}/${id}/edit`)}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-muted\n transition-all duration-200\n font-medium\n \"\n >\n <Edit size={16} />\n Edit Page\n </button>\n\n <button type=\"button\"\n onClick={handleDelete}\n disabled={deleteLoading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-status-error-subtle)]\n text-[var(--color-status-error)]\n border border-[var(--color-status-error-border)]\n rounded-lg\n hover:opacity-80\n transition-all duration-200\n font-medium\n disabled:opacity-50\n \"\n >\n <Trash2 size={16} />\n Delete\n </button>\n </div>\n </div>\n </div>\n\n {/* Content */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n {/* Content Preview */}\n <div className=\"lg:col-span-2 bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.contentPreview', 'Content Preview')}\n </h2>\n <div\n className=\"prose prose-sm max-w-none text-text-secondary leading-relaxed\"\n dangerouslySetInnerHTML={{\n __html:\n contentPage.contentFormat === 'markdown'\n ? renderMarkdown(contentPage.content)\n : contentPage.content,\n }}\n />\n </div>\n\n {/* Metadata */}\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.metadata', 'Metadata')}\n </h2>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.slug', 'Slug')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">{contentPage.slug}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.version', 'Version')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">v{contentPage.version}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.contentFormat', 'Content Format')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 capitalize\">\n {contentPage.contentFormat}\n </dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.sortOrder', 'Sort Order')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">{contentPage.sortOrder}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.created', 'Created')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.createdAt)}\n </dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.lastUpdated', 'Last Updated')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.updatedAt)}\n </dd>\n </div>\n {contentPage.lastUpdated && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.contentLastUpdated', 'Content Last Updated')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n {formatDate(contentPage.lastUpdated)}\n </dd>\n </div>\n )}\n </dl>\n </div>\n\n {/* SEO Information */}\n {hasSeo && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Globe size={20} className=\"text-text-secondary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('contentPages.seoInformation', 'SEO Information')}\n </h2>\n </div>\n <dl className=\"space-y-3\">\n {contentPage.seoTitle && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoTitle', 'SEO Title')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.seoTitle}</dd>\n </div>\n )}\n {contentPage.seoDescription && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoDescription', 'SEO Description')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.seoDescription}</dd>\n </div>\n )}\n {contentPage.seoKeywords && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.seoKeywords', 'SEO Keywords')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n <div className=\"flex flex-wrap gap-1.5 mt-1\">\n {contentPage.seoKeywords.split(',').map((keyword) => (\n <span\n key={keyword.trim()}\n className=\"\n inline-flex px-2 py-0.5\n bg-muted\n text-text-secondary\n rounded-md text-xs font-medium\n \"\n >\n {keyword.trim()}\n </span>\n ))}\n </div>\n </dd>\n </div>\n )}\n </dl>\n </div>\n )}\n\n {/* Product Association */}\n {contentPage.productId && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Package size={20} className=\"text-text-secondary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('contentPages.productAssociation', 'Product Association')}\n </h2>\n </div>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productId', 'Product ID')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">\n {contentPage.productId}\n </dd>\n </div>\n {contentPage.product && (\n <>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productName', 'Product Name')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{contentPage.product.name}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('contentPages.productSlug', 'Product Slug')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">\n /{contentPage.product.slug}\n </dd>\n </div>\n </>\n )}\n </dl>\n </div>\n )}\n\n {/* Tags */}\n {contentPage.tags && contentPage.tags.length > 0 && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('contentPages.tags', 'Tags')}\n </h2>\n <TagList tags={contentPage.tags} />\n </div>\n )}\n\n {/* Activity History */}\n <div className=\"lg:col-span-2 bg-surface border border-default rounded-lg shadow-[var(--shadow-elevation-1)]\">\n <h2 className=\"text-lg font-semibold text-text-primary p-6 pb-0\">\n {tr('contentPages.activityHistory', 'Activity History')}\n </h2>\n <AuditHistoryTab resourceId={contentPage.id} resourceType=\"ProductContentPage\" />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;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C,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,MAAD;MAAI,WAAU;gBACX,EAAG,qBAAqB,OAAO;MAC7B,CAAA,EACL,kBAAC,GAAD,EAAS,MAAM,EAAY,MAAQ,CAAA,CAC/B;;IAIR,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,MAAD;MAAI,WAAU;gBACX,EAAG,gCAAgC,mBAAmB;MACpD,CAAA,EACL,kBAAC,GAAD;MAAiB,YAAY,EAAY;MAAI,cAAa;MAAuB,CAAA,CAC7E;;IACF;KACF"}
|
|
@@ -38,6 +38,7 @@ function f() {
|
|
|
38
38
|
className: "mb-6",
|
|
39
39
|
children: [
|
|
40
40
|
/* @__PURE__ */ u("button", {
|
|
41
|
+
type: "button",
|
|
41
42
|
onClick: T,
|
|
42
43
|
className: "\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n ",
|
|
43
44
|
children: [/* @__PURE__ */ l(c, { size: 20 }), /* @__PURE__ */ u("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageEditPage.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPageEditPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { ArrowLeft } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useContentPage, useUpdateContentPage } from '../hooks/useContentPages';\nimport { ContentPageForm } from '../components/ContentPageForm';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { UpdateContentPageInput } from '../types';\n\nexport function ContentPageEditPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const contentPagesBasePath = `${basePath}/content-pages`;\n const { contentPage, loading: fetchLoading, error: fetchError } = useContentPage(id!);\n const { updateContentPage, loading: updateLoading } = useUpdateContentPage();\n const [error, setError] = useState<string | null>(null);\n const tr = useTr();\n\n const handleSubmit = async (data: UpdateContentPageInput) => {\n if (!id) return;\n\n try {\n setError(null);\n await updateContentPage(id, data);\n navigate(`${contentPagesBasePath}/${id}`);\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to update content page';\n setError(message);\n console.error('Failed to update content page:', err);\n }\n };\n\n const handleCancel = () => {\n navigate(`${contentPagesBasePath}/${id}`);\n };\n\n if (fetchLoading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('contentPages.loadingContentPage', 'Loading content page...')} />\n </div>\n );\n }\n\n if (fetchError || !contentPage) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={\n fetchError?.message || tr('contentPages.contentPageNotFound', 'Content page not found')\n }\n action={{\n label: tr('contentPages.backToContentPages', 'Back to Content Pages'),\n onClick: () => navigate(contentPagesBasePath),\n }}\n />\n </div>\n );\n }\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n <div className=\"mb-6\">\n <button\n onClick={handleCancel}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('contentPages.backTo', 'Back to')} {contentPage.title}\n </span>\n </button>\n\n <h1 className=\"text-3xl font-bold text-text-primary mb-2\">\n {tr('contentPages.editContentPage', 'Edit Content Page')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('contentPages.editContentPageSubtitle', 'Update content page information')}\n </p>\n </div>\n\n {error && (\n <div className=\"mb-6 p-4 bg-[var(--color-status-error-subtle)] border border-[var(--color-status-error-border)] rounded-lg\">\n <p className=\"text-sm text-[var(--color-status-error)]\">{error}</p>\n </div>\n )}\n\n <div className=\"max-w-2xl\">\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)]\">\n <ContentPageForm\n contentPage={contentPage}\n onSubmit={handleSubmit}\n onCancel={handleCancel}\n loading={updateLoading}\n />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,IAAsB;CACpC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAuB,GAAG,EAAS,iBACnC,EAAE,gBAAa,SAAS,GAAc,OAAO,MAAe,EAAe,EAAI,EAC/E,EAAE,sBAAmB,SAAS,MAAkB,GAAsB,EACtE,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,IAAK,GAAO,EAEZ,IAAe,OAAO,MAAiC;AACtD,QAEL,KAAI;AAGF,GAFA,EAAS,KAAK,EACd,MAAM,EAAkB,GAAI,EAAK,EACjC,EAAS,GAAG,EAAqB,GAAG,IAAK;WAClC,GAAK;AAGZ,GADA,EADgB,aAAe,QAAQ,EAAI,UAAU,gCACpC,EACjB,QAAQ,MAAM,kCAAkC,EAAI;;IAIlD,UAAqB;AACzB,IAAS,GAAG,EAAqB,GAAG,IAAK;;AA2B3C,QAxBI,IAEA,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAc,SAAS,EAAG,mCAAmC,0BAA0B,EAAI,CAAA;EACvF,CAAA,GAIN,KAAc,CAAC,IAEf,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,SACE,GAAY,WAAW,EAAG,oCAAoC,yBAAyB;GAEzF,QAAQ;IACN,OAAO,EAAG,mCAAmC,wBAAwB;IACrE,eAAe,EAAS,EAAqB;IAC9C;GACD,CAAA;EACE,CAAA,GAKR,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,UAAD;
|
|
1
|
+
{"version":3,"file":"ContentPageEditPage.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPageEditPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { ArrowLeft } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useContentPage, useUpdateContentPage } from '../hooks/useContentPages';\nimport { ContentPageForm } from '../components/ContentPageForm';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { UpdateContentPageInput } from '../types';\n\nexport function ContentPageEditPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const contentPagesBasePath = `${basePath}/content-pages`;\n const { contentPage, loading: fetchLoading, error: fetchError } = useContentPage(id!);\n const { updateContentPage, loading: updateLoading } = useUpdateContentPage();\n const [error, setError] = useState<string | null>(null);\n const tr = useTr();\n\n const handleSubmit = async (data: UpdateContentPageInput) => {\n if (!id) return;\n\n try {\n setError(null);\n await updateContentPage(id, data);\n navigate(`${contentPagesBasePath}/${id}`);\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to update content page';\n setError(message);\n console.error('Failed to update content page:', err);\n }\n };\n\n const handleCancel = () => {\n navigate(`${contentPagesBasePath}/${id}`);\n };\n\n if (fetchLoading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('contentPages.loadingContentPage', 'Loading content page...')} />\n </div>\n );\n }\n\n if (fetchError || !contentPage) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={\n fetchError?.message || tr('contentPages.contentPageNotFound', 'Content page not found')\n }\n action={{\n label: tr('contentPages.backToContentPages', 'Back to Content Pages'),\n onClick: () => navigate(contentPagesBasePath),\n }}\n />\n </div>\n );\n }\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n <div className=\"mb-6\">\n <button type=\"button\"\n onClick={handleCancel}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('contentPages.backTo', 'Back to')} {contentPage.title}\n </span>\n </button>\n\n <h1 className=\"text-3xl font-bold text-text-primary mb-2\">\n {tr('contentPages.editContentPage', 'Edit Content Page')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('contentPages.editContentPageSubtitle', 'Update content page information')}\n </p>\n </div>\n\n {error && (\n <div className=\"mb-6 p-4 bg-[var(--color-status-error-subtle)] border border-[var(--color-status-error-border)] rounded-lg\">\n <p className=\"text-sm text-[var(--color-status-error)]\">{error}</p>\n </div>\n )}\n\n <div className=\"max-w-2xl\">\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)]\">\n <ContentPageForm\n contentPage={contentPage}\n onSubmit={handleSubmit}\n onCancel={handleCancel}\n loading={updateLoading}\n />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,IAAsB;CACpC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAuB,GAAG,EAAS,iBACnC,EAAE,gBAAa,SAAS,GAAc,OAAO,MAAe,EAAe,EAAI,EAC/E,EAAE,sBAAmB,SAAS,MAAkB,GAAsB,EACtE,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,IAAK,GAAO,EAEZ,IAAe,OAAO,MAAiC;AACtD,QAEL,KAAI;AAGF,GAFA,EAAS,KAAK,EACd,MAAM,EAAkB,GAAI,EAAK,EACjC,EAAS,GAAG,EAAqB,GAAG,IAAK;WAClC,GAAK;AAGZ,GADA,EADgB,aAAe,QAAQ,EAAI,UAAU,gCACpC,EACjB,QAAQ,MAAM,kCAAkC,EAAI;;IAIlD,UAAqB;AACzB,IAAS,GAAG,EAAqB,GAAG,IAAK;;AA2B3C,QAxBI,IAEA,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAc,SAAS,EAAG,mCAAmC,0BAA0B,EAAI,CAAA;EACvF,CAAA,GAIN,KAAc,CAAC,IAEf,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,SACE,GAAY,WAAW,EAAG,oCAAoC,yBAAyB;GAEzF,QAAQ;IACN,OAAO,EAAG,mCAAmC,wBAAwB;IACrE,eAAe,EAAS,EAAqB;IAC9C;GACD,CAAA;EACE,CAAA,GAKR,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,UAAD;MAAQ,MAAK;MACX,SAAS;MACT,WAAU;gBAFZ,CASE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA,EACvB,kBAAC,QAAD;OAAM,WAAU;iBAAhB;QACG,EAAG,uBAAuB,UAAU;QAAC;QAAE,EAAY;QAC/C;SACA;;KAET,kBAAC,MAAD;MAAI,WAAU;gBACX,EAAG,gCAAgC,oBAAoB;MACrD,CAAA;KACL,kBAAC,KAAD;MAAG,WAAU;gBACV,EAAG,wCAAwC,kCAAkC;MAC5E,CAAA;KACA;;GAEL,KACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,KAAD;KAAG,WAAU;eAA4C;KAAU,CAAA;IAC/D,CAAA;GAGR,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD;MACe;MACb,UAAU;MACV,UAAU;MACV,SAAS;MACT,CAAA;KACE,CAAA;IACF,CAAA;GACF"}
|
|
@@ -89,6 +89,7 @@ function k() {
|
|
|
89
89
|
})] }), /* @__PURE__ */ w(E, {
|
|
90
90
|
role: "super_admin",
|
|
91
91
|
children: /* @__PURE__ */ T("button", {
|
|
92
|
+
type: "button",
|
|
92
93
|
onClick: () => k(`${j}/new`),
|
|
93
94
|
className: "\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90 hover:scale-[1.02]\n transition-all duration-200\n font-medium\n ",
|
|
94
95
|
children: [/* @__PURE__ */ w(b, { size: 20 }), F("contentPages.newPage", "New Page")]
|
|
@@ -138,11 +139,13 @@ function k() {
|
|
|
138
139
|
})]
|
|
139
140
|
}),
|
|
140
141
|
/* @__PURE__ */ w("button", {
|
|
142
|
+
type: "button",
|
|
141
143
|
onClick: () => G(),
|
|
142
144
|
className: "\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-muted\n transition-all duration-200\n ",
|
|
143
145
|
children: /* @__PURE__ */ w(x, { size: 18 })
|
|
144
146
|
}),
|
|
145
147
|
B.length > 0 && /* @__PURE__ */ w("button", {
|
|
148
|
+
type: "button",
|
|
146
149
|
onClick: () => a("content-pages", B.map((e) => ({
|
|
147
150
|
id: e.id,
|
|
148
151
|
slug: e.slug,
|
|
@@ -174,6 +177,7 @@ function k() {
|
|
|
174
177
|
className: "text-text-secondary mb-4",
|
|
175
178
|
children: F("contentPages.noContentPagesFound", "No content pages found")
|
|
176
179
|
}), /* @__PURE__ */ T("button", {
|
|
180
|
+
type: "button",
|
|
177
181
|
onClick: () => k(`${j}/new`),
|
|
178
182
|
className: "\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90 hover:scale-[1.02]\n transition-all duration-200\n font-medium\n ",
|
|
179
183
|
children: [/* @__PURE__ */ w(b, { size: 20 }), F("contentPages.newPage", "New Page")]
|
|
@@ -221,7 +225,7 @@ function k() {
|
|
|
221
225
|
children: /* @__PURE__ */ T("div", {
|
|
222
226
|
className: "flex items-center gap-3",
|
|
223
227
|
children: [/* @__PURE__ */ w("div", {
|
|
224
|
-
className: "
|
|
228
|
+
className: "size-10 rounded-lg bg-[var(--color-status-info-subtle)] flex items-center justify-center",
|
|
225
229
|
children: /* @__PURE__ */ w(y, {
|
|
226
230
|
size: 20,
|
|
227
231
|
className: "text-[var(--color-status-info)]"
|
|
@@ -263,6 +267,7 @@ function k() {
|
|
|
263
267
|
className: "flex items-center justify-end gap-2",
|
|
264
268
|
onClick: (e) => e.stopPropagation(),
|
|
265
269
|
children: [/* @__PURE__ */ w("button", {
|
|
270
|
+
type: "button",
|
|
266
271
|
onClick: () => k(`${j}/${e.id}`),
|
|
267
272
|
className: "p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200",
|
|
268
273
|
title: F("contentPages.viewDetails", "View details"),
|
|
@@ -270,11 +275,13 @@ function k() {
|
|
|
270
275
|
}), /* @__PURE__ */ T(E, {
|
|
271
276
|
role: "super_admin",
|
|
272
277
|
children: [/* @__PURE__ */ w("button", {
|
|
278
|
+
type: "button",
|
|
273
279
|
onClick: () => k(`${j}/${e.id}/edit`),
|
|
274
280
|
className: "p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200",
|
|
275
281
|
title: F("contentPages.edit", "Edit"),
|
|
276
282
|
children: /* @__PURE__ */ w(S, { size: 18 })
|
|
277
283
|
}), /* @__PURE__ */ w("button", {
|
|
284
|
+
type: "button",
|
|
278
285
|
onClick: () => Z(e.id),
|
|
279
286
|
disabled: X,
|
|
280
287
|
className: "p-2 rounded-lg text-[var(--color-status-error)] hover:bg-[var(--color-status-error-subtle)] transition-all duration-200 disabled:opacity-50",
|