@wix/himalaya-cli 0.1641.0 → 0.1643.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/cli.mjs +327 -155
- package/guides/himi-json-output.md +20 -1
- package/guides/qa-builds.md +33 -0
- package/package.json +2 -2
- package/template-icons/conference.png +0 -0
- package/templates/branded-lite/dev/index.ts +152 -88
- package/templates/branded-lite/l10n/en.json +1 -1
- package/templates/branded-lite/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +93 -11
- package/templates/community-club/dev/index.ts +152 -88
- package/templates/community-club/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/community-club/tier5-src/himi-events-detail/index.ts +93 -11
- package/templates/conference/README.md +53 -0
- package/templates/conference/config.ts +321 -0
- package/templates/conference/dev/index.ts +17252 -0
- package/templates/conference/himalaya.content.json +46 -0
- package/templates/conference/himalaya.template.json +15 -0
- package/templates/conference/icon.png +0 -0
- package/templates/conference/platforms.json +1 -0
- package/templates/conference/tier5-src/_shared/agenda-stars.ts +64 -0
- package/templates/conference/tier5-src/_shared/app-locale.ts +61 -0
- package/templates/conference/tier5-src/_shared/branded-lite-hosted.ts +279 -0
- package/templates/conference/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/conference/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/conference/tier5-src/_shared/business-chat-history.ts +51 -0
- package/templates/conference/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/conference/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/conference/tier5-src/_shared/business-chat-presenter.ts +576 -0
- package/templates/conference/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/conference/tier5-src/_shared/collection-contract.ts +229 -0
- package/templates/conference/tier5-src/_shared/collection-query.ts +193 -0
- package/templates/conference/tier5-src/_shared/collection-service.ts +400 -0
- package/templates/conference/tier5-src/_shared/engine-intl.ts +508 -0
- package/templates/conference/tier5-src/_shared/event-agenda.ts +122 -0
- package/templates/conference/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/conference/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/conference/tier5-src/_shared/himi-account.ts +164 -0
- package/templates/conference/tier5-src/_shared/himi-copy.ts +89 -0
- package/templates/conference/tier5-src/_shared/himi-events.ts +65 -0
- package/templates/conference/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/conference/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/conference/tier5-src/_shared/iap-attendance-form.ts +106 -0
- package/templates/conference/tier5-src/_shared/iap-attendance-purchase.ts +211 -0
- package/templates/conference/tier5-src/_shared/iap-attendance.ts +38 -0
- package/templates/conference/tier5-src/_shared/iap-worker.ts +125 -0
- package/templates/conference/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/conference/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/conference/tier5-src/_shared/member-access.ts +52 -0
- package/templates/conference/tier5-src/_shared/member-account-routes.ts +52 -0
- package/templates/conference/tier5-src/_shared/member-read.ts +52 -0
- package/templates/conference/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/conference/tier5-src/_shared/offset-page.ts +10 -0
- package/templates/conference/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/conference/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/conference/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/conference/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/conference/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/conference/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/conference/tier5-src/business-chat/index.ts +724 -0
- package/templates/conference/tier5-src/himi-conference-agenda/index.ts +183 -0
- package/templates/conference/tier5-src/himi-conference-home/index.ts +389 -0
- package/templates/conference/tier5-src/himi-events-account/index.ts +219 -0
- package/templates/conference/tier5-src/himi-events-detail/index.ts +1304 -0
- package/templates/conference/tier5-src/himi-events-list/index.ts +124 -0
- package/templates/conference/tier5-src/himi-events-my-events/index.ts +225 -0
- package/templates/conference/tier5-src/himi-events-rsvp/index.ts +230 -0
- package/templates/conference/tier5-src/himi-store-account/index.ts +998 -0
- package/templates/conference/tokens.json +365 -0
- package/templates/events-meetups/dev/index.ts +152 -88
- package/templates/events-meetups/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +93 -11
- package/templates/gym-fitness/dev/index.ts +152 -88
- package/templates/gym-fitness/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +93 -11
- package/templates/nonprofit-cause/dev/index.ts +152 -88
- package/templates/nonprofit-cause/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +93 -11
- package/templates/podcast-creator/dev/index.ts +152 -88
- package/templates/podcast-creator/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +93 -11
- package/templates/portfolio-creative/dev/index.ts +152 -88
- package/templates/portfolio-creative/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +93 -11
- package/templates/restaurant/dev/index.ts +152 -88
- package/templates/restaurant/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/restaurant/tier5-src/himi-events-detail/index.ts +93 -11
- package/templates/yoga-studio/dev/index.ts +152 -88
- package/templates/yoga-studio/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +93 -11
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
type EventRow,
|
|
36
36
|
} from "../_shared/himi-events";
|
|
37
37
|
import { stashCopy, copyParam } from "../_shared/himi-copy.js";
|
|
38
|
+
import { readFeaturedEvent } from "../_shared/featured-event.js";
|
|
38
39
|
import { eventPageUrlOf, eventStatus, registrationKindOf, registrationUi, registrationUrlOf, type RegistrationKind } from "../_shared/event-registration.js";
|
|
39
40
|
export { eventPageUrlOf, registrationKindOf, registrationUrlOf, type RegistrationKind };
|
|
40
41
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
@@ -88,6 +89,8 @@ interface TicketTierRow {
|
|
|
88
89
|
rowLimit?: number;
|
|
89
90
|
noPolicy?: boolean;
|
|
90
91
|
notAvailable?: boolean;
|
|
92
|
+
/** Its "Ticket terms" disclosure is open (`toggleDisclosure` with `terms:<id>`). */
|
|
93
|
+
termsOpen?: boolean;
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
// Offline-first (data-offline): the event detail is a read-through single-item read —
|
|
@@ -194,6 +197,13 @@ interface S extends AttendancePurchaseFields {
|
|
|
194
197
|
/** Buyer-visible ticket tiers for a ticketed event (empty otherwise). Loaded
|
|
195
198
|
* alongside the event so the price is on screen BEFORE the CTA is tapped. */
|
|
196
199
|
ticketTiers: TicketTierRow[];
|
|
200
|
+
/** The ids of the open disclosures: "fullSchedule", "allDates", "policies", `terms:<tier id>`.
|
|
201
|
+
* A DisclosureGroup is worker-controlled on every renderer (`expandedPath` + `onToggle`):
|
|
202
|
+
* one with neither never opens. */
|
|
203
|
+
openDisclosures: string[];
|
|
204
|
+
fullScheduleOpen: boolean;
|
|
205
|
+
allDatesOpen: boolean;
|
|
206
|
+
policiesOpen: boolean;
|
|
197
207
|
ticketCurrency: string;
|
|
198
208
|
ticketLimitPerOrder: number;
|
|
199
209
|
ticketPurchaseBlocked: boolean;
|
|
@@ -232,6 +242,15 @@ function inputId(): string {
|
|
|
232
242
|
return currentInputId(["himi_event_"]);
|
|
233
243
|
}
|
|
234
244
|
|
|
245
|
+
/** `featured: "1"` (an onAppear param): a screen with no event id — a conference app's Tickets
|
|
246
|
+
* tab — shows the site's featured event (the one on now, else the next to start). */
|
|
247
|
+
const featuredRequested = (arg: unknown): boolean => (arg as { featured?: unknown } | undefined)?.featured === "1";
|
|
248
|
+
// The last featured open found no live or upcoming event: the empty state says so, not "not found".
|
|
249
|
+
let noFeaturedEvent = false;
|
|
250
|
+
// This worker serves a featured screen: set by the first `featured` onAppear, kept for its Retry
|
|
251
|
+
// (the retry block's load carries no params, and must read the featured event again).
|
|
252
|
+
let featuredMode = false;
|
|
253
|
+
|
|
235
254
|
/** Money for a tier, or the free label. */
|
|
236
255
|
function tierPrice(t: WixAvailableTicket): string {
|
|
237
256
|
const raw = t.price?.amount;
|
|
@@ -333,11 +352,12 @@ function derive(s: S): S {
|
|
|
333
352
|
const hasContent = !!s.title;
|
|
334
353
|
const count = s.ticketTiers.reduce((n, row) => n + (row.quantity ?? 0), 0);
|
|
335
354
|
const total = s.ticketTiers.reduce((n, row) => n + (row.isGuestPrice ? Number(row.guestPrice || row.minPrice || 0) : row.priceAmount ?? 0) * (row.quantity ?? 0), 0);
|
|
355
|
+
const open = new Set(s.openDisclosures ?? []);
|
|
336
356
|
const ticketTiers = s.ticketTiers.map((row) => {
|
|
337
357
|
const definitionId = row.ticketDefinitionId ?? row.id;
|
|
338
358
|
const sameDefinitionElsewhere = s.ticketTiers.reduce((n, other) => n + ((other.ticketDefinitionId ?? other.id) === definitionId && other.id !== row.id ? other.quantity ?? 0 : 0), 0);
|
|
339
359
|
const selectedElsewhere = s.ticketTiers.reduce((n, other) => n + (other.id === row.id ? 0 : other.quantity ?? 0), 0);
|
|
340
|
-
return { ...row, maxQuantity: Math.max(0, Math.min((row.rowLimit ?? 99) - sameDefinitionElsewhere, s.ticketLimitPerOrder - selectedElsewhere)) };
|
|
360
|
+
return { ...row, termsOpen: open.has(`terms:${row.id}`), maxQuantity: Math.max(0, Math.min((row.rowLimit ?? 99) - sameDefinitionElsewhere, s.ticketLimitPerOrder - selectedElsewhere)) };
|
|
341
361
|
});
|
|
342
362
|
const chosenRows = s.ticketTiers.filter((row) => (row.quantity ?? 0) > 0);
|
|
343
363
|
const singleTicketSelected = chosenRows.length === 1 && chosenRows[0]!.quantity === 1;
|
|
@@ -405,6 +425,10 @@ function derive(s: S): S {
|
|
|
405
425
|
noFullSchedule: s.fullSchedule.length === 0,
|
|
406
426
|
noMoreDates: s.moreDates.length === 0,
|
|
407
427
|
noAllDates: s.allDates.length === 0,
|
|
428
|
+
openDisclosures: [...open],
|
|
429
|
+
fullScheduleOpen: open.has("fullSchedule"),
|
|
430
|
+
allDatesOpen: open.has("allDates"),
|
|
431
|
+
policiesOpen: open.has("policies"),
|
|
408
432
|
isLoading: s.status === "loading",
|
|
409
433
|
notLoading: s.status !== "loading",
|
|
410
434
|
notErrored: !s.errored,
|
|
@@ -413,7 +437,9 @@ function derive(s: S): S {
|
|
|
413
437
|
? ""
|
|
414
438
|
: (s.errored
|
|
415
439
|
? copyParam("event.errorText", "Event could not be loaded.")
|
|
416
|
-
:
|
|
440
|
+
: noFeaturedEvent
|
|
441
|
+
? copyParam("event.noUpcomingText", "No upcoming event.")
|
|
442
|
+
: copyParam("event.notFoundText", "Event not found.")),
|
|
417
443
|
};
|
|
418
444
|
return next;
|
|
419
445
|
}
|
|
@@ -552,6 +578,7 @@ type DetailActions = {
|
|
|
552
578
|
openMap: (s: S) => Promise<S>;
|
|
553
579
|
openTickets: (s: S) => Promise<S | undefined>;
|
|
554
580
|
closeTickets: (s: S) => S;
|
|
581
|
+
toggleDisclosure: (s: S, arg?: unknown) => S;
|
|
555
582
|
setQuantity: (s: S, arg?: unknown) => Promise<S | undefined>;
|
|
556
583
|
setGuestPrice: (s: S, arg?: unknown) => S;
|
|
557
584
|
checkout: (s: S) => Promise<S | undefined>;
|
|
@@ -572,9 +599,10 @@ type DetailActions = {
|
|
|
572
599
|
iapRefresh: (s: S) => Promise<S>;
|
|
573
600
|
iapPoll: (s: S) => Promise<S>;
|
|
574
601
|
};
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
602
|
+
/** The state before any event is read — also where a featured open starts when it finds no event,
|
|
603
|
+
* or a different one, so nothing of the previous event (its footer, tiers, About) carries over. */
|
|
604
|
+
function bootState(): S {
|
|
605
|
+
return derive({
|
|
578
606
|
...ATTENDANCE_INITIAL,
|
|
579
607
|
status: "loading",
|
|
580
608
|
id: inputId(),
|
|
@@ -630,6 +658,10 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
630
658
|
noAllDates: true,
|
|
631
659
|
policies: [],
|
|
632
660
|
noPolicies: true,
|
|
661
|
+
openDisclosures: [],
|
|
662
|
+
fullScheduleOpen: false,
|
|
663
|
+
allDatesOpen: false,
|
|
664
|
+
policiesOpen: false,
|
|
633
665
|
description: "",
|
|
634
666
|
descriptionJson: "",
|
|
635
667
|
hasDescriptionJson: false,
|
|
@@ -676,7 +708,12 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
676
708
|
isLoading: true,
|
|
677
709
|
notLoading: false,
|
|
678
710
|
noEmpty: true,
|
|
679
|
-
})
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S, DetailActions>("himiEventDetail", {
|
|
715
|
+
notHydrated: [...ATTENDANCE_NOT_HYDRATED, "ticketPurchaseBlocked", "ticketSheetOpen", "rsvpActionsOpen", "cancelConfirmOpen", "rsvpId", "rsvpState", "rsvpLabel"],
|
|
716
|
+
state: bootState(),
|
|
680
717
|
actions: {
|
|
681
718
|
openTickets: async (s) => {
|
|
682
719
|
if (s.ticketTiers.length) return derive({ ...s, ticketSheetOpen: true });
|
|
@@ -691,6 +728,18 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
691
728
|
return ticketSelectionState;
|
|
692
729
|
},
|
|
693
730
|
closeTickets: (s) => derive({ ...s, ticketSheetOpen: false }),
|
|
731
|
+
// Open or close one disclosure by its id (see `openDisclosures`).
|
|
732
|
+
toggleDisclosure: (s, arg) => {
|
|
733
|
+
const base = String((arg as { id?: unknown } | undefined)?.id ?? "");
|
|
734
|
+
// A row's disclosure names its row in its own param: the web renderer substitutes a whole
|
|
735
|
+
// `$item.` value only, never one inside a longer string ("terms:$item.id").
|
|
736
|
+
const row = String((arg as { tier?: unknown } | undefined)?.tier ?? "");
|
|
737
|
+
const id = base && row ? `${base}:${row}` : base;
|
|
738
|
+
if (!id) return s;
|
|
739
|
+
const open = new Set(s.openDisclosures ?? []);
|
|
740
|
+
if (open.has(id)) open.delete(id); else open.add(id);
|
|
741
|
+
return derive({ ...s, openDisclosures: [...open] });
|
|
742
|
+
},
|
|
694
743
|
openRsvpActions: (s) => derive({ ...s, rsvpActionsOpen: true, cancelConfirmOpen: false, snackbarMessage: "" }),
|
|
695
744
|
closeRsvpActions: (s) => derive({ ...s, rsvpActionsOpen: false, cancelConfirmOpen: false }),
|
|
696
745
|
beginCancelRsvp: (s) => derive({ ...s, cancelConfirmOpen: !!s.rsvpId, snackbarMessage: "" }),
|
|
@@ -960,10 +1009,29 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
960
1009
|
ticketCheckoutDenied = false;
|
|
961
1010
|
ticketSelectionState = undefined;
|
|
962
1011
|
lastReady = undefined;
|
|
963
|
-
s = { ...s, ticketSheetOpen: false, rsvpActionsOpen: false, cancelConfirmOpen: false, rsvpId: "", rsvpState: "none", rsvpLabel: "" };
|
|
1012
|
+
s = { ...s, ticketSheetOpen: false, rsvpActionsOpen: false, cancelConfirmOpen: false, rsvpId: "", rsvpState: "none", rsvpLabel: "", openDisclosures: [] };
|
|
964
1013
|
applePurchase.invalidate();
|
|
965
1014
|
stashCopy(arg);
|
|
966
|
-
|
|
1015
|
+
let id = s.id || inputId();
|
|
1016
|
+
noFeaturedEvent = false;
|
|
1017
|
+
// A featured screen resolves its event on every load — each appear, and its Retry — since the
|
|
1018
|
+
// site's next event may have changed.
|
|
1019
|
+
if (featuredRequested(arg)) featuredMode = true;
|
|
1020
|
+
if (featuredMode && !inputId()) {
|
|
1021
|
+
const featured = await readFeaturedEvent(["DETAILS"]);
|
|
1022
|
+
if (selectionVersion !== ticketSelectionVersion) return undefined;
|
|
1023
|
+
// A failed read is a clean error: the last event's image, About, schedule and tiers must not
|
|
1024
|
+
// stay on screen under the Retry card (the loaded content hides only while loading).
|
|
1025
|
+
if (!featured.ok) return derive({ ...bootState(), id: "", status: "ready", errored: true, title: "" });
|
|
1026
|
+
if (!featured.event?.id) {
|
|
1027
|
+
noFeaturedEvent = true;
|
|
1028
|
+
return derive({ ...bootState(), id: "", status: "ready", errored: false, title: "" });
|
|
1029
|
+
}
|
|
1030
|
+
id = featured.event.id;
|
|
1031
|
+
// Another event than the one on screen starts clean: its offline fallback must not keep the
|
|
1032
|
+
// previous event's About, schedule or policies.
|
|
1033
|
+
s = s.id === id ? s : { ...bootState(), id };
|
|
1034
|
+
}
|
|
967
1035
|
if (!id) return derive({ ...s, status: "ready", errored: true });
|
|
968
1036
|
try {
|
|
969
1037
|
// TEXTS adds the Ricos `description` to the base fieldset (a bare read returns none);
|
|
@@ -1002,13 +1070,23 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
1002
1070
|
const memberProbeNeeded = kind === "rsvp" || rawEvent.registration?.allowedGuestTypes === "MEMBER";
|
|
1003
1071
|
const isMember = memberProbeNeeded ? await signedInMember() : false;
|
|
1004
1072
|
const [scheduleResponse, policyResponse, rsvpResponse] = await Promise.all([
|
|
1005
|
-
|
|
1073
|
+
// `limit` is required: without it Wix answers the agenda's `total` with an EMPTY `items`.
|
|
1074
|
+
rawEvent.agendaSettings?.enabled ? bestEffort("GET", `/events/v1/schedule?eventId=${encodeURIComponent(id)}&limit=100`) : undefined,
|
|
1006
1075
|
bestEffort("POST", "/events-policies/v2/policies/query", { query: { filter: { eventId: { $eq: id } }, paging: { limit: 100 } } }),
|
|
1007
1076
|
kind === "rsvp" && isMember ? bestEffort("GET", `/events/v2/rsvps/current?eventId=${encodeURIComponent(id)}`) : undefined,
|
|
1008
1077
|
]);
|
|
1009
1078
|
let optionalReadFailed = [scheduleResponse, policyResponse, rsvpResponse].some((response) => response?.ok === false);
|
|
1010
1079
|
const scheduleRaw = (scheduleResponse?.ok ? scheduleResponse.value : undefined) as { agenda?: Array<Record<string, unknown>>; schedule?: Array<Record<string, unknown>>; items?: Array<Record<string, unknown>>; agendaItems?: Array<Record<string, unknown>> } | undefined;
|
|
1011
|
-
|
|
1080
|
+
// A hidden or canceled session is not on the agenda, and an item id is listed once (an owner's
|
|
1081
|
+
// read carries a draft and its published copy); sessions in start order.
|
|
1082
|
+
const seenItems = new Set<string>();
|
|
1083
|
+
const scheduleSource = (scheduleRaw?.agenda ?? scheduleRaw?.agendaItems ?? scheduleRaw?.schedule ?? scheduleRaw?.items ?? [])
|
|
1084
|
+
.filter((item) => item.hidden !== true && String(item.status ?? "").toUpperCase() !== "CANCELED")
|
|
1085
|
+
.filter((item) => { const key = String(item.id ?? ""); if (!key) return true; if (seenItems.has(key)) return false; seenItems.add(key); return true; })
|
|
1086
|
+
.map((item) => ({ item, at: Date.parse(String((item.timeSlot as { start?: string } | undefined)?.start ?? item.startTime ?? item.startDate ?? "")) }))
|
|
1087
|
+
.sort((a, b) => (Number.isNaN(a.at) ? Infinity : a.at) - (Number.isNaN(b.at) ? Infinity : b.at))
|
|
1088
|
+
.map(({ item }) => item);
|
|
1089
|
+
const fullSchedule = scheduleSource.map((item) => {
|
|
1012
1090
|
const slot = item.timeSlot as { start?: string; end?: string; timeZoneId?: string } | undefined;
|
|
1013
1091
|
const start = String(slot?.start ?? item.startTime ?? item.startDate ?? item.time ?? "");
|
|
1014
1092
|
const date = start ? new Date(start) : undefined;
|
|
@@ -1218,5 +1296,9 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
1218
1296
|
},
|
|
1219
1297
|
});
|
|
1220
1298
|
resetUnhydratedKeysOnOlderRuntime(svc, { ...svc.getState(), ...ATTENDANCE_INITIAL, ticketPurchaseBlocked: true, ticketSheetOpen: false, rsvpActionsOpen: false, cancelConfirmOpen: false, rsvpId: "", rsvpState: "none", rsvpLabel: "" }, [...ATTENDANCE_NOT_HYDRATED, "ticketPurchaseBlocked", "ticketSheetOpen", "rsvpActionsOpen", "cancelConfirmOpen", "rsvpId", "rsvpState", "rsvpLabel"]);
|
|
1221
|
-
|
|
1299
|
+
// The boot load needs an event id. Without one it could only answer "not found" — and on a
|
|
1300
|
+
// screen that finds its event itself (`featured`, a conference app's Tickets tab) that error
|
|
1301
|
+
// showed for the whole featured read, seconds on web, instead of the skeleton. The screen's
|
|
1302
|
+
// onAppear load decides an id-less open: the featured event, or the error.
|
|
1303
|
+
if (inputId()) svc.load();
|
|
1222
1304
|
export { svc };
|
|
@@ -12122,6 +12122,7 @@ const SCREENS = runtimeSetting({
|
|
|
12122
12122
|
"type": "HStack",
|
|
12123
12123
|
"props": {
|
|
12124
12124
|
"spacing": 10,
|
|
12125
|
+
"alignment": "center",
|
|
12125
12126
|
"children": [
|
|
12126
12127
|
{
|
|
12127
12128
|
"id": "",
|
|
@@ -12135,7 +12136,8 @@ const SCREENS = runtimeSetting({
|
|
|
12135
12136
|
}
|
|
12136
12137
|
},
|
|
12137
12138
|
"modifiers": {
|
|
12138
|
-
"accessibilityRole": "decorative"
|
|
12139
|
+
"accessibilityRole": "decorative",
|
|
12140
|
+
"hiddenPath": "$service:himiMyEvents.signInRequired"
|
|
12139
12141
|
}
|
|
12140
12142
|
},
|
|
12141
12143
|
{
|
|
@@ -12147,6 +12149,39 @@ const SCREENS = runtimeSetting({
|
|
|
12147
12149
|
"text": "Something did not load.",
|
|
12148
12150
|
"style": "bodyEmphasis"
|
|
12149
12151
|
}
|
|
12152
|
+
},
|
|
12153
|
+
"modifiers": {
|
|
12154
|
+
"hiddenPath": "$service:himiMyEvents.signInRequired"
|
|
12155
|
+
}
|
|
12156
|
+
},
|
|
12157
|
+
{
|
|
12158
|
+
"id": "",
|
|
12159
|
+
"body": {
|
|
12160
|
+
"package": "himalaya",
|
|
12161
|
+
"type": "Icon",
|
|
12162
|
+
"props": {
|
|
12163
|
+
"name": "person",
|
|
12164
|
+
"size": 18,
|
|
12165
|
+
"tint": "textSecondary"
|
|
12166
|
+
}
|
|
12167
|
+
},
|
|
12168
|
+
"modifiers": {
|
|
12169
|
+
"accessibilityRole": "decorative",
|
|
12170
|
+
"hiddenPath": "$service:himiMyEvents.noSignIn"
|
|
12171
|
+
}
|
|
12172
|
+
},
|
|
12173
|
+
{
|
|
12174
|
+
"id": "",
|
|
12175
|
+
"body": {
|
|
12176
|
+
"package": "himalaya",
|
|
12177
|
+
"type": "Text",
|
|
12178
|
+
"props": {
|
|
12179
|
+
"text": "Sign in to see your events.",
|
|
12180
|
+
"style": "bodyEmphasis"
|
|
12181
|
+
}
|
|
12182
|
+
},
|
|
12183
|
+
"modifiers": {
|
|
12184
|
+
"hiddenPath": "$service:himiMyEvents.noSignIn"
|
|
12150
12185
|
}
|
|
12151
12186
|
}
|
|
12152
12187
|
]
|
|
@@ -20900,12 +20935,19 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
20900
20935
|
}
|
|
20901
20936
|
},
|
|
20902
20937
|
{
|
|
20903
|
-
"id": "",
|
|
20938
|
+
"id": "himi_event.full_schedule",
|
|
20904
20939
|
"body": {
|
|
20905
20940
|
"package": "himalaya",
|
|
20906
20941
|
"type": "DisclosureGroup",
|
|
20907
20942
|
"props": {
|
|
20908
20943
|
"title": "See Full Schedule",
|
|
20944
|
+
"expandedPath": "$service:himiEventDetail.fullScheduleOpen",
|
|
20945
|
+
"onToggle": {
|
|
20946
|
+
"actionId": "tier5.himiEventDetail.toggleDisclosure",
|
|
20947
|
+
"params": {
|
|
20948
|
+
"id": "fullSchedule"
|
|
20949
|
+
}
|
|
20950
|
+
},
|
|
20909
20951
|
"content": [
|
|
20910
20952
|
{
|
|
20911
20953
|
"id": "",
|
|
@@ -21091,12 +21133,19 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
21091
21133
|
}
|
|
21092
21134
|
},
|
|
21093
21135
|
{
|
|
21094
|
-
"id": "",
|
|
21136
|
+
"id": "himi_event.all_dates",
|
|
21095
21137
|
"body": {
|
|
21096
21138
|
"package": "himalaya",
|
|
21097
21139
|
"type": "DisclosureGroup",
|
|
21098
21140
|
"props": {
|
|
21099
21141
|
"title": "See All Dates",
|
|
21142
|
+
"expandedPath": "$service:himiEventDetail.allDatesOpen",
|
|
21143
|
+
"onToggle": {
|
|
21144
|
+
"actionId": "tier5.himiEventDetail.toggleDisclosure",
|
|
21145
|
+
"params": {
|
|
21146
|
+
"id": "allDates"
|
|
21147
|
+
}
|
|
21148
|
+
},
|
|
21100
21149
|
"content": [
|
|
21101
21150
|
{
|
|
21102
21151
|
"id": "",
|
|
@@ -21192,6 +21241,13 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
21192
21241
|
"type": "DisclosureGroup",
|
|
21193
21242
|
"props": {
|
|
21194
21243
|
"title": "Policies",
|
|
21244
|
+
"expandedPath": "$service:himiEventDetail.policiesOpen",
|
|
21245
|
+
"onToggle": {
|
|
21246
|
+
"actionId": "tier5.himiEventDetail.toggleDisclosure",
|
|
21247
|
+
"params": {
|
|
21248
|
+
"id": "policies"
|
|
21249
|
+
}
|
|
21250
|
+
},
|
|
21195
21251
|
"content": [
|
|
21196
21252
|
{
|
|
21197
21253
|
"id": "",
|
|
@@ -21340,8 +21396,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
21340
21396
|
"props": {
|
|
21341
21397
|
"presentedPath": "$service:himiEventDetail.ticketSheetOpen",
|
|
21342
21398
|
"detents": [
|
|
21343
|
-
0.
|
|
21344
|
-
0.9
|
|
21399
|
+
0.62
|
|
21345
21400
|
],
|
|
21346
21401
|
"showGrabber": true,
|
|
21347
21402
|
"dismissible": true,
|
|
@@ -21411,6 +21466,89 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
21411
21466
|
}
|
|
21412
21467
|
}
|
|
21413
21468
|
},
|
|
21469
|
+
{
|
|
21470
|
+
"id": "himi_event.ticket_summary",
|
|
21471
|
+
"body": {
|
|
21472
|
+
"package": "himalaya",
|
|
21473
|
+
"type": "VStack",
|
|
21474
|
+
"props": {
|
|
21475
|
+
"spacing": 8,
|
|
21476
|
+
"children": [
|
|
21477
|
+
{
|
|
21478
|
+
"id": "",
|
|
21479
|
+
"body": {
|
|
21480
|
+
"package": "himalaya",
|
|
21481
|
+
"type": "Text",
|
|
21482
|
+
"props": {
|
|
21483
|
+
"text": "$service:himiEventDetail.ticketCountLabel",
|
|
21484
|
+
"style": "caption",
|
|
21485
|
+
"color": "textSecondary"
|
|
21486
|
+
}
|
|
21487
|
+
}
|
|
21488
|
+
},
|
|
21489
|
+
{
|
|
21490
|
+
"id": "",
|
|
21491
|
+
"body": {
|
|
21492
|
+
"package": "himalaya",
|
|
21493
|
+
"type": "HStack",
|
|
21494
|
+
"props": {
|
|
21495
|
+
"spacing": 12,
|
|
21496
|
+
"alignment": "center",
|
|
21497
|
+
"children": [
|
|
21498
|
+
{
|
|
21499
|
+
"id": "",
|
|
21500
|
+
"body": {
|
|
21501
|
+
"package": "himalaya",
|
|
21502
|
+
"type": "Text",
|
|
21503
|
+
"props": {
|
|
21504
|
+
"text": "$service:himiEventDetail.ticketTotal",
|
|
21505
|
+
"style": "title3",
|
|
21506
|
+
"monospacedDigits": true
|
|
21507
|
+
}
|
|
21508
|
+
}
|
|
21509
|
+
},
|
|
21510
|
+
{
|
|
21511
|
+
"id": "",
|
|
21512
|
+
"body": {
|
|
21513
|
+
"package": "himalaya",
|
|
21514
|
+
"type": "Spacer",
|
|
21515
|
+
"props": {}
|
|
21516
|
+
}
|
|
21517
|
+
},
|
|
21518
|
+
{
|
|
21519
|
+
"id": "himi_event.checkout",
|
|
21520
|
+
"body": {
|
|
21521
|
+
"package": "himalaya",
|
|
21522
|
+
"type": "Button",
|
|
21523
|
+
"props": {
|
|
21524
|
+
"title": "Checkout",
|
|
21525
|
+
"style": "primary",
|
|
21526
|
+
"disabledPath": "$service:himiEventDetail.checkoutDisabled",
|
|
21527
|
+
"action": {
|
|
21528
|
+
"actionId": "tier5.himiEventDetail.checkout"
|
|
21529
|
+
}
|
|
21530
|
+
}
|
|
21531
|
+
}
|
|
21532
|
+
}
|
|
21533
|
+
]
|
|
21534
|
+
}
|
|
21535
|
+
}
|
|
21536
|
+
},
|
|
21537
|
+
{
|
|
21538
|
+
"id": "",
|
|
21539
|
+
"body": {
|
|
21540
|
+
"package": "himalaya",
|
|
21541
|
+
"type": "Divider",
|
|
21542
|
+
"props": {}
|
|
21543
|
+
}
|
|
21544
|
+
}
|
|
21545
|
+
]
|
|
21546
|
+
}
|
|
21547
|
+
},
|
|
21548
|
+
"modifiers": {
|
|
21549
|
+
"hiddenPath": "$service:himiEventDetail.regularTicketsHidden"
|
|
21550
|
+
}
|
|
21551
|
+
},
|
|
21414
21552
|
{
|
|
21415
21553
|
"id": "",
|
|
21416
21554
|
"body": {
|
|
@@ -21510,12 +21648,20 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
21510
21648
|
}
|
|
21511
21649
|
},
|
|
21512
21650
|
{
|
|
21513
|
-
"id": "",
|
|
21651
|
+
"id": "himi_event.ticket_terms",
|
|
21514
21652
|
"body": {
|
|
21515
21653
|
"package": "himalaya",
|
|
21516
21654
|
"type": "DisclosureGroup",
|
|
21517
21655
|
"props": {
|
|
21518
21656
|
"title": "Ticket terms",
|
|
21657
|
+
"expandedPath": "$item.termsOpen",
|
|
21658
|
+
"onToggle": {
|
|
21659
|
+
"actionId": "tier5.himiEventDetail.toggleDisclosure",
|
|
21660
|
+
"params": {
|
|
21661
|
+
"id": "terms",
|
|
21662
|
+
"tier": "$item.id"
|
|
21663
|
+
}
|
|
21664
|
+
},
|
|
21519
21665
|
"content": [
|
|
21520
21666
|
{
|
|
21521
21667
|
"id": "",
|
|
@@ -22030,88 +22176,6 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
22030
22176
|
"modifiers": {
|
|
22031
22177
|
"hiddenPath": "$service:himiEventDetail.iapBuyHidden"
|
|
22032
22178
|
}
|
|
22033
|
-
},
|
|
22034
|
-
{
|
|
22035
|
-
"id": "",
|
|
22036
|
-
"body": {
|
|
22037
|
-
"package": "himalaya",
|
|
22038
|
-
"type": "VStack",
|
|
22039
|
-
"props": {
|
|
22040
|
-
"spacing": 8,
|
|
22041
|
-
"children": [
|
|
22042
|
-
{
|
|
22043
|
-
"id": "",
|
|
22044
|
-
"body": {
|
|
22045
|
-
"package": "himalaya",
|
|
22046
|
-
"type": "Divider",
|
|
22047
|
-
"props": {}
|
|
22048
|
-
}
|
|
22049
|
-
},
|
|
22050
|
-
{
|
|
22051
|
-
"id": "",
|
|
22052
|
-
"body": {
|
|
22053
|
-
"package": "himalaya",
|
|
22054
|
-
"type": "Text",
|
|
22055
|
-
"props": {
|
|
22056
|
-
"text": "$service:himiEventDetail.ticketCountLabel",
|
|
22057
|
-
"style": "caption",
|
|
22058
|
-
"color": "textSecondary"
|
|
22059
|
-
}
|
|
22060
|
-
}
|
|
22061
|
-
},
|
|
22062
|
-
{
|
|
22063
|
-
"id": "",
|
|
22064
|
-
"body": {
|
|
22065
|
-
"package": "himalaya",
|
|
22066
|
-
"type": "HStack",
|
|
22067
|
-
"props": {
|
|
22068
|
-
"spacing": 12,
|
|
22069
|
-
"children": [
|
|
22070
|
-
{
|
|
22071
|
-
"id": "",
|
|
22072
|
-
"body": {
|
|
22073
|
-
"package": "himalaya",
|
|
22074
|
-
"type": "Text",
|
|
22075
|
-
"props": {
|
|
22076
|
-
"text": "$service:himiEventDetail.ticketTotal",
|
|
22077
|
-
"style": "title3",
|
|
22078
|
-
"monospacedDigits": true
|
|
22079
|
-
}
|
|
22080
|
-
}
|
|
22081
|
-
},
|
|
22082
|
-
{
|
|
22083
|
-
"id": "",
|
|
22084
|
-
"body": {
|
|
22085
|
-
"package": "himalaya",
|
|
22086
|
-
"type": "Spacer",
|
|
22087
|
-
"props": {}
|
|
22088
|
-
}
|
|
22089
|
-
},
|
|
22090
|
-
{
|
|
22091
|
-
"id": "btn_tier5_himieventdetail_checkout",
|
|
22092
|
-
"body": {
|
|
22093
|
-
"package": "himalaya",
|
|
22094
|
-
"type": "Button",
|
|
22095
|
-
"props": {
|
|
22096
|
-
"title": "Checkout",
|
|
22097
|
-
"style": "primary",
|
|
22098
|
-
"disabledPath": "$service:himiEventDetail.checkoutDisabled",
|
|
22099
|
-
"action": {
|
|
22100
|
-
"actionId": "tier5.himiEventDetail.checkout"
|
|
22101
|
-
}
|
|
22102
|
-
}
|
|
22103
|
-
}
|
|
22104
|
-
}
|
|
22105
|
-
]
|
|
22106
|
-
}
|
|
22107
|
-
}
|
|
22108
|
-
}
|
|
22109
|
-
]
|
|
22110
|
-
}
|
|
22111
|
-
},
|
|
22112
|
-
"modifiers": {
|
|
22113
|
-
"hiddenPath": "$service:himiEventDetail.regularTicketsHidden"
|
|
22114
|
-
}
|
|
22115
22179
|
}
|
|
22116
22180
|
]
|
|
22117
22181
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// The site's featured event: the one on now, else the next one to start. A conference app is
|
|
2
|
+
// about one event at a time — its Home hero, its Tickets tab and its Agenda all show this one —
|
|
3
|
+
// and a site with several events reaches the rest from the events list.
|
|
4
|
+
//
|
|
5
|
+
// Read from the visitor-readable Events v3 query. "None" (no live or upcoming event) is a real
|
|
6
|
+
// answer, distinct from a failed read: the caller shows an empty state for the first and an
|
|
7
|
+
// error with Retry for the second, never a sample event.
|
|
8
|
+
import { queryEvents, startDateOf, endDateOf, type WixEvent, type WixEventFieldset } from "@himalaya/wix-events";
|
|
9
|
+
|
|
10
|
+
export type FeaturedEventRead = { ok: true; event: WixEvent | null } | { ok: false; event: null };
|
|
11
|
+
|
|
12
|
+
// Only live and upcoming events, earliest first, filtered and sorted by Wix (verified on a visitor
|
|
13
|
+
// token, 2026-11-10): the featured one is on the first page however many events the site has. The
|
|
14
|
+
// pick below still checks each row, and pages on (to Wix's own total) only while no page has
|
|
15
|
+
// produced an event to feature — never a fixed page cap that could miss one.
|
|
16
|
+
const FEATURED_QUERY = {
|
|
17
|
+
filter: { status: { $in: ["UPCOMING", "STARTED"] } },
|
|
18
|
+
sort: [{ fieldName: "dateAndTimeSettings.startDate", order: "ASC" }],
|
|
19
|
+
};
|
|
20
|
+
const PAGE = 50;
|
|
21
|
+
|
|
22
|
+
const millis = (iso: string | undefined): number => {
|
|
23
|
+
const ms = iso ? Date.parse(iso) : NaN;
|
|
24
|
+
return Number.isNaN(ms) ? NaN : ms;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** The event to feature among `events` at `now`: a published event that has not ended — the one
|
|
28
|
+
* that started first when several run now, else the next to start. A draft, a canceled event
|
|
29
|
+
* and an ended one are never featured; an event with no date is featured only when no dated one
|
|
30
|
+
* qualifies (its date is "to be announced"). */
|
|
31
|
+
export function pickFeaturedEvent(events: WixEvent[], now: number): WixEvent | null {
|
|
32
|
+
const eligible = events.filter((e) => {
|
|
33
|
+
const status = String(e.eventStatus ?? (e as { status?: string }).status ?? "").toUpperCase();
|
|
34
|
+
if (status === "DRAFT" || status === "CANCELED" || status === "ENDED") return false;
|
|
35
|
+
const end = millis(endDateOf(e)), start = millis(startDateOf(e));
|
|
36
|
+
const last = Number.isNaN(end) ? start : end;
|
|
37
|
+
return Number.isNaN(last) || last >= now;
|
|
38
|
+
});
|
|
39
|
+
const dated = eligible.filter((e) => !Number.isNaN(millis(startDateOf(e))));
|
|
40
|
+
if (dated.length) return dated.slice().sort((a, b) => millis(startDateOf(a)) - millis(startDateOf(b)))[0];
|
|
41
|
+
return eligible[0] ?? null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Read the site's live and upcoming events and pick the featured one. */
|
|
45
|
+
export async function readFeaturedEvent(fields: WixEventFieldset[] = ["DETAILS", "REGISTRATION"], now: number = Date.now()): Promise<FeaturedEventRead> {
|
|
46
|
+
const events: WixEvent[] = [];
|
|
47
|
+
try {
|
|
48
|
+
for (let offset = 0; ; offset += PAGE) {
|
|
49
|
+
const res = await queryEvents({ limit: PAGE, offset, fields, query: FEATURED_QUERY as never });
|
|
50
|
+
const page = (res.events ?? []).filter((e) => !!e.id);
|
|
51
|
+
events.push(...page);
|
|
52
|
+
const total = Number((res as { pagingMetadata?: { total?: unknown } }).pagingMetadata?.total);
|
|
53
|
+
const done = page.length < PAGE || (Number.isFinite(total) && offset + PAGE >= total);
|
|
54
|
+
// A dated pick is final (a later page starts later); an undated one is not — a dated event
|
|
55
|
+
// may still follow, and a dated event is always featured before a "to be announced" one.
|
|
56
|
+
const pick = pickFeaturedEvent(events, now);
|
|
57
|
+
if (done || (pick && !Number.isNaN(millis(startDateOf(pick))))) break;
|
|
58
|
+
}
|
|
59
|
+
} catch {
|
|
60
|
+
return { ok: false, event: null };
|
|
61
|
+
}
|
|
62
|
+
return { ok: true, event: pickFeaturedEvent(events, now) };
|
|
63
|
+
}
|