@burdenoff/microfe-product 2026.625.1 → 2026.626.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/pages/ContentPageViewPage.js +40 -36
- package/dist/product/pages/ContentPageViewPage.js.map +1 -1
- package/dist/product/pages/ProductCatalogPage.js +71 -63
- package/dist/product/pages/ProductCatalogPage.js.map +1 -1
- package/dist/product/pages/ProductViewPage.js +218 -181
- package/dist/product/pages/ProductViewPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js +27 -25
- package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js +99 -72
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js +32 -30
- package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js +96 -91
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js +25 -23
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js +136 -111
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js +35 -33
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js +130 -126
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js +27 -25
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js +95 -70
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js +32 -30
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js +63 -58
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js.map +1 -1
- package/dist/product-management/modules/products/components/ProductPlans.js +132 -143
- package/dist/product-management/modules/products/components/ProductPlans.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductCreatePage.js +27 -25
- package/dist/product-management/modules/products/pages/ProductCreatePage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductDetailPage.js +142 -114
- package/dist/product-management/modules/products/pages/ProductDetailPage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductEditPage.js +31 -29
- package/dist/product-management/modules/products/pages/ProductEditPage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductsListPage.js +218 -210
- package/dist/product-management/modules/products/pages/ProductsListPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js +27 -22
- package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js +156 -129
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js +30 -25
- package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js +140 -132
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js.map +1 -1
- package/dist/product-management/shared/components/AuditHistoryTab.js +18 -16
- package/dist/product-management/shared/components/AuditHistoryTab.js.map +1 -1
- package/package.json +2 -2
|
@@ -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 {\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,cAA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vC,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;YACb,CAAA,CACM;aACb;;SACH,CAAA;QACF;SA1FE,EAAS,GA0FX,CACL;MACI,CAAA,CACF;;IACE,CAAA;GAEb;GACG"}
|
|
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 PagePurpose,\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 <PagePurpose className=\"mb-4\">\n {tr(\n 'shortcuts.purpose',\n 'Keyboard shortcuts map a key combination to an in-app event so power users can move fast. Define product-specific or global shortcuts, enable or disable them on the fly, and use \"Seed Defaults\" to load the standard set in one click.'\n )}\n </PagePurpose>\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=\"glass\" glow 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 <Tr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,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"}
|
|
@@ -2,32 +2,34 @@ import { LoadingState as e } from "./feedback/LoadingState.js";
|
|
|
2
2
|
import { GetEntityActivityLogsDocument as t } from "../../../generated/global-operations.js";
|
|
3
3
|
import { AlertCircle as n, Clock as r, User as i } from "lucide-react";
|
|
4
4
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
5
|
+
import { IllustratedEmptyState as s } from "@burdenoff/fe-libs/ui";
|
|
6
|
+
import { useQuery as c } from "@apollo/client/react";
|
|
6
7
|
//#region src/product-management/shared/components/AuditHistoryTab.tsx
|
|
7
|
-
function
|
|
8
|
-
let { data:
|
|
8
|
+
function l({ resourceId: l, resourceType: u }) {
|
|
9
|
+
let { data: d, loading: f, error: p } = c(t, {
|
|
9
10
|
variables: {
|
|
10
|
-
resourceId:
|
|
11
|
-
resourceType:
|
|
11
|
+
resourceId: l,
|
|
12
|
+
resourceType: u,
|
|
12
13
|
limit: 50,
|
|
13
14
|
offset: 0
|
|
14
15
|
},
|
|
15
16
|
fetchPolicy: "cache-and-network"
|
|
16
17
|
});
|
|
17
|
-
if (
|
|
18
|
-
if (
|
|
18
|
+
if (f) return /* @__PURE__ */ a(e, { message: "Loading activity history…" });
|
|
19
|
+
if (p) return /* @__PURE__ */ o("div", {
|
|
19
20
|
className: "flex items-center gap-2 text-[var(--color-status-error)] p-4",
|
|
20
21
|
children: [/* @__PURE__ */ a(n, { size: 16 }), /* @__PURE__ */ a("span", {
|
|
21
22
|
className: "text-sm",
|
|
22
|
-
children:
|
|
23
|
+
children: p.message
|
|
23
24
|
})]
|
|
24
25
|
});
|
|
25
|
-
let
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
let m = d?.activityLogs?.nodes ?? [];
|
|
27
|
+
if (m.length === 0) return /* @__PURE__ */ a(s, {
|
|
28
|
+
illustration: "empty-notifications",
|
|
29
|
+
title: "No activity yet",
|
|
30
|
+
description: "Changes to this item — who edited what and when — will appear here as they happen."
|
|
29
31
|
});
|
|
30
|
-
let
|
|
32
|
+
let h = (e) => new Date(e).toLocaleString("en-US", {
|
|
31
33
|
year: "numeric",
|
|
32
34
|
month: "short",
|
|
33
35
|
day: "numeric",
|
|
@@ -36,7 +38,7 @@ function c({ resourceId: c, resourceType: l }) {
|
|
|
36
38
|
});
|
|
37
39
|
return /* @__PURE__ */ a("div", {
|
|
38
40
|
className: "divide-y divide-border-seam",
|
|
39
|
-
children:
|
|
41
|
+
children: m.map((e) => /* @__PURE__ */ o("div", {
|
|
40
42
|
className: "flex items-start gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
|
|
41
43
|
children: [
|
|
42
44
|
/* @__PURE__ */ a("div", {
|
|
@@ -68,13 +70,13 @@ function c({ resourceId: c, resourceType: l }) {
|
|
|
68
70
|
}),
|
|
69
71
|
/* @__PURE__ */ o("div", {
|
|
70
72
|
className: "flex items-center gap-1 text-xs text-text-tertiary shrink-0",
|
|
71
|
-
children: [/* @__PURE__ */ a(r, { size: 12 }), /* @__PURE__ */ a("span", { children:
|
|
73
|
+
children: [/* @__PURE__ */ a(r, { size: 12 }), /* @__PURE__ */ a("span", { children: h(e.createdAt) })]
|
|
72
74
|
})
|
|
73
75
|
]
|
|
74
76
|
}, e.id))
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
79
|
//#endregion
|
|
78
|
-
export {
|
|
80
|
+
export { l as AuditHistoryTab };
|
|
79
81
|
|
|
80
82
|
//# sourceMappingURL=AuditHistoryTab.js.map
|
|
@@ -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 <
|
|
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 { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\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 (\n <IllustratedEmptyState\n illustration=\"empty-notifications\"\n title=\"No activity yet\"\n description=\"Changes to this item — who edited what and when — will appear here as they happen.\"\n />\n );\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":";;;;;;;AAgBA,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,QACE,kBAAC,GAAD;EACE,cAAa;EACb,OAAM;EACN,aAAY;EACZ,CAAA;CAIN,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-product",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.626.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.625.
|
|
44
|
+
"@burdenoff/fe-libs": "2026.625.5",
|
|
45
45
|
"@tanstack/react-query": "^5.90.16",
|
|
46
46
|
"@xmldom/xmldom": "0.8.13",
|
|
47
47
|
"ajv": "8.20.0",
|