@wix/himalaya-cli 0.1760.0 → 0.1761.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 +880 -717
- package/guides/one-app-section-mappings.md +6 -7
- package/guides/one-app-to-himi-app.md +3 -3
- package/package.json +2 -2
- package/templates/beauty-salon/recipes/programs-participant-carousel.json +257 -0
- package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +7 -4
- package/templates/branded-lite/recipes/programs-participant-carousel.json +257 -0
- package/templates/branded-lite/tier5-src/_shared/programs-section.ts +7 -4
- package/templates/community-club/recipes/programs-participant-carousel.json +257 -0
- package/templates/community-club/tier5-src/_shared/programs-section.ts +7 -4
- package/templates/events-meetups/recipes/programs-participant-carousel.json +257 -0
- package/templates/events-meetups/tier5-src/_shared/programs-section.ts +7 -4
- package/templates/gym-fitness/recipes/programs-participant-carousel.json +257 -0
- package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +7 -4
- package/templates/nonprofit-cause/recipes/programs-participant-carousel.json +257 -0
- package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +7 -4
- package/templates/podcast-creator/recipes/programs-participant-carousel.json +257 -0
- package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +7 -4
- package/templates/portfolio-creative/recipes/programs-participant-carousel.json +257 -0
- package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +7 -4
- package/templates/restaurant/recipes/programs-participant-carousel.json +257 -0
- package/templates/restaurant/tier5-src/_shared/programs-section.ts +7 -4
- package/templates/retail-store/recipes/programs-participant-carousel.json +257 -0
- package/templates/retail-store/tier5-src/_shared/programs-section.ts +7 -4
- package/templates/yoga-studio/recipes/programs-participant-carousel.json +257 -0
- package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +7 -4
|
@@ -456,6 +456,8 @@ export interface ProgramsSectionOptions {
|
|
|
456
456
|
showPrice?: boolean;
|
|
457
457
|
/** Program ids promoted to the front, in this order (source `sortingSettings.ordering === "MANUAL"`). */
|
|
458
458
|
order?: string[];
|
|
459
|
+
/** carousel: the member's own participations only (the One App participant carousel). Signed out, empty or failed reads show nothing. */
|
|
460
|
+
participating?: boolean;
|
|
459
461
|
/** list: hide a filter the source section turns off. */
|
|
460
462
|
filters?: { status?: boolean; category?: boolean };
|
|
461
463
|
/** list: the section's inline mode: show this many cards, no paging, and offer See all while more programs exist
|
|
@@ -471,10 +473,11 @@ const ORDER_LIMIT = 100;
|
|
|
471
473
|
export function registerProgramsSection(serviceName: string, options: ProgramsSectionOptions = { layout: "list" }) {
|
|
472
474
|
const carousel = options.layout === "carousel";
|
|
473
475
|
const display: Display = { card: carousel, duration: options.showDuration !== false, participants: options.showParticipants !== false };
|
|
474
|
-
const showPrice = options.showPrice !== false;
|
|
476
|
+
const showPrice = options.showPrice !== false && !options.participating;
|
|
475
477
|
const limit = Math.min(PAGE_SIZE, Math.max(1, Math.floor(options.limit ?? CAROUSEL_LIMIT)));
|
|
476
478
|
const inlineLimit = !carousel && options.inlineLimit !== undefined && options.inlineLimit > 0 ? Math.min(PAGE_SIZE, Math.floor(options.inlineLimit)) : 0;
|
|
477
|
-
|
|
479
|
+
// A promoted program is read by id, so it would bypass the member's participations: the participant carousel has no manual order.
|
|
480
|
+
const order = (options.participating ? [] : options.order ?? []).filter((id) => typeof id === "string" && id).slice(0, ORDER_LIMIT);
|
|
478
481
|
/** The promoted programs, in their configured order. A failed read promotes nothing: the default order stands. */
|
|
479
482
|
async function promotedPrograms(): Promise<WixProgram[]> {
|
|
480
483
|
if (!order.length) return [];
|
|
@@ -505,7 +508,7 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
505
508
|
return { status: status === "joined" ? "joined" : "all", categoryId: rest.join("|") };
|
|
506
509
|
}
|
|
507
510
|
|
|
508
|
-
let statusFilter: "all" | "joined" = "all";
|
|
511
|
+
let statusFilter: "all" | "joined" = options.participating ? "joined" : "all";
|
|
509
512
|
let categoryId = "";
|
|
510
513
|
let pageScope: Scope | undefined;
|
|
511
514
|
|
|
@@ -702,7 +705,7 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
702
705
|
async retry() { await controller.retry(); return undefined; },
|
|
703
706
|
setStatus(state, arg) {
|
|
704
707
|
const value = (arg as { selectedId?: unknown } | undefined)?.selectedId;
|
|
705
|
-
const next = value === "joined" ? "joined" : value === "all" ? "all" : undefined;
|
|
708
|
+
const next = value === "joined" ? "joined" : value === "all" && !options.participating ? "all" : undefined;
|
|
706
709
|
if (!next || next === statusFilter) return state;
|
|
707
710
|
statusFilter = next;
|
|
708
711
|
return controller.query(criteria()).then(() => undefined);
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_recipe": "The member's participating programs (title, horizontal rail with the member's progress, and a button to all their programs). Service: registerProgramsSection(svc,{layout:'carousel',participating:true,...}). Hidden whole unless the member has programs to show.",
|
|
3
|
+
"_placeholders": {
|
|
4
|
+
"svc": "service name the page worker registered with registerProgramsSection",
|
|
5
|
+
"id": "unique node id prefix",
|
|
6
|
+
"detailScreen": "program detail screen id, himi_program",
|
|
7
|
+
"memberProgramsScreen": "the member's programs screen id, himi_member_programs",
|
|
8
|
+
"heading": "the source section's own title when it shows one, else an empty string",
|
|
9
|
+
"ctaLabel": "the call-to-action button's label"
|
|
10
|
+
},
|
|
11
|
+
"node": {
|
|
12
|
+
"id": "{{id}}.participant",
|
|
13
|
+
"body": {
|
|
14
|
+
"package": "himalaya",
|
|
15
|
+
"type": "VStack",
|
|
16
|
+
"props": {
|
|
17
|
+
"spacing": 12,
|
|
18
|
+
"alignment": "leading",
|
|
19
|
+
"children": [
|
|
20
|
+
{
|
|
21
|
+
"id": "{{id}}.heading",
|
|
22
|
+
"body": {
|
|
23
|
+
"package": "himalaya",
|
|
24
|
+
"type": "Text",
|
|
25
|
+
"props": {
|
|
26
|
+
"text": "{{heading}}",
|
|
27
|
+
"style": "title3",
|
|
28
|
+
"collapseWhenEmpty": true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "{{id}}.carousel",
|
|
34
|
+
"body": {
|
|
35
|
+
"package": "himalaya",
|
|
36
|
+
"type": "Carousel",
|
|
37
|
+
"props": {
|
|
38
|
+
"itemsPath": "$service:{{svc}}.rows",
|
|
39
|
+
"items": [
|
|
40
|
+
{
|
|
41
|
+
"id": "{{id}}.card",
|
|
42
|
+
"body": {
|
|
43
|
+
"package": "himalaya",
|
|
44
|
+
"type": "VStack",
|
|
45
|
+
"props": {
|
|
46
|
+
"spacing": 8,
|
|
47
|
+
"alignment": "leading",
|
|
48
|
+
"children": [
|
|
49
|
+
{
|
|
50
|
+
"id": "",
|
|
51
|
+
"body": {
|
|
52
|
+
"package": "himalaya",
|
|
53
|
+
"type": "ZStack",
|
|
54
|
+
"props": {
|
|
55
|
+
"alignment": "leading",
|
|
56
|
+
"children": [
|
|
57
|
+
{
|
|
58
|
+
"id": "",
|
|
59
|
+
"body": {
|
|
60
|
+
"package": "himalaya",
|
|
61
|
+
"type": "Image",
|
|
62
|
+
"props": {
|
|
63
|
+
"url": "$item.image",
|
|
64
|
+
"fillWidth": true,
|
|
65
|
+
"height": 180,
|
|
66
|
+
"contentMode": "fill",
|
|
67
|
+
"contentDescription": "$item.name"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"modifiers": {
|
|
71
|
+
"cornerRadius": 8,
|
|
72
|
+
"fillMaxWidth": true,
|
|
73
|
+
"hiddenPath": "$item.noImage"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "",
|
|
78
|
+
"body": {
|
|
79
|
+
"package": "himalaya",
|
|
80
|
+
"type": "ZStack",
|
|
81
|
+
"props": {
|
|
82
|
+
"alignment": "center",
|
|
83
|
+
"children": [
|
|
84
|
+
{
|
|
85
|
+
"id": "",
|
|
86
|
+
"body": {
|
|
87
|
+
"package": "himalaya",
|
|
88
|
+
"type": "Text",
|
|
89
|
+
"props": {
|
|
90
|
+
"text": "$item.initial",
|
|
91
|
+
"style": "display",
|
|
92
|
+
"maxLines": 1,
|
|
93
|
+
"color": "textOnAccent"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"modifiers": {
|
|
101
|
+
"fillMaxWidth": true,
|
|
102
|
+
"height": 180,
|
|
103
|
+
"background": {
|
|
104
|
+
"token": "accentPrimary"
|
|
105
|
+
},
|
|
106
|
+
"cornerRadius": 8,
|
|
107
|
+
"hiddenPath": "$item.hasImage"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "",
|
|
116
|
+
"body": {
|
|
117
|
+
"package": "himalaya",
|
|
118
|
+
"type": "Text",
|
|
119
|
+
"props": {
|
|
120
|
+
"text": "$item.name",
|
|
121
|
+
"style": "bodyEmphasis",
|
|
122
|
+
"maxLines": 2
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "",
|
|
128
|
+
"body": {
|
|
129
|
+
"package": "himalaya",
|
|
130
|
+
"type": "Text",
|
|
131
|
+
"props": {
|
|
132
|
+
"text": "$item.durationLine",
|
|
133
|
+
"style": "footnote",
|
|
134
|
+
"maxLines": 1,
|
|
135
|
+
"color": "textSecondary",
|
|
136
|
+
"collapseWhenEmpty": true
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"modifiers": {
|
|
140
|
+
"hiddenPath": "$item.noDuration"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "",
|
|
145
|
+
"body": {
|
|
146
|
+
"package": "himalaya",
|
|
147
|
+
"type": "Text",
|
|
148
|
+
"props": {
|
|
149
|
+
"text": "$item.accessLine",
|
|
150
|
+
"style": "footnote",
|
|
151
|
+
"maxLines": 1,
|
|
152
|
+
"color": "textSecondary",
|
|
153
|
+
"collapseWhenEmpty": true
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"modifiers": {
|
|
157
|
+
"hiddenPath": "$item.noAccess"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "",
|
|
162
|
+
"body": {
|
|
163
|
+
"package": "himalaya",
|
|
164
|
+
"type": "Text",
|
|
165
|
+
"props": {
|
|
166
|
+
"text": "$item.descriptionLine",
|
|
167
|
+
"style": "footnote",
|
|
168
|
+
"maxLines": 2,
|
|
169
|
+
"color": "textSecondary",
|
|
170
|
+
"collapseWhenEmpty": true
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "",
|
|
176
|
+
"body": {
|
|
177
|
+
"package": "himalaya",
|
|
178
|
+
"type": "ProgressBar",
|
|
179
|
+
"props": {
|
|
180
|
+
"progress": 0,
|
|
181
|
+
"progressPath": "$item.progress"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"modifiers": {
|
|
185
|
+
"hiddenPath": "$item.noProgress"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"modifiers": {
|
|
192
|
+
"background": {
|
|
193
|
+
"token": "surfaceElevated"
|
|
194
|
+
},
|
|
195
|
+
"border": {
|
|
196
|
+
"width": 1,
|
|
197
|
+
"color": {
|
|
198
|
+
"token": "border"
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"cornerRadius": 8,
|
|
202
|
+
"padding": {
|
|
203
|
+
"leading": 12,
|
|
204
|
+
"trailing": 12,
|
|
205
|
+
"top": 12,
|
|
206
|
+
"bottom": 8
|
|
207
|
+
},
|
|
208
|
+
"onTap": {
|
|
209
|
+
"actionId": "himi.open",
|
|
210
|
+
"params": {
|
|
211
|
+
"screenId": "{{detailScreen}}",
|
|
212
|
+
"id": "$item.id"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"pressFeedback": "scale",
|
|
216
|
+
"haptic": "light",
|
|
217
|
+
"accessibilityLabel": "$item.name",
|
|
218
|
+
"width": 280
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"id": "{{id}}.cta",
|
|
227
|
+
"body": {
|
|
228
|
+
"package": "himalaya",
|
|
229
|
+
"type": "Button",
|
|
230
|
+
"props": {
|
|
231
|
+
"title": "{{ctaLabel}}",
|
|
232
|
+
"style": "secondary",
|
|
233
|
+
"size": "md",
|
|
234
|
+
"fullWidth": true,
|
|
235
|
+
"action": {
|
|
236
|
+
"actionId": "himi.open",
|
|
237
|
+
"params": {
|
|
238
|
+
"screenId": "{{memberProgramsScreen}}"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"modifiers": {
|
|
248
|
+
"padding": {
|
|
249
|
+
"leading": 16,
|
|
250
|
+
"trailing": 16,
|
|
251
|
+
"top": 8,
|
|
252
|
+
"bottom": 8
|
|
253
|
+
},
|
|
254
|
+
"hiddenPath": "$service:{{svc}}.hideList"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
@@ -456,6 +456,8 @@ export interface ProgramsSectionOptions {
|
|
|
456
456
|
showPrice?: boolean;
|
|
457
457
|
/** Program ids promoted to the front, in this order (source `sortingSettings.ordering === "MANUAL"`). */
|
|
458
458
|
order?: string[];
|
|
459
|
+
/** carousel: the member's own participations only (the One App participant carousel). Signed out, empty or failed reads show nothing. */
|
|
460
|
+
participating?: boolean;
|
|
459
461
|
/** list: hide a filter the source section turns off. */
|
|
460
462
|
filters?: { status?: boolean; category?: boolean };
|
|
461
463
|
/** list: the section's inline mode: show this many cards, no paging, and offer See all while more programs exist
|
|
@@ -471,10 +473,11 @@ const ORDER_LIMIT = 100;
|
|
|
471
473
|
export function registerProgramsSection(serviceName: string, options: ProgramsSectionOptions = { layout: "list" }) {
|
|
472
474
|
const carousel = options.layout === "carousel";
|
|
473
475
|
const display: Display = { card: carousel, duration: options.showDuration !== false, participants: options.showParticipants !== false };
|
|
474
|
-
const showPrice = options.showPrice !== false;
|
|
476
|
+
const showPrice = options.showPrice !== false && !options.participating;
|
|
475
477
|
const limit = Math.min(PAGE_SIZE, Math.max(1, Math.floor(options.limit ?? CAROUSEL_LIMIT)));
|
|
476
478
|
const inlineLimit = !carousel && options.inlineLimit !== undefined && options.inlineLimit > 0 ? Math.min(PAGE_SIZE, Math.floor(options.inlineLimit)) : 0;
|
|
477
|
-
|
|
479
|
+
// A promoted program is read by id, so it would bypass the member's participations: the participant carousel has no manual order.
|
|
480
|
+
const order = (options.participating ? [] : options.order ?? []).filter((id) => typeof id === "string" && id).slice(0, ORDER_LIMIT);
|
|
478
481
|
/** The promoted programs, in their configured order. A failed read promotes nothing: the default order stands. */
|
|
479
482
|
async function promotedPrograms(): Promise<WixProgram[]> {
|
|
480
483
|
if (!order.length) return [];
|
|
@@ -505,7 +508,7 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
505
508
|
return { status: status === "joined" ? "joined" : "all", categoryId: rest.join("|") };
|
|
506
509
|
}
|
|
507
510
|
|
|
508
|
-
let statusFilter: "all" | "joined" = "all";
|
|
511
|
+
let statusFilter: "all" | "joined" = options.participating ? "joined" : "all";
|
|
509
512
|
let categoryId = "";
|
|
510
513
|
let pageScope: Scope | undefined;
|
|
511
514
|
|
|
@@ -702,7 +705,7 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
702
705
|
async retry() { await controller.retry(); return undefined; },
|
|
703
706
|
setStatus(state, arg) {
|
|
704
707
|
const value = (arg as { selectedId?: unknown } | undefined)?.selectedId;
|
|
705
|
-
const next = value === "joined" ? "joined" : value === "all" ? "all" : undefined;
|
|
708
|
+
const next = value === "joined" ? "joined" : value === "all" && !options.participating ? "all" : undefined;
|
|
706
709
|
if (!next || next === statusFilter) return state;
|
|
707
710
|
statusFilter = next;
|
|
708
711
|
return controller.query(criteria()).then(() => undefined);
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_recipe": "The member's participating programs (title, horizontal rail with the member's progress, and a button to all their programs). Service: registerProgramsSection(svc,{layout:'carousel',participating:true,...}). Hidden whole unless the member has programs to show.",
|
|
3
|
+
"_placeholders": {
|
|
4
|
+
"svc": "service name the page worker registered with registerProgramsSection",
|
|
5
|
+
"id": "unique node id prefix",
|
|
6
|
+
"detailScreen": "program detail screen id, himi_program",
|
|
7
|
+
"memberProgramsScreen": "the member's programs screen id, himi_member_programs",
|
|
8
|
+
"heading": "the source section's own title when it shows one, else an empty string",
|
|
9
|
+
"ctaLabel": "the call-to-action button's label"
|
|
10
|
+
},
|
|
11
|
+
"node": {
|
|
12
|
+
"id": "{{id}}.participant",
|
|
13
|
+
"body": {
|
|
14
|
+
"package": "himalaya",
|
|
15
|
+
"type": "VStack",
|
|
16
|
+
"props": {
|
|
17
|
+
"spacing": 12,
|
|
18
|
+
"alignment": "leading",
|
|
19
|
+
"children": [
|
|
20
|
+
{
|
|
21
|
+
"id": "{{id}}.heading",
|
|
22
|
+
"body": {
|
|
23
|
+
"package": "himalaya",
|
|
24
|
+
"type": "Text",
|
|
25
|
+
"props": {
|
|
26
|
+
"text": "{{heading}}",
|
|
27
|
+
"style": "title3",
|
|
28
|
+
"collapseWhenEmpty": true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "{{id}}.carousel",
|
|
34
|
+
"body": {
|
|
35
|
+
"package": "himalaya",
|
|
36
|
+
"type": "Carousel",
|
|
37
|
+
"props": {
|
|
38
|
+
"itemsPath": "$service:{{svc}}.rows",
|
|
39
|
+
"items": [
|
|
40
|
+
{
|
|
41
|
+
"id": "{{id}}.card",
|
|
42
|
+
"body": {
|
|
43
|
+
"package": "himalaya",
|
|
44
|
+
"type": "VStack",
|
|
45
|
+
"props": {
|
|
46
|
+
"spacing": 8,
|
|
47
|
+
"alignment": "leading",
|
|
48
|
+
"children": [
|
|
49
|
+
{
|
|
50
|
+
"id": "",
|
|
51
|
+
"body": {
|
|
52
|
+
"package": "himalaya",
|
|
53
|
+
"type": "ZStack",
|
|
54
|
+
"props": {
|
|
55
|
+
"alignment": "leading",
|
|
56
|
+
"children": [
|
|
57
|
+
{
|
|
58
|
+
"id": "",
|
|
59
|
+
"body": {
|
|
60
|
+
"package": "himalaya",
|
|
61
|
+
"type": "Image",
|
|
62
|
+
"props": {
|
|
63
|
+
"url": "$item.image",
|
|
64
|
+
"fillWidth": true,
|
|
65
|
+
"height": 180,
|
|
66
|
+
"contentMode": "fill",
|
|
67
|
+
"contentDescription": "$item.name"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"modifiers": {
|
|
71
|
+
"cornerRadius": 8,
|
|
72
|
+
"fillMaxWidth": true,
|
|
73
|
+
"hiddenPath": "$item.noImage"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "",
|
|
78
|
+
"body": {
|
|
79
|
+
"package": "himalaya",
|
|
80
|
+
"type": "ZStack",
|
|
81
|
+
"props": {
|
|
82
|
+
"alignment": "center",
|
|
83
|
+
"children": [
|
|
84
|
+
{
|
|
85
|
+
"id": "",
|
|
86
|
+
"body": {
|
|
87
|
+
"package": "himalaya",
|
|
88
|
+
"type": "Text",
|
|
89
|
+
"props": {
|
|
90
|
+
"text": "$item.initial",
|
|
91
|
+
"style": "display",
|
|
92
|
+
"maxLines": 1,
|
|
93
|
+
"color": "textOnAccent"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"modifiers": {
|
|
101
|
+
"fillMaxWidth": true,
|
|
102
|
+
"height": 180,
|
|
103
|
+
"background": {
|
|
104
|
+
"token": "accentPrimary"
|
|
105
|
+
},
|
|
106
|
+
"cornerRadius": 8,
|
|
107
|
+
"hiddenPath": "$item.hasImage"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "",
|
|
116
|
+
"body": {
|
|
117
|
+
"package": "himalaya",
|
|
118
|
+
"type": "Text",
|
|
119
|
+
"props": {
|
|
120
|
+
"text": "$item.name",
|
|
121
|
+
"style": "bodyEmphasis",
|
|
122
|
+
"maxLines": 2
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "",
|
|
128
|
+
"body": {
|
|
129
|
+
"package": "himalaya",
|
|
130
|
+
"type": "Text",
|
|
131
|
+
"props": {
|
|
132
|
+
"text": "$item.durationLine",
|
|
133
|
+
"style": "footnote",
|
|
134
|
+
"maxLines": 1,
|
|
135
|
+
"color": "textSecondary",
|
|
136
|
+
"collapseWhenEmpty": true
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"modifiers": {
|
|
140
|
+
"hiddenPath": "$item.noDuration"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "",
|
|
145
|
+
"body": {
|
|
146
|
+
"package": "himalaya",
|
|
147
|
+
"type": "Text",
|
|
148
|
+
"props": {
|
|
149
|
+
"text": "$item.accessLine",
|
|
150
|
+
"style": "footnote",
|
|
151
|
+
"maxLines": 1,
|
|
152
|
+
"color": "textSecondary",
|
|
153
|
+
"collapseWhenEmpty": true
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"modifiers": {
|
|
157
|
+
"hiddenPath": "$item.noAccess"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "",
|
|
162
|
+
"body": {
|
|
163
|
+
"package": "himalaya",
|
|
164
|
+
"type": "Text",
|
|
165
|
+
"props": {
|
|
166
|
+
"text": "$item.descriptionLine",
|
|
167
|
+
"style": "footnote",
|
|
168
|
+
"maxLines": 2,
|
|
169
|
+
"color": "textSecondary",
|
|
170
|
+
"collapseWhenEmpty": true
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "",
|
|
176
|
+
"body": {
|
|
177
|
+
"package": "himalaya",
|
|
178
|
+
"type": "ProgressBar",
|
|
179
|
+
"props": {
|
|
180
|
+
"progress": 0,
|
|
181
|
+
"progressPath": "$item.progress"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"modifiers": {
|
|
185
|
+
"hiddenPath": "$item.noProgress"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"modifiers": {
|
|
192
|
+
"background": {
|
|
193
|
+
"token": "surfaceElevated"
|
|
194
|
+
},
|
|
195
|
+
"border": {
|
|
196
|
+
"width": 1,
|
|
197
|
+
"color": {
|
|
198
|
+
"token": "border"
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"cornerRadius": 8,
|
|
202
|
+
"padding": {
|
|
203
|
+
"leading": 12,
|
|
204
|
+
"trailing": 12,
|
|
205
|
+
"top": 12,
|
|
206
|
+
"bottom": 8
|
|
207
|
+
},
|
|
208
|
+
"onTap": {
|
|
209
|
+
"actionId": "himi.open",
|
|
210
|
+
"params": {
|
|
211
|
+
"screenId": "{{detailScreen}}",
|
|
212
|
+
"id": "$item.id"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"pressFeedback": "scale",
|
|
216
|
+
"haptic": "light",
|
|
217
|
+
"accessibilityLabel": "$item.name",
|
|
218
|
+
"width": 280
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"id": "{{id}}.cta",
|
|
227
|
+
"body": {
|
|
228
|
+
"package": "himalaya",
|
|
229
|
+
"type": "Button",
|
|
230
|
+
"props": {
|
|
231
|
+
"title": "{{ctaLabel}}",
|
|
232
|
+
"style": "secondary",
|
|
233
|
+
"size": "md",
|
|
234
|
+
"fullWidth": true,
|
|
235
|
+
"action": {
|
|
236
|
+
"actionId": "himi.open",
|
|
237
|
+
"params": {
|
|
238
|
+
"screenId": "{{memberProgramsScreen}}"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"modifiers": {
|
|
248
|
+
"padding": {
|
|
249
|
+
"leading": 16,
|
|
250
|
+
"trailing": 16,
|
|
251
|
+
"top": 8,
|
|
252
|
+
"bottom": 8
|
|
253
|
+
},
|
|
254
|
+
"hiddenPath": "$service:{{svc}}.hideList"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
@@ -456,6 +456,8 @@ export interface ProgramsSectionOptions {
|
|
|
456
456
|
showPrice?: boolean;
|
|
457
457
|
/** Program ids promoted to the front, in this order (source `sortingSettings.ordering === "MANUAL"`). */
|
|
458
458
|
order?: string[];
|
|
459
|
+
/** carousel: the member's own participations only (the One App participant carousel). Signed out, empty or failed reads show nothing. */
|
|
460
|
+
participating?: boolean;
|
|
459
461
|
/** list: hide a filter the source section turns off. */
|
|
460
462
|
filters?: { status?: boolean; category?: boolean };
|
|
461
463
|
/** list: the section's inline mode: show this many cards, no paging, and offer See all while more programs exist
|
|
@@ -471,10 +473,11 @@ const ORDER_LIMIT = 100;
|
|
|
471
473
|
export function registerProgramsSection(serviceName: string, options: ProgramsSectionOptions = { layout: "list" }) {
|
|
472
474
|
const carousel = options.layout === "carousel";
|
|
473
475
|
const display: Display = { card: carousel, duration: options.showDuration !== false, participants: options.showParticipants !== false };
|
|
474
|
-
const showPrice = options.showPrice !== false;
|
|
476
|
+
const showPrice = options.showPrice !== false && !options.participating;
|
|
475
477
|
const limit = Math.min(PAGE_SIZE, Math.max(1, Math.floor(options.limit ?? CAROUSEL_LIMIT)));
|
|
476
478
|
const inlineLimit = !carousel && options.inlineLimit !== undefined && options.inlineLimit > 0 ? Math.min(PAGE_SIZE, Math.floor(options.inlineLimit)) : 0;
|
|
477
|
-
|
|
479
|
+
// A promoted program is read by id, so it would bypass the member's participations: the participant carousel has no manual order.
|
|
480
|
+
const order = (options.participating ? [] : options.order ?? []).filter((id) => typeof id === "string" && id).slice(0, ORDER_LIMIT);
|
|
478
481
|
/** The promoted programs, in their configured order. A failed read promotes nothing: the default order stands. */
|
|
479
482
|
async function promotedPrograms(): Promise<WixProgram[]> {
|
|
480
483
|
if (!order.length) return [];
|
|
@@ -505,7 +508,7 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
505
508
|
return { status: status === "joined" ? "joined" : "all", categoryId: rest.join("|") };
|
|
506
509
|
}
|
|
507
510
|
|
|
508
|
-
let statusFilter: "all" | "joined" = "all";
|
|
511
|
+
let statusFilter: "all" | "joined" = options.participating ? "joined" : "all";
|
|
509
512
|
let categoryId = "";
|
|
510
513
|
let pageScope: Scope | undefined;
|
|
511
514
|
|
|
@@ -702,7 +705,7 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
702
705
|
async retry() { await controller.retry(); return undefined; },
|
|
703
706
|
setStatus(state, arg) {
|
|
704
707
|
const value = (arg as { selectedId?: unknown } | undefined)?.selectedId;
|
|
705
|
-
const next = value === "joined" ? "joined" : value === "all" ? "all" : undefined;
|
|
708
|
+
const next = value === "joined" ? "joined" : value === "all" && !options.participating ? "all" : undefined;
|
|
706
709
|
if (!next || next === statusFilter) return state;
|
|
707
710
|
statusFilter = next;
|
|
708
711
|
return controller.query(criteria()).then(() => undefined);
|