@burdenoff/microfe-product 2026.731.1 → 2026.817.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 (37) hide show
  1. package/dist/product/ProductUserRoutes.js +1 -1
  2. package/dist/product/ProductUserRoutes.js.map +1 -1
  3. package/dist/product/pages/ContentPageViewPage.js +1 -1
  4. package/dist/product/pages/ContentPageViewPage.js.map +1 -1
  5. package/dist/product/pages/ProductCatalogPage.js.map +1 -1
  6. package/dist/product/pages/ProductViewPage.js +1 -1
  7. package/dist/product/pages/ProductViewPage.js.map +1 -1
  8. package/dist/product-management/ProductManagementRoutes.js +1 -1
  9. package/dist/product-management/ProductManagementRoutes.js.map +1 -1
  10. package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js +1 -1
  11. package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js.map +1 -1
  12. package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js +1 -1
  13. package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js.map +1 -1
  14. package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js +1 -1
  15. package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js.map +1 -1
  16. package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js +1 -1
  17. package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js.map +1 -1
  18. package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js +1 -1
  19. package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js.map +1 -1
  20. package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js +1 -1
  21. package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js.map +1 -1
  22. package/dist/product-management/modules/products/components/ProductPlans.js.map +1 -1
  23. package/dist/product-management/modules/products/pages/ProductDetailPage.js +1 -1
  24. package/dist/product-management/modules/products/pages/ProductDetailPage.js.map +1 -1
  25. package/dist/product-management/modules/products/pages/ProductEditPage.js +1 -1
  26. package/dist/product-management/modules/products/pages/ProductEditPage.js.map +1 -1
  27. package/dist/product-management/modules/products/pages/ProductsListPage.js +35 -32
  28. package/dist/product-management/modules/products/pages/ProductsListPage.js.map +1 -1
  29. package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js +1 -1
  30. package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js.map +1 -1
  31. package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js +1 -1
  32. package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js.map +1 -1
  33. package/dist/product-management/shared/components/feedback/ErrorState.js +20 -15
  34. package/dist/product-management/shared/components/feedback/ErrorState.js.map +1 -1
  35. package/dist/product-management/shared/utils/permission-error.js +23 -0
  36. package/dist/product-management/shared/utils/permission-error.js.map +1 -0
  37. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"ShortcutDetailPage.js","names":[],"sources":["../../../../../src/product-management/modules/shortcuts/pages/ShortcutDetailPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport { ArrowLeft, SquarePen, Trash2, ToggleLeft, ToggleRight } from 'lucide-react';\nimport { Markdown } from '@burdenoff/fe-libs/shared/components';\nimport {\n CTAOverflowMenu,\n EmphasisPanel,\n GradientText,\n NextSteps,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useShortcut, useDeleteShortcut, useToggleShortcut } from '../hooks/useShortcuts';\nimport { ShortcutCategoryBadge } from '../components/ShortcutCategoryBadge';\nimport { ShortcutKeyBadge } from '../components/ShortcutKeyBadge';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\nimport { useConfirmDialog } from '../../../shared/hooks/useConfirmDialog';\n\nexport function ShortcutDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const tr = useTr();\n const { confirm, ConfirmDialog } = useConfirmDialog();\n const shortcutId = id || '';\n\n const { shortcut, loading, error, refetch } = useShortcut(shortcutId);\n const { deleteShortcut, loading: deleteLoading } = useDeleteShortcut();\n const { toggleShortcut, loading: toggleLoading } = useToggleShortcut();\n\n const handleDelete = async () => {\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(shortcutId);\n void nativeNotify('success');\n navigate(`${basePath}/shortcuts`);\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete shortcut:', error);\n }\n };\n\n const handleToggle = async () => {\n if (!shortcut) return;\n void nativeImpact('medium');\n\n try {\n await toggleShortcut(shortcutId, !shortcut.isEnabled);\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to toggle shortcut:', error);\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('shortcuts.loadingShortcut', 'Loading shortcut...')} />\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={{\n label: tr('productCommon.retry', 'Retry'),\n onClick: () => refetch(),\n }}\n />\n </div>\n );\n }\n\n if (!shortcut) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={tr('shortcuts.shortcutNotFound', 'Shortcut not found')}\n action={{\n label: tr('shortcuts.goBack', 'Go Back'),\n onClick: () => navigate(`${basePath}/shortcuts`),\n }}\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-200\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts`)}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-colors duration-200\n \"\n >\n <ArrowLeft size={18} />\n {tr('shortcuts.backToShortcuts', 'Back to Shortcuts')}\n </button>\n\n <div className=\"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4\">\n <div>\n <div className=\"flex flex-wrap items-center gap-3 mb-2\">\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary\">\n <GradientText>{shortcut.label}</GradientText>\n </h1>\n <ShortcutCategoryBadge category={shortcut.category} />\n </div>\n <div className=\"flex items-center gap-3\">\n <ShortcutKeyBadge\n shortcutKey={shortcut.shortcutKey}\n isSequence={shortcut.isSequence}\n />\n <span\n className={`\n inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium\n ${\n shortcut.isEnabled\n ? 'bg-[var(--color-status-success-subtle)] text-[var(--color-status-success)]'\n : 'bg-bg-sunken text-text-tertiary'\n }\n `}\n >\n {shortcut.isEnabled && (\n <span className=\"size-1.5 rounded-full bg-[var(--color-status-success)] motion-safe:animate-vc-glow-pulse\" />\n )}\n {shortcut.isEnabled\n ? tr('shortcuts.enabled', 'Enabled')\n : tr('shortcuts.disabled', 'Disabled')}\n </span>\n </div>\n </div>\n\n <CTAOverflowMenu\n primary={{\n label: tr('shortcuts.edit', 'Edit'),\n onSelect: () => navigate(`${basePath}/shortcuts/${shortcutId}/edit`),\n icon: <SquarePen className=\"size-4\" />,\n }}\n actions={[\n {\n label: shortcut.isEnabled\n ? tr('shortcuts.disable', 'Disable')\n : tr('shortcuts.enable', 'Enable'),\n onSelect: () => {\n void handleToggle();\n },\n disabled: toggleLoading,\n icon: shortcut.isEnabled ? (\n <ToggleLeft className=\"size-4\" />\n ) : (\n <ToggleRight className=\"size-4\" />\n ),\n },\n {\n label: tr('shortcuts.delete', 'Delete'),\n onSelect: () => {\n void handleDelete();\n },\n intent: 'destructive',\n disabled: deleteLoading,\n icon: <Trash2 className=\"size-4\" />,\n },\n ]}\n />\n </div>\n </div>\n\n <PagePurpose className=\"mb-6\">\n {tr(\n 'shortcuts.detailPurpose',\n `This is the \"${shortcut.label}\" shortcut — it fires the \"${shortcut.eventName}\" event when pressed. Review its key bindings (including Mac and Windows/Linux variants), toggle it on or off, or edit it to change the keys or event.`\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"product-shortcut-detail\"\n className=\"mb-6\"\n steps={[\n {\n id: 'edit',\n label: tr('shortcuts.steps.edit', 'Edit this shortcut'),\n description: tr(\n 'shortcuts.steps.editDesc',\n 'Change the key combination, event, category, or per-platform keys.'\n ),\n onClick: () => navigate(`${basePath}/shortcuts/${shortcutId}/edit`),\n },\n {\n id: 'toggle',\n label: shortcut.isEnabled\n ? tr('shortcuts.steps.disable', 'Disable this shortcut')\n : tr('shortcuts.steps.enable', 'Enable this shortcut'),\n description: tr(\n 'shortcuts.steps.toggleDesc',\n 'Turn it on or off without deleting it — useful while testing.'\n ),\n onClick: () => {\n void handleToggle();\n },\n },\n {\n id: 'back',\n label: tr('shortcuts.steps.back', 'Back to all shortcuts'),\n description: tr(\n 'shortcuts.steps.backDesc',\n 'Return to the list to manage the rest of your shortcuts.'\n ),\n onClick: () => navigate(`${basePath}/shortcuts`),\n },\n ]}\n />\n\n {/* Details Grid */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n {/* Main Info Card — the page's emphasis zone */}\n <EmphasisPanel>\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('shortcuts.shortcutDetails', 'Shortcut Details')}\n </h2>\n\n <dl className=\"space-y-4\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.label', 'Label')}\n </dt>\n <dd className=\"text-text-primary mt-1\">{shortcut.label}</dd>\n </div>\n\n {shortcut.description && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.description', 'Description')}\n </dt>\n <dd className=\"text-text-primary mt-1\">\n <Markdown>{shortcut.description}</Markdown>\n </dd>\n </div>\n )}\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.shortcutKey', 'Shortcut Key')}\n </dt>\n <dd className=\"mt-1\">\n <ShortcutKeyBadge\n shortcutKey={shortcut.shortcutKey}\n isSequence={shortcut.isSequence}\n />\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.eventName', 'Event Name')}\n </dt>\n <dd className=\"mt-1\">\n <code className=\"text-sm text-text-secondary bg-bg-sunken px-2 py-1 rounded font-mono\">\n {shortcut.eventName}\n </code>\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.category', 'Category')}\n </dt>\n <dd className=\"mt-1\">\n <ShortcutCategoryBadge category={shortcut.category} />\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.product', 'Product')}\n </dt>\n <dd className=\"text-text-primary mt-1\">\n {shortcut.product?.name || (\n <span className=\"text-text-tertiary italic\">\n {tr('shortcuts.globalAllProducts', 'Global (All Products)')}\n </span>\n )}\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.type', 'Type')}\n </dt>\n <dd className=\"text-text-primary mt-1\">\n {shortcut.isSequence\n ? tr('shortcuts.keySequence', 'Key Sequence')\n : tr('shortcuts.keyCombination', 'Key Combination')}\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.sortOrder', 'Sort Order')}\n </dt>\n <dd className=\"text-text-primary mt-1\">{shortcut.sortOrder}</dd>\n </div>\n </dl>\n </EmphasisPanel>\n\n {/* Platform-Specific Keys Card */}\n <div className=\"bg-bg-surface bg-accent-wash border border-border-seam rounded-card shadow-elevation-1 p-6\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('shortcuts.platformKeys', 'Platform Keys')}\n </h2>\n\n <dl className=\"space-y-4\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.defaultKey', 'Default Key')}\n </dt>\n <dd className=\"mt-1\">\n <ShortcutKeyBadge\n shortcutKey={shortcut.shortcutKey}\n isSequence={shortcut.isSequence}\n />\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.macKey', 'Mac Key')}\n </dt>\n <dd className=\"mt-1\">\n {shortcut.macKey ? (\n <ShortcutKeyBadge shortcutKey={shortcut.macKey} />\n ) : (\n <span className=\"text-text-tertiary italic\">\n {tr('shortcuts.sameAsDefault', 'Same as default')}\n </span>\n )}\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.windowsLinuxKey', 'Windows/Linux Key')}\n </dt>\n <dd className=\"mt-1\">\n {shortcut.windowsKey ? (\n <ShortcutKeyBadge shortcutKey={shortcut.windowsKey} />\n ) : (\n <span className=\"text-text-tertiary italic\">\n {tr('shortcuts.sameAsDefault', 'Same as default')}\n </span>\n )}\n </dd>\n </div>\n </dl>\n\n <div className=\"mt-6 pt-4 border-t border-border-seam\">\n <h3 className=\"text-sm font-semibold text-text-secondary mb-3\">\n {tr('shortcuts.timestamps', 'Timestamps')}\n </h3>\n <dl className=\"space-y-2 text-sm\">\n <div className=\"flex justify-between\">\n <dt className=\"text-text-tertiary\">{tr('shortcuts.created', 'Created')}</dt>\n <dd className=\"text-text-primary\">\n {new Date(shortcut.createdAt).toLocaleString()}\n </dd>\n </div>\n <div className=\"flex justify-between\">\n <dt className=\"text-text-tertiary\">{tr('shortcuts.updated', 'Updated')}</dt>\n <dd className=\"text-text-primary\">\n {new Date(sh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D;OAAK,WAAU;iBAAf,CACE,kBAAC,MAAD;QAAI,WAAU;kBACX,EAAG,wBAAwB,aAAa;QACtC,CAAA,EACL,kBAAC,MAAD;QAAI,WAAU;kBAAd,CACE,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,MAAD;UAAI,WAAU;oBAAsB,EAAG,qBAAqB,UAAU;UAAM,CAAA,EAC5E,kBAAC,MAAD;UAAI,WAAU;oBACX,IAAI,KAAK,EAAS,UAAU,CAAC,gBAAgB;UAC3C,CAAA,CACD;YACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,MAAD;UAAI,WAAU;oBAAsB,EAAG,qBAAqB,UAAU;UAAM,CAAA,EAC5E,kBAAC,MAAD;UAAI,WAAU;oBACX,IAAI,KAAK,EAAS,UAAU,CAAC,gBAAgB;UAC3C,CAAA,CACD;WACH;UACD;;MACF;OACF;;GACL;GACG;MAnTJ,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,SAAS,EAAG,8BAA8B,qBAAqB;GAC/D,QAAQ;IACN,OAAO,EAAG,oBAAoB,UAAU;IACxC,eAAe,EAAS,GAAG,EAAS,YAAY;IACjD;GACD,CAAA;EACE,CAAA"}
1
+ {"version":3,"file":"ShortcutDetailPage.js","names":[],"sources":["../../../../../src/product-management/modules/shortcuts/pages/ShortcutDetailPage.tsx"],"sourcesContent":["import { useParams } from 'react-router';\nimport { ArrowLeft, SquarePen, Trash2, ToggleLeft, ToggleRight } from 'lucide-react';\nimport { Markdown } from '@burdenoff/fe-libs/shared/components';\nimport {\n CTAOverflowMenu,\n EmphasisPanel,\n GradientText,\n NextSteps,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useShortcut, useDeleteShortcut, useToggleShortcut } from '../hooks/useShortcuts';\nimport { ShortcutCategoryBadge } from '../components/ShortcutCategoryBadge';\nimport { ShortcutKeyBadge } from '../components/ShortcutKeyBadge';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\nimport { useConfirmDialog } from '../../../shared/hooks/useConfirmDialog';\n\nexport function ShortcutDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const tr = useTr();\n const { confirm, ConfirmDialog } = useConfirmDialog();\n const shortcutId = id || '';\n\n const { shortcut, loading, error, refetch } = useShortcut(shortcutId);\n const { deleteShortcut, loading: deleteLoading } = useDeleteShortcut();\n const { toggleShortcut, loading: toggleLoading } = useToggleShortcut();\n\n const handleDelete = async () => {\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(shortcutId);\n void nativeNotify('success');\n navigate(`${basePath}/shortcuts`);\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete shortcut:', error);\n }\n };\n\n const handleToggle = async () => {\n if (!shortcut) return;\n void nativeImpact('medium');\n\n try {\n await toggleShortcut(shortcutId, !shortcut.isEnabled);\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to toggle shortcut:', error);\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('shortcuts.loadingShortcut', 'Loading shortcut...')} />\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={{\n label: tr('productCommon.retry', 'Retry'),\n onClick: () => refetch(),\n }}\n />\n </div>\n );\n }\n\n if (!shortcut) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={tr('shortcuts.shortcutNotFound', 'Shortcut not found')}\n action={{\n label: tr('shortcuts.goBack', 'Go Back'),\n onClick: () => navigate(`${basePath}/shortcuts`),\n }}\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-200\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts`)}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-colors duration-200\n \"\n >\n <ArrowLeft size={18} />\n {tr('shortcuts.backToShortcuts', 'Back to Shortcuts')}\n </button>\n\n <div className=\"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4\">\n <div>\n <div className=\"flex flex-wrap items-center gap-3 mb-2\">\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary\">\n <GradientText>{shortcut.label}</GradientText>\n </h1>\n <ShortcutCategoryBadge category={shortcut.category} />\n </div>\n <div className=\"flex items-center gap-3\">\n <ShortcutKeyBadge\n shortcutKey={shortcut.shortcutKey}\n isSequence={shortcut.isSequence}\n />\n <span\n className={`\n inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium\n ${\n shortcut.isEnabled\n ? 'bg-[var(--color-status-success-subtle)] text-[var(--color-status-success)]'\n : 'bg-bg-sunken text-text-tertiary'\n }\n `}\n >\n {shortcut.isEnabled && (\n <span className=\"size-1.5 rounded-full bg-[var(--color-status-success)] motion-safe:animate-vc-glow-pulse\" />\n )}\n {shortcut.isEnabled\n ? tr('shortcuts.enabled', 'Enabled')\n : tr('shortcuts.disabled', 'Disabled')}\n </span>\n </div>\n </div>\n\n <CTAOverflowMenu\n primary={{\n label: tr('shortcuts.edit', 'Edit'),\n onSelect: () => navigate(`${basePath}/shortcuts/${shortcutId}/edit`),\n icon: <SquarePen className=\"size-4\" />,\n }}\n actions={[\n {\n label: shortcut.isEnabled\n ? tr('shortcuts.disable', 'Disable')\n : tr('shortcuts.enable', 'Enable'),\n onSelect: () => {\n void handleToggle();\n },\n disabled: toggleLoading,\n icon: shortcut.isEnabled ? (\n <ToggleLeft className=\"size-4\" />\n ) : (\n <ToggleRight className=\"size-4\" />\n ),\n },\n {\n label: tr('shortcuts.delete', 'Delete'),\n onSelect: () => {\n void handleDelete();\n },\n intent: 'destructive',\n disabled: deleteLoading,\n icon: <Trash2 className=\"size-4\" />,\n },\n ]}\n />\n </div>\n </div>\n\n <PagePurpose className=\"mb-6\">\n {tr(\n 'shortcuts.detailPurpose',\n `This is the \"${shortcut.label}\" shortcut — it fires the \"${shortcut.eventName}\" event when pressed. Review its key bindings (including Mac and Windows/Linux variants), toggle it on or off, or edit it to change the keys or event.`\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"product-shortcut-detail\"\n className=\"mb-6\"\n steps={[\n {\n id: 'edit',\n label: tr('shortcuts.steps.edit', 'Edit this shortcut'),\n description: tr(\n 'shortcuts.steps.editDesc',\n 'Change the key combination, event, category, or per-platform keys.'\n ),\n onClick: () => navigate(`${basePath}/shortcuts/${shortcutId}/edit`),\n },\n {\n id: 'toggle',\n label: shortcut.isEnabled\n ? tr('shortcuts.steps.disable', 'Disable this shortcut')\n : tr('shortcuts.steps.enable', 'Enable this shortcut'),\n description: tr(\n 'shortcuts.steps.toggleDesc',\n 'Turn it on or off without deleting it — useful while testing.'\n ),\n onClick: () => {\n void handleToggle();\n },\n },\n {\n id: 'back',\n label: tr('shortcuts.steps.back', 'Back to all shortcuts'),\n description: tr(\n 'shortcuts.steps.backDesc',\n 'Return to the list to manage the rest of your shortcuts.'\n ),\n onClick: () => navigate(`${basePath}/shortcuts`),\n },\n ]}\n />\n\n {/* Details Grid */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n {/* Main Info Card — the page's emphasis zone */}\n <EmphasisPanel>\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('shortcuts.shortcutDetails', 'Shortcut Details')}\n </h2>\n\n <dl className=\"space-y-4\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.label', 'Label')}\n </dt>\n <dd className=\"text-text-primary mt-1\">{shortcut.label}</dd>\n </div>\n\n {shortcut.description && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.description', 'Description')}\n </dt>\n <dd className=\"text-text-primary mt-1\">\n <Markdown>{shortcut.description}</Markdown>\n </dd>\n </div>\n )}\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.shortcutKey', 'Shortcut Key')}\n </dt>\n <dd className=\"mt-1\">\n <ShortcutKeyBadge\n shortcutKey={shortcut.shortcutKey}\n isSequence={shortcut.isSequence}\n />\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.eventName', 'Event Name')}\n </dt>\n <dd className=\"mt-1\">\n <code className=\"text-sm text-text-secondary bg-bg-sunken px-2 py-1 rounded font-mono\">\n {shortcut.eventName}\n </code>\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.category', 'Category')}\n </dt>\n <dd className=\"mt-1\">\n <ShortcutCategoryBadge category={shortcut.category} />\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.product', 'Product')}\n </dt>\n <dd className=\"text-text-primary mt-1\">\n {shortcut.product?.name || (\n <span className=\"text-text-tertiary italic\">\n {tr('shortcuts.globalAllProducts', 'Global (All Products)')}\n </span>\n )}\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.type', 'Type')}\n </dt>\n <dd className=\"text-text-primary mt-1\">\n {shortcut.isSequence\n ? tr('shortcuts.keySequence', 'Key Sequence')\n : tr('shortcuts.keyCombination', 'Key Combination')}\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.sortOrder', 'Sort Order')}\n </dt>\n <dd className=\"text-text-primary mt-1\">{shortcut.sortOrder}</dd>\n </div>\n </dl>\n </EmphasisPanel>\n\n {/* Platform-Specific Keys Card */}\n <div className=\"bg-bg-surface bg-accent-wash border border-border-seam rounded-card shadow-elevation-1 p-6\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('shortcuts.platformKeys', 'Platform Keys')}\n </h2>\n\n <dl className=\"space-y-4\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.defaultKey', 'Default Key')}\n </dt>\n <dd className=\"mt-1\">\n <ShortcutKeyBadge\n shortcutKey={shortcut.shortcutKey}\n isSequence={shortcut.isSequence}\n />\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.macKey', 'Mac Key')}\n </dt>\n <dd className=\"mt-1\">\n {shortcut.macKey ? (\n <ShortcutKeyBadge shortcutKey={shortcut.macKey} />\n ) : (\n <span className=\"text-text-tertiary italic\">\n {tr('shortcuts.sameAsDefault', 'Same as default')}\n </span>\n )}\n </dd>\n </div>\n\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('shortcuts.windowsLinuxKey', 'Windows/Linux Key')}\n </dt>\n <dd className=\"mt-1\">\n {shortcut.windowsKey ? (\n <ShortcutKeyBadge shortcutKey={shortcut.windowsKey} />\n ) : (\n <span className=\"text-text-tertiary italic\">\n {tr('shortcuts.sameAsDefault', 'Same as default')}\n </span>\n )}\n </dd>\n </div>\n </dl>\n\n <div className=\"mt-6 pt-4 border-t border-border-seam\">\n <h3 className=\"text-sm font-semibold text-text-secondary mb-3\">\n {tr('shortcuts.timestamps', 'Timestamps')}\n </h3>\n <dl className=\"space-y-2 text-sm\">\n <div className=\"flex justify-between\">\n <dt className=\"text-text-tertiary\">{tr('shortcuts.created', 'Created')}</dt>\n <dd className=\"text-text-primary\">\n {new Date(shortcut.createdAt).toLocaleString()}\n </dd>\n </div>\n <div className=\"flex justify-between\">\n <dt className=\"text-text-tertiary\">{tr('shortcuts.updated', 'Updated')}</dt>\n <dd className=\"text-text-primary\">\n {new Date(shortcut.updatedAt).toLocaleString()}\n </dd>\n </div>\n </dl>\n </div>\n </div>\n </div>\n {ConfirmDialog}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,SAAgB,IAAqB;CACnC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAK,GAAO,EACZ,EAAE,YAAS,qBAAkB,GAAkB,EAC/C,IAAa,KAAM,IAEnB,EAAE,aAAU,YAAS,UAAO,eAAY,EAAY,EAAW,EAC/D,EAAE,mBAAgB,SAAS,MAAkB,GAAmB,EAChE,EAAE,mBAAgB,SAAS,MAAkB,GAAmB,EAEhE,IAAe,YAAY;AAC1B,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,EAGN,KAAI;AAGF,GAFA,MAAM,EAAe,EAAW,EAC3B,EAAa,UAAU,EAC5B,EAAS,GAAG,EAAS,YAAY;WAC1B,GAAO;AAEd,GADK,EAAa,QAAQ,EAC1B,QAAQ,MAAM,8BAA8B,EAAM;;IAIhD,IAAe,YAAY;AAC1B,SACA;KAAa,SAAS;AAE3B,OAAI;AAEF,IADA,MAAM,EAAe,GAAY,CAAC,EAAS,UAAU,EACrD,GAAS;YACF,GAAO;AAEd,IADK,EAAa,QAAQ,EAC1B,QAAQ,MA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AClD,CAAA,EACL,kBAAC,MAAD;SAAI,WAAU;mBACX,EAAS,aACR,kBAAC,GAAD,EAAkB,aAAa,EAAS,YAAc,CAAA,GAEtD,kBAAC,QAAD;UAAM,WAAU;oBACb,EAAG,2BAA2B,kBAAkB;UAC5C,CAAA;SAEN,CAAA,CACD,EAAA,CAAA;QACH;;MAEL,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,MAAD;QAAI,WAAU;kBACX,EAAG,wBAAwB,aAAa;QACtC,CAAA,EACL,kBAAC,MAAD;QAAI,WAAU;kBAAd,CACE,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,MAAD;UAAI,WAAU;oBAAsB,EAAG,qBAAqB,UAAU;UAAM,CAAA,EAC5E,kBAAC,MAAD;UAAI,WAAU;oBACX,IAAI,KAAK,EAAS,UAAU,CAAC,gBAAgB;UAC3C,CAAA,CACD;YACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,MAAD;UAAI,WAAU;oBAAsB,EAAG,qBAAqB,UAAU;UAAM,CAAA,EAC5E,kBAAC,MAAD;UAAI,WAAU;oBACX,IAAI,KAAK,EAAS,UAAU,CAAC,gBAAgB;UAC3C,CAAA,CACD;WACH;UACD;;MACF;OACF;;GACL;GACG;MAnTJ,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,SAAS,EAAG,8BAA8B,qBAAqB;GAC/D,QAAQ;IACN,OAAO,EAAG,oBAAoB,UAAU;IACxC,eAAe,EAAS,GAAG,EAAS,YAAY;IACjD;GACD,CAAA;EACE,CAAA"}
@@ -6,7 +6,7 @@ import { useShortcut as i, useUpdateShortcut as a } from "../hooks/useShortcuts.
6
6
  import { ShortcutForm as o } from "../components/ShortcutForm.js";
7
7
  import { ArrowLeft as s } from "lucide-react";
8
8
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
- import { useParams as u } from "react-router-dom";
9
+ import { useParams as u } from "react-router";
10
10
  import { EmphasisPanel as d, PagePurpose as f } from "@burdenoff/fe-libs/ui";
11
11
  //#region src/product-management/modules/shortcuts/pages/ShortcutEditPage.tsx
12
12
  function p() {
@@ -1 +1 @@
1
- {"version":3,"file":"ShortcutEditPage.js","names":[],"sources":["../../../../../src/product-management/modules/shortcuts/pages/ShortcutEditPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport { ArrowLeft } from 'lucide-react';\nimport { EmphasisPanel, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useShortcut, useUpdateShortcut } from '../hooks/useShortcuts';\nimport { ShortcutForm } from '../components/ShortcutForm';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { UpdateKeyboardShortcutInput } from '../types';\n\nexport function ShortcutEditPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const tr = useTr();\n const shortcutId = id || '';\n\n const { shortcut, loading: fetchLoading, error: fetchError, refetch } = useShortcut(shortcutId);\n const { updateShortcut, loading: updateLoading, error: updateError } = useUpdateShortcut();\n\n const handleSubmit = async (data: UpdateKeyboardShortcutInput) => {\n try {\n await updateShortcut(shortcutId, data);\n navigate(`${basePath}/shortcuts/${shortcutId}`);\n } catch (error) {\n console.error('Failed to update shortcut:', error);\n }\n };\n\n const handleCancel = () => {\n navigate(`${basePath}/shortcuts/${shortcutId}`);\n };\n\n if (fetchLoading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('shortcuts.loadingShortcut', 'Loading shortcut...')} />\n </div>\n );\n }\n\n if (fetchError) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={fetchError.message}\n action={{\n label: tr('productCommon.retry', 'Retry'),\n onClick: () => refetch(),\n }}\n />\n </div>\n );\n }\n\n if (!shortcut) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={tr('shortcuts.shortcutNotFound', 'Shortcut not found')}\n action={{\n label: tr('shortcuts.goBack', 'Go Back'),\n onClick: () => navigate(`${basePath}/shortcuts`),\n }}\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-200\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/${shortcutId}`)}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-colors duration-200\n \"\n >\n <ArrowLeft size={18} />\n {tr('shortcuts.backToShortcut', 'Back to Shortcut')}\n </button>\n\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary mb-2\">\n {tr('shortcuts.editKeyboardShortcut', 'Edit Keyboard Shortcut')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('shortcuts.editShortcutSubtitle', 'Update the keyboard shortcut configuration')}\n </p>\n\n <PagePurpose className=\"mt-3 max-w-2xl\">\n {tr(\n 'shortcuts.editPurpose',\n 'Adjust this shortcut — rebind its keys, change the event it fires, update per-platform variants, or move it to a different category. Changes apply across the products that use this shortcut.'\n )}\n </PagePurpose>\n </div>\n\n {/* Error Message */}\n {updateError && (\n <div className=\"mb-6 p-4 bg-[var(--color-status-error-subtle)] border border-[var(--color-status-error)] rounded-lg\">\n <p className=\"text-[var(--color-status-error)]\">{updateError.message}</p>\n </div>\n )}\n\n {/* Form Card */}\n <EmphasisPanel className=\"max-w-2xl\">\n <ShortcutForm\n shortcut={shortcut}\n onSubmit={handleSubmit}\n onCancel={handleCancel}\n loading={updateLoading}\n />\n </EmphasisPanel>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,IAAmB;CACjC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,aAAU,cAAW,gBAAgB,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yF9C,gBArFmB;AACzB,QAAS,GAAG,EAAS,aAAa,IAAa;;KAqFzC,SAAS;KACT,CAAA;IACY,CAAA;GACZ;MA7DJ,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,SAAS,EAAG,8BAA8B,qBAAqB;GAC/D,QAAQ;IACN,OAAO,EAAG,oBAAoB,UAAU;IACxC,eAAe,EAAS,GAAG,EAAS,YAAY;IACjD;GACD,CAAA;EACE,CAAA"}
1
+ {"version":3,"file":"ShortcutEditPage.js","names":[],"sources":["../../../../../src/product-management/modules/shortcuts/pages/ShortcutEditPage.tsx"],"sourcesContent":["import { useParams } from 'react-router';\nimport { ArrowLeft } from 'lucide-react';\nimport { EmphasisPanel, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useShortcut, useUpdateShortcut } from '../hooks/useShortcuts';\nimport { ShortcutForm } from '../components/ShortcutForm';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { UpdateKeyboardShortcutInput } from '../types';\n\nexport function ShortcutEditPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const tr = useTr();\n const shortcutId = id || '';\n\n const { shortcut, loading: fetchLoading, error: fetchError, refetch } = useShortcut(shortcutId);\n const { updateShortcut, loading: updateLoading, error: updateError } = useUpdateShortcut();\n\n const handleSubmit = async (data: UpdateKeyboardShortcutInput) => {\n try {\n await updateShortcut(shortcutId, data);\n navigate(`${basePath}/shortcuts/${shortcutId}`);\n } catch (error) {\n console.error('Failed to update shortcut:', error);\n }\n };\n\n const handleCancel = () => {\n navigate(`${basePath}/shortcuts/${shortcutId}`);\n };\n\n if (fetchLoading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('shortcuts.loadingShortcut', 'Loading shortcut...')} />\n </div>\n );\n }\n\n if (fetchError) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={fetchError.message}\n action={{\n label: tr('productCommon.retry', 'Retry'),\n onClick: () => refetch(),\n }}\n />\n </div>\n );\n }\n\n if (!shortcut) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={tr('shortcuts.shortcutNotFound', 'Shortcut not found')}\n action={{\n label: tr('shortcuts.goBack', 'Go Back'),\n onClick: () => navigate(`${basePath}/shortcuts`),\n }}\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-200\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/${shortcutId}`)}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-colors duration-200\n \"\n >\n <ArrowLeft size={18} />\n {tr('shortcuts.backToShortcut', 'Back to Shortcut')}\n </button>\n\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary mb-2\">\n {tr('shortcuts.editKeyboardShortcut', 'Edit Keyboard Shortcut')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('shortcuts.editShortcutSubtitle', 'Update the keyboard shortcut configuration')}\n </p>\n\n <PagePurpose className=\"mt-3 max-w-2xl\">\n {tr(\n 'shortcuts.editPurpose',\n 'Adjust this shortcut — rebind its keys, change the event it fires, update per-platform variants, or move it to a different category. Changes apply across the products that use this shortcut.'\n )}\n </PagePurpose>\n </div>\n\n {/* Error Message */}\n {updateError && (\n <div className=\"mb-6 p-4 bg-[var(--color-status-error-subtle)] border border-[var(--color-status-error)] rounded-lg\">\n <p className=\"text-[var(--color-status-error)]\">{updateError.message}</p>\n </div>\n )}\n\n {/* Form Card */}\n <EmphasisPanel className=\"max-w-2xl\">\n <ShortcutForm\n shortcut={shortcut}\n onSubmit={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,kBAAC,GAAD;KACY;KACV,UAAU,OA7FU,MAAsC;AAChE,UAAI;AAEF,OADA,MAAM,EAAe,GAAY,EAAK,EACtC,EAAS,GAAG,EAAS,aAAa,IAAa;eACxC,GAAO;AACd,eAAQ,MAAM,8BAA8B,EAAM;;;KAyF9C,gBArFmB;AACzB,QAAS,GAAG,EAAS,aAAa,IAAa;;KAqFzC,SAAS;KACT,CAAA;IACY,CAAA;GACZ;MA7DJ,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,SAAS,EAAG,8BAA8B,qBAAqB;GAC/D,QAAQ;IACN,OAAO,EAAG,oBAAoB,UAAU;IACxC,eAAe,EAAS,GAAG,EAAS,YAAY;IACjD;GACD,CAAA;EACE,CAAA"}
@@ -1,35 +1,40 @@
1
- import { AlertCircle as e } from "lucide-react";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
1
+ import { isPermissionDeniedError as e } from "../../utils/permission-error.js";
2
+ import { AlertCircle as t, Lock as n } from "lucide-react";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
3
4
  //#region src/product-management/shared/components/feedback/ErrorState.tsx
4
- function r({ title: r = "Something went wrong", message: i, action: a }) {
5
- return /* @__PURE__ */ n("div", {
5
+ function a({ title: a = "Something went wrong", message: o, error: s, action: c, deniedTitle: l = "You don't have access", deniedMessage: u = "This area is restricted to platform administrators." }) {
6
+ let d = e(s, o);
7
+ return /* @__PURE__ */ i("div", {
6
8
  className: "flex flex-col items-center justify-center py-12 text-center animate-in fade-in duration-200",
7
9
  children: [
8
- /* @__PURE__ */ t("div", {
9
- className: "size-16 rounded-full bg-[var(--color-status-error-subtle)] flex items-center justify-center mb-4",
10
- children: /* @__PURE__ */ t(e, {
10
+ /* @__PURE__ */ r("div", {
11
+ className: `size-16 rounded-full flex items-center justify-center mb-4 ${d ? "bg-[var(--color-bg-subtle)]" : "bg-[var(--color-status-error-subtle)]"}`,
12
+ children: d ? /* @__PURE__ */ r(n, {
13
+ size: 32,
14
+ className: "text-text-tertiary"
15
+ }) : /* @__PURE__ */ r(t, {
11
16
  size: 32,
12
17
  className: "text-[var(--color-status-error)]"
13
18
  })
14
19
  }),
15
- /* @__PURE__ */ t("h3", {
20
+ /* @__PURE__ */ r("h3", {
16
21
  className: "text-lg font-semibold text-text-primary mb-2",
17
- children: r
22
+ children: d ? l : a
18
23
  }),
19
- /* @__PURE__ */ t("p", {
24
+ /* @__PURE__ */ r("p", {
20
25
  className: "text-sm text-text-tertiary mb-6 max-w-md",
21
- children: i
26
+ children: d ? u : o
22
27
  }),
23
- a && /* @__PURE__ */ t("button", {
28
+ c && !d && /* @__PURE__ */ r("button", {
24
29
  type: "button",
25
- onClick: a.onClick,
30
+ onClick: c.onClick,
26
31
  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 ",
27
- children: a.label
32
+ children: c.label
28
33
  })
29
34
  ]
30
35
  });
31
36
  }
32
37
  //#endregion
33
- export { r as ErrorState };
38
+ export { a as ErrorState };
34
39
 
35
40
  //# sourceMappingURL=ErrorState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorState.js","names":[],"sources":["../../../../../src/product-management/shared/components/feedback/ErrorState.tsx"],"sourcesContent":["import { AlertCircle } from 'lucide-react';\n\ninterface ErrorStateProps {\n title?: string;\n message: string;\n action?: {\n label: string;\n onClick: () => void;\n };\n}\n\n/**\n * ErrorState — generic error display.\n *\n * The `title` prop is intentionally English-only by default. Translation\n * should happen at the call site (where the calling module's i18n\n * namespace is loaded), e.g. `<ErrorState title={tr('foo.error', 'Something went wrong')} ... />`.\n */\nexport function ErrorState({ title = 'Something went wrong', message, action }: ErrorStateProps) {\n return (\n <div className=\"flex flex-col items-center justify-center py-12 text-center animate-in fade-in duration-200\">\n <div className=\"size-16 rounded-full bg-[var(--color-status-error-subtle)] flex items-center justify-center mb-4\">\n <AlertCircle size={32} className=\"text-[var(--color-status-error)]\" />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">{title}</h3>\n <p className=\"text-sm text-text-tertiary mb-6 max-w-md\">{message}</p>\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 )}\n </div>\n );\n}\n"],"mappings":";;;AAkBA,SAAgB,EAAW,EAAE,WAAQ,wBAAwB,YAAS,aAA2B;AAC/F,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KAAa,MAAM;KAAI,WAAU;KAAqC,CAAA;IAClE,CAAA;GACN,kBAAC,MAAD;IAAI,WAAU;cAAgD;IAAW,CAAA;GACzE,kBAAC,KAAD;IAAG,WAAU;cAA4C;IAAY,CAAA;GACpE,KACC,kBAAC,UAAD;IACE,MAAK;IACL,SAAS,EAAO;IAChB,WAAU;cAUT,EAAO;IACD,CAAA;GAEP"}
1
+ {"version":3,"file":"ErrorState.js","names":[],"sources":["../../../../../src/product-management/shared/components/feedback/ErrorState.tsx"],"sourcesContent":["import { AlertCircle, Lock } from 'lucide-react';\n\nimport { isPermissionDeniedError } from '../../utils/permission-error';\n\ninterface ErrorStateProps {\n title?: string;\n message: string;\n /**\n * The raw error, when the caller has it. Lets this component tell a denial\n * apart from a genuine failure via the GraphQL `extensions.code` rather than\n * guessing from the message.\n */\n error?: unknown;\n action?: {\n label: string;\n onClick: () => void;\n };\n /** Copy for the access-denied variant; English defaults, translate at the call site. */\n deniedTitle?: string;\n deniedMessage?: string;\n}\n\n/**\n * ErrorState — generic error display.\n *\n * The `title` prop is intentionally English-only by default. Translation\n * should happen at the call site (where the calling module's i18n\n * namespace is loaded), e.g. `<ErrorState title={tr('foo.error', 'Something went wrong')} ... />`.\n *\n * A permission denial renders as its own state: these screens read the platform\n * product catalog, which is restricted to super admins, so a normal user who\n * lands here is not looking at a broken page. Showing \"Something went wrong\"\n * over a Retry button that can never succeed invites them to sit there\n * retrying, so the denial says what it is and drops the action.\n */\nexport function ErrorState({\n title = 'Something went wrong',\n message,\n error,\n action,\n deniedTitle = \"You don't have access\",\n deniedMessage = 'This area is restricted to platform administrators.',\n}: ErrorStateProps) {\n const denied = isPermissionDeniedError(error, message);\n\n return (\n <div className=\"flex flex-col items-center justify-center py-12 text-center animate-in fade-in duration-200\">\n <div\n className={`size-16 rounded-full flex items-center justify-center mb-4 ${\n denied ? 'bg-[var(--color-bg-subtle)]' : 'bg-[var(--color-status-error-subtle)]'\n }`}\n >\n {denied ? (\n <Lock size={32} className=\"text-text-tertiary\" />\n ) : (\n <AlertCircle size={32} className=\"text-[var(--color-status-error)]\" />\n )}\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">\n {denied ? deniedTitle : title}\n </h3>\n <p className=\"text-sm text-text-tertiary mb-6 max-w-md\">{denied ? deniedMessage : message}</p>\n {action && !denied && (\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 )}\n </div>\n );\n}\n"],"mappings":";;;;AAmCA,SAAgB,EAAW,EACzB,WAAQ,wBACR,YACA,UACA,WACA,iBAAc,yBACd,mBAAgB,yDACE;CAClB,IAAM,IAAS,EAAwB,GAAO,EAAQ;AAEtD,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IACE,WAAW,8DACT,IAAS,gCAAgC;cAG1C,IACC,kBAAC,GAAD;KAAM,MAAM;KAAI,WAAU;KAAuB,CAAA,GAEjD,kBAAC,GAAD;KAAa,MAAM;KAAI,WAAU;KAAqC,CAAA;IAEpE,CAAA;GACN,kBAAC,MAAD;IAAI,WAAU;cACX,IAAS,IAAc;IACrB,CAAA;GACL,kBAAC,KAAD;IAAG,WAAU;cAA4C,IAAS,IAAgB;IAAY,CAAA;GAC7F,KAAU,CAAC,KACV,kBAAC,UAAD;IACE,MAAK;IACL,SAAS,EAAO;IAChB,WAAU;cAUT,EAAO;IACD,CAAA;GAEP"}
@@ -0,0 +1,23 @@
1
+ //#region src/product-management/shared/utils/permission-error.ts
2
+ var e = new Set([
3
+ "FORBIDDEN",
4
+ "UNAUTHENTICATED",
5
+ "ACCESS_DENIED"
6
+ ]);
7
+ function t(e) {
8
+ return typeof e == "string" ? /permission denied|forbidden|access denied|default:deny|not authori[sz]ed/i.test(e) : !1;
9
+ }
10
+ function n(n, r) {
11
+ if (t(r)) return !0;
12
+ if (!n || typeof n != "object") return t(n);
13
+ let i = n;
14
+ for (let n of i.graphQLErrors ?? []) {
15
+ let r = n?.extensions?.code;
16
+ if (typeof r == "string" && e.has(r) || t(n?.message)) return !0;
17
+ }
18
+ return t(i.message);
19
+ }
20
+ //#endregion
21
+ export { n as isPermissionDeniedError };
22
+
23
+ //# sourceMappingURL=permission-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission-error.js","names":[],"sources":["../../../../src/product-management/shared/utils/permission-error.ts"],"sourcesContent":["/**\n * Recognises \"you are not allowed to read this\" so the UI can say so plainly\n * instead of dressing it up as a transient failure.\n *\n * Product management reads the platform catalog (`platformProducts`), which is\n * gated `@rbac(action: \"read\", resource: \"product\", scopeType: \"global\")` —\n * super admins and platform support only. A normal user who reaches one of\n * these screens got \"Something went wrong / Cached: Permission denied\" with a\n * Retry button that can never succeed, which reads as a broken page rather\n * than a closed door.\n */\n\ninterface GraphQLErrorLike {\n extensions?: { code?: unknown } | null;\n message?: unknown;\n}\n\ninterface ApolloErrorLike {\n graphQLErrors?: readonly GraphQLErrorLike[];\n message?: unknown;\n}\n\nconst DENIED_CODES = new Set(['FORBIDDEN', 'UNAUTHENTICATED', 'ACCESS_DENIED']);\n\n/**\n * Message-level fallback. The gateway's denial surfaces through Apollo's cache\n * as a bare string (\"Cached: Permission denied\") with no extensions attached,\n * so structured detection alone would miss the exact case this exists for.\n */\nfunction messageLooksDenied(message: unknown): boolean {\n if (typeof message !== 'string') return false;\n return /permission denied|forbidden|access denied|default:deny|not authori[sz]ed/i.test(message);\n}\n\nexport function isPermissionDeniedError(error: unknown, message?: string): boolean {\n if (messageLooksDenied(message)) return true;\n\n if (!error || typeof error !== 'object') return messageLooksDenied(error);\n\n const apolloError = error as ApolloErrorLike;\n\n for (const graphQLError of apolloError.graphQLErrors ?? []) {\n const code = graphQLError?.extensions?.code;\n if (typeof code === 'string' && DENIED_CODES.has(code)) return true;\n if (messageLooksDenied(graphQLError?.message)) return true;\n }\n\n return messageLooksDenied(apolloError.message);\n}\n"],"mappings":";AAsBA,IAAM,IAAe,IAAI,IAAI;CAAC;CAAa;CAAmB;CAAgB,CAAC;AAO/E,SAAS,EAAmB,GAA2B;AAErD,QADI,OAAO,KAAY,WAChB,4EAA4E,KAAK,EAAQ,GADxD;;AAI1C,SAAgB,EAAwB,GAAgB,GAA2B;AACjF,KAAI,EAAmB,EAAQ,CAAE,QAAO;AAExC,KAAI,CAAC,KAAS,OAAO,KAAU,SAAU,QAAO,EAAmB,EAAM;CAEzE,IAAM,IAAc;AAEpB,MAAK,IAAM,KAAgB,EAAY,iBAAiB,EAAE,EAAE;EAC1D,IAAM,IAAO,GAAc,YAAY;AAEvC,MADI,OAAO,KAAS,YAAY,EAAa,IAAI,EAAK,IAClD,EAAmB,GAAc,QAAQ,CAAE,QAAO;;AAGxD,QAAO,EAAmB,EAAY,QAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-product",
3
- "version": "2026.731.1",
3
+ "version": "2026.817.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.720.3",
44
+ "@burdenoff/fe-libs": "2026.801.1",
45
45
  "@tanstack/react-query": "^5.90.16",
46
46
  "@xmldom/xmldom": "0.8.13",
47
47
  "ajv": "8.20.0",
@@ -53,7 +53,7 @@
53
53
  "lucide-react": "^0.468.0",
54
54
  "react": "^19.0.0",
55
55
  "react-dom": "^19.0.0",
56
- "react-router-dom": "^7.1.3",
56
+ "react-router": "^8.3.0",
57
57
  "tailwind-merge": "^3.4.0",
58
58
  "uuid": "14.0.0",
59
59
  "zod": "^4.2.1",
@@ -92,7 +92,7 @@
92
92
  "zustand": "^5.0.0"
93
93
  },
94
94
  "publishConfig": {
95
- "access": "restricted"
95
+ "access": "public"
96
96
  },
97
97
  "overrides": {
98
98
  "lodash": "4.18.1",