@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.
- package/CHANGELOG.md +59 -0
- package/dist/actions.json +42 -0
- package/dist/catalog.json +731 -16
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/components.d.ts +9 -4
- package/dist/components.js +11 -6
- package/dist/content-types.json +300 -0
- package/dist/core/dist/define-component.d.ts +6 -1
- package/dist/docs/account-entry-point.md +4 -4
- package/dist/docs/account-menu.md +2 -2
- package/dist/docs/account-saved-cards.md +301 -0
- package/dist/docs/binding-switcher.md +154 -0
- package/dist/docs/card-entry.md +3 -3
- package/dist/docs/card-summary.md +175 -0
- package/dist/docs/cart-destination.md +238 -0
- package/dist/docs/cart-item.md +21 -3
- package/dist/docs/cart-totalizer.md +1 -1
- package/dist/docs/cart.md +118 -11
- package/dist/docs/footer-social.md +1 -1
- package/dist/docs/free-shipping-progress.md +13 -9
- package/dist/docs/incentives.md +2 -2
- package/dist/docs/logo.md +1 -1
- package/dist/docs/payment-method-badges.md +2 -2
- package/dist/docs/payment-methods.md +1 -1
- package/dist/docs/product-information.md +2 -2
- package/dist/docs/product-shelf.md +7 -0
- package/dist/docs/select.md +3 -4
- package/dist/docs/sign-in-redirect.md +1 -1
- package/dist/docs/toast.md +30 -12
- package/dist/index.d.ts +2 -1
- package/dist/internal/client.d.ts +4 -1
- package/dist/internal/client.js +4 -1
- package/dist/internal/server.d.ts +4 -2
- package/dist/internal/server.js +4 -2
- package/dist/matter/account-saved-cards/account-saved-cards.d.ts +383 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js +956 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
- package/dist/matter/billing-address/billing-address.js.map +1 -1
- package/dist/matter/cart/cart-namespace.d.ts +5 -1
- package/dist/matter/cart/cart-namespace.js +5 -1
- package/dist/matter/cart/cart-namespace.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +34 -4
- package/dist/matter/cart/cart.js +238 -28
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-destination/cart-destination.d.ts +222 -0
- package/dist/matter/cart-destination/cart-destination.js +613 -0
- package/dist/matter/cart-destination/cart-destination.js.map +1 -0
- package/dist/matter/cart-item/cart-item.d.ts +4 -2
- package/dist/matter/cart-item/cart-item.js +75 -16
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/cart-totalizer/cart-totalizer.js +3 -2
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +6 -3
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +76 -33
- package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
- package/dist/matter/pricing/pricing.js.map +1 -1
- package/dist/matter/product-shelf/product-shelf.d.ts +7 -0
- package/dist/matter/product-shelf/product-shelf.js +115 -1
- package/dist/matter/product-shelf/product-shelf.js.map +1 -1
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.js +6 -2
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/particles/binding-switcher/binding-switcher.d.ts +38 -0
- package/dist/particles/binding-switcher/binding-switcher.js +183 -0
- package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
- package/dist/particles/card-summary/card-network.d.ts +17 -0
- package/dist/particles/card-summary/card-network.js +25 -0
- package/dist/particles/card-summary/card-network.js.map +1 -0
- package/dist/particles/card-summary/card-summary.d.ts +83 -0
- package/dist/particles/card-summary/card-summary.js +188 -0
- package/dist/particles/card-summary/card-summary.js.map +1 -0
- package/dist/particles/footer-social/footer-social.d.ts +1 -1
- package/dist/particles/footer-social/footer-social.js +1 -1
- package/dist/particles/footer-social/footer-social.js.map +1 -1
- package/dist/particles/incentives/incentives.d.ts +1 -1
- package/dist/particles/incentives/incentives.js +1 -1
- package/dist/particles/incentives/incentives.js.map +1 -1
- package/dist/particles/payment-methods/payment-methods.d.ts +1 -1
- package/dist/particles/payment-methods/payment-methods.js +1 -1
- package/dist/particles/payment-methods/payment-methods.js.map +1 -1
- package/dist/particles/toast/toast.d.ts +20 -6
- package/dist/particles/toast/toast.js +49 -7
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +298 -34
- package/dist/sdk/actions/index.d.ts +3 -1
- package/dist/sdk/actions/index.js +3 -1
- package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
- package/dist/sdk/actions/locale-action-provider.js +20 -0
- package/dist/sdk/actions/locale-action-provider.js.map +1 -0
- package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
- package/dist/sdk/actions/saved-card-action-provider.js +16 -0
- package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +6 -2
- package/dist/sdk/cache/storefront-cache.js +2 -1
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- package/dist/sdk/cart/operations.d.ts +2 -1
- package/dist/sdk/cart/operations.js +55 -1
- package/dist/sdk/cart/operations.js.map +1 -1
- package/dist/sdk/cart/optimistic.d.ts +30 -7
- package/dist/sdk/cart/optimistic.js +78 -41
- package/dist/sdk/cart/optimistic.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
- package/dist/sdk/cart/use-cart-actions.js +61 -15
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
- package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
- package/dist/sdk/generated/gql.js +15 -11
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +177 -46
- package/dist/sdk/generated/graphql.js +2314 -93
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/messages/en-US.js +19 -0
- package/dist/sdk/i18n/messages/en-US.json +19 -0
- package/dist/sdk/i18n/messages/en-US.json.d.ts +19 -0
- package/dist/sdk/i18n/messages/es-ES.js +19 -0
- package/dist/sdk/i18n/messages/es-ES.json +19 -0
- package/dist/sdk/i18n/messages/pt-BR.js +19 -0
- package/dist/sdk/i18n/messages/pt-BR.json +19 -0
- package/dist/sdk/i18n/provider.js +1 -1
- package/dist/sdk/i18n/provider.js.map +1 -1
- package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
- package/dist/sdk/locale/binding-switch-provider.js +20 -0
- package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
- package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
- package/dist/sdk/locale/use-locale-actions.js +70 -0
- package/dist/sdk/locale/use-locale-actions.js.map +1 -0
- package/dist/sdk/navigation/binding-switch.d.ts +39 -0
- package/dist/sdk/navigation/binding-switch.js +129 -0
- package/dist/sdk/navigation/binding-switch.js.map +1 -0
- package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
- package/dist/sdk/navigation/decode-route-params.js +32 -0
- package/dist/sdk/navigation/decode-route-params.js.map +1 -0
- package/dist/sdk/saved-cards/operations.d.ts +16 -0
- package/dist/sdk/saved-cards/operations.js +41 -0
- package/dist/sdk/saved-cards/operations.js.map +1 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
- package/dist/sdk/seo/page-alternates.d.ts +5 -3
- package/dist/sdk/seo/page-alternates.js +7 -12
- package/dist/sdk/seo/page-alternates.js.map +1 -1
- package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
- package/dist/sdk/shipping/shipping-operations.js +13 -0
- package/dist/sdk/shipping/shipping-operations.js.map +1 -1
- package/dist/sdk/state/cart.d.ts +9 -2
- package/dist/sdk/state/cart.js +9 -2
- package/dist/sdk/state/cart.js.map +1 -1
- package/package.json +2 -2
- 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).",
|