@mohasinac/appkit 4.39.1 → 4.40.0
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/countersReconcile.js +21 -0
- package/dist/_internal/server/jobs/core/onProductWrite.js +35 -1
- package/dist/features/categories/components/CategoryDetailPageView.js +17 -5
- package/dist/features/categories/repository/categories.repository.d.ts +65 -1
- package/dist/features/categories/repository/categories.repository.js +245 -77
- package/dist/features/categories/types/index.d.ts +2 -2
- package/dist/features/tester/seed-data/authored/admin__admin-detail-round-trips.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/admin__admin-detail-round-trips.js +145 -0
- package/dist/features/tester/seed-data/authored/admin__firebase-function-effects.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/admin__firebase-function-effects.js +234 -0
- package/dist/features/tester/seed-data/authored/buying__buying-checkout.js +32 -0
- package/dist/features/tester/seed-data/authored/buying__cart.js +60 -0
- package/dist/features/tester/seed-data/authored/buying__order-detail-actions.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/buying__order-detail-actions.js +138 -0
- package/dist/features/tester/seed-data/authored/buying__wishlist-history.js +30 -0
- package/dist/features/tester/seed-data/authored/content-discovery__category-counts-and-rollup.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/content-discovery__category-counts-and-rollup.js +145 -0
- package/dist/features/tester/seed-data/authored/content-discovery__event-detail-subroutes.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/content-discovery__event-detail-subroutes.js +154 -0
- package/dist/features/tester/seed-data/authored/content-discovery__store-reviews-aggregate.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/content-discovery__store-reviews-aggregate.js +88 -0
- package/dist/features/tester/seed-data/authored/index.js +22 -0
- package/dist/features/tester/seed-data/authored/public-pages__help-how-it-works.js +134 -7
- package/dist/features/tester/seed-data/authored/public-pages__help-scams-guides-subpages.js +89 -0
- package/dist/features/tester/seed-data/authored/public-pages__newly-wired-browse-indexes.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/public-pages__newly-wired-browse-indexes.js +141 -0
- package/dist/features/tester/seed-data/authored/public-pages__store-tabs.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/public-pages__store-tabs.js +115 -0
- package/dist/features/tester/seed-data/authored/selling__digital-content-delivery.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/selling__digital-content-delivery.js +148 -0
- package/dist/features/tester/seed-data/authored/selling__listing-edit-roundtrip.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/selling__listing-edit-roundtrip.js +118 -0
- package/dist/features/tester/seed-data/authored/selling__seller-orders-at-scale.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/selling__seller-orders-at-scale.js +69 -0
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +471 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/tabs-overflow.js +30 -7
- package/package.json +1 -1
|
@@ -121,15 +121,38 @@ export function useTabsOverflow(listRef, activeKey) {
|
|
|
121
121
|
}, [measure]);
|
|
122
122
|
/*
|
|
123
123
|
* Keep the selected tab reachable when it starts off-screen in the strip.
|
|
124
|
-
* Keyed on `activeKey` and NOT run every render — an
|
|
125
|
-
*
|
|
126
|
-
*
|
|
124
|
+
* Keyed on `activeKey` and NOT run every render — an unconditional scroll
|
|
125
|
+
* would yank the strip back while the user is mid-scroll, fighting their
|
|
126
|
+
* own input.
|
|
127
|
+
*
|
|
128
|
+
* 🛑 This writes the STRIP's own `scrollLeft`. It must never call
|
|
129
|
+
* `scrollIntoView`, which by definition walks every scrollable ancestor and
|
|
130
|
+
* therefore can move the PAGE. `block: "nearest"` is not a sufficient guard:
|
|
131
|
+
* "nearest" only declines to scroll when the element is ALREADY in the
|
|
132
|
+
* viewport, so on mount a tab bar below the fold still drags the whole
|
|
133
|
+
* document down to meet it. That is exactly what happened on the homepage —
|
|
134
|
+
* the FAQ tab strip sits ~11,000px down, and every cold load of `/` landed
|
|
135
|
+
* the visitor at the WhatsApp section instead of the hero.
|
|
127
136
|
*/
|
|
137
|
+
const didMountRef = useRef(false);
|
|
128
138
|
useEffect(() => {
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
//
|
|
132
|
-
|
|
139
|
+
const el = listRef.current;
|
|
140
|
+
const active = el?.querySelector('[aria-selected="true"]');
|
|
141
|
+
// Mount is not a tab CHANGE. The initial active tab is wherever the strip
|
|
142
|
+
// already renders it, so there is nothing to bring into view — and doing
|
|
143
|
+
// it anyway is what made this a page-scroll bug rather than a strip one.
|
|
144
|
+
if (!didMountRef.current) {
|
|
145
|
+
didMountRef.current = true;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (!el || !active)
|
|
149
|
+
return;
|
|
150
|
+
// Nothing to do when the strip does not overflow; `scrollLeft` would be a
|
|
151
|
+
// no-op anyway, but skipping avoids a pointless layout read.
|
|
152
|
+
if (el.scrollWidth <= el.clientWidth + EPSILON)
|
|
153
|
+
return;
|
|
154
|
+
const target = active.offsetLeft - (el.clientWidth - active.offsetWidth) / 2;
|
|
155
|
+
el.scrollLeft = Math.max(0, Math.min(target, el.scrollWidth - el.clientWidth));
|
|
133
156
|
}, [listRef, activeKey]);
|
|
134
157
|
const scrollByPage = useCallback((direction) => {
|
|
135
158
|
const el = listRef.current;
|