@burdenoff/microfe-product 2026.517.1 → 2026.517.3
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/generated/global-operations.d.ts +5 -0
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-operations.js +3 -0
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +2 -0
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/product-management/modules/content-pages/components/ContentPageForm.d.ts.map +1 -1
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js +138 -53
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.d.ts.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js +135 -98
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/schemas/index.d.ts +10 -0
- package/dist/product-management/modules/content-pages/schemas/index.d.ts.map +1 -1
- package/dist/product-management/modules/content-pages/schemas/index.js +48 -38
- package/dist/product-management/modules/content-pages/schemas/index.js.map +1 -1
- package/dist/product-management/modules/content-pages/types/index.d.ts +5 -0
- package/dist/product-management/modules/content-pages/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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 {\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\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 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 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 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 sortOrder: sortOrderNum !== contentPage.sortOrder ? sortOrderNum : undefined,\n productId:\n formData.productId !== (contentPage.productId || '')\n ? formData.productId || undefined\n : undefined,\n tags,\n excerpt: formData.excerpt || undefined,\n thumbnail: formData.thumbnail || undefined,\n author: formData.author || undefined,\n publishedAt: formData.publishedAt ? new Date(formData.publishedAt).toISOString() : 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 sortOrder: sortOrderNum,\n productId: formData.productId || undefined,\n tags,\n excerpt: formData.excerpt || undefined,\n thumbnail: formData.thumbnail || undefined,\n author: formData.author || undefined,\n publishedAt: formData.publishedAt ? new Date(formData.publishedAt).toISOString() : 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 {/* 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 {/* Blog Fields 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.blogFields', 'Blog Fields')}\n </h3>\n <p className=\"text-xs text-text-tertiary\">\n Optional fields for blog posts. Fill these when the content page is a blog article.\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 description shown on blog 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 className=\"mt-2 rounded-lg overflow-hidden border border-default\" style={{ maxWidth: 320 }}>\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 htmlFor=\"category\" className=\"block text-sm font-medium text-text-primary mb-1\">\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 htmlFor=\"publishedAt\" className=\"block text-sm font-medium text-text-primary mb-1\">\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 htmlFor=\"readingTime\" className=\"block text-sm font-medium text-text-primary mb-1\">\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 {/* 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 {/* 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 <input\n id=\"productId\"\n type=\"text\"\n value={formData.productId}\n onChange={(e) => setFormData({ ...formData, productId: e.target.value })}\n className={inputClassName}\n placeholder={tr('contentPages.productIdPlaceholder', 'Optional product association')}\n disabled={loading}\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":";;;;;;;;AAgCA,SAAS,EAAe,GAAoB;CAC1C,IAAI,IAAO;AA+EX,QA5EA,IAAO,EAAK,QAAQ,MAAM,QAAQ,CAAC,QAAQ,MAAM,OAAO,CAAC,QAAQ,MAAM,OAAO,EAG9E,IAAO,E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,kBAAC,SAAD;OACE,IAAG;OACH,MAAK;OACL,OAAO,EAAS;OAChB,WAAW,MAAM,EAAY;QAAE,GAAG;QAAU,WAAW,EAAE,OAAO;QAAO,CAAC;OACxE,WAAW;OACX,aAAa,EAAG,qCAAqC,+BAA+B;OACpF,UAAU;OACV,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 {\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\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', '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=\"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 get the Blog Fields 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 {/* Blog Fields Section — only for Blog Posts */}\n {pageType === 'blog' && (\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.blogFields', 'Blog Fields')}\n </h3>\n <p className=\"text-xs text-text-tertiary\">\n Optional fields for blog posts. Fill these when the content page is a blog article.\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 description shown on blog 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 <input\n id=\"productId\"\n type=\"text\"\n value={formData.productId}\n onChange={(e) => setFormData({ ...formData, productId: e.target.value })}\n className={inputClassName}\n placeholder={tr('contentPages.productIdPlaceholder', 'Optional product association')}\n disabled={loading}\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":";;;;;;;;AAgCA,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,cAAc,EAGhD,IAAO,EAAK,QACV,4BACA,4HACD,EAGD,IAAO,EAAK,QACV,iBACA,kGACD,EAGD,IAAO,EAAK,QAAQ,0BAA0B,MAKrC,4CAJO,EACX,MAAM,KAAK,CACX,KAAK,MAAS,oBAAoB,EAAK,QAAQ,OAAO,GAAG,CAAC,OAAO,CACjE,KAAK,KAC2C,CAAM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ACF,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPagesListPage.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPagesListPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContentPagesListPage.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/content-pages/pages/ContentPagesListPage.tsx"],"names":[],"mappings":"AAuBA,wBAAgB,oBAAoB,4CA0UnC"}
|
|
@@ -12,117 +12,154 @@ import { Download as p, Eye as m, FileText as h, Plus as g, RefreshCw as _, Squa
|
|
|
12
12
|
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
13
13
|
import { PermissionGate as S } from "@burdenoff/fe-libs/shared/components";
|
|
14
14
|
//#region src/product-management/modules/content-pages/pages/ContentPagesListPage.tsx
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
15
|
+
var C = [
|
|
16
|
+
{
|
|
17
|
+
label: "All",
|
|
18
|
+
tag: ""
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: "Blog",
|
|
22
|
+
tag: "blog"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "Legal",
|
|
26
|
+
tag: "legal"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: "Docs",
|
|
30
|
+
tag: "docs"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "Pages",
|
|
34
|
+
tag: "page"
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
function w() {
|
|
38
|
+
let { navigate: w, basePath: T = "/products" } = t(), E = `${T}/content-pages`, [D, O] = f(""), k = e(), [A, j] = f({}), { contentPages: M, loading: N, error: P, refetch: F } = l(void 0, {
|
|
39
|
+
...A,
|
|
40
|
+
search: D || void 0
|
|
41
|
+
}, { limit: 20 }), { deleteContentPage: I, loading: L } = u(), R = async (e) => {
|
|
20
42
|
s("medium");
|
|
21
|
-
let t =
|
|
43
|
+
let t = k("contentPages.confirmDelete", "Are you sure you want to delete this content page?"), n = await o({
|
|
22
44
|
title: "Delete content page",
|
|
23
45
|
message: t,
|
|
24
46
|
okButtonTitle: "Delete",
|
|
25
47
|
cancelButtonTitle: "Cancel"
|
|
26
48
|
});
|
|
27
49
|
if (n === null ? window.confirm(t) : n) try {
|
|
28
|
-
await
|
|
50
|
+
await I(e), c("success"), F();
|
|
29
51
|
} catch (e) {
|
|
30
52
|
c("error"), console.error("Failed to delete content page:", e);
|
|
31
53
|
}
|
|
32
|
-
},
|
|
54
|
+
}, z = (e) => e ? new Date(e).toLocaleDateString("en-US", {
|
|
33
55
|
year: "numeric",
|
|
34
56
|
month: "short",
|
|
35
57
|
day: "numeric"
|
|
36
58
|
}) : "—";
|
|
37
|
-
return
|
|
59
|
+
return N ? /* @__PURE__ */ b("div", {
|
|
38
60
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6",
|
|
39
|
-
children: /* @__PURE__ */ b(n, { message:
|
|
40
|
-
}) :
|
|
61
|
+
children: /* @__PURE__ */ b(n, { message: k("contentPages.loadingContentPages", "Loading content pages...") })
|
|
62
|
+
}) : P ? /* @__PURE__ */ b("div", {
|
|
41
63
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6",
|
|
42
64
|
children: /* @__PURE__ */ b(r, {
|
|
43
|
-
message:
|
|
65
|
+
message: P.message,
|
|
44
66
|
action: {
|
|
45
|
-
label:
|
|
46
|
-
onClick: () =>
|
|
67
|
+
label: k("productCommon.retry", "Retry"),
|
|
68
|
+
onClick: () => F()
|
|
47
69
|
}
|
|
48
70
|
})
|
|
49
71
|
}) : /* @__PURE__ */ x("div", {
|
|
50
72
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300",
|
|
51
73
|
children: [/* @__PURE__ */ x("div", {
|
|
52
74
|
className: "mb-6",
|
|
53
|
-
children: [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
/* @__PURE__ */ x("select", {
|
|
79
|
-
value: k.isPublished === void 0 ? "" : k.isPublished ? "published" : "all",
|
|
80
|
-
onChange: (e) => A({
|
|
81
|
-
...k,
|
|
82
|
-
isPublished: e.target.value === "published" ? !0 : void 0
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ x("div", {
|
|
77
|
+
className: "flex items-center justify-between mb-4",
|
|
78
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h1", {
|
|
79
|
+
className: "text-3xl font-bold text-text-primary mb-2",
|
|
80
|
+
children: k("contentPages.title", "Content Pages")
|
|
81
|
+
}), /* @__PURE__ */ b("p", {
|
|
82
|
+
className: "text-text-secondary",
|
|
83
|
+
children: k("contentPages.subtitle", "Manage content pages and documentation")
|
|
84
|
+
})] }), /* @__PURE__ */ b(S, {
|
|
85
|
+
role: "super_admin",
|
|
86
|
+
children: /* @__PURE__ */ x("button", {
|
|
87
|
+
onClick: () => w(`${E}/new`),
|
|
88
|
+
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 ",
|
|
89
|
+
children: [/* @__PURE__ */ b(g, { size: 20 }), k("contentPages.newPage", "New Page")]
|
|
90
|
+
})
|
|
91
|
+
})]
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ b("div", {
|
|
94
|
+
className: "flex flex-wrap gap-1 border-b border-default pb-px",
|
|
95
|
+
children: C.map((e) => /* @__PURE__ */ b("button", {
|
|
96
|
+
type: "button",
|
|
97
|
+
onClick: () => j({
|
|
98
|
+
...A,
|
|
99
|
+
tag: e.tag || void 0
|
|
83
100
|
}),
|
|
84
|
-
className:
|
|
85
|
-
children:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
101
|
+
className: `px-4 py-2 rounded-t-lg text-sm font-medium transition-all border-b-2 ${(A.tag ?? "") === e.tag ? "border-[var(--color-action-primary-bg)] text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"}`,
|
|
102
|
+
children: k(`contentPages.tab.${e.label.toLowerCase()}`, e.label)
|
|
103
|
+
}, e.label))
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ x("div", {
|
|
106
|
+
className: "flex gap-4",
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ b(i, {
|
|
109
|
+
value: D,
|
|
110
|
+
onChange: O,
|
|
111
|
+
placeholder: k("contentPages.searchPlaceholder", "Search content pages..."),
|
|
112
|
+
className: "flex-1"
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ x("select", {
|
|
115
|
+
value: A.isPublished === void 0 ? "" : A.isPublished ? "published" : "all",
|
|
116
|
+
onChange: (e) => j({
|
|
117
|
+
...A,
|
|
118
|
+
isPublished: e.target.value === "published" ? !0 : void 0
|
|
119
|
+
}),
|
|
120
|
+
className: "\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n ",
|
|
121
|
+
children: [/* @__PURE__ */ b("option", {
|
|
122
|
+
value: "",
|
|
123
|
+
children: k("contentPages.filterAll", "All")
|
|
124
|
+
}), /* @__PURE__ */ b("option", {
|
|
125
|
+
value: "published",
|
|
126
|
+
children: k("contentPages.publishedOnly", "Published Only")
|
|
127
|
+
})]
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ b("button", {
|
|
130
|
+
onClick: () => F(),
|
|
131
|
+
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 ",
|
|
132
|
+
children: /* @__PURE__ */ b(_, { size: 18 })
|
|
133
|
+
}),
|
|
134
|
+
M.length > 0 && /* @__PURE__ */ b("button", {
|
|
135
|
+
onClick: () => a("content-pages", M.map((e) => ({
|
|
136
|
+
id: e.id,
|
|
137
|
+
slug: e.slug,
|
|
138
|
+
title: e.title,
|
|
139
|
+
isPublished: e.isPublished,
|
|
140
|
+
contentFormat: e.contentFormat,
|
|
141
|
+
tags: (e.tags ?? []).join(", "),
|
|
142
|
+
sortOrder: e.sortOrder,
|
|
143
|
+
productId: e.productId ?? "",
|
|
144
|
+
createdAt: e.createdAt,
|
|
145
|
+
updatedAt: e.updatedAt
|
|
146
|
+
}))),
|
|
147
|
+
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 ",
|
|
148
|
+
title: k("contentPages.exportCsv", "Export as CSV"),
|
|
149
|
+
children: /* @__PURE__ */ b(p, { size: 18 })
|
|
150
|
+
})
|
|
151
|
+
]
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
}), M.length === 0 ? /* @__PURE__ */ x("div", {
|
|
118
155
|
className: "bg-surface border border-default rounded-lg p-12 text-center animate-in fade-in duration-300",
|
|
119
156
|
children: [/* @__PURE__ */ b("p", {
|
|
120
157
|
className: "text-text-secondary mb-4",
|
|
121
|
-
children:
|
|
158
|
+
children: k("contentPages.noContentPagesFound", "No content pages found")
|
|
122
159
|
}), /* @__PURE__ */ x("button", {
|
|
123
|
-
onClick: () =>
|
|
160
|
+
onClick: () => w(`${E}/new`),
|
|
124
161
|
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 ",
|
|
125
|
-
children: [/* @__PURE__ */ b(g, { size: 20 }),
|
|
162
|
+
children: [/* @__PURE__ */ b(g, { size: 20 }), k("contentPages.newPage", "New Page")]
|
|
126
163
|
})]
|
|
127
164
|
}) : /* @__PURE__ */ b("div", {
|
|
128
165
|
className: "bg-surface border border-default rounded-lg shadow-[var(--shadow-elevation-1)] overflow-hidden",
|
|
@@ -133,34 +170,34 @@ function C() {
|
|
|
133
170
|
children: /* @__PURE__ */ x("tr", { children: [
|
|
134
171
|
/* @__PURE__ */ b("th", {
|
|
135
172
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
136
|
-
children:
|
|
173
|
+
children: k("contentPages.columnPage", "Page")
|
|
137
174
|
}),
|
|
138
175
|
/* @__PURE__ */ b("th", {
|
|
139
176
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
140
|
-
children:
|
|
177
|
+
children: k("contentPages.columnSlug", "Slug")
|
|
141
178
|
}),
|
|
142
179
|
/* @__PURE__ */ b("th", {
|
|
143
180
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
144
|
-
children:
|
|
181
|
+
children: k("contentPages.columnStatus", "Status")
|
|
145
182
|
}),
|
|
146
183
|
/* @__PURE__ */ b("th", {
|
|
147
184
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
148
|
-
children:
|
|
185
|
+
children: k("contentPages.columnVersion", "Version")
|
|
149
186
|
}),
|
|
150
187
|
/* @__PURE__ */ b("th", {
|
|
151
188
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
152
|
-
children:
|
|
189
|
+
children: k("contentPages.columnLastUpdated", "Last Updated")
|
|
153
190
|
}),
|
|
154
191
|
/* @__PURE__ */ b("th", {
|
|
155
192
|
className: "text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
156
|
-
children:
|
|
193
|
+
children: k("contentPages.columnActions", "Actions")
|
|
157
194
|
})
|
|
158
195
|
] })
|
|
159
196
|
}), /* @__PURE__ */ b("tbody", {
|
|
160
197
|
className: "divide-y divide-[var(--color-border-default)]",
|
|
161
|
-
children:
|
|
198
|
+
children: M.map((e) => /* @__PURE__ */ x("tr", {
|
|
162
199
|
className: "hover:bg-muted transition-all duration-200 cursor-pointer",
|
|
163
|
-
onClick: () =>
|
|
200
|
+
onClick: () => w(`${E}/${e.id}`),
|
|
164
201
|
children: [
|
|
165
202
|
/* @__PURE__ */ b("td", {
|
|
166
203
|
className: "px-6 py-4",
|
|
@@ -200,7 +237,7 @@ function C() {
|
|
|
200
237
|
className: "px-6 py-4",
|
|
201
238
|
children: /* @__PURE__ */ b("span", {
|
|
202
239
|
className: "text-sm text-text-secondary",
|
|
203
|
-
children:
|
|
240
|
+
children: z(e.lastUpdated || e.updatedAt)
|
|
204
241
|
})
|
|
205
242
|
}),
|
|
206
243
|
/* @__PURE__ */ b("td", {
|
|
@@ -209,22 +246,22 @@ function C() {
|
|
|
209
246
|
className: "flex items-center justify-end gap-2",
|
|
210
247
|
onClick: (e) => e.stopPropagation(),
|
|
211
248
|
children: [/* @__PURE__ */ b("button", {
|
|
212
|
-
onClick: () =>
|
|
249
|
+
onClick: () => w(`${E}/${e.id}`),
|
|
213
250
|
className: "p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200",
|
|
214
|
-
title:
|
|
251
|
+
title: k("contentPages.viewDetails", "View details"),
|
|
215
252
|
children: /* @__PURE__ */ b(m, { size: 18 })
|
|
216
253
|
}), /* @__PURE__ */ x(S, {
|
|
217
254
|
role: "super_admin",
|
|
218
255
|
children: [/* @__PURE__ */ b("button", {
|
|
219
|
-
onClick: () =>
|
|
256
|
+
onClick: () => w(`${E}/${e.id}/edit`),
|
|
220
257
|
className: "p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200",
|
|
221
|
-
title:
|
|
258
|
+
title: k("contentPages.edit", "Edit"),
|
|
222
259
|
children: /* @__PURE__ */ b(v, { size: 18 })
|
|
223
260
|
}), /* @__PURE__ */ b("button", {
|
|
224
|
-
onClick: () =>
|
|
225
|
-
disabled:
|
|
261
|
+
onClick: () => R(e.id),
|
|
262
|
+
disabled: L,
|
|
226
263
|
className: "p-2 rounded-lg text-[var(--color-status-error)] hover:bg-[var(--color-status-error-subtle)] transition-all duration-200 disabled:opacity-50",
|
|
227
|
-
title:
|
|
264
|
+
title: k("contentPages.delete", "Delete"),
|
|
228
265
|
children: /* @__PURE__ */ b(y, { size: 18 })
|
|
229
266
|
})]
|
|
230
267
|
})]
|
|
@@ -238,6 +275,6 @@ function C() {
|
|
|
238
275
|
});
|
|
239
276
|
}
|
|
240
277
|
//#endregion
|
|
241
|
-
export {
|
|
278
|
+
export { w as ContentPagesListPage };
|
|
242
279
|
|
|
243
280
|
//# sourceMappingURL=ContentPagesListPage.js.map
|