@wix/himalaya-cli 0.1667.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/cli.mjs CHANGED
@@ -13371,6 +13371,7 @@ function buttonVariant(style) {
13371
13371
  var SYSTEM_FONT_FAMILY, TONAL_ELEVATION_ALPHA, BUTTON_SIZES, BUTTON_MIN_HIT_TARGET, nonNegative, nonEmpty2, own2, COLOR_TOKEN_PROPS, TYPOGRAPHY_TOKEN_PROPS, BUTTON_VARIANTS;
13372
13372
  var init_tokens = __esm({
13373
13373
  "../../core/ts/src/tokens.ts"() {
13374
+ "use strict";
13374
13375
  init_define_HHP_CATALOG();
13375
13376
  SYSTEM_FONT_FAMILY = "$system";
13376
13377
  TONAL_ELEVATION_ALPHA = [0, 0.05, 0.08, 0.11, 0.12, 0.14];
@@ -30983,7 +30984,6 @@ function resolveIdiom(tokens2, ctx = {}) {
30983
30984
  var IDIOM_CONTEXTS, UNSAFE_KEYS;
30984
30985
  var init_idiom = __esm({
30985
30986
  "../../core/ts/src/idiom.ts"() {
30986
- "use strict";
30987
30987
  init_define_HHP_CATALOG();
30988
30988
  IDIOM_CONTEXTS = {
30989
30989
  ios: { native: ["ios"] },
@@ -32804,7 +32804,6 @@ function shouldRevealError(args) {
32804
32804
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE, AUTHORED_PATTERN_LIMIT, authoredPatterns;
32805
32805
  var init_validation = __esm({
32806
32806
  "../../core/ts/src/validation.ts"() {
32807
- "use strict";
32808
32807
  init_define_HHP_CATALOG();
32809
32808
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
32810
32809
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
@@ -625,6 +625,9 @@
625
625
  "total": 2
626
626
  }
627
627
  },
628
+ "POST /online-programs/v3/participants/search": {
629
+ "participants": []
630
+ },
628
631
  "POST /online-programs/participants/v3/join-applications/query": {
629
632
  "joinApplications": [],
630
633
  "pagingMetadata": { "count": 0, "total": 0 }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1667.0",
3
+ "version": "0.1668.0",
4
4
  "type": "module",
5
5
  "description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
6
6
  "keywords": [
@@ -79,5 +79,5 @@
79
79
  "artifactId": "himalaya-cli"
80
80
  }
81
81
  },
82
- "falconPackageHash": "53ab8ffeef8b9299ea999fbbce1b31dad7a84cdb5a708e6a78819acb"
82
+ "falconPackageHash": "df3dc82b4c107b73398974e5265310faa43355346378ca5f9f3d599f"
83
83
  }
@@ -103202,13 +103202,44 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
103202
103202
  "spacing": 8,
103203
103203
  "alignment": "leading",
103204
103204
  "children": [
103205
+ {
103206
+ "id": "himi_program.standing",
103207
+ "body": {
103208
+ "package": "himalaya",
103209
+ "type": "Text",
103210
+ "props": {
103211
+ "text": "$service:himiBrandedProgram.standingLine",
103212
+ "style": "bodyEmphasis",
103213
+ "collapseWhenEmpty": true
103214
+ }
103215
+ }
103216
+ },
103217
+ {
103218
+ "id": "himi_program.cancel_request",
103219
+ "body": {
103220
+ "package": "himalaya",
103221
+ "type": "Button",
103222
+ "props": {
103223
+ "title": "$service:himiBrandedProgram.cancelLabel",
103224
+ "style": "secondary",
103225
+ "fullWidth": true,
103226
+ "disabledPath": "$service:himiBrandedProgram.cancelDisabled",
103227
+ "action": {
103228
+ "actionId": "tier5.himiBrandedProgram.cancelRequest"
103229
+ }
103230
+ }
103231
+ },
103232
+ "modifiers": {
103233
+ "hiddenPath": "$service:himiBrandedProgram.cancelHidden"
103234
+ }
103235
+ },
103205
103236
  {
103206
103237
  "id": "himi_program.enrol",
103207
103238
  "body": {
103208
103239
  "package": "himalaya",
103209
103240
  "type": "Button",
103210
103241
  "props": {
103211
- "title": "Enrol",
103242
+ "title": "$service:himiBrandedProgram.enrollLabel",
103212
103243
  "style": "primary",
103213
103244
  "fullWidth": true,
103214
103245
  "disabledPath": "$service:himiBrandedProgram.enrollDisabled",
@@ -92,10 +92,8 @@
92
92
  },
93
93
  "h_050a944c6675": {
94
94
  "source": "Enrol",
95
- "kind": "Button.title",
96
- "translation": "",
97
95
  "key": "program.enrolCta",
98
- "keyOrigin": "string-table"
96
+ "translation": ""
99
97
  },
100
98
  "h_0559813da230": {
101
99
  "source": "Back to projects",
@@ -707,6 +705,11 @@
707
705
  "key": "donation.notFoundBody",
708
706
  "keyOrigin": "string-table"
709
707
  },
708
+ "h_287d0c97c3f8": {
709
+ "source": "Your join request was cancelled.",
710
+ "key": "program.requestCancelledMessage",
711
+ "translation": ""
712
+ },
710
713
  "h_295468e69a99": {
711
714
  "source": "It may have been removed.",
712
715
  "kind": "Text.text",
@@ -1819,6 +1822,11 @@
1819
1822
  "key": "planDetail.message",
1820
1823
  "keyOrigin": "string-table"
1821
1824
  },
1825
+ "h_6dd1d806fc51": {
1826
+ "source": "The request could not be cancelled. Try again.",
1827
+ "key": "program.cancelRequestFailedMessage",
1828
+ "translation": ""
1829
+ },
1822
1830
  "h_6df910132a36": {
1823
1831
  "source": "Suggestion sent.",
1824
1832
  "kind": "Worker.copy",
@@ -2157,6 +2165,11 @@
2157
2165
  "key": "loyalty.sampleBody",
2158
2166
  "keyOrigin": "string-table"
2159
2167
  },
2168
+ "h_84837a216817": {
2169
+ "source": "Cancel request",
2170
+ "key": "program.cancelRequestCta",
2171
+ "translation": ""
2172
+ },
2160
2173
  "h_849594a18598": {
2161
2174
  "source": "Address not found",
2162
2175
  "kind": "Text.text",
@@ -17,6 +17,21 @@
17
17
  "key": "product.galleryPage",
18
18
  "translation": "Imagen {index} de {count}"
19
19
  },
20
+ "h_84837a216817": {
21
+ "source": "Cancel request",
22
+ "key": "program.cancelRequestCta",
23
+ "translation": "Cancelar solicitud"
24
+ },
25
+ "h_287d0c97c3f8": {
26
+ "source": "Your join request was cancelled.",
27
+ "key": "program.requestCancelledMessage",
28
+ "translation": "Tu solicitud de inscripción se ha cancelado."
29
+ },
30
+ "h_6dd1d806fc51": {
31
+ "source": "The request could not be cancelled. Try again.",
32
+ "key": "program.cancelRequestFailedMessage",
33
+ "translation": "No se ha podido cancelar la solicitud. Inténtalo de nuevo."
34
+ },
20
35
  "h_0d049cb0b019": {
21
36
  "source": "This site is not accepting online payments. Go back or contact the business for other payment options.",
22
37
  "translation": "Este sitio no acepta pagos en línea. Vuelve atrás o contacta con el negocio para consultar otras opciones de pago."
@@ -3185,6 +3185,21 @@
3185
3185
  "key": "cms.searchEmptyText",
3186
3186
  "translation": "אין אוספים שתואמים לחיפוש."
3187
3187
  },
3188
+ "h_84837a216817": {
3189
+ "source": "Cancel request",
3190
+ "key": "program.cancelRequestCta",
3191
+ "translation": "ביטול בקשה"
3192
+ },
3193
+ "h_287d0c97c3f8": {
3194
+ "source": "Your join request was cancelled.",
3195
+ "key": "program.requestCancelledMessage",
3196
+ "translation": "בקשת ההצטרפות שלך בוטלה."
3197
+ },
3198
+ "h_6dd1d806fc51": {
3199
+ "source": "The request could not be cancelled. Try again.",
3200
+ "key": "program.cancelRequestFailedMessage",
3201
+ "translation": "לא ניתן לבטל את הבקשה. יש לנסות שוב."
3202
+ },
3188
3203
  "h_a689a999a5e6": {
3189
3204
  "source": "Expired",
3190
3205
  "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
- /** The member's standing on one program — the One App participant/application states, folded. */
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
- function standingOf(p: WixProgram, participant: WixParticipant | undefined, application: WixJoinApplication | undefined): Standing {
170
- if (participant) {
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;