@burdenoff/microfe-product 2026.715.1 → 2026.720.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product/pages/ContentPageViewPage.js +42 -43
- package/dist/product/pages/ContentPageViewPage.js.map +1 -1
- package/dist/product/pages/ProductViewPage.js +88 -87
- package/dist/product/pages/ProductViewPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js +341 -473
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js +8 -10
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js +250 -252
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js +72 -72
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js.map +1 -1
- package/dist/product-management/modules/products/components/ProductForm.js +490 -492
- package/dist/product-management/modules/products/components/ProductForm.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductDetailPage.js +130 -129
- package/dist/product-management/modules/products/pages/ProductDetailPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/components/ShortcutForm.js +195 -203
- package/dist/product-management/modules/shortcuts/components/ShortcutForm.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js +88 -87
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js.map +1 -1
- package/dist/shared/components/MarkdownEditor.js +161 -0
- package/dist/shared/components/MarkdownEditor.js.map +1 -0
- package/dist/shared/components/index.js +1 -0
- package/package.json +2 -2
- package/dist/node_modules/dompurify/dist/purify.es.js +0 -555
- package/dist/node_modules/dompurify/dist/purify.es.js.map +0 -1
- package/dist/shared/utils/renderMarkdown.js +0 -8
- package/dist/shared/utils/renderMarkdown.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShortcutForm.js","names":[],"sources":["../../../../../src/product-management/modules/shortcuts/components/ShortcutForm.tsx"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { Loader2 } from 'lucide-react';\nimport { ZodError } from 'zod';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport type {\n KeyboardShortcut,\n CreateKeyboardShortcutInput,\n UpdateKeyboardShortcutInput,\n} from '../types';\nimport { ShortcutCategories } from '../types';\nimport { createShortcutSchema, updateShortcutSchema } from '../schemas';\nimport { useProducts } from '../../products/hooks/useProducts';\n\ninterface ShortcutFormProps {\n shortcut?: KeyboardShortcut | null;\n onSubmit: (data: CreateKeyboardShortcutInput | UpdateKeyboardShortcutInput) => Promise<void>;\n onCancel: () => void;\n loading?: boolean;\n}\n\nexport function ShortcutForm({ shortcut, onSubmit, onCancel, loading }: ShortcutFormProps) {\n const tr = useTr();\n\n const { products } = useProducts({}, { limit: 100 });\n\n const [formData, setFormData] = useState({\n productId: shortcut?.productId || '',\n shortcutKey: shortcut?.shortcutKey || '',\n eventName: shortcut?.eventName || '',\n category: shortcut?.category || ShortcutCategories.NAVIGATION,\n label: shortcut?.label || '',\n description: shortcut?.description || '',\n macKey: shortcut?.macKey || '',\n windowsKey: shortcut?.windowsKey || '',\n isEnabled: shortcut?.isEnabled ?? true,\n isSequence: shortcut?.isSequence ?? false,\n sortOrder: shortcut?.sortOrder ?? 0,\n });\n\n const [errors, setErrors] = useState<Record<string, string>>({});\n\n // Auto-detect if it's a sequence (contains space but no +)\n useEffect(() => {\n const hasSpace = formData.shortcutKey.includes(' ');\n const hasPlus = formData.shortcutKey.includes('+');\n if (hasSpace && !hasPlus) {\n setFormData((prev) => ({ ...prev, isSequence: true }));\n } else if (hasPlus && !hasSpace) {\n setFormData((prev) => ({ ...prev, isSequence: false }));\n }\n }, [formData.shortcutKey]);\n\n const validate = () => {\n try {\n const schema = shortcut ? updateShortcutSchema : createShortcutSchema;\n schema.parse(formData);\n setErrors({});\n return true;\n } catch (error) {\n if (error instanceof ZodError) {\n const newErrors: Record<string, string> = {};\n error.issues.forEach((issue) => {\n const path = issue.path.join('.');\n newErrors[path] = issue.message;\n });\n setErrors(newErrors);\n }\n return false;\n }\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (!validate()) {\n return;\n }\n\n const submitData = shortcut\n ? {\n // Update only changed fields\n shortcutKey:\n formData.shortcutKey !== shortcut.shortcutKey ? formData.shortcutKey : undefined,\n eventName: formData.eventName !== shortcut.eventName ? formData.eventName : undefined,\n category: formData.category !== shortcut.category ? formData.category : undefined,\n label: formData.label !== shortcut.label ? formData.label : undefined,\n description:\n formData.description !== (shortcut.description || '')\n ? formData.description || undefined\n : undefined,\n macKey:\n formData.macKey !== (shortcut.macKey || '') ? formData.macKey || undefined : undefined,\n windowsKey:\n formData.windowsKey !== (shortcut.windowsKey || '')\n ? formData.windowsKey || undefined\n : undefined,\n isEnabled: formData.isEnabled !== shortcut.isEnabled ? formData.isEnabled : undefined,\n isSequence: formData.isSequence !== shortcut.isSequence ? formData.isSequence : undefined,\n sortOrder: formData.sortOrder !== shortcut.sortOrder ? formData.sortOrder : undefined,\n }\n : {\n // Create with all fields\n productId: formData.productId || undefined,\n shortcutKey: formData.shortcutKey,\n eventName: formData.eventName,\n category: formData.category,\n label: formData.label,\n description: formData.description || undefined,\n macKey: formData.macKey || undefined,\n windowsKey: formData.windowsKey || undefined,\n isEnabled: formData.isEnabled,\n isSequence: formData.isSequence,\n sortOrder: formData.sortOrder,\n };\n\n await onSubmit(submitData);\n };\n\n const inputClassName = `\n w-full px-3 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n placeholder:text-text-tertiary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n disabled:bg-bg-sunken disabled:cursor-not-allowed\n transition-all duration-200\n `;\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-6 animate-in fade-in duration-200\">\n {/* Basic Information Section */}\n <div className=\"space-y-4\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('shortcuts.basicInformation', 'Basic Information')}\n </h3>\n\n {/* Product Selection */}\n <div>\n <label htmlFor=\"productId\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.product', 'Product')}\n </label>\n <select\n id=\"productId\"\n value={formData.productId}\n onChange={(e) => setFormData({ ...formData, productId: e.target.value })}\n className={inputClassName}\n disabled={loading || !!shortcut}\n >\n <option value=\"\">{tr('shortcuts.globalAllProducts', 'Global (All Products)')}</option>\n {products.map((product) => (\n <option key={product.id} value={product.id}>\n {product.name}\n </option>\n ))}\n </select>\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'shortcuts.globalShortcutHint',\n 'Leave empty for global shortcuts that work across all products.'\n )}\n </p>\n </div>\n\n {/* Label */}\n <div>\n <label htmlFor=\"label\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.label', 'Label')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"label\"\n type=\"text\"\n value={formData.label}\n onChange={(e) => setFormData({ ...formData, label: e.target.value })}\n className={inputClassName}\n placeholder=\"e.g., Go to Home\"\n disabled={loading}\n required\n />\n {errors.label && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.label}</p>\n )}\n </div>\n\n {/* Shortcut Key */}\n <div>\n <label htmlFor=\"shortcutKey\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.shortcutKey', 'Shortcut Key')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"shortcutKey\"\n type=\"text\"\n value={formData.shortcutKey}\n onChange={(e) => setFormData({ ...formData, shortcutKey: e.target.value })}\n className={inputClassName}\n placeholder=\"e.g., g h or Cmd+K\"\n disabled={loading}\n required\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'shortcuts.shortcutKeyHint',\n 'Use space for sequences (g h), use + for modifiers (Cmd+K, Ctrl+Shift+P)'\n )}\n </p>\n {errors.shortcutKey && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.shortcutKey}</p>\n )}\n </div>\n\n {/* Event Name */}\n <div>\n <label htmlFor=\"eventName\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.eventName', 'Event Name')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"eventName\"\n type=\"text\"\n value={formData.eventName}\n onChange={(e) => setFormData({ ...formData, eventName: e.target.value })}\n className={inputClassName}\n placeholder=\"e.g., navigate:home\"\n disabled={loading}\n required\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'shortcuts.eventNameHint',\n 'The event name to emit when this shortcut is triggered.'\n )}\n </p>\n {errors.eventName && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.eventName}</p>\n )}\n </div>\n\n {/* Category */}\n <div>\n <label htmlFor=\"category\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.category', 'Category')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <select\n id=\"category\"\n value={formData.category}\n onChange={(e) => setFormData({ ...formData, category: e.target.value })}\n className={inputClassName}\n disabled={loading}\n >\n {Object.values(ShortcutCategories).map((cat) => (\n <option key={cat} value={cat}>\n {cat}\n </option>\n ))}\n </select>\n </div>\n\n {/* Description */}\n <div>\n <label htmlFor=\"description\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.description', 'Description')}\n </label>\n <textarea\n id=\"description\"\n value={formData.description}\n onChange={(e) => setFormData({ ...formData, description: e.target.value })}\n rows={2}\n className={inputClassName}\n placeholder={tr(\n 'shortcuts.descriptionPlaceholder',\n 'Enter a description for this shortcut'\n )}\n disabled={loading}\n />\n {errors.description && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.description}</p>\n )}\n </div>\n </div>\n\n {/* Platform-Specific Keys Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('shortcuts.platformSpecificKeys', 'Platform-Specific Keys (Optional)')}\n </h3>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {/* Mac Key */}\n <div>\n <label htmlFor=\"macKey\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.macKeyOverride', 'Mac Key Override')}\n </label>\n <input\n id=\"macKey\"\n type=\"text\"\n value={formData.macKey}\n onChange={(e) => setFormData({ ...formData, macKey: e.target.value })}\n className={inputClassName}\n placeholder=\"e.g., Cmd+K\"\n disabled={loading}\n />\n </div>\n\n {/* Windows Key */}\n <div>\n <label\n htmlFor=\"windowsKey\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('shortcuts.windowsKeyOverride', 'Windows Key Override')}\n </label>\n <input\n id=\"windowsKey\"\n type=\"text\"\n value={formData.windowsKey}\n onChange={(e) => setFormData({ ...formData, windowsKey: e.target.value })}\n className={inputClassName}\n placeholder=\"e.g., Ctrl+K\"\n disabled={loading}\n />\n </div>\n </div>\n </div>\n\n {/* Options Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('shortcuts.options', 'Options')}\n </h3>\n\n <div className=\"flex items-center gap-6\">\n {/* Is Enabled */}\n <label className=\"flex items-center gap-2 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={formData.isEnabled}\n onChange={(e) => setFormData({ ...formData, isEnabled: e.target.checked })}\n className=\"size-4 rounded border-default text-[var(--color-action-primary-bg)] focus:ring-[var(--color-border-focus)]\"\n disabled={loading}\n />\n <span className=\"text-sm text-text-primary\">{tr('shortcuts.enabled', 'Enabled')}</span>\n </label>\n\n {/* Is Sequence */}\n <label className=\"flex items-center gap-2 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={formData.isSequence}\n onChange={(e) => setFormData({ ...formData, isSequence: e.target.checked })}\n className=\"size-4 rounded border-default text-[var(--color-action-primary-bg)] focus:ring-[var(--color-border-focus)]\"\n disabled={loading}\n />\n <span className=\"text-sm text-text-primary\">\n {tr('shortcuts.keySequence', 'Key Sequence')}\n </span>\n </label>\n </div>\n\n {/* Sort Order */}\n <div className=\"w-32\">\n <label htmlFor=\"sortOrder\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.sortOrder', 'Sort Order')}\n </label>\n <input\n id=\"sortOrder\"\n type=\"number\"\n min={0}\n value={formData.sortOrder}\n onChange={(e) => setFormData({ ...formData, sortOrder: parseInt(e.target.value) || 0 })}\n className={inputClassName}\n disabled={loading}\n />\n </div>\n </div>\n\n {/* Form Actions */}\n <div className=\"flex gap-3 pt-4 border-t border-border-seam\">\n <button\n type=\"submit\"\n disabled={loading}\n className=\"\n inline-flex items-center gap-2 px-6 py-2.5\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90\n transition-all duration-200\n font-medium\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n {loading && <Loader2 size={16} className=\"animate-spin\" />}\n {shortcut\n ? tr('shortcuts.updateShortcut', 'Update Shortcut')\n : tr('shortcuts.createShortcut', 'Create Shortcut')}\n </button>\n\n <button\n type=\"button\"\n onClick={onCancel}\n disabled={loading}\n className=\"\n px-6 py-2.5\n bg-transparent\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n font-medium\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n {tr('productCommon.cancel', 'Cancel')}\n </button>\n </div>\n </form>\n );\n}\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,EAAa,EAAE,aAAU,aAAU,aAAU,cAA8B;CACzF,IAAM,IAAK,GAAO,EAEZ,EAAE,gBAAa,EAAY,EAAE,EAAE,EAAE,OAAO,KAAK,CAAC,EAE9C,CAAC,GAAU,K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,CACE,kBAAC,SAAD;QACE,MAAK;QACL,SAAS,EAAS;QAClB,WAAW,MAAM,EAAY;SAAE,GAAG;SAAU,YAAY,EAAE,OAAO;SAAS,CAAC;QAC3E,WAAU;QACV,UAAU;QACV,CAAA,EACF,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAG,yBAAyB,eAAe;QACvC,CAAA,CACD;SACJ;;KAGN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,SAAD;OAAO,SAAQ;OAAY,WAAU;iBAClC,EAAG,uBAAuB,aAAa;OAClC,CAAA,EACR,kBAAC,SAAD;OACE,IAAG;OACH,MAAK;OACL,KAAK;OACL,OAAO,EAAS;OAChB,WAAW,MAAM,EAAY;QAAE,GAAG;QAAU,WAAW,SAAS,EAAE,OAAO,MAAM,IAAI;QAAG,CAAC;OACvF,WAAW;OACX,UAAU;OACV,CAAA,CACE;;KACF;;GAGN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,UAAD;KACE,MAAK;KACL,UAAU;KACV,WAAU;eAHZ,CAcG,KAAW,kBAAC,GAAD;MAAS,MAAM;MAAI,WAAU;MAAiB,CAAA,EACzD,IACG,EAAG,4BAA4B,kBAAkB,GACjD,EAAG,4BAA4B,kBAAkB,CAC9C;QAET,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,UAAU;KACV,WAAU;eAYT,EAAG,wBAAwB,SAAS;KAC9B,CAAA,CACL;;GACD"}
|
|
1
|
+
{"version":3,"file":"ShortcutForm.js","names":[],"sources":["../../../../../src/product-management/modules/shortcuts/components/ShortcutForm.tsx"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { Loader2 } from 'lucide-react';\nimport { ZodError } from 'zod';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport type {\n KeyboardShortcut,\n CreateKeyboardShortcutInput,\n UpdateKeyboardShortcutInput,\n} from '../types';\nimport { ShortcutCategories } from '../types';\nimport { createShortcutSchema, updateShortcutSchema } from '../schemas';\nimport { useProducts } from '../../products/hooks/useProducts';\nimport { MarkdownEditor } from '../../../../shared/components/MarkdownEditor';\n\ninterface ShortcutFormProps {\n shortcut?: KeyboardShortcut | null;\n onSubmit: (data: CreateKeyboardShortcutInput | UpdateKeyboardShortcutInput) => Promise<void>;\n onCancel: () => void;\n loading?: boolean;\n}\n\nexport function ShortcutForm({ shortcut, onSubmit, onCancel, loading }: ShortcutFormProps) {\n const tr = useTr();\n\n const { products } = useProducts({}, { limit: 100 });\n\n const [formData, setFormData] = useState({\n productId: shortcut?.productId || '',\n shortcutKey: shortcut?.shortcutKey || '',\n eventName: shortcut?.eventName || '',\n category: shortcut?.category || ShortcutCategories.NAVIGATION,\n label: shortcut?.label || '',\n description: shortcut?.description || '',\n macKey: shortcut?.macKey || '',\n windowsKey: shortcut?.windowsKey || '',\n isEnabled: shortcut?.isEnabled ?? true,\n isSequence: shortcut?.isSequence ?? false,\n sortOrder: shortcut?.sortOrder ?? 0,\n });\n\n const [errors, setErrors] = useState<Record<string, string>>({});\n\n // Auto-detect if it's a sequence (contains space but no +)\n useEffect(() => {\n const hasSpace = formData.shortcutKey.includes(' ');\n const hasPlus = formData.shortcutKey.includes('+');\n if (hasSpace && !hasPlus) {\n setFormData((prev) => ({ ...prev, isSequence: true }));\n } else if (hasPlus && !hasSpace) {\n setFormData((prev) => ({ ...prev, isSequence: false }));\n }\n }, [formData.shortcutKey]);\n\n const validate = () => {\n try {\n const schema = shortcut ? updateShortcutSchema : createShortcutSchema;\n schema.parse(formData);\n setErrors({});\n return true;\n } catch (error) {\n if (error instanceof ZodError) {\n const newErrors: Record<string, string> = {};\n error.issues.forEach((issue) => {\n const path = issue.path.join('.');\n newErrors[path] = issue.message;\n });\n setErrors(newErrors);\n }\n return false;\n }\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (!validate()) {\n return;\n }\n\n const submitData = shortcut\n ? {\n // Update only changed fields\n shortcutKey:\n formData.shortcutKey !== shortcut.shortcutKey ? formData.shortcutKey : undefined,\n eventName: formData.eventName !== shortcut.eventName ? formData.eventName : undefined,\n category: formData.category !== shortcut.category ? formData.category : undefined,\n label: formData.label !== shortcut.label ? formData.label : undefined,\n description:\n formData.description !== (shortcut.description || '')\n ? formData.description || undefined\n : undefined,\n macKey:\n formData.macKey !== (shortcut.macKey || '') ? formData.macKey || undefined : undefined,\n windowsKey:\n formData.windowsKey !== (shortcut.windowsKey || '')\n ? formData.windowsKey || undefined\n : undefined,\n isEnabled: formData.isEnabled !== shortcut.isEnabled ? formData.isEnabled : undefined,\n isSequence: formData.isSequence !== shortcut.isSequence ? formData.isSequence : undefined,\n sortOrder: formData.sortOrder !== shortcut.sortOrder ? formData.sortOrder : undefined,\n }\n : {\n // Create with all fields\n productId: formData.productId || undefined,\n shortcutKey: formData.shortcutKey,\n eventName: formData.eventName,\n category: formData.category,\n label: formData.label,\n description: formData.description || undefined,\n macKey: formData.macKey || undefined,\n windowsKey: formData.windowsKey || undefined,\n isEnabled: formData.isEnabled,\n isSequence: formData.isSequence,\n sortOrder: formData.sortOrder,\n };\n\n await onSubmit(submitData);\n };\n\n const inputClassName = `\n w-full px-3 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n placeholder:text-text-tertiary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n disabled:bg-bg-sunken disabled:cursor-not-allowed\n transition-all duration-200\n `;\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-6 animate-in fade-in duration-200\">\n {/* Basic Information Section */}\n <div className=\"space-y-4\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('shortcuts.basicInformation', 'Basic Information')}\n </h3>\n\n {/* Product Selection */}\n <div>\n <label htmlFor=\"productId\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.product', 'Product')}\n </label>\n <select\n id=\"productId\"\n value={formData.productId}\n onChange={(e) => setFormData({ ...formData, productId: e.target.value })}\n className={inputClassName}\n disabled={loading || !!shortcut}\n >\n <option value=\"\">{tr('shortcuts.globalAllProducts', 'Global (All Products)')}</option>\n {products.map((product) => (\n <option key={product.id} value={product.id}>\n {product.name}\n </option>\n ))}\n </select>\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'shortcuts.globalShortcutHint',\n 'Leave empty for global shortcuts that work across all products.'\n )}\n </p>\n </div>\n\n {/* Label */}\n <div>\n <label htmlFor=\"label\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.label', 'Label')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"label\"\n type=\"text\"\n value={formData.label}\n onChange={(e) => setFormData({ ...formData, label: e.target.value })}\n className={inputClassName}\n placeholder=\"e.g., Go to Home\"\n disabled={loading}\n required\n />\n {errors.label && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.label}</p>\n )}\n </div>\n\n {/* Shortcut Key */}\n <div>\n <label htmlFor=\"shortcutKey\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.shortcutKey', 'Shortcut Key')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"shortcutKey\"\n type=\"text\"\n value={formData.shortcutKey}\n onChange={(e) => setFormData({ ...formData, shortcutKey: e.target.value })}\n className={inputClassName}\n placeholder=\"e.g., g h or Cmd+K\"\n disabled={loading}\n required\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'shortcuts.shortcutKeyHint',\n 'Use space for sequences (g h), use + for modifiers (Cmd+K, Ctrl+Shift+P)'\n )}\n </p>\n {errors.shortcutKey && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.shortcutKey}</p>\n )}\n </div>\n\n {/* Event Name */}\n <div>\n <label htmlFor=\"eventName\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.eventName', 'Event Name')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <input\n id=\"eventName\"\n type=\"text\"\n value={formData.eventName}\n onChange={(e) => setFormData({ ...formData, eventName: e.target.value })}\n className={inputClassName}\n placeholder=\"e.g., navigate:home\"\n disabled={loading}\n required\n />\n <p className=\"text-xs text-text-tertiary mt-1\">\n {tr(\n 'shortcuts.eventNameHint',\n 'The event name to emit when this shortcut is triggered.'\n )}\n </p>\n {errors.eventName && (\n <p className=\"text-sm text-[var(--color-status-error)] mt-1\">{errors.eventName}</p>\n )}\n </div>\n\n {/* Category */}\n <div>\n <label htmlFor=\"category\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.category', 'Category')}{' '}\n <span className=\"text-[var(--color-status-error)]\">*</span>\n </label>\n <select\n id=\"category\"\n value={formData.category}\n onChange={(e) => setFormData({ ...formData, category: e.target.value })}\n className={inputClassName}\n disabled={loading}\n >\n {Object.values(ShortcutCategories).map((cat) => (\n <option key={cat} value={cat}>\n {cat}\n </option>\n ))}\n </select>\n </div>\n\n {/* Description */}\n <MarkdownEditor\n id=\"description\"\n label={tr('shortcuts.description', 'Description')}\n value={formData.description}\n onChange={(value) => setFormData({ ...formData, description: value })}\n placeholder={tr(\n 'shortcuts.descriptionPlaceholder',\n 'Enter a description for this shortcut'\n )}\n disabled={loading}\n error={errors.description}\n rows={3}\n minHeight={90}\n />\n </div>\n\n {/* Platform-Specific Keys Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('shortcuts.platformSpecificKeys', 'Platform-Specific Keys (Optional)')}\n </h3>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {/* Mac Key */}\n <div>\n <label htmlFor=\"macKey\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.macKeyOverride', 'Mac Key Override')}\n </label>\n <input\n id=\"macKey\"\n type=\"text\"\n value={formData.macKey}\n onChange={(e) => setFormData({ ...formData, macKey: e.target.value })}\n className={inputClassName}\n placeholder=\"e.g., Cmd+K\"\n disabled={loading}\n />\n </div>\n\n {/* Windows Key */}\n <div>\n <label\n htmlFor=\"windowsKey\"\n className=\"block text-sm font-medium text-text-primary mb-1\"\n >\n {tr('shortcuts.windowsKeyOverride', 'Windows Key Override')}\n </label>\n <input\n id=\"windowsKey\"\n type=\"text\"\n value={formData.windowsKey}\n onChange={(e) => setFormData({ ...formData, windowsKey: e.target.value })}\n className={inputClassName}\n placeholder=\"e.g., Ctrl+K\"\n disabled={loading}\n />\n </div>\n </div>\n </div>\n\n {/* Options Section */}\n <div className=\"space-y-4 pt-4 border-t border-border-seam\">\n <h3 className=\"text-sm font-semibold text-text-secondary uppercase tracking-wider\">\n {tr('shortcuts.options', 'Options')}\n </h3>\n\n <div className=\"flex items-center gap-6\">\n {/* Is Enabled */}\n <label className=\"flex items-center gap-2 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={formData.isEnabled}\n onChange={(e) => setFormData({ ...formData, isEnabled: e.target.checked })}\n className=\"size-4 rounded border-default text-[var(--color-action-primary-bg)] focus:ring-[var(--color-border-focus)]\"\n disabled={loading}\n />\n <span className=\"text-sm text-text-primary\">{tr('shortcuts.enabled', 'Enabled')}</span>\n </label>\n\n {/* Is Sequence */}\n <label className=\"flex items-center gap-2 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={formData.isSequence}\n onChange={(e) => setFormData({ ...formData, isSequence: e.target.checked })}\n className=\"size-4 rounded border-default text-[var(--color-action-primary-bg)] focus:ring-[var(--color-border-focus)]\"\n disabled={loading}\n />\n <span className=\"text-sm text-text-primary\">\n {tr('shortcuts.keySequence', 'Key Sequence')}\n </span>\n </label>\n </div>\n\n {/* Sort Order */}\n <div className=\"w-32\">\n <label htmlFor=\"sortOrder\" className=\"block text-sm font-medium text-text-primary mb-1\">\n {tr('shortcuts.sortOrder', 'Sort Order')}\n </label>\n <input\n id=\"sortOrder\"\n type=\"number\"\n min={0}\n value={formData.sortOrder}\n onChange={(e) => setFormData({ ...formData, sortOrder: parseInt(e.target.value) || 0 })}\n className={inputClassName}\n disabled={loading}\n />\n </div>\n </div>\n\n {/* Form Actions */}\n <div className=\"flex gap-3 pt-4 border-t border-border-seam\">\n <button\n type=\"submit\"\n disabled={loading}\n className=\"\n inline-flex items-center gap-2 px-6 py-2.5\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90\n transition-all duration-200\n font-medium\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n {loading && <Loader2 size={16} className=\"animate-spin\" />}\n {shortcut\n ? tr('shortcuts.updateShortcut', 'Update Shortcut')\n : tr('shortcuts.createShortcut', 'Create Shortcut')}\n </button>\n\n <button\n type=\"button\"\n onClick={onCancel}\n disabled={loading}\n className=\"\n px-6 py-2.5\n bg-transparent\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n font-medium\n disabled:opacity-50 disabled:cursor-not-allowed\n \"\n >\n {tr('productCommon.cancel', 'Cancel')}\n </button>\n </div>\n </form>\n );\n}\n"],"mappings":";;;;;;;;;;AAqBA,SAAgB,EAAa,EAAE,aAAU,aAAU,aAAU,cAA8B;CACzF,IAAM,IAAK,GAAO,EAEZ,EAAE,gBAAa,EAAY,EAAE,EAAE,EAAE,OAAO,KAAK,CAAC,EAE9C,CAAC,GAAU,KAAe,EAAS;EACvC,WAAW,GAAU,aAAa;EAClC,aAAa,GAAU,eAAe;EACtC,WAAW,GAAU,aAAa;EAClC,UAAU,GAAU,YAAY,EAAmB;EACnD,OAAO,GAAU,SAAS;EAC1B,aAAa,GAAU,eAAe;EACtC,QAAQ,GAAU,UAAU;EAC5B,YAAY,GAAU,cAAc;EACpC,WAAW,GAAU,aAAa;EAClC,YAAY,GAAU,cAAc;EACpC,WAAW,GAAU,aAAa;EACnC,CAAC,EAEI,CAAC,GAAQ,KAAa,EAAiC,EAAE,CAAC;AAGhE,SAAgB;EACd,IAAM,IAAW,EAAS,YAAY,SAAS,IAAI,EAC7C,IAAU,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D;IAAK,WAAU;cAAf,CACE,kBAAC,UAAD;KACE,MAAK;KACL,UAAU;KACV,WAAU;eAHZ,CAcG,KAAW,kBAAC,GAAD;MAAS,MAAM;MAAI,WAAU;MAAiB,CAAA,EACzD,IACG,EAAG,4BAA4B,kBAAkB,GACjD,EAAG,4BAA4B,kBAAkB,CAC9C;QAET,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,UAAU;KACV,WAAU;eAYT,EAAG,wBAAwB,SAAS;KAC9B,CAAA,CACL;;GACD"}
|
|
@@ -10,207 +10,208 @@ import { ShortcutKeyBadge as f } from "../components/ShortcutKeyBadge.js";
|
|
|
10
10
|
import { ArrowLeft as p, SquarePen as m, ToggleLeft as h, ToggleRight as g, Trash2 as _ } from "lucide-react";
|
|
11
11
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
12
12
|
import { useParams as b } from "react-router-dom";
|
|
13
|
-
import {
|
|
13
|
+
import { Markdown as x } from "@burdenoff/fe-libs/shared/components";
|
|
14
|
+
import { CTAOverflowMenu as S, EmphasisPanel as C, GradientText as w, NextSteps as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
|
|
14
15
|
//#region src/product-management/modules/shortcuts/pages/ShortcutDetailPage.tsx
|
|
15
|
-
function
|
|
16
|
-
let { id:
|
|
16
|
+
function D() {
|
|
17
|
+
let { id: D } = b(), { navigate: O, basePath: k = "/products" } = t(), A = e(), { confirm: j, ConfirmDialog: M } = s(), N = D || "", { shortcut: P, loading: F, error: I, refetch: L } = l(N), { deleteShortcut: R, loading: z } = c(), { toggleShortcut: B, loading: V } = u(), H = async () => {
|
|
17
18
|
a("medium");
|
|
18
|
-
let e =
|
|
19
|
+
let e = A("shortcuts.confirmDelete", "Are you sure you want to delete this shortcut?"), t = await i({
|
|
19
20
|
title: "Delete shortcut",
|
|
20
21
|
message: e,
|
|
21
22
|
okButtonTitle: "Delete",
|
|
22
23
|
cancelButtonTitle: "Cancel"
|
|
23
24
|
});
|
|
24
|
-
if (t === null ? await
|
|
25
|
+
if (t === null ? await j({
|
|
25
26
|
title: "Delete shortcut",
|
|
26
27
|
message: e,
|
|
27
28
|
okButtonTitle: "Delete",
|
|
28
29
|
cancelButtonTitle: "Cancel",
|
|
29
30
|
destructive: !0
|
|
30
31
|
}) : t) try {
|
|
31
|
-
await
|
|
32
|
+
await R(N), o("success"), O(`${k}/shortcuts`);
|
|
32
33
|
} catch (e) {
|
|
33
34
|
o("error"), console.error("Failed to delete shortcut:", e);
|
|
34
35
|
}
|
|
35
|
-
},
|
|
36
|
-
if (
|
|
36
|
+
}, U = async () => {
|
|
37
|
+
if (P) {
|
|
37
38
|
a("medium");
|
|
38
39
|
try {
|
|
39
|
-
await
|
|
40
|
+
await B(N, !P.isEnabled), L();
|
|
40
41
|
} catch (e) {
|
|
41
42
|
o("error"), console.error("Failed to toggle shortcut:", e);
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
|
-
return
|
|
46
|
+
return F ? /* @__PURE__ */ v("div", {
|
|
46
47
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6",
|
|
47
|
-
children: /* @__PURE__ */ v(n, { message:
|
|
48
|
-
}) :
|
|
48
|
+
children: /* @__PURE__ */ v(n, { message: A("shortcuts.loadingShortcut", "Loading shortcut...") })
|
|
49
|
+
}) : I ? /* @__PURE__ */ v("div", {
|
|
49
50
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6",
|
|
50
51
|
children: /* @__PURE__ */ v(r, {
|
|
51
|
-
message:
|
|
52
|
+
message: I.message,
|
|
52
53
|
action: {
|
|
53
|
-
label:
|
|
54
|
-
onClick: () =>
|
|
54
|
+
label: A("productCommon.retry", "Retry"),
|
|
55
|
+
onClick: () => L()
|
|
55
56
|
}
|
|
56
57
|
})
|
|
57
|
-
}) :
|
|
58
|
+
}) : P ? /* @__PURE__ */ y("div", {
|
|
58
59
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200",
|
|
59
60
|
children: [
|
|
60
61
|
/* @__PURE__ */ y("div", {
|
|
61
62
|
className: "mb-6",
|
|
62
63
|
children: [/* @__PURE__ */ y("button", {
|
|
63
64
|
type: "button",
|
|
64
|
-
onClick: () =>
|
|
65
|
+
onClick: () => O(`${k}/shortcuts`),
|
|
65
66
|
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 ",
|
|
66
|
-
children: [/* @__PURE__ */ v(p, { size: 18 }),
|
|
67
|
+
children: [/* @__PURE__ */ v(p, { size: 18 }), A("shortcuts.backToShortcuts", "Back to Shortcuts")]
|
|
67
68
|
}), /* @__PURE__ */ y("div", {
|
|
68
69
|
className: "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",
|
|
69
70
|
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("div", {
|
|
70
71
|
className: "flex flex-wrap items-center gap-3 mb-2",
|
|
71
72
|
children: [/* @__PURE__ */ v("h1", {
|
|
72
73
|
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
73
|
-
children: /* @__PURE__ */ v(
|
|
74
|
-
}), /* @__PURE__ */ v(d, { category:
|
|
74
|
+
children: /* @__PURE__ */ v(w, { children: P.label })
|
|
75
|
+
}), /* @__PURE__ */ v(d, { category: P.category })]
|
|
75
76
|
}), /* @__PURE__ */ y("div", {
|
|
76
77
|
className: "flex items-center gap-3",
|
|
77
78
|
children: [/* @__PURE__ */ v(f, {
|
|
78
|
-
shortcutKey:
|
|
79
|
-
isSequence:
|
|
79
|
+
shortcutKey: P.shortcutKey,
|
|
80
|
+
isSequence: P.isSequence
|
|
80
81
|
}), /* @__PURE__ */ y("span", {
|
|
81
82
|
className: `
|
|
82
83
|
inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium
|
|
83
|
-
${
|
|
84
|
+
${P.isEnabled ? "bg-[var(--color-status-success-subtle)] text-[var(--color-status-success)]" : "bg-bg-sunken text-text-tertiary"}
|
|
84
85
|
`,
|
|
85
|
-
children: [
|
|
86
|
+
children: [P.isEnabled && /* @__PURE__ */ v("span", { className: "size-1.5 rounded-full bg-[var(--color-status-success)] motion-safe:animate-vc-glow-pulse" }), P.isEnabled ? A("shortcuts.enabled", "Enabled") : A("shortcuts.disabled", "Disabled")]
|
|
86
87
|
})]
|
|
87
|
-
})] }), /* @__PURE__ */ v(
|
|
88
|
+
})] }), /* @__PURE__ */ v(S, {
|
|
88
89
|
primary: {
|
|
89
|
-
label:
|
|
90
|
-
onSelect: () =>
|
|
90
|
+
label: A("shortcuts.edit", "Edit"),
|
|
91
|
+
onSelect: () => O(`${k}/shortcuts/${N}/edit`),
|
|
91
92
|
icon: /* @__PURE__ */ v(m, { className: "size-4" })
|
|
92
93
|
},
|
|
93
94
|
actions: [{
|
|
94
|
-
label:
|
|
95
|
+
label: P.isEnabled ? A("shortcuts.disable", "Disable") : A("shortcuts.enable", "Enable"),
|
|
95
96
|
onSelect: () => {
|
|
96
|
-
|
|
97
|
+
U();
|
|
97
98
|
},
|
|
98
|
-
disabled:
|
|
99
|
-
icon:
|
|
99
|
+
disabled: V,
|
|
100
|
+
icon: P.isEnabled ? /* @__PURE__ */ v(h, { className: "size-4" }) : /* @__PURE__ */ v(g, { className: "size-4" })
|
|
100
101
|
}, {
|
|
101
|
-
label:
|
|
102
|
+
label: A("shortcuts.delete", "Delete"),
|
|
102
103
|
onSelect: () => {
|
|
103
|
-
|
|
104
|
+
H();
|
|
104
105
|
},
|
|
105
106
|
intent: "destructive",
|
|
106
|
-
disabled:
|
|
107
|
+
disabled: z,
|
|
107
108
|
icon: /* @__PURE__ */ v(_, { className: "size-4" })
|
|
108
109
|
}]
|
|
109
110
|
})]
|
|
110
111
|
})]
|
|
111
112
|
}),
|
|
112
|
-
/* @__PURE__ */ v(
|
|
113
|
+
/* @__PURE__ */ v(E, {
|
|
113
114
|
className: "mb-6",
|
|
114
|
-
children:
|
|
115
|
+
children: A("shortcuts.detailPurpose", `This is the "${P.label}" shortcut — it fires the "${P.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.`)
|
|
115
116
|
}),
|
|
116
|
-
/* @__PURE__ */ v(
|
|
117
|
+
/* @__PURE__ */ v(T, {
|
|
117
118
|
storageKey: "product-shortcut-detail",
|
|
118
119
|
className: "mb-6",
|
|
119
120
|
steps: [
|
|
120
121
|
{
|
|
121
122
|
id: "edit",
|
|
122
|
-
label:
|
|
123
|
-
description:
|
|
124
|
-
onClick: () =>
|
|
123
|
+
label: A("shortcuts.steps.edit", "Edit this shortcut"),
|
|
124
|
+
description: A("shortcuts.steps.editDesc", "Change the key combination, event, category, or per-platform keys."),
|
|
125
|
+
onClick: () => O(`${k}/shortcuts/${N}/edit`)
|
|
125
126
|
},
|
|
126
127
|
{
|
|
127
128
|
id: "toggle",
|
|
128
|
-
label:
|
|
129
|
-
description:
|
|
129
|
+
label: P.isEnabled ? A("shortcuts.steps.disable", "Disable this shortcut") : A("shortcuts.steps.enable", "Enable this shortcut"),
|
|
130
|
+
description: A("shortcuts.steps.toggleDesc", "Turn it on or off without deleting it — useful while testing."),
|
|
130
131
|
onClick: () => {
|
|
131
|
-
|
|
132
|
+
U();
|
|
132
133
|
}
|
|
133
134
|
},
|
|
134
135
|
{
|
|
135
136
|
id: "back",
|
|
136
|
-
label:
|
|
137
|
-
description:
|
|
138
|
-
onClick: () =>
|
|
137
|
+
label: A("shortcuts.steps.back", "Back to all shortcuts"),
|
|
138
|
+
description: A("shortcuts.steps.backDesc", "Return to the list to manage the rest of your shortcuts."),
|
|
139
|
+
onClick: () => O(`${k}/shortcuts`)
|
|
139
140
|
}
|
|
140
141
|
]
|
|
141
142
|
}),
|
|
142
143
|
/* @__PURE__ */ y("div", {
|
|
143
144
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
144
|
-
children: [/* @__PURE__ */ y(
|
|
145
|
+
children: [/* @__PURE__ */ y(C, { children: [/* @__PURE__ */ v("h2", {
|
|
145
146
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
146
|
-
children:
|
|
147
|
+
children: A("shortcuts.shortcutDetails", "Shortcut Details")
|
|
147
148
|
}), /* @__PURE__ */ y("dl", {
|
|
148
149
|
className: "space-y-4",
|
|
149
150
|
children: [
|
|
150
151
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
151
152
|
className: "text-sm font-medium text-text-secondary",
|
|
152
|
-
children:
|
|
153
|
+
children: A("shortcuts.label", "Label")
|
|
153
154
|
}), /* @__PURE__ */ v("dd", {
|
|
154
155
|
className: "text-text-primary mt-1",
|
|
155
|
-
children:
|
|
156
|
+
children: P.label
|
|
156
157
|
})] }),
|
|
157
|
-
|
|
158
|
+
P.description && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
158
159
|
className: "text-sm font-medium text-text-secondary",
|
|
159
|
-
children:
|
|
160
|
+
children: A("shortcuts.description", "Description")
|
|
160
161
|
}), /* @__PURE__ */ v("dd", {
|
|
161
162
|
className: "text-text-primary mt-1",
|
|
162
|
-
children:
|
|
163
|
+
children: /* @__PURE__ */ v(x, { children: P.description })
|
|
163
164
|
})] }),
|
|
164
165
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
165
166
|
className: "text-sm font-medium text-text-secondary",
|
|
166
|
-
children:
|
|
167
|
+
children: A("shortcuts.shortcutKey", "Shortcut Key")
|
|
167
168
|
}), /* @__PURE__ */ v("dd", {
|
|
168
169
|
className: "mt-1",
|
|
169
170
|
children: /* @__PURE__ */ v(f, {
|
|
170
|
-
shortcutKey:
|
|
171
|
-
isSequence:
|
|
171
|
+
shortcutKey: P.shortcutKey,
|
|
172
|
+
isSequence: P.isSequence
|
|
172
173
|
})
|
|
173
174
|
})] }),
|
|
174
175
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
175
176
|
className: "text-sm font-medium text-text-secondary",
|
|
176
|
-
children:
|
|
177
|
+
children: A("shortcuts.eventName", "Event Name")
|
|
177
178
|
}), /* @__PURE__ */ v("dd", {
|
|
178
179
|
className: "mt-1",
|
|
179
180
|
children: /* @__PURE__ */ v("code", {
|
|
180
181
|
className: "text-sm text-text-secondary bg-bg-sunken px-2 py-1 rounded font-mono",
|
|
181
|
-
children:
|
|
182
|
+
children: P.eventName
|
|
182
183
|
})
|
|
183
184
|
})] }),
|
|
184
185
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
185
186
|
className: "text-sm font-medium text-text-secondary",
|
|
186
|
-
children:
|
|
187
|
+
children: A("shortcuts.category", "Category")
|
|
187
188
|
}), /* @__PURE__ */ v("dd", {
|
|
188
189
|
className: "mt-1",
|
|
189
|
-
children: /* @__PURE__ */ v(d, { category:
|
|
190
|
+
children: /* @__PURE__ */ v(d, { category: P.category })
|
|
190
191
|
})] }),
|
|
191
192
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
192
193
|
className: "text-sm font-medium text-text-secondary",
|
|
193
|
-
children:
|
|
194
|
+
children: A("shortcuts.product", "Product")
|
|
194
195
|
}), /* @__PURE__ */ v("dd", {
|
|
195
196
|
className: "text-text-primary mt-1",
|
|
196
|
-
children:
|
|
197
|
+
children: P.product?.name || /* @__PURE__ */ v("span", {
|
|
197
198
|
className: "text-text-tertiary italic",
|
|
198
|
-
children:
|
|
199
|
+
children: A("shortcuts.globalAllProducts", "Global (All Products)")
|
|
199
200
|
})
|
|
200
201
|
})] }),
|
|
201
202
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
202
203
|
className: "text-sm font-medium text-text-secondary",
|
|
203
|
-
children:
|
|
204
|
+
children: A("shortcuts.type", "Type")
|
|
204
205
|
}), /* @__PURE__ */ v("dd", {
|
|
205
206
|
className: "text-text-primary mt-1",
|
|
206
|
-
children:
|
|
207
|
+
children: P.isSequence ? A("shortcuts.keySequence", "Key Sequence") : A("shortcuts.keyCombination", "Key Combination")
|
|
207
208
|
})] }),
|
|
208
209
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
209
210
|
className: "text-sm font-medium text-text-secondary",
|
|
210
|
-
children:
|
|
211
|
+
children: A("shortcuts.sortOrder", "Sort Order")
|
|
211
212
|
}), /* @__PURE__ */ v("dd", {
|
|
212
213
|
className: "text-text-primary mt-1",
|
|
213
|
-
children:
|
|
214
|
+
children: P.sortOrder
|
|
214
215
|
})] })
|
|
215
216
|
]
|
|
216
217
|
})] }), /* @__PURE__ */ y("div", {
|
|
@@ -218,39 +219,39 @@ function E() {
|
|
|
218
219
|
children: [
|
|
219
220
|
/* @__PURE__ */ v("h2", {
|
|
220
221
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
221
|
-
children:
|
|
222
|
+
children: A("shortcuts.platformKeys", "Platform Keys")
|
|
222
223
|
}),
|
|
223
224
|
/* @__PURE__ */ y("dl", {
|
|
224
225
|
className: "space-y-4",
|
|
225
226
|
children: [
|
|
226
227
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
227
228
|
className: "text-sm font-medium text-text-secondary",
|
|
228
|
-
children:
|
|
229
|
+
children: A("shortcuts.defaultKey", "Default Key")
|
|
229
230
|
}), /* @__PURE__ */ v("dd", {
|
|
230
231
|
className: "mt-1",
|
|
231
232
|
children: /* @__PURE__ */ v(f, {
|
|
232
|
-
shortcutKey:
|
|
233
|
-
isSequence:
|
|
233
|
+
shortcutKey: P.shortcutKey,
|
|
234
|
+
isSequence: P.isSequence
|
|
234
235
|
})
|
|
235
236
|
})] }),
|
|
236
237
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
237
238
|
className: "text-sm font-medium text-text-secondary",
|
|
238
|
-
children:
|
|
239
|
+
children: A("shortcuts.macKey", "Mac Key")
|
|
239
240
|
}), /* @__PURE__ */ v("dd", {
|
|
240
241
|
className: "mt-1",
|
|
241
|
-
children:
|
|
242
|
+
children: P.macKey ? /* @__PURE__ */ v(f, { shortcutKey: P.macKey }) : /* @__PURE__ */ v("span", {
|
|
242
243
|
className: "text-text-tertiary italic",
|
|
243
|
-
children:
|
|
244
|
+
children: A("shortcuts.sameAsDefault", "Same as default")
|
|
244
245
|
})
|
|
245
246
|
})] }),
|
|
246
247
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
247
248
|
className: "text-sm font-medium text-text-secondary",
|
|
248
|
-
children:
|
|
249
|
+
children: A("shortcuts.windowsLinuxKey", "Windows/Linux Key")
|
|
249
250
|
}), /* @__PURE__ */ v("dd", {
|
|
250
251
|
className: "mt-1",
|
|
251
|
-
children:
|
|
252
|
+
children: P.windowsKey ? /* @__PURE__ */ v(f, { shortcutKey: P.windowsKey }) : /* @__PURE__ */ v("span", {
|
|
252
253
|
className: "text-text-tertiary italic",
|
|
253
|
-
children:
|
|
254
|
+
children: A("shortcuts.sameAsDefault", "Same as default")
|
|
254
255
|
})
|
|
255
256
|
})] })
|
|
256
257
|
]
|
|
@@ -259,26 +260,26 @@ function E() {
|
|
|
259
260
|
className: "mt-6 pt-4 border-t border-border-seam",
|
|
260
261
|
children: [/* @__PURE__ */ v("h3", {
|
|
261
262
|
className: "text-sm font-semibold text-text-secondary mb-3",
|
|
262
|
-
children:
|
|
263
|
+
children: A("shortcuts.timestamps", "Timestamps")
|
|
263
264
|
}), /* @__PURE__ */ y("dl", {
|
|
264
265
|
className: "space-y-2 text-sm",
|
|
265
266
|
children: [/* @__PURE__ */ y("div", {
|
|
266
267
|
className: "flex justify-between",
|
|
267
268
|
children: [/* @__PURE__ */ v("dt", {
|
|
268
269
|
className: "text-text-tertiary",
|
|
269
|
-
children:
|
|
270
|
+
children: A("shortcuts.created", "Created")
|
|
270
271
|
}), /* @__PURE__ */ v("dd", {
|
|
271
272
|
className: "text-text-primary",
|
|
272
|
-
children: new Date(
|
|
273
|
+
children: new Date(P.createdAt).toLocaleString()
|
|
273
274
|
})]
|
|
274
275
|
}), /* @__PURE__ */ y("div", {
|
|
275
276
|
className: "flex justify-between",
|
|
276
277
|
children: [/* @__PURE__ */ v("dt", {
|
|
277
278
|
className: "text-text-tertiary",
|
|
278
|
-
children:
|
|
279
|
+
children: A("shortcuts.updated", "Updated")
|
|
279
280
|
}), /* @__PURE__ */ v("dd", {
|
|
280
281
|
className: "text-text-primary",
|
|
281
|
-
children: new Date(
|
|
282
|
+
children: new Date(P.updatedAt).toLocaleString()
|
|
282
283
|
})]
|
|
283
284
|
})]
|
|
284
285
|
})]
|
|
@@ -286,20 +287,20 @@ function E() {
|
|
|
286
287
|
]
|
|
287
288
|
})]
|
|
288
289
|
}),
|
|
289
|
-
|
|
290
|
+
M
|
|
290
291
|
]
|
|
291
292
|
}) : /* @__PURE__ */ v("div", {
|
|
292
293
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6",
|
|
293
294
|
children: /* @__PURE__ */ v(r, {
|
|
294
|
-
message:
|
|
295
|
+
message: A("shortcuts.shortcutNotFound", "Shortcut not found"),
|
|
295
296
|
action: {
|
|
296
|
-
label:
|
|
297
|
-
onClick: () =>
|
|
297
|
+
label: A("shortcuts.goBack", "Go Back"),
|
|
298
|
+
onClick: () => O(`${k}/shortcuts`)
|
|
298
299
|
}
|
|
299
300
|
})
|
|
300
301
|
});
|
|
301
302
|
}
|
|
302
303
|
//#endregion
|
|
303
|
-
export {
|
|
304
|
+
export { D as ShortcutDetailPage };
|
|
304
305
|
|
|
305
306
|
//# sourceMappingURL=ShortcutDetailPage.js.map
|
|
@@ -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 {\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\">{shortcut.description}</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":";;;;;;;;;;;;;;AAmBA,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;;IAI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5C,CAAA;SAEN,CAAA,CACD,EAAA,CAAA;QAEN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;SAAI,WAAU;mBACX,EAAG,6BAA6B,oBAAoB;SAClD,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;MAjTJ,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-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(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,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