@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.
Files changed (39) hide show
  1. package/dist/_internal/server/jobs/core/countersReconcile.js +21 -0
  2. package/dist/_internal/server/jobs/core/onProductWrite.js +35 -1
  3. package/dist/features/categories/components/CategoryDetailPageView.js +17 -5
  4. package/dist/features/categories/repository/categories.repository.d.ts +65 -1
  5. package/dist/features/categories/repository/categories.repository.js +245 -77
  6. package/dist/features/categories/types/index.d.ts +2 -2
  7. package/dist/features/tester/seed-data/authored/admin__admin-detail-round-trips.d.ts +2 -0
  8. package/dist/features/tester/seed-data/authored/admin__admin-detail-round-trips.js +145 -0
  9. package/dist/features/tester/seed-data/authored/admin__firebase-function-effects.d.ts +2 -0
  10. package/dist/features/tester/seed-data/authored/admin__firebase-function-effects.js +234 -0
  11. package/dist/features/tester/seed-data/authored/buying__buying-checkout.js +32 -0
  12. package/dist/features/tester/seed-data/authored/buying__cart.js +60 -0
  13. package/dist/features/tester/seed-data/authored/buying__order-detail-actions.d.ts +2 -0
  14. package/dist/features/tester/seed-data/authored/buying__order-detail-actions.js +138 -0
  15. package/dist/features/tester/seed-data/authored/buying__wishlist-history.js +30 -0
  16. package/dist/features/tester/seed-data/authored/content-discovery__category-counts-and-rollup.d.ts +2 -0
  17. package/dist/features/tester/seed-data/authored/content-discovery__category-counts-and-rollup.js +145 -0
  18. package/dist/features/tester/seed-data/authored/content-discovery__event-detail-subroutes.d.ts +2 -0
  19. package/dist/features/tester/seed-data/authored/content-discovery__event-detail-subroutes.js +154 -0
  20. package/dist/features/tester/seed-data/authored/content-discovery__store-reviews-aggregate.d.ts +2 -0
  21. package/dist/features/tester/seed-data/authored/content-discovery__store-reviews-aggregate.js +88 -0
  22. package/dist/features/tester/seed-data/authored/index.js +22 -0
  23. package/dist/features/tester/seed-data/authored/public-pages__help-how-it-works.js +134 -7
  24. package/dist/features/tester/seed-data/authored/public-pages__help-scams-guides-subpages.js +89 -0
  25. package/dist/features/tester/seed-data/authored/public-pages__newly-wired-browse-indexes.d.ts +2 -0
  26. package/dist/features/tester/seed-data/authored/public-pages__newly-wired-browse-indexes.js +141 -0
  27. package/dist/features/tester/seed-data/authored/public-pages__store-tabs.d.ts +2 -0
  28. package/dist/features/tester/seed-data/authored/public-pages__store-tabs.js +115 -0
  29. package/dist/features/tester/seed-data/authored/selling__digital-content-delivery.d.ts +2 -0
  30. package/dist/features/tester/seed-data/authored/selling__digital-content-delivery.js +148 -0
  31. package/dist/features/tester/seed-data/authored/selling__listing-edit-roundtrip.d.ts +2 -0
  32. package/dist/features/tester/seed-data/authored/selling__listing-edit-roundtrip.js +118 -0
  33. package/dist/features/tester/seed-data/authored/selling__seller-orders-at-scale.d.ts +2 -0
  34. package/dist/features/tester/seed-data/authored/selling__seller-orders-at-scale.js +69 -0
  35. package/dist/features/tester/seed-data/tester-checklist-seed-data.js +471 -0
  36. package/dist/styles.css +1 -1
  37. package/dist/tailwind-utilities.css +1 -1
  38. package/dist/ui/components/tabs-overflow.js +30 -7
  39. 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
- * unconditional scrollIntoView would yank the strip back while the user is
126
- * mid-scroll, fighting their own input.
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 active = listRef.current?.querySelector('[aria-selected="true"]');
130
- // `block: "nearest"` is essential — the default "start" scrolls the whole
131
- // PAGE vertically whenever a tab bar sits below the fold.
132
- active?.scrollIntoView?.({ block: "nearest", inline: "nearest" });
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "4.39.1",
3
+ "version": "4.40.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"