@wix/himalaya-cli 0.1525.0 → 0.1526.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/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +14 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +22 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/worker-subtree-safe-types.generated.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +7 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +13 -0
- package/dist/cli.mjs +137 -39
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/designing-himi-screens.md +43 -18
- package/guides/recipe-dynamic-list.md +7 -7
- package/guides/recipe-four-state.md +47 -41
- package/guides/recipe-search.md +1 -1
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +69 -40
- package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +9 -1
- package/templates/beauty-salon/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/branded-lite/dev/index.ts +165 -88
- package/templates/branded-lite/tier5-src/business-chat/index.ts +4 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +9 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/branded-lite/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/community-club/dev/index.ts +40 -21
- package/templates/community-club/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/events-meetups/dev/index.ts +36 -19
- package/templates/events-meetups/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/gym-fitness/dev/index.ts +73 -42
- package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +9 -1
- package/templates/gym-fitness/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/nonprofit-cause/dev/index.ts +47 -29
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/podcast-creator/dev/index.ts +47 -29
- package/templates/podcast-creator/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/portfolio-creative/dev/index.ts +52 -27
- package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/restaurant/dev/index.ts +48 -25
- package/templates/restaurant/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/retail-store/dev/index.ts +44 -23
- package/templates/retail-store/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/yoga-studio/dev/index.ts +57 -34
- package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +9 -1
- package/templates/yoga-studio/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +69 -10
|
@@ -2220,8 +2220,10 @@ const SCREENS = runtimeSetting({
|
|
|
2220
2220
|
"actionId": "himi.open",
|
|
2221
2221
|
"params": {
|
|
2222
2222
|
"screenId": "himi_sign_in",
|
|
2223
|
-
"mode": "signin"
|
|
2224
|
-
|
|
2223
|
+
"mode": "signin",
|
|
2224
|
+
"modal": "1"
|
|
2225
|
+
},
|
|
2226
|
+
"presentation": "sheet"
|
|
2225
2227
|
}
|
|
2226
2228
|
}
|
|
2227
2229
|
}
|
|
@@ -2239,8 +2241,10 @@ const SCREENS = runtimeSetting({
|
|
|
2239
2241
|
"actionId": "himi.open",
|
|
2240
2242
|
"params": {
|
|
2241
2243
|
"screenId": "himi_sign_in",
|
|
2242
|
-
"mode": "register"
|
|
2243
|
-
|
|
2244
|
+
"mode": "register",
|
|
2245
|
+
"modal": "1"
|
|
2246
|
+
},
|
|
2247
|
+
"presentation": "sheet"
|
|
2244
2248
|
}
|
|
2245
2249
|
}
|
|
2246
2250
|
}
|
|
@@ -3360,6 +3364,8 @@ const SCREENS = runtimeSetting({
|
|
|
3360
3364
|
"memberAccountLinks": "1",
|
|
3361
3365
|
"restorePurchases": "1",
|
|
3362
3366
|
"signInScreen": "himi_sign_in",
|
|
3367
|
+
"signInPresentation": "sheet",
|
|
3368
|
+
"signInReturnTab": "profile",
|
|
3363
3369
|
"pollIdentity": "1",
|
|
3364
3370
|
"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.\"}"
|
|
3365
3371
|
}
|
|
@@ -3615,8 +3621,10 @@ const SCREENS = runtimeSetting({
|
|
|
3615
3621
|
"params": {
|
|
3616
3622
|
"screenId": "himi_sign_in",
|
|
3617
3623
|
"mode": "signin",
|
|
3618
|
-
"returnScreenId": "himi_account_settings"
|
|
3619
|
-
|
|
3624
|
+
"returnScreenId": "himi_account_settings",
|
|
3625
|
+
"modal": "1"
|
|
3626
|
+
},
|
|
3627
|
+
"presentation": "sheet"
|
|
3620
3628
|
}
|
|
3621
3629
|
}
|
|
3622
3630
|
},
|
|
@@ -5526,8 +5534,7 @@ const SCREENS = runtimeSetting({
|
|
|
5526
5534
|
"style": "primary",
|
|
5527
5535
|
"fullWidth": true,
|
|
5528
5536
|
"action": {
|
|
5529
|
-
"actionId": "
|
|
5530
|
-
"presentation": "back"
|
|
5537
|
+
"actionId": "tier5.himiStoreAccount.leave"
|
|
5531
5538
|
}
|
|
5532
5539
|
}
|
|
5533
5540
|
}
|
|
@@ -5568,7 +5575,7 @@ const SCREENS = runtimeSetting({
|
|
|
5568
5575
|
"declaredCapabilities": [
|
|
5569
5576
|
"wix_api"
|
|
5570
5577
|
],
|
|
5571
|
-
"minBinaryVersion": "
|
|
5578
|
+
"minBinaryVersion": "1.7.0",
|
|
5572
5579
|
"bundleVersion": "0.0.1"
|
|
5573
5580
|
}
|
|
5574
5581
|
},
|
|
@@ -6435,8 +6442,10 @@ const SCREENS = runtimeSetting({
|
|
|
6435
6442
|
"screenId": "himi_sign_in",
|
|
6436
6443
|
"mode": "signin",
|
|
6437
6444
|
"intent": "profile",
|
|
6438
|
-
"returnScreenId": "himi_view_profile"
|
|
6439
|
-
|
|
6445
|
+
"returnScreenId": "himi_view_profile",
|
|
6446
|
+
"modal": "1"
|
|
6447
|
+
},
|
|
6448
|
+
"presentation": "sheet"
|
|
6440
6449
|
}
|
|
6441
6450
|
}
|
|
6442
6451
|
}
|
|
@@ -7501,8 +7510,10 @@ const SCREENS = runtimeSetting({
|
|
|
7501
7510
|
"screenId": "himi_sign_in",
|
|
7502
7511
|
"mode": "signin",
|
|
7503
7512
|
"intent": "wallet",
|
|
7504
|
-
"returnScreenId": "himi_wallet"
|
|
7505
|
-
|
|
7513
|
+
"returnScreenId": "himi_wallet",
|
|
7514
|
+
"modal": "1"
|
|
7515
|
+
},
|
|
7516
|
+
"presentation": "sheet"
|
|
7506
7517
|
}
|
|
7507
7518
|
}
|
|
7508
7519
|
}
|
|
@@ -7970,11 +7981,7 @@ const SCREENS = runtimeSetting({
|
|
|
7970
7981
|
"size": "sm",
|
|
7971
7982
|
"fullWidth": true,
|
|
7972
7983
|
"action": {
|
|
7973
|
-
"actionId": "
|
|
7974
|
-
"params": {
|
|
7975
|
-
"screenId": "$service:himiPlaceSummary.ctaScreenId",
|
|
7976
|
-
"mode": "$service:himiPlaceSummary.ctaMode"
|
|
7977
|
-
}
|
|
7984
|
+
"actionId": "tier5.himiPlaceSummary.openCta"
|
|
7978
7985
|
}
|
|
7979
7986
|
}
|
|
7980
7987
|
},
|
|
@@ -8015,7 +8022,8 @@ const SCREENS = runtimeSetting({
|
|
|
8015
8022
|
"onAppear": {
|
|
8016
8023
|
"actionId": "tier5.himiPlaceSummary.load",
|
|
8017
8024
|
"params": {
|
|
8018
|
-
"verticals": "[\"plans\",\"feed\",\"events\",\"blog\",\"groups\"]"
|
|
8025
|
+
"verticals": "[\"plans\",\"feed\",\"events\",\"blog\",\"groups\"]",
|
|
8026
|
+
"signInPresentation": "sheet"
|
|
8019
8027
|
}
|
|
8020
8028
|
}
|
|
8021
8029
|
}
|
|
@@ -10961,8 +10969,10 @@ const SCREENS = runtimeSetting({
|
|
|
10961
10969
|
"actionId": "himi.open",
|
|
10962
10970
|
"params": {
|
|
10963
10971
|
"screenId": "himi_sign_in",
|
|
10964
|
-
"mode": "signin"
|
|
10965
|
-
|
|
10972
|
+
"mode": "signin",
|
|
10973
|
+
"modal": "1"
|
|
10974
|
+
},
|
|
10975
|
+
"presentation": "sheet"
|
|
10966
10976
|
}
|
|
10967
10977
|
}
|
|
10968
10978
|
},
|
|
@@ -11462,8 +11472,10 @@ const SCREENS = runtimeSetting({
|
|
|
11462
11472
|
"screenId": "himi_sign_in",
|
|
11463
11473
|
"mode": "signin",
|
|
11464
11474
|
"intent": "post",
|
|
11465
|
-
"returnScreenId": "himi_feed"
|
|
11466
|
-
|
|
11475
|
+
"returnScreenId": "himi_feed",
|
|
11476
|
+
"modal": "1"
|
|
11477
|
+
},
|
|
11478
|
+
"presentation": "sheet"
|
|
11467
11479
|
}
|
|
11468
11480
|
}
|
|
11469
11481
|
}
|
|
@@ -12080,8 +12092,10 @@ const SCREENS = runtimeSetting({
|
|
|
12080
12092
|
"screenId": "himi_sign_in",
|
|
12081
12093
|
"mode": "signin",
|
|
12082
12094
|
"intent": "post",
|
|
12083
|
-
"returnScreenId": "himi_create_post"
|
|
12084
|
-
|
|
12095
|
+
"returnScreenId": "himi_create_post",
|
|
12096
|
+
"modal": "1"
|
|
12097
|
+
},
|
|
12098
|
+
"presentation": "sheet"
|
|
12085
12099
|
}
|
|
12086
12100
|
}
|
|
12087
12101
|
}
|
|
@@ -23207,8 +23221,10 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
23207
23221
|
"params": {
|
|
23208
23222
|
"screenId": "himi_sign_in",
|
|
23209
23223
|
"mode": "signin",
|
|
23210
|
-
"intent": "rsvp"
|
|
23211
|
-
|
|
23224
|
+
"intent": "rsvp",
|
|
23225
|
+
"modal": "1"
|
|
23226
|
+
},
|
|
23227
|
+
"presentation": "sheet"
|
|
23212
23228
|
}
|
|
23213
23229
|
}
|
|
23214
23230
|
},
|
|
@@ -24540,8 +24556,10 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
24540
24556
|
"intent": "join_group",
|
|
24541
24557
|
"contextName": "$service:himiBrandedGroup.name",
|
|
24542
24558
|
"returnScreenId": "himi_group",
|
|
24543
|
-
"returnId": "$service:himiBrandedGroup.id"
|
|
24544
|
-
|
|
24559
|
+
"returnId": "$service:himiBrandedGroup.id",
|
|
24560
|
+
"modal": "1"
|
|
24561
|
+
},
|
|
24562
|
+
"presentation": "sheet"
|
|
24545
24563
|
}
|
|
24546
24564
|
}
|
|
24547
24565
|
},
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// `load` is both the onAppear action and what an embed controller's `refresh()` runs (arg-less:
|
|
10
10
|
// the stashed appear params keep the verticals and the copy pack), so a host that hears
|
|
11
11
|
// `booking.created` / `booking.cancelled` re-reads the summary without a remount.
|
|
12
|
-
import { defineService } from "@himalaya/state";
|
|
12
|
+
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";
|
|
@@ -52,6 +52,7 @@ const PLANS_SCREEN = "himi_plans";
|
|
|
52
52
|
const SIGN_IN_SCREEN = "himi_sign_in";
|
|
53
53
|
|
|
54
54
|
let stashedVerticals: string[] | null = null;
|
|
55
|
+
let signInPresentation: "sheet" | "full_screen" | undefined;
|
|
55
56
|
let generation = 0;
|
|
56
57
|
|
|
57
58
|
function appearVerticals(arg: unknown): string[] {
|
|
@@ -190,6 +191,8 @@ async function read(arg: unknown, again = true): Promise<PlaceSummaryState> {
|
|
|
190
191
|
* write back over the newer result. */
|
|
191
192
|
async function load(_s: PlaceSummaryState, arg?: unknown): Promise<PlaceSummaryState | undefined> {
|
|
192
193
|
stashCopy(arg);
|
|
194
|
+
const presentation = arg && typeof arg === "object" ? (arg as Record<string, unknown>).signInPresentation : undefined;
|
|
195
|
+
if (presentation === "sheet" || presentation === "full_screen") signInPresentation = presentation;
|
|
193
196
|
const mine = ++generation;
|
|
194
197
|
const next = await read(arg);
|
|
195
198
|
return mine === generation ? next : undefined;
|
|
@@ -198,11 +201,19 @@ async function load(_s: PlaceSummaryState, arg?: unknown): Promise<PlaceSummaryS
|
|
|
198
201
|
const svc = defineService<PlaceSummaryState, {
|
|
199
202
|
load: (s: PlaceSummaryState, arg?: unknown) => Promise<PlaceSummaryState | undefined>;
|
|
200
203
|
retry: (s: PlaceSummaryState) => Promise<PlaceSummaryState | undefined>;
|
|
204
|
+
openCta: (s: PlaceSummaryState) => PlaceSummaryState;
|
|
201
205
|
}>("himiPlaceSummary", {
|
|
202
206
|
state: BLANK,
|
|
203
207
|
actions: {
|
|
204
208
|
load,
|
|
205
209
|
retry: (s) => load(s),
|
|
210
|
+
openCta: (s) => {
|
|
211
|
+
if (s.hideCta || !s.ctaScreenId) return s;
|
|
212
|
+
// No return path: the tile is embedded, so the form closes over its host.
|
|
213
|
+
return navigate(s, s.ctaScreenId === SIGN_IN_SCREEN && signInPresentation
|
|
214
|
+
? { screenId: SIGN_IN_SCREEN, presentation: signInPresentation, args: { mode: "signin", modal: "1" } }
|
|
215
|
+
: { screenId: s.ctaScreenId, args: { mode: s.ctaMode } });
|
|
216
|
+
},
|
|
206
217
|
},
|
|
207
218
|
});
|
|
208
219
|
export { svc };
|
|
@@ -26,6 +26,10 @@ interface AuthRouteInput {
|
|
|
26
26
|
returnScreenId?: string;
|
|
27
27
|
returnId?: string;
|
|
28
28
|
returnChannelId?: string;
|
|
29
|
+
/** Standalone sign-in only: "1" when it was opened as a modal (sheet / cover). */
|
|
30
|
+
modal?: string;
|
|
31
|
+
/** Modal only: the tab whose stack the return screen opens on once the modal closes. */
|
|
32
|
+
returnTab?: string;
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
// The screen's boot input survives refresh; consuming it must survive too.
|
|
@@ -61,6 +65,12 @@ function authIntentFromArg(arg: unknown, prev: Pick<S, "authIntent" | "authConte
|
|
|
61
65
|
};
|
|
62
66
|
}
|
|
63
67
|
|
|
68
|
+
/** How the standalone form leaves. A modal is closed: on web `back` pops the tab's stack,
|
|
69
|
+
* not the modal. A pushed form goes back. */
|
|
70
|
+
function leaveNav(): "dismiss" | "back" {
|
|
71
|
+
return routeInput().modal === "1" ? "dismiss" : "back";
|
|
72
|
+
}
|
|
73
|
+
|
|
64
74
|
/** Where a successful sign-in returns to, or null. Never Account itself — that would
|
|
65
75
|
* only push a second copy of the screen the member is already on. */
|
|
66
76
|
function resumeTarget(s: Pick<S, "returnScreenId" | "returnId" | "returnChannelId">): { screenId: string; args?: Record<string, string> } | null {
|
|
@@ -78,11 +88,26 @@ function resumeTarget(s: Pick<S, "returnScreenId" | "returnId" | "returnChannelI
|
|
|
78
88
|
* On the standalone sign-in screen the target is pushed, not a `replace`: on iOS and
|
|
79
89
|
* Android `replace` resets the stack to its root, which would drop the screens the
|
|
80
90
|
* visitor came through. Back from the target shows the form again, and the form sends a
|
|
81
|
-
* member back on appear (settle). With no target the form goes back.
|
|
91
|
+
* member back on appear (settle). With no target the form goes back.
|
|
92
|
+
*
|
|
93
|
+
* A modal form closes. A target pushed from here would open inside the modal (iOS, Android)
|
|
94
|
+
* or under it (web), so a modal that names a `returnTab` hands the target to that tab: the
|
|
95
|
+
* host closes the modal, then pushes it on that tab's stack (Account's member rows). A host
|
|
96
|
+
* showing no such tab (a drawer, a narrow Mac window) drops that request whole, modal and
|
|
97
|
+
* all, so the modal is also dismissed directly: it always closes, and the row opens where
|
|
98
|
+
* the tab exists. With no `returnTab` it only closes, and the screen under it loads again —
|
|
99
|
+
* the screen that opened the modal is the return target. */
|
|
82
100
|
function resumeAfterAuth(next: S): S {
|
|
83
101
|
const target = resumeTarget(next);
|
|
84
102
|
if (!next.isMember) return next;
|
|
85
|
-
|
|
103
|
+
const tab = routeInput().modal === "1" ? routeInput().returnTab ?? "" : "";
|
|
104
|
+
if (target && tab && next.standalone) {
|
|
105
|
+
routeInputConsumed = true;
|
|
106
|
+
void dispatch("himi.open", { presentation: "dismiss" });
|
|
107
|
+
const cleared = derive({ ...next, authIntent: "", authContextName: "", returnScreenId: "", returnId: "", returnChannelId: "" });
|
|
108
|
+
return navigate(cleared, target.args ? { tab, screenId: target.screenId, args: target.args } : { tab, screenId: target.screenId });
|
|
109
|
+
}
|
|
110
|
+
if (!target || routeInput().modal === "1") return next.standalone ? navigate(next, { presentation: leaveNav() }) : next;
|
|
86
111
|
routeInputConsumed = true;
|
|
87
112
|
const cleared = derive({ ...next, authIntent: "", authContextName: "", returnScreenId: "", returnId: "", returnChannelId: "" });
|
|
88
113
|
return navigate(cleared, target);
|
|
@@ -96,11 +121,31 @@ function forwardToSignIn(next: S): S {
|
|
|
96
121
|
if (!next.authIntent && !next.returnScreenId) return next;
|
|
97
122
|
routeInputConsumed = true;
|
|
98
123
|
const args: Record<string, string> = { mode: "signin" };
|
|
99
|
-
for (const key of ["authIntent", "authContextName"
|
|
100
|
-
if (next[key]) args[key === "authIntent" ? "intent" :
|
|
124
|
+
for (const key of ["authIntent", "authContextName"] as const) {
|
|
125
|
+
if (next[key]) args[key === "authIntent" ? "intent" : "contextName"] = next[key];
|
|
126
|
+
}
|
|
127
|
+
return openSignIn(derive({ ...next, authIntent: "", authContextName: "", returnScreenId: "", returnId: "", returnChannelId: "" }),
|
|
128
|
+
args, resumeTarget(next));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Account sends a guest to the standalone sign-in screen, with `after`, the member screen to
|
|
132
|
+
* open once signed in. With a `signInPresentation` appear param it opens as that modal, and
|
|
133
|
+
* `after` goes on Account's own tab (`signInReturnTab`) when the modal closes; pushed, the form
|
|
134
|
+
* pushes `after` itself (resumeAfterAuth). */
|
|
135
|
+
function openSignIn(next: S, args: Record<string, string>, after: { screenId: string; args?: Record<string, string> } | null): S {
|
|
136
|
+
const screenId = next.signInScreen || "himi_sign_in";
|
|
137
|
+
const presentation = signInPresentationRequested;
|
|
138
|
+
const back: Record<string, string> = {};
|
|
139
|
+
if (after) {
|
|
140
|
+
back.returnScreenId = after.screenId;
|
|
141
|
+
if (after.args?.id) back.returnId = after.args.id;
|
|
142
|
+
if (after.args?.channelId) back.returnChannelId = after.args.channelId;
|
|
101
143
|
}
|
|
102
|
-
return navigate(
|
|
103
|
-
|
|
144
|
+
if (!presentation) return navigate(next, { screenId, args: { ...args, ...back } });
|
|
145
|
+
const modalArgs: Record<string, string> = { ...args, modal: "1" };
|
|
146
|
+
// With no tab to open it on, a modal has no way to the member screen: it only closes.
|
|
147
|
+
if (after && signInReturnTabRequested) Object.assign(modalArgs, back, { returnTab: signInReturnTabRequested });
|
|
148
|
+
return navigate(next, { screenId, presentation, args: modalArgs });
|
|
104
149
|
}
|
|
105
150
|
|
|
106
151
|
/** After a load: the standalone sign-in screen sends a member back (a stale link, or a
|
|
@@ -128,8 +173,11 @@ function settle(next: S, arg: unknown, latest = true): S {
|
|
|
128
173
|
// The appear refresh returns `_nav`, which every host applies — binaries from before
|
|
129
174
|
// worker nav dispatch included. Only an arg-less load, whose result iOS
|
|
130
175
|
// discards, dispatches.
|
|
131
|
-
if (strField(arg, "standalone") === "1") return navigate(cleared, { presentation:
|
|
132
|
-
|
|
176
|
+
if (strField(arg, "standalone") === "1") return navigate(cleared, { presentation: leaveNav() });
|
|
177
|
+
// Not from a modal: nothing pushed over it comes back to it, and on iOS the closing modal's
|
|
178
|
+
// own screen reloads here once, after it has asked to close — a late dismiss would close
|
|
179
|
+
// whatever modal is open by then.
|
|
180
|
+
if (routeInput().modal !== "1") void dispatch("himi.open", { presentation: leaveNav() });
|
|
133
181
|
return cleared;
|
|
134
182
|
}
|
|
135
183
|
// Account forwards only on an appear refresh: the boot `load()` has no params and its
|
|
@@ -180,6 +228,10 @@ let appliedSeq = 0;
|
|
|
180
228
|
// The appear params belong to the worker session too, like the two flags above: a probe
|
|
181
229
|
// dropped because the visitor typed must not take them with it.
|
|
182
230
|
let signInScreenRequested = "";
|
|
231
|
+
/** Account only: how it opens the standalone sign-in screen ("" = push). */
|
|
232
|
+
let signInPresentationRequested: "" | "sheet" | "full_screen" = "";
|
|
233
|
+
/** Account only: its tab, where a member screen opens after a modal sign-in. */
|
|
234
|
+
let signInReturnTabRequested = "";
|
|
183
235
|
let standaloneRequested = false;
|
|
184
236
|
let pollIdentityRequested = false;
|
|
185
237
|
// Bumped by every mode switch, so a dropped probe never puts back a mode the visitor left.
|
|
@@ -210,6 +262,9 @@ function appearConfig(s: S, arg: unknown): AppearConfig {
|
|
|
210
262
|
passwordDraft = "";
|
|
211
263
|
}
|
|
212
264
|
signInScreenRequested ||= strField(arg, "signInScreen") || s.signInScreen;
|
|
265
|
+
const presentation = strField(arg, "signInPresentation");
|
|
266
|
+
if (presentation === "sheet" || presentation === "full_screen") signInPresentationRequested = presentation;
|
|
267
|
+
signInReturnTabRequested ||= strField(arg, "signInReturnTab");
|
|
213
268
|
// Only the sign-in screen's route carries `mode`, so it marks the form from the boot load on.
|
|
214
269
|
standaloneRequested ||= s.standalone || appearing || (!routeInputConsumed && !!routeInput().mode);
|
|
215
270
|
pollIdentityRequested ||= s.pollIdentity || strField(arg, "pollIdentity") === "1";
|
|
@@ -676,6 +731,7 @@ const svc = defineService<S, {
|
|
|
676
731
|
signOut: (s: S) => Promise<S>;
|
|
677
732
|
sync: (s: S) => Promise<S | undefined>;
|
|
678
733
|
openMember: (s: S, arg?: unknown) => Promise<S>;
|
|
734
|
+
leave: (s: S) => S;
|
|
679
735
|
restorePublish: (s: S) => S;
|
|
680
736
|
iapRestore: (s: S) => Promise<undefined>;
|
|
681
737
|
}>("himiStoreAccount", {
|
|
@@ -756,7 +812,8 @@ const svc = defineService<S, {
|
|
|
756
812
|
return "next" in r ? r.next : undefined;
|
|
757
813
|
},
|
|
758
814
|
// A row to a member-only screen shows to a guest too. A member opens it; a guest signs
|
|
759
|
-
// in first and the sign-in screen
|
|
815
|
+
// in first, and the sign-in screen then opens the row's screen — as a modal, by closing
|
|
816
|
+
// and pushing it on this tab (openSignIn) — so Back returns here either way.
|
|
760
817
|
openMember: async (s, arg): Promise<S> => {
|
|
761
818
|
const screenId = strField(arg, "screenId");
|
|
762
819
|
if (!screenId) return s;
|
|
@@ -764,8 +821,10 @@ const svc = defineService<S, {
|
|
|
764
821
|
// From the state as it is now: a probe may have landed during the identity read.
|
|
765
822
|
const now = svc.getState();
|
|
766
823
|
if (member) return navigate(now, { screenId });
|
|
767
|
-
return
|
|
824
|
+
return openSignIn(now, { mode: "signin" }, { screenId });
|
|
768
825
|
},
|
|
826
|
+
// The standalone form's Continue: leaves the form the way it was opened.
|
|
827
|
+
leave: (s) => navigate(s, { presentation: leaveNav() }),
|
|
769
828
|
// Typing means any focus request was delivered: clear the tokens (safe while mounted, since
|
|
770
829
|
// bumpToken never repeats), so a visit rarely ends — and a pooled form rarely reopens —
|
|
771
830
|
// holding one.
|
|
@@ -2158,8 +2158,10 @@ const SCREENS = runtimeSetting({
|
|
|
2158
2158
|
"actionId": "himi.open",
|
|
2159
2159
|
"params": {
|
|
2160
2160
|
"screenId": "himi_sign_in",
|
|
2161
|
-
"mode": "signin"
|
|
2162
|
-
|
|
2161
|
+
"mode": "signin",
|
|
2162
|
+
"modal": "1"
|
|
2163
|
+
},
|
|
2164
|
+
"presentation": "sheet"
|
|
2163
2165
|
}
|
|
2164
2166
|
}
|
|
2165
2167
|
}
|
|
@@ -2177,8 +2179,10 @@ const SCREENS = runtimeSetting({
|
|
|
2177
2179
|
"actionId": "himi.open",
|
|
2178
2180
|
"params": {
|
|
2179
2181
|
"screenId": "himi_sign_in",
|
|
2180
|
-
"mode": "register"
|
|
2181
|
-
|
|
2182
|
+
"mode": "register",
|
|
2183
|
+
"modal": "1"
|
|
2184
|
+
},
|
|
2185
|
+
"presentation": "sheet"
|
|
2182
2186
|
}
|
|
2183
2187
|
}
|
|
2184
2188
|
}
|
|
@@ -3298,6 +3302,8 @@ const SCREENS = runtimeSetting({
|
|
|
3298
3302
|
"memberAccountLinks": "1",
|
|
3299
3303
|
"restorePurchases": "1",
|
|
3300
3304
|
"signInScreen": "himi_sign_in",
|
|
3305
|
+
"signInPresentation": "sheet",
|
|
3306
|
+
"signInReturnTab": "profile",
|
|
3301
3307
|
"pollIdentity": "1",
|
|
3302
3308
|
"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.\"}"
|
|
3303
3309
|
}
|
|
@@ -3553,8 +3559,10 @@ const SCREENS = runtimeSetting({
|
|
|
3553
3559
|
"params": {
|
|
3554
3560
|
"screenId": "himi_sign_in",
|
|
3555
3561
|
"mode": "signin",
|
|
3556
|
-
"returnScreenId": "himi_account_settings"
|
|
3557
|
-
|
|
3562
|
+
"returnScreenId": "himi_account_settings",
|
|
3563
|
+
"modal": "1"
|
|
3564
|
+
},
|
|
3565
|
+
"presentation": "sheet"
|
|
3558
3566
|
}
|
|
3559
3567
|
}
|
|
3560
3568
|
},
|
|
@@ -5464,8 +5472,7 @@ const SCREENS = runtimeSetting({
|
|
|
5464
5472
|
"style": "primary",
|
|
5465
5473
|
"fullWidth": true,
|
|
5466
5474
|
"action": {
|
|
5467
|
-
"actionId": "
|
|
5468
|
-
"presentation": "back"
|
|
5475
|
+
"actionId": "tier5.himiStoreAccount.leave"
|
|
5469
5476
|
}
|
|
5470
5477
|
}
|
|
5471
5478
|
}
|
|
@@ -5506,7 +5513,7 @@ const SCREENS = runtimeSetting({
|
|
|
5506
5513
|
"declaredCapabilities": [
|
|
5507
5514
|
"wix_api"
|
|
5508
5515
|
],
|
|
5509
|
-
"minBinaryVersion": "
|
|
5516
|
+
"minBinaryVersion": "1.7.0",
|
|
5510
5517
|
"bundleVersion": "0.0.1"
|
|
5511
5518
|
}
|
|
5512
5519
|
},
|
|
@@ -6373,8 +6380,10 @@ const SCREENS = runtimeSetting({
|
|
|
6373
6380
|
"screenId": "himi_sign_in",
|
|
6374
6381
|
"mode": "signin",
|
|
6375
6382
|
"intent": "profile",
|
|
6376
|
-
"returnScreenId": "himi_view_profile"
|
|
6377
|
-
|
|
6383
|
+
"returnScreenId": "himi_view_profile",
|
|
6384
|
+
"modal": "1"
|
|
6385
|
+
},
|
|
6386
|
+
"presentation": "sheet"
|
|
6378
6387
|
}
|
|
6379
6388
|
}
|
|
6380
6389
|
}
|
|
@@ -7439,8 +7448,10 @@ const SCREENS = runtimeSetting({
|
|
|
7439
7448
|
"screenId": "himi_sign_in",
|
|
7440
7449
|
"mode": "signin",
|
|
7441
7450
|
"intent": "wallet",
|
|
7442
|
-
"returnScreenId": "himi_wallet"
|
|
7443
|
-
|
|
7451
|
+
"returnScreenId": "himi_wallet",
|
|
7452
|
+
"modal": "1"
|
|
7453
|
+
},
|
|
7454
|
+
"presentation": "sheet"
|
|
7444
7455
|
}
|
|
7445
7456
|
}
|
|
7446
7457
|
}
|
|
@@ -7908,11 +7919,7 @@ const SCREENS = runtimeSetting({
|
|
|
7908
7919
|
"size": "sm",
|
|
7909
7920
|
"fullWidth": true,
|
|
7910
7921
|
"action": {
|
|
7911
|
-
"actionId": "
|
|
7912
|
-
"params": {
|
|
7913
|
-
"screenId": "$service:himiPlaceSummary.ctaScreenId",
|
|
7914
|
-
"mode": "$service:himiPlaceSummary.ctaMode"
|
|
7915
|
-
}
|
|
7922
|
+
"actionId": "tier5.himiPlaceSummary.openCta"
|
|
7916
7923
|
}
|
|
7917
7924
|
}
|
|
7918
7925
|
},
|
|
@@ -7953,7 +7960,8 @@ const SCREENS = runtimeSetting({
|
|
|
7953
7960
|
"onAppear": {
|
|
7954
7961
|
"actionId": "tier5.himiPlaceSummary.load",
|
|
7955
7962
|
"params": {
|
|
7956
|
-
"verticals": "[\"plans\",\"feed\",\"events\",\"blog\",\"podcasts\"]"
|
|
7963
|
+
"verticals": "[\"plans\",\"feed\",\"events\",\"blog\",\"podcasts\"]",
|
|
7964
|
+
"signInPresentation": "sheet"
|
|
7957
7965
|
}
|
|
7958
7966
|
}
|
|
7959
7967
|
}
|
|
@@ -10899,8 +10907,10 @@ const SCREENS = runtimeSetting({
|
|
|
10899
10907
|
"actionId": "himi.open",
|
|
10900
10908
|
"params": {
|
|
10901
10909
|
"screenId": "himi_sign_in",
|
|
10902
|
-
"mode": "signin"
|
|
10903
|
-
|
|
10910
|
+
"mode": "signin",
|
|
10911
|
+
"modal": "1"
|
|
10912
|
+
},
|
|
10913
|
+
"presentation": "sheet"
|
|
10904
10914
|
}
|
|
10905
10915
|
}
|
|
10906
10916
|
},
|
|
@@ -11400,8 +11410,10 @@ const SCREENS = runtimeSetting({
|
|
|
11400
11410
|
"screenId": "himi_sign_in",
|
|
11401
11411
|
"mode": "signin",
|
|
11402
11412
|
"intent": "post",
|
|
11403
|
-
"returnScreenId": "himi_feed"
|
|
11404
|
-
|
|
11413
|
+
"returnScreenId": "himi_feed",
|
|
11414
|
+
"modal": "1"
|
|
11415
|
+
},
|
|
11416
|
+
"presentation": "sheet"
|
|
11405
11417
|
}
|
|
11406
11418
|
}
|
|
11407
11419
|
}
|
|
@@ -12018,8 +12030,10 @@ const SCREENS = runtimeSetting({
|
|
|
12018
12030
|
"screenId": "himi_sign_in",
|
|
12019
12031
|
"mode": "signin",
|
|
12020
12032
|
"intent": "post",
|
|
12021
|
-
"returnScreenId": "himi_create_post"
|
|
12022
|
-
|
|
12033
|
+
"returnScreenId": "himi_create_post",
|
|
12034
|
+
"modal": "1"
|
|
12035
|
+
},
|
|
12036
|
+
"presentation": "sheet"
|
|
12023
12037
|
}
|
|
12024
12038
|
}
|
|
12025
12039
|
}
|
|
@@ -19315,8 +19329,10 @@ const SCREENS = runtimeSetting({
|
|
|
19315
19329
|
"action": {
|
|
19316
19330
|
"actionId": "himi.open",
|
|
19317
19331
|
"params": {
|
|
19318
|
-
"screenId": "himi_sign_in"
|
|
19319
|
-
|
|
19332
|
+
"screenId": "himi_sign_in",
|
|
19333
|
+
"modal": "1"
|
|
19334
|
+
},
|
|
19335
|
+
"presentation": "sheet"
|
|
19320
19336
|
}
|
|
19321
19337
|
}
|
|
19322
19338
|
},
|
|
@@ -23676,8 +23692,10 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
23676
23692
|
"params": {
|
|
23677
23693
|
"screenId": "himi_sign_in",
|
|
23678
23694
|
"mode": "signin",
|
|
23679
|
-
"intent": "rsvp"
|
|
23680
|
-
|
|
23695
|
+
"intent": "rsvp",
|
|
23696
|
+
"modal": "1"
|
|
23697
|
+
},
|
|
23698
|
+
"presentation": "sheet"
|
|
23681
23699
|
}
|
|
23682
23700
|
}
|
|
23683
23701
|
},
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// `load` is both the onAppear action and what an embed controller's `refresh()` runs (arg-less:
|
|
10
10
|
// the stashed appear params keep the verticals and the copy pack), so a host that hears
|
|
11
11
|
// `booking.created` / `booking.cancelled` re-reads the summary without a remount.
|
|
12
|
-
import { defineService } from "@himalaya/state";
|
|
12
|
+
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";
|
|
@@ -52,6 +52,7 @@ const PLANS_SCREEN = "himi_plans";
|
|
|
52
52
|
const SIGN_IN_SCREEN = "himi_sign_in";
|
|
53
53
|
|
|
54
54
|
let stashedVerticals: string[] | null = null;
|
|
55
|
+
let signInPresentation: "sheet" | "full_screen" | undefined;
|
|
55
56
|
let generation = 0;
|
|
56
57
|
|
|
57
58
|
function appearVerticals(arg: unknown): string[] {
|
|
@@ -190,6 +191,8 @@ async function read(arg: unknown, again = true): Promise<PlaceSummaryState> {
|
|
|
190
191
|
* write back over the newer result. */
|
|
191
192
|
async function load(_s: PlaceSummaryState, arg?: unknown): Promise<PlaceSummaryState | undefined> {
|
|
192
193
|
stashCopy(arg);
|
|
194
|
+
const presentation = arg && typeof arg === "object" ? (arg as Record<string, unknown>).signInPresentation : undefined;
|
|
195
|
+
if (presentation === "sheet" || presentation === "full_screen") signInPresentation = presentation;
|
|
193
196
|
const mine = ++generation;
|
|
194
197
|
const next = await read(arg);
|
|
195
198
|
return mine === generation ? next : undefined;
|
|
@@ -198,11 +201,19 @@ async function load(_s: PlaceSummaryState, arg?: unknown): Promise<PlaceSummaryS
|
|
|
198
201
|
const svc = defineService<PlaceSummaryState, {
|
|
199
202
|
load: (s: PlaceSummaryState, arg?: unknown) => Promise<PlaceSummaryState | undefined>;
|
|
200
203
|
retry: (s: PlaceSummaryState) => Promise<PlaceSummaryState | undefined>;
|
|
204
|
+
openCta: (s: PlaceSummaryState) => PlaceSummaryState;
|
|
201
205
|
}>("himiPlaceSummary", {
|
|
202
206
|
state: BLANK,
|
|
203
207
|
actions: {
|
|
204
208
|
load,
|
|
205
209
|
retry: (s) => load(s),
|
|
210
|
+
openCta: (s) => {
|
|
211
|
+
if (s.hideCta || !s.ctaScreenId) return s;
|
|
212
|
+
// No return path: the tile is embedded, so the form closes over its host.
|
|
213
|
+
return navigate(s, s.ctaScreenId === SIGN_IN_SCREEN && signInPresentation
|
|
214
|
+
? { screenId: SIGN_IN_SCREEN, presentation: signInPresentation, args: { mode: "signin", modal: "1" } }
|
|
215
|
+
: { screenId: s.ctaScreenId, args: { mode: s.ctaMode } });
|
|
216
|
+
},
|
|
206
217
|
},
|
|
207
218
|
});
|
|
208
219
|
export { svc };
|