@v-office/website-headless 1.2.0 → 1.4.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.
- package/README.md +22 -4
- package/dist/enhance/index.d.mts +1 -1
- package/dist/{index-Dlf8Hlzc.d.mts → index-DEli4-cW.d.mts} +14 -3
- package/dist/index.d.mts +45 -2
- package/dist/index.mjs +53 -5
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/versions/1.3.0/CHANGELOG.md +21 -0
- package/instructions/versions/1.3.0/MIGRATION.md +10 -0
- package/instructions/versions/1.3.0/release.json +3 -0
- package/instructions/versions/1.4.0/CHANGELOG.md +20 -0
- package/instructions/versions/1.4.0/MIGRATION.md +12 -0
- package/instructions/versions/1.4.0/release.json +3 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -39,6 +39,7 @@ favourites namespace, the backend) have no default at all.
|
|
|
39
39
|
- [Checkout flow](#checkout-flow)
|
|
40
40
|
- [Contact form](#contact-form)
|
|
41
41
|
- [Countries](#countries)
|
|
42
|
+
- [Regions](#regions)
|
|
42
43
|
- [Legal documents](#legal-documents)
|
|
43
44
|
- [Favourites](#favourites)
|
|
44
45
|
- [Shared helpers](#shared-helpers)
|
|
@@ -223,8 +224,8 @@ Everything in `.` runs in both places, but some calls belong to one of them:
|
|
|
223
224
|
|
|
224
225
|
- **Build time** (they spend rate-limited requests or need full ICU): `loadRentalCatalogue`,
|
|
225
226
|
`fetchRentalFlags`, `resolveSearchGroups`, `measureFilters`, `findOfferWindows`,
|
|
226
|
-
`findCampaignStart`, `fetchLegalDocuments`, `countryOptions`, `
|
|
227
|
-
`rentalFactsMap`, `buildShowcaseGroups`, `resolveFilters`. Their results are plain JSON and are
|
|
227
|
+
`findCampaignStart`, `fetchLegalDocuments`, `countryOptions`, `regionOptions`, `regionsByRental`,
|
|
228
|
+
`rentalIndexEntries`, `cardSource`, `rentalFactsMap`, `buildShowcaseGroups`, `resolveFilters`. Their results are plain JSON and are
|
|
228
229
|
passed to islands as props.
|
|
229
230
|
- **Browser**: the stores (`createSearchForm`, `createSearchStore`, `createQuoteFlow`,
|
|
230
231
|
`createCheckoutFlow`, `createContactForm`, `createFavorites`), `loadRentalIndex`,
|
|
@@ -1069,8 +1070,9 @@ try {
|
|
|
1069
1070
|
- `slugify(name)`: German transliteration, lowercase, hyphenated, at most 60 characters
|
|
1070
1071
|
- `rankHighlights(rentals, { universalShare? })`: moves labels that almost every rental carries to
|
|
1071
1072
|
the back; reorders, never drops
|
|
1072
|
-
- `parseCounts({ roomSummary, highlights })`: counts from the SDK's
|
|
1073
|
-
|
|
1073
|
+
- `parseCounts({ capacity, roomSummary, highlights })`: counts from the SDK's `capacity` numbers
|
|
1074
|
+
(website-sdk 2.38.0 or later), then from its count lines for what `capacity` omits (every
|
|
1075
|
+
wording of both backends and locales)
|
|
1074
1076
|
- `parseDistances(vicinity)`, `distanceFact(distances, kinds?)`: distances in metres; the first
|
|
1075
1077
|
stated distance of the first kind in `kinds` (default `WATER_KINDS`: beach, sea, lake), by
|
|
1076
1078
|
priority, never the nearest
|
|
@@ -1793,6 +1795,22 @@ build time; the result is plain data passed to islands.
|
|
|
1793
1795
|
non-English tags first, then English tags with an explicit region; bare `"en"` is never maximized.
|
|
1794
1796
|
- `CountryCode`: ISO 3166-1 alpha-2; the register is never filtered.
|
|
1795
1797
|
|
|
1798
|
+
## Regions
|
|
1799
|
+
|
|
1800
|
+
Module `regions`. The region tree (`sdk.static.regions.getRegions` of `@v-office/website-sdk`, v10 and v9,
|
|
1801
|
+
one read per build) as the search's region data. A region's value is its id; it holds its subregions' rentals, so
|
|
1802
|
+
`?region=<id>` finds them too. Build time; the results are plain data passed to islands.
|
|
1803
|
+
|
|
1804
|
+
- `regionOptions(tree, { locale, rentalIds })` → `RegionChoice[]` (`value` = id, `label` = name,
|
|
1805
|
+
`count` = the site's rentals with the subregions', `group` = a subregion's top-level region name):
|
|
1806
|
+
every region with one of the site's rentals (`rentalIds`, the ids of the rentals the site reads,
|
|
1807
|
+
since the tree ignores `rentalScope`), in the tree's order. Pass them as they are as the `regions` prop of `SearchBar` from
|
|
1808
|
+
`@v-office/website-components`, and as the `options` of a curated hidden `region` facet, which words
|
|
1809
|
+
a `?region=` chip with the name instead of the id.
|
|
1810
|
+
`createSearchForm` takes the `value`s.
|
|
1811
|
+
- `regionsByRental(tree)` → rental id → the ids of every region holding it, ancestors included: the
|
|
1812
|
+
`regions` of `cardSource` extras, so `rentalFactsMap` carries them to the browser filter.
|
|
1813
|
+
|
|
1796
1814
|
## Legal documents
|
|
1797
1815
|
|
|
1798
1816
|
Module `legal`. Build time only.
|
package/dist/enhance/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { An as LngLat, Mn as MapPoint, _a as
|
|
1
|
+
import { An as LngLat, Mn as MapPoint, _a as ENHANCE_PARTS, a as PlaceMarker, ba as GATE_MARKERS, jn as MapBounds, s as ClusterOptions, va as EnhancePart, wn as SameSpotLayout, xa as GateMarkers, ya as EnhanceParts } from "../index-DEli4-cW.mjs";
|
|
2
2
|
//#region src/enhance/lifecycle.d.ts
|
|
3
3
|
/** Removes everything a binder added. Safe to call more than once. */
|
|
4
4
|
type Dispose = () => void;
|
|
@@ -324,6 +324,16 @@ interface RentalPropertyInfo {
|
|
|
324
324
|
}
|
|
325
325
|
//#endregion
|
|
326
326
|
//#region src/rental/facts.d.ts
|
|
327
|
+
/** The counts website-sdk 2.38.0+ states as numbers (`capacity` on a rental or search item),
|
|
328
|
+
* typed by the fields headless reads. Declared here, not imported: the peer range accepts SDKs
|
|
329
|
+
* that do not export the type yet. */
|
|
330
|
+
interface SdkCapacity {
|
|
331
|
+
readonly maxGuests?: number | null | undefined;
|
|
332
|
+
readonly bedrooms?: number | null | undefined;
|
|
333
|
+
readonly bathrooms?: number | null | undefined;
|
|
334
|
+
readonly rooms?: number | null | undefined;
|
|
335
|
+
readonly livingAreaSqm?: number | null | undefined;
|
|
336
|
+
}
|
|
327
337
|
/** Counts the feed states. Undefined = the feed states nothing — never print a 0. */
|
|
328
338
|
interface RentalCounts {
|
|
329
339
|
/** Most guests. */
|
|
@@ -353,9 +363,10 @@ interface RentalDistance {
|
|
|
353
363
|
declare const ADJACENT_BELOW_M: 25;
|
|
354
364
|
/** The "water" fact's kinds by priority — Strand > Meer > See, never city (not water). */
|
|
355
365
|
declare const WATER_KINDS: readonly DistanceKind[];
|
|
356
|
-
/** Counts from `
|
|
357
|
-
* bathrooms come from the highlights). */
|
|
366
|
+
/** Counts from `capacity` first, then `roomSummary`, then `highlights` (v9 states no
|
|
367
|
+
* `roomSummary`, so on an SDK without `capacity` its bathrooms come from the highlights). */
|
|
358
368
|
type ParseCounts = (sources: {
|
|
369
|
+
readonly capacity?: SdkCapacity | null | undefined;
|
|
359
370
|
readonly roomSummary?: readonly string[] | null | undefined;
|
|
360
371
|
readonly highlights?: readonly string[] | null | undefined;
|
|
361
372
|
}) => RentalCounts;
|
|
@@ -2723,4 +2734,4 @@ declare class RentalAddressModeError extends Error {
|
|
|
2723
2734
|
/** See {@link RentalAddressLine}. */
|
|
2724
2735
|
declare const rentalAddressLine: RentalAddressLine;
|
|
2725
2736
|
//#endregion
|
|
2726
|
-
export { describeOutcome as $,
|
|
2737
|
+
export { describeOutcome as $, RentalDetail as $i, fetchRentalFlags as $n, CardSource as $r, GuestBound as $t, QueryShape as A, SdkMode as Ai, LngLat as An, SdkConfigForInput as Ar, quickFilterDefs as At, toSdkQuery as B, RentalDistance as Bi, resultCardSource as Bn, RouteParams as Br, SEARCH_PARAMS as Bt, SearchState as C, isIsoDay as Ci, SameSpotGroup as Cn, EnvRecord as Cr, ResolvedFilters as Ct, createSearchStore as D, Locale as Di, circleOffsets as Dn, HUB_ENDPOINTS as Dr, facetOptions as Dt, SearchStoreOptions as E, Backend as Ei, SameSpotOptions as En, sdkConfigFromEnv as Er, activeFilters as Et, externalSearchHref as F, WebsiteSdk as Fi, mapPoints as Fn, CardSourceExtras as Fr, writeSelection as Ft, sortFromSearch as G, isSpecEcho as Gi, PreviewStrategy as Gn, CardBadge as Gr, SearchQuery as Gt, SORT_URL_VALUE as H, WATER_KINDS as Hi, shortReviewerName as Hn, routeHref as Hr, SearchParamAliases as Ht, handoverQuery as I, resolveSdk as Ii, ResultLinkOptions as In, cardSource as Ir, partyPairs as It, EmptyCause as J, AmenityGroup as Ji, DEFAULT_FLAG_FILTERS as Jn, CardImage as Jr, searchHref as Jt, sortResults as K, parseCounts as Ki, descriptionPreview as Kn, CardContext as Kr, WriteSearchOptions as Kt, queryShape as L, ADJACENT_BELOW_M as Li, SearchResultItem as Ln, loadRentalFacts as Lr, readParty as Lt, SanitizedSearch as M, SdkSetup as Mi, MapPoint as Mn, VofficeEndpointTable as Mr, resolveFilters as Mt, SdkQueryOptions as N, SdkSource as Ni, PinLabelOptions as Nn, VofficeEndpoints as Nr, withoutFilter as Nt, ExternalSearchLink as O, STAGES as Oi, distanceMeters as On, HubEndpointTable as Or, measureFilters as Ot, SdkSearchQuery as P, Stage as Pi, hasMapPoints as Pn, sdkConfigFor as Pr, withoutFilters as Pt, SearchedParts as Q, RentalAddress as Qi, assignSlugs as Qn, CardRating as Qr, DEFAULT_GUEST_LIMITS as Qt, resultsQueryFlagScript as R, DistanceKind as Ri, catalogueResultItem as Rn, rentalFactsMap as Rr, FlexibleStay as Rt, SearchScopeKind as S, formatIsoDate as Si, PixelOffset as Sn, createSdk as Sr, ResolveFiltersOptions as St, SearchStore as T, todayIso as Ti, SameSpotMode as Tn, SdkEnvError as Tr, WhenEmpty as Tt, SortKey as U, distanceFact as Ui, splitReviewAuthor as Un, AlternativePeriod as Ur, SearchParamKeys as Ut, DEFAULT_SORT_OPTIONS as V, SdkCapacity as Vi, newestReviewsFirst as Vn, RouteTemplate as Vr, SearchContract as Vt, SortOptionState as W, isAdjacent as Wi, DescriptionPreview as Wn, BadgeRule as Wr, SearchPeriod as Wt, Relaxation as X, CatalogueRental as Xi, LoadRentalCatalogueOptions as Xn, CardModelOptions as Xr, ChildAgeRange as Xt, OutcomeInput as Y, BedRun as Yi, FetchRentalFlagsOptions as Yn, CardLiveField as Yr, writeSearch as Yt, SearchOutcome as Z, DescriptionContent as Zi, RentalFlagsResult as Zn, CardPill as Zr, DEFAULT_CHILD_AGE as Zt, FAVORITE_LEAVE_MS as _, ENHANCE_PARTS as _a, Glyph as _i, DEFAULT_FIT as _n, fetchSearchPage as _r, FilterGroupSpec as _t, PlaceMarker as a, RentalRoom as aa, RentalFactsMap as ai, Party as an, AmenityPreviewItem as ar, OffersWindowSpec as at, SearchActions as b, GATE_MARKERS as ba, IsoMonth as bi, frameFor as bn, SharedSdk as br, FilterSpec as bt, DEFAULT_CLUSTER as c, RoomKind as ca, toCardModel as ci, clampParty as cn, AdaptEvent as cr, findCampaignStart as ct, ResultsMapController as d, RichInline as da, Range as di, stayKeyOf as dn, adaptRental as dr, offersWindowQuery as dt, RentalFlag as ea, CardStatus as ei, GuestBounds as en, loadRentalCatalogue as er, CampaignChip as et, ResultsMapOptions as f, StructuredDocumentOptions as fa, matches as fi, Listener as fn, RawSearchPage as fr, ActiveFilter as ft, CampaignOf as g, plainText as ga, GLYPHS as gi, createStore as gn, WalkSummary as gr, FilterEntry as gt, createResultsMapController as h, parseTextBlocks as ha, parsePriceLabel as hi, WritableStore as hn, WalkOptions as hr, FilterDef as ht, MapPlace as i, RentalReviews as ia, RentalFacts as ii, GuestOptions as in, ALWAYS_EXCLUDED_CATEGORIES as ir, OfferWindow as it, ResultHandoverOptions as j, SdkOptions as ji, MapBounds as jn, VOFFICE_ENDPOINTS as jr, readSelection as jt, ExternalSearchSource as k, SdkConfig as ki, layoutSameSpot as kn, HubEndpoints as kr, minimumSteps as kt, MapResultsSource as l, PlainTextOptions as la, CardMatch as li, guestBounds as ln, AdaptRentalOptions as lr, findOfferWindows as lt, ResultsMapSurface as m, normalizeStructuredDocument as ma, formatPriceLabel as mi, Unsubscribe as mn, SearchPageRequest as mr, FacetOptionsOptions as mt, RentalAddressModeError as n, RentalPropertyInfo as na, PillOptions as ni, GuestKind as nn, slugify as nr, FindCampaignStartOptions as nt, mergePlaces as o, ReviewCriterion as oa, StayPrice as oi, QuoteOccupancy as on, AmenityPreviewOptions as or, campaignChips as ot, ResultsMapState as p, TextMarkup as pa, PriceCents as pi, Store as pn, SEARCH_PAGE_SIZE as pr, FacetOption as pt, toSdkSort as q, parseDistances as qi, descriptionSummary as qn, CardFact as qr, readSearch as qt, rentalAddressLine as r, RentalReview as ra, RentalCardModel as ri, GuestLimits as rn, HIDDEN_ROOM_ATTRIBUTES as rr, FindOfferWindowsOptions as rt, ClusterOptions as s, ReviewSummary as sa, StayWindow as si, agesComplete as sn, amenityPreview as sr, campaignGroup as st, RentalAddressMode as t, RentalImage as ta, FactKind as ti, GuestCaps as tn, rankHighlights as tr, CampaignChipsInput as tt, MapViewReport as u, RichBlock as ua, CardSignal as ui, occupancyOf as un, RentalContentError as ur, offerWindowHref as ut, FavoritesPort as v, EnhancePart as va, GlyphList as vi, DefaultFit as vn, walkSearchPages as vr, FilterMeasurement as vt, SearchStatus as w, nightsBetween as wi, SameSpotLayout as wn, SDK_ENV as wr, SdkFilterDefinition as wt, SearchScope as x, GateMarkers as xa, addDays as xi, idsInView as xn, shareSdk as xr, ImplicitScope as xt, HistoryPort as y, EnhanceParts as ya, IsoDay as yi, FitOptions as yn, loadSharedSdk as yr, FilterSelection as yt, sanitizeSearch as z, RentalCounts as zi, compareUndatedSearchOrder as zn, withRentalFacts as zr, QueryPair as zt };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as describeOutcome, $i as
|
|
1
|
+
import { $ as describeOutcome, $i as RentalDetail, $n as fetchRentalFlags, $r as CardSource, $t as GuestBound, A as QueryShape, Ai as SdkMode, An as LngLat, Ar as SdkConfigForInput, At as quickFilterDefs, B as toSdkQuery, Bi as RentalDistance, Bn as resultCardSource, Br as RouteParams, Bt as SEARCH_PARAMS, C as SearchState, Ci as isIsoDay, Cn as SameSpotGroup, Cr as EnvRecord, Ct as ResolvedFilters, D as createSearchStore, Di as Locale, Dn as circleOffsets, Dr as HUB_ENDPOINTS, Dt as facetOptions, E as SearchStoreOptions, Ei as Backend, En as SameSpotOptions, Er as sdkConfigFromEnv, Et as activeFilters, F as externalSearchHref, Fi as WebsiteSdk, Fn as mapPoints, Fr as CardSourceExtras, Ft as writeSelection, G as sortFromSearch, Gi as isSpecEcho, Gn as PreviewStrategy, Gr as CardBadge, Gt as SearchQuery, H as SORT_URL_VALUE, Hi as WATER_KINDS, Hn as shortReviewerName, Hr as routeHref, Ht as SearchParamAliases, I as handoverQuery, Ii as resolveSdk, In as ResultLinkOptions, Ir as cardSource, It as partyPairs, J as EmptyCause, Ji as AmenityGroup, Jn as DEFAULT_FLAG_FILTERS, Jr as CardImage, Jt as searchHref, K as sortResults, Ki as parseCounts, Kn as descriptionPreview, Kr as CardContext, Kt as WriteSearchOptions, L as queryShape, Li as ADJACENT_BELOW_M, Ln as SearchResultItem, Lr as loadRentalFacts, Lt as readParty, M as SanitizedSearch, Mi as SdkSetup, Mn as MapPoint, Mr as VofficeEndpointTable, Mt as resolveFilters, N as SdkQueryOptions, Ni as SdkSource, Nn as PinLabelOptions, Nr as VofficeEndpoints, Nt as withoutFilter, O as ExternalSearchLink, Oi as STAGES, On as distanceMeters, Or as HubEndpointTable, Ot as measureFilters, P as SdkSearchQuery, Pi as Stage, Pn as hasMapPoints, Pr as sdkConfigFor, Pt as withoutFilters, Q as SearchedParts, Qi as RentalAddress, Qn as assignSlugs, Qr as CardRating, Qt as DEFAULT_GUEST_LIMITS, R as resultsQueryFlagScript, Ri as DistanceKind, Rn as catalogueResultItem, Rr as rentalFactsMap, Rt as FlexibleStay, S as SearchScopeKind, Si as formatIsoDate, Sn as PixelOffset, Sr as createSdk, St as ResolveFiltersOptions, T as SearchStore, Ti as todayIso, Tn as SameSpotMode, Tr as SdkEnvError, Tt as WhenEmpty, U as SortKey, Ui as distanceFact, Un as splitReviewAuthor, Ur as AlternativePeriod, Ut as SearchParamKeys, V as DEFAULT_SORT_OPTIONS, Vi as SdkCapacity, Vn as newestReviewsFirst, Vr as RouteTemplate, Vt as SearchContract, W as SortOptionState, Wi as isAdjacent, Wn as DescriptionPreview, Wr as BadgeRule, Wt as SearchPeriod, X as Relaxation, Xi as CatalogueRental, Xn as LoadRentalCatalogueOptions, Xr as CardModelOptions, Xt as ChildAgeRange, Y as OutcomeInput, Yi as BedRun, Yn as FetchRentalFlagsOptions, Yr as CardLiveField, Yt as writeSearch, Z as SearchOutcome, Zi as DescriptionContent, Zn as RentalFlagsResult, Zr as CardPill, Zt as DEFAULT_CHILD_AGE, _ as FAVORITE_LEAVE_MS, _a as ENHANCE_PARTS, _i as Glyph, _n as DEFAULT_FIT, _r as fetchSearchPage, _t as FilterGroupSpec, a as PlaceMarker, aa as RentalRoom, ai as RentalFactsMap, an as Party, ar as AmenityPreviewItem, at as OffersWindowSpec, b as SearchActions, ba as GATE_MARKERS, bi as IsoMonth, bn as frameFor, br as SharedSdk, bt as FilterSpec, c as DEFAULT_CLUSTER, ca as RoomKind, ci as toCardModel, cn as clampParty, cr as AdaptEvent, ct as findCampaignStart, d as ResultsMapController, da as RichInline, di as Range, dn as stayKeyOf, dr as adaptRental, dt as offersWindowQuery, ea as RentalFlag, ei as CardStatus, en as GuestBounds, er as loadRentalCatalogue, et as CampaignChip, f as ResultsMapOptions, fa as StructuredDocumentOptions, fi as matches, fn as Listener, fr as RawSearchPage, ft as ActiveFilter, g as CampaignOf, ga as plainText, gi as GLYPHS, gn as createStore, gr as WalkSummary, gt as FilterEntry, h as createResultsMapController, ha as parseTextBlocks, hi as parsePriceLabel, hn as WritableStore, hr as WalkOptions, ht as FilterDef, i as MapPlace, ia as RentalReviews, ii as RentalFacts, in as GuestOptions, ir as ALWAYS_EXCLUDED_CATEGORIES, it as OfferWindow, j as ResultHandoverOptions, ji as SdkOptions, jn as MapBounds, jr as VOFFICE_ENDPOINTS, jt as readSelection, k as ExternalSearchSource, ki as SdkConfig, kn as layoutSameSpot, kr as HubEndpoints, kt as minimumSteps, l as MapResultsSource, la as PlainTextOptions, li as CardMatch, ln as guestBounds, lr as AdaptRentalOptions, lt as findOfferWindows, m as ResultsMapSurface, ma as normalizeStructuredDocument, mi as formatPriceLabel, mn as Unsubscribe, mr as SearchPageRequest, mt as FacetOptionsOptions, n as RentalAddressModeError, na as RentalPropertyInfo, ni as PillOptions, nn as GuestKind, nr as slugify, nt as FindCampaignStartOptions, o as mergePlaces, oa as ReviewCriterion, oi as StayPrice, on as QuoteOccupancy, or as AmenityPreviewOptions, ot as campaignChips, p as ResultsMapState, pa as TextMarkup, pi as PriceCents, pn as Store, pr as SEARCH_PAGE_SIZE, pt as FacetOption, q as toSdkSort, qi as parseDistances, qn as descriptionSummary, qr as CardFact, qt as readSearch, r as rentalAddressLine, ra as RentalReview, ri as RentalCardModel, rn as GuestLimits, rr as HIDDEN_ROOM_ATTRIBUTES, rt as FindOfferWindowsOptions, s as ClusterOptions, sa as ReviewSummary, si as StayWindow, sn as agesComplete, sr as amenityPreview, st as campaignGroup, t as RentalAddressMode, ta as RentalImage, ti as FactKind, tn as GuestCaps, tr as rankHighlights, tt as CampaignChipsInput, u as MapViewReport, ua as RichBlock, ui as CardSignal, un as occupancyOf, ur as RentalContentError, ut as offerWindowHref, v as FavoritesPort, va as EnhancePart, vi as GlyphList, vn as DefaultFit, vr as walkSearchPages, vt as FilterMeasurement, w as SearchStatus, wi as nightsBetween, wn as SameSpotLayout, wr as SDK_ENV, wt as SdkFilterDefinition, x as SearchScope, xa as GateMarkers, xi as addDays, xn as idsInView, xr as shareSdk, xt as ImplicitScope, y as HistoryPort, ya as EnhanceParts, yi as IsoDay, yn as FitOptions, yr as loadSharedSdk, yt as FilterSelection, z as sanitizeSearch, zi as RentalCounts, zn as compareUndatedSearchOrder, zr as withRentalFacts, zt as QueryPair } from "./index-DEli4-cW.mjs";
|
|
2
2
|
import { BookingPaymentOption, BookingPaymentScheduleKind, ContactSubmitInput, GuestQuote, GuestQuoteResult, SubmittableBookingPaymentOption } from "@v-office/website-sdk";
|
|
3
3
|
import { BackendKind } from "@v-office/website-sdk/capabilities/search";
|
|
4
4
|
//#region src/map/constants.d.ts
|
|
@@ -194,6 +194,49 @@ export declare const dialCode: DialCode;
|
|
|
194
194
|
/** See {@link DetectCountry}. */
|
|
195
195
|
export declare const detectCountry: DetectCountry;
|
|
196
196
|
//#endregion
|
|
197
|
+
//#region src/regions/regions.d.ts
|
|
198
|
+
/** The minimal shape read off `sdk.static.regions.getRegions`; its result passes as it is. */
|
|
199
|
+
interface RegionTree {
|
|
200
|
+
/** Depth first: every region before its subregions. */
|
|
201
|
+
readonly regions: readonly {
|
|
202
|
+
readonly id: string;
|
|
203
|
+
/** `null` on a top-level region. */
|
|
204
|
+
readonly parentId: string | null;
|
|
205
|
+
readonly name: Readonly<Record<Locale, string>>;
|
|
206
|
+
/** The region's rentals and its subregions'. */
|
|
207
|
+
readonly rentalIds: readonly string[];
|
|
208
|
+
}[];
|
|
209
|
+
}
|
|
210
|
+
/** One region choice: a search bar `RegionOption` and a curated `region` facet's `FacetOption`. */
|
|
211
|
+
interface RegionChoice {
|
|
212
|
+
/** The region id, the `?region=` value. */
|
|
213
|
+
readonly value: string;
|
|
214
|
+
/** The region's name in the locale. */
|
|
215
|
+
readonly label: string;
|
|
216
|
+
/** The site's rentals in the region and its subregions. */
|
|
217
|
+
readonly count: number;
|
|
218
|
+
/** A subregion's top-level region name; a top-level region has none. */
|
|
219
|
+
readonly group?: string;
|
|
220
|
+
}
|
|
221
|
+
/** What `regionOptions` reads. */
|
|
222
|
+
interface RegionOptionsInput {
|
|
223
|
+
/** The label language. */
|
|
224
|
+
readonly locale: Locale;
|
|
225
|
+
/** The ids of the site's rentals. The tree ignores the SDK's `rentalScope`, so a region
|
|
226
|
+
* counts only these, and a region without any of them is not offered. */
|
|
227
|
+
readonly rentalIds: readonly string[];
|
|
228
|
+
}
|
|
229
|
+
/** Every region with at least one of the site's rentals, in the tree's order (a region before its
|
|
230
|
+
* subregions). */
|
|
231
|
+
type RegionOptions = (tree: RegionTree, input: RegionOptionsInput) => RegionChoice[];
|
|
232
|
+
/** Rental id → the ids of every region holding it, its regions' ancestors included: the
|
|
233
|
+
* `RentalFacts.regions` / `CardSource.regions` the browser matches `?region=` against. */
|
|
234
|
+
type RegionsByRental = (tree: RegionTree) => Record<string, readonly string[]>;
|
|
235
|
+
/** See {@link RegionOptions}. */
|
|
236
|
+
export declare const regionOptions: RegionOptions;
|
|
237
|
+
/** See {@link RegionsByRental}. */
|
|
238
|
+
export declare const regionsByRental: RegionsByRental;
|
|
239
|
+
//#endregion
|
|
197
240
|
//#region src/favorites/favorites.d.ts
|
|
198
241
|
/** The window event every site script listens to (`detail: FavoritesChange`); kept verbatim. The
|
|
199
242
|
* `./enhance` binder dispatches it from `onChange`. */
|
|
@@ -2804,4 +2847,4 @@ type FetchLegalDocuments = (sdk: WebsiteSdk, locale: Locale) => Promise<LegalDoc
|
|
|
2804
2847
|
/** See {@link FetchLegalDocuments}. */
|
|
2805
2848
|
export declare const fetchLegalDocuments: FetchLegalDocuments;
|
|
2806
2849
|
//#endregion
|
|
2807
|
-
export { ADJACENT_BELOW_M, ALWAYS_EXCLUDED_CATEGORIES, type ActiveFilter, type AdaptEvent, type AdaptRentalOptions, type AlternativePeriod, type AmenityGroup, type AmenityPreviewItem, type AmenityPreviewOptions, type AvailabilityWindowInput, type Backend, type BadgeRule, type BedRun, type BookableFrom, type BookingConfirmation, type BookingContact, type BookingKind, type BookingSnapshot, type BuiltInFieldSpec, type BuiltInPolicyLabels, type CampaignChip, type CampaignChipsInput, type CampaignLabelSource, type CampaignOf, type CardBadge, type CardContext, type CardFact, type CardImage, type CardLiveField, type CardMatch, type CardModelOptions, type CardPill, type CardRating, type CardSignal, type CardSource, type CardSourceExtras, type CardStatus, type CatalogueRental, type CheckedCopy, type CheckoutActions, type CheckoutBlocker, type CheckoutContext, type CheckoutEventDetail, type CheckoutFlow, type CheckoutFlowOptions, type CheckoutHandover, type CheckoutHandoverOptions, type CheckoutInsuranceState, type CheckoutIssue, type CheckoutMessages, type CheckoutPart, type CheckoutPhase, type CheckoutPolicyState, type CheckoutRequirement, type CheckoutService, type CheckoutState, type CheckoutStructure, type CheckoutVoucherState, type ChildAgeRange, type ClusterOptions, type ContactControl, type ContactEventDetail, type ContactFieldName, type ContactFieldSpec, type ContactForm, type ContactFormActions, type ContactFormMessages, type ContactFormOptions, type ContactFormState, type ContactLink, type ContactPhase, type ContactSubmitOutcome, type ContactValue, type ContactValues, type CountryCode, type CountryGroups, type CountryOption, type CountryOptionsInput, DEFAULT_CHILD_AGE, DEFAULT_CLUSTER, DEFAULT_FIT, DEFAULT_FLAG_FILTERS, DEFAULT_GUEST_LIMITS, DEFAULT_SORT_OPTIONS, type DateControls, type DateMode, type DateSearch, type DateSearchOptions, type DateSearchState, type DayKind, type DayPrices, type DayState, type DefaultFit, type DescriptionContent, type DescriptionPreview, type DistanceKind, ENHANCE_PARTS, type EmptyCause, type EndAvailability, type EndAvailabilityInput, type EnhancePart, type EnhanceParts, type EnvRecord, type ExternalSearchLink, type ExternalSearchSource, type ExtraFieldSpec, FAVORITE_LEAVE_MS, type FacetOption, type FacetOptionsOptions, type FactKind, type Favorites, type FavoritesChange, type FavoritesOptions, type FavoritesPort, type FavoritesState, type FetchRentalFlagsOptions, type FieldWidth, type FilterDef, type FilterEntry, type FilterGroupSpec, type FilterMeasurement, type FilterSelection, type FilterSpec, type FindCampaignStartOptions, type FindOfferWindowsOptions, type FitOptions, type FlexibleStay, GATE_MARKERS, GLYPHS, type GateMarkers, type Glyph, type GlyphList, type GuestBound, type GuestBounds, type GuestCaps, type GuestForm, type GuestFormField, type GuestFormOptions, type GuestFormState, type GuestKind, type GuestLimits, type GuestOptions, type GuestSearch, type GuestSearchOptions, type GuestSearchState, HIDDEN_ROOM_ATTRIBUTES, HUB_ENDPOINTS, type HistoryPort, type HubEndpointTable, type HubEndpoints, type ImplicitScope, type InitialAvailability, type InsuranceDocsState, type InsurancePaymentLink, type IsoDay, type IsoMonth, type LegalDocument, type LegalDocuments, type Listener, type LiveSearchOptions, type LngLat, type LoadRentalCatalogueOptions, type Locale, type MapBounds, type MapPlace, type MapPoint, type MapResultsSource, type MapViewReport, type OfferWindow, type OffersWindowSpec, type OptionalGuestField, type OutcomeInput, type Party, type PaymentLine, type PaymentReturn, type PaymentScheduleView, type PeriodLabel, type PeriodValue, type PillOptions, type PinLabelOptions, type PixelOffset, type PlaceMarker, type PlainTextOptions, type PolicyBranch, type PolicyBranchOptions, type PolicyChoiceMode, type PolicyOffer, type PolicyOfferInput, type PolicyOption, type PolicyStance, type PolicyTerms, type PolicyTermsOptions, type PolicyTitle, type PreviewStrategy, type PriceCents, type PriceLine, type PriceView, type QueryPair, type QueryShape, type QuoteAddonService, type QuoteCancellationPolicy, type QuoteCta, type QuoteEventDetail, type QuoteFlow, type QuoteFlowOptions, type QuoteFlowSettings, type QuoteFlowState, type QuoteHandover, type QuoteInsurance, type QuoteInsuranceOption, type QuoteOccupancy, type QuoteOutcome, type QuotePolicyRule, type QuoteRequest, type QuoteResult, type QuoteSelectionResult, type QuoteUnavailableCode, type QuoteView, type QuoteVoucher, type Range, type RawSearchPage, type RelatedOptions, type Relaxation, type RentalAddress, type RentalAddressMode, RentalAddressModeError, type RentalCardModel, RentalContentError, type RentalCounts, type RentalDetail, type RentalDistance, type RentalFacts, type RentalFactsMap, type RentalFlag, type RentalFlagsResult, type RentalImage, type RentalIndexEntry, type RentalMatch, type RentalMatchOptions, type RentalPropertyInfo, type RentalReview, type RentalReviews, type RentalRoom, type ResolveFiltersOptions, type ResolvedContactField, type ResolvedContactItem, type ResolvedFilters, type ResolvedSearchGroup, type ResultHandoverOptions, type ResultLinkOptions, type ResultsMapController, type ResultsMapOptions, type ResultsMapState, type ResultsMapSurface, type ReviewCriterion, type ReviewSummary, type RichBlock, type RichInline, type RoomKind, type RotationOptions, type RouteParams, type RouteTemplate, type RoutedContactIssues, SDK_ENV, SEARCH_PAGE_SIZE, SEARCH_PARAMS, SORT_URL_VALUE, STAGES, type Salutation, type SameSpotGroup, type SameSpotLayout, type SameSpotMode, type SameSpotOptions, type SanitizedSearch, type SdkConfig, type SdkConfigForInput, SdkEnvError, type SdkFilterDefinition, type SdkMode, type SdkOptions, type SdkQueryOptions, type SdkSearchQuery, type SdkSetup, type SdkSource, type SearchActions, type SearchContract, type SearchField, type SearchForm, type SearchFormIssue, type SearchFormOptions, type SearchFormState, type SearchGroupSpec, type SearchOutcome, type SearchPage, type SearchPageRequest, type SearchParamAliases, type SearchParamKeys, type SearchPeriod, type SearchQuery, type SearchResultItem, type SearchScope, type SearchScopeKind, type SearchState, type SearchStatus, type SearchStore, type SearchStoreClaim, type SearchStoreOptions, type SearchedParts, type SelectOption, type Selection, type SelectionSpec, type ShareLocation, type ShareUrlOptions, type SharedSdk, type ShowcaseGroup, type ShowcaseGroupSpec, type ShowcaseOrder, type SnapshotImage, type SortKey, type SortOptionState, type Stage, type Stay, type StayPicker, type StayPickerOptions, type StayPickerState, type StayPrice, type StayWindow, type StorageLike, type Store, type StructureRequirement, type StructureViolation, type StructuredDocumentOptions, type SubmitBookingOptions, type SubmitWording, type Template, type TextMarkup, type TokensOf, type Unsubscribe, VOFFICE_ENDPOINTS, type ValidationMessages, type ValueConstraints, type VofficeEndpointTable, type VofficeEndpoints, WATER_KINDS, type WalkOptions, type WalkSummary, type WebsiteSdk, type WhenEmpty, type WhenUnavailable, type WritableStore, type WriteSearchOptions, activeFilters, adaptRental, addDays, agesComplete, amenityPreview, assignSlugs, campaignChips, campaignGroup, cardSource, catalogueResultItem, circleOffsets, clampParty, compareUndatedSearchOrder, createResultsMapController, createSdk, createSearchStore, createStore, describeOutcome, descriptionPreview, descriptionSummary, distanceFact, distanceMeters, externalSearchHref, facetOptions, fetchRentalFlags, fetchSearchPage, findCampaignStart, findOfferWindows, formatIsoDate, formatPriceLabel, frameFor, guestBounds, handoverQuery, hasMapPoints, idsInView, isAdjacent, isIsoDay, isSpecEcho, layoutSameSpot, loadRentalCatalogue, loadRentalFacts, loadSharedSdk, mapPoints, matches, measureFilters, mergePlaces, minimumSteps, newestReviewsFirst, nightsBetween, normalizeStructuredDocument, occupancyOf, offerWindowHref, offersWindowQuery, parseCounts, parseDistances, parsePriceLabel, parseTextBlocks, partyPairs, plainText, queryShape, quickFilterDefs, rankHighlights, readParty, readSearch, readSelection, rentalAddressLine, rentalFactsMap, resolveFilters, resolveSdk, resultCardSource, resultsQueryFlagScript, routeHref, sanitizeSearch, sdkConfigFor, sdkConfigFromEnv, searchHref, shareSdk, shortReviewerName, slugify, sortFromSearch, sortResults, splitReviewAuthor, stayKeyOf, toCardModel, toSdkQuery, toSdkSort, todayIso, walkSearchPages, withRentalFacts, withoutFilter, withoutFilters, writeSearch, writeSelection };
|
|
2850
|
+
export { ADJACENT_BELOW_M, ALWAYS_EXCLUDED_CATEGORIES, type ActiveFilter, type AdaptEvent, type AdaptRentalOptions, type AlternativePeriod, type AmenityGroup, type AmenityPreviewItem, type AmenityPreviewOptions, type AvailabilityWindowInput, type Backend, type BadgeRule, type BedRun, type BookableFrom, type BookingConfirmation, type BookingContact, type BookingKind, type BookingSnapshot, type BuiltInFieldSpec, type BuiltInPolicyLabels, type CampaignChip, type CampaignChipsInput, type CampaignLabelSource, type CampaignOf, type CardBadge, type CardContext, type CardFact, type CardImage, type CardLiveField, type CardMatch, type CardModelOptions, type CardPill, type CardRating, type CardSignal, type CardSource, type CardSourceExtras, type CardStatus, type CatalogueRental, type CheckedCopy, type CheckoutActions, type CheckoutBlocker, type CheckoutContext, type CheckoutEventDetail, type CheckoutFlow, type CheckoutFlowOptions, type CheckoutHandover, type CheckoutHandoverOptions, type CheckoutInsuranceState, type CheckoutIssue, type CheckoutMessages, type CheckoutPart, type CheckoutPhase, type CheckoutPolicyState, type CheckoutRequirement, type CheckoutService, type CheckoutState, type CheckoutStructure, type CheckoutVoucherState, type ChildAgeRange, type ClusterOptions, type ContactControl, type ContactEventDetail, type ContactFieldName, type ContactFieldSpec, type ContactForm, type ContactFormActions, type ContactFormMessages, type ContactFormOptions, type ContactFormState, type ContactLink, type ContactPhase, type ContactSubmitOutcome, type ContactValue, type ContactValues, type CountryCode, type CountryGroups, type CountryOption, type CountryOptionsInput, DEFAULT_CHILD_AGE, DEFAULT_CLUSTER, DEFAULT_FIT, DEFAULT_FLAG_FILTERS, DEFAULT_GUEST_LIMITS, DEFAULT_SORT_OPTIONS, type DateControls, type DateMode, type DateSearch, type DateSearchOptions, type DateSearchState, type DayKind, type DayPrices, type DayState, type DefaultFit, type DescriptionContent, type DescriptionPreview, type DistanceKind, ENHANCE_PARTS, type EmptyCause, type EndAvailability, type EndAvailabilityInput, type EnhancePart, type EnhanceParts, type EnvRecord, type ExternalSearchLink, type ExternalSearchSource, type ExtraFieldSpec, FAVORITE_LEAVE_MS, type FacetOption, type FacetOptionsOptions, type FactKind, type Favorites, type FavoritesChange, type FavoritesOptions, type FavoritesPort, type FavoritesState, type FetchRentalFlagsOptions, type FieldWidth, type FilterDef, type FilterEntry, type FilterGroupSpec, type FilterMeasurement, type FilterSelection, type FilterSpec, type FindCampaignStartOptions, type FindOfferWindowsOptions, type FitOptions, type FlexibleStay, GATE_MARKERS, GLYPHS, type GateMarkers, type Glyph, type GlyphList, type GuestBound, type GuestBounds, type GuestCaps, type GuestForm, type GuestFormField, type GuestFormOptions, type GuestFormState, type GuestKind, type GuestLimits, type GuestOptions, type GuestSearch, type GuestSearchOptions, type GuestSearchState, HIDDEN_ROOM_ATTRIBUTES, HUB_ENDPOINTS, type HistoryPort, type HubEndpointTable, type HubEndpoints, type ImplicitScope, type InitialAvailability, type InsuranceDocsState, type InsurancePaymentLink, type IsoDay, type IsoMonth, type LegalDocument, type LegalDocuments, type Listener, type LiveSearchOptions, type LngLat, type LoadRentalCatalogueOptions, type Locale, type MapBounds, type MapPlace, type MapPoint, type MapResultsSource, type MapViewReport, type OfferWindow, type OffersWindowSpec, type OptionalGuestField, type OutcomeInput, type Party, type PaymentLine, type PaymentReturn, type PaymentScheduleView, type PeriodLabel, type PeriodValue, type PillOptions, type PinLabelOptions, type PixelOffset, type PlaceMarker, type PlainTextOptions, type PolicyBranch, type PolicyBranchOptions, type PolicyChoiceMode, type PolicyOffer, type PolicyOfferInput, type PolicyOption, type PolicyStance, type PolicyTerms, type PolicyTermsOptions, type PolicyTitle, type PreviewStrategy, type PriceCents, type PriceLine, type PriceView, type QueryPair, type QueryShape, type QuoteAddonService, type QuoteCancellationPolicy, type QuoteCta, type QuoteEventDetail, type QuoteFlow, type QuoteFlowOptions, type QuoteFlowSettings, type QuoteFlowState, type QuoteHandover, type QuoteInsurance, type QuoteInsuranceOption, type QuoteOccupancy, type QuoteOutcome, type QuotePolicyRule, type QuoteRequest, type QuoteResult, type QuoteSelectionResult, type QuoteUnavailableCode, type QuoteView, type QuoteVoucher, type Range, type RawSearchPage, type RegionChoice, type RegionOptionsInput, type RegionTree, type RelatedOptions, type Relaxation, type RentalAddress, type RentalAddressMode, RentalAddressModeError, type RentalCardModel, RentalContentError, type RentalCounts, type RentalDetail, type RentalDistance, type RentalFacts, type RentalFactsMap, type RentalFlag, type RentalFlagsResult, type RentalImage, type RentalIndexEntry, type RentalMatch, type RentalMatchOptions, type RentalPropertyInfo, type RentalReview, type RentalReviews, type RentalRoom, type ResolveFiltersOptions, type ResolvedContactField, type ResolvedContactItem, type ResolvedFilters, type ResolvedSearchGroup, type ResultHandoverOptions, type ResultLinkOptions, type ResultsMapController, type ResultsMapOptions, type ResultsMapState, type ResultsMapSurface, type ReviewCriterion, type ReviewSummary, type RichBlock, type RichInline, type RoomKind, type RotationOptions, type RouteParams, type RouteTemplate, type RoutedContactIssues, SDK_ENV, SEARCH_PAGE_SIZE, SEARCH_PARAMS, SORT_URL_VALUE, STAGES, type Salutation, type SameSpotGroup, type SameSpotLayout, type SameSpotMode, type SameSpotOptions, type SanitizedSearch, type SdkCapacity, type SdkConfig, type SdkConfigForInput, SdkEnvError, type SdkFilterDefinition, type SdkMode, type SdkOptions, type SdkQueryOptions, type SdkSearchQuery, type SdkSetup, type SdkSource, type SearchActions, type SearchContract, type SearchField, type SearchForm, type SearchFormIssue, type SearchFormOptions, type SearchFormState, type SearchGroupSpec, type SearchOutcome, type SearchPage, type SearchPageRequest, type SearchParamAliases, type SearchParamKeys, type SearchPeriod, type SearchQuery, type SearchResultItem, type SearchScope, type SearchScopeKind, type SearchState, type SearchStatus, type SearchStore, type SearchStoreClaim, type SearchStoreOptions, type SearchedParts, type SelectOption, type Selection, type SelectionSpec, type ShareLocation, type ShareUrlOptions, type SharedSdk, type ShowcaseGroup, type ShowcaseGroupSpec, type ShowcaseOrder, type SnapshotImage, type SortKey, type SortOptionState, type Stage, type Stay, type StayPicker, type StayPickerOptions, type StayPickerState, type StayPrice, type StayWindow, type StorageLike, type Store, type StructureRequirement, type StructureViolation, type StructuredDocumentOptions, type SubmitBookingOptions, type SubmitWording, type Template, type TextMarkup, type TokensOf, type Unsubscribe, VOFFICE_ENDPOINTS, type ValidationMessages, type ValueConstraints, type VofficeEndpointTable, type VofficeEndpoints, WATER_KINDS, type WalkOptions, type WalkSummary, type WebsiteSdk, type WhenEmpty, type WhenUnavailable, type WritableStore, type WriteSearchOptions, activeFilters, adaptRental, addDays, agesComplete, amenityPreview, assignSlugs, campaignChips, campaignGroup, cardSource, catalogueResultItem, circleOffsets, clampParty, compareUndatedSearchOrder, createResultsMapController, createSdk, createSearchStore, createStore, describeOutcome, descriptionPreview, descriptionSummary, distanceFact, distanceMeters, externalSearchHref, facetOptions, fetchRentalFlags, fetchSearchPage, findCampaignStart, findOfferWindows, formatIsoDate, formatPriceLabel, frameFor, guestBounds, handoverQuery, hasMapPoints, idsInView, isAdjacent, isIsoDay, isSpecEcho, layoutSameSpot, loadRentalCatalogue, loadRentalFacts, loadSharedSdk, mapPoints, matches, measureFilters, mergePlaces, minimumSteps, newestReviewsFirst, nightsBetween, normalizeStructuredDocument, occupancyOf, offerWindowHref, offersWindowQuery, parseCounts, parseDistances, parsePriceLabel, parseTextBlocks, partyPairs, plainText, queryShape, quickFilterDefs, rankHighlights, readParty, readSearch, readSelection, rentalAddressLine, rentalFactsMap, resolveFilters, resolveSdk, resultCardSource, resultsQueryFlagScript, routeHref, sanitizeSearch, sdkConfigFor, sdkConfigFromEnv, searchHref, shareSdk, shortReviewerName, slugify, sortFromSearch, sortResults, splitReviewAuthor, stayKeyOf, toCardModel, toSdkQuery, toSdkSort, todayIso, walkSearchPages, withRentalFacts, withoutFilter, withoutFilters, writeSearch, writeSelection };
|
package/dist/index.mjs
CHANGED
|
@@ -986,6 +986,34 @@ const detectCountry = function detectCountry(countries, languages, fallback = "D
|
|
|
986
986
|
return fallback;
|
|
987
987
|
};
|
|
988
988
|
//#endregion
|
|
989
|
+
//#region src/regions/regions.ts
|
|
990
|
+
/** See {@link RegionOptions}. */
|
|
991
|
+
const regionOptions = function regionOptions(tree, { locale, rentalIds }) {
|
|
992
|
+
const siteRentals = new Set(rentalIds);
|
|
993
|
+
const topLevelName = /* @__PURE__ */ new Map();
|
|
994
|
+
const choices = [];
|
|
995
|
+
for (const region of tree.regions) {
|
|
996
|
+
const name = region.name[locale];
|
|
997
|
+
const group = region.parentId === null ? void 0 : topLevelName.get(region.parentId);
|
|
998
|
+
topLevelName.set(region.id, group ?? name);
|
|
999
|
+
const count = region.rentalIds.filter((id) => siteRentals.has(id)).length;
|
|
1000
|
+
if (count === 0) continue;
|
|
1001
|
+
choices.push({
|
|
1002
|
+
value: region.id,
|
|
1003
|
+
label: name,
|
|
1004
|
+
count,
|
|
1005
|
+
...group === void 0 ? {} : { group }
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
return choices;
|
|
1009
|
+
};
|
|
1010
|
+
/** See {@link RegionsByRental}. */
|
|
1011
|
+
const regionsByRental = function regionsByRental(tree) {
|
|
1012
|
+
const byRental = {};
|
|
1013
|
+
for (const region of tree.regions) for (const rentalId of region.rentalIds) (byRental[rentalId] ??= []).push(region.id);
|
|
1014
|
+
return byRental;
|
|
1015
|
+
};
|
|
1016
|
+
//#endregion
|
|
989
1017
|
//#region src/guests/party.ts
|
|
990
1018
|
/** The kit limits every site ran on; a site overrides single keys. */
|
|
991
1019
|
const DEFAULT_GUEST_LIMITS = {
|
|
@@ -2645,7 +2673,8 @@ const WATER_KINDS = [
|
|
|
2645
2673
|
const parseCounts = function parseCounts(sources) {
|
|
2646
2674
|
return {
|
|
2647
2675
|
...countsOf(sources.highlights),
|
|
2648
|
-
...countsOf(sources.roomSummary)
|
|
2676
|
+
...countsOf(sources.roomSummary),
|
|
2677
|
+
...capacityCounts(sources.capacity)
|
|
2649
2678
|
};
|
|
2650
2679
|
};
|
|
2651
2680
|
/** See {@link ParseDistances}. */
|
|
@@ -2668,10 +2697,15 @@ const isSpecEcho = function isSpecEcho(label) {
|
|
|
2668
2697
|
const isDistanceItem = function isDistanceItem(item) {
|
|
2669
2698
|
return DISTANCE_ITEM.test(item.trim());
|
|
2670
2699
|
};
|
|
2671
|
-
/** "<n> <label>" labels, lowercased.
|
|
2672
|
-
*
|
|
2700
|
+
/** "<n> <label>" labels, lowercased. From website-sdk 2.38.0 both backends render counts in
|
|
2701
|
+
* their plural form ("1 Gast", "4 Gäste"); older SDKs wrote v10 as "4 Maximale Personenzahl"
|
|
2702
|
+
* and v9 as "4 Schlafmöglichkeiten", still read for sites on those versions. */
|
|
2673
2703
|
const COUNT_LABELS = {
|
|
2674
2704
|
guests: [
|
|
2705
|
+
"gast",
|
|
2706
|
+
"gäste",
|
|
2707
|
+
"guest",
|
|
2708
|
+
"guests",
|
|
2675
2709
|
"maximale personenzahl",
|
|
2676
2710
|
"maximum number of people",
|
|
2677
2711
|
"schlafmöglichkeit",
|
|
@@ -2797,6 +2831,16 @@ function readCount(line) {
|
|
|
2797
2831
|
value: Number(match[1])
|
|
2798
2832
|
} : void 0;
|
|
2799
2833
|
}
|
|
2834
|
+
/** The SDK omits a count it does not state, so every stated value is kept. */
|
|
2835
|
+
function capacityCounts(capacity) {
|
|
2836
|
+
const counts = {};
|
|
2837
|
+
if (capacity?.maxGuests != null) counts.guests = capacity.maxGuests;
|
|
2838
|
+
if (capacity?.bedrooms != null) counts.bedrooms = capacity.bedrooms;
|
|
2839
|
+
if (capacity?.bathrooms != null) counts.bathrooms = capacity.bathrooms;
|
|
2840
|
+
if (capacity?.rooms != null) counts.rooms = capacity.rooms;
|
|
2841
|
+
if (capacity?.livingAreaSqm != null) counts.area = capacity.livingAreaSqm;
|
|
2842
|
+
return counts;
|
|
2843
|
+
}
|
|
2800
2844
|
function countsOf(lines) {
|
|
2801
2845
|
const counts = {};
|
|
2802
2846
|
for (const line of lines ?? []) {
|
|
@@ -3464,6 +3508,7 @@ function toDetail(raw, options) {
|
|
|
3464
3508
|
} } : {},
|
|
3465
3509
|
...type ? { type } : {},
|
|
3466
3510
|
counts: parseCounts({
|
|
3511
|
+
capacity: raw.capacity,
|
|
3467
3512
|
roomSummary: raw.roomSummary,
|
|
3468
3513
|
highlights: raw.highlights
|
|
3469
3514
|
}),
|
|
@@ -4020,7 +4065,10 @@ function baseOf(item, ctx) {
|
|
|
4020
4065
|
hrefWithoutDates: `${page}${partyOnlyQuery(ctx.search)}`,
|
|
4021
4066
|
images: live.length > 0 ? live : facts?.images ?? [],
|
|
4022
4067
|
counts: {
|
|
4023
|
-
...parseCounts({
|
|
4068
|
+
...parseCounts({
|
|
4069
|
+
capacity: item.capacity,
|
|
4070
|
+
highlights: item.highlights ?? null
|
|
4071
|
+
}),
|
|
4024
4072
|
...definedCounts(facts?.counts)
|
|
4025
4073
|
},
|
|
4026
4074
|
highlights: item.highlights ?? [],
|
|
@@ -8957,4 +9005,4 @@ function parseNodes(data) {
|
|
|
8957
9005
|
/** See {@link FetchLegalDocuments}. */
|
|
8958
9006
|
const fetchLegalDocuments = (sdk, locale) => fetchDocuments(sdk, locale);
|
|
8959
9007
|
//#endregion
|
|
8960
|
-
export { ADJACENT_BELOW_M, ALWAYS_EXCLUDED_CATEGORIES, BOOKING_KIND_ATTRIBUTE, BOOKING_SNAPSHOT_KEY, BUILT_IN_POLICY_LABELS, CAMPAIGN_PARAM, CHECKOUT_CONTEXT_KEY, CHECKOUT_EVENT, CHECKOUT_PARTS, CHECKOUT_STRUCTURE, CONTACT_ENDPOINT_REQUIRED, CONTACT_EVENT, CONTACT_LIMITS, DEFAULT_CHILD_AGE, DEFAULT_CLUSTER, DEFAULT_CONTACT_FIELDS, DEFAULT_FEATURED_COUNTRIES, DEFAULT_FIT, DEFAULT_FLAG_FILTERS, DEFAULT_GUEST_LIMITS, DEFAULT_MAP_STYLE_URL, DEFAULT_SORT_OPTIONS, ENHANCE_PARTS, FAVORITES_EVENT, FAVORITE_LEAVE_MS, GATE_MARKERS, GLYPHS, HIDDEN_ROOM_ATTRIBUTES, HUB_ENDPOINTS, MULTI_RATE_CODES, NO_INSURANCE_DOCS, POLICY_DEADLINE_HAS_TIME, QUOTE_EVENT, QUOTE_PARAM_KEYS, RELOAD_FLASH_MS, RentalAddressModeError, RentalContentError, SALUTATION_WIRE_VALUES, SAME_SPOT_METERS, SDK_ENV, SEARCH_PAGE_SIZE, SEARCH_PARAMS, SORT_URL_VALUE, STAGES, SUBMIT_WORDING, SdkEnvError, TRACKING_PARAM_PATTERN, VOFFICE_ENDPOINTS, WATER_KINDS, WINDOW_PARAM_KEYS, acquireFavorites, acquireQuoteFlow, acquireSearchStore, activeFilters, adaptGuestQuote, adaptRental, addDays, addQuoteService, agesComplete, amenityPreview, assertCheckoutStructure, assignSlugs, browserStorage, buildContactInput, buildShowcaseGroups, campaignChips, campaignGroup, cardSource, catalogueResultItem, checkoutHref, checkoutSearch, circleOffsets, clampParty, clearQuoteServices, compareUndatedSearchOrder, connectSearchStore, contactSpecProblems, countryOptions, createCheckoutFlow, createContactForm, createDateSearch, createFavorites, createGuestForm, createGuestSearch, createQuoteFlow, createResultsMapController, createSdk, createSearchForm, createSearchStore, createStayPicker, createStore, dayPriceLabel, defineCopy, describeOutcome, describePeriod, describePolicyOffer, describeSdkError, descriptionPreview, descriptionSummary, detectCountry, dialCode, distanceFact, distanceMeters, emailError, externalSearchHref, facetOptions, favoritesStorageKey, fetchEndAvailability, fetchInitialAvailability, fetchLegalDocuments, fetchQuote, fetchRentalFlags, fetchSearchPage, fillTemplate, findCampaignStart, findOfferWindows, floorplanUrl, foldSearchText, formatIsoDate, formatPriceLabel, formatStayRange, frameFor, freeCancellationUntil, guestBounds, handoverQuery, hasMapPoints, idsInView, insuranceDocsPending, insuranceIdToReapply, insuranceProductKey, isAdjacent, isBuiltInPolicy, isIsoDay, isRateConfigurationFault, isSpecEcho, isSubmittableOption, isTrackingParam, layoutSameSpot, loadRentalCatalogue, loadRentalFacts, loadRentalIndex, loadSharedSdk, logSdkFailure, mapPoints, matchRentals, matches, measureFilters, mergePlaces, minimumSteps, newestReviewsFirst, nightsBetween, normalizePhone, normalizeStructuredDocument, occupancyOf, offerWindowHref, offeredPolicies, offersWindowQuery, parseCounts, parseDistances, parsePriceLabel, parseTextBlocks, partyPairs, payWithOption, phoneError, plainText, policyStance, policyTerms, policyTitle, postalcodeError, prefillFromParams, pricePolicyBranches, queryShape, quickFilterDefs, rankHighlights, readCheckoutHandover, readParty, readPaymentReturn, readQuoteHandover, readSearch, readSelection, removeQuoteService, rentalAddressLine, rentalFactsMap, rentalIndexEntries, resolveContactFields, resolveFilters, resolveSdk, resolveSearchGroups, resultCardSource, resultsQueryFlagScript, rotationWindow, routeContactIssues, routeHref, runLiveSearch, sanitizeSearch, saveCheckoutContext, sdkConfigFor, sdkConfigFromEnv, searchHref, seededShuffle, selectQuoteInsurance, selectQuotePolicy, selectRelated, selectRentals, selectableInsuranceOptions, selectedInsuranceOption, shareSdk, shareUrl, shortReviewerName, shownInsuranceResources, slugify, sortFromSearch, sortResults, splitReviewAuthor, stabilizeCardOrder, stayKeyOf, stayQuery, streetWarning, submitBooking, toCardModel, toSdkQuery, toSdkSort, todayIso, validateContactValues, walkSearchPages, webpSrcset, webpUrl, withRentalFacts, withoutFilter, withoutFilters, withoutTracking, writeQuoteParams, writeSearch, writeSelection };
|
|
9008
|
+
export { ADJACENT_BELOW_M, ALWAYS_EXCLUDED_CATEGORIES, BOOKING_KIND_ATTRIBUTE, BOOKING_SNAPSHOT_KEY, BUILT_IN_POLICY_LABELS, CAMPAIGN_PARAM, CHECKOUT_CONTEXT_KEY, CHECKOUT_EVENT, CHECKOUT_PARTS, CHECKOUT_STRUCTURE, CONTACT_ENDPOINT_REQUIRED, CONTACT_EVENT, CONTACT_LIMITS, DEFAULT_CHILD_AGE, DEFAULT_CLUSTER, DEFAULT_CONTACT_FIELDS, DEFAULT_FEATURED_COUNTRIES, DEFAULT_FIT, DEFAULT_FLAG_FILTERS, DEFAULT_GUEST_LIMITS, DEFAULT_MAP_STYLE_URL, DEFAULT_SORT_OPTIONS, ENHANCE_PARTS, FAVORITES_EVENT, FAVORITE_LEAVE_MS, GATE_MARKERS, GLYPHS, HIDDEN_ROOM_ATTRIBUTES, HUB_ENDPOINTS, MULTI_RATE_CODES, NO_INSURANCE_DOCS, POLICY_DEADLINE_HAS_TIME, QUOTE_EVENT, QUOTE_PARAM_KEYS, RELOAD_FLASH_MS, RentalAddressModeError, RentalContentError, SALUTATION_WIRE_VALUES, SAME_SPOT_METERS, SDK_ENV, SEARCH_PAGE_SIZE, SEARCH_PARAMS, SORT_URL_VALUE, STAGES, SUBMIT_WORDING, SdkEnvError, TRACKING_PARAM_PATTERN, VOFFICE_ENDPOINTS, WATER_KINDS, WINDOW_PARAM_KEYS, acquireFavorites, acquireQuoteFlow, acquireSearchStore, activeFilters, adaptGuestQuote, adaptRental, addDays, addQuoteService, agesComplete, amenityPreview, assertCheckoutStructure, assignSlugs, browserStorage, buildContactInput, buildShowcaseGroups, campaignChips, campaignGroup, cardSource, catalogueResultItem, checkoutHref, checkoutSearch, circleOffsets, clampParty, clearQuoteServices, compareUndatedSearchOrder, connectSearchStore, contactSpecProblems, countryOptions, createCheckoutFlow, createContactForm, createDateSearch, createFavorites, createGuestForm, createGuestSearch, createQuoteFlow, createResultsMapController, createSdk, createSearchForm, createSearchStore, createStayPicker, createStore, dayPriceLabel, defineCopy, describeOutcome, describePeriod, describePolicyOffer, describeSdkError, descriptionPreview, descriptionSummary, detectCountry, dialCode, distanceFact, distanceMeters, emailError, externalSearchHref, facetOptions, favoritesStorageKey, fetchEndAvailability, fetchInitialAvailability, fetchLegalDocuments, fetchQuote, fetchRentalFlags, fetchSearchPage, fillTemplate, findCampaignStart, findOfferWindows, floorplanUrl, foldSearchText, formatIsoDate, formatPriceLabel, formatStayRange, frameFor, freeCancellationUntil, guestBounds, handoverQuery, hasMapPoints, idsInView, insuranceDocsPending, insuranceIdToReapply, insuranceProductKey, isAdjacent, isBuiltInPolicy, isIsoDay, isRateConfigurationFault, isSpecEcho, isSubmittableOption, isTrackingParam, layoutSameSpot, loadRentalCatalogue, loadRentalFacts, loadRentalIndex, loadSharedSdk, logSdkFailure, mapPoints, matchRentals, matches, measureFilters, mergePlaces, minimumSteps, newestReviewsFirst, nightsBetween, normalizePhone, normalizeStructuredDocument, occupancyOf, offerWindowHref, offeredPolicies, offersWindowQuery, parseCounts, parseDistances, parsePriceLabel, parseTextBlocks, partyPairs, payWithOption, phoneError, plainText, policyStance, policyTerms, policyTitle, postalcodeError, prefillFromParams, pricePolicyBranches, queryShape, quickFilterDefs, rankHighlights, readCheckoutHandover, readParty, readPaymentReturn, readQuoteHandover, readSearch, readSelection, regionOptions, regionsByRental, removeQuoteService, rentalAddressLine, rentalFactsMap, rentalIndexEntries, resolveContactFields, resolveFilters, resolveSdk, resolveSearchGroups, resultCardSource, resultsQueryFlagScript, rotationWindow, routeContactIssues, routeHref, runLiveSearch, sanitizeSearch, saveCheckoutContext, sdkConfigFor, sdkConfigFromEnv, searchHref, seededShuffle, selectQuoteInsurance, selectQuotePolicy, selectRelated, selectRentals, selectableInsuranceOptions, selectedInsuranceOption, shareSdk, shareUrl, shortReviewerName, shownInsuranceResources, slugify, sortFromSearch, sortResults, splitReviewAuthor, stabilizeCardOrder, stayKeyOf, stayQuery, streetWarning, submitBooking, toCardModel, toSdkQuery, toSdkSort, todayIso, validateContactValues, walkSearchPages, webpSrcset, webpUrl, withRentalFacts, withoutFilter, withoutFilters, withoutTracking, writeQuoteParams, writeSearch, writeSelection };
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/website-headless`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/1.4.0/CHANGELOG.md`: release notes for 1.4.0
|
|
8
|
+
- `versions/1.3.0/CHANGELOG.md`: release notes for 1.3.0
|
|
7
9
|
- `versions/1.2.0/CHANGELOG.md`: release notes for 1.2.0
|
|
8
10
|
- `versions/1.1.1/CHANGELOG.md`: release notes for 1.1.1
|
|
9
11
|
- `versions/1.1.0/CHANGELOG.md`: release notes for 1.1.0
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Migration guides of `@v-office/website-headless`, newest first. Apply them in order when skipping versions.
|
|
6
6
|
|
|
7
|
+
- `versions/1.4.0/MIGRATION.md`: Migration: 1.3.0 to 1.4.0
|
|
8
|
+
- `versions/1.3.0/MIGRATION.md`: Migration: 1.2.0 to 1.3.0
|
|
7
9
|
- `versions/1.2.0/MIGRATION.md`: Migration: 1.1.1 to 1.2.0
|
|
8
10
|
- `versions/1.1.1/MIGRATION.md`: Migration: 1.1.0 to 1.1.1
|
|
9
11
|
- `versions/1.1.0/MIGRATION.md`: Migration: 1.0.0 to 1.1.0
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog: 1.3.0
|
|
2
|
+
|
|
3
|
+
The search's region field and `?region=` scope can come from the website's region tree
|
|
4
|
+
(`sdk.static.regions.getRegions` of `@v-office/website-sdk` 2.37.1 or later, v10 and v9).
|
|
5
|
+
These helpers were described for 1.2.0, but 1.2.0 was published without them.
|
|
6
|
+
|
|
7
|
+
## Added
|
|
8
|
+
|
|
9
|
+
- `regionOptions(tree, { locale, rentalIds })` returns every region holding one of the site's
|
|
10
|
+
rentals as a `RegionChoice` (`value` = the region's id, its key such as `dornum`; `label` =
|
|
11
|
+
its name; `count` of the site's rentals; `group` = the top-level region's name for a
|
|
12
|
+
subregion), in the tree's order. `rentalIds` are the ids of the rentals the site reads: the
|
|
13
|
+
tree ignores the SDK's `rentalScope`. Pass them as the `regions` prop of `SearchBar` from
|
|
14
|
+
`@v-office/website-components`, and as the options of a curated hidden `region` facet.
|
|
15
|
+
- `regionsByRental(tree)` maps each rental id to every region holding it, ancestors included,
|
|
16
|
+
for the `regions` of `cardSource`. `?region=<id>` then also finds the subregions' rentals.
|
|
17
|
+
- The types `RegionChoice`, `RegionOptionsInput` and `RegionTree`.
|
|
18
|
+
|
|
19
|
+
## Changed
|
|
20
|
+
|
|
21
|
+
- Nothing for existing code. Without a region tree, regions work as before.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Migration: 1.2.0 to 1.3.0
|
|
2
|
+
|
|
3
|
+
No changes required. To take a site's regions from the region tree, see
|
|
4
|
+
`@v-office/website-sdk`'s `regions.md` (website-sdk 2.37.1 or later).
|
|
5
|
+
|
|
6
|
+
## 1. Upgrade
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
pnpm add --save-exact @v-office/website-headless@1.3.0
|
|
10
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog: 1.4.0
|
|
2
|
+
|
|
3
|
+
Counts come from the SDK's numbers instead of its translated text.
|
|
4
|
+
|
|
5
|
+
## Changed
|
|
6
|
+
|
|
7
|
+
- `parseCounts` takes `capacity` (website-sdk 2.38.0 or later) and reads it first; the text of
|
|
8
|
+
`roomSummary` and `highlights` only fills what `capacity` omits. `adaptRental` and the search
|
|
9
|
+
results pass it, so `RentalDetail.counts` and a result's `counts` no longer depend on the
|
|
10
|
+
locale or on a label's wording.
|
|
11
|
+
- With website-sdk below 2.38.0 there is no `capacity`, and counts are read from the text as
|
|
12
|
+
before.
|
|
13
|
+
- The count text reads the guest wording of website-sdk 2.38.0 too ("1 Gast", "4 Gäste",
|
|
14
|
+
"1 guest", "4 guests"), so `isSpecEcho` still recognizes those highlights as counts.
|
|
15
|
+
|
|
16
|
+
## Added
|
|
17
|
+
|
|
18
|
+
- The type `SdkCapacity`: the `capacity` fields `parseCounts` reads. Headless declares it
|
|
19
|
+
rather than importing website-sdk's `RentalCapacity`, so its types compile against every SDK
|
|
20
|
+
the peer range accepts (2.25.0 and later).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/website-headless",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Framework-free behaviour layer for v-office websites, never UI: stores, pure rules and SDK runners for the search bar, results, map, showcase, quote, checkout and contact form, the rental and card models, and progressive-enhancement engines for server-rendered markup (./enhance)",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "26.5.1",
|
|
29
|
-
"@v-office/website-sdk": "2.
|
|
29
|
+
"@v-office/website-sdk": "2.38.0",
|
|
30
30
|
"effect": "4.0.0-rc.115",
|
|
31
31
|
"jsdom": "^30.0.1",
|
|
32
32
|
"oxfmt": "0.67.0",
|