@wix/himalaya-cli 0.1752.0 → 0.1754.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/dev-server/src/builder.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +3 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +5 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +10 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/online-programs/src/index.d.ts +175 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +108 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-online-programs.mjs +65 -1
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{2671d1cadb15daa5e59440f4c924e30c221ab3d405e8a56a0ab1cdbe4764af3d.bin → 707207384524513171a679366d75e91a1652b53eb3de01ef15418c4ba68c9370.bin} +1 -1
- package/dist/browser-plane/sw.js +5 -5
- package/dist/cli.mjs +168 -73
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +5 -0
- package/guides/himi-json-output.md +12 -3
- package/guides/one-app-section-mappings.md +1 -1
- package/guides/one-app-to-himi-app.md +4 -0
- package/guides/push-cli-onboarding.md +2 -0
- package/guides/sdk-reference.json +165 -0
- package/guides/wix-business-context.md +15 -1
- package/package.json +2 -2
- package/templates/beauty-salon/recipes/programs-filters.json +94 -0
- package/templates/beauty-salon/recipes/programs-see-all.json +43 -0
- package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +19 -7
- package/templates/beauty-salon/tier5-src/himi-branded-lite-order/index.ts +7 -2
- package/templates/branded-lite/recipes/programs-filters.json +94 -0
- package/templates/branded-lite/recipes/programs-see-all.json +43 -0
- package/templates/branded-lite/tier5-src/_shared/programs-section.ts +19 -7
- package/templates/branded-lite/tier5-src/himi-branded-lite-inbox/index.ts +10 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-order/index.ts +7 -2
- package/templates/community-club/recipes/programs-filters.json +94 -0
- package/templates/community-club/recipes/programs-see-all.json +43 -0
- package/templates/community-club/tier5-src/_shared/programs-section.ts +19 -7
- package/templates/events-meetups/recipes/programs-filters.json +94 -0
- package/templates/events-meetups/recipes/programs-see-all.json +43 -0
- package/templates/events-meetups/tier5-src/_shared/programs-section.ts +19 -7
- package/templates/gym-fitness/recipes/programs-filters.json +94 -0
- package/templates/gym-fitness/recipes/programs-see-all.json +43 -0
- package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +19 -7
- package/templates/gym-fitness/tier5-src/himi-branded-lite-order/index.ts +7 -2
- package/templates/nonprofit-cause/recipes/programs-filters.json +94 -0
- package/templates/nonprofit-cause/recipes/programs-see-all.json +43 -0
- package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +19 -7
- package/templates/podcast-creator/recipes/programs-filters.json +94 -0
- package/templates/podcast-creator/recipes/programs-see-all.json +43 -0
- package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +19 -7
- package/templates/portfolio-creative/recipes/programs-filters.json +94 -0
- package/templates/portfolio-creative/recipes/programs-see-all.json +43 -0
- package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +19 -7
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-order/index.ts +7 -2
- package/templates/restaurant/recipes/programs-filters.json +94 -0
- package/templates/restaurant/recipes/programs-see-all.json +43 -0
- package/templates/restaurant/tier5-src/_shared/programs-section.ts +19 -7
- package/templates/retail-store/recipes/programs-filters.json +94 -0
- package/templates/retail-store/recipes/programs-see-all.json +43 -0
- package/templates/retail-store/tier5-src/_shared/programs-section.ts +19 -7
- package/templates/retail-store/tier5-src/himi-branded-lite-order/index.ts +7 -2
- package/templates/wholesale-store/tier5-src/himi-branded-lite-order/index.ts +7 -2
- package/templates/yoga-studio/recipes/programs-filters.json +94 -0
- package/templates/yoga-studio/recipes/programs-see-all.json +43 -0
- package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +19 -7
|
@@ -63,6 +63,9 @@ export interface ScreenDescriptor {
|
|
|
63
63
|
/** "" / "pinned" (default) | "floating": how the host draws `stickyFooter`. Mirror of
|
|
64
64
|
* ScreenDescriptor.sticky_footer_placement in core.proto. */
|
|
65
65
|
stickyFooterPlacement?: string;
|
|
66
|
+
/** A `$service:` token: each new non-empty value scrolls the screen back to the top. Mirror of
|
|
67
|
+
* ScreenDescriptor.scroll_to_top_path in core.proto. */
|
|
68
|
+
scrollToTopPath?: string;
|
|
66
69
|
}
|
|
67
70
|
/** Tier 3/4 + embeddable WebView behavior. Mirror of WebViewConfig in core.proto
|
|
68
71
|
* (RFC 0038). All fields optional; zero values reproduce legacy behavior. */
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts
CHANGED
|
@@ -897,9 +897,10 @@ export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_s
|
|
|
897
897
|
/** `defineApp({ socialSignIn })` — see AppConfig.socialSignIn. */
|
|
898
898
|
export interface SocialSignInConfig {
|
|
899
899
|
google?: {
|
|
900
|
-
/** The iOS OAuth client: Info.plist GIDClientID and the
|
|
900
|
+
/** The iOS OAuth client: Info.plist GIDClientID and the reversed-client-ID URL scheme. */
|
|
901
901
|
iosClientId?: string;
|
|
902
|
-
/** The WEB OAuth client
|
|
902
|
+
/** The WEB OAuth client, the token audience on both platforms: Info.plist GIDServerClientID on iOS,
|
|
903
|
+
* the client Credential Manager mints for on Android. */
|
|
903
904
|
serverClientId?: string;
|
|
904
905
|
};
|
|
905
906
|
}
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts
CHANGED
|
@@ -3856,6 +3856,11 @@ export interface ScreenDescriptor {
|
|
|
3856
3856
|
* over the bottom of the scroll with no band behind it (a Fab, a snackbar) and insets the
|
|
3857
3857
|
* content by its height. Static; an unknown value is "pinned". */
|
|
3858
3858
|
stickyFooterPlacement?: string;
|
|
3859
|
+
/** A `$service:` path used as a token: when its value CHANGES to a non-empty one, the screen's
|
|
3860
|
+
* own vertical scroll returns to the top (animated; none under Reduce Motion). The value on
|
|
3861
|
+
* first render is a baseline; an empty or unresolved value does nothing. A worker fires it
|
|
3862
|
+
* again by writing a new value (a counter, "x|3"). The rule of `LazyList.scrollToItemPath`. */
|
|
3863
|
+
scrollToTopPath?: string;
|
|
3859
3864
|
etag?: string;
|
|
3860
3865
|
cacheControl?: CacheControl;
|
|
3861
3866
|
telemetryScreenName?: string;
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts
CHANGED
|
@@ -469,3 +469,13 @@ export interface SiteShellCheckOptions {
|
|
|
469
469
|
}
|
|
470
470
|
/** Throws with a legible message on a site description no shell can build from. */
|
|
471
471
|
export declare function assertSiteShellConfig(site: SiteShellConfig, opts?: SiteShellCheckOptions): void;
|
|
472
|
+
/** A rewriter for one contract's site: rewrites every dead tap in a descriptor, in place on a copy. */
|
|
473
|
+
export declare function siteShellLinks(site: SiteShellConfig): (descriptor: ScreenDescriptor) => ScreenDescriptor;
|
|
474
|
+
/**
|
|
475
|
+
* A screen with a top bar of its own (a member chat thread, say) replaces `navigation.topBarDefault`, so
|
|
476
|
+
* the contract's app-wide icons (`site.topBar`) would vanish there. This appends them after the screen's
|
|
477
|
+
* own actions, skipping one the screen already has and one that would open this very screen.
|
|
478
|
+
*/
|
|
479
|
+
export declare function withSiteTopBarActions(descriptor: ScreenDescriptor, defaults: TopBarConfig | undefined): ScreenDescriptor;
|
|
480
|
+
/** Trailing legacy-action slots a screen's own top bar draws (the R2 toolbar); more go to its overflow menu. */
|
|
481
|
+
export declare const SITE_SCREEN_TRAILING_SLOTS = 2;
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts
CHANGED
|
@@ -157,6 +157,10 @@ export declare const screenDescriptorSchema: {
|
|
|
157
157
|
readonly stickyFooterPlacement: {
|
|
158
158
|
readonly type: "string";
|
|
159
159
|
};
|
|
160
|
+
readonly scrollToTopPath: {
|
|
161
|
+
readonly type: "string";
|
|
162
|
+
readonly pattern: "^$|^\\$service:";
|
|
163
|
+
};
|
|
160
164
|
readonly logicBundle: {
|
|
161
165
|
readonly type: "object";
|
|
162
166
|
readonly additionalProperties: false;
|
|
@@ -427,3 +427,178 @@ export interface WixGetPremiumStatsResponse {
|
|
|
427
427
|
export declare function getPremiumStats(): Promise<WixGetPremiumStatsResponse>;
|
|
428
428
|
/** True when participation is blocked by the free-tier cap (no premium, count over limit). */
|
|
429
429
|
export declare function isParticipationBlocked(stats: WixGetPremiumStatsResponse | undefined): boolean;
|
|
430
|
+
export interface WixSection {
|
|
431
|
+
id?: string;
|
|
432
|
+
revision?: string;
|
|
433
|
+
programId?: string;
|
|
434
|
+
description?: {
|
|
435
|
+
title?: string;
|
|
436
|
+
};
|
|
437
|
+
totalSteps?: number;
|
|
438
|
+
ordering?: number;
|
|
439
|
+
delayInDays?: number;
|
|
440
|
+
}
|
|
441
|
+
export interface WixListSectionsResponse {
|
|
442
|
+
sections?: WixSection[];
|
|
443
|
+
}
|
|
444
|
+
/** GET /online-programs/v3/sections?programId= — every section of one program, in order.
|
|
445
|
+
* An empty list can mean the program has no sections OR the caller may not read them: the API does not tell the two apart.
|
|
446
|
+
* @scope member — a joined member (or a visitor of a program that allows it). */
|
|
447
|
+
export declare function listSections(programId: string, readOptions?: WixCallOptions): Promise<WixListSectionsResponse>;
|
|
448
|
+
export interface WixStep {
|
|
449
|
+
id?: string;
|
|
450
|
+
revision?: string;
|
|
451
|
+
programId?: string;
|
|
452
|
+
sectionId?: string;
|
|
453
|
+
description?: {
|
|
454
|
+
title?: string;
|
|
455
|
+
details?: unknown;
|
|
456
|
+
[field: string]: unknown;
|
|
457
|
+
};
|
|
458
|
+
ordering?: number;
|
|
459
|
+
/** VIDEO | QUIZ | TEXT | … — read `videoOptions` / `quizOptions` for the matching one. */
|
|
460
|
+
stepType?: string;
|
|
461
|
+
videoOptions?: Record<string, unknown>;
|
|
462
|
+
quizOptions?: {
|
|
463
|
+
id?: string;
|
|
464
|
+
totalQuestions?: number;
|
|
465
|
+
passingGrade?: number;
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
export interface WixQueryStepsResponse {
|
|
469
|
+
steps?: WixStep[];
|
|
470
|
+
pagingMetadata?: {
|
|
471
|
+
count?: number;
|
|
472
|
+
hasNext?: boolean;
|
|
473
|
+
cursors?: {
|
|
474
|
+
next?: string | null;
|
|
475
|
+
prev?: string | null;
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
export interface WixQueryStepsOptions {
|
|
480
|
+
/** Narrow to one section. */
|
|
481
|
+
sectionId?: string;
|
|
482
|
+
/** Page size, 1..100; default 100. */
|
|
483
|
+
limit?: number;
|
|
484
|
+
/** `pagingMetadata.cursors.next` of the previous page. A cursor page carries no filter: the cursor holds the section filter, as in the other cursor pages here. */
|
|
485
|
+
cursor?: string;
|
|
486
|
+
/** Which description fields come back; omit for the API default (the participant view). */
|
|
487
|
+
descriptionFieldSet?: string;
|
|
488
|
+
}
|
|
489
|
+
/** POST /online-programs/v3/steps/query — the steps of one program as a participant sees them.
|
|
490
|
+
* @scope member */
|
|
491
|
+
export declare function queryParticipantSteps(programId: string, opts?: WixQueryStepsOptions, readOptions?: WixCallOptions): Promise<WixQueryStepsResponse>;
|
|
492
|
+
export interface WixResolvedStep {
|
|
493
|
+
id?: string;
|
|
494
|
+
participantId?: string;
|
|
495
|
+
programStepId?: string;
|
|
496
|
+
quizSubmissionId?: string;
|
|
497
|
+
earnedScore?: number;
|
|
498
|
+
passingGrade?: number;
|
|
499
|
+
/** A free string in the spec; the API defines no values there, so none are listed here. */
|
|
500
|
+
status?: string;
|
|
501
|
+
createdDate?: string;
|
|
502
|
+
updatedDate?: string;
|
|
503
|
+
}
|
|
504
|
+
export interface WixQueryResolvedStepsResponse {
|
|
505
|
+
resolvedSteps?: WixResolvedStep[];
|
|
506
|
+
pagingMetadata?: {
|
|
507
|
+
count?: number;
|
|
508
|
+
hasNext?: boolean;
|
|
509
|
+
cursors?: {
|
|
510
|
+
next?: string | null;
|
|
511
|
+
prev?: string | null;
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
/** POST /online-programs/participants/v3/resolved-steps/query — the steps one participant finished.
|
|
516
|
+
* An empty list means nothing is done yet, never that the read failed. A cursor page carries no filter: the cursor
|
|
517
|
+
* holds the participant filter, so pass the cursor from the same participant's previous page.
|
|
518
|
+
* @scope member */
|
|
519
|
+
export declare function queryResolvedSteps(participantId: string, opts?: {
|
|
520
|
+
limit?: number;
|
|
521
|
+
cursor?: string;
|
|
522
|
+
}, readOptions?: WixCallOptions): Promise<WixQueryResolvedStepsResponse>;
|
|
523
|
+
/** POST /online-programs/participants/v3/resolved-steps/upsert/participant/{participantId}/step/{stepId}
|
|
524
|
+
* — complete a step. Repeating the call for the same pair updates the one resolved step.
|
|
525
|
+
* The ids in the body always come from the two arguments, so they match the path. `status` is sent as given
|
|
526
|
+
* and is NOT defaulted: the spec lists no values and no default, so the caller passes what the site expects.
|
|
527
|
+
* A quiz step's score is the server's to set from `quizSubmissionId`; the binding does not send one.
|
|
528
|
+
* @scope member — the participant must be the signed-in member's own. */
|
|
529
|
+
export declare function completeStep(participantId: string, programStepId: string, resolvedStep?: Pick<WixResolvedStep, "status" | "quizSubmissionId">, options?: WixCallOptions): Promise<{
|
|
530
|
+
resolvedStep?: WixResolvedStep;
|
|
531
|
+
}>;
|
|
532
|
+
/** DELETE /online-programs/participants/v3/resolved-steps/{resolvedStepId} — undo a completed step.
|
|
533
|
+
* @scope member */
|
|
534
|
+
export declare function undoStep(resolvedStepId: string, options?: WixCallOptions): Promise<Record<string, never>>;
|
|
535
|
+
export interface WixQuizField {
|
|
536
|
+
id?: string;
|
|
537
|
+
/** The key a submission's `answers` use for this question (not `id`). */
|
|
538
|
+
target?: string;
|
|
539
|
+
/** The question text. */
|
|
540
|
+
question?: string;
|
|
541
|
+
score?: number;
|
|
542
|
+
rightMessage?: string;
|
|
543
|
+
wrongMessage?: string;
|
|
544
|
+
/** One of `numeric` / `shortText` / `longText` / `singleChoice` / `multiChoice` / `fileUpload` is set. */
|
|
545
|
+
[fieldType: string]: unknown;
|
|
546
|
+
}
|
|
547
|
+
export interface WixQuiz {
|
|
548
|
+
id?: string;
|
|
549
|
+
revision?: string;
|
|
550
|
+
settings?: {
|
|
551
|
+
passingGrade?: number;
|
|
552
|
+
title?: string;
|
|
553
|
+
attempts?: number;
|
|
554
|
+
};
|
|
555
|
+
fields?: WixQuizField[];
|
|
556
|
+
}
|
|
557
|
+
/** GET /online-programs/v1/quizzes/{quizId} — a quiz with its questions. `quizId` is the step's `quizOptions.id`.
|
|
558
|
+
* NOT callable by a member: on amit1 the gateway answers a member token with an empty 403 (the lock lists
|
|
559
|
+
* only the APP identity for this route). The submission route below does accept a member.
|
|
560
|
+
* @scope owner — the quiz definition is app-identity only, so a member session cannot read it. */
|
|
561
|
+
export declare function getQuiz(quizId: string, readOptions?: WixCallOptions): Promise<{
|
|
562
|
+
quiz?: WixQuiz;
|
|
563
|
+
}>;
|
|
564
|
+
export interface WixQuizAnswer {
|
|
565
|
+
fieldId?: string;
|
|
566
|
+
value?: unknown;
|
|
567
|
+
score?: number;
|
|
568
|
+
correct?: boolean;
|
|
569
|
+
message?: string;
|
|
570
|
+
}
|
|
571
|
+
export interface WixQuizSubmission {
|
|
572
|
+
id?: string;
|
|
573
|
+
quizId?: string;
|
|
574
|
+
/** The participant the answers belong to: pass the signed-in member's own participant id. */
|
|
575
|
+
groupId?: string;
|
|
576
|
+
earnedGrade?: number;
|
|
577
|
+
passingGrade?: number;
|
|
578
|
+
/** Keyed by question `target` (`WixQuizField.target`). */
|
|
579
|
+
answers?: Record<string, WixQuizAnswer>;
|
|
580
|
+
evaluationStatus?: string;
|
|
581
|
+
}
|
|
582
|
+
/** POST /online-programs/v1/quiz-submissions — submit answers; the response carries the evaluation.
|
|
583
|
+
* @scope member */
|
|
584
|
+
export declare function createQuizSubmission(submission: {
|
|
585
|
+
quizId: string;
|
|
586
|
+
groupId?: string;
|
|
587
|
+
answers: Record<string, WixQuizAnswer>;
|
|
588
|
+
}, options?: WixCallOptions): Promise<{
|
|
589
|
+
quizSubmission?: WixQuizSubmission;
|
|
590
|
+
}>;
|
|
591
|
+
/** DELETE /online-programs/v3/participants/{participantId} — the member leaves the program.
|
|
592
|
+
* Removes the member's own participation: pass the participant id from `queryMemberParticipants` / `listMyParticipations`,
|
|
593
|
+
* never another member's. Whether progress is kept is not documented by the spec.
|
|
594
|
+
* Verified on amit1: a member leaving their own participation gets `{}` and the participant's
|
|
595
|
+
* `enrollmentStatus` becomes `LEFT`.
|
|
596
|
+
* @scope member */
|
|
597
|
+
export declare function leaveProgram(participantId: string, options?: WixCallOptions): Promise<Record<string, never>>;
|
|
598
|
+
export interface WixCertificateDownloadUrl {
|
|
599
|
+
downloadUrl?: string;
|
|
600
|
+
expirationDate?: string;
|
|
601
|
+
}
|
|
602
|
+
/** GET /online-programs/v3/participants/{participantId}/certificate-download-url — a time-limited link.
|
|
603
|
+
* @scope member */
|
|
604
|
+
export declare function getCertificateDownloadUrl(participantId: string, readOptions?: WixCallOptions): Promise<WixCertificateDownloadUrl>;
|
|
@@ -9048,6 +9048,9 @@ var screenDescriptorSchema = {
|
|
|
9048
9048
|
// "" / "pinned" (default) | "floating" — how the host draws `stickyFooter`. A free string
|
|
9049
9049
|
// like every chrome discriminator: an unknown value coalesces to "pinned" (invariant 6).
|
|
9050
9050
|
stickyFooterPlacement: { type: "string" },
|
|
9051
|
+
// A `$service:` token: each new non-empty value scrolls the screen back to the top. A literal never changes,
|
|
9052
|
+
// so it could never fire: the path must be a binding (or empty, which is unset), as transcriptScroll.anchorPath.
|
|
9053
|
+
scrollToTopPath: { type: "string", pattern: "^$|^\\$service:" },
|
|
9051
9054
|
// RFC 0002 — Tier-5 worker bundle reference (LogicBundleRef). Without this in
|
|
9052
9055
|
// the schema, `additionalProperties:false` rejected EVERY T5 descriptor, so the
|
|
9053
9056
|
// admin's pre-push validation 400'd any edit of a T5 screen.
|
|
@@ -15827,6 +15830,108 @@ function assertExternalUrl(site, value, where) {
|
|
|
15827
15830
|
throw new Error(`${where}: target url ${JSON.stringify(value)} is on the site itself \u2014 declare it as a page (placement "overflow" for no row) and target { page }`);
|
|
15828
15831
|
}
|
|
15829
15832
|
}
|
|
15833
|
+
var SITE_STAND_INS = {
|
|
15834
|
+
himi_business_chat: /^(contact|contact-us|contact-me)$|^\/contact/,
|
|
15835
|
+
himi_shop: /^(shop|store|products)$|^\/(shop|store|category|products)/,
|
|
15836
|
+
himi_plans: /^(plans|pricing)$|^\/(plans|pricing|plans-pricing)/
|
|
15837
|
+
};
|
|
15838
|
+
var ALWAYS_HIDDEN_TARGETS = ["himi_cart", "himi_new_message"];
|
|
15839
|
+
var HIDDEN_ACTIONS = ["tier5.himiBrandedOrder.reorder"];
|
|
15840
|
+
var LABEL_FOR = { action: "actionLabel", cta: "ctaLabel" };
|
|
15841
|
+
function standInActions(site) {
|
|
15842
|
+
const tapFor = (id, target) => siteTopBarDefault({ ...site, topBar: { actions: [{ id, icon: "globe", label: id, target }] } })?.actions?.[0]?.onTap;
|
|
15843
|
+
const taps = /* @__PURE__ */ new Map();
|
|
15844
|
+
for (const [screenId, match] of Object.entries(SITE_STAND_INS)) {
|
|
15845
|
+
const page = site.pages.find((p) => match.test(p.id)) ?? site.pages.find((p) => match.test(p.path));
|
|
15846
|
+
const tap = page && tapFor(screenId, { page: page.id });
|
|
15847
|
+
if (tap) taps.set(screenId, tap);
|
|
15848
|
+
}
|
|
15849
|
+
for (const page of site.nativePages ?? []) {
|
|
15850
|
+
const tap = tapFor(page.screenId, { screen: page.screenId });
|
|
15851
|
+
if (tap && tap.actionId === "himi.tab") taps.set(page.screenId, tap);
|
|
15852
|
+
}
|
|
15853
|
+
return taps;
|
|
15854
|
+
}
|
|
15855
|
+
function siteShellLinks(site) {
|
|
15856
|
+
const standIns = standInActions(site);
|
|
15857
|
+
const verdict = (action) => {
|
|
15858
|
+
if (!action || typeof action !== "object") return "keep";
|
|
15859
|
+
const a = action;
|
|
15860
|
+
if (HIDDEN_ACTIONS.includes(a.actionId)) return "hide";
|
|
15861
|
+
if (a.actionId !== "himi.open") return "keep";
|
|
15862
|
+
const target = a.params?.screenId;
|
|
15863
|
+
if (!target) return "keep";
|
|
15864
|
+
if (standIns.has(target)) return standIns.get(target);
|
|
15865
|
+
if (ALWAYS_HIDDEN_TARGETS.includes(target) || target in SITE_STAND_INS) return "hide";
|
|
15866
|
+
return "keep";
|
|
15867
|
+
};
|
|
15868
|
+
const visit = (node) => {
|
|
15869
|
+
if (Array.isArray(node)) {
|
|
15870
|
+
for (let i = node.length - 1; i >= 0; i--) if (!visit(node[i])) node.splice(i, 1);
|
|
15871
|
+
return true;
|
|
15872
|
+
}
|
|
15873
|
+
if (!node || typeof node !== "object") return true;
|
|
15874
|
+
const n = node;
|
|
15875
|
+
const body = n.body;
|
|
15876
|
+
const props = body?.props;
|
|
15877
|
+
if (props) {
|
|
15878
|
+
for (const key of ["action", "cta"]) {
|
|
15879
|
+
const v = verdict(props[key]);
|
|
15880
|
+
if (v === "hide") {
|
|
15881
|
+
if (body.type === "Button") return false;
|
|
15882
|
+
delete props[key];
|
|
15883
|
+
delete props[LABEL_FOR[key]];
|
|
15884
|
+
} else if (v !== "keep") props[key] = { ...v };
|
|
15885
|
+
}
|
|
15886
|
+
}
|
|
15887
|
+
const modifiers = n.modifiers;
|
|
15888
|
+
if (modifiers) {
|
|
15889
|
+
const v = verdict(modifiers.onTap);
|
|
15890
|
+
if (v === "hide") return false;
|
|
15891
|
+
if (v !== "keep") modifiers.onTap = { ...v };
|
|
15892
|
+
}
|
|
15893
|
+
for (const [key, value] of Object.entries(n)) {
|
|
15894
|
+
if (key === "modifiers") continue;
|
|
15895
|
+
if (value && typeof value === "object" && !visit(value)) delete n[key];
|
|
15896
|
+
}
|
|
15897
|
+
return true;
|
|
15898
|
+
};
|
|
15899
|
+
return (descriptor) => {
|
|
15900
|
+
const copy = JSON.parse(JSON.stringify(descriptor));
|
|
15901
|
+
for (const key of Object.keys(copy)) {
|
|
15902
|
+
if (key === "logicBundle") continue;
|
|
15903
|
+
const part = copy[key];
|
|
15904
|
+
if (part && typeof part === "object" && !visit(part)) delete copy[key];
|
|
15905
|
+
}
|
|
15906
|
+
return copy;
|
|
15907
|
+
};
|
|
15908
|
+
}
|
|
15909
|
+
function withSiteTopBarActions(descriptor, defaults) {
|
|
15910
|
+
const extra = defaults?.actions ?? [];
|
|
15911
|
+
if (!descriptor.topBar || extra.length === 0) return descriptor;
|
|
15912
|
+
const own2 = descriptor.topBar.actions ?? [];
|
|
15913
|
+
const ids = new Set(own2.map((action) => action.id));
|
|
15914
|
+
const opensSelf = (action) => action.onTap?.params?.screenId === descriptor.screenId;
|
|
15915
|
+
const added = extra.filter((action) => !ids.has(action.id) && !opensSelf(action));
|
|
15916
|
+
if (added.length === 0) return descriptor;
|
|
15917
|
+
const room = Math.max(0, SITE_SCREEN_TRAILING_SLOTS - own2.length);
|
|
15918
|
+
const overflow = added.slice(room).map((action) => ({
|
|
15919
|
+
id: action.id,
|
|
15920
|
+
placement: "overflow",
|
|
15921
|
+
label: action.accessibilityLabel ?? action.label ?? action.id,
|
|
15922
|
+
...action.icon !== void 0 ? { icon: action.icon } : {},
|
|
15923
|
+
...action.onTap !== void 0 ? { onTap: action.onTap } : {}
|
|
15924
|
+
}));
|
|
15925
|
+
return {
|
|
15926
|
+
...descriptor,
|
|
15927
|
+
topBar: {
|
|
15928
|
+
...descriptor.topBar,
|
|
15929
|
+
actions: [...own2, ...added.slice(0, room)],
|
|
15930
|
+
...overflow.length > 0 ? { items: [...descriptor.topBar.items ?? [], ...overflow] } : {}
|
|
15931
|
+
}
|
|
15932
|
+
};
|
|
15933
|
+
}
|
|
15934
|
+
var SITE_SCREEN_TRAILING_SLOTS = 2;
|
|
15830
15935
|
|
|
15831
15936
|
// ../../core/ts/src/site-web-sdk.generated.ts
|
|
15832
15937
|
var PAGE_CAPABILITY_DISPATCHES = {
|
|
@@ -16228,6 +16333,7 @@ export {
|
|
|
16228
16333
|
SITE_PRIVATE_NATIVE_SCREENS,
|
|
16229
16334
|
SITE_SCREEN_FORMS,
|
|
16230
16335
|
SITE_SCREEN_PREFIX,
|
|
16336
|
+
SITE_SCREEN_TRAILING_SLOTS,
|
|
16231
16337
|
SITE_SHELL_MAX_TABS,
|
|
16232
16338
|
SITE_TOP_BAR_MAX_ACTIONS,
|
|
16233
16339
|
SITE_WEB_SDK_GENERATED_PREFIX,
|
|
@@ -16380,6 +16486,7 @@ export {
|
|
|
16380
16486
|
sitePageUrl,
|
|
16381
16487
|
siteScreenId,
|
|
16382
16488
|
siteScreens,
|
|
16489
|
+
siteShellLinks,
|
|
16383
16490
|
siteSidebar,
|
|
16384
16491
|
siteTopBarDefault,
|
|
16385
16492
|
siteWebSdkBundleName,
|
|
@@ -16413,6 +16520,7 @@ export {
|
|
|
16413
16520
|
widgetSnapshotSchema,
|
|
16414
16521
|
withSiteNativeScreenTopBar,
|
|
16415
16522
|
withSiteNativeScreenTopBarBuilder,
|
|
16523
|
+
withSiteTopBarActions,
|
|
16416
16524
|
withSiteWebSdk,
|
|
16417
16525
|
workerSubtreePolicyErrors,
|
|
16418
16526
|
workerSubtreeSha256,
|
|
@@ -7060,6 +7060,9 @@ var screenDescriptorSchema = {
|
|
|
7060
7060
|
// "" / "pinned" (default) | "floating" — how the host draws `stickyFooter`. A free string
|
|
7061
7061
|
// like every chrome discriminator: an unknown value coalesces to "pinned" (invariant 6).
|
|
7062
7062
|
stickyFooterPlacement: { type: "string" },
|
|
7063
|
+
// A `$service:` token: each new non-empty value scrolls the screen back to the top. A literal never changes,
|
|
7064
|
+
// so it could never fire: the path must be a binding (or empty, which is unset), as transcriptScroll.anchorPath.
|
|
7065
|
+
scrollToTopPath: { type: "string", pattern: "^$|^\\$service:" },
|
|
7063
7066
|
// RFC 0002 — Tier-5 worker bundle reference (LogicBundleRef). Without this in
|
|
7064
7067
|
// the schema, `additionalProperties:false` rejected EVERY T5 descriptor, so the
|
|
7065
7068
|
// admin's pre-push validation 400'd any edit of a T5 screen.
|
|
@@ -237,6 +237,61 @@ function isParticipationBlocked(stats) {
|
|
|
237
237
|
const limit = stats.activeParticipantsLimit;
|
|
238
238
|
return typeof limit === "number" && count > limit;
|
|
239
239
|
}
|
|
240
|
+
function listSections(programId, readOptions) {
|
|
241
|
+
if (!programId) throw new Error("listSections: programId is required");
|
|
242
|
+
return wixCall("GET", `/online-programs/v3/sections?programId=${encodeURIComponent(programId)}`, void 0, readOptions);
|
|
243
|
+
}
|
|
244
|
+
function queryParticipantSteps(programId, opts = {}, readOptions) {
|
|
245
|
+
if (!programId) throw new Error("queryParticipantSteps: programId is required");
|
|
246
|
+
const limit = clampPageLimit(opts.limit, 100);
|
|
247
|
+
const query = opts.cursor ? { cursorPaging: { limit, cursor: opts.cursor } } : {
|
|
248
|
+
// Verified on amit1: a member's call IGNORES the top-level `programId` and returns the steps of every program,
|
|
249
|
+
// so the program must be in the filter. The API accepts an `ordering` sort only together with a `sectionId` filter.
|
|
250
|
+
filter: { programId: { $eq: programId }, ...opts.sectionId ? { sectionId: { $eq: opts.sectionId } } : {} },
|
|
251
|
+
...opts.sectionId ? { sort: [{ fieldName: "ordering", order: "ASC" }] } : {},
|
|
252
|
+
cursorPaging: { limit }
|
|
253
|
+
};
|
|
254
|
+
return wixCall("POST", "/online-programs/v3/steps/query", {
|
|
255
|
+
programId,
|
|
256
|
+
query,
|
|
257
|
+
...opts.descriptionFieldSet ? { descriptionFieldSet: opts.descriptionFieldSet } : {}
|
|
258
|
+
}, readOptions);
|
|
259
|
+
}
|
|
260
|
+
function queryResolvedSteps(participantId, opts = {}, readOptions) {
|
|
261
|
+
if (!participantId) throw new Error("queryResolvedSteps: participantId is required");
|
|
262
|
+
const limit = clampPageLimit(opts.limit, 100);
|
|
263
|
+
const query = opts.cursor ? { cursorPaging: { limit, cursor: opts.cursor } } : { filter: { participantId: { $eq: participantId } }, cursorPaging: { limit } };
|
|
264
|
+
return wixCall("POST", "/online-programs/participants/v3/resolved-steps/query", { query }, readOptions);
|
|
265
|
+
}
|
|
266
|
+
function completeStep(participantId, programStepId, resolvedStep = {}, options) {
|
|
267
|
+
if (!participantId || !programStepId) throw new Error("completeStep: participantId and programStepId are required");
|
|
268
|
+
return wixCall(
|
|
269
|
+
"POST",
|
|
270
|
+
`/online-programs/participants/v3/resolved-steps/upsert/participant/${encodeURIComponent(participantId)}/step/${encodeURIComponent(programStepId)}`,
|
|
271
|
+
{ resolvedStep: { ...resolvedStep.status !== void 0 ? { status: resolvedStep.status } : {}, ...resolvedStep.quizSubmissionId ? { quizSubmissionId: resolvedStep.quizSubmissionId } : {}, participantId, programStepId } },
|
|
272
|
+
options
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
function undoStep(resolvedStepId, options) {
|
|
276
|
+
if (!resolvedStepId) throw new Error("undoStep: resolvedStepId is required");
|
|
277
|
+
return wixCall("DELETE", `/online-programs/participants/v3/resolved-steps/${encodeURIComponent(resolvedStepId)}`, void 0, options);
|
|
278
|
+
}
|
|
279
|
+
function getQuiz(quizId, readOptions) {
|
|
280
|
+
if (!quizId) throw new Error("getQuiz: quizId is required");
|
|
281
|
+
return wixCall("GET", `/online-programs/v1/quizzes/${encodeURIComponent(quizId)}`, void 0, readOptions);
|
|
282
|
+
}
|
|
283
|
+
function createQuizSubmission(submission, options) {
|
|
284
|
+
if (!submission?.quizId) throw new Error("createQuizSubmission: quizId is required");
|
|
285
|
+
return wixCall("POST", "/online-programs/v1/quiz-submissions", { quizSubmission: submission }, options);
|
|
286
|
+
}
|
|
287
|
+
function leaveProgram(participantId, options) {
|
|
288
|
+
if (!participantId) throw new Error("leaveProgram: participantId is required");
|
|
289
|
+
return wixCall("DELETE", `/online-programs/v3/participants/${encodeURIComponent(participantId)}`, void 0, options);
|
|
290
|
+
}
|
|
291
|
+
function getCertificateDownloadUrl(participantId, readOptions) {
|
|
292
|
+
if (!participantId) throw new Error("getCertificateDownloadUrl: participantId is required");
|
|
293
|
+
return wixCall("GET", `/online-programs/v3/participants/${encodeURIComponent(participantId)}/certificate-download-url`, void 0, readOptions);
|
|
294
|
+
}
|
|
240
295
|
function clampPageLimit(limit, max) {
|
|
241
296
|
const n = Math.floor(limit ?? max);
|
|
242
297
|
if (!Number.isFinite(n) || n < 1) return 1;
|
|
@@ -255,22 +310,31 @@ export {
|
|
|
255
310
|
MEMBER_FINISHED_PROGRESS_STATUSES,
|
|
256
311
|
PENDING_JOIN_APPLICATION_STATUSES,
|
|
257
312
|
cancelJoinApplication,
|
|
313
|
+
completeStep,
|
|
314
|
+
createQuizSubmission,
|
|
315
|
+
getCertificateDownloadUrl,
|
|
258
316
|
getCurrentJoinApplication,
|
|
259
317
|
getParticipationStats,
|
|
260
318
|
getPremiumStats,
|
|
261
319
|
getProgram,
|
|
320
|
+
getQuiz,
|
|
262
321
|
isParticipationBlocked,
|
|
263
322
|
joinProgram,
|
|
323
|
+
leaveProgram,
|
|
264
324
|
listJoinApplications,
|
|
265
325
|
listMyParticipations,
|
|
266
326
|
listProgramCategories,
|
|
327
|
+
listSections,
|
|
267
328
|
participantsShownByProgram,
|
|
268
329
|
participationsByProgram,
|
|
269
330
|
payableIdOf,
|
|
270
331
|
queryJoinApplications,
|
|
271
332
|
queryMemberParticipants,
|
|
333
|
+
queryParticipantSteps,
|
|
272
334
|
queryParticipants,
|
|
273
335
|
queryPrograms,
|
|
274
|
-
|
|
336
|
+
queryResolvedSteps,
|
|
337
|
+
searchMemberParticipation,
|
|
338
|
+
undoStep
|
|
275
339
|
};
|
|
276
340
|
//# sourceMappingURL=wix-online-programs.mjs.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"files": [
|
|
3
3
|
{
|
|
4
4
|
"name": "sw.js",
|
|
5
|
-
"bytes":
|
|
5
|
+
"bytes": 2572028
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"name": "host.html",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"bytes": 24320
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"name": "preview-deferred/
|
|
24
|
+
"name": "preview-deferred/707207384524513171a679366d75e91a1652b53eb3de01ef15418c4ba68c9370.bin",
|
|
25
25
|
"bytes": 488215
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
],
|
|
80
80
|
"deferred": [
|
|
81
81
|
{
|
|
82
|
-
"key": "assets/pdf-
|
|
82
|
+
"key": "assets/pdf-CR8c7gMK.js",
|
|
83
83
|
"contentType": "application/javascript; charset=utf-8",
|
|
84
|
-
"sha256": "
|
|
85
|
-
"file": "preview-deferred/
|
|
84
|
+
"sha256": "707207384524513171a679366d75e91a1652b53eb3de01ef15418c4ba68c9370",
|
|
85
|
+
"file": "preview-deferred/707207384524513171a679366d75e91a1652b53eb3de01ef15418c4ba68c9370.bin"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"key": "assets/pdf.worker.min-BGnVRhRG.js",
|