@wix/himalaya-cli 0.1946.0 → 0.1948.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.
Files changed (36) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/admob-ids.d.ts +4 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/index.d.ts +1 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +3 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +8 -2
  5. package/dist/browser-plane/assets.json +5 -5
  6. package/dist/browser-plane/preview-deferred/{9521361aa5be10b9a96b96c0ea2f7e157e728874b20de5200879cbd735eefb38.bin → 1425fc7ef3149df8ba41fdbcca629cefd430a2cae524822c21985f0aade6430a.bin} +1 -1
  7. package/dist/browser-plane/sw.js +1 -1
  8. package/dist/cli.mjs +2266 -789
  9. package/dist/preview-assets.generated.bin +0 -0
  10. package/guides/getting-started.md +6 -1
  11. package/guides/himi-skill.md +6 -1
  12. package/guides/himi-test.md +61 -1
  13. package/guides/one-app-section-mappings.md +1 -1
  14. package/guides/one-app-to-himi-app.md +21 -14
  15. package/guides/sdk-reference.json +1 -1
  16. package/guides/skill.md +1 -1
  17. package/package.json +2 -2
  18. package/templates/branded-lite/recipes/form-section.json +958 -0
  19. package/templates/branded-lite/tier5-src/_shared/event-agenda.ts +15 -15
  20. package/templates/branded-lite/tier5-src/_shared/event-schedule-section.ts +8 -8
  21. package/templates/branded-lite/tier5-src/_shared/form-section.ts +640 -0
  22. package/templates/branded-lite/tier5-src/himi-branded-lite-form/index.ts +4 -588
  23. package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +7 -6
  24. package/templates/community-club/tier5-src/himi-events-detail/index.ts +7 -6
  25. package/templates/conference/tier5-src/_shared/event-agenda.ts +15 -15
  26. package/templates/conference/tier5-src/himi-conference-agenda/index.ts +3 -5
  27. package/templates/conference/tier5-src/himi-conference-home/index.ts +5 -6
  28. package/templates/conference/tier5-src/himi-events-detail/index.ts +7 -6
  29. package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +7 -6
  30. package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +7 -6
  31. package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +7 -6
  32. package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +7 -6
  33. package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +7 -6
  34. package/templates/professional-services/tier5-src/himi-events-detail/index.ts +7 -6
  35. package/templates/restaurant/tier5-src/himi-events-detail/index.ts +7 -6
  36. package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +7 -6
@@ -2,9 +2,11 @@
2
2
  // visible session in start order, its time range and length in the EVENT's time zone (an
3
3
  // attendee abroad plans by the venue's clock), its stage, and the day it falls on.
4
4
  //
5
- // Read from the visitor-readable `GET /events/v1/schedule?eventId=` — only when the event has its
6
- // agenda turned on (`agendaSettings.enabled`); otherwise Wix answers for an owner only. A failed
7
- // read is reported (`ok: false`) so the caller can show an error with Retry, never an empty agenda.
5
+ // Read from the visitor-readable `GET /events/v1/schedule?eventId=`, whatever the event's
6
+ // `agendaSettings.enabled` says: that switch is the website's agenda page, not the API's. With it
7
+ // off, Wix still answers a visitor 200 — the published sessions for a One App visitor, an empty
8
+ // list where there are none — and One App shows them. A failed read is reported (`ok: false`) so
9
+ // the caller can show an error with Retry, never an empty agenda.
8
10
  import { calendarDay, formatClock, formatWeekdayMonthDayLong } from "./engine-intl.js";
9
11
  import { copyParam, copyTemplate } from "./himi-copy.js";
10
12
 
@@ -55,14 +57,15 @@ export function durationLabel(minutes: number): string {
55
57
  }
56
58
 
57
59
  interface RawItem {
58
- id?: unknown; name?: unknown; title?: unknown; hidden?: unknown; status?: unknown;
60
+ id?: unknown; name?: unknown; title?: unknown; hidden?: unknown; status?: unknown; draft?: unknown;
59
61
  stageName?: unknown; description?: unknown;
60
62
  timeSlot?: { start?: unknown; end?: unknown; timeZoneId?: unknown };
61
63
  }
62
64
 
63
65
  /** One session row from a Wix schedule item, or null for a hidden, draft or unnamed one. */
64
66
  export function agendaSession(item: RawItem, eventZone: string): AgendaSession | null {
65
- if (item.hidden === true) return null;
67
+ // An owner's read lists each item's draft copy too (`draft: true`), and only the draft until it is published.
68
+ if (item.hidden === true || item.draft === true) return null;
66
69
  // Wix schedule items are SCHEDULED or CANCELED (a draft is a separate copy, not a status).
67
70
  if (clean(item.status).toUpperCase() === "CANCELED") return null;
68
71
  const id = clean(item.id), name = clean(item.name) || clean(item.title);
@@ -91,9 +94,9 @@ export function agendaSession(item: RawItem, eventZone: string): AgendaSession |
91
94
 
92
95
  export type AgendaRead = { ok: true; sessions: AgendaSession[] } | { ok: false; sessions: AgendaSession[] };
93
96
 
94
- /** The visible sessions of `eventId`, in start order. An agenda that is off is an empty one. */
95
- export async function readAgenda(eventId: string, agendaEnabled: boolean, eventZone: string): Promise<AgendaRead> {
96
- if (!eventId || !agendaEnabled) return { ok: true, sessions: [] };
97
+ /** The visible sessions of `eventId`, in start order. */
98
+ export async function readAgenda(eventId: string, eventZone: string): Promise<AgendaRead> {
99
+ if (!eventId) return { ok: true, sessions: [] };
97
100
  const api = wixApi();
98
101
  if (!api) return { ok: false, sessions: [] };
99
102
  try {
@@ -112,11 +115,8 @@ export async function readAgenda(eventId: string, agendaEnabled: boolean, eventZ
112
115
  }
113
116
  }
114
117
 
115
- /** The event's own time zone and whether its agenda is on, from an Events v3 record. */
116
- export function agendaSettingsOf(event: unknown): { enabled: boolean; zone: string } {
117
- const e = event as { agendaSettings?: { enabled?: unknown }; dateAndTimeSettings?: { timeZoneId?: unknown }; scheduling?: { timeZoneId?: unknown; config?: { timeZoneId?: unknown } } } | null;
118
- return {
119
- enabled: e?.agendaSettings?.enabled === true,
120
- zone: clean(e?.dateAndTimeSettings?.timeZoneId) || clean(e?.scheduling?.config?.timeZoneId) || clean(e?.scheduling?.timeZoneId),
121
- };
118
+ /** The event's own time zone, from an Events v3 record (the DETAILS fieldset carries it). */
119
+ export function eventZoneOf(event: unknown): string {
120
+ const e = event as { dateAndTimeSettings?: { timeZoneId?: unknown }; scheduling?: { timeZoneId?: unknown; config?: { timeZoneId?: unknown } } } | null;
121
+ return clean(e?.dateAndTimeSettings?.timeZoneId) || clean(e?.scheduling?.config?.timeZoneId) || clean(e?.scheduling?.timeZoneId);
122
122
  }
@@ -2,15 +2,15 @@
2
2
  // order, each as the day and start time it runs (in the app's language, in the EVENT's time zone), its name and its stage.
3
3
  // limit -> how many sessions (default 10); `noMore` is false when the event has more, which is when the section's View All button
4
4
  // (to the event screen, whose full schedule lists every session) shows.
5
- // The read is the one the conference agenda makes: the event with its AGENDA fieldset (without it Wix leaves `agendaSettings` out and the
6
- // agenda is never read), then `GET /events/v1/schedule?eventId=` (_shared/event-agenda.ts). An event with its agenda off, or none, has no
7
- // sessions: the section then hides completely (`hideSection`), title included. A failed read is `error`, never an empty schedule; an event
8
- // that no longer exists (404) is an empty one.
5
+ // The read is the one the conference agenda makes: the event (DETAILS, for its time zone), then `GET /events/v1/schedule?eventId=`
6
+ // (_shared/event-agenda.ts), whether or not the event's agenda switch is on — One App shows the published sessions either way. An event
7
+ // with no sessions has none to show: the section then hides completely (`hideSection`), title included. A failed read is `error`, never an
8
+ // empty schedule; an event that no longer exists (404) is an empty one.
9
9
  // The section adds no words of its own: every row is the event's own data, and the error state is the shared section-error recipe's.
10
10
  // A page worker registers it under a service name; the descriptor binds `$service:<serviceName>.*` (recipe event-schedule).
11
11
  import { defineService } from "@himalaya/state";
12
12
  import { getEvent } from "@himalaya/wix-events";
13
- import { agendaSettingsOf, readAgenda, type AgendaSession } from "./event-agenda.js";
13
+ import { eventZoneOf, readAgenda, type AgendaSession } from "./event-agenda.js";
14
14
  import { isNotFoundError } from "./detail-presence.js";
15
15
  import { formatClock, formatWeekdayMonthDayLong } from "./engine-intl.js";
16
16
  import { stashCopy } from "./himi-copy.js";
@@ -75,9 +75,9 @@ export function registerEventScheduleSection(serviceName: string, options: Event
75
75
  stashCopy(arg);
76
76
  try {
77
77
  if (!options.eventId) return view("ready", [], false);
78
- const res = await getEvent(options.eventId, { fields: ["DETAILS", "AGENDA"] });
79
- const { enabled, zone } = agendaSettingsOf((res as unknown as { event?: unknown }).event ?? res);
80
- const agenda = await readAgenda(options.eventId, enabled, zone);
78
+ const res = await getEvent(options.eventId, { fields: ["DETAILS"] });
79
+ const zone = eventZoneOf((res as unknown as { event?: unknown }).event ?? res);
80
+ const agenda = await readAgenda(options.eventId, zone);
81
81
  if (!agenda.ok) throw new Error("The event schedule could not be read");
82
82
  return view("ready", agenda.sessions.slice(0, limit).map((session) => rowOf(session, zone)), agenda.sessions.length > limit);
83
83
  } catch (error) {