@code-collective/booking-widget 1.0.15 → 1.0.16
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 +75 -48
- package/README.md +506 -500
- package/dist/booking-widget.js +28 -51
- package/dist/booking-widget.min.js +2 -2
- package/dist/booking-widget.umd.cjs +2 -2
- package/package.json +1 -1
- package/src/lib/api.ts +1 -28
- package/src/lib/checkout-payment-flow.svelte.ts +59 -103
- package/src/lib/generated-types.ts +0 -82
package/CHANGELOG.md
CHANGED
|
@@ -1,48 +1,75 @@
|
|
|
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.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- **
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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.
|