@vtex/faststore 0.0.8 → 0.0.10

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 (151) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/actions.json +42 -0
  3. package/dist/catalog.json +731 -16
  4. package/dist/cli/index.js +1 -1
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/components.d.ts +9 -4
  7. package/dist/components.js +11 -6
  8. package/dist/content-types.json +300 -0
  9. package/dist/core/dist/define-component.d.ts +6 -1
  10. package/dist/docs/account-entry-point.md +4 -4
  11. package/dist/docs/account-menu.md +2 -2
  12. package/dist/docs/account-saved-cards.md +301 -0
  13. package/dist/docs/binding-switcher.md +154 -0
  14. package/dist/docs/card-entry.md +3 -3
  15. package/dist/docs/card-summary.md +175 -0
  16. package/dist/docs/cart-destination.md +238 -0
  17. package/dist/docs/cart-item.md +21 -3
  18. package/dist/docs/cart-totalizer.md +1 -1
  19. package/dist/docs/cart.md +118 -11
  20. package/dist/docs/footer-social.md +1 -1
  21. package/dist/docs/free-shipping-progress.md +13 -9
  22. package/dist/docs/incentives.md +2 -2
  23. package/dist/docs/logo.md +1 -1
  24. package/dist/docs/payment-method-badges.md +2 -2
  25. package/dist/docs/payment-methods.md +1 -1
  26. package/dist/docs/product-information.md +2 -2
  27. package/dist/docs/product-shelf.md +7 -0
  28. package/dist/docs/select.md +3 -4
  29. package/dist/docs/sign-in-redirect.md +1 -1
  30. package/dist/docs/toast.md +30 -12
  31. package/dist/index.d.ts +2 -1
  32. package/dist/internal/client.d.ts +4 -1
  33. package/dist/internal/client.js +4 -1
  34. package/dist/internal/server.d.ts +4 -2
  35. package/dist/internal/server.js +4 -2
  36. package/dist/matter/account-saved-cards/account-saved-cards.d.ts +383 -0
  37. package/dist/matter/account-saved-cards/account-saved-cards.js +956 -0
  38. package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
  39. package/dist/matter/billing-address/billing-address.js.map +1 -1
  40. package/dist/matter/cart/cart-namespace.d.ts +5 -1
  41. package/dist/matter/cart/cart-namespace.js +5 -1
  42. package/dist/matter/cart/cart-namespace.js.map +1 -1
  43. package/dist/matter/cart/cart.d.ts +34 -4
  44. package/dist/matter/cart/cart.js +238 -28
  45. package/dist/matter/cart/cart.js.map +1 -1
  46. package/dist/matter/cart-destination/cart-destination.d.ts +222 -0
  47. package/dist/matter/cart-destination/cart-destination.js +613 -0
  48. package/dist/matter/cart-destination/cart-destination.js.map +1 -0
  49. package/dist/matter/cart-item/cart-item.d.ts +4 -2
  50. package/dist/matter/cart-item/cart-item.js +75 -16
  51. package/dist/matter/cart-item/cart-item.js.map +1 -1
  52. package/dist/matter/cart-totalizer/cart-totalizer.js +3 -2
  53. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
  54. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +6 -3
  55. package/dist/matter/free-shipping-progress/free-shipping-progress.js +76 -33
  56. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
  57. package/dist/matter/pricing/pricing.js.map +1 -1
  58. package/dist/matter/product-shelf/product-shelf.d.ts +7 -0
  59. package/dist/matter/product-shelf/product-shelf.js +115 -1
  60. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  61. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  62. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +1 -1
  63. package/dist/matter/shipping-simulator/shipping-simulator.js +6 -2
  64. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  65. package/dist/particles/binding-switcher/binding-switcher.d.ts +38 -0
  66. package/dist/particles/binding-switcher/binding-switcher.js +183 -0
  67. package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
  68. package/dist/particles/card-summary/card-network.d.ts +17 -0
  69. package/dist/particles/card-summary/card-network.js +25 -0
  70. package/dist/particles/card-summary/card-network.js.map +1 -0
  71. package/dist/particles/card-summary/card-summary.d.ts +83 -0
  72. package/dist/particles/card-summary/card-summary.js +188 -0
  73. package/dist/particles/card-summary/card-summary.js.map +1 -0
  74. package/dist/particles/footer-social/footer-social.d.ts +1 -1
  75. package/dist/particles/footer-social/footer-social.js +1 -1
  76. package/dist/particles/footer-social/footer-social.js.map +1 -1
  77. package/dist/particles/incentives/incentives.d.ts +1 -1
  78. package/dist/particles/incentives/incentives.js +1 -1
  79. package/dist/particles/incentives/incentives.js.map +1 -1
  80. package/dist/particles/payment-methods/payment-methods.d.ts +1 -1
  81. package/dist/particles/payment-methods/payment-methods.js +1 -1
  82. package/dist/particles/payment-methods/payment-methods.js.map +1 -1
  83. package/dist/particles/toast/toast.d.ts +20 -6
  84. package/dist/particles/toast/toast.js +49 -7
  85. package/dist/particles/toast/toast.js.map +1 -1
  86. package/dist/schema.graphql +298 -34
  87. package/dist/sdk/actions/index.d.ts +3 -1
  88. package/dist/sdk/actions/index.js +3 -1
  89. package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
  90. package/dist/sdk/actions/locale-action-provider.js +20 -0
  91. package/dist/sdk/actions/locale-action-provider.js.map +1 -0
  92. package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
  93. package/dist/sdk/actions/saved-card-action-provider.js +16 -0
  94. package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
  95. package/dist/sdk/actions/types.d.ts +6 -2
  96. package/dist/sdk/cache/storefront-cache.js +2 -1
  97. package/dist/sdk/cache/storefront-cache.js.map +1 -1
  98. package/dist/sdk/cart/operations.d.ts +2 -1
  99. package/dist/sdk/cart/operations.js +55 -1
  100. package/dist/sdk/cart/operations.js.map +1 -1
  101. package/dist/sdk/cart/optimistic.d.ts +30 -7
  102. package/dist/sdk/cart/optimistic.js +78 -41
  103. package/dist/sdk/cart/optimistic.js.map +1 -1
  104. package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
  105. package/dist/sdk/cart/use-cart-actions.js +61 -15
  106. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  107. package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
  108. package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
  109. package/dist/sdk/generated/gql.js +15 -11
  110. package/dist/sdk/generated/gql.js.map +1 -1
  111. package/dist/sdk/generated/graphql.d.ts +177 -46
  112. package/dist/sdk/generated/graphql.js +2314 -93
  113. package/dist/sdk/generated/graphql.js.map +1 -1
  114. package/dist/sdk/i18n/messages/en-US.js +19 -0
  115. package/dist/sdk/i18n/messages/en-US.json +19 -0
  116. package/dist/sdk/i18n/messages/en-US.json.d.ts +19 -0
  117. package/dist/sdk/i18n/messages/es-ES.js +19 -0
  118. package/dist/sdk/i18n/messages/es-ES.json +19 -0
  119. package/dist/sdk/i18n/messages/pt-BR.js +19 -0
  120. package/dist/sdk/i18n/messages/pt-BR.json +19 -0
  121. package/dist/sdk/i18n/provider.js +1 -1
  122. package/dist/sdk/i18n/provider.js.map +1 -1
  123. package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
  124. package/dist/sdk/locale/binding-switch-provider.js +20 -0
  125. package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
  126. package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
  127. package/dist/sdk/locale/use-locale-actions.js +70 -0
  128. package/dist/sdk/locale/use-locale-actions.js.map +1 -0
  129. package/dist/sdk/navigation/binding-switch.d.ts +39 -0
  130. package/dist/sdk/navigation/binding-switch.js +129 -0
  131. package/dist/sdk/navigation/binding-switch.js.map +1 -0
  132. package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
  133. package/dist/sdk/navigation/decode-route-params.js +32 -0
  134. package/dist/sdk/navigation/decode-route-params.js.map +1 -0
  135. package/dist/sdk/saved-cards/operations.d.ts +16 -0
  136. package/dist/sdk/saved-cards/operations.js +41 -0
  137. package/dist/sdk/saved-cards/operations.js.map +1 -0
  138. package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
  139. package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
  140. package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
  141. package/dist/sdk/seo/page-alternates.d.ts +5 -3
  142. package/dist/sdk/seo/page-alternates.js +7 -12
  143. package/dist/sdk/seo/page-alternates.js.map +1 -1
  144. package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
  145. package/dist/sdk/shipping/shipping-operations.js +13 -0
  146. package/dist/sdk/shipping/shipping-operations.js.map +1 -1
  147. package/dist/sdk/state/cart.d.ts +9 -2
  148. package/dist/sdk/state/cart.js +9 -2
  149. package/dist/sdk/state/cart.js.map +1 -1
  150. package/package.json +2 -2
  151. package/src/styles/tailwind.css +1 -2
package/CHANGELOG.md CHANGED
@@ -4,6 +4,65 @@ Every published version of `@vtex/faststore` has a section here. From `0.0.2` on
4
4
  written when its release pull request opens, and reviewed alongside the API delta that justifies the
5
5
  version.
6
6
 
7
+ ## 0.0.10
8
+
9
+ `0.0.9` was never published: its version and changelog landed with the Cart feature, outside a
10
+ release pull request. This is the first release after `0.0.8`, and it carries that change too.
11
+
12
+ **Breaking: cart line writes.** The `cartItemRemove`, `cartItemsRemove`, `cartItemQuantityIncrease`
13
+ and `cartItemQuantityDecrease` mutations now take `lineId` (`lineIds` for `cartItemsRemove`) instead
14
+ of `variantId` (`variantIds`), so a line is addressed by `CartItem.lineId` and two lines of one SKU no
15
+ longer resolve to the first one. `@vtex/faststore` 0.0.2 to 0.0.8 still send `variantId`, so they
16
+ fail on those four writes against the API once it ships. 0.0.10 is the release that fixes it: the
17
+ cart actions read each line's `lineId` and send it. `cartItemAdd` is unchanged.
18
+
19
+ **Changed in `./client` and `./components`.** A money `amount` is a `string`, not a `number`:
20
+ `ShippingOption.price` and `listPrice`, and every price, total and discount value in the cart types.
21
+ Parse it before doing arithmetic. `CartItemEntity` gains `lineId: string`.
22
+
23
+ **Changed in `./components`.** `FreeShippingProgressRootProps.cartTotal` is gone; pass `itemsTotal`.
24
+ `ToastRootProps.toast` is optional, and `ToastRoot` and `CartCount` may render nothing.
25
+ `CartCountProps` gains `templateOne` and `CartCouponFormProps` gains `appliedMessage`.
26
+
27
+ **Changed in `.` and `./components`.** `CartActions` gains `syncSalesChannel`, which moves the cart
28
+ onto the active sales channel. A custom implementation of the whole `CartActions` type must add it;
29
+ an override through `ComponentActions.cart` does not, since that field is partial.
30
+
31
+ **Widened in `.`.** `FetchStrategy` gains `'lazy-on-mount'`: the client fetches the component's data
32
+ when it mounts, outside the page query. `ShippingAddressInput.recipientName` is optional.
33
+ `ComponentActions` gains `locale` and `savedCard`, and `LocaleActions` is exported.
34
+
35
+ **Added to `./components`.** Three groups of components.
36
+ - Cart: the destination block (`CartDestination*`, `useCartDestination`), coupon states
37
+ (`CartCouponEmpty`, `CartCouponSavings`, `CartCouponUnmatched`), `ClearCartButton`,
38
+ `ProductShelfOnMountRoot`, `ToastList` and `useOptionalToast`.
39
+ - Saved cards in My Account: the `AccountSavedCards*` and `AccountSavedCard*` families with their
40
+ hooks, and the `CardSummary*` particle with `cardNetworkIcon`.
41
+ - `BindingSwitcher`, which moves the shopper between the store's bindings, with
42
+ `bindingSwitcherOptions`.
43
+
44
+ **Added to `./client`.** The message catalog gains `fs/card.ending-in` and the `fs/saved-cards.*` ids.
45
+
46
+ `./graphql` and `./cli` have no change.
47
+
48
+ **Changed in `./tailwind.css`.** This is not a snapshotted entry. The theme's `--color-brand` is now
49
+ `--color-primary`, and `--color-brand-light` is gone, so the `brand` and `brand-light` utilities no
50
+ longer exist. A store's theme variables follow the Foundation names: `--color-primary`,
51
+ `--color-secondary`, `--color-neutral`, `--color-surface` and `--font-body` replace `--color-brand`,
52
+ `--color-accent`, `--color-ink` and `--font-family`. `--color-muted` is dropped. No old name has an
53
+ alias.
54
+
55
+ Outside the four entries, this release also carries the Foundation in `sukima`: a store writes one
56
+ version 2 `foundation.json` instead of `global.json`. The CLI takes `--foundation` instead of
57
+ `--global`, and `generate`, `watch` and `dev` take `--account`. The napi option `globalSchemaPath` is
58
+ now `foundationPath`. `generateApp`, `validateProject` and the compilers' `update` take a
59
+ `foundation` instead of a `globalSchema`. Every compile entry point takes an optional `account`.
60
+ The compiler loads only `version: 2`, refuses a key the format does not define, and points a
61
+ typography use at its `next/font` variable when `fonts` loads it under the same role. It
62
+ also carries decoded route params in generated pages, Global bindings inlined in element props, CMS
63
+ publish seeding of composite entries, and the `cartSalesChannelSync` mutation and safer VTEX client
64
+ retries in `storefront-api-core`.
65
+
7
66
  ## 0.0.8
8
67
 
9
68
  **Removed from `./components`.** `OrderPlacedPaymentSummaryData.label` and
package/dist/actions.json CHANGED
@@ -256,6 +256,10 @@
256
256
  "validate": {
257
257
  "description": "Re-check the active cart against the platform and adopt corrected availability (async, read-only upstream).",
258
258
  "payload": []
259
+ },
260
+ "syncSalesChannel": {
261
+ "description": "Moves the active cart onto the request's sales channel and reconciles its locale.",
262
+ "payload": []
259
263
  }
260
264
  }
261
265
  },
@@ -359,6 +363,25 @@
359
363
  }
360
364
  }
361
365
  },
366
+ "locale": {
367
+ "namespace": "locale",
368
+ "description": "Switches the whole binding (locale, currency, sales channel) by a document navigation to the equivalent URL, or to the destination home with a notice.",
369
+ "provider": {
370
+ "name": "LocaleActionProvider",
371
+ "importPath": "@vtex/faststore/internal/client"
372
+ },
373
+ "methods": {
374
+ "set": {
375
+ "description": "Switch to another binding: navigates to the equivalent URL of the current page, or to the destination home with fs_notice=no-equivalent.",
376
+ "payload": [
377
+ {
378
+ "name": "bindingId",
379
+ "type": "string"
380
+ }
381
+ ]
382
+ }
383
+ }
384
+ },
362
385
  "order": {
363
386
  "namespace": "order",
364
387
  "description": "Mutation-backed cancellation of one of the shopper's orders.",
@@ -546,6 +569,25 @@
546
569
  }
547
570
  }
548
571
  },
572
+ "savedCard": {
573
+ "namespace": "savedCard",
574
+ "description": "Mutation-backed writes against the signed-in shopper's saved cards.",
575
+ "provider": {
576
+ "name": "SavedCardActionProvider",
577
+ "importPath": "@vtex/faststore/internal/client"
578
+ },
579
+ "methods": {
580
+ "remove": {
581
+ "description": "Remove one saved card (async strategy). The row stays until the server answers.",
582
+ "payload": [
583
+ {
584
+ "name": "id",
585
+ "type": "string"
586
+ }
587
+ ]
588
+ }
589
+ }
590
+ },
549
591
  "session": {
550
592
  "namespace": "session",
551
593
  "description": "Mutation-backed authentication writes against the VTEX ID session (login, access code, logout).",