@wix/himalaya-cli 0.1615.0 → 0.1617.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 (57) hide show
  1. package/dist/cli.mjs +37 -36
  2. package/dist/preview-assets.generated.bin +0 -0
  3. package/guides/tier-5-add-a-screen.md +1 -1
  4. package/package.json +2 -2
  5. package/templates/beauty-salon/dev/index.ts +37 -18
  6. package/templates/beauty-salon/tier5-src/_shared/sign-in-sheet.ts +18 -0
  7. package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +8 -3
  8. package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
  9. package/templates/beauty-salon/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
  10. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +8 -2
  11. package/templates/branded-lite/dev/index.ts +95 -47
  12. package/templates/branded-lite/tier5-src/_shared/sign-in-sheet.ts +18 -0
  13. package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +8 -3
  14. package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
  15. package/templates/branded-lite/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
  16. package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +7 -2
  17. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +8 -2
  18. package/templates/community-club/dev/index.ts +27 -13
  19. package/templates/community-club/tier5-src/_shared/sign-in-sheet.ts +18 -0
  20. package/templates/community-club/tier5-src/himi-store-account/index.ts +8 -2
  21. package/templates/events-meetups/dev/index.ts +25 -12
  22. package/templates/events-meetups/tier5-src/_shared/sign-in-sheet.ts +18 -0
  23. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +8 -2
  24. package/templates/gym-fitness/dev/index.ts +41 -20
  25. package/templates/gym-fitness/tier5-src/_shared/sign-in-sheet.ts +18 -0
  26. package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +8 -3
  27. package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
  28. package/templates/gym-fitness/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
  29. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +8 -2
  30. package/templates/nonprofit-cause/dev/index.ts +31 -15
  31. package/templates/nonprofit-cause/tier5-src/_shared/sign-in-sheet.ts +18 -0
  32. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
  33. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +8 -2
  34. package/templates/podcast-creator/dev/index.ts +29 -14
  35. package/templates/podcast-creator/tier5-src/_shared/sign-in-sheet.ts +18 -0
  36. package/templates/podcast-creator/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
  37. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +8 -2
  38. package/templates/portfolio-creative/dev/index.ts +31 -15
  39. package/templates/portfolio-creative/tier5-src/_shared/sign-in-sheet.ts +18 -0
  40. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +8 -2
  41. package/templates/restaurant/dev/index.ts +27 -13
  42. package/templates/restaurant/tier5-src/_shared/sign-in-sheet.ts +18 -0
  43. package/templates/restaurant/tier5-src/himi-store-account/index.ts +8 -2
  44. package/templates/retail-store/dev/index.ts +25 -12
  45. package/templates/retail-store/tier5-src/_shared/sign-in-sheet.ts +18 -0
  46. package/templates/retail-store/tier5-src/himi-store-account/index.ts +8 -2
  47. package/templates/salon-spa/tier5-src/_shared/sign-in-sheet.ts +18 -0
  48. package/templates/salon-spa/tier5-src/himi-booking-service/index.ts +8 -3
  49. package/templates/salon-spa/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
  50. package/templates/salon-spa/tier5-src/himi-store-account/index.ts +8 -2
  51. package/templates/yoga-studio/dev/index.ts +37 -18
  52. package/templates/yoga-studio/tier5-src/_shared/sign-in-sheet.ts +18 -0
  53. package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +8 -3
  54. package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
  55. package/templates/yoga-studio/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
  56. package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +7 -2
  57. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +8 -2
@@ -13,6 +13,7 @@ import { addDays, dayKey, dayLabel, timeLabel } from "@himalaya/time";
13
13
  import { getService, queryServiceAvailability, registerToWaitlist, type WixAvailabilityEntry, type WixService, type WixServiceAddress, type WixServiceBookingPolicy } from "@himalaya/wix-bookings";
14
14
  import { getMyMember } from "@himalaya/wix-members";
15
15
  import { memberAccess, type MemberAccess } from "../_shared/member-access.js";
16
+ import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
16
17
  import { placesIn, sessionControl, sessionOf, type MemberPlace, type Session, type SessionControl } from "../_shared/booking-session.js";
17
18
  import { categoryName, courseDatesText, courseReadWindows, courseSessionsAvailability, courseWindowOpen, serviceDurationText, servicePriceLine, slotStartInstant, type BookingLabel, type ServicePriceLine } from "../_shared/himi-bookings.js";
18
19
  import { formatServiceMoney, serviceCurrency } from "../_shared/wix-service-price.js";
@@ -723,10 +724,14 @@ const sameMember = (a: MemberAccess | undefined, b: MemberAccess | undefined): b
723
724
  * appear (or tap) params — Branded Lite passes `himi_sign_in` as a sheet. */
724
725
  let signInScreenId = "";
725
726
  let signInPresentation: "" | "sheet" | "full_screen" = "";
727
+ let signInStyle: "page" | "" = "";
726
728
  function rememberSignIn(arg: unknown): void {
727
- const a = (arg ?? {}) as { signInScreenId?: unknown; signInPresentation?: unknown };
729
+ const a = (arg ?? {}) as { signInScreenId?: unknown; signInPresentation?: unknown; signInSheetStyle?: unknown };
728
730
  if (typeof a.signInScreenId === "string" && a.signInScreenId.trim()) signInScreenId = a.signInScreenId.trim();
729
- if (a.signInPresentation === "sheet" || a.signInPresentation === "full_screen") signInPresentation = a.signInPresentation;
731
+ if (a.signInPresentation === "sheet" || a.signInPresentation === "full_screen") {
732
+ signInPresentation = a.signInPresentation;
733
+ signInStyle = signInPageStyle(a.signInSheetStyle);
734
+ }
730
735
  }
731
736
 
732
737
  // ---- State -----------------------------------------------------------------------
@@ -1130,7 +1135,7 @@ const svc = defineService<S, {
1130
1135
  // joins the waitlist itself. A sign-in sheet only closes, and this screen loads again.
1131
1136
  if (!signInScreenId) return navigate(s, { screenId: "himi_time", args: { id: s.id, start: s.sessionStart, sessionId: s.sessionId } });
1132
1137
  return navigate(s, signInPresentation
1133
- ? { screenId: signInScreenId, presentation: signInPresentation, args: { mode: "signin", modal: "1" } }
1138
+ ? { screenId: signInScreenId, presentation: signInPresentation, args: { mode: "signin", modal: "1", ...signInSheetStyle(signInPresentation, signInStyle) } }
1134
1139
  : { screenId: signInScreenId, args: { mode: "signin" } });
1135
1140
  }
1136
1141
  const name = await memberName();
@@ -28,6 +28,7 @@ import {
28
28
  queryServices, registerToWaitlist, type WixAvailabilityEntry, type WixBooking, type WixService,
29
29
  } from "@himalaya/wix-bookings";
30
30
  import { getMyMember } from "@himalaya/wix-members";
31
+ import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
31
32
  import { LOADING, loadFailed, type LoadFlags } from "../_shared/branded-load-state.js";
32
33
  import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
33
34
  import { slotStartInstant } from "../_shared/himi-bookings.js";
@@ -650,6 +651,7 @@ async function settled(next: S | undefined): Promise<S | undefined> {
650
651
 
651
652
  /** How the app opens its sign-in screen, from the appear params ("" = push). */
652
653
  let signInPresentation: "" | "sheet" | "full_screen" = "";
654
+ let signInStyle: "page" | "" = "";
653
655
  /** The app's sign-in screen (`signInScreenId` appear param): Branded Lite's `himi_sign_in` by
654
656
  * default; an app with no such screen names its own (salon-spa: the Profile tab, `himi_account`). */
655
657
  let signInScreenId = "himi_sign_in";
@@ -680,7 +682,10 @@ const svc = defineService<S, {
680
682
  load: async (s, p) => {
681
683
  stashCopy(p);
682
684
  const presentation = argOf(p, "signInPresentation");
683
- if (presentation === "sheet" || presentation === "full_screen") signInPresentation = presentation;
685
+ if (presentation === "sheet" || presentation === "full_screen") {
686
+ signInPresentation = presentation;
687
+ signInStyle = signInPageStyle(argOf(p, "signInSheetStyle"));
688
+ }
684
689
  const signInScreen = argOf(p, "signInScreenId");
685
690
  if (/^[a-z][a-z0-9_]{0,63}$/.test(signInScreen)) signInScreenId = signInScreen;
686
691
  const fw = Number(argOf(p, "firstWeekday") || s.firstWeekday);
@@ -883,7 +888,7 @@ const svc = defineService<S, {
883
888
  busy = false;
884
889
  // As a modal it only closes, and this screen loads again (its re-appearance reload).
885
890
  return navigate(s, signInPresentation
886
- ? { screenId: signInScreenId, presentation: signInPresentation, args: { mode: "signin", modal: "1" } }
891
+ ? { screenId: signInScreenId, presentation: signInPresentation, args: { mode: "signin", modal: "1", ...signInSheetStyle(signInPresentation, signInStyle) } }
887
892
  : { screenId: signInScreenId, args: { mode: "signin", returnScreenId: "himi_agenda" } });
888
893
  }
889
894
  const name = await memberName();
@@ -13,6 +13,7 @@ import { defineService, navigate } from "@himalaya/state";
13
13
  import { listMyPlanOrders, type WixPlanOrder } from "@himalaya/wix-pricing-plans";
14
14
  import { fetchMemberBookings, type MemberBookingRow } from "../_shared/member-bookings.js";
15
15
  import { memberAccess, assertMemberAccess, memberAccessDenied, type MemberAccess } from "../_shared/member-access.js";
16
+ import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
16
17
  import { hostSiteFromInput } from "../_shared/branded-lite-hosted.js";
17
18
  import { formatDateMedium } from "../_shared/engine-intl.js";
18
19
  import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
@@ -53,6 +54,7 @@ const SIGN_IN_SCREEN = "himi_sign_in";
53
54
 
54
55
  let stashedVerticals: string[] | null = null;
55
56
  let signInPresentation: "sheet" | "full_screen" | undefined;
57
+ let signInStyle: "page" | "" = "";
56
58
  let generation = 0;
57
59
 
58
60
  function appearVerticals(arg: unknown): string[] {
@@ -192,7 +194,10 @@ async function read(arg: unknown, again = true): Promise<PlaceSummaryState> {
192
194
  async function load(_s: PlaceSummaryState, arg?: unknown): Promise<PlaceSummaryState | undefined> {
193
195
  stashCopy(arg);
194
196
  const presentation = arg && typeof arg === "object" ? (arg as Record<string, unknown>).signInPresentation : undefined;
195
- if (presentation === "sheet" || presentation === "full_screen") signInPresentation = presentation;
197
+ if (presentation === "sheet" || presentation === "full_screen") {
198
+ signInPresentation = presentation;
199
+ signInStyle = signInPageStyle((arg as Record<string, unknown>).signInSheetStyle);
200
+ }
196
201
  const mine = ++generation;
197
202
  const next = await read(arg);
198
203
  return mine === generation ? next : undefined;
@@ -211,7 +216,7 @@ const svc = defineService<PlaceSummaryState, {
211
216
  if (s.hideCta || !s.ctaScreenId) return s;
212
217
  // No return path: the tile is embedded, so the form closes over its host.
213
218
  return navigate(s, s.ctaScreenId === SIGN_IN_SCREEN && signInPresentation
214
- ? { screenId: SIGN_IN_SCREEN, presentation: signInPresentation, args: { mode: "signin", modal: "1" } }
219
+ ? { screenId: SIGN_IN_SCREEN, presentation: signInPresentation, args: { mode: "signin", modal: "1", ...signInSheetStyle(signInPresentation, signInStyle) } }
215
220
  : { screenId: s.ctaScreenId, args: { mode: s.ctaMode } });
216
221
  },
217
222
  },
@@ -14,6 +14,7 @@ import { dispatch } from "@himalaya/dispatch";
14
14
  import { getCurrentCart, searchOrders, type WixOrder } from "@himalaya/wix-ecom";
15
15
  import { guestProfile, loadMemberProfile, signedInEmail, strOf, fmtDate, titleCase, type AccountActivityRow } from "../_shared/himi-account";
16
16
  import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
17
+ import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
17
18
  import { memberAccountRoutes } from "../_shared/member-account-routes.js";
18
19
  import { createIapCommerce, onlineProgramOrders, pricingPlanOrders, storesAppleSalesEnabled, storesProductOrders } from "@himalaya/iap-checkout";
19
20
  import { IAP_RESTORE_KEYS, NO_IAP_RESTORE, createIapRestore, resetUnhydratedKeysOnOlderRuntime, type IapRestoreFields } from "../_shared/iap-worker.js";
@@ -143,7 +144,7 @@ function openSignIn(next: S, args: Record<string, string>, after: { screenId: st
143
144
  if (after.args?.channelId) back.returnChannelId = after.args.channelId;
144
145
  }
145
146
  if (!presentation) return navigate(next, { screenId, args: { ...args, ...back } });
146
- const modalArgs: Record<string, string> = { ...args, modal: "1" };
147
+ const modalArgs: Record<string, string> = { ...args, modal: "1", ...signInSheetStyle(presentation, signInStyleRequested) };
147
148
  // With no tab to open it on, a modal has no way to the member screen: it only closes.
148
149
  if (after && signInReturnTabRequested) Object.assign(modalArgs, back, { returnTab: signInReturnTabRequested });
149
150
  return navigate(next, { screenId, presentation, args: modalArgs });
@@ -231,6 +232,8 @@ let appliedSeq = 0;
231
232
  let signInScreenRequested = "";
232
233
  /** Account only: how it opens the standalone sign-in screen ("" = push). */
233
234
  let signInPresentationRequested: "" | "sheet" | "full_screen" = "";
235
+ /** Account only: `signInSheetStyle`, "page" when the app opens that sheet as a full page. */
236
+ let signInStyleRequested: "page" | "" = "";
234
237
  /** Account only: its tab, where a member screen opens after a modal sign-in. */
235
238
  let signInReturnTabRequested = "";
236
239
  let standaloneRequested = false;
@@ -268,7 +271,10 @@ function appearConfig(s: S, arg: unknown): AppearConfig {
268
271
  }
269
272
  signInScreenRequested ||= strField(arg, "signInScreen") || s.signInScreen;
270
273
  const presentation = strField(arg, "signInPresentation");
271
- if (presentation === "sheet" || presentation === "full_screen") signInPresentationRequested = presentation;
274
+ if (presentation === "sheet" || presentation === "full_screen") {
275
+ signInPresentationRequested = presentation;
276
+ signInStyleRequested = signInPageStyle(strField(arg, "signInSheetStyle"));
277
+ }
272
278
  signInReturnTabRequested ||= strField(arg, "signInReturnTab");
273
279
  // Only the sign-in screen's route carries `mode`, so it marks the form from the boot load on.
274
280
  standaloneRequested ||= s.standalone || appearing || (!routeInputConsumed && !!routeInput().mode);
@@ -2443,7 +2443,8 @@ const SCREENS = runtimeSetting({
2443
2443
  "params": {
2444
2444
  "screenId": "himi_sign_in",
2445
2445
  "mode": "signin",
2446
- "modal": "1"
2446
+ "modal": "1",
2447
+ "sheetStyle": "page"
2447
2448
  },
2448
2449
  "presentation": "sheet"
2449
2450
  }
@@ -2464,7 +2465,8 @@ const SCREENS = runtimeSetting({
2464
2465
  "params": {
2465
2466
  "screenId": "himi_sign_in",
2466
2467
  "mode": "register",
2467
- "modal": "1"
2468
+ "modal": "1",
2469
+ "sheetStyle": "page"
2468
2470
  },
2469
2471
  "presentation": "sheet"
2470
2472
  }
@@ -3668,6 +3670,7 @@ const SCREENS = runtimeSetting({
3668
3670
  "restorePurchases": "1",
3669
3671
  "signInScreen": "himi_sign_in",
3670
3672
  "signInPresentation": "sheet",
3673
+ "signInSheetStyle": "page",
3671
3674
  "signInReturnTab": "profile",
3672
3675
  "pollIdentity": "1",
3673
3676
  "copy": "{\"account.subtitle\":\"RSVPs, memberships, groups and saved content in one place.\",\"storeAccount.authBody\":\"Sign in to continue — RSVPs, memberships and groups stay with you.\",\"storeAccount.authBodyRegister\":\"Create a member account to continue — RSVPs, memberships and groups stay with you.\"}"
@@ -3925,7 +3928,8 @@ const SCREENS = runtimeSetting({
3925
3928
  "screenId": "himi_sign_in",
3926
3929
  "mode": "signin",
3927
3930
  "returnScreenId": "himi_account_settings",
3928
- "modal": "1"
3931
+ "modal": "1",
3932
+ "sheetStyle": "page"
3929
3933
  },
3930
3934
  "presentation": "sheet"
3931
3935
  }
@@ -6945,7 +6949,8 @@ const SCREENS = runtimeSetting({
6945
6949
  "params": {
6946
6950
  "screenId": "himi_sign_in",
6947
6951
  "returnScreenId": "himi_notif_settings",
6948
- "modal": "1"
6952
+ "modal": "1",
6953
+ "sheetStyle": "page"
6949
6954
  },
6950
6955
  "presentation": "sheet"
6951
6956
  }
@@ -7340,7 +7345,8 @@ const SCREENS = runtimeSetting({
7340
7345
  "mode": "signin",
7341
7346
  "intent": "profile",
7342
7347
  "returnScreenId": "himi_view_profile",
7343
- "modal": "1"
7348
+ "modal": "1",
7349
+ "sheetStyle": "page"
7344
7350
  },
7345
7351
  "presentation": "sheet"
7346
7352
  }
@@ -8408,7 +8414,8 @@ const SCREENS = runtimeSetting({
8408
8414
  "mode": "signin",
8409
8415
  "intent": "wallet",
8410
8416
  "returnScreenId": "himi_wallet",
8411
- "modal": "1"
8417
+ "modal": "1",
8418
+ "sheetStyle": "page"
8412
8419
  },
8413
8420
  "presentation": "sheet"
8414
8421
  }
@@ -8920,7 +8927,8 @@ const SCREENS = runtimeSetting({
8920
8927
  "actionId": "tier5.himiPlaceSummary.load",
8921
8928
  "params": {
8922
8929
  "verticals": "[\"plans\",\"feed\",\"events\",\"blog\",\"groups\"]",
8923
- "signInPresentation": "sheet"
8930
+ "signInPresentation": "sheet",
8931
+ "signInSheetStyle": "page"
8924
8932
  }
8925
8933
  }
8926
8934
  }
@@ -11867,7 +11875,8 @@ const SCREENS = runtimeSetting({
11867
11875
  "params": {
11868
11876
  "screenId": "himi_sign_in",
11869
11877
  "mode": "signin",
11870
- "modal": "1"
11878
+ "modal": "1",
11879
+ "sheetStyle": "page"
11871
11880
  },
11872
11881
  "presentation": "sheet"
11873
11882
  }
@@ -12370,7 +12379,8 @@ const SCREENS = runtimeSetting({
12370
12379
  "mode": "signin",
12371
12380
  "intent": "post",
12372
12381
  "returnScreenId": "himi_feed",
12373
- "modal": "1"
12382
+ "modal": "1",
12383
+ "sheetStyle": "page"
12374
12384
  },
12375
12385
  "presentation": "sheet"
12376
12386
  }
@@ -12990,7 +13000,8 @@ const SCREENS = runtimeSetting({
12990
13000
  "mode": "signin",
12991
13001
  "intent": "post",
12992
13002
  "returnScreenId": "himi_create_post",
12993
- "modal": "1"
13003
+ "modal": "1",
13004
+ "sheetStyle": "page"
12994
13005
  },
12995
13006
  "presentation": "sheet"
12996
13007
  }
@@ -16769,7 +16780,8 @@ const SCREENS = runtimeSetting({
16769
16780
  "params": {
16770
16781
  "screenId": "himi_sign_in",
16771
16782
  "mode": "signin",
16772
- "modal": "1"
16783
+ "modal": "1",
16784
+ "sheetStyle": "page"
16773
16785
  },
16774
16786
  "presentation": "sheet"
16775
16787
  }
@@ -23883,7 +23895,8 @@ const SCREENS = runtimeSetting({
23883
23895
  "mode": "signin",
23884
23896
  "intent": "groups",
23885
23897
  "returnScreenId": "himi_my_groups",
23886
- "modal": "1"
23898
+ "modal": "1",
23899
+ "sheetStyle": "page"
23887
23900
  },
23888
23901
  "presentation": "sheet"
23889
23902
  }
@@ -27238,7 +27251,8 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
27238
27251
  "screenId": "himi_sign_in",
27239
27252
  "mode": "signin",
27240
27253
  "intent": "rsvp",
27241
- "modal": "1"
27254
+ "modal": "1",
27255
+ "sheetStyle": "page"
27242
27256
  },
27243
27257
  "presentation": "sheet"
27244
27258
  }
@@ -27554,7 +27568,8 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
27554
27568
  "params": {
27555
27569
  "screenId": "himi_sign_in",
27556
27570
  "mode": "signin",
27557
- "modal": "1"
27571
+ "modal": "1",
27572
+ "sheetStyle": "page"
27558
27573
  },
27559
27574
  "presentation": "sheet"
27560
27575
  }
@@ -28832,7 +28847,8 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
28832
28847
  "contextName": "$service:himiBrandedGroup.name",
28833
28848
  "returnScreenId": "himi_group",
28834
28849
  "returnId": "$service:himiBrandedGroup.id",
28835
- "modal": "1"
28850
+ "modal": "1",
28851
+ "sheetStyle": "page"
28836
28852
  },
28837
28853
  "presentation": "sheet"
28838
28854
  }
@@ -0,0 +1,18 @@
1
+ // A sign-in sheet can be a form page rather than a drawer. `sheetStyle: "page"` keeps the iOS sheet
2
+ // and opens a full-screen modal on Android and web, whose sheet is a bottom drawer. A host older
3
+ // than the param ignores it and draws its own sheet.
4
+ //
5
+ // Opt-in per app: the app passes `signInSheetStyle: "page"` beside `signInPresentation`. These
6
+ // workers are shared (Salon & Spa runs them too), and an app that opens its other sign-ins as a
7
+ // plain sheet must not get a page from some of them and a drawer from the rest.
8
+
9
+ /** The app's `signInSheetStyle` param, read beside `signInPresentation`: "page", else "". */
10
+ export function signInPageStyle(value: unknown): "page" | "" {
11
+ return value === "page" ? "page" : "";
12
+ }
13
+
14
+ /** The nav args a sign-in opened with `presentation` adds: `sheetStyle` on a sheet the app asked
15
+ * to open as a page, else none. */
16
+ export function signInSheetStyle(presentation: string | undefined, style: "page" | ""): { sheetStyle?: "page" } {
17
+ return presentation === "sheet" && style === "page" ? { sheetStyle: "page" } : {};
18
+ }
@@ -13,6 +13,7 @@ import { defineService, navigate } from "@himalaya/state";
13
13
  import { listMyPlanOrders, type WixPlanOrder } from "@himalaya/wix-pricing-plans";
14
14
  import { fetchMemberBookings, type MemberBookingRow } from "../_shared/member-bookings.js";
15
15
  import { memberAccess, assertMemberAccess, memberAccessDenied, type MemberAccess } from "../_shared/member-access.js";
16
+ import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
16
17
  import { hostSiteFromInput } from "../_shared/branded-lite-hosted.js";
17
18
  import { formatDateMedium } from "../_shared/engine-intl.js";
18
19
  import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
@@ -53,6 +54,7 @@ const SIGN_IN_SCREEN = "himi_sign_in";
53
54
 
54
55
  let stashedVerticals: string[] | null = null;
55
56
  let signInPresentation: "sheet" | "full_screen" | undefined;
57
+ let signInStyle: "page" | "" = "";
56
58
  let generation = 0;
57
59
 
58
60
  function appearVerticals(arg: unknown): string[] {
@@ -192,7 +194,10 @@ async function read(arg: unknown, again = true): Promise<PlaceSummaryState> {
192
194
  async function load(_s: PlaceSummaryState, arg?: unknown): Promise<PlaceSummaryState | undefined> {
193
195
  stashCopy(arg);
194
196
  const presentation = arg && typeof arg === "object" ? (arg as Record<string, unknown>).signInPresentation : undefined;
195
- if (presentation === "sheet" || presentation === "full_screen") signInPresentation = presentation;
197
+ if (presentation === "sheet" || presentation === "full_screen") {
198
+ signInPresentation = presentation;
199
+ signInStyle = signInPageStyle((arg as Record<string, unknown>).signInSheetStyle);
200
+ }
196
201
  const mine = ++generation;
197
202
  const next = await read(arg);
198
203
  return mine === generation ? next : undefined;
@@ -211,7 +216,7 @@ const svc = defineService<PlaceSummaryState, {
211
216
  if (s.hideCta || !s.ctaScreenId) return s;
212
217
  // No return path: the tile is embedded, so the form closes over its host.
213
218
  return navigate(s, s.ctaScreenId === SIGN_IN_SCREEN && signInPresentation
214
- ? { screenId: SIGN_IN_SCREEN, presentation: signInPresentation, args: { mode: "signin", modal: "1" } }
219
+ ? { screenId: SIGN_IN_SCREEN, presentation: signInPresentation, args: { mode: "signin", modal: "1", ...signInSheetStyle(signInPresentation, signInStyle) } }
215
220
  : { screenId: s.ctaScreenId, args: { mode: s.ctaMode } });
216
221
  },
217
222
  },
@@ -14,6 +14,7 @@ import { dispatch } from "@himalaya/dispatch";
14
14
  import { getCurrentCart, searchOrders, type WixOrder } from "@himalaya/wix-ecom";
15
15
  import { guestProfile, loadMemberProfile, signedInEmail, strOf, fmtDate, titleCase, type AccountActivityRow } from "../_shared/himi-account";
16
16
  import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
17
+ import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
17
18
  import { memberAccountRoutes } from "../_shared/member-account-routes.js";
18
19
  import { createIapCommerce, onlineProgramOrders, pricingPlanOrders, storesAppleSalesEnabled, storesProductOrders } from "@himalaya/iap-checkout";
19
20
  import { IAP_RESTORE_KEYS, NO_IAP_RESTORE, createIapRestore, resetUnhydratedKeysOnOlderRuntime, type IapRestoreFields } from "../_shared/iap-worker.js";
@@ -143,7 +144,7 @@ function openSignIn(next: S, args: Record<string, string>, after: { screenId: st
143
144
  if (after.args?.channelId) back.returnChannelId = after.args.channelId;
144
145
  }
145
146
  if (!presentation) return navigate(next, { screenId, args: { ...args, ...back } });
146
- const modalArgs: Record<string, string> = { ...args, modal: "1" };
147
+ const modalArgs: Record<string, string> = { ...args, modal: "1", ...signInSheetStyle(presentation, signInStyleRequested) };
147
148
  // With no tab to open it on, a modal has no way to the member screen: it only closes.
148
149
  if (after && signInReturnTabRequested) Object.assign(modalArgs, back, { returnTab: signInReturnTabRequested });
149
150
  return navigate(next, { screenId, presentation, args: modalArgs });
@@ -231,6 +232,8 @@ let appliedSeq = 0;
231
232
  let signInScreenRequested = "";
232
233
  /** Account only: how it opens the standalone sign-in screen ("" = push). */
233
234
  let signInPresentationRequested: "" | "sheet" | "full_screen" = "";
235
+ /** Account only: `signInSheetStyle`, "page" when the app opens that sheet as a full page. */
236
+ let signInStyleRequested: "page" | "" = "";
234
237
  /** Account only: its tab, where a member screen opens after a modal sign-in. */
235
238
  let signInReturnTabRequested = "";
236
239
  let standaloneRequested = false;
@@ -268,7 +271,10 @@ function appearConfig(s: S, arg: unknown): AppearConfig {
268
271
  }
269
272
  signInScreenRequested ||= strField(arg, "signInScreen") || s.signInScreen;
270
273
  const presentation = strField(arg, "signInPresentation");
271
- if (presentation === "sheet" || presentation === "full_screen") signInPresentationRequested = presentation;
274
+ if (presentation === "sheet" || presentation === "full_screen") {
275
+ signInPresentationRequested = presentation;
276
+ signInStyleRequested = signInPageStyle(strField(arg, "signInSheetStyle"));
277
+ }
272
278
  signInReturnTabRequested ||= strField(arg, "signInReturnTab");
273
279
  // Only the sign-in screen's route carries `mode`, so it marks the form from the boot load on.
274
280
  standaloneRequested ||= s.standalone || appearing || (!routeInputConsumed && !!routeInput().mode);
@@ -2381,7 +2381,8 @@ const SCREENS = runtimeSetting({
2381
2381
  "params": {
2382
2382
  "screenId": "himi_sign_in",
2383
2383
  "mode": "signin",
2384
- "modal": "1"
2384
+ "modal": "1",
2385
+ "sheetStyle": "page"
2385
2386
  },
2386
2387
  "presentation": "sheet"
2387
2388
  }
@@ -2402,7 +2403,8 @@ const SCREENS = runtimeSetting({
2402
2403
  "params": {
2403
2404
  "screenId": "himi_sign_in",
2404
2405
  "mode": "register",
2405
- "modal": "1"
2406
+ "modal": "1",
2407
+ "sheetStyle": "page"
2406
2408
  },
2407
2409
  "presentation": "sheet"
2408
2410
  }
@@ -3606,6 +3608,7 @@ const SCREENS = runtimeSetting({
3606
3608
  "restorePurchases": "1",
3607
3609
  "signInScreen": "himi_sign_in",
3608
3610
  "signInPresentation": "sheet",
3611
+ "signInSheetStyle": "page",
3609
3612
  "signInReturnTab": "profile",
3610
3613
  "pollIdentity": "1",
3611
3614
  "copy": "{\"account.subtitle\":\"RSVPs, memberships and saved content in one place.\",\"storeAccount.authBody\":\"Sign in to continue — RSVPs and memberships stay with you.\",\"storeAccount.authBodyRegister\":\"Create a member account to continue — RSVPs and memberships stay with you.\"}"
@@ -3863,7 +3866,8 @@ const SCREENS = runtimeSetting({
3863
3866
  "screenId": "himi_sign_in",
3864
3867
  "mode": "signin",
3865
3868
  "returnScreenId": "himi_account_settings",
3866
- "modal": "1"
3869
+ "modal": "1",
3870
+ "sheetStyle": "page"
3867
3871
  },
3868
3872
  "presentation": "sheet"
3869
3873
  }
@@ -6883,7 +6887,8 @@ const SCREENS = runtimeSetting({
6883
6887
  "params": {
6884
6888
  "screenId": "himi_sign_in",
6885
6889
  "returnScreenId": "himi_notif_settings",
6886
- "modal": "1"
6890
+ "modal": "1",
6891
+ "sheetStyle": "page"
6887
6892
  },
6888
6893
  "presentation": "sheet"
6889
6894
  }
@@ -7278,7 +7283,8 @@ const SCREENS = runtimeSetting({
7278
7283
  "mode": "signin",
7279
7284
  "intent": "profile",
7280
7285
  "returnScreenId": "himi_view_profile",
7281
- "modal": "1"
7286
+ "modal": "1",
7287
+ "sheetStyle": "page"
7282
7288
  },
7283
7289
  "presentation": "sheet"
7284
7290
  }
@@ -8346,7 +8352,8 @@ const SCREENS = runtimeSetting({
8346
8352
  "mode": "signin",
8347
8353
  "intent": "wallet",
8348
8354
  "returnScreenId": "himi_wallet",
8349
- "modal": "1"
8355
+ "modal": "1",
8356
+ "sheetStyle": "page"
8350
8357
  },
8351
8358
  "presentation": "sheet"
8352
8359
  }
@@ -8858,7 +8865,8 @@ const SCREENS = runtimeSetting({
8858
8865
  "actionId": "tier5.himiPlaceSummary.load",
8859
8866
  "params": {
8860
8867
  "verticals": "[\"plans\",\"feed\",\"events\",\"blog\",\"podcasts\"]",
8861
- "signInPresentation": "sheet"
8868
+ "signInPresentation": "sheet",
8869
+ "signInSheetStyle": "page"
8862
8870
  }
8863
8871
  }
8864
8872
  }
@@ -11805,7 +11813,8 @@ const SCREENS = runtimeSetting({
11805
11813
  "params": {
11806
11814
  "screenId": "himi_sign_in",
11807
11815
  "mode": "signin",
11808
- "modal": "1"
11816
+ "modal": "1",
11817
+ "sheetStyle": "page"
11809
11818
  },
11810
11819
  "presentation": "sheet"
11811
11820
  }
@@ -12308,7 +12317,8 @@ const SCREENS = runtimeSetting({
12308
12317
  "mode": "signin",
12309
12318
  "intent": "post",
12310
12319
  "returnScreenId": "himi_feed",
12311
- "modal": "1"
12320
+ "modal": "1",
12321
+ "sheetStyle": "page"
12312
12322
  },
12313
12323
  "presentation": "sheet"
12314
12324
  }
@@ -12928,7 +12938,8 @@ const SCREENS = runtimeSetting({
12928
12938
  "mode": "signin",
12929
12939
  "intent": "post",
12930
12940
  "returnScreenId": "himi_create_post",
12931
- "modal": "1"
12941
+ "modal": "1",
12942
+ "sheetStyle": "page"
12932
12943
  },
12933
12944
  "presentation": "sheet"
12934
12945
  }
@@ -16707,7 +16718,8 @@ const SCREENS = runtimeSetting({
16707
16718
  "params": {
16708
16719
  "screenId": "himi_sign_in",
16709
16720
  "mode": "signin",
16710
- "modal": "1"
16721
+ "modal": "1",
16722
+ "sheetStyle": "page"
16711
16723
  },
16712
16724
  "presentation": "sheet"
16713
16725
  }
@@ -20691,7 +20703,8 @@ const SCREENS = runtimeSetting({
20691
20703
  "actionId": "himi.open",
20692
20704
  "params": {
20693
20705
  "screenId": "himi_sign_in",
20694
- "modal": "1"
20706
+ "modal": "1",
20707
+ "sheetStyle": "page"
20695
20708
  },
20696
20709
  "presentation": "sheet"
20697
20710
  }
@@ -26608,7 +26621,8 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
26608
26621
  "screenId": "himi_sign_in",
26609
26622
  "mode": "signin",
26610
26623
  "intent": "rsvp",
26611
- "modal": "1"
26624
+ "modal": "1",
26625
+ "sheetStyle": "page"
26612
26626
  },
26613
26627
  "presentation": "sheet"
26614
26628
  }
@@ -26924,7 +26938,8 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
26924
26938
  "params": {
26925
26939
  "screenId": "himi_sign_in",
26926
26940
  "mode": "signin",
26927
- "modal": "1"
26941
+ "modal": "1",
26942
+ "sheetStyle": "page"
26928
26943
  },
26929
26944
  "presentation": "sheet"
26930
26945
  }
@@ -0,0 +1,18 @@
1
+ // A sign-in sheet can be a form page rather than a drawer. `sheetStyle: "page"` keeps the iOS sheet
2
+ // and opens a full-screen modal on Android and web, whose sheet is a bottom drawer. A host older
3
+ // than the param ignores it and draws its own sheet.
4
+ //
5
+ // Opt-in per app: the app passes `signInSheetStyle: "page"` beside `signInPresentation`. These
6
+ // workers are shared (Salon & Spa runs them too), and an app that opens its other sign-ins as a
7
+ // plain sheet must not get a page from some of them and a drawer from the rest.
8
+
9
+ /** The app's `signInSheetStyle` param, read beside `signInPresentation`: "page", else "". */
10
+ export function signInPageStyle(value: unknown): "page" | "" {
11
+ return value === "page" ? "page" : "";
12
+ }
13
+
14
+ /** The nav args a sign-in opened with `presentation` adds: `sheetStyle` on a sheet the app asked
15
+ * to open as a page, else none. */
16
+ export function signInSheetStyle(presentation: string | undefined, style: "page" | ""): { sheetStyle?: "page" } {
17
+ return presentation === "sheet" && style === "page" ? { sheetStyle: "page" } : {};
18
+ }
@@ -13,6 +13,7 @@ import { defineService, navigate } from "@himalaya/state";
13
13
  import { listMyPlanOrders, type WixPlanOrder } from "@himalaya/wix-pricing-plans";
14
14
  import { fetchMemberBookings, type MemberBookingRow } from "../_shared/member-bookings.js";
15
15
  import { memberAccess, assertMemberAccess, memberAccessDenied, type MemberAccess } from "../_shared/member-access.js";
16
+ import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
16
17
  import { hostSiteFromInput } from "../_shared/branded-lite-hosted.js";
17
18
  import { formatDateMedium } from "../_shared/engine-intl.js";
18
19
  import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
@@ -53,6 +54,7 @@ const SIGN_IN_SCREEN = "himi_sign_in";
53
54
 
54
55
  let stashedVerticals: string[] | null = null;
55
56
  let signInPresentation: "sheet" | "full_screen" | undefined;
57
+ let signInStyle: "page" | "" = "";
56
58
  let generation = 0;
57
59
 
58
60
  function appearVerticals(arg: unknown): string[] {
@@ -192,7 +194,10 @@ async function read(arg: unknown, again = true): Promise<PlaceSummaryState> {
192
194
  async function load(_s: PlaceSummaryState, arg?: unknown): Promise<PlaceSummaryState | undefined> {
193
195
  stashCopy(arg);
194
196
  const presentation = arg && typeof arg === "object" ? (arg as Record<string, unknown>).signInPresentation : undefined;
195
- if (presentation === "sheet" || presentation === "full_screen") signInPresentation = presentation;
197
+ if (presentation === "sheet" || presentation === "full_screen") {
198
+ signInPresentation = presentation;
199
+ signInStyle = signInPageStyle((arg as Record<string, unknown>).signInSheetStyle);
200
+ }
196
201
  const mine = ++generation;
197
202
  const next = await read(arg);
198
203
  return mine === generation ? next : undefined;
@@ -211,7 +216,7 @@ const svc = defineService<PlaceSummaryState, {
211
216
  if (s.hideCta || !s.ctaScreenId) return s;
212
217
  // No return path: the tile is embedded, so the form closes over its host.
213
218
  return navigate(s, s.ctaScreenId === SIGN_IN_SCREEN && signInPresentation
214
- ? { screenId: SIGN_IN_SCREEN, presentation: signInPresentation, args: { mode: "signin", modal: "1" } }
219
+ ? { screenId: SIGN_IN_SCREEN, presentation: signInPresentation, args: { mode: "signin", modal: "1", ...signInSheetStyle(signInPresentation, signInStyle) } }
215
220
  : { screenId: s.ctaScreenId, args: { mode: s.ctaMode } });
216
221
  },
217
222
  },