@code-collective/booking-widget 1.0.16 → 1.0.17

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/CHANGELOG.md CHANGED
@@ -1,75 +1,86 @@
1
- # Changelog
2
-
3
- The version in `package.json` had drifted behind npm (the repo said 1.0.7 while `latest` was 1.0.9), so
4
- 1.0.8 and 1.0.9 shipped without an entry here. This file starts at the point that caused a consumer a real
5
- detour.
6
-
7
- ## 1.0.16
8
-
9
- Peach now owns payment retries. A declined card never reaches the widget or the checkout API at all - Peach
10
- re-prompts inside its own embedded form and the shopper returns only once they have paid or given up - so the
11
- widget no longer reports declines, no longer asks the server to go and read Peach's status, and no longer
12
- renders a decline screen of its own.
13
-
14
- - **Removed** `reportPaymentFailure()` and `resolvePayment()` from `BookingApi`/`ApiClient`. The endpoints
15
- behind them (`POST /v1/checkout/cart/payment-failure`, `POST /v1/checkout/cart/resolve-payment`) are gone
16
- from the checkout API. Anything calling them directly must drop the call; there is nothing to replace it
17
- with, because there is no longer a client-reported outcome for the server to record.
18
- - **Changed** the cart status response is now `{ cartStatus, confirmResult }`. `paymentOutcome`, `resolvedBy`
19
- and `resultCode` are gone - the browser reads the cart's own status and nothing else.
20
- - **Changed** a Peach SDK `error` or `expired` callback now releases the checkout through
21
- `abandonPayment()`, the same call a cancel already used, so Try Again always mints a brand-new Peach
22
- checkout rather than reopening one Peach has finished with.
23
- - **Fixed** a cart the server's stuck-payment sweep expired is terminal in the widget. It used to keep
24
- polling a cart that could never change until the poll's own 90s window ran out, and a reload landed the
25
- shopper back on a card form for a cart that no longer existed.
26
- - **Unchanged** every export, custom-element attribute, `bwOptions` key and `bw:*` event name.
27
-
28
- ## 1.0.13, 1.0.14, 1.0.15
29
-
30
- Published without entries here. 1.0.13 and 1.0.14 carried a CSS regression - the checkout modal's own styles
31
- (cart card, pay bar, buttons) were silently missing from the built widget after a CSS split - and **1.0.15
32
- fixes it**. Anyone pinned to 1.0.13 or 1.0.14 should upgrade.
33
-
34
- ## 1.0.12
35
-
36
- Published from the branch that carries this work, which 1.0.10 was not. 1.0.11 was prepared but never
37
- published - the release script bumps patch before publishing, so the version that went out is one ahead of
38
- the one the branch was prepared as. The contents are identical either way.
39
-
40
- ## 1.0.10
41
-
42
- Published from a checkout that did not contain this work - `npm run release` was run from the main repo
43
- while the branch lived in a worktree - so it carries none of the entries below. `createBookingHost`,
44
- `BookingProvider`, `CartExpiryGuard`, `portal` and `setPeachSdk` are all absent from its `src/lib/index.ts`,
45
- which is the entry the `svelte` export condition points at and therefore the one a Svelte consumer compiles.
46
- Nothing to roll back; it is 1.0.9's code under a new number. **Publish from a checkout that has the branch,
47
- and check the entry exports before shipping** - `npm pack` the tarball and grep `package/src/lib/index.ts`.
48
-
49
- See `.changeset/` for the individual entries. In summary:
50
-
51
- - **Added** `createBookingHost()`, the shared host layer both builds now wire through, and
52
- `BookingProvider` so components need no `api`/`cartManager` props.
53
- - **Added** `mode="modal"` on `Checkout`, portalled to `document.body`.
54
- - **Added** exports: `CartExpiryGuard`, `onWidgetMessage`, `postMessage`, the `WidgetMessage` union,
55
- `portal`, `setBookingDefaults`.
56
- - **Changed** add-to-cart now opens checkout on every build by default (`autoOpenCheckout`).
57
- - **Changed** each `bw:*` event reaches `window` once per thing that happened. They were arriving twice,
58
- and `bw:close` four times per dismissal. Anything counting `bw:order-confirmed` was double-counting.
59
- - **Changed** each `bw-*` element dispatches its own events rather than all firing on the first element of
60
- that tag.
61
- - **Fixed** building a host no longer throws `window is not defined` during a server render.
62
- - **Unchanged** `ApiClient`, `SessionManager` and `CartManager` are still exported; the custom-element
63
- attributes, `bwOptions` and the `bw:*` event names are all as they were.
64
-
65
- ## 1.0.9
66
-
67
- - **Removed** `FakeApiClient` and the `useFakeApi` mount option, along with `src/lib/fake-api.ts`. This was
68
- a breaking change shipped in a patch release with no note: a consumer importing `FakeApiClient` gets a
69
- build error, because a missing named export is a hard failure in a bundler, not a runtime `undefined`.
70
- It had been the offline development path for consumers with no checkout API configured.
71
-
72
- **Decision: removed for good.** It is not coming back, and no later version reinstates it. A consumer
73
- that wants to run without a checkout API should render its own fallback rather than a fake catalogue.
74
- Where a stand-in client is genuinely needed - a test double, a demo page - pass one to
75
- `createBookingHost({ api })`, which takes any `BookingApi` implementation.
1
+ # Changelog
2
+
3
+ The version in `package.json` had drifted behind npm (the repo said 1.0.7 while `latest` was 1.0.9), so
4
+ 1.0.8 and 1.0.9 shipped without an entry here. This file starts at the point that caused a consumer a real
5
+ detour.
6
+
7
+ ## 1.0.16
8
+
9
+ Peach now owns payment retries. A declined card never reaches the widget or the checkout API at all - Peach
10
+ re-prompts inside its own embedded form and the shopper returns only once they have paid or given up - so the
11
+ widget no longer reports declines, no longer asks the server to go and read Peach's status, and no longer
12
+ renders a decline screen of its own.
13
+
14
+ - **Removed** `reportPaymentFailure()` and `resolvePayment()` from `BookingApi`/`ApiClient`. The endpoints
15
+ behind them (`POST /v1/checkout/cart/payment-failure`, `POST /v1/checkout/cart/resolve-payment`) are gone
16
+ from the checkout API. Anything calling them directly must drop the call; there is nothing to replace it
17
+ with, because there is no longer a client-reported outcome for the server to record.
18
+ - **Changed** the cart status response is now `{ cartStatus, confirmResult }`. `paymentOutcome`, `resolvedBy`
19
+ and `resultCode` are gone - the browser reads the cart's own status and nothing else.
20
+ - **Changed** a Peach SDK `error` or `expired` callback now releases the checkout through
21
+ `abandonPayment()`, the same call a cancel already used, so Try Again always mints a brand-new Peach
22
+ checkout rather than reopening one Peach has finished with.
23
+ - **Fixed** a cart the server's stuck-payment sweep expired is terminal in the widget. It used to keep
24
+ polling a cart that could never change until the poll's own 90s window ran out, and a reload landed the
25
+ shopper back on a card form for a cart that no longer existed.
26
+ - **Fixed** a card Peach ultimately declined used to leave the shopper on the verifying spinner for its full
27
+ 90 seconds and then on the pending screen, never offered Try Again, for a cart that could never change.
28
+ Peach fires its completed callback for a rejected transaction as well as a charged one; the widget now reads
29
+ the result code it carries and resolves straight to Payment Failed with Try Again. It deliberately does not
30
+ ask the server: Peach's checkout-level status answers "transaction pending" for a rejected transaction, so
31
+ it is only good for confirming a success. A code the widget cannot read is still treated as a possible
32
+ charge and polled, since showing "Payment Failed" over a charged card is the worse error.
33
+ - **Changed** Pay Now is accepted on a cart still awaiting confirmation, minting a new checkout over the dead
34
+ one. Nothing about the cart changes - that is what makes Try Again work after a decline. The new checkout
35
+ reuses the cart's merchant order ID, so Peach's dashboard still shows one order per basket however many
36
+ times the shopper retried; editing the basket is what mints a new order ID.
37
+ - **Unchanged** every export, custom-element attribute, `bwOptions` key and `bw:*` event name.
38
+
39
+ ## 1.0.13, 1.0.14, 1.0.15
40
+
41
+ Published without entries here. 1.0.13 and 1.0.14 carried a CSS regression - the checkout modal's own styles
42
+ (cart card, pay bar, buttons) were silently missing from the built widget after a CSS split - and **1.0.15
43
+ fixes it**. Anyone pinned to 1.0.13 or 1.0.14 should upgrade.
44
+
45
+ ## 1.0.12
46
+
47
+ Published from the branch that carries this work, which 1.0.10 was not. 1.0.11 was prepared but never
48
+ published - the release script bumps patch before publishing, so the version that went out is one ahead of
49
+ the one the branch was prepared as. The contents are identical either way.
50
+
51
+ ## 1.0.10
52
+
53
+ Published from a checkout that did not contain this work - `npm run release` was run from the main repo
54
+ while the branch lived in a worktree - so it carries none of the entries below. `createBookingHost`,
55
+ `BookingProvider`, `CartExpiryGuard`, `portal` and `setPeachSdk` are all absent from its `src/lib/index.ts`,
56
+ which is the entry the `svelte` export condition points at and therefore the one a Svelte consumer compiles.
57
+ Nothing to roll back; it is 1.0.9's code under a new number. **Publish from a checkout that has the branch,
58
+ and check the entry exports before shipping** - `npm pack` the tarball and grep `package/src/lib/index.ts`.
59
+
60
+ See `.changeset/` for the individual entries. In summary:
61
+
62
+ - **Added** `createBookingHost()`, the shared host layer both builds now wire through, and
63
+ `BookingProvider` so components need no `api`/`cartManager` props.
64
+ - **Added** `mode="modal"` on `Checkout`, portalled to `document.body`.
65
+ - **Added** exports: `CartExpiryGuard`, `onWidgetMessage`, `postMessage`, the `WidgetMessage` union,
66
+ `portal`, `setBookingDefaults`.
67
+ - **Changed** add-to-cart now opens checkout on every build by default (`autoOpenCheckout`).
68
+ - **Changed** each `bw:*` event reaches `window` once per thing that happened. They were arriving twice,
69
+ and `bw:close` four times per dismissal. Anything counting `bw:order-confirmed` was double-counting.
70
+ - **Changed** each `bw-*` element dispatches its own events rather than all firing on the first element of
71
+ that tag.
72
+ - **Fixed** building a host no longer throws `window is not defined` during a server render.
73
+ - **Unchanged** `ApiClient`, `SessionManager` and `CartManager` are still exported; the custom-element
74
+ attributes, `bwOptions` and the `bw:*` event names are all as they were.
75
+
76
+ ## 1.0.9
77
+
78
+ - **Removed** `FakeApiClient` and the `useFakeApi` mount option, along with `src/lib/fake-api.ts`. This was
79
+ a breaking change shipped in a patch release with no note: a consumer importing `FakeApiClient` gets a
80
+ build error, because a missing named export is a hard failure in a bundler, not a runtime `undefined`.
81
+ It had been the offline development path for consumers with no checkout API configured.
82
+
83
+ **Decision: removed for good.** It is not coming back, and no later version reinstates it. A consumer
84
+ that wants to run without a checkout API should render its own fallback rather than a fake catalogue.
85
+ Where a stand-in client is genuinely needed - a test double, a demo page - pass one to
86
+ `createBookingHost({ api })`, which takes any `BookingApi` implementation.