@wix/himalaya-cli 0.1666.0 → 0.1668.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/ts/src/schema.d.ts +2 -1
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{7700021a25a8d932331f2abf6ba6c2f13b2a18cabfc4ce8b02aa0ed1ae973ffc.bin → 6eb8e06efae709dec91b845b9df5a93594d4a91d157b435e053cc7789d005253.bin} +1 -1
- package/dist/browser-plane/sw.js +9 -9
- package/dist/cli.mjs +192 -50
- package/dist/preview-assets.generated.bin +0 -0
- package/fixtures/wix-canned.json +3 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +2 -1
- package/package.json +2 -2
- package/templates/branded-lite/dev/index.ts +32 -1
- package/templates/branded-lite/l10n/en.json +16 -3
- package/templates/branded-lite/l10n/es.json +15 -0
- package/templates/branded-lite/l10n/he.json +15 -0
- package/templates/branded-lite/tier5-src/_shared/program-standing.ts +40 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-member-programs/index.ts +4 -35
- package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +302 -9
- package/templates/yoga-studio/dev/index.ts +32 -1
- package/templates/yoga-studio/l10n/en.json +16 -3
- package/templates/yoga-studio/l10n/es.json +15 -0
- package/templates/yoga-studio/l10n/he.json +15 -0
- package/templates/yoga-studio/tier5-src/_shared/program-standing.ts +40 -0
- package/templates/yoga-studio/tier5-src/himi-branded-lite-member-programs/index.ts +4 -35
- package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +302 -9
|
@@ -34189,13 +34189,44 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
34189
34189
|
"spacing": 8,
|
|
34190
34190
|
"alignment": "leading",
|
|
34191
34191
|
"children": [
|
|
34192
|
+
{
|
|
34193
|
+
"id": "himi_program.standing",
|
|
34194
|
+
"body": {
|
|
34195
|
+
"package": "himalaya",
|
|
34196
|
+
"type": "Text",
|
|
34197
|
+
"props": {
|
|
34198
|
+
"text": "$service:himiBrandedProgram.standingLine",
|
|
34199
|
+
"style": "bodyEmphasis",
|
|
34200
|
+
"collapseWhenEmpty": true
|
|
34201
|
+
}
|
|
34202
|
+
}
|
|
34203
|
+
},
|
|
34204
|
+
{
|
|
34205
|
+
"id": "himi_program.cancel_request",
|
|
34206
|
+
"body": {
|
|
34207
|
+
"package": "himalaya",
|
|
34208
|
+
"type": "Button",
|
|
34209
|
+
"props": {
|
|
34210
|
+
"title": "$service:himiBrandedProgram.cancelLabel",
|
|
34211
|
+
"style": "secondary",
|
|
34212
|
+
"fullWidth": true,
|
|
34213
|
+
"disabledPath": "$service:himiBrandedProgram.cancelDisabled",
|
|
34214
|
+
"action": {
|
|
34215
|
+
"actionId": "tier5.himiBrandedProgram.cancelRequest"
|
|
34216
|
+
}
|
|
34217
|
+
}
|
|
34218
|
+
},
|
|
34219
|
+
"modifiers": {
|
|
34220
|
+
"hiddenPath": "$service:himiBrandedProgram.cancelHidden"
|
|
34221
|
+
}
|
|
34222
|
+
},
|
|
34192
34223
|
{
|
|
34193
34224
|
"id": "himi_program.enrol",
|
|
34194
34225
|
"body": {
|
|
34195
34226
|
"package": "himalaya",
|
|
34196
34227
|
"type": "Button",
|
|
34197
34228
|
"props": {
|
|
34198
|
-
"title": "
|
|
34229
|
+
"title": "$service:himiBrandedProgram.enrollLabel",
|
|
34199
34230
|
"style": "primary",
|
|
34200
34231
|
"fullWidth": true,
|
|
34201
34232
|
"disabledPath": "$service:himiBrandedProgram.enrollDisabled",
|
|
@@ -37,10 +37,8 @@
|
|
|
37
37
|
},
|
|
38
38
|
"h_050a944c6675": {
|
|
39
39
|
"source": "Enrol",
|
|
40
|
-
"kind": "Button.title",
|
|
41
|
-
"translation": "",
|
|
42
40
|
"key": "program.enrolCta",
|
|
43
|
-
"
|
|
41
|
+
"translation": ""
|
|
44
42
|
},
|
|
45
43
|
"h_060be00f4f26": {
|
|
46
44
|
"source": "All categories",
|
|
@@ -306,6 +304,11 @@
|
|
|
306
304
|
"key": "blogPost.hideReasonOffensive",
|
|
307
305
|
"keyOrigin": "string-table"
|
|
308
306
|
},
|
|
307
|
+
"h_287d0c97c3f8": {
|
|
308
|
+
"source": "Your join request was cancelled.",
|
|
309
|
+
"key": "program.requestCancelledMessage",
|
|
310
|
+
"translation": ""
|
|
311
|
+
},
|
|
309
312
|
"h_2bfc736745fa": {
|
|
310
313
|
"source": "Personal info",
|
|
311
314
|
"kind": "Text.text",
|
|
@@ -754,6 +757,11 @@
|
|
|
754
757
|
"key": "subscriptionDetail.cancel",
|
|
755
758
|
"keyOrigin": "string-table"
|
|
756
759
|
},
|
|
760
|
+
"h_6dd1d806fc51": {
|
|
761
|
+
"source": "The request could not be cancelled. Try again.",
|
|
762
|
+
"key": "program.cancelRequestFailedMessage",
|
|
763
|
+
"translation": ""
|
|
764
|
+
},
|
|
757
765
|
"h_6ff33102b1c6": {
|
|
758
766
|
"source": "Wishlist",
|
|
759
767
|
"kind": "Text.text",
|
|
@@ -858,6 +866,11 @@
|
|
|
858
866
|
"key": "blogPost.hideCta",
|
|
859
867
|
"keyOrigin": "string-table"
|
|
860
868
|
},
|
|
869
|
+
"h_84837a216817": {
|
|
870
|
+
"source": "Cancel request",
|
|
871
|
+
"key": "program.cancelRequestCta",
|
|
872
|
+
"translation": ""
|
|
873
|
+
},
|
|
861
874
|
"h_8500c9c784a2": {
|
|
862
875
|
"source": "Sign in to see your activity in one place.",
|
|
863
876
|
"kind": "Text.text",
|
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
"$source": "es",
|
|
3
3
|
"$note": "Partial stock translations; missing strings retain their English fallback.",
|
|
4
4
|
"messages": {
|
|
5
|
+
"h_84837a216817": {
|
|
6
|
+
"source": "Cancel request",
|
|
7
|
+
"key": "program.cancelRequestCta",
|
|
8
|
+
"translation": "Cancelar solicitud"
|
|
9
|
+
},
|
|
10
|
+
"h_287d0c97c3f8": {
|
|
11
|
+
"source": "Your join request was cancelled.",
|
|
12
|
+
"key": "program.requestCancelledMessage",
|
|
13
|
+
"translation": "Tu solicitud de inscripción se ha cancelado."
|
|
14
|
+
},
|
|
15
|
+
"h_6dd1d806fc51": {
|
|
16
|
+
"source": "The request could not be cancelled. Try again.",
|
|
17
|
+
"key": "program.cancelRequestFailedMessage",
|
|
18
|
+
"translation": "No se ha podido cancelar la solicitud. Inténtalo de nuevo."
|
|
19
|
+
},
|
|
5
20
|
"h_0d049cb0b019": {
|
|
6
21
|
"source": "This site is not accepting online payments. Go back or contact the business for other payment options.",
|
|
7
22
|
"translation": "Este sitio no acepta pagos en línea. Vuelve atrás o contacta con el negocio para consultar otras opciones de pago."
|
|
@@ -1215,6 +1215,21 @@
|
|
|
1215
1215
|
"key": "blog.categoriesLabel",
|
|
1216
1216
|
"translation": "קטגוריות פוסטים"
|
|
1217
1217
|
},
|
|
1218
|
+
"h_84837a216817": {
|
|
1219
|
+
"source": "Cancel request",
|
|
1220
|
+
"key": "program.cancelRequestCta",
|
|
1221
|
+
"translation": "ביטול בקשה"
|
|
1222
|
+
},
|
|
1223
|
+
"h_287d0c97c3f8": {
|
|
1224
|
+
"source": "Your join request was cancelled.",
|
|
1225
|
+
"key": "program.requestCancelledMessage",
|
|
1226
|
+
"translation": "בקשת ההצטרפות שלך בוטלה."
|
|
1227
|
+
},
|
|
1228
|
+
"h_6dd1d806fc51": {
|
|
1229
|
+
"source": "The request could not be cancelled. Try again.",
|
|
1230
|
+
"key": "program.cancelRequestFailedMessage",
|
|
1231
|
+
"translation": "לא ניתן לבטל את הבקשה. יש לנסות שוב."
|
|
1232
|
+
},
|
|
1218
1233
|
"h_a689a999a5e6": {
|
|
1219
1234
|
"source": "Expired",
|
|
1220
1235
|
"key": "mySubscriptions.expired",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// The member's standing on one Online Program — the One App participant/application states, folded.
|
|
2
|
+
// Shared by the programs list cards and the program detail screen so both read a member the same way.
|
|
3
|
+
import type { WixJoinApplication, WixParticipant } from "@himalaya/wix-online-programs";
|
|
4
|
+
|
|
5
|
+
export type Standing = "none" | "joined" | "completed" | "finished" | "suspended" | "pending" | "approved" | "invited";
|
|
6
|
+
|
|
7
|
+
export function standingOf(ended: boolean, participant: WixParticipant | undefined, application: WixJoinApplication | undefined): Standing {
|
|
8
|
+
if (participant) {
|
|
9
|
+
const progress = (participant.progressStatus ?? "").toUpperCase();
|
|
10
|
+
const enrollment = (participant.enrollmentStatus ?? "").toUpperCase();
|
|
11
|
+
if (progress === "COMPLETED") return "completed";
|
|
12
|
+
if (progress === "FAILED" || ended) return "finished";
|
|
13
|
+
if (enrollment === "SUSPENDED") return "suspended";
|
|
14
|
+
return "joined";
|
|
15
|
+
}
|
|
16
|
+
const status = (application?.status ?? "").toUpperCase();
|
|
17
|
+
const payment = (application?.paymentStatus ?? "").toUpperCase();
|
|
18
|
+
if (status === "APPROVAL_PENDING") return "pending";
|
|
19
|
+
if (status === "SUSPENDED") return "suspended";
|
|
20
|
+
if (status === "APPROVED") {
|
|
21
|
+
// The same reading as joinProgram: a free or settled approval is enrolling, and an offline payment
|
|
22
|
+
// waits on the owner. Only an approval that still owes money asks the member to pay.
|
|
23
|
+
if (payment === "NO_PAYMENT_REQUIRED" || payment === "PAYMENT_SUCCESSFUL") return application?.participantId ? "joined" : "pending";
|
|
24
|
+
if (payment === "PENDING_OWNER_APPROVAL") return "pending";
|
|
25
|
+
return "approved";
|
|
26
|
+
}
|
|
27
|
+
if (status === "PAYMENT_PENDING") return "approved";
|
|
28
|
+
if (status === "INVITED") return "invited";
|
|
29
|
+
return "none";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const STATUS: Record<Exclude<Standing, "none">, { key: string; fallback: string; icon: string; color: string }> = {
|
|
33
|
+
joined: { key: "memberPrograms.status.joined", fallback: "Joined", icon: "checkmark", color: "accentPrimary" },
|
|
34
|
+
completed: { key: "memberPrograms.status.completed", fallback: "Program complete", icon: "trophy", color: "success" },
|
|
35
|
+
finished: { key: "memberPrograms.status.ended", fallback: "Program ended", icon: "flag", color: "textSecondary" },
|
|
36
|
+
suspended: { key: "memberPrograms.status.suspended", fallback: "Participation suspended", icon: "close", color: "warning" },
|
|
37
|
+
pending: { key: "memberPrograms.status.pending", fallback: "Pending request", icon: "clock", color: "warning" },
|
|
38
|
+
approved: { key: "memberPrograms.status.approved", fallback: "Request approved", icon: "checkmark", color: "success" },
|
|
39
|
+
invited: { key: "memberPrograms.status.invited", fallback: "Invited", icon: "mail", color: "accentPrimary" },
|
|
40
|
+
};
|
|
@@ -21,6 +21,7 @@ import { getMyMember } from "@himalaya/wix-members";
|
|
|
21
21
|
import { iapPriceFields, onlineProgramItem, type IapPollDirective } from "@himalaya/iap";
|
|
22
22
|
import { createIapCommerce } from "@himalaya/iap-checkout";
|
|
23
23
|
import { createCollectionQuery, type CollectionPage, type CollectionQueryState } from "../_shared/collection-query.js";
|
|
24
|
+
import { standingOf as sharedStandingOf, STATUS, type Standing } from "../_shared/program-standing.js";
|
|
24
25
|
import { memberAccess, memberAccessChanged, memberAccessDenied, type MemberAccess } from "../_shared/member-access.js";
|
|
25
26
|
import { cleanTitle, initials } from "../_shared/himi-text.js";
|
|
26
27
|
import { programImage } from "../_shared/himi-media.js";
|
|
@@ -37,8 +38,7 @@ const DETAIL_SCREEN = "himi_program";
|
|
|
37
38
|
|
|
38
39
|
// ── Row model ────────────────────────────────────────────────────────────────
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
export type Standing = "none" | "joined" | "completed" | "finished" | "suspended" | "pending" | "approved" | "invited";
|
|
41
|
+
export type { Standing };
|
|
42
42
|
|
|
43
43
|
/** A card as loaded, before pricing. */
|
|
44
44
|
export interface ProgramContent {
|
|
@@ -166,39 +166,8 @@ function daysBetween(fromIso: string, now: number): number {
|
|
|
166
166
|
|
|
167
167
|
// ── Member standing ──────────────────────────────────────────────────────────
|
|
168
168
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
const progress = (participant.progressStatus ?? "").toUpperCase();
|
|
172
|
-
const enrollment = (participant.enrollmentStatus ?? "").toUpperCase();
|
|
173
|
-
if (progress === "COMPLETED") return "completed";
|
|
174
|
-
if (progress === "FAILED" || isEnded(p)) return "finished";
|
|
175
|
-
if (enrollment === "SUSPENDED") return "suspended";
|
|
176
|
-
return "joined";
|
|
177
|
-
}
|
|
178
|
-
const status = (application?.status ?? "").toUpperCase();
|
|
179
|
-
const payment = (application?.paymentStatus ?? "").toUpperCase();
|
|
180
|
-
if (status === "APPROVAL_PENDING") return "pending";
|
|
181
|
-
if (status === "APPROVED") {
|
|
182
|
-
// The same reading as joinProgram: a free or settled approval is enrolling, and an offline payment
|
|
183
|
-
// waits on the owner. Only an approval that still owes money asks the member to pay.
|
|
184
|
-
if (payment === "NO_PAYMENT_REQUIRED" || payment === "PAYMENT_SUCCESSFUL") return application?.participantId ? "joined" : "pending";
|
|
185
|
-
if (payment === "PENDING_OWNER_APPROVAL") return "pending";
|
|
186
|
-
return "approved";
|
|
187
|
-
}
|
|
188
|
-
if (status === "PAYMENT_PENDING") return "approved";
|
|
189
|
-
if (status === "INVITED") return "invited";
|
|
190
|
-
return "none";
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
const STATUS: Record<Exclude<Standing, "none">, { key: string; fallback: string; icon: string; color: string }> = {
|
|
194
|
-
joined: { key: "memberPrograms.status.joined", fallback: "Joined", icon: "checkmark", color: "accentPrimary" },
|
|
195
|
-
completed: { key: "memberPrograms.status.completed", fallback: "Program complete", icon: "trophy", color: "success" },
|
|
196
|
-
finished: { key: "memberPrograms.status.ended", fallback: "Program ended", icon: "flag", color: "textSecondary" },
|
|
197
|
-
suspended: { key: "memberPrograms.status.suspended", fallback: "Participation suspended", icon: "close", color: "warning" },
|
|
198
|
-
pending: { key: "memberPrograms.status.pending", fallback: "Pending request", icon: "clock", color: "warning" },
|
|
199
|
-
approved: { key: "memberPrograms.status.approved", fallback: "Request approved", icon: "checkmark", color: "success" },
|
|
200
|
-
invited: { key: "memberPrograms.status.invited", fallback: "Invited", icon: "mail", color: "accentPrimary" },
|
|
201
|
-
};
|
|
169
|
+
const standingOf = (p: WixProgram, participant: WixParticipant | undefined, application: WixJoinApplication | undefined): Standing =>
|
|
170
|
+
sharedStandingOf(isEnded(p), participant, application);
|
|
202
171
|
|
|
203
172
|
function timelineLine(p: WixProgram, participant: WixParticipant | undefined, standing: Standing, now: number): string {
|
|
204
173
|
const timeline = full(p).timeline;
|