@code-collective/booking-widget 1.0.10 → 1.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.
- package/CHANGELOG.md +46 -0
- package/README.md +500 -388
- package/dist/booking-widget.css +1 -1
- package/dist/booking-widget.js +2415 -1745
- package/dist/booking-widget.min.css +1 -1
- package/dist/booking-widget.min.js +39 -23
- package/dist/booking-widget.umd.cjs +5 -3
- package/package.json +58 -55
- package/src/lib/BookingProvider.svelte +21 -0
- package/src/lib/CartBar.svelte +26 -41
- package/src/lib/CartBarView.svelte +78 -61
- package/src/lib/CartExpiryGuard.svelte +15 -9
- package/src/lib/CartOverview.svelte +30 -20
- package/src/lib/CartOverviewButton.svelte +104 -101
- package/src/lib/Checkout.svelte +141 -128
- package/src/lib/CheckoutModal.svelte +838 -805
- package/src/lib/CheckoutPanel.svelte +121 -0
- package/src/lib/PaymentPage.svelte +191 -177
- package/src/lib/PickupPointPicker.svelte +1 -1
- package/src/lib/TicketConfigurator.svelte +166 -152
- package/src/lib/UnitCounter.svelte +16 -2
- package/src/lib/WizardPage.svelte +102 -35
- package/src/lib/app.css +0 -6
- package/src/lib/booking-context.ts +33 -0
- package/src/lib/cart-overview.svelte.ts +97 -0
- package/src/lib/config.ts +162 -153
- package/src/lib/elements/bw-cart.svelte +49 -35
- package/src/lib/elements/bw-checkout.svelte +97 -97
- package/src/lib/elements/bw-configurator.svelte +72 -56
- package/src/lib/elements/register.ts +171 -196
- package/src/lib/elements/shared.ts +18 -14
- package/src/lib/elements/theme.css +0 -6
- package/src/lib/host.svelte.ts +336 -0
- package/src/lib/index.ts +242 -196
- package/src/lib/layout.svelte.ts +52 -0
- package/src/lib/messages.ts +157 -77
- package/src/lib/peach-sdk.ts +86 -40
- package/src/lib/portal.ts +23 -0
- package/src/lib/CartExpiryGuard.test.ts +0 -331
- package/src/lib/CheckoutModal.confirm-outcome.test.ts +0 -91
- package/src/lib/CheckoutModal.payment-timeout.test.ts +0 -140
- package/src/lib/test/fixtures.ts +0 -107
- package/src/lib/test/messages-mock.ts +0 -34
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
## Unreleased
|
|
8
|
+
|
|
9
|
+
Pending a release as **1.0.11**.
|
|
10
|
+
|
|
11
|
+
## 1.0.10
|
|
12
|
+
|
|
13
|
+
Published from a checkout that did not contain this work - `npm run release` was run from the main repo
|
|
14
|
+
while the branch lived in a worktree - so it carries none of the entries below. `createBookingHost`,
|
|
15
|
+
`BookingProvider`, `CartExpiryGuard`, `portal` and `setPeachSdk` are all absent from its `src/lib/index.ts`,
|
|
16
|
+
which is the entry the `svelte` export condition points at and therefore the one a Svelte consumer compiles.
|
|
17
|
+
Nothing to roll back; it is 1.0.9's code under a new number. **Publish from a checkout that has the branch,
|
|
18
|
+
and check the entry exports before shipping** - `npm pack` the tarball and grep `package/src/lib/index.ts`.
|
|
19
|
+
|
|
20
|
+
See `.changeset/` for the individual entries. In summary:
|
|
21
|
+
|
|
22
|
+
- **Added** `createBookingHost()`, the shared host layer both builds now wire through, and
|
|
23
|
+
`BookingProvider` so components need no `api`/`cartManager` props.
|
|
24
|
+
- **Added** `mode="modal"` on `Checkout`, portalled to `document.body`.
|
|
25
|
+
- **Added** exports: `CartExpiryGuard`, `onWidgetMessage`, `postMessage`, the `WidgetMessage` union,
|
|
26
|
+
`portal`, `setBookingDefaults`.
|
|
27
|
+
- **Changed** add-to-cart now opens checkout on every build by default (`autoOpenCheckout`).
|
|
28
|
+
- **Changed** each `bw:*` event reaches `window` once per thing that happened. They were arriving twice,
|
|
29
|
+
and `bw:close` four times per dismissal. Anything counting `bw:order-confirmed` was double-counting.
|
|
30
|
+
- **Changed** each `bw-*` element dispatches its own events rather than all firing on the first element of
|
|
31
|
+
that tag.
|
|
32
|
+
- **Fixed** building a host no longer throws `window is not defined` during a server render.
|
|
33
|
+
- **Unchanged** `ApiClient`, `SessionManager` and `CartManager` are still exported; the custom-element
|
|
34
|
+
attributes, `bwOptions` and the `bw:*` event names are all as they were.
|
|
35
|
+
|
|
36
|
+
## 1.0.9
|
|
37
|
+
|
|
38
|
+
- **Removed** `FakeApiClient` and the `useFakeApi` mount option, along with `src/lib/fake-api.ts`. This was
|
|
39
|
+
a breaking change shipped in a patch release with no note: a consumer importing `FakeApiClient` gets a
|
|
40
|
+
build error, because a missing named export is a hard failure in a bundler, not a runtime `undefined`.
|
|
41
|
+
It had been the offline development path for consumers with no checkout API configured.
|
|
42
|
+
|
|
43
|
+
**Decision: removed for good.** It is not coming back, and no later version reinstates it. A consumer
|
|
44
|
+
that wants to run without a checkout API should render its own fallback rather than a fake catalogue.
|
|
45
|
+
Where a stand-in client is genuinely needed - a test double, a demo page - pass one to
|
|
46
|
+
`createBookingHost({ api })`, which takes any `BookingApi` implementation.
|