@v-office/website-chat 1.1.0 → 1.1.1
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/dist/{icons-B4hI9ipR.js → icons-DIqOmKoe.js} +6 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +19 -13
- package/dist/{panel-hLRBoh8t.js → panel-BsocDe9I.js} +16 -19
- package/instructions/CHANGELOG.md +1 -0
- package/instructions/MIGRATION.md +1 -0
- package/instructions/versions/1.1.1/CHANGELOG.md +26 -0
- package/instructions/versions/1.1.1/MIGRATION.md +13 -0
- package/package.json +3 -3
|
@@ -146,6 +146,11 @@ const Check = () => /* @__PURE__ */ jsx(Svg, {
|
|
|
146
146
|
size: 14,
|
|
147
147
|
children: /* @__PURE__ */ jsx("path", { d: "M5 12.5l4.5 4.5L19 7.5" })
|
|
148
148
|
});
|
|
149
|
+
/** In a photo's place on a card without photos. */
|
|
150
|
+
const House = () => /* @__PURE__ */ jsx(Svg, {
|
|
151
|
+
size: 32,
|
|
152
|
+
children: /* @__PURE__ */ jsx("path", { d: "M3 10.5 12 3l9 7.5M5 9v11h14V9M10 20v-6h4v6" })
|
|
153
|
+
});
|
|
149
154
|
/** What a suggestion is about, read from its words (German and English), for its icon. */
|
|
150
155
|
const TOPICS = [
|
|
151
156
|
{
|
|
@@ -235,4 +240,4 @@ const TopicIcon = ({ text }) => {
|
|
|
235
240
|
return /* @__PURE__ */ jsx(Svg, { children: TOPIC_PATHS[topic] });
|
|
236
241
|
};
|
|
237
242
|
//#endregion
|
|
238
|
-
export {
|
|
243
|
+
export { House as a, TopicIcon as c, saveConversation as d, chatAvailable as f, Cross as i, clearConversation as l, Check as n, Restart as o, sendMessage as p, Chevron as r, Spark as s, Arrow as t, loadConversation as u };
|
package/dist/index.d.ts
CHANGED
|
@@ -33,7 +33,8 @@ interface ChatCopy {
|
|
|
33
33
|
/** A card's short button: book its stay, or see the rental without one. */
|
|
34
34
|
readonly book: string;
|
|
35
35
|
readonly view: string;
|
|
36
|
-
/**
|
|
36
|
+
/** @deprecated Not shown since 1.1.1: a card lists the wishes it matches instead. Kept so a site's
|
|
37
|
+
* `copy` that sets it still type-checks. */
|
|
37
38
|
readonly matchBadge: string;
|
|
38
39
|
/** A stay's length on a card; `{n}` is the count. */
|
|
39
40
|
readonly nights: Readonly<Partial<Record<Intl.LDMLPluralRule, string>>> & {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as MAX_MESSAGE_CHARS, t as CHAT_LOCALES } from "./protocol-BuNqZAMt.js";
|
|
2
|
-
import {
|
|
2
|
+
import { f as chatAvailable, s as Spark, t as Arrow, u as loadConversation } from "./icons-DIqOmKoe.js";
|
|
3
3
|
import { Suspense, lazy, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -333,7 +333,7 @@ ${SITE_COLORS.map((t) => ` ${t.chat}: var(${t.site}, ${t.own});`).join("\n")}
|
|
|
333
333
|
.ui { align-self: stretch; display: flex; flex-direction: column; gap: 12px; }
|
|
334
334
|
.thinking { display: flex; gap: 5px; padding: 4px 2px; }
|
|
335
335
|
.thinking i { width: 7px; height: 7px; border-radius: 999px; background: var(--chat-accent); opacity: 0.5; }
|
|
336
|
-
.dock { position: relative; padding: 10px 20px 16px; background: var(--chat-surface); }
|
|
336
|
+
.dock { position: relative; padding: 10px 20px 16px; background: var(--chat-surface-soft); }
|
|
337
337
|
.dock::before { content: ""; position: absolute; left: 0; right: 0; top: -28px; height: 28px;
|
|
338
338
|
pointer-events: none; background: linear-gradient(to top, var(--chat-surface-soft), transparent); }
|
|
339
339
|
.suggestions { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 10px;
|
|
@@ -399,12 +399,17 @@ ${SITE_COLORS.map((t) => ` ${t.chat}: var(${t.site}, ${t.own});`).join("\n")}
|
|
|
399
399
|
.gallery-arrow[data-side="next"] { right: 10px; }
|
|
400
400
|
.gallery-wrap:hover .gallery-arrow:not(:disabled), .gallery-arrow:focus-visible { opacity: 1; }
|
|
401
401
|
@media (hover: none) { .gallery-arrow:not(:focus-visible) { pointer-events: none; } }
|
|
402
|
-
|
|
402
|
+
/* The row scrolls, so it clips: room below for the cards' shadow, taken back from the gap under it. */
|
|
403
|
+
.carousel { gap: 12px; padding: 2px 2px 16px; margin-bottom: -10px; }
|
|
403
404
|
.carousel > .card { flex: 0 0 86%; scroll-snap-align: start; }
|
|
404
|
-
/* Room for two:
|
|
405
|
+
/* Room for two: two cards side by side and the next one peeking in, still one row to swipe; two
|
|
406
|
+
results fill the row exactly, with nothing to swipe to. */
|
|
405
407
|
@container (min-width: 520px) {
|
|
406
|
-
.carousel
|
|
407
|
-
.carousel-
|
|
408
|
+
.carousel > .card { flex-basis: calc((100% - 24px) / 2.15); }
|
|
409
|
+
.carousel:has(> .card:nth-child(2):last-child) > .card { flex-basis: calc((100% - 12px) / 2); }
|
|
410
|
+
.carousel-wrap:has(> .carousel > .card:nth-child(2):last-child) > .snap-nav { display: none; }
|
|
411
|
+
/* "n / total" counts one card per step, which a row of two no longer takes: the arrows stay. */
|
|
412
|
+
.carousel-wrap > .snap-nav > span { visibility: hidden; }
|
|
408
413
|
}
|
|
409
414
|
.snap-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
|
|
410
415
|
.snap-nav button, .calendar-head button { border: 1px solid var(--chat-border); background: var(--chat-surface);
|
|
@@ -474,11 +479,12 @@ ${SITE_COLORS.map((t) => ` ${t.chat}: var(${t.site}, ${t.own});`).join("\n")}
|
|
|
474
479
|
/* A link out of the chat while a reply still streams (ReplyLink). */
|
|
475
480
|
[aria-disabled="true"] { opacity: 0.5; cursor: progress; }
|
|
476
481
|
|
|
477
|
-
/*
|
|
478
|
-
|
|
479
|
-
.
|
|
480
|
-
|
|
481
|
-
|
|
482
|
+
/* A card without photos: in a carousel a quiet block holds the photo's place, so the row lines up;
|
|
483
|
+
on its own the card simply starts with its text. */
|
|
484
|
+
.no-photo { display: none; aspect-ratio: 5 / 3; place-items: center; background: var(--chat-surface-soft);
|
|
485
|
+
color: var(--chat-muted); }
|
|
486
|
+
.carousel .no-photo { display: grid; }
|
|
487
|
+
/* Wishes a found stay matches, ticked under the name. */
|
|
482
488
|
.wishes { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
|
|
483
489
|
.wishes li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 10px;
|
|
484
490
|
border: 1px solid var(--chat-border); border-radius: var(--chat-round); font-size: 13px; font-weight: 600; }
|
|
@@ -566,7 +572,7 @@ ${SITE_COLORS.map((t) => ` ${t.chat}: var(${t.site}, ${t.own});`).join("\n")}
|
|
|
566
572
|
`;
|
|
567
573
|
//#endregion
|
|
568
574
|
//#region src/WebsiteChat.tsx
|
|
569
|
-
const Panel = lazy(() => import("./panel-
|
|
575
|
+
const Panel = lazy(() => import("./panel-BsocDe9I.js"));
|
|
570
576
|
/** See {@link WebsiteChatComponent}. */
|
|
571
577
|
const WebsiteChat = function WebsiteChat(props) {
|
|
572
578
|
const { endpoint, locale, theme = "classic", position = "right" } = props;
|
|
@@ -638,7 +644,7 @@ const WebsiteChat = function WebsiteChat(props) {
|
|
|
638
644
|
fallback: null,
|
|
639
645
|
children: /* @__PURE__ */ jsx(Panel, {
|
|
640
646
|
endpoint,
|
|
641
|
-
clientVersion: "1.1.
|
|
647
|
+
clientVersion: "1.1.1",
|
|
642
648
|
locale,
|
|
643
649
|
copy,
|
|
644
650
|
searchPath: props.searchPath,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as SESSION_TTL_S, r as MAX_MESSAGE_CHARS } from "./protocol-BuNqZAMt.js";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as House, c as TopicIcon, d as saveConversation, i as Cross, l as clearConversation, n as Check, o as Restart, p as sendMessage, r as Chevron, t as Arrow, u as loadConversation } from "./icons-DIqOmKoe.js";
|
|
3
3
|
import { r as chatCatalog, u as statePath } from "./catalog-y3xQ2jXW.js";
|
|
4
4
|
import { createContext, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -186,9 +186,10 @@ const Snapper = ({ count, className, label, children }) => {
|
|
|
186
186
|
const element = row.current;
|
|
187
187
|
if (!element) return;
|
|
188
188
|
const still = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
189
|
-
const
|
|
190
|
-
element.
|
|
191
|
-
|
|
189
|
+
const [first, second] = element.children;
|
|
190
|
+
const card = first && second ? second.offsetLeft - first.offsetLeft : element.clientWidth;
|
|
191
|
+
element.scrollBy({
|
|
192
|
+
left: step * card,
|
|
192
193
|
behavior: still ? "auto" : "smooth"
|
|
193
194
|
});
|
|
194
195
|
};
|
|
@@ -340,18 +341,18 @@ const CardFoot = ({ rentalId, stay }) => {
|
|
|
340
341
|
const href = useBookHref(rentalId, stay);
|
|
341
342
|
return /* @__PURE__ */ jsxs("div", {
|
|
342
343
|
className: "card-foot",
|
|
343
|
-
children: [stay && /* @__PURE__ */
|
|
344
|
+
children: [stay && /* @__PURE__ */ jsx("div", {
|
|
344
345
|
className: "foot-price",
|
|
345
|
-
children:
|
|
346
|
+
children: !stay.bookable ? /* @__PURE__ */ jsx("span", {
|
|
346
347
|
className: "muted",
|
|
347
348
|
children: copy.notBookable
|
|
348
|
-
}) : stay.total && /* @__PURE__ */ jsx("span", {
|
|
349
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [stay.total && /* @__PURE__ */ jsx("span", {
|
|
349
350
|
className: "price",
|
|
350
351
|
children: stay.total
|
|
351
352
|
}), /* @__PURE__ */ jsx("span", {
|
|
352
353
|
className: "foot-meta",
|
|
353
354
|
children: stayMeta(stay, copy, locale)
|
|
354
|
-
})]
|
|
355
|
+
})] })
|
|
355
356
|
}), /* @__PURE__ */ jsx(ReplyLink, {
|
|
356
357
|
className: "button compact",
|
|
357
358
|
href,
|
|
@@ -360,7 +361,6 @@ const CardFoot = ({ rentalId, stay }) => {
|
|
|
360
361
|
});
|
|
361
362
|
};
|
|
362
363
|
const Card = ({ rentalId, stayId }) => {
|
|
363
|
-
const { copy } = useChat();
|
|
364
364
|
const rental = useRental(rentalId);
|
|
365
365
|
const stay = useStay(stayId, rentalId);
|
|
366
366
|
const wishes = useWishes(rentalId);
|
|
@@ -368,16 +368,13 @@ const Card = ({ rentalId, stayId }) => {
|
|
|
368
368
|
return /* @__PURE__ */ jsxs("article", {
|
|
369
369
|
className: "card rental-card",
|
|
370
370
|
children: [
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
"aria-hidden": "true",
|
|
379
|
-
children: copy.matchBadge
|
|
380
|
-
}) : null]
|
|
371
|
+
rental.images.length > 0 ? /* @__PURE__ */ jsx(Gallery, {
|
|
372
|
+
images: rental.images,
|
|
373
|
+
name: rental.name
|
|
374
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
375
|
+
className: "no-photo",
|
|
376
|
+
"aria-hidden": "true",
|
|
377
|
+
children: /* @__PURE__ */ jsx(House, {})
|
|
381
378
|
}),
|
|
382
379
|
/* @__PURE__ */ jsxs("div", {
|
|
383
380
|
className: "card-body",
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/website-chat`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/1.1.1/CHANGELOG.md`: release notes for 1.1.1
|
|
7
8
|
- `versions/1.1.0/CHANGELOG.md`: release notes for 1.1.0
|
|
8
9
|
- `versions/1.0.1/CHANGELOG.md`: release notes for 1.0.1
|
|
9
10
|
- `versions/1.0.0/CHANGELOG.md`: release notes for 1.0.0
|
|
@@ -4,6 +4,7 @@
|
|
|
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.1.1/MIGRATION.md`: Migration: 1.1.0 to 1.1.1
|
|
7
8
|
- `versions/1.1.0/MIGRATION.md`: Migration: 1.0.1 to 1.1.0
|
|
8
9
|
- `versions/1.0.1/MIGRATION.md`: Migration: 1.0.0 to 1.0.1
|
|
9
10
|
- `versions/1.0.0/MIGRATION.md`: Migration: 1.0.0
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Changelog: 1.1.1
|
|
2
|
+
|
|
3
|
+
Calmer search results and one surface around the message field. Nothing to change on a site.
|
|
4
|
+
|
|
5
|
+
## Changed
|
|
6
|
+
|
|
7
|
+
- Search results (`RentalCarousel`) are one row on wide screens too: two cards side by side and
|
|
8
|
+
the next one peeking in, with arrows that move one card at a time. Two results fill the row and
|
|
9
|
+
have no arrows. On a phone the row shows one card with "1 / 4" as before.
|
|
10
|
+
- The area around the message field has the message area's background, so the conversation and
|
|
11
|
+
the field sit on one surface.
|
|
12
|
+
- A card no longer carries the "Passt genau" badge on its photo: the wishes it matches are ticked
|
|
13
|
+
under its name, as before.
|
|
14
|
+
- A card whose stay cannot be booked says only that ("Für diesen Zeitraum nicht buchbar"),
|
|
15
|
+
without the nights and dates of the stay asked for.
|
|
16
|
+
|
|
17
|
+
## Fixed
|
|
18
|
+
|
|
19
|
+
- In the row of search results, a card without photos holds the photo's place, so its text lines
|
|
20
|
+
up with the cards next to it. On its own it still starts with its text.
|
|
21
|
+
- The cards' shadows are no longer cut off under the row of search results.
|
|
22
|
+
|
|
23
|
+
## Unchanged
|
|
24
|
+
|
|
25
|
+
- Props, themes and colours are as before. `copy.matchBadge` is still accepted, so a site that
|
|
26
|
+
sets it keeps compiling; it is no longer shown.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Migration: 1.1.0 to 1.1.1
|
|
2
|
+
|
|
3
|
+
No changes required.
|
|
4
|
+
|
|
5
|
+
## 1. Upgrade
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add --save-exact @v-office/website-chat@1.1.1
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 2. `copy.matchBadge` (optional)
|
|
12
|
+
|
|
13
|
+
A site that sets `copy={{ matchBadge: … }}` can drop it: the badge is no longer shown.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/website-chat",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
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": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@types/node": "26.5.1",
|
|
35
35
|
"@types/react": "19.3.0",
|
|
36
36
|
"@types/react-dom": "19.3.0",
|
|
37
|
-
"@v-office/website-headless": "1.
|
|
38
|
-
"@v-office/website-sdk": "2.
|
|
37
|
+
"@v-office/website-headless": "1.5.0",
|
|
38
|
+
"@v-office/website-sdk": "3.2.0",
|
|
39
39
|
"jsdom": "30.0.1",
|
|
40
40
|
"oxfmt": "0.67.0",
|
|
41
41
|
"oxlint": "1.82.0",
|