@meetelise/chat 1.63.0 → 1.64.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/dist/src/WebComponent/SchedulerV2/schedulerRequests.d.ts +43 -0
- package/dist/src/WebComponent/SchedulerV2/tourItineraryApi.d.ts +167 -0
- package/dist/src/WebComponent/SchedulerV2/tourTimes.d.ts +26 -0
- package/dist/src/WebComponent/actions/call-us-window.d.ts +0 -2
- package/dist/src/WebComponent/actions/email-us-window.d.ts +1 -2
- package/dist/src/WebComponent/pubnub-chat.d.ts +5 -0
- package/package.json +1 -1
- package/public/dist/index.js +167 -167
- package/src/WebComponent/Scheduler/tour-scheduler.ts +2 -2
- package/src/WebComponent/SchedulerV2/schedulerRequests.ts +123 -0
- package/src/WebComponent/SchedulerV2/tourItineraryApi.ts +256 -0
- package/src/WebComponent/SchedulerV2/tourTimes.ts +82 -0
- package/src/WebComponent/actions/call-us-window.ts +12 -8
- package/src/WebComponent/actions/email-us-window.ts +12 -6
- package/src/WebComponent/pubnub-chat.ts +14 -0
- package/src/overlayFocus.test.ts +102 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { LeadSourceSubmittedListItem } from "../LeadSourceMultitouchClient";
|
|
2
|
+
import type { BookingAttribution, BookingContact, BookingRequest, PlanRequest, PlanResponse, TourTypeId } from "./tourItineraryApi";
|
|
3
|
+
/** What the prospect has chosen on the schedule step. */
|
|
4
|
+
export interface ItineraryChoice {
|
|
5
|
+
/** New stops, in the prospect's order. */
|
|
6
|
+
buildingIds: number[];
|
|
7
|
+
tourType: TourTypeId;
|
|
8
|
+
date: string;
|
|
9
|
+
/** "HH:mm" picked for the first new stop, or null for the earliest. */
|
|
10
|
+
firstStart: string | null;
|
|
11
|
+
/** ISO starts picked for later new stops, by building id. */
|
|
12
|
+
laterStarts: Record<number, string>;
|
|
13
|
+
/** Booked events this itinerary extends, in order; the last one is fixed first. */
|
|
14
|
+
existingEventIds: number[];
|
|
15
|
+
}
|
|
16
|
+
export declare const buildPlanRequest: (choice: ItineraryChoice) => PlanRequest;
|
|
17
|
+
/**
|
|
18
|
+
* Lead-source attribution, built the way tour-scheduler.ts builds the same
|
|
19
|
+
* fields for /v2/scheduleMe.
|
|
20
|
+
*/
|
|
21
|
+
export declare const buildAttribution: ({ orgSlug, selectedLeadSource, currentLeadSource, touchpoints, search, referrer, googleReferral, }: {
|
|
22
|
+
orgSlug: string;
|
|
23
|
+
/** Picked in the "How did you hear about us?" dropdown. */
|
|
24
|
+
selectedLeadSource: string | null;
|
|
25
|
+
/** Derived from the referrer and query params. */
|
|
26
|
+
currentLeadSource: string;
|
|
27
|
+
touchpoints: LeadSourceSubmittedListItem[];
|
|
28
|
+
search: string;
|
|
29
|
+
referrer: string;
|
|
30
|
+
googleReferral: {
|
|
31
|
+
rwgToken: string;
|
|
32
|
+
buildingId: number;
|
|
33
|
+
environment: string;
|
|
34
|
+
} | null;
|
|
35
|
+
}) => BookingAttribution;
|
|
36
|
+
export declare const buildBookingRequest: ({ choice, plan, contact, attribution, conversationTrackingId, cancelExistingTours, }: {
|
|
37
|
+
choice: ItineraryChoice;
|
|
38
|
+
plan: PlanResponse;
|
|
39
|
+
contact: BookingContact;
|
|
40
|
+
attribution: BookingAttribution;
|
|
41
|
+
conversationTrackingId: string | null;
|
|
42
|
+
cancelExistingTours: boolean;
|
|
43
|
+
}) => BookingRequest;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for the widget tour itinerary endpoints (communities, plan, book).
|
|
3
|
+
* The schemas follow the contract shared with the backend; the server owns
|
|
4
|
+
* ranking, caps, chaining and every prospect-facing reason, and the widget only
|
|
5
|
+
* renders what comes back.
|
|
6
|
+
*/
|
|
7
|
+
export declare type TourTypeId = "escorted-tour" | "self-guided-tour" | "live-virtual-tour";
|
|
8
|
+
export interface CommunityAddress {
|
|
9
|
+
line1: string | null;
|
|
10
|
+
city: string | null;
|
|
11
|
+
state: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface Community {
|
|
14
|
+
building_id: number;
|
|
15
|
+
name: string;
|
|
16
|
+
address: CommunityAddress | null;
|
|
17
|
+
timezone: string | null;
|
|
18
|
+
distance_mi: number | null;
|
|
19
|
+
/** In US dollars. */
|
|
20
|
+
price_from: {
|
|
21
|
+
bedrooms: number;
|
|
22
|
+
amount: number;
|
|
23
|
+
} | null;
|
|
24
|
+
next_available: {
|
|
25
|
+
date: string;
|
|
26
|
+
time: string;
|
|
27
|
+
} | null;
|
|
28
|
+
best_match: boolean;
|
|
29
|
+
image_url: string | null;
|
|
30
|
+
tourable: boolean;
|
|
31
|
+
/** The text to show when the community can't be toured. */
|
|
32
|
+
unavailable_reason: string | null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Most stops in one itinerary, counting ones already booked. The server's cap,
|
|
36
|
+
* mirrored here for the picker; booking enforces the real one.
|
|
37
|
+
*/
|
|
38
|
+
export declare const MAX_ITINERARY_STOPS = 3;
|
|
39
|
+
/** The top communities after filtering; there's no paging. */
|
|
40
|
+
export interface CommunitiesResponse {
|
|
41
|
+
anchor: {
|
|
42
|
+
building_id: number;
|
|
43
|
+
name: string;
|
|
44
|
+
is_general_building: boolean;
|
|
45
|
+
};
|
|
46
|
+
communities: Community[];
|
|
47
|
+
}
|
|
48
|
+
export interface CommunityFilters {
|
|
49
|
+
bedrooms: number[];
|
|
50
|
+
moveIn: string | null;
|
|
51
|
+
maxBudget: number | null;
|
|
52
|
+
}
|
|
53
|
+
/** Adding a stop after a booking: the widget sends what it knows of that booking. */
|
|
54
|
+
export interface ExtendQuery {
|
|
55
|
+
/** ISO 8601 with offset: when the last booked stop ends. */
|
|
56
|
+
availableAfter: string;
|
|
57
|
+
tourType: TourTypeId;
|
|
58
|
+
/** The last booked stop's building, which distances are measured from. */
|
|
59
|
+
nearBuildingId: number;
|
|
60
|
+
/** Every building already in the itinerary. */
|
|
61
|
+
excludeBuildingIds: number[];
|
|
62
|
+
}
|
|
63
|
+
export interface CommunityQuery extends CommunityFilters {
|
|
64
|
+
extend?: ExtendQuery;
|
|
65
|
+
}
|
|
66
|
+
export interface PlanRequest {
|
|
67
|
+
building_ids: number[];
|
|
68
|
+
tour_type: TourTypeId;
|
|
69
|
+
date: string;
|
|
70
|
+
start_time: string | null;
|
|
71
|
+
stop_starts: Record<string, string> | null;
|
|
72
|
+
fixed_first: {
|
|
73
|
+
calendar_event_id: number;
|
|
74
|
+
} | null;
|
|
75
|
+
}
|
|
76
|
+
export interface PlanStop {
|
|
77
|
+
building_id: number;
|
|
78
|
+
start: string;
|
|
79
|
+
end: string;
|
|
80
|
+
timezone: string;
|
|
81
|
+
distance_from_prev_mi: number | null;
|
|
82
|
+
alternatives: string[];
|
|
83
|
+
fixed: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface PlanResponse {
|
|
86
|
+
bookable_dates: string[];
|
|
87
|
+
tour_types: TourTypeId[];
|
|
88
|
+
stops: PlanStop[];
|
|
89
|
+
changed: {
|
|
90
|
+
building_id: number;
|
|
91
|
+
reason: string;
|
|
92
|
+
text: string;
|
|
93
|
+
}[];
|
|
94
|
+
unchainable: {
|
|
95
|
+
building_id: number;
|
|
96
|
+
reason: string;
|
|
97
|
+
text: string;
|
|
98
|
+
}[];
|
|
99
|
+
}
|
|
100
|
+
export declare type BookingStopRequest = {
|
|
101
|
+
existing_calendar_event_id: number;
|
|
102
|
+
} | {
|
|
103
|
+
building_id: number;
|
|
104
|
+
start: string;
|
|
105
|
+
};
|
|
106
|
+
export interface BookingContact {
|
|
107
|
+
first_name: string;
|
|
108
|
+
last_name: string;
|
|
109
|
+
email: string;
|
|
110
|
+
phone_e164: string;
|
|
111
|
+
bedrooms: number[];
|
|
112
|
+
move_in: string | null;
|
|
113
|
+
notes: string;
|
|
114
|
+
}
|
|
115
|
+
/** The attribution /v2/scheduleMe takes today, under the same names. */
|
|
116
|
+
export interface BookingAttribution {
|
|
117
|
+
lead_sources: string[];
|
|
118
|
+
lead_sources_with_timestamps: Record<string, unknown>[];
|
|
119
|
+
query_params: Record<string, string>;
|
|
120
|
+
referrer: string;
|
|
121
|
+
google_rwg_token: string | null;
|
|
122
|
+
google_referral_building_id: number | null;
|
|
123
|
+
google_environment: string | null;
|
|
124
|
+
}
|
|
125
|
+
export interface BookingRequest {
|
|
126
|
+
tour_type: TourTypeId;
|
|
127
|
+
stops: BookingStopRequest[];
|
|
128
|
+
contact: BookingContact;
|
|
129
|
+
lead_sources: BookingAttribution;
|
|
130
|
+
conversation_tracking_id: string | null;
|
|
131
|
+
cancel_existing_tours: boolean;
|
|
132
|
+
}
|
|
133
|
+
export declare type BookedStopStatus = "booked" | "existing" | "failed";
|
|
134
|
+
export interface BookedStop {
|
|
135
|
+
building_id: number;
|
|
136
|
+
calendar_event_id: number | null;
|
|
137
|
+
start: string | null;
|
|
138
|
+
end: string | null;
|
|
139
|
+
status: BookedStopStatus;
|
|
140
|
+
error: {
|
|
141
|
+
code: string;
|
|
142
|
+
message: string;
|
|
143
|
+
} | null;
|
|
144
|
+
}
|
|
145
|
+
export interface BookingResponse {
|
|
146
|
+
itinerary_id: string | null;
|
|
147
|
+
stops: BookedStop[];
|
|
148
|
+
}
|
|
149
|
+
export declare type TourApiErrorCode = "SLOT_TAKEN" | "EXISTING_TOUR" | "MAX_STOPS" | "NOT_IN_GROUP" | "INVALID_STOPS" | "RATE_LIMITED";
|
|
150
|
+
export declare class TourApiError extends Error {
|
|
151
|
+
readonly status: number;
|
|
152
|
+
readonly code: TourApiErrorCode | null;
|
|
153
|
+
constructor(status: number, code: TourApiErrorCode | null, message: string);
|
|
154
|
+
}
|
|
155
|
+
export interface TourItineraryApi {
|
|
156
|
+
getCommunities(query: CommunityQuery): Promise<CommunitiesResponse>;
|
|
157
|
+
plan(request: PlanRequest): Promise<PlanResponse>;
|
|
158
|
+
book(request: BookingRequest, idempotencyKey: string): Promise<BookingResponse>;
|
|
159
|
+
}
|
|
160
|
+
/** Query string for GET tour-communities; empty filters are left out. */
|
|
161
|
+
export declare const communitiesSearchParams: (query: CommunityQuery) => URLSearchParams;
|
|
162
|
+
export declare const createTourItineraryApi: ({ orgSlug, buildingSlug, getSessionToken, host, }: {
|
|
163
|
+
orgSlug: string;
|
|
164
|
+
buildingSlug: string;
|
|
165
|
+
getSessionToken: () => string | null;
|
|
166
|
+
host?: string | undefined;
|
|
167
|
+
}) => TourItineraryApi;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TourTypeId } from "./tourItineraryApi";
|
|
2
|
+
/** "2026-10-15T10:45:00-05:00" -> "2026-10-15" */
|
|
3
|
+
export declare const isoDate: (iso: string) => string;
|
|
4
|
+
/** "2026-10-15T10:45:00-05:00" -> "10:45" */
|
|
5
|
+
export declare const isoHourMinute: (iso: string) => string;
|
|
6
|
+
/** "14:30" -> "2:30pm" */
|
|
7
|
+
export declare const formatHourMinute: (hourMinute: string) => string;
|
|
8
|
+
/** ISO start -> "10:45am" */
|
|
9
|
+
export declare const formatTime: (iso: string) => string;
|
|
10
|
+
/** "10:00–10:30am", or "11:30am–12:00pm" across noon. */
|
|
11
|
+
export declare const formatTimeRange: (startIso: string, endIso: string) => string;
|
|
12
|
+
/** A calendar date, read as that date wherever the visitor is. */
|
|
13
|
+
export declare const dateFromIsoDate: (date: string) => Date;
|
|
14
|
+
/** "2026-10-15" -> "Thu, Oct 15" */
|
|
15
|
+
export declare const formatShortDate: (date: string) => string;
|
|
16
|
+
/** "2026-10-15" -> "Oct 15" */
|
|
17
|
+
export declare const formatMonthDay: (date: string) => string;
|
|
18
|
+
/** "2026-10-15" -> "Thu, Oct 15, 2026" */
|
|
19
|
+
export declare const formatLongDate: (date: string) => string;
|
|
20
|
+
/** A Date as the "YYYY-MM-DD" the API uses. */
|
|
21
|
+
export declare const toIsoDate: (date: Date) => string;
|
|
22
|
+
export declare const TOUR_TYPE_COPY: Record<TourTypeId, {
|
|
23
|
+
label: string;
|
|
24
|
+
subtitle: string;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const TOUR_TYPE_ORDER: TourTypeId[];
|
|
@@ -4,8 +4,6 @@ export declare class CallUsWindow extends LitElement {
|
|
|
4
4
|
connectedCallback(): void;
|
|
5
5
|
disconnectedCallback(): void;
|
|
6
6
|
private trapOverlayTab;
|
|
7
|
-
private movedFocusInside;
|
|
8
|
-
updated(): void;
|
|
9
7
|
static styles: import("lit").CSSResult[];
|
|
10
8
|
buildingSlug: string;
|
|
11
9
|
orgSlug: string;
|
|
@@ -8,8 +8,7 @@ export declare class EmailUsWindow extends LitElement {
|
|
|
8
8
|
connectedCallback(): void;
|
|
9
9
|
disconnectedCallback(): void;
|
|
10
10
|
private trapOverlayTab;
|
|
11
|
-
|
|
12
|
-
updated(): void;
|
|
11
|
+
firstUpdated(): Promise<void>;
|
|
13
12
|
static styles: import("lit").CSSResult[];
|
|
14
13
|
leadSources: string[];
|
|
15
14
|
onCloseClicked?: (e: MouseEvent) => void;
|
|
@@ -87,5 +87,10 @@ export declare class PubnubChat extends LitElement {
|
|
|
87
87
|
}
|
|
88
88
|
/** Move focus to the first control in an overlay. Returns false if there is none yet. */
|
|
89
89
|
export declare function focusFirstTabStop(container: HTMLElement): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Move focus into an overlay, to the first control in `preferred` when it has one.
|
|
92
|
+
* Leaves focus alone when the person is already on a control inside the overlay.
|
|
93
|
+
*/
|
|
94
|
+
export declare function placeFocusInside(container: HTMLElement, preferred?: HTMLElement | null): boolean;
|
|
90
95
|
/** Wrap Tab inside container when focus is already in it. No effect otherwise. */
|
|
91
96
|
export declare function trapTabInside(event: KeyboardEvent, container: HTMLElement): void;
|