@v-office/website-chat 1.1.3 → 1.3.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.
@@ -22,10 +22,16 @@ interface ChatRequest {
22
22
  readonly locale: ChatLocale;
23
23
  /** The widget's package version: the service offers only components it can render. */
24
24
  readonly clientVersion: string;
25
+ /** The stay the widget keeps in reach for the visitor (its dock bar), so "we'll take it" means that
26
+ * one; `null` or absent without one. An older service ignores it (1.3.0). */
27
+ readonly picked?: string | null;
25
28
  }
26
29
  /** Why the chat cannot answer: switched off, its budget spent, a reply still running, too many
27
30
  * messages, or anything else. The widget shows its fallback (search and contact links). */
28
31
  type ChatUnavailableReason = "off" | "budget" | "busy" | "limit" | "error";
32
+ /** What the service is doing while the visitor waits, for the widget's waiting line (1.3.0). A widget
33
+ * shows a step it does not know as plain waiting. */
34
+ type ChatStatusStep = "search" | "rental" | "availability" | "quote" | "reviews";
29
35
  /** One server-sent event (`event: <type>`, `data: <json>`), in order. */
30
36
  type ChatEvent = {
31
37
  readonly type: "session";
@@ -36,6 +42,11 @@ type ChatEvent = {
36
42
  } | {
37
43
  readonly type: "ui";
38
44
  readonly spec: Spec;
45
+ } |
46
+ /** Since 1.3.0; every earlier widget drops an event it does not know. */
47
+ {
48
+ readonly type: "status";
49
+ readonly step: ChatStatusStep;
39
50
  } | {
40
51
  readonly type: "done";
41
52
  } | {
@@ -43,4 +54,4 @@ type ChatEvent = {
43
54
  readonly reason: ChatUnavailableReason;
44
55
  };
45
56
  //#endregion
46
- export { ChatLocale as a, MAX_MESSAGE_CHARS as c, ChatEvent as i, SESSION_TTL_S as l, CHAT_PATH as n, ChatRequest as o, ChatAvailability as r, ChatUnavailableReason as s, CHAT_LOCALES as t };
57
+ export { ChatLocale as a, ChatUnavailableReason as c, ChatEvent as i, MAX_MESSAGE_CHARS as l, CHAT_PATH as n, ChatRequest as o, ChatAvailability as r, ChatStatusStep as s, CHAT_LOCALES as t, SESSION_TTL_S as u };
@@ -4,6 +4,8 @@
4
4
 
5
5
  Release notes of `@v-office/website-chat`, newest first. Each version has its own directory.
6
6
 
7
+ - `versions/1.3.0/CHANGELOG.md`: release notes for 1.3.0
8
+ - `versions/1.2.0/CHANGELOG.md`: release notes for 1.2.0
7
9
  - `versions/1.1.3/CHANGELOG.md`: release notes for 1.1.3
8
10
  - `versions/1.1.2/CHANGELOG.md`: release notes for 1.1.2
9
11
  - `versions/1.1.1/CHANGELOG.md`: release notes for 1.1.1
@@ -4,6 +4,8 @@
4
4
 
5
5
  Migration guides of `@v-office/website-chat`, newest first. Apply them in order when skipping versions.
6
6
 
7
+ - `versions/1.3.0/MIGRATION.md`: Migration: 1.2.0 to 1.3.0
8
+ - `versions/1.2.0/MIGRATION.md`: Migration: 1.1.3 to 1.2.0
7
9
  - `versions/1.1.3/MIGRATION.md`: Migration: 1.1.2 to 1.1.3
8
10
  - `versions/1.1.2/MIGRATION.md`: Migration: 1.1.1 to 1.1.2
9
11
  - `versions/1.1.1/MIGRATION.md`: Migration: 1.1.0 to 1.1.1
@@ -0,0 +1,45 @@
1
+ # Changelog: 1.2.0
2
+
3
+ The chat reads better on phones, says more clearly what each card is for, and tells screen readers what
4
+ happens. Nothing to change on a site.
5
+
6
+ ## Added
7
+
8
+ - Copy keys `pets` (`{n} Haustier` / `{n} Haustiere`, `{n} pet` / `{n} pets`) and `rentalsFound`
9
+ ("Gefundene Unterkünfte" / "Rentals found"), with defaults in both languages.
10
+
11
+ ## Changed
12
+
13
+ - Other free periods (`AlternativeStays`) name the rental they belong to, so dates under one rental's card
14
+ never read as its prices.
15
+ - Cards name the month ("12.–19. Juli", "12–19 Jul") and the party the price is for, pets included.
16
+ - Compare and the price calendar fit a phone: two readable comparison columns that scroll, rows that line
17
+ up side by side, and the cheapest arrival scrolled into view.
18
+ - A price breakdown shown on its own names the rental, the dates and the party.
19
+ - On narrow phones a carousel card is only as tall as its content, so its price and booking button stay
20
+ above the input; in a carousel a long rental name stops at three lines, and counts on cards and in
21
+ Compare keep their number and noun on one line ("2 Kinder", "2 Schlafzimmer").
22
+ - Touch targets are at least 44 px on touch screens, the first-message suggestions wrap instead of
23
+ scrolling, and hover styles apply only where there is a pointer.
24
+ - Larger dates and prices, the same visible focus ring on every control, a placeholder with AA contrast,
25
+ free and taken calendar days that are easy to tell apart in dark mode, visitor messages and chips with
26
+ an edge, and tidier chips and buttons. The widget still takes its colours from the site's tokens; only
27
+ some of its own tones changed for these contrasts.
28
+ - A reply opens at its start: when the first card arrives, the visitor's question scrolls to the top of the
29
+ conversation, and the list follows only a visitor who stays at the bottom. Only the conversation
30
+ scrolls; the chat's header stays in place.
31
+ - Screen readers hear each finished reply once (`role="log"`) and that the chat is working while it
32
+ searches; booking links name the rental and the dates; a carousel is announced as the rentals found.
33
+ - The chat shows that it is working until the reply's text arrives, also after its cards. A message the
34
+ chat cannot answer now is answered in the conversation, with links to the search and the contact page;
35
+ when the chat was busy or the message failed, it stays in the input to send again.
36
+ - Two first-message suggestions changed: a summer week for a family and next weekend, instead of school
37
+ holidays, which differ by federal state.
38
+ - `--chat-top` applies only from 1024 px wide. On phones and tablets the chat opens as a full-height sheet
39
+ over the site's sticky header, which could not be used while the chat was open anyway.
40
+ - The component descriptions in `./catalog` say more precisely when each component fits and what must come
41
+ first. Nothing renders differently because of them.
42
+
43
+ ## Unchanged
44
+
45
+ - Props, themes, the `colors` prop and the protocol are as in 1.1.3; existing copy keys keep their meaning.
@@ -0,0 +1,15 @@
1
+ # Migration: 1.1.3 to 1.2.0
2
+
3
+ No changes required.
4
+
5
+ - A site that passes `copy` needs nothing for the new keys `pets` and `rentalsFound`: their defaults apply.
6
+ Code that builds a complete `ChatCopy` object adds both.
7
+ - A site that overrides `suggestions` keeps its own; the new defaults apply only where it does not.
8
+ - A site that sets `--chat-top` keeps it: it still moves the panel below the sticky header on screens from
9
+ 1024 px wide. Below that, the chat covers the header as a full-height sheet.
10
+
11
+ ## 1. Upgrade
12
+
13
+ ```sh
14
+ pnpm add --save-exact @v-office/website-chat@1.2.0
15
+ ```
@@ -0,0 +1,82 @@
1
+ # Changelog: 1.3.0
2
+
3
+ Quotes say what the price covers, what the guest saves and until when the stay is free to cancel, all from
4
+ the booking system, and a quote shown when the guest has decided hands the stay over to the booking page.
5
+ Nothing to change on a site.
6
+
7
+ ## Added
8
+
9
+ - Quotes (`StayQuote`) name the total ("Gesamtpreis für 7 Nächte"), show the agency's discount with what
10
+ the guest saves ("Frühbucher · Sie sparen 112,30 €"), the rate's own name and the free-cancellation date
11
+ from the booking system ("Kostenlos stornierbar bis 7. Jan. 2027", or "Nicht erstattbar"), and fold the
12
+ price lines into "Preisdetails". The dates carry their weekdays ("Sa 6. – Sa 13. Feb."), and a small
13
+ photo sits beside the name.
14
+ - A quote shown when the guest has decided (`handover`) becomes a hand-over card: arrival and departure
15
+ with weekdays, the party with the children's ages, the rate, the chosen extras, the total as the largest
16
+ figure, one full-width "Weiter zur Buchung" button, and, where the rental has a booking page, what that page asks
17
+ next.
18
+ - Cards and Compare label their total the same way and mark a discounted stay with the discount's name.
19
+ - A bar above the input keeps the stay being discussed in reach: its name, total, dates and guests and
20
+ a "Zur Buchung" button; a tap on its name brings the stay's card back into view. Before a stay is
21
+ priced it shows what the chat searched with (period, party, nights, wishes), the party marked
22
+ "angenommen" when the guest named none; a tap on a part puts the start of a correction into the input.
23
+ - The header keeps a "KI" mark beside the title. After the first message the AI notice shrinks to one
24
+ line ("Preise aus dem Buchungssystem"), with the full notice behind ⓘ.
25
+ - While the guest waits, the chat says what it is doing ("Prüfe den Preis im Buchungssystem …").
26
+ - A message the chat could not answer (busy, failed) can be sent again with "Erneut senden".
27
+ - Optional `privacyPath` prop: the step that starts the chat links the site's privacy policy.
28
+ - Links out of the chat (rental and booking pages, search, contact) carry `ref=chat`, a parameter
29
+ the site already treats as tracking: it changes no search and is not kept in share links.
30
+ - Calendars mark the days a stay can start on and each free day's price level (cheaper to dearer, never
31
+ an amount, and only where the levels differ); taken days are hatched, so the calendar reads without
32
+ colour. Tapping an arrival day fills it alone and shows "Anreise Di 9. Feb." with "Preis anzeigen",
33
+ which asks the chat for that stay.
34
+ - A stay the booking system refused lists the stay lengths it allows from that arrival ("4 Nächte bis
35
+ Di 18. Mai"); each asks for its price. "Anderen Anreisetag wählen" starts a new question.
36
+ - Cards from a flexible search switch between their rental's free periods in place: dates, total and
37
+ booking button change without a new reply, and the bar above the input follows. Periods in one month
38
+ name it once ("Freie Termine im Mai", pills "8.–15.", "13.–20.").
39
+ - Copy keys: `arrivalPossible`, `cheaper`, `dearer`, `showPrice`, `arrivalOn`, `possibleFrom`, `until`,
40
+ `otherArrival`, `otherArrivalStarter`, `freePeriods`, `freePeriodsIn`, `datesDiffer` and `otherDate`.
41
+ - Tapping a card's photo opens the rental's photos large inside the chat: uncropped, with the
42
+ booking system's captions, swiped or stepped through, with the stay's total and "Zur Buchung" kept in
43
+ the foot. Escape closes the photos first, then the chat. Copy keys `openPhotos`, `closePhotos`.
44
+ - Copy keys, with defaults in both languages: `totalForNights`, `priceDetails`, `dealFallback`, `youSave`,
45
+ `freeCancellation`, `nonRefundable`, `arrival`, `departure`, `continueToBooking`, `nothingBookedYet`,
46
+ `handoverSteps` (the three steps under the hand-over's button), `aiBadge`, `noticeShort`,
47
+ `noticeMore`, `status` (the waiting line per step), `retry`, `privacyLink`, `yourPick`, `yourTrip`,
48
+ `assumed`, `guests`, `adultsShort`, `weekend` and `tripStarters`.
49
+ - `./catalog`: the optional state the chat service writes for these (`ChatDiscount`, `ChatCancellation`,
50
+ `ChatTrip`, and optional fields on `ChatStay`, `ChatCalendar`, `ChatImage` and `ChatState`), the
51
+ `status` event (`ChatStatusStep`), the optional `picked` field of a request, and `versionAtLeast`. A
52
+ widget that does not draw a field yet ignores it.
53
+
54
+ ## Changed
55
+
56
+ - The German `book` label reads "Zur Buchung" instead of "Buchen", as a stay link's button (`bookStay`) already did.
57
+ - Under a card's labelled total, the foot shows the dates without repeating the nights.
58
+ - The input reads "Ihre Reise beschreiben …" ("Describe your trip …") and stays one line on a phone; its
59
+ focus ring shows for keyboard focus only.
60
+ - Quick replies the guest has answered go quiet: only the chosen one stays, outlined and muted. The
61
+ current ones stay tinted pills, so they never look like the outlined links out of the chat.
62
+ - Buttons keep their full colour while a reply is still being written (they wait for it, as before).
63
+ - Other free periods (`AlternativeStays`) are rows with weekday dates, nights (with a discount's badge)
64
+ and total that choose a period for the booking button in the bar, instead of chips that left the chat
65
+ for the booking page. The choice is kept with the conversation and named in the next message.
66
+ - Calendars show free days plain and taken days hatched instead of tinting free days.
67
+ - Cards lead with a larger photo (4:3 for a single card on a phone, flatter in a carousel) with the place
68
+ and "★ 4,8 (23)" on it and a photo count instead of dots; a card without photos writes them the same
69
+ way above its name. Photos load in the size the screen needs
70
+ where the booking system offers several (`srcset`).
71
+ - In dark mode cards, comparisons and calendars rise a step above the conversation with a fine edge,
72
+ instead of sinking into it. Star ratings take a colour that reads on light and dark surfaces.
73
+ - A carousel card puts the total's label above the total and the button, so the price stays in view; a
74
+ discount's badge sits on the total's line, never on two. Compare's rows line up at every width, long
75
+ names cut at three lines.
76
+ - On touch screens a carousel shows dots instead of the arrows and count, fades at the end while more
77
+ cards follow, and says when its rentals' dates differ. Compare marks a stay on other dates than the first.
78
+
79
+ ## Unchanged
80
+
81
+ - Props, themes and the existing copy keys keep their meaning. `PriceBreakdown` and `PriceCalendar` still
82
+ render, for conversations stored before this version.
@@ -0,0 +1,22 @@
1
+ # Migration: 1.2.0 to 1.3.0
2
+
3
+ No changes required.
4
+
5
+ - A site whose `copy` sets `book` keeps its own label; the others now read "Zur Buchung" in German.
6
+ - A site that passes `copy` needs nothing for the new keys: their defaults apply. Override
7
+ `handoverSteps` when the site's booking page asks something else than contact details, payment and an
8
+ email confirmation (the hand-over lists them only for rentals with a booking page). Code that builds a
9
+ complete `ChatCopy` object adds the new keys.
10
+ - Pass `privacyPath` (for example `privacyPath="/datenschutz"`) to link the privacy policy where the
11
+ chat is started.
12
+ - A site that overrides `notice` also overrides `noticeShort`, which stands in for it after the first
13
+ message (the full `notice` stays behind ⓘ). A site that overrides `placeholder` keeps its own.
14
+ - Analytics may see `ref=chat` on rental, booking, search and contact URLs opened from the chat.
15
+ - Other free periods no longer link to the booking page themselves: a tapped row becomes the stay in
16
+ the bar above the input, whose "Zur Buchung" opens it.
17
+
18
+ ## 1. Upgrade
19
+
20
+ ```sh
21
+ pnpm add --save-exact @v-office/website-chat@1.3.0
22
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-office/website-chat",
3
- "version": "1.1.3",
3
+ "version": "1.3.0",
4
4
  "description": "The AI chat of v-office websites: a launcher and a lazily loaded chat panel in a Shadow DOM, talking to the AI Studio chat service, and the json-render catalog (./catalog) the service places its rental cards, stays and links from. Styled through CSS custom properties and curated template themes; consumers need no Tailwind",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "@types/react": "19.3.0",
36
36
  "@types/react-dom": "19.3.0",
37
37
  "@v-office/website-headless": "1.5.0",
38
- "@v-office/website-sdk": "3.3.0",
38
+ "@v-office/website-sdk": "3.6.0",
39
39
  "jsdom": "30.0.1",
40
40
  "oxfmt": "0.67.0",
41
41
  "oxlint": "1.82.0",