Skip to content

Latest commit

 

History

History
363 lines (201 loc) · 15.2 KB

File metadata and controls

363 lines (201 loc) · 15.2 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

Added

  • pickup-point-selector now registers itself into the DeliveryPromiseContext uiRegistry (pickupPoint entry) on mount and unregisters on unmount, matching shopper-location-setter and shipping-method-selector. This lets consumers (e.g. vtex.search-result) detect that a delivery-promise block is present.

[1.4.0] - 2026-07-14

Changed

  • Postal code input now supports alphanumeric formats for international markets (Canada, Argentina) with country-specific masks for BR, MX, AR, CL, CO, PE, US, CA, ES, IT, and FR.

Fixed

  • Fixed SSR crash in getCountryCode when atob is unavailable in the render-server environment.

[1.3.1] - 2026-07-08

Added

  • CSS handles for UnavailableItemsModal, AddLocation, and ProductItem components to enable theme customization.

[1.3.0] - 2026-07-08

Added

  • clearButton and updateButton CSS handles on the pickup point list so merchants can style the Clear and Update buttons independently (previously only the shared updateButtonContainer was available).

Changed

  • Pickup point selection now requires explicit Clear button instead of clicking the selected point to unselect.
  • Clearing a selected pickup point now dispatches RESET_FULFILLMENT_METHOD (via a new onClearPickup handler) instead of re-dispatching UPDATE_PICKUP. This skips the delivery-promises BFF availability check on clear — clearing only broadens availability, so there is nothing to validate — resulting in a faster clear path with the same session cleanup.
  • Added bottom padding to the pickup point list when the floating action bar is visible so the last item scrolls fully clear of the Clear / Update buttons.

Fixed

  • pickup-point-selector modal now closes automatically after a pickup is selected or cleared. Previously only shipping-method-selector closed itself when the soft-refresh feature landed; the standalone pickup-point-selector was missing the same wiring, leaving the modal open until the shopper dismissed it manually.

[1.2.0] - 2026-06-30

Changed

  • Replace the full-page reload after zipcode / pickup / shipping-method session writes with a targeted soft refresh that refetches only the segment-dependent storefront queries (resetting search pagination to the first page through render-runtime), updates the fulfillment selection optimistically with rollback on a failed session write, closes the shipping-method modal, and falls back to location.reload() when Apollo is unavailable.

[1.1.4] - 2026-06-11

Deprecated

  • docs/AvailabilityBadges.md: separate documentation file is deprecated in favor of inline documentation in docs/README.md. The file remains with a deprecation notice but is no longer referenced in navigation.

[1.1.3] - 2026-06-05

Changed

  • UPDATE_ZIPCODE dispatch: the postal code is now resolved once at the dispatch entry point (single getAddress call) and the resolved address is threaded through the cart-availability check and submitZipcode. getAddress failures and empty geoCoordinates now fail fast as INVALID_POSTAL_CODE without invoking the BFF availability call.
  • submitZipcode: runs getCatalogCount, updateOrderForm and getPickups in parallel using Promise.all. getCatalogCount keeps its UX gate (zero results still surfaces products-not-found-error); updateOrderForm failures are best-effort (logged and continued); getPickups failures degrade gracefully to no active pickups. The two POST /api/sessions writes that previously happened during a zipcode submission are coalesced into a single write that already carries the resolved pickup (or undefined when there are no active pickups, when getPickups rejects, or when salesChannel is still loading and pickup fetching is deferred).
  • validateCartItems: skips the delivery-promises-bff/availability call entirely when the cart is empty, avoiding an unnecessary network round trip for the common header-flow scenario.

[1.1.2] - 2026-05-26

Fixed

  • ShopperLocationSetter / PickupPointSelector button wrappers: left padding was 0 while top, right, and bottom were at Tachyons scale 4. Replaced pt4 pr4 pb4 pl0 with the uniform shorthand pa4, matching the existing behaviour of ShippingMethodSelector. CSS handle names are unchanged; theme overrides on shopperLocationSetterButtonWrapper and pickupPointSelectorButtonWrapper continue to work.

[1.1.1] - 2026-04-27

Added

  • ShopperLocationDetectorButton (via shopper-location-setter / showLocationDetectorButton): after the delivery-promise context finishes its initial load, if there is no postal code yet, the control once requests browser geolocation, reverse-geocodes to a postal code, and dispatches UPDATE_ZIPCODE. Manual “use my location” still works after errors. Waits for isLoading to become false so session or facet postal codes are respected before prompting.

Changed

  • CLEAR_ZIPCODE + location detector: dispatching CLEAR_ZIPCODE sets a session flag before the reload so the detector does not run automatic geolocation again on the next paint. The flag is cleared when a postal code is successfully applied through submitZipcode (including before any success location.reload()), so later clears can set it again.

[1.1.0] - 2026-04-08

[1.0.0] - 2026-04-08

Breaking changes

  • Store Framework: removed the monolithic delivery-promise-location-selector interface. Themes must declare the split blocks instead: shopper-location-setter, shipping-method-selector, and pickup-point-selector (each with its own React entry point). There is no bundled legacy block or in-repo migration guide from the old block to the new ones—only the new contract is supported.
  • Assumption: at most one mounted instance of each block type in the theme. The context keeps a single registration per type (no ref counting); the last mount wins if duplicates exist.

Added

  • shopper-location-setter block: postal code UI—non-dismissible modal when required is true, popover flow when required is false; props mode (default | icon) and showLocationDetectorButton (geolocation control; only on this block).
  • shipping-method-selector block: delivery vs pickup after a postal code exists; props required, mode, and shippingSelection (delivery-and-pickup | only-pickup). When required is true and there is no deliveryPromiseMethod, the shipping-method modal is non-dismissible until the shopper chooses a method.
  • pickup-point-selector block: pickup point selection; prop mode only (no required in this version).
  • Delivery promise context — UI registry: blocks register on mount via REGISTER_SHOPPER_LOCATION_BLOCK / UNREGISTER_SHOPPER_LOCATION_BLOCK and REGISTER_SHIPPING_METHOD_BLOCK / UNREGISTER_SHIPPING_METHOD_BLOCK, each passing { required: boolean }. Exposed on state as uiRegistry.
  • Cross-block shipping-method modal: REQUEST_OPEN_SHIPPING_METHOD_MODAL and state field shippingMethodModalRequestId so the method modal can open from context when the postal code control and the method control are sibling blocks (not the same React subtree).
  • UnavailableItemsModal: rendered once in DeliveryPromiseProviderCore, bound to shared context state; individual blocks do not mount their own copy.
  • README (docs/README.md): blocks list, theme example, reload policy, registry, modal-request flow, CEP → method rules when both required are true vs optional CEP + required method, and global overlays.
  • Tests: uiRegistry register/unregister; effectiveReload / shippingMethodModalRequestId combinations (required shipping with optional vs required location); nonDismissibleModal on shipping-method-selector.
  • PickupModalPresentational: root React export wrapping the presentational pickup modal UI for apps (for example search-result) that control zip/pickup outside global context.
  • pickupSearchClient / pickupInPointPreference: helpers for pickup list fetch and PLP preference storage patterns.
  • Dispatch action CLEAR_ZIPCODE resets navigation context: clears order form shippingData, clears shipping facets via clearShippingSession, and resets related state (then reloads).

Changed

  • PostalCodeModal, context, and useDeliveryPromise adjustments to support controlled flows and shared pickup-fetch behavior with optional integrations.
  • Reload after postal code (submitZipcode / UPDATE_ZIPCODE): when reload is true, location.reload() is skipped if a required shipping-method block is registered (effectiveReload = reload && !shippingMethodRequired). Session and in-memory state still update; reload continues to apply after method selection (and in other flows that already reload). When both location and shipping blocks are required, the hook does not bump shippingMethodModalRequestId on postal-code submit—the location setter requests the method modal only after CEP is valid and its flow has finished, avoiding stacked modals. When shipping is required but location is not, the hook bumps shippingMethodModalRequestId on successful postal-code submit so shipping-method-selector can open immediately.
  • Dispatch action for the delivery shipping method is SELECT_DELIVERY_SHIPPING_OPTION (replaces SELECT_HOME_DELIVERY; same name as vtex.shipping-option-components).
  • Pickup points are loaded via Intelligent Search pickup-point-availability using the session sales channel as trade policy (fallback 1), with vtex.session-client.
  • Cart availability checks call delivery-promises-bff at /api/delivery-promises-bff/availability/* with { items: [{ itemId, productId }] } and read unavailableItemIds from the response.

[0.1.1] - 2026-03-26

Changed

  • React context API renamed from ShippingOption* to DeliveryPromise* (for example DeliveryPromiseProvider, useDeliveryPromiseState, useDeliveryPromiseDispatch). State field shippingOption is now deliveryPromiseMethod. RESET_SHIPPING_OPTION is now RESET_FULFILLMENT_METHOD. Default export component for the location selector block renamed from ShippingOptionZipcode to DeliveryPromiseLocationSelector.

[0.1.0] - 2026-03-26

Breaking changes

Themes and customizations must be updated together; there is no drop-in replacement under the old app id.

  • Dependency: replace vtex.shipping-option-components with vtex.delivery-promise-components (use 0.x until a stable major is published).
  • Store block: rename shipping-option-location-selector to delivery-promise-location-selector in blocks.json / theme JSON (children arrays and block definitions).
  • Translations: all message ids changed from store/shipping-option-components.* to store/delivery-promise-components.* — update any messages overrides or CMS entries that referenced the old ids.

Changed

  • App and package name: shipping-option-componentsdelivery-promise-components
  • Catalog / docs references updated to the new GitHub slug vtex-apps/delivery-promise-components (rename the repository to match when publishing)

Notes

  • Pixel event ids (shipping-option-deliver-to, shipping-option-store, item-added-to-cart-shipping-modal) and the shipping_info cookie name are unchanged for analytics and session continuity

[2.0.2] - 2026-01-27

Changed

  • Updated the Shipping Option Components README

[2.0.0] - 2025-12-11

Changed

  • Shipping method selection is now optional and no longer required after entering postal code
  • Added toggle functionality to deselect shipping methods and return to default state
  • Shipping method modal no longer opens automatically and can be dismissed without selection
  • Removed auto select pickup

[1.11.0] - 2025-12-09

Changed

  • Not forwarding cookies to getCatalogCount anymore
  • Refresh page after zipcode update at segment cookie

[1.10.0] - 2025-10-28

Added

  • Unselect the pickup point in the global filter.

[1.9.0] - 2025-10-09

Added

  • ShopperLocationDetectorButton component to automatically detect

[1.8.0] - 2025-10-06

Added

  • Always add the shippingOption to the session.

[1.7.1] - 2025-10-06

Changed

  • Added a callout about Delivery Promises in README.md.

[1.7.0] - 2025-10-02

Fixed

  • Send zipCode as a string in update orderForm request

[1.6.2] - 2025-09-23

Removed

  • vtex.react-portal and vtex.store-drawer dependencies

Changed

  • React to @16
  • ReactModal compatibility with React 16

Added

  • Docs file for availabilityBadges
  • Tests file for availability Badges

[1.6.1] - 2025-08-04

Changed

  • Updated the app version mentioned in README.md.

[1.6.0] - 2025-07-16

Added

  • Cart products validation.

[1.5.0] - 2025-07-14

Added

  • AvailabilityBadges component to use in ProductSummary.

[1.4.0] - 2025-07-14

Added

  • Validation to verify that the postal code has products available.

[1.3.0] - 2025-06-10

Added

  • Context to share states with other apps
  • Export PickupModal and LocationModal

[1.2.0] - 2025-06-06

Added

  • Popover adjusted to positioning on the page.

[1.1.1] - 2025-05-26

Added

  • Props documentation

[1.1.0] - 2025-05-16

Added

  • Icon mode

[1.0.1] - 2025-04-22

Fixed

  • Dismissible behavior on shipping vs pickup modal
  • Spanish description on shipping vs pickup modal
  • Situation where user get stuck after providing a invalid zipcode.

[1.0.0] - 2025-03-31

Added

  • Major layout adjustments
  • Shipping modal

[0.6.1] - 2025-03-13

Fixed

  • Bad formatting of shipping info cookie

[0.6.0] - 2025-03-07

Added

  • country inside the body facets

[0.5.5] - 2025-02-26

Removed

  • Remove DP variant validation.

[0.5.4] - 2025-01-29

Fixed

  • Missing translations update

[0.5.3] - 2025-01-17

Fixed

  • The selected pickup point does not change due to a problem updating cookie data

[0.5.2] - 2025-01-17

Fixed

  • The hideStoreSelection property removes the Pickup Drawer and it cannot be opened

[0.5.1] - 2024-12-19

Fixed

  • sometimes zip code is not updated due to a problem in __RUNTIME__.segmentToken

[0.5.0] - 2024-12-18

Added

  • Popover to open the location drawer;
  • Popover with input to add postal code.

[0.4.2] - 2024-11-06

Fixed

  • Selected pickup doesn't work on first load

[0.4.1] - 2024-11-01

Fixed

  • Drawer opens behind the sidebar

[0.4.0] - 2024-10-04

Fixed

  • Selected pickup did not change.

[0.3.0] - 2024-10-04

Added

  • Catalan, Czech, Danish, Greek, Finnish, Hungarian, Indonesian, Norwegian, Polish, Russian, Slovak, Slovenian, Swedish and Ukrainian translations.

[0.2.0] - 2024-10-02

Added

  • orderForm integration from PLP to cart

[0.1.2] - 2024-09-12

[0.1.1] - 2024-09-12

[0.1.0] - 2024-09-12

Fixed

  • English, Portuguese and Spanish translations.
  • Crowdin integration file.

Added

  • Bulgharian, German, French, Italian, Japanese, Korean, Dutch, Romanian and Thai translations

Added

  • Initial release.