@mohasinac/appkit 2.7.10 → 2.7.12
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/jobs/core/assignSpinPrize.js +8 -7
- package/dist/_internal/server/jobs/core/bundleStockSync.js +11 -6
- package/dist/_internal/server/jobs/core/countersReconcile.js +3 -2
- package/dist/_internal/server/jobs/core/onProductStockChange.js +12 -7
- package/dist/_internal/server/jobs/core/onProductWrite.js +3 -2
- package/dist/_internal/server/jobs/core/prizeRevealClose.js +7 -5
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.js +11 -6
- package/dist/_internal/server/jobs/core/prizeRevealOpen.js +13 -7
- package/dist/_internal/server/jobs/core/prizeRevealReminder.js +9 -4
- package/dist/_internal/server/jobs/core/triggerEventRaffle.js +3 -2
- package/dist/_internal/shared/features/blog/schema.d.ts +4 -4
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +32 -32
- package/dist/_internal/shared/features/events/schema.d.ts +4 -4
- package/dist/_internal/shared/features/products/schema.d.ts +20 -20
- package/dist/_internal/shared/features/promotions/schema.d.ts +2 -2
- package/dist/_internal/shared/features/reviews/schema.d.ts +1 -1
- package/dist/configs/next.js +17 -1
- package/dist/constants/field-names.d.ts +813 -0
- package/dist/constants/field-names.js +918 -0
- package/dist/constants/sort.d.ts +7 -0
- package/dist/constants/sort.js +5 -0
- package/dist/constants/table-keys.d.ts +48 -0
- package/dist/constants/table-keys.js +46 -0
- package/dist/features/account/components/AddressesIndexListing.js +9 -6
- package/dist/features/admin/components/AdminAllEventEntriesView.js +4 -1
- package/dist/features/admin/components/AdminBidsView.js +4 -1
- package/dist/features/admin/components/AdminBlogView.js +9 -2
- package/dist/features/admin/components/AdminBrandsView.js +9 -2
- package/dist/features/admin/components/AdminCarouselView.js +4 -1
- package/dist/features/admin/components/AdminCartsView.js +4 -1
- package/dist/features/admin/components/AdminCategoriesView.js +9 -2
- package/dist/features/admin/components/AdminContactView.js +4 -1
- package/dist/features/admin/components/AdminCouponsView.js +4 -1
- package/dist/features/admin/components/AdminFaqsView.js +5 -1
- package/dist/features/admin/components/AdminFeaturesView.js +5 -2
- package/dist/features/admin/components/AdminHistoryView.js +5 -1
- package/dist/features/admin/components/AdminNewsletterView.js +4 -1
- package/dist/features/admin/components/AdminNotificationsView.js +4 -1
- package/dist/features/admin/components/AdminOrdersView.js +14 -12
- package/dist/features/admin/components/AdminPayoutsView.js +4 -1
- package/dist/features/admin/components/AdminPrizeDrawsView.js +4 -1
- package/dist/features/admin/components/AdminProductsView.js +14 -3
- package/dist/features/admin/components/AdminReturnRequestsView.js +4 -1
- package/dist/features/admin/components/AdminReviewsView.js +4 -1
- package/dist/features/admin/components/AdminScammersView.js +4 -1
- package/dist/features/admin/components/AdminSessionsView.js +4 -1
- package/dist/features/admin/components/AdminStoreAddressesView.js +5 -1
- package/dist/features/admin/components/AdminStoresView.js +10 -3
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +4 -1
- package/dist/features/admin/components/AdminSupportTicketsView.js +4 -1
- package/dist/features/admin/components/AdminTeamView.js +4 -1
- package/dist/features/admin/components/AdminUsersView.js +9 -12
- package/dist/features/admin/components/AdminViewCards.d.ts +12 -0
- package/dist/features/admin/components/AdminViewCards.js +53 -0
- package/dist/features/admin/components/AdminWishlistsView.js +4 -1
- package/dist/features/auctions/repository/bid.repository.js +1 -6
- package/dist/features/auctions/schemas/index.d.ts +4 -4
- package/dist/features/blog/actions/blog-actions.d.ts +16 -16
- package/dist/features/blog/components/BlogFilters.d.ts +28 -28
- package/dist/features/blog/components/BlogFilters.js +18 -15
- package/dist/features/blog/components/BlogIndexListing.js +24 -13
- package/dist/features/blog/schemas/index.d.ts +10 -10
- package/dist/features/categories/components/CategoriesIndexListing.js +30 -19
- package/dist/features/categories/schemas/index.d.ts +2 -2
- package/dist/features/events/components/AdminEventsView.js +5 -1
- package/dist/features/events/components/EventFilters.d.ts +24 -24
- package/dist/features/events/components/EventFilters.js +16 -13
- package/dist/features/events/components/EventStatusBadge.js +1 -0
- package/dist/features/events/components/EventsIndexListing.js +36 -24
- package/dist/features/events/components/EventsListPageView.js +13 -10
- package/dist/features/events/schemas/firestore.d.ts +1 -0
- package/dist/features/events/schemas/firestore.js +1 -0
- package/dist/features/events/schemas/index.d.ts +1 -1
- package/dist/features/events/types/index.d.ts +1 -1
- package/dist/features/faq/actions/faq-actions.d.ts +10 -10
- package/dist/features/faq/schemas/index.d.ts +4 -4
- package/dist/features/layout/TitleBarLayout.js +1 -1
- package/dist/features/orders/components/OrderFilters.d.ts +20 -20
- package/dist/features/orders/components/OrderFilters.js +33 -30
- package/dist/features/orders/repository/orders.repository.js +1 -15
- package/dist/features/orders/schemas/index.d.ts +2 -2
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +44 -36
- package/dist/features/pre-orders/schemas/index.d.ts +3 -3
- package/dist/features/products/components/AuctionsIndexListing.js +63 -30
- package/dist/features/products/components/BidHistory.d.ts +0 -1
- package/dist/features/products/components/BidHistory.js +1 -1
- package/dist/features/products/components/PrizeDrawsIndexListing.js +44 -37
- package/dist/features/products/components/ProductDetailPageView.js +1 -1
- package/dist/features/products/components/ProductFilters.d.ts +20 -20
- package/dist/features/products/components/ProductFilters.js +62 -59
- package/dist/features/products/components/ProductsIndexListing.js +37 -29
- package/dist/features/products/components/ProductsIndexPageView.js +18 -10
- package/dist/features/products/hooks/useProducts.js +2 -0
- package/dist/features/products/repository/products.repository.js +2 -22
- package/dist/features/products/schemas/index.d.ts +28 -28
- package/dist/features/products/schemas/product-features.validators.d.ts +12 -12
- package/dist/features/products/types/index.d.ts +2 -0
- package/dist/features/promotions/components/CouponsIndexListing.js +21 -17
- package/dist/features/promotions/schemas/index.d.ts +4 -4
- package/dist/features/reviews/components/ReviewDetailShell.js +6 -5
- package/dist/features/reviews/components/ReviewFilters.d.ts +16 -16
- package/dist/features/reviews/components/ReviewFilters.js +10 -7
- package/dist/features/reviews/components/ReviewsIndexListing.js +25 -14
- package/dist/features/reviews/components/ReviewsList.d.ts +5 -2
- package/dist/features/reviews/components/ReviewsList.js +11 -5
- package/dist/features/reviews/schemas/firestore.d.ts +1 -0
- package/dist/features/reviews/schemas/index.d.ts +8 -8
- package/dist/features/reviews/types/index.d.ts +1 -0
- package/dist/features/search/schemas/index.d.ts +2 -2
- package/dist/features/seller/components/SellerAuctionsView.js +5 -1
- package/dist/features/seller/components/SellerBidsView.js +4 -1
- package/dist/features/seller/components/SellerCouponsView.js +4 -1
- package/dist/features/seller/components/SellerOffersView.js +5 -1
- package/dist/features/seller/components/SellerOrdersView.js +4 -1
- package/dist/features/seller/components/SellerPayoutsView.js +5 -1
- package/dist/features/seller/components/SellerPreOrdersView.js +4 -1
- package/dist/features/seller/components/SellerPrizeDrawsView.js +4 -1
- package/dist/features/seller/components/SellerProductsView.js +4 -1
- package/dist/features/seller/schemas/index.d.ts +10 -10
- package/dist/features/stores/api/route.js +10 -1
- package/dist/features/stores/components/StoreAuctionsListing.js +2 -1
- package/dist/features/stores/components/StorePreOrdersListing.js +2 -1
- package/dist/features/stores/components/StoreReviewsListing.js +1 -1
- package/dist/features/stores/components/StoresIndexListing.js +45 -27
- package/dist/features/stores/schemas/firestore.d.ts +1 -0
- package/dist/features/stores/schemas/index.d.ts +4 -4
- package/dist/index.d.ts +8 -1
- package/dist/index.js +12 -1
- package/dist/react/hooks/useUrlTable.js +2 -1
- package/dist/seed/bids-seed-data.js +45 -44
- package/dist/seed/categories-seed-data.js +41 -40
- package/dist/seed/coupons-seed-data.js +41 -40
- package/dist/seed/products-auctions-seed-data.js +54 -53
- package/dist/seed/products-preorders-seed-data.js +25 -24
- package/dist/seed/products-prize-draws-seed-data.js +24 -23
- package/dist/seed/products-standard-seed-data.js +294 -293
- package/dist/seed/reviews-seed-data.js +61 -60
- package/dist/seed/scammers-seed-data.js +3 -2
- package/dist/seed/stores-seed-data.js +9 -8
- package/dist/seed/support-tickets-seed-data.js +13 -12
- package/dist/seed/users-seed-data.js +28 -27
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/ListingToolbar.d.ts +7 -4
- package/dist/ui/components/ListingToolbar.js +4 -3
- package/dist/ui/components/SiteLogo.js +1 -1
- package/dist/utils/sieve-builder.d.ts +41 -0
- package/dist/utils/sieve-builder.js +66 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ export interface ListingToolbarLabels {
|
|
|
9
9
|
sort?: string;
|
|
10
10
|
gridView?: string;
|
|
11
11
|
listView?: string;
|
|
12
|
+
tableView?: string;
|
|
12
13
|
resetAll?: string;
|
|
13
14
|
selectAll?: (total: number) => string;
|
|
14
15
|
deselectAll?: string;
|
|
@@ -29,10 +30,12 @@ export interface ListingToolbarProps {
|
|
|
29
30
|
sortValue?: string;
|
|
30
31
|
sortOptions?: readonly ListingToolbarSortOption[];
|
|
31
32
|
onSortChange?: (value: string) => void;
|
|
32
|
-
/** Grid / list view toggle */
|
|
33
|
-
view?: "grid" | "list";
|
|
34
|
-
onViewChange?: (view: "grid" | "list") => void;
|
|
33
|
+
/** Grid / list / table view toggle */
|
|
34
|
+
view?: "grid" | "list" | "table";
|
|
35
|
+
onViewChange?: (view: "grid" | "list" | "table") => void;
|
|
35
36
|
hideViewToggle?: boolean;
|
|
37
|
+
/** When true, adds a third Table button to the view toggle group (admin pages only). */
|
|
38
|
+
showTableView?: boolean;
|
|
36
39
|
/** Reset all toolbar state to defaults */
|
|
37
40
|
onResetAll?: () => void;
|
|
38
41
|
hasActiveState?: boolean;
|
|
@@ -51,4 +54,4 @@ export interface ListingToolbarProps {
|
|
|
51
54
|
labels?: ListingToolbarLabels;
|
|
52
55
|
className?: string;
|
|
53
56
|
}
|
|
54
|
-
export declare function ListingToolbar({ filterCount, onFiltersClick, searchValue, searchPlaceholder, onSearchChange, onSearchCommit, onSearchKeyDown, sortValue, sortOptions, onSortChange, view, onViewChange, hideViewToggle, onResetAll, hasActiveState, bulkMode, bulkSelectedCount, bulkTotalCount, onBulkSelectAll, onBulkClear, extra, labels, className, }: ListingToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare function ListingToolbar({ filterCount, onFiltersClick, searchValue, searchPlaceholder, onSearchChange, onSearchCommit, onSearchKeyDown, sortValue, sortOptions, onSortChange, view, onViewChange, hideViewToggle, showTableView, onResetAll, hasActiveState, bulkMode, bulkSelectedCount, bulkTotalCount, onBulkSelectAll, onBulkClear, extra, labels, className, }: ListingToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { CheckSquare, Search, SlidersHorizontal, LayoutGrid, List, RotateCcw, Square, } from "lucide-react";
|
|
3
|
+
import { CheckSquare, Search, SlidersHorizontal, LayoutGrid, List, Table2, RotateCcw, Square, } from "lucide-react";
|
|
4
4
|
import { SortDropdown } from "./SortDropdown";
|
|
5
5
|
const DEFAULT_LABELS = {
|
|
6
6
|
search: "Search",
|
|
@@ -8,6 +8,7 @@ const DEFAULT_LABELS = {
|
|
|
8
8
|
sort: "Sort",
|
|
9
9
|
gridView: "Grid view",
|
|
10
10
|
listView: "List view",
|
|
11
|
+
tableView: "Table view",
|
|
11
12
|
resetAll: "Reset all",
|
|
12
13
|
selectAll: (total) => `Select All (${total})`,
|
|
13
14
|
deselectAll: "Deselect All",
|
|
@@ -17,7 +18,7 @@ const DEFAULT_LABELS = {
|
|
|
17
18
|
const VIEW_BTN_BASE = "p-1.5 sm:p-2 transition-colors";
|
|
18
19
|
const VIEW_BTN_ACTIVE = "bg-[var(--appkit-color-primary,theme(colors.violet.600))] text-white";
|
|
19
20
|
const VIEW_BTN_INACTIVE = "text-zinc-500 hover:bg-zinc-50 dark:hover:bg-slate-800 dark:text-zinc-400";
|
|
20
|
-
export function ListingToolbar({ filterCount = 0, onFiltersClick, searchValue = "", searchPlaceholder = "Search…", onSearchChange, onSearchCommit, onSearchKeyDown, sortValue, sortOptions, onSortChange, view = "grid", onViewChange, hideViewToggle = false, onResetAll, hasActiveState = false, bulkMode = false, bulkSelectedCount = 0, bulkTotalCount = 0, onBulkSelectAll, onBulkClear, extra, labels, className = "", }) {
|
|
21
|
+
export function ListingToolbar({ filterCount = 0, onFiltersClick, searchValue = "", searchPlaceholder = "Search…", onSearchChange, onSearchCommit, onSearchKeyDown, sortValue, sortOptions, onSortChange, view = "grid", onViewChange, hideViewToggle = false, showTableView = false, onResetAll, hasActiveState = false, bulkMode = false, bulkSelectedCount = 0, bulkTotalCount = 0, onBulkSelectAll, onBulkClear, extra, labels, className = "", }) {
|
|
21
22
|
const l = { ...DEFAULT_LABELS, ...labels };
|
|
22
23
|
const handleKeyDown = (e) => {
|
|
23
24
|
if (onSearchKeyDown) {
|
|
@@ -30,5 +31,5 @@ export function ListingToolbar({ filterCount = 0, onFiltersClick, searchValue =
|
|
|
30
31
|
const allSelected = bulkTotalCount > 0 && bulkSelectedCount === bulkTotalCount;
|
|
31
32
|
return (_jsx("div", { className: `sticky top-[var(--header-height,0px)] z-20 border-b border-zinc-200 dark:border-slate-700 bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm py-2 px-3 sm:py-2.5 sm:px-4 ${className}`, children: _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-2.5", children: [bulkMode ? (_jsxs("div", { className: "flex flex-1 items-center gap-2", children: [_jsxs("button", { type: "button", onClick: onBulkSelectAll, className: "flex items-center gap-1.5 rounded-lg border border-zinc-300 dark:border-slate-600 px-3 py-1.5 text-sm font-medium text-zinc-700 dark:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-slate-800 transition-colors", children: [allSelected
|
|
32
33
|
? _jsx(CheckSquare, { className: "h-4 w-4 text-[var(--appkit-color-primary,theme(colors.violet.600))]" })
|
|
33
|
-
: _jsx(Square, { className: "h-4 w-4" }), allSelected ? l.deselectAll : l.selectAll(bulkTotalCount)] }), _jsx("span", { className: "text-sm text-zinc-500 dark:text-zinc-400", children: l.selected(bulkSelectedCount) }), _jsx("button", { type: "button", onClick: onBulkClear, className: "text-xs text-zinc-400 hover:text-rose-500 dark:text-zinc-500 transition-colors", children: l.clearSelection })] })) : onSearchChange ? (_jsxs("div", { className: "flex flex-1 items-center overflow-hidden rounded-lg border border-zinc-300 dark:border-slate-600 bg-white dark:bg-slate-900 min-w-0", children: [_jsx("input", { type: "text", value: searchValue, onChange: (e) => onSearchChange(e.target.value), onKeyDown: handleKeyDown, placeholder: searchPlaceholder, className: "min-w-0 flex-1 bg-transparent px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder-zinc-400 outline-none" }), _jsx("button", { type: "button", onClick: onSearchCommit, className: "flex shrink-0 items-center justify-center px-2.5 py-2 text-zinc-400 hover:text-[var(--appkit-color-primary,theme(colors.violet.600))] transition-colors", "aria-label": l.search, children: _jsx(Search, { className: "h-4 w-4" }) })] })) : null, _jsxs("div", { className: "flex items-center gap-1.5 sm:gap-2 shrink-0", children: [onFiltersClick && (_jsxs("button", { type: "button", onClick: onFiltersClick, className: "relative flex shrink-0 items-center gap-1.5 rounded-lg border border-zinc-300 dark:border-slate-600 px-2.5 py-1.5 sm:px-3.5 sm:py-2 text-sm font-medium text-zinc-700 dark:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-slate-800 transition-colors", children: [_jsx(SlidersHorizontal, { className: "h-4 w-4" }), _jsx("span", { className: "hidden sm:inline", children: l.filters }), filterCount > 0 && (_jsx("span", { className: "absolute -top-1.5 -right-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--appkit-color-primary,theme(colors.violet.600))] text-[10px] font-bold text-white", children: filterCount }))] })), sortOptions && sortValue !== undefined && onSortChange && (_jsxs("div", { className: "flex items-center gap-1.5 text-sm text-zinc-500 dark:text-zinc-400", children: [_jsx("span", { className: "hidden md:inline whitespace-nowrap text-xs", children: l.sort }), _jsx(SortDropdown, { value: sortValue, onChange: onSortChange, options: sortOptions })] })), !hideViewToggle && onViewChange && (_jsxs("div", { className: "flex items-center rounded-lg border border-zinc-300 dark:border-slate-600 overflow-hidden", children: [_jsx("button", { type: "button", onClick: () => onViewChange("grid"), "aria-label": l.gridView, className: `${VIEW_BTN_BASE} ${view === "grid" ? VIEW_BTN_ACTIVE : VIEW_BTN_INACTIVE}`, children: _jsx(LayoutGrid, { className: "h-4 w-4" }) }), _jsx("button", { type: "button", onClick: () => onViewChange("list"), "aria-label": l.listView, className: `${VIEW_BTN_BASE} ${view === "list" ? VIEW_BTN_ACTIVE : VIEW_BTN_INACTIVE}`, children: _jsx(List, { className: "h-4 w-4" }) })] })), onResetAll && hasActiveState && (_jsx("button", { type: "button", onClick: onResetAll, "aria-label": l.resetAll, title: l.resetAll, className: "flex shrink-0 items-center justify-center rounded-lg border border-zinc-300 dark:border-slate-600 p-1.5 sm:p-2 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-slate-800 hover:text-rose-500 dark:hover:text-rose-400 transition-colors", children: _jsx(RotateCcw, { className: "h-4 w-4" }) })), extra] })] }) }));
|
|
34
|
+
: _jsx(Square, { className: "h-4 w-4" }), allSelected ? l.deselectAll : l.selectAll(bulkTotalCount)] }), _jsx("span", { className: "text-sm text-zinc-500 dark:text-zinc-400", children: l.selected(bulkSelectedCount) }), _jsx("button", { type: "button", onClick: onBulkClear, className: "text-xs text-zinc-400 hover:text-rose-500 dark:text-zinc-500 transition-colors", children: l.clearSelection })] })) : onSearchChange ? (_jsxs("div", { className: "flex flex-1 items-center overflow-hidden rounded-lg border border-zinc-300 dark:border-slate-600 bg-white dark:bg-slate-900 min-w-0", children: [_jsx("input", { type: "text", value: searchValue, onChange: (e) => onSearchChange(e.target.value), onKeyDown: handleKeyDown, placeholder: searchPlaceholder, className: "min-w-0 flex-1 bg-transparent px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder-zinc-400 outline-none" }), _jsx("button", { type: "button", onClick: onSearchCommit, className: "flex shrink-0 items-center justify-center px-2.5 py-2 text-zinc-400 hover:text-[var(--appkit-color-primary,theme(colors.violet.600))] transition-colors", "aria-label": l.search, children: _jsx(Search, { className: "h-4 w-4" }) })] })) : null, _jsxs("div", { className: "flex items-center gap-1.5 sm:gap-2 shrink-0", children: [onFiltersClick && (_jsxs("button", { type: "button", onClick: onFiltersClick, className: "relative flex shrink-0 items-center gap-1.5 rounded-lg border border-zinc-300 dark:border-slate-600 px-2.5 py-1.5 sm:px-3.5 sm:py-2 text-sm font-medium text-zinc-700 dark:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-slate-800 transition-colors", children: [_jsx(SlidersHorizontal, { className: "h-4 w-4" }), _jsx("span", { className: "hidden sm:inline", children: l.filters }), filterCount > 0 && (_jsx("span", { className: "absolute -top-1.5 -right-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--appkit-color-primary,theme(colors.violet.600))] text-[10px] font-bold text-white", children: filterCount }))] })), sortOptions && sortValue !== undefined && onSortChange && (_jsxs("div", { className: "flex items-center gap-1.5 text-sm text-zinc-500 dark:text-zinc-400", children: [_jsx("span", { className: "hidden md:inline whitespace-nowrap text-xs", children: l.sort }), _jsx(SortDropdown, { value: sortValue, onChange: onSortChange, options: sortOptions })] })), !hideViewToggle && onViewChange && (_jsxs("div", { className: "flex items-center rounded-lg border border-zinc-300 dark:border-slate-600 overflow-hidden", children: [_jsx("button", { type: "button", onClick: () => onViewChange("grid"), "aria-label": l.gridView, className: `${VIEW_BTN_BASE} ${view === "grid" ? VIEW_BTN_ACTIVE : VIEW_BTN_INACTIVE}`, children: _jsx(LayoutGrid, { className: "h-4 w-4" }) }), _jsx("button", { type: "button", onClick: () => onViewChange("list"), "aria-label": l.listView, className: `${VIEW_BTN_BASE} ${view === "list" ? VIEW_BTN_ACTIVE : VIEW_BTN_INACTIVE}`, children: _jsx(List, { className: "h-4 w-4" }) }), showTableView && (_jsx("button", { type: "button", onClick: () => onViewChange("table"), "aria-label": l.tableView, className: `${VIEW_BTN_BASE} ${view === "table" ? VIEW_BTN_ACTIVE : VIEW_BTN_INACTIVE}`, children: _jsx(Table2, { className: "h-4 w-4" }) }))] })), onResetAll && hasActiveState && (_jsx("button", { type: "button", onClick: onResetAll, "aria-label": l.resetAll, title: l.resetAll, className: "flex shrink-0 items-center justify-center rounded-lg border border-zinc-300 dark:border-slate-600 p-1.5 sm:p-2 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-slate-800 hover:text-rose-500 dark:hover:text-rose-400 transition-colors", children: _jsx(RotateCcw, { className: "h-4 w-4" }) })), extra] })] }) }));
|
|
34
35
|
}
|
|
@@ -14,5 +14,5 @@ export function SiteLogo({ className = "h-7", title = "LetItRip.in", variant = "
|
|
|
14
14
|
_jsx("img", { src: src, alt: title, className: `block w-auto object-contain ${className}` }));
|
|
15
15
|
}
|
|
16
16
|
const fill = variant === "gradient" ? `url(#${GRADIENT_ID})` : "currentColor";
|
|
17
|
-
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0
|
|
17
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 214 56", role: "img", "aria-label": title, className: `block w-auto ${className}`, children: [_jsx("title", { children: title }), variant === "gradient" && (_jsx("defs", { children: _jsxs("linearGradient", { id: GRADIENT_ID, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [_jsx("stop", { offset: "0%", style: { stopColor: "var(--appkit-color-primary-700, #1343de)" } }), _jsx("stop", { offset: "55%", style: { stopColor: "var(--appkit-color-cobalt, #3570fc)" } }), _jsx("stop", { offset: "100%", style: { stopColor: "var(--appkit-color-secondary-400, #84e122)" } })] }) })), _jsx("text", { x: "0", y: "44", fontFamily: "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif", fontWeight: "800", fontSize: "44", letterSpacing: "-1.5", fill: fill, children: "LetItRip" }), _jsx("rect", { x: "169", y: "5", width: "43", height: "21", rx: "10.5", fill: fill, opacity: "0.12" }), _jsx("text", { x: "174", y: "21", fontFamily: "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif", fontWeight: "700", fontSize: "15", letterSpacing: "0.2", fill: fill, children: ".in" })] }));
|
|
18
18
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const SIEVE_OP: {
|
|
2
|
+
readonly EQ: "==";
|
|
3
|
+
readonly NEQ: "!=";
|
|
4
|
+
readonly GT: ">";
|
|
5
|
+
readonly LT: "<";
|
|
6
|
+
readonly GTE: ">=";
|
|
7
|
+
readonly LTE: "<=";
|
|
8
|
+
readonly CONTAINS: "@=";
|
|
9
|
+
readonly STARTS: "_=";
|
|
10
|
+
readonly ENDS: "_-=";
|
|
11
|
+
readonly NOT_CONTAINS: "!@=";
|
|
12
|
+
readonly NOT_STARTS: "!_=";
|
|
13
|
+
readonly NOT_ENDS: "!_-=";
|
|
14
|
+
readonly CONTAINS_CI: "@=*";
|
|
15
|
+
readonly STARTS_CI: "_=*";
|
|
16
|
+
readonly ENDS_CI: "_-=*";
|
|
17
|
+
readonly EQ_CI: "==*";
|
|
18
|
+
readonly NEQ_CI: "!=*";
|
|
19
|
+
};
|
|
20
|
+
export type SieveOp = (typeof SIEVE_OP)[keyof typeof SIEVE_OP];
|
|
21
|
+
/** Operators for which the pipe `|` is valid for OR-matching within a single clause */
|
|
22
|
+
export declare const SIEVE_PIPE_OPS: Set<SieveOp>;
|
|
23
|
+
/** Single Sieve clause: sieveFilter("status", "==", "published") → "status==published" */
|
|
24
|
+
export declare function sieveFilter(field: string, op: SieveOp, value: string | number | boolean): string;
|
|
25
|
+
/**
|
|
26
|
+
* Multi-value equality filter as multiple AND clauses.
|
|
27
|
+
* sieveMultiEq("condition", ["new","used"]) → "condition==new,condition==used"
|
|
28
|
+
*
|
|
29
|
+
* For pipe-valid ops (CONTAINS / STARTS / ENDS and CI variants), pass the
|
|
30
|
+
* pipe-joined value directly to sieveFilter() instead of this helper.
|
|
31
|
+
*/
|
|
32
|
+
export declare function sieveMultiEq(field: string, values: (string | number | boolean)[]): string;
|
|
33
|
+
/**
|
|
34
|
+
* Expand a URL param that may contain "|"-separated values into the correct Sieve clause(s).
|
|
35
|
+
* - For equality ops: "new|used" → "condition==new,condition==used"
|
|
36
|
+
* - For pipe-valid ops: "foo|bar" → "title@=*foo|bar" (single clause, valid)
|
|
37
|
+
*/
|
|
38
|
+
export declare function expandSieveParam(field: string, value: string | null, op?: SieveOp): string;
|
|
39
|
+
/** Join Sieve clauses with comma (AND) — drops falsy values */
|
|
40
|
+
export declare function sieveAnd(...clauses: (string | null | undefined | false)[]): string;
|
|
41
|
+
export { sortBy } from "../constants/sort";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export const SIEVE_OP = {
|
|
2
|
+
EQ: "==",
|
|
3
|
+
NEQ: "!=",
|
|
4
|
+
GT: ">",
|
|
5
|
+
LT: "<",
|
|
6
|
+
GTE: ">=",
|
|
7
|
+
LTE: "<=",
|
|
8
|
+
CONTAINS: "@=",
|
|
9
|
+
STARTS: "_=",
|
|
10
|
+
ENDS: "_-=",
|
|
11
|
+
NOT_CONTAINS: "!@=",
|
|
12
|
+
NOT_STARTS: "!_=",
|
|
13
|
+
NOT_ENDS: "!_-=",
|
|
14
|
+
CONTAINS_CI: "@=*",
|
|
15
|
+
STARTS_CI: "_=*",
|
|
16
|
+
ENDS_CI: "_-=*",
|
|
17
|
+
EQ_CI: "==*",
|
|
18
|
+
NEQ_CI: "!=*",
|
|
19
|
+
};
|
|
20
|
+
/** Operators for which the pipe `|` is valid for OR-matching within a single clause */
|
|
21
|
+
export const SIEVE_PIPE_OPS = new Set([
|
|
22
|
+
SIEVE_OP.CONTAINS,
|
|
23
|
+
SIEVE_OP.STARTS,
|
|
24
|
+
SIEVE_OP.ENDS,
|
|
25
|
+
SIEVE_OP.CONTAINS_CI,
|
|
26
|
+
SIEVE_OP.STARTS_CI,
|
|
27
|
+
SIEVE_OP.ENDS_CI,
|
|
28
|
+
]);
|
|
29
|
+
/** Single Sieve clause: sieveFilter("status", "==", "published") → "status==published" */
|
|
30
|
+
export function sieveFilter(field, op, value) {
|
|
31
|
+
return `${field}${op}${value}`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Multi-value equality filter as multiple AND clauses.
|
|
35
|
+
* sieveMultiEq("condition", ["new","used"]) → "condition==new,condition==used"
|
|
36
|
+
*
|
|
37
|
+
* For pipe-valid ops (CONTAINS / STARTS / ENDS and CI variants), pass the
|
|
38
|
+
* pipe-joined value directly to sieveFilter() instead of this helper.
|
|
39
|
+
*/
|
|
40
|
+
export function sieveMultiEq(field, values) {
|
|
41
|
+
return values.map((v) => sieveFilter(field, SIEVE_OP.EQ, v)).join(",");
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Expand a URL param that may contain "|"-separated values into the correct Sieve clause(s).
|
|
45
|
+
* - For equality ops: "new|used" → "condition==new,condition==used"
|
|
46
|
+
* - For pipe-valid ops: "foo|bar" → "title@=*foo|bar" (single clause, valid)
|
|
47
|
+
*/
|
|
48
|
+
export function expandSieveParam(field, value, op = SIEVE_OP.EQ) {
|
|
49
|
+
if (!value)
|
|
50
|
+
return "";
|
|
51
|
+
const values = value.split("|").filter(Boolean);
|
|
52
|
+
if (values.length === 0)
|
|
53
|
+
return "";
|
|
54
|
+
if (SIEVE_PIPE_OPS.has(op)) {
|
|
55
|
+
return sieveFilter(field, op, value);
|
|
56
|
+
}
|
|
57
|
+
if (values.length === 1) {
|
|
58
|
+
return sieveFilter(field, op, values[0]);
|
|
59
|
+
}
|
|
60
|
+
return sieveMultiEq(field, values);
|
|
61
|
+
}
|
|
62
|
+
/** Join Sieve clauses with comma (AND) — drops falsy values */
|
|
63
|
+
export function sieveAnd(...clauses) {
|
|
64
|
+
return clauses.filter(Boolean).join(",");
|
|
65
|
+
}
|
|
66
|
+
export { sortBy } from "../constants/sort";
|