@mohasinac/appkit 2.7.7 → 2.7.9

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.
@@ -82,6 +82,10 @@ export function defineNextConfig(override = {}) {
82
82
  // build/esm/, and any future subpackages are always included — no more
83
83
  // per-subdirectory entries that silently miss e.g. build/protos/admin_v1.json.
84
84
  // Consumer additions for the same route key are MERGED (array union), not replaced.
85
+ // List derived from full dynamic runtime trace (scripts/trace-firebase-full.mjs) plus
86
+ // known lazy-loaded packages (proxy agents, debug, stream utilities).
87
+ // Do NOT use broad @scope/** globs — the full firebase client SDK is hundreds of MB
88
+ // and causes Vercel's "Deploying outputs..." step to time out / fail.
85
89
  const defaultOutputFileTracingIncludes = {
86
90
  "/api/**": [
87
91
  // Firebase Admin — entire package (lib/ + esm/, all sub-SDKs)
@@ -108,91 +112,48 @@ export function defineNextConfig(override = {}) {
108
112
  "./node_modules/duplexify/**",
109
113
  "./node_modules/uuid/**",
110
114
  "./node_modules/lodash.camelcase/**",
111
- // Firebase client SDK scoped packages (RTDB, util, component, logger)
112
- "./node_modules/@firebase/**",
113
- // OpenTelemetry (used by google-gax for tracing)
114
- "./node_modules/@opentelemetry/**",
115
- // @fastify/busboy (multipart — used by firebase-admin storage)
116
- "./node_modules/@fastify/**",
117
- // @nodable/entities (XML entity encoding in fast-xml-parser)
118
- "./node_modules/@nodable/**",
119
- // Transitive deps of gaxios / duplexify / abort-controller / retry-request
120
- // not statically analysed by the Vercel output file tracer (dynamic requires).
121
- // Generated by full recursive dep scan (2026-05-14).
122
- "./node_modules/is-stream/**",
123
- "./node_modules/extend/**",
124
- "./node_modules/https-proxy-agent/**",
125
- "./node_modules/agent-base/**",
115
+ // Packages confirmed by dynamic runtime trace (trace-firebase-full.mjs) as loaded
116
+ // at cold start but not followed by Vercel's static file tracer:
117
+ "./node_modules/@opentelemetry/api/**",
118
+ "./node_modules/@js-sdsl/ordered-map/**",
119
+ "./node_modules/base64-js/**",
120
+ "./node_modules/bignumber.js/**",
121
+ "./node_modules/ecdsa-sig-formatter/**",
122
+ "./node_modules/event-target-shim/**",
123
+ "./node_modules/fast-deep-equal/**",
124
+ "./node_modules/jwa/**",
125
+ // Stream / encoding utilities (loaded by duplexify / readable-stream / gRPC chain):
126
126
  "./node_modules/readable-stream/**",
127
127
  "./node_modules/inherits/**",
128
- "./node_modules/debug/**",
129
- "./node_modules/ms/**",
130
128
  "./node_modules/end-of-stream/**",
131
129
  "./node_modules/once/**",
132
130
  "./node_modules/wrappy/**",
133
131
  "./node_modules/stream-shift/**",
134
- "./node_modules/stream-events/**",
135
132
  "./node_modules/safe-buffer/**",
136
- "./node_modules/string_decoder/**",
137
133
  "./node_modules/util-deprecate/**",
138
- "./node_modules/teeny-request/**",
134
+ // Auth / HTTP utilities:
135
+ "./node_modules/is-stream/**",
136
+ "./node_modules/extend/**",
137
+ "./node_modules/https-proxy-agent/**",
138
+ "./node_modules/agent-base/**",
139
139
  "./node_modules/http-proxy-agent/**",
140
+ "./node_modules/debug/**",
141
+ "./node_modules/ms/**",
142
+ // Google Cloud metadata / logging / misc:
140
143
  "./node_modules/gcp-metadata/**",
141
144
  "./node_modules/json-bigint/**",
142
- "./node_modules/stubs/**",
145
+ "./node_modules/google-logging-utils/**",
146
+ // teeny-request (used by retry-request for HTTP retries):
147
+ "./node_modules/teeny-request/**",
143
148
  "./node_modules/form-data/**",
144
149
  "./node_modules/combined-stream/**",
145
150
  "./node_modules/delayed-stream/**",
146
151
  "./node_modules/asynckit/**",
147
152
  "./node_modules/mime-types/**",
148
153
  "./node_modules/mime-db/**",
149
- "./node_modules/google-logging-utils/**",
150
- "./node_modules/event-target-shim/**",
151
- "./node_modules/faye-websocket/**",
152
- "./node_modules/websocket-driver/**",
153
- "./node_modules/websocket-extensions/**",
154
- "./node_modules/http-parser-js/**",
155
- "./node_modules/functional-red-black-tree/**",
156
- "./node_modules/fast-xml-parser/**",
157
- "./node_modules/fast-xml-builder/**",
158
- "./node_modules/strnum/**",
159
- "./node_modules/html-entities/**",
160
- "./node_modules/jose/**",
161
- "./node_modules/jsonwebtoken/**",
162
- "./node_modules/jwa/**",
163
- "./node_modules/jwks-rsa/**",
164
- "./node_modules/lru-memoizer/**",
165
- "./node_modules/limiter/**",
166
- "./node_modules/node-forge/**",
167
- "./node_modules/lru-cache/**",
168
- "./node_modules/yallist/**",
169
- "./node_modules/async-retry/**",
170
- "./node_modules/retry/**",
171
- "./node_modules/p-limit/**",
172
- "./node_modules/yocto-queue/**",
173
- "./node_modules/arrify/**",
174
- "./node_modules/semver/**",
175
- "./node_modules/fast-deep-equal/**",
176
- "./node_modules/tslib/**",
177
- "./node_modules/base64-js/**",
178
- "./node_modules/bignumber.js/**",
179
- "./node_modules/farmhash-modern/**",
180
- "./node_modules/mime/**",
181
- "./node_modules/punycode/**",
182
- "./node_modules/whatwg-url/**",
183
- "./node_modules/tr46/**",
184
- "./node_modules/webidl-conversions/**",
185
- "./node_modules/path-expression-matcher/**",
186
- "./node_modules/ecdsa-sig-formatter/**",
187
- "./node_modules/buffer-equal-constant-time/**",
188
- "./node_modules/lodash.clonedeep/**",
189
- "./node_modules/lodash.includes/**",
190
- "./node_modules/lodash.isboolean/**",
191
- "./node_modules/lodash.isinteger/**",
192
- "./node_modules/lodash.isnumber/**",
193
- "./node_modules/lodash.isplainobject/**",
194
- "./node_modules/lodash.isstring/**",
195
- "./node_modules/lodash.once/**",
154
+ "./node_modules/stream-events/**",
155
+ "./node_modules/stubs/**",
156
+ "./node_modules/string_decoder/**",
196
157
  ],
197
158
  };
198
159
  const mergedOutputFileTracingIncludes = {
@@ -87,9 +87,7 @@ export function AdminFeaturesView({ children, ...props }) {
87
87
  const tabClass = (value) => `${TAB_BASE_CLASS} ${scopeFilter === value ? TAB_ACTIVE_CLASS : TAB_INACTIVE_CLASS}`;
88
88
  return (_jsxs(Div, { className: "min-h-screen", children: [_jsx(ListingToolbar, { searchValue: searchInput, searchPlaceholder: "Search features by label", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
89
89
  table.set("sort", v);
90
- table.setPage(1);
91
90
  }, hideViewToggle: true, onResetAll: resetAll, hasActiveState: hasActiveState, extra: _jsxs(Button, { size: "sm", onClick: openCreatePanel, className: "flex items-center gap-1.5", children: [_jsx(Plus, { className: "h-4 w-4" }), "Add Feature"] }) }), _jsx(Row, { className: STICKY_TABS_CLASS, gap: "xs", children: PRODUCT_FEATURE_SCOPE_TABS.map((tab) => (_jsx("button", { type: "button", onClick: () => {
92
91
  table.set("scope", tab.value);
93
- table.setPage(1);
94
92
  }, className: tabClass(tab.value), children: tab.label }, tab.value))) }), totalPages > 1 && (_jsx(Div, { className: PAGINATION_BAR_CLASS, children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs(Div, { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx(Text, { as: "div", className: ERROR_BANNER_CLASS, children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No features found", onRowClick: (row) => openEditPanel(row.id) })] }), _jsx(SideDrawer, { isOpen: isCreateOpen || isEditOpen, onClose: closePanel, title: isCreateOpen ? "Add Feature" : "Edit Feature", mode: isCreateOpen ? "create" : "edit", children: (isCreateOpen || isEditOpen) && (_jsx(AdminFeatureEditorView, { featureId: editId ?? undefined, onSaved: closePanel, onDeleted: closePanel, embedded: true })) })] }));
95
93
  }
@@ -130,6 +130,5 @@ export function AdminPrizeDrawsView({ children, ...props }) {
130
130
  }
131
131
  return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search prize draws by name or store\u2026", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
132
132
  table.set("sort", v);
133
- table.setPage(1);
134
133
  }, hideViewToggle: true, onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx("div", { className: "sticky z-10 flex justify-center bg-[var(--appkit-color-surface)]/95 backdrop-blur-sm border-b border-[var(--appkit-color-border)] px-3 py-1.5", style: { top: "calc(var(--header-height, 0px) + 44px)" }, children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx(Alert, { variant: "error", className: "mb-4", children: errorMessage })), _jsx(DataTable, { columns: PRIZE_DRAW_COLUMNS, rows: rows, isLoading: isLoading, emptyLabel: "No prize draws found", getRowHref: (row) => String(ROUTES.ADMIN.PRIZE_DRAWS_EDIT(row.id)), renderRowActions: (row) => (_jsx(Button, { variant: "ghost", size: "sm", asChild: true, children: _jsx("a", { href: String(ROUTES.ADMIN.PRIZE_DRAWS_EDIT(row.id)), "aria-label": "Edit", children: _jsx(Pencil, { className: "w-4 h-4" }) }) })) })] }), filterOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-[var(--appkit-color-surface)] shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-[var(--appkit-color-border)] px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-[var(--appkit-color-text)]", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-[var(--appkit-color-text-muted)] hover:text-[var(--appkit-color-error)] transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: _jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }) }), _jsx("div", { className: "border-t border-[var(--appkit-color-border)] px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-[var(--appkit-color-primary)] py-2.5 text-sm font-semibold text-white hover:opacity-90 transition-opacity active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }))] }));
135
134
  }
@@ -104,7 +104,6 @@ export function AdminScammersView({ children, ...props }) {
104
104
  }
105
105
  return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search by name, phone, UPI ID", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
106
106
  table.set("sort", v);
107
- table.setPage(1);
108
107
  }, hideViewToggle: true, onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx("div", { className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 flex justify-center bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm border-b border-zinc-200 dark:border-slate-700 px-3 py-1.5", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx("div", { className: "mb-4 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No scammer profiles found", renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
109
108
  {
110
109
  label: "Review",
@@ -51,6 +51,5 @@ export function AdminSublistingCategoriesView() {
51
51
  const totalPages = Math.ceil(total / PAGE_SIZE);
52
52
  return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { searchValue: searchInput, searchPlaceholder: "Search sub-listing categories\u2026", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
53
53
  table.set("sort", v);
54
- table.setPage(1);
55
54
  }, hideViewToggle: true, onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx("div", { className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 flex justify-center bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm border-b border-zinc-200 dark:border-slate-700 px-3 py-1.5", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx("div", { className: "mb-4 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No sub-listing categories found" })] })] }));
56
55
  }
@@ -111,7 +111,6 @@ export function AdminSupportTicketsView({ children, ...props }) {
111
111
  }
112
112
  return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search by subject", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
113
113
  table.set("sort", v);
114
- table.setPage(1);
115
114
  }, hideViewToggle: true, onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx("div", { className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 flex justify-center bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm border-b border-zinc-200 dark:border-slate-700 px-3 py-1.5", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx("div", { className: "mb-4 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No support tickets found", renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
116
115
  {
117
116
  label: "View",
@@ -127,7 +127,6 @@ export function AdminTeamView({ children, ...props }) {
127
127
  }
128
128
  return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search by name or email", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
129
129
  table.set("sort", v);
130
- table.setPage(1);
131
130
  }, hideViewToggle: true, onResetAll: resetAll, hasActiveState: hasActiveState, extra: _jsxs(Button, { type: "button", variant: "primary", onClick: openInvite, className: "flex items-center gap-1.5 whitespace-nowrap", children: [_jsx(UserPlus, { className: "h-4 w-4" }), "Invite Employee"] }) }), totalPages > 1 && (_jsx("div", { className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 flex justify-center bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm border-b border-zinc-200 dark:border-slate-700 px-3 py-1.5", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx("div", { className: "mb-4 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No employees found", renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
132
131
  {
133
132
  label: "Edit Permissions",
@@ -77,7 +77,6 @@ export function BlogIndexListing({ initialData }) {
77
77
  const currentPage = table.getNumber("page", 1);
78
78
  const commitSearch = useCallback(() => {
79
79
  table.set("q", searchInput.trim());
80
- table.setPage(1);
81
80
  }, [searchInput, table]);
82
81
  return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search posts...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || "-publishedAt", sortOptions: BLOG_PUBLIC_SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, hideViewToggle: true, onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx("div", { className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 flex justify-center bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm border-b border-zinc-200 dark:border-slate-700 px-3 py-1.5", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsx("div", { className: "py-6", children: isLoading ? (_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: Array.from({ length: 6 }).map((_, i) => (_jsxs("div", { className: "rounded-xl border border-zinc-100 dark:border-slate-700 overflow-hidden animate-pulse", children: [_jsx("div", { className: "aspect-video bg-zinc-200 dark:bg-slate-700" }), _jsxs("div", { className: "p-5 space-y-2", children: [_jsx("div", { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-1/4" }), _jsx("div", { className: "h-4 bg-zinc-200 dark:bg-slate-700 rounded w-3/4" }), _jsx("div", { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-full" }), _jsx("div", { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-2/3" })] })] }, i))) })) : posts.length === 0 ? (_jsx("p", { className: "py-12 text-center text-sm text-zinc-500 dark:text-zinc-400", children: "No posts found." })) : (_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: posts.map((post) => (_jsx(BlogCard, { post: post, href: String(ROUTES.BLOG.ARTICLE(post.slug)) }, post.id))) })) }), filterOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "flex items-center gap-2 text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close filters", className: "rounded-lg p-1.5 text-zinc-500 hover:bg-zinc-100 dark:hover:bg-slate-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4", children: _jsx(BlogFilters, { table: pendingTable, variant: "public" }) }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }))] }));
83
82
  }
@@ -75,12 +75,10 @@ export function CategoriesIndexListing({ initialData: _, brandsOnly = false }) {
75
75
  activeFilterCount > 0;
76
76
  const commitSearch = useCallback(() => {
77
77
  table.set("q", searchInput.trim());
78
- table.setPage(1);
79
78
  }, [searchInput, table]);
80
79
  const clearSearch = () => {
81
80
  setSearchInput("");
82
81
  table.set("q", "");
83
- table.setPage(1);
84
82
  };
85
83
  // Tab state — "all" | "categories" | "brands" (not used when brandsOnly=true)
86
84
  const activeTab = brandsOnly ? "brands" : (table.get("tab") || "all");
@@ -90,7 +88,6 @@ export function CategoriesIndexListing({ initialData: _, brandsOnly = false }) {
90
88
  undefined;
91
89
  const switchTab = (key) => {
92
90
  table.set("tab", key);
93
- table.setPage(1);
94
91
  };
95
92
  const { categories, total, totalPages, isLoading } = useCategoriesFiltered({
96
93
  q: table.get("q") || undefined,
@@ -100,7 +100,6 @@ export function EventsIndexListing({ initialData }) {
100
100
  const currentPage = table.getNumber("page", 1);
101
101
  const commitSearch = useCallback(() => {
102
102
  table.set("q", searchInput.trim());
103
- table.setPage(1);
104
103
  }, [searchInput, table]);
105
104
  return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search events...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || "startsAt", sortOptions: EVENT_PUBLIC_SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, hideViewToggle: true, onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx("div", { className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 flex justify-center bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm border-b border-zinc-200 dark:border-slate-700 px-3 py-1.5", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsx("div", { className: "py-6", children: isLoading ? (_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: Array.from({ length: 6 }).map((_, i) => (_jsxs("div", { className: "rounded-xl border border-zinc-100 dark:border-slate-700 overflow-hidden animate-pulse", children: [_jsx("div", { className: "aspect-video bg-zinc-200 dark:bg-slate-700" }), _jsxs("div", { className: "p-4 space-y-2", children: [_jsx("div", { className: "h-4 bg-zinc-200 dark:bg-slate-700 rounded w-3/4" }), _jsx("div", { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-full" }), _jsx("div", { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-2/3" }), _jsx("div", { className: "h-8 bg-zinc-200 dark:bg-slate-700 rounded mt-2" })] })] }, i))) })) : events.length === 0 ? (_jsx("p", { className: "py-12 text-center text-sm text-zinc-500 dark:text-zinc-400", children: "No events found." })) : (_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: events.map((event) => (_jsx(EventCard, { event: event }, event.id))) })) }), filterOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "flex items-center gap-2 text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close filters", className: "rounded-lg p-1.5 text-zinc-500 hover:bg-zinc-100 dark:hover:bg-slate-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4", children: _jsx(EventFilters, { table: pendingTable, variant: "public" }) }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }))] }));
106
105
  }
@@ -112,7 +112,6 @@ export function PreOrdersIndexListing({ initialData, categorySlug, brandName })
112
112
  const { products: preOrders, totalPages, page, isLoading } = useProducts(params, { initialData });
113
113
  const commitSearch = useCallback(() => {
114
114
  table.set("q", searchInput.trim());
115
- table.setPage(1);
116
115
  }, [searchInput, table]);
117
116
  const handleSearchKeyDown = (e) => {
118
117
  if (e.key === "Enter")
@@ -107,7 +107,6 @@ export function AuctionsIndexListing({ initialData, categorySlug, brandName }) {
107
107
  const { products: auctions, totalPages, page, isLoading } = useProducts(params, { initialData });
108
108
  const commitSearch = useCallback(() => {
109
109
  table.set("q", searchInput.trim());
110
- table.setPage(1);
111
110
  }, [searchInput, table]);
112
111
  const handleSearchKeyDown = (e) => {
113
112
  if (e.key === "Enter")
@@ -108,7 +108,6 @@ export function PrizeDrawsIndexListing({ initialData, categorySlug, brandName, s
108
108
  : draws;
109
109
  const commitSearch = useCallback(() => {
110
110
  table.set("q", searchInput.trim());
111
- table.setPage(1);
112
111
  }, [searchInput, table]);
113
112
  const handleSearchKeyDown = (e) => {
114
113
  if (e.key === "Enter")
@@ -117,7 +116,6 @@ export function PrizeDrawsIndexListing({ initialData, categorySlug, brandName, s
117
116
  const gridClass = "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4";
118
117
  return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search prize draws...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, onSearchKeyDown: handleSearchKeyDown, sortValue: table.get("sort") || "-createdAt", sortOptions: PRIZE_DRAW_SORT_OPTIONS, onSortChange: (v) => {
119
118
  table.set("sort", v);
120
- table.setPage(1);
121
119
  }, view: view, onViewChange: (v) => {
122
120
  setView(v);
123
121
  table.set("view", v);
@@ -103,7 +103,6 @@ export function ProductsIndexListing({ initialData }) {
103
103
  const selection = useBulkSelection({ items: products, keyExtractor: (p) => p.id });
104
104
  const commitSearch = useCallback(() => {
105
105
  table.set("q", searchInput.trim());
106
- table.setPage(1);
107
106
  }, [searchInput, table]);
108
107
  const handleSearchKeyDown = (e) => {
109
108
  if (e.key === "Enter")
@@ -53,7 +53,6 @@ export function CouponsIndexListing({ initialCoupons, storeSlug, storeId, }) {
53
53
  : coupons;
54
54
  const commitSearch = useCallback(() => {
55
55
  table.set("q", searchInput.trim());
56
- table.setPage(1);
57
56
  }, [searchInput, table]);
58
57
  const handleKeyDown = (e) => {
59
58
  if (e.key === "Enter")
@@ -62,10 +61,7 @@ export function CouponsIndexListing({ initialCoupons, storeSlug, storeId, }) {
62
61
  const activeType = table.get("type");
63
62
  const hasActiveFilters = !!activeType || !!table.get("dateFrom") || !!table.get("dateTo");
64
63
  const clearFilters = () => {
65
- table.set("type", "");
66
- table.set("dateFrom", "");
67
- table.set("dateTo", "");
68
- table.setPage(1);
64
+ table.setMany({ type: "", dateFrom: "", dateTo: "" });
69
65
  };
70
66
  return (_jsxs("div", { className: "min-h-[40vh]", children: [_jsxs("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.5 px-4", children: [_jsxs("div", { className: "flex items-center gap-2.5 max-w-full", children: [_jsxs("button", { type: "button", onClick: () => setFilterOpen(true), className: `flex shrink-0 items-center gap-2 rounded-lg border px-3.5 py-2 text-sm font-medium transition-colors ${hasActiveFilters
71
67
  ? "border-primary bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300"
@@ -69,7 +69,6 @@ export function ReviewsIndexListing({ initialData, variant = "public", }) {
69
69
  activeFilterCount > 0;
70
70
  const commitSearch = useCallback(() => {
71
71
  table.set("q", searchInput.trim());
72
- table.setPage(1);
73
72
  }, [searchInput, table]);
74
73
  const { reviews, total, totalPages, isLoading } = useReviews({
75
74
  q: table.get("q") || undefined,
@@ -74,7 +74,6 @@ export function StoresIndexListing({ initialData }) {
74
74
  activeFilterCount > 0;
75
75
  const commitSearch = useCallback(() => {
76
76
  table.set("q", searchInput.trim());
77
- table.setPage(1);
78
77
  }, [searchInput, table]);
79
78
  // Build sieve filters from applied URL params
80
79
  const ratingRaw = table.get("rating");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "2.7.7",
3
+ "version": "2.7.9",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"