@burdenoff/microfe-product 2026.516.1 → 2026.517.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.
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPageForm.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/content-pages/components/ContentPageForm.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGnG,UAAU,oBAAoB;IAC5B,WAAW,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACxC,QAAQ,EAAE,CAAC,IAAI,EAAE,sBAAsB,GAAG,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA0ID,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,GACR,EAAE,oBAAoB,2CAwkBtB"}
1
+ {"version":3,"file":"ContentPageForm.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/content-pages/components/ContentPageForm.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGnG,UAAU,oBAAoB;IAC5B,WAAW,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACxC,QAAQ,EAAE,CAAC,IAAI,EAAE,sBAAsB,GAAG,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA0ID,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,GACR,EAAE,oBAAoB,2CA8vBtB"}
@@ -87,11 +87,18 @@ function C({ contentPage: c, onSubmit: l, onCancel: f, loading: p }) {
87
87
  seoKeywords: c?.seoKeywords || "",
88
88
  isPublished: c?.isPublished ?? !1,
89
89
  sortOrder: c?.sortOrder ?? 0,
90
- productId: c?.productId || ""
90
+ productId: c?.productId || "",
91
+ excerpt: c?.excerpt || "",
92
+ thumbnail: c?.thumbnail || "",
93
+ author: c?.author || "",
94
+ publishedAt: c?.publishedAt ? c.publishedAt.slice(0, 16) : "",
95
+ readingTime: c?.readingTime ?? 0,
96
+ featured: c?.featured ?? !1,
97
+ category: c?.category || ""
91
98
  }), [v, C] = s(c?.tags ?? []), [w, T] = s({}), [E, D] = s(!1), O = o(null), k = () => {
92
99
  try {
93
100
  let e = c ? i : r, t = { ...h };
94
- return t.sortOrder = typeof h.sortOrder == "string" ? parseInt(h.sortOrder, 10) || 0 : h.sortOrder, t.seoTitle || delete t.seoTitle, t.seoDescription || delete t.seoDescription, t.seoKeywords || delete t.seoKeywords, t.productId || delete t.productId, t.contentFormat ||= "markdown", e.parse(t), T({}), !0;
101
+ return t.sortOrder = typeof h.sortOrder == "string" ? parseInt(h.sortOrder, 10) || 0 : h.sortOrder, t.seoTitle || delete t.seoTitle, t.seoDescription || delete t.seoDescription, t.seoKeywords || delete t.seoKeywords, t.productId || delete t.productId, t.contentFormat ||= "markdown", t.excerpt || delete t.excerpt, t.thumbnail || delete t.thumbnail, t.author || delete t.author, t.publishedAt || delete t.publishedAt, t.readingTime || delete t.readingTime, t.category || delete t.category, e.parse(t), T({}), !0;
95
102
  } catch (e) {
96
103
  if (e instanceof t) {
97
104
  let t = {};
@@ -115,7 +122,14 @@ function C({ contentPage: c, onSubmit: l, onCancel: f, loading: p }) {
115
122
  isPublished: h.isPublished === c.isPublished ? void 0 : h.isPublished,
116
123
  sortOrder: t === c.sortOrder ? void 0 : t,
117
124
  productId: h.productId === (c.productId || "") ? void 0 : h.productId || void 0,
118
- tags: v
125
+ tags: v,
126
+ excerpt: h.excerpt || void 0,
127
+ thumbnail: h.thumbnail || void 0,
128
+ author: h.author || void 0,
129
+ publishedAt: h.publishedAt ? new Date(h.publishedAt).toISOString() : void 0,
130
+ readingTime: h.readingTime || void 0,
131
+ featured: h.featured,
132
+ category: h.category || void 0
119
133
  } : {
120
134
  slug: h.slug,
121
135
  title: h.title,
@@ -127,7 +141,14 @@ function C({ contentPage: c, onSubmit: l, onCancel: f, loading: p }) {
127
141
  isPublished: h.isPublished,
128
142
  sortOrder: t,
129
143
  productId: h.productId || void 0,
130
- tags: v
144
+ tags: v,
145
+ excerpt: h.excerpt || void 0,
146
+ thumbnail: h.thumbnail || void 0,
147
+ author: h.author || void 0,
148
+ publishedAt: h.publishedAt ? new Date(h.publishedAt).toISOString() : void 0,
149
+ readingTime: h.readingTime || void 0,
150
+ featured: h.featured,
151
+ category: h.category || void 0
131
152
  });
132
153
  }, j = a((e) => {
133
154
  let t = O.current;
@@ -386,6 +407,170 @@ function C({ contentPage: c, onSubmit: l, onCancel: f, loading: p }) {
386
407
  ] })
387
408
  ]
388
409
  }),
410
+ /* @__PURE__ */ b("div", {
411
+ className: "space-y-4 pt-4 border-t border-default",
412
+ children: [
413
+ /* @__PURE__ */ y("h3", {
414
+ className: "text-sm font-semibold text-text-secondary uppercase tracking-wider",
415
+ children: m("contentPages.blogFields", "Blog Fields")
416
+ }),
417
+ /* @__PURE__ */ y("p", {
418
+ className: "text-xs text-text-tertiary",
419
+ children: "Optional fields for blog posts. Fill these when the content page is a blog article."
420
+ }),
421
+ /* @__PURE__ */ b("div", { children: [
422
+ /* @__PURE__ */ y("label", {
423
+ htmlFor: "excerpt",
424
+ className: "block text-sm font-medium text-text-primary mb-1",
425
+ children: m("contentPages.excerpt", "Excerpt")
426
+ }),
427
+ /* @__PURE__ */ y("textarea", {
428
+ id: "excerpt",
429
+ value: h.excerpt,
430
+ onChange: (e) => g({
431
+ ...h,
432
+ excerpt: e.target.value
433
+ }),
434
+ rows: 2,
435
+ className: M,
436
+ placeholder: "Short description shown on blog cards",
437
+ disabled: p
438
+ }),
439
+ /* @__PURE__ */ b("p", {
440
+ className: "text-xs text-text-tertiary mt-1",
441
+ children: [h.excerpt.length, "/500 characters"]
442
+ })
443
+ ] }),
444
+ /* @__PURE__ */ b("div", { children: [
445
+ /* @__PURE__ */ y("label", {
446
+ htmlFor: "thumbnail",
447
+ className: "block text-sm font-medium text-text-primary mb-1",
448
+ children: m("contentPages.thumbnail", "Thumbnail URL")
449
+ }),
450
+ /* @__PURE__ */ y("input", {
451
+ id: "thumbnail",
452
+ type: "url",
453
+ value: h.thumbnail,
454
+ onChange: (e) => g({
455
+ ...h,
456
+ thumbnail: e.target.value
457
+ }),
458
+ className: M,
459
+ placeholder: "https://images.unsplash.com/...",
460
+ disabled: p
461
+ }),
462
+ h.thumbnail && /* @__PURE__ */ y("div", {
463
+ className: "mt-2 rounded-lg overflow-hidden border border-default",
464
+ style: { maxWidth: 320 },
465
+ children: /* @__PURE__ */ y("img", {
466
+ src: h.thumbnail,
467
+ alt: "Thumbnail preview",
468
+ className: "w-full h-auto"
469
+ })
470
+ })
471
+ ] }),
472
+ /* @__PURE__ */ b("div", {
473
+ className: "grid grid-cols-2 gap-4",
474
+ children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
475
+ htmlFor: "author",
476
+ className: "block text-sm font-medium text-text-primary mb-1",
477
+ children: m("contentPages.author", "Author")
478
+ }), /* @__PURE__ */ y("input", {
479
+ id: "author",
480
+ type: "text",
481
+ value: h.author,
482
+ onChange: (e) => g({
483
+ ...h,
484
+ author: e.target.value
485
+ }),
486
+ className: M,
487
+ placeholder: "Author name",
488
+ disabled: p
489
+ })] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
490
+ htmlFor: "category",
491
+ className: "block text-sm font-medium text-text-primary mb-1",
492
+ children: m("contentPages.category", "Category")
493
+ }), /* @__PURE__ */ y("input", {
494
+ id: "category",
495
+ type: "text",
496
+ value: h.category,
497
+ onChange: (e) => g({
498
+ ...h,
499
+ category: e.target.value
500
+ }),
501
+ className: M,
502
+ placeholder: "Engineering, Product, Company",
503
+ disabled: p
504
+ })] })]
505
+ }),
506
+ /* @__PURE__ */ b("div", {
507
+ className: "grid grid-cols-2 gap-4",
508
+ children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
509
+ htmlFor: "publishedAt",
510
+ className: "block text-sm font-medium text-text-primary mb-1",
511
+ children: m("contentPages.publishedAt", "Publish Date")
512
+ }), /* @__PURE__ */ y("input", {
513
+ id: "publishedAt",
514
+ type: "datetime-local",
515
+ value: h.publishedAt,
516
+ onChange: (e) => g({
517
+ ...h,
518
+ publishedAt: e.target.value
519
+ }),
520
+ className: M,
521
+ disabled: p
522
+ })] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
523
+ htmlFor: "readingTime",
524
+ className: "block text-sm font-medium text-text-primary mb-1",
525
+ children: m("contentPages.readingTime", "Reading Time (min)")
526
+ }), /* @__PURE__ */ y("input", {
527
+ id: "readingTime",
528
+ type: "number",
529
+ min: 0,
530
+ max: 999,
531
+ value: h.readingTime,
532
+ onChange: (e) => g({
533
+ ...h,
534
+ readingTime: parseInt(e.target.value, 10) || 0
535
+ }),
536
+ className: M,
537
+ placeholder: "5",
538
+ disabled: p
539
+ })] })]
540
+ }),
541
+ /* @__PURE__ */ b("div", {
542
+ className: "flex items-center gap-3",
543
+ children: [/* @__PURE__ */ y("button", {
544
+ type: "button",
545
+ role: "switch",
546
+ "aria-checked": h.featured,
547
+ onClick: () => g({
548
+ ...h,
549
+ featured: !h.featured
550
+ }),
551
+ disabled: p,
552
+ className: `
553
+ relative inline-flex h-6 w-11 shrink-0
554
+ cursor-pointer rounded-full
555
+ border-2 border-transparent
556
+ transition-colors duration-200 ease-in-out
557
+ focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)] focus:ring-offset-2
558
+ disabled:opacity-50 disabled:cursor-not-allowed
559
+ ${h.featured ? "bg-[var(--color-action-primary-bg)]" : "bg-gray-300 dark:bg-gray-600"}
560
+ `,
561
+ children: /* @__PURE__ */ y("span", { className: `
562
+ pointer-events-none inline-block h-5 w-5
563
+ transform rounded-full bg-white shadow ring-0
564
+ transition duration-200 ease-in-out
565
+ ${h.featured ? "translate-x-5" : "translate-x-0"}
566
+ ` })
567
+ }), /* @__PURE__ */ y("label", {
568
+ className: "text-sm font-medium text-text-primary",
569
+ children: h.featured ? m("contentPages.featured", "Featured") : m("contentPages.notFeatured", "Not Featured")
570
+ })]
571
+ })
572
+ ]
573
+ }),
389
574
  /* @__PURE__ */ b("div", {
390
575
  className: "space-y-4 pt-4 border-t border-default",
391
576
  children: [
@@ -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, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\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 &gt; lines)\n html = html.replace(\n /^&gt; (.+)$/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 });\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\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 }\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 };\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 {/* 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,EAAK,QAAQ,6BAA6B,GAAQ,GAAO,MACvD,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ACL,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, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\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 &gt; lines)\n html = html.replace(\n /^&gt; (.+)$/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,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ACrC,CAAA;MACR,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"}
@@ -15,6 +15,13 @@ export declare const createContentPageSchema: z.ZodObject<{
15
15
  isPublished: z.ZodOptional<z.ZodBoolean>;
16
16
  sortOrder: z.ZodOptional<z.ZodNumber>;
17
17
  productId: z.ZodOptional<z.ZodString>;
18
+ excerpt: z.ZodOptional<z.ZodString>;
19
+ thumbnail: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
20
+ author: z.ZodOptional<z.ZodString>;
21
+ publishedAt: z.ZodOptional<z.ZodString>;
22
+ readingTime: z.ZodOptional<z.ZodNumber>;
23
+ featured: z.ZodOptional<z.ZodBoolean>;
24
+ category: z.ZodOptional<z.ZodString>;
18
25
  }, z.core.$strip>;
19
26
  export declare const updateContentPageSchema: z.ZodObject<{
20
27
  slug: z.ZodOptional<z.ZodString>;
@@ -27,6 +34,13 @@ export declare const updateContentPageSchema: z.ZodObject<{
27
34
  isPublished: z.ZodOptional<z.ZodBoolean>;
28
35
  sortOrder: z.ZodOptional<z.ZodNumber>;
29
36
  productId: z.ZodOptional<z.ZodString>;
37
+ excerpt: z.ZodOptional<z.ZodString>;
38
+ thumbnail: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
39
+ author: z.ZodOptional<z.ZodString>;
40
+ publishedAt: z.ZodOptional<z.ZodString>;
41
+ readingTime: z.ZodOptional<z.ZodNumber>;
42
+ featured: z.ZodOptional<z.ZodBoolean>;
43
+ category: z.ZodOptional<z.ZodString>;
30
44
  }, z.core.$strip>;
31
45
  export type CreateContentPageFormData = z.infer<typeof createContentPageSchema>;
32
46
  export type UpdateContentPageFormData = z.infer<typeof updateContentPageSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/content-pages/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAGH,eAAO,MAAM,uBAAuB;;;;;;;;;;;iBAoBlC,CAAC;AAGH,eAAO,MAAM,uBAAuB;;;;;;;;;;;iBAsBlC,CAAC;AAGH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAChF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/content-pages/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAGH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;iBA2BlC,CAAC;AAGH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;iBA6BlC,CAAC;AAGH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAChF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -1,29 +1,43 @@
1
- import { boolean as e, number as t, object as n, string as r } from "../../../../node_modules/zod/v4/classic/schemas.js";
1
+ import { boolean as e, literal as t, number as n, object as r, string as i } from "../../../../node_modules/zod/v4/classic/schemas.js";
2
2
  //#region src/product-management/modules/content-pages/schemas/index.ts
3
- var i = n({
4
- slug: r().min(2, "Slug must be at least 2 characters").max(100, "Slug must not exceed 100 characters").regex(/^[a-z0-9-]+$/, "Slug must contain only lowercase letters, numbers, and hyphens").trim(),
5
- title: r().min(2, "Title must be at least 2 characters").max(200, "Title must not exceed 200 characters").trim(),
6
- content: r().min(1, "Content is required"),
7
- contentFormat: r().default("markdown").optional(),
8
- seoTitle: r().max(100, "SEO title must not exceed 100 characters").optional(),
9
- seoDescription: r().max(300, "SEO description must not exceed 300 characters").optional(),
10
- seoKeywords: r().max(200, "SEO keywords must not exceed 200 characters").optional(),
3
+ var a = r({
4
+ slug: i().min(2, "Slug must be at least 2 characters").max(100, "Slug must not exceed 100 characters").regex(/^[a-z0-9-]+$/, "Slug must contain only lowercase letters, numbers, and hyphens").trim(),
5
+ title: i().min(2, "Title must be at least 2 characters").max(200, "Title must not exceed 200 characters").trim(),
6
+ content: i().min(1, "Content is required"),
7
+ contentFormat: i().default("markdown").optional(),
8
+ seoTitle: i().max(100, "SEO title must not exceed 100 characters").optional(),
9
+ seoDescription: i().max(300, "SEO description must not exceed 300 characters").optional(),
10
+ seoKeywords: i().max(200, "SEO keywords must not exceed 200 characters").optional(),
11
11
  isPublished: e().optional(),
12
- sortOrder: t().int().min(0).optional(),
13
- productId: r().optional()
14
- }), a = n({
15
- slug: r().min(2, "Slug must be at least 2 characters").max(100, "Slug must not exceed 100 characters").regex(/^[a-z0-9-]+$/, "Slug must contain only lowercase letters, numbers, and hyphens").trim().optional(),
16
- title: r().min(2, "Title must be at least 2 characters").max(200, "Title must not exceed 200 characters").trim().optional(),
17
- content: r().min(1, "Content is required").optional(),
18
- contentFormat: r().optional(),
19
- seoTitle: r().max(100, "SEO title must not exceed 100 characters").optional(),
20
- seoDescription: r().max(300, "SEO description must not exceed 300 characters").optional(),
21
- seoKeywords: r().max(200, "SEO keywords must not exceed 200 characters").optional(),
12
+ sortOrder: n().int().min(0).optional(),
13
+ productId: i().optional(),
14
+ excerpt: i().max(500, "Excerpt must not exceed 500 characters").optional(),
15
+ thumbnail: i().url("Must be a valid URL").or(t("")).optional(),
16
+ author: i().max(100, "Author must not exceed 100 characters").optional(),
17
+ publishedAt: i().optional(),
18
+ readingTime: n().int().min(0).max(999).optional(),
19
+ featured: e().optional(),
20
+ category: i().max(50, "Category must not exceed 50 characters").optional()
21
+ }), o = r({
22
+ slug: i().min(2, "Slug must be at least 2 characters").max(100, "Slug must not exceed 100 characters").regex(/^[a-z0-9-]+$/, "Slug must contain only lowercase letters, numbers, and hyphens").trim().optional(),
23
+ title: i().min(2, "Title must be at least 2 characters").max(200, "Title must not exceed 200 characters").trim().optional(),
24
+ content: i().min(1, "Content is required").optional(),
25
+ contentFormat: i().optional(),
26
+ seoTitle: i().max(100, "SEO title must not exceed 100 characters").optional(),
27
+ seoDescription: i().max(300, "SEO description must not exceed 300 characters").optional(),
28
+ seoKeywords: i().max(200, "SEO keywords must not exceed 200 characters").optional(),
22
29
  isPublished: e().optional(),
23
- sortOrder: t().int().min(0).optional(),
24
- productId: r().optional()
30
+ sortOrder: n().int().min(0).optional(),
31
+ productId: i().optional(),
32
+ excerpt: i().max(500, "Excerpt must not exceed 500 characters").optional(),
33
+ thumbnail: i().url("Must be a valid URL").or(t("")).optional(),
34
+ author: i().max(100, "Author must not exceed 100 characters").optional(),
35
+ publishedAt: i().optional(),
36
+ readingTime: n().int().min(0).max(999).optional(),
37
+ featured: e().optional(),
38
+ category: i().max(50, "Category must not exceed 50 characters").optional()
25
39
  });
26
40
  //#endregion
27
- export { i as createContentPageSchema, a as updateContentPageSchema };
41
+ export { a as createContentPageSchema, o as updateContentPageSchema };
28
42
 
29
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Content Page Validation Schemas\n * Zod schemas for validating content page form inputs\n * Aligned with backend ProductContentPage schema\n */\n\n// Create Content Page Schema\nexport const createContentPageSchema = z.object({\n slug: z\n .string()\n .min(2, 'Slug must be at least 2 characters')\n .max(100, 'Slug must not exceed 100 characters')\n .regex(/^[a-z0-9-]+$/, 'Slug must contain only lowercase letters, numbers, and hyphens')\n .trim(),\n title: z\n .string()\n .min(2, 'Title must be at least 2 characters')\n .max(200, 'Title must not exceed 200 characters')\n .trim(),\n content: z.string().min(1, 'Content is required'),\n contentFormat: z.string().default('markdown').optional(),\n seoTitle: z.string().max(100, 'SEO title must not exceed 100 characters').optional(),\n seoDescription: z.string().max(300, 'SEO description must not exceed 300 characters').optional(),\n seoKeywords: z.string().max(200, 'SEO keywords must not exceed 200 characters').optional(),\n isPublished: z.boolean().optional(),\n sortOrder: z.number().int().min(0).optional(),\n productId: z.string().optional(),\n});\n\n// Update Content Page Schema (all fields optional)\nexport const updateContentPageSchema = z.object({\n slug: z\n .string()\n .min(2, 'Slug must be at least 2 characters')\n .max(100, 'Slug must not exceed 100 characters')\n .regex(/^[a-z0-9-]+$/, 'Slug must contain only lowercase letters, numbers, and hyphens')\n .trim()\n .optional(),\n title: z\n .string()\n .min(2, 'Title must be at least 2 characters')\n .max(200, 'Title must not exceed 200 characters')\n .trim()\n .optional(),\n content: z.string().min(1, 'Content is required').optional(),\n contentFormat: z.string().optional(),\n seoTitle: z.string().max(100, 'SEO title must not exceed 100 characters').optional(),\n seoDescription: z.string().max(300, 'SEO description must not exceed 300 characters').optional(),\n seoKeywords: z.string().max(200, 'SEO keywords must not exceed 200 characters').optional(),\n isPublished: z.boolean().optional(),\n sortOrder: z.number().int().min(0).optional(),\n productId: z.string().optional(),\n});\n\n// Type exports\nexport type CreateContentPageFormData = z.infer<typeof createContentPageSchema>;\nexport type UpdateContentPageFormData = z.infer<typeof updateContentPageSchema>;\n"],"mappings":";;AASA,IAAa,IAA0B,EAAS;CAC9C,MAAM,GACK,CACR,IAAI,GAAG,qCAAqC,CAC5C,IAAI,KAAK,sCAAsC,CAC/C,MAAM,gBAAgB,iEAAiE,CACvF,MAAM;CACT,OAAO,GACI,CACR,IAAI,GAAG,sCAAsC,CAC7C,IAAI,KAAK,uCAAuC,CAChD,MAAM;CACT,SAAS,GAAU,CAAC,IAAI,GAAG,sBAAsB;CACjD,eAAe,GAAU,CAAC,QAAQ,WAAW,CAAC,UAAU;CACxD,UAAU,GAAU,CAAC,IAAI,KAAK,2CAA2C,CAAC,UAAU;CACpF,gBAAgB,GAAU,CAAC,IAAI,KAAK,iDAAiD,CAAC,UAAU;CAChG,aAAa,GAAU,CAAC,IAAI,KAAK,8CAA8C,CAAC,UAAU;CAC1F,aAAa,GAAW,CAAC,UAAU;CACnC,WAAW,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;CAC7C,WAAW,GAAU,CAAC,UAAU;CACjC,CAAC,EAGW,IAA0B,EAAS;CAC9C,MAAM,GACK,CACR,IAAI,GAAG,qCAAqC,CAC5C,IAAI,KAAK,sCAAsC,CAC/C,MAAM,gBAAgB,iEAAiE,CACvF,MAAM,CACN,UAAU;CACb,OAAO,GACI,CACR,IAAI,GAAG,sCAAsC,CAC7C,IAAI,KAAK,uCAAuC,CAChD,MAAM,CACN,UAAU;CACb,SAAS,GAAU,CAAC,IAAI,GAAG,sBAAsB,CAAC,UAAU;CAC5D,eAAe,GAAU,CAAC,UAAU;CACpC,UAAU,GAAU,CAAC,IAAI,KAAK,2CAA2C,CAAC,UAAU;CACpF,gBAAgB,GAAU,CAAC,IAAI,KAAK,iDAAiD,CAAC,UAAU;CAChG,aAAa,GAAU,CAAC,IAAI,KAAK,8CAA8C,CAAC,UAAU;CAC1F,aAAa,GAAW,CAAC,UAAU;CACnC,WAAW,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;CAC7C,WAAW,GAAU,CAAC,UAAU;CACjC,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/product-management/modules/content-pages/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Content Page Validation Schemas\n * Zod schemas for validating content page form inputs\n * Aligned with backend ProductContentPage schema\n */\n\n// Create Content Page Schema\nexport const createContentPageSchema = z.object({\n slug: z\n .string()\n .min(2, 'Slug must be at least 2 characters')\n .max(100, 'Slug must not exceed 100 characters')\n .regex(/^[a-z0-9-]+$/, 'Slug must contain only lowercase letters, numbers, and hyphens')\n .trim(),\n title: z\n .string()\n .min(2, 'Title must be at least 2 characters')\n .max(200, 'Title must not exceed 200 characters')\n .trim(),\n content: z.string().min(1, 'Content is required'),\n contentFormat: z.string().default('markdown').optional(),\n seoTitle: z.string().max(100, 'SEO title must not exceed 100 characters').optional(),\n seoDescription: z.string().max(300, 'SEO description must not exceed 300 characters').optional(),\n seoKeywords: z.string().max(200, 'SEO keywords must not exceed 200 characters').optional(),\n isPublished: z.boolean().optional(),\n sortOrder: z.number().int().min(0).optional(),\n productId: z.string().optional(),\n excerpt: z.string().max(500, 'Excerpt must not exceed 500 characters').optional(),\n thumbnail: z.string().url('Must be a valid URL').or(z.literal('')).optional(),\n author: z.string().max(100, 'Author must not exceed 100 characters').optional(),\n publishedAt: z.string().optional(),\n readingTime: z.number().int().min(0).max(999).optional(),\n featured: z.boolean().optional(),\n category: z.string().max(50, 'Category must not exceed 50 characters').optional(),\n});\n\n// Update Content Page Schema (all fields optional)\nexport const updateContentPageSchema = z.object({\n slug: z\n .string()\n .min(2, 'Slug must be at least 2 characters')\n .max(100, 'Slug must not exceed 100 characters')\n .regex(/^[a-z0-9-]+$/, 'Slug must contain only lowercase letters, numbers, and hyphens')\n .trim()\n .optional(),\n title: z\n .string()\n .min(2, 'Title must be at least 2 characters')\n .max(200, 'Title must not exceed 200 characters')\n .trim()\n .optional(),\n content: z.string().min(1, 'Content is required').optional(),\n contentFormat: z.string().optional(),\n seoTitle: z.string().max(100, 'SEO title must not exceed 100 characters').optional(),\n seoDescription: z.string().max(300, 'SEO description must not exceed 300 characters').optional(),\n seoKeywords: z.string().max(200, 'SEO keywords must not exceed 200 characters').optional(),\n isPublished: z.boolean().optional(),\n sortOrder: z.number().int().min(0).optional(),\n productId: z.string().optional(),\n excerpt: z.string().max(500, 'Excerpt must not exceed 500 characters').optional(),\n thumbnail: z.string().url('Must be a valid URL').or(z.literal('')).optional(),\n author: z.string().max(100, 'Author must not exceed 100 characters').optional(),\n publishedAt: z.string().optional(),\n readingTime: z.number().int().min(0).max(999).optional(),\n featured: z.boolean().optional(),\n category: z.string().max(50, 'Category must not exceed 50 characters').optional(),\n});\n\n// Type exports\nexport type CreateContentPageFormData = z.infer<typeof createContentPageSchema>;\nexport type UpdateContentPageFormData = z.infer<typeof updateContentPageSchema>;\n"],"mappings":";;AASA,IAAa,IAA0B,EAAS;CAC9C,MAAM,GACK,CACR,IAAI,GAAG,qCAAqC,CAC5C,IAAI,KAAK,sCAAsC,CAC/C,MAAM,gBAAgB,iEAAiE,CACvF,MAAM;CACT,OAAO,GACI,CACR,IAAI,GAAG,sCAAsC,CAC7C,IAAI,KAAK,uCAAuC,CAChD,MAAM;CACT,SAAS,GAAU,CAAC,IAAI,GAAG,sBAAsB;CACjD,eAAe,GAAU,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AAa,GAAW,CAAC,UAAU;CACnC,WAAW,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;CAC7C,WAAW,GAAU,CAAC,UAAU;CAChC,SAAS,GAAU,CAAC,IAAI,KAAK,yCAAyC,CAAC,UAAU;CACjF,WAAW,GAAU,CAAC,IAAI,sBAAsB,CAAC,GAAG,EAAU,GAAG,CAAC,CAAC,UAAU;CAC7E,QAAQ,GAAU,CAAC,IAAI,KAAK,wCAAwC,CAAC,UAAU;CAC/E,aAAa,GAAU,CAAC,UAAU;CAClC,aAAa,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,UAAU;CACxD,UAAU,GAAW,CAAC,UAAU;CAChC,UAAU,GAAU,CAAC,IAAI,IAAI,yCAAyC,CAAC,UAAU;CAClF,CAAC"}
@@ -17,6 +17,13 @@ export interface ProductContentPage {
17
17
  isPublished: boolean;
18
18
  sortOrder: number;
19
19
  tags: string[];
20
+ excerpt: string | null;
21
+ thumbnail: string | null;
22
+ author: string | null;
23
+ publishedAt: string | null;
24
+ readingTime: number | null;
25
+ featured: boolean;
26
+ category: string | null;
20
27
  createdAt: string;
21
28
  updatedAt: string;
22
29
  product?: {
@@ -43,6 +50,13 @@ export interface CreateContentPageInput {
43
50
  isPublished?: boolean;
44
51
  sortOrder?: number;
45
52
  tags?: string[];
53
+ excerpt?: string;
54
+ thumbnail?: string;
55
+ author?: string;
56
+ publishedAt?: string;
57
+ readingTime?: number;
58
+ featured?: boolean;
59
+ category?: string;
46
60
  }
47
61
  export interface UpdateContentPageInput {
48
62
  productId?: string;
@@ -56,6 +70,13 @@ export interface UpdateContentPageInput {
56
70
  isPublished?: boolean;
57
71
  sortOrder?: number;
58
72
  tags?: string[];
73
+ excerpt?: string;
74
+ thumbnail?: string;
75
+ author?: string;
76
+ publishedAt?: string;
77
+ readingTime?: number;
78
+ featured?: boolean;
79
+ category?: string;
59
80
  }
60
81
  export interface ContentPagesConnection {
61
82
  items: ProductContentPage[];