@mohasinac/appkit 2.7.18 β†’ 2.7.19

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.
@@ -15,9 +15,15 @@ export function buildManifest({ name, shortName, description }) {
15
15
  prefer_related_applications: false,
16
16
  icons: [
17
17
  {
18
- src: "/favicon.svg",
19
- sizes: "any",
20
- type: "image/svg+xml",
18
+ src: "/favicon/android-chrome-192x192.png",
19
+ sizes: "192x192",
20
+ type: "image/png",
21
+ purpose: "any maskable",
22
+ },
23
+ {
24
+ src: "/favicon/android-chrome-512x512.png",
25
+ sizes: "512x512",
26
+ type: "image/png",
21
27
  purpose: "any maskable",
22
28
  },
23
29
  ],
@@ -385,6 +385,27 @@ export interface SiteSettingsDocument {
385
385
  accentDark?: string;
386
386
  };
387
387
  featuredResults?: FeaturedResult[];
388
+ /**
389
+ * Per-action runtime enable/disable overrides.
390
+ * Key = ActionId value string (e.g. "checkout", "add-to-wishlist").
391
+ * Absent key = action is enabled by default.
392
+ */
393
+ actionConfig?: Partial<Record<string, {
394
+ enabled: boolean;
395
+ }>>;
396
+ /**
397
+ * Per-nav-item runtime enable/disable overrides.
398
+ * Key = NavItem.id (nav-* slug, e.g. "nav-products").
399
+ * Absent key = nav item is enabled by default.
400
+ */
401
+ navConfig?: Record<string, {
402
+ enabled: boolean;
403
+ }>;
404
+ /**
405
+ * Derived hrefs of disabled nav items β€” written by updateNavConfigAction
406
+ * alongside navConfig. Read by RSC public layouts to block disabled routes.
407
+ */
408
+ disabledRoutes?: string[];
388
409
  createdAt: Date;
389
410
  updatedAt: Date;
390
411
  }
@@ -196,6 +196,9 @@ export const DEFAULT_SITE_SETTINGS_DATA = {
196
196
  enabled: true,
197
197
  message: "πŸŽ‰ Up to 15% Off on PokΓ©mon TCG this week β€” Use code SAVE15",
198
198
  },
199
+ actionConfig: {},
200
+ navConfig: {},
201
+ disabledRoutes: [],
199
202
  };
200
203
  export const SITE_SETTINGS_PUBLIC_FIELDS = [
201
204
  "siteName",
@@ -1,17 +1,14 @@
1
1
  /**
2
2
  * action-defs.ts
3
3
  *
4
- * Single source of truth for ALL action IDs, labels, variants, and groupings
5
- * used across the platform:
4
+ * Universal CTA registry for the entire platform.
5
+ * Every action β€” public marketplace CTAs, dashboard row actions, quick actions β€” is
6
+ * registered here with auth requirements, RBAC permissions, and enable/disable defaults.
6
7
  *
7
- * Product detail pages β€” desktop action panel + mobile BuyBar
8
- * Listing pages β€” BulkActionsBar selections
9
- * Table rows β€” RowActionMenu items (admin / seller / user)
10
- * Form shells β€” submit / cancel / save-draft / publish / delete
11
- * Dashboard quick bar β€” top-level shortcut buttons per dashboard type
12
- *
13
- * Pure TypeScript β€” no React, no JSX, no callbacks.
14
- * Consuming components resolve iconName β†’ Lucide component, and supply onClick.
8
+ * Three enforcement layers read from this registry:
9
+ * Client β€” useAuthGate() shows LoginRequiredModal for Tier 1 (public) actions
10
+ * Server β€” checkActionAllowed() enforces the same guards on every server action
11
+ * Admin β€” ActionPermissionsManager toggles defaultEnabled via siteSettings.actionConfig
15
12
  */
16
13
  export type ActionVariant = "primary" | "secondary" | "outline" | "ghost" | "danger" | "warning";
17
14
  export declare const ACTION_ID: {
@@ -25,8 +22,29 @@ export declare const ACTION_ID: {
25
22
  readonly PLACE_BID: "place-bid";
26
23
  readonly BUY_NOW_AUCTION: "buy-now-auction";
27
24
  readonly WATCH_AUCTION: "watch-auction";
25
+ readonly UNWATCH_AUCTION: "unwatch-auction";
28
26
  readonly RESERVE_NOW: "reserve-now";
29
27
  readonly CANCEL_RESERVATION: "cancel-reservation";
28
+ readonly CHECKOUT: "checkout";
29
+ readonly ENTER_PRIZE_DRAW: "enter-prize-draw";
30
+ readonly ENTER_RAFFLE: "enter-raffle";
31
+ readonly REPORT_LISTING: "report-listing";
32
+ readonly FOLLOW_STORE: "follow-store";
33
+ readonly WRITE_REVIEW: "write-review";
34
+ readonly MESSAGE_SELLER: "message-seller";
35
+ readonly BECOME_SELLER: "become-seller";
36
+ readonly REQUEST_PAYOUT: "request-payout";
37
+ readonly RESPOND_TO_REVIEW: "respond-to-review";
38
+ readonly CANCEL_ORDER: "cancel-order";
39
+ readonly REQUEST_RETURN: "request-return";
40
+ readonly REORDER: "reorder";
41
+ readonly TRACK_ORDER: "track-order";
42
+ readonly EDIT_PROFILE: "edit-profile";
43
+ readonly ADD_ADDRESS: "add-address";
44
+ readonly EDIT_ADDRESS: "edit-address";
45
+ readonly DELETE_ADDRESS: "delete-address";
46
+ readonly CHANGE_PASSWORD: "change-password";
47
+ readonly DELETE_ACCOUNT: "delete-account";
30
48
  };
31
49
  export type ActionId = (typeof ACTION_ID)[keyof typeof ACTION_ID];
32
50
  export interface ActionMeta {
@@ -37,8 +55,26 @@ export interface ActionMeta {
37
55
  variant: ActionVariant;
38
56
  /** Lucide icon name β€” consuming component resolves this to the React component */
39
57
  iconName?: string;
40
- /** When true, the action is hidden if the user is not authenticated */
58
+ /**
59
+ * Tier 1: shows LoginRequiredModal on public pages if user is not signed in.
60
+ * Server action also enforces via checkActionAllowed().
61
+ */
41
62
  requiresAuth?: boolean;
63
+ /** Message shown in LoginRequiredModal. Required when requiresAuth=true. */
64
+ authMessage?: string;
65
+ /**
66
+ * RBAC permission key required to use this action.
67
+ * If set, user must have this permission in addition to being signed in.
68
+ * Uses the 85+ permission keys from the RBAC system.
69
+ * Example: "products.create", "orders.refund", "admin.users.suspend"
70
+ */
71
+ requiredPermission?: string;
72
+ /**
73
+ * Whether this action is enabled by default.
74
+ * Can be overridden at runtime via siteSettings.actionConfig[actionId].enabled.
75
+ * Defaults to true when omitted.
76
+ */
77
+ defaultEnabled?: boolean;
42
78
  }
43
79
  export declare const ACTION_META: Record<ActionId, ActionMeta>;
44
80
  export declare const DETAIL_ACTIONS: {
@@ -56,7 +92,7 @@ export declare const MOBILE_PRIMARY_ACTIONS: {
56
92
  };
57
93
  export declare const LISTING_BULK_ACTIONS: {
58
94
  readonly products: readonly ["add-to-cart", "add-to-wishlist", "compare"];
59
- readonly auctions: readonly ["watch-auction", "add-to-wishlist", "compare"];
95
+ readonly auctions: readonly ["watch-auction", "unwatch-auction", "compare"];
60
96
  readonly preorders: readonly ["add-to-cart", "add-to-wishlist", "compare"];
61
97
  readonly stores: ActionId[];
62
98
  };
@@ -92,6 +128,14 @@ export interface RowActionMeta {
92
128
  destructive?: boolean;
93
129
  /** Adds a separator above this item in the dropdown */
94
130
  separator?: boolean;
131
+ /** Tier 2: all row actions require auth (role-gated at layout level) */
132
+ requiresAuth: true;
133
+ /** Minimum role required β€” enforced by RoleGate/ProtectedRoute at layout, NOT useAuthGate */
134
+ requiredRole?: "admin" | "moderator" | "seller" | "user";
135
+ /** RBAC permission key β€” shown in admin panel next to the toggle */
136
+ requiredPermission?: string;
137
+ /** Whether this row action is enabled by default (admin can toggle via actionConfig) */
138
+ defaultEnabled?: boolean;
95
139
  }
96
140
  export declare const ROW_ACTION_META: Record<RowActionId, RowActionMeta>;
97
141
  export declare const ADMIN_ROW_ACTIONS: {
@@ -143,21 +187,11 @@ export interface FormActionMeta {
143
187
  destructive?: boolean;
144
188
  }
145
189
  export declare const FORM_ACTION_META: Record<FormActionId, FormActionMeta>;
146
- /**
147
- * Preset ordered action groups for common form footer layouts.
148
- * Consumed by FormShell and DrawerFormFooter to determine which buttons render,
149
- * in which order (left β†’ right).
150
- */
151
190
  export declare const FORM_FOOTER_PRESET: {
152
- /** Standard edit drawer: Cancel | Save Changes */
153
191
  readonly drawerEdit: readonly ["form-cancel", "form-submit"];
154
- /** Edit drawer with delete: Delete | Cancel | Save Changes */
155
192
  readonly drawerEditDelete: readonly ["form-delete", "form-cancel", "form-submit"];
156
- /** Content editor (blog / product): Discard | Save Draft | Publish */
157
193
  readonly contentEditor: readonly ["form-discard", "form-save-draft", "form-publish"];
158
- /** Simple modal / dialog: Cancel | Submit */
159
194
  readonly modalForm: readonly ["form-cancel", "form-submit"];
160
- /** Settings page: Reset | Save Changes */
161
195
  readonly settingsForm: readonly ["form-reset", "form-submit"];
162
196
  };
163
197
  export declare const DASHBOARD_QUICK_ACTION_ID: {
@@ -187,6 +221,14 @@ export interface DashboardQuickActionMeta {
187
221
  iconName?: string;
188
222
  /** ROUTES key path that the button navigates to β€” consuming component resolves */
189
223
  routeKey?: string;
224
+ /** All dashboard quick actions require auth (role-gated at layout level) */
225
+ requiresAuth: true;
226
+ /** Minimum role required β€” enforced by RoleGate/ProtectedRoute at layout */
227
+ requiredRole?: "admin" | "moderator" | "seller" | "user";
228
+ /** RBAC permission key β€” shown in admin panel next to the toggle */
229
+ requiredPermission?: string;
230
+ /** Whether this quick action is enabled by default */
231
+ defaultEnabled?: boolean;
190
232
  }
191
233
  export declare const DASHBOARD_QUICK_ACTION_META: Record<DashboardQuickActionId, DashboardQuickActionMeta>;
192
234
  export declare const DASHBOARD_QUICK_ACTIONS: {
@@ -1,17 +1,14 @@
1
1
  /**
2
2
  * action-defs.ts
3
3
  *
4
- * Single source of truth for ALL action IDs, labels, variants, and groupings
5
- * used across the platform:
4
+ * Universal CTA registry for the entire platform.
5
+ * Every action β€” public marketplace CTAs, dashboard row actions, quick actions β€” is
6
+ * registered here with auth requirements, RBAC permissions, and enable/disable defaults.
6
7
  *
7
- * Product detail pages β€” desktop action panel + mobile BuyBar
8
- * Listing pages β€” BulkActionsBar selections
9
- * Table rows β€” RowActionMenu items (admin / seller / user)
10
- * Form shells β€” submit / cancel / save-draft / publish / delete
11
- * Dashboard quick bar β€” top-level shortcut buttons per dashboard type
12
- *
13
- * Pure TypeScript β€” no React, no JSX, no callbacks.
14
- * Consuming components resolve iconName β†’ Lucide component, and supply onClick.
8
+ * Three enforcement layers read from this registry:
9
+ * Client β€” useAuthGate() shows LoginRequiredModal for Tier 1 (public) actions
10
+ * Server β€” checkActionAllowed() enforces the same guards on every server action
11
+ * Admin β€” ActionPermissionsManager toggles defaultEnabled via siteSettings.actionConfig
15
12
  */
16
13
  // ─────────────────────────────────────────────────────────────────────────────
17
14
  // Β§ 1 Product / listing actions
@@ -30,23 +27,73 @@ export const ACTION_ID = {
30
27
  PLACE_BID: "place-bid",
31
28
  BUY_NOW_AUCTION: "buy-now-auction",
32
29
  WATCH_AUCTION: "watch-auction",
30
+ UNWATCH_AUCTION: "unwatch-auction",
33
31
  // Pre-order
34
32
  RESERVE_NOW: "reserve-now",
35
33
  CANCEL_RESERVATION: "cancel-reservation",
34
+ // ── Checkout / navigation CTAs ───────────────────────────────────────────
35
+ CHECKOUT: "checkout",
36
+ ENTER_PRIZE_DRAW: "enter-prize-draw",
37
+ ENTER_RAFFLE: "enter-raffle",
38
+ REPORT_LISTING: "report-listing",
39
+ FOLLOW_STORE: "follow-store",
40
+ // ── Reviews & social ─────────────────────────────────────────────────────
41
+ WRITE_REVIEW: "write-review",
42
+ MESSAGE_SELLER: "message-seller",
43
+ // ── Seller (public-facing CTAs on store/product pages) ───────────────────
44
+ BECOME_SELLER: "become-seller",
45
+ REQUEST_PAYOUT: "request-payout",
46
+ RESPOND_TO_REVIEW: "respond-to-review",
47
+ // ── User account actions ─────────────────────────────────────────────────
48
+ CANCEL_ORDER: "cancel-order",
49
+ REQUEST_RETURN: "request-return",
50
+ REORDER: "reorder",
51
+ TRACK_ORDER: "track-order",
52
+ EDIT_PROFILE: "edit-profile",
53
+ ADD_ADDRESS: "add-address",
54
+ EDIT_ADDRESS: "edit-address",
55
+ DELETE_ADDRESS: "delete-address",
56
+ CHANGE_PASSWORD: "change-password",
57
+ DELETE_ACCOUNT: "delete-account",
36
58
  };
37
59
  export const ACTION_META = {
38
- [ACTION_ID.BUY_NOW]: { id: ACTION_ID.BUY_NOW, label: "Buy Now", variant: "primary" },
60
+ [ACTION_ID.BUY_NOW]: { id: ACTION_ID.BUY_NOW, label: "Buy Now", variant: "primary", requiresAuth: true, authMessage: "You need to be signed in to purchase items." },
39
61
  [ACTION_ID.ADD_TO_CART]: { id: ACTION_ID.ADD_TO_CART, label: "Add to Cart", variant: "secondary", iconName: "ShoppingCart" },
40
- [ACTION_ID.ADD_TO_WISHLIST]: { id: ACTION_ID.ADD_TO_WISHLIST, label: "Add to Wishlist", variant: "ghost", iconName: "Heart" },
41
- [ACTION_ID.REMOVE_FROM_WISHLIST]: { id: ACTION_ID.REMOVE_FROM_WISHLIST, label: "Remove from Wishlist", variant: "ghost", iconName: "HeartOff" },
42
- [ACTION_ID.MAKE_OFFER]: { id: ACTION_ID.MAKE_OFFER, label: "Make an Offer", variant: "outline", iconName: "Tag", requiresAuth: true },
62
+ [ACTION_ID.ADD_TO_WISHLIST]: { id: ACTION_ID.ADD_TO_WISHLIST, label: "Add to Wishlist", variant: "ghost", iconName: "Heart", requiresAuth: true, authMessage: "You need to be signed in to save items to your wishlist." },
63
+ [ACTION_ID.REMOVE_FROM_WISHLIST]: { id: ACTION_ID.REMOVE_FROM_WISHLIST, label: "Remove from Wishlist", variant: "ghost", iconName: "HeartOff", requiresAuth: true, authMessage: "You need to be signed in to manage your wishlist." },
64
+ [ACTION_ID.MAKE_OFFER]: { id: ACTION_ID.MAKE_OFFER, label: "Make an Offer", variant: "outline", iconName: "Tag", requiresAuth: true, authMessage: "You need to be signed in to make an offer." },
43
65
  [ACTION_ID.SHARE]: { id: ACTION_ID.SHARE, label: "Share", variant: "ghost", iconName: "Share2" },
44
66
  [ACTION_ID.COMPARE]: { id: ACTION_ID.COMPARE, label: "Compare", variant: "secondary", iconName: "Columns" },
45
- [ACTION_ID.PLACE_BID]: { id: ACTION_ID.PLACE_BID, label: "Place Bid", variant: "primary", requiresAuth: true },
46
- [ACTION_ID.BUY_NOW_AUCTION]: { id: ACTION_ID.BUY_NOW_AUCTION, label: "Buy Now", variant: "secondary", requiresAuth: true },
47
- [ACTION_ID.WATCH_AUCTION]: { id: ACTION_ID.WATCH_AUCTION, label: "Watch", variant: "ghost", iconName: "Eye" },
48
- [ACTION_ID.RESERVE_NOW]: { id: ACTION_ID.RESERVE_NOW, label: "Reserve Now", variant: "primary", requiresAuth: true },
49
- [ACTION_ID.CANCEL_RESERVATION]: { id: ACTION_ID.CANCEL_RESERVATION, label: "Cancel Reservation", variant: "danger", iconName: "X", requiresAuth: true },
67
+ [ACTION_ID.PLACE_BID]: { id: ACTION_ID.PLACE_BID, label: "Place Bid", variant: "primary", requiresAuth: true, authMessage: "You need to be signed in to place a bid." },
68
+ [ACTION_ID.BUY_NOW_AUCTION]: { id: ACTION_ID.BUY_NOW_AUCTION, label: "Buy Now", variant: "secondary", requiresAuth: true, authMessage: "You need to be signed in to purchase items." },
69
+ [ACTION_ID.WATCH_AUCTION]: { id: ACTION_ID.WATCH_AUCTION, label: "Watch", variant: "ghost", iconName: "Eye", requiresAuth: true, authMessage: "You need to be signed in to watch auctions." },
70
+ [ACTION_ID.UNWATCH_AUCTION]: { id: ACTION_ID.UNWATCH_AUCTION, label: "Unwatch", variant: "ghost", iconName: "EyeOff", requiresAuth: true, authMessage: "You need to be signed in to manage your watchlist." },
71
+ [ACTION_ID.RESERVE_NOW]: { id: ACTION_ID.RESERVE_NOW, label: "Reserve Now", variant: "primary", requiresAuth: true, authMessage: "You need to be signed in to reserve a pre-order." },
72
+ [ACTION_ID.CANCEL_RESERVATION]: { id: ACTION_ID.CANCEL_RESERVATION, label: "Cancel Reservation", variant: "danger", iconName: "X", requiresAuth: true, authMessage: "You need to be signed in to cancel a reservation." },
73
+ // ── Checkout / navigation CTAs ────────────────────────────────────────────
74
+ [ACTION_ID.CHECKOUT]: { id: ACTION_ID.CHECKOUT, label: "Checkout", variant: "primary", requiresAuth: true, authMessage: "You need to be signed in to checkout." },
75
+ [ACTION_ID.ENTER_PRIZE_DRAW]: { id: ACTION_ID.ENTER_PRIZE_DRAW, label: "Enter Draw", variant: "primary", requiresAuth: true, authMessage: "You need to be signed in to enter a prize draw." },
76
+ [ACTION_ID.ENTER_RAFFLE]: { id: ACTION_ID.ENTER_RAFFLE, label: "Enter Raffle", variant: "primary", requiresAuth: true, authMessage: "You need to be signed in to enter a raffle." },
77
+ [ACTION_ID.REPORT_LISTING]: { id: ACTION_ID.REPORT_LISTING, label: "Report Listing", variant: "ghost", requiresAuth: true, authMessage: "You need to be signed in to report a listing." },
78
+ [ACTION_ID.FOLLOW_STORE]: { id: ACTION_ID.FOLLOW_STORE, label: "Follow Store", variant: "outline", requiresAuth: true, authMessage: "You need to be signed in to follow a store." },
79
+ // ── Reviews & social ──────────────────────────────────────────────────────
80
+ [ACTION_ID.WRITE_REVIEW]: { id: ACTION_ID.WRITE_REVIEW, label: "Write a Review", variant: "outline", requiresAuth: true, authMessage: "You need to be signed in to write a review." },
81
+ [ACTION_ID.MESSAGE_SELLER]: { id: ACTION_ID.MESSAGE_SELLER, label: "Message Seller", variant: "outline", requiresAuth: true, authMessage: "You need to be signed in to message a seller." },
82
+ // ── Seller CTAs ───────────────────────────────────────────────────────────
83
+ [ACTION_ID.BECOME_SELLER]: { id: ACTION_ID.BECOME_SELLER, label: "Apply as Seller", variant: "primary", requiresAuth: true, authMessage: "You need to be signed in to apply as a seller." },
84
+ [ACTION_ID.REQUEST_PAYOUT]: { id: ACTION_ID.REQUEST_PAYOUT, label: "Request Payout", variant: "outline", requiresAuth: true, authMessage: "You need to be signed in to request a payout.", requiredPermission: "seller.payouts.request" },
85
+ [ACTION_ID.RESPOND_TO_REVIEW]: { id: ACTION_ID.RESPOND_TO_REVIEW, label: "Respond to Review", variant: "outline", requiresAuth: true, authMessage: "You need to be signed in to respond to a review.", requiredPermission: "seller.reviews.respond" },
86
+ // ── User account actions ──────────────────────────────────────────────────
87
+ [ACTION_ID.CANCEL_ORDER]: { id: ACTION_ID.CANCEL_ORDER, label: "Cancel Order", variant: "danger", requiresAuth: true, authMessage: "You need to be signed in to cancel an order." },
88
+ [ACTION_ID.REQUEST_RETURN]: { id: ACTION_ID.REQUEST_RETURN, label: "Request Return", variant: "outline", requiresAuth: true, authMessage: "You need to be signed in to request a return." },
89
+ [ACTION_ID.REORDER]: { id: ACTION_ID.REORDER, label: "Reorder", variant: "secondary", requiresAuth: true, authMessage: "You need to be signed in to reorder." },
90
+ [ACTION_ID.TRACK_ORDER]: { id: ACTION_ID.TRACK_ORDER, label: "Track Order", variant: "ghost", requiresAuth: true, authMessage: "You need to be signed in to track your order." },
91
+ [ACTION_ID.EDIT_PROFILE]: { id: ACTION_ID.EDIT_PROFILE, label: "Edit Profile", variant: "outline", requiresAuth: true, authMessage: "You need to be signed in to edit your profile." },
92
+ [ACTION_ID.ADD_ADDRESS]: { id: ACTION_ID.ADD_ADDRESS, label: "Add Address", variant: "outline", requiresAuth: true, authMessage: "You need to be signed in to add an address." },
93
+ [ACTION_ID.EDIT_ADDRESS]: { id: ACTION_ID.EDIT_ADDRESS, label: "Edit Address", variant: "ghost", requiresAuth: true, authMessage: "You need to be signed in to edit an address." },
94
+ [ACTION_ID.DELETE_ADDRESS]: { id: ACTION_ID.DELETE_ADDRESS, label: "Delete Address", variant: "danger", requiresAuth: true, authMessage: "You need to be signed in to delete an address." },
95
+ [ACTION_ID.CHANGE_PASSWORD]: { id: ACTION_ID.CHANGE_PASSWORD, label: "Change Password", variant: "outline", requiresAuth: true, authMessage: "You need to be signed in to change your password." },
96
+ [ACTION_ID.DELETE_ACCOUNT]: { id: ACTION_ID.DELETE_ACCOUNT, label: "Delete Account", variant: "danger", requiresAuth: true, authMessage: "You need to be signed in to delete your account.", requiredPermission: "user.account.delete" },
50
97
  };
51
98
  // Detail page action groups β€” ordered top-to-bottom in the right-hand panel
52
99
  export const DETAIL_ACTIONS = {
@@ -66,7 +113,7 @@ export const MOBILE_PRIMARY_ACTIONS = {
66
113
  // Listing page bulk actions β€” shown in BulkActionsBar when items are selected
67
114
  export const LISTING_BULK_ACTIONS = {
68
115
  products: [ACTION_ID.ADD_TO_CART, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
69
- auctions: [ACTION_ID.WATCH_AUCTION, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
116
+ auctions: [ACTION_ID.WATCH_AUCTION, ACTION_ID.UNWATCH_AUCTION, ACTION_ID.COMPARE],
70
117
  preorders: [ACTION_ID.ADD_TO_CART, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
71
118
  stores: [ACTION_ID.COMPARE],
72
119
  };
@@ -96,23 +143,23 @@ export const ROW_ACTION_ID = {
96
143
  ARCHIVE: "row-archive",
97
144
  };
98
145
  export const ROW_ACTION_META = {
99
- [ROW_ACTION_ID.EDIT]: { id: ROW_ACTION_ID.EDIT, label: "Edit", iconName: "Pencil" },
100
- [ROW_ACTION_ID.VIEW]: { id: ROW_ACTION_ID.VIEW, label: "View", iconName: "Eye" },
101
- [ROW_ACTION_ID.DELETE]: { id: ROW_ACTION_ID.DELETE, label: "Delete", iconName: "Trash2", destructive: true, separator: true },
102
- [ROW_ACTION_ID.APPROVE]: { id: ROW_ACTION_ID.APPROVE, label: "Approve", iconName: "Check" },
103
- [ROW_ACTION_ID.REJECT]: { id: ROW_ACTION_ID.REJECT, label: "Reject", iconName: "X", destructive: true },
104
- [ROW_ACTION_ID.SUSPEND]: { id: ROW_ACTION_ID.SUSPEND, label: "Suspend", iconName: "Ban", destructive: true, separator: true },
105
- [ROW_ACTION_ID.RESTORE]: { id: ROW_ACTION_ID.RESTORE, label: "Restore", iconName: "RotateCcw" },
106
- [ROW_ACTION_ID.MANAGE]: { id: ROW_ACTION_ID.MANAGE, label: "Manage", iconName: "Settings" },
107
- [ROW_ACTION_ID.DUPLICATE]: { id: ROW_ACTION_ID.DUPLICATE, label: "Duplicate", iconName: "Copy" },
108
- [ROW_ACTION_ID.EXPORT]: { id: ROW_ACTION_ID.EXPORT, label: "Export", iconName: "Download" },
109
- [ROW_ACTION_ID.TRACK]: { id: ROW_ACTION_ID.TRACK, label: "Track Shipment", iconName: "Truck" },
110
- [ROW_ACTION_ID.CANCEL]: { id: ROW_ACTION_ID.CANCEL, label: "Cancel", iconName: "X", destructive: true },
111
- [ROW_ACTION_ID.REFUND]: { id: ROW_ACTION_ID.REFUND, label: "Refund", iconName: "RefreshCw", destructive: true, separator: true },
112
- [ROW_ACTION_ID.RESEND]: { id: ROW_ACTION_ID.RESEND, label: "Resend", iconName: "Send" },
113
- [ROW_ACTION_ID.REPLY]: { id: ROW_ACTION_ID.REPLY, label: "Reply", iconName: "MessageSquare" },
114
- [ROW_ACTION_ID.PUBLISH]: { id: ROW_ACTION_ID.PUBLISH, label: "Publish", iconName: "Upload" },
115
- [ROW_ACTION_ID.ARCHIVE]: { id: ROW_ACTION_ID.ARCHIVE, label: "Archive", iconName: "Archive", separator: true },
146
+ [ROW_ACTION_ID.EDIT]: { id: ROW_ACTION_ID.EDIT, label: "Edit", iconName: "Pencil", requiresAuth: true },
147
+ [ROW_ACTION_ID.VIEW]: { id: ROW_ACTION_ID.VIEW, label: "View", iconName: "Eye", requiresAuth: true },
148
+ [ROW_ACTION_ID.DELETE]: { id: ROW_ACTION_ID.DELETE, label: "Delete", iconName: "Trash2", requiresAuth: true, destructive: true, separator: true },
149
+ [ROW_ACTION_ID.APPROVE]: { id: ROW_ACTION_ID.APPROVE, label: "Approve", iconName: "Check", requiresAuth: true, requiredRole: "admin", requiredPermission: "admin.content.approve" },
150
+ [ROW_ACTION_ID.REJECT]: { id: ROW_ACTION_ID.REJECT, label: "Reject", iconName: "X", requiresAuth: true, requiredRole: "admin", requiredPermission: "admin.content.approve", destructive: true },
151
+ [ROW_ACTION_ID.SUSPEND]: { id: ROW_ACTION_ID.SUSPEND, label: "Suspend", iconName: "Ban", requiresAuth: true, requiredRole: "admin", requiredPermission: "admin.users.suspend", destructive: true, separator: true },
152
+ [ROW_ACTION_ID.RESTORE]: { id: ROW_ACTION_ID.RESTORE, label: "Restore", iconName: "RotateCcw", requiresAuth: true, requiredRole: "admin", requiredPermission: "admin.users.suspend" },
153
+ [ROW_ACTION_ID.MANAGE]: { id: ROW_ACTION_ID.MANAGE, label: "Manage", iconName: "Settings", requiresAuth: true },
154
+ [ROW_ACTION_ID.DUPLICATE]: { id: ROW_ACTION_ID.DUPLICATE, label: "Duplicate", iconName: "Copy", requiresAuth: true },
155
+ [ROW_ACTION_ID.EXPORT]: { id: ROW_ACTION_ID.EXPORT, label: "Export", iconName: "Download", requiresAuth: true },
156
+ [ROW_ACTION_ID.TRACK]: { id: ROW_ACTION_ID.TRACK, label: "Track Shipment", iconName: "Truck", requiresAuth: true },
157
+ [ROW_ACTION_ID.CANCEL]: { id: ROW_ACTION_ID.CANCEL, label: "Cancel", iconName: "X", requiresAuth: true, destructive: true },
158
+ [ROW_ACTION_ID.REFUND]: { id: ROW_ACTION_ID.REFUND, label: "Refund", iconName: "RefreshCw", requiresAuth: true, requiredRole: "admin", requiredPermission: "admin.orders.refund", destructive: true, separator: true },
159
+ [ROW_ACTION_ID.RESEND]: { id: ROW_ACTION_ID.RESEND, label: "Resend", iconName: "Send", requiresAuth: true },
160
+ [ROW_ACTION_ID.REPLY]: { id: ROW_ACTION_ID.REPLY, label: "Reply", iconName: "MessageSquare", requiresAuth: true },
161
+ [ROW_ACTION_ID.PUBLISH]: { id: ROW_ACTION_ID.PUBLISH, label: "Publish", iconName: "Upload", requiresAuth: true },
162
+ [ROW_ACTION_ID.ARCHIVE]: { id: ROW_ACTION_ID.ARCHIVE, label: "Archive", iconName: "Archive", requiresAuth: true, separator: true },
116
163
  };
117
164
  // Admin dashboard row action groups per entity type
118
165
  export const ADMIN_ROW_ACTIONS = {
@@ -166,21 +213,11 @@ export const FORM_ACTION_META = {
166
213
  [FORM_ACTION_ID.DELETE]: { id: FORM_ACTION_ID.DELETE, label: "Delete", variant: "danger", type: "button", iconName: "Trash2", destructive: true },
167
214
  [FORM_ACTION_ID.DISCARD]: { id: FORM_ACTION_ID.DISCARD, label: "Discard", variant: "ghost", type: "button", destructive: true },
168
215
  };
169
- /**
170
- * Preset ordered action groups for common form footer layouts.
171
- * Consumed by FormShell and DrawerFormFooter to determine which buttons render,
172
- * in which order (left β†’ right).
173
- */
174
216
  export const FORM_FOOTER_PRESET = {
175
- /** Standard edit drawer: Cancel | Save Changes */
176
217
  drawerEdit: [FORM_ACTION_ID.CANCEL, FORM_ACTION_ID.SUBMIT],
177
- /** Edit drawer with delete: Delete | Cancel | Save Changes */
178
218
  drawerEditDelete: [FORM_ACTION_ID.DELETE, FORM_ACTION_ID.CANCEL, FORM_ACTION_ID.SUBMIT],
179
- /** Content editor (blog / product): Discard | Save Draft | Publish */
180
219
  contentEditor: [FORM_ACTION_ID.DISCARD, FORM_ACTION_ID.SAVE_DRAFT, FORM_ACTION_ID.PUBLISH],
181
- /** Simple modal / dialog: Cancel | Submit */
182
220
  modalForm: [FORM_ACTION_ID.CANCEL, FORM_ACTION_ID.SUBMIT],
183
- /** Settings page: Reset | Save Changes */
184
221
  settingsForm: [FORM_ACTION_ID.RESET, FORM_ACTION_ID.SUBMIT],
185
222
  };
186
223
  // ─────────────────────────────────────────────────────────────────────────────
@@ -210,23 +247,23 @@ export const DASHBOARD_QUICK_ACTION_ID = {
210
247
  USER_ADD_ADDRESS: "dqa-user-add-address",
211
248
  };
212
249
  export const DASHBOARD_QUICK_ACTION_META = {
213
- [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_PRODUCT]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_PRODUCT, label: "Add Product", variant: "primary", iconName: "Plus" },
214
- [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_USER]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_USER, label: "Add User", variant: "outline", iconName: "UserPlus" },
215
- [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_STORE]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_STORE, label: "Add Store", variant: "outline", iconName: "Store" },
216
- [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_COUPON]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_COUPON, label: "Add Coupon", variant: "outline", iconName: "Tag" },
217
- [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_EVENT]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_EVENT, label: "Add Event", variant: "outline", iconName: "Calendar" },
218
- [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_BLOG]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_BLOG, label: "New Post", variant: "outline", iconName: "FileText" },
219
- [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_FAQ]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_FAQ, label: "Add FAQ", variant: "outline", iconName: "HelpCircle" },
220
- [DASHBOARD_QUICK_ACTION_ID.ADMIN_SETTINGS]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_SETTINGS, label: "Settings", variant: "ghost", iconName: "Settings" },
221
- [DASHBOARD_QUICK_ACTION_ID.SELLER_ADD_PRODUCT]: { id: DASHBOARD_QUICK_ACTION_ID.SELLER_ADD_PRODUCT, label: "List a Product", variant: "primary", iconName: "Plus" },
222
- [DASHBOARD_QUICK_ACTION_ID.SELLER_ADD_COUPON]: { id: DASHBOARD_QUICK_ACTION_ID.SELLER_ADD_COUPON, label: "New Coupon", variant: "outline", iconName: "Tag" },
223
- [DASHBOARD_QUICK_ACTION_ID.SELLER_VIEW_ORDERS]: { id: DASHBOARD_QUICK_ACTION_ID.SELLER_VIEW_ORDERS, label: "Orders", variant: "outline", iconName: "ShoppingBag" },
224
- [DASHBOARD_QUICK_ACTION_ID.SELLER_PAYOUT_REQ]: { id: DASHBOARD_QUICK_ACTION_ID.SELLER_PAYOUT_REQ, label: "Request Payout", variant: "outline", iconName: "Banknote" },
225
- [DASHBOARD_QUICK_ACTION_ID.SELLER_SETTINGS]: { id: DASHBOARD_QUICK_ACTION_ID.SELLER_SETTINGS, label: "Store Settings", variant: "ghost", iconName: "Settings" },
226
- [DASHBOARD_QUICK_ACTION_ID.USER_VIEW_ORDERS]: { id: DASHBOARD_QUICK_ACTION_ID.USER_VIEW_ORDERS, label: "My Orders", variant: "outline", iconName: "Package" },
227
- [DASHBOARD_QUICK_ACTION_ID.USER_VIEW_WISHLIST]: { id: DASHBOARD_QUICK_ACTION_ID.USER_VIEW_WISHLIST, label: "Wishlist", variant: "outline", iconName: "Heart" },
228
- [DASHBOARD_QUICK_ACTION_ID.USER_EDIT_PROFILE]: { id: DASHBOARD_QUICK_ACTION_ID.USER_EDIT_PROFILE, label: "Edit Profile", variant: "outline", iconName: "User" },
229
- [DASHBOARD_QUICK_ACTION_ID.USER_ADD_ADDRESS]: { id: DASHBOARD_QUICK_ACTION_ID.USER_ADD_ADDRESS, label: "Add Address", variant: "outline", iconName: "MapPin" },
250
+ [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_PRODUCT]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_PRODUCT, label: "Add Product", variant: "primary", iconName: "Plus", requiresAuth: true, requiredRole: "admin", requiredPermission: "products.create" },
251
+ [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_USER]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_USER, label: "Add User", variant: "outline", iconName: "UserPlus", requiresAuth: true, requiredRole: "admin", requiredPermission: "admin.users.create" },
252
+ [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_STORE]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_STORE, label: "Add Store", variant: "outline", iconName: "Store", requiresAuth: true, requiredRole: "admin", requiredPermission: "admin.stores.create" },
253
+ [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_COUPON]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_COUPON, label: "Add Coupon", variant: "outline", iconName: "Tag", requiresAuth: true, requiredRole: "admin", requiredPermission: "coupons.create" },
254
+ [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_EVENT]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_EVENT, label: "Add Event", variant: "outline", iconName: "Calendar", requiresAuth: true, requiredRole: "admin", requiredPermission: "events.create" },
255
+ [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_BLOG]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_BLOG, label: "New Post", variant: "outline", iconName: "FileText", requiresAuth: true, requiredRole: "admin", requiredPermission: "blog.create" },
256
+ [DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_FAQ]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_ADD_FAQ, label: "Add FAQ", variant: "outline", iconName: "HelpCircle", requiresAuth: true, requiredRole: "admin", requiredPermission: "faqs.create" },
257
+ [DASHBOARD_QUICK_ACTION_ID.ADMIN_SETTINGS]: { id: DASHBOARD_QUICK_ACTION_ID.ADMIN_SETTINGS, label: "Settings", variant: "ghost", iconName: "Settings", requiresAuth: true, requiredRole: "admin", requiredPermission: "admin.settings.read" },
258
+ [DASHBOARD_QUICK_ACTION_ID.SELLER_ADD_PRODUCT]: { id: DASHBOARD_QUICK_ACTION_ID.SELLER_ADD_PRODUCT, label: "List a Product", variant: "primary", iconName: "Plus", requiresAuth: true, requiredRole: "seller", requiredPermission: "products.create" },
259
+ [DASHBOARD_QUICK_ACTION_ID.SELLER_ADD_COUPON]: { id: DASHBOARD_QUICK_ACTION_ID.SELLER_ADD_COUPON, label: "New Coupon", variant: "outline", iconName: "Tag", requiresAuth: true, requiredRole: "seller", requiredPermission: "coupons.create" },
260
+ [DASHBOARD_QUICK_ACTION_ID.SELLER_VIEW_ORDERS]: { id: DASHBOARD_QUICK_ACTION_ID.SELLER_VIEW_ORDERS, label: "Orders", variant: "outline", iconName: "ShoppingBag", requiresAuth: true, requiredRole: "seller" },
261
+ [DASHBOARD_QUICK_ACTION_ID.SELLER_PAYOUT_REQ]: { id: DASHBOARD_QUICK_ACTION_ID.SELLER_PAYOUT_REQ, label: "Request Payout", variant: "outline", iconName: "Banknote", requiresAuth: true, requiredRole: "seller", requiredPermission: "seller.payouts.request" },
262
+ [DASHBOARD_QUICK_ACTION_ID.SELLER_SETTINGS]: { id: DASHBOARD_QUICK_ACTION_ID.SELLER_SETTINGS, label: "Store Settings", variant: "ghost", iconName: "Settings", requiresAuth: true, requiredRole: "seller" },
263
+ [DASHBOARD_QUICK_ACTION_ID.USER_VIEW_ORDERS]: { id: DASHBOARD_QUICK_ACTION_ID.USER_VIEW_ORDERS, label: "My Orders", variant: "outline", iconName: "Package", requiresAuth: true, requiredRole: "user" },
264
+ [DASHBOARD_QUICK_ACTION_ID.USER_VIEW_WISHLIST]: { id: DASHBOARD_QUICK_ACTION_ID.USER_VIEW_WISHLIST, label: "Wishlist", variant: "outline", iconName: "Heart", requiresAuth: true, requiredRole: "user" },
265
+ [DASHBOARD_QUICK_ACTION_ID.USER_EDIT_PROFILE]: { id: DASHBOARD_QUICK_ACTION_ID.USER_EDIT_PROFILE, label: "Edit Profile", variant: "outline", iconName: "User", requiresAuth: true, requiredRole: "user" },
266
+ [DASHBOARD_QUICK_ACTION_ID.USER_ADD_ADDRESS]: { id: DASHBOARD_QUICK_ACTION_ID.USER_ADD_ADDRESS, label: "Add Address", variant: "outline", iconName: "MapPin", requiresAuth: true, requiredRole: "user" },
230
267
  };
231
268
  // Quick action groups β€” ordered left-to-right in the top shortcut bar
232
269
  export const DASHBOARD_QUICK_ACTIONS = {
@@ -396,4 +396,7 @@ export const siteSettingsSeedData = {
396
396
  deviantartClientId: "deviantart_client_id_PLACEHOLDER",
397
397
  deviantartClientSecret: "deviantart_client_secret_PLACEHOLDER",
398
398
  },
399
+ actionConfig: {},
400
+ navConfig: {},
401
+ disabledRoutes: [],
399
402
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "2.7.18",
3
+ "version": "2.7.19",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"