@burdenoff/microfe-product 2026.624.3 → 2026.625.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product/pages/ContentPageViewPage.js +25 -24
- package/dist/product/pages/ContentPageViewPage.js.map +1 -1
- package/dist/product/pages/ProductCatalogPage.js +69 -64
- package/dist/product/pages/ProductCatalogPage.js.map +1 -1
- package/dist/product/pages/ProductViewPage.js +91 -86
- package/dist/product/pages/ProductViewPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js +7 -7
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js +2 -2
- package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js +91 -89
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js +2 -2
- package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js +164 -159
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js +1 -1
- package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js +2 -2
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js +82 -80
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js +2 -2
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js +83 -79
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js +4 -4
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js +2 -2
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js +71 -69
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js +2 -2
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js +80 -75
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js.map +1 -1
- package/dist/product-management/modules/products/components/ProductForm.js +8 -8
- package/dist/product-management/modules/products/components/ProductForm.js.map +1 -1
- package/dist/product-management/modules/products/components/ProductPlans.js +4 -4
- package/dist/product-management/modules/products/components/ProductPlans.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductCreatePage.js +2 -2
- package/dist/product-management/modules/products/pages/ProductCreatePage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductDetailPage.js +142 -140
- package/dist/product-management/modules/products/pages/ProductDetailPage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductEditPage.js +2 -2
- package/dist/product-management/modules/products/pages/ProductEditPage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductsListPage.js +188 -179
- package/dist/product-management/modules/products/pages/ProductsListPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/components/ShortcutForm.js +3 -3
- package/dist/product-management/modules/shortcuts/components/ShortcutForm.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js +2 -2
- package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js +167 -175
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js +2 -2
- package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js +171 -168
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js.map +1 -1
- package/dist/product-management/shared/components/AuditHistoryTab.js +1 -1
- package/dist/product-management/shared/components/AuditHistoryTab.js.map +1 -1
- package/dist/product-management/shared/components/feedback/EmptyState.js +2 -20
- package/package.json +2 -2
- package/dist/product-management/shared/components/feedback/EmptyState.js.map +0 -1
|
@@ -1,301 +1,304 @@
|
|
|
1
1
|
import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
2
2
|
import { useProductConsole as t } from "../../../providers/ProductConsoleProvider.js";
|
|
3
3
|
import { LoadingState as n } from "../../../shared/components/feedback/LoadingState.js";
|
|
4
|
-
import { ErrorState as
|
|
5
|
-
import { SearchInput as
|
|
6
|
-
import { nativeConfirm as
|
|
7
|
-
import { useConfirmDialog as
|
|
8
|
-
import { useDebounced as
|
|
9
|
-
import { useDeleteShortcut as
|
|
10
|
-
import { ShortcutCategories as
|
|
11
|
-
import { ShortcutCategoryBadge as
|
|
12
|
-
import { ShortcutKeyBadge as
|
|
13
|
-
import { useState as
|
|
14
|
-
import { Eye as
|
|
15
|
-
import { jsx as
|
|
16
|
-
import { PermissionGate as
|
|
4
|
+
import { ErrorState as ee } from "../../../shared/components/feedback/ErrorState.js";
|
|
5
|
+
import { SearchInput as r } from "../../../shared/components/input/SearchInput.js";
|
|
6
|
+
import { nativeConfirm as i, nativeImpact as a, nativeNotify as o } from "../../../../utils/nativeBridge.js";
|
|
7
|
+
import { useConfirmDialog as s } from "../../../shared/hooks/useConfirmDialog.js";
|
|
8
|
+
import { useDebounced as c } from "../../../shared/hooks/useDebounced.js";
|
|
9
|
+
import { useDeleteShortcut as l, useSeedDefaultShortcuts as u, useShortcuts as d, useToggleShortcut as f } from "../hooks/useShortcuts.js";
|
|
10
|
+
import { ShortcutCategories as p } from "../types/index.js";
|
|
11
|
+
import { ShortcutCategoryBadge as m } from "../components/ShortcutCategoryBadge.js";
|
|
12
|
+
import { ShortcutKeyBadge as h } from "../components/ShortcutKeyBadge.js";
|
|
13
|
+
import { useState as g } from "react";
|
|
14
|
+
import { Eye as _, Plus as v, RefreshCw as y, Sparkles as b, SquarePen as x, ToggleLeft as S, ToggleRight as C, Trash2 as w } from "lucide-react";
|
|
15
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
16
|
+
import { PermissionGate as D } from "@burdenoff/fe-libs/shared/components";
|
|
17
|
+
import { Button as O, CTAOverflowMenu as k, GlassCard as A, GradientText as j, IllustratedEmptyState as M } from "@burdenoff/fe-libs/ui";
|
|
17
18
|
//#region src/product-management/modules/shortcuts/pages/ShortcutsListPage.tsx
|
|
18
|
-
function
|
|
19
|
-
let { navigate:
|
|
20
|
-
...
|
|
21
|
-
search:
|
|
22
|
-
}, { limit: 50 }), { deleteShortcut:
|
|
23
|
-
|
|
24
|
-
let t =
|
|
19
|
+
function N() {
|
|
20
|
+
let { navigate: N, basePath: P = "/products" } = t(), F = e(), { confirm: I, ConfirmDialog: L } = s(), [R, z] = g(""), B = c(R, 300), [V, H] = g({}), { shortcuts: U, loading: W, error: G, refetch: K } = d({
|
|
21
|
+
...V,
|
|
22
|
+
search: B || void 0
|
|
23
|
+
}, { limit: 50 }), { deleteShortcut: q, loading: J } = l(), { toggleShortcut: Y, loading: X } = f(), { seedDefaultShortcuts: Z, loading: Q } = u(), te = async (e) => {
|
|
24
|
+
a("medium");
|
|
25
|
+
let t = F("shortcuts.confirmDelete", "Are you sure you want to delete this shortcut?"), n = await i({
|
|
25
26
|
title: "Delete shortcut",
|
|
26
27
|
message: t,
|
|
27
28
|
okButtonTitle: "Delete",
|
|
28
29
|
cancelButtonTitle: "Cancel"
|
|
29
30
|
});
|
|
30
|
-
if (n === null ? await
|
|
31
|
+
if (n === null ? await I({
|
|
31
32
|
title: "Delete shortcut",
|
|
32
33
|
message: t,
|
|
33
34
|
okButtonTitle: "Delete",
|
|
34
35
|
cancelButtonTitle: "Cancel",
|
|
35
36
|
destructive: !0
|
|
36
37
|
}) : n) try {
|
|
37
|
-
await
|
|
38
|
+
await q(e), o("success"), K();
|
|
38
39
|
} catch (e) {
|
|
39
|
-
|
|
40
|
+
o("error"), console.error("Failed to delete shortcut:", e);
|
|
40
41
|
}
|
|
41
|
-
},
|
|
42
|
-
|
|
42
|
+
}, ne = async (e, t) => {
|
|
43
|
+
a("medium");
|
|
43
44
|
try {
|
|
44
|
-
await
|
|
45
|
+
await Y(e, !t), K();
|
|
45
46
|
} catch (e) {
|
|
46
|
-
|
|
47
|
+
o("error"), console.error("Failed to toggle shortcut:", e);
|
|
47
48
|
}
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
let e =
|
|
49
|
+
}, $ = async () => {
|
|
50
|
+
a("light");
|
|
51
|
+
let e = F("shortcuts.confirmSeedDefaults", "This will create default global shortcuts. Continue?"), t = await i({
|
|
51
52
|
title: "Seed defaults",
|
|
52
53
|
message: e,
|
|
53
54
|
okButtonTitle: "Continue",
|
|
54
55
|
cancelButtonTitle: "Cancel"
|
|
55
56
|
});
|
|
56
|
-
if (t === null ? await
|
|
57
|
+
if (t === null ? await I({
|
|
57
58
|
title: "Seed defaults",
|
|
58
59
|
message: e,
|
|
59
60
|
okButtonTitle: "Continue",
|
|
60
61
|
cancelButtonTitle: "Cancel"
|
|
61
62
|
}) : t) try {
|
|
62
|
-
let e = (await
|
|
63
|
-
|
|
63
|
+
let e = (await Z()).data?.seedDefaultShortcuts || 0;
|
|
64
|
+
o("success"), alert(`Created ${e} default shortcuts.`), K();
|
|
64
65
|
} catch (e) {
|
|
65
|
-
|
|
66
|
+
o("error"), console.error("Failed to seed shortcuts:", e);
|
|
66
67
|
}
|
|
67
68
|
};
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ E("div", {
|
|
69
70
|
className: "min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200",
|
|
70
71
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ E("div", {
|
|
72
73
|
className: "mb-6",
|
|
73
|
-
children: [/* @__PURE__ */
|
|
74
|
-
className: "flex items-center justify-between mb-4",
|
|
75
|
-
children: [/* @__PURE__ */
|
|
76
|
-
className: "text-3xl font-
|
|
77
|
-
children: j("shortcuts.title", "Keyboard Shortcuts")
|
|
78
|
-
}), /* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ E("div", {
|
|
75
|
+
className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-4",
|
|
76
|
+
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h1", {
|
|
77
|
+
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary mb-2",
|
|
78
|
+
children: /* @__PURE__ */ T(j, { children: F("shortcuts.title", "Keyboard Shortcuts") })
|
|
79
|
+
}), /* @__PURE__ */ T("p", {
|
|
79
80
|
className: "text-text-secondary",
|
|
80
|
-
children:
|
|
81
|
-
})] }), /* @__PURE__ */
|
|
81
|
+
children: F("shortcuts.subtitle", "Manage keyboard shortcuts across all Burdenoff products")
|
|
82
|
+
})] }), /* @__PURE__ */ T(D, {
|
|
82
83
|
role: "super_admin",
|
|
83
|
-
children: /* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
84
|
+
children: /* @__PURE__ */ T(k, {
|
|
85
|
+
primary: {
|
|
86
|
+
label: F("shortcuts.createShortcut", "Create Shortcut"),
|
|
87
|
+
onSelect: () => N(`${P}/shortcuts/new`),
|
|
88
|
+
icon: /* @__PURE__ */ T(v, { className: "size-4" })
|
|
89
|
+
},
|
|
90
|
+
actions: [{
|
|
91
|
+
label: F("shortcuts.seedDefaults", "Seed Defaults"),
|
|
92
|
+
onSelect: () => {
|
|
93
|
+
$();
|
|
94
|
+
},
|
|
95
|
+
disabled: Q,
|
|
96
|
+
icon: /* @__PURE__ */ T(b, { className: "size-4" })
|
|
97
|
+
}]
|
|
97
98
|
})
|
|
98
99
|
})]
|
|
99
|
-
}), /* @__PURE__ */
|
|
100
|
+
}), /* @__PURE__ */ E("div", {
|
|
100
101
|
className: "flex gap-4",
|
|
101
102
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
value:
|
|
104
|
-
onChange:
|
|
105
|
-
placeholder:
|
|
103
|
+
/* @__PURE__ */ T(r, {
|
|
104
|
+
value: R,
|
|
105
|
+
onChange: z,
|
|
106
|
+
placeholder: F("shortcuts.searchPlaceholder", "Search shortcuts..."),
|
|
106
107
|
className: "flex-1"
|
|
107
108
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
value:
|
|
110
|
-
onChange: (e) =>
|
|
111
|
-
...
|
|
109
|
+
/* @__PURE__ */ E("select", {
|
|
110
|
+
value: V.category || "",
|
|
111
|
+
onChange: (e) => H({
|
|
112
|
+
...V,
|
|
112
113
|
category: e.target.value || void 0
|
|
113
114
|
}),
|
|
114
115
|
className: "\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n ",
|
|
115
|
-
children: [/* @__PURE__ */
|
|
116
|
+
children: [/* @__PURE__ */ T("option", {
|
|
116
117
|
value: "",
|
|
117
|
-
children:
|
|
118
|
-
}), Object.values(
|
|
118
|
+
children: F("shortcuts.allCategories", "All Categories")
|
|
119
|
+
}), Object.values(p).map((e) => /* @__PURE__ */ T("option", {
|
|
119
120
|
value: e,
|
|
120
121
|
children: e
|
|
121
122
|
}, e))]
|
|
122
123
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
value:
|
|
125
|
-
onChange: (e) =>
|
|
126
|
-
...
|
|
124
|
+
/* @__PURE__ */ E("select", {
|
|
125
|
+
value: V.isEnabled === void 0 || V.isEnabled === null ? "" : V.isEnabled.toString(),
|
|
126
|
+
onChange: (e) => H({
|
|
127
|
+
...V,
|
|
127
128
|
isEnabled: e.target.value === "" ? void 0 : e.target.value === "true"
|
|
128
129
|
}),
|
|
129
130
|
className: "\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n ",
|
|
130
131
|
children: [
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ T("option", {
|
|
132
133
|
value: "",
|
|
133
|
-
children:
|
|
134
|
+
children: F("shortcuts.allStatus", "All Status")
|
|
134
135
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ T("option", {
|
|
136
137
|
value: "true",
|
|
137
|
-
children:
|
|
138
|
+
children: F("shortcuts.enabled", "Enabled")
|
|
138
139
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ T("option", {
|
|
140
141
|
value: "false",
|
|
141
|
-
children:
|
|
142
|
+
children: F("shortcuts.disabled", "Disabled")
|
|
142
143
|
})
|
|
143
144
|
]
|
|
144
145
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ T("button", {
|
|
146
147
|
type: "button",
|
|
147
|
-
onClick: () =>
|
|
148
|
+
onClick: () => K(),
|
|
148
149
|
className: "\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n ",
|
|
149
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ T(y, { size: 18 })
|
|
150
151
|
})
|
|
151
152
|
]
|
|
152
153
|
})]
|
|
153
154
|
}),
|
|
154
|
-
|
|
155
|
-
message:
|
|
155
|
+
G ? /* @__PURE__ */ T(ee, {
|
|
156
|
+
message: G.message,
|
|
156
157
|
action: {
|
|
157
|
-
label:
|
|
158
|
-
onClick: () =>
|
|
158
|
+
label: F("productCommon.retry", "Retry"),
|
|
159
|
+
onClick: () => K()
|
|
159
160
|
}
|
|
160
|
-
}) :
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
161
|
+
}) : W && U.length === 0 ? /* @__PURE__ */ T(n, { message: F("shortcuts.loadingShortcuts", "Loading keyboard shortcuts...") }) : U.length === 0 ? /* @__PURE__ */ T(A, {
|
|
162
|
+
treatment: "insight",
|
|
163
|
+
className: "animate-in fade-in duration-200",
|
|
164
|
+
children: /* @__PURE__ */ T(M, {
|
|
165
|
+
illustration: R || V.category || V.isEnabled !== void 0 ? "empty-search" : "empty-data",
|
|
166
|
+
title: F("shortcuts.noShortcutsFound", "No keyboard shortcuts found"),
|
|
167
|
+
action: /* @__PURE__ */ E("div", {
|
|
168
|
+
className: "flex flex-wrap items-center justify-center gap-3",
|
|
169
|
+
children: [/* @__PURE__ */ E(O, {
|
|
170
|
+
type: "button",
|
|
171
|
+
variant: "outline",
|
|
172
|
+
onClick: $,
|
|
173
|
+
disabled: Q,
|
|
174
|
+
children: [/* @__PURE__ */ T(b, { className: "size-4" }), F("shortcuts.seedDefaults", "Seed Defaults")]
|
|
175
|
+
}), /* @__PURE__ */ E(O, {
|
|
176
|
+
type: "button",
|
|
177
|
+
onClick: () => N(`${P}/shortcuts/new`),
|
|
178
|
+
children: [/* @__PURE__ */ T(v, { className: "size-4" }), F("shortcuts.createShortcut", "Create Shortcut")]
|
|
179
|
+
})]
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
}) : /* @__PURE__ */ T(A, {
|
|
183
|
+
treatment: "insight",
|
|
184
|
+
className: "overflow-hidden p-0",
|
|
185
|
+
children: /* @__PURE__ */ E("table", {
|
|
183
186
|
className: "w-full",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
185
|
-
className: "bg-bg-sunken border-b border-
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
-
/* @__PURE__ */
|
|
187
|
+
children: [/* @__PURE__ */ T("thead", {
|
|
188
|
+
className: "bg-bg-sunken/60 border-b border-border-seam",
|
|
189
|
+
children: /* @__PURE__ */ E("tr", { children: [
|
|
190
|
+
/* @__PURE__ */ T("th", {
|
|
188
191
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
189
|
-
children:
|
|
192
|
+
children: F("shortcuts.columnShortcut", "Shortcut")
|
|
190
193
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ T("th", {
|
|
192
195
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
193
|
-
children:
|
|
196
|
+
children: F("shortcuts.columnLabel", "Label")
|
|
194
197
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ T("th", {
|
|
196
199
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
197
|
-
children:
|
|
200
|
+
children: F("shortcuts.columnCategory", "Category")
|
|
198
201
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ T("th", {
|
|
200
203
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
201
|
-
children:
|
|
204
|
+
children: F("shortcuts.columnEvent", "Event")
|
|
202
205
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ T("th", {
|
|
204
207
|
className: "text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
205
|
-
children:
|
|
208
|
+
children: F("shortcuts.columnProduct", "Product")
|
|
206
209
|
}),
|
|
207
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ T("th", {
|
|
208
211
|
className: "text-center px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
209
|
-
children:
|
|
212
|
+
children: F("shortcuts.columnEnabled", "Enabled")
|
|
210
213
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ T("th", {
|
|
212
215
|
className: "text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase",
|
|
213
|
-
children:
|
|
216
|
+
children: F("shortcuts.columnActions", "Actions")
|
|
214
217
|
})
|
|
215
218
|
] })
|
|
216
|
-
}), /* @__PURE__ */
|
|
217
|
-
className: "divide-y divide-
|
|
218
|
-
children:
|
|
219
|
-
className: "hover:bg-bg-sunken transition-
|
|
219
|
+
}), /* @__PURE__ */ T("tbody", {
|
|
220
|
+
className: "divide-y divide-border-seam",
|
|
221
|
+
children: U.map((e) => /* @__PURE__ */ E("tr", {
|
|
222
|
+
className: "hover:bg-bg-sunken/70 transition-colors duration-200",
|
|
220
223
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ T("td", {
|
|
222
225
|
className: "px-6 py-4",
|
|
223
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ T(h, {
|
|
224
227
|
shortcutKey: e.shortcutKey,
|
|
225
228
|
isSequence: e.isSequence
|
|
226
229
|
})
|
|
227
230
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ T("td", {
|
|
229
232
|
className: "px-6 py-4",
|
|
230
|
-
children: /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
231
234
|
className: "font-medium text-text-primary",
|
|
232
235
|
children: e.label
|
|
233
|
-
}), e.description && /* @__PURE__ */
|
|
236
|
+
}), e.description && /* @__PURE__ */ T("p", {
|
|
234
237
|
className: "text-sm text-text-tertiary line-clamp-1",
|
|
235
238
|
children: e.description
|
|
236
239
|
})] })
|
|
237
240
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ T("td", {
|
|
239
242
|
className: "px-6 py-4",
|
|
240
|
-
children: /* @__PURE__ */
|
|
243
|
+
children: /* @__PURE__ */ T(m, { category: e.category })
|
|
241
244
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ T("td", {
|
|
243
246
|
className: "px-6 py-4",
|
|
244
|
-
children: /* @__PURE__ */
|
|
247
|
+
children: /* @__PURE__ */ T("code", {
|
|
245
248
|
className: "text-sm text-text-secondary bg-bg-sunken px-1.5 py-0.5 rounded font-mono",
|
|
246
249
|
children: e.eventName
|
|
247
250
|
})
|
|
248
251
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ T("td", {
|
|
250
253
|
className: "px-6 py-4",
|
|
251
|
-
children: /* @__PURE__ */
|
|
254
|
+
children: /* @__PURE__ */ T("span", {
|
|
252
255
|
className: "text-sm text-text-primary",
|
|
253
|
-
children: e.product?.name || /* @__PURE__ */
|
|
256
|
+
children: e.product?.name || /* @__PURE__ */ T("span", {
|
|
254
257
|
className: "text-text-tertiary italic",
|
|
255
|
-
children:
|
|
258
|
+
children: F("shortcuts.global", "Global")
|
|
256
259
|
})
|
|
257
260
|
})
|
|
258
261
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ T("td", {
|
|
260
263
|
className: "px-6 py-4 text-center",
|
|
261
|
-
children: /* @__PURE__ */
|
|
264
|
+
children: /* @__PURE__ */ T("button", {
|
|
262
265
|
type: "button",
|
|
263
|
-
onClick: () =>
|
|
264
|
-
disabled:
|
|
266
|
+
onClick: () => ne(e.id, e.isEnabled),
|
|
267
|
+
disabled: X,
|
|
265
268
|
className: `
|
|
266
269
|
p-1 rounded-lg transition-all duration-200
|
|
267
270
|
${e.isEnabled ? "text-[var(--color-status-success)] hover:bg-[var(--color-status-success-subtle)]" : "text-text-tertiary hover:bg-bg-sunken"}
|
|
268
271
|
disabled:opacity-50
|
|
269
272
|
`,
|
|
270
|
-
title: e.isEnabled ?
|
|
271
|
-
children: e.isEnabled ? /* @__PURE__ */
|
|
273
|
+
title: e.isEnabled ? F("shortcuts.disable", "Disable") : F("shortcuts.enable", "Enable"),
|
|
274
|
+
children: e.isEnabled ? /* @__PURE__ */ T(C, { size: 24 }) : /* @__PURE__ */ T(S, { size: 24 })
|
|
272
275
|
})
|
|
273
276
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ T("td", {
|
|
275
278
|
className: "px-6 py-4",
|
|
276
|
-
children: /* @__PURE__ */
|
|
279
|
+
children: /* @__PURE__ */ E("div", {
|
|
277
280
|
className: "flex items-center justify-end gap-2",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ T("button", {
|
|
279
282
|
type: "button",
|
|
280
|
-
onClick: () =>
|
|
283
|
+
onClick: () => N(`${P}/shortcuts/${e.id}`),
|
|
281
284
|
className: "p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200",
|
|
282
|
-
title:
|
|
283
|
-
children: /* @__PURE__ */
|
|
284
|
-
}), /* @__PURE__ */ D
|
|
285
|
+
title: F("shortcuts.viewDetails", "View details"),
|
|
286
|
+
children: /* @__PURE__ */ T(_, { size: 18 })
|
|
287
|
+
}), /* @__PURE__ */ E(D, {
|
|
285
288
|
role: "super_admin",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
289
|
+
children: [/* @__PURE__ */ T("button", {
|
|
287
290
|
type: "button",
|
|
288
|
-
onClick: () =>
|
|
291
|
+
onClick: () => N(`${P}/shortcuts/${e.id}/edit`),
|
|
289
292
|
className: "p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200",
|
|
290
|
-
title:
|
|
291
|
-
children: /* @__PURE__ */
|
|
292
|
-
}), /* @__PURE__ */
|
|
293
|
+
title: F("shortcuts.edit", "Edit"),
|
|
294
|
+
children: /* @__PURE__ */ T(x, { size: 18 })
|
|
295
|
+
}), /* @__PURE__ */ T("button", {
|
|
293
296
|
type: "button",
|
|
294
|
-
onClick: () =>
|
|
295
|
-
disabled:
|
|
297
|
+
onClick: () => te(e.id),
|
|
298
|
+
disabled: J,
|
|
296
299
|
className: "p-2 rounded-lg text-[var(--color-status-error)] hover:bg-[var(--color-status-error-subtle)] transition-all duration-200 disabled:opacity-50",
|
|
297
|
-
title:
|
|
298
|
-
children: /* @__PURE__ */
|
|
300
|
+
title: F("shortcuts.delete", "Delete"),
|
|
301
|
+
children: /* @__PURE__ */ T(w, { size: 18 })
|
|
299
302
|
})]
|
|
300
303
|
})]
|
|
301
304
|
})
|
|
@@ -305,11 +308,11 @@ function k() {
|
|
|
305
308
|
})]
|
|
306
309
|
})
|
|
307
310
|
}),
|
|
308
|
-
|
|
311
|
+
L
|
|
309
312
|
]
|
|
310
313
|
});
|
|
311
314
|
}
|
|
312
315
|
//#endregion
|
|
313
|
-
export {
|
|
316
|
+
export { N as ShortcutsListPage };
|
|
314
317
|
|
|
315
318
|
//# sourceMappingURL=ShortcutsListPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShortcutsListPage.js","names":[],"sources":["../../../../../src/product-management/modules/shortcuts/pages/ShortcutsListPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Plus,\n RefreshCw,\n Eye,\n SquarePen,\n Trash2,\n ToggleLeft,\n ToggleRight,\n Sparkles,\n} from 'lucide-react';\nimport { PermissionGate } from '@burdenoff/fe-libs/shared/components';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useDebounced } from '../../../shared/hooks/useDebounced';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport {\n useShortcuts,\n useDeleteShortcut,\n useToggleShortcut,\n useSeedDefaultShortcuts,\n} from '../hooks/useShortcuts';\nimport { ShortcutCategoryBadge } from '../components/ShortcutCategoryBadge';\nimport { ShortcutKeyBadge } from '../components/ShortcutKeyBadge';\nimport { SearchInput } from '../../../shared/components/input/SearchInput';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { KeyboardShortcutFilterInput } from '../types';\nimport { ShortcutCategories } from '../types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\nimport { useConfirmDialog } from '../../../shared/hooks/useConfirmDialog';\n\nexport function ShortcutsListPage() {\n const { navigate, basePath = '/products' } = useProductConsole();\n const tr = useTr();\n const { confirm, ConfirmDialog } = useConfirmDialog();\n const [searchQuery, setSearchQuery] = useState('');\n // Debounce so typing doesn't fire a query (and flip `loading`) on every keystroke.\n const debouncedSearchQuery = useDebounced(searchQuery, 300);\n const [filter, setFilter] = useState<KeyboardShortcutFilterInput>({});\n\n const { shortcuts, loading, error, refetch } = useShortcuts(\n { ...filter, search: debouncedSearchQuery || undefined },\n { limit: 50 }\n );\n\n const { deleteShortcut, loading: deleteLoading } = useDeleteShortcut();\n const { toggleShortcut, loading: toggleLoading } = useToggleShortcut();\n const { seedDefaultShortcuts, loading: seedLoading } = useSeedDefaultShortcuts();\n\n const handleDelete = async (id: string) => {\n void nativeImpact('medium');\n const message = tr('shortcuts.confirmDelete', 'Are you sure you want to delete this shortcut?');\n const native = await nativeConfirm({\n title: 'Delete shortcut',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok =\n native === null\n ? await confirm({\n title: 'Delete shortcut',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n destructive: true,\n })\n : native;\n if (!ok) return;\n\n try {\n await deleteShortcut(id);\n void nativeNotify('success');\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete shortcut:', error);\n }\n };\n\n const handleToggle = async (id: string, currentEnabled: boolean) => {\n void nativeImpact('medium');\n try {\n await toggleShortcut(id, !currentEnabled);\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to toggle shortcut:', error);\n }\n };\n\n const handleSeedDefaults = async () => {\n void nativeImpact('light');\n const message = tr(\n 'shortcuts.confirmSeedDefaults',\n 'This will create default global shortcuts. Continue?'\n );\n const native = await nativeConfirm({\n title: 'Seed defaults',\n message,\n okButtonTitle: 'Continue',\n cancelButtonTitle: 'Cancel',\n });\n const ok =\n native === null\n ? await confirm({\n title: 'Seed defaults',\n message,\n okButtonTitle: 'Continue',\n cancelButtonTitle: 'Cancel',\n })\n : native;\n if (!ok) return;\n\n try {\n const result = await seedDefaultShortcuts();\n const count = result.data?.seedDefaultShortcuts || 0;\n void nativeNotify('success');\n alert(`Created ${count} default shortcuts.`);\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to seed shortcuts:', error);\n }\n };\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <div className=\"flex items-center justify-between mb-4\">\n <div>\n <h1 className=\"text-3xl font-bold text-text-primary mb-2\">\n {tr('shortcuts.title', 'Keyboard Shortcuts')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('shortcuts.subtitle', 'Manage keyboard shortcuts across all Burdenoff products')}\n </p>\n </div>\n\n <PermissionGate role=\"super_admin\">\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleSeedDefaults}\n disabled={seedLoading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n font-medium\n disabled:opacity-50\n \"\n >\n <Sparkles size={18} />\n {tr('shortcuts.seedDefaults', 'Seed Defaults')}\n </button>\n\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/new`)}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90\n transition-all duration-200\n font-medium\n \"\n >\n <Plus size={20} />\n {tr('shortcuts.createShortcut', 'Create Shortcut')}\n </button>\n </div>\n </PermissionGate>\n </div>\n\n {/* Search and Filters */}\n <div className=\"flex gap-4\">\n {/* Search */}\n <SearchInput\n value={searchQuery}\n onChange={setSearchQuery}\n placeholder={tr('shortcuts.searchPlaceholder', 'Search shortcuts...')}\n className=\"flex-1\"\n />\n\n {/* Category Filter */}\n <select\n value={filter.category || ''}\n onChange={(e) =>\n setFilter({\n ...filter,\n category: e.target.value || undefined,\n })\n }\n className=\"\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n \"\n >\n <option value=\"\">{tr('shortcuts.allCategories', 'All Categories')}</option>\n {Object.values(ShortcutCategories).map((cat) => (\n <option key={cat} value={cat}>\n {cat}\n </option>\n ))}\n </select>\n\n {/* Enabled Filter */}\n <select\n value={\n filter.isEnabled === undefined || filter.isEnabled === null\n ? ''\n : filter.isEnabled.toString()\n }\n onChange={(e) =>\n setFilter({\n ...filter,\n isEnabled: e.target.value === '' ? undefined : e.target.value === 'true',\n })\n }\n className=\"\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n \"\n >\n <option value=\"\">{tr('shortcuts.allStatus', 'All Status')}</option>\n <option value=\"true\">{tr('shortcuts.enabled', 'Enabled')}</option>\n <option value=\"false\">{tr('shortcuts.disabled', 'Disabled')}</option>\n </select>\n\n {/* Refresh */}\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n \"\n >\n <RefreshCw size={18} />\n </button>\n </div>\n </div>\n\n {/* Body — header above stays mounted across refetches so the search keeps focus. */}\n {error ? (\n <ErrorState\n message={error.message}\n action={{ label: tr('productCommon.retry', 'Retry'), onClick: () => refetch() }}\n />\n ) : loading && shortcuts.length === 0 ? (\n <LoadingState message={tr('shortcuts.loadingShortcuts', 'Loading keyboard shortcuts...')} />\n ) : shortcuts.length === 0 ? (\n <div className=\"bg-surface border border-default rounded-lg p-12 text-center animate-in fade-in duration-200\">\n <p className=\"text-text-secondary mb-4\">\n {tr('shortcuts.noShortcutsFound', 'No keyboard shortcuts found')}\n </p>\n <div className=\"flex items-center justify-center gap-3\">\n <button\n type=\"button\"\n onClick={handleSeedDefaults}\n disabled={seedLoading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n font-medium\n \"\n >\n <Sparkles size={18} />\n {tr('shortcuts.seedDefaults', 'Seed Defaults')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/new`)}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-action-primary-bg)]\n text-[var(--color-action-primary-text)]\n rounded-lg\n hover:opacity-90\n transition-all duration-200\n font-medium\n \"\n >\n <Plus size={20} />\n {tr('shortcuts.createShortcut', 'Create Shortcut')}\n </button>\n </div>\n </div>\n ) : (\n <div className=\"bg-surface border border-default rounded-lg shadow-[var(--shadow-elevation-1)] overflow-hidden\">\n <table className=\"w-full\">\n <thead className=\"bg-bg-sunken border-b border-default\">\n <tr>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnShortcut', 'Shortcut')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnLabel', 'Label')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnCategory', 'Category')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnEvent', 'Event')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnProduct', 'Product')}\n </th>\n <th className=\"text-center px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnEnabled', 'Enabled')}\n </th>\n <th className=\"text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnActions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-[var(--color-border-default)]\">\n {shortcuts.map((shortcut) => (\n <tr key={shortcut.id} className=\"hover:bg-bg-sunken transition-all duration-200\">\n <td className=\"px-6 py-4\">\n <ShortcutKeyBadge\n shortcutKey={shortcut.shortcutKey}\n isSequence={shortcut.isSequence}\n />\n </td>\n <td className=\"px-6 py-4\">\n <div>\n <p className=\"font-medium text-text-primary\">{shortcut.label}</p>\n {shortcut.description && (\n <p className=\"text-sm text-text-tertiary line-clamp-1\">\n {shortcut.description}\n </p>\n )}\n </div>\n </td>\n <td className=\"px-6 py-4\">\n <ShortcutCategoryBadge category={shortcut.category} />\n </td>\n <td className=\"px-6 py-4\">\n <code className=\"text-sm text-text-secondary bg-bg-sunken px-1.5 py-0.5 rounded font-mono\">\n {shortcut.eventName}\n </code>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-primary\">\n {shortcut.product?.name || (\n <span className=\"text-text-tertiary italic\">\n {tr('shortcuts.global', 'Global')}\n </span>\n )}\n </span>\n </td>\n <td className=\"px-6 py-4 text-center\">\n <button\n type=\"button\"\n onClick={() => handleToggle(shortcut.id, shortcut.isEnabled)}\n disabled={toggleLoading}\n className={`\n p-1 rounded-lg transition-all duration-200\n ${\n shortcut.isEnabled\n ? 'text-[var(--color-status-success)] hover:bg-[var(--color-status-success-subtle)]'\n : 'text-text-tertiary hover:bg-bg-sunken'\n }\n disabled:opacity-50\n `}\n title={\n shortcut.isEnabled\n ? tr('shortcuts.disable', 'Disable')\n : tr('shortcuts.enable', 'Enable')\n }\n >\n {shortcut.isEnabled ? <ToggleRight size={24} /> : <ToggleLeft size={24} />}\n </button>\n </td>\n <td className=\"px-6 py-4\">\n <div className=\"flex items-center justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/${shortcut.id}`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200\"\n title={tr('shortcuts.viewDetails', 'View details')}\n >\n <Eye size={18} />\n </button>\n <PermissionGate role=\"super_admin\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/${shortcut.id}/edit`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200\"\n title={tr('shortcuts.edit', 'Edit')}\n >\n <SquarePen size={18} />\n </button>\n <button\n type=\"button\"\n onClick={() => handleDelete(shortcut.id)}\n disabled={deleteLoading}\n className=\"p-2 rounded-lg text-[var(--color-status-error)] hover:bg-[var(--color-status-error-subtle)] transition-all duration-200 disabled:opacity-50\"\n title={tr('shortcuts.delete', 'Delete')}\n >\n <Trash2 size={18} />\n </button>\n </PermissionGate>\n </div>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n {ConfirmDialog}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,SAAgB,IAAoB;CAClC,IAAM,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAK,GAAO,EACZ,EAAE,YAAS,qBAAkB,GAAkB,EAC/C,CAAC,GAAa,KAAkB,EAAS,GAAG,EAE5C,IAAuB,EAAa,GAAa,IAAI,EACrD,CAAC,GAAQ,KAAa,EAAsC,EAAE,CAAC,EAE/D,EAAE,cAAW,YAAS,U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AS,GAwFb,CACL;MACI,CAAA,CACF;;IACJ,CAAA;GAEP;GACG"}
|
|
1
|
+
{"version":3,"file":"ShortcutsListPage.js","names":[],"sources":["../../../../../src/product-management/modules/shortcuts/pages/ShortcutsListPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Plus,\n RefreshCw,\n Eye,\n SquarePen,\n Trash2,\n ToggleLeft,\n ToggleRight,\n Sparkles,\n} from 'lucide-react';\nimport { PermissionGate } from '@burdenoff/fe-libs/shared/components';\nimport {\n Button,\n CTAOverflowMenu,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n} from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useDebounced } from '../../../shared/hooks/useDebounced';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport {\n useShortcuts,\n useDeleteShortcut,\n useToggleShortcut,\n useSeedDefaultShortcuts,\n} from '../hooks/useShortcuts';\nimport { ShortcutCategoryBadge } from '../components/ShortcutCategoryBadge';\nimport { ShortcutKeyBadge } from '../components/ShortcutKeyBadge';\nimport { SearchInput } from '../../../shared/components/input/SearchInput';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { KeyboardShortcutFilterInput } from '../types';\nimport { ShortcutCategories } from '../types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\nimport { useConfirmDialog } from '../../../shared/hooks/useConfirmDialog';\n\nexport function ShortcutsListPage() {\n const { navigate, basePath = '/products' } = useProductConsole();\n const tr = useTr();\n const { confirm, ConfirmDialog } = useConfirmDialog();\n const [searchQuery, setSearchQuery] = useState('');\n // Debounce so typing doesn't fire a query (and flip `loading`) on every keystroke.\n const debouncedSearchQuery = useDebounced(searchQuery, 300);\n const [filter, setFilter] = useState<KeyboardShortcutFilterInput>({});\n\n const { shortcuts, loading, error, refetch } = useShortcuts(\n { ...filter, search: debouncedSearchQuery || undefined },\n { limit: 50 }\n );\n\n const { deleteShortcut, loading: deleteLoading } = useDeleteShortcut();\n const { toggleShortcut, loading: toggleLoading } = useToggleShortcut();\n const { seedDefaultShortcuts, loading: seedLoading } = useSeedDefaultShortcuts();\n\n const handleDelete = async (id: string) => {\n void nativeImpact('medium');\n const message = tr('shortcuts.confirmDelete', 'Are you sure you want to delete this shortcut?');\n const native = await nativeConfirm({\n title: 'Delete shortcut',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok =\n native === null\n ? await confirm({\n title: 'Delete shortcut',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n destructive: true,\n })\n : native;\n if (!ok) return;\n\n try {\n await deleteShortcut(id);\n void nativeNotify('success');\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete shortcut:', error);\n }\n };\n\n const handleToggle = async (id: string, currentEnabled: boolean) => {\n void nativeImpact('medium');\n try {\n await toggleShortcut(id, !currentEnabled);\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to toggle shortcut:', error);\n }\n };\n\n const handleSeedDefaults = async () => {\n void nativeImpact('light');\n const message = tr(\n 'shortcuts.confirmSeedDefaults',\n 'This will create default global shortcuts. Continue?'\n );\n const native = await nativeConfirm({\n title: 'Seed defaults',\n message,\n okButtonTitle: 'Continue',\n cancelButtonTitle: 'Cancel',\n });\n const ok =\n native === null\n ? await confirm({\n title: 'Seed defaults',\n message,\n okButtonTitle: 'Continue',\n cancelButtonTitle: 'Cancel',\n })\n : native;\n if (!ok) return;\n\n try {\n const result = await seedDefaultShortcuts();\n const count = result.data?.seedDefaultShortcuts || 0;\n void nativeNotify('success');\n alert(`Created ${count} default shortcuts.`);\n refetch();\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to seed shortcuts:', error);\n }\n };\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-200\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <div className=\"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-4\">\n <div>\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary mb-2\">\n <GradientText>{tr('shortcuts.title', 'Keyboard Shortcuts')}</GradientText>\n </h1>\n <p className=\"text-text-secondary\">\n {tr('shortcuts.subtitle', 'Manage keyboard shortcuts across all Burdenoff products')}\n </p>\n </div>\n\n <PermissionGate role=\"super_admin\">\n <CTAOverflowMenu\n primary={{\n label: tr('shortcuts.createShortcut', 'Create Shortcut'),\n onSelect: () => navigate(`${basePath}/shortcuts/new`),\n icon: <Plus className=\"size-4\" />,\n }}\n actions={[\n {\n label: tr('shortcuts.seedDefaults', 'Seed Defaults'),\n onSelect: () => {\n void handleSeedDefaults();\n },\n disabled: seedLoading,\n icon: <Sparkles className=\"size-4\" />,\n },\n ]}\n />\n </PermissionGate>\n </div>\n\n {/* Search and Filters */}\n <div className=\"flex gap-4\">\n {/* Search */}\n <SearchInput\n value={searchQuery}\n onChange={setSearchQuery}\n placeholder={tr('shortcuts.searchPlaceholder', 'Search shortcuts...')}\n className=\"flex-1\"\n />\n\n {/* Category Filter */}\n <select\n value={filter.category || ''}\n onChange={(e) =>\n setFilter({\n ...filter,\n category: e.target.value || undefined,\n })\n }\n className=\"\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n \"\n >\n <option value=\"\">{tr('shortcuts.allCategories', 'All Categories')}</option>\n {Object.values(ShortcutCategories).map((cat) => (\n <option key={cat} value={cat}>\n {cat}\n </option>\n ))}\n </select>\n\n {/* Enabled Filter */}\n <select\n value={\n filter.isEnabled === undefined || filter.isEnabled === null\n ? ''\n : filter.isEnabled.toString()\n }\n onChange={(e) =>\n setFilter({\n ...filter,\n isEnabled: e.target.value === '' ? undefined : e.target.value === 'true',\n })\n }\n className=\"\n px-4 py-2\n bg-surface\n border border-default\n rounded-lg\n text-text-primary\n focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]\n transition-all duration-200\n \"\n >\n <option value=\"\">{tr('shortcuts.allStatus', 'All Status')}</option>\n <option value=\"true\">{tr('shortcuts.enabled', 'Enabled')}</option>\n <option value=\"false\">{tr('shortcuts.disabled', 'Disabled')}</option>\n </select>\n\n {/* Refresh */}\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-bg-sunken\n transition-all duration-200\n \"\n >\n <RefreshCw size={18} />\n </button>\n </div>\n </div>\n\n {/* Body — header above stays mounted across refetches so the search keeps focus. */}\n {error ? (\n <ErrorState\n message={error.message}\n action={{ label: tr('productCommon.retry', 'Retry'), onClick: () => refetch() }}\n />\n ) : loading && shortcuts.length === 0 ? (\n <LoadingState message={tr('shortcuts.loadingShortcuts', 'Loading keyboard shortcuts...')} />\n ) : shortcuts.length === 0 ? (\n <GlassCard treatment=\"insight\" className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={\n searchQuery || filter.category || filter.isEnabled !== undefined\n ? 'empty-search'\n : 'empty-data'\n }\n title={tr('shortcuts.noShortcutsFound', 'No keyboard shortcuts found')}\n action={\n <div className=\"flex flex-wrap items-center justify-center gap-3\">\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={handleSeedDefaults}\n disabled={seedLoading}\n >\n <Sparkles className=\"size-4\" />\n {tr('shortcuts.seedDefaults', 'Seed Defaults')}\n </Button>\n <Button type=\"button\" onClick={() => navigate(`${basePath}/shortcuts/new`)}>\n <Plus className=\"size-4\" />\n {tr('shortcuts.createShortcut', 'Create Shortcut')}\n </Button>\n </div>\n }\n />\n </GlassCard>\n ) : (\n <GlassCard treatment=\"insight\" className=\"overflow-hidden p-0\">\n <table className=\"w-full\">\n <thead className=\"bg-bg-sunken/60 border-b border-border-seam\">\n <tr>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnShortcut', 'Shortcut')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnLabel', 'Label')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnCategory', 'Category')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnEvent', 'Event')}\n </th>\n <th className=\"text-left px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnProduct', 'Product')}\n </th>\n <th className=\"text-center px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnEnabled', 'Enabled')}\n </th>\n <th className=\"text-right px-6 py-3 text-xs font-semibold text-text-secondary uppercase\">\n {tr('shortcuts.columnActions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border-seam\">\n {shortcuts.map((shortcut) => (\n <tr\n key={shortcut.id}\n className=\"hover:bg-bg-sunken/70 transition-colors duration-200\"\n >\n <td className=\"px-6 py-4\">\n <ShortcutKeyBadge\n shortcutKey={shortcut.shortcutKey}\n isSequence={shortcut.isSequence}\n />\n </td>\n <td className=\"px-6 py-4\">\n <div>\n <p className=\"font-medium text-text-primary\">{shortcut.label}</p>\n {shortcut.description && (\n <p className=\"text-sm text-text-tertiary line-clamp-1\">\n {shortcut.description}\n </p>\n )}\n </div>\n </td>\n <td className=\"px-6 py-4\">\n <ShortcutCategoryBadge category={shortcut.category} />\n </td>\n <td className=\"px-6 py-4\">\n <code className=\"text-sm text-text-secondary bg-bg-sunken px-1.5 py-0.5 rounded font-mono\">\n {shortcut.eventName}\n </code>\n </td>\n <td className=\"px-6 py-4\">\n <span className=\"text-sm text-text-primary\">\n {shortcut.product?.name || (\n <span className=\"text-text-tertiary italic\">\n {tr('shortcuts.global', 'Global')}\n </span>\n )}\n </span>\n </td>\n <td className=\"px-6 py-4 text-center\">\n <button\n type=\"button\"\n onClick={() => handleToggle(shortcut.id, shortcut.isEnabled)}\n disabled={toggleLoading}\n className={`\n p-1 rounded-lg transition-all duration-200\n ${\n shortcut.isEnabled\n ? 'text-[var(--color-status-success)] hover:bg-[var(--color-status-success-subtle)]'\n : 'text-text-tertiary hover:bg-bg-sunken'\n }\n disabled:opacity-50\n `}\n title={\n shortcut.isEnabled\n ? tr('shortcuts.disable', 'Disable')\n : tr('shortcuts.enable', 'Enable')\n }\n >\n {shortcut.isEnabled ? <ToggleRight size={24} /> : <ToggleLeft size={24} />}\n </button>\n </td>\n <td className=\"px-6 py-4\">\n <div className=\"flex items-center justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/${shortcut.id}`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200\"\n title={tr('shortcuts.viewDetails', 'View details')}\n >\n <Eye size={18} />\n </button>\n <PermissionGate role=\"super_admin\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/shortcuts/${shortcut.id}/edit`)}\n className=\"p-2 rounded-lg text-text-secondary hover:bg-bg-sunken transition-all duration-200\"\n title={tr('shortcuts.edit', 'Edit')}\n >\n <SquarePen size={18} />\n </button>\n <button\n type=\"button\"\n onClick={() => handleDelete(shortcut.id)}\n disabled={deleteLoading}\n className=\"p-2 rounded-lg text-[var(--color-status-error)] hover:bg-[var(--color-status-error-subtle)] transition-all duration-200 disabled:opacity-50\"\n title={tr('shortcuts.delete', 'Delete')}\n >\n <Trash2 size={18} />\n </button>\n </PermissionGate>\n </div>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </GlassCard>\n )}\n {ConfirmDialog}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsCA,SAAgB,IAAoB;CAClC,IAAM,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAK,GAAO,EACZ,EAAE,YAAS,qBAAkB,GAAkB,EA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