@wix/himalaya-cli 0.1751.0 → 0.1753.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/app-config.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +16 -1
- 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/stdlib/auth-providers/wix/src/index.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/native-engine.d.ts +49 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/copy.generated.d.ts +16 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/feedback.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/auth.mjs +27 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +105 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +27 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth/worker.mjs +133 -13
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth.mjs +139 -13
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{21f35a12bd94f4ab97a9a75453c4adcadc438daf024a4b1950d5c356c123bd01.bin → 2671d1cadb15daa5e59440f4c924e30c221ab3d405e8a56a0ab1cdbe4764af3d.bin} +1 -1
- package/dist/browser-plane/sw.js +1 -1
- package/dist/cli.mjs +3918 -3348
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/app-config.md +1 -1
- package/guides/himi-json-output.md +25 -3
- package/guides/one-app-section-mappings.md +1 -1
- package/guides/push-cli-onboarding.md +13 -0
- package/guides/qa-builds.md +3 -1
- package/guides/releasing-with-himi-serve.md +51 -0
- package/guides/store-submission.md +46 -1
- 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/fitness-gym/tier5-src/himi-fitcoach-goal/index.ts +3 -4
- 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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_recipe": "See all button for an INLINE programs list (a limited number of cards); shown only while more programs exist than the cards show. Omit when the scaffold has no himi_programs screen.",
|
|
3
|
+
"_placeholders": {
|
|
4
|
+
"svc": "service name registered with registerProgramsSection (inlineLimit set)",
|
|
5
|
+
"id": "unique node id prefix for this section",
|
|
6
|
+
"seeAllLabel": "button title",
|
|
7
|
+
"seeAllScreen": "screen id the button opens, himi_programs"
|
|
8
|
+
},
|
|
9
|
+
"node": {
|
|
10
|
+
"id": "{{id}}.seeall",
|
|
11
|
+
"body": {
|
|
12
|
+
"package": "himalaya",
|
|
13
|
+
"type": "VStack",
|
|
14
|
+
"props": {
|
|
15
|
+
"spacing": 0,
|
|
16
|
+
"alignment": "leading",
|
|
17
|
+
"children": [
|
|
18
|
+
{
|
|
19
|
+
"id": "{{id}}.seeall.button",
|
|
20
|
+
"body": {
|
|
21
|
+
"package": "himalaya",
|
|
22
|
+
"type": "Button",
|
|
23
|
+
"props": {
|
|
24
|
+
"title": "{{seeAllLabel}}",
|
|
25
|
+
"style": "secondary",
|
|
26
|
+
"size": "md",
|
|
27
|
+
"fullWidth": true,
|
|
28
|
+
"action": {
|
|
29
|
+
"actionId": "himi.open",
|
|
30
|
+
"params": { "screenId": "{{seeAllScreen}}" }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"modifiers": {
|
|
39
|
+
"padding": { "leading": 0, "trailing": 0, "top": 8, "bottom": 8 },
|
|
40
|
+
"hiddenPath": "$service:{{svc}}.noSeeAll"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -113,6 +113,7 @@ export interface State {
|
|
|
113
113
|
categoryId: string;
|
|
114
114
|
categoryChips: Option[];
|
|
115
115
|
hideCategoryFilter: boolean;
|
|
116
|
+
noSeeAll: boolean;
|
|
116
117
|
hidePriceRetry: boolean;
|
|
117
118
|
priceRetryText: string;
|
|
118
119
|
summary: string;
|
|
@@ -339,7 +340,7 @@ function programContent(o: { program: WixProgram; participant?: WixParticipant;
|
|
|
339
340
|
// ── Reads ────────────────────────────────────────────────────────────────────
|
|
340
341
|
|
|
341
342
|
interface Scope { email: string; memberId: string; scope: string }
|
|
342
|
-
interface PageMeta extends Record<string, unknown> { email: string; memberId: string; scope: string; needsSignIn: boolean; joinedFilter: boolean }
|
|
343
|
+
interface PageMeta extends Record<string, unknown> { email: string; memberId: string; scope: string; needsSignIn: boolean; joinedFilter: boolean; more?: boolean }
|
|
343
344
|
|
|
344
345
|
type Participations = Map<string, WixParticipant>;
|
|
345
346
|
/** The member's participations for this scope — walked once per first page, reused by its later pages. */
|
|
@@ -457,6 +458,9 @@ export interface ProgramsSectionOptions {
|
|
|
457
458
|
order?: string[];
|
|
458
459
|
/** list: hide a filter the source section turns off. */
|
|
459
460
|
filters?: { status?: boolean; category?: boolean };
|
|
461
|
+
/** list: the section's inline mode: show this many cards, no paging, and offer See all while more programs exist
|
|
462
|
+
* (the source's `extraProps.limit`). Absent: the list follows the cursor to the last program. */
|
|
463
|
+
inlineLimit?: number;
|
|
460
464
|
}
|
|
461
465
|
|
|
462
466
|
const CAROUSEL_LIMIT = 5;
|
|
@@ -469,6 +473,7 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
469
473
|
const display: Display = { card: carousel, duration: options.showDuration !== false, participants: options.showParticipants !== false };
|
|
470
474
|
const showPrice = options.showPrice !== false;
|
|
471
475
|
const limit = Math.min(PAGE_SIZE, Math.max(1, Math.floor(options.limit ?? CAROUSEL_LIMIT)));
|
|
476
|
+
const inlineLimit = !carousel && options.inlineLimit !== undefined && options.inlineLimit > 0 ? Math.min(PAGE_SIZE, Math.floor(options.inlineLimit)) : 0;
|
|
472
477
|
const order = (options.order ?? []).filter((id) => typeof id === "string" && id).slice(0, ORDER_LIMIT);
|
|
473
478
|
/** The promoted programs, in their configured order. A failed read promotes nothing: the default order stands. */
|
|
474
479
|
async function promotedPrograms(): Promise<WixProgram[]> {
|
|
@@ -537,13 +542,18 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
537
542
|
// An ended program the member never joined is not theirs to see (the One App's visibility rule) —
|
|
538
543
|
// applied only when the member's participations are known, so a degraded read hides nothing they joined.
|
|
539
544
|
.filter((p) => !isEnded(p) || participations.has(p.id) || !participationsKnown);
|
|
540
|
-
const programs = carousel ? visible.slice(0, limit) : visible;
|
|
545
|
+
const programs = carousel ? visible.slice(0, limit) : inlineLimit ? visible.slice(0, inlineLimit) : visible;
|
|
541
546
|
const pagingMetadata = response.pagingMetadata as { hasNext?: boolean; cursors?: { next?: string | null } } | undefined;
|
|
542
547
|
// A last page may still carry a cursor: `hasNext: false` wins, as in the catalog bundle.
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
548
|
+
const readCursor = carousel ? "" : pagingMetadata?.hasNext === false ? "" : pagingMetadata?.cursors?.next ?? "";
|
|
549
|
+
// An inline list never hands a cursor to the screen, but it still reads on past a page that held nothing to show.
|
|
550
|
+
const nextCursor = inlineLimit ? "" : readCursor;
|
|
551
|
+
if (!carousel && !inlineLimit && pagingMetadata?.hasNext && !nextCursor) throw new Error("Programs response is missing its next-page cursor");
|
|
552
|
+
// An inline list reads one page and says whether programs remain past what it shows: that is the See all.
|
|
553
|
+
const pageMore = visible.length > inlineLimit || pagingMetadata?.hasNext === true || !!readCursor;
|
|
554
|
+
if (inlineLimit) metadata.more = pageMore;
|
|
555
|
+
if (!programs.length && readCursor && readCursor !== pageCursor) {
|
|
556
|
+
if (read + 1 < MAX_EMPTY_READS) { pageCursor = readCursor; continue; }
|
|
547
557
|
// Past the cap, end the list rather than hand back an empty page with a cursor nothing can load.
|
|
548
558
|
return { items: [], nextCursor: "", metadata };
|
|
549
559
|
}
|
|
@@ -570,7 +580,7 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
570
580
|
status: "loading", rows: [], isLoading: true, notLoading: false, isErrored: false, notErrored: true, noEmpty: true, hideList: true,
|
|
571
581
|
emptyText: "", errorText: "", identityLine: "", needsSignIn: false, noSignIn: true, nextCursor: "", noMore: true, noPageError: true, loadingMore: false,
|
|
572
582
|
statusFilter: "all", statusOptions: [], hideStatusFilter: true, categoryId: "", categoryChips: [], hideCategoryFilter: true,
|
|
573
|
-
hidePriceRetry: true, priceRetryText: "", summary: "", hasRows: false, noRows: true,
|
|
583
|
+
noSeeAll: true, hidePriceRetry: true, priceRetryText: "", summary: "", hasRows: false, noRows: true,
|
|
574
584
|
};
|
|
575
585
|
|
|
576
586
|
/** A row shows a price when the section does and the member is not in or past the program. */
|
|
@@ -631,6 +641,8 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
631
641
|
hideStatusFilter: options.filters?.status === false || (!member && statusFilter !== "joined"),
|
|
632
642
|
categoryId, categoryChips,
|
|
633
643
|
hideCategoryFilter: options.filters?.category === false || categoriesFailed || !categories || categories.length === 0,
|
|
644
|
+
// See all only for an inline (limited) list that has programs past the cards it shows.
|
|
645
|
+
noSeeAll: !(inlineLimit && status === "ready" && meta.more === true),
|
|
634
646
|
hidePriceRetry: status !== "ready" || !views.some((view) => view && view.route !== "disabled" && (scopeIncomplete || view.retryable)),
|
|
635
647
|
priceRetryText: copyParam("memberPrograms.priceRetryText", "Some prices could not be loaded."),
|
|
636
648
|
// The rows loaded so far are not the catalog: a count is only true once the last page is in.
|
|
@@ -391,15 +391,20 @@ const svc = defineService<State, {
|
|
|
391
391
|
// survives a failed load, and registering from there would subscribe to a record
|
|
392
392
|
// this member's ownership was never established for — which `findOwnedOrder` and
|
|
393
393
|
// `assertOrderMember` exist to establish.
|
|
394
|
-
|
|
394
|
+
// `scheme`: the host app's own URL scheme (a site shell serving this screen registers its customer's,
|
|
395
|
+
// not Branded Lite's), so the activity's tap returns to the app that started it. Absent or malformed:
|
|
396
|
+
// Branded Lite's.
|
|
397
|
+
follow: (state, arg?: unknown) => {
|
|
395
398
|
if (state.liveTracking || !state.id || state.hideContent) return undefined;
|
|
399
|
+
const requested = (arg as { scheme?: unknown } | undefined)?.scheme;
|
|
400
|
+
const scheme = typeof requested === "string" && /^[a-z][a-z0-9+.-]*$/i.test(requested) ? requested : "himalaya-himi-branded-lite";
|
|
396
401
|
liveSession = beginLiveSession({
|
|
397
402
|
activityType: "member_order",
|
|
398
403
|
entityType: "order",
|
|
399
404
|
entityId: state.id,
|
|
400
405
|
headline: state.title || copyParam("order.followHeadline", "Your order"),
|
|
401
406
|
detail: [state.fulfillmentStatus, state.total].filter(Boolean).join(" · "),
|
|
402
|
-
deepLink:
|
|
407
|
+
deepLink: `${scheme}://screen/himi_order?id=${encodeURIComponent(state.id)}`,
|
|
403
408
|
ttlSeconds: FOLLOW_TTL_SECONDS,
|
|
404
409
|
startingNote: copyParam("order.followStarting", "Starting…"),
|
|
405
410
|
unavailableNote: copyParam("order.followUnavailable", "This device has no live surface."),
|
|
@@ -391,15 +391,20 @@ const svc = defineService<State, {
|
|
|
391
391
|
// survives a failed load, and registering from there would subscribe to a record
|
|
392
392
|
// this member's ownership was never established for — which `findOwnedOrder` and
|
|
393
393
|
// `assertOrderMember` exist to establish.
|
|
394
|
-
|
|
394
|
+
// `scheme`: the host app's own URL scheme (a site shell serving this screen registers its customer's,
|
|
395
|
+
// not Branded Lite's), so the activity's tap returns to the app that started it. Absent or malformed:
|
|
396
|
+
// Branded Lite's.
|
|
397
|
+
follow: (state, arg?: unknown) => {
|
|
395
398
|
if (state.liveTracking || !state.id || state.hideContent) return undefined;
|
|
399
|
+
const requested = (arg as { scheme?: unknown } | undefined)?.scheme;
|
|
400
|
+
const scheme = typeof requested === "string" && /^[a-z][a-z0-9+.-]*$/i.test(requested) ? requested : "himalaya-himi-branded-lite";
|
|
396
401
|
liveSession = beginLiveSession({
|
|
397
402
|
activityType: "member_order",
|
|
398
403
|
entityType: "order",
|
|
399
404
|
entityId: state.id,
|
|
400
405
|
headline: state.title || copyParam("order.followHeadline", "Your order"),
|
|
401
406
|
detail: [state.fulfillmentStatus, state.total].filter(Boolean).join(" · "),
|
|
402
|
-
deepLink:
|
|
407
|
+
deepLink: `${scheme}://screen/himi_order?id=${encodeURIComponent(state.id)}`,
|
|
403
408
|
ttlSeconds: FOLLOW_TTL_SECONDS,
|
|
404
409
|
startingNote: copyParam("order.followStarting", "Starting…"),
|
|
405
410
|
unavailableNote: copyParam("order.followUnavailable", "This device has no live surface."),
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_recipe": "The programs list's two filters: the participant-status segmented control (All programs / Programs I joined; hidden for a guest) and the category chips (All categories first; hidden when the site has no categories). Service: registerProgramsSection(svc,{layout:'list'}); the worker owns the options and hides a control the source turns off (options.filters). Also the list's empty line (a category or the joined filter with no programs), hidden while there are cards.",
|
|
3
|
+
"_placeholders": {
|
|
4
|
+
"svc": "service name the page worker registered with registerProgramsSection",
|
|
5
|
+
"id": "unique node id prefix (e.g. the screen id)",
|
|
6
|
+
"statusLabel": "accessibility label of the status control",
|
|
7
|
+
"categoryLabel": "accessibility label of the category chips",
|
|
8
|
+
"allProgramsLabel": "fallback label of the first status option",
|
|
9
|
+
"joinedLabel": "fallback label of the second status option",
|
|
10
|
+
"allCategoriesLabel": "fallback label of the first category chip"
|
|
11
|
+
},
|
|
12
|
+
"node": {
|
|
13
|
+
"id": "{{id}}.filters",
|
|
14
|
+
"body": {
|
|
15
|
+
"package": "himalaya",
|
|
16
|
+
"type": "VStack",
|
|
17
|
+
"props": {
|
|
18
|
+
"spacing": 10,
|
|
19
|
+
"alignment": "leading",
|
|
20
|
+
"children": [
|
|
21
|
+
{
|
|
22
|
+
"id": "{{id}}.status_filter",
|
|
23
|
+
"body": {
|
|
24
|
+
"package": "himalaya",
|
|
25
|
+
"type": "SegmentedControl",
|
|
26
|
+
"props": {
|
|
27
|
+
"options": [
|
|
28
|
+
{
|
|
29
|
+
"id": "all",
|
|
30
|
+
"label": "{{allProgramsLabel}}"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "joined",
|
|
34
|
+
"label": "{{joinedLabel}}"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"optionsPath": "$service:{{svc}}.statusOptions",
|
|
38
|
+
"selectedId": "$service:{{svc}}.statusFilter",
|
|
39
|
+
"onChange": {
|
|
40
|
+
"actionId": "tier5.{{svc}}.setStatus"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"modifiers": {
|
|
45
|
+
"accessibilityLabel": "{{statusLabel}}",
|
|
46
|
+
"hiddenPath": "$service:{{svc}}.hideStatusFilter"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "{{id}}.category_filter",
|
|
51
|
+
"body": {
|
|
52
|
+
"package": "himalaya",
|
|
53
|
+
"type": "FilterChips",
|
|
54
|
+
"props": {
|
|
55
|
+
"chips": [
|
|
56
|
+
{
|
|
57
|
+
"id": "",
|
|
58
|
+
"label": "{{allCategoriesLabel}}"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"optionsPath": "$service:{{svc}}.categoryChips",
|
|
62
|
+
"selectedIds": [
|
|
63
|
+
"$service:{{svc}}.categoryId"
|
|
64
|
+
],
|
|
65
|
+
"onChange": {
|
|
66
|
+
"actionId": "tier5.{{svc}}.setCategory"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"modifiers": {
|
|
71
|
+
"accessibilityLabel": "{{categoryLabel}}",
|
|
72
|
+
"hiddenPath": "$service:{{svc}}.hideCategoryFilter"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "{{id}}.empty",
|
|
77
|
+
"body": {
|
|
78
|
+
"package": "himalaya",
|
|
79
|
+
"type": "Text",
|
|
80
|
+
"props": {
|
|
81
|
+
"text": "$service:{{svc}}.emptyText",
|
|
82
|
+
"style": "body",
|
|
83
|
+
"color": "textSecondary"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"modifiers": {
|
|
87
|
+
"hiddenPath": "$service:{{svc}}.noEmpty"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_recipe": "See all button for an INLINE programs list (a limited number of cards); shown only while more programs exist than the cards show. Omit when the scaffold has no himi_programs screen.",
|
|
3
|
+
"_placeholders": {
|
|
4
|
+
"svc": "service name registered with registerProgramsSection (inlineLimit set)",
|
|
5
|
+
"id": "unique node id prefix for this section",
|
|
6
|
+
"seeAllLabel": "button title",
|
|
7
|
+
"seeAllScreen": "screen id the button opens, himi_programs"
|
|
8
|
+
},
|
|
9
|
+
"node": {
|
|
10
|
+
"id": "{{id}}.seeall",
|
|
11
|
+
"body": {
|
|
12
|
+
"package": "himalaya",
|
|
13
|
+
"type": "VStack",
|
|
14
|
+
"props": {
|
|
15
|
+
"spacing": 0,
|
|
16
|
+
"alignment": "leading",
|
|
17
|
+
"children": [
|
|
18
|
+
{
|
|
19
|
+
"id": "{{id}}.seeall.button",
|
|
20
|
+
"body": {
|
|
21
|
+
"package": "himalaya",
|
|
22
|
+
"type": "Button",
|
|
23
|
+
"props": {
|
|
24
|
+
"title": "{{seeAllLabel}}",
|
|
25
|
+
"style": "secondary",
|
|
26
|
+
"size": "md",
|
|
27
|
+
"fullWidth": true,
|
|
28
|
+
"action": {
|
|
29
|
+
"actionId": "himi.open",
|
|
30
|
+
"params": { "screenId": "{{seeAllScreen}}" }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"modifiers": {
|
|
39
|
+
"padding": { "leading": 0, "trailing": 0, "top": 8, "bottom": 8 },
|
|
40
|
+
"hiddenPath": "$service:{{svc}}.noSeeAll"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -113,6 +113,7 @@ export interface State {
|
|
|
113
113
|
categoryId: string;
|
|
114
114
|
categoryChips: Option[];
|
|
115
115
|
hideCategoryFilter: boolean;
|
|
116
|
+
noSeeAll: boolean;
|
|
116
117
|
hidePriceRetry: boolean;
|
|
117
118
|
priceRetryText: string;
|
|
118
119
|
summary: string;
|
|
@@ -339,7 +340,7 @@ function programContent(o: { program: WixProgram; participant?: WixParticipant;
|
|
|
339
340
|
// ── Reads ────────────────────────────────────────────────────────────────────
|
|
340
341
|
|
|
341
342
|
interface Scope { email: string; memberId: string; scope: string }
|
|
342
|
-
interface PageMeta extends Record<string, unknown> { email: string; memberId: string; scope: string; needsSignIn: boolean; joinedFilter: boolean }
|
|
343
|
+
interface PageMeta extends Record<string, unknown> { email: string; memberId: string; scope: string; needsSignIn: boolean; joinedFilter: boolean; more?: boolean }
|
|
343
344
|
|
|
344
345
|
type Participations = Map<string, WixParticipant>;
|
|
345
346
|
/** The member's participations for this scope — walked once per first page, reused by its later pages. */
|
|
@@ -457,6 +458,9 @@ export interface ProgramsSectionOptions {
|
|
|
457
458
|
order?: string[];
|
|
458
459
|
/** list: hide a filter the source section turns off. */
|
|
459
460
|
filters?: { status?: boolean; category?: boolean };
|
|
461
|
+
/** list: the section's inline mode: show this many cards, no paging, and offer See all while more programs exist
|
|
462
|
+
* (the source's `extraProps.limit`). Absent: the list follows the cursor to the last program. */
|
|
463
|
+
inlineLimit?: number;
|
|
460
464
|
}
|
|
461
465
|
|
|
462
466
|
const CAROUSEL_LIMIT = 5;
|
|
@@ -469,6 +473,7 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
469
473
|
const display: Display = { card: carousel, duration: options.showDuration !== false, participants: options.showParticipants !== false };
|
|
470
474
|
const showPrice = options.showPrice !== false;
|
|
471
475
|
const limit = Math.min(PAGE_SIZE, Math.max(1, Math.floor(options.limit ?? CAROUSEL_LIMIT)));
|
|
476
|
+
const inlineLimit = !carousel && options.inlineLimit !== undefined && options.inlineLimit > 0 ? Math.min(PAGE_SIZE, Math.floor(options.inlineLimit)) : 0;
|
|
472
477
|
const order = (options.order ?? []).filter((id) => typeof id === "string" && id).slice(0, ORDER_LIMIT);
|
|
473
478
|
/** The promoted programs, in their configured order. A failed read promotes nothing: the default order stands. */
|
|
474
479
|
async function promotedPrograms(): Promise<WixProgram[]> {
|
|
@@ -537,13 +542,18 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
537
542
|
// An ended program the member never joined is not theirs to see (the One App's visibility rule) —
|
|
538
543
|
// applied only when the member's participations are known, so a degraded read hides nothing they joined.
|
|
539
544
|
.filter((p) => !isEnded(p) || participations.has(p.id) || !participationsKnown);
|
|
540
|
-
const programs = carousel ? visible.slice(0, limit) : visible;
|
|
545
|
+
const programs = carousel ? visible.slice(0, limit) : inlineLimit ? visible.slice(0, inlineLimit) : visible;
|
|
541
546
|
const pagingMetadata = response.pagingMetadata as { hasNext?: boolean; cursors?: { next?: string | null } } | undefined;
|
|
542
547
|
// A last page may still carry a cursor: `hasNext: false` wins, as in the catalog bundle.
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
548
|
+
const readCursor = carousel ? "" : pagingMetadata?.hasNext === false ? "" : pagingMetadata?.cursors?.next ?? "";
|
|
549
|
+
// An inline list never hands a cursor to the screen, but it still reads on past a page that held nothing to show.
|
|
550
|
+
const nextCursor = inlineLimit ? "" : readCursor;
|
|
551
|
+
if (!carousel && !inlineLimit && pagingMetadata?.hasNext && !nextCursor) throw new Error("Programs response is missing its next-page cursor");
|
|
552
|
+
// An inline list reads one page and says whether programs remain past what it shows: that is the See all.
|
|
553
|
+
const pageMore = visible.length > inlineLimit || pagingMetadata?.hasNext === true || !!readCursor;
|
|
554
|
+
if (inlineLimit) metadata.more = pageMore;
|
|
555
|
+
if (!programs.length && readCursor && readCursor !== pageCursor) {
|
|
556
|
+
if (read + 1 < MAX_EMPTY_READS) { pageCursor = readCursor; continue; }
|
|
547
557
|
// Past the cap, end the list rather than hand back an empty page with a cursor nothing can load.
|
|
548
558
|
return { items: [], nextCursor: "", metadata };
|
|
549
559
|
}
|
|
@@ -570,7 +580,7 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
570
580
|
status: "loading", rows: [], isLoading: true, notLoading: false, isErrored: false, notErrored: true, noEmpty: true, hideList: true,
|
|
571
581
|
emptyText: "", errorText: "", identityLine: "", needsSignIn: false, noSignIn: true, nextCursor: "", noMore: true, noPageError: true, loadingMore: false,
|
|
572
582
|
statusFilter: "all", statusOptions: [], hideStatusFilter: true, categoryId: "", categoryChips: [], hideCategoryFilter: true,
|
|
573
|
-
hidePriceRetry: true, priceRetryText: "", summary: "", hasRows: false, noRows: true,
|
|
583
|
+
noSeeAll: true, hidePriceRetry: true, priceRetryText: "", summary: "", hasRows: false, noRows: true,
|
|
574
584
|
};
|
|
575
585
|
|
|
576
586
|
/** A row shows a price when the section does and the member is not in or past the program. */
|
|
@@ -631,6 +641,8 @@ export function registerProgramsSection(serviceName: string, options: ProgramsSe
|
|
|
631
641
|
hideStatusFilter: options.filters?.status === false || (!member && statusFilter !== "joined"),
|
|
632
642
|
categoryId, categoryChips,
|
|
633
643
|
hideCategoryFilter: options.filters?.category === false || categoriesFailed || !categories || categories.length === 0,
|
|
644
|
+
// See all only for an inline (limited) list that has programs past the cards it shows.
|
|
645
|
+
noSeeAll: !(inlineLimit && status === "ready" && meta.more === true),
|
|
634
646
|
hidePriceRetry: status !== "ready" || !views.some((view) => view && view.route !== "disabled" && (scopeIncomplete || view.retryable)),
|
|
635
647
|
priceRetryText: copyParam("memberPrograms.priceRetryText", "Some prices could not be loaded."),
|
|
636
648
|
// The rows loaded so far are not the catalog: a count is only true once the last page is in.
|