@wix/himalaya-cli 0.1025.0 → 0.1026.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +0 -2
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +1031 -240
- package/templates/beauty-salon/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/beauty-salon/tier5-src/himi-branded-lite-orders/index.ts +4 -1
- package/templates/beauty-salon/tier5-src/wix-spaces-collection-detail/index.ts +9 -9
- package/templates/beauty-salon/tier5-src/wix-spaces-create-post/index.ts +14 -4
- package/templates/beauty-salon/tier5-src/wix-spaces-plan-detail/index.ts +7 -9
- package/templates/beauty-salon/tier5-src/wix-spaces-subscription-detail/index.ts +12 -11
- package/templates/beauty-salon/tier5-src/wix-spaces-view-profile/index.ts +22 -12
- package/templates/branded-lite/config.ts +3 -1
- package/templates/branded-lite/dev/index.ts +3455 -813
- package/templates/branded-lite/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-orders/index.ts +4 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio-project/index.ts +7 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-simple-detail/index.ts +4 -3
- package/templates/branded-lite/tier5-src/wix-spaces-chat-thread/index.ts +17 -4
- package/templates/branded-lite/tier5-src/wix-spaces-collection-detail/index.ts +9 -9
- package/templates/branded-lite/tier5-src/wix-spaces-coupon-detail/index.ts +7 -9
- package/templates/branded-lite/tier5-src/wix-spaces-create-post/index.ts +14 -4
- package/templates/branded-lite/tier5-src/wix-spaces-food-order-detail/index.ts +6 -3
- package/templates/branded-lite/tier5-src/wix-spaces-form-detail/index.ts +7 -9
- package/templates/branded-lite/tier5-src/wix-spaces-forum-post/index.ts +7 -9
- package/templates/branded-lite/tier5-src/wix-spaces-invoice-detail/index.ts +7 -9
- package/templates/branded-lite/tier5-src/wix-spaces-member-detail/index.ts +8 -8
- package/templates/branded-lite/tier5-src/wix-spaces-photo-albums/index.ts +8 -2
- package/templates/branded-lite/tier5-src/wix-spaces-plan-detail/index.ts +7 -9
- package/templates/branded-lite/tier5-src/wix-spaces-subscription-detail/index.ts +12 -11
- package/templates/branded-lite/tier5-src/wix-spaces-view-profile/index.ts +22 -12
- package/templates/community-club/dev/index.ts +345 -97
- package/templates/community-club/tier5-src/wix-spaces-create-post/index.ts +14 -4
- package/templates/community-club/tier5-src/wix-spaces-view-profile/index.ts +22 -12
- package/templates/events-meetups/dev/index.ts +345 -97
- package/templates/events-meetups/tier5-src/wix-spaces-create-post/index.ts +14 -4
- package/templates/events-meetups/tier5-src/wix-spaces-view-profile/index.ts +22 -12
- package/templates/gym-fitness/dev/index.ts +1031 -240
- package/templates/gym-fitness/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/gym-fitness/tier5-src/himi-branded-lite-orders/index.ts +4 -1
- package/templates/gym-fitness/tier5-src/wix-spaces-collection-detail/index.ts +9 -9
- package/templates/gym-fitness/tier5-src/wix-spaces-create-post/index.ts +14 -4
- package/templates/gym-fitness/tier5-src/wix-spaces-plan-detail/index.ts +7 -9
- package/templates/gym-fitness/tier5-src/wix-spaces-subscription-detail/index.ts +12 -11
- package/templates/gym-fitness/tier5-src/wix-spaces-view-profile/index.ts +22 -12
- package/templates/nonprofit-cause/dev/index.ts +732 -188
- package/templates/nonprofit-cause/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/nonprofit-cause/tier5-src/wix-spaces-create-post/index.ts +14 -4
- package/templates/nonprofit-cause/tier5-src/wix-spaces-plan-detail/index.ts +7 -9
- package/templates/nonprofit-cause/tier5-src/wix-spaces-subscription-detail/index.ts +12 -11
- package/templates/nonprofit-cause/tier5-src/wix-spaces-view-profile/index.ts +22 -12
- package/templates/podcast-creator/dev/index.ts +942 -321
- package/templates/podcast-creator/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/podcast-creator/tier5-src/himi-branded-lite-simple-detail/index.ts +4 -3
- package/templates/podcast-creator/tier5-src/wix-spaces-create-post/index.ts +14 -4
- package/templates/podcast-creator/tier5-src/wix-spaces-plan-detail/index.ts +7 -9
- package/templates/podcast-creator/tier5-src/wix-spaces-subscription-detail/index.ts +12 -11
- package/templates/podcast-creator/tier5-src/wix-spaces-view-profile/index.ts +22 -12
- package/templates/portfolio-creative/dev/index.ts +676 -169
- package/templates/portfolio-creative/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-orders/index.ts +4 -1
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio-project/index.ts +7 -2
- package/templates/portfolio-creative/tier5-src/wix-spaces-collection-detail/index.ts +9 -9
- package/templates/portfolio-creative/tier5-src/wix-spaces-create-post/index.ts +14 -4
- package/templates/portfolio-creative/tier5-src/wix-spaces-view-profile/index.ts +22 -12
- package/templates/restaurant/dev/index.ts +529 -149
- package/templates/restaurant/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/restaurant/tier5-src/wix-spaces-create-post/index.ts +14 -4
- package/templates/restaurant/tier5-src/wix-spaces-food-order-detail/index.ts +6 -3
- package/templates/restaurant/tier5-src/wix-spaces-view-profile/index.ts +22 -12
- package/templates/retail-store/dev/index.ts +643 -148
- package/templates/retail-store/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/retail-store/tier5-src/himi-branded-lite-orders/index.ts +4 -1
- package/templates/retail-store/tier5-src/wix-spaces-collection-detail/index.ts +9 -9
- package/templates/retail-store/tier5-src/wix-spaces-create-post/index.ts +14 -4
- package/templates/retail-store/tier5-src/wix-spaces-view-profile/index.ts +22 -12
- package/templates/yoga-studio/dev/index.ts +711 -183
- package/templates/yoga-studio/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/yoga-studio/tier5-src/wix-spaces-create-post/index.ts +14 -4
- package/templates/yoga-studio/tier5-src/wix-spaces-plan-detail/index.ts +7 -9
- package/templates/yoga-studio/tier5-src/wix-spaces-subscription-detail/index.ts +12 -11
- package/templates/yoga-studio/tier5-src/wix-spaces-view-profile/index.ts +22 -12
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
// paint the seeded "apptestercoowner" demo identity when the session is a real
|
|
4
4
|
// member (or a guest — show honesty instead).
|
|
5
5
|
import { defineService } from "@himalaya/state";
|
|
6
|
-
import {
|
|
6
|
+
import { memberAccess } from "../_shared/member-access.js";
|
|
7
7
|
import { getMyData, displayName } from "@himalaya/wix-users";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// `needsSignIn` / `noSignIn` drive the shared member gate: a guest gets the
|
|
10
|
+
// gate with a Sign in button and no placeholder profile. `profileHidden` stays true until
|
|
11
|
+
// `load` has resolved a member, so a guest never glimpses the placeholder avatar while
|
|
12
|
+
// the membership check is still running; `hideLoading` is false for exactly that moment,
|
|
13
|
+
// so the screen shows a loading line instead of going blank.
|
|
14
|
+
interface S { status: "loading" | "ready"; name: string; handle: string; about: string; initial: string; photo: string; needsSignIn: boolean; noSignIn: boolean; profileHidden: boolean; hideLoading: boolean }
|
|
10
15
|
|
|
11
16
|
const EMPTY: S = {
|
|
12
17
|
status: "loading",
|
|
@@ -15,18 +20,17 @@ const EMPTY: S = {
|
|
|
15
20
|
about: "No info to display.",
|
|
16
21
|
initial: "?",
|
|
17
22
|
photo: "",
|
|
23
|
+
needsSignIn: false,
|
|
24
|
+
noSignIn: true,
|
|
25
|
+
profileHidden: true,
|
|
26
|
+
hideLoading: false,
|
|
18
27
|
};
|
|
19
28
|
|
|
29
|
+
// The SAME member check create-post and orders use (`memberAccess`: the host's
|
|
30
|
+
// memberIdentity, falling back to wix-users only on hosts that predate that action), so
|
|
31
|
+
// one shared gate never gives two answers in one app.
|
|
20
32
|
async function sessionEmail(): Promise<string> {
|
|
21
|
-
|
|
22
|
-
const identity = await dispatch("himi.wix.memberIdentity") as unknown;
|
|
23
|
-
const direct = identity as { email?: unknown } | null;
|
|
24
|
-
const wrapped = identity as { payload?: { email?: unknown } } | null;
|
|
25
|
-
const email = direct?.email ?? wrapped?.payload?.email;
|
|
26
|
-
return typeof email === "string" ? email.trim() : "";
|
|
27
|
-
} catch {
|
|
28
|
-
return "";
|
|
29
|
-
}
|
|
33
|
+
return (await memberAccess()).email;
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
function wixApi() {
|
|
@@ -37,7 +41,7 @@ function fromParts(name: string, handleRaw: string, about: string, photo = ""):
|
|
|
37
41
|
const clean = name.trim();
|
|
38
42
|
const handle = "@" + (handleRaw || clean || "member").replace(/\s+/g, "").replace(/^@+/, "").toLowerCase();
|
|
39
43
|
const initial = (clean.split(/\s+/).filter(Boolean).map((w) => w[0]).join("").slice(0, 2) || "?").toUpperCase();
|
|
40
|
-
return { status: "ready", name: clean || "Member", handle, about: about || "No info to display.", initial, photo };
|
|
44
|
+
return { status: "ready", name: clean || "Member", handle, about: about || "No info to display.", initial, photo, needsSignIn: false, noSignIn: true, profileHidden: false, hideLoading: true };
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesViewProfile", {
|
|
@@ -48,11 +52,17 @@ const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesViewProfile"
|
|
|
48
52
|
if (!email) {
|
|
49
53
|
return {
|
|
50
54
|
status: "ready",
|
|
55
|
+
// Kept for hosts without the shared member gate (the Spaces clone renders these
|
|
56
|
+
// fields directly); branded-lite hides the profile block behind `profileHidden`.
|
|
51
57
|
name: "Sign in to view your profile",
|
|
52
58
|
handle: "",
|
|
53
59
|
about: "Your public profile is available after you sign in from Account.",
|
|
54
60
|
initial: "?",
|
|
55
61
|
photo: "",
|
|
62
|
+
needsSignIn: true,
|
|
63
|
+
noSignIn: false,
|
|
64
|
+
profileHidden: true,
|
|
65
|
+
hideLoading: true,
|
|
56
66
|
};
|
|
57
67
|
}
|
|
58
68
|
try {
|