@shoppexio/storefront-react 0.2.1 → 0.4.0

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 (42) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/dist/account.css +4 -8
  3. package/dist/account.js +2387 -942
  4. package/dist/account.js.map +1 -1
  5. package/dist/{chunk-ZEFZPUAW.js → chunk-NBOIS53R.js} +2 -1
  6. package/dist/chunk-NBOIS53R.js.map +1 -0
  7. package/dist/index.d.ts +243 -29
  8. package/dist/index.js +221 -77
  9. package/dist/index.js.map +1 -1
  10. package/eject/account/account-availability.ts +4 -1
  11. package/eject/account/account-downloads.ts +89 -1
  12. package/eject/account/account-referrals.ts +249 -7
  13. package/eject/account/account-reseller.ts +6 -140
  14. package/eject/account/dashboard.tsx +1 -0
  15. package/eject/account/downloads.tsx +73 -4
  16. package/eject/account/hosted-page.ts +45 -0
  17. package/eject/account/messages/ar.json +94 -31
  18. package/eject/account/messages/de.json +94 -31
  19. package/eject/account/messages/en.json +94 -31
  20. package/eject/account/messages/es.json +94 -31
  21. package/eject/account/messages/fi.json +94 -31
  22. package/eject/account/messages/fr.json +94 -31
  23. package/eject/account/messages/hi.json +94 -31
  24. package/eject/account/messages/it.json +94 -31
  25. package/eject/account/messages/lt.json +94 -31
  26. package/eject/account/messages/nl.json +94 -31
  27. package/eject/account/messages/pl.json +94 -31
  28. package/eject/account/messages/pt.json +94 -31
  29. package/eject/account/messages/ru.json +94 -31
  30. package/eject/account/messages/tr.json +94 -31
  31. package/eject/account/messages/uk.json +94 -31
  32. package/eject/account/messages/zh.json +94 -31
  33. package/eject/account/orders.tsx +141 -0
  34. package/eject/account/overview.tsx +6 -0
  35. package/eject/account/referrals.tsx +444 -156
  36. package/eject/account/reseller.tsx +59 -306
  37. package/eject/account/rewards.tsx +43 -6
  38. package/eject/account/settings.tsx +98 -2
  39. package/eject/account/shared.tsx +42 -3
  40. package/eject/account/subscriptions.tsx +75 -16
  41. package/package.json +7 -4
  42. package/dist/chunk-ZEFZPUAW.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,125 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ - Account: adding funds, changing a card and handing out reseller keys move to
6
+ the hosted buyer pages on the checkout host (`/topup`, `/billing`,
7
+ `/reseller`), behind their own email code. The account links there through
8
+ `hostedPageUrl`; the "Top up" link shows only when the wallet summary's new
9
+ `topups_allowed` is true. Removed: the reseller wholesale basket, its quote
10
+ and the quantity steppers, and `quoteResellerOrder` from the SDK type. An
11
+ ejected account takes `overview.tsx`, `reseller.tsx`, `rewards.tsx`,
12
+ `subscriptions.tsx`, `shared.tsx`, `hosted-page.ts` and the message catalogs
13
+ from `eject/account` again.
14
+ - Referrals: "Your rates" replaces the single "{n}% commission" figure: the
15
+ rate on most products and the products that earn nothing, the cap and the
16
+ minimum per order, and how long a referred buyer stays. A link names its
17
+ commission only when it earns another rate. `SdkCustomerAffiliateSummary`
18
+ carries `rates` (`SdkCustomerAffiliateRates`, null until the main link is
19
+ approved and active); its `custom_rate_product_count` counts the products
20
+ that pay their own rate, so the row says "most products" while any does. An ejected account takes `referrals.tsx`,
21
+ `account-referrals.ts` and the message catalogs from `eject/account` again.
22
+ - Reviews: `ShopReview.reply` carries the shop's reply under a review (null
23
+ when the shop has not replied), from the feed's `reply`; `SdkShopReview`
24
+ declares it.
25
+
26
+ ## 0.3.0
27
+
28
+ Added, in the customer account (`@shoppexio/storefront-react/account`). Each
29
+ needs the storefront SDK build that carries the matching customer method;
30
+ against an older SDK the control answers with the account's generic error.
31
+
32
+ - Referrals: a buyer makes a referral link with a code of their own, when the
33
+ shop allows it (`can_create_custom_links`; a shop that does not shows its
34
+ own reason instead). A buyer the shop has not enrolled yet (auto-join off)
35
+ gets the control too, without the balance and history. A link that asks for
36
+ its own rates is reported as waiting for approval. Payouts, conversions and
37
+ sharebacks stay out.
38
+ - Orders: "Download invoice (PDF)" on an order.
39
+ - Settings: three order-mail switches (order confirmations, order receipts,
40
+ payment issues), next to the marketing lists.
41
+ - `ShoppexSdk` declares `createAffiliateLink`, `invoicePdf`,
42
+ `notificationPreferences`
43
+ and `updateNotificationPreferences`; `SdkCustomerAffiliateSummary` carries
44
+ `can_create_custom_links` and `custom_link_request_disabled_reason`.
45
+
46
+ A project that already ejected the account keeps its own copy. Take
47
+ `referrals.tsx`, `orders.tsx`, `settings.tsx` and `account-referrals.ts` from `eject/account` again to get these.
48
+
49
+ Added, in the cart:
50
+
51
+ - `useCart().requote()`: asks the server to price the cart again, for a Retry
52
+ under a failed quote. It is the cart's own refresh, so it writes only the
53
+ quote and `quoteError`, never clears a failed write's `mutationError`, and
54
+ settles once the answer is in.
55
+
56
+ Added, in the payload:
57
+
58
+ - `ProductCustomField.options`: the labels of a `type: 'select'` field, in
59
+ the merchant's order. Draw a select as a dropdown of exactly these labels.
60
+ - `StorefrontProduct.addonsRequired` and `addonChoiceMissing(product, chosen)`:
61
+ the buyer must pick one of the product's add-ons, the rule the server
62
+ refuses a line by (`errors.checkout.addon_required`). It asks nothing when
63
+ the product offers no add-on; a required (locked) add-on counts as the pick.
64
+ A template's buy box reads it to ask before the add; a card or tile that adds
65
+ without a choice sends the buyer to the product page.
66
+ - `StorefrontProduct.upsellProductIds`: the merchant's upsell picks as product
67
+ uniqids (`StorefrontProduct.id`), in the merchant's order; empty when they
68
+ picked none. The Easy lane lists them on the product page instead of the
69
+ automatic related products.
70
+
71
+ A template that builds `StorefrontProduct` objects itself adds
72
+ `addonsRequired` and `upsellProductIds`.
73
+
74
+ - `ProductAddon.description`: the merchant's line under an add-on's title,
75
+ `null` when they wrote none (the wire sends `''`). The Easy lane prints it
76
+ under the title; a template that builds `ProductAddon` objects itself adds
77
+ the field.
78
+ - `StorefrontProduct.images`: the gallery with each image's `kind`
79
+ (`'art' | 'logo' | null`) and `inkColor` (`#rrggbb` or `null`), next to
80
+ `imageUrls`. Both are the backend's pixel analysis; null means "not analysed",
81
+ and an unknown value is read as null, never guessed. A template draws a logo
82
+ on a contrasting plate from them.
83
+ - `StorefrontShop.description`: the shop's one-line description, or `null`
84
+ when the merchant set none. The Easy lane's footer shows it under the
85
+ brand; a code template shows it where its own footer copy is blank, so both
86
+ lanes say the same thing.
87
+ - `StorefrontProduct.deliveryType` (`ProductDeliveryType`): what the buyer
88
+ receives, `'key' | 'download' | 'service' | 'shipped'`, as the backend reads
89
+ it off the product's delivery mechanism. `null` where the mechanism does not
90
+ say (an item the merchant's webhook makes, an information card) and for a
91
+ value this version does not know. The Loadout Easy-lane card shows it as its
92
+ type cell, in `unitLabelSingular` when the merchant set one.
93
+
94
+ Changed:
95
+
96
+ - `validateCheckoutFieldValue` refuses a select answer that is not one of its
97
+ `options` with "<name> must be one of the listed options." (the server
98
+ refuses it with `custom_field_option_invalid`).
99
+ - A product's `customFields` leave out the fields the merchant collects after
100
+ payment (`collect_after_payment`): the buyer answers those on the invoice,
101
+ and the server drops a value the cart sends for them.
102
+ - `useCart().add` refuses a product with `addonsRequired` when the line names
103
+ none of its add-ons ("Choose an add-on for <product> to continue."), and a
104
+ bundle add refuses such a member, instead of writing a line the quote
105
+ refuses.
106
+ - Rewards: when a points conversion's result is unknown (the API answered
107
+ `RESPONSE_CONTRACT_VIOLATION`), the account shows "Loading your rewards"
108
+ and keeps the conversion form locked until a fresh read of the balance
109
+ answers, so a buyer cannot convert the same points twice.
110
+ - Line prices match the invoice to the cent. `calculateDisplayLineTotal`,
111
+ `calculateLinePricing` and the cart view now use the backend's decimal line
112
+ math: a mill unit price is multiplied before rounding ($0.012 × 3 is $0.04,
113
+ not $0.03), an exact half cent rounds up, totals above ~$90 billion keep
114
+ their last cent, and add-on prices are added as decimals instead of a float
115
+ sum. `calculateDisplayLineTotal` takes the selected add-on prices as an
116
+ optional fifth argument. Volume-discount rules are read like the invoice
117
+ reads them (`"3units"` is no tier, `value: true` is 1).
118
+ - `formatMoney` keeps the currency's decimals on a whole amount too: `$64.00`,
119
+ not `$64`, as the Easy lane prints every price. Card prices, the "from"
120
+ price, buy box totals and the cart all follow. A template test that pinned
121
+ `$49` reads `$49.00` after the bump.
122
+
3
123
  ## 0.2.1
4
124
 
5
125
  - Favorites follow the account session without a reload. Signing in on the
package/dist/account.css CHANGED
@@ -256,10 +256,6 @@
256
256
  width: calc(var(--sxa-spacing) * 16);
257
257
  }
258
258
 
259
- .sxa\:w-24 {
260
- width: calc(var(--sxa-spacing) * 24);
261
- }
262
-
263
259
  .sxa\:w-36 {
264
260
  width: calc(var(--sxa-spacing) * 36);
265
261
  }
@@ -667,6 +663,10 @@
667
663
  word-break: break-all;
668
664
  }
669
665
 
666
+ .sxa\:whitespace-pre-line {
667
+ white-space: pre-line;
668
+ }
669
+
670
670
  .sxa\:whitespace-pre-wrap {
671
671
  white-space: pre-wrap;
672
672
  }
@@ -738,10 +738,6 @@
738
738
  background-color: var(--sx-surface-raised);
739
739
  }
740
740
 
741
- .sxa\:hover\:text-error:hover {
742
- color: var(--sx-error);
743
- }
744
-
745
741
  .sxa\:hover\:opacity-80:hover {
746
742
  opacity: .8;
747
743
  }