@base44/app-plugin-commerce 0.10.3 → 0.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44/app-plugin-commerce",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "description": "Base44 Commerce plugin — entities, backend functions, shared commerce engine, admin UI and the commerce skill, shipped as copyable source",
5
5
  "keywords": [
6
6
  "base44",
@@ -1,5 +1,5 @@
1
1
  ---
2
- read_when: "You are about to drive the storefront from a browser script — adding to the cart, stepping quantities, filling the checkout, placing an order."
2
+ read_when: "You are about to drive the storefront from a browser script — adding to the cart, stepping quantities, opening the checkout."
3
3
  skip_when: "You are not scripting the storefront."
4
4
  ---
5
5
 
@@ -37,17 +37,13 @@ DOM is briefly right about the *intent* and wrong about the *state*.
37
37
  `/checkout` — URL plus a field of the form on screen — before emptying the
38
38
  cart or moving on. Tearing the cart down while still on the cart page, or
39
39
  mid-navigation, produces an empty checkout that reads as a routing bug.
40
- - **Filling the checkout.** Every field is a controlled React input, so writing
41
- `el.value` changes nothing React sees. Use the harness's own fill (it
42
- dispatches `input` + `change`) never lift the native setter off
43
- `HTMLInputElement.prototype` and call `descriptor.set(v)`: detached from the
44
- element it throws `Illegal invocation`, and the workaround it is reaching for
45
- is what the fill helper already does.
46
- - **`placeOrder` ends the page.** It navigates with `window.location.assign`,
47
- so a script that placed an order loses its page context and can land back at
48
- `/` while the order itself was created normally. That is the hard
49
- navigation, not a broken redirect. The confirmation is reachable at any time
50
- from a fresh navigation to `orderReceivedUrl(result)`
51
- (`/order-received?order_id=…&order_key=…` — the ids come back in
52
- `placeOrder`'s result, and `commerce/admin-orders` `search` has the order
53
- either way).
40
+ - **The checkout is shipped code never fill it, never place an order.** Its
41
+ logic is the kit's and already tested; what is yours is how it looks. Open
42
+ `/checkout` with items in the cart and check that: it renders inside the
43
+ store's chrome, the `.sfui` tokens took (colours, radius, heading face match
44
+ the rest of the site), the `brand` copy reads in the store's voice, and
45
+ nothing overflows on a phone-width viewport. Do not type into its fields and
46
+ do not submit — an order is real store data the owner sees in `/store-admin`,
47
+ and the platform's "delete the record you created" rule does not fit it (the
48
+ entities are admin-only; a raw delete skips the engine that releases stock).
49
+ Empty the cart when you are done.
@@ -54,10 +54,12 @@ export function CartLineRow({ item, tt, productHref, compact = false, lineExtra
54
54
  const formatMoney = useFormatMoney();
55
55
  const attrs = attributesLabel(item.attributes);
56
56
  const href = productHref ? productHref(item) : null;
57
+ // storefront-cart sends `image` as a bare URL string; order lines carry {src, alt}.
58
+ const imageSrc = typeof item.image === "string" ? item.image : item.image?.src;
57
59
  return (
58
60
  <li className="sfui-line" data-pending={line.pending || undefined} data-compact={compact || undefined}>
59
61
  <div className="sfui-line-media" aria-hidden="true">
60
- {item.image?.src && <img src={item.image.src} alt="" loading="lazy" />}
62
+ {imageSrc && <img src={imageSrc} alt="" loading="lazy" />}
61
63
  </div>
62
64
  <div className="sfui-line-main">
63
65
  <p className="sfui-line-name">