@meetelise/chat 1.70.1 → 1.72.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.
@@ -1,30 +1,37 @@
1
1
  import { LitElement, TemplateResult } from "lit";
2
2
  import "../actions/action-confirm-button";
3
- import "../shared/simple-tooltip";
3
+ import "./scheduler-popover";
4
4
  import { CommunitiesResponse, CommunityFilters, CommunitySummary } from "./tourItineraryApi";
5
5
  export declare type CommunityLoader = (filters: CommunityFilters) => Promise<CommunitiesResponse>;
6
6
  /**
7
- * Lists a central group's top communities so the prospect can pick one, or, in
8
- * the "extend" variant after a booking, up to the number of stops left. Ranking
9
- * and every reason come from the server. The cards and badges are the fee
10
- * calculator's. The scheduler holds the picks; after a booking it shows them,
11
- * with Continue, in its footer (`renderSelectionTray`).
7
+ * Lists a central group's top communities so the prospect can pick one: the
8
+ * community to tour, or, in the "extend" variant after a booking, the next stop
9
+ * to add. Ranking and every reason come from the server. The cards and badges
10
+ * are the fee calculator's.
12
11
  */
13
12
  export declare class CommunityPicker extends LitElement {
14
13
  variant: "select" | "extend";
15
14
  load: CommunityLoader | null;
16
15
  /** The first, unfiltered page, when the scheduler already has it. */
17
16
  initial: CommunitiesResponse | null;
18
- /** The picks so far; a click asks for a change with `selection-change`. */
17
+ /** The pick so far, if any; a click asks for a change with `selection-change`. */
19
18
  selected: CommunitySummary[];
20
- /** How many communities may be picked: the stops left in the itinerary. */
21
- maxSelectable: number;
22
- private filters;
19
+ /**
20
+ * The prospect's filters, which the scheduler shares with its form for this
21
+ * visit; a change is reported with `filters-change`.
22
+ */
23
+ filters: CommunityFilters;
23
24
  private openFilter;
24
25
  private communities;
25
26
  private loading;
26
27
  private error;
28
+ private mobile;
27
29
  private requestId;
30
+ private cleanupMobileListener?;
31
+ connectedCallback(): void;
32
+ disconnectedCallback(): void;
33
+ /** The scheduler's unfiltered page, while no filter is set. */
34
+ private get initialPage();
28
35
  willUpdate(): void;
29
36
  firstUpdated(): void;
30
37
  private reload;
@@ -36,27 +43,14 @@ export declare class CommunityPicker extends LitElement {
36
43
  private isFilterActive;
37
44
  /** The chip's name, or the value picked once there is one. */
38
45
  private filterLabel;
46
+ /** Each filter's controls, in the panel its chip opens. */
47
+ private renderFilterPanel;
39
48
  private renderFilters;
40
49
  private renderCard;
41
50
  private renderList;
42
51
  render(): TemplateResult;
43
52
  static styles: import("lit").CSSResult[];
44
53
  }
45
- /**
46
- * The picks and Continue, in the scheduler's footer under either picker. The
47
- * scheduler renders it so the footer stays its own, as on every other step.
48
- */
49
- export declare const renderSelectionTray: ({ selected, mobile, onRemove, onContinue, }: {
50
- selected: CommunitySummary[];
51
- mobile: boolean;
52
- onRemove: (buildingId: number) => void;
53
- onContinue: () => void;
54
- }) => TemplateResult | string;
55
- /**
56
- * Styles for `renderSelectionTray`: the fee calculator's badges (its padding and
57
- * radius), without the rest of its stylesheet, which also styles `:host`.
58
- */
59
- export declare const selectionTrayStyles: import("lit").CSSResult;
60
54
  declare global {
61
55
  interface HTMLElementTagNameMap {
62
56
  "community-picker": CommunityPicker;
@@ -32,6 +32,10 @@ export declare class ItineraryEditor extends LitElement {
32
32
  single: boolean;
33
33
  /** The prospect may change which communities they tour. */
34
34
  canEditCommunities: boolean;
35
+ /** Adding stops to a booking: only the stops, as the design's itinerary. */
36
+ stopsOnly: boolean;
37
+ /** With `stopsOnly`, the itinerary has room for another stop. */
38
+ canAddStop: boolean;
35
39
  loading: boolean;
36
40
  /**
37
41
  * The server has planned these choices. Until it has, as after a failed
@@ -65,6 +69,7 @@ export declare class ItineraryEditor extends LitElement {
65
69
  private renderProblem;
66
70
  /** Several communities: the date sits under the tour type, as in the design. */
67
71
  private renderItineraryDate;
72
+ private renderStops;
68
73
  private renderItinerary;
69
74
  render(): TemplateResult;
70
75
  static styles: import("lit").CSSResult[];
@@ -0,0 +1,29 @@
1
+ import { LitElement, TemplateResult } from "lit";
2
+ /**
3
+ * A trigger and the small panel it opens, for the v2 scheduler's secondary
4
+ * choices. The panel floats under the trigger with `me-select`'s list surface
5
+ * and closes, as that list does, on a click outside it, or on Escape. With
6
+ * `inline` (phones) it opens in place instead, after its siblings in the
7
+ * parent's flex row, as the filter row always did there.
8
+ *
9
+ * The parent owns `open`; the element asks for a close with `popover-close`.
10
+ * Slot the trigger as `slot="trigger"` and the panel's content in the default
11
+ * slot, so the trigger's `aria-controls` can name an id in the parent's tree.
12
+ */
13
+ export declare class SchedulerPopover extends LitElement {
14
+ open: boolean;
15
+ inline: boolean;
16
+ connectedCallback(): void;
17
+ disconnectedCallback(): void;
18
+ private requestClose;
19
+ /** As `me-select`: a click anywhere outside, trigger included, closes it. */
20
+ private onDocumentClick;
21
+ private onKeydown;
22
+ render(): TemplateResult;
23
+ static styles: import("lit").CSSResult;
24
+ }
25
+ declare global {
26
+ interface HTMLElementTagNameMap {
27
+ "scheduler-popover": SchedulerPopover;
28
+ }
29
+ }
@@ -36,7 +36,8 @@ export declare const buildAttribution: ({ orgSlug, selectedLeadSource, currentLe
36
36
  export declare const buildBookingRequest: ({ choice, plan, contact, attribution, conversationTrackingId, cancelExistingTours, }: {
37
37
  choice: ItineraryChoice;
38
38
  plan: PlanResponse;
39
- contact: BookingContact;
39
+ /** Null when adding stops to a booking: the server already has the prospect. */
40
+ contact: BookingContact | null;
40
41
  attribution: BookingAttribution;
41
42
  conversationTrackingId: string | null;
42
43
  cancelExistingTours: boolean;
@@ -5,6 +5,7 @@ import "./contact-form";
5
5
  import "./booking-confirmation";
6
6
  import "../actions/action-confirm-button";
7
7
  import "../loaders/mega-loader";
8
+ import "../mini-loader";
8
9
  import { LabeledOption } from "../../fetchBuildingInfo";
9
10
  import type { LayoutOption } from "../../fetchBuildingWebchatView";
10
11
  import type LeadSourceClient from "../LeadSourceClient";
@@ -53,8 +54,10 @@ export declare class TourSchedulerV2 extends LitElement {
53
54
  private group;
54
55
  private communities;
55
56
  private selectedIds;
56
- /** The open picker's picks, shown in the footer until Continue. */
57
+ /** The picker's pick, marked when the prospect goes back to it. */
57
58
  private picks;
59
+ /** Adding stops: the nearby communities are open under the itinerary. */
60
+ private addingStop;
58
61
  private existingEventIds;
59
62
  private tourType;
60
63
  /** A tour type this building books on its own page, once picked. */
@@ -67,6 +70,11 @@ export declare class TourSchedulerV2 extends LitElement {
67
70
  private planError;
68
71
  private notice;
69
72
  private contact;
73
+ /**
74
+ * Bedrooms, move-in and budget, shared by both pickers' filters and the form
75
+ * (which has no budget) for as long as the widget is open.
76
+ */
77
+ private preferences;
70
78
  private submitting;
71
79
  private bookingError;
72
80
  private reschedulePrompt;
@@ -138,6 +146,19 @@ export declare class TourSchedulerV2 extends LitElement {
138
146
  */
139
147
  private extendQueryFromBooking;
140
148
  private stopsRemaining;
149
+ /**
150
+ * Another stop fits after the booked ones and those added so far, and the
151
+ * plan shown is for these stops, so the list can start after its last one.
152
+ */
153
+ private get canAddStop();
154
+ /**
155
+ * As `extendQueryFromBooking`, from the itinerary being added: times after
156
+ * its last planned stop, near it, without any community already in it.
157
+ */
158
+ private extendQueryFromPlan;
159
+ private loadAddStopCommunities;
160
+ /** One more community joins the itinerary, after the stops already in it. */
161
+ private onStopAdded;
141
162
  /** Offers more communities while the itinerary has stops left. */
142
163
  private loadExtension;
143
164
  private onBookingError;
@@ -155,6 +176,15 @@ export declare class TourSchedulerV2 extends LitElement {
155
176
  * building's layouts.
156
177
  */
157
178
  private get bedroomOptions();
179
+ /**
180
+ * The form's bedroom preference, from the shared bedrooms: the one offered
181
+ * option they name, or none when they name no offered option or several.
182
+ */
183
+ private get preferredLayout();
184
+ /** The form's values, with bedrooms and move-in from the shared preferences. */
185
+ private get formValues();
186
+ private onContactChange;
187
+ private onFiltersChange;
158
188
  /** A preference can only be required where there is one to choose. */
159
189
  private get bedroomsRequired();
160
190
  private disclaimer;
@@ -165,8 +195,10 @@ export declare class TourSchedulerV2 extends LitElement {
165
195
  * communities join the itinerary after the booking, from the confirmation.
166
196
  */
167
197
  private renderPicker;
168
- private onPicksChange;
169
- private renderTray;
198
+ /** Adding stops to a booking: the design's itinerary heading. */
199
+ private renderItineraryHeading;
200
+ /** "Add another stop": the nearby communities, under the itinerary. */
201
+ private renderAddStop;
170
202
  private renderSchedule;
171
203
  /** Today's reschedule prompt, with the server's reason. */
172
204
  private renderReschedulePrompt;
@@ -141,7 +141,8 @@ export interface BookingAttribution {
141
141
  export interface BookingRequest {
142
142
  tour_type: TourTypeId;
143
143
  stops: BookingStopRequest[];
144
- contact: BookingContact;
144
+ /** Left out when adding stops to a booking, which books into its conversation. */
145
+ contact?: BookingContact;
145
146
  lead_sources: BookingAttribution;
146
147
  conversation_tracking_id: string | null;
147
148
  cancel_existing_tours: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.70.1",
3
+ "version": "1.72.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/MeetElise/chat-ui#readme",