@mohasinac/appkit 4.31.1 → 4.32.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/_internal/server/features/products/list-public.d.ts +18 -0
- package/dist/_internal/server/features/products/list-public.js +27 -9
- package/dist/client.d.ts +9 -0
- package/dist/client.js +12 -0
- package/dist/features/account/components/UserBidsView.js +6 -1
- package/dist/features/account/components/UserOrdersView.js +8 -1
- package/dist/features/account/components/UserReturnsView.js +6 -1
- package/dist/features/admin/components/AdminAdsView.js +36 -34
- package/dist/features/admin/components/AdminAuditLogView.js +12 -1
- package/dist/features/admin/components/AdminBundlesView.js +5 -1
- package/dist/features/admin/components/AdminCarouselEditorView.js +78 -10
- package/dist/features/admin/components/AdminFaqsView.js +10 -1
- package/dist/features/admin/components/AdminNotificationsView.js +7 -1
- package/dist/features/admin/components/AdminOrderEditorView.js +55 -24
- package/dist/features/admin/components/AdminPrizeDrawsView.js +11 -1
- package/dist/features/admin/components/AdminProductEditorView.js +78 -18
- package/dist/features/admin/components/AdminSectionsView.js +89 -32
- package/dist/features/admin/components/AdminSiteSettingsView.js +96 -44
- package/dist/features/admin/components/AdminStoresView.js +13 -1
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +58 -43
- package/dist/features/admin/components/AdminSupportTicketsView.js +11 -1
- package/dist/features/admin/components/AdminTeamView.js +11 -1
- package/dist/features/admin/components/AdminTesterChecklistView.js +6 -1
- package/dist/features/admin/components/AdminUserEditorView.js +65 -82
- package/dist/features/admin/components/analytics/AdminPageViewsReportView.js +6 -1
- package/dist/features/admin/constants/admin-page-tabs.d.ts +36 -0
- package/dist/features/admin/constants/admin-page-tabs.js +45 -0
- package/dist/features/admin/schemas/admin-ops-forms.d.ts +81 -0
- package/dist/features/admin/schemas/admin-ops-forms.js +123 -1
- package/dist/features/admin/schemas/admin-user-form.d.ts +78 -3
- package/dist/features/admin/schemas/admin-user-form.js +96 -7
- package/dist/features/admin/schemas/homepage-section-form.d.ts +9 -0
- package/dist/features/layout/PageTabs.d.ts +17 -0
- package/dist/features/layout/PageTabs.js +45 -0
- package/dist/features/products/components/GroupSettingsPanel.js +62 -16
- package/dist/features/search/action-index/tab-entries.d.ts +18 -0
- package/dist/features/search/action-index/tab-entries.js +128 -0
- package/dist/features/seller/components/SellerBundlesView.js +5 -1
- package/dist/features/seller/components/SellerGoogleReviewsView.js +31 -19
- package/dist/features/seller/components/SellerOrdersView.js +57 -19
- package/dist/features/seller/components/SellerProductsView.js +10 -1
- package/dist/features/seller/components/SellerReviewsView.d.ts +2 -1
- package/dist/features/seller/components/SellerReviewsView.js +54 -19
- package/dist/features/seller/constants/store-tabs.d.ts +64 -0
- package/dist/features/seller/constants/store-tabs.js +60 -0
- package/dist/features/seller/schemas/order-forms.d.ts +33 -0
- package/dist/features/seller/schemas/order-forms.js +75 -0
- package/dist/features/seller/schemas/review-forms.d.ts +37 -0
- package/dist/features/seller/schemas/review-forms.js +82 -0
- package/dist/features/shell/index.d.ts +1 -1
- package/dist/features/shell/index.js +5 -1
- package/dist/features/shipments/components/AdminShipmentLotItemsView.js +44 -15
- package/dist/features/shipments/schemas/validation.d.ts +41 -0
- package/dist/features/shipments/schemas/validation.js +49 -0
- package/dist/features/store-extensions/schemas/google-config-form.d.ts +36 -0
- package/dist/features/store-extensions/schemas/google-config-form.js +24 -0
- package/dist/features/stores/actions/store-query-actions.js +5 -3
- package/dist/features/stores/repository/store.repository.d.ts +3 -1
- package/dist/features/stores/repository/store.repository.js +6 -2
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +79 -0
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +53 -22
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/next/index.d.ts +2 -0
- package/dist/next/index.js +1 -0
- package/dist/react/hooks/useTabParam.d.ts +19 -0
- package/dist/react/hooks/useTabParam.js +65 -0
- package/dist/schemas/registry.d.ts +27 -3
- package/dist/styles.css +1 -1
- package/dist/tailwind-utilities.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/*
|
|
3
|
+
* WHY: `Tabs` has no URL sync of its own, so every tabbed page has had to
|
|
4
|
+
* hand-roll one. `AdminSiteSettingsView` read `?tab=` once, in a
|
|
5
|
+
* `useState` initialiser guarded on `typeof window` — and never wrote it
|
|
6
|
+
* back, so the URL went stale the moment anyone clicked a tab. A deep
|
|
7
|
+
* link into a tab worked; sharing the page you were looking at did not.
|
|
8
|
+
*
|
|
9
|
+
* W8's tab consolidations add five more tabbed pages, each of which needs
|
|
10
|
+
* the absorbed page's `?tab=` deep link to keep working, which is well
|
|
11
|
+
* past the Rule of Three.
|
|
12
|
+
*
|
|
13
|
+
* WHAT: Read `?tab=` (validated against the page's own union), and write it
|
|
14
|
+
* back on every change.
|
|
15
|
+
*
|
|
16
|
+
* ## Why `router.replace` and not `push`
|
|
17
|
+
*
|
|
18
|
+
* A tab is a view of one page, not a new destination. Pushing would make Back
|
|
19
|
+
* walk the user through every tab they glanced at before leaving the page,
|
|
20
|
+
* which is the behaviour `useUrlTable` already rejected for filters.
|
|
21
|
+
*
|
|
22
|
+
* ## Why not `useUrlTable().set(TABLE_KEYS.TAB, …)`
|
|
23
|
+
*
|
|
24
|
+
* That would work, and it also resets `page` to 1 — correct for a filter
|
|
25
|
+
* change, meaningless here, and it puts a `page=1` in the URL of a settings
|
|
26
|
+
* page that has no pagination.
|
|
27
|
+
*
|
|
28
|
+
* EXPORTS: useTabParam
|
|
29
|
+
*
|
|
30
|
+
* @tag domain:shared
|
|
31
|
+
* @tag layer:hook
|
|
32
|
+
* @tag pattern:none
|
|
33
|
+
* @tag access:client
|
|
34
|
+
* @tag consumers:AdminSiteSettingsView,store payouts/shipping/fulfillment/storefront,admin roles/settings
|
|
35
|
+
* @tag sideEffects:router
|
|
36
|
+
*/
|
|
37
|
+
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
|
38
|
+
import { useCallback } from "react";
|
|
39
|
+
import { TABLE_KEYS } from "../../constants/table-keys";
|
|
40
|
+
/**
|
|
41
|
+
* The active tab, kept in `?tab=`.
|
|
42
|
+
*
|
|
43
|
+
* `isValid` is the page's own type guard — `isSiteSettingsTabId`,
|
|
44
|
+
* `isPayoutsTabId`, and so on — so an unknown value in the URL is IGNORED
|
|
45
|
+
* rather than written into state. That is what makes a stale bookmark open the
|
|
46
|
+
* default tab instead of rendering an empty panel.
|
|
47
|
+
*/
|
|
48
|
+
export function useTabParam(isValid, fallback, options) {
|
|
49
|
+
const nativeRouter = useRouter();
|
|
50
|
+
const nativePathname = usePathname();
|
|
51
|
+
const searchParams = useSearchParams();
|
|
52
|
+
const router = options?.router ?? nativeRouter;
|
|
53
|
+
const pathname = options?.pathname ?? nativePathname;
|
|
54
|
+
const requested = searchParams.get(TABLE_KEYS.TAB);
|
|
55
|
+
const active = isValid(requested) ? requested : fallback;
|
|
56
|
+
const setTab = useCallback((next) => {
|
|
57
|
+
if (!isValid(next))
|
|
58
|
+
return;
|
|
59
|
+
const params = new URLSearchParams(searchParams.toString());
|
|
60
|
+
params.set(TABLE_KEYS.TAB, next);
|
|
61
|
+
const query = params.toString();
|
|
62
|
+
router.replace(query ? `${pathname}?${query}` : pathname);
|
|
63
|
+
}, [isValid, pathname, router, searchParams]);
|
|
64
|
+
return [active, setTab];
|
|
65
|
+
}
|
|
@@ -4874,26 +4874,50 @@ export declare const SCHEMAS: {
|
|
|
4874
4874
|
carrier?: string | undefined;
|
|
4875
4875
|
}>;
|
|
4876
4876
|
readonly adminUser: import("zod").ZodObject<{
|
|
4877
|
+
role: import("zod").ZodOptional<import("zod").ZodEnum<["user", "seller", "admin", "moderator"]>>;
|
|
4878
|
+
emailVerified: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
4877
4879
|
displayName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4878
4880
|
phoneNumber: import("zod").ZodUnion<[import("zod").ZodOptional<import("zod").ZodString>, import("zod").ZodLiteral<"">]>;
|
|
4879
4881
|
isTester: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
4880
4882
|
canTestAdmin: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
4881
4883
|
adminNotes: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4882
|
-
|
|
4884
|
+
bio: import("zod").ZodUnion<[import("zod").ZodOptional<import("zod").ZodString>, import("zod").ZodLiteral<"">]>;
|
|
4885
|
+
location: import("zod").ZodUnion<[import("zod").ZodOptional<import("zod").ZodString>, import("zod").ZodLiteral<"">]>;
|
|
4886
|
+
website: import("zod").ZodUnion<[import("zod").ZodOptional<import("zod").ZodString>, import("zod").ZodLiteral<"">]>;
|
|
4887
|
+
twitter: import("zod").ZodUnion<[import("zod").ZodOptional<import("zod").ZodString>, import("zod").ZodLiteral<"">]>;
|
|
4888
|
+
instagram: import("zod").ZodUnion<[import("zod").ZodOptional<import("zod").ZodString>, import("zod").ZodLiteral<"">]>;
|
|
4889
|
+
facebook: import("zod").ZodUnion<[import("zod").ZodOptional<import("zod").ZodString>, import("zod").ZodLiteral<"">]>;
|
|
4890
|
+
linkedin: import("zod").ZodUnion<[import("zod").ZodOptional<import("zod").ZodString>, import("zod").ZodLiteral<"">]>;
|
|
4883
4891
|
}, "strip", import("zod").ZodTypeAny, {
|
|
4892
|
+
role?: "user" | "seller" | "admin" | "moderator" | undefined;
|
|
4884
4893
|
displayName?: string | undefined;
|
|
4894
|
+
location?: string | undefined;
|
|
4885
4895
|
adminNotes?: string | undefined;
|
|
4896
|
+
bio?: string | undefined;
|
|
4886
4897
|
phoneNumber?: string | undefined;
|
|
4898
|
+
emailVerified?: boolean | undefined;
|
|
4899
|
+
website?: string | undefined;
|
|
4887
4900
|
isTester?: boolean | undefined;
|
|
4888
4901
|
canTestAdmin?: boolean | undefined;
|
|
4889
|
-
|
|
4902
|
+
instagram?: string | undefined;
|
|
4903
|
+
facebook?: string | undefined;
|
|
4904
|
+
twitter?: string | undefined;
|
|
4905
|
+
linkedin?: string | undefined;
|
|
4890
4906
|
}, {
|
|
4907
|
+
role?: "user" | "seller" | "admin" | "moderator" | undefined;
|
|
4891
4908
|
displayName?: string | undefined;
|
|
4909
|
+
location?: string | undefined;
|
|
4892
4910
|
adminNotes?: string | undefined;
|
|
4911
|
+
bio?: string | undefined;
|
|
4893
4912
|
phoneNumber?: string | undefined;
|
|
4913
|
+
emailVerified?: boolean | undefined;
|
|
4914
|
+
website?: string | undefined;
|
|
4894
4915
|
isTester?: boolean | undefined;
|
|
4895
4916
|
canTestAdmin?: boolean | undefined;
|
|
4896
|
-
|
|
4917
|
+
instagram?: string | undefined;
|
|
4918
|
+
facebook?: string | undefined;
|
|
4919
|
+
twitter?: string | undefined;
|
|
4920
|
+
linkedin?: string | undefined;
|
|
4897
4921
|
}>;
|
|
4898
4922
|
readonly employeeInvite: import("zod").ZodObject<{
|
|
4899
4923
|
email: import("zod").ZodString;
|