@shop-on/theme-runtime 0.10.0 → 0.11.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/badge-tags.d.ts +1 -3
- package/dist/badge-tags.js +1 -2
- package/dist/bytes.d.ts +1 -3
- package/dist/bytes.js +1 -2
- package/dist/cart-note.d.ts +1 -3
- package/dist/cart-note.js +1 -2
- package/dist/color.d.ts +1 -3
- package/dist/color.js +1 -2
- package/dist/fonts.d.ts +7 -8
- package/dist/fonts.js +20 -9
- package/dist/index.d.ts +6 -7
- package/dist/index.js +2 -3
- package/dist/initials.d.ts +1 -3
- package/dist/initials.js +1 -2
- package/dist/json-ld-escape.d.ts +1 -3
- package/dist/json-ld-escape.js +1 -2
- package/dist/line-groups.d.ts +2 -4
- package/dist/line-groups.js +1 -2
- package/dist/line-item-attributes.d.ts +0 -2
- package/dist/line-item-attributes.js +1 -2
- package/dist/listing-filters.d.ts +7 -24
- package/dist/listing-filters.js +19 -39
- package/dist/listing-price.d.ts +1 -3
- package/dist/listing-price.js +1 -2
- package/dist/money.d.ts +1 -3
- package/dist/money.js +1 -2
- package/dist/parse-embed-url.d.ts +1 -3
- package/dist/parse-embed-url.js +1 -2
- package/dist/playable-video.d.ts +1 -3
- package/dist/playable-video.js +1 -2
- package/dist/product-href.d.ts +1 -3
- package/dist/product-href.js +1 -2
- package/dist/product-variants/build-availability-index.d.ts +1 -3
- package/dist/product-variants/build-availability-index.js +1 -2
- package/dist/product-variants/build-variant-state.d.ts +1 -3
- package/dist/product-variants/build-variant-state.js +1 -2
- package/dist/product-variants/find-closest-variant.d.ts +1 -3
- package/dist/product-variants/find-closest-variant.js +1 -2
- package/dist/product-variants/index.d.ts +2 -2
- package/dist/product-variants/index.js +1 -1
- package/dist/product-variants/is-default-single-variant.d.ts +1 -3
- package/dist/product-variants/is-default-single-variant.js +1 -2
- package/dist/product-variants/is-variant-selectable.d.ts +1 -3
- package/dist/product-variants/is-variant-selectable.js +1 -2
- package/dist/product-variants/resolve-selected-variant.d.ts +1 -3
- package/dist/product-variants/resolve-selected-variant.js +1 -2
- package/dist/product-variants/selection-key.d.ts +1 -3
- package/dist/product-variants/selection-key.js +1 -2
- package/dist/product-variants/stale-variant.d.ts +1 -3
- package/dist/product-variants/stale-variant.js +1 -2
- package/dist/product-variants/swatch-source.d.ts +4 -4
- package/dist/product-variants/swatch-source.js +9 -13
- package/dist/product-variants/types.d.ts +8 -17
- package/dist/product-variants/variant-price-range.d.ts +1 -3
- package/dist/product-variants/variant-price-range.js +1 -2
- package/dist/richtext.d.ts +1 -3
- package/dist/richtext.js +10 -10
- package/dist/sale.d.ts +1 -3
- package/dist/sale.js +1 -2
- package/dist/seo.d.ts +13 -5
- package/dist/seo.js +17 -5
- package/dist/strip-handoff-url.d.ts +1 -3
- package/dist/strip-handoff-url.js +1 -2
- package/dist/template-types.d.ts +1 -3
- package/dist/thumbhash.d.ts +1 -3
- package/dist/thumbhash.js +1 -2
- package/package.json +5 -7
- package/dist/cart-discounts.d.ts +0 -16
- package/dist/cart-discounts.js +0 -21
- package/dist/page-cursor.d.ts +0 -20
- package/dist/page-cursor.js +0 -24
package/dist/page-cursor.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//#region src/page-cursor.ts
|
|
2
|
-
/**
|
|
3
|
-
* The `after` cursor that skips straight to page N of a listing.
|
|
4
|
-
*
|
|
5
|
-
* `?page=` is a number in the URL because that is what a buyer and a crawler can
|
|
6
|
-
* both read, but the API speaks cursors — so the number is translated here
|
|
7
|
-
* rather than by walking the connection a page at a time.
|
|
8
|
-
*
|
|
9
|
-
* INTERNAL-MONOREPO CONTRACT: apps/api runs graphql-ruby with NO custom
|
|
10
|
-
* `cursor_encoder`, so connections use the built-in `Base64Encoder` and
|
|
11
|
-
* `RelationConnection#cursor_for` emits `base64url(no padding)` of the item's
|
|
12
|
-
* 1-based offset. Skipping `(page-1)*perPage` rows therefore means an `after` of
|
|
13
|
-
* `base64url((page-1)*perPage)`. Regression check: `grep -r cursor_encoder
|
|
14
|
-
* apps/api` must stay empty. Page 1 needs no cursor at all.
|
|
15
|
-
*
|
|
16
|
-
* `btoa` is a global in Node ≥ 18 and in browsers; the input is always a decimal
|
|
17
|
-
* ASCII string, so it is safe.
|
|
18
|
-
*/
|
|
19
|
-
function pageCursor(page, perPage) {
|
|
20
|
-
const offset = Math.max(0, (page - 1) * perPage);
|
|
21
|
-
return btoa(String(offset)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
export { pageCursor };
|