@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 };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# __HIMI_APP_NAME__ — from the `conference` template
|
|
2
|
+
|
|
3
|
+
A conference / summit / festival app over a real Wix site: a poster Home for the site's featured event (the one on now, else the next to start) with Get Tickets, the main-stage speakers, the workshops and the first sessions; Tickets — the shared event detail with the ticket sheet and checkout; an Agenda by day with My Agenda stars; Speakers; More with My tickets, Message the organizers (the Wix Inbox chat), Venue, All events and Profile. Speakers and workshops are the app's own CMS collections (create them with `himi cms create`). Boots as a VISITOR; tickets, My RSVPs and the chat open Branded Lite's sign-in form as a sheet.
|
|
4
|
+
|
|
5
|
+
Everything here is now yours to edit — screens in `dev/`, logic in `tier5-src/`,
|
|
6
|
+
identity and navigation in `config.ts`, look and feel in `tokens.json`.
|
|
7
|
+
|
|
8
|
+
## Point at your Wix site
|
|
9
|
+
|
|
10
|
+
Your **Wix Headless `clientId` binds the data** — the visitor token minted from it already
|
|
11
|
+
names your site, so reads need nothing else. Set these before `himi build` / preview so calls
|
|
12
|
+
hit YOUR site (the placeholders are not a real backend):
|
|
13
|
+
|
|
14
|
+
export WIX_CLIENT_ID="<headless-oauth-client-id>"
|
|
15
|
+
export WIX_SITE_URL="https://your-site.wixsite.com/…"
|
|
16
|
+
export WIX_SITE_ID="<metasite-id>"
|
|
17
|
+
|
|
18
|
+
`WIX_SITE_ID` is the site that client belongs to. The member login takes it from the environment
|
|
19
|
+
while `WIX_CLIENT_ID` is the client the config uses. A native build needs it for member sign-up on
|
|
20
|
+
a CAPTCHA-protected site, push registration and in-app purchases.
|
|
21
|
+
|
|
22
|
+
Full details, including how to ship a binary a customer can install against their own
|
|
23
|
+
site: `himi docs branded-lite-site-binding`.
|
|
24
|
+
|
|
25
|
+
## The loop
|
|
26
|
+
|
|
27
|
+
himi build # compile tier5-src/* -> dist/bundles
|
|
28
|
+
himi validate # screens, bindings and worker boot
|
|
29
|
+
himi render <screenId> --tree # render a screen right here, no device needed
|
|
30
|
+
himi test # exercise every action your screens declare
|
|
31
|
+
himi login --browser --target wix # sign in with your Wix account (once)
|
|
32
|
+
# no browser? export WIX_API_KEY, then himi login --wix --target wix
|
|
33
|
+
himi push --draft # publish a DRAFT release + get preview links
|
|
34
|
+
|
|
35
|
+
Build, validate, render and test run entirely on your machine. Only `login` and
|
|
36
|
+
`push` reach Wix. No per-app install is needed: the CLI ships the `@wix/himalaya`
|
|
37
|
+
runtime it compiles against.
|
|
38
|
+
|
|
39
|
+
## Pattern index — where to look for each recipe
|
|
40
|
+
|
|
41
|
+
| Pattern | Screens |
|
|
42
|
+
|---|---|
|
|
43
|
+
| A featured record as a poster hero (the next event) | con_home hero, con_tickets |
|
|
44
|
+
| A shared detail screen under its own id as a tab (featured mode) | con_tickets |
|
|
45
|
+
| A flat list grouped by day (a row carries its day heading) | con_agenda |
|
|
46
|
+
| Stars on device, per member (My Agenda) | con_agenda |
|
|
47
|
+
| App-owned CMS collections as content (speakers, workshops) | con_home, con_speakers |
|
|
48
|
+
| Reusing a shared screen in your own words (stock-string copy rewrite) | himi_event, himi_events, himi_my_events, himi_account |
|
|
49
|
+
| Selecting a tab from a worker (a _nav tab directive) | con_home See all, Agenda & Tickets |
|
|
50
|
+
| Member chat with the business (Wix Inbox) | himi_business_chat |
|
|
51
|
+
|
|
52
|
+
Guides: `himi docs recipe-dynamic-list`, `himi docs tier-5-add-a-screen`,
|
|
53
|
+
`himi docs designing-himi-screens`. Seed references: `himi agent-init`.
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
// Your app's configuration — identity, auth, navigation, capabilities and tokens.
|
|
2
|
+
// Inspect the live values any time with `himi context`; see `himi docs app-config`.
|
|
3
|
+
import { defineApp } from "@himalaya/core";
|
|
4
|
+
import { WixConsumerAuthProvider } from "@himalaya/wix-auth";
|
|
5
|
+
import { ConsoleTelemetrySink } from "@himalaya/telemetry-console";
|
|
6
|
+
|
|
7
|
+
export default defineApp({
|
|
8
|
+
id: "__HIMI_APP_DOTID__",
|
|
9
|
+
name: "__HIMI_APP_NAME__",
|
|
10
|
+
bundleId: "__HIMI_APP_DOTID__",
|
|
11
|
+
applicationId: "__HIMI_APP_DOTID__",
|
|
12
|
+
// Placeholders — an over-the-air app never consumes these. Leave as-is.
|
|
13
|
+
schemaPackage: "@example/__HIMI_APP_SLUG__-schema",
|
|
14
|
+
schemaPackageRange: { min: 9900, max: 9909 },
|
|
15
|
+
// Placeholders — only a local server would read these. Leave as-is.
|
|
16
|
+
ports: { devServer: 8190, web: 5390 },
|
|
17
|
+
auth: WixConsumerAuthProvider({
|
|
18
|
+
// POINT THESE AT YOUR SITE — set WIX_CLIENT_ID (a public headless OAuth client id)
|
|
19
|
+
// and WIX_SITE_URL (your live site URL). The placeholders below are NOT a real
|
|
20
|
+
// backend; the app boots but reads nothing until you set them. The site needs
|
|
21
|
+
// Wix Events; the Wix Inbox chat is optional. Create the speakers and workshops
|
|
22
|
+
// collections with `himi cms create`.
|
|
23
|
+
clientId: process.env.WIX_CLIENT_ID ?? "YOUR_WIX_CLIENT_ID",
|
|
24
|
+
siteUrl: process.env.WIX_SITE_URL ?? "https://your-site.example.com",
|
|
25
|
+
// The OAuth redirect must be ALLOWLISTED on the headless client in `clientId`.
|
|
26
|
+
redirectUri: process.env.WIX_REDIRECT_URI ?? "himalaya-__HIMI_APP_SLUG__://oauth/callback",
|
|
27
|
+
bootAsVisitor: true,
|
|
28
|
+
preserveVisitorOnSignOut: true,
|
|
29
|
+
}),
|
|
30
|
+
telemetry: ConsoleTelemetrySink(),
|
|
31
|
+
serverUrls: {
|
|
32
|
+
screen: "http://localhost:8190/v1",
|
|
33
|
+
actions: "http://localhost:8190/v1/actions",
|
|
34
|
+
sync: "http://localhost:8190/v1/sync",
|
|
35
|
+
},
|
|
36
|
+
capabilities: ["wix_api","local_database","open_url","share","calendar","secure_storage","wix_platform","app_info","wix_chat","iap","wix_cashier"],
|
|
37
|
+
designTokensPath: "./tokens.json",
|
|
38
|
+
navigation: {
|
|
39
|
+
"navKind": "responsive",
|
|
40
|
+
"scheme": "himalaya-__HIMI_APP_SLUG__",
|
|
41
|
+
"deepLinkPatterns": [],
|
|
42
|
+
"linkableScreens": [
|
|
43
|
+
{
|
|
44
|
+
"screenId": "con_home",
|
|
45
|
+
"isPublic": true,
|
|
46
|
+
"paramKeys": [],
|
|
47
|
+
"parentScreenId": "",
|
|
48
|
+
"tabId": "home"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"screenId": "con_tickets",
|
|
52
|
+
"isPublic": true,
|
|
53
|
+
"paramKeys": [],
|
|
54
|
+
"parentScreenId": "",
|
|
55
|
+
"tabId": "tickets"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"screenId": "himi_event",
|
|
59
|
+
"isPublic": true,
|
|
60
|
+
"paramKeys": [
|
|
61
|
+
"id"
|
|
62
|
+
],
|
|
63
|
+
"parentScreenId": "con_home",
|
|
64
|
+
"tabId": "home"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"screenId": "himi_rsvp",
|
|
68
|
+
"isPublic": true,
|
|
69
|
+
"paramKeys": [
|
|
70
|
+
"id"
|
|
71
|
+
],
|
|
72
|
+
"parentScreenId": "himi_event",
|
|
73
|
+
"tabId": "home"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"screenId": "con_agenda",
|
|
77
|
+
"isPublic": true,
|
|
78
|
+
"paramKeys": [],
|
|
79
|
+
"parentScreenId": "",
|
|
80
|
+
"tabId": "agenda"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"screenId": "con_speakers",
|
|
84
|
+
"isPublic": true,
|
|
85
|
+
"paramKeys": [],
|
|
86
|
+
"parentScreenId": "",
|
|
87
|
+
"tabId": "speakers"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"screenId": "con_more",
|
|
91
|
+
"isPublic": true,
|
|
92
|
+
"paramKeys": [],
|
|
93
|
+
"parentScreenId": "",
|
|
94
|
+
"tabId": "more"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"screenId": "con_venue",
|
|
98
|
+
"isPublic": true,
|
|
99
|
+
"paramKeys": [],
|
|
100
|
+
"parentScreenId": "con_more",
|
|
101
|
+
"tabId": "more"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"screenId": "himi_events",
|
|
105
|
+
"isPublic": true,
|
|
106
|
+
"paramKeys": [],
|
|
107
|
+
"parentScreenId": "con_more",
|
|
108
|
+
"tabId": "more"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"screenId": "himi_my_events",
|
|
112
|
+
"isPublic": false,
|
|
113
|
+
"paramKeys": [],
|
|
114
|
+
"parentScreenId": "con_more",
|
|
115
|
+
"tabId": "more"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"screenId": "himi_account",
|
|
119
|
+
"isPublic": true,
|
|
120
|
+
"paramKeys": [],
|
|
121
|
+
"parentScreenId": "con_more",
|
|
122
|
+
"tabId": "more"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"screenId": "himi_sign_in",
|
|
126
|
+
"isPublic": true,
|
|
127
|
+
"paramKeys": [
|
|
128
|
+
"mode",
|
|
129
|
+
"intent",
|
|
130
|
+
"modal",
|
|
131
|
+
"returnTab",
|
|
132
|
+
"contextName",
|
|
133
|
+
"returnScreenId",
|
|
134
|
+
"returnId",
|
|
135
|
+
"returnChannelId",
|
|
136
|
+
"authContinuation"
|
|
137
|
+
],
|
|
138
|
+
"parentScreenId": "himi_account",
|
|
139
|
+
"tabId": "more"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"screenId": "himi_business_chat",
|
|
143
|
+
"isPublic": false,
|
|
144
|
+
"paramKeys": [],
|
|
145
|
+
"parentScreenId": "con_more",
|
|
146
|
+
"tabId": "more"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"tabBar": {
|
|
150
|
+
"presentation": "native",
|
|
151
|
+
"items": [
|
|
152
|
+
{
|
|
153
|
+
"id": "home",
|
|
154
|
+
"screenId": "con_home",
|
|
155
|
+
"label": "Home",
|
|
156
|
+
"icon": "home",
|
|
157
|
+
"selectedIcon": "home_fill"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"id": "tickets",
|
|
161
|
+
"screenId": "con_tickets",
|
|
162
|
+
"label": "Tickets",
|
|
163
|
+
"icon": "ticket"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"id": "agenda",
|
|
167
|
+
"screenId": "con_agenda",
|
|
168
|
+
"label": "Agenda",
|
|
169
|
+
"icon": "calendar"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "speakers",
|
|
173
|
+
"screenId": "con_speakers",
|
|
174
|
+
"label": "Speakers",
|
|
175
|
+
"icon": "star",
|
|
176
|
+
"selectedIcon": "star_fill"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"id": "more",
|
|
180
|
+
"screenId": "con_more",
|
|
181
|
+
"label": "More",
|
|
182
|
+
"icon": "menu"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
// This app talks to a language model (dual LLM / remote model).
|
|
188
|
+
agent: {
|
|
189
|
+
"onDevice": {
|
|
190
|
+
"ios": "foundation_models",
|
|
191
|
+
"android": "mediapipe"
|
|
192
|
+
},
|
|
193
|
+
"remote": {
|
|
194
|
+
"providerId": "anthropic",
|
|
195
|
+
"config": {
|
|
196
|
+
"model": "claude-haiku-4-5"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"privateModeToggle": false
|
|
200
|
+
},
|
|
201
|
+
entities: {},
|
|
202
|
+
// Your app's own CMS collections (Wix Data). Create them on your site with `himi cms create`;
|
|
203
|
+
// see `himi docs cms-collections`. Visitors read them; your site's admins edit them.
|
|
204
|
+
cms: {
|
|
205
|
+
"collections": [
|
|
206
|
+
{
|
|
207
|
+
"id": "himi___HIMI_APP_CMS_PREFIX___speakers",
|
|
208
|
+
"displayName": "Speakers",
|
|
209
|
+
"displayField": "name",
|
|
210
|
+
"readRole": "ANYONE",
|
|
211
|
+
"fields": [
|
|
212
|
+
{
|
|
213
|
+
"key": "name",
|
|
214
|
+
"displayName": "Name",
|
|
215
|
+
"type": "TEXT"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"key": "role",
|
|
219
|
+
"displayName": "Role",
|
|
220
|
+
"type": "TEXT"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"key": "bio",
|
|
224
|
+
"displayName": "Bio",
|
|
225
|
+
"type": "TEXT"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"key": "photo",
|
|
229
|
+
"displayName": "Photo",
|
|
230
|
+
"type": "IMAGE"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"key": "linkedin",
|
|
234
|
+
"displayName": "LinkedIn",
|
|
235
|
+
"type": "URL"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"key": "twitter",
|
|
239
|
+
"displayName": "X (Twitter)",
|
|
240
|
+
"type": "URL"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"key": "website",
|
|
244
|
+
"displayName": "Website",
|
|
245
|
+
"type": "URL"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"key": "order",
|
|
249
|
+
"displayName": "Order",
|
|
250
|
+
"type": "NUMBER"
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"id": "himi___HIMI_APP_CMS_PREFIX___workshops",
|
|
256
|
+
"displayName": "Workshops",
|
|
257
|
+
"displayField": "title",
|
|
258
|
+
"readRole": "ANYONE",
|
|
259
|
+
"fields": [
|
|
260
|
+
{
|
|
261
|
+
"key": "title",
|
|
262
|
+
"displayName": "Title",
|
|
263
|
+
"type": "TEXT"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"key": "description",
|
|
267
|
+
"displayName": "Description",
|
|
268
|
+
"type": "TEXT"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"key": "photo",
|
|
272
|
+
"displayName": "Photo",
|
|
273
|
+
"type": "IMAGE"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"key": "order",
|
|
277
|
+
"displayName": "Order",
|
|
278
|
+
"type": "NUMBER"
|
|
279
|
+
}
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
// Your on-device database. It must declare every entity a worker reads or writes,
|
|
285
|
+
// or those calls fail closed — keep it in step with `local_database` above.
|
|
286
|
+
dataSchema: {
|
|
287
|
+
"version": 1,
|
|
288
|
+
"entities": [
|
|
289
|
+
{
|
|
290
|
+
"name": "events",
|
|
291
|
+
"encrypted": false,
|
|
292
|
+
"fields": [
|
|
293
|
+
{
|
|
294
|
+
"name": "id",
|
|
295
|
+
"type": "string",
|
|
296
|
+
"required": true
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"name": "title",
|
|
300
|
+
"type": "string"
|
|
301
|
+
}
|
|
302
|
+
]
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"name": "rsvps",
|
|
306
|
+
"encrypted": true,
|
|
307
|
+
"fields": [
|
|
308
|
+
{
|
|
309
|
+
"name": "id",
|
|
310
|
+
"type": "string",
|
|
311
|
+
"required": true
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"name": "eventId",
|
|
315
|
+
"type": "string"
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
});
|