@burdenoff/microfe-product 2026.624.2 → 2026.625.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 (65) hide show
  1. package/dist/product/pages/ContentPageViewPage.js +25 -24
  2. package/dist/product/pages/ContentPageViewPage.js.map +1 -1
  3. package/dist/product/pages/ProductCatalogPage.js +69 -64
  4. package/dist/product/pages/ProductCatalogPage.js.map +1 -1
  5. package/dist/product/pages/ProductViewPage.js +91 -86
  6. package/dist/product/pages/ProductViewPage.js.map +1 -1
  7. package/dist/product-management/modules/content-pages/components/ContentPageForm.js +7 -7
  8. package/dist/product-management/modules/content-pages/components/ContentPageForm.js.map +1 -1
  9. package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js +2 -2
  10. package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js.map +1 -1
  11. package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js +243 -230
  12. package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js.map +1 -1
  13. package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js +2 -2
  14. package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js.map +1 -1
  15. package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js +293 -277
  16. package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js.map +1 -1
  17. package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js +1 -1
  18. package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js.map +1 -1
  19. package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js +2 -2
  20. package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js.map +1 -1
  21. package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js +158 -148
  22. package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js.map +1 -1
  23. package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js +2 -2
  24. package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js.map +1 -1
  25. package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js +98 -81
  26. package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js.map +1 -1
  27. package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js +4 -4
  28. package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js.map +1 -1
  29. package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js +2 -2
  30. package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js.map +1 -1
  31. package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js +109 -99
  32. package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js.map +1 -1
  33. package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js +2 -2
  34. package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js.map +1 -1
  35. package/dist/product-management/modules/press-kit/pages/PressKitListPage.js +252 -236
  36. package/dist/product-management/modules/press-kit/pages/PressKitListPage.js.map +1 -1
  37. package/dist/product-management/modules/products/components/ProductForm.js +8 -8
  38. package/dist/product-management/modules/products/components/ProductForm.js.map +1 -1
  39. package/dist/product-management/modules/products/components/ProductPlans.js +4 -4
  40. package/dist/product-management/modules/products/components/ProductPlans.js.map +1 -1
  41. package/dist/product-management/modules/products/pages/ProductCreatePage.js +2 -2
  42. package/dist/product-management/modules/products/pages/ProductCreatePage.js.map +1 -1
  43. package/dist/product-management/modules/products/pages/ProductDetailPage.js +408 -395
  44. package/dist/product-management/modules/products/pages/ProductDetailPage.js.map +1 -1
  45. package/dist/product-management/modules/products/pages/ProductEditPage.js +2 -2
  46. package/dist/product-management/modules/products/pages/ProductEditPage.js.map +1 -1
  47. package/dist/product-management/modules/products/pages/ProductsListPage.js +301 -281
  48. package/dist/product-management/modules/products/pages/ProductsListPage.js.map +1 -1
  49. package/dist/product-management/modules/shortcuts/components/ShortcutForm.js +3 -3
  50. package/dist/product-management/modules/shortcuts/components/ShortcutForm.js.map +1 -1
  51. package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js +2 -2
  52. package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js.map +1 -1
  53. package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js +221 -218
  54. package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js.map +1 -1
  55. package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js +2 -2
  56. package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js.map +1 -1
  57. package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js +260 -241
  58. package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js.map +1 -1
  59. package/dist/product-management/shared/components/AuditHistoryTab.js +1 -1
  60. package/dist/product-management/shared/components/AuditHistoryTab.js.map +1 -1
  61. package/dist/product-management/shared/components/feedback/EmptyState.js +2 -20
  62. package/dist/product-management/shared/hooks/useConfirmDialog.js +44 -0
  63. package/dist/product-management/shared/hooks/useConfirmDialog.js.map +1 -0
  64. package/package.json +2 -2
  65. package/dist/product-management/shared/components/feedback/EmptyState.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ShortcutsListPage.js","names":[],"sources":["../../../../../src/product-management/modules/shortcuts/pages/ShortcutsListPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Plus,\n RefreshCw,\n Eye,\n SquarePen,\n Trash2,\n ToggleLeft,\n ToggleRight,\n Sparkles,\n} from 'lucide-react';\nimport { PermissionGate } from '@burdenoff/fe-libs/shared/components';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useDebounced } from '../../../shared/hooks/useDebounced';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport {\n useShortcuts,\n useDeleteShortcut,\n useToggleShortcut,\n useSeedDefaultShortcuts,\n} from '../hooks/useShortcuts';\nimport { ShortcutCategoryBadge } from '../components/ShortcutCategoryBadge';\nimport { ShortcutKeyBadge } from '../components/ShortcutKeyBadge';\nimport { SearchInput } from '../../../shared/components/input/SearchInput';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { KeyboardShortcutFilterInput } from '../types';\nimport { ShortcutCategories } from '../types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\n\nexport function ShortcutsListPage() {\n const { navigate, basePath = '/products' } = useProductConsole();\n const tr = useTr();\n const [searchQuery, setSearchQuery] = useState('');\n // Debounce so typing doesn't fire a query (and flip `loading`) on every keystroke.\n const debouncedSearchQuery = useDebounced(searchQuery, 300);\n const [filter, setFilter] = useState<KeyboardShortcutFilterInput>({});\n\n const { shortcuts, loading, error, refetch } = useShortcuts(\n { ...filter, search: debouncedSearchQuery || undefined },\n { limit: 50 }\n );\n\n const { deleteShortcut, loading: deleteLoading } = useDeleteShortcut();\n const { toggleShortcut, loading: toggleLoading } = useToggleShortcut();\n const { seedDefaultShortcuts, loading: seedLoading } = useSeedDefaultShortcuts();\n\n const handleDelete = async (id: string) => {\n void nativeImpact('medium');\n const message = tr('shortcuts.confirmDelete', 'Are you sure you want to delete this shortcut?');\n const native = await nativeConfirm({\n title: 'Delete shortcut',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok = native === null ? window.confirm(message) : native;\n if (!ok) return;\n\n try {\n await deleteShortcut(id);\n void nativeNotify('success');\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete shortcut:', error);\n }\n };\n\n const handleToggle = async (id: string, currentEnabled: boolean) => {\n void nativeImpact('medium');\n try {\n await toggleShortcut(id, !currentEnabled);\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to toggle shortcut:', error);\n }\n };\n\n const handleSeedDefaults = async () => {\n void nativeImpact('light');\n const message = tr(\n 'shortcuts.confirmSeedDefaults',\n 'This will create default global shortcuts. Continue?'\n );\n const native = await nativeConfirm({\n title: 'Seed defaults',\n message,\n okButtonTitle: 'Continue',\n cancelButtonTitle: 'Cancel',\n });\n const ok = native === null ? window.confirm(message) : native;\n if (!ok) return;\n\n try {\n const result = await seedDefaultShortcuts();\n const count = result.data?.seedDefaultShortcuts || 0;\n void nativeNotify('success');\n alert(`Created ${count} default shortcuts.`);\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to seed shortcuts:', error);\n }\n };\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200\">\n {/* Page Header */}\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('shortcuts.title', 'Keyboard Shortcuts')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('shortcuts.subtitle', 'Manage keyboard shortcuts across all Burdenoff products')}\n </p>\n </div>\n\n <PermissionGate role=\"super_admin\">\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleSeedDefaults}\n disabled={seedLoading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n font-medium\n disabled:opacity-50\n \"\n >\n <Sparkles size={18} />\n {tr('shortcuts.seedDefaults', 'Seed Defaults')}\n </button>\n\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/new`)}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90\n transition-all duration-200\n font-medium\n \"\n >\n <Plus size={20} />\n {tr('shortcuts.createShortcut', 'Create Shortcut')}\n </button>\n </div>\n </PermissionGate>\n </div>\n\n {/* Search and Filters */}\n <div className=\"flex gap-4\">\n {/* Search */}\n <SearchInput\n value={searchQuery}\n onChange={setSearchQuery}\n placeholder={tr('shortcuts.searchPlaceholder', 'Search shortcuts...')}\n className=\"flex-1\"\n />\n\n {/* Category Filter */}\n <select\n value={filter.category || ''}\n onChange={(e) =>\n setFilter({\n ...filter,\n category: e.target.value || undefined,\n })\n }\n className=\"\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n \"\n >\n <option value=\"\">{tr('shortcuts.allCategories', 'All Categories')}</option>\n {Object.values(ShortcutCategories).map((cat) => (\n <option key={cat} value={cat}>\n {cat}\n </option>\n ))}\n </select>\n\n {/* Enabled Filter */}\n <select\n value={\n filter.isEnabled === undefined || filter.isEnabled === null\n ? ''\n : filter.isEnabled.toString()\n }\n onChange={(e) =>\n setFilter({\n ...filter,\n isEnabled: e.target.value === '' ? undefined : e.target.value === 'true',\n })\n }\n className=\"\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n \"\n >\n <option value=\"\">{tr('shortcuts.allStatus', 'All Status')}</option>\n <option value=\"true\">{tr('shortcuts.enabled', 'Enabled')}</option>\n <option value=\"false\">{tr('shortcuts.disabled', 'Disabled')}</option>\n </select>\n\n {/* Refresh */}\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n \"\n >\n <RefreshCw size={18} />\n </button>\n </div>\n </div>\n\n {/* Body — header above stays mounted across refetches so the search keeps focus. */}\n {error ? (\n <ErrorState\n message={error.message}\n action={{ label: tr('productCommon.retry', 'Retry'), onClick: () => refetch() }}\n />\n ) : loading && shortcuts.length === 0 ? (\n <LoadingState message={tr('shortcuts.loadingShortcuts', 'Loading keyboard shortcuts...')} />\n ) : shortcuts.length === 0 ? (\n <div className=\"bg-surface border border-default rounded-lg p-12 text-center animate-in fade-in duration-200\">\n <p className=\"text-text-secondary mb-4\">\n {tr('shortcuts.noShortcutsFound', 'No keyboard shortcuts found')}\n </p>\n <div className=\"flex items-center justify-center gap-3\">\n <button\n type=\"button\"\n onClick={handleSeedDefaults}\n disabled={seedLoading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n font-medium\n \"\n >\n <Sparkles size={18} />\n {tr('shortcuts.seedDefaults', 'Seed Defaults')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/new`)}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90\n transition-all duration-200\n font-medium\n \"\n >\n <Plus size={20} />\n {tr('shortcuts.createShortcut', 'Create Shortcut')}\n </button>\n </div>\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-bg-sunken 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('shortcuts.columnShortcut', 'Shortcut')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnLabel', 'Label')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnCategory', 'Category')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnEvent', 'Event')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnProduct', 'Product')}\n </th>\n <th className=\"text-center px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnEnabled', 'Enabled')}\n </th>\n <th className=\"text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnActions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-[var(--color-border-default)]\">\n {shortcuts.map((shortcut) => (\n <tr key={shortcut.id} className=\"hover:bg-bg-sunken transition-all duration-200\">\n <td className=\"px-6 py-4\">\n <ShortcutKeyBadge\n shortcutKey={shortcut.shortcutKey}\n isSequence={shortcut.isSequence}\n />\n </td>\n <td className=\"px-6 py-4\">\n <div>\n <p className=\"font-medium text-text-primary\">{shortcut.label}</p>\n {shortcut.description && (\n <p className=\"text-sm text-text-tertiary line-clamp-1\">\n {shortcut.description}\n </p>\n )}\n </div>\n </td>\n <td className=\"px-6 py-4\">\n <ShortcutCategoryBadge category={shortcut.category} />\n </td>\n <td className=\"px-6 py-4\">\n <code className=\"text-sm text-text-secondary bg-bg-sunken px-1.5 py-0.5 rounded font-mono\">\n {shortcut.eventName}\n </code>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-primary\">\n {shortcut.product?.name || (\n <span className=\"text-text-tertiary italic\">\n {tr('shortcuts.global', 'Global')}\n </span>\n )}\n </span>\n </td>\n <td className=\"px-6 py-4 text-center\">\n <button\n type=\"button\"\n onClick={() => handleToggle(shortcut.id, shortcut.isEnabled)}\n disabled={toggleLoading}\n className={`\n p-1 rounded-lg transition-all duration-200\n ${\n shortcut.isEnabled\n ? 'text-[var(--color-status-success)] hover:bg-[var(--color-status-success-subtle)]'\n : 'text-text-tertiary hover:bg-bg-sunken'\n }\n disabled:opacity-50\n `}\n title={\n shortcut.isEnabled\n ? tr('shortcuts.disable', 'Disable')\n : tr('shortcuts.enable', 'Enable')\n }\n >\n {shortcut.isEnabled ? <ToggleRight size={24} /> : <ToggleLeft size={24} />}\n </button>\n </td>\n <td className=\"px-6 py-4\">\n <div className=\"flex items-center justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/${shortcut.id}`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200\"\n title={tr('shortcuts.viewDetails', 'View details')}\n >\n <Eye size={18} />\n </button>\n <PermissionGate role=\"super_admin\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/${shortcut.id}/edit`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200\"\n title={tr('shortcuts.edit', 'Edit')}\n >\n <SquarePen size={18} />\n </button>\n <button\n type=\"button\"\n onClick={() => handleDelete(shortcut.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('shortcuts.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":";;;;;;;;;;;;;;;;AA8BA,SAAgB,IAAoB;CAClC,IAAM,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAK,GAAO,EACZ,CAAC,GAAa,KAAkB,EAAS,GAAG,EAE5C,IAAuB,EAAa,GAAa,IAAI,EACrD,CAAC,GAAQ,KAAa,EAAsC,EAAE,CAAC,EAE/D,EAAE,cAAW,YAAS,UAAO,eAAY,EAC7C;EAAE,GAAG;EAAQ,QAAQ,KAAwB,KAAA;EAAW,EACxD,EAAE,OAAO,IAAI,CACd,EAEK,EAAE,mBAAgB,SAAS,MAAkB,GAAmB,EAChE,EAAE,mBAAgB,SAAS,MAAkB,GAAmB,EAChE,EAAE,yBAAsB,SAAS,MAAgB,GAAyB,EAE1E,IAAe,OAAO,MAAe;AACpC,IAAa,SAAS;EAC3B,IAAM,IAAU,EAAG,2BAA2B,iDAAiD,EACzF,IAAS,MAAM,EAAc;GACjC,OAAO;GACP;GACA,eAAe;GACf,mBAAmB;GACpB,CAAC;AACS,YAAW,OAAO,OAAO,QAAQ,EAAQ,GAAG,EAGvD,KAAI;AAGF,GAFA,MAAM,EAAe,EAAG,EACnB,EAAa,UAAU,EAC5B,GAAS;WACF,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D;SAAK,WAAU;mBAAf,CACE,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAS,GAAG,EAAS,aAAa,EAAS,KAAK;UAC/D,WAAU;UACV,OAAO,EAAG,yBAAyB,eAAe;oBAElD,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;UACV,CAAA,EACT,kBAAC,GAAD;UAAgB,MAAK;oBAArB,CACE,kBAAC,UAAD;WACE,MAAK;WACL,eAAe,EAAS,GAAG,EAAS,aAAa,EAAS,GAAG,OAAO;WACpE,WAAU;WACV,OAAO,EAAG,kBAAkB,OAAO;qBAEnC,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;WAChB,CAAA,EACT,kBAAC,UAAD;WACE,MAAK;WACL,eAAe,EAAa,EAAS,GAAG;WACxC,UAAU;WACV,WAAU;WACV,OAAO,EAAG,oBAAoB,SAAS;qBAEvC,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;WACb,CAAA,CACM;YACb;;QACH,CAAA;OACF;QAxFI,EAAS,GAwFb,CACL;KACI,CAAA,CACF;;GACJ,CAAA,CAEJ"}
1
+ {"version":3,"file":"ShortcutsListPage.js","names":[],"sources":["../../../../../src/product-management/modules/shortcuts/pages/ShortcutsListPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Plus,\n RefreshCw,\n Eye,\n SquarePen,\n Trash2,\n ToggleLeft,\n ToggleRight,\n Sparkles,\n} from 'lucide-react';\nimport { PermissionGate } from '@burdenoff/fe-libs/shared/components';\nimport {\n Button,\n CTAOverflowMenu,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n} from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useDebounced } from '../../../shared/hooks/useDebounced';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport {\n useShortcuts,\n useDeleteShortcut,\n useToggleShortcut,\n useSeedDefaultShortcuts,\n} from '../hooks/useShortcuts';\nimport { ShortcutCategoryBadge } from '../components/ShortcutCategoryBadge';\nimport { ShortcutKeyBadge } from '../components/ShortcutKeyBadge';\nimport { SearchInput } from '../../../shared/components/input/SearchInput';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { KeyboardShortcutFilterInput } from '../types';\nimport { ShortcutCategories } from '../types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\nimport { useConfirmDialog } from '../../../shared/hooks/useConfirmDialog';\n\nexport function ShortcutsListPage() {\n const { navigate, basePath = '/products' } = useProductConsole();\n const tr = useTr();\n const { confirm, ConfirmDialog } = useConfirmDialog();\n const [searchQuery, setSearchQuery] = useState('');\n // Debounce so typing doesn't fire a query (and flip `loading`) on every keystroke.\n const debouncedSearchQuery = useDebounced(searchQuery, 300);\n const [filter, setFilter] = useState<KeyboardShortcutFilterInput>({});\n\n const { shortcuts, loading, error, refetch } = useShortcuts(\n { ...filter, search: debouncedSearchQuery || undefined },\n { limit: 50 }\n );\n\n const { deleteShortcut, loading: deleteLoading } = useDeleteShortcut();\n const { toggleShortcut, loading: toggleLoading } = useToggleShortcut();\n const { seedDefaultShortcuts, loading: seedLoading } = useSeedDefaultShortcuts();\n\n const handleDelete = async (id: string) => {\n void nativeImpact('medium');\n const message = tr('shortcuts.confirmDelete', 'Are you sure you want to delete this shortcut?');\n const native = await nativeConfirm({\n title: 'Delete shortcut',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok =\n native === null\n ? await confirm({\n title: 'Delete shortcut',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n destructive: true,\n })\n : native;\n if (!ok) return;\n\n try {\n await deleteShortcut(id);\n void nativeNotify('success');\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete shortcut:', error);\n }\n };\n\n const handleToggle = async (id: string, currentEnabled: boolean) => {\n void nativeImpact('medium');\n try {\n await toggleShortcut(id, !currentEnabled);\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to toggle shortcut:', error);\n }\n };\n\n const handleSeedDefaults = async () => {\n void nativeImpact('light');\n const message = tr(\n 'shortcuts.confirmSeedDefaults',\n 'This will create default global shortcuts. Continue?'\n );\n const native = await nativeConfirm({\n title: 'Seed defaults',\n message,\n okButtonTitle: 'Continue',\n cancelButtonTitle: 'Cancel',\n });\n const ok =\n native === null\n ? await confirm({\n title: 'Seed defaults',\n message,\n okButtonTitle: 'Continue',\n cancelButtonTitle: 'Cancel',\n })\n : native;\n if (!ok) return;\n\n try {\n const result = await seedDefaultShortcuts();\n const count = result.data?.seedDefaultShortcuts || 0;\n void nativeNotify('success');\n alert(`Created ${count} default shortcuts.`);\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to seed shortcuts:', error);\n }\n };\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <div className=\"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-4\">\n <div>\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary mb-2\">\n <GradientText>{tr('shortcuts.title', 'Keyboard Shortcuts')}</GradientText>\n </h1>\n <p className=\"text-text-secondary\">\n {tr('shortcuts.subtitle', 'Manage keyboard shortcuts across all Burdenoff products')}\n </p>\n </div>\n\n <PermissionGate role=\"super_admin\">\n <CTAOverflowMenu\n primary={{\n label: tr('shortcuts.createShortcut', 'Create Shortcut'),\n onSelect: () => navigate(`${basePath}/shortcuts/new`),\n icon: <Plus className=\"size-4\" />,\n }}\n actions={[\n {\n label: tr('shortcuts.seedDefaults', 'Seed Defaults'),\n onSelect: () => {\n void handleSeedDefaults();\n },\n disabled: seedLoading,\n icon: <Sparkles className=\"size-4\" />,\n },\n ]}\n />\n </PermissionGate>\n </div>\n\n {/* Search and Filters */}\n <div className=\"flex gap-4\">\n {/* Search */}\n <SearchInput\n value={searchQuery}\n onChange={setSearchQuery}\n placeholder={tr('shortcuts.searchPlaceholder', 'Search shortcuts...')}\n className=\"flex-1\"\n />\n\n {/* Category Filter */}\n <select\n value={filter.category || ''}\n onChange={(e) =>\n setFilter({\n ...filter,\n category: e.target.value || undefined,\n })\n }\n className=\"\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n \"\n >\n <option value=\"\">{tr('shortcuts.allCategories', 'All Categories')}</option>\n {Object.values(ShortcutCategories).map((cat) => (\n <option key={cat} value={cat}>\n {cat}\n </option>\n ))}\n </select>\n\n {/* Enabled Filter */}\n <select\n value={\n filter.isEnabled === undefined || filter.isEnabled === null\n ? ''\n : filter.isEnabled.toString()\n }\n onChange={(e) =>\n setFilter({\n ...filter,\n isEnabled: e.target.value === '' ? undefined : e.target.value === 'true',\n })\n }\n className=\"\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n \"\n >\n <option value=\"\">{tr('shortcuts.allStatus', 'All Status')}</option>\n <option value=\"true\">{tr('shortcuts.enabled', 'Enabled')}</option>\n <option value=\"false\">{tr('shortcuts.disabled', 'Disabled')}</option>\n </select>\n\n {/* Refresh */}\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n \"\n >\n <RefreshCw size={18} />\n </button>\n </div>\n </div>\n\n {/* Body — header above stays mounted across refetches so the search keeps focus. */}\n {error ? (\n <ErrorState\n message={error.message}\n action={{ label: tr('productCommon.retry', 'Retry'), onClick: () => refetch() }}\n />\n ) : loading && shortcuts.length === 0 ? (\n <LoadingState message={tr('shortcuts.loadingShortcuts', 'Loading keyboard shortcuts...')} />\n ) : shortcuts.length === 0 ? (\n <GlassCard treatment=\"insight\" className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={\n searchQuery || filter.category || filter.isEnabled !== undefined\n ? 'empty-search'\n : 'empty-data'\n }\n title={tr('shortcuts.noShortcutsFound', 'No keyboard shortcuts found')}\n action={\n <div className=\"flex flex-wrap items-center justify-center gap-3\">\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={handleSeedDefaults}\n disabled={seedLoading}\n >\n <Sparkles className=\"size-4\" />\n {tr('shortcuts.seedDefaults', 'Seed Defaults')}\n </Button>\n <Button type=\"button\" onClick={() => navigate(`${basePath}/shortcuts/new`)}>\n <Plus className=\"size-4\" />\n {tr('shortcuts.createShortcut', 'Create Shortcut')}\n </Button>\n </div>\n }\n />\n </GlassCard>\n ) : (\n <GlassCard treatment=\"insight\" className=\"overflow-hidden p-0\">\n <table className=\"w-full\">\n <thead className=\"bg-bg-sunken/60 border-b border-border-seam\">\n <tr>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnShortcut', 'Shortcut')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnLabel', 'Label')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnCategory', 'Category')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnEvent', 'Event')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnProduct', 'Product')}\n </th>\n <th className=\"text-center px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnEnabled', 'Enabled')}\n </th>\n <th className=\"text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnActions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border-seam\">\n {shortcuts.map((shortcut) => (\n <tr\n key={shortcut.id}\n className=\"hover:bg-bg-sunken/70 transition-colors duration-200\"\n >\n <td className=\"px-6 py-4\">\n <ShortcutKeyBadge\n shortcutKey={shortcut.shortcutKey}\n isSequence={shortcut.isSequence}\n />\n </td>\n <td className=\"px-6 py-4\">\n <div>\n <p className=\"font-medium text-text-primary\">{shortcut.label}</p>\n {shortcut.description && (\n <p className=\"text-sm text-text-tertiary line-clamp-1\">\n {shortcut.description}\n </p>\n )}\n </div>\n </td>\n <td className=\"px-6 py-4\">\n <ShortcutCategoryBadge category={shortcut.category} />\n </td>\n <td className=\"px-6 py-4\">\n <code className=\"text-sm text-text-secondary bg-bg-sunken px-1.5 py-0.5 rounded font-mono\">\n {shortcut.eventName}\n </code>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-primary\">\n {shortcut.product?.name || (\n <span className=\"text-text-tertiary italic\">\n {tr('shortcuts.global', 'Global')}\n </span>\n )}\n </span>\n </td>\n <td className=\"px-6 py-4 text-center\">\n <button\n type=\"button\"\n onClick={() => handleToggle(shortcut.id, shortcut.isEnabled)}\n disabled={toggleLoading}\n className={`\n p-1 rounded-lg transition-all duration-200\n ${\n shortcut.isEnabled\n ? 'text-[var(--color-status-success)] hover:bg-[var(--color-status-success-subtle)]'\n : 'text-text-tertiary hover:bg-bg-sunken'\n }\n disabled:opacity-50\n `}\n title={\n shortcut.isEnabled\n ? tr('shortcuts.disable', 'Disable')\n : tr('shortcuts.enable', 'Enable')\n }\n >\n {shortcut.isEnabled ? <ToggleRight size={24} /> : <ToggleLeft size={24} />}\n </button>\n </td>\n <td className=\"px-6 py-4\">\n <div className=\"flex items-center justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/${shortcut.id}`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200\"\n title={tr('shortcuts.viewDetails', 'View details')}\n >\n <Eye size={18} />\n </button>\n <PermissionGate role=\"super_admin\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/${shortcut.id}/edit`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200\"\n title={tr('shortcuts.edit', 'Edit')}\n >\n <SquarePen size={18} />\n </button>\n <button\n type=\"button\"\n onClick={() => handleDelete(shortcut.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('shortcuts.delete', 'Delete')}\n >\n <Trash2 size={18} />\n </button>\n </PermissionGate>\n </div>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </GlassCard>\n )}\n {ConfirmDialog}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsCA,SAAgB,IAAoB;CAClC,IAAM,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAK,GAAO,EACZ,EAAE,YAAS,qBAAkB,GAAkB,EAC/C,CAAC,GAAa,KAAkB,EAAS,GAAG,EAE5C,IAAuB,EAAa,GAAa,IAAI,EACrD,CAAC,GAAQ,KAAa,EAAsC,EAAE,CAAC,EAE/D,EAAE,cAAW,YAAS,UAAO,eAAY,EAC7C;EAAE,GAAG;EAAQ,QAAQ,KAAwB,KAAA;EAAW,EACxD,EAAE,OAAO,IAAI,CACd,EAEK,EAAE,mBAAgB,SAAS,MAAkB,GAAmB,EAChE,EAAE,mBAAgB,SAAS,MAAkB,GAAmB,EAChE,EAAE,yBAAsB,SAAS,MAAgB,GAAyB,EAE1E,KAAe,OAAO,MAAe;AACpC,IAAa,SAAS;EAC3B,IAAM,IAAU,EAAG,2BAA2B,iDAAiD,EACzF,IAAS,MAAM,EAAc;GACjC,OAAO;GACP;GACA,eAAe;GACf,mBAAmB;GACpB,CAAC;AAEA,YAAW,OACP,MAAM,EAAQ;GACZ,OAAO;GACP;GACA,eAAe;GACf,mBAAmB;GACnB,aAAa;GACd,CAAC,GACF,EA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qB,UAAU,GAClC,EAAG,oBAAoB,SAAS;oBAGrC,EAAS,YAAY,kBAAC,GAAD,EAAa,MAAM,IAAM,CAAA,GAAG,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;UACnE,CAAA;SACN,CAAA;QACL,kBAAC,MAAD;SAAI,WAAU;mBACZ,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,UAAD;WACE,MAAK;WACL,eAAe,EAAS,GAAG,EAAS,aAAa,EAAS,KAAK;WAC/D,WAAU;WACV,OAAO,EAAG,yBAAyB,eAAe;qBAElD,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;WACV,CAAA,EACT,kBAAC,GAAD;WAAgB,MAAK;qBAArB,CACE,kBAAC,UAAD;YACE,MAAK;YACL,eAAe,EAAS,GAAG,EAAS,aAAa,EAAS,GAAG,OAAO;YACpE,WAAU;YACV,OAAO,EAAG,kBAAkB,OAAO;sBAEnC,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;YAChB,CAAA,EACT,kBAAC,UAAD;YACE,MAAK;YACL,eAAe,GAAa,EAAS,GAAG;YACxC,UAAU;YACV,WAAU;YACV,OAAO,EAAG,oBAAoB,SAAS;sBAEvC,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;YACb,CAAA,CACM;aACb;;SACH,CAAA;QACF;SA1FE,EAAS,GA0FX,CACL;MACI,CAAA,CACF;;IACE,CAAA;GAEb;GACG"}
@@ -35,7 +35,7 @@ function c({ resourceId: c, resourceType: l }) {
35
35
  minute: "2-digit"
36
36
  });
37
37
  return /* @__PURE__ */ a("div", {
38
- className: "divide-y divide-[var(--color-border-default)]",
38
+ className: "divide-y divide-border-seam",
39
39
  children: p.map((e) => /* @__PURE__ */ o("div", {
40
40
  className: "flex items-start gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
41
41
  children: [
@@ -1 +1 @@
1
- {"version":3,"file":"AuditHistoryTab.js","names":[],"sources":["../../../../src/product-management/shared/components/AuditHistoryTab.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client/react';\nimport { Clock, User, AlertCircle } from 'lucide-react';\nimport {\n GetEntityActivityLogsDocument,\n type GetEntityActivityLogsQuery,\n} from '../../../generated/global-operations';\nimport { LoadingState } from './feedback/LoadingState';\n\ntype ActivityLog = NonNullable<GetEntityActivityLogsQuery['activityLogs']['nodes'][number]>;\n\ninterface AuditHistoryTabProps {\n resourceId: string;\n resourceType: string;\n}\n\nexport function AuditHistoryTab({ resourceId, resourceType }: AuditHistoryTabProps) {\n const { data, loading, error } = useQuery(GetEntityActivityLogsDocument, {\n variables: { resourceId, resourceType, limit: 50, offset: 0 },\n fetchPolicy: 'cache-and-network',\n });\n\n if (loading) return <LoadingState message=\"Loading activity history…\" />;\n\n if (error) {\n return (\n <div className=\"flex items-center gap-2 text-[var(--color-status-error)] p-4\">\n <AlertCircle size={16} />\n <span className=\"text-sm\">{error.message}</span>\n </div>\n );\n }\n\n const logs = data?.activityLogs?.nodes ?? [];\n\n if (logs.length === 0) {\n return <p className=\"text-sm text-text-secondary p-4\">No activity recorded yet.</p>;\n }\n\n const formatDate = (dateString: string) =>\n new Date(dateString).toLocaleString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n\n return (\n <div className=\"divide-y divide-[var(--color-border-default)]\">\n {logs.map((log: ActivityLog) => (\n <div\n key={log.id}\n className=\"flex items-start gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors\"\n >\n <div className=\"size-8 rounded-full bg-[var(--color-status-info-subtle)] flex items-center justify-center shrink-0\">\n <User size={14} className=\"text-[var(--color-status-info)]\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm text-text-primary\">\n <span className=\"font-medium\">{log.actorId ?? 'system'}</span>{' '}\n <span className=\"text-text-secondary\">{log.description ?? log.action}</span>\n </p>\n {log.metadata &&\n typeof log.metadata === 'object' &&\n Object.keys(log.metadata as object).length > 0 && (\n <p className=\"text-xs text-text-tertiary font-mono mt-0.5 truncate\">\n {JSON.stringify(log.metadata)}\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-1 text-xs text-text-tertiary shrink-0\">\n <Clock size={12} />\n <span>{formatDate(log.createdAt)}</span>\n </div>\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;AAeA,SAAgB,EAAgB,EAAE,eAAY,mBAAsC;CAClF,IAAM,EAAE,SAAM,YAAS,aAAU,EAAS,GAA+B;EACvE,WAAW;GAAE;GAAY;GAAc,OAAO;GAAI,QAAQ;GAAG;EAC7D,aAAa;EACd,CAAC;AAEF,KAAI,EAAS,QAAO,kBAAC,GAAD,EAAc,SAAQ,6BAA8B,CAAA;AAExE,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD,EAAa,MAAM,IAAM,CAAA,EACzB,kBAAC,QAAD;GAAM,WAAU;aAAW,EAAM;GAAe,CAAA,CAC5C;;CAIV,IAAM,IAAO,GAAM,cAAc,SAAS,EAAE;AAE5C,KAAI,EAAK,WAAW,EAClB,QAAO,kBAAC,KAAD;EAAG,WAAU;YAAkC;EAA6B,CAAA;CAGrF,IAAM,KAAc,MAClB,IAAI,KAAK,EAAW,CAAC,eAAe,SAAS;EAC3C,MAAM;EACN,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;EACT,CAAC;AAEJ,QACE,kBAAC,OAAD;EAAK,WAAU;YACZ,EAAK,KAAK,MACT,kBAAC,OAAD;GAEE,WAAU;aAFZ;IAIE,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD;MAAM,MAAM;MAAI,WAAU;MAAoC,CAAA;KAC1D,CAAA;IACN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,KAAD;MAAG,WAAU;gBAAb;OACE,kBAAC,QAAD;QAAM,WAAU;kBAAe,EAAI,WAAW;QAAgB,CAAA;OAAC;OAC/D,kBAAC,QAAD;QAAM,WAAU;kBAAuB,EAAI,eAAe,EAAI;QAAc,CAAA;OAC1E;SACH,EAAI,YACH,OAAO,EAAI,YAAa,YACxB,OAAO,KAAK,EAAI,SAAmB,CAAC,SAAS,KAC3C,kBAAC,KAAD;MAAG,WAAU;gBACV,KAAK,UAAU,EAAI,SAAS;MAC3B,CAAA,CAEJ;;IACN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA,EACnB,kBAAC,QAAD,EAAA,UAAO,EAAW,EAAI,UAAU,EAAQ,CAAA,CACpC;;IACF;KAvBC,EAAI,GAuBL,CACN;EACE,CAAA"}
1
+ {"version":3,"file":"AuditHistoryTab.js","names":[],"sources":["../../../../src/product-management/shared/components/AuditHistoryTab.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client/react';\nimport { Clock, User, AlertCircle } from 'lucide-react';\nimport {\n GetEntityActivityLogsDocument,\n type GetEntityActivityLogsQuery,\n} from '../../../generated/global-operations';\nimport { LoadingState } from './feedback/LoadingState';\n\ntype ActivityLog = NonNullable<GetEntityActivityLogsQuery['activityLogs']['nodes'][number]>;\n\ninterface AuditHistoryTabProps {\n resourceId: string;\n resourceType: string;\n}\n\nexport function AuditHistoryTab({ resourceId, resourceType }: AuditHistoryTabProps) {\n const { data, loading, error } = useQuery(GetEntityActivityLogsDocument, {\n variables: { resourceId, resourceType, limit: 50, offset: 0 },\n fetchPolicy: 'cache-and-network',\n });\n\n if (loading) return <LoadingState message=\"Loading activity history…\" />;\n\n if (error) {\n return (\n <div className=\"flex items-center gap-2 text-[var(--color-status-error)] p-4\">\n <AlertCircle size={16} />\n <span className=\"text-sm\">{error.message}</span>\n </div>\n );\n }\n\n const logs = data?.activityLogs?.nodes ?? [];\n\n if (logs.length === 0) {\n return <p className=\"text-sm text-text-secondary p-4\">No activity recorded yet.</p>;\n }\n\n const formatDate = (dateString: string) =>\n new Date(dateString).toLocaleString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n\n return (\n <div className=\"divide-y divide-border-seam\">\n {logs.map((log: ActivityLog) => (\n <div\n key={log.id}\n className=\"flex items-start gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors\"\n >\n <div className=\"size-8 rounded-full bg-[var(--color-status-info-subtle)] flex items-center justify-center shrink-0\">\n <User size={14} className=\"text-[var(--color-status-info)]\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm text-text-primary\">\n <span className=\"font-medium\">{log.actorId ?? 'system'}</span>{' '}\n <span className=\"text-text-secondary\">{log.description ?? log.action}</span>\n </p>\n {log.metadata &&\n typeof log.metadata === 'object' &&\n Object.keys(log.metadata as object).length > 0 && (\n <p className=\"text-xs text-text-tertiary font-mono mt-0.5 truncate\">\n {JSON.stringify(log.metadata)}\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-1 text-xs text-text-tertiary shrink-0\">\n <Clock size={12} />\n <span>{formatDate(log.createdAt)}</span>\n </div>\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;AAeA,SAAgB,EAAgB,EAAE,eAAY,mBAAsC;CAClF,IAAM,EAAE,SAAM,YAAS,aAAU,EAAS,GAA+B;EACvE,WAAW;GAAE;GAAY;GAAc,OAAO;GAAI,QAAQ;GAAG;EAC7D,aAAa;EACd,CAAC;AAEF,KAAI,EAAS,QAAO,kBAAC,GAAD,EAAc,SAAQ,6BAA8B,CAAA;AAExE,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD,EAAa,MAAM,IAAM,CAAA,EACzB,kBAAC,QAAD;GAAM,WAAU;aAAW,EAAM;GAAe,CAAA,CAC5C;;CAIV,IAAM,IAAO,GAAM,cAAc,SAAS,EAAE;AAE5C,KAAI,EAAK,WAAW,EAClB,QAAO,kBAAC,KAAD;EAAG,WAAU;YAAkC;EAA6B,CAAA;CAGrF,IAAM,KAAc,MAClB,IAAI,KAAK,EAAW,CAAC,eAAe,SAAS;EAC3C,MAAM;EACN,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;EACT,CAAC;AAEJ,QACE,kBAAC,OAAD;EAAK,WAAU;YACZ,EAAK,KAAK,MACT,kBAAC,OAAD;GAEE,WAAU;aAFZ;IAIE,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD;MAAM,MAAM;MAAI,WAAU;MAAoC,CAAA;KAC1D,CAAA;IACN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,KAAD;MAAG,WAAU;gBAAb;OACE,kBAAC,QAAD;QAAM,WAAU;kBAAe,EAAI,WAAW;QAAgB,CAAA;OAAC;OAC/D,kBAAC,QAAD;QAAM,WAAU;kBAAuB,EAAI,eAAe,EAAI;QAAc,CAAA;OAC1E;SACH,EAAI,YACH,OAAO,EAAI,YAAa,YACxB,OAAO,KAAK,EAAI,SAAmB,CAAC,SAAS,KAC3C,kBAAC,KAAD;MAAG,WAAU;gBACV,KAAK,UAAU,EAAI,SAAS;MAC3B,CAAA,CAEJ;;IACN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA,EACnB,kBAAC,QAAD,EAAA,UAAO,EAAW,EAAI,UAAU,EAAQ,CAAA,CACpC;;IACF;KAvBC,EAAI,GAuBL,CACN;EACE,CAAA"}
@@ -1,20 +1,2 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { EmptyState as t } from "@burdenoff/fe-libs/ui";
3
- //#region src/product-management/shared/components/feedback/EmptyState.tsx
4
- function n({ icon: n, title: r, description: i, action: a }) {
5
- return /* @__PURE__ */ e(t, {
6
- icon: n,
7
- title: r,
8
- description: i,
9
- action: a ? /* @__PURE__ */ e("button", {
10
- type: "button",
11
- onClick: a.onClick,
12
- className: "\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90\n transition-all duration-200\n font-medium\n ",
13
- children: a.label
14
- }) : void 0
15
- });
16
- }
17
- //#endregion
18
- export { n as EmptyState };
19
-
20
- //# sourceMappingURL=EmptyState.js.map
1
+ import "react/jsx-runtime";
2
+ import "@burdenoff/fe-libs/ui";
@@ -0,0 +1,44 @@
1
+ import { useCallback as e, useRef as t, useState as n } from "react";
2
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
3
+ import { AlertDialog as a, AlertDialogAction as o, AlertDialogCancel as s, AlertDialogContent as c, AlertDialogDescription as l, AlertDialogFooter as u, AlertDialogHeader as d, AlertDialogTitle as f } from "@burdenoff/fe-libs/ui";
4
+ //#region src/product-management/shared/hooks/useConfirmDialog.tsx
5
+ function p() {
6
+ let [p, m] = n({
7
+ open: !1,
8
+ title: "",
9
+ message: ""
10
+ }), h = t(null), g = e((e) => (m({
11
+ ...e,
12
+ open: !0
13
+ }), new Promise((e) => {
14
+ h.current = e;
15
+ })), []), _ = e((e) => {
16
+ m((e) => ({
17
+ ...e,
18
+ open: !1
19
+ }));
20
+ let t = h.current;
21
+ h.current = null, t?.(e);
22
+ }, []);
23
+ return {
24
+ confirm: g,
25
+ ConfirmDialog: /* @__PURE__ */ r(a, {
26
+ open: p.open,
27
+ onOpenChange: (e) => {
28
+ e || _(!1);
29
+ },
30
+ children: /* @__PURE__ */ i(c, { children: [/* @__PURE__ */ i(d, { children: [/* @__PURE__ */ r(f, { children: p.title }), /* @__PURE__ */ r(l, { children: p.message })] }), /* @__PURE__ */ i(u, { children: [/* @__PURE__ */ r(s, {
31
+ onClick: () => _(!1),
32
+ children: p.cancelButtonTitle ?? "Cancel"
33
+ }), /* @__PURE__ */ r(o, {
34
+ onClick: () => _(!0),
35
+ className: p.destructive ? "bg-[var(--color-action-danger-bg)] text-[var(--color-action-danger-text)] hover:bg-[var(--color-action-danger-bg-hover)]" : void 0,
36
+ children: p.okButtonTitle ?? "OK"
37
+ })] })] })
38
+ })
39
+ };
40
+ }
41
+ //#endregion
42
+ export { p as useConfirmDialog };
43
+
44
+ //# sourceMappingURL=useConfirmDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConfirmDialog.js","names":[],"sources":["../../../../src/product-management/shared/hooks/useConfirmDialog.tsx"],"sourcesContent":["import { useCallback, useRef, useState } from 'react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '@burdenoff/fe-libs/ui';\n\nexport interface ConfirmDialogOptions {\n title: string;\n message: string;\n okButtonTitle?: string;\n cancelButtonTitle?: string;\n /** Destructive intent styles the confirm action with the danger token. */\n destructive?: boolean;\n}\n\ninterface ConfirmDialogState extends ConfirmDialogOptions {\n open: boolean;\n}\n\n/**\n * Promise-based confirmation backed by fe-libs `AlertDialog`.\n *\n * Drop-in replacement for the web `window.confirm()` fallback used alongside\n * the native bridge: `confirm()` resolves to `true`/`false` exactly like\n * `window.confirm`, so existing `const ok = native === null ? await confirm(...) : native`\n * gates keep their semantics. Render the returned `ConfirmDialog` element once\n * in the component tree.\n */\nexport function useConfirmDialog() {\n const [state, setState] = useState<ConfirmDialogState>({\n open: false,\n title: '',\n message: '',\n });\n const resolverRef = useRef<((value: boolean) => void) | null>(null);\n\n const confirm = useCallback((options: ConfirmDialogOptions): Promise<boolean> => {\n setState({ ...options, open: true });\n return new Promise<boolean>((resolve) => {\n resolverRef.current = resolve;\n });\n }, []);\n\n const settle = useCallback((value: boolean) => {\n setState((prev) => ({ ...prev, open: false }));\n const resolver = resolverRef.current;\n resolverRef.current = null;\n resolver?.(value);\n }, []);\n\n const ConfirmDialog = (\n <AlertDialog\n open={state.open}\n onOpenChange={(next) => {\n if (!next) settle(false);\n }}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{state.title}</AlertDialogTitle>\n <AlertDialogDescription>{state.message}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel onClick={() => settle(false)}>\n {state.cancelButtonTitle ?? 'Cancel'}\n </AlertDialogCancel>\n <AlertDialogAction\n onClick={() => settle(true)}\n className={\n state.destructive\n ? 'bg-[var(--color-action-danger-bg)] text-[var(--color-action-danger-text)] hover:bg-[var(--color-action-danger-bg-hover)]'\n : undefined\n }\n >\n {state.okButtonTitle ?? 'OK'}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n\n return { confirm, ConfirmDialog };\n}\n"],"mappings":";;;;AAkCA,SAAgB,IAAmB;CACjC,IAAM,CAAC,GAAO,KAAY,EAA6B;EACrD,MAAM;EACN,OAAO;EACP,SAAS;EACV,CAAC,EACI,IAAc,EAA0C,KAAK,EAE7D,IAAU,GAAa,OAC3B,EAAS;EAAE,GAAG;EAAS,MAAM;EAAM,CAAC,EAC7B,IAAI,SAAkB,MAAY;AACvC,IAAY,UAAU;GACtB,GACD,EAAE,CAAC,EAEA,IAAS,GAAa,MAAmB;AAC7C,KAAU,OAAU;GAAE,GAAG;GAAM,MAAM;GAAO,EAAE;EAC9C,IAAM,IAAW,EAAY;AAE7B,EADA,EAAY,UAAU,MACtB,IAAW,EAAM;IAChB,EAAE,CAAC;AAiCN,QAAO;EAAE;EAAS,eA9BhB,kBAAC,GAAD;GACE,MAAM,EAAM;GACZ,eAAe,MAAS;AACtB,IAAK,KAAM,EAAO,GAAM;;aAG1B,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAmB,EAAM,OAAyB,CAAA,EAClD,kBAAC,GAAD,EAAA,UAAyB,EAAM,SAAiC,CAAA,CAC9C,EAAA,CAAA,EACpB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;IAAmB,eAAe,EAAO,GAAM;cAC5C,EAAM,qBAAqB;IACV,CAAA,EACpB,kBAAC,GAAD;IACE,eAAe,EAAO,GAAK;IAC3B,WACE,EAAM,cACF,6HACA,KAAA;cAGL,EAAM,iBAAiB;IACN,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA;GACT,CAGE;EAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-product",
3
- "version": "2026.624.2",
3
+ "version": "2026.625.1",
4
4
  "description": "Product management microfrontend for Burdenoff products",
5
5
  "type": "module",
6
6
  "files": [
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@apollo/client": "^3.12.0",
44
- "@burdenoff/fe-libs": "2026.529.5",
44
+ "@burdenoff/fe-libs": "2026.625.3",
45
45
  "@tanstack/react-query": "^5.90.16",
46
46
  "@xmldom/xmldom": "0.8.13",
47
47
  "ajv": "8.20.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"EmptyState.js","names":[],"sources":["../../../../../src/product-management/shared/components/feedback/EmptyState.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { EmptyState as CanonicalEmptyState } from '@burdenoff/fe-libs/ui';\n\ninterface EmptyStateProps {\n icon: ReactNode;\n title: string;\n description: string;\n action?: {\n label: string;\n onClick: () => void;\n };\n}\n\n/**\n * Local wrapper around the canonical `EmptyState` from `@burdenoff/fe-libs/ui`.\n *\n * Maps the legacy microfe-product local shape (`action: { label, onClick }`)\n * onto the canonical shape (`action: ReactNode`). Keeps existing call sites\n * stable while routing all empty-state rendering through the shared primitive.\n */\nexport function EmptyState({ icon, title, description, action }: EmptyStateProps) {\n return (\n <CanonicalEmptyState\n icon={icon}\n title={title}\n description={description}\n action={\n action ? (\n <button\n type=\"button\"\n onClick={action.onClick}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90\n transition-all duration-200\n font-medium\n \"\n >\n {action.label}\n </button>\n ) : undefined\n }\n />\n );\n}\n"],"mappings":";;;AAoBA,SAAgB,EAAW,EAAE,SAAM,UAAO,gBAAa,aAA2B;AAChF,QACE,kBAAC,GAAD;EACQ;EACC;EACM;EACb,QACE,IACE,kBAAC,UAAD;GACE,MAAK;GACL,SAAS,EAAO;GAChB,WAAU;aAUT,EAAO;GACD,CAAA,GACP,KAAA;EAEN,CAAA"}