@shop-on/theme-runtime 0.9.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.
Files changed (71) hide show
  1. package/dist/badge-tags.d.ts +1 -3
  2. package/dist/badge-tags.js +1 -2
  3. package/dist/bytes.d.ts +1 -3
  4. package/dist/bytes.js +1 -2
  5. package/dist/cart-note.d.ts +1 -3
  6. package/dist/cart-note.js +1 -2
  7. package/dist/color.d.ts +1 -3
  8. package/dist/color.js +1 -2
  9. package/dist/fonts.d.ts +7 -8
  10. package/dist/fonts.js +20 -9
  11. package/dist/index.d.ts +6 -7
  12. package/dist/index.js +2 -3
  13. package/dist/initials.d.ts +1 -3
  14. package/dist/initials.js +1 -2
  15. package/dist/json-ld-escape.d.ts +1 -3
  16. package/dist/json-ld-escape.js +1 -2
  17. package/dist/line-groups.d.ts +2 -4
  18. package/dist/line-groups.js +1 -2
  19. package/dist/line-item-attributes.d.ts +0 -2
  20. package/dist/line-item-attributes.js +1 -2
  21. package/dist/listing-filters.d.ts +7 -24
  22. package/dist/listing-filters.js +19 -39
  23. package/dist/listing-price.d.ts +1 -3
  24. package/dist/listing-price.js +1 -2
  25. package/dist/money.d.ts +1 -3
  26. package/dist/money.js +1 -2
  27. package/dist/parse-embed-url.d.ts +1 -3
  28. package/dist/parse-embed-url.js +1 -2
  29. package/dist/playable-video.d.ts +1 -3
  30. package/dist/playable-video.js +1 -2
  31. package/dist/product-href.d.ts +1 -3
  32. package/dist/product-href.js +1 -2
  33. package/dist/product-variants/build-availability-index.d.ts +1 -3
  34. package/dist/product-variants/build-availability-index.js +1 -2
  35. package/dist/product-variants/build-variant-state.d.ts +1 -3
  36. package/dist/product-variants/build-variant-state.js +1 -2
  37. package/dist/product-variants/find-closest-variant.d.ts +1 -3
  38. package/dist/product-variants/find-closest-variant.js +1 -2
  39. package/dist/product-variants/index.d.ts +2 -2
  40. package/dist/product-variants/index.js +1 -1
  41. package/dist/product-variants/is-default-single-variant.d.ts +1 -3
  42. package/dist/product-variants/is-default-single-variant.js +1 -2
  43. package/dist/product-variants/is-variant-selectable.d.ts +1 -3
  44. package/dist/product-variants/is-variant-selectable.js +1 -2
  45. package/dist/product-variants/resolve-selected-variant.d.ts +1 -3
  46. package/dist/product-variants/resolve-selected-variant.js +1 -2
  47. package/dist/product-variants/selection-key.d.ts +1 -3
  48. package/dist/product-variants/selection-key.js +1 -2
  49. package/dist/product-variants/stale-variant.d.ts +1 -3
  50. package/dist/product-variants/stale-variant.js +1 -2
  51. package/dist/product-variants/swatch-source.d.ts +4 -4
  52. package/dist/product-variants/swatch-source.js +9 -13
  53. package/dist/product-variants/types.d.ts +8 -17
  54. package/dist/product-variants/variant-price-range.d.ts +1 -3
  55. package/dist/product-variants/variant-price-range.js +1 -2
  56. package/dist/richtext.d.ts +1 -3
  57. package/dist/richtext.js +10 -10
  58. package/dist/sale.d.ts +1 -3
  59. package/dist/sale.js +1 -2
  60. package/dist/seo.d.ts +13 -5
  61. package/dist/seo.js +17 -5
  62. package/dist/strip-handoff-url.d.ts +1 -3
  63. package/dist/strip-handoff-url.js +1 -2
  64. package/dist/template-types.d.ts +1 -3
  65. package/dist/thumbhash.d.ts +1 -3
  66. package/dist/thumbhash.js +1 -2
  67. package/package.json +5 -7
  68. package/dist/cart-discounts.d.ts +0 -16
  69. package/dist/cart-discounts.js +0 -21
  70. package/dist/page-cursor.d.ts +0 -20
  71. package/dist/page-cursor.js +0 -24
@@ -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 };