@burdenoff/microfe-product 2026.626.2 → 2026.720.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.
Files changed (38) hide show
  1. package/dist/product/pages/ContentPageViewPage.js +42 -43
  2. package/dist/product/pages/ContentPageViewPage.js.map +1 -1
  3. package/dist/product/pages/ProductViewPage.js +88 -87
  4. package/dist/product/pages/ProductViewPage.js.map +1 -1
  5. package/dist/product-management/modules/content-pages/components/ContentPageForm.js +341 -473
  6. package/dist/product-management/modules/content-pages/components/ContentPageForm.js.map +1 -1
  7. package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js +8 -10
  8. package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js.map +1 -1
  9. package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js +201 -168
  10. package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js.map +1 -1
  11. package/dist/product-management/modules/feature-flags/hooks/useFeatureFlags.js +1 -0
  12. package/dist/product-management/modules/feature-flags/hooks/useFeatureFlags.js.map +1 -1
  13. package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js +37 -34
  14. package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js.map +1 -1
  15. package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js +183 -138
  16. package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js.map +1 -1
  17. package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js +250 -252
  18. package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js.map +1 -1
  19. package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js +72 -72
  20. package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js.map +1 -1
  21. package/dist/product-management/modules/products/components/ProductForm.js +490 -492
  22. package/dist/product-management/modules/products/components/ProductForm.js.map +1 -1
  23. package/dist/product-management/modules/products/hooks/useProducts.js +20 -7
  24. package/dist/product-management/modules/products/hooks/useProducts.js.map +1 -1
  25. package/dist/product-management/modules/products/pages/ProductDetailPage.js +130 -129
  26. package/dist/product-management/modules/products/pages/ProductDetailPage.js.map +1 -1
  27. package/dist/product-management/modules/shortcuts/components/ShortcutForm.js +195 -203
  28. package/dist/product-management/modules/shortcuts/components/ShortcutForm.js.map +1 -1
  29. package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js +88 -87
  30. package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js.map +1 -1
  31. package/dist/shared/components/MarkdownEditor.js +161 -0
  32. package/dist/shared/components/MarkdownEditor.js.map +1 -0
  33. package/dist/shared/components/index.js +1 -0
  34. package/package.json +2 -2
  35. package/dist/node_modules/dompurify/dist/purify.es.js +0 -555
  36. package/dist/node_modules/dompurify/dist/purify.es.js.map +0 -1
  37. package/dist/shared/utils/renderMarkdown.js +0 -8
  38. package/dist/shared/utils/renderMarkdown.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ProductForm.js","names":[],"sources":["../../../../../src/product-management/modules/products/components/ProductForm.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Loader2, ChevronDown, ChevronRight, Plus, X, Shield } from 'lucide-react';\nimport { ZodError } from 'zod';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport type { CreateProductInput, UpdateProductInput, PlatformProduct } from '../types';\nimport { ProductStatus } from '../types';\nimport { createProductSchema, updateProductSchema } from '../schemas';\nimport { TagInput } from '../../../shared/components/input/TagInput';\n\ninterface SocialLinkEntry {\n /** Stable client-side id so React list keys survive reorder/remove. */\n id: string;\n platform: string;\n url: string;\n}\n\nlet nextEntryId = 0;\nconst makeEntryId = (prefix: string) => `${prefix}-${++nextEntryId}`;\n\n/**\n * Resource-links share the same admin UI shape as social-links — a list of\n * (key, URL) rows the admin can freely add / remove. They're stored in their\n * own JSON column on `Product` so the website SDK can pick them up separately\n * from socials (different footer column, different default behaviour).\n */\ninterface ResourceLinkEntry {\n /** Stable client-side id so React list keys survive reorder/remove. */\n id: string;\n resource: string;\n url: string;\n}\n\ninterface ProductFormProps {\n product?: PlatformProduct | null;\n onSubmit: (data: CreateProductInput | UpdateProductInput) => Promise<void>;\n onCancel: () => void;\n loading?: boolean;\n}\n\nfunction initSocialLinks(product?: PlatformProduct | null): SocialLinkEntry[] {\n if (product?.socialLinks && typeof product.socialLinks === 'object') {\n const entries = Object.entries(product.socialLinks);\n if (entries.length > 0) {\n return entries.map(([platform, url]) => ({ id: makeEntryId('social'), platform, url }));\n }\n }\n return [];\n}\n\nfunction initResourceLinks(product?: PlatformProduct | null): ResourceLinkEntry[] {\n if (product?.resourceLinks && typeof product.resourceLinks === 'object') {\n const entries = Object.entries(product.resourceLinks);\n if (entries.length > 0) {\n return entries.map(([resource, url]) => ({ id: makeEntryId('resource'), resource, url }));\n }\n }\n return [];\n}\n\nexport function ProductForm({ product, onSubmit, onCancel, loading }: ProductFormProps) {\n const tr = useTr();\n\n const [formData, setFormData] = useState({\n name: product?.name || '',\n slug: product?.slug || '',\n description: product?.description || '',\n status: product?.status || ProductStatus.ACTIVE,\n logoUrl: product?.logoUrl || '',\n website: product?.website || '',\n appUrl: product?.appUrl || '',\n docsUrl: product?.docsUrl || '',\n githubUrl: product?.githubUrl || '',\n statusPageUrl: product?.statusPageUrl || '',\n contactEmail: product?.contactEmail || '',\n supportEmail: product?.supportEmail || '',\n contactPhone: product?.contactPhone || '',\n contactAddress: product?.contactAddress || '',\n seoTitle: product?.seoTitle || '',\n seoDescription: product?.seoDescription || '',\n seoKeywords: product?.seoKeywords || '',\n ogImage: product?.ogImage || '',\n appStoreUrl: product?.appStoreUrl || '',\n playStoreUrl: product?.playStoreUrl || '',\n });\n\n const [socialLinks, setSocialLinks] = useState<SocialLinkEntry[]>(() => initSocialLinks(product));\n const [resourceLinks, setResourceLinks] = useState<ResourceLinkEntry[]>(() =>\n initResourceLinks(product)\n );\n const [tags, setTags] = useState<string[]>(product?.tags ?? []);\n\n const [errors, setErrors] = useState<Record<string, string>>({});\n\n const [expandedSections, setExpandedSections] = useState<Record<string, boolean>>({\n contact: false,\n seo: false,\n appStore: false,\n social: false,\n resources: false,\n integrations: false,\n });\n\n const toggleSection = (section: string) => {\n setExpandedSections((prev) => ({ ...prev, [section]: !prev[section] }));\n };\n\n const addSocialLink = () => {\n setSocialLinks((prev) => [...prev, { id: makeEntryId('social'), platform: '', url: '' }]);\n };\n\n const removeSocialLink = (index: number) => {\n setSocialLinks((prev) => prev.filter((_, i) => i !== index));\n };\n\n const updateSocialLink = (index: number, field: 'platform' | 'url', value: string) => {\n setSocialLinks((prev) =>\n prev.map((entry, i) => (i === index ? { ...entry, [field]: value } : entry))\n );\n };\n\n const buildSocialLinksRecord = (): Record<string, string> | undefined => {\n const filtered = socialLinks.filter(\n (entry) => entry.platform.trim() !== '' && entry.url.trim() !== ''\n );\n if (filtered.length === 0) return undefined;\n const record: Record<string, string> = {};\n filtered.forEach((entry) => {\n record[entry.platform.trim()] = entry.url.trim();\n });\n return record;\n };\n\n const addResourceLink = () => {\n setResourceLinks((prev) => [...prev, { id: makeEntryId('resource'), resource: '', url: '' }]);\n };\n\n const removeResourceLink = (index: number) => {\n setResourceLinks((prev) => prev.filter((_, i) => i !== index));\n };\n\n const updateResourceLink = (index: number, field: 'resource' | 'url', value: string) => {\n setResourceLinks((prev) =>\n prev.map((entry, i) => (i === index ? { ...entry, [field]: value } : entry))\n );\n };\n\n const buildResourceLinksRecord = (): Record<string, string> | undefined => {\n const filtered = resourceLinks.filter(\n (entry) => entry.resource.trim() !== '' && entry.url.trim() !== ''\n );\n if (filtered.length === 0) return undefined;\n const record: Record<string, string> = {};\n filtered.forEach((entry) => {\n record[entry.resource.trim()] = entry.url.trim();\n });\n return record;\n };\n\n const validate = () => {\n try {\n const schema = product ? updateProductSchema : createProductSchema;\n const dataToValidate = {\n ...formData,\n socialLinks: buildSocialLinksRecord(),\n resourceLinks: buildResourceLinksRecord(),\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 socialLinksRecord = buildSocialLinksRecord();\n const resourceLinksRecord = buildResourceLinksRecord();\n\n const submitData = product\n ? {\n // Update only changed fields\n name: formData.name !== product.name ? formData.name : undefined,\n description:\n formData.description !== product.description ? formData.description : undefined,\n status: formData.status !== product.status ? formData.status : undefined,\n logoUrl: formData.logoUrl !== product.logoUrl ? formData.logoUrl : undefined,\n website: formData.website !== product.website ? formData.website : undefined,\n appUrl: formData.appUrl !== product.appUrl ? formData.appUrl : undefined,\n docsUrl: formData.docsUrl !== product.docsUrl ? formData.docsUrl : undefined,\n githubUrl: formData.githubUrl !== product.githubUrl ? formData.githubUrl : undefined,\n statusPageUrl:\n formData.statusPageUrl !== product.statusPageUrl ? formData.statusPageUrl : undefined,\n contactEmail:\n formData.contactEmail !== (product.contactEmail || '')\n ? formData.contactEmail\n : undefined,\n supportEmail:\n formData.supportEmail !== (product.supportEmail || '')\n ? formData.supportEmail\n : undefined,\n contactPhone:\n formData.contactPhone !== (product.contactPhone || '')\n ? formData.contactPhone\n : undefined,\n contactAddress:\n formData.contactAddress !== (product.contactAddress || '')\n ? formData.contactAddress\n : undefined,\n seoTitle: formData.seoTitle !== (product.seoTitle || '') ? formData.seoTitle : undefined,\n seoDescription:\n formData.seoDescription !== (product.seoDescription || '')\n ? formData.seoDescription\n : undefined,\n seoKeywords:\n formData.seoKeywords !== (product.seoKeywords || '') ? formData.seoKeywords : undefined,\n ogImage: formData.ogImage !== (product.ogImage || '') ? formData.ogImage : undefined,\n appStoreUrl:\n formData.appStoreUrl !== (product.appStoreUrl || '') ? formData.appStoreUrl : undefined,\n playStoreUrl:\n formData.playStoreUrl !== (product.playStoreUrl || '')\n ? formData.playStoreUrl\n : undefined,\n socialLinks: socialLinksRecord,\n resourceLinks: resourceLinksRecord,\n tags,\n // reCAPTCHA keys from Integrations section\n ...(() => {\n const form = e.target as HTMLFormElement;\n const siteKey = (form.elements.namedItem('recaptchaSiteKey') as HTMLInputElement)\n ?.value;\n const secretKey = (form.elements.namedItem('recaptchaSecretKey') as HTMLInputElement)\n ?.value;\n const result: Record<string, string | undefined> = {};\n if (siteKey && siteKey !== (product.recaptchaSiteKey || ''))\n result.recaptchaSiteKey = siteKey;\n if (secretKey) result.recaptchaSecretKey = secretKey;\n return result;\n })(),\n }\n : {\n // Create with all fields\n name: formData.name,\n slug: formData.slug,\n description: formData.description || undefined,\n status: formData.status,\n logoUrl: formData.logoUrl || undefined,\n website: formData.website || undefined,\n appUrl: formData.appUrl || undefined,\n docsUrl: formData.docsUrl || undefined,\n githubUrl: formData.githubUrl || undefined,\n statusPageUrl: formData.statusPageUrl || undefined,\n contactEmail: formData.contactEmail || undefined,\n supportEmail: formData.supportEmail || undefined,\n contactPhone: formData.contactPhone || undefined,\n contactAddress: formData.contactAddress || undefined,\n seoTitle: formData.seoTitle || undefined,\n seoDescription: formData.seoDescription || undefined,\n seoKeywords: formData.seoKeywords || undefined,\n ogImage: formData.ogImage || undefined,\n appStoreUrl: formData.appStoreUrl || undefined,\n playStoreUrl: formData.playStoreUrl || undefined,\n socialLinks: socialLinksRecord,\n resourceLinks: resourceLinksRecord,\n tags,\n };\n\n await onSubmit(submitData);\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-bg-sunken disabled:cursor-not-allowed\n transition-all duration-200\n `;\n\n const sectionHeaderClassName = `\n flex items-center gap-2 w-full text-left\n text-sm font-semibold text-text-secondary uppercase tracking-wider\n cursor-pointer hover:text-text-primary transition-colors duration-200\n `;\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-6 animate-in fade-in duration-200\">\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('products.basicInformation', 'Basic Information')}\n </h3>\n\n {/* Name */}\n <div>\n <label htmlFor=\"name\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.productName', 'Product Name')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"name\"\n type=\"text\"\n value={formData.name}\n onChange={(e) => setFormData({ ...formData, name: e.target.value })}\n className={inputClassName}\n placeholder={tr('products.enterProductName', 'Enter product name')}\n disabled={loading}\n required\n />\n {errors.name && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.name}</p>\n )}\n </div>\n\n {/* Slug */}\n <div>\n <label htmlFor=\"slug\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.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({ ...formData, slug: e.target.value.toLowerCase().replace(/\\s+/g, '-') })\n }\n className={inputClassName}\n placeholder=\"product-slug\"\n disabled={loading || !!product}\n required={!product}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'products.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 {/* Description */}\n <div>\n <label htmlFor=\"description\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.description', 'Description')}\n </label>\n <textarea\n id=\"description\"\n value={formData.description}\n onChange={(e) => setFormData({ ...formData, description: e.target.value })}\n rows={3}\n className={inputClassName}\n placeholder={tr('products.enterProductDescription', 'Enter product description')}\n disabled={loading}\n />\n </div>\n\n {/* Status */}\n <div>\n <label htmlFor=\"status\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.status', 'Status')}\n </label>\n <select\n id=\"status\"\n value={formData.status}\n onChange={(e) =>\n setFormData({\n ...formData,\n status: e.target.value as (typeof ProductStatus)[keyof typeof ProductStatus],\n })\n }\n className={inputClassName}\n disabled={loading}\n >\n <option value={ProductStatus.ACTIVE}>{tr('products.statusActive', 'Active')}</option>\n <option value={ProductStatus.DRAFT}>{tr('products.statusDraft', 'Draft')}</option>\n <option value={ProductStatus.WAITLIST}>\n {tr('products.statusWaitlist', 'Waitlist')}\n </option>\n <option value={ProductStatus.COMING_SOON}>\n {tr('products.statusComingSoon', 'Coming Soon')}\n </option>\n </select>\n </div>\n\n {/* Tags */}\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.tags', 'Tags')}\n </label>\n <TagInput value={tags} onChange={setTags} disabled={loading} />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr('products.tagsHint', 'Press Enter or comma to add a tag.')}\n </p>\n </div>\n </div>\n\n {/* URLs Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('products.urlsAndLinks', 'URLs & Links')}\n </h3>\n\n {/* Logo URL */}\n <div>\n <label htmlFor=\"logoUrl\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.logoUrl', 'Logo URL')}\n </label>\n <input\n id=\"logoUrl\"\n type=\"url\"\n value={formData.logoUrl}\n onChange={(e) => setFormData({ ...formData, logoUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://example.com/logo.png\"\n disabled={loading}\n />\n {errors.logoUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.logoUrl}</p>\n )}\n </div>\n\n {/* App URL - Important for ProductSwitcher */}\n <div>\n <label htmlFor=\"appUrl\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.appUrl', 'App URL')}{' '}\n <span className=\"text-[var(--color-status-warning)]\">\n {tr('products.requiredForProductSwitcher', '(Required for product switcher)')}\n </span>\n </label>\n <input\n id=\"appUrl\"\n type=\"url\"\n value={formData.appUrl}\n onChange={(e) => setFormData({ ...formData, appUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://app.product.com/\"\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'products.appUrlHint',\n \"The main application URL. Products without an App URL won't appear in the product switcher.\"\n )}\n </p>\n {errors.appUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.appUrl}</p>\n )}\n </div>\n\n {/* Website URL */}\n <div>\n <label htmlFor=\"website\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.websiteUrl', 'Website URL')}\n </label>\n <input\n id=\"website\"\n type=\"url\"\n value={formData.website}\n onChange={(e) => setFormData({ ...formData, website: e.target.value })}\n className={inputClassName}\n placeholder=\"https://product.com/\"\n disabled={loading}\n />\n {errors.website && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.website}</p>\n )}\n </div>\n\n {/* Docs URL */}\n <div>\n <label htmlFor=\"docsUrl\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.documentationUrl', 'Documentation URL')}\n </label>\n <input\n id=\"docsUrl\"\n type=\"url\"\n value={formData.docsUrl}\n onChange={(e) => setFormData({ ...formData, docsUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://docs.product.com/\"\n disabled={loading}\n />\n {errors.docsUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.docsUrl}</p>\n )}\n </div>\n\n {/* GitHub URL */}\n <div>\n <label htmlFor=\"githubUrl\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.githubUrl', 'GitHub URL')}\n </label>\n <input\n id=\"githubUrl\"\n type=\"url\"\n value={formData.githubUrl}\n onChange={(e) => setFormData({ ...formData, githubUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://github.com/org/repo\"\n disabled={loading}\n />\n {errors.githubUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.githubUrl}</p>\n )}\n </div>\n\n {/* Status Page URL */}\n <div>\n <label\n htmlFor=\"statusPageUrl\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.statusPageUrl', 'Status Page URL')}\n </label>\n <input\n id=\"statusPageUrl\"\n type=\"url\"\n value={formData.statusPageUrl}\n onChange={(e) => setFormData({ ...formData, statusPageUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://status.product.com/\"\n disabled={loading}\n />\n {errors.statusPageUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.statusPageUrl}</p>\n )}\n </div>\n </div>\n\n {/* Contact Information Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <button\n type=\"button\"\n onClick={() => toggleSection('contact')}\n className={sectionHeaderClassName}\n >\n {expandedSections.contact ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n {tr('products.contactInformation', 'Contact Information')}\n </button>\n\n {expandedSections.contact && (\n <div className=\"space-y-4 animate-in fade-in duration-200\">\n {/* Contact Email */}\n <div>\n <label\n htmlFor=\"contactEmail\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.contactEmail', 'Contact Email')}\n </label>\n <input\n id=\"contactEmail\"\n type=\"email\"\n value={formData.contactEmail}\n onChange={(e) => setFormData({ ...formData, contactEmail: e.target.value })}\n className={inputClassName}\n placeholder=\"contact@product.com\"\n disabled={loading}\n />\n {errors.contactEmail && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.contactEmail}\n </p>\n )}\n </div>\n\n {/* Support Email */}\n <div>\n <label\n htmlFor=\"supportEmail\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.supportEmail', 'Support Email')}\n </label>\n <input\n id=\"supportEmail\"\n type=\"email\"\n value={formData.supportEmail}\n onChange={(e) => setFormData({ ...formData, supportEmail: e.target.value })}\n className={inputClassName}\n placeholder=\"support@product.com\"\n disabled={loading}\n />\n {errors.supportEmail && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.supportEmail}\n </p>\n )}\n </div>\n\n {/* Contact Phone */}\n <div>\n <label\n htmlFor=\"contactPhone\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.contactPhone', 'Contact Phone')}\n </label>\n <input\n id=\"contactPhone\"\n type=\"tel\"\n value={formData.contactPhone}\n onChange={(e) => setFormData({ ...formData, contactPhone: e.target.value })}\n className={inputClassName}\n placeholder=\"+1 (555) 123-4567\"\n disabled={loading}\n />\n {errors.contactPhone && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.contactPhone}\n </p>\n )}\n </div>\n\n {/* Contact Address */}\n <div>\n <label\n htmlFor=\"contactAddress\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.contactAddress', 'Contact Address')}\n </label>\n <textarea\n id=\"contactAddress\"\n value={formData.contactAddress}\n onChange={(e) => setFormData({ ...formData, contactAddress: e.target.value })}\n rows={3}\n className={inputClassName}\n placeholder=\"123 Main St, City, State, ZIP\"\n disabled={loading}\n />\n {errors.contactAddress && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.contactAddress}\n </p>\n )}\n </div>\n </div>\n )}\n </div>\n\n {/* SEO Metadata Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <button\n type=\"button\"\n onClick={() => toggleSection('seo')}\n className={sectionHeaderClassName}\n >\n {expandedSections.seo ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n {tr('products.seoMetadata', 'SEO Metadata')}\n </button>\n\n {expandedSections.seo && (\n <div className=\"space-y-4 animate-in fade-in duration-200\">\n {/* SEO Title */}\n <div>\n <label\n htmlFor=\"seoTitle\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.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=\"Product SEO title\"\n disabled={loading}\n maxLength={100}\n />\n <div className=\"flex justify-between mt-1\">\n {errors.seoTitle ? (\n <p className=\"text-sm text-[var(--color-status-error)]\">{errors.seoTitle}</p>\n ) : (\n <span />\n )}\n <p className=\"text-xs text-text-tertiary\">{formData.seoTitle.length}/100</p>\n </div>\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('products.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 'products.seoDescriptionPlaceholder',\n 'Brief description for search engines'\n )}\n disabled={loading}\n maxLength={300}\n />\n <div className=\"flex justify-between mt-1\">\n {errors.seoDescription ? (\n <p className=\"text-sm text-[var(--color-status-error)]\">\n {errors.seoDescription}\n </p>\n ) : (\n <span />\n )}\n <p className=\"text-xs text-text-tertiary\">{formData.seoDescription.length}/300</p>\n </div>\n </div>\n\n {/* SEO Keywords */}\n <div>\n <label\n htmlFor=\"seoKeywords\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.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 maxLength={200}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'products.seoKeywordsHint',\n 'Comma-separated keywords for search engine optimization.'\n )}\n </p>\n {errors.seoKeywords && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.seoKeywords}\n </p>\n )}\n </div>\n\n {/* OG Image */}\n <div>\n <label htmlFor=\"ogImage\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.ogImageUrl', 'OG Image URL')}\n </label>\n <input\n id=\"ogImage\"\n type=\"url\"\n value={formData.ogImage}\n onChange={(e) => setFormData({ ...formData, ogImage: e.target.value })}\n className={inputClassName}\n placeholder=\"https://example.com/og-image.png\"\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr('products.ogImageHint', 'Open Graph image used when sharing on social media.')}\n </p>\n {errors.ogImage && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.ogImage}</p>\n )}\n </div>\n </div>\n )}\n </div>\n\n {/* App Store Links Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <button\n type=\"button\"\n onClick={() => toggleSection('appStore')}\n className={sectionHeaderClassName}\n >\n {expandedSections.appStore ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n {tr('products.appStoreLinks', 'App Store Links')}\n </button>\n\n {expandedSections.appStore && (\n <div className=\"space-y-4 animate-in fade-in duration-200\">\n {/* Apple App Store URL */}\n <div>\n <label\n htmlFor=\"appStoreUrl\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.appleAppStoreUrl', 'Apple App Store URL')}\n </label>\n <input\n id=\"appStoreUrl\"\n type=\"url\"\n value={formData.appStoreUrl}\n onChange={(e) => setFormData({ ...formData, appStoreUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://apps.apple.com/app/...\"\n disabled={loading}\n />\n {errors.appStoreUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.appStoreUrl}\n </p>\n )}\n </div>\n\n {/* Google Play Store URL */}\n <div>\n <label\n htmlFor=\"playStoreUrl\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.googlePlayStoreUrl', 'Google Play Store URL')}\n </label>\n <input\n id=\"playStoreUrl\"\n type=\"url\"\n value={formData.playStoreUrl}\n onChange={(e) => setFormData({ ...formData, playStoreUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://play.google.com/store/apps/details?id=...\"\n disabled={loading}\n />\n {errors.playStoreUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.playStoreUrl}\n </p>\n )}\n </div>\n </div>\n )}\n </div>\n\n {/* Social Media Links Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <button\n type=\"button\"\n onClick={() => toggleSection('social')}\n className={sectionHeaderClassName}\n >\n {expandedSections.social ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n {tr('products.socialMediaLinks', 'Social Media Links')}\n </button>\n\n {expandedSections.social && (\n <div className=\"space-y-4 animate-in fade-in duration-200\">\n {socialLinks.map((entry, index) => (\n <div key={entry.id} className=\"flex items-start gap-3\">\n <div className=\"flex-1\">\n <label\n htmlFor={`socialPlatform-${index}`}\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.platform', 'Platform')}\n </label>\n <input\n id={`socialPlatform-${index}`}\n type=\"text\"\n value={entry.platform}\n onChange={(e) => updateSocialLink(index, 'platform', e.target.value)}\n className={inputClassName}\n placeholder=\"e.g. twitter\"\n disabled={loading}\n />\n </div>\n <div className=\"flex-[2]\">\n <label\n htmlFor={`socialUrl-${index}`}\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.url', 'URL')}\n </label>\n <input\n id={`socialUrl-${index}`}\n type=\"url\"\n value={entry.url}\n onChange={(e) => updateSocialLink(index, 'url', e.target.value)}\n className={inputClassName}\n placeholder=\"https://twitter.com/yourproduct\"\n disabled={loading}\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeSocialLink(index)}\n disabled={loading}\n className=\"\n mt-7 p-2\n text-text-tertiary\n hover:text-[var(--color-status-error)]\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n title={tr('products.removeSocialLink', 'Remove social link')}\n >\n <X size={16} />\n </button>\n </div>\n ))}\n\n <button\n type=\"button\"\n onClick={addSocialLink}\n disabled={loading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n text-sm font-medium\n text-text-secondary\n border border-dashed border-default\n rounded-lg\n hover:bg-bg-sunken hover:text-text-primary\n transition-all duration-200\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n <Plus size={16} />\n {tr('products.addSocialLink', 'Add Social Link')}\n </button>\n </div>\n )}\n </div>\n\n {/*\n * Resource Links Section\n * Identical shape to \"Social Media Links\" — a free-form list of\n * (resource-key, URL) rows. Surfaces in the website footer\n * \"Resources\" column via the SDK <ResourceLinks/> primitive. Known\n * resource keys the SDK renders today: `docs`, `community`,\n * `careers`, `team`, `companies`. Unknown keys are silently skipped\n * by the SDK, so admins can add new ones before the SDK ships an\n * icon/label for them.\n */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <button\n type=\"button\"\n onClick={() => toggleSection('resources')}\n className={sectionHeaderClassName}\n >\n {expandedSections.resources ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n {tr('products.resourceLinks', 'Resource Links')}\n </button>\n\n {expandedSections.resources && (\n <div className=\"space-y-4 animate-in fade-in duration-200\">\n <p className=\"text-xs text-text-tertiary\">\n {tr(\n 'products.resourceLinksHint',\n 'Footer \"Resources\" column. Known keys: docs, community, careers, team, companies. Unknown keys are ignored by the website until the SDK adds them.'\n )}\n </p>\n\n {resourceLinks.map((entry, index) => (\n <div key={entry.id} className=\"flex items-start gap-3\">\n <div className=\"flex-1\">\n <label\n htmlFor={`resourceKey-${index}`}\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.resource', 'Resource')}\n </label>\n <input\n id={`resourceKey-${index}`}\n type=\"text\"\n value={entry.resource}\n onChange={(e) => updateResourceLink(index, 'resource', e.target.value)}\n className={inputClassName}\n placeholder=\"e.g. docs\"\n disabled={loading}\n />\n </div>\n <div className=\"flex-[2]\">\n <label\n htmlFor={`resourceUrl-${index}`}\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.url', 'URL')}\n </label>\n <input\n id={`resourceUrl-${index}`}\n type=\"url\"\n value={entry.url}\n onChange={(e) => updateResourceLink(index, 'url', e.target.value)}\n className={inputClassName}\n placeholder=\"https://docs.yourproduct.com\"\n disabled={loading}\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeResourceLink(index)}\n disabled={loading}\n className=\"\n mt-7 p-2\n text-text-tertiary\n hover:text-[var(--color-status-error)]\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n title={tr('products.removeResourceLink', 'Remove resource link')}\n >\n <X size={16} />\n </button>\n </div>\n ))}\n\n <button\n type=\"button\"\n onClick={addResourceLink}\n disabled={loading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n text-sm font-medium\n text-text-secondary\n border border-dashed border-default\n rounded-lg\n hover:bg-bg-sunken hover:text-text-primary\n transition-all duration-200\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n <Plus size={16} />\n {tr('products.addResourceLink', 'Add Resource Link')}\n </button>\n </div>\n )}\n </div>\n\n {/* Integrations Section */}\n <div className=\"border border-default rounded-lg overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => toggleSection('integrations')}\n className=\"\n w-full flex items-center gap-2 px-4 py-3\n text-sm font-semibold text-text-primary\n bg-surface hover:bg-bg-sunken\n transition-all duration-200\n \"\n >\n {expandedSections.integrations ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n <Shield size={16} className=\"text-text-secondary\" />\n {tr('products.integrations', 'Integrations')}\n <span className=\"text-xs font-normal text-text-secondary ml-1\">\n {tr('products.recaptcha', '(reCAPTCHA)')}\n </span>\n </button>\n\n {expandedSections.integrations && (\n <div className=\"px-4 pb-4 pt-2 space-y-4 border-t border-border-seam\">\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'products.recaptchaDescription',\n 'reCAPTCHA v2 keys for bot protection on website forms (newsletter, contact). Site key is public, secret key is used for server-side verification only.'\n )}\n </p>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1.5\">\n {tr('products.recaptchaSiteKey', 'reCAPTCHA Site Key')}\n </label>\n <input\n type=\"text\"\n name=\"recaptchaSiteKey\"\n defaultValue={product?.recaptchaSiteKey || ''}\n disabled={loading}\n placeholder=\"6Lxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n className=\"\n w-full px-3 py-2\n bg-[var(--color-bg-input)] text-text-primary\n border border-default rounded-lg\n focus:outline-none focus:ring-2 focus:ring-[var(--color-action-primary-bg)] focus:border-transparent\n disabled:opacity-50\n text-sm font-mono\n transition-all duration-200\n \"\n />\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr(\n 'products.recaptchaSiteKeyHint',\n 'Public key — exposed in frontend. Register at google.com/recaptcha/admin'\n )}\n </p>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1.5\">\n {tr('products.recaptchaSecretKey', 'reCAPTCHA Secret Key')}\n </label>\n <input\n type=\"password\"\n name=\"recaptchaSecretKey\"\n defaultValue=\"\"\n disabled={loading}\n placeholder={tr(\n 'products.enterSecretKeyPlaceholder',\n 'Enter secret key (leave empty to keep existing)'\n )}\n className=\"\n w-full px-3 py-2\n bg-[var(--color-bg-input)] text-text-primary\n border border-default rounded-lg\n focus:outline-none focus:ring-2 focus:ring-[var(--color-action-primary-bg)] focus:border-transparent\n disabled:opacity-50\n text-sm font-mono\n transition-all duration-200\n \"\n />\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr(\n 'products.recaptchaSecretKeyHint',\n 'Secret key — server-side only, never exposed via public API'\n )}\n </p>\n </div>\n </div>\n )}\n </div>\n\n {/* Form Actions */}\n <div className=\"flex gap-3 pt-4 border-t border-border-seam\">\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\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 {product\n ? tr('products.updateProduct', 'Update Product')\n : tr('products.createProduct', 'Create Product')}\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-bg-sunken\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":";;;;;;;;;AAgBA,IAAI,IAAc,GACZ,KAAe,MAAmB,GAAG,EAAO,GAAG,EAAE;AAsBvD,SAAS,EAAgB,GAAqD;AAC5E,KAAI,GAAS,eAAe,OAAO,EAAQ,eAAgB,UAAU;EACnE,IAAM,IAAU,OAAO,QAAQ,EAAQ,YAAY;AACnD,MAAI,EAAQ,SAAS,EACnB,QAAO,EAAQ,KAAK,CAAC,GAAU,QAAU;GAAE,IAAI,EAAY,SAAS;GAAE;GAAU;GAAK,EAAE;;AAG3F,QAAO,EAAE;;AAGX,SAAS,EAAkB,GAAuD;AAChF,KAAI,GAAS,iBAAiB,OAAO,EAAQ,iBAAkB,UAAU;EACvE,IAAM,IAAU,OAAO,QAAQ,EAAQ,cAAc;AACrD,MAAI,EAAQ,SAAS,EACnB,QAAO,EAAQ,KAAK,CAAC,GAAU,QAAU;GAAE,IAAI,EAAY,WAAW;GAAE;GAAU;GAAK,EAAE;;AAG7F,QAAO,EAAE;;AAGX,SAAgB,EAAY,EAAE,YAAS,aAAU,aAAU,cAA6B;CACtF,IAAM,IAAK,GAAO,EAEZ,CAAC,GAAU,KAAe,EAAS;EACvC,MAAM,GAAS,QAAQ;EACvB,MAAM,GAAS,QAAQ;EACvB,aAAa,GAAS,eAAe;EACrC,QAAQ,GAAS,UAAU,EAAc;EACzC,SA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,EAAA,CAAA;MACF;OAEJ;;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,0BAA0B,iBAAiB,GAC9C,EAAG,0BAA0B,iBAAiB,CAC3C;QAET,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,UAAU;KACV,WAAU;eAYT,EAAG,wBAAwB,SAAS;KAC9B,CAAA,CACL;;GACD"}
1
+ {"version":3,"file":"ProductForm.js","names":[],"sources":["../../../../../src/product-management/modules/products/components/ProductForm.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Loader2, ChevronDown, ChevronRight, Plus, X, Shield } from 'lucide-react';\nimport { ZodError } from 'zod';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport type { CreateProductInput, UpdateProductInput, PlatformProduct } from '../types';\nimport { ProductStatus } from '../types';\nimport { createProductSchema, updateProductSchema } from '../schemas';\nimport { TagInput } from '../../../shared/components/input/TagInput';\nimport { MarkdownEditor } from '../../../../shared/components/MarkdownEditor';\n\ninterface SocialLinkEntry {\n /** Stable client-side id so React list keys survive reorder/remove. */\n id: string;\n platform: string;\n url: string;\n}\n\nlet nextEntryId = 0;\nconst makeEntryId = (prefix: string) => `${prefix}-${++nextEntryId}`;\n\n/**\n * Resource-links share the same admin UI shape as social-links — a list of\n * (key, URL) rows the admin can freely add / remove. They're stored in their\n * own JSON column on `Product` so the website SDK can pick them up separately\n * from socials (different footer column, different default behaviour).\n */\ninterface ResourceLinkEntry {\n /** Stable client-side id so React list keys survive reorder/remove. */\n id: string;\n resource: string;\n url: string;\n}\n\ninterface ProductFormProps {\n product?: PlatformProduct | null;\n onSubmit: (data: CreateProductInput | UpdateProductInput) => Promise<void>;\n onCancel: () => void;\n loading?: boolean;\n}\n\nfunction initSocialLinks(product?: PlatformProduct | null): SocialLinkEntry[] {\n if (product?.socialLinks && typeof product.socialLinks === 'object') {\n const entries = Object.entries(product.socialLinks);\n if (entries.length > 0) {\n return entries.map(([platform, url]) => ({ id: makeEntryId('social'), platform, url }));\n }\n }\n return [];\n}\n\nfunction initResourceLinks(product?: PlatformProduct | null): ResourceLinkEntry[] {\n if (product?.resourceLinks && typeof product.resourceLinks === 'object') {\n const entries = Object.entries(product.resourceLinks);\n if (entries.length > 0) {\n return entries.map(([resource, url]) => ({ id: makeEntryId('resource'), resource, url }));\n }\n }\n return [];\n}\n\nexport function ProductForm({ product, onSubmit, onCancel, loading }: ProductFormProps) {\n const tr = useTr();\n\n const [formData, setFormData] = useState({\n name: product?.name || '',\n slug: product?.slug || '',\n description: product?.description || '',\n status: product?.status || ProductStatus.ACTIVE,\n logoUrl: product?.logoUrl || '',\n website: product?.website || '',\n appUrl: product?.appUrl || '',\n docsUrl: product?.docsUrl || '',\n githubUrl: product?.githubUrl || '',\n statusPageUrl: product?.statusPageUrl || '',\n contactEmail: product?.contactEmail || '',\n supportEmail: product?.supportEmail || '',\n contactPhone: product?.contactPhone || '',\n contactAddress: product?.contactAddress || '',\n seoTitle: product?.seoTitle || '',\n seoDescription: product?.seoDescription || '',\n seoKeywords: product?.seoKeywords || '',\n ogImage: product?.ogImage || '',\n appStoreUrl: product?.appStoreUrl || '',\n playStoreUrl: product?.playStoreUrl || '',\n });\n\n const [socialLinks, setSocialLinks] = useState<SocialLinkEntry[]>(() => initSocialLinks(product));\n const [resourceLinks, setResourceLinks] = useState<ResourceLinkEntry[]>(() =>\n initResourceLinks(product)\n );\n const [tags, setTags] = useState<string[]>(product?.tags ?? []);\n\n const [errors, setErrors] = useState<Record<string, string>>({});\n\n const [expandedSections, setExpandedSections] = useState<Record<string, boolean>>({\n contact: false,\n seo: false,\n appStore: false,\n social: false,\n resources: false,\n integrations: false,\n });\n\n const toggleSection = (section: string) => {\n setExpandedSections((prev) => ({ ...prev, [section]: !prev[section] }));\n };\n\n const addSocialLink = () => {\n setSocialLinks((prev) => [...prev, { id: makeEntryId('social'), platform: '', url: '' }]);\n };\n\n const removeSocialLink = (index: number) => {\n setSocialLinks((prev) => prev.filter((_, i) => i !== index));\n };\n\n const updateSocialLink = (index: number, field: 'platform' | 'url', value: string) => {\n setSocialLinks((prev) =>\n prev.map((entry, i) => (i === index ? { ...entry, [field]: value } : entry))\n );\n };\n\n const buildSocialLinksRecord = (): Record<string, string> | undefined => {\n const filtered = socialLinks.filter(\n (entry) => entry.platform.trim() !== '' && entry.url.trim() !== ''\n );\n if (filtered.length === 0) return undefined;\n const record: Record<string, string> = {};\n filtered.forEach((entry) => {\n record[entry.platform.trim()] = entry.url.trim();\n });\n return record;\n };\n\n const addResourceLink = () => {\n setResourceLinks((prev) => [...prev, { id: makeEntryId('resource'), resource: '', url: '' }]);\n };\n\n const removeResourceLink = (index: number) => {\n setResourceLinks((prev) => prev.filter((_, i) => i !== index));\n };\n\n const updateResourceLink = (index: number, field: 'resource' | 'url', value: string) => {\n setResourceLinks((prev) =>\n prev.map((entry, i) => (i === index ? { ...entry, [field]: value } : entry))\n );\n };\n\n const buildResourceLinksRecord = (): Record<string, string> | undefined => {\n const filtered = resourceLinks.filter(\n (entry) => entry.resource.trim() !== '' && entry.url.trim() !== ''\n );\n if (filtered.length === 0) return undefined;\n const record: Record<string, string> = {};\n filtered.forEach((entry) => {\n record[entry.resource.trim()] = entry.url.trim();\n });\n return record;\n };\n\n const validate = () => {\n try {\n const schema = product ? updateProductSchema : createProductSchema;\n const dataToValidate = {\n ...formData,\n socialLinks: buildSocialLinksRecord(),\n resourceLinks: buildResourceLinksRecord(),\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 socialLinksRecord = buildSocialLinksRecord();\n const resourceLinksRecord = buildResourceLinksRecord();\n\n const submitData = product\n ? {\n // Update only changed fields\n name: formData.name !== product.name ? formData.name : undefined,\n description:\n formData.description !== product.description ? formData.description : undefined,\n status: formData.status !== product.status ? formData.status : undefined,\n logoUrl: formData.logoUrl !== product.logoUrl ? formData.logoUrl : undefined,\n website: formData.website !== product.website ? formData.website : undefined,\n appUrl: formData.appUrl !== product.appUrl ? formData.appUrl : undefined,\n docsUrl: formData.docsUrl !== product.docsUrl ? formData.docsUrl : undefined,\n githubUrl: formData.githubUrl !== product.githubUrl ? formData.githubUrl : undefined,\n statusPageUrl:\n formData.statusPageUrl !== product.statusPageUrl ? formData.statusPageUrl : undefined,\n contactEmail:\n formData.contactEmail !== (product.contactEmail || '')\n ? formData.contactEmail\n : undefined,\n supportEmail:\n formData.supportEmail !== (product.supportEmail || '')\n ? formData.supportEmail\n : undefined,\n contactPhone:\n formData.contactPhone !== (product.contactPhone || '')\n ? formData.contactPhone\n : undefined,\n contactAddress:\n formData.contactAddress !== (product.contactAddress || '')\n ? formData.contactAddress\n : undefined,\n seoTitle: formData.seoTitle !== (product.seoTitle || '') ? formData.seoTitle : undefined,\n seoDescription:\n formData.seoDescription !== (product.seoDescription || '')\n ? formData.seoDescription\n : undefined,\n seoKeywords:\n formData.seoKeywords !== (product.seoKeywords || '') ? formData.seoKeywords : undefined,\n ogImage: formData.ogImage !== (product.ogImage || '') ? formData.ogImage : undefined,\n appStoreUrl:\n formData.appStoreUrl !== (product.appStoreUrl || '') ? formData.appStoreUrl : undefined,\n playStoreUrl:\n formData.playStoreUrl !== (product.playStoreUrl || '')\n ? formData.playStoreUrl\n : undefined,\n socialLinks: socialLinksRecord,\n resourceLinks: resourceLinksRecord,\n tags,\n // reCAPTCHA keys from Integrations section\n ...(() => {\n const form = e.target as HTMLFormElement;\n const siteKey = (form.elements.namedItem('recaptchaSiteKey') as HTMLInputElement)\n ?.value;\n const secretKey = (form.elements.namedItem('recaptchaSecretKey') as HTMLInputElement)\n ?.value;\n const result: Record<string, string | undefined> = {};\n if (siteKey && siteKey !== (product.recaptchaSiteKey || ''))\n result.recaptchaSiteKey = siteKey;\n if (secretKey) result.recaptchaSecretKey = secretKey;\n return result;\n })(),\n }\n : {\n // Create with all fields\n name: formData.name,\n slug: formData.slug,\n description: formData.description || undefined,\n status: formData.status,\n logoUrl: formData.logoUrl || undefined,\n website: formData.website || undefined,\n appUrl: formData.appUrl || undefined,\n docsUrl: formData.docsUrl || undefined,\n githubUrl: formData.githubUrl || undefined,\n statusPageUrl: formData.statusPageUrl || undefined,\n contactEmail: formData.contactEmail || undefined,\n supportEmail: formData.supportEmail || undefined,\n contactPhone: formData.contactPhone || undefined,\n contactAddress: formData.contactAddress || undefined,\n seoTitle: formData.seoTitle || undefined,\n seoDescription: formData.seoDescription || undefined,\n seoKeywords: formData.seoKeywords || undefined,\n ogImage: formData.ogImage || undefined,\n appStoreUrl: formData.appStoreUrl || undefined,\n playStoreUrl: formData.playStoreUrl || undefined,\n socialLinks: socialLinksRecord,\n resourceLinks: resourceLinksRecord,\n tags,\n };\n\n await onSubmit(submitData);\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-bg-sunken disabled:cursor-not-allowed\n transition-all duration-200\n `;\n\n const sectionHeaderClassName = `\n flex items-center gap-2 w-full text-left\n text-sm font-semibold text-text-secondary uppercase tracking-wider\n cursor-pointer hover:text-text-primary transition-colors duration-200\n `;\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-6 animate-in fade-in duration-200\">\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('products.basicInformation', 'Basic Information')}\n </h3>\n\n {/* Name */}\n <div>\n <label htmlFor=\"name\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.productName', 'Product Name')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"name\"\n type=\"text\"\n value={formData.name}\n onChange={(e) => setFormData({ ...formData, name: e.target.value })}\n className={inputClassName}\n placeholder={tr('products.enterProductName', 'Enter product name')}\n disabled={loading}\n required\n />\n {errors.name && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.name}</p>\n )}\n </div>\n\n {/* Slug */}\n <div>\n <label htmlFor=\"slug\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.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({ ...formData, slug: e.target.value.toLowerCase().replace(/\\s+/g, '-') })\n }\n className={inputClassName}\n placeholder=\"product-slug\"\n disabled={loading || !!product}\n required={!product}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'products.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 {/* Description */}\n <MarkdownEditor\n id=\"description\"\n label={tr('products.description', 'Description')}\n value={formData.description}\n onChange={(value) => setFormData({ ...formData, description: value })}\n placeholder={tr('products.enterProductDescription', 'Enter product description')}\n disabled={loading}\n rows={4}\n minHeight={120}\n />\n\n {/* Status */}\n <div>\n <label htmlFor=\"status\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.status', 'Status')}\n </label>\n <select\n id=\"status\"\n value={formData.status}\n onChange={(e) =>\n setFormData({\n ...formData,\n status: e.target.value as (typeof ProductStatus)[keyof typeof ProductStatus],\n })\n }\n className={inputClassName}\n disabled={loading}\n >\n <option value={ProductStatus.ACTIVE}>{tr('products.statusActive', 'Active')}</option>\n <option value={ProductStatus.DRAFT}>{tr('products.statusDraft', 'Draft')}</option>\n <option value={ProductStatus.WAITLIST}>\n {tr('products.statusWaitlist', 'Waitlist')}\n </option>\n <option value={ProductStatus.COMING_SOON}>\n {tr('products.statusComingSoon', 'Coming Soon')}\n </option>\n </select>\n </div>\n\n {/* Tags */}\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.tags', 'Tags')}\n </label>\n <TagInput value={tags} onChange={setTags} disabled={loading} />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr('products.tagsHint', 'Press Enter or comma to add a tag.')}\n </p>\n </div>\n </div>\n\n {/* URLs Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('products.urlsAndLinks', 'URLs & Links')}\n </h3>\n\n {/* Logo URL */}\n <div>\n <label htmlFor=\"logoUrl\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.logoUrl', 'Logo URL')}\n </label>\n <input\n id=\"logoUrl\"\n type=\"url\"\n value={formData.logoUrl}\n onChange={(e) => setFormData({ ...formData, logoUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://example.com/logo.png\"\n disabled={loading}\n />\n {errors.logoUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.logoUrl}</p>\n )}\n </div>\n\n {/* App URL - Important for ProductSwitcher */}\n <div>\n <label htmlFor=\"appUrl\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.appUrl', 'App URL')}{' '}\n <span className=\"text-[var(--color-status-warning)]\">\n {tr('products.requiredForProductSwitcher', '(Required for product switcher)')}\n </span>\n </label>\n <input\n id=\"appUrl\"\n type=\"url\"\n value={formData.appUrl}\n onChange={(e) => setFormData({ ...formData, appUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://app.product.com/\"\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'products.appUrlHint',\n \"The main application URL. Products without an App URL won't appear in the product switcher.\"\n )}\n </p>\n {errors.appUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.appUrl}</p>\n )}\n </div>\n\n {/* Website URL */}\n <div>\n <label htmlFor=\"website\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.websiteUrl', 'Website URL')}\n </label>\n <input\n id=\"website\"\n type=\"url\"\n value={formData.website}\n onChange={(e) => setFormData({ ...formData, website: e.target.value })}\n className={inputClassName}\n placeholder=\"https://product.com/\"\n disabled={loading}\n />\n {errors.website && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.website}</p>\n )}\n </div>\n\n {/* Docs URL */}\n <div>\n <label htmlFor=\"docsUrl\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.documentationUrl', 'Documentation URL')}\n </label>\n <input\n id=\"docsUrl\"\n type=\"url\"\n value={formData.docsUrl}\n onChange={(e) => setFormData({ ...formData, docsUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://docs.product.com/\"\n disabled={loading}\n />\n {errors.docsUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.docsUrl}</p>\n )}\n </div>\n\n {/* GitHub URL */}\n <div>\n <label htmlFor=\"githubUrl\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.githubUrl', 'GitHub URL')}\n </label>\n <input\n id=\"githubUrl\"\n type=\"url\"\n value={formData.githubUrl}\n onChange={(e) => setFormData({ ...formData, githubUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://github.com/org/repo\"\n disabled={loading}\n />\n {errors.githubUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.githubUrl}</p>\n )}\n </div>\n\n {/* Status Page URL */}\n <div>\n <label\n htmlFor=\"statusPageUrl\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.statusPageUrl', 'Status Page URL')}\n </label>\n <input\n id=\"statusPageUrl\"\n type=\"url\"\n value={formData.statusPageUrl}\n onChange={(e) => setFormData({ ...formData, statusPageUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://status.product.com/\"\n disabled={loading}\n />\n {errors.statusPageUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.statusPageUrl}</p>\n )}\n </div>\n </div>\n\n {/* Contact Information Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <button\n type=\"button\"\n onClick={() => toggleSection('contact')}\n className={sectionHeaderClassName}\n >\n {expandedSections.contact ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n {tr('products.contactInformation', 'Contact Information')}\n </button>\n\n {expandedSections.contact && (\n <div className=\"space-y-4 animate-in fade-in duration-200\">\n {/* Contact Email */}\n <div>\n <label\n htmlFor=\"contactEmail\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.contactEmail', 'Contact Email')}\n </label>\n <input\n id=\"contactEmail\"\n type=\"email\"\n value={formData.contactEmail}\n onChange={(e) => setFormData({ ...formData, contactEmail: e.target.value })}\n className={inputClassName}\n placeholder=\"contact@product.com\"\n disabled={loading}\n />\n {errors.contactEmail && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.contactEmail}\n </p>\n )}\n </div>\n\n {/* Support Email */}\n <div>\n <label\n htmlFor=\"supportEmail\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.supportEmail', 'Support Email')}\n </label>\n <input\n id=\"supportEmail\"\n type=\"email\"\n value={formData.supportEmail}\n onChange={(e) => setFormData({ ...formData, supportEmail: e.target.value })}\n className={inputClassName}\n placeholder=\"support@product.com\"\n disabled={loading}\n />\n {errors.supportEmail && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.supportEmail}\n </p>\n )}\n </div>\n\n {/* Contact Phone */}\n <div>\n <label\n htmlFor=\"contactPhone\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.contactPhone', 'Contact Phone')}\n </label>\n <input\n id=\"contactPhone\"\n type=\"tel\"\n value={formData.contactPhone}\n onChange={(e) => setFormData({ ...formData, contactPhone: e.target.value })}\n className={inputClassName}\n placeholder=\"+1 (555) 123-4567\"\n disabled={loading}\n />\n {errors.contactPhone && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.contactPhone}\n </p>\n )}\n </div>\n\n {/* Contact Address */}\n <div>\n <label\n htmlFor=\"contactAddress\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.contactAddress', 'Contact Address')}\n </label>\n <textarea\n id=\"contactAddress\"\n value={formData.contactAddress}\n onChange={(e) => setFormData({ ...formData, contactAddress: e.target.value })}\n rows={3}\n className={inputClassName}\n placeholder=\"123 Main St, City, State, ZIP\"\n disabled={loading}\n />\n {errors.contactAddress && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.contactAddress}\n </p>\n )}\n </div>\n </div>\n )}\n </div>\n\n {/* SEO Metadata Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <button\n type=\"button\"\n onClick={() => toggleSection('seo')}\n className={sectionHeaderClassName}\n >\n {expandedSections.seo ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n {tr('products.seoMetadata', 'SEO Metadata')}\n </button>\n\n {expandedSections.seo && (\n <div className=\"space-y-4 animate-in fade-in duration-200\">\n {/* SEO Title */}\n <div>\n <label\n htmlFor=\"seoTitle\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.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=\"Product SEO title\"\n disabled={loading}\n maxLength={100}\n />\n <div className=\"flex justify-between mt-1\">\n {errors.seoTitle ? (\n <p className=\"text-sm text-[var(--color-status-error)]\">{errors.seoTitle}</p>\n ) : (\n <span />\n )}\n <p className=\"text-xs text-text-tertiary\">{formData.seoTitle.length}/100</p>\n </div>\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('products.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 'products.seoDescriptionPlaceholder',\n 'Brief description for search engines'\n )}\n disabled={loading}\n maxLength={300}\n />\n <div className=\"flex justify-between mt-1\">\n {errors.seoDescription ? (\n <p className=\"text-sm text-[var(--color-status-error)]\">\n {errors.seoDescription}\n </p>\n ) : (\n <span />\n )}\n <p className=\"text-xs text-text-tertiary\">{formData.seoDescription.length}/300</p>\n </div>\n </div>\n\n {/* SEO Keywords */}\n <div>\n <label\n htmlFor=\"seoKeywords\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.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 maxLength={200}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'products.seoKeywordsHint',\n 'Comma-separated keywords for search engine optimization.'\n )}\n </p>\n {errors.seoKeywords && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.seoKeywords}\n </p>\n )}\n </div>\n\n {/* OG Image */}\n <div>\n <label htmlFor=\"ogImage\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('products.ogImageUrl', 'OG Image URL')}\n </label>\n <input\n id=\"ogImage\"\n type=\"url\"\n value={formData.ogImage}\n onChange={(e) => setFormData({ ...formData, ogImage: e.target.value })}\n className={inputClassName}\n placeholder=\"https://example.com/og-image.png\"\n disabled={loading}\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr('products.ogImageHint', 'Open Graph image used when sharing on social media.')}\n </p>\n {errors.ogImage && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.ogImage}</p>\n )}\n </div>\n </div>\n )}\n </div>\n\n {/* App Store Links Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <button\n type=\"button\"\n onClick={() => toggleSection('appStore')}\n className={sectionHeaderClassName}\n >\n {expandedSections.appStore ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n {tr('products.appStoreLinks', 'App Store Links')}\n </button>\n\n {expandedSections.appStore && (\n <div className=\"space-y-4 animate-in fade-in duration-200\">\n {/* Apple App Store URL */}\n <div>\n <label\n htmlFor=\"appStoreUrl\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.appleAppStoreUrl', 'Apple App Store URL')}\n </label>\n <input\n id=\"appStoreUrl\"\n type=\"url\"\n value={formData.appStoreUrl}\n onChange={(e) => setFormData({ ...formData, appStoreUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://apps.apple.com/app/...\"\n disabled={loading}\n />\n {errors.appStoreUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.appStoreUrl}\n </p>\n )}\n </div>\n\n {/* Google Play Store URL */}\n <div>\n <label\n htmlFor=\"playStoreUrl\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.googlePlayStoreUrl', 'Google Play Store URL')}\n </label>\n <input\n id=\"playStoreUrl\"\n type=\"url\"\n value={formData.playStoreUrl}\n onChange={(e) => setFormData({ ...formData, playStoreUrl: e.target.value })}\n className={inputClassName}\n placeholder=\"https://play.google.com/store/apps/details?id=...\"\n disabled={loading}\n />\n {errors.playStoreUrl && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">\n {errors.playStoreUrl}\n </p>\n )}\n </div>\n </div>\n )}\n </div>\n\n {/* Social Media Links Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <button\n type=\"button\"\n onClick={() => toggleSection('social')}\n className={sectionHeaderClassName}\n >\n {expandedSections.social ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n {tr('products.socialMediaLinks', 'Social Media Links')}\n </button>\n\n {expandedSections.social && (\n <div className=\"space-y-4 animate-in fade-in duration-200\">\n {socialLinks.map((entry, index) => (\n <div key={entry.id} className=\"flex items-start gap-3\">\n <div className=\"flex-1\">\n <label\n htmlFor={`socialPlatform-${index}`}\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.platform', 'Platform')}\n </label>\n <input\n id={`socialPlatform-${index}`}\n type=\"text\"\n value={entry.platform}\n onChange={(e) => updateSocialLink(index, 'platform', e.target.value)}\n className={inputClassName}\n placeholder=\"e.g. twitter\"\n disabled={loading}\n />\n </div>\n <div className=\"flex-[2]\">\n <label\n htmlFor={`socialUrl-${index}`}\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.url', 'URL')}\n </label>\n <input\n id={`socialUrl-${index}`}\n type=\"url\"\n value={entry.url}\n onChange={(e) => updateSocialLink(index, 'url', e.target.value)}\n className={inputClassName}\n placeholder=\"https://twitter.com/yourproduct\"\n disabled={loading}\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeSocialLink(index)}\n disabled={loading}\n className=\"\n mt-7 p-2\n text-text-tertiary\n hover:text-[var(--color-status-error)]\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n title={tr('products.removeSocialLink', 'Remove social link')}\n >\n <X size={16} />\n </button>\n </div>\n ))}\n\n <button\n type=\"button\"\n onClick={addSocialLink}\n disabled={loading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n text-sm font-medium\n text-text-secondary\n border border-dashed border-default\n rounded-lg\n hover:bg-bg-sunken hover:text-text-primary\n transition-all duration-200\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n <Plus size={16} />\n {tr('products.addSocialLink', 'Add Social Link')}\n </button>\n </div>\n )}\n </div>\n\n {/*\n * Resource Links Section\n * Identical shape to \"Social Media Links\" — a free-form list of\n * (resource-key, URL) rows. Surfaces in the website footer\n * \"Resources\" column via the SDK <ResourceLinks/> primitive. Known\n * resource keys the SDK renders today: `docs`, `community`,\n * `careers`, `team`, `companies`. Unknown keys are silently skipped\n * by the SDK, so admins can add new ones before the SDK ships an\n * icon/label for them.\n */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <button\n type=\"button\"\n onClick={() => toggleSection('resources')}\n className={sectionHeaderClassName}\n >\n {expandedSections.resources ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n {tr('products.resourceLinks', 'Resource Links')}\n </button>\n\n {expandedSections.resources && (\n <div className=\"space-y-4 animate-in fade-in duration-200\">\n <p className=\"text-xs text-text-tertiary\">\n {tr(\n 'products.resourceLinksHint',\n 'Footer \"Resources\" column. Known keys: docs, community, careers, team, companies. Unknown keys are ignored by the website until the SDK adds them.'\n )}\n </p>\n\n {resourceLinks.map((entry, index) => (\n <div key={entry.id} className=\"flex items-start gap-3\">\n <div className=\"flex-1\">\n <label\n htmlFor={`resourceKey-${index}`}\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.resource', 'Resource')}\n </label>\n <input\n id={`resourceKey-${index}`}\n type=\"text\"\n value={entry.resource}\n onChange={(e) => updateResourceLink(index, 'resource', e.target.value)}\n className={inputClassName}\n placeholder=\"e.g. docs\"\n disabled={loading}\n />\n </div>\n <div className=\"flex-[2]\">\n <label\n htmlFor={`resourceUrl-${index}`}\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('products.url', 'URL')}\n </label>\n <input\n id={`resourceUrl-${index}`}\n type=\"url\"\n value={entry.url}\n onChange={(e) => updateResourceLink(index, 'url', e.target.value)}\n className={inputClassName}\n placeholder=\"https://docs.yourproduct.com\"\n disabled={loading}\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeResourceLink(index)}\n disabled={loading}\n className=\"\n mt-7 p-2\n text-text-tertiary\n hover:text-[var(--color-status-error)]\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n title={tr('products.removeResourceLink', 'Remove resource link')}\n >\n <X size={16} />\n </button>\n </div>\n ))}\n\n <button\n type=\"button\"\n onClick={addResourceLink}\n disabled={loading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n text-sm font-medium\n text-text-secondary\n border border-dashed border-default\n rounded-lg\n hover:bg-bg-sunken hover:text-text-primary\n transition-all duration-200\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n <Plus size={16} />\n {tr('products.addResourceLink', 'Add Resource Link')}\n </button>\n </div>\n )}\n </div>\n\n {/* Integrations Section */}\n <div className=\"border border-default rounded-lg overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => toggleSection('integrations')}\n className=\"\n w-full flex items-center gap-2 px-4 py-3\n text-sm font-semibold text-text-primary\n bg-surface hover:bg-bg-sunken\n transition-all duration-200\n \"\n >\n {expandedSections.integrations ? <ChevronDown size={16} /> : <ChevronRight size={16} />}\n <Shield size={16} className=\"text-text-secondary\" />\n {tr('products.integrations', 'Integrations')}\n <span className=\"text-xs font-normal text-text-secondary ml-1\">\n {tr('products.recaptcha', '(reCAPTCHA)')}\n </span>\n </button>\n\n {expandedSections.integrations && (\n <div className=\"px-4 pb-4 pt-2 space-y-4 border-t border-border-seam\">\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'products.recaptchaDescription',\n 'reCAPTCHA v2 keys for bot protection on website forms (newsletter, contact). Site key is public, secret key is used for server-side verification only.'\n )}\n </p>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1.5\">\n {tr('products.recaptchaSiteKey', 'reCAPTCHA Site Key')}\n </label>\n <input\n type=\"text\"\n name=\"recaptchaSiteKey\"\n defaultValue={product?.recaptchaSiteKey || ''}\n disabled={loading}\n placeholder=\"6Lxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n className=\"\n w-full px-3 py-2\n bg-[var(--color-bg-input)] text-text-primary\n border border-default rounded-lg\n focus:outline-none focus:ring-2 focus:ring-[var(--color-action-primary-bg)] focus:border-transparent\n disabled:opacity-50\n text-sm font-mono\n transition-all duration-200\n \"\n />\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr(\n 'products.recaptchaSiteKeyHint',\n 'Public key — exposed in frontend. Register at google.com/recaptcha/admin'\n )}\n </p>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1.5\">\n {tr('products.recaptchaSecretKey', 'reCAPTCHA Secret Key')}\n </label>\n <input\n type=\"password\"\n name=\"recaptchaSecretKey\"\n defaultValue=\"\"\n disabled={loading}\n placeholder={tr(\n 'products.enterSecretKeyPlaceholder',\n 'Enter secret key (leave empty to keep existing)'\n )}\n className=\"\n w-full px-3 py-2\n bg-[var(--color-bg-input)] text-text-primary\n border border-default rounded-lg\n focus:outline-none focus:ring-2 focus:ring-[var(--color-action-primary-bg)] focus:border-transparent\n disabled:opacity-50\n text-sm font-mono\n transition-all duration-200\n \"\n />\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr(\n 'products.recaptchaSecretKeyHint',\n 'Secret key — server-side only, never exposed via public API'\n )}\n </p>\n </div>\n </div>\n )}\n </div>\n\n {/* Form Actions */}\n <div className=\"flex gap-3 pt-4 border-t border-border-seam\">\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\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 {product\n ? tr('products.updateProduct', 'Update Product')\n : tr('products.createProduct', 'Create Product')}\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-bg-sunken\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":";;;;;;;;;;AAiBA,IAAI,IAAc,GACZ,KAAe,MAAmB,GAAG,EAAO,GAAG,EAAE;AAsBvD,SAAS,EAAgB,GAAqD;AAC5E,KAAI,GAAS,eAAe,OAAO,EAAQ,eAAgB,UAAU;EACnE,IAAM,IAAU,OAAO,QAAQ,EAAQ,YAAY;AACnD,MAAI,EAAQ,SAAS,EACnB,QAAO,EAAQ,KAAK,CAAC,GAAU,QAAU;GAAE,IAAI,EAAY,SAAS;GAAE;GAAU;GAAK,EAAE;;AAG3F,QAAO,EAAE;;AAGX,SAAS,EAAkB,GAAuD;AAChF,KAAI,GAAS,iBAAiB,OAAO,EAAQ,iBAAkB,UAAU;EACvE,IAAM,IAAU,OAAO,QAAQ,EAAQ,cAAc;AACrD,MAAI,EAAQ,SAAS,EACnB,QAAO,EAAQ,KAAK,CAAC,GAAU,QAAU;GAAE,IAAI,EAAY,WAAW;GAAE;GAAU;GAAK,EAAE;;AAG7F,QAAO,EAAE;;AAGX,SAAgB,EAAY,EAAE,YAAS,aAAU,aAAU,cAA6B;CACtF,IAAM,IAAK,GAAO,EAEZ,CAAC,GAAU,KAAe,EAAS;EACvC,MAAM,GAAS,QAAQ;EACvB,MAAM,GAAS,QAAQ;EACvB,aAAa,GAAS,eAAe;EACrC,QAAQ,GAAS,UAAU,EAAc;EACzC,SAAS,GAAS,WAAW;EAC7B,SAAS,GAAS,WAAW;EAC7B,QAAQ,GAAS,UAAU;EAC3B,SAAS,GAAS,WAAW;EAC7B,WAAW,GAAS,aAAa;EACjC,eAAe,GAAS,iBAAiB;EACzC,cAAc,GAAS,gBAAgB;EACvC,cAAc,GAAS,gBAAgB;EACvC,cAAc,GAAS,gBAAgB;EACvC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AS;KAC9B,CAAA,CACL;;GACD"}
@@ -33,9 +33,22 @@ function l(e) {
33
33
  refetch: a
34
34
  };
35
35
  }
36
- var u = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
37
- function d(e) {
38
- let t = u.test(e), n = i({
36
+ function u(e) {
37
+ let { data: t, loading: n, error: i, refetch: a } = r({
38
+ variables: { slug: e },
39
+ skip: !e,
40
+ fetchPolicy: "cache-and-network"
41
+ });
42
+ return {
43
+ product: t?.platformProductBySlug,
44
+ loading: n,
45
+ error: i,
46
+ refetch: a
47
+ };
48
+ }
49
+ var d = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
50
+ function f(e) {
51
+ let t = d.test(e), n = i({
39
52
  variables: { id: e },
40
53
  skip: !e || !t,
41
54
  fetchPolicy: "cache-and-network"
@@ -53,7 +66,7 @@ function d(e) {
53
66
  }
54
67
  };
55
68
  }
56
- function f() {
69
+ function p() {
57
70
  let [n, { data: r, loading: i, error: a }] = t({ refetchQueries: [e] }), o = s("tenant.product.created", { component: "microfe-product" });
58
71
  return {
59
72
  createProduct: async (e) => {
@@ -73,7 +86,7 @@ function f() {
73
86
  error: a
74
87
  };
75
88
  }
76
- function p() {
89
+ function m() {
77
90
  let [e, { data: t, loading: n, error: r }] = o(), i = s("tenant.product.updated", { component: "microfe-product" });
78
91
  return {
79
92
  updateProduct: async (t, n) => {
@@ -95,7 +108,7 @@ function p() {
95
108
  error: r
96
109
  };
97
110
  }
98
- function m() {
111
+ function h() {
99
112
  let [t, { data: r, loading: i, error: a }] = n({ refetchQueries: [e] }), o = s("tenant.product.deleted", { component: "microfe-product" });
100
113
  return {
101
114
  deleteProduct: async (e) => {
@@ -108,6 +121,6 @@ function m() {
108
121
  };
109
122
  }
110
123
  //#endregion
111
- export { f as useCreateProduct, m as useDeleteProduct, l as useProduct, d as useProductByIdOrSlug, c as useProducts, p as useUpdateProduct };
124
+ export { p as useCreateProduct, h as useDeleteProduct, l as useProduct, f as useProductByIdOrSlug, u as useProductBySlug, c as useProducts, m as useUpdateProduct };
112
125
 
113
126
  //# sourceMappingURL=useProducts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useProducts.js","names":[],"sources":["../../../../../src/product-management/modules/products/hooks/useProducts.ts"],"sourcesContent":["import { useEventEmitter } from '@burdenoff/fe-libs/shared/events';\n\nimport {\n useGetPlatformProductsQuery,\n useGetPlatformProductQuery,\n useGetPlatformProductBySlugQuery,\n useCreatePlatformProductMutation,\n useUpdatePlatformProductMutation,\n useDeletePlatformProductMutation,\n GetPlatformProductsDocument,\n} from '../../../../generated/global-operations';\nimport type {\n PlatformProduct,\n ProductFilterInput,\n CreateProductInput,\n UpdateProductInput,\n} from '../types';\n\n/**\n * Hook to fetch products with filtering and pagination\n */\nexport function useProducts(\n filter?: ProductFilterInput,\n options?: { limit?: number; offset?: number }\n) {\n const { data, loading, error, refetch, fetchMore } = useGetPlatformProductsQuery({\n variables: {\n filter,\n limit: options?.limit || 50,\n offset: options?.offset || 0,\n },\n fetchPolicy: 'cache-and-network',\n });\n\n return {\n products: (data?.platformProducts?.items || []) as PlatformProduct[],\n total: data?.platformProducts?.total || 0,\n hasMore: data?.platformProducts?.hasMore || false,\n loading,\n error,\n refetch,\n fetchMore,\n };\n}\n\n/**\n * Hook to fetch a single product by ID\n */\nexport function useProduct(id: string) {\n const { data, loading, error, refetch } = useGetPlatformProductQuery({\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\n return {\n product: data?.platformProduct as PlatformProduct | undefined,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Hook to fetch a product by slug\n */\nexport function useProductBySlug(slug: string) {\n const { data, loading, error, refetch } = useGetPlatformProductBySlugQuery({\n variables: { slug },\n skip: !slug,\n fetchPolicy: 'cache-and-network',\n });\n\n return {\n product: data?.platformProductBySlug as PlatformProduct | undefined,\n loading,\n error,\n refetch,\n };\n}\n\n/** Match the canonical UUID-v4 shape (8-4-4-4-12 hex). */\nconst UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * Hook to fetch a product by either ID (UUID) or slug. Routes like\n * `/products/:id` historically receive only UUIDs, but users hand-type or\n * follow external links to `/products/<slug>` and expect to land on the\n * detail page (M22-B2). Detect the shape and pick the right query.\n *\n * Note: slugs are allowed to match the UUID format\n * (lowercase letters/digits/hyphens), so a UUID-shaped slug would\n * normally be treated as an ID and miss the bySlug resolver. To\n * avoid that regression, when the ID query completes with no\n * product, we fall back to the slug query.\n */\nexport function useProductByIdOrSlug(idOrSlug: string) {\n const isUuid = UUID_RE.test(idOrSlug);\n\n const byId = useGetPlatformProductQuery({\n variables: { id: idOrSlug },\n skip: !idOrSlug || !isUuid,\n fetchPolicy: 'cache-and-network',\n });\n\n // UUID-shaped param: only fall back to slug after the ID query finishes\n // and returns no product. Non-UUID param: always query by slug.\n const idQueryReturnedNothing = isUuid && !byId.loading && !byId.data?.platformProduct;\n\n const bySlug = useGetPlatformProductBySlugQuery({\n variables: { slug: idOrSlug },\n skip: !idOrSlug || (isUuid && !idQueryReturnedNothing),\n fetchPolicy: 'cache-and-network',\n });\n\n const byIdProduct = byId.data?.platformProduct as PlatformProduct | undefined;\n const bySlugProduct = bySlug.data?.platformProductBySlug as PlatformProduct | undefined;\n\n // Prefer the ID match; fall back to slug when ID lookup misses.\n const product = byIdProduct ?? bySlugProduct;\n const loading = byId.loading || bySlug.loading;\n const error = byIdProduct ? byId.error : (bySlug.error ?? byId.error);\n // refetch both so a manual retry covers either query.\n const refetch = async () => {\n await Promise.all([byId.refetch(), bySlug.refetch()]);\n };\n\n return { product, loading, error, refetch };\n}\n\n/**\n * Hook to create a new product. Emits `tenant.product.created` on success.\n */\nexport function useCreateProduct() {\n const [createProductMutation, { data, loading, error }] = useCreatePlatformProductMutation({\n refetchQueries: [GetPlatformProductsDocument],\n });\n const emit = useEventEmitter('tenant.product.created', { component: 'microfe-product' });\n\n return {\n createProduct: async (input: CreateProductInput) => {\n const result = await createProductMutation({ variables: { input } });\n const product = result.data?.createPlatformProduct;\n if (product) {\n emit({\n resourceId: product.id,\n resourceSlug: product.slug,\n metadata: { name: product.name, status: product.status },\n });\n }\n return result;\n },\n createPlatformProduct: data?.createPlatformProduct as PlatformProduct | undefined,\n data: data?.createPlatformProduct as PlatformProduct | undefined,\n loading,\n error,\n };\n}\n\n/**\n * Hook to update a product. Emits `tenant.product.updated` on success.\n */\nexport function useUpdateProduct() {\n const [updateProductMutation, { data, loading, error }] = useUpdatePlatformProductMutation();\n const emit = useEventEmitter('tenant.product.updated', { component: 'microfe-product' });\n\n return {\n updateProduct: async (id: string, input: UpdateProductInput) => {\n const result = await updateProductMutation({ variables: { id, input } });\n const product = result.data?.updatePlatformProduct;\n if (product) {\n emit({\n resourceId: product.id,\n resourceSlug: product.slug,\n metadata: { name: product.name, status: product.status },\n });\n }\n return result;\n },\n data: data?.updatePlatformProduct as PlatformProduct | undefined,\n loading,\n error,\n };\n}\n\n/**\n * Hook to delete a product. Emits `tenant.product.deleted` on success.\n */\nexport function useDeleteProduct() {\n const [deleteProductMutation, { data, loading, error }] = useDeletePlatformProductMutation({\n refetchQueries: [GetPlatformProductsDocument],\n });\n const emit = useEventEmitter('tenant.product.deleted', { component: 'microfe-product' });\n\n return {\n deleteProduct: async (id: string) => {\n const result = await deleteProductMutation({ variables: { id } });\n if (result.data?.deletePlatformProduct) {\n emit({ resourceId: id });\n }\n return result;\n },\n data: data?.deletePlatformProduct,\n loading,\n error,\n };\n}\n\n/**\n * Hook to update product status to ACTIVE\n */\nexport function useActivateProduct() {\n const { updateProduct, loading, error } = useUpdateProduct();\n\n return {\n activateProduct: (id: string) => updateProduct(id, { status: 'ACTIVE' }),\n loading,\n error,\n };\n}\n\n/**\n * Hook to archive a product by setting it to DRAFT.\n * Backend schema does not expose a DEPRECATED status; DRAFT is used to hide a product from public listings.\n */\nexport function useArchiveProduct() {\n const { updateProduct, loading, error } = useUpdateProduct();\n\n return {\n archiveProduct: (id: string) => updateProduct(id, { status: 'DRAFT' }),\n loading,\n error,\n };\n}\n"],"mappings":";;;AAqBA,SAAgB,EACd,GACA,GACA;CACA,IAAM,EAAE,SAAM,YAAS,UAAO,YAAS,iBAAc,EAA4B;EAC/E,WAAW;GACT;GACA,OAAO,GAAS,SAAS;GACzB,QAAQ,GAAS,UAAU;GAC5B;EACD,aAAa;EACd,CAAC;AAEF,QAAO;EACL,UAAW,GAAM,kBAAkB,SAAS,EAAE;EAC9C,OAAO,GAAM,kBAAkB,SAAS;EACxC,SAAS,GAAM,kBAAkB,WAAW;EAC5C;EACA;EACA;EACA;EACD;;AAMH,SAAgB,EAAW,GAAY;CACrC,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAA2B;EACnE,WAAW,EAAE,OAAI;EACjB,MAAM,CAAC;EACP,aAAa;EACd,CAAC;AAEF,QAAO;EACL,SAAS,GAAM;EACf;EACA;EACA;EACD;;AAsBH,IAAM,IAAU;AAchB,SAAgB,EAAqB,GAAkB;CACrD,IAAM,IAAS,EAAQ,KAAK,EAAS,EAE/B,IAAO,EAA2B;EACtC,WAAW,EAAE,IAAI,GAAU;EAC3B,MAAM,CAAC,KAAY,CAAC;EACpB,aAAa;EACd,CAAC,EAII,IAAyB,KAAU,CAAC,EAAK,WAAW,CAAC,EAAK,MAAM,iBAEhE,IAAS,EAAiC;EAC9C,WAAW,EAAE,MAAM,GAAU;EAC7B,MAAM,CAAC,KAAa,KAAU,CAAC;EAC/B,aAAa;EACd,CAAC,EAEI,IAAc,EAAK,MAAM,iBACzB,IAAgB,EAAO,MAAM;AAWnC,QAAO;EAAE,SARO,KAAe;EAQb,SAPF,EAAK,WAAW,EAAO;EAOZ,OANb,IAAc,EAAK,QAAS,EAAO,SAAS,EAAK;EAM7B,qBAJN;AAC1B,SAAM,QAAQ,IAAI,C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AsB,EAAE,WAAW,EAAE,OAAI,EAAE,CAAC;AAIjE,UAHI,EAAO,MAAM,yBACf,EAAK,EAAE,YAAY,GAAI,CAAC,EAEnB;;EAET,MAAM,GAAM;EACZ;EACA;EACD"}
1
+ {"version":3,"file":"useProducts.js","names":[],"sources":["../../../../../src/product-management/modules/products/hooks/useProducts.ts"],"sourcesContent":["import { useEventEmitter } from '@burdenoff/fe-libs/shared/events';\n\nimport {\n useGetPlatformProductsQuery,\n useGetPlatformProductQuery,\n useGetPlatformProductBySlugQuery,\n useCreatePlatformProductMutation,\n useUpdatePlatformProductMutation,\n useDeletePlatformProductMutation,\n GetPlatformProductsDocument,\n} from '../../../../generated/global-operations';\nimport type {\n PlatformProduct,\n ProductFilterInput,\n CreateProductInput,\n UpdateProductInput,\n} from '../types';\n\n/**\n * Hook to fetch products with filtering and pagination\n */\nexport function useProducts(\n filter?: ProductFilterInput,\n options?: { limit?: number; offset?: number }\n) {\n const { data, loading, error, refetch, fetchMore } = useGetPlatformProductsQuery({\n variables: {\n filter,\n limit: options?.limit || 50,\n offset: options?.offset || 0,\n },\n fetchPolicy: 'cache-and-network',\n });\n\n return {\n products: (data?.platformProducts?.items || []) as PlatformProduct[],\n total: data?.platformProducts?.total || 0,\n hasMore: data?.platformProducts?.hasMore || false,\n loading,\n error,\n refetch,\n fetchMore,\n };\n}\n\n/**\n * Hook to fetch a single product by ID\n */\nexport function useProduct(id: string) {\n const { data, loading, error, refetch } = useGetPlatformProductQuery({\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\n return {\n product: data?.platformProduct as PlatformProduct | undefined,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Hook to fetch a product by slug\n */\nexport function useProductBySlug(slug: string) {\n const { data, loading, error, refetch } = useGetPlatformProductBySlugQuery({\n variables: { slug },\n skip: !slug,\n fetchPolicy: 'cache-and-network',\n });\n\n return {\n product: data?.platformProductBySlug as PlatformProduct | undefined,\n loading,\n error,\n refetch,\n };\n}\n\n/** Match the canonical UUID-v4 shape (8-4-4-4-12 hex). */\nconst UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * Hook to fetch a product by either ID (UUID) or slug. Routes like\n * `/products/:id` historically receive only UUIDs, but users hand-type or\n * follow external links to `/products/<slug>` and expect to land on the\n * detail page (M22-B2). Detect the shape and pick the right query.\n *\n * Note: slugs are allowed to match the UUID format\n * (lowercase letters/digits/hyphens), so a UUID-shaped slug would\n * normally be treated as an ID and miss the bySlug resolver. To\n * avoid that regression, when the ID query completes with no\n * product, we fall back to the slug query.\n */\nexport function useProductByIdOrSlug(idOrSlug: string) {\n const isUuid = UUID_RE.test(idOrSlug);\n\n const byId = useGetPlatformProductQuery({\n variables: { id: idOrSlug },\n skip: !idOrSlug || !isUuid,\n fetchPolicy: 'cache-and-network',\n });\n\n // UUID-shaped param: only fall back to slug after the ID query finishes\n // and returns no product. Non-UUID param: always query by slug.\n const idQueryReturnedNothing = isUuid && !byId.loading && !byId.data?.platformProduct;\n\n const bySlug = useGetPlatformProductBySlugQuery({\n variables: { slug: idOrSlug },\n skip: !idOrSlug || (isUuid && !idQueryReturnedNothing),\n fetchPolicy: 'cache-and-network',\n });\n\n const byIdProduct = byId.data?.platformProduct as PlatformProduct | undefined;\n const bySlugProduct = bySlug.data?.platformProductBySlug as PlatformProduct | undefined;\n\n // Prefer the ID match; fall back to slug when ID lookup misses.\n const product = byIdProduct ?? bySlugProduct;\n const loading = byId.loading || bySlug.loading;\n const error = byIdProduct ? byId.error : (bySlug.error ?? byId.error);\n // refetch both so a manual retry covers either query.\n const refetch = async () => {\n await Promise.all([byId.refetch(), bySlug.refetch()]);\n };\n\n return { product, loading, error, refetch };\n}\n\n/**\n * Hook to create a new product. Emits `tenant.product.created` on success.\n */\nexport function useCreateProduct() {\n const [createProductMutation, { data, loading, error }] = useCreatePlatformProductMutation({\n refetchQueries: [GetPlatformProductsDocument],\n });\n const emit = useEventEmitter('tenant.product.created', { component: 'microfe-product' });\n\n return {\n createProduct: async (input: CreateProductInput) => {\n const result = await createProductMutation({ variables: { input } });\n const product = result.data?.createPlatformProduct;\n if (product) {\n emit({\n resourceId: product.id,\n resourceSlug: product.slug,\n metadata: { name: product.name, status: product.status },\n });\n }\n return result;\n },\n createPlatformProduct: data?.createPlatformProduct as PlatformProduct | undefined,\n data: data?.createPlatformProduct as PlatformProduct | undefined,\n loading,\n error,\n };\n}\n\n/**\n * Hook to update a product. Emits `tenant.product.updated` on success.\n */\nexport function useUpdateProduct() {\n const [updateProductMutation, { data, loading, error }] = useUpdatePlatformProductMutation();\n const emit = useEventEmitter('tenant.product.updated', { component: 'microfe-product' });\n\n return {\n updateProduct: async (id: string, input: UpdateProductInput) => {\n const result = await updateProductMutation({ variables: { id, input } });\n const product = result.data?.updatePlatformProduct;\n if (product) {\n emit({\n resourceId: product.id,\n resourceSlug: product.slug,\n metadata: { name: product.name, status: product.status },\n });\n }\n return result;\n },\n data: data?.updatePlatformProduct as PlatformProduct | undefined,\n loading,\n error,\n };\n}\n\n/**\n * Hook to delete a product. Emits `tenant.product.deleted` on success.\n */\nexport function useDeleteProduct() {\n const [deleteProductMutation, { data, loading, error }] = useDeletePlatformProductMutation({\n refetchQueries: [GetPlatformProductsDocument],\n });\n const emit = useEventEmitter('tenant.product.deleted', { component: 'microfe-product' });\n\n return {\n deleteProduct: async (id: string) => {\n const result = await deleteProductMutation({ variables: { id } });\n if (result.data?.deletePlatformProduct) {\n emit({ resourceId: id });\n }\n return result;\n },\n data: data?.deletePlatformProduct,\n loading,\n error,\n };\n}\n\n/**\n * Hook to update product status to ACTIVE\n */\nexport function useActivateProduct() {\n const { updateProduct, loading, error } = useUpdateProduct();\n\n return {\n activateProduct: (id: string) => updateProduct(id, { status: 'ACTIVE' }),\n loading,\n error,\n };\n}\n\n/**\n * Hook to archive a product by setting it to DRAFT.\n * Backend schema does not expose a DEPRECATED status; DRAFT is used to hide a product from public listings.\n */\nexport function useArchiveProduct() {\n const { updateProduct, loading, error } = useUpdateProduct();\n\n return {\n archiveProduct: (id: string) => updateProduct(id, { status: 'DRAFT' }),\n loading,\n error,\n };\n}\n"],"mappings":";;;AAqBA,SAAgB,EACd,GACA,GACA;CACA,IAAM,EAAE,SAAM,YAAS,UAAO,YAAS,iBAAc,EAA4B;EAC/E,WAAW;GACT;GACA,OAAO,GAAS,SAAS;GACzB,QAAQ,GAAS,UAAU;GAC5B;EACD,aAAa;EACd,CAAC;AAEF,QAAO;EACL,UAAW,GAAM,kBAAkB,SAAS,EAAE;EAC9C,OAAO,GAAM,kBAAkB,SAAS;EACxC,SAAS,GAAM,kBAAkB,WAAW;EAC5C;EACA;EACA;EACA;EACD;;AAMH,SAAgB,EAAW,GAAY;CACrC,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAA2B;EACnE,WAAW,EAAE,OAAI;EACjB,MAAM,CAAC;EACP,aAAa;EACd,CAAC;AAEF,QAAO;EACL,SAAS,GAAM;EACf;EACA;EACA;EACD;;AAMH,SAAgB,EAAiB,GAAc;CAC7C,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAAiC;EACzE,WAAW,EAAE,SAAM;EACnB,MAAM,CAAC;EACP,aAAa;EACd,CAAC;AAEF,QAAO;EACL,SAAS,GAAM;EACf;EACA;EACA;EACD;;AAIH,IAAM,IAAU;AAchB,SAAgB,EAAqB,GAAkB;CACrD,IAAM,IAAS,EAAQ,KAAK,EAAS,EAE/B,IAAO,EAA2B;EACtC,WAAW,EAAE,IAAI,GAAU;EAC3B,MAAM,CAAC,KAAY,CAAC;EACpB,aAAa;EACd,CAAC,EAII,IAAyB,KAAU,CAAC,EAAK,WAAW,CAAC,EAAK,MAAM,iBAEhE,IAAS,EAAiC;EAC9C,WAAW,EAAE,MAAM,GAAU;EAC7B,MAAM,CAAC,KAAa,KAAU,CAAC;EAC/B,aAAa;EACd,CAAC,EAEI,IAAc,EAAK,MAAM,iBACzB,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