@vtex/faststore 0.0.10 → 0.0.12

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 (509) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +0 -1
  3. package/dist/_virtual/_rolldown/runtime.js +4 -0
  4. package/dist/actions.json +6 -1
  5. package/dist/catalog.json +789 -1701
  6. package/dist/cli/index.d.ts +66 -28
  7. package/dist/cli/index.js +7371 -512
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/cli/server-runtime.js +41 -60
  10. package/dist/cli/server-runtime.js.map +1 -1
  11. package/dist/client.d.ts +3 -3
  12. package/dist/client.js +2 -2
  13. package/dist/components.d.ts +63 -57
  14. package/dist/components.js +60 -54
  15. package/dist/content-types.json +5785 -754
  16. package/dist/core/dist/define-component.d.ts +1 -1
  17. package/dist/core/dist/define-content-type.d.ts +50 -2
  18. package/dist/core/dist/define-content-type.js +107 -3
  19. package/dist/core/dist/define-content-type.js.map +1 -1
  20. package/dist/core/dist/index.d.ts +2 -2
  21. package/dist/docs/access-code-field.md +1 -1
  22. package/dist/docs/access-code-sign-in.md +126 -77
  23. package/dist/docs/account-address-book.md +210 -95
  24. package/dist/docs/account-menu.md +14 -15
  25. package/dist/docs/account-saved-cards.md +44 -39
  26. package/dist/docs/alert-dialog.md +3 -1
  27. package/dist/docs/avatar.md +4 -2
  28. package/dist/docs/billing-address.md +99 -30
  29. package/dist/docs/binding-switcher.md +5 -2
  30. package/dist/docs/buy-button.md +7 -8
  31. package/dist/docs/card-entry.md +39 -26
  32. package/dist/docs/card-summary.md +18 -8
  33. package/dist/docs/cardholder-document.md +5 -3
  34. package/dist/docs/carousel.md +5 -4
  35. package/dist/docs/cart-destination.md +39 -26
  36. package/dist/docs/cart-item.md +29 -14
  37. package/dist/docs/cart-totalizer.md +7 -5
  38. package/dist/docs/cart.md +135 -41
  39. package/dist/docs/challenge-return.md +135 -0
  40. package/dist/docs/client-preferences-fieldset.md +10 -5
  41. package/dist/docs/client-preferences.md +31 -8
  42. package/dist/docs/client-profile-fieldset.md +20 -6
  43. package/dist/docs/client-profile.md +12 -3
  44. package/dist/docs/copy-text.md +9 -7
  45. package/dist/docs/document-field.md +1 -1
  46. package/dist/docs/email-field.md +2 -1
  47. package/dist/docs/email-identification.md +12 -2
  48. package/dist/docs/footer-copyright.md +4 -2
  49. package/dist/docs/form.md +54 -18
  50. package/dist/docs/free-shipping-progress.md +6 -5
  51. package/dist/docs/identity-edit.md +8 -2
  52. package/dist/docs/identity-summary.md +18 -5
  53. package/dist/docs/installments.md +46 -32
  54. package/dist/docs/my-account-profile.md +16 -11
  55. package/dist/docs/navigation-link.md +5 -3
  56. package/dist/docs/order-cancel.md +3 -1
  57. package/dist/docs/order-delivery-address.md +7 -5
  58. package/dist/docs/order-delivery-group.md +1 -3
  59. package/dist/docs/order-details-back.md +1 -1
  60. package/dist/docs/order-details-header.md +1 -4
  61. package/dist/docs/order-invoice-download.md +60 -0
  62. package/dist/docs/order-list-row.md +1 -1
  63. package/dist/docs/order-list-search.md +13 -20
  64. package/dist/docs/order-list-views.md +11 -17
  65. package/dist/docs/order-list.md +12 -5
  66. package/dist/docs/order-payment.md +9 -7
  67. package/dist/docs/order-placed-date.md +1 -1
  68. package/dist/docs/order-placed-payment-summary.md +28 -15
  69. package/dist/docs/order-placed.md +49 -14
  70. package/dist/docs/order-progress.md +1 -1
  71. package/dist/docs/order-status-badge.md +20 -9
  72. package/dist/docs/order-summary.md +2 -2
  73. package/dist/docs/order-tracking-link.md +58 -0
  74. package/dist/docs/payment-method-badges.md +30 -4
  75. package/dist/docs/payment-methods.md +1 -1
  76. package/dist/docs/payment.md +36 -17
  77. package/dist/docs/phone-field.md +4 -4
  78. package/dist/docs/place-order.md +84 -36
  79. package/dist/docs/postal-code-field.md +3 -1
  80. package/dist/docs/pricing.md +21 -23
  81. package/dist/docs/product-gallery.md +19 -20
  82. package/dist/docs/product-information.md +13 -9
  83. package/dist/docs/product-list.md +7 -6
  84. package/dist/docs/product-shelf.md +0 -1
  85. package/dist/docs/promotion.md +4 -2
  86. package/dist/docs/region.md +23 -15
  87. package/dist/docs/save-card.md +7 -6
  88. package/dist/docs/saved-cards.md +65 -36
  89. package/dist/docs/shipping-address.md +57 -21
  90. package/dist/docs/shipping-simulator.md +53 -15
  91. package/dist/docs/sign-in-disclosure.md +176 -0
  92. package/dist/docs/sign-in-form.md +78 -47
  93. package/dist/docs/sign-in-redirect.md +4 -2
  94. package/dist/docs/sign-in.md +173 -0
  95. package/dist/docs/toast.md +15 -4
  96. package/dist/docs/variant-selector.md +15 -11
  97. package/dist/domain-logic/dist/checkout/rules.js +33 -0
  98. package/dist/domain-logic/dist/checkout/rules.js.map +1 -0
  99. package/dist/graphql/types.d.ts +4 -14
  100. package/dist/index.d.ts +2 -2
  101. package/dist/internal/client.d.ts +1 -3
  102. package/dist/internal/client.js +1 -1
  103. package/dist/internal/server.d.ts +7 -4
  104. package/dist/internal/server.js +7 -4
  105. package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
  106. package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
  107. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
  108. package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
  109. package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
  110. package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
  111. package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
  112. package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
  113. package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
  114. package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
  115. package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
  116. package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
  117. package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
  118. package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
  119. package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
  120. package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
  121. package/dist/matter/account-address-book/account-address-book.js +74 -33
  122. package/dist/matter/account-address-book/account-address-book.js.map +1 -1
  123. package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
  124. package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
  125. package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
  126. package/dist/matter/account-address-book/account-address-country.js +83 -49
  127. package/dist/matter/account-address-book/account-address-country.js.map +1 -1
  128. package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
  129. package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
  130. package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
  131. package/dist/matter/account-address-book/account-address-form.js +518 -155
  132. package/dist/matter/account-address-book/account-address-form.js.map +1 -1
  133. package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
  134. package/dist/matter/account-address-book/account-address-record.js +32 -17
  135. package/dist/matter/account-address-book/account-address-record.js.map +1 -1
  136. package/dist/matter/account-menu/account-menu.d.ts +34 -17
  137. package/dist/matter/account-menu/account-menu.js +46 -54
  138. package/dist/matter/account-menu/account-menu.js.map +1 -1
  139. package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
  140. package/dist/matter/account-saved-cards/account-saved-cards.d.ts +108 -28
  141. package/dist/matter/account-saved-cards/account-saved-cards.js +177 -122
  142. package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -1
  143. package/dist/matter/billing-address/billing-address.d.ts +156 -74
  144. package/dist/matter/billing-address/billing-address.js +227 -156
  145. package/dist/matter/billing-address/billing-address.js.map +1 -1
  146. package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
  147. package/dist/matter/breadcrumb/breadcrumb.js +24 -9
  148. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
  149. package/dist/matter/buy-button/buy-button.d.ts +8 -11
  150. package/dist/matter/buy-button/buy-button.js +10 -19
  151. package/dist/matter/buy-button/buy-button.js.map +1 -1
  152. package/dist/matter/card-entry/card-capture.js +12 -4
  153. package/dist/matter/card-entry/card-capture.js.map +1 -1
  154. package/dist/matter/card-entry/card-entry.d.ts +123 -32
  155. package/dist/matter/card-entry/card-entry.js +348 -221
  156. package/dist/matter/card-entry/card-entry.js.map +1 -1
  157. package/dist/matter/cart/cart-namespace.d.ts +7 -1
  158. package/dist/matter/cart/cart-namespace.js +7 -1
  159. package/dist/matter/cart/cart-namespace.js.map +1 -1
  160. package/dist/matter/cart/cart.d.ts +402 -61
  161. package/dist/matter/cart/cart.js +624 -153
  162. package/dist/matter/cart/cart.js.map +1 -1
  163. package/dist/matter/cart-destination/cart-destination.d.ts +30 -19
  164. package/dist/matter/cart-destination/cart-destination.js +160 -70
  165. package/dist/matter/cart-destination/cart-destination.js.map +1 -1
  166. package/dist/matter/cart-item/cart-item.d.ts +144 -17
  167. package/dist/matter/cart-item/cart-item.js +166 -49
  168. package/dist/matter/cart-item/cart-item.js.map +1 -1
  169. package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
  170. package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
  171. package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
  172. package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
  173. package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
  174. package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
  175. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
  176. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
  177. package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
  178. package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
  179. package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
  180. package/dist/matter/cart-totalizer/cart-totalizer.js +46 -17
  181. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
  182. package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
  183. package/dist/matter/challenge-return/challenge-return.js +241 -0
  184. package/dist/matter/challenge-return/challenge-return.js.map +1 -0
  185. package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
  186. package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
  187. package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
  188. package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
  189. package/dist/matter/client-preferences/client-preferences.js +84 -15
  190. package/dist/matter/client-preferences/client-preferences.js.map +1 -1
  191. package/dist/matter/client-profile/client-profile.d.ts +44 -9
  192. package/dist/matter/client-profile/client-profile.js +64 -24
  193. package/dist/matter/client-profile/client-profile.js.map +1 -1
  194. package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
  195. package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
  196. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
  197. package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
  198. package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
  199. package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
  200. package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
  201. package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
  202. package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
  203. package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
  204. package/dist/matter/delivery-options/delivery-options.js +75 -12
  205. package/dist/matter/delivery-options/delivery-options.js.map +1 -1
  206. package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
  207. package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
  208. package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
  209. package/dist/matter/email-identification/email-identification.d.ts +25 -3
  210. package/dist/matter/email-identification/email-identification.js +49 -12
  211. package/dist/matter/email-identification/email-identification.js.map +1 -1
  212. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +79 -7
  213. package/dist/matter/free-shipping-progress/free-shipping-progress.js +77 -20
  214. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
  215. package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
  216. package/dist/matter/identity-edit/identity-edit.js +47 -19
  217. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  218. package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
  219. package/dist/matter/identity-summary/identity-summary.js +95 -45
  220. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  221. package/dist/matter/installments/installments-select.d.ts +98 -16
  222. package/dist/matter/installments/installments-select.js +156 -48
  223. package/dist/matter/installments/installments-select.js.map +1 -1
  224. package/dist/matter/installments/installments.d.ts +96 -16
  225. package/dist/matter/installments/installments.js +115 -40
  226. package/dist/matter/installments/installments.js.map +1 -1
  227. package/dist/matter/installments/use-installments-selection.d.ts +1 -0
  228. package/dist/matter/installments/use-installments-selection.js +8 -3
  229. package/dist/matter/installments/use-installments-selection.js.map +1 -1
  230. package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
  231. package/dist/matter/my-account-profile/my-account-profile.js +370 -174
  232. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  233. package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
  234. package/dist/matter/order-cancel/order-cancel.js +118 -51
  235. package/dist/matter/order-cancel/order-cancel.js.map +1 -1
  236. package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
  237. package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
  238. package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
  239. package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
  240. package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
  241. package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
  242. package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
  243. package/dist/matter/order-details-header/order-details-header.js +66 -58
  244. package/dist/matter/order-details-header/order-details-header.js.map +1 -1
  245. package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
  246. package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
  247. package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
  248. package/dist/matter/order-list/order-list.d.ts +164 -19
  249. package/dist/matter/order-list/order-list.js +229 -87
  250. package/dist/matter/order-list/order-list.js.map +1 -1
  251. package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
  252. package/dist/matter/order-list-row/order-list-row.js +3 -2
  253. package/dist/matter/order-list-row/order-list-row.js.map +1 -1
  254. package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
  255. package/dist/matter/order-list-search/order-list-search.js +30 -69
  256. package/dist/matter/order-list-search/order-list-search.js.map +1 -1
  257. package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
  258. package/dist/matter/order-list-views/order-list-views.js +22 -68
  259. package/dist/matter/order-list-views/order-list-views.js.map +1 -1
  260. package/dist/matter/order-payment/order-payment.d.ts +33 -10
  261. package/dist/matter/order-payment/order-payment.js +44 -39
  262. package/dist/matter/order-payment/order-payment.js.map +1 -1
  263. package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
  264. package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
  265. package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
  266. package/dist/matter/order-placed/order-placed.d.ts +198 -31
  267. package/dist/matter/order-placed/order-placed.js +230 -139
  268. package/dist/matter/order-placed/order-placed.js.map +1 -1
  269. package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
  270. package/dist/matter/order-placed-date/order-placed-date.js +7 -8
  271. package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
  272. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
  273. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
  274. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
  275. package/dist/matter/order-progress/order-progress.d.ts +19 -8
  276. package/dist/matter/order-progress/order-progress.js +37 -45
  277. package/dist/matter/order-progress/order-progress.js.map +1 -1
  278. package/dist/matter/order-summary/order-summary.d.ts +19 -9
  279. package/dist/matter/order-summary/order-summary.js +38 -44
  280. package/dist/matter/order-summary/order-summary.js.map +1 -1
  281. package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
  282. package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
  283. package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
  284. package/dist/matter/payment/payment-card-capture.js +17 -10
  285. package/dist/matter/payment/payment-card-capture.js.map +1 -1
  286. package/dist/matter/payment/payment-controller.d.ts +4 -2
  287. package/dist/matter/payment/payment-controller.js +30 -9
  288. package/dist/matter/payment/payment-controller.js.map +1 -1
  289. package/dist/matter/payment/payment-method-badges.js +1 -1
  290. package/dist/matter/payment/payment.d.ts +69 -19
  291. package/dist/matter/payment/payment.js +101 -35
  292. package/dist/matter/payment/payment.js.map +1 -1
  293. package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
  294. package/dist/matter/payment/use-payment-method-selection.js +94 -32
  295. package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
  296. package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
  297. package/dist/matter/payment/use-payment-submit-gate.js +47 -8
  298. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
  299. package/dist/matter/place-order/place-order.d.ts +171 -57
  300. package/dist/matter/place-order/place-order.js +376 -185
  301. package/dist/matter/place-order/place-order.js.map +1 -1
  302. package/dist/matter/pricing/pricing.d.ts +152 -13
  303. package/dist/matter/pricing/pricing.js +153 -52
  304. package/dist/matter/pricing/pricing.js.map +1 -1
  305. package/dist/matter/product-information/product-information.d.ts +27 -4
  306. package/dist/matter/product-information/product-information.js +32 -15
  307. package/dist/matter/product-information/product-information.js.map +1 -1
  308. package/dist/matter/product-list/product-list.d.ts +24 -6
  309. package/dist/matter/product-list/product-list.js +32 -26
  310. package/dist/matter/product-list/product-list.js.map +1 -1
  311. package/dist/matter/product-shelf/product-shelf.d.ts +1 -3
  312. package/dist/matter/product-shelf/product-shelf.js +2 -15
  313. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  314. package/dist/matter/region/region.d.ts +33 -16
  315. package/dist/matter/region/region.js +59 -52
  316. package/dist/matter/region/region.js.map +1 -1
  317. package/dist/matter/save-card/save-card.d.ts +43 -8
  318. package/dist/matter/save-card/save-card.js +61 -23
  319. package/dist/matter/save-card/save-card.js.map +1 -1
  320. package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
  321. package/dist/matter/saved-cards/saved-cards.js +349 -77
  322. package/dist/matter/saved-cards/saved-cards.js.map +1 -1
  323. package/dist/matter/shipping-address/address-payload.js +25 -0
  324. package/dist/matter/shipping-address/address-payload.js.map +1 -0
  325. package/dist/matter/shipping-address/country-descriptors.js +71 -71
  326. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  327. package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
  328. package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
  329. package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
  330. package/dist/matter/shipping-address/shipping-address.js +443 -188
  331. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  332. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +250 -24
  333. package/dist/matter/shipping-simulator/shipping-simulator.js +257 -51
  334. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  335. package/dist/matter/sign-in/sign-in.d.ts +108 -0
  336. package/dist/matter/sign-in/sign-in.js +285 -0
  337. package/dist/matter/sign-in/sign-in.js.map +1 -0
  338. package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
  339. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
  340. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
  341. package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
  342. package/dist/matter/sign-in-form/sign-in-form.js +134 -144
  343. package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
  344. package/dist/particles/binding-switcher/binding-switcher.d.ts +29 -8
  345. package/dist/particles/binding-switcher/binding-switcher.js +37 -26
  346. package/dist/particles/binding-switcher/binding-switcher.js.map +1 -1
  347. package/dist/particles/card-summary/card-summary.d.ts +38 -8
  348. package/dist/particles/card-summary/card-summary.js +55 -22
  349. package/dist/particles/card-summary/card-summary.js.map +1 -1
  350. package/dist/particles/carousel/carousel.d.ts +99 -11
  351. package/dist/particles/carousel/carousel.js +103 -35
  352. package/dist/particles/carousel/carousel.js.map +1 -1
  353. package/dist/particles/copy-text/copy-text.js +5 -15
  354. package/dist/particles/copy-text/copy-text.js.map +1 -1
  355. package/dist/particles/dialog/dialog.d.ts +14 -6
  356. package/dist/particles/dialog/dialog.js +6 -3
  357. package/dist/particles/dialog/dialog.js.map +1 -1
  358. package/dist/particles/drawer/drawer.js +1 -1
  359. package/dist/particles/drawer/drawer.js.map +1 -1
  360. package/dist/particles/email-field/email-field.d.ts +2 -1
  361. package/dist/particles/email-field/email-field.js +2 -1
  362. package/dist/particles/email-field/email-field.js.map +1 -1
  363. package/dist/particles/footer-link-group/footer-link-group.js +1 -0
  364. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
  365. package/dist/particles/form/form.d.ts +85 -13
  366. package/dist/particles/form/form.js +91 -42
  367. package/dist/particles/form/form.js.map +1 -1
  368. package/dist/particles/gallery/gallery.d.ts +129 -12
  369. package/dist/particles/gallery/gallery.js +121 -34
  370. package/dist/particles/gallery/gallery.js.map +1 -1
  371. package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
  372. package/dist/particles/order-details-back/order-details-back.js +8 -10
  373. package/dist/particles/order-details-back/order-details-back.js.map +1 -1
  374. package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
  375. package/dist/particles/order-status-badge/order-status-badge.js +4 -20
  376. package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
  377. package/dist/particles/password-field/password-field.d.ts +1 -1
  378. package/dist/particles/password-field/password-field.js +2 -4
  379. package/dist/particles/password-field/password-field.js.map +1 -1
  380. package/dist/particles/phone-field/phone-field.d.ts +4 -4
  381. package/dist/particles/phone-field/phone-field.js +8 -11
  382. package/dist/particles/phone-field/phone-field.js.map +1 -1
  383. package/dist/particles/spinner/spinner.d.ts +24 -4
  384. package/dist/particles/spinner/spinner.js +25 -9
  385. package/dist/particles/spinner/spinner.js.map +1 -1
  386. package/dist/particles/switch/switch.d.ts +4 -1
  387. package/dist/particles/switch/switch.js +3 -1
  388. package/dist/particles/switch/switch.js.map +1 -1
  389. package/dist/particles/toast/toast.d.ts +29 -3
  390. package/dist/particles/toast/toast.js +34 -10
  391. package/dist/particles/toast/toast.js.map +1 -1
  392. package/dist/schema.graphql +164 -56
  393. package/dist/sdk/address/address-fields.js +4 -4
  394. package/dist/sdk/address/address-fields.js.map +1 -1
  395. package/dist/sdk/address/constants.js +1 -6
  396. package/dist/sdk/address/constants.js.map +1 -1
  397. package/dist/sdk/address/messages.js +44 -44
  398. package/dist/sdk/address/messages.js.map +1 -1
  399. package/dist/sdk/address/postal-code.js +15 -2
  400. package/dist/sdk/address/postal-code.js.map +1 -1
  401. package/dist/sdk/address/types.d.ts +5 -3
  402. package/dist/sdk/address/validate-address.js +3 -3
  403. package/dist/sdk/address/validate-address.js.map +1 -1
  404. package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
  405. package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
  406. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  407. package/dist/sdk/data/index.js +2 -2
  408. package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
  409. package/dist/sdk/generated/gql.js +1 -1
  410. package/dist/sdk/generated/gql.js.map +1 -1
  411. package/dist/sdk/generated/graphql.d.ts +20 -5
  412. package/dist/sdk/generated/graphql.js +6 -0
  413. package/dist/sdk/generated/graphql.js.map +1 -1
  414. package/dist/sdk/i18n/format-error-code.js +23 -0
  415. package/dist/sdk/i18n/format-error-code.js.map +1 -0
  416. package/dist/sdk/i18n/message-formatter.d.ts +22 -0
  417. package/dist/sdk/i18n/message-formatter.js +140 -0
  418. package/dist/sdk/i18n/message-formatter.js.map +1 -0
  419. package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
  420. package/dist/sdk/i18n/use-message-formatter.js +18 -0
  421. package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
  422. package/dist/sdk/identity/use-identity-actions.js.map +1 -1
  423. package/dist/sdk/navigation/redirect.d.ts +2 -0
  424. package/dist/sdk/navigation/redirect.js +19 -1
  425. package/dist/sdk/navigation/redirect.js.map +1 -1
  426. package/dist/sdk/navigation/types.d.ts +13 -0
  427. package/dist/sdk/payment/bin-format.js +21 -0
  428. package/dist/sdk/payment/bin-format.js.map +1 -0
  429. package/dist/sdk/payment/challenge-return.js +37 -0
  430. package/dist/sdk/payment/challenge-return.js.map +1 -0
  431. package/dist/sdk/payment/confirmation-last-four.js +39 -0
  432. package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
  433. package/dist/sdk/payment/gateway.d.ts +1 -1
  434. package/dist/sdk/payment/gateway.js +8 -2
  435. package/dist/sdk/payment/gateway.js.map +1 -1
  436. package/dist/sdk/payment/operations.d.ts +1 -0
  437. package/dist/sdk/payment/operations.js +28 -6
  438. package/dist/sdk/payment/operations.js.map +1 -1
  439. package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
  440. package/dist/sdk/payment/resumed-purchase.js +119 -0
  441. package/dist/sdk/payment/resumed-purchase.js.map +1 -0
  442. package/dist/sdk/payment/security-code-mask.js +16 -23
  443. package/dist/sdk/payment/security-code-mask.js.map +1 -1
  444. package/dist/sdk/payment/submission-registry.js +6 -2
  445. package/dist/sdk/payment/submission-registry.js.map +1 -1
  446. package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
  447. package/dist/sdk/payment/use-payment-actions.js +23 -4
  448. package/dist/sdk/payment/use-payment-actions.js.map +1 -1
  449. package/dist/sdk/payment/use-place-order.d.ts +10 -2
  450. package/dist/sdk/payment/use-place-order.js +138 -76
  451. package/dist/sdk/payment/use-place-order.js.map +1 -1
  452. package/dist/sdk/provider/storefront-provider.d.ts +1 -7
  453. package/dist/sdk/provider/storefront-provider.js +4 -11
  454. package/dist/sdk/provider/storefront-provider.js.map +1 -1
  455. package/dist/sdk/seo/entity-landing.d.ts +24 -0
  456. package/dist/sdk/seo/entity-landing.js +30 -0
  457. package/dist/sdk/seo/entity-landing.js.map +1 -0
  458. package/dist/sdk/seo/page-alternates.d.ts +3 -2
  459. package/dist/sdk/seo/page-alternates.js +4 -2
  460. package/dist/sdk/seo/page-alternates.js.map +1 -1
  461. package/dist/sdk/seo/search-landing.d.ts +42 -0
  462. package/dist/sdk/seo/search-landing.js +85 -0
  463. package/dist/sdk/seo/search-landing.js.map +1 -0
  464. package/dist/sdk/session/mock-session.d.ts +9 -0
  465. package/dist/sdk/session/mock-session.js +31 -0
  466. package/dist/sdk/session/mock-session.js.map +1 -0
  467. package/dist/sdk/session/read-server-session.d.ts +3 -0
  468. package/dist/sdk/session/read-server-session.js +5 -0
  469. package/dist/sdk/session/read-server-session.js.map +1 -1
  470. package/dist/sdk/session/return-path-segment.d.ts +10 -0
  471. package/dist/sdk/session/return-path-segment.js +15 -0
  472. package/dist/sdk/session/return-path-segment.js.map +1 -0
  473. package/dist/sdk/session/use-session-actions.js.map +1 -1
  474. package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
  475. package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
  476. package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
  477. package/dist/utils/safe-href.d.ts +2 -0
  478. package/package.json +4 -3
  479. package/skills/storefront-asset/SKILL.md +2 -2
  480. package/skills/storefront-asset/references/api-side.md +27 -14
  481. package/skills/storefront-asset/references/findings.md +5 -2
  482. package/src/styles/tailwind.css +8 -0
  483. package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
  484. package/dist/message-locales.json +0 -7
  485. package/dist/sdk/i18n/client.d.ts +0 -4
  486. package/dist/sdk/i18n/client.js +0 -4
  487. package/dist/sdk/i18n/locales.d.ts +0 -8
  488. package/dist/sdk/i18n/locales.js +0 -57
  489. package/dist/sdk/i18n/locales.js.map +0 -1
  490. package/dist/sdk/i18n/messages/en-US.js +0 -183
  491. package/dist/sdk/i18n/messages/en-US.js.map +0 -1
  492. package/dist/sdk/i18n/messages/en-US.json +0 -178
  493. package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -182
  494. package/dist/sdk/i18n/messages/es-ES.js +0 -183
  495. package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
  496. package/dist/sdk/i18n/messages/es-ES.json +0 -178
  497. package/dist/sdk/i18n/messages/pt-BR.js +0 -183
  498. package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
  499. package/dist/sdk/i18n/messages/pt-BR.json +0 -178
  500. package/dist/sdk/i18n/provider.d.ts +0 -1
  501. package/dist/sdk/i18n/provider.js +0 -30
  502. package/dist/sdk/i18n/provider.js.map +0 -1
  503. package/dist/sdk/i18n/server.d.ts +0 -28
  504. package/dist/sdk/i18n/server.js +0 -59
  505. package/dist/sdk/i18n/server.js.map +0 -1
  506. package/dist/utils/resolve-authored-copy.js +0 -18
  507. package/dist/utils/resolve-authored-copy.js.map +0 -1
  508. package/dist/utils/substitute-template.js +0 -33
  509. package/dist/utils/substitute-template.js.map +0 -1
@@ -25,7 +25,7 @@ export type PropSchemaField = {
25
25
  default?: unknown;
26
26
  /**
27
27
  * The route params the component supplies when it navigates, honored only when `type === 'link'`
28
- * (e.g. `{ type: 'link', default: { standard: 'order-placed' }, fills: ['orderGroup'] }`).
28
+ * (e.g. `{ type: 'link', default: { standard: 'order-placed' }, fills: ['orderId'] }`).
29
29
  */
30
30
  fills?: readonly string[];
31
31
  label?: string;
@@ -2,10 +2,22 @@ import { JsonValue } from "./schema/generated/schema.js";
2
2
  //#region ../core/dist/define-content-type.d.ts
3
3
  export type ContentScalarType = 'string' | 'number' | 'integer' | 'boolean';
4
4
  export type ContentPropertyType = ContentScalarType | 'array' | 'object';
5
+ /** One argument of a message: `integer`/`number` feed a plural, `string` with `enum` a select. */
6
+ export type MessageArgumentSchema = {
7
+ type: 'integer' | 'number';
8
+ } | {
9
+ type: 'string';
10
+ enum?: readonly string[];
11
+ };
12
+ export type MessageArgumentsSchema = {
13
+ type: 'object';
14
+ properties: Record<string, MessageArgumentSchema>;
15
+ };
5
16
  /**
6
17
  * The JSON Schema vocabulary subset accepted per scalar property. `widget` carries presentation
7
18
  * annotations (e.g. `{ 'ui:widget': 'media-gallery' }`) passed through to the Schema Registry
8
- * uninterpreted. Anything outside this shape is rejected at definition time.
19
+ * uninterpreted. The `message*` keywords are the message contract, valid only with
20
+ * `format: 'icu-message'`. Anything outside this shape is rejected at definition time.
9
21
  */
10
22
  export type ContentScalarSchema = {
11
23
  type: ContentScalarType;
@@ -20,6 +32,13 @@ export type ContentScalarSchema = {
20
32
  pattern?: string;
21
33
  minimum?: number;
22
34
  maximum?: number;
35
+ messageArguments?: MessageArgumentsSchema;
36
+ messageTags?: readonly string[];
37
+ messageExample?: Record<string, string | number>;
38
+ /** The English source copy in ICU, copied into a store at creation and never read at runtime. */
39
+ messageSource?: string;
40
+ /** A store may leave this message unwritten: generation and preflight do not require it, and it renders nothing. */
41
+ messageOptional?: boolean;
23
42
  widget?: Record<string, JsonValue>;
24
43
  };
25
44
  /**
@@ -55,7 +74,7 @@ export type ContentObjectSchema = {
55
74
  properties: Record<string, ContentPropertySchema>;
56
75
  };
57
76
  export type ContentTypeDefinition = {
58
- /** Stable, URL-safe id (`^[a-z][a-z0-9-]*$`): becomes the Registry content-type key and the Data Plane path segment. */
77
+ /** Stable, URL-safe id, the Registry content-type key and the Data Plane path segment: bare in core, `<scope>.<id>` in an extension, at most 36 characters. */
59
78
  id: string;
60
79
  /** Human title shown in the Content Platform Admin. */
61
80
  title: string;
@@ -85,6 +104,35 @@ type ContentPropertyValue<P> = P extends {
85
104
  } ? PropertyTypeValue<T> : never;
86
105
  /** JSON-Schema → TS inference for the `$content` prop. Usage: ContentValue<typeof PromotionContent>. */
87
106
  export type ContentValue<T extends ContentTypeDefinition> = ObjectValue<T['schema']>;
107
+ /**
108
+ * The `$locale` the compiler injects into an element whose component declares a message field; never
109
+ * authored. A Server Component formats its messages in it; a client component reads the storefront
110
+ * context instead, and only keeps it off the DOM.
111
+ */
112
+ export type MessageLocaleProp = {
113
+ $locale?: string;
114
+ };
115
+ type MessageArgumentValue<A> = A extends {
116
+ enum: readonly (infer E)[];
117
+ } ? E : A extends {
118
+ type: 'integer' | 'number';
119
+ } ? number : A extends {
120
+ type: 'string';
121
+ } ? string : never;
122
+ /** The call-site arguments of a message field. Usage: MessageArguments<typeof X['schema']['properties']['items']>. */
123
+ export type MessageArguments<P> = P extends {
124
+ messageArguments: {
125
+ properties: infer A;
126
+ };
127
+ } ? { -readonly [K in keyof A]: MessageArgumentValue<A[K]>; } : Record<string, never>;
128
+ /** The root property names of a content type that hold a message. Usage: MessageFieldName<typeof X>. */
129
+ export type MessageFieldName<T extends ContentTypeDefinition> = { [K in keyof T['schema']['properties']]: T['schema']['properties'][K] extends {
130
+ format: 'icu-message';
131
+ } ? K : never; }[keyof T['schema']['properties']] & string;
132
+ /** The rich tags a message field allows, `never` when it declares none. */
133
+ export type MessageTagName<P> = P extends {
134
+ messageTags: readonly (infer N extends string)[];
135
+ } ? N : never;
88
136
  /**
89
137
  * Declares a standalone content model. Unlike `defineComponent` (pure identity), this validates at
90
138
  * definition time and throws one aggregated Error listing every violation. The `const` type
@@ -1,5 +1,7 @@
1
1
  //#region ../core/dist/define-content-type.js
2
- const ID_PATTERN = /^[a-z][a-z0-9-]*$/;
2
+ const ID_PATTERN = /^(?:[a-z0-9][a-z0-9._-]*\.)?[a-z][a-z0-9-]*$/;
3
+ /** Content Platform stores the id in a `varchar(36)` column. */
4
+ const MAX_ID_LENGTH = 36;
3
5
  const CONTENT_SCALAR_TYPES = [
4
6
  "string",
5
7
  "number",
@@ -39,7 +41,12 @@ const SCALAR_KEYWORDS = /* @__PURE__ */ new Set([
39
41
  "pattern",
40
42
  "minimum",
41
43
  "maximum",
42
- "widget"
44
+ "widget",
45
+ "messageArguments",
46
+ "messageTags",
47
+ "messageExample",
48
+ "messageSource",
49
+ "messageOptional"
43
50
  ]);
44
51
  const ARRAY_KEYWORDS = /* @__PURE__ */ new Set([
45
52
  "type",
@@ -70,6 +77,20 @@ const STRING_ANNOTATION_KEYWORDS = ["title", "description"];
70
77
  const STRING_LENGTH_KEYWORDS = ["minLength", "maxLength"];
71
78
  const STRING_PATTERN_KEYWORDS = ["format", "pattern"];
72
79
  const ITEM_BOUND_KEYWORDS = ["minItems", "maxItems"];
80
+ const MESSAGE_CONTRACT_KEYWORDS = [
81
+ "messageArguments",
82
+ "messageTags",
83
+ "messageExample",
84
+ "messageSource",
85
+ "messageOptional"
86
+ ];
87
+ const MESSAGE_ARGUMENTS_KEYWORDS = /* @__PURE__ */ new Set(["type", "properties"]);
88
+ const MESSAGE_ARGUMENT_KEYWORDS = /* @__PURE__ */ new Set(["type", "enum"]);
89
+ const MESSAGE_ARGUMENT_TYPES = /* @__PURE__ */ new Set([
90
+ "integer",
91
+ "number",
92
+ "string"
93
+ ]);
73
94
  /**
74
95
  * Declares a standalone content model. Unlike `defineComponent` (pure identity), this validates at
75
96
  * definition time and throws one aggregated Error listing every violation. The `const` type
@@ -97,7 +118,9 @@ function collectEnvelopeViolations(definition, violations) {
97
118
  }
98
119
  /** V1 (id) and V2 (title). */
99
120
  function collectIdentityViolations(definition, violations) {
100
- if (typeof definition.id !== "string" || !ID_PATTERN.test(definition.id)) violations.push(`id must be a URL-safe string matching /^[a-z][a-z0-9-]*$/ (got ${JSON.stringify(definition.id)})`);
121
+ if (typeof definition.id !== "string" || !ID_PATTERN.test(definition.id)) violations.push(String.raw`id must be a URL-safe string matching /^(?:[a-z0-9][a-z0-9._-]*\.)?[a-z][a-z0-9-]*$/ (got ${JSON.stringify(definition.id)})`);
122
+ const idLength = typeof definition.id === "string" ? Array.from(definition.id).length : 0;
123
+ if (idLength > MAX_ID_LENGTH) violations.push(`id must be at most ${MAX_ID_LENGTH} characters (got ${idLength})`);
101
124
  if (typeof definition.title !== "string" || definition.title.length === 0) violations.push("title must be a non-empty string");
102
125
  }
103
126
  /** V4 (root shape) and V6 (root keyword whitelist), delegating to per-property checks (V5, V6). */
@@ -233,6 +256,87 @@ function collectScalarViolations(path, property, type, violations) {
233
256
  if (property.default !== void 0 && !property.enum.includes(property.default)) violations.push(`${path}.default must be one of the enum members`);
234
257
  }
235
258
  }
259
+ collectMessageContractViolations(path, property, type, violations);
260
+ }
261
+ /** The message contract: `messageArguments`, `messageTags`, `messageExample`, `messageSource` and `messageOptional`, on a message field only. */
262
+ function collectMessageContractViolations(path, property, type, violations) {
263
+ if (type !== "string" || property.format !== "icu-message") {
264
+ for (const keyword of MESSAGE_CONTRACT_KEYWORDS) if (property[keyword] !== void 0) violations.push(`${path}.${keyword} only applies to type 'string' with format 'icu-message'`);
265
+ return;
266
+ }
267
+ const { messageArguments, messageTags, messageExample, messageSource, messageOptional } = property;
268
+ if (messageArguments !== void 0) collectMessageArgumentsViolations(`${path}.messageArguments`, messageArguments, violations);
269
+ if (messageTags !== void 0) collectMessageTagsViolations(`${path}.messageTags`, messageTags, violations);
270
+ collectMessageExamplePresenceViolations(path, messageArguments, messageExample, violations);
271
+ if (messageSource !== void 0 && (typeof messageSource !== "string" || messageSource.trim().length === 0)) violations.push(`${path}.messageSource must be a non-blank string`);
272
+ if (messageOptional !== void 0 && typeof messageOptional !== "boolean") violations.push(`${path}.messageOptional must be a boolean`);
273
+ }
274
+ /** `messageExample` is required with declared arguments, needs `messageArguments`, and must fit them. */
275
+ function collectMessageExamplePresenceViolations(path, messageArguments, messageExample, violations) {
276
+ const declared = isRecord(messageArguments) && isRecord(messageArguments.properties) ? messageArguments.properties : void 0;
277
+ if (messageExample === void 0) {
278
+ if (declared !== void 0 && Object.keys(declared).length > 0) violations.push(`${path}.messageExample is required when messageArguments declares arguments`);
279
+ } else if (messageArguments === void 0) violations.push(`${path}.messageExample requires messageArguments`);
280
+ else if (!isRecord(messageExample)) violations.push(`${path}.messageExample must be an object`);
281
+ else if (declared !== void 0) collectMessageExampleViolations(`${path}.messageExample`, messageExample, declared, violations);
282
+ }
283
+ function collectMessageArgumentsViolations(path, value, violations) {
284
+ if (!isRecord(value)) {
285
+ violations.push(`${path} must be an object`);
286
+ return;
287
+ }
288
+ collectKeywordViolations(path, value, MESSAGE_ARGUMENTS_KEYWORDS, violations);
289
+ if (value.type !== "object") violations.push(`${path}.type must be 'object'`);
290
+ const { properties } = value;
291
+ if (!isRecord(properties) || Object.keys(properties).length === 0) {
292
+ violations.push(`${path}.properties must declare at least one argument`);
293
+ return;
294
+ }
295
+ for (const [name, argument] of Object.entries(properties)) collectMessageArgumentViolations(`${path}.properties.${name}`, name, argument, violations);
296
+ }
297
+ function collectMessageArgumentViolations(path, name, argument, violations) {
298
+ if (name === "__proto__") {
299
+ violations.push(`${path}: property name "${name}" is not allowed`);
300
+ return;
301
+ }
302
+ if (!isRecord(argument)) {
303
+ violations.push(`${path} must be an object`);
304
+ return;
305
+ }
306
+ collectKeywordViolations(path, argument, MESSAGE_ARGUMENT_KEYWORDS, violations);
307
+ if (typeof argument.type !== "string" || !MESSAGE_ARGUMENT_TYPES.has(argument.type)) {
308
+ violations.push(`${path}.type must be one of 'integer' | 'number' | 'string' (got ${JSON.stringify(argument.type)})`);
309
+ return;
310
+ }
311
+ if (argument.enum === void 0) return;
312
+ if (argument.type !== "string") violations.push(`${path}.enum only applies to type 'string'`);
313
+ else if (!isStringEnum(argument.enum)) violations.push(`${path}.enum must be a non-empty array of strings`);
314
+ }
315
+ function collectMessageTagsViolations(path, value, violations) {
316
+ if (!Array.isArray(value)) {
317
+ violations.push(`${path} must be an array of tag names`);
318
+ return;
319
+ }
320
+ const seen = /* @__PURE__ */ new Set();
321
+ for (const member of value) if (typeof member !== "string" || member.length === 0) violations.push(`${path} member ${JSON.stringify(member)} must be a non-empty string`);
322
+ else if (seen.has(member)) violations.push(`${path} declares "${member}" more than once`);
323
+ else seen.add(member);
324
+ }
325
+ /** The example holds exactly the declared arguments, each of its declared type and within its `enum`. */
326
+ function collectMessageExampleViolations(path, example, declared, violations) {
327
+ for (const name of Object.keys(declared)) if (!Object.hasOwn(example, name)) violations.push(`${path} is missing argument "${name}"`);
328
+ for (const key of Object.keys(example)) if (!Object.hasOwn(declared, key)) violations.push(`${path}.${key} is not a declared argument`);
329
+ for (const [name, argument] of Object.entries(declared)) {
330
+ if (!Object.hasOwn(example, name) || !isRecord(argument)) continue;
331
+ const { type } = argument;
332
+ if (typeof type !== "string" || !MESSAGE_ARGUMENT_TYPES.has(type)) continue;
333
+ const value = example[name];
334
+ if (!matchesPropertyType(value, type)) violations.push(`${path}.${name} must be of type '${type}'`);
335
+ else if (type === "string" && isStringEnum(argument.enum) && !argument.enum.includes(value)) violations.push(`${path}.${name} must be one of the enum members`);
336
+ }
337
+ }
338
+ function isStringEnum(value) {
339
+ return Array.isArray(value) && value.length > 0 && value.every((member) => typeof member === "string");
236
340
  }
237
341
  function isFiniteNumber(value) {
238
342
  return typeof value === "number" && Number.isFinite(value);
@@ -1 +1 @@
1
- {"version":3,"file":"define-content-type.js","names":[],"sources":["../../../../core/dist/define-content-type.js"],"sourcesContent":["const ID_PATTERN = /^[a-z][a-z0-9-]*$/;\nconst CONTENT_SCALAR_TYPES = ['string', 'number', 'integer', 'boolean'];\nconst CONTENT_PROPERTY_TYPES = [...CONTENT_SCALAR_TYPES, 'array', 'object'];\nconst SCALAR_TYPE_LIST = \"'string' | 'number' | 'integer' | 'boolean'\";\nconst PROPERTY_TYPE_LIST = `${SCALAR_TYPE_LIST} | 'array' | 'object'`;\nconst ROOT_KEYWORDS = new Set(['type', 'additionalProperties', 'required', 'properties']);\n/** The closed top-level envelope. An unknown key would survive canonicalize + hash and ship to the\n * Registry, so it is rejected here rather than at artifact load. */\nconst ENVELOPE_KEYS = new Set(['id', 'title', 'description', 'schema']);\nconst SCALAR_KEYWORDS = new Set([\n 'type',\n 'title',\n 'description',\n 'default',\n 'enum',\n 'format',\n 'minLength',\n 'maxLength',\n 'pattern',\n 'minimum',\n 'maximum',\n 'widget',\n]);\nconst ARRAY_KEYWORDS = new Set(['type', 'title', 'description', 'items', 'minItems', 'maxItems', 'widget']);\nconst OBJECT_KEYWORDS = new Set([\n 'type',\n 'title',\n 'description',\n 'additionalProperties',\n 'required',\n 'properties',\n 'widget',\n]);\nconst STRING_ONLY_KEYWORDS = ['format', 'minLength', 'maxLength', 'pattern'];\nconst NUMERIC_ONLY_KEYWORDS = ['minimum', 'maximum'];\nconst STRING_ANNOTATION_KEYWORDS = ['title', 'description'];\nconst STRING_LENGTH_KEYWORDS = ['minLength', 'maxLength'];\nconst STRING_PATTERN_KEYWORDS = ['format', 'pattern'];\nconst ITEM_BOUND_KEYWORDS = ['minItems', 'maxItems'];\n/**\n * Declares a standalone content model. Unlike `defineComponent` (pure identity), this validates at\n * definition time and throws one aggregated Error listing every violation. The `const` type\n * parameter preserves literal types so `ContentValue<typeof X>` can infer enums and required keys.\n */\nexport function defineContentType(definition) {\n if (!isRecord(definition)) {\n throw new Error('Invalid content type \"<unknown>\":\\n- definition must be an object');\n }\n const violations = [];\n collectEnvelopeViolations(definition, violations);\n collectIdentityViolations(definition, violations);\n collectSchemaViolations(definition.schema, violations);\n collectSerializabilityViolations(definition, 'definition', [], violations);\n if (violations.length > 0) {\n const label = typeof definition.id === 'string' && definition.id.length > 0 ? definition.id : '<unknown>';\n throw new Error(`Invalid content type \"${label}\":\\n- ${violations.join('\\n- ')}`);\n }\n return definition;\n}\nfunction isRecord(value) {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n/** V6 (envelope): the top-level model shape is closed. */\nfunction collectEnvelopeViolations(definition, violations) {\n for (const key of Object.keys(definition)) {\n if (!ENVELOPE_KEYS.has(key)) {\n violations.push(`unknown model key \"${key}\"`);\n }\n }\n}\n/** V1 (id) and V2 (title). */\nfunction collectIdentityViolations(definition, violations) {\n if (typeof definition.id !== 'string' || !ID_PATTERN.test(definition.id)) {\n violations.push(`id must be a URL-safe string matching /^[a-z][a-z0-9-]*$/ (got ${JSON.stringify(definition.id)})`);\n }\n if (typeof definition.title !== 'string' || definition.title.length === 0) {\n violations.push('title must be a non-empty string');\n }\n}\n/** V4 (root shape) and V6 (root keyword whitelist), delegating to per-property checks (V5, V6). */\nfunction collectSchemaViolations(schema, violations) {\n if (!isRecord(schema)) {\n violations.push('schema must be an object');\n return;\n }\n collectKeywordViolations('schema', schema, ROOT_KEYWORDS, violations);\n if (schema.type !== 'object') {\n violations.push(\"schema.type must be 'object'\");\n }\n if (schema.additionalProperties !== false) {\n violations.push('schema.additionalProperties must be false');\n }\n const { properties, required } = schema;\n if (!isRecord(properties) || Object.keys(properties).length === 0) {\n violations.push('schema.properties must declare at least one property');\n }\n else {\n for (const [name, property] of Object.entries(properties)) {\n collectRootPropertyViolations(name, property, violations);\n }\n }\n collectRequiredViolations('schema', required, properties, violations);\n}\n/** The keyword whitelist for one level, plus the v1 `$ref` prohibition. */\nfunction collectKeywordViolations(path, value, allowed, violations) {\n for (const key of Object.keys(value)) {\n if (key === '$ref') {\n violations.push(`${path}: $ref is forbidden in v1`);\n }\n else if (!allowed.has(key)) {\n violations.push(`${path}: unknown keyword \"${key}\"`);\n }\n }\n}\n/** `required` names only declared properties, at the root and inside a nested shape. */\nfunction collectRequiredViolations(path, required, properties, violations) {\n if (required === undefined) {\n return;\n }\n if (!Array.isArray(required)) {\n violations.push(`${path}.required must be an array of property names`);\n return;\n }\n const known = isRecord(properties) ? Object.keys(properties) : [];\n for (const name of required) {\n if (typeof name !== 'string' || !known.includes(name)) {\n violations.push(`${path}.required names unknown property ${JSON.stringify(name)}`);\n }\n }\n}\n/** V5 (vocabulary subset) and V6 (v1 prohibitions) for one root property: six admitted types. */\nfunction collectRootPropertyViolations(name, property, violations) {\n const path = `properties.${name}`;\n // In a JS object literal `__proto__:` sets the prototype instead of creating an own property, so the model silently loses the property at runtime.\n if (name === '__proto__') {\n violations.push(`${path}: property name \"${name}\" is not allowed`);\n return;\n }\n if (!isRecord(property)) {\n violations.push(`${path} must be an object`);\n return;\n }\n const type = property.type;\n collectKeywordViolations(path, property, keywordsFor(type), violations);\n collectAnnotationViolations(path, property, violations);\n if (type === 'array') {\n collectArrayViolations(path, property, violations);\n return;\n }\n if (type === 'object') {\n collectObjectShapeViolations(path, property, violations);\n return;\n }\n if (typeof type !== 'string' || !CONTENT_PROPERTY_TYPES.includes(type)) {\n violations.push(`${path}.type must be one of ${PROPERTY_TYPE_LIST} (got ${JSON.stringify(type)})`);\n return;\n }\n collectScalarViolations(path, property, type, violations);\n}\n/** The same rules one level down, where only the four scalar types are admitted. */\nfunction collectNestedPropertyViolations(path, name, property, violations) {\n if (name === '__proto__') {\n violations.push(`${path}: property name \"${name}\" is not allowed`);\n return;\n }\n if (!isRecord(property)) {\n violations.push(`${path} must be an object`);\n return;\n }\n const type = property.type;\n collectKeywordViolations(path, property, SCALAR_KEYWORDS, violations);\n collectAnnotationViolations(path, property, violations);\n if (typeof type !== 'string' || !CONTENT_SCALAR_TYPES.includes(type)) {\n violations.push(`${path}.type must be one of ${SCALAR_TYPE_LIST} (got ${JSON.stringify(type)})`);\n return;\n }\n collectScalarViolations(path, property, type, violations);\n}\nfunction keywordsFor(type) {\n if (type === 'array') {\n return ARRAY_KEYWORDS;\n }\n if (type === 'object') {\n return OBJECT_KEYWORDS;\n }\n return SCALAR_KEYWORDS;\n}\nfunction collectAnnotationViolations(path, property, violations) {\n for (const keyword of STRING_ANNOTATION_KEYWORDS) {\n if (property[keyword] !== undefined && typeof property[keyword] !== 'string') {\n violations.push(`${path}.${keyword} must be a string`);\n }\n }\n if (property.widget !== undefined && !isRecord(property.widget)) {\n violations.push(`${path}.widget must be an object`);\n }\n}\n/** An array property: a closed object `items` shape plus the optional item-count bounds. */\nfunction collectArrayViolations(path, property, violations) {\n collectItemsViolations(`${path}.items`, property.items, violations);\n for (const keyword of ITEM_BOUND_KEYWORDS) {\n if (property[keyword] !== undefined && !isNonNegativeInteger(property[keyword])) {\n violations.push(`${path}.${keyword} must be a non-negative integer`);\n }\n }\n const { minItems, maxItems } = property;\n if (isNonNegativeInteger(minItems) && isNonNegativeInteger(maxItems) && minItems > maxItems) {\n violations.push(`${path}.minItems must not exceed maxItems`);\n }\n}\n/** An `items` shape carries the shape envelope only, so its keyword whitelist is the root one. */\nfunction collectItemsViolations(path, shape, violations) {\n if (!isRecord(shape)) {\n violations.push(`${path} must be an object`);\n return;\n }\n collectKeywordViolations(path, shape, ROOT_KEYWORDS, violations);\n collectObjectShapeViolations(path, shape, violations);\n}\n/**\n * The closed-object body shared by an `items` shape and an `object` property: `type`,\n * `additionalProperties`, a non-empty `properties` map of scalars, and a valid `required`.\n */\nfunction collectObjectShapeViolations(path, shape, violations) {\n if (shape.type !== 'object') {\n violations.push(`${path}.type must be 'object'`);\n }\n if (shape.additionalProperties !== false) {\n violations.push(`${path}.additionalProperties must be false`);\n }\n const { properties, required } = shape;\n if (!isRecord(properties) || Object.keys(properties).length === 0) {\n violations.push(`${path}.properties must declare at least one property`);\n }\n else {\n for (const [name, property] of Object.entries(properties)) {\n collectNestedPropertyViolations(`${path}.properties.${name}`, name, property, violations);\n }\n }\n collectRequiredViolations(path, required, properties, violations);\n}\n/** The scalar constraint domains, unchanged from v1 and applied at both levels. */\nfunction collectScalarViolations(path, property, type, violations) {\n if (type === 'string') {\n for (const keyword of STRING_LENGTH_KEYWORDS) {\n if (property[keyword] !== undefined && !isNonNegativeInteger(property[keyword])) {\n violations.push(`${path}.${keyword} must be a non-negative integer`);\n }\n }\n for (const keyword of STRING_PATTERN_KEYWORDS) {\n if (property[keyword] !== undefined && typeof property[keyword] !== 'string') {\n violations.push(`${path}.${keyword} must be a string`);\n }\n }\n if (typeof property.pattern === 'string' && !isValidRegExp(property.pattern)) {\n violations.push(`${path}.pattern must be a valid regular expression`);\n }\n }\n else {\n for (const keyword of STRING_ONLY_KEYWORDS) {\n if (property[keyword] !== undefined) {\n violations.push(`${path}.${keyword} only applies to type 'string'`);\n }\n }\n }\n if (type === 'number' || type === 'integer') {\n for (const keyword of NUMERIC_ONLY_KEYWORDS) {\n if (property[keyword] !== undefined && !isFiniteNumber(property[keyword])) {\n violations.push(`${path}.${keyword} must be a finite number`);\n }\n }\n }\n else {\n for (const keyword of NUMERIC_ONLY_KEYWORDS) {\n if (property[keyword] !== undefined) {\n violations.push(`${path}.${keyword} only applies to types 'number' and 'integer'`);\n }\n }\n }\n if (property.default !== undefined && !matchesPropertyType(property.default, type)) {\n violations.push(`${path}.default must be a JSON literal of type '${type}'`);\n }\n if (property.enum !== undefined) {\n if (type === 'boolean') {\n violations.push(`${path}.enum is not allowed on type 'boolean'`);\n }\n else if (!Array.isArray(property.enum)) {\n violations.push(`${path}.enum must be an array of literals matching type '${type}'`);\n }\n else if (property.enum.length === 0) {\n violations.push(`${path}.enum must declare at least one member`);\n }\n else {\n for (const member of property.enum) {\n if (!matchesPropertyType(member, type)) {\n violations.push(`${path}.enum member ${JSON.stringify(member)} does not match type '${type}'`);\n }\n }\n if (property.default !== undefined && !property.enum.includes(property.default)) {\n violations.push(`${path}.default must be one of the enum members`);\n }\n }\n }\n}\nfunction isFiniteNumber(value) {\n return typeof value === 'number' && Number.isFinite(value);\n}\nfunction isNonNegativeInteger(value) {\n return typeof value === 'number' && Number.isInteger(value) && value >= 0;\n}\nfunction isValidRegExp(pattern) {\n try {\n new RegExp(pattern);\n return true;\n }\n catch {\n return false;\n }\n}\nfunction matchesPropertyType(value, type) {\n switch (type) {\n case 'string':\n return typeof value === 'string';\n case 'number':\n return isFiniteNumber(value);\n case 'integer':\n return typeof value === 'number' && Number.isInteger(value);\n case 'boolean':\n return typeof value === 'boolean';\n }\n}\n/** V7 (JSON serializability), applied to the whole definition including `widget` values. */\nfunction collectSerializabilityViolations(value, path, ancestors, violations) {\n if (value === null) {\n return;\n }\n if (typeof value === 'function' ||\n typeof value === 'undefined' ||\n typeof value === 'symbol' ||\n typeof value === 'bigint') {\n violations.push(`${path} is not JSON-serializable (${typeof value})`);\n return;\n }\n if (typeof value !== 'object') {\n return;\n }\n if (ancestors.includes(value)) {\n violations.push(`${path} is a cyclic reference`);\n return;\n }\n const nextAncestors = [...ancestors, value];\n if (Array.isArray(value)) {\n value.forEach((member, index) => {\n collectSerializabilityViolations(member, `${path}[${index}]`, nextAncestors, violations);\n });\n return;\n }\n for (const [key, member] of Object.entries(value)) {\n collectSerializabilityViolations(member, `${path}.${key}`, nextAncestors, violations);\n }\n}\n//# sourceMappingURL=define-content-type.js.map"],"mappings":";AAAA,MAAM,aAAa;AACnB,MAAM,uBAAuB;CAAC;CAAU;CAAU;CAAW;AAAS;AACtE,MAAM,yBAAyB;CAAC,GAAG;CAAsB;CAAS;AAAQ;AAC1E,MAAM,mBAAmB;AACzB,MAAM,qBAAqB,GAAG,iBAAiB;AAC/C,MAAM,gCAAgB,IAAI,IAAI;CAAC;CAAQ;CAAwB;CAAY;AAAY,CAAC;;;AAGxF,MAAM,gCAAgB,IAAI,IAAI;CAAC;CAAM;CAAS;CAAe;AAAQ,CAAC;AACtE,MAAM,kCAAkB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC;AACD,MAAM,iCAAiB,IAAI,IAAI;CAAC;CAAQ;CAAS;CAAe;CAAS;CAAY;CAAY;AAAQ,CAAC;AAC1G,MAAM,kCAAkB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC;AACD,MAAM,uBAAuB;CAAC;CAAU;CAAa;CAAa;AAAS;AAC3E,MAAM,wBAAwB,CAAC,WAAW,SAAS;AACnD,MAAM,6BAA6B,CAAC,SAAS,aAAa;AAC1D,MAAM,yBAAyB,CAAC,aAAa,WAAW;AACxD,MAAM,0BAA0B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C,KAAK,WAAW,OAAO,QAAQ,KAAK,GAC5C,iCAAiC,QAAQ,GAAG,KAAK,GAAG,OAAO,eAAe,UAAU;AAE5F"}
1
+ {"version":3,"file":"define-content-type.js","names":[],"sources":["../../../../core/dist/define-content-type.js"],"sourcesContent":["const ID_PATTERN = /^(?:[a-z0-9][a-z0-9._-]*\\.)?[a-z][a-z0-9-]*$/;\n/** Content Platform stores the id in a `varchar(36)` column. */\nconst MAX_ID_LENGTH = 36;\nconst CONTENT_SCALAR_TYPES = ['string', 'number', 'integer', 'boolean'];\nconst CONTENT_PROPERTY_TYPES = [...CONTENT_SCALAR_TYPES, 'array', 'object'];\nconst SCALAR_TYPE_LIST = \"'string' | 'number' | 'integer' | 'boolean'\";\nconst PROPERTY_TYPE_LIST = `${SCALAR_TYPE_LIST} | 'array' | 'object'`;\nconst ROOT_KEYWORDS = new Set(['type', 'additionalProperties', 'required', 'properties']);\n/** The closed top-level envelope. An unknown key would survive canonicalize + hash and ship to the\n * Registry, so it is rejected here rather than at artifact load. */\nconst ENVELOPE_KEYS = new Set(['id', 'title', 'description', 'schema']);\nconst SCALAR_KEYWORDS = new Set([\n 'type',\n 'title',\n 'description',\n 'default',\n 'enum',\n 'format',\n 'minLength',\n 'maxLength',\n 'pattern',\n 'minimum',\n 'maximum',\n 'widget',\n 'messageArguments',\n 'messageTags',\n 'messageExample',\n 'messageSource',\n 'messageOptional',\n]);\nconst ARRAY_KEYWORDS = new Set(['type', 'title', 'description', 'items', 'minItems', 'maxItems', 'widget']);\nconst OBJECT_KEYWORDS = new Set([\n 'type',\n 'title',\n 'description',\n 'additionalProperties',\n 'required',\n 'properties',\n 'widget',\n]);\nconst STRING_ONLY_KEYWORDS = ['format', 'minLength', 'maxLength', 'pattern'];\nconst NUMERIC_ONLY_KEYWORDS = ['minimum', 'maximum'];\nconst STRING_ANNOTATION_KEYWORDS = ['title', 'description'];\nconst STRING_LENGTH_KEYWORDS = ['minLength', 'maxLength'];\nconst STRING_PATTERN_KEYWORDS = ['format', 'pattern'];\nconst ITEM_BOUND_KEYWORDS = ['minItems', 'maxItems'];\nconst MESSAGE_CONTRACT_KEYWORDS = [\n 'messageArguments',\n 'messageTags',\n 'messageExample',\n 'messageSource',\n 'messageOptional',\n];\nconst MESSAGE_ARGUMENTS_KEYWORDS = new Set(['type', 'properties']);\nconst MESSAGE_ARGUMENT_KEYWORDS = new Set(['type', 'enum']);\nconst MESSAGE_ARGUMENT_TYPES = new Set(['integer', 'number', 'string']);\n/**\n * Declares a standalone content model. Unlike `defineComponent` (pure identity), this validates at\n * definition time and throws one aggregated Error listing every violation. The `const` type\n * parameter preserves literal types so `ContentValue<typeof X>` can infer enums and required keys.\n */\nexport function defineContentType(definition) {\n if (!isRecord(definition)) {\n throw new Error('Invalid content type \"<unknown>\":\\n- definition must be an object');\n }\n const violations = [];\n collectEnvelopeViolations(definition, violations);\n collectIdentityViolations(definition, violations);\n collectSchemaViolations(definition.schema, violations);\n collectSerializabilityViolations(definition, 'definition', [], violations);\n if (violations.length > 0) {\n const label = typeof definition.id === 'string' && definition.id.length > 0 ? definition.id : '<unknown>';\n throw new Error(`Invalid content type \"${label}\":\\n- ${violations.join('\\n- ')}`);\n }\n return definition;\n}\nfunction isRecord(value) {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n/** V6 (envelope): the top-level model shape is closed. */\nfunction collectEnvelopeViolations(definition, violations) {\n for (const key of Object.keys(definition)) {\n if (!ENVELOPE_KEYS.has(key)) {\n violations.push(`unknown model key \"${key}\"`);\n }\n }\n}\n/** V1 (id) and V2 (title). */\nfunction collectIdentityViolations(definition, violations) {\n if (typeof definition.id !== 'string' || !ID_PATTERN.test(definition.id)) {\n violations.push(String.raw `id must be a URL-safe string matching /^(?:[a-z0-9][a-z0-9._-]*\\.)?[a-z][a-z0-9-]*$/ (got ${JSON.stringify(definition.id)})`);\n }\n // Counted in code points, as the Rust mirror counts `chars`.\n const idLength = typeof definition.id === 'string' ? Array.from(definition.id).length : 0;\n if (idLength > MAX_ID_LENGTH) {\n violations.push(`id must be at most ${MAX_ID_LENGTH} characters (got ${idLength})`);\n }\n if (typeof definition.title !== 'string' || definition.title.length === 0) {\n violations.push('title must be a non-empty string');\n }\n}\n/** V4 (root shape) and V6 (root keyword whitelist), delegating to per-property checks (V5, V6). */\nfunction collectSchemaViolations(schema, violations) {\n if (!isRecord(schema)) {\n violations.push('schema must be an object');\n return;\n }\n collectKeywordViolations('schema', schema, ROOT_KEYWORDS, violations);\n if (schema.type !== 'object') {\n violations.push(\"schema.type must be 'object'\");\n }\n if (schema.additionalProperties !== false) {\n violations.push('schema.additionalProperties must be false');\n }\n const { properties, required } = schema;\n if (!isRecord(properties) || Object.keys(properties).length === 0) {\n violations.push('schema.properties must declare at least one property');\n }\n else {\n for (const [name, property] of Object.entries(properties)) {\n collectRootPropertyViolations(name, property, violations);\n }\n }\n collectRequiredViolations('schema', required, properties, violations);\n}\n/** The keyword whitelist for one level, plus the v1 `$ref` prohibition. */\nfunction collectKeywordViolations(path, value, allowed, violations) {\n for (const key of Object.keys(value)) {\n if (key === '$ref') {\n violations.push(`${path}: $ref is forbidden in v1`);\n }\n else if (!allowed.has(key)) {\n violations.push(`${path}: unknown keyword \"${key}\"`);\n }\n }\n}\n/** `required` names only declared properties, at the root and inside a nested shape. */\nfunction collectRequiredViolations(path, required, properties, violations) {\n if (required === undefined) {\n return;\n }\n if (!Array.isArray(required)) {\n violations.push(`${path}.required must be an array of property names`);\n return;\n }\n const known = isRecord(properties) ? Object.keys(properties) : [];\n for (const name of required) {\n if (typeof name !== 'string' || !known.includes(name)) {\n violations.push(`${path}.required names unknown property ${JSON.stringify(name)}`);\n }\n }\n}\n/** V5 (vocabulary subset) and V6 (v1 prohibitions) for one root property: six admitted types. */\nfunction collectRootPropertyViolations(name, property, violations) {\n const path = `properties.${name}`;\n // In a JS object literal `__proto__:` sets the prototype instead of creating an own property, so the model silently loses the property at runtime.\n if (name === '__proto__') {\n violations.push(`${path}: property name \"${name}\" is not allowed`);\n return;\n }\n if (!isRecord(property)) {\n violations.push(`${path} must be an object`);\n return;\n }\n const type = property.type;\n collectKeywordViolations(path, property, keywordsFor(type), violations);\n collectAnnotationViolations(path, property, violations);\n if (type === 'array') {\n collectArrayViolations(path, property, violations);\n return;\n }\n if (type === 'object') {\n collectObjectShapeViolations(path, property, violations);\n return;\n }\n if (typeof type !== 'string' || !CONTENT_PROPERTY_TYPES.includes(type)) {\n violations.push(`${path}.type must be one of ${PROPERTY_TYPE_LIST} (got ${JSON.stringify(type)})`);\n return;\n }\n collectScalarViolations(path, property, type, violations);\n}\n/** The same rules one level down, where only the four scalar types are admitted. */\nfunction collectNestedPropertyViolations(path, name, property, violations) {\n if (name === '__proto__') {\n violations.push(`${path}: property name \"${name}\" is not allowed`);\n return;\n }\n if (!isRecord(property)) {\n violations.push(`${path} must be an object`);\n return;\n }\n const type = property.type;\n collectKeywordViolations(path, property, SCALAR_KEYWORDS, violations);\n collectAnnotationViolations(path, property, violations);\n if (typeof type !== 'string' || !CONTENT_SCALAR_TYPES.includes(type)) {\n violations.push(`${path}.type must be one of ${SCALAR_TYPE_LIST} (got ${JSON.stringify(type)})`);\n return;\n }\n collectScalarViolations(path, property, type, violations);\n}\nfunction keywordsFor(type) {\n if (type === 'array') {\n return ARRAY_KEYWORDS;\n }\n if (type === 'object') {\n return OBJECT_KEYWORDS;\n }\n return SCALAR_KEYWORDS;\n}\nfunction collectAnnotationViolations(path, property, violations) {\n for (const keyword of STRING_ANNOTATION_KEYWORDS) {\n if (property[keyword] !== undefined && typeof property[keyword] !== 'string') {\n violations.push(`${path}.${keyword} must be a string`);\n }\n }\n if (property.widget !== undefined && !isRecord(property.widget)) {\n violations.push(`${path}.widget must be an object`);\n }\n}\n/** An array property: a closed object `items` shape plus the optional item-count bounds. */\nfunction collectArrayViolations(path, property, violations) {\n collectItemsViolations(`${path}.items`, property.items, violations);\n for (const keyword of ITEM_BOUND_KEYWORDS) {\n if (property[keyword] !== undefined && !isNonNegativeInteger(property[keyword])) {\n violations.push(`${path}.${keyword} must be a non-negative integer`);\n }\n }\n const { minItems, maxItems } = property;\n if (isNonNegativeInteger(minItems) && isNonNegativeInteger(maxItems) && minItems > maxItems) {\n violations.push(`${path}.minItems must not exceed maxItems`);\n }\n}\n/** An `items` shape carries the shape envelope only, so its keyword whitelist is the root one. */\nfunction collectItemsViolations(path, shape, violations) {\n if (!isRecord(shape)) {\n violations.push(`${path} must be an object`);\n return;\n }\n collectKeywordViolations(path, shape, ROOT_KEYWORDS, violations);\n collectObjectShapeViolations(path, shape, violations);\n}\n/**\n * The closed-object body shared by an `items` shape and an `object` property: `type`,\n * `additionalProperties`, a non-empty `properties` map of scalars, and a valid `required`.\n */\nfunction collectObjectShapeViolations(path, shape, violations) {\n if (shape.type !== 'object') {\n violations.push(`${path}.type must be 'object'`);\n }\n if (shape.additionalProperties !== false) {\n violations.push(`${path}.additionalProperties must be false`);\n }\n const { properties, required } = shape;\n if (!isRecord(properties) || Object.keys(properties).length === 0) {\n violations.push(`${path}.properties must declare at least one property`);\n }\n else {\n for (const [name, property] of Object.entries(properties)) {\n collectNestedPropertyViolations(`${path}.properties.${name}`, name, property, violations);\n }\n }\n collectRequiredViolations(path, required, properties, violations);\n}\n/** The scalar constraint domains, unchanged from v1 and applied at both levels. */\nfunction collectScalarViolations(path, property, type, violations) {\n if (type === 'string') {\n for (const keyword of STRING_LENGTH_KEYWORDS) {\n if (property[keyword] !== undefined && !isNonNegativeInteger(property[keyword])) {\n violations.push(`${path}.${keyword} must be a non-negative integer`);\n }\n }\n for (const keyword of STRING_PATTERN_KEYWORDS) {\n if (property[keyword] !== undefined && typeof property[keyword] !== 'string') {\n violations.push(`${path}.${keyword} must be a string`);\n }\n }\n if (typeof property.pattern === 'string' && !isValidRegExp(property.pattern)) {\n violations.push(`${path}.pattern must be a valid regular expression`);\n }\n }\n else {\n for (const keyword of STRING_ONLY_KEYWORDS) {\n if (property[keyword] !== undefined) {\n violations.push(`${path}.${keyword} only applies to type 'string'`);\n }\n }\n }\n if (type === 'number' || type === 'integer') {\n for (const keyword of NUMERIC_ONLY_KEYWORDS) {\n if (property[keyword] !== undefined && !isFiniteNumber(property[keyword])) {\n violations.push(`${path}.${keyword} must be a finite number`);\n }\n }\n }\n else {\n for (const keyword of NUMERIC_ONLY_KEYWORDS) {\n if (property[keyword] !== undefined) {\n violations.push(`${path}.${keyword} only applies to types 'number' and 'integer'`);\n }\n }\n }\n if (property.default !== undefined && !matchesPropertyType(property.default, type)) {\n violations.push(`${path}.default must be a JSON literal of type '${type}'`);\n }\n if (property.enum !== undefined) {\n if (type === 'boolean') {\n violations.push(`${path}.enum is not allowed on type 'boolean'`);\n }\n else if (!Array.isArray(property.enum)) {\n violations.push(`${path}.enum must be an array of literals matching type '${type}'`);\n }\n else if (property.enum.length === 0) {\n violations.push(`${path}.enum must declare at least one member`);\n }\n else {\n for (const member of property.enum) {\n if (!matchesPropertyType(member, type)) {\n violations.push(`${path}.enum member ${JSON.stringify(member)} does not match type '${type}'`);\n }\n }\n if (property.default !== undefined && !property.enum.includes(property.default)) {\n violations.push(`${path}.default must be one of the enum members`);\n }\n }\n }\n collectMessageContractViolations(path, property, type, violations);\n}\n/** The message contract: `messageArguments`, `messageTags`, `messageExample`, `messageSource` and `messageOptional`, on a message field only. */\nfunction collectMessageContractViolations(path, property, type, violations) {\n if (type !== 'string' || property.format !== 'icu-message') {\n for (const keyword of MESSAGE_CONTRACT_KEYWORDS) {\n if (property[keyword] !== undefined) {\n violations.push(`${path}.${keyword} only applies to type 'string' with format 'icu-message'`);\n }\n }\n return;\n }\n const { messageArguments, messageTags, messageExample, messageSource, messageOptional } = property;\n if (messageArguments !== undefined) {\n collectMessageArgumentsViolations(`${path}.messageArguments`, messageArguments, violations);\n }\n if (messageTags !== undefined) {\n collectMessageTagsViolations(`${path}.messageTags`, messageTags, violations);\n }\n collectMessageExamplePresenceViolations(path, messageArguments, messageExample, violations);\n // Sukima also checks the source as ICU against the contract; that parser has no TypeScript twin here.\n if (messageSource !== undefined && (typeof messageSource !== 'string' || messageSource.trim().length === 0)) {\n violations.push(`${path}.messageSource must be a non-blank string`);\n }\n if (messageOptional !== undefined && typeof messageOptional !== 'boolean') {\n violations.push(`${path}.messageOptional must be a boolean`);\n }\n}\n/** `messageExample` is required with declared arguments, needs `messageArguments`, and must fit them. */\nfunction collectMessageExamplePresenceViolations(path, messageArguments, messageExample, violations) {\n const declared = isRecord(messageArguments) && isRecord(messageArguments.properties) ? messageArguments.properties : undefined;\n if (messageExample === undefined) {\n if (declared !== undefined && Object.keys(declared).length > 0) {\n violations.push(`${path}.messageExample is required when messageArguments declares arguments`);\n }\n }\n else if (messageArguments === undefined) {\n violations.push(`${path}.messageExample requires messageArguments`);\n }\n else if (!isRecord(messageExample)) {\n violations.push(`${path}.messageExample must be an object`);\n }\n else if (declared !== undefined) {\n collectMessageExampleViolations(`${path}.messageExample`, messageExample, declared, violations);\n }\n}\nfunction collectMessageArgumentsViolations(path, value, violations) {\n if (!isRecord(value)) {\n violations.push(`${path} must be an object`);\n return;\n }\n collectKeywordViolations(path, value, MESSAGE_ARGUMENTS_KEYWORDS, violations);\n if (value.type !== 'object') {\n violations.push(`${path}.type must be 'object'`);\n }\n const { properties } = value;\n if (!isRecord(properties) || Object.keys(properties).length === 0) {\n violations.push(`${path}.properties must declare at least one argument`);\n return;\n }\n for (const [name, argument] of Object.entries(properties)) {\n collectMessageArgumentViolations(`${path}.properties.${name}`, name, argument, violations);\n }\n}\nfunction collectMessageArgumentViolations(path, name, argument, violations) {\n if (name === '__proto__') {\n violations.push(`${path}: property name \"${name}\" is not allowed`);\n return;\n }\n if (!isRecord(argument)) {\n violations.push(`${path} must be an object`);\n return;\n }\n collectKeywordViolations(path, argument, MESSAGE_ARGUMENT_KEYWORDS, violations);\n if (typeof argument.type !== 'string' || !MESSAGE_ARGUMENT_TYPES.has(argument.type)) {\n violations.push(`${path}.type must be one of 'integer' | 'number' | 'string' (got ${JSON.stringify(argument.type)})`);\n return;\n }\n if (argument.enum === undefined)\n return;\n if (argument.type !== 'string') {\n violations.push(`${path}.enum only applies to type 'string'`);\n }\n else if (!isStringEnum(argument.enum)) {\n violations.push(`${path}.enum must be a non-empty array of strings`);\n }\n}\nfunction collectMessageTagsViolations(path, value, violations) {\n if (!Array.isArray(value)) {\n violations.push(`${path} must be an array of tag names`);\n return;\n }\n const seen = new Set();\n for (const member of value) {\n if (typeof member !== 'string' || member.length === 0) {\n violations.push(`${path} member ${JSON.stringify(member)} must be a non-empty string`);\n }\n else if (seen.has(member)) {\n violations.push(`${path} declares \"${member}\" more than once`);\n }\n else {\n seen.add(member);\n }\n }\n}\n/** The example holds exactly the declared arguments, each of its declared type and within its `enum`. */\nfunction collectMessageExampleViolations(path, example, declared, violations) {\n for (const name of Object.keys(declared)) {\n if (!Object.hasOwn(example, name)) {\n violations.push(`${path} is missing argument \"${name}\"`);\n }\n }\n for (const key of Object.keys(example)) {\n if (!Object.hasOwn(declared, key)) {\n violations.push(`${path}.${key} is not a declared argument`);\n }\n }\n for (const [name, argument] of Object.entries(declared)) {\n if (!Object.hasOwn(example, name) || !isRecord(argument)) {\n continue;\n }\n const { type } = argument;\n if (typeof type !== 'string' || !MESSAGE_ARGUMENT_TYPES.has(type)) {\n continue;\n }\n const value = example[name];\n if (!matchesPropertyType(value, type)) {\n violations.push(`${path}.${name} must be of type '${type}'`);\n }\n else if (type === 'string' && isStringEnum(argument.enum) && !argument.enum.includes(value)) {\n violations.push(`${path}.${name} must be one of the enum members`);\n }\n }\n}\nfunction isStringEnum(value) {\n return Array.isArray(value) && value.length > 0 && value.every((member) => typeof member === 'string');\n}\nfunction isFiniteNumber(value) {\n return typeof value === 'number' && Number.isFinite(value);\n}\nfunction isNonNegativeInteger(value) {\n return typeof value === 'number' && Number.isInteger(value) && value >= 0;\n}\nfunction isValidRegExp(pattern) {\n try {\n new RegExp(pattern);\n return true;\n }\n catch {\n return false;\n }\n}\nfunction matchesPropertyType(value, type) {\n switch (type) {\n case 'string':\n return typeof value === 'string';\n case 'number':\n return isFiniteNumber(value);\n case 'integer':\n return typeof value === 'number' && Number.isInteger(value);\n case 'boolean':\n return typeof value === 'boolean';\n }\n}\n/** V7 (JSON serializability), applied to the whole definition including `widget` values. */\nfunction collectSerializabilityViolations(value, path, ancestors, violations) {\n if (value === null) {\n return;\n }\n if (typeof value === 'function' ||\n typeof value === 'undefined' ||\n typeof value === 'symbol' ||\n typeof value === 'bigint') {\n violations.push(`${path} is not JSON-serializable (${typeof value})`);\n return;\n }\n if (typeof value !== 'object') {\n return;\n }\n if (ancestors.includes(value)) {\n violations.push(`${path} is a cyclic reference`);\n return;\n }\n const nextAncestors = [...ancestors, value];\n if (Array.isArray(value)) {\n value.forEach((member, index) => {\n collectSerializabilityViolations(member, `${path}[${index}]`, nextAncestors, violations);\n });\n return;\n }\n for (const [key, member] of Object.entries(value)) {\n collectSerializabilityViolations(member, `${path}.${key}`, nextAncestors, violations);\n }\n}\n//# sourceMappingURL=define-content-type.js.map"],"mappings":";AAAA,MAAM,aAAa;;AAEnB,MAAM,gBAAgB;AACtB,MAAM,uBAAuB;CAAC;CAAU;CAAU;CAAW;AAAS;AACtE,MAAM,yBAAyB;CAAC,GAAG;CAAsB;CAAS;AAAQ;AAC1E,MAAM,mBAAmB;AACzB,MAAM,qBAAqB,GAAG,iBAAiB;AAC/C,MAAM,gCAAgB,IAAI,IAAI;CAAC;CAAQ;CAAwB;CAAY;AAAY,CAAC;;;AAGxF,MAAM,gCAAgB,IAAI,IAAI;CAAC;CAAM;CAAS;CAAe;AAAQ,CAAC;AACtE,MAAM,kCAAkB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC;AACD,MAAM,iCAAiB,IAAI,IAAI;CAAC;CAAQ;CAAS;CAAe;CAAS;CAAY;CAAY;AAAQ,CAAC;AAC1G,MAAM,kCAAkB,IAAI,IAAI;CAC5B;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D,OAAO,OAAO,UAAU;CAChC;AACJ;;AAEA,SAAS,iCAAiC,OAAO,MAAM,WAAW,YAAY;CAC1E,IAAI,UAAU,MACV;CAEJ,IAAI,OAAO,UAAU,cACjB,OAAO,UAAU,eACjB,OAAO,UAAU,YACjB,OAAO,UAAU,UAAU;EAC3B,WAAW,KAAK,GAAG,KAAK,6BAA6B,OAAO,MAAM,EAAE;EACpE;CACJ;CACA,IAAI,OAAO,UAAU,UACjB;CAEJ,IAAI,UAAU,SAAS,KAAK,GAAG;EAC3B,WAAW,KAAK,GAAG,KAAK,uBAAuB;EAC/C;CACJ;CACA,MAAM,gBAAgB,CAAC,GAAG,WAAW,KAAK;CAC1C,IAAI,MAAM,QAAQ,KAAK,GAAG;EACtB,MAAM,SAAS,QAAQ,UAAU;GAC7B,iCAAiC,QAAQ,GAAG,KAAK,GAAG,MAAM,IAAI,eAAe,UAAU;EAC3F,CAAC;EACD;CACJ;CACA,KAAK,MAAM,CAAC,KAAK,WAAW,OAAO,QAAQ,KAAK,GAC5C,iCAAiC,QAAQ,GAAG,KAAK,GAAG,OAAO,eAAe,UAAU;AAE5F"}
@@ -1,7 +1,7 @@
1
1
  import { ActionSelector } from "./actions/registry.js";
2
2
  import { MockActions, mockAction } from "./actions/mock-action.js";
3
3
  import { Direction, JsonValue, StorefrontContext } from "./schema/generated/schema.js";
4
- import { ContentArraySchema, ContentNestedObjectShape, ContentObjectPropertySchema, ContentObjectSchema, ContentPropertySchema, ContentPropertyType, ContentScalarSchema, ContentScalarType, ContentTypeDefinition, ContentValue, defineContentType } from "./define-content-type.js";
4
+ import { ContentArraySchema, ContentNestedObjectShape, ContentObjectPropertySchema, ContentObjectSchema, ContentPropertySchema, ContentPropertyType, ContentScalarSchema, ContentScalarType, ContentTypeDefinition, ContentValue, MessageArgumentSchema, MessageArguments, MessageArgumentsSchema, MessageFieldName, MessageLocaleProp, MessageTagName, defineContentType } from "./define-content-type.js";
5
5
  import { ComponentDefinition, EditorMetadata, FetchStrategy, PropSchema, PropSchemaField, PropType, VariableBinding, VariableBindings, defineComponent } from "./define-component.js";
6
6
  import "./types.js";
7
- export { type ActionSelector, type ComponentDefinition, type ContentArraySchema, type ContentNestedObjectShape, type ContentObjectPropertySchema, type ContentObjectSchema, type ContentPropertySchema, type ContentPropertyType, type ContentScalarSchema, type ContentScalarType, type ContentTypeDefinition, type ContentValue, type EditorMetadata, type FetchStrategy, type JsonValue, type MockActions, type PropSchema, type PropSchemaField, type PropType, type StorefrontContext, type VariableBinding, type VariableBindings, defineComponent, defineContentType, mockAction };
7
+ export { type ActionSelector, type ComponentDefinition, type ContentArraySchema, type ContentNestedObjectShape, type ContentObjectPropertySchema, type ContentObjectSchema, type ContentPropertySchema, type ContentPropertyType, type ContentScalarSchema, type ContentScalarType, type ContentTypeDefinition, type ContentValue, type EditorMetadata, type FetchStrategy, type JsonValue, type MessageArgumentSchema, type MessageArguments, type MessageArgumentsSchema, type MessageFieldName, type MessageLocaleProp, type MessageTagName, type MockActions, type PropSchema, type PropSchemaField, type PropType, type StorefrontContext, type VariableBinding, type VariableBindings, defineComponent, defineContentType, mockAction };
@@ -89,7 +89,7 @@ The label is associated with the input and the error is linked via `aria-describ
89
89
  - **Adding client-side format validation.** A code's validity is server-only; `invalid`/`errorMessage` must come from `userErrors`, never a local regex.
90
90
  - **Wiring GraphQL into this particle.** It is data-agnostic; use `AccessCodeSignIn.Validate` for the checkout-bound binding.
91
91
  - **Replacing it with a segmented multi-box widget.** This catalog deliberately composes `Field` + `Input` into a single-line input.
92
- - **Localizing via a message id.** There is no `react-intl`; pass `label` / `placeholder` / `errorMessage` as strings.
92
+ - **Localizing via a message id.** Labels are plain strings; pass `label` / `placeholder` / `errorMessage` directly.
93
93
 
94
94
  ---
95
95