@vtex/faststore 0.0.7 → 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 (498) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/dist/actions.json +194 -1
  3. package/dist/catalog.json +3449 -1612
  4. package/dist/cli/index.d.ts +512 -63
  5. package/dist/cli/index.js +2098 -686
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/cli/server-runtime.js +44 -24
  8. package/dist/cli/server-runtime.js.map +1 -1
  9. package/dist/client.d.ts +5 -1
  10. package/dist/client.js +5 -1
  11. package/dist/components.d.ts +42 -10
  12. package/dist/components.js +47 -15
  13. package/dist/content-types.json +823 -0
  14. package/dist/core/dist/define-component.d.ts +12 -2
  15. package/dist/docs/account-access-gate.md +4 -4
  16. package/dist/docs/account-address-book.md +519 -0
  17. package/dist/docs/account-entry-point.md +5 -5
  18. package/dist/docs/account-menu.md +7 -7
  19. package/dist/docs/account-saved-cards.md +301 -0
  20. package/dist/docs/alert-dialog.md +2 -2
  21. package/dist/docs/billing-address.md +17 -9
  22. package/dist/docs/binding-switcher.md +154 -0
  23. package/dist/docs/card-entry.md +38 -7
  24. package/dist/docs/card-summary.md +175 -0
  25. package/dist/docs/cardholder-document.md +16 -14
  26. package/dist/docs/cart-destination.md +238 -0
  27. package/dist/docs/cart-item.md +22 -4
  28. package/dist/docs/cart-totalizer.md +1 -1
  29. package/dist/docs/cart.md +126 -19
  30. package/dist/docs/client-profile-fieldset.md +7 -5
  31. package/dist/docs/copy-text.md +84 -0
  32. package/dist/docs/document-field.md +8 -8
  33. package/dist/docs/footer-link-group.md +2 -2
  34. package/dist/docs/footer-social.md +1 -1
  35. package/dist/docs/free-shipping-progress.md +13 -9
  36. package/dist/docs/header-root.md +1 -1
  37. package/dist/docs/incentives.md +4 -4
  38. package/dist/docs/logo.md +6 -6
  39. package/dist/docs/my-account-profile.md +4 -4
  40. package/dist/docs/navigation-link-list.md +2 -2
  41. package/dist/docs/navigation-link.md +3 -3
  42. package/dist/docs/order-cancel.md +52 -0
  43. package/dist/docs/order-delivery-address.md +63 -0
  44. package/dist/docs/order-delivery-group.md +83 -0
  45. package/dist/docs/order-details-back.md +41 -0
  46. package/dist/docs/order-details-header.md +48 -0
  47. package/dist/docs/order-list-row.md +46 -0
  48. package/dist/docs/order-list-search.md +101 -0
  49. package/dist/docs/order-list-views.md +97 -0
  50. package/dist/docs/order-list.md +94 -0
  51. package/dist/docs/order-payment.md +94 -0
  52. package/dist/docs/order-placed-date.md +49 -0
  53. package/dist/docs/order-placed-payment-summary.md +13 -15
  54. package/dist/docs/order-placed.md +225 -0
  55. package/dist/docs/order-progress.md +88 -0
  56. package/dist/docs/order-status-badge.md +91 -0
  57. package/dist/docs/order-summary.md +53 -0
  58. package/dist/docs/payment-method-badges.md +16 -5
  59. package/dist/docs/payment-methods.md +1 -1
  60. package/dist/docs/place-order.md +13 -9
  61. package/dist/docs/product-information.md +2 -2
  62. package/dist/docs/product-shelf.md +7 -0
  63. package/dist/docs/saved-cards.md +2 -2
  64. package/dist/docs/select.md +22 -10
  65. package/dist/docs/session.md +1 -1
  66. package/dist/docs/shipping-address.md +1 -1
  67. package/dist/docs/sign-in-redirect.md +7 -7
  68. package/dist/docs/toast.md +35 -13
  69. package/dist/index.d.ts +7 -2
  70. package/dist/index.js +2 -1
  71. package/dist/internal/client.d.ts +9 -1
  72. package/dist/internal/client.js +10 -2
  73. package/dist/internal/server.d.ts +8 -2
  74. package/dist/internal/server.js +8 -2
  75. package/dist/matter/account-access-gate/account-access-gate.d.ts +2 -1
  76. package/dist/matter/account-access-gate/account-access-gate.js +19 -16
  77. package/dist/matter/account-access-gate/account-access-gate.js.map +1 -1
  78. package/dist/matter/account-address-book/account-address-book-delete.d.ts +60 -0
  79. package/dist/matter/account-address-book/account-address-book-delete.js +184 -0
  80. package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -0
  81. package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +19 -0
  82. package/dist/matter/account-address-book/account-address-book-deliverability.js +50 -0
  83. package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -0
  84. package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +42 -0
  85. package/dist/matter/account-address-book/account-address-book-form-parts.js +146 -0
  86. package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -0
  87. package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +25 -0
  88. package/dist/matter/account-address-book/account-address-book-profile-notice.js +72 -0
  89. package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -0
  90. package/dist/matter/account-address-book/account-address-book.d.ts +120 -0
  91. package/dist/matter/account-address-book/account-address-book.js +469 -0
  92. package/dist/matter/account-address-book/account-address-book.js.map +1 -0
  93. package/dist/matter/account-address-book/account-address-country-switch.js +59 -0
  94. package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -0
  95. package/dist/matter/account-address-book/account-address-country.d.ts +36 -0
  96. package/dist/matter/account-address-book/account-address-country.js +151 -0
  97. package/dist/matter/account-address-book/account-address-country.js.map +1 -0
  98. package/dist/matter/account-address-book/account-address-first-line.js +11 -0
  99. package/dist/matter/account-address-book/account-address-first-line.js.map +1 -0
  100. package/dist/matter/account-address-book/account-address-form-context.d.ts +55 -0
  101. package/dist/matter/account-address-book/account-address-form-context.js +14 -0
  102. package/dist/matter/account-address-book/account-address-form-context.js.map +1 -0
  103. package/dist/matter/account-address-book/account-address-form.d.ts +85 -0
  104. package/dist/matter/account-address-book/account-address-form.js +946 -0
  105. package/dist/matter/account-address-book/account-address-form.js.map +1 -0
  106. package/dist/matter/account-address-book/account-address-postal-autofill.js +189 -0
  107. package/dist/matter/account-address-book/account-address-postal-autofill.js.map +1 -0
  108. package/dist/matter/account-address-book/account-address-record.d.ts +26 -0
  109. package/dist/matter/account-address-book/account-address-record.js +138 -0
  110. package/dist/matter/account-address-book/account-address-record.js.map +1 -0
  111. package/dist/matter/account-entry-point/account-entry-point.js +11 -11
  112. package/dist/matter/account-entry-point/account-entry-point.js.map +1 -1
  113. package/dist/matter/account-menu/account-menu.d.ts +7 -3
  114. package/dist/matter/account-menu/account-menu.js +69 -28
  115. package/dist/matter/account-menu/account-menu.js.map +1 -1
  116. package/dist/matter/account-saved-cards/account-saved-cards.d.ts +383 -0
  117. package/dist/matter/account-saved-cards/account-saved-cards.js +956 -0
  118. package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
  119. package/dist/matter/billing-address/billing-address.d.ts +30 -17
  120. package/dist/matter/billing-address/billing-address.js +128 -33
  121. package/dist/matter/billing-address/billing-address.js.map +1 -1
  122. package/dist/matter/breadcrumb/breadcrumb.js +2 -2
  123. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
  124. package/dist/matter/card-entry/card-capture.js +4 -3
  125. package/dist/matter/card-entry/card-capture.js.map +1 -1
  126. package/dist/matter/card-entry/card-entry.d.ts +5 -3
  127. package/dist/matter/card-entry/card-entry.js +77 -27
  128. package/dist/matter/card-entry/card-entry.js.map +1 -1
  129. package/dist/matter/cardholder-document/cardholder-document.d.ts +10 -9
  130. package/dist/matter/cardholder-document/cardholder-document.js +36 -16
  131. package/dist/matter/cardholder-document/cardholder-document.js.map +1 -1
  132. package/dist/matter/cart/cart-namespace.d.ts +5 -1
  133. package/dist/matter/cart/cart-namespace.js +5 -1
  134. package/dist/matter/cart/cart-namespace.js.map +1 -1
  135. package/dist/matter/cart/cart.d.ts +41 -6
  136. package/dist/matter/cart/cart.js +267 -54
  137. package/dist/matter/cart/cart.js.map +1 -1
  138. package/dist/matter/cart-destination/cart-destination.d.ts +222 -0
  139. package/dist/matter/cart-destination/cart-destination.js +613 -0
  140. package/dist/matter/cart-destination/cart-destination.js.map +1 -0
  141. package/dist/matter/cart-item/cart-item.d.ts +4 -2
  142. package/dist/matter/cart-item/cart-item.js +76 -17
  143. package/dist/matter/cart-item/cart-item.js.map +1 -1
  144. package/dist/matter/cart-totalizer/cart-totalizer.js +3 -2
  145. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
  146. package/dist/matter/client-preferences/client-preferences-fieldset.js +1 -1
  147. package/dist/matter/client-profile-form/client-profile-fieldset.js +8 -5
  148. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
  149. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +6 -3
  150. package/dist/matter/free-shipping-progress/free-shipping-progress.js +76 -33
  151. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
  152. package/dist/matter/identity-edit/identity-edit.js +3 -3
  153. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  154. package/dist/matter/identity-summary/identity-summary.js +2 -2
  155. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  156. package/dist/matter/my-account-profile/my-account-profile.d.ts +3 -3
  157. package/dist/matter/my-account-profile/my-account-profile.js +4 -4
  158. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  159. package/dist/matter/order-cancel/order-cancel.d.ts +110 -0
  160. package/dist/matter/order-cancel/order-cancel.js +344 -0
  161. package/dist/matter/order-cancel/order-cancel.js.map +1 -0
  162. package/dist/matter/order-delivery-address/order-delivery-address.d.ts +73 -0
  163. package/dist/matter/order-delivery-address/order-delivery-address.js +172 -0
  164. package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -0
  165. package/dist/matter/order-delivery-group/order-delivery-group.d.ts +128 -0
  166. package/dist/matter/order-delivery-group/order-delivery-group.js +408 -0
  167. package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -0
  168. package/dist/matter/order-details-header/order-details-header.d.ts +104 -0
  169. package/dist/matter/order-details-header/order-details-header.js +190 -0
  170. package/dist/matter/order-details-header/order-details-header.js.map +1 -0
  171. package/dist/matter/order-list/customer-orders-filter.d.ts +12 -0
  172. package/dist/matter/order-list/customer-orders-filter.js +30 -0
  173. package/dist/matter/order-list/customer-orders-filter.js.map +1 -0
  174. package/dist/matter/order-list/order-list.d.ts +121 -0
  175. package/dist/matter/order-list/order-list.js +395 -0
  176. package/dist/matter/order-list/order-list.js.map +1 -0
  177. package/dist/matter/order-list-row/order-list-row.d.ts +44 -0
  178. package/dist/matter/order-list-row/order-list-row.js +127 -0
  179. package/dist/matter/order-list-row/order-list-row.js.map +1 -0
  180. package/dist/matter/order-list-search/order-list-search.d.ts +72 -0
  181. package/dist/matter/order-list-search/order-list-search.js +296 -0
  182. package/dist/matter/order-list-search/order-list-search.js.map +1 -0
  183. package/dist/matter/order-list-views/order-list-views.d.ts +65 -0
  184. package/dist/matter/order-list-views/order-list-views.js +154 -0
  185. package/dist/matter/order-list-views/order-list-views.js.map +1 -0
  186. package/dist/matter/order-payment/order-payment.d.ts +83 -0
  187. package/dist/matter/order-payment/order-payment.js +258 -0
  188. package/dist/matter/order-payment/order-payment.js.map +1 -0
  189. package/dist/matter/order-placed/order-placed-deliveries.d.ts +145 -0
  190. package/dist/matter/order-placed/order-placed-deliveries.js +380 -0
  191. package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -0
  192. package/dist/matter/order-placed/order-placed.d.ts +122 -0
  193. package/dist/matter/order-placed/order-placed.js +452 -0
  194. package/dist/matter/order-placed/order-placed.js.map +1 -0
  195. package/dist/matter/order-placed-date/order-placed-date.d.ts +45 -0
  196. package/dist/matter/order-placed-date/order-placed-date.js +92 -0
  197. package/dist/matter/order-placed-date/order-placed-date.js.map +1 -0
  198. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +5 -8
  199. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +29 -81
  200. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
  201. package/dist/matter/order-progress/order-progress.d.ts +85 -0
  202. package/dist/matter/order-progress/order-progress.js +203 -0
  203. package/dist/matter/order-progress/order-progress.js.map +1 -0
  204. package/dist/matter/order-summary/order-summary.d.ts +81 -0
  205. package/dist/matter/order-summary/order-summary.js +192 -0
  206. package/dist/matter/order-summary/order-summary.js.map +1 -0
  207. package/dist/matter/payment/cardholder-document-rule.d.ts +35 -0
  208. package/dist/matter/payment/cardholder-document-rule.js +35 -0
  209. package/dist/matter/payment/cardholder-document-rule.js.map +1 -0
  210. package/dist/matter/payment/payment-card-capture.js +38 -23
  211. package/dist/matter/payment/payment-card-capture.js.map +1 -1
  212. package/dist/matter/payment/payment-controller.js +11 -0
  213. package/dist/matter/payment/payment-controller.js.map +1 -1
  214. package/dist/matter/payment/payment-method-badges.js +4 -2
  215. package/dist/matter/payment/payment-method-badges.js.map +1 -1
  216. package/dist/matter/payment/payment.js +11 -0
  217. package/dist/matter/payment/payment.js.map +1 -1
  218. package/dist/matter/payment/use-payment-method-selection.d.ts +39 -0
  219. package/dist/matter/payment/use-payment-method-selection.js +30 -2
  220. package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
  221. package/dist/matter/payment/use-payment-submit-gate.d.ts +16 -2
  222. package/dist/matter/payment/use-payment-submit-gate.js +42 -14
  223. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
  224. package/dist/matter/place-order/place-order.d.ts +12 -7
  225. package/dist/matter/place-order/place-order.js +126 -103
  226. package/dist/matter/place-order/place-order.js.map +1 -1
  227. package/dist/matter/pricing/pricing.js +5 -5
  228. package/dist/matter/pricing/pricing.js.map +1 -1
  229. package/dist/matter/product-shelf/product-shelf.d.ts +7 -0
  230. package/dist/matter/product-shelf/product-shelf.js +115 -1
  231. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  232. package/dist/matter/region/region.js +1 -1
  233. package/dist/matter/saved-cards/saved-cards.js +26 -15
  234. package/dist/matter/saved-cards/saved-cards.js.map +1 -1
  235. package/dist/matter/session/session.js +2 -2
  236. package/dist/matter/session/session.js.map +1 -1
  237. package/dist/matter/shipping-address/country-descriptors.d.ts +1 -0
  238. package/dist/matter/shipping-address/country-descriptors.js +23 -1
  239. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  240. package/dist/matter/shipping-address/shipping-address.js +62 -14
  241. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  242. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +2 -2
  243. package/dist/matter/shipping-simulator/shipping-simulator.js +6 -2
  244. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  245. package/dist/matter/sign-in-redirect/sign-in-redirect.js +48 -10
  246. package/dist/matter/sign-in-redirect/sign-in-redirect.js.map +1 -1
  247. package/dist/matter/variant-selector/variant-selector.js +2 -2
  248. package/dist/matter/variant-selector/variant-selector.js.map +1 -1
  249. package/dist/particles/address-summary/address-summary.js +2 -2
  250. package/dist/particles/address-summary/address-summary.js.map +1 -1
  251. package/dist/particles/alert-dialog/alert-dialog.d.ts +5 -1
  252. package/dist/particles/alert-dialog/alert-dialog.js +5 -2
  253. package/dist/particles/alert-dialog/alert-dialog.js.map +1 -1
  254. package/dist/particles/binding-switcher/binding-switcher.d.ts +38 -0
  255. package/dist/particles/binding-switcher/binding-switcher.js +183 -0
  256. package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
  257. package/dist/particles/card-summary/card-network.d.ts +17 -0
  258. package/dist/particles/card-summary/card-network.js +25 -0
  259. package/dist/particles/card-summary/card-network.js.map +1 -0
  260. package/dist/particles/card-summary/card-summary.d.ts +83 -0
  261. package/dist/particles/card-summary/card-summary.js +188 -0
  262. package/dist/particles/card-summary/card-summary.js.map +1 -0
  263. package/dist/particles/copy-text/copy-text.d.ts +28 -0
  264. package/dist/particles/copy-text/copy-text.js +140 -0
  265. package/dist/particles/copy-text/copy-text.js.map +1 -0
  266. package/dist/particles/document-field/document-field.d.ts +34 -5
  267. package/dist/particles/document-field/document-field.js +115 -19
  268. package/dist/particles/document-field/document-field.js.map +1 -1
  269. package/dist/particles/field/field.js +1 -1
  270. package/dist/particles/field/field.js.map +1 -1
  271. package/dist/particles/footer-link-group/footer-link-group.d.ts +6 -2
  272. package/dist/particles/footer-link-group/footer-link-group.js +18 -7
  273. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
  274. package/dist/particles/footer-social/footer-social.d.ts +1 -1
  275. package/dist/particles/footer-social/footer-social.js +1 -1
  276. package/dist/particles/footer-social/footer-social.js.map +1 -1
  277. package/dist/particles/incentives/incentives.d.ts +7 -3
  278. package/dist/particles/incentives/incentives.js +8 -3
  279. package/dist/particles/incentives/incentives.js.map +1 -1
  280. package/dist/particles/logo/logo.d.ts +3 -2
  281. package/dist/particles/logo/logo.js +20 -8
  282. package/dist/particles/logo/logo.js.map +1 -1
  283. package/dist/particles/navigation-link/navigation-link.d.ts +2 -3
  284. package/dist/particles/navigation-link/navigation-link.js +4 -4
  285. package/dist/particles/navigation-link/navigation-link.js.map +1 -1
  286. package/dist/particles/navigation-link-list/navigation-link-list.d.ts +6 -2
  287. package/dist/particles/navigation-link-list/navigation-link-list.js +18 -7
  288. package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -1
  289. package/dist/particles/order-details-back/order-details-back.d.ts +28 -0
  290. package/dist/particles/order-details-back/order-details-back.js +52 -0
  291. package/dist/particles/order-details-back/order-details-back.js.map +1 -0
  292. package/dist/particles/order-status-badge/order-status-badge.d.ts +19 -0
  293. package/dist/particles/order-status-badge/order-status-badge.js +50 -0
  294. package/dist/particles/order-status-badge/order-status-badge.js.map +1 -0
  295. package/dist/particles/payment-methods/payment-methods.d.ts +1 -1
  296. package/dist/particles/payment-methods/payment-methods.js +1 -1
  297. package/dist/particles/payment-methods/payment-methods.js.map +1 -1
  298. package/dist/particles/phone-field/phone-field.js +2 -2
  299. package/dist/particles/phone-field/phone-field.js.map +1 -1
  300. package/dist/particles/select/select.js +6 -6
  301. package/dist/particles/select/select.js.map +1 -1
  302. package/dist/particles/toast/toast.d.ts +21 -7
  303. package/dist/particles/toast/toast.js +76 -8
  304. package/dist/particles/toast/toast.js.map +1 -1
  305. package/dist/schema.graphql +1376 -126
  306. package/dist/sdk/actions/address-action-provider.d.ts +16 -0
  307. package/dist/sdk/actions/address-action-provider.js +20 -0
  308. package/dist/sdk/actions/address-action-provider.js.map +1 -0
  309. package/dist/sdk/actions/analytics-action-provider.js +1 -1
  310. package/dist/sdk/actions/index.d.ts +5 -1
  311. package/dist/sdk/actions/index.js +5 -1
  312. package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
  313. package/dist/sdk/actions/locale-action-provider.js +20 -0
  314. package/dist/sdk/actions/locale-action-provider.js.map +1 -0
  315. package/dist/sdk/actions/order-action-provider.d.ts +12 -0
  316. package/dist/sdk/actions/order-action-provider.js +16 -0
  317. package/dist/sdk/actions/order-action-provider.js.map +1 -0
  318. package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
  319. package/dist/sdk/actions/saved-card-action-provider.js +16 -0
  320. package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
  321. package/dist/sdk/actions/types.d.ts +10 -2
  322. package/dist/sdk/address/address-fields.js +38 -0
  323. package/dist/sdk/address/address-fields.js.map +1 -0
  324. package/dist/sdk/address/checkout-readiness.js +17 -0
  325. package/dist/sdk/address/checkout-readiness.js.map +1 -0
  326. package/dist/sdk/address/constants.js +60 -0
  327. package/dist/sdk/address/constants.js.map +1 -0
  328. package/dist/sdk/address/country-display.js +19 -0
  329. package/dist/sdk/address/country-display.js.map +1 -0
  330. package/dist/sdk/address/country-rules.js +30 -0
  331. package/dist/sdk/address/country-rules.js.map +1 -0
  332. package/dist/sdk/address/format-address.js +18 -0
  333. package/dist/sdk/address/format-address.js.map +1 -0
  334. package/dist/sdk/address/iso-countries.js +262 -0
  335. package/dist/sdk/address/iso-countries.js.map +1 -0
  336. package/dist/sdk/address/layouts.js +56 -0
  337. package/dist/sdk/address/layouts.js.map +1 -0
  338. package/dist/sdk/address/messages.js +97 -0
  339. package/dist/sdk/address/messages.js.map +1 -0
  340. package/dist/sdk/address/operations.d.ts +54 -0
  341. package/dist/sdk/address/operations.js +83 -0
  342. package/dist/sdk/address/operations.js.map +1 -0
  343. package/dist/sdk/address/postal-code-lookup-operations.js +23 -0
  344. package/dist/sdk/address/postal-code-lookup-operations.js.map +1 -0
  345. package/dist/sdk/address/postal-code.js +11 -0
  346. package/dist/sdk/address/postal-code.js.map +1 -0
  347. package/dist/sdk/address/schema.js +14 -0
  348. package/dist/sdk/address/schema.js.map +1 -0
  349. package/dist/sdk/address/server-fields.js +25 -0
  350. package/dist/sdk/address/server-fields.js.map +1 -0
  351. package/dist/sdk/address/switch-country.js +57 -0
  352. package/dist/sdk/address/switch-country.js.map +1 -0
  353. package/dist/sdk/address/types.d.ts +26 -0
  354. package/dist/sdk/address/use-address-actions.d.ts +29 -0
  355. package/dist/sdk/address/use-address-actions.js +247 -0
  356. package/dist/sdk/address/use-address-actions.js.map +1 -0
  357. package/dist/sdk/address/use-address-by-postal-code.js +57 -0
  358. package/dist/sdk/address/use-address-by-postal-code.js.map +1 -0
  359. package/dist/sdk/address/validate-address.js +62 -0
  360. package/dist/sdk/address/validate-address.js.map +1 -0
  361. package/dist/sdk/cache/storefront-cache.js +30 -4
  362. package/dist/sdk/cache/storefront-cache.js.map +1 -1
  363. package/dist/sdk/cart/operations.d.ts +2 -1
  364. package/dist/sdk/cart/operations.js +55 -1
  365. package/dist/sdk/cart/operations.js.map +1 -1
  366. package/dist/sdk/cart/optimistic.d.ts +30 -7
  367. package/dist/sdk/cart/optimistic.js +78 -41
  368. package/dist/sdk/cart/optimistic.js.map +1 -1
  369. package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
  370. package/dist/sdk/cart/use-cart-actions.js +61 -15
  371. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  372. package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
  373. package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
  374. package/dist/sdk/client/fetch-page-data.d.ts +11 -0
  375. package/dist/sdk/client/fetch-page-data.js +12 -1
  376. package/dist/sdk/client/fetch-page-data.js.map +1 -1
  377. package/dist/sdk/content/create-content-runtime.js +1 -8
  378. package/dist/sdk/content/create-content-runtime.js.map +1 -1
  379. package/dist/sdk/data/failed-fields.js +23 -0
  380. package/dist/sdk/data/failed-fields.js.map +1 -0
  381. package/dist/sdk/data/index.js +2 -2
  382. package/dist/sdk/data/page-reactive-data-root.d.ts +45 -7
  383. package/dist/sdk/data/page-reactive-data-root.js +88 -12
  384. package/dist/sdk/data/page-reactive-data-root.js.map +1 -1
  385. package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
  386. package/dist/sdk/generated/fragment-types.js +2 -0
  387. package/dist/sdk/generated/fragment-types.js.map +1 -1
  388. package/dist/sdk/generated/gql.js +17 -11
  389. package/dist/sdk/generated/gql.js.map +1 -1
  390. package/dist/sdk/generated/graphql.d.ts +185 -46
  391. package/dist/sdk/generated/graphql.js +2587 -155
  392. package/dist/sdk/generated/graphql.js.map +1 -1
  393. package/dist/sdk/i18n/messages/en-US.js +157 -1
  394. package/dist/sdk/i18n/messages/en-US.json +157 -1
  395. package/dist/sdk/i18n/messages/en-US.json.d.ts +156 -0
  396. package/dist/sdk/i18n/messages/es-ES.js +157 -1
  397. package/dist/sdk/i18n/messages/es-ES.json +157 -1
  398. package/dist/sdk/i18n/messages/pt-BR.js +157 -1
  399. package/dist/sdk/i18n/messages/pt-BR.json +157 -1
  400. package/dist/sdk/i18n/provider.js +1 -1
  401. package/dist/sdk/i18n/provider.js.map +1 -1
  402. package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
  403. package/dist/sdk/locale/binding-switch-provider.js +20 -0
  404. package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
  405. package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
  406. package/dist/sdk/locale/use-locale-actions.js +70 -0
  407. package/dist/sdk/locale/use-locale-actions.js.map +1 -0
  408. package/dist/sdk/navigation/binding-switch.d.ts +39 -0
  409. package/dist/sdk/navigation/binding-switch.js +129 -0
  410. package/dist/sdk/navigation/binding-switch.js.map +1 -0
  411. package/dist/sdk/navigation/current-page.js +30 -0
  412. package/dist/sdk/navigation/current-page.js.map +1 -0
  413. package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
  414. package/dist/sdk/navigation/decode-route-params.js +32 -0
  415. package/dist/sdk/navigation/decode-route-params.js.map +1 -0
  416. package/dist/sdk/navigation/not-found-log.d.ts +28 -0
  417. package/dist/sdk/navigation/not-found-log.js +133 -0
  418. package/dist/sdk/navigation/not-found-log.js.map +1 -0
  419. package/dist/sdk/navigation/path.js +25 -0
  420. package/dist/sdk/navigation/path.js.map +1 -0
  421. package/dist/sdk/navigation/redirect.d.ts +11 -0
  422. package/dist/sdk/navigation/redirect.js +22 -0
  423. package/dist/sdk/navigation/redirect.js.map +1 -0
  424. package/dist/sdk/navigation/report.js +70 -0
  425. package/dist/sdk/navigation/report.js.map +1 -0
  426. package/dist/sdk/navigation/resolve-storefront-href.d.ts +12 -0
  427. package/dist/sdk/navigation/resolve-storefront-href.js +214 -0
  428. package/dist/sdk/navigation/resolve-storefront-href.js.map +1 -0
  429. package/dist/sdk/navigation/route-identity-provider.d.ts +11 -0
  430. package/dist/sdk/navigation/route-identity-provider.js +20 -0
  431. package/dist/sdk/navigation/route-identity-provider.js.map +1 -0
  432. package/dist/sdk/navigation/route-map-provider.d.ts +19 -0
  433. package/dist/sdk/navigation/route-map-provider.js +29 -0
  434. package/dist/sdk/navigation/route-map-provider.js.map +1 -0
  435. package/dist/sdk/navigation/storefront-link.d.ts +16 -0
  436. package/dist/sdk/navigation/storefront-link.js +66 -0
  437. package/dist/sdk/navigation/storefront-link.js.map +1 -0
  438. package/dist/sdk/navigation/types.d.ts +45 -0
  439. package/dist/sdk/navigation/use-storefront-navigation.d.ts +26 -0
  440. package/dist/sdk/navigation/use-storefront-navigation.js +73 -0
  441. package/dist/sdk/navigation/use-storefront-navigation.js.map +1 -0
  442. package/dist/sdk/navigation/use-storefront-route.d.ts +26 -0
  443. package/dist/sdk/navigation/use-storefront-route.js +87 -0
  444. package/dist/sdk/navigation/use-storefront-route.js.map +1 -0
  445. package/dist/sdk/navigation/use-storefront-search-params.d.ts +11 -0
  446. package/dist/sdk/navigation/use-storefront-search-params.js +16 -0
  447. package/dist/sdk/navigation/use-storefront-search-params.js.map +1 -0
  448. package/dist/sdk/orders/completion-badge.d.ts +8 -0
  449. package/dist/sdk/orders/completion-badge.js +47 -0
  450. package/dist/sdk/orders/completion-badge.js.map +1 -0
  451. package/dist/sdk/orders/order-operations.d.ts +19 -0
  452. package/dist/sdk/orders/order-operations.js +21 -0
  453. package/dist/sdk/orders/order-operations.js.map +1 -0
  454. package/dist/sdk/orders/use-order-actions.d.ts +23 -0
  455. package/dist/sdk/orders/use-order-actions.js +62 -0
  456. package/dist/sdk/orders/use-order-actions.js.map +1 -0
  457. package/dist/sdk/payment/gateway-origin.js +26 -13
  458. package/dist/sdk/payment/gateway-origin.js.map +1 -1
  459. package/dist/sdk/payment/gateway.d.ts +14 -2
  460. package/dist/sdk/payment/gateway.js +32 -14
  461. package/dist/sdk/payment/gateway.js.map +1 -1
  462. package/dist/sdk/payment/operations.js +11 -0
  463. package/dist/sdk/payment/operations.js.map +1 -1
  464. package/dist/sdk/payment/submission-registry.d.ts +2 -1
  465. package/dist/sdk/payment/submission-registry.js +12 -8
  466. package/dist/sdk/payment/submission-registry.js.map +1 -1
  467. package/dist/sdk/payment/use-payment-actions.d.ts +5 -3
  468. package/dist/sdk/payment/use-payment-actions.js +5 -2
  469. package/dist/sdk/payment/use-payment-actions.js.map +1 -1
  470. package/dist/sdk/payment/use-place-order.d.ts +6 -3
  471. package/dist/sdk/payment/use-place-order.js +333 -143
  472. package/dist/sdk/payment/use-place-order.js.map +1 -1
  473. package/dist/sdk/saved-cards/operations.d.ts +16 -0
  474. package/dist/sdk/saved-cards/operations.js +41 -0
  475. package/dist/sdk/saved-cards/operations.js.map +1 -0
  476. package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
  477. package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
  478. package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
  479. package/dist/sdk/seo/page-alternates.d.ts +57 -0
  480. package/dist/sdk/seo/page-alternates.js +127 -0
  481. package/dist/sdk/seo/page-alternates.js.map +1 -0
  482. package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
  483. package/dist/sdk/shipping/shipping-operations.js +13 -0
  484. package/dist/sdk/shipping/shipping-operations.js.map +1 -1
  485. package/dist/sdk/state/cart.d.ts +9 -2
  486. package/dist/sdk/state/cart.js +9 -2
  487. package/dist/sdk/state/cart.js.map +1 -1
  488. package/dist/utils/own-value.js +19 -0
  489. package/dist/utils/own-value.js.map +1 -0
  490. package/dist/utils/safe-href.d.ts +4 -4
  491. package/dist/utils/safe-href.js +31 -22
  492. package/dist/utils/safe-href.js.map +1 -1
  493. package/package.json +5 -1
  494. package/skills/storefront-asset/SKILL.md +111 -0
  495. package/skills/storefront-asset/references/api-side.md +153 -0
  496. package/skills/storefront-asset/references/findings.md +40 -0
  497. package/skills/storefront-asset/references/ui-side.md +94 -0
  498. package/src/styles/tailwind.css +28 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-address-book.js","names":[],"sources":["../../../src/matter/account-address-book/account-address-book.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport {\n type ComponentPropsWithRef,\n createContext,\n Fragment,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n AddressSummary,\n AddressSummaryCountry,\n AddressSummaryField,\n AddressSummaryRecipient,\n AddressSummaryRoot,\n} from '../../particles/address-summary/address-summary.js';\nimport { Button } from '../../particles/button/button.js';\nimport { countryDisplayName } from '../../sdk/address/country-display.js';\nimport { formatAddress } from '../../sdk/address/format-address.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { ListItemRefContext } from '../../sdk/data/list-item-ref-context.js';\nimport { ReactiveRootContext } from '../../sdk/data/page-reactive-data-root.js';\nimport { useStorefrontFormatters } from '../../sdk/format/client.js';\nimport { useIntl } from '../../sdk/i18n/client.js';\nimport { resolveAuthoredCopy } from '../../utils/resolve-authored-copy.js';\nimport { useSession } from '../session/session.js';\n\n/**\n * The shopper's saved addresses, listed (specs/sfs-3440-address-book-list.md, RFC REQ-01). One family\n * split by data-fetch role, in the pattern `SavedCards` and `CartRoot` use:\n *\n * - `AccountAddressBookRoot` reads the book once through the page's reactive query, owns the four\n * states, and gates on a signed-in session.\n * - `AccountAddressBookList` fans the addresses out by entity ref, one `li` per address.\n * - `AccountAddressBookItem` subscribes to its own `CustomerAddress` entity (`reactive-list-item`) and\n * bridges it onto the generic `AddressSummary` particle.\n * - `Loading`, `Empty` and `Error` are composed parts, so a store chooses where each sits.\n *\n * Every rule the components apply lives in `sdk/address/`: line order is `formatAddress`'s and the\n * country name is `countryDisplayName`'s. The components only compose them.\n */\n\n// ---------------------------------------------------------------------------\n// GraphQL fragments — raw template literals, as `saved-cards.tsx` does: the codegen `documents` glob\n// does not scan `src/matter/account-address-book*`. Both drill `customerAddressBook` and merge at\n// compile time (ADR-0011/ADR-0012); `data-component-contract.test.ts` validates each against the real\n// schema. The book is an object with an `id` rather than a bare list under `Query`, which is the\n// shape the compiler can deliver per item.\n// ---------------------------------------------------------------------------\n\nconst fragment = /* GraphQL */ `\n fragment AccountAddressBookRootData on Query {\n customerAddressBook {\n __typename\n id\n addresses {\n __typename\n id\n }\n }\n }\n`;\n\nconst itemFragment = /* GraphQL */ `\n fragment AccountAddressBookItemData on Query {\n customerAddressBook {\n addresses {\n __typename\n id\n country\n recipientName\n street\n number\n complement\n neighborhood\n city\n state\n postalCode\n reference\n }\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** The minimal per-address identifiers the root needs to iterate. */\nexport type AccountAddressBookRootSlice = Readonly<{\n __typename?: 'CustomerAddressBook';\n id: string;\n addresses: readonly Readonly<{ __typename?: 'CustomerAddress'; id: string }>[];\n}>;\n\n/** The full per-address slice `AccountAddressBookItem` resolves on its own. */\nexport type AccountAddressBookItemSlice = Readonly<{\n __typename?: 'CustomerAddress';\n id: string;\n country?: string | null;\n recipientName?: string | null;\n street?: string | null;\n number?: string | null;\n complement?: string | null;\n neighborhood?: string | null;\n city?: string | null;\n state?: string | null;\n postalCode?: string | null;\n reference?: string | null;\n}>;\n\n/**\n * Where the book is. `null` is the frame before anything resolved, loaded, or failed: it shows\n * nothing, so no state is ever claimed that the data has not earned.\n */\nexport type AccountAddressBookState = 'loading' | 'error' | 'empty' | 'ready';\n\n/** The form the book has open. `address` is the item's raw slice, so the form can seed itself from it. */\nexport type AccountAddressBookOpenForm =\n | Readonly<{ mode: 'add' }>\n | Readonly<{ mode: 'edit'; address: AccountAddressBookItemSlice }>;\n\n/** The address a delete confirmation is open for. `null` when none is. */\nexport type AccountAddressBookPendingDelete = AccountAddressBookItemSlice | null;\n\nexport type AccountAddressBookContextValue = Readonly<{\n book: AccountAddressBookRootSlice | null;\n state: AccountAddressBookState | null;\n openForm: AccountAddressBookOpenForm | null;\n /** Opens a form, replacing any open one. `opener` is where focus returns when the form closes. */\n open: (form: AccountAddressBookOpenForm, opener: HTMLElement | null) => void;\n close: () => void;\n /** True while the open form has a save in flight. The dialog stays open until it settles. */\n formPending: boolean;\n /** Reported by the open form as its save starts and settles. */\n setFormPending: (pending: boolean) => void;\n /** The address waiting for the shopper's answer to a delete confirmation, or `null`. */\n pendingDelete: AccountAddressBookPendingDelete;\n /** Asks for a confirmation. `opener` is where focus returns when it is declined. */\n requestDelete: (address: AccountAddressBookItemSlice, opener: HTMLElement | null) => void;\n endDelete: () => void;\n /** True from an in-place retry until the book resolves. The error part stays mounted meanwhile. */\n retrying: boolean;\n /** Loads the book again: in place through the page root's `refetch`, else by reloading the page. */\n retry: () => void;\n}>;\n\nexport type AccountAddressBookRootProps = ComponentPropsWithRef<'div'> & {\n /** Unwrapped `customerAddressBook` from the reactive runtime (arity-1 fragment); `null` until resolved. */\n $data?: AccountAddressBookRootSlice | null;\n};\n\nexport type AccountAddressBookListProps = ComponentPropsWithRef<'ul'>;\n\nexport type AccountAddressBookItemProps = ComponentPropsWithRef<'div'> & {\n /** Per-address slice from the reactive-list-item runtime; passed directly in tests. */\n $data?: AccountAddressBookItemSlice | null;\n};\n\nexport type AccountAddressBookItemLinesProps = Readonly<{ className?: string }>;\n\nexport type AccountAddressBookLoadingProps = ComponentPropsWithRef<'output'> & {\n /** Announced while the book loads. A blank value falls back to the catalog copy. */\n message?: string;\n};\n\nexport type AccountAddressBookEmptyProps = ComponentPropsWithRef<'p'> & {\n /** Shown once the book resolved to zero addresses. A blank value falls back to the catalog copy. */\n message?: string;\n};\n\nexport type AccountAddressBookErrorProps = ComponentPropsWithRef<'div'> & {\n /** Shown when the read failed. A blank value falls back to the catalog copy. */\n message?: string;\n /** The retry control's label. A blank value falls back to the catalog copy. */\n retryLabel?: string;\n};\n\n// ---------------------------------------------------------------------------\n// Contexts\n// ---------------------------------------------------------------------------\n\nconst AccountAddressBookContext = createContext<AccountAddressBookContextValue | null>(null);\n\n/** The resolved book and its state, for any part composed under `AccountAddressBookRoot`. */\nexport function useAccountAddressBook(): AccountAddressBookContextValue {\n const value = useContext(AccountAddressBookContext);\n if (!value) {\n throw new Error('Address book parts must be used inside an AccountAddressBookRoot.');\n }\n return value;\n}\n\n/** The book's context, or `null` outside a root: the form also stands alone, in add mode. */\nexport function useOptionalAccountAddressBook(): AccountAddressBookContextValue | null {\n return useContext(AccountAddressBookContext);\n}\n\nconst AccountAddressBookItemContext = createContext<AccountAddressBookItemSlice | null>(null);\n\n/**\n * The raw address an entry renders, with its alpha-3 `country`. Delete, edit and the deliverability\n * marker read this rather than the summary, whose country is already a display name.\n */\nexport function useAccountAddressBookItem(): AccountAddressBookItemSlice {\n const value = useContext(AccountAddressBookItemContext);\n if (!value) {\n throw new Error('Address book entry parts must be used inside an AccountAddressBookItem.');\n }\n return value;\n}\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\n/**\n * Each state gates on the resolved book, never on `loading` alone: `loading` is false on the first\n * client frame before the seed effect runs, and the book is null both while loading and after a\n * failure. So empty needs a book that resolved to zero addresses, and error needs no book and a\n * settled read that reported one.\n */\nfunction resolveState({\n book,\n loading,\n error,\n}: {\n book: AccountAddressBookRootSlice | null;\n loading: boolean;\n error: unknown;\n}): AccountAddressBookState | null {\n if (book != null) return book.addresses.length === 0 ? 'empty' : 'ready';\n if (loading) return 'loading';\n return error ? 'error' : null;\n}\n\nconst BOOK_SELECTOR = '[data-fs-account-address-book]';\n\n/**\n * Where focus goes once an overlay the book opened has closed: back to the control that opened it,\n * and, when a save or a removal took that control out of the document, to the book itself rather\n * than the page's top. `active` is true while the overlay is open; `remember` runs as it opens.\n */\nfunction useFocusReturn(active: boolean): (opener: HTMLElement | null) => void {\n const target = useRef<{ opener: HTMLElement | null; root: HTMLElement | null } | null>(null);\n\n const remember = useCallback((opener: HTMLElement | null) => {\n target.current = { opener, root: opener?.closest<HTMLElement>(BOOK_SELECTOR) ?? null };\n }, []);\n\n useEffect(() => {\n if (active) return;\n const current = target.current;\n target.current = null;\n if (!current) return;\n const { opener, root } = current;\n (opener?.isConnected ? opener : root)?.focus();\n }, [active]);\n\n return remember;\n}\n\n/**\n * The retry loads the book again in place through the page root's `refetch`. A root with none falls\n * back to reloading the page: the read changes nothing, so that is safe, and the page re-runs its\n * query.\n */\nfunction reloadPage() {\n globalThis.location.reload();\n}\n\n/**\n * A retry keeps the error part, and so its button, mounted while the book loads: focus stays on the\n * button, and the same button is offered again if the read fails again. `retrying` lasts as long as\n * the retry's own `refetch`, so a later load from another trigger is never read as this retry.\n * Once the book resolves, the list or the empty message replaces the button, so focus moves to the\n * book, but only when focus was inside the book at the retry and has fallen to the page's top since.\n * A failed read drops that mark.\n */\nfunction useRetry(refetch: (() => Promise<void>) | undefined, state: AccountAddressBookState | null) {\n const [retrying, setRetrying] = useState(false);\n const focusRoot = useRef<HTMLElement | null>(null);\n\n const retry = useCallback(() => {\n if (!refetch) {\n reloadPage();\n return;\n }\n const { activeElement } = document;\n focusRoot.current = activeElement instanceof HTMLElement ? activeElement.closest<HTMLElement>(BOOK_SELECTOR) : null;\n setRetrying(true);\n refetch()\n .catch(() => {\n // A provider's own `refetch` may reject. The book's error state already shows the failure.\n })\n .finally(() => setRetrying(false));\n }, [refetch]);\n\n useEffect(() => {\n if (state === 'error') {\n focusRoot.current = null;\n return;\n }\n if (state !== 'ready' && state !== 'empty') return;\n const root = focusRoot.current;\n focusRoot.current = null;\n const { activeElement } = document;\n if (root && (!activeElement || activeElement === document.body)) root.focus();\n }, [state]);\n\n return { retrying, retry };\n}\n\nexport function AccountAddressBookRoot({\n $data: $dataProp,\n className,\n children,\n ...props\n}: AccountAddressBookRootProps) {\n const $data = useDataOverride<AccountAddressBookRootSlice | null | undefined>($dataProp);\n const book = $data ?? null;\n const { loading, error, refetch } = useContext(ReactiveRootContext);\n const { state: sessionState } = useSession();\n const state = resolveState({ book, loading, error });\n const [openForm, setOpenForm] = useState<AccountAddressBookOpenForm | null>(null);\n const [formPending, setFormPending] = useState(false);\n const [pendingDelete, setPendingDelete] = useState<AccountAddressBookPendingDelete>(null);\n const rememberFormOpener = useFocusReturn(openForm !== null);\n const rememberDeleteOpener = useFocusReturn(pendingDelete !== null);\n const { retrying, retry } = useRetry(refetch, state);\n\n const open = useCallback(\n (form: AccountAddressBookOpenForm, opener: HTMLElement | null) => {\n rememberFormOpener(opener);\n setOpenForm(form);\n },\n [rememberFormOpener],\n );\n const close = useCallback(() => setOpenForm(null), []);\n\n const requestDelete = useCallback(\n (address: AccountAddressBookItemSlice, opener: HTMLElement | null) => {\n rememberDeleteOpener(opener);\n setPendingDelete(address);\n },\n [rememberDeleteOpener],\n );\n const endDelete = useCallback(() => setPendingDelete(null), []);\n\n const value = useMemo(\n () => ({\n book,\n state,\n openForm,\n open,\n close,\n formPending,\n setFormPending,\n pendingDelete,\n requestDelete,\n endDelete,\n retrying,\n retry,\n }),\n [book, state, openForm, open, close, formPending, pendingDelete, requestDelete, endDelete, retrying, retry],\n );\n\n if (sessionState !== 'loggedIn') return null;\n\n return (\n <AccountAddressBookContext value={value}>\n <div\n tabIndex={-1}\n {...props}\n className={className}\n data-fs-account-address-book=\"\"\n {...(state ? { 'data-fs-account-address-book-state': state } : {})}\n >\n {children}\n </div>\n </AccountAddressBookContext>\n );\n}\n\nexport function AccountAddressBookList({ className, children, ...props }: AccountAddressBookListProps) {\n const { book } = useAccountAddressBook();\n const addresses = book?.addresses ?? [];\n\n if (addresses.length === 0) return null;\n\n return (\n <ul {...props} className={className} data-fs-account-address-book-list=\"\">\n {addresses.map(({ id }) => (\n <li key={id} data-fs-account-address-book-list-item=\"\">\n <ListItemRefContext\n // No fallback slice: the root's fragment selects only `{ id }`, so there is no complete\n // row to fall back to. An incomplete cache slice renders nothing until it resolves.\n value={{ __typename: 'CustomerAddress', id, fallbackData: undefined }}\n >\n {children}\n </ListItemRefContext>\n </li>\n ))}\n </ul>\n );\n}\n\nexport function AccountAddressBookItem({\n $data: $dataProp,\n className,\n children,\n ...props\n}: AccountAddressBookItemProps) {\n // Delivery-agnostic: the slice arrives through the DataOverrideContext seam the reactive-list-item\n // wrapper publishes (or via $data in tests); this component calls no data hook of its own.\n const slice = useDataOverride<AccountAddressBookItemSlice | null | undefined>($dataProp) ?? null;\n const { displayName } = useStorefrontFormatters();\n\n if (!slice) return null;\n\n // The summary shows a name, the raw slice keeps the code, and an address carries no name of its own.\n const summary = {\n recipientName: slice.recipientName,\n street: slice.street,\n number: slice.number,\n complement: slice.complement,\n neighborhood: slice.neighborhood,\n city: slice.city,\n state: slice.state,\n postalCode: slice.postalCode,\n reference: slice.reference,\n country: countryDisplayName(slice.country, displayName),\n };\n\n return (\n <AccountAddressBookItemContext value={slice}>\n <AddressSummaryRoot address={summary}>\n <div {...props} className={className} data-fs-account-address-book-item=\"\">\n {children ?? (\n <AddressSummary>\n <AddressSummaryRecipient />\n <AccountAddressBookItemLines />\n <AddressSummaryCountry />\n </AddressSummary>\n )}\n </div>\n </AddressSummaryRoot>\n </AccountAddressBookItemContext>\n );\n}\n\n/** One `p` per line the address's country prints, each field in that country's order. */\nexport function AccountAddressBookItemLines({ className }: AccountAddressBookItemLinesProps) {\n const address = useAccountAddressBookItem();\n\n return (\n <>\n {formatAddress(address, address.country ?? '').map((line) => (\n <p key={line.map(({ field }) => field).join()} className={className} data-fs-account-address-book-line=\"\">\n {line.map(({ field, separator }) => (\n <Fragment key={field}>\n {separator}\n <AddressSummaryField field={field} />\n </Fragment>\n ))}\n </p>\n ))}\n </>\n );\n}\n\n/**\n * The polite live region stays mounted whether or not the book is loading, so the message is\n * announced when it lands (the region has to exist before its text does).\n */\nexport function AccountAddressBookLoading({ message, className, children, ...props }: AccountAddressBookLoadingProps) {\n const { state } = useAccountAddressBook();\n const intl = useIntl();\n\n return (\n <output {...props} aria-live=\"polite\" className={className} data-fs-account-address-book-loading=\"\">\n {state === 'loading' ? (\n <>\n {children ?? <AccountAddressBookSkeleton />}\n <span data-fs-account-address-book-loading-message=\"\" data-fs-sr-only=\"\" className=\"sr-only\">\n {resolveAuthoredCopy(message, intl.formatMessage({ id: 'fs/address-book.loading' }))}\n </span>\n </>\n ) : null}\n </output>\n );\n}\n\nexport function AccountAddressBookEmpty({ message, className, ...props }: AccountAddressBookEmptyProps) {\n const { state } = useAccountAddressBook();\n const intl = useIntl();\n\n if (state !== 'empty') return null;\n\n return (\n <p {...props} className={className} data-fs-account-address-book-empty=\"\">\n {resolveAuthoredCopy(message, intl.formatMessage({ id: 'fs/address-book.empty' }))}\n </p>\n );\n}\n\nexport function AccountAddressBookError({ message, retryLabel, className, ...props }: AccountAddressBookErrorProps) {\n const { state, retrying, retry } = useAccountAddressBook();\n const intl = useIntl();\n const busy = retrying && state === 'loading';\n\n if (state !== 'error' && !busy) return null;\n\n return (\n <div {...props} role=\"alert\" className={className} data-fs-account-address-book-error=\"\">\n <p data-fs-account-address-book-error-message=\"\">\n {resolveAuthoredCopy(message, intl.formatMessage({ id: 'fs/address-book.error' }))}\n </p>\n {/* `aria-disabled`, not `disabled`: a disabled button loses focus, and the shopper's is on it. */}\n <Button\n type=\"button\"\n onClick={busy ? undefined : retry}\n aria-disabled={busy || undefined}\n aria-busy={busy || undefined}\n data-fs-account-address-book-retry=\"\"\n >\n {resolveAuthoredCopy(retryLabel, intl.formatMessage({ id: 'fs/address-book.retry' }))}\n </Button>\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Skeleton — no context: `AccountAddressBookLoading` renders it before the root has anything to\n// provide, and the definitions reference it for the lint rule that asks every fetching component\n// for one. The compiler does not render it on the reactive path.\n// ---------------------------------------------------------------------------\n\nexport function AccountAddressBookSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>) {\n return (\n <div {...props} className={className} aria-hidden=\"true\" data-fs-account-address-book-skeleton=\"\">\n <span data-fs-account-address-book-skeleton-line=\"\" />\n <span data-fs-account-address-book-skeleton-line=\"\" />\n <span data-fs-account-address-book-skeleton-line=\"\" />\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const AccountAddressBookRootDefinition = defineComponent<AccountAddressBookRootProps>({\n name: 'AccountAddressBookRoot',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookRoot,\n fragment,\n fetchStrategy: 'reactive',\n requiresContext: 'session',\n providesContext: 'account-address-book',\n skeleton: AccountAddressBookSkeleton,\n editor: { label: 'Account Address Book', category: 'identity' },\n schema: {},\n guideline:\n \"Root of the signed-in shopper's saved addresses: reads the address book once and owns its four states (loading, error, empty, ready), exposed as data-fs-account-address-book-state. Renders nothing unless the session is logged in, so it needs a SessionRoot ancestor. Compose AccountAddressBookLoading, AccountAddressBookError, AccountAddressBookEmpty and an AccountAddressBookList holding one AccountAddressBookItem, in any order. Reading the book starts no cart. See account-address-book.md.\",\n});\n\nexport const AccountAddressBookListDefinition = defineComponent<AccountAddressBookListProps>({\n name: 'AccountAddressBookList',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookList,\n requiresContext: 'account-address-book',\n editor: { label: 'Account Address Book List', category: 'content' },\n schema: {},\n guideline:\n 'The saved addresses as a list, one entry per address in the order the book returns them. Place one AccountAddressBookItem inside as the per-address template; it is repeated once per address. Renders nothing until the book has at least one address. Must be inside AccountAddressBookRoot.',\n});\n\nexport const AccountAddressBookItemDefinition = defineComponent<AccountAddressBookItemProps>({\n name: 'AccountAddressBookItem',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookItem,\n fragment: itemFragment,\n fetchStrategy: 'reactive-list-item',\n requiresContext: 'account-address-book',\n providesContext: ['account-address-book-item', 'address-summary'],\n skeleton: AccountAddressBookSkeleton,\n editor: { label: 'Account Address Book Item', category: 'content' },\n schema: {},\n guideline:\n \"One saved address, written the way its country writes it, with the recipient first and the country's name last. With no children it renders that default entry; give it children to compose the entry yourself, using the AddressSummary parts and AccountAddressBookItemLines. Provides the address-summary contract and the raw address for triggers placed inside it. Must be inside AccountAddressBookList.\",\n});\n\nexport const AccountAddressBookItemLinesDefinition = defineComponent<AccountAddressBookItemLinesProps>({\n name: 'AccountAddressBookItemLines',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookItemLines,\n requiresContext: 'account-address-book-item',\n editor: { label: 'Account Address Book Item Lines', category: 'content' },\n schema: {},\n guideline:\n \"The address's lines in its country's order, one paragraph per line with each field in sequence and its separator (a United States address reads number before street). A field the address lacks is dropped along with its separator. Must be inside AccountAddressBookItem.\",\n});\n\nexport const AccountAddressBookLoadingDefinition = defineComponent<AccountAddressBookLoadingProps>({\n name: 'AccountAddressBookLoading',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookLoading,\n requiresContext: 'account-address-book',\n editor: { label: 'Account Address Book Loading', category: 'content' },\n schema: {\n message: { type: 'string', label: 'Loading message' },\n },\n guideline:\n 'Shown only while the book is loading and has not resolved: a placeholder plus a loading message. The wrapper is a polite live region that stays mounted, and the message is visually hidden so it is heard and not seen. Pass children to replace the default placeholder. Must be inside AccountAddressBookRoot.',\n});\n\nexport const AccountAddressBookEmptyDefinition = defineComponent<AccountAddressBookEmptyProps>({\n name: 'AccountAddressBookEmpty',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookEmpty,\n requiresContext: 'account-address-book',\n editor: { label: 'Account Address Book Empty', category: 'content' },\n schema: {\n message: { type: 'string', label: 'Empty message' },\n },\n guideline:\n 'Shown only once the book has resolved to zero addresses, never while it loads or after it fails, so it never invites the shopper to add an address they already have. Must be inside AccountAddressBookRoot.',\n});\n\nexport const AccountAddressBookErrorDefinition = defineComponent<AccountAddressBookErrorProps>({\n name: 'AccountAddressBookError',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookError,\n requiresContext: 'account-address-book',\n editor: { label: 'Account Address Book Error', category: 'content' },\n schema: {\n message: { type: 'string', label: 'Error message' },\n retryLabel: { type: 'string', label: 'Retry label' },\n },\n guideline:\n 'Shown when the book failed to load, as an alert with a retry control that loads the book again in place. Stays, with its retry disabled, while that retry loads. Never shown for a first load or an empty book. Must be inside AccountAddressBookRoot.',\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAM,WAAyB;;;;;;;;;;;;AAa/B,MAAM,eAA6B;;;;;;;;;;;;;;;;;;;;AAuHnC,MAAM,4BAA4B,cAAqD,IAAI;;AAG3F,SAAgB,wBAAwD;CACtE,MAAM,QAAQ,WAAW,yBAAyB;CAClD,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,mEAAmE;CAErF,OAAO;AACT;;AAGA,SAAgB,gCAAuE;CACrF,OAAO,WAAW,yBAAyB;AAC7C;AAEA,MAAM,gCAAgC,cAAkD,IAAI;;;;;AAM5F,SAAgB,4BAAyD;CACvE,MAAM,QAAQ,WAAW,6BAA6B;CACtD,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,yEAAyE;CAE3F,OAAO;AACT;;;;;;;AAYA,SAAS,aAAa,EACpB,MACA,SACA,SAKiC;CACjC,IAAI,QAAQ,MAAM,OAAO,KAAK,UAAU,WAAW,IAAI,UAAU;CACjE,IAAI,SAAS,OAAO;CACpB,OAAO,QAAQ,U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jB,iBAAiB,CAAC,6BAA6B,iBAAiB;CAChE,UAAU;CACV,QAAQ;EAAE,OAAO;EAA6B,UAAU;CAAU;CAClE,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,wCAAwC,gBAAkD;CACrG,MAAM;CACN,YAAY;CACZ,WAAW;CACX,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAAmC,UAAU;CAAU;CACxE,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,sCAAsC,gBAAgD;CACjG,MAAM;CACN,YAAY;CACZ,WAAW;CACX,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAAgC,UAAU;CAAU;CACrE,QAAQ,EACN,SAAS;EAAE,MAAM;EAAU,OAAO;CAAkB,EACtD;CACA,WACE;AACJ,CAAC;AAED,MAAa,oCAAoC,gBAA8C;CAC7F,MAAM;CACN,YAAY;CACZ,WAAW;CACX,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAA8B,UAAU;CAAU;CACnE,QAAQ,EACN,SAAS;EAAE,MAAM;EAAU,OAAO;CAAgB,EACpD;CACA,WACE;AACJ,CAAC;AAED,MAAa,oCAAoC,gBAA8C;CAC7F,MAAM;CACN,YAAY;CACZ,WAAW;CACX,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAA8B,UAAU;CAAU;CACnE,QAAQ;EACN,SAAS;GAAE,MAAM;GAAU,OAAO;EAAgB;EAClD,YAAY;GAAE,MAAM;GAAU,OAAO;EAAc;CACrD;CACA,WACE;AACJ,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { isCountryField } from "../../sdk/address/constants.js";
2
+ import { resolveLabelId } from "../../sdk/address/messages.js";
3
+ import { addressFields } from "../../sdk/address/address-fields.js";
4
+ import { switchCountry } from "../../sdk/address/switch-country.js";
5
+ //#region src/matter/account-address-book/account-address-country-switch.ts
6
+ function isBlank(value) {
7
+ return value === null || value === void 0 || value.trim() === "";
8
+ }
9
+ /**
10
+ * The country a new address starts in: the preferred one when the store ships there or the list is
11
+ * unknown, else the first country of the list, in the platform's order. `defaultCountry` comes
12
+ * trimmed and upper-cased.
13
+ */
14
+ function initialAddressCountry(countries, defaultCountry) {
15
+ if (!countries || countries.includes(defaultCountry)) return defaultCountry;
16
+ return countries[0] ?? defaultCountry;
17
+ }
18
+ /**
19
+ * Applies a country switch to the draft. What the new country cannot take is kept for the old one,
20
+ * and what was kept for the new one comes back in every field the switch leaves empty, when it
21
+ * passes the new country's rules with the rest of the draft: a city returns with its state. The
22
+ * change lists the draft's values that stayed behind, with the old country's labels.
23
+ */
24
+ function applyCountrySwitch({ draft, aside, from, to }) {
25
+ const stored = aside[to.country] ?? {};
26
+ const carried = switchCountry(draft, from, to);
27
+ const offered = Object.keys(stored).filter((name) => !isBlank(stored[name]) && isBlank(carried.values[name]));
28
+ const { values } = switchCountry({
29
+ ...draft,
30
+ ...Object.fromEntries(offered.map((name) => [name, stored[name]]))
31
+ }, from, to);
32
+ const next = {};
33
+ for (const [name, value] of Object.entries(values)) if (name !== "name") next[name] = value;
34
+ const left = (name, value) => values[name] !== value;
35
+ const labels = new Map(addressFields(from, draft).map(({ name, labelId }) => [name, labelId]));
36
+ return {
37
+ draft: next,
38
+ aside: {
39
+ ...aside,
40
+ [from.country]: Object.fromEntries(Object.entries(carried.setAside).filter(([name, value]) => left(name, value))),
41
+ [to.country]: Object.fromEntries(Object.entries(stored).filter(([name, value]) => left(name, value)))
42
+ },
43
+ change: {
44
+ from: from.country,
45
+ to: to.country,
46
+ notCarried: carried.notCarried.flatMap((field) => {
47
+ if (!isCountryField(field) || !left(field, draft[field])) return [];
48
+ return [{
49
+ field,
50
+ labelId: labels.get(field) ?? resolveLabelId("", field, from.country)
51
+ }];
52
+ })
53
+ }
54
+ };
55
+ }
56
+ //#endregion
57
+ export { applyCountrySwitch, initialAddressCountry };
58
+
59
+ //# sourceMappingURL=account-address-country-switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-address-country-switch.js","names":[],"sources":["../../../src/matter/account-address-book/account-address-country-switch.ts"],"sourcesContent":["import { addressFields } from '../../sdk/address/address-fields.js';\nimport { isCountryField } from '../../sdk/address/constants.js';\nimport { resolveLabelId } from '../../sdk/address/messages.js';\nimport { switchCountry } from '../../sdk/address/switch-country.js';\nimport type { AddressFieldName, AddressValues, CountryRules } from '../../sdk/address/types.js';\nimport type { MessageId } from '../../sdk/i18n/client.js';\nimport type {\n AccountAddressCountryChange,\n AccountAddressFormDraft,\n EditableField,\n} from './account-address-form-context.js';\n\n/** The values each country's switch set aside, by ISO 3166-1 alpha-3. Never sent. */\nexport type AddressCountryMemory = Readonly<Record<string, AddressValues>>;\n\ntype CountrySwitchInput = Readonly<{\n draft: AccountAddressFormDraft;\n aside: AddressCountryMemory;\n from: CountryRules;\n to: CountryRules;\n}>;\n\ntype CountrySwitchResult = Readonly<{\n draft: AccountAddressFormDraft;\n aside: AddressCountryMemory;\n change: AccountAddressCountryChange;\n}>;\n\nfunction isBlank(value: string | null | undefined): boolean {\n return value === null || value === undefined || value.trim() === '';\n}\n\n/**\n * The country a new address starts in: the preferred one when the store ships there or the list is\n * unknown, else the first country of the list, in the platform's order. `defaultCountry` comes\n * trimmed and upper-cased.\n */\nexport function initialAddressCountry(countries: readonly string[] | null, defaultCountry: string): string {\n if (!countries || countries.includes(defaultCountry)) return defaultCountry;\n return countries[0] ?? defaultCountry;\n}\n\n/**\n * Applies a country switch to the draft. What the new country cannot take is kept for the old one,\n * and what was kept for the new one comes back in every field the switch leaves empty, when it\n * passes the new country's rules with the rest of the draft: a city returns with its state. The\n * change lists the draft's values that stayed behind, with the old country's labels.\n */\nexport function applyCountrySwitch({ draft, aside, from, to }: CountrySwitchInput): CountrySwitchResult {\n const stored = aside[to.country] ?? {};\n const carried = switchCountry(draft, from, to);\n const offered = (Object.keys(stored) as AddressFieldName[]).filter(\n (name) => !isBlank(stored[name]) && isBlank(carried.values[name]),\n );\n const { values } = switchCountry(\n { ...draft, ...Object.fromEntries(offered.map((name) => [name, stored[name]])) },\n from,\n to,\n );\n\n const next: Partial<Record<EditableField, string>> = {};\n for (const [name, value] of Object.entries(values) as [AddressFieldName, string][]) {\n if (name !== 'name') next[name] = value;\n }\n\n const left = (name: AddressFieldName, value: string | null | undefined) => values[name] !== value;\n const labels = new Map(addressFields(from, draft).map(({ name, labelId }) => [name, labelId]));\n\n return {\n draft: next,\n aside: {\n ...aside,\n [from.country]: Object.fromEntries(\n Object.entries(carried.setAside).filter(([name, value]) => left(name as AddressFieldName, value)),\n ),\n [to.country]: Object.fromEntries(\n Object.entries(stored).filter(([name, value]) => left(name as AddressFieldName, value)),\n ),\n },\n change: {\n from: from.country,\n to: to.country,\n notCarried: carried.notCarried.flatMap((field) => {\n if (!isCountryField(field) || !left(field, draft[field])) return [];\n const labelId: MessageId = labels.get(field) ?? resolveLabelId('', field, from.country);\n return [{ field, labelId }];\n }),\n },\n };\n}\n"],"mappings":";;;;;AA4BA,SAAS,QAAQ,OAA2C;CAC1D,OAAO,UAAU,QAAQ,UAAU,KAAA,KAAa,MAAM,KAAK,MAAM;AACnE;;;;;;AAOA,SAAgB,sBAAsB,WAAqC,gBAAgC;CACzG,IAAI,CAAC,aAAa,UAAU,SAAS,cAAc,GAAG,OAAO;CAC7D,OAAO,UAAU,MAAM;AACzB;;;;;;;AAQA,SAAgB,mBAAmB,EAAE,OAAO,OAAO,MAAM,MAA+C;CACtG,MAAM,SAAS,MAAM,GAAG,YAAY,CAAC;CACrC,MAAM,UAAU,cAAc,OAAO,MAAM,EAAE;CAC7C,MAAM,UAAW,OAAO,KAAK,MAAM,CAAC,CAAwB,QACzD,SAAS,CAAC,QAAQ,OAAO,KAAK,KAAK,QAAQ,QAAQ,OAAO,KAAK,CAClE;CACA,MAAM,EAAE,WAAW,cACjB;EAAE,GAAG;EAAO,GAAG,OAAO,YAAY,QAAQ,KAAK,SAAS,CAAC,MAAM,OAAO,KAAK,CAAC,CAAC;CAAE,GAC/E,MACA,EACF;CAEA,MAAM,OAA+C,CAAC;CACtD,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,GAC/C,IAAI,SAAS,QAAQ,KAAK,QAAQ;CAGpC,MAAM,QAAQ,MAAwB,UAAqC,OAAO,UAAU;CAC5F,MAAM,SAAS,IAAI,IAAI,cAAc,MAAM,KAAK,CAAC,CAAC,KAAK,EAAE,MAAM,cAAc,CAAC,MAAM,OAAO,CAAC,CAAC;CAE7F,OAAO;EACL,OAAO;EACP,OAAO;GACL,GAAG;IACF,KAAK,UAAU,OAAO,YACrB,OAAO,QAAQ,QAAQ,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,WAAW,KAAK,MAA0B,KAAK,CAAC,CAClG;IACC,GAAG,UAAU,OAAO,YACnB,OAAO,QAAQ,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,WAAW,KAAK,MAA0B,KAAK,CAAC,CACxF;EACF;EACA,QAAQ;GACN,MAAM,KAAK;GACX,IAAI,GAAG;GACP,YAAY,QAAQ,WAAW,SAAS,UAAU;IAChD,IAAI,CAAC,eAAe,KAAK,KAAK,CAAC,KAAK,OAAO,MAAM,MAAM,GAAG,OAAO,CAAC;IAElE,OAAO,CAAC;KAAE;KAAO,SADU,OAAO,IAAI,KAAK,KAAK,eAAe,IAAI,OAAO,KAAK,OAAO;IAC7D,CAAC;GAC5B,CAAC;EACH;CACF;AACF"}
@@ -0,0 +1,36 @@
1
+ import { ComponentDefinition } from "../../core/dist/define-component.js";
2
+ import "../../core/dist/index.js";
3
+ //#region src/matter/account-address-book/account-address-country.d.ts
4
+ /** The shipping countries the control reads. `countries` is ISO 3166-1 alpha-3, in the platform's order. */
5
+ export type AddressCountryControlSlice = Readonly<{
6
+ countries: readonly string[];
7
+ source: 'PLATFORM' | 'SALES_CHANNEL_FALLBACK';
8
+ }>;
9
+ export type AddressCountryControlProps = Readonly<{
10
+ /** Unwrapped `shippingCountries` from the reactive runtime: `null` when the read failed, absent outside the page query. */
11
+ $data?: AddressCountryControlSlice | null;
12
+ /** The select's label. A blank value falls back to the catalog copy. */
13
+ label?: string;
14
+ className?: string;
15
+ }>;
16
+ export type AccountAddressCountryNoticeProps = Readonly<{
17
+ /** Replaces the whole sentence, with the same ICU arguments. A blank value falls back to the catalog copy. */
18
+ message?: string;
19
+ className?: string;
20
+ }>;
21
+ export declare const AddressCountryControlDefinition: ComponentDefinition<Readonly<{
22
+ /** Unwrapped `shippingCountries` from the reactive runtime: `null` when the read failed, absent outside the page query. */
23
+ $data?: AddressCountryControlSlice | null;
24
+ /** The select's label. A blank value falls back to the catalog copy. */
25
+ label?: string;
26
+ className?: string;
27
+ }>>;
28
+ export declare const AccountAddressCountryNoticeDefinition: ComponentDefinition<Readonly<{
29
+ /** Replaces the whole sentence, with the same ICU arguments. A blank value falls back to the catalog copy. */
30
+ message?: string;
31
+ className?: string;
32
+ }>>;
33
+ export declare function AddressCountryControl({ $data: $dataProp, label, className }: AddressCountryControlProps): import("react/jsx-runtime").JSX.Element | null;
34
+ export declare function AccountAddressCountryNotice({ message, className }: AccountAddressCountryNoticeProps): import("react/jsx-runtime").JSX.Element;
35
+ //#endregion
36
+ //# sourceMappingURL=account-address-country.d.ts.map
@@ -0,0 +1,151 @@
1
+ "use client";
2
+ import { defineComponent } from "../../core/dist/define-component.js";
3
+ import "../../core/dist/index.js";
4
+ import { useStorefrontContext } from "../../sdk/context/storefront-context.js";
5
+ import { useStorefrontFormatters } from "../../sdk/format/client.js";
6
+ import { useIntl } from "../../sdk/i18n/client.js";
7
+ import { useDataOverride } from "../../sdk/data/data-override-context.js";
8
+ import { resolveAuthoredCopy } from "../../utils/resolve-authored-copy.js";
9
+ import { countryDisplayName } from "../../sdk/address/country-display.js";
10
+ import { AccountAddressBookSkeleton } from "./account-address-book.js";
11
+ import { Select } from "../../particles/select/select.js";
12
+ import { useAccountAddressForm } from "./account-address-form-context.js";
13
+ import { useEffect, useMemo } from "react";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
15
+ const AddressCountryControlDefinition = defineComponent({
16
+ name: "AddressCountryControl",
17
+ importPath: "@vtex/faststore/components",
18
+ component: AddressCountryControl,
19
+ fragment: `
20
+ fragment AddressCountryControlData on Query {
21
+ shippingCountries {
22
+ countries
23
+ source
24
+ }
25
+ }
26
+ `,
27
+ fetchStrategy: "reactive",
28
+ requiresContext: "account-address-form",
29
+ skeleton: AccountAddressBookSkeleton,
30
+ editor: {
31
+ label: "Address Country Control",
32
+ category: "input"
33
+ },
34
+ schema: { label: {
35
+ type: "string",
36
+ label: "Field label"
37
+ } },
38
+ guideline: "The country of the address. A new address picks it from the countries the store ships to, in a list sorted by name, when there are two or more; with one it shows nothing, and the address takes that country. A saved address keeps its country, shown as text, and so does a new one when the list could not be read. Changing it keeps the fields the new country takes, and brings back what was typed for that country before. Compose it explicitly under AccountAddressFormRoot to offer the choice: in the root's default composition it gets no list and shows the root's defaultCountry as text. Place AccountAddressCountryNotice next to it. Must be inside AccountAddressFormRoot."
39
+ });
40
+ const AccountAddressCountryNoticeDefinition = defineComponent({
41
+ name: "AccountAddressCountryNotice",
42
+ importPath: "@vtex/faststore/components",
43
+ component: AccountAddressCountryNotice,
44
+ requiresContext: "account-address-form",
45
+ editor: {
46
+ label: "Account Address Country Notice",
47
+ category: "content"
48
+ },
49
+ schema: { message: {
50
+ type: "string",
51
+ label: "Notice message"
52
+ } },
53
+ guideline: "Says which fields a country change left behind, and that they come back on switching back. Announced politely, and empty until a change leaves something behind. The message takes count, country, previous and fields as ICU arguments. Place it right after AddressCountryControl. Must be inside AccountAddressFormRoot."
54
+ });
55
+ function AddressCountryControl({ $data: $dataProp, label, className }) {
56
+ const slice = useDataOverride($dataProp);
57
+ const { mode, country, pending, countryChoice: { offer, selected, change } } = useAccountAddressForm();
58
+ const { displayName } = useStorefrontFormatters();
59
+ const { locale } = useStorefrontContext();
60
+ const intl = useIntl();
61
+ const countries = slice?.countries ?? null;
62
+ const reported = countries?.join(",") ?? null;
63
+ useEffect(() => offer(reported === null ? null : reported.split(",").filter(Boolean)), [offer, reported]);
64
+ const options = useMemo(() => {
65
+ const collator = new Intl.Collator(locale);
66
+ return (countries ?? []).map((code) => ({
67
+ value: code,
68
+ label: countryDisplayName(code, displayName) ?? code
69
+ })).sort((a, b) => collator.compare(a.label, b.label));
70
+ }, [
71
+ countries,
72
+ locale,
73
+ displayName
74
+ ]);
75
+ const wrapper = {
76
+ className,
77
+ "data-fs-address-country-control": "",
78
+ ...selected !== country ? { "data-fs-address-country-control-pending": "" } : {}
79
+ };
80
+ if (mode === "add" && countries?.length === 1) return null;
81
+ if (mode === "add" && countries && countries.length > 1) return /* @__PURE__ */ jsx("div", {
82
+ ...wrapper,
83
+ "data-fs-address-country-control-mode": "select",
84
+ children: /* @__PURE__ */ jsxs(Select.Root, {
85
+ value: selected,
86
+ disabled: pending,
87
+ onValueChange: (value) => value && change(value),
88
+ children: [
89
+ /* @__PURE__ */ jsx(Select.Label, { children: resolveAuthoredCopy(label, intl.formatMessage({ id: "fs/address-form.country" })) }),
90
+ /* @__PURE__ */ jsxs(Select.Trigger, {
91
+ "data-fs-account-address-form-control": "",
92
+ disabled: pending,
93
+ children: [/* @__PURE__ */ jsx(Select.Value, { children: (value) => options.find((option) => option.value === value)?.label ?? countryDisplayName(value, displayName) ?? value }), /* @__PURE__ */ jsx(Select.Icon, {})]
94
+ }),
95
+ /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, { children: /* @__PURE__ */ jsx(Select.Popup, { children: /* @__PURE__ */ jsx(Select.List, { children: options.map((option) => /* @__PURE__ */ jsx(Select.Item, {
96
+ value: option.value,
97
+ label: option.label,
98
+ children: /* @__PURE__ */ jsx(Select.ItemText, { children: option.label })
99
+ }, option.value)) }) }) }) })
100
+ ]
101
+ })
102
+ });
103
+ const name = countryDisplayName(country, displayName);
104
+ if (!name) return null;
105
+ return /* @__PURE__ */ jsx("div", {
106
+ ...wrapper,
107
+ "data-fs-address-country-control-mode": "text",
108
+ children: /* @__PURE__ */ jsx("p", {
109
+ "data-fs-address-country-control-text": "",
110
+ children: name
111
+ })
112
+ });
113
+ }
114
+ function describeChange({ change, message, intl, formatters }) {
115
+ if (!change || change.notCarried.length === 0) return "";
116
+ const { displayName, formatList } = formatters;
117
+ const values = {
118
+ count: change.notCarried.length,
119
+ country: countryDisplayName(change.to, displayName) ?? change.to,
120
+ previous: countryDisplayName(change.from, displayName) ?? change.from,
121
+ fields: formatList(change.notCarried.map(({ labelId }) => intl.formatMessage({ id: labelId })))
122
+ };
123
+ const fallback = intl.formatMessage({ id: "fs/address-form.country-notice" }, values);
124
+ const authored = resolveAuthoredCopy(message, "");
125
+ if (!authored) return fallback;
126
+ try {
127
+ return String(intl.formatters.getMessageFormat(authored, intl.locale).format(values));
128
+ } catch {
129
+ return fallback;
130
+ }
131
+ }
132
+ function AccountAddressCountryNotice({ message, className }) {
133
+ const { countryChoice: { lastChange } } = useAccountAddressForm();
134
+ const intl = useIntl();
135
+ const formatters = useStorefrontFormatters();
136
+ return /* @__PURE__ */ jsx("output", {
137
+ "aria-live": "polite",
138
+ className,
139
+ "data-fs-account-address-country-notice": "",
140
+ children: describeChange({
141
+ change: lastChange,
142
+ message,
143
+ intl,
144
+ formatters
145
+ })
146
+ });
147
+ }
148
+ //#endregion
149
+ export { AccountAddressCountryNotice, AccountAddressCountryNoticeDefinition, AddressCountryControl, AddressCountryControlDefinition };
150
+
151
+ //# sourceMappingURL=account-address-country.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-address-country.js","names":[],"sources":["../../../src/matter/account-address-book/account-address-country.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport { useEffect, useMemo } from 'react';\nimport { Select } from '../../particles/select/select.js';\nimport { countryDisplayName } from '../../sdk/address/country-display.js';\nimport { useStorefrontContext } from '../../sdk/context/storefront-context.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { useStorefrontFormatters } from '../../sdk/format/client.js';\nimport { useIntl } from '../../sdk/i18n/client.js';\nimport { resolveAuthoredCopy } from '../../utils/resolve-authored-copy.js';\nimport { AccountAddressBookSkeleton } from './account-address-book.js';\nimport { type AccountAddressCountryChange, useAccountAddressForm } from './account-address-form-context.js';\n\n/**\n * The country of a new address, chosen from where the store ships, and the notice that says what a switch\n * left behind. The control reads `shippingCountries` through its own fragment and reports the list to the\n * form, which owns the country, the switch and the values set aside. Neither part touches the draft.\n */\n\nconst fragment = /* GraphQL */ `\n fragment AddressCountryControlData on Query {\n shippingCountries {\n countries\n source\n }\n }\n`;\n\n/** The shipping countries the control reads. `countries` is ISO 3166-1 alpha-3, in the platform's order. */\nexport type AddressCountryControlSlice = Readonly<{\n countries: readonly string[];\n source: 'PLATFORM' | 'SALES_CHANNEL_FALLBACK';\n}>;\n\nexport type AddressCountryControlProps = Readonly<{\n /** Unwrapped `shippingCountries` from the reactive runtime: `null` when the read failed, absent outside the page query. */\n $data?: AddressCountryControlSlice | null;\n /** The select's label. A blank value falls back to the catalog copy. */\n label?: string;\n className?: string;\n}>;\n\nexport type AccountAddressCountryNoticeProps = Readonly<{\n /** Replaces the whole sentence, with the same ICU arguments. A blank value falls back to the catalog copy. */\n message?: string;\n className?: string;\n}>;\n\nexport const AddressCountryControlDefinition = defineComponent<AddressCountryControlProps>({\n name: 'AddressCountryControl',\n importPath: '@vtex/faststore/components',\n component: AddressCountryControl,\n fragment,\n fetchStrategy: 'reactive',\n requiresContext: 'account-address-form',\n skeleton: AccountAddressBookSkeleton,\n editor: { label: 'Address Country Control', category: 'input' },\n schema: {\n label: { type: 'string', label: 'Field label' },\n },\n guideline:\n \"The country of the address. A new address picks it from the countries the store ships to, in a list sorted by name, when there are two or more; with one it shows nothing, and the address takes that country. A saved address keeps its country, shown as text, and so does a new one when the list could not be read. Changing it keeps the fields the new country takes, and brings back what was typed for that country before. Compose it explicitly under AccountAddressFormRoot to offer the choice: in the root's default composition it gets no list and shows the root's defaultCountry as text. Place AccountAddressCountryNotice next to it. Must be inside AccountAddressFormRoot.\",\n});\n\nexport const AccountAddressCountryNoticeDefinition = defineComponent<AccountAddressCountryNoticeProps>({\n name: 'AccountAddressCountryNotice',\n importPath: '@vtex/faststore/components',\n component: AccountAddressCountryNotice,\n requiresContext: 'account-address-form',\n editor: { label: 'Account Address Country Notice', category: 'content' },\n schema: {\n message: { type: 'string', label: 'Notice message' },\n },\n guideline:\n 'Says which fields a country change left behind, and that they come back on switching back. Announced politely, and empty until a change leaves something behind. The message takes count, country, previous and fields as ICU arguments. Place it right after AddressCountryControl. Must be inside AccountAddressFormRoot.',\n});\n\ntype CountryOption = Readonly<{ value: string; label: string }>;\n\nexport function AddressCountryControl({ $data: $dataProp, label, className }: AddressCountryControlProps) {\n const slice = useDataOverride<AddressCountryControlSlice | null | undefined>($dataProp);\n const {\n mode,\n country,\n pending,\n countryChoice: { offer, selected, change },\n } = useAccountAddressForm();\n const { displayName } = useStorefrontFormatters();\n const { locale } = useStorefrontContext();\n const intl = useIntl();\n\n // A slice from another ancestor's provider has no `countries`: the list is unknown then.\n const countries = slice?.countries ?? null;\n const reported = countries?.join(',') ?? null;\n\n useEffect(() => offer(reported === null ? null : reported.split(',').filter(Boolean)), [offer, reported]);\n\n const options = useMemo<readonly CountryOption[]>(() => {\n const collator = new Intl.Collator(locale);\n return (countries ?? [])\n .map((code) => ({ value: code, label: countryDisplayName(code, displayName) ?? code }))\n .sort((a, b) => collator.compare(a.label, b.label));\n }, [countries, locale, displayName]);\n\n const switching = selected !== country;\n const wrapper = {\n className,\n 'data-fs-address-country-control': '',\n ...(switching ? { 'data-fs-address-country-control-pending': '' } : {}),\n };\n\n if (mode === 'add' && countries?.length === 1) return null;\n\n if (mode === 'add' && countries && countries.length > 1) {\n return (\n <div {...wrapper} data-fs-address-country-control-mode=\"select\">\n <Select.Root value={selected} disabled={pending} onValueChange={(value) => value && change(value)}>\n <Select.Label>\n {resolveAuthoredCopy(label, intl.formatMessage({ id: 'fs/address-form.country' }))}\n </Select.Label>\n <Select.Trigger data-fs-account-address-form-control=\"\" disabled={pending}>\n <Select.Value>\n {(value) =>\n options.find((option) => option.value === value)?.label ??\n countryDisplayName(value, displayName) ??\n value\n }\n </Select.Value>\n <Select.Icon />\n </Select.Trigger>\n <Select.Portal>\n <Select.Positioner>\n <Select.Popup>\n <Select.List>\n {options.map((option) => (\n <Select.Item key={option.value} value={option.value} label={option.label}>\n <Select.ItemText>{option.label}</Select.ItemText>\n </Select.Item>\n ))}\n </Select.List>\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n </div>\n );\n }\n\n const name = countryDisplayName(country, displayName);\n if (!name) return null;\n\n return (\n <div {...wrapper} data-fs-address-country-control-mode=\"text\">\n <p data-fs-address-country-control-text=\"\">{name}</p>\n </div>\n );\n}\n\ntype DescribeChangeInput = Readonly<{\n change: AccountAddressCountryChange | null;\n message: string | undefined;\n intl: ReturnType<typeof useIntl>;\n formatters: ReturnType<typeof useStorefrontFormatters>;\n}>;\n\nfunction describeChange({ change, message, intl, formatters }: DescribeChangeInput): string {\n if (!change || change.notCarried.length === 0) return '';\n const { displayName, formatList } = formatters;\n const values = {\n count: change.notCarried.length,\n country: countryDisplayName(change.to, displayName) ?? change.to,\n previous: countryDisplayName(change.from, displayName) ?? change.from,\n fields: formatList(change.notCarried.map(({ labelId }) => intl.formatMessage({ id: labelId }))),\n };\n const fallback = intl.formatMessage({ id: 'fs/address-form.country-notice' }, values);\n const authored = resolveAuthoredCopy(message, '');\n if (!authored) return fallback;\n try {\n return String(intl.formatters.getMessageFormat(authored, intl.locale).format(values));\n } catch {\n // An authored message is free text: a malformed ICU pattern falls back to the catalog copy.\n return fallback;\n }\n}\n\nexport function AccountAddressCountryNotice({ message, className }: AccountAddressCountryNoticeProps) {\n const {\n countryChoice: { lastChange },\n } = useAccountAddressForm();\n const intl = useIntl();\n const formatters = useStorefrontFormatters();\n\n return (\n <output aria-live=\"polite\" className={className} data-fs-account-address-country-notice=\"\">\n {describeChange({ change: lastChange, message, intl, formatters })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CACjD,CAAA;AAET;AASA,SAAS,eAAe,EAAE,QAAQ,SAAS,MAAM,cAA2C;CAC1F,IAAI,CAAC,UAAU,OAAO,WAAW,WAAW,GAAG,OAAO;CACtD,MAAM,EAAE,aAAa,eAAe;CACpC,MAAM,SAAS;EACb,OAAO,OAAO,WAAW;EACzB,SAAS,mBAAmB,OAAO,IAAI,WAAW,KAAK,OAAO;EAC9D,UAAU,mBAAmB,OAAO,MAAM,WAAW,KAAK,OAAO;EACjE,QAAQ,WAAW,OAAO,WAAW,KAAK,EAAE,cAAc,KAAK,cAAc,EAAE,IAAI,QAAQ,CAAC,CAAC,CAAC;CAChG;CACA,MAAM,WAAW,KAAK,cAAc,EAAE,IAAI,iCAAiC,GAAG,MAAM;CACpF,MAAM,WAAW,oBAAoB,SAAS,EAAE;CAChD,IAAI,CAAC,UAAU,OAAO;CACtB,IAAI;EACF,OAAO,OAAO,KAAK,WAAW,iBAAiB,UAAU,KAAK,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC;CACtF,QAAQ;EAEN,OAAO;CACT;AACF;AAEA,SAAgB,4BAA4B,EAAE,SAAS,aAA+C;CACpG,MAAM,EACJ,eAAe,EAAE,iBACf,sBAAsB;CAC1B,MAAM,OAAO,QAAQ;CACrB,MAAM,aAAa,wBAAwB;CAE3C,OACE,oBAAC,UAAD;EAAQ,aAAU;EAAoB;EAAW,0CAAuC;EACrF,UAAA,eAAe;GAAE,QAAQ;GAAY;GAAS;GAAM;EAAW,CAAC;CAC3D,CAAA;AAEZ"}
@@ -0,0 +1,11 @@
1
+ import { formatAddress } from "../../sdk/address/format-address.js";
2
+ //#region src/matter/account-address-book/account-address-first-line.ts
3
+ /** The text of the address's first printed line, so a button says which address it acts on. */
4
+ function firstLine(address) {
5
+ const [line] = formatAddress(address, address.country ?? "");
6
+ return (line ?? []).map(({ field, separator }) => `${separator ?? ""}${address[field] ?? ""}`).join("");
7
+ }
8
+ //#endregion
9
+ export { firstLine };
10
+
11
+ //# sourceMappingURL=account-address-first-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-address-first-line.js","names":[],"sources":["../../../src/matter/account-address-book/account-address-first-line.ts"],"sourcesContent":["import { formatAddress } from '../../sdk/address/format-address.js';\nimport type { AccountAddressBookItemSlice } from './account-address-book.js';\n\n/** The text of the address's first printed line, so a button says which address it acts on. */\nexport function firstLine(address: AccountAddressBookItemSlice): string {\n const [line] = formatAddress(address, address.country ?? '');\n return (line ?? []).map(({ field, separator }) => `${separator ?? ''}${address[field] ?? ''}`).join('');\n}\n"],"mappings":";;;AAIA,SAAgB,UAAU,SAA8C;CACtE,MAAM,CAAC,QAAQ,cAAc,SAAS,QAAQ,WAAW,EAAE;CAC3D,QAAQ,QAAQ,CAAC,EAAA,CAAG,KAAK,EAAE,OAAO,gBAAgB,GAAG,aAAa,KAAK,QAAQ,UAAU,IAAI,CAAC,CAAC,KAAK,EAAE;AACxG"}
@@ -0,0 +1,55 @@
1
+ import { MessageId } from "../../sdk/i18n/locales.js";
2
+ import "../../sdk/i18n/client.js";
3
+ import { AddressFieldError, AddressFieldName, CountryRules } from "../../sdk/address/types.js";
4
+ //#region src/matter/account-address-book/account-address-form-context.d.ts
5
+ export type EditableField = Exclude<AddressFieldName, 'name'>;
6
+ /** The draft: the address fields the form edits. `name` is not edited, as `CustomerAddress` has none. */
7
+ export type AccountAddressFormDraft = Readonly<Partial<Record<EditableField, string>>>;
8
+ export type AccountAddressFormFieldErrors = Readonly<Partial<Record<AddressFieldName, AddressFieldError>>>;
9
+ /** What a refusal that names no field on screen says. */
10
+ export type AccountAddressFormErrorKind = 'unrenderedField' | 'notFound' | 'unauthorized' | 'saveFailed' | 'rulesFailed' | 'countrySwitchFailed' | 'unsupportedCountry';
11
+ /** What the last applied switch did not carry, for AccountAddressCountryNotice. */
12
+ export type AccountAddressCountryChange = Readonly<{
13
+ /** ISO 3166-1 alpha-3. */
14
+ from: string;
15
+ to: string;
16
+ /** In the old country's field order; empty when everything was carried. */
17
+ notCarried: readonly Readonly<{
18
+ field: AddressFieldName;
19
+ labelId: MessageId;
20
+ }>[];
21
+ }>;
22
+ /**
23
+ * The country choice, the only part of the form the country control and the notice touch. The
24
+ * values set aside on a switch stay with the draft's owner, behind `change`.
25
+ */
26
+ export type AccountAddressFormCountryChoice = Readonly<{
27
+ /** AddressCountryControl reports its shipping countries; `null` means unknown. Returns the withdrawal. */
28
+ offer: (countries: readonly string[] | null) => () => void;
29
+ /** The country the control shows as chosen: a switch in flight, else `country`. */
30
+ selected: string;
31
+ /** Starts a switch in add mode. Ignored in edit mode. `change(country)` cancels a switch in flight. */
32
+ change: (to: string) => void;
33
+ /** `null` until a switch applies, and always in edit mode. */
34
+ lastChange: AccountAddressCountryChange | null;
35
+ }>;
36
+ export type AccountAddressFormContextValue = Readonly<{
37
+ mode: 'add' | 'edit';
38
+ /** ISO 3166-1 alpha-3, upper case. Empty while a new address's country is not resolved yet. */
39
+ country: string;
40
+ /** `null` until the country's rules loaded. */
41
+ rules: CountryRules | null;
42
+ draft: AccountAddressFormDraft;
43
+ fieldErrors: AccountAddressFormFieldErrors;
44
+ formError: AccountAddressFormErrorKind | null;
45
+ pending: boolean;
46
+ setField: (name: EditableField, value: string) => void;
47
+ /** A field part calls this while it is on screen, so a refusal on a field with no control is told apart. */
48
+ registerField: (name: AddressFieldName) => () => void;
49
+ close: () => void;
50
+ countryChoice: AccountAddressFormCountryChoice;
51
+ }>;
52
+ /** The form's draft, errors and state, for any part composed under `AccountAddressFormRoot`. */
53
+ export declare function useAccountAddressForm(): AccountAddressFormContextValue;
54
+ //#endregion
55
+ //# sourceMappingURL=account-address-form-context.d.ts.map
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import { createContext, useContext } from "react";
3
+ //#region src/matter/account-address-book/account-address-form-context.ts
4
+ const AccountAddressFormContext = createContext(null);
5
+ /** The form's draft, errors and state, for any part composed under `AccountAddressFormRoot`. */
6
+ function useAccountAddressForm() {
7
+ const value = useContext(AccountAddressFormContext);
8
+ if (!value) throw new Error("Address form parts must be used inside an AccountAddressFormRoot.");
9
+ return value;
10
+ }
11
+ //#endregion
12
+ export { AccountAddressFormContext, useAccountAddressForm };
13
+
14
+ //# sourceMappingURL=account-address-form-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-address-form-context.js","names":[],"sources":["../../../src/matter/account-address-book/account-address-form-context.ts"],"sourcesContent":["'use client';\n\nimport { createContext, useContext } from 'react';\nimport type { AddressFieldError, AddressFieldName, CountryRules } from '../../sdk/address/types.js';\nimport type { MessageId } from '../../sdk/i18n/client.js';\n\nexport type EditableField = Exclude<AddressFieldName, 'name'>;\n\n/** The draft: the address fields the form edits. `name` is not edited, as `CustomerAddress` has none. */\nexport type AccountAddressFormDraft = Readonly<Partial<Record<EditableField, string>>>;\n\nexport type AccountAddressFormFieldErrors = Readonly<Partial<Record<AddressFieldName, AddressFieldError>>>;\n\n/** What a refusal that names no field on screen says. */\nexport type AccountAddressFormErrorKind =\n | 'unrenderedField'\n | 'notFound'\n | 'unauthorized'\n | 'saveFailed'\n | 'rulesFailed'\n | 'countrySwitchFailed'\n | 'unsupportedCountry';\n\n/** What the last applied switch did not carry, for AccountAddressCountryNotice. */\nexport type AccountAddressCountryChange = Readonly<{\n /** ISO 3166-1 alpha-3. */\n from: string;\n to: string;\n /** In the old country's field order; empty when everything was carried. */\n notCarried: readonly Readonly<{ field: AddressFieldName; labelId: MessageId }>[];\n}>;\n\n/**\n * The country choice, the only part of the form the country control and the notice touch. The\n * values set aside on a switch stay with the draft's owner, behind `change`.\n */\nexport type AccountAddressFormCountryChoice = Readonly<{\n /** AddressCountryControl reports its shipping countries; `null` means unknown. Returns the withdrawal. */\n offer: (countries: readonly string[] | null) => () => void;\n /** The country the control shows as chosen: a switch in flight, else `country`. */\n selected: string;\n /** Starts a switch in add mode. Ignored in edit mode. `change(country)` cancels a switch in flight. */\n change: (to: string) => void;\n /** `null` until a switch applies, and always in edit mode. */\n lastChange: AccountAddressCountryChange | null;\n}>;\n\nexport type AccountAddressFormContextValue = Readonly<{\n mode: 'add' | 'edit';\n /** ISO 3166-1 alpha-3, upper case. Empty while a new address's country is not resolved yet. */\n country: string;\n /** `null` until the country's rules loaded. */\n rules: CountryRules | null;\n draft: AccountAddressFormDraft;\n fieldErrors: AccountAddressFormFieldErrors;\n formError: AccountAddressFormErrorKind | null;\n pending: boolean;\n setField: (name: EditableField, value: string) => void;\n /** A field part calls this while it is on screen, so a refusal on a field with no control is told apart. */\n registerField: (name: AddressFieldName) => () => void;\n close: () => void;\n countryChoice: AccountAddressFormCountryChoice;\n}>;\n\nexport const AccountAddressFormContext = createContext<AccountAddressFormContextValue | null>(null);\n\n/** The form's draft, errors and state, for any part composed under `AccountAddressFormRoot`. */\nexport function useAccountAddressForm(): AccountAddressFormContextValue {\n const value = useContext(AccountAddressFormContext);\n if (!value) {\n throw new Error('Address form parts must be used inside an AccountAddressFormRoot.');\n }\n return value;\n}\n"],"mappings":";;;AAgEA,MAAa,4BAA4B,cAAqD,IAAI;;AAGlG,SAAgB,wBAAwD;CACtE,MAAM,QAAQ,WAAW,yBAAyB;CAClD,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,mEAAmE;CAErF,OAAO;AACT"}
@@ -0,0 +1,85 @@
1
+ import { ComponentDefinition } from "../../core/dist/define-component.js";
2
+ import "../../core/dist/index.js";
3
+ import { PageRef } from "../../sdk/navigation/types.js";
4
+ import { ComponentActions } from "../../sdk/actions/types.js";
5
+ import { ComponentPropsWithRef } from "react";
6
+ //#region src/matter/account-address-book/account-address-form.d.ts
7
+ /**
8
+ * The form that adds an address and corrects a saved one (specs/sfs-3441-address-book-form.md, RFC
9
+ * REQ-02 and REQ-03). The Root renders `FormRoot` and registers one fieldset with it, under the
10
+ * `accountAddress` namespace: react-hook-form holds the draft and knows what is dirty, and the
11
+ * fieldset owns the field errors, the form-level error, the status message and the save. It holds no
12
+ * country rule: the fields come from `addressFields`, the verdict from `validateAddress`, and the
13
+ * writes go through `$actions.address`.
14
+ */
15
+ export type AccountAddressFormRootProps = ComponentPropsWithRef<'form'> & {
16
+ /**
17
+ * ISO 3166-1 alpha-3 country a new address prefers: taken when the store ships there or its list
18
+ * is unknown. A blank value falls back to `BRA`.
19
+ */
20
+ defaultCountry?: string;
21
+ /** Toast after an address is added. A blank value falls back to the catalog copy. */
22
+ addedMessage?: string;
23
+ /** Toast after an address is saved. A blank value falls back to the catalog copy. */
24
+ savedMessage?: string;
25
+ /** Announced when a save is blocked. A blank value falls back to the catalog copy. */
26
+ blockedMessage?: string;
27
+ /** Where leaving the form goes when it stands on its own page. A page reference, or a site-relative string. A blank value falls back to the address page. */
28
+ returnHref?: PageRef | string;
29
+ /** Injected by the compiler from `actions: { address: [...] }`; the address write surface. */
30
+ $actions?: ComponentActions;
31
+ };
32
+ /** `className` goes on every field's wrapper. */
33
+ export type AccountAddressFormFieldsProps = Readonly<{
34
+ className?: string;
35
+ }>;
36
+ export type AccountAddressFormLabelProps = Readonly<{
37
+ /** The field's label. A blank value falls back to the catalog copy. */
38
+ label?: string;
39
+ className?: string;
40
+ }>;
41
+ export type AccountAddressFormErrorProps = ComponentPropsWithRef<'div'> & {
42
+ /** Each message below falls back to the catalog copy when blank. */
43
+ unrenderedFieldMessage?: string;
44
+ notFoundMessage?: string;
45
+ unauthorizedMessage?: string;
46
+ saveFailedMessage?: string;
47
+ rulesFailedMessage?: string;
48
+ countrySwitchFailedMessage?: string;
49
+ unsupportedCountryMessage?: string;
50
+ };
51
+ export type AccountAddressFormButtonProps = Omit<ComponentPropsWithRef<'button'>, 'type'> & {
52
+ /** The button's text. A blank value falls back to the catalog copy. */
53
+ label?: string;
54
+ };
55
+ export declare function AccountAddressFormRoot({ defaultCountry, addedMessage, savedMessage, blockedMessage, returnHref, $actions, className, children, ...props }: AccountAddressFormRootProps): import("react/jsx-runtime").JSX.Element | null;
56
+ export declare function AccountAddressFormRecipientName({ label, className }: AccountAddressFormLabelProps): import("react/jsx-runtime").JSX.Element | null;
57
+ export declare function AccountAddressFormReference({ label, className }: AccountAddressFormLabelProps): import("react/jsx-runtime").JSX.Element | null;
58
+ /**
59
+ * One field per descriptor the country's rules give for the draft, in the order the country's form lists them.
60
+ * A complete postal code fills the empty state, city, neighborhood and street the shopper has not typed;
61
+ * the fill is announced once.
62
+ */
63
+ export declare function AccountAddressFormFields({ className }: AccountAddressFormFieldsProps): import("react/jsx-runtime").JSX.Element[] | null;
64
+ export declare function AccountAddressFormError({ unrenderedFieldMessage, notFoundMessage, unauthorizedMessage, saveFailedMessage, rulesFailedMessage, countrySwitchFailedMessage, unsupportedCountryMessage, className, ...props }: AccountAddressFormErrorProps): import("react/jsx-runtime").JSX.Element | null;
65
+ export declare function AccountAddressFormSubmit({ label, className, children, ...props }: AccountAddressFormButtonProps): import("react/jsx-runtime").JSX.Element;
66
+ export declare function AccountAddressFormCancel({ label, className, children, onClick, ...props }: AccountAddressFormButtonProps): import("react/jsx-runtime").JSX.Element;
67
+ export declare const AccountAddressFormRootDefinition: ComponentDefinition<AccountAddressFormRootProps>;
68
+ export declare const AccountAddressFormRecipientNameDefinition: ComponentDefinition<Readonly<{
69
+ /** The field's label. A blank value falls back to the catalog copy. */
70
+ label?: string;
71
+ className?: string;
72
+ }>>;
73
+ export declare const AccountAddressFormFieldsDefinition: ComponentDefinition<Readonly<{
74
+ className?: string;
75
+ }>>;
76
+ export declare const AccountAddressFormReferenceDefinition: ComponentDefinition<Readonly<{
77
+ /** The field's label. A blank value falls back to the catalog copy. */
78
+ label?: string;
79
+ className?: string;
80
+ }>>;
81
+ export declare const AccountAddressFormErrorDefinition: ComponentDefinition<AccountAddressFormErrorProps>;
82
+ export declare const AccountAddressFormSubmitDefinition: ComponentDefinition<AccountAddressFormButtonProps>;
83
+ export declare const AccountAddressFormCancelDefinition: ComponentDefinition<AccountAddressFormButtonProps>;
84
+ //#endregion
85
+ //# sourceMappingURL=account-address-form.d.ts.map