@wix/himalaya-cli 0.1478.0 → 0.1480.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 (45) hide show
  1. package/dist/cli.mjs +454 -263
  2. package/dist/preview-assets.generated.bin +0 -0
  3. package/guides/component-reference.json +2 -25
  4. package/guides/component-reference.md +3 -9
  5. package/package.json +2 -2
  6. package/templates/beauty-salon/dev/index.ts +29 -229
  7. package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +69 -9
  8. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +6 -1
  9. package/templates/beauty-salon/tier5-src/wix-spaces-my-subscriptions/index.ts +2 -2
  10. package/templates/branded-lite/dev/index.ts +58 -364
  11. package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +69 -9
  12. package/templates/branded-lite/tier5-src/himi-events-rsvp/index.ts +5 -0
  13. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +6 -1
  14. package/templates/branded-lite/tier5-src/wix-spaces-my-subscriptions/index.ts +2 -2
  15. package/templates/community-club/dev/index.ts +26 -134
  16. package/templates/community-club/tier5-src/himi-events-rsvp/index.ts +5 -0
  17. package/templates/community-club/tier5-src/himi-store-account/index.ts +6 -1
  18. package/templates/events-meetups/dev/index.ts +26 -134
  19. package/templates/events-meetups/tier5-src/himi-events-rsvp/index.ts +5 -0
  20. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +6 -1
  21. package/templates/gym-fitness/dev/index.ts +55 -363
  22. package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +69 -9
  23. package/templates/gym-fitness/tier5-src/himi-events-rsvp/index.ts +5 -0
  24. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +6 -1
  25. package/templates/gym-fitness/tier5-src/wix-spaces-my-subscriptions/index.ts +2 -2
  26. package/templates/nonprofit-cause/dev/index.ts +29 -136
  27. package/templates/nonprofit-cause/tier5-src/himi-events-rsvp/index.ts +5 -0
  28. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +6 -1
  29. package/templates/nonprofit-cause/tier5-src/wix-spaces-my-subscriptions/index.ts +2 -2
  30. package/templates/podcast-creator/dev/index.ts +29 -136
  31. package/templates/podcast-creator/tier5-src/himi-events-rsvp/index.ts +5 -0
  32. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +6 -1
  33. package/templates/podcast-creator/tier5-src/wix-spaces-my-subscriptions/index.ts +2 -2
  34. package/templates/portfolio-creative/dev/index.ts +26 -134
  35. package/templates/portfolio-creative/tier5-src/himi-events-rsvp/index.ts +5 -0
  36. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +6 -1
  37. package/templates/restaurant/dev/index.ts +26 -134
  38. package/templates/restaurant/tier5-src/himi-events-rsvp/index.ts +5 -0
  39. package/templates/restaurant/tier5-src/himi-store-account/index.ts +6 -1
  40. package/templates/retail-store/tier5-src/himi-store-account/index.ts +6 -1
  41. package/templates/yoga-studio/dev/index.ts +55 -363
  42. package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +69 -9
  43. package/templates/yoga-studio/tier5-src/himi-events-rsvp/index.ts +5 -0
  44. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +6 -1
  45. package/templates/yoga-studio/tier5-src/wix-spaces-my-subscriptions/index.ts +2 -2
Binary file
@@ -9,7 +9,6 @@
9
9
  "Carousel",
10
10
  "Pager",
11
11
  "WebView",
12
- "Menu",
13
12
  "Video",
14
13
  "PdfView",
15
14
  "MediaPlayer",
@@ -722,30 +721,8 @@
722
721
  "name": "Menu",
723
722
  "category": "Overlays & menus",
724
723
  "propsType": "MenuProps",
725
- "bindings": [],
726
- "notImplemented": [
727
- {
728
- "props": [
729
- "itemsPath"
730
- ],
731
- "platforms": [
732
- "ios"
733
- ],
734
- "severity": "category",
735
- "note": "`itemsPath` does not bind items."
736
- },
737
- {
738
- "props": [
739
- "style",
740
- "itemsPath"
741
- ],
742
- "platforms": [
743
- "android",
744
- "web"
745
- ],
746
- "severity": "category",
747
- "note": "`style: \"action_sheet\"` renders as a dropdown. (`style: \"context\"` is honoured: it opens on a long-press, or right-click on web, with its `preview`.) `itemsPath` does not bind items."
748
- }
724
+ "bindings": [
725
+ "itemsPath"
749
726
  ],
750
727
  "propsSource": "export interface MenuProps {\n anchor?: Component;\n items?: MenuItem[];\n style?: \"dropdown\" | \"context\" | \"action_sheet\";\n /** \"$service:\" binding → MenuItem[]. */\n itemsPath?: string;\n /** The overlay traps focus and hides the rest of the tree from AT while\n * presented (iOS `accessibilityViewIsModal`, Android `isTraversalGroup`, ARIA\n * `aria-modal`). TRI-STATE: absent takes the Menu's default — MODAL,\n * from the one shared overlay default table — and an explicit `false` opts out. */\n modal?: boolean;\n /** A preview lifted above the menu while a `style: \"context\"` menu is open (iOS\n * `.contextMenu(menuItems:preview:)`; Android and web draw it as a card over a scrim).\n * Absent ⇒ the anchor itself lifts. Ignored by the other styles. */\n preview?: Component;\n}"
751
728
  },
@@ -76,7 +76,7 @@ See also **[Modifiers](#modifiers)** (the `modifiers` block) and **[Actions](#ac
76
76
  | `SelectionControl` | Controls & cells | `valuePath` |
77
77
  | `ActivityIndicator` | Controls & cells | `valuePath` |
78
78
  | `BottomSheet` | Overlays & menus | `presentedPath` |
79
- | `Menu` | Overlays & menus | — |
79
+ | `Menu` | Overlays & menus | `itemsPath` |
80
80
  | `Tooltip` | Overlays & menus | — |
81
81
  | `Popover` | Overlays & menus | `presentedPath` |
82
82
  | `Chip` | Chips & selection | `selectedPath`, `tokenPath` |
@@ -119,9 +119,9 @@ See also **[Modifiers](#modifiers)** (the `modifiers` block) and **[Actions](#ac
119
119
 
120
120
  These props are accepted by the schema and pass validation, but the named platform's renderer never reads them — they silently do nothing (no warning, no log). Prefer a prop NOT listed here, or drive the behaviour from a worker.
121
121
 
122
- **Scope: 10 of 87 components, all of them android / web / ios-only** — every other component/platform pair reads every prop it decodes. The list splits in two, and the halves mean different things:
122
+ **Scope: 9 of 87 components, all of them android / web / ios-only** — every other component/platform pair reads every prop it decodes. The list splits in two, and the halves mean different things:
123
123
 
124
- - **`category` (3: `Menu`, `MediaPlayer`, `TimeGrid`)** — the prop changes the component's *kind*. These genuinely are **not implemented**: an overlay renders always-visible inline, so the component does not do the job its name implies. Check the row's note for a working alternative.
124
+ - **`category` (2: `MediaPlayer`, `TimeGrid`)** — the prop changes the component's *kind*. These genuinely are **not implemented**: an overlay renders always-visible inline, so the component does not do the job its name implies. Check the row's note for a working alternative.
125
125
  - **`styling` (7: `Text`, `Icon`, `Carousel`, `Pager`, `WebView`, `Video`, `PdfView`)** — the component itself **works**; only the listed prop is inert. Use the component; just do not depend on that one prop.
126
126
 
127
127
  | Component | Unread props | Platform | Kind | Note |
@@ -131,8 +131,6 @@ These props are accepted by the schema and pass validation, but the named platfo
131
131
  | `Carousel` | `liveWindow` | ios, android, web | styling | Declared ahead of its runtime: every page stays mounted until Pager/Carousel live_window lands on each renderer (W8, #4630). |
132
132
  | `Pager` | `liveWindow` | ios, android, web | styling | Declared ahead of its runtime: every page stays mounted until Pager/Carousel live_window lands on each renderer (W8, #4630). |
133
133
  | `WebView` | `bridge`, `instanceId`, `activePath`, `mutedPath`, `reloadKeyPath`, `heightPath`, `fill` | ios, android, web | styling | The embedded worker-bridged WebView contract is declared ahead of its runtime: no channel, instance identity, fill layout, bound height or active/muted/reload binding until the hosts implement it (iOS/macOS #4624/#4625, Android #4626/#4627, web #4628/#4629). |
134
- | `Menu` | `itemsPath` | ios | category | `itemsPath` does not bind items. |
135
- | `Menu` | `style`, `itemsPath` | android, web | category | `style: "action_sheet"` renders as a dropdown. (`style: "context"` is honoured: it opens on a long-press, or right-click on web, with its `preview`.) `itemsPath` does not bind items. |
136
134
  | `Video` | `poster` | ios | styling | `poster` is not shown. |
137
135
  | `PdfView` | `showPageControls`, `zoomable`, `allowShare` | web | styling | Interactive PDF.js canvas rendering honours the reader’s page, zoom and export controls. Static previews and PDF.js loading/rendering failures use a native browser-viewer fallback. In that fallback, hiding page or zoom controls is only a viewer hint and cannot reliably hide browser chrome; allowShare hides the reader’s export controls but cannot prevent browser save/print. These props are UI controls, not document access restrictions. |
138
136
  | `MediaPlayer` | `autoplayVisibilityThreshold`, `preload`, `playbackRates`, `showQueue`, `showChapters`, `showTranscript` | ios | category | `autoplayVisibilityThreshold` is ignored (whenVisible = once on appear). `preload` is ignored. `playbackRates` is ignored, and the queue/chapters/transcript panels never render. |
@@ -1381,10 +1379,6 @@ export interface MenuProps {
1381
1379
  }
1382
1380
  ```
1383
1381
 
1384
- > ⚠️ **Not implemented on ios:** `itemsPath` — `itemsPath` does not bind items.
1385
-
1386
- > ⚠️ **Not implemented on android, web:** `style`, `itemsPath` — `style: "action_sheet"` renders as a dropdown. (`style: "context"` is honoured: it opens on a long-press, or right-click on web, with its `preview`.) `itemsPath` does not bind items.
1387
-
1388
1382
  #### Tooltip
1389
1383
 
1390
1384
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1478.0",
3
+ "version": "0.1480.0",
4
4
  "type": "module",
5
5
  "description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
6
6
  "keywords": [
@@ -71,5 +71,5 @@
71
71
  "artifactId": "himalaya-cli"
72
72
  }
73
73
  },
74
- "falconPackageHash": "9df3ab790eedc5502b485d550de7a6fda56709041ca3aa3c46412c91"
74
+ "falconPackageHash": "67fdcf6f5732be22446c9fd644c7085232052895c050c1fb8702c079"
75
75
  }
@@ -25828,14 +25828,15 @@ const SCREENS = runtimeSetting({
25828
25828
  "package": "himalaya",
25829
25829
  "type": "Button",
25830
25830
  "props": {
25831
- "title": "Go to Account",
25831
+ "title": "Sign in",
25832
25832
  "style": "secondary",
25833
25833
  "fullWidth": true,
25834
25834
  "leadingIcon": "person",
25835
25835
  "action": {
25836
25836
  "actionId": "himi.open",
25837
25837
  "params": {
25838
- "screenId": "himi_account"
25838
+ "screenId": "himi_sign_in",
25839
+ "mode": "signin"
25839
25840
  }
25840
25841
  }
25841
25842
  }
@@ -32590,233 +32591,6 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
32590
32591
  "props": {
32591
32592
  "spacing": 12,
32592
32593
  "children": [
32593
- {
32594
- "id": "himi_time.signin_card",
32595
- "body": {
32596
- "package": "himalaya",
32597
- "type": "VStack",
32598
- "props": {
32599
- "spacing": 12,
32600
- "alignment": "leading",
32601
- "children": [
32602
- {
32603
- "id": "",
32604
- "body": {
32605
- "package": "himalaya",
32606
- "type": "HStack",
32607
- "props": {
32608
- "spacing": 10,
32609
- "children": [
32610
- {
32611
- "id": "",
32612
- "body": {
32613
- "package": "himalaya",
32614
- "type": "Icon",
32615
- "props": {
32616
- "name": "person",
32617
- "size": 18,
32618
- "tint": "accentPrimary"
32619
- }
32620
- },
32621
- "modifiers": {
32622
- "accessibilityRole": "decorative"
32623
- }
32624
- },
32625
- {
32626
- "id": "",
32627
- "body": {
32628
- "package": "himalaya",
32629
- "type": "Text",
32630
- "props": {
32631
- "text": "$service:himiBookingTime.authTitle",
32632
- "style": "bodyEmphasis",
32633
- "collapseWhenEmpty": true
32634
- }
32635
- }
32636
- }
32637
- ]
32638
- }
32639
- }
32640
- },
32641
- {
32642
- "id": "",
32643
- "body": {
32644
- "package": "himalaya",
32645
- "type": "Text",
32646
- "props": {
32647
- "text": "$service:himiBookingTime.authBody",
32648
- "style": "body",
32649
- "color": "textSecondary",
32650
- "collapseWhenEmpty": true
32651
- }
32652
- }
32653
- },
32654
- {
32655
- "id": "himi_time.signin.first_name",
32656
- "body": {
32657
- "package": "himalaya",
32658
- "type": "TextField",
32659
- "props": {
32660
- "placeholder": "First name",
32661
- "autoCapitalization": "words",
32662
- "onChange": {
32663
- "actionId": "tier5.himiBookingTime.setFirstName"
32664
- }
32665
- }
32666
- },
32667
- "modifiers": {
32668
- "hiddenPath": "$service:himiBookingTime.notRegistering"
32669
- }
32670
- },
32671
- {
32672
- "id": "himi_time.signin.last_name",
32673
- "body": {
32674
- "package": "himalaya",
32675
- "type": "TextField",
32676
- "props": {
32677
- "placeholder": "Last name",
32678
- "autoCapitalization": "words",
32679
- "onChange": {
32680
- "actionId": "tier5.himiBookingTime.setLastName"
32681
- }
32682
- }
32683
- },
32684
- "modifiers": {
32685
- "hiddenPath": "$service:himiBookingTime.notRegistering"
32686
- }
32687
- },
32688
- {
32689
- "id": "himi_time.signin.email",
32690
- "body": {
32691
- "package": "himalaya",
32692
- "type": "TextField",
32693
- "props": {
32694
- "placeholder": "Email",
32695
- "keyboard": "email",
32696
- "autoCapitalization": "none",
32697
- "onChange": {
32698
- "actionId": "tier5.himiBookingTime.setEmail"
32699
- }
32700
- }
32701
- }
32702
- },
32703
- {
32704
- "id": "himi_time.signin.password",
32705
- "body": {
32706
- "package": "himalaya",
32707
- "type": "TextField",
32708
- "props": {
32709
- "placeholder": "Password",
32710
- "valuePath": "$service:himiBookingTime.password",
32711
- "secure": true,
32712
- "autoCapitalization": "none",
32713
- "onChange": {
32714
- "actionId": "tier5.himiBookingTime.setPassword"
32715
- }
32716
- }
32717
- }
32718
- },
32719
- {
32720
- "id": "himi_time.signin",
32721
- "body": {
32722
- "package": "himalaya",
32723
- "type": "Button",
32724
- "props": {
32725
- "title": "Sign in",
32726
- "style": "primary",
32727
- "fullWidth": true,
32728
- "action": {
32729
- "actionId": "tier5.himiBookingTime.signIn"
32730
- }
32731
- }
32732
- },
32733
- "modifiers": {
32734
- "cornerRadius": 8,
32735
- "pressFeedback": "scale",
32736
- "haptic": "medium",
32737
- "hiddenPath": "$service:himiBookingTime.isRegistering"
32738
- }
32739
- },
32740
- {
32741
- "id": "himi_time.show_register",
32742
- "body": {
32743
- "package": "himalaya",
32744
- "type": "Button",
32745
- "props": {
32746
- "title": "Create account",
32747
- "style": "secondary",
32748
- "fullWidth": true,
32749
- "action": {
32750
- "actionId": "tier5.himiBookingTime.showRegister"
32751
- }
32752
- }
32753
- },
32754
- "modifiers": {
32755
- "hiddenPath": "$service:himiBookingTime.isRegistering"
32756
- }
32757
- },
32758
- {
32759
- "id": "himi_time.register",
32760
- "body": {
32761
- "package": "himalaya",
32762
- "type": "Button",
32763
- "props": {
32764
- "title": "Create account",
32765
- "style": "primary",
32766
- "fullWidth": true,
32767
- "action": {
32768
- "actionId": "tier5.himiBookingTime.register"
32769
- }
32770
- }
32771
- },
32772
- "modifiers": {
32773
- "cornerRadius": 8,
32774
- "pressFeedback": "scale",
32775
- "haptic": "medium",
32776
- "hiddenPath": "$service:himiBookingTime.notRegistering"
32777
- }
32778
- },
32779
- {
32780
- "id": "himi_time.show_signin",
32781
- "body": {
32782
- "package": "himalaya",
32783
- "type": "Button",
32784
- "props": {
32785
- "title": "I already have an account",
32786
- "style": "secondary",
32787
- "fullWidth": true,
32788
- "action": {
32789
- "actionId": "tier5.himiBookingTime.showSignIn"
32790
- }
32791
- }
32792
- },
32793
- "modifiers": {
32794
- "hiddenPath": "$service:himiBookingTime.notRegistering"
32795
- }
32796
- }
32797
- ]
32798
- }
32799
- },
32800
- "modifiers": {
32801
- "background": {
32802
- "token": "surfaceElevated"
32803
- },
32804
- "border": {
32805
- "width": 1,
32806
- "color": {
32807
- "token": "border"
32808
- }
32809
- },
32810
- "cornerRadius": 8,
32811
- "padding": {
32812
- "leading": 14,
32813
- "trailing": 14,
32814
- "top": 14,
32815
- "bottom": 14
32816
- },
32817
- "hiddenPath": "$service:himiBookingTime.hideSignIn"
32818
- }
32819
- },
32820
32594
  {
32821
32595
  "id": "himi_time.member_card",
32822
32596
  "body": {
@@ -32965,6 +32739,32 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
32965
32739
  "hiddenPath": "$service:himiBookingTime.notBooking"
32966
32740
  }
32967
32741
  },
32742
+ {
32743
+ "id": "himi_time.book_sign_in",
32744
+ "body": {
32745
+ "package": "himalaya",
32746
+ "type": "Button",
32747
+ "props": {
32748
+ "title": "Book selected time",
32749
+ "style": "primary",
32750
+ "fullWidth": true,
32751
+ "action": {
32752
+ "actionId": "himi.open",
32753
+ "params": {
32754
+ "screenId": "himi_sign_in",
32755
+ "mode": "signin",
32756
+ "intent": "book"
32757
+ }
32758
+ }
32759
+ }
32760
+ },
32761
+ "modifiers": {
32762
+ "cornerRadius": 8,
32763
+ "pressFeedback": "scale",
32764
+ "haptic": "medium",
32765
+ "hiddenPath": "$service:himiBookingTime.hideSignIn"
32766
+ }
32767
+ },
32968
32768
  {
32969
32769
  "id": "himi_time.book",
32970
32770
  "body": {
@@ -160,6 +160,9 @@ function inputId(): string {
160
160
  /** The time a host opened this screen at (`himalaya.input.start`, ISO 8601), or "". Every load
161
161
  * preselects that slot (or opens on its day) until the member picks a day or a time themselves —
162
162
  * not just the first, because the boot load and the screen's own `load` can overlap. */
163
+ /** Counts the customer's picks. A load that sees it move ran while they picked a time. */
164
+ let selectionRevision = 0;
165
+
163
166
  let pendingStart = (() => {
164
167
  const start = (globalThis as { himalaya?: { input?: { start?: unknown } } }).himalaya?.input?.start;
165
168
  return typeof start === "string" && Number.isFinite(Date.parse(start)) ? start : "";
@@ -420,6 +423,48 @@ async function signedInEmail(): Promise<string> {
420
423
  }
421
424
  }
422
425
 
426
+ // A guest's picked time, kept for the sign-in it needs. Hosts key workers by account, so
427
+ // signing in can start a new worker for this screen, with no selection. `himalaya.storage`
428
+ // is shared by every worker of the app on every host, so a member's load of the same
429
+ // service with nothing selected takes the pick back. Reading never clears it: a new worker's
430
+ // boot load and appear load can run at once, and both must restore the same time. It goes
431
+ // when the member picks a time or books, or after 30 minutes.
432
+ const PENDING_PICK_KEY = "himi.booking.pendingPick.v1";
433
+ const PENDING_PICK_TTL_MS = 30 * 60 * 1000;
434
+ type StorageLike = { getItem(key: string): string | null; setItem(key: string, value: string): void };
435
+
436
+ function appStorage(): StorageLike | undefined {
437
+ return (globalThis as { himalaya?: { storage?: StorageLike } }).himalaya?.storage;
438
+ }
439
+
440
+ function writePick(value: string): void {
441
+ try {
442
+ appStorage()?.setItem(PENDING_PICK_KEY, value);
443
+ } catch {
444
+ // No storage on this host: the pick lives only as long as this worker.
445
+ }
446
+ }
447
+
448
+ function rememberPick(serviceId: string, slotId: string): void {
449
+ writePick(JSON.stringify({ serviceId, slotId, at: Date.now() }));
450
+ }
451
+
452
+ function clearPick(): void {
453
+ writePick("");
454
+ }
455
+
456
+ /** The slot a guest picked for `serviceId` in the last 30 minutes, or "". */
457
+ function readPick(serviceId: string): string {
458
+ let pick: { serviceId?: unknown; slotId?: unknown; at?: unknown } | null = null;
459
+ try {
460
+ pick = JSON.parse(appStorage()?.getItem(PENDING_PICK_KEY) || "null");
461
+ } catch {
462
+ // No storage, or a damaged entry: there is no pick to restore.
463
+ }
464
+ const fresh = typeof pick?.at === "number" && Date.now() - pick.at < PENDING_PICK_TTL_MS;
465
+ return fresh && pick?.serviceId === serviceId && typeof pick?.slotId === "string" ? pick.slotId : "";
466
+ }
467
+
423
468
  // Wix Bookings appDefId — the catalogReference.appId that wraps a booking as an
424
469
  // ecom checkout line item, and the payment appId the native cashier settles under.
425
470
  const WIX_BOOKINGS_APP_ID = "13d21c63-b5ec-5912-8397-c3a5ddb27a97";
@@ -507,7 +552,8 @@ const svc = defineService<S, {
507
552
  bookingsScreenId: "himi_bookings",
508
553
  }),
509
554
  actions: {
510
- load: async (s, arg) => {
555
+ load: async (s, arg): Promise<S> => {
556
+ const revisionAtStart = selectionRevision;
511
557
  stashCopy(arg);
512
558
  if (!s.id) return derive({ ...s, status: "ready", errored: true });
513
559
  let next = derive({ ...s, status: "loading", errored: false, message: "", successMessage: "" });
@@ -544,22 +590,29 @@ const svc = defineService<S, {
544
590
  }
545
591
  allRows = rows;
546
592
  const days = daysOf(rows);
547
- // Keep the customer's day across a reload when it still has times;
548
- // otherwise open on the first day that has any.
593
+ // A reload runs in the background when the screen shows again. A time the customer
594
+ // picked while it ran wins over the selection this load started from.
595
+ const chosen: S = selectionRevision !== revisionAtStart ? (svc.getState?.() ?? next) : next;
549
596
  // A host's `start` (deep entry): that slot preselected, or — taken since — its day.
550
597
  const wantedStart = pendingStart;
551
598
  const startRow = wantedStart ? rows.find((r) => r.id === slotIdAt(slotsById, wantedStart)) : undefined;
552
599
  // The requested day even with no time left on it: "taken since" opens there, nothing selected.
553
600
  const startDay = wantedStart ? days.find((d) => d.id === dayKey(wantedStart)) : undefined;
554
- const keep = days.find((d) => d.id === next.selectedDay && d.hasSlots);
555
- const initialDay = startRow?.dayKey ?? startDay?.id ?? keep?.id ?? days.find((d) => d.hasSlots)?.id ?? days[0]?.id ?? "";
556
- const selectionAlive = !!startRow || slotsById.has(next.selectedSlotId);
601
+ const selectionAlive = !!startRow || slotsById.has(chosen.selectedSlotId);
602
+ // A member with no live selection, and no host start, gets back the time they picked as a guest.
603
+ const picked = selectionAlive || wantedStart || !next.isMember ? undefined : rows.find((row) => row.id === readPick(s.id));
604
+ // Keep the customer's day across a reload when it still has times;
605
+ // otherwise open on the first day that has any.
606
+ const keep = days.find((d) => d.id === chosen.selectedDay && d.hasSlots);
607
+ const initialDay = startRow?.dayKey ?? startDay?.id ?? picked?.dayKey ?? keep?.id ?? days.find((d) => d.hasSlots)?.id ?? days[0]?.id ?? "";
557
608
  const header = serviceHeaderFields(serviceRes.service);
558
609
  return derive(withDay({
559
610
  ...next,
560
611
  days,
561
- selectedSlotId: startRow ? startRow.id : selectionAlive ? next.selectedSlotId : "",
562
- selectedLine: startRow ? [startRow.day, startRow.title, startRow.subtitle].filter(Boolean).join(" · ") : selectionAlive ? next.selectedLine : "",
612
+ selectedSlotId: startRow ? startRow.id : selectionAlive ? chosen.selectedSlotId : picked?.id ?? "",
613
+ selectedLine: startRow ? [startRow.day, startRow.title, startRow.subtitle].filter(Boolean).join(" · ")
614
+ : selectionAlive ? chosen.selectedLine
615
+ : picked ? [picked.day, picked.title, picked.subtitle].filter(Boolean).join(" · ") : "",
563
616
  status: "ready",
564
617
  errored: false,
565
618
  serviceName: serviceRes.service?.name || copyParam("time.serviceNameFallback", "Choose a time"),
@@ -593,7 +646,12 @@ const svc = defineService<S, {
593
646
  ? arg
594
647
  : ((arg as { id?: string; slotId?: string })?.slotId ?? (arg as { id?: string })?.id ?? "");
595
648
  const selected = allRows.find((slot) => slot.id === slotId);
596
- if (selected) pendingStart = "";
649
+ if (selected) {
650
+ selectionRevision++;
651
+ pendingStart = "";
652
+ if (s.isMember) clearPick();
653
+ else rememberPick(s.id, slotId);
654
+ }
597
655
  return derive({
598
656
  ...s,
599
657
  selectedSlotId: selected ? slotId : s.selectedSlotId,
@@ -666,6 +724,8 @@ const svc = defineService<S, {
666
724
  start: hostEventInstant(booking?.startDate) || slot.startDate,
667
725
  end: hostEventInstant(booking?.endDate) || slot.endDate,
668
726
  });
727
+ // The member acts on the pick now; a later visit must not restore it.
728
+ clearPick();
669
729
  // PAID service — FULLY NATIVE in-app payment (mirrors Wix's RN apps): NO
670
730
  // hosted-checkout WebView / browser redirect. The chain is
671
731
  // createBooking → ecom.createCheckout(booking line item) → ecom.createOrder
@@ -365,6 +365,11 @@ function authHeadline(s: S, isRegistering: boolean, isRecovering: boolean): { au
365
365
  authTitle: copyParam("storeAccount.authTitleRsvp", "Sign in to RSVP"),
366
366
  authBody: copyParam("storeAccount.authBodyRsvp", "Sign in to RSVP, then we’ll bring you back."),
367
367
  };
368
+ case "book":
369
+ return {
370
+ authTitle: copyParam("storeAccount.authTitleBook", "Sign in to book"),
371
+ authBody: copyParam("storeAccount.authBodyBook", "Sign in to book this time, then we’ll bring you back."),
372
+ };
368
373
  case "post":
369
374
  return {
370
375
  authTitle: copyParam("storeAccount.authTitlePost", "Sign in to post"),
@@ -392,7 +397,7 @@ interface S extends IapRestoreFields {
392
397
  noMemberImage: boolean;
393
398
  authTitle: string;
394
399
  authBody: string;
395
- /** Mid-flow gate intent (`join_group` | `rsvp` | `post` | ""). */
400
+ /** Mid-flow gate intent (`join_group` | `rsvp` | `book` | `post` | ""). */
396
401
  authIntent: string;
397
402
  authContextName: string;
398
403
  returnScreenId: string;
@@ -9,7 +9,7 @@ interface S {
9
9
  status: "loading" | "ready";
10
10
  orders: Row[];
11
11
  emptyText: string;
12
- /** When true, descriptor hides the guest-only "Go to Account" CTA (hiddenWhen). */
12
+ /** When true, descriptor hides the guest-only "Sign in" CTA (hiddenWhen). */
13
13
  hideAccountCta: boolean;
14
14
  }
15
15
 
@@ -19,7 +19,7 @@ function norm(o: WixPlanOrder): Row {
19
19
  }
20
20
 
21
21
  const EMPTY_MEMBER = "No subscriptions yet";
22
- const EMPTY_GUEST = "Sign in from Account to see subscriptions you’ve joined — we don’t invent sample memberships.";
22
+ const EMPTY_GUEST = "Sign in to see the subscriptions you’ve joined — we don’t invent sample memberships.";
23
23
  const EMPTY_FORBIDDEN = "No subscriptions for this member yet.";
24
24
 
25
25
  /** The signed-in member's email, or "" for anyone else. A visitor's identity is