@wix/himalaya-cli 0.1033.0 → 0.1034.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 +398 -1
- package/templates/beauty-salon/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/beauty-salon/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/beauty-salon/tier5-src/himi-store-saved/index.ts +3 -2
- package/templates/beauty-salon/tier5-src/wix-spaces-collections/index.ts +3 -2
- package/templates/beauty-salon/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/beauty-salon/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/beauty-salon-owner/dev/index.ts +1216 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/branded-lite/dev/index.ts +2239 -343
- package/templates/branded-lite/tier5-src/_shared/branded-load-state.ts +106 -0
- package/templates/branded-lite/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/branded-lite/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/branded-lite/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-badges/index.ts +20 -16
- package/templates/branded-lite/tier5-src/himi-branded-lite-coupons/index.ts +20 -20
- package/templates/branded-lite/tier5-src/himi-branded-lite-donations/index.ts +20 -16
- package/templates/branded-lite/tier5-src/himi-branded-lite-forms/index.ts +23 -31
- package/templates/branded-lite/tier5-src/himi-branded-lite-galleries/index.ts +19 -14
- package/templates/branded-lite/tier5-src/himi-branded-lite-giftcards/index.ts +20 -16
- package/templates/branded-lite/tier5-src/himi-branded-lite-inbox/index.ts +20 -15
- package/templates/branded-lite/tier5-src/himi-branded-lite-invoices/index.ts +20 -16
- package/templates/branded-lite/tier5-src/himi-branded-lite-loyalty/index.ts +20 -17
- package/templates/branded-lite/tier5-src/himi-branded-lite-notifications/index.ts +20 -18
- package/templates/branded-lite/tier5-src/himi-branded-lite-notifsettings/index.ts +23 -19
- package/templates/branded-lite/tier5-src/himi-branded-lite-podcasts/index.ts +1 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-reservations/index.ts +24 -20
- package/templates/branded-lite/tier5-src/himi-branded-lite-reviews/index.ts +20 -17
- package/templates/branded-lite/tier5-src/himi-branded-lite-videos/index.ts +19 -15
- package/templates/branded-lite/tier5-src/himi-store-saved/index.ts +3 -2
- package/templates/branded-lite/tier5-src/wix-spaces-collections/index.ts +3 -2
- package/templates/branded-lite/tier5-src/wix-spaces-forum/index.ts +3 -2
- package/templates/branded-lite/tier5-src/wix-spaces-members/index.ts +19 -6
- package/templates/branded-lite/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/branded-lite/tier5-src/wix-spaces-new-message/index.ts +3 -2
- package/templates/branded-lite/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/community-club/dev/index.ts +283 -2
- package/templates/community-club/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/community-club/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/community-club/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/community-club/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/community-club-owner/dev/index.ts +1216 -0
- package/templates/community-club-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/events-meetups/dev/index.ts +197 -1
- package/templates/events-meetups/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/events-meetups/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/events-meetups/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/events-meetups/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/events-meetups-owner/dev/index.ts +1088 -0
- package/templates/events-meetups-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/gym-fitness/dev/index.ts +462 -1
- package/templates/gym-fitness/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/gym-fitness/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/gym-fitness/tier5-src/himi-store-saved/index.ts +3 -2
- package/templates/gym-fitness/tier5-src/wix-spaces-collections/index.ts +3 -2
- package/templates/gym-fitness/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/gym-fitness/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/gym-fitness-owner/dev/index.ts +1280 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/nonprofit-cause/dev/index.ts +264 -1
- package/templates/nonprofit-cause/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/nonprofit-cause/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/nonprofit-cause/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/nonprofit-cause/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/nonprofit-cause-owner/dev/index.ts +1152 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/owner-lite/dev/index.ts +1280 -0
- package/templates/owner-lite/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/owner-lite/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/podcast-creator/dev/index.ts +286 -23
- package/templates/podcast-creator/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/podcast-creator/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/podcast-creator/tier5-src/himi-branded-lite-podcasts/index.ts +1 -1
- package/templates/podcast-creator/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/podcast-creator/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/podcast-creator-owner/dev/index.ts +1216 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/portfolio-creative/dev/index.ts +353 -23
- package/templates/portfolio-creative/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/portfolio-creative/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/portfolio-creative/tier5-src/himi-store-saved/index.ts +3 -2
- package/templates/portfolio-creative/tier5-src/wix-spaces-collections/index.ts +3 -2
- package/templates/portfolio-creative/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/portfolio-creative-owner/dev/index.ts +1216 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/restaurant/dev/index.ts +197 -1
- package/templates/restaurant/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/restaurant/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/restaurant/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/restaurant/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/restaurant-owner/dev/index.ts +1280 -0
- package/templates/restaurant-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/retail-store/dev/index.ts +203 -1
- package/templates/retail-store/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/retail-store/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/retail-store/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/retail-store/tier5-src/himi-store-saved/index.ts +3 -2
- package/templates/retail-store/tier5-src/wix-spaces-collections/index.ts +3 -2
- package/templates/retail-store/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/retail-store-owner/dev/index.ts +1152 -0
- package/templates/retail-store-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/yoga-studio/dev/index.ts +392 -1
- package/templates/yoga-studio/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/yoga-studio/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/yoga-studio/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/yoga-studio/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/yoga-studio-owner/dev/index.ts +1152 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +36 -5
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
// same ChannelListQuery to the VOD public GraphQL endpoint through the raw
|
|
7
7
|
// `globalThis.himalaya.wixApi.call` bridge (which accepts absolute URLs + rides the
|
|
8
8
|
// app's WixApiCapability auth — same chokepoint wix-spaces-dashboard uses for
|
|
9
|
-
// manage.wix.com).
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// banner. Real channels always win the moment any exist.
|
|
9
|
+
// manage.wix.com). a failed query is an error with Retry (or Sign in), an
|
|
10
|
+
// empty one a real empty state; sample channels appear only in the host's explicit
|
|
11
|
+
// sample preview (_shared/branded-load-state.ts).
|
|
13
12
|
//
|
|
14
13
|
// Endpoint + query verbatim from wix-one-app-vod/src/api/v3 (env.ts + ChannelFetch.ts).
|
|
15
14
|
import { defineService } from "../_shared/collection-service.js";
|
|
15
|
+
import { LOADING, loaded, loadFailed, type LoadCopy, type LoadFlags } from "../_shared/branded-load-state.js";
|
|
16
16
|
|
|
17
17
|
const VOD_PUBLIC_GRAPHQL = "https://manage.wix.com/_api/vod/public/graphql";
|
|
18
18
|
const CHANNEL_LIST_QUERY = `
|
|
@@ -34,8 +34,7 @@ function wixApi(): WixApi | null {
|
|
|
34
34
|
|
|
35
35
|
interface VodChannel { id?: string; title?: string; description?: string; videos?: { total?: number }; hasPaidVideos?: boolean }
|
|
36
36
|
interface Row { id: string; title: string; subtitle: string }
|
|
37
|
-
interface S {
|
|
38
|
-
status: "loading" | "ready";
|
|
37
|
+
interface S extends LoadFlags {
|
|
39
38
|
channels: Row[]; emptyText: string;
|
|
40
39
|
isMock: boolean; notMock: boolean; /** #2849 — hiddenWhen() hides on TRUE, so these are inverted: the empty-state banner
|
|
41
40
|
* shows only when the site really has none, and the unavailable one only when the
|
|
@@ -57,17 +56,23 @@ const MOCK: Row[] = [
|
|
|
57
56
|
{ id: "sample-masterclass", title: "Masterclass", subtitle: "8 videos · Premium" },
|
|
58
57
|
];
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
/** sample rows reach the screen ONLY in the host's explicit sample preview;
|
|
60
|
+
* a failed or empty query is an honest error / empty state (branded-load-state.ts). */
|
|
61
|
+
const COPY: LoadCopy<Row> = {
|
|
62
|
+
prefix: "videos",
|
|
63
|
+
empty: "No videos yet — check back soon.",
|
|
64
|
+
error: "Videos couldn't be loaded.",
|
|
65
|
+
signIn: "Sign in to watch videos.",
|
|
66
|
+
sample: () => MOCK.map((r) => ({ ...r })),
|
|
67
|
+
};
|
|
63
68
|
|
|
64
69
|
const svc = defineService<S, { load: (s: S) => Promise<S> }>("himiBrandedVideos", {
|
|
65
|
-
state: {
|
|
70
|
+
state: { ...LOADING, channels: [], emptyText: "" },
|
|
66
71
|
actions: {
|
|
67
72
|
load: async (s) => {
|
|
68
73
|
try {
|
|
69
74
|
const api = wixApi();
|
|
70
|
-
if (!api) return
|
|
75
|
+
if (!api) return { ...s, ...loadFailed("channels", new Error("Wix bridge unavailable"), COPY) };
|
|
71
76
|
const res = (await api.call("POST", VOD_PUBLIC_GRAPHQL, { query: CHANNEL_LIST_QUERY, variables: {} })) as
|
|
72
77
|
{ data?: { channels?: { entities?: VodChannel[] } } } | { channels?: { entities?: VodChannel[] } };
|
|
73
78
|
// The gateway may return the GraphQL envelope ({data:{...}}) or the bridge may
|
|
@@ -76,10 +81,9 @@ const svc = defineService<S, { load: (s: S) => Promise<S> }>("himiBrandedVideos"
|
|
|
76
81
|
(res as { data?: { channels?: { entities?: VodChannel[] } } })?.data?.channels?.entities ??
|
|
77
82
|
(res as { channels?: { entities?: VodChannel[] } })?.channels?.entities ?? [];
|
|
78
83
|
const channels = entities.map(norm);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return mockState(s, "unavailable");
|
|
84
|
+
return { ...s, ...loaded("channels", channels, COPY) };
|
|
85
|
+
} catch (err) {
|
|
86
|
+
return { ...s, ...loadFailed("channels", err, COPY) };
|
|
83
87
|
}
|
|
84
88
|
},
|
|
85
89
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineService } from "@himalaya/state";
|
|
2
|
+
import { withEmptyFlags } from "../_shared/empty-flags.js";
|
|
2
3
|
import { readSavedProducts, removeSavedProduct, type SavedProduct } from "../_shared/himi-store-saved.js";
|
|
3
4
|
import { stashCopy, copyParam } from "../_shared/himi-copy.js";
|
|
4
5
|
|
|
@@ -25,7 +26,7 @@ function failed(s: S): S {
|
|
|
25
26
|
const svc = defineService<S, {
|
|
26
27
|
load: (s: S, arg?: unknown) => S;
|
|
27
28
|
remove: (s: S, arg?: unknown) => S;
|
|
28
|
-
}>("himiStoreSaved", {
|
|
29
|
+
}>("himiStoreSaved", withEmptyFlags({
|
|
29
30
|
state: shape({ status: "loading", rows: [], error: "" }),
|
|
30
31
|
actions: {
|
|
31
32
|
load: (s, arg) => {
|
|
@@ -41,5 +42,5 @@ const svc = defineService<S, {
|
|
|
41
42
|
} catch { return failed(s); }
|
|
42
43
|
},
|
|
43
44
|
},
|
|
44
|
-
});
|
|
45
|
+
}, { rows: "noRows" }));
|
|
45
46
|
export { svc };
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Prefer Catalog V3 Categories API (`queryStoreCategories`); V1 `queryCollections`
|
|
3
3
|
// returns HTTP 428 on modern CATALOG_V3 sites (docs/wix-authentication.md).
|
|
4
4
|
import { defineService } from "@himalaya/state";
|
|
5
|
+
import { withEmptyFlags } from "../_shared/empty-flags.js";
|
|
5
6
|
import {
|
|
6
7
|
categoryCount,
|
|
7
8
|
queryCollections,
|
|
@@ -71,7 +72,7 @@ async function loadCollections(): Promise<Loaded> {
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesCollections", {
|
|
75
|
+
const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesCollections", withEmptyFlags({
|
|
75
76
|
state: { status: "loading", collections: [], emptyText: "", error: "" },
|
|
76
77
|
actions: {
|
|
77
78
|
load: async () => {
|
|
@@ -93,6 +94,6 @@ const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesCollections"
|
|
|
93
94
|
};
|
|
94
95
|
},
|
|
95
96
|
},
|
|
96
|
-
});
|
|
97
|
+
}, { collections: "noCollections" }));
|
|
97
98
|
svc.load();
|
|
98
99
|
export { svc };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Tier-5 bundle: Wix Spaces clone — Forum posts list (ON-DEVICE, site-scoped).
|
|
2
2
|
// Emits a rich feed-card Row (F2) and supports client-side list search (D22).
|
|
3
3
|
import { defineService } from "@himalaya/state";
|
|
4
|
+
import { withEmptyFlags } from "../_shared/empty-flags.js";
|
|
4
5
|
import { queryPosts, type WixPost } from "@himalaya/wix-forum";
|
|
5
6
|
import { formatDateMedium } from "../_shared/engine-intl.js";
|
|
6
7
|
|
|
@@ -82,7 +83,7 @@ function filterRows(all: Row[], q: string): Row[] {
|
|
|
82
83
|
return all.filter((r) => r.name.toLowerCase().includes(t) || (r.subtitle || "").toLowerCase().includes(t));
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
const svc = defineService<S, { load: (s: S) => Promise<S>; filter: (s: S, arg?: unknown) => S }>("spacesForum", {
|
|
86
|
+
const svc = defineService<S, { load: (s: S) => Promise<S>; filter: (s: S, arg?: unknown) => S }>("spacesForum", withEmptyFlags({
|
|
86
87
|
state: { status: "loading", all: [], posts: [], emptyText: "" },
|
|
87
88
|
actions: {
|
|
88
89
|
load: async (s) => {
|
|
@@ -98,6 +99,6 @@ const svc = defineService<S, { load: (s: S) => Promise<S>; filter: (s: S, arg?:
|
|
|
98
99
|
return { ...s, posts: filtered, emptyText: filtered.length ? "" : "No results" };
|
|
99
100
|
},
|
|
100
101
|
},
|
|
101
|
-
});
|
|
102
|
+
}, { posts: "noPosts" }));
|
|
102
103
|
svc.load();
|
|
103
104
|
export { svc };
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
// Tier-5 bundle: Wix Spaces clone — Site Members list (ON-DEVICE, site-scoped).
|
|
2
2
|
// Mirrors wix-owner-members. Binds rows via $service:spacesMembers.members.
|
|
3
3
|
// Supports client-side list search (D22) via the filter action.
|
|
4
|
+
//
|
|
5
|
+
// Load states are explicit: `notLoading` gates a skeleton, `notErrored` an
|
|
6
|
+
// error card with Retry, and `hideSearch` keeps the search field off a list that has
|
|
7
|
+
// not loaded, failed, or has no members — a search box over nothing is not a state.
|
|
4
8
|
import { defineService } from "@himalaya/state";
|
|
9
|
+
import { withEmptyFlags } from "../_shared/empty-flags.js";
|
|
5
10
|
import { queryMembers, type WixMember } from "@himalaya/wix-members";
|
|
6
11
|
|
|
7
12
|
interface Row { id: string; name: string; subtitle: string; initial: string; photo: string }
|
|
8
|
-
interface S {
|
|
13
|
+
interface S {
|
|
14
|
+
status: "loading" | "ready" | "error";
|
|
15
|
+
all: Row[]; members: Row[]; emptyText: string;
|
|
16
|
+
error: string; notErrored: boolean; notLoading: boolean; hideSearch: boolean;
|
|
17
|
+
}
|
|
9
18
|
|
|
10
19
|
function name(m: WixMember): string {
|
|
11
20
|
const nick = m.profile?.nickname?.trim();
|
|
@@ -23,15 +32,19 @@ function filterRows(all: Row[], q: string): Row[] {
|
|
|
23
32
|
return all.filter((r) => r.name.toLowerCase().includes(t) || (r.subtitle || "").toLowerCase().includes(t));
|
|
24
33
|
}
|
|
25
34
|
|
|
26
|
-
const svc = defineService<S, { load: (s: S) => Promise<S>; filter: (s: S, arg?: unknown) => S }>("spacesMembers", {
|
|
27
|
-
state: { status: "loading", all: [], members: [], emptyText: "" },
|
|
35
|
+
const svc = defineService<S, { load: (s: S) => Promise<S>; filter: (s: S, arg?: unknown) => S }>("spacesMembers", withEmptyFlags({
|
|
36
|
+
state: { status: "loading", all: [], members: [], emptyText: "", error: "", notErrored: true, notLoading: false, hideSearch: true },
|
|
28
37
|
actions: {
|
|
29
38
|
load: async (s) => {
|
|
30
39
|
try {
|
|
31
40
|
const r = await queryMembers({ query: { paging: { limit: 50 } } });
|
|
32
41
|
const all = (r.members ?? []).map(norm);
|
|
33
|
-
return { status: "ready", all, members: all, emptyText: all.length ? "" : "No members yet"
|
|
34
|
-
|
|
42
|
+
return { status: "ready", all, members: all, emptyText: all.length ? "" : "No members yet",
|
|
43
|
+
error: "", notErrored: true, notLoading: true, hideSearch: all.length === 0 };
|
|
44
|
+
} catch {
|
|
45
|
+
return { ...s, status: "error", all: [], members: [], emptyText: "",
|
|
46
|
+
error: "Members couldn't be loaded.", notErrored: false, notLoading: true, hideSearch: true };
|
|
47
|
+
}
|
|
35
48
|
},
|
|
36
49
|
filter: (s, arg) => {
|
|
37
50
|
const q = (typeof arg === "string" ? arg : (arg as { value?: string })?.value || "").trim().toLowerCase();
|
|
@@ -39,6 +52,6 @@ const svc = defineService<S, { load: (s: S) => Promise<S>; filter: (s: S, arg?:
|
|
|
39
52
|
return { ...s, members: filtered, emptyText: filtered.length ? "" : "No results" };
|
|
40
53
|
},
|
|
41
54
|
},
|
|
42
|
-
});
|
|
55
|
+
}, { members: "noMembers" }));
|
|
43
56
|
svc.load();
|
|
44
57
|
export { svc };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Tier-5 bundle: Wix Spaces clone — My Subscriptions / plan orders (site-scoped).
|
|
2
2
|
import { defineService } from "@himalaya/state";
|
|
3
|
+
import { withEmptyFlags } from "../_shared/empty-flags.js";
|
|
3
4
|
import { dispatch } from "@himalaya/dispatch";
|
|
4
5
|
import { listPlanOrders, type WixPlanOrder } from "@himalaya/wix-pricing-plans";
|
|
5
6
|
|
|
@@ -21,6 +22,10 @@ const EMPTY_MEMBER = "No subscriptions yet";
|
|
|
21
22
|
const EMPTY_GUEST = "Sign in from Account to see subscriptions you’ve joined — we don’t invent sample memberships.";
|
|
22
23
|
const EMPTY_FORBIDDEN = "No subscriptions for this member yet.";
|
|
23
24
|
|
|
25
|
+
/** The signed-in member's email, or "" for anyone else. A visitor's identity is
|
|
26
|
+
* `{ email: "" }` and a failed lookup proves nothing, so both read as "no member": the
|
|
27
|
+
* plan-orders endpoint is not member-filtered, and calling it for a visitor would list
|
|
28
|
+
* orders that are not theirs. Fail closed. */
|
|
24
29
|
async function sessionEmail(): Promise<string> {
|
|
25
30
|
try {
|
|
26
31
|
const identity = await dispatch("himi.wix.memberIdentity") as unknown;
|
|
@@ -38,12 +43,16 @@ function looksForbidden(err: unknown): boolean {
|
|
|
38
43
|
return /403|FORBIDDEN|permission|denied|UNAUTHORIZED|401/i.test(msg);
|
|
39
44
|
}
|
|
40
45
|
|
|
41
|
-
const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesMySubscriptions", {
|
|
46
|
+
const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesMySubscriptions", withEmptyFlags({
|
|
42
47
|
state: { status: "loading", orders: [], emptyText: "", hideAccountCta: false },
|
|
43
48
|
actions: {
|
|
44
49
|
load: async () => {
|
|
45
50
|
const email = await sessionEmail();
|
|
46
51
|
const hideAccountCta = Boolean(email);
|
|
52
|
+
// plan orders are a MEMBER's own. With no signed-in member there is no
|
|
53
|
+
// "my" to list, whatever the endpoint answers (a dev mock or a cached session can
|
|
54
|
+
// answer it): a visitor must never see a subscription as theirs.
|
|
55
|
+
if (!email) return { status: "ready", orders: [], emptyText: EMPTY_GUEST, hideAccountCta: false };
|
|
47
56
|
try {
|
|
48
57
|
const r = await listPlanOrders();
|
|
49
58
|
const orders = (((r as unknown as { orders?: WixPlanOrder[] }).orders) ?? []).map(norm);
|
|
@@ -68,6 +77,6 @@ const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesMySubscripti
|
|
|
68
77
|
}
|
|
69
78
|
},
|
|
70
79
|
},
|
|
71
|
-
});
|
|
80
|
+
}, { orders: "noOrders" }));
|
|
72
81
|
svc.load();
|
|
73
82
|
export { svc };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Tier-5 bundle: Wix Spaces clone — New Message recipient picker (ON-DEVICE,
|
|
2
2
|
// site-scoped). Lists site members to start a chat with; mirrors spacesMembers.
|
|
3
3
|
import { defineService } from "@himalaya/state";
|
|
4
|
+
import { withEmptyFlags } from "../_shared/empty-flags.js";
|
|
4
5
|
import { queryMembers, type WixMember } from "@himalaya/wix-members";
|
|
5
6
|
|
|
6
7
|
interface Row { id: string; name: string; subtitle: string; initial: string; photo: string }
|
|
@@ -13,7 +14,7 @@ function name(m: WixMember): string {
|
|
|
13
14
|
return full || m.loginEmail?.trim() || "Member";
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesNewMessage", {
|
|
17
|
+
const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesNewMessage", withEmptyFlags({
|
|
17
18
|
state: { status: "loading", members: [], emptyText: "" },
|
|
18
19
|
actions: {
|
|
19
20
|
load: async (s) => {
|
|
@@ -27,6 +28,6 @@ const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesNewMessage",
|
|
|
27
28
|
} catch { return { ...s, status: "ready", emptyText: "No members to message" }; }
|
|
28
29
|
},
|
|
29
30
|
},
|
|
30
|
-
});
|
|
31
|
+
}, { members: "noMembers" }));
|
|
31
32
|
svc.load();
|
|
32
33
|
export { svc };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Tier-5 bundle: Wix Spaces clone — What's New (ON-DEVICE, account-level).
|
|
2
2
|
import { defineService } from "@himalaya/state";
|
|
3
|
+
import { withEmptyFlags } from "../_shared/empty-flags.js";
|
|
3
4
|
import { listAnnouncements, type WixAnnouncement } from "@himalaya/wix-new-releases";
|
|
4
5
|
|
|
5
6
|
interface Row { id: string; name: string; subtitle: string }
|
|
@@ -10,7 +11,7 @@ function norm(a: WixAnnouncement, i: number): Row {
|
|
|
10
11
|
return { id: aa.id || `a${i}`, name: aa.title || "Announcement", subtitle: aa.description || aa.bodyText || "" };
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesWhatsNew", {
|
|
14
|
+
const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesWhatsNew", withEmptyFlags({
|
|
14
15
|
state: { status: "loading", items: [], emptyText: "" },
|
|
15
16
|
actions: {
|
|
16
17
|
load: async (s) => {
|
|
@@ -21,6 +22,6 @@ const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesWhatsNew", {
|
|
|
21
22
|
} catch { return { ...s, status: "ready", items: [], emptyText: "Nothing new right now" }; }
|
|
22
23
|
},
|
|
23
24
|
},
|
|
24
|
-
});
|
|
25
|
+
}, { items: "noItems" }));
|
|
25
26
|
svc.load();
|
|
26
27
|
export { svc };
|
|
@@ -4566,7 +4566,8 @@ const SCREENS = runtimeSetting({
|
|
|
4566
4566
|
"props": {
|
|
4567
4567
|
"text": "$service:spacesDeleteAccount.message",
|
|
4568
4568
|
"style": "caption",
|
|
4569
|
-
"color": "textTertiary"
|
|
4569
|
+
"color": "textTertiary",
|
|
4570
|
+
"collapseWhenEmpty": true
|
|
4570
4571
|
}
|
|
4571
4572
|
}
|
|
4572
4573
|
},
|
|
@@ -4861,6 +4862,9 @@ const SCREENS = runtimeSetting({
|
|
|
4861
4862
|
}
|
|
4862
4863
|
]
|
|
4863
4864
|
}
|
|
4865
|
+
},
|
|
4866
|
+
"modifiers": {
|
|
4867
|
+
"hiddenPath": "$service:spacesWhatsNew.noItems"
|
|
4864
4868
|
}
|
|
4865
4869
|
},
|
|
4866
4870
|
{
|
|
@@ -6107,6 +6111,24 @@ const SCREENS = runtimeSetting({
|
|
|
6107
6111
|
"props": {
|
|
6108
6112
|
"spacing": 0,
|
|
6109
6113
|
"children": [
|
|
6114
|
+
{
|
|
6115
|
+
"id": "himi_events.list.collection.loading",
|
|
6116
|
+
"body": {
|
|
6117
|
+
"package": "himalaya",
|
|
6118
|
+
"type": "Skeleton",
|
|
6119
|
+
"props": {
|
|
6120
|
+
"height": 72,
|
|
6121
|
+
"cornerRadius": 12,
|
|
6122
|
+
"count": 3
|
|
6123
|
+
}
|
|
6124
|
+
},
|
|
6125
|
+
"modifiers": {
|
|
6126
|
+
"hiddenPath": "$service:himiEvents.collection.noLoading",
|
|
6127
|
+
"padding": {
|
|
6128
|
+
"bottom": 12
|
|
6129
|
+
}
|
|
6130
|
+
}
|
|
6131
|
+
},
|
|
6110
6132
|
{
|
|
6111
6133
|
"id": "",
|
|
6112
6134
|
"body": {
|
|
@@ -6368,6 +6390,52 @@ const SCREENS = runtimeSetting({
|
|
|
6368
6390
|
}
|
|
6369
6391
|
}
|
|
6370
6392
|
},
|
|
6393
|
+
{
|
|
6394
|
+
"id": "himi_events.list.collection.empty-source",
|
|
6395
|
+
"body": {
|
|
6396
|
+
"package": "himalaya",
|
|
6397
|
+
"type": "VStack",
|
|
6398
|
+
"props": {
|
|
6399
|
+
"spacing": 8,
|
|
6400
|
+
"alignment": "center",
|
|
6401
|
+
"children": [
|
|
6402
|
+
{
|
|
6403
|
+
"id": "",
|
|
6404
|
+
"body": {
|
|
6405
|
+
"package": "himalaya",
|
|
6406
|
+
"type": "Icon",
|
|
6407
|
+
"props": {
|
|
6408
|
+
"name": "inbox",
|
|
6409
|
+
"size": 28,
|
|
6410
|
+
"tint": "textTertiary"
|
|
6411
|
+
}
|
|
6412
|
+
},
|
|
6413
|
+
"modifiers": {
|
|
6414
|
+
"accessibilityRole": "decorative"
|
|
6415
|
+
}
|
|
6416
|
+
},
|
|
6417
|
+
{
|
|
6418
|
+
"id": "",
|
|
6419
|
+
"body": {
|
|
6420
|
+
"package": "himalaya",
|
|
6421
|
+
"type": "Text",
|
|
6422
|
+
"props": {
|
|
6423
|
+
"text": "$service:himiEvents.collection.emptySourceText",
|
|
6424
|
+
"style": "body",
|
|
6425
|
+
"color": "textSecondary"
|
|
6426
|
+
}
|
|
6427
|
+
}
|
|
6428
|
+
}
|
|
6429
|
+
]
|
|
6430
|
+
}
|
|
6431
|
+
},
|
|
6432
|
+
"modifiers": {
|
|
6433
|
+
"hiddenPath": "$service:himiEvents.collection.noEmptySource",
|
|
6434
|
+
"padding": {
|
|
6435
|
+
"bottom": 12
|
|
6436
|
+
}
|
|
6437
|
+
}
|
|
6438
|
+
},
|
|
6371
6439
|
{
|
|
6372
6440
|
"id": "",
|
|
6373
6441
|
"body": {
|
|
@@ -9411,6 +9479,24 @@ const SCREENS = runtimeSetting({
|
|
|
9411
9479
|
"props": {
|
|
9412
9480
|
"spacing": 0,
|
|
9413
9481
|
"children": [
|
|
9482
|
+
{
|
|
9483
|
+
"id": "himi_blog.list.collection.loading",
|
|
9484
|
+
"body": {
|
|
9485
|
+
"package": "himalaya",
|
|
9486
|
+
"type": "Skeleton",
|
|
9487
|
+
"props": {
|
|
9488
|
+
"height": 72,
|
|
9489
|
+
"cornerRadius": 12,
|
|
9490
|
+
"count": 3
|
|
9491
|
+
}
|
|
9492
|
+
},
|
|
9493
|
+
"modifiers": {
|
|
9494
|
+
"hiddenPath": "$service:himiBlogFeed.collection.noLoading",
|
|
9495
|
+
"padding": {
|
|
9496
|
+
"bottom": 12
|
|
9497
|
+
}
|
|
9498
|
+
}
|
|
9499
|
+
},
|
|
9414
9500
|
{
|
|
9415
9501
|
"id": "",
|
|
9416
9502
|
"body": {
|
|
@@ -9629,6 +9715,52 @@ const SCREENS = runtimeSetting({
|
|
|
9629
9715
|
}
|
|
9630
9716
|
}
|
|
9631
9717
|
},
|
|
9718
|
+
{
|
|
9719
|
+
"id": "himi_blog.list.collection.empty-source",
|
|
9720
|
+
"body": {
|
|
9721
|
+
"package": "himalaya",
|
|
9722
|
+
"type": "VStack",
|
|
9723
|
+
"props": {
|
|
9724
|
+
"spacing": 8,
|
|
9725
|
+
"alignment": "center",
|
|
9726
|
+
"children": [
|
|
9727
|
+
{
|
|
9728
|
+
"id": "",
|
|
9729
|
+
"body": {
|
|
9730
|
+
"package": "himalaya",
|
|
9731
|
+
"type": "Icon",
|
|
9732
|
+
"props": {
|
|
9733
|
+
"name": "inbox",
|
|
9734
|
+
"size": 28,
|
|
9735
|
+
"tint": "textTertiary"
|
|
9736
|
+
}
|
|
9737
|
+
},
|
|
9738
|
+
"modifiers": {
|
|
9739
|
+
"accessibilityRole": "decorative"
|
|
9740
|
+
}
|
|
9741
|
+
},
|
|
9742
|
+
{
|
|
9743
|
+
"id": "",
|
|
9744
|
+
"body": {
|
|
9745
|
+
"package": "himalaya",
|
|
9746
|
+
"type": "Text",
|
|
9747
|
+
"props": {
|
|
9748
|
+
"text": "$service:himiBlogFeed.collection.emptySourceText",
|
|
9749
|
+
"style": "body",
|
|
9750
|
+
"color": "textSecondary"
|
|
9751
|
+
}
|
|
9752
|
+
}
|
|
9753
|
+
}
|
|
9754
|
+
]
|
|
9755
|
+
}
|
|
9756
|
+
},
|
|
9757
|
+
"modifiers": {
|
|
9758
|
+
"hiddenPath": "$service:himiBlogFeed.collection.noEmptySource",
|
|
9759
|
+
"padding": {
|
|
9760
|
+
"bottom": 12
|
|
9761
|
+
}
|
|
9762
|
+
}
|
|
9763
|
+
},
|
|
9632
9764
|
{
|
|
9633
9765
|
"id": "",
|
|
9634
9766
|
"body": {
|
|
@@ -12434,6 +12566,24 @@ const SCREENS = runtimeSetting({
|
|
|
12434
12566
|
"props": {
|
|
12435
12567
|
"spacing": 0,
|
|
12436
12568
|
"children": [
|
|
12569
|
+
{
|
|
12570
|
+
"id": "himi_groups.rows.collection.loading",
|
|
12571
|
+
"body": {
|
|
12572
|
+
"package": "himalaya",
|
|
12573
|
+
"type": "Skeleton",
|
|
12574
|
+
"props": {
|
|
12575
|
+
"height": 72,
|
|
12576
|
+
"cornerRadius": 12,
|
|
12577
|
+
"count": 3
|
|
12578
|
+
}
|
|
12579
|
+
},
|
|
12580
|
+
"modifiers": {
|
|
12581
|
+
"hiddenPath": "$service:himiBrandedGroups.collection.noLoading",
|
|
12582
|
+
"padding": {
|
|
12583
|
+
"bottom": 12
|
|
12584
|
+
}
|
|
12585
|
+
}
|
|
12586
|
+
},
|
|
12437
12587
|
{
|
|
12438
12588
|
"id": "",
|
|
12439
12589
|
"body": {
|
|
@@ -12652,6 +12802,52 @@ const SCREENS = runtimeSetting({
|
|
|
12652
12802
|
}
|
|
12653
12803
|
}
|
|
12654
12804
|
},
|
|
12805
|
+
{
|
|
12806
|
+
"id": "himi_groups.rows.collection.empty-source",
|
|
12807
|
+
"body": {
|
|
12808
|
+
"package": "himalaya",
|
|
12809
|
+
"type": "VStack",
|
|
12810
|
+
"props": {
|
|
12811
|
+
"spacing": 8,
|
|
12812
|
+
"alignment": "center",
|
|
12813
|
+
"children": [
|
|
12814
|
+
{
|
|
12815
|
+
"id": "",
|
|
12816
|
+
"body": {
|
|
12817
|
+
"package": "himalaya",
|
|
12818
|
+
"type": "Icon",
|
|
12819
|
+
"props": {
|
|
12820
|
+
"name": "inbox",
|
|
12821
|
+
"size": 28,
|
|
12822
|
+
"tint": "textTertiary"
|
|
12823
|
+
}
|
|
12824
|
+
},
|
|
12825
|
+
"modifiers": {
|
|
12826
|
+
"accessibilityRole": "decorative"
|
|
12827
|
+
}
|
|
12828
|
+
},
|
|
12829
|
+
{
|
|
12830
|
+
"id": "",
|
|
12831
|
+
"body": {
|
|
12832
|
+
"package": "himalaya",
|
|
12833
|
+
"type": "Text",
|
|
12834
|
+
"props": {
|
|
12835
|
+
"text": "$service:himiBrandedGroups.collection.emptySourceText",
|
|
12836
|
+
"style": "body",
|
|
12837
|
+
"color": "textSecondary"
|
|
12838
|
+
}
|
|
12839
|
+
}
|
|
12840
|
+
}
|
|
12841
|
+
]
|
|
12842
|
+
}
|
|
12843
|
+
},
|
|
12844
|
+
"modifiers": {
|
|
12845
|
+
"hiddenPath": "$service:himiBrandedGroups.collection.noEmptySource",
|
|
12846
|
+
"padding": {
|
|
12847
|
+
"bottom": 12
|
|
12848
|
+
}
|
|
12849
|
+
}
|
|
12850
|
+
},
|
|
12655
12851
|
{
|
|
12656
12852
|
"id": "",
|
|
12657
12853
|
"body": {
|
|
@@ -14775,6 +14971,24 @@ const SCREENS = runtimeSetting({
|
|
|
14775
14971
|
"props": {
|
|
14776
14972
|
"spacing": 0,
|
|
14777
14973
|
"children": [
|
|
14974
|
+
{
|
|
14975
|
+
"id": "himi_cms.rows.collection.loading",
|
|
14976
|
+
"body": {
|
|
14977
|
+
"package": "himalaya",
|
|
14978
|
+
"type": "Skeleton",
|
|
14979
|
+
"props": {
|
|
14980
|
+
"height": 72,
|
|
14981
|
+
"cornerRadius": 12,
|
|
14982
|
+
"count": 3
|
|
14983
|
+
}
|
|
14984
|
+
},
|
|
14985
|
+
"modifiers": {
|
|
14986
|
+
"hiddenPath": "$service:himiBrandedCms.collection.noLoading",
|
|
14987
|
+
"padding": {
|
|
14988
|
+
"bottom": 12
|
|
14989
|
+
}
|
|
14990
|
+
}
|
|
14991
|
+
},
|
|
14778
14992
|
{
|
|
14779
14993
|
"id": "",
|
|
14780
14994
|
"body": {
|
|
@@ -15007,7 +15221,7 @@ const SCREENS = runtimeSetting({
|
|
|
15007
15221
|
"package": "himalaya",
|
|
15008
15222
|
"type": "Text",
|
|
15009
15223
|
"props": {
|
|
15010
|
-
"text": "
|
|
15224
|
+
"text": "$service:himiBrandedCms.collection.errorTitle",
|
|
15011
15225
|
"style": "bodyEmphasis"
|
|
15012
15226
|
}
|
|
15013
15227
|
}
|
|
@@ -15041,6 +15255,27 @@ const SCREENS = runtimeSetting({
|
|
|
15041
15255
|
"modifiers": {
|
|
15042
15256
|
"hiddenPath": "$service:himiBrandedCms.collection.noRetry"
|
|
15043
15257
|
}
|
|
15258
|
+
},
|
|
15259
|
+
{
|
|
15260
|
+
"id": "himi_cms.rows.collection.sign_in",
|
|
15261
|
+
"body": {
|
|
15262
|
+
"package": "himalaya",
|
|
15263
|
+
"type": "Button",
|
|
15264
|
+
"props": {
|
|
15265
|
+
"title": "Sign in",
|
|
15266
|
+
"style": "primary",
|
|
15267
|
+
"leadingIcon": "person",
|
|
15268
|
+
"action": {
|
|
15269
|
+
"actionId": "himi.open",
|
|
15270
|
+
"params": {
|
|
15271
|
+
"screenId": "himi_account"
|
|
15272
|
+
}
|
|
15273
|
+
}
|
|
15274
|
+
}
|
|
15275
|
+
},
|
|
15276
|
+
"modifiers": {
|
|
15277
|
+
"hiddenPath": "$service:himiBrandedCms.collection.noSignIn"
|
|
15278
|
+
}
|
|
15044
15279
|
}
|
|
15045
15280
|
]
|
|
15046
15281
|
}
|
|
@@ -15052,6 +15287,52 @@ const SCREENS = runtimeSetting({
|
|
|
15052
15287
|
}
|
|
15053
15288
|
}
|
|
15054
15289
|
},
|
|
15290
|
+
{
|
|
15291
|
+
"id": "himi_cms.rows.collection.empty-source",
|
|
15292
|
+
"body": {
|
|
15293
|
+
"package": "himalaya",
|
|
15294
|
+
"type": "VStack",
|
|
15295
|
+
"props": {
|
|
15296
|
+
"spacing": 8,
|
|
15297
|
+
"alignment": "center",
|
|
15298
|
+
"children": [
|
|
15299
|
+
{
|
|
15300
|
+
"id": "",
|
|
15301
|
+
"body": {
|
|
15302
|
+
"package": "himalaya",
|
|
15303
|
+
"type": "Icon",
|
|
15304
|
+
"props": {
|
|
15305
|
+
"name": "inbox",
|
|
15306
|
+
"size": 28,
|
|
15307
|
+
"tint": "textTertiary"
|
|
15308
|
+
}
|
|
15309
|
+
},
|
|
15310
|
+
"modifiers": {
|
|
15311
|
+
"accessibilityRole": "decorative"
|
|
15312
|
+
}
|
|
15313
|
+
},
|
|
15314
|
+
{
|
|
15315
|
+
"id": "",
|
|
15316
|
+
"body": {
|
|
15317
|
+
"package": "himalaya",
|
|
15318
|
+
"type": "Text",
|
|
15319
|
+
"props": {
|
|
15320
|
+
"text": "$service:himiBrandedCms.collection.emptySourceText",
|
|
15321
|
+
"style": "body",
|
|
15322
|
+
"color": "textSecondary"
|
|
15323
|
+
}
|
|
15324
|
+
}
|
|
15325
|
+
}
|
|
15326
|
+
]
|
|
15327
|
+
}
|
|
15328
|
+
},
|
|
15329
|
+
"modifiers": {
|
|
15330
|
+
"hiddenPath": "$service:himiBrandedCms.collection.noEmptySource",
|
|
15331
|
+
"padding": {
|
|
15332
|
+
"bottom": 12
|
|
15333
|
+
}
|
|
15334
|
+
}
|
|
15335
|
+
},
|
|
15055
15336
|
{
|
|
15056
15337
|
"id": "",
|
|
15057
15338
|
"body": {
|