@v-office/website-chat 1.1.1 → 1.1.3

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/index.js CHANGED
@@ -572,7 +572,7 @@ ${SITE_COLORS.map((t) => ` ${t.chat}: var(${t.site}, ${t.own});`).join("\n")}
572
572
  `;
573
573
  //#endregion
574
574
  //#region src/WebsiteChat.tsx
575
- const Panel = lazy(() => import("./panel-BsocDe9I.js"));
575
+ const Panel = lazy(() => import("./panel-BN_DMA4R.js"));
576
576
  /** See {@link WebsiteChatComponent}. */
577
577
  const WebsiteChat = function WebsiteChat(props) {
578
578
  const { endpoint, locale, theme = "classic", position = "right" } = props;
@@ -644,7 +644,7 @@ const WebsiteChat = function WebsiteChat(props) {
644
644
  fallback: null,
645
645
  children: /* @__PURE__ */ jsx(Panel, {
646
646
  endpoint,
647
- clientVersion: "1.1.1",
647
+ clientVersion: "1.1.3",
648
648
  locale,
649
649
  copy,
650
650
  searchPath: props.searchPath,
@@ -23,6 +23,14 @@ const stayHref = (page, stay, searchPath) => {
23
23
  const bookingHref = (bookingPage, stay) => withQuery(bookingPage, [...stayPairs(stay), ...(stay.services ?? []).filter((service) => service.count > 0).map((service) => ["service", `${service.id}:${service.count}`])]);
24
24
  //#endregion
25
25
  //#region src/map.tsx
26
+ /** MapLibre and its worker, loaded on the first tap. MapLibre finds its worker beside its own module
27
+ * by default; bundled, the module is a hashed chunk with nothing beside it, so `?worker&url` has the
28
+ * site's bundler emit the worker as one self-contained file (MapLibre's own Vite setup), and
29
+ * `setWorkerUrl` points MapLibre at it before the first map reads it. */
30
+ const loadMapLibre = () => Promise.all([import("maplibre-gl"), import("maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url")]).then(([library, worker]) => {
31
+ library.setWorkerUrl(worker.default);
32
+ return library;
33
+ });
26
34
  /** What the style's sources ask to be credited, with their links, as MapLibre's attribution control
27
35
  * would show it (OpenStreetMap's to its copyright page). */
28
36
  const Attribution = () => /* @__PURE__ */ jsxs("p", {
@@ -61,10 +69,8 @@ const MapCard = ({ rental, label, notice, load, children }) => {
61
69
  if (!shown || !element || !location) return;
62
70
  let removed = false;
63
71
  let map;
64
- import("maplibre-gl").then((module) => {
72
+ loadMapLibre().then(({ Map, Marker }) => {
65
73
  if (removed) return;
66
- const library = module;
67
- const { Map, Marker } = library.default ?? library;
68
74
  const center = [location.lng, location.lat];
69
75
  const created = new Map({
70
76
  container: element,
@@ -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.1.3/CHANGELOG.md`: release notes for 1.1.3
8
+ - `versions/1.1.2/CHANGELOG.md`: release notes for 1.1.2
7
9
  - `versions/1.1.1/CHANGELOG.md`: release notes for 1.1.1
8
10
  - `versions/1.1.0/CHANGELOG.md`: release notes for 1.1.0
9
11
  - `versions/1.0.1/CHANGELOG.md`: release notes for 1.0.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.1.3/MIGRATION.md`: Migration: 1.1.2 to 1.1.3
8
+ - `versions/1.1.2/MIGRATION.md`: Migration: 1.1.1 to 1.1.2
7
9
  - `versions/1.1.1/MIGRATION.md`: Migration: 1.1.0 to 1.1.1
8
10
  - `versions/1.1.0/MIGRATION.md`: Migration: 1.0.1 to 1.1.0
9
11
  - `versions/1.0.1/MIGRATION.md`: Migration: 1.0.0 to 1.0.1
@@ -0,0 +1,7 @@
1
+ # Changelog: 1.1.2
2
+
3
+ The same widget as 1.1.1, released again from new CI runners. Nothing to change on a site.
4
+
5
+ ## Unchanged
6
+
7
+ - Code, props, themes, colours and copy are as in 1.1.1.
@@ -0,0 +1,9 @@
1
+ # Migration: 1.1.1 to 1.1.2
2
+
3
+ No changes required.
4
+
5
+ ## 1. Upgrade
6
+
7
+ ```sh
8
+ pnpm add --save-exact @v-office/website-chat@1.1.2
9
+ ```
@@ -0,0 +1,18 @@
1
+ # Changelog: 1.1.3
2
+
3
+ The chat's map card runs on MapLibre GL JS 6, the major the sites already use for their own maps.
4
+ Nothing to change on a site.
5
+
6
+ ## Changed
7
+
8
+ - `maplibre-gl` is `^6.17.0` (was `^5.24.0`). A site that also has `maplibre-gl` 6 for its own maps
9
+ bundles one copy instead of two.
10
+ - The map card loads MapLibre's worker through `maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url` and
11
+ `setWorkerUrl`, so the site's bundler emits it as one file beside the bundled map. Astro (Vite)
12
+ understands `?worker&url`; a site built with another bundler needs one that does.
13
+ - MapLibre 6 needs WebGL2. In a browser without it, the card shows its button to load the map again
14
+ instead of an empty box, as it did without WebGL.
15
+
16
+ ## Unchanged
17
+
18
+ - Props, themes, colours and copy are as in 1.1.2. The map still loads only on a tap.
@@ -0,0 +1,9 @@
1
+ # Migration: 1.1.2 to 1.1.3
2
+
3
+ No changes required.
4
+
5
+ ## 1. Upgrade
6
+
7
+ ```sh
8
+ pnpm add --save-exact @v-office/website-chat@1.1.3
9
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-office/website-chat",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
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": {
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "@json-render/core": "0.21.0",
29
29
  "@json-render/react": "0.21.0",
30
- "maplibre-gl": "^5.24.0",
30
+ "maplibre-gl": "^6.17.0",
31
31
  "zod": "^4.3.6"
32
32
  },
33
33
  "devDependencies": {
@@ -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.2.0",
38
+ "@v-office/website-sdk": "3.3.0",
39
39
  "jsdom": "30.0.1",
40
40
  "oxfmt": "0.67.0",
41
41
  "oxlint": "1.82.0",