@burdenoff/microfe-product 2026.523.1 → 2026.524.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.d.ts.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js +4 -0
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/schemas/index.d.ts +2 -0
- package/dist/product-management/modules/press-kit/schemas/index.d.ts.map +1 -1
- package/dist/product-management/modules/press-kit/schemas/index.js +2 -1
- package/dist/product-management/modules/press-kit/schemas/index.js.map +1 -1
- package/dist/product-management/modules/press-kit/types/index.d.ts +1 -1
- package/dist/product-management/modules/press-kit/types/index.d.ts.map +1 -1
- package/dist/product-management/modules/press-kit/types/index.js +2 -1
- package/dist/product-management/modules/press-kit/types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PressKitListPage.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/press-kit/pages/PressKitListPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PressKitListPage.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/press-kit/pages/PressKitListPage.tsx"],"names":[],"mappings":"AAiCA,wBAAgB,gBAAgB,4CA2S/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PressKitListPage.js","names":[],"sources":["../../../../../src/product-management/modules/press-kit/pages/PressKitListPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Download, FileText, Plus, Eye, SquarePen, Trash2, RefreshCw } from 'lucide-react';\nimport { PermissionGate } from '@burdenoff/fe-libs/shared/components';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { usePressKitAssets, useDeletePressKitAsset } from '../hooks/usePressKitAssets';\nimport { SearchInput } from '../../../shared/components/input/SearchInput';\nimport { exportToCsv } from '../../../shared/utils/exportUtils';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { PressKitAssetFilterInput, PressKitAssetCategory } from '../types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\n\n/** Category tabs — each filters the list server-side by category ('' = All). */\nconst CATEGORY_TABS: { label: string; category: string }[] = [\n { label: 'All', category: '' },\n { label: 'Logos', category: 'LOGO' },\n { label: 'Banners', category: 'BANNER' },\n { label: 'Screenshots', category: 'SCREENSHOT' },\n { label: 'Brochures', category: 'BROCHURE' },\n { label: 'Documents', category: 'DOCUMENT' },\n { label: 'Press Releases', category: 'PRESS_RELEASE' },\n { label: 'Brand Guides', category: 'BRAND_GUIDE' },\n];\n\nfunction formatBytes(bytes: number | null): string {\n if (!bytes) return '—';\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`;\n return `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n}\n\nexport function PressKitListPage() {\n const { navigate, basePath = '/products' } = useProductConsole();\n const pressKitBasePath = `${basePath}/press-kit`;\n const [searchQuery, setSearchQuery] = useState('');\n const tr = useTr();\n const [filter, setFilter] = useState<PressKitAssetFilterInput>({});\n\n const { assets, loading, error, refetch } = usePressKitAssets(\n undefined,\n { ...filter, search: searchQuery || undefined },\n { limit: 50 }\n );\n\n const { deletePressKitAsset, loading: deleteLoading } = useDeletePressKitAsset();\n\n const handleDelete = async (id: string) => {\n void nativeImpact('medium');\n const message = tr('pressKit.confirmDelete', 'Delete this press kit asset?');\n const native = await nativeConfirm({\n title: 'Delete press kit asset',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok = native === null ? window.confirm(message) : native;\n if (!ok) return;\n\n try {\n // `deletePressKitAsset` returns `Boolean!`. A throw covers hard failures\n // (network, auth, validation); the explicit `false` branch covers\n // soft-failure cases where the resolver resolved but the asset wasn't\n // actually removed — so we don't show a misleading success toast.\n const result = await deletePressKitAsset(id);\n if (!result.data?.deletePressKitAsset) {\n void nativeNotify('error');\n console.error('Press kit asset delete returned false:', id);\n return;\n }\n void nativeNotify('success');\n refetch();\n } catch (err) {\n void nativeNotify('error');\n console.error('Failed to delete press kit asset:', err);\n }\n };\n\n const formatDate = (dateString: string | null) => {\n if (!dateString) return '—';\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n };\n\n if (loading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('pressKit.loadingAssets', 'Loading press kit assets...')} />\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={error.message}\n action={{ label: tr('productCommon.retry', 'Retry'), onClick: () => refetch() }}\n />\n </div>\n );\n }\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n <div className=\"mb-6\">\n <div className=\"flex items-center justify-between mb-4\">\n <div>\n <h1 className=\"text-3xl font-bold text-text-primary mb-2\">\n {tr('pressKit.title', 'Press Kit')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('pressKit.subtitle', 'Manage downloadable press & media assets')}\n </p>\n </div>\n\n <PermissionGate role=\"super_admin\">\n <button\n onClick={() => navigate(`${pressKitBasePath}/new`)}\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-[var(--color-action-primary-bg)] text-[var(--color-action-primary-text)] rounded-lg hover:opacity-90 hover:scale-[1.02] transition-all duration-200 font-medium\"\n >\n <Plus size={20} />\n {tr('pressKit.newAsset', 'New Asset')}\n </button>\n </PermissionGate>\n </div>\n\n {/* Category tabs */}\n <div className=\"flex flex-wrap gap-1 border-b border-default pb-px\">\n {CATEGORY_TABS.map((t) => {\n const active = (filter.category ?? '') === t.category;\n return (\n <button\n key={t.label}\n type=\"button\"\n onClick={() =>\n setFilter({\n ...filter,\n category: (t.category || undefined) as PressKitAssetCategory | undefined,\n })\n }\n className={`px-4 py-2 rounded-t-lg text-sm font-medium transition-all border-b-2 ${\n active\n ? 'border-[var(--color-action-primary-bg)] text-text-primary'\n : 'border-transparent text-text-secondary hover:text-text-primary'\n }`}\n >\n {t.label}\n </button>\n );\n })}\n </div>\n\n <div className=\"flex gap-4\">\n <SearchInput\n value={searchQuery}\n onChange={setSearchQuery}\n placeholder={tr('pressKit.searchPlaceholder', 'Search press kit assets...')}\n className=\"flex-1\"\n />\n\n <button\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-surface text-text-primary border border-default rounded-lg hover:bg-muted transition-all duration-200\"\n >\n <RefreshCw size={18} />\n </button>\n\n {assets.length > 0 && (\n <button\n onClick={() =>\n exportToCsv(\n 'press-kit-assets',\n assets.map((a) => ({\n id: a.id,\n slug: a.slug,\n title: a.title,\n category: a.category,\n fileUrl: a.fileUrl,\n mimeType: a.mimeType ?? '',\n visibility: a.visibility,\n sortOrder: a.sortOrder,\n productId: a.productId,\n updatedAt: a.updatedAt,\n }))\n )\n }\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-surface text-text-primary border border-default rounded-lg hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.exportCsv', 'Export as CSV')}\n >\n <Download size={18} />\n </button>\n )}\n </div>\n </div>\n\n {assets.length === 0 ? (\n <div className=\"bg-surface border border-default rounded-lg p-12 text-center animate-in fade-in duration-300\">\n <p className=\"text-text-secondary mb-4\">\n {tr('pressKit.noAssetsFound', 'No press kit assets found')}\n </p>\n <PermissionGate role=\"super_admin\">\n <button\n onClick={() => navigate(`${pressKitBasePath}/new`)}\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-[var(--color-action-primary-bg)] text-[var(--color-action-primary-text)] rounded-lg hover:opacity-90 hover:scale-[1.02] transition-all duration-200 font-medium\"\n >\n <Plus size={20} />\n {tr('pressKit.newAsset', 'New Asset')}\n </button>\n </PermissionGate>\n </div>\n ) : (\n <div className=\"bg-surface border border-default rounded-lg shadow-[var(--shadow-elevation-1)] overflow-hidden\">\n <table className=\"w-full\">\n <thead className=\"bg-muted border-b border-default\">\n <tr>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnAsset', 'Asset')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnCategory', 'Category')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnFile', 'File')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnVisibility', 'Visibility')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnUpdated', 'Updated')}\n </th>\n <th className=\"text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnActions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-[var(--color-border-default)]\">\n {assets.map((asset) => (\n <tr\n key={asset.id}\n className=\"hover:bg-muted transition-all duration-200 cursor-pointer\"\n onClick={() => navigate(`${pressKitBasePath}/${asset.id}`)}\n >\n <td className=\"px-6 py-4\">\n <div className=\"flex items-center gap-3\">\n <div className=\"w-10 h-10 rounded-lg bg-[var(--color-status-info-subtle)] flex items-center justify-center overflow-hidden\">\n {asset.thumbnailUrl ? (\n <img\n src={asset.thumbnailUrl}\n alt=\"\"\n className=\"w-full h-full object-cover\"\n />\n ) : (\n <FileText size={20} className=\"text-[var(--color-status-info)]\" />\n )}\n </div>\n <div>\n <p className=\"font-medium text-text-primary\">{asset.title}</p>\n <p className=\"text-xs text-text-tertiary font-mono\">/{asset.slug}</p>\n </div>\n </div>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-xs font-medium px-2 py-1 rounded-full bg-[var(--color-status-info-subtle)] text-[var(--color-status-info)]\">\n {asset.category.replace(/_/g, ' ')}\n </span>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-secondary\">\n {(asset.mimeType ?? 'file').split('/').pop()} · {formatBytes(asset.fileSize)}\n </span>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-secondary\">{asset.visibility}</span>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-secondary\">\n {formatDate(asset.updatedAt)}\n </span>\n </td>\n <td className=\"px-6 py-4\">\n <div\n className=\"flex items-center justify-end gap-2\"\n onClick={(e) => e.stopPropagation()}\n >\n <a\n href={asset.fileUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.download', 'Download')}\n >\n <Download size={18} />\n </a>\n <button\n onClick={() => navigate(`${pressKitBasePath}/${asset.id}`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.viewDetails', 'View details')}\n >\n <Eye size={18} />\n </button>\n <PermissionGate role=\"super_admin\">\n <button\n onClick={() => navigate(`${pressKitBasePath}/${asset.id}/edit`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.edit', 'Edit')}\n >\n <SquarePen size={18} />\n </button>\n <button\n onClick={() => handleDelete(asset.id)}\n disabled={deleteLoading}\n className=\"p-2 rounded-lg text-[var(--color-status-error)] hover:bg-[var(--color-status-error-subtle)] transition-all duration-200 disabled:opacity-50\"\n title={tr('pressKit.delete', 'Delete')}\n >\n <Trash2 size={18} />\n </button>\n </PermissionGate>\n </div>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAM,IAAuD;CAC3D;EAAE,OAAO;EAAO,UAAU;EAAI;CAC9B;EA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BAAC,MAAD;QAAI,WAAU;kBACZ,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAW,EAAM,UAAU;SACvB,CAAA;QACJ,CAAA;OACL,kBAAC,MAAD;QAAI,WAAU;kBACZ,kBAAC,OAAD;SACE,WAAU;SACV,UAAU,MAAM,EAAE,iBAAiB;mBAFrC;UAIE,kBAAC,KAAD;WACE,MAAM,EAAM;WACZ,QAAO;WACP,KAAI;WACJ,WAAU;WACV,OAAO,EAAG,qBAAqB,WAAW;qBAE1C,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;WACpB,CAAA;UACJ,kBAAC,UAAD;WACE,eAAe,EAAS,GAAG,EAAiB,GAAG,EAAM,KAAK;WAC1D,WAAU;WACV,OAAO,EAAG,wBAAwB,eAAe;qBAEjD,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;WACV,CAAA;UACT,kBAAC,GAAD;WAAgB,MAAK;qBAArB,CACE,kBAAC,UAAD;YACE,eAAe,EAAS,GAAG,EAAiB,GAAG,EAAM,GAAG,OAAO;YAC/D,WAAU;YACV,OAAO,EAAG,iBAAiB,OAAO;sBAElC,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;YAChB,CAAA,EACT,kBAAC,UAAD;YACE,eAAe,EAAa,EAAM,GAAG;YACrC,UAAU;YACV,WAAU;YACV,OAAO,EAAG,mBAAmB,SAAS;sBAEtC,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;YACb,CAAA,CACM;;UACb;;QACH,CAAA;OACF;QAjFE,EAAM,GAiFR,CACL;KACI,CAAA,CACF;;GACJ,CAAA,CAEJ"}
|
|
1
|
+
{"version":3,"file":"PressKitListPage.js","names":[],"sources":["../../../../../src/product-management/modules/press-kit/pages/PressKitListPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Download, FileText, Plus, Eye, SquarePen, Trash2, RefreshCw } from 'lucide-react';\nimport { PermissionGate } from '@burdenoff/fe-libs/shared/components';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { usePressKitAssets, useDeletePressKitAsset } from '../hooks/usePressKitAssets';\nimport { SearchInput } from '../../../shared/components/input/SearchInput';\nimport { exportToCsv } from '../../../shared/utils/exportUtils';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { PressKitAssetFilterInput, PressKitAssetCategory } from '../types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\n\n/** Category tabs — each filters the list server-side by category ('' = All). */\nconst CATEGORY_TABS: { label: string; category: PressKitAssetCategory | '' }[] = [\n { label: 'All', category: '' },\n { label: 'Logos', category: 'LOGO' },\n { label: 'Banners', category: 'BANNER' },\n { label: 'Screenshots', category: 'SCREENSHOT' },\n { label: 'Brochures', category: 'BROCHURE' },\n { label: 'Documents', category: 'DOCUMENT' },\n { label: 'Press Releases', category: 'PRESS_RELEASE' },\n { label: 'Brand Guides', category: 'BRAND_GUIDE' },\n { label: 'Contracts', category: 'CONTRACT' },\n];\n\nfunction formatBytes(bytes: number | null): string {\n if (!bytes) return '—';\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`;\n return `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n}\n\nexport function PressKitListPage() {\n const { navigate, basePath = '/products' } = useProductConsole();\n const pressKitBasePath = `${basePath}/press-kit`;\n const [searchQuery, setSearchQuery] = useState('');\n const tr = useTr();\n const [filter, setFilter] = useState<PressKitAssetFilterInput>({});\n\n const { assets, loading, error, refetch } = usePressKitAssets(\n undefined,\n { ...filter, search: searchQuery || undefined },\n { limit: 50 }\n );\n\n const { deletePressKitAsset, loading: deleteLoading } = useDeletePressKitAsset();\n\n const handleDelete = async (id: string) => {\n void nativeImpact('medium');\n const message = tr('pressKit.confirmDelete', 'Delete this press kit asset?');\n const native = await nativeConfirm({\n title: 'Delete press kit asset',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok = native === null ? window.confirm(message) : native;\n if (!ok) return;\n\n try {\n // `deletePressKitAsset` returns `Boolean!`. A throw covers hard failures\n // (network, auth, validation); the explicit `false` branch covers\n // soft-failure cases where the resolver resolved but the asset wasn't\n // actually removed — so we don't show a misleading success toast.\n const result = await deletePressKitAsset(id);\n if (!result.data?.deletePressKitAsset) {\n void nativeNotify('error');\n console.error('Press kit asset delete returned false:', id);\n return;\n }\n void nativeNotify('success');\n refetch();\n } catch (err) {\n void nativeNotify('error');\n console.error('Failed to delete press kit asset:', err);\n }\n };\n\n const formatDate = (dateString: string | null) => {\n if (!dateString) return '—';\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n };\n\n if (loading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('pressKit.loadingAssets', 'Loading press kit assets...')} />\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={error.message}\n action={{ label: tr('productCommon.retry', 'Retry'), onClick: () => refetch() }}\n />\n </div>\n );\n }\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n <div className=\"mb-6\">\n <div className=\"flex items-center justify-between mb-4\">\n <div>\n <h1 className=\"text-3xl font-bold text-text-primary mb-2\">\n {tr('pressKit.title', 'Press Kit')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('pressKit.subtitle', 'Manage downloadable press & media assets')}\n </p>\n </div>\n\n <PermissionGate role=\"super_admin\">\n <button\n onClick={() => navigate(`${pressKitBasePath}/new`)}\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-[var(--color-action-primary-bg)] text-[var(--color-action-primary-text)] rounded-lg hover:opacity-90 hover:scale-[1.02] transition-all duration-200 font-medium\"\n >\n <Plus size={20} />\n {tr('pressKit.newAsset', 'New Asset')}\n </button>\n </PermissionGate>\n </div>\n\n {/* Category tabs */}\n <div className=\"flex flex-wrap gap-1 border-b border-default pb-px\">\n {CATEGORY_TABS.map((t) => {\n const active = (filter.category ?? '') === t.category;\n return (\n <button\n key={t.label}\n type=\"button\"\n onClick={() =>\n setFilter({\n ...filter,\n category: (t.category || undefined) as PressKitAssetCategory | undefined,\n })\n }\n className={`px-4 py-2 rounded-t-lg text-sm font-medium transition-all border-b-2 ${\n active\n ? 'border-[var(--color-action-primary-bg)] text-text-primary'\n : 'border-transparent text-text-secondary hover:text-text-primary'\n }`}\n >\n {t.label}\n </button>\n );\n })}\n </div>\n\n <div className=\"flex gap-4\">\n <SearchInput\n value={searchQuery}\n onChange={setSearchQuery}\n placeholder={tr('pressKit.searchPlaceholder', 'Search press kit assets...')}\n className=\"flex-1\"\n />\n\n <button\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-surface text-text-primary border border-default rounded-lg hover:bg-muted transition-all duration-200\"\n >\n <RefreshCw size={18} />\n </button>\n\n {assets.length > 0 && (\n <button\n onClick={() =>\n exportToCsv(\n 'press-kit-assets',\n assets.map((a) => ({\n id: a.id,\n slug: a.slug,\n title: a.title,\n category: a.category,\n fileUrl: a.fileUrl,\n mimeType: a.mimeType ?? '',\n visibility: a.visibility,\n sortOrder: a.sortOrder,\n productId: a.productId,\n updatedAt: a.updatedAt,\n }))\n )\n }\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-surface text-text-primary border border-default rounded-lg hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.exportCsv', 'Export as CSV')}\n >\n <Download size={18} />\n </button>\n )}\n </div>\n </div>\n\n {assets.length === 0 ? (\n <div className=\"bg-surface border border-default rounded-lg p-12 text-center animate-in fade-in duration-300\">\n <p className=\"text-text-secondary mb-4\">\n {tr('pressKit.noAssetsFound', 'No press kit assets found')}\n </p>\n <PermissionGate role=\"super_admin\">\n <button\n onClick={() => navigate(`${pressKitBasePath}/new`)}\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-[var(--color-action-primary-bg)] text-[var(--color-action-primary-text)] rounded-lg hover:opacity-90 hover:scale-[1.02] transition-all duration-200 font-medium\"\n >\n <Plus size={20} />\n {tr('pressKit.newAsset', 'New Asset')}\n </button>\n </PermissionGate>\n </div>\n ) : (\n <div className=\"bg-surface border border-default rounded-lg shadow-[var(--shadow-elevation-1)] overflow-hidden\">\n <table className=\"w-full\">\n <thead className=\"bg-muted border-b border-default\">\n <tr>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnAsset', 'Asset')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnCategory', 'Category')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnFile', 'File')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnVisibility', 'Visibility')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnUpdated', 'Updated')}\n </th>\n <th className=\"text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('pressKit.columnActions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-[var(--color-border-default)]\">\n {assets.map((asset) => (\n <tr\n key={asset.id}\n className=\"hover:bg-muted transition-all duration-200 cursor-pointer\"\n onClick={() => navigate(`${pressKitBasePath}/${asset.id}`)}\n >\n <td className=\"px-6 py-4\">\n <div className=\"flex items-center gap-3\">\n <div className=\"w-10 h-10 rounded-lg bg-[var(--color-status-info-subtle)] flex items-center justify-center overflow-hidden\">\n {asset.thumbnailUrl ? (\n <img\n src={asset.thumbnailUrl}\n alt=\"\"\n className=\"w-full h-full object-cover\"\n />\n ) : (\n <FileText size={20} className=\"text-[var(--color-status-info)]\" />\n )}\n </div>\n <div>\n <p className=\"font-medium text-text-primary\">{asset.title}</p>\n <p className=\"text-xs text-text-tertiary font-mono\">/{asset.slug}</p>\n </div>\n </div>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-xs font-medium px-2 py-1 rounded-full bg-[var(--color-status-info-subtle)] text-[var(--color-status-info)]\">\n {asset.category.replace(/_/g, ' ')}\n </span>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-secondary\">\n {(asset.mimeType ?? 'file').split('/').pop()} · {formatBytes(asset.fileSize)}\n </span>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-secondary\">{asset.visibility}</span>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-secondary\">\n {formatDate(asset.updatedAt)}\n </span>\n </td>\n <td className=\"px-6 py-4\">\n <div\n className=\"flex items-center justify-end gap-2\"\n onClick={(e) => e.stopPropagation()}\n >\n <a\n href={asset.fileUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.download', 'Download')}\n >\n <Download size={18} />\n </a>\n <button\n onClick={() => navigate(`${pressKitBasePath}/${asset.id}`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.viewDetails', 'View details')}\n >\n <Eye size={18} />\n </button>\n <PermissionGate role=\"super_admin\">\n <button\n onClick={() => navigate(`${pressKitBasePath}/${asset.id}/edit`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-muted transition-all duration-200\"\n title={tr('pressKit.edit', 'Edit')}\n >\n <SquarePen size={18} />\n </button>\n <button\n onClick={() => handleDelete(asset.id)}\n disabled={deleteLoading}\n className=\"p-2 rounded-lg text-[var(--color-status-error)] hover:bg-[var(--color-status-error-subtle)] transition-all duration-200 disabled:opacity-50\"\n title={tr('pressKit.delete', 'Delete')}\n >\n <Trash2 size={18} />\n </button>\n </PermissionGate>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: z.ZodObject<{
|
|
|
9
9
|
DOCUMENT: "DOCUMENT";
|
|
10
10
|
PRESS_RELEASE: "PRESS_RELEASE";
|
|
11
11
|
BRAND_GUIDE: "BRAND_GUIDE";
|
|
12
|
+
CONTRACT: "CONTRACT";
|
|
12
13
|
}>;
|
|
13
14
|
title: z.ZodString;
|
|
14
15
|
slug: z.ZodString;
|
|
@@ -36,6 +37,7 @@ export declare const updatePressKitAssetSchema: z.ZodObject<{
|
|
|
36
37
|
DOCUMENT: "DOCUMENT";
|
|
37
38
|
PRESS_RELEASE: "PRESS_RELEASE";
|
|
38
39
|
BRAND_GUIDE: "BRAND_GUIDE";
|
|
40
|
+
CONTRACT: "CONTRACT";
|
|
39
41
|
}>>;
|
|
40
42
|
title: z.ZodOptional<z.ZodString>;
|
|
41
43
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/press-kit/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/press-kit/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBpC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAapC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACpF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/product-management/modules/press-kit/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Press Kit Asset Validation Schemas\n * Aligned with backend ProductPressKitAsset schema\n */\n\nconst categoryEnum = z.enum([\n 'LOGO',\n 'BANNER',\n 'SCREENSHOT',\n 'BROCHURE',\n 'DOCUMENT',\n 'PRESS_RELEASE',\n 'BRAND_GUIDE',\n]);\n\nexport const createPressKitAssetSchema = z.object({\n productId: z.string().min(1, 'Product is required'),\n category: categoryEnum,\n title: z\n .string()\n .min(2, 'Title must be at least 2 characters')\n .max(200, 'Title must not exceed 200 characters')\n .trim(),\n slug: z\n .string()\n .min(2, 'Slug must be at least 2 characters')\n .max(100, 'Slug must not exceed 100 characters')\n .regex(/^[a-z0-9-]+$/, 'Slug must contain only lowercase letters, numbers, and hyphens')\n .trim(),\n description: z.string().max(1000, 'Description must not exceed 1000 characters').optional(),\n fileUrl: z.string().url('Must be a valid URL'),\n fileName: z.string().max(255).optional(),\n fileSize: z.number().int().min(0).optional(),\n mimeType: z.string().max(120).optional(),\n thumbnailUrl: z.string().url('Must be a valid URL').or(z.literal('')).optional(),\n version: z.string().max(40).optional(),\n tags: z.array(z.string()).optional(),\n visibility: z.enum(['PUBLIC', 'AUTHENTICATED', 'INTERNAL']).optional(),\n sortOrder: z.number().int().min(0).optional(),\n});\n\nexport const updatePressKitAssetSchema = z.object({\n category: categoryEnum.optional(),\n title: z.string().min(2).max(200).trim().optional(),\n description: z.string().max(1000).optional(),\n fileUrl: z.string().url('Must be a valid URL').optional(),\n fileName: z.string().max(255).optional(),\n fileSize: z.number().int().min(0).optional(),\n mimeType: z.string().max(120).optional(),\n thumbnailUrl: z.string().url('Must be a valid URL').or(z.literal('')).optional(),\n version: z.string().max(40).optional(),\n tags: z.array(z.string()).optional(),\n visibility: z.enum(['PUBLIC', 'AUTHENTICATED', 'INTERNAL']).optional(),\n sortOrder: z.number().int().min(0).optional(),\n});\n\nexport type CreatePressKitAssetFormData = z.infer<typeof createPressKitAssetSchema>;\nexport type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UAAU,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;CAC5C,UAAU,GAAU,CAAC,IAAI,IAAI,CAAC,UAAU;CACxC,cAAc,GAAU,CAAC,IAAI,sBAAsB,CAAC,GAAG,EAAU,GAAG,CAAC,CAAC,UAAU;CAChF,SAAS,GAAU,CAAC,IAAI,GAAG,CAAC,UAAU;CACtC,MAAM,EAAQ,GAAU,CAAC,CAAC,UAAU;CACpC,YAAY,EAAO;EAAC;EAAU;EAAiB;EAAW,CAAC,CAAC,UAAU;CACtE,WAAW,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;CAC9C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/product-management/modules/press-kit/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Press Kit Asset Validation Schemas\n * Aligned with backend ProductPressKitAsset schema\n */\n\nconst categoryEnum = z.enum([\n 'LOGO',\n 'BANNER',\n 'SCREENSHOT',\n 'BROCHURE',\n 'DOCUMENT',\n 'PRESS_RELEASE',\n 'BRAND_GUIDE',\n 'CONTRACT',\n]);\n\nexport const createPressKitAssetSchema = z.object({\n productId: z.string().min(1, 'Product is required'),\n category: categoryEnum,\n title: z\n .string()\n .min(2, 'Title must be at least 2 characters')\n .max(200, 'Title must not exceed 200 characters')\n .trim(),\n slug: z\n .string()\n .min(2, 'Slug must be at least 2 characters')\n .max(100, 'Slug must not exceed 100 characters')\n .regex(/^[a-z0-9-]+$/, 'Slug must contain only lowercase letters, numbers, and hyphens')\n .trim(),\n description: z.string().max(1000, 'Description must not exceed 1000 characters').optional(),\n fileUrl: z.string().url('Must be a valid URL'),\n fileName: z.string().max(255).optional(),\n fileSize: z.number().int().min(0).optional(),\n mimeType: z.string().max(120).optional(),\n thumbnailUrl: z.string().url('Must be a valid URL').or(z.literal('')).optional(),\n version: z.string().max(40).optional(),\n tags: z.array(z.string()).optional(),\n visibility: z.enum(['PUBLIC', 'AUTHENTICATED', 'INTERNAL']).optional(),\n sortOrder: z.number().int().min(0).optional(),\n});\n\nexport const updatePressKitAssetSchema = z.object({\n category: categoryEnum.optional(),\n title: z.string().min(2).max(200).trim().optional(),\n description: z.string().max(1000).optional(),\n fileUrl: z.string().url('Must be a valid URL').optional(),\n fileName: z.string().max(255).optional(),\n fileSize: z.number().int().min(0).optional(),\n mimeType: z.string().max(120).optional(),\n thumbnailUrl: z.string().url('Must be a valid URL').or(z.literal('')).optional(),\n version: z.string().max(40).optional(),\n tags: z.array(z.string()).optional(),\n visibility: z.enum(['PUBLIC', 'AUTHENTICATED', 'INTERNAL']).optional(),\n sortOrder: z.number().int().min(0).optional(),\n});\n\nexport type CreatePressKitAssetFormData = z.infer<typeof createPressKitAssetSchema>;\nexport type UpdatePressKitAssetFormData = z.infer<typeof updatePressKitAssetSchema>;\n"],"mappings":";;AAOA,IAAM,IAAe,EAAO;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,EAEW,IAA4B,EAAS;CAChD,WAAW,GAAU,CAAC,IAAI,GAAG,sBAAsB;CACnD,UAAU;CACV,OAAO,GACI,CACR,IAAI,GAAG,sCAAsC,CAC7C,IAAI,KAAK,uCAAuC,CAChD,MAAM;CACT,MAAM,GACK,CACR,IAAI,GAAG,qCAAqC,CAC5C,IAAI,KAAK,sCAAsC,CAC/C,MAAM,gBAAgB,iEAAiE,CACvF,MAAM;CACT,aAAa,GAAU,CAAC,IAAI,KAAM,8CAA8C,CAAC,UAAU;CAC3F,SAAS,GAAU,CAAC,IAAI,sBAAsB;CAC9C,UAAU,GAAU,CAAC,IAAI,IAAI,CAAC,UAAU;CACxC,UAAU,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;CAC5C,UAAU,GAAU,CAAC,IAAI,IAAI,CAAC,UAAU;CACxC,cAAc,GAAU,CAAC,IAAI,sBAAsB,CAAC,GAAG,EAAU,GAAG,CAAC,CAAC,UAAU;CAChF,SAAS,GAAU,CAAC,IAAI,GAAG,CAAC,UAAU;CACtC,MAAM,EAAQ,GAAU,CAAC,CAAC,UAAU;CACpC,YAAY,EAAO;EAAC;EAAU;EAAiB;EAAW,CAAC,CAAC,UAAU;CACtE,WAAW,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;CAC9C,CAAC,EAEW,IAA4B,EAAS;CAChD,UAAU,EAAa,UAAU;CACjC,OAAO,GAAU,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU;CACnD,aAAa,GAAU,CAAC,IAAI,IAAK,CAAC,UAAU;CAC5C,SAAS,GAAU,CAAC,IAAI,sBAAsB,CAAC,UAAU;CACzD,UAAU,GAAU,CAAC,IAAI,IAAI,CAAC,UAAU;CACxC,UAAU,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;CAC5C,UAAU,GAAU,CAAC,IAAI,IAAI,CAAC,UAAU;CACxC,cAAc,GAAU,CAAC,IAAI,sBAAsB,CAAC,GAAG,EAAU,GAAG,CAAC,CAAC,UAAU;CAChF,SAAS,GAAU,CAAC,IAAI,GAAG,CAAC,UAAU;CACtC,MAAM,EAAQ,GAAU,CAAC,CAAC,UAAU;CACpC,YAAY,EAAO;EAAC;EAAU;EAAiB;EAAW,CAAC,CAAC,UAAU;CACtE,WAAW,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;CAC9C,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Aligned with backend ProductPressKitAsset schema
|
|
4
4
|
*/
|
|
5
5
|
export type ContentVisibility = 'PUBLIC' | 'AUTHENTICATED' | 'INTERNAL';
|
|
6
|
-
export type PressKitAssetCategory = 'LOGO' | 'BANNER' | 'SCREENSHOT' | 'BROCHURE' | 'DOCUMENT' | 'PRESS_RELEASE' | 'BRAND_GUIDE';
|
|
6
|
+
export type PressKitAssetCategory = 'LOGO' | 'BANNER' | 'SCREENSHOT' | 'BROCHURE' | 'DOCUMENT' | 'PRESS_RELEASE' | 'BRAND_GUIDE' | 'CONTRACT';
|
|
7
7
|
export interface ProductPressKitAsset {
|
|
8
8
|
id: string;
|
|
9
9
|
productId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/press-kit/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,eAAe,GAAG,UAAU,CAAC;AAExE,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,UAAU,GACV,eAAe,GACf,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/press-kit/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,eAAe,GAAG,UAAU,CAAC;AAExE,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,UAAU,GACV,eAAe,GACf,aAAa,GACb,UAAU,CAAC;AAEf,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,qBAAqB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE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,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,oBAAoB,EAAE,qBAAqB,EASvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/product-management/modules/press-kit/types/index.ts"],"sourcesContent":["/**\n * Press Kit Module Types\n * Aligned with backend ProductPressKitAsset schema\n */\n\nexport type ContentVisibility = 'PUBLIC' | 'AUTHENTICATED' | 'INTERNAL';\n\nexport type PressKitAssetCategory =\n | 'LOGO'\n | 'BANNER'\n | 'SCREENSHOT'\n | 'BROCHURE'\n | 'DOCUMENT'\n | 'PRESS_RELEASE'\n | 'BRAND_GUIDE';\n\nexport interface ProductPressKitAsset {\n id: string;\n productId: string;\n category: PressKitAssetCategory;\n title: string;\n slug: string;\n description: string | null;\n fileUrl: string;\n fileName: string | null;\n fileSize: number | null;\n mimeType: string | null;\n thumbnailUrl: string | null;\n version: string | null;\n tags: string[];\n visibility: ContentVisibility;\n sortOrder: number;\n createdAt: string;\n updatedAt: string;\n product?: { id: string; name: string; slug: string } | null;\n}\n\nexport interface PressKitAssetFilterInput {\n search?: string;\n category?: PressKitAssetCategory;\n visibility?: ContentVisibility;\n tag?: string;\n}\n\n// Nullable string fields accept `null` to match the GraphQL schema\n// (`String` without `!`). On Update, a `null` value explicitly clears\n// the field; on Create, `null` and absence are equivalent. Without\n// `null` in these types, callers cannot send an explicit clear from\n// the form's edit mode — see `PressKitAssetForm.handleSubmit`.\nexport interface CreatePressKitAssetInput {\n productId: string;\n category: PressKitAssetCategory;\n title: string;\n slug: string;\n description?: string | null;\n fileUrl: string;\n fileName?: string | null;\n fileSize?: number | null;\n mimeType?: string | null;\n thumbnailUrl?: string | null;\n version?: string | null;\n tags?: string[];\n visibility?: ContentVisibility;\n sortOrder?: number;\n}\n\nexport interface UpdatePressKitAssetInput {\n category?: PressKitAssetCategory;\n title?: string;\n description?: string | null;\n fileUrl?: string;\n fileName?: string | null;\n fileSize?: number | null;\n mimeType?: string | null;\n thumbnailUrl?: string | null;\n version?: string | null;\n tags?: string[];\n visibility?: ContentVisibility;\n sortOrder?: number;\n}\n\nexport interface PressKitAssetsConnection {\n items: ProductPressKitAsset[];\n total: number;\n hasMore: boolean;\n}\n\nexport const PRESS_KIT_CATEGORIES: PressKitAssetCategory[] = [\n 'LOGO',\n 'BANNER',\n 'SCREENSHOT',\n 'BROCHURE',\n 'DOCUMENT',\n 'PRESS_RELEASE',\n 'BRAND_GUIDE',\n];\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/product-management/modules/press-kit/types/index.ts"],"sourcesContent":["/**\n * Press Kit Module Types\n * Aligned with backend ProductPressKitAsset schema\n */\n\nexport type ContentVisibility = 'PUBLIC' | 'AUTHENTICATED' | 'INTERNAL';\n\nexport type PressKitAssetCategory =\n | 'LOGO'\n | 'BANNER'\n | 'SCREENSHOT'\n | 'BROCHURE'\n | 'DOCUMENT'\n | 'PRESS_RELEASE'\n | 'BRAND_GUIDE'\n | 'CONTRACT';\n\nexport interface ProductPressKitAsset {\n id: string;\n productId: string;\n category: PressKitAssetCategory;\n title: string;\n slug: string;\n description: string | null;\n fileUrl: string;\n fileName: string | null;\n fileSize: number | null;\n mimeType: string | null;\n thumbnailUrl: string | null;\n version: string | null;\n tags: string[];\n visibility: ContentVisibility;\n sortOrder: number;\n createdAt: string;\n updatedAt: string;\n product?: { id: string; name: string; slug: string } | null;\n}\n\nexport interface PressKitAssetFilterInput {\n search?: string;\n category?: PressKitAssetCategory;\n visibility?: ContentVisibility;\n tag?: string;\n}\n\n// Nullable string fields accept `null` to match the GraphQL schema\n// (`String` without `!`). On Update, a `null` value explicitly clears\n// the field; on Create, `null` and absence are equivalent. Without\n// `null` in these types, callers cannot send an explicit clear from\n// the form's edit mode — see `PressKitAssetForm.handleSubmit`.\nexport interface CreatePressKitAssetInput {\n productId: string;\n category: PressKitAssetCategory;\n title: string;\n slug: string;\n description?: string | null;\n fileUrl: string;\n fileName?: string | null;\n fileSize?: number | null;\n mimeType?: string | null;\n thumbnailUrl?: string | null;\n version?: string | null;\n tags?: string[];\n visibility?: ContentVisibility;\n sortOrder?: number;\n}\n\nexport interface UpdatePressKitAssetInput {\n category?: PressKitAssetCategory;\n title?: string;\n description?: string | null;\n fileUrl?: string;\n fileName?: string | null;\n fileSize?: number | null;\n mimeType?: string | null;\n thumbnailUrl?: string | null;\n version?: string | null;\n tags?: string[];\n visibility?: ContentVisibility;\n sortOrder?: number;\n}\n\nexport interface PressKitAssetsConnection {\n items: ProductPressKitAsset[];\n total: number;\n hasMore: boolean;\n}\n\nexport const PRESS_KIT_CATEGORIES: PressKitAssetCategory[] = [\n 'LOGO',\n 'BANNER',\n 'SCREENSHOT',\n 'BROCHURE',\n 'DOCUMENT',\n 'PRESS_RELEASE',\n 'BRAND_GUIDE',\n 'CONTRACT',\n];\n"],"mappings":";AAwFA,IAAa,IAAgD;CAC3D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|