@wix/himalaya-cli 0.1752.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/ts/src/site-shell.d.ts +10 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +105 -0
- package/dist/cli.mjs +43 -9
- package/guides/one-app-section-mappings.md +1 -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/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
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;
|
|
@@ -15827,6 +15827,108 @@ function assertExternalUrl(site, value, where) {
|
|
|
15827
15827
|
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
15828
|
}
|
|
15829
15829
|
}
|
|
15830
|
+
var SITE_STAND_INS = {
|
|
15831
|
+
himi_business_chat: /^(contact|contact-us|contact-me)$|^\/contact/,
|
|
15832
|
+
himi_shop: /^(shop|store|products)$|^\/(shop|store|category|products)/,
|
|
15833
|
+
himi_plans: /^(plans|pricing)$|^\/(plans|pricing|plans-pricing)/
|
|
15834
|
+
};
|
|
15835
|
+
var ALWAYS_HIDDEN_TARGETS = ["himi_cart", "himi_new_message"];
|
|
15836
|
+
var HIDDEN_ACTIONS = ["tier5.himiBrandedOrder.reorder"];
|
|
15837
|
+
var LABEL_FOR = { action: "actionLabel", cta: "ctaLabel" };
|
|
15838
|
+
function standInActions(site) {
|
|
15839
|
+
const tapFor = (id, target) => siteTopBarDefault({ ...site, topBar: { actions: [{ id, icon: "globe", label: id, target }] } })?.actions?.[0]?.onTap;
|
|
15840
|
+
const taps = /* @__PURE__ */ new Map();
|
|
15841
|
+
for (const [screenId, match] of Object.entries(SITE_STAND_INS)) {
|
|
15842
|
+
const page = site.pages.find((p) => match.test(p.id)) ?? site.pages.find((p) => match.test(p.path));
|
|
15843
|
+
const tap = page && tapFor(screenId, { page: page.id });
|
|
15844
|
+
if (tap) taps.set(screenId, tap);
|
|
15845
|
+
}
|
|
15846
|
+
for (const page of site.nativePages ?? []) {
|
|
15847
|
+
const tap = tapFor(page.screenId, { screen: page.screenId });
|
|
15848
|
+
if (tap && tap.actionId === "himi.tab") taps.set(page.screenId, tap);
|
|
15849
|
+
}
|
|
15850
|
+
return taps;
|
|
15851
|
+
}
|
|
15852
|
+
function siteShellLinks(site) {
|
|
15853
|
+
const standIns = standInActions(site);
|
|
15854
|
+
const verdict = (action) => {
|
|
15855
|
+
if (!action || typeof action !== "object") return "keep";
|
|
15856
|
+
const a = action;
|
|
15857
|
+
if (HIDDEN_ACTIONS.includes(a.actionId)) return "hide";
|
|
15858
|
+
if (a.actionId !== "himi.open") return "keep";
|
|
15859
|
+
const target = a.params?.screenId;
|
|
15860
|
+
if (!target) return "keep";
|
|
15861
|
+
if (standIns.has(target)) return standIns.get(target);
|
|
15862
|
+
if (ALWAYS_HIDDEN_TARGETS.includes(target) || target in SITE_STAND_INS) return "hide";
|
|
15863
|
+
return "keep";
|
|
15864
|
+
};
|
|
15865
|
+
const visit = (node) => {
|
|
15866
|
+
if (Array.isArray(node)) {
|
|
15867
|
+
for (let i = node.length - 1; i >= 0; i--) if (!visit(node[i])) node.splice(i, 1);
|
|
15868
|
+
return true;
|
|
15869
|
+
}
|
|
15870
|
+
if (!node || typeof node !== "object") return true;
|
|
15871
|
+
const n = node;
|
|
15872
|
+
const body = n.body;
|
|
15873
|
+
const props = body?.props;
|
|
15874
|
+
if (props) {
|
|
15875
|
+
for (const key of ["action", "cta"]) {
|
|
15876
|
+
const v = verdict(props[key]);
|
|
15877
|
+
if (v === "hide") {
|
|
15878
|
+
if (body.type === "Button") return false;
|
|
15879
|
+
delete props[key];
|
|
15880
|
+
delete props[LABEL_FOR[key]];
|
|
15881
|
+
} else if (v !== "keep") props[key] = { ...v };
|
|
15882
|
+
}
|
|
15883
|
+
}
|
|
15884
|
+
const modifiers = n.modifiers;
|
|
15885
|
+
if (modifiers) {
|
|
15886
|
+
const v = verdict(modifiers.onTap);
|
|
15887
|
+
if (v === "hide") return false;
|
|
15888
|
+
if (v !== "keep") modifiers.onTap = { ...v };
|
|
15889
|
+
}
|
|
15890
|
+
for (const [key, value] of Object.entries(n)) {
|
|
15891
|
+
if (key === "modifiers") continue;
|
|
15892
|
+
if (value && typeof value === "object" && !visit(value)) delete n[key];
|
|
15893
|
+
}
|
|
15894
|
+
return true;
|
|
15895
|
+
};
|
|
15896
|
+
return (descriptor) => {
|
|
15897
|
+
const copy = JSON.parse(JSON.stringify(descriptor));
|
|
15898
|
+
for (const key of Object.keys(copy)) {
|
|
15899
|
+
if (key === "logicBundle") continue;
|
|
15900
|
+
const part = copy[key];
|
|
15901
|
+
if (part && typeof part === "object" && !visit(part)) delete copy[key];
|
|
15902
|
+
}
|
|
15903
|
+
return copy;
|
|
15904
|
+
};
|
|
15905
|
+
}
|
|
15906
|
+
function withSiteTopBarActions(descriptor, defaults) {
|
|
15907
|
+
const extra = defaults?.actions ?? [];
|
|
15908
|
+
if (!descriptor.topBar || extra.length === 0) return descriptor;
|
|
15909
|
+
const own2 = descriptor.topBar.actions ?? [];
|
|
15910
|
+
const ids = new Set(own2.map((action) => action.id));
|
|
15911
|
+
const opensSelf = (action) => action.onTap?.params?.screenId === descriptor.screenId;
|
|
15912
|
+
const added = extra.filter((action) => !ids.has(action.id) && !opensSelf(action));
|
|
15913
|
+
if (added.length === 0) return descriptor;
|
|
15914
|
+
const room = Math.max(0, SITE_SCREEN_TRAILING_SLOTS - own2.length);
|
|
15915
|
+
const overflow = added.slice(room).map((action) => ({
|
|
15916
|
+
id: action.id,
|
|
15917
|
+
placement: "overflow",
|
|
15918
|
+
label: action.accessibilityLabel ?? action.label ?? action.id,
|
|
15919
|
+
...action.icon !== void 0 ? { icon: action.icon } : {},
|
|
15920
|
+
...action.onTap !== void 0 ? { onTap: action.onTap } : {}
|
|
15921
|
+
}));
|
|
15922
|
+
return {
|
|
15923
|
+
...descriptor,
|
|
15924
|
+
topBar: {
|
|
15925
|
+
...descriptor.topBar,
|
|
15926
|
+
actions: [...own2, ...added.slice(0, room)],
|
|
15927
|
+
...overflow.length > 0 ? { items: [...descriptor.topBar.items ?? [], ...overflow] } : {}
|
|
15928
|
+
}
|
|
15929
|
+
};
|
|
15930
|
+
}
|
|
15931
|
+
var SITE_SCREEN_TRAILING_SLOTS = 2;
|
|
15830
15932
|
|
|
15831
15933
|
// ../../core/ts/src/site-web-sdk.generated.ts
|
|
15832
15934
|
var PAGE_CAPABILITY_DISPATCHES = {
|
|
@@ -16228,6 +16330,7 @@ export {
|
|
|
16228
16330
|
SITE_PRIVATE_NATIVE_SCREENS,
|
|
16229
16331
|
SITE_SCREEN_FORMS,
|
|
16230
16332
|
SITE_SCREEN_PREFIX,
|
|
16333
|
+
SITE_SCREEN_TRAILING_SLOTS,
|
|
16231
16334
|
SITE_SHELL_MAX_TABS,
|
|
16232
16335
|
SITE_TOP_BAR_MAX_ACTIONS,
|
|
16233
16336
|
SITE_WEB_SDK_GENERATED_PREFIX,
|
|
@@ -16380,6 +16483,7 @@ export {
|
|
|
16380
16483
|
sitePageUrl,
|
|
16381
16484
|
siteScreenId,
|
|
16382
16485
|
siteScreens,
|
|
16486
|
+
siteShellLinks,
|
|
16383
16487
|
siteSidebar,
|
|
16384
16488
|
siteTopBarDefault,
|
|
16385
16489
|
siteWebSdkBundleName,
|
|
@@ -16413,6 +16517,7 @@ export {
|
|
|
16413
16517
|
widgetSnapshotSchema,
|
|
16414
16518
|
withSiteNativeScreenTopBar,
|
|
16415
16519
|
withSiteNativeScreenTopBarBuilder,
|
|
16520
|
+
withSiteTopBarActions,
|
|
16416
16521
|
withSiteWebSdk,
|
|
16417
16522
|
workerSubtreePolicyErrors,
|
|
16418
16523
|
workerSubtreeSha256,
|
package/dist/cli.mjs
CHANGED
|
@@ -39877,7 +39877,6 @@ function resolveIdiom(tokens2, ctx = {}) {
|
|
|
39877
39877
|
var IDIOM_CONTEXTS, UNSAFE_KEYS;
|
|
39878
39878
|
var init_idiom = __esm({
|
|
39879
39879
|
"../../core/ts/src/idiom.ts"() {
|
|
39880
|
-
"use strict";
|
|
39881
39880
|
init_define_HHP_CATALOG();
|
|
39882
39881
|
IDIOM_CONTEXTS = {
|
|
39883
39882
|
ios: { native: ["ios"] },
|
|
@@ -266697,6 +266696,15 @@ function composed2(id, s5, svc, nodes2) {
|
|
|
266697
266696
|
else out2.push(vstack(`${id}.box`, nodes2, 0, { onAppear: { actionId: `tier5.${svc}.load`, params: {} } }));
|
|
266698
266697
|
return out2;
|
|
266699
266698
|
}
|
|
266699
|
+
function programsLimit(section3, settings) {
|
|
266700
|
+
const extra = obj8(section3.extraProps);
|
|
266701
|
+
const authored2 = extra.limit ?? settings.limit;
|
|
266702
|
+
const count2 = countOf2(authored2);
|
|
266703
|
+
if (count2 !== void 0) return count2;
|
|
266704
|
+
if (settings.isInfinite === true || settings.infinite === true || settings.allowInfinite === true || extra.infinite === true || extra.allowInfinite === true) return void 0;
|
|
266705
|
+
if (authored2 === void 0 || authored2 === null) return PROGRAMS_DEFAULT_LIMIT;
|
|
266706
|
+
return void 0;
|
|
266707
|
+
}
|
|
266700
266708
|
function productsSection(kind) {
|
|
266701
266709
|
const type2 = kind === "carousel" ? "stores_products_carousel_section" : "stores_products_grid_section";
|
|
266702
266710
|
return (id, s5, st2, index, ctx, sectionId) => {
|
|
@@ -267282,7 +267290,7 @@ function addNavigation(out2, plan, taken2) {
|
|
|
267282
267290
|
out2.routes.push({ layoutItemId: "(more)", label: "More", screenId, kind: "generated" });
|
|
267283
267291
|
out2.tabs.push({ layoutItemId: "(more)", label: "More", screenId });
|
|
267284
267292
|
}
|
|
267285
|
-
var TEMPLATE_HOME_SCREEN, TEMPLATE_SCREEN_PARAM_KEYS, SYSTEM_ALL_PRODUCTS_ID, collectionParams, TEMPLATE_PARAMS, countOf2, SCREEN_ADAPTATIONS, FALLBACK_TARGETS, NO_INLINE_SECTION, ROUTE_PLACEHOLDER, BOTTOM_TABS_BEFORE_MORE, TEMPLATE_VERTICALS, TEMPLATE_FALLBACKS, MODULES, obj8, arr, str16, node, text26, vstack, hstack, inset, openUrl2, youtubeIdOf, DIRECT_VIDEO_FILE, dialUrl, mailUrl, BUSINESS_CHAT_SCREEN, sourceTap, BLOG_HERO_MAX, SHOP_ALL, PRODUCTS_INLINE, HANDLERS, MERGED_PAGES_BUNDLE, chevron;
|
|
267293
|
+
var TEMPLATE_HOME_SCREEN, TEMPLATE_SCREEN_PARAM_KEYS, SYSTEM_ALL_PRODUCTS_ID, collectionParams, TEMPLATE_PARAMS, countOf2, SCREEN_ADAPTATIONS, FALLBACK_TARGETS, NO_INLINE_SECTION, ROUTE_PLACEHOLDER, BOTTOM_TABS_BEFORE_MORE, TEMPLATE_VERTICALS, TEMPLATE_FALLBACKS, MODULES, obj8, arr, str16, node, text26, vstack, hstack, inset, openUrl2, youtubeIdOf, DIRECT_VIDEO_FILE, dialUrl, mailUrl, BUSINESS_CHAT_SCREEN, sourceTap, PROGRAMS_DEFAULT_LIMIT, PROGRAMS_INLINE_MAX, BLOG_HERO_MAX, SHOP_ALL, PRODUCTS_INLINE, HANDLERS, MERGED_PAGES_BUNDLE, chevron;
|
|
267286
267294
|
var init_generate2 = __esm({
|
|
267287
267295
|
"src/one-app/generate.ts"() {
|
|
267288
267296
|
init_define_HHP_CATALOG();
|
|
@@ -267437,6 +267445,8 @@ var init_generate2 = __esm({
|
|
|
267437
267445
|
if (action.type === "vertical" && str16(action.ctaId).startsWith("chat.") && hasScreen2(BUSINESS_CHAT_SCREEN)) return { actionId: "himi.open", params: { screenId: BUSINESS_CHAT_SCREEN } };
|
|
267438
267446
|
return void 0;
|
|
267439
267447
|
};
|
|
267448
|
+
PROGRAMS_DEFAULT_LIMIT = 2;
|
|
267449
|
+
PROGRAMS_INLINE_MAX = 20;
|
|
267440
267450
|
BLOG_HERO_MAX = 10;
|
|
267441
267451
|
SHOP_ALL = "all";
|
|
267442
267452
|
PRODUCTS_INLINE = { carousel: 8, grid: 6 };
|
|
@@ -267698,19 +267708,43 @@ var init_generate2 = __esm({
|
|
|
267698
267708
|
children2.push(ctx.recipe("programs-carousel", { svc, id, detailScreen: "himi_program" }), ...ctx.optionalRecipe("section-error", { svc, id, action: "retry" }));
|
|
267699
267709
|
return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
|
|
267700
267710
|
},
|
|
267701
|
-
// The programs list:
|
|
267711
|
+
// The programs list: full-width cards from the shared programs module (the list layout pages itself), with the source's
|
|
267712
|
+
// category and participant-status filters. The source's inline mode (`limit`, default 2) shows that many cards and a
|
|
267713
|
+
// See All to the programs screen while more programs exist; an authored limit or an infinite list is followed.
|
|
267702
267714
|
achievements_list_section: (id, s5, st2, index, ctx, sectionId) => {
|
|
267715
|
+
const filterSettings = obj8(st2.filterSettings);
|
|
267716
|
+
const filtersOn = st2.isFilterVisible !== false;
|
|
267717
|
+
const filters = { status: filtersOn && filterSettings.byParticipantStatus !== false, category: filtersOn && filterSettings.byCategory !== false };
|
|
267718
|
+
const limit = programsLimit(s5, st2);
|
|
267719
|
+
if (limit !== void 0 && limit > PROGRAMS_INLINE_MAX) ctx.gap(sectionId, "achievements_list_section", `the source shows ${limit} programs inline; the inline list shows at most ${PROGRAMS_INLINE_MAX} and offers See All for the rest`);
|
|
267703
267720
|
const svc = ctx.uses("programs", `programs${index}`, {
|
|
267704
267721
|
layout: "list",
|
|
267705
267722
|
showDuration: st2.isDurationVisible !== false,
|
|
267706
267723
|
showParticipants: st2.isParticipantsVisible !== false,
|
|
267707
|
-
showPrice: st2.isPriceVisible !== false
|
|
267724
|
+
showPrice: st2.isPriceVisible !== false,
|
|
267725
|
+
filters,
|
|
267726
|
+
...limit !== void 0 ? { inlineLimit: limit } : {}
|
|
267708
267727
|
});
|
|
267709
|
-
const
|
|
267710
|
-
|
|
267711
|
-
|
|
267712
|
-
|
|
267713
|
-
|
|
267728
|
+
const card2 = ctx.recipe("programs-card", { svc, id, detailScreen: "himi_program" });
|
|
267729
|
+
const filterNodes = filters.status || filters.category ? ctx.optionalRecipe("programs-filters", {
|
|
267730
|
+
svc,
|
|
267731
|
+
id,
|
|
267732
|
+
statusLabel: "Show programs",
|
|
267733
|
+
categoryLabel: "Filter by category",
|
|
267734
|
+
allProgramsLabel: "All programs",
|
|
267735
|
+
joinedLabel: "Programs I joined",
|
|
267736
|
+
allCategoriesLabel: "All categories"
|
|
267737
|
+
}) : [];
|
|
267738
|
+
if ((filters.status || filters.category) && !filterNodes.length) {
|
|
267739
|
+
ctx.gap(sectionId, "achievements_list_section", "the source shows category and participant-status filters; this scaffold ships no programs-filters recipe, so the list has no filter controls");
|
|
267740
|
+
}
|
|
267741
|
+
const nodes2 = [...filterNodes, card2, ...ctx.optionalRecipe("section-error", { svc, id, action: "retry" })];
|
|
267742
|
+
if (limit !== void 0) {
|
|
267743
|
+
const seeAll = ctx.hasScreen("himi_programs") ? ctx.optionalRecipe("programs-see-all", { svc, id, seeAllLabel: "See All", seeAllScreen: "himi_programs" }) : [];
|
|
267744
|
+
if (seeAll.length) nodes2.push(...seeAll);
|
|
267745
|
+
else ctx.gap(sectionId, "achievements_list_section", "the source offers See All for more programs; this scaffold has no himi_programs screen or no programs-see-all recipe, so the button is left out");
|
|
267746
|
+
}
|
|
267747
|
+
return composed2(id, s5, svc, nodes2);
|
|
267714
267748
|
},
|
|
267715
267749
|
// The members directory: search with the member count, flat rows, letter bands, role, activity, badges and Follow. The
|
|
267716
267750
|
// section has no settings of its own, so the native defaults are the contract: every extra is on.
|
|
@@ -79,7 +79,7 @@ The **Himalaya implementation** cell is blank for every unassigned row. Notes on
|
|
|
79
79
|
|
|
80
80
|
| Source sectionDefinitionId | Source viewer component | Himalaya implementation | Placement / reuse | Class | Settings, actions and gaps |
|
|
81
81
|
| --- | --- | --- | --- | --- | --- |
|
|
82
|
-
| `achievements_list_section` | `wix-one-app-achievements.SectionMemberChallengesScreen` | [Programs list/detail](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/apps/himi-branded-lite/dev/index.ts) + [programs worker](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/tier5-bundles-src/himi-branded-lite-programs/index.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Existing base; member list added | Partial | `himi_member_programs` (worker `himi-branded-lite-member-programs`) is the member list: each card carries the signed-in member's standing from Participants v3 / Join Applications v3 (Joined, Program complete, Program ended, Pending request, Request approved, Invited, Participation suspended), a progress bar once started, the price before joining, the "All programs / Programs I joined" and category filters, cursor paging and pull-to-refresh; an ended program the member never joined is dropped.
|
|
82
|
+
| `achievements_list_section` | `wix-one-app-achievements.SectionMemberChallengesScreen` | [Programs list/detail](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/apps/himi-branded-lite/dev/index.ts) + [programs worker](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/tier5-bundles-src/himi-branded-lite-programs/index.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Existing base; member list added | Partial | `himi_member_programs` (worker `himi-branded-lite-member-programs`) is the member list: each card carries the signed-in member's standing from Participants v3 / Join Applications v3 (Joined, Program complete, Program ended, Pending request, Request approved, Invited, Participation suspended), a progress bar once started, the price before joining, the "All programs / Programs I joined" and category filters, cursor paging and pull-to-refresh; an ended program the member never joined is dropped. The migration generator now composes the list inline: the category and "All programs / Programs I joined" filters (hidden when `isFilterVisible` is false), the default 2-card mode (`extraProps.limit`, an authored limit or an infinite list is followed) and "See all" to `himi_programs` only while more programs exist. Still open: join / cancel-request actions on the card itself (the card opens the program, which owns them), and Pricing Plans benefits ("Included in your plan"). |
|
|
83
83
|
| `achievements_carousel_section` | `wix-one-app-achievements.MemberChallengesCarousel` | [Programs data/detail](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/tier5-bundles-src/himi-branded-lite-programs/index.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") + [Core Carousel](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/builder.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Existing base; adaptation needed | Partial | Reuse the Programs feature and compose a carousel; preserve source extraProps.limit=5 and selected programs. No ready-made legacy Challenges carousel adapter is claimed. |
|
|
84
84
|
| `achievements_participant_carousel_section` | `wix-one-app-achievements.ParticipantChallengesCarousel` | | | Empty | The public Programs catalog is not a member-participating-programs carousel. No verified consumer participant/progress list implementation was found. |
|
|
85
85
|
|
|
@@ -322,12 +322,26 @@ Three optional parts of a site shell's `site` block add or trim native chrome wi
|
|
|
322
322
|
|
|
323
323
|
- **`topBar.actions`**: up to three trailing icons, served app-wide as `navigation.topBarDefault` (`siteTopBarDefault(site)`), so every screen without a top bar of its own shows them. `label` is the icon's accessible name. A `target` is exactly one of:
|
|
324
324
|
- `page`: a site page id of any placement. An `overflow` page has no row but can still be a target, for example the site's cart page.
|
|
325
|
-
- `screen`: a native page's `screenId`, or a native screen the shell serves itself (`himi_notification_settings`, and the Account screen when a member binding is set).
|
|
325
|
+
- `screen`: a native page's `screenId`, or a native screen the shell serves itself (`himi_notification_settings`, and the Account screen and the member screens below when a member binding is set).
|
|
326
326
|
- `url`: an https page off the site. The icon opens the same "Open in browser?" prompt an off-site link in a site page shows. A URL on the site is refused: declare it as a page instead.
|
|
327
327
|
|
|
328
328
|
A target that is a tab switches to that tab (`himi.tab`). Any other target opens its screen (`himi.open`), and so does every target under the `drawer` and `single` layouts, which have no tab bar. Under `menuSource: "runtime"`, a site page target is always opened rather than switched to, because the site's own menu may move that page out of the tab bar on a later launch. On the page or native screen an icon opens, the bar leaves that icon out, so tapping it cannot push a second copy of it. A native screen that draws a top bar of its own keeps it as the author wrote it. A `url` with a `.` or `..` path segment is refused.
|
|
329
329
|
- **`nativePages`**: the author's own Tier-5 screens as rows. Each one is a `tab`, `drawer` or `overflow` entry (an `overflow` entry is linkable only). They join the tab bar, drawer and rail with the site's pages, after the page named by `after` (default: after all of them, and never before `home`). Tabs count toward the four-tab limit together with the site's tabs. The WebView keep-alive cap only concerns site tabs, because a native tab keeps no WebView. Every native page is in `linkableScreens`. It is private by default: a link from outside the app (a website link, another app) to `<scheme>://screen/<screenId>` opens it only when the page sets `"public": true`. `"requiresAuth": true` implies public and signs the user in first. It needs a sign-in that gates deep links, which today means a Wix member binding. Any other app refuses it, a Base44 site included, rather than open the screen signed out. A native page that places the built-in Notifications or Account screen stays public unless it sets `"public": false`, which turns off outside links to that screen. A public native page opens on its tab when it has one. Under the `drawer`, `single` and one-tab `auto` layouts, where there is no tab to select, the link pushes it instead. Account deletion (`himi_delete_account`) cannot be placed. An id must differ from every site page's id and must not start with `drawer_`. A `screenId` must not start with `site_`.
|
|
330
330
|
|
|
331
|
+
**Member screens (Brandy, `wix` binding).** A Brandy app whose contract binds a Wix member client (`wix`) also serves Branded Lite's own member screens, with Branded Lite's builders and workers: the activity feed `himi_notifications`, the inbox `himi_inbox`, My Orders `himi_orders` and My Subscriptions `himi_my_subscriptions`. A native page may place any of them, and a `{ screen }` icon may open one that a native page places (an `overflow` page adds no row). The Account screen links to all of them. The screens they open (an order, a thread, a subscription, the sign-in form) are served too but cannot be placed. A visitor-only contract refuses a native page or icon that names a member screen, saying a `wix` binding is missing. Cart and checkout are not served yet: they need a visitor session shared with the website. The wishlist (`himi_saved_products`) is not served: it lists products saved on native product screens, which a site shell does not have. Inside these screens, a link to a screen a site shell does not serve goes to the website instead: Chat with us opens the site's contact page, Browse the shop and Browse plans open the site's shop and plans pages (a tab is switched to), and each is removed when the site has no such page. Reorder, which fills the native cart, is removed. A sensible default for a member app is Account and Notifications as drawer rows and a bell that opens Notifications:
|
|
332
|
+
|
|
333
|
+
```json
|
|
334
|
+
"nativePages": [
|
|
335
|
+
{ "id": "my_account", "screenId": "himi_account", "title": "Account", "icon": "person", "placement": "drawer" },
|
|
336
|
+
{ "id": "activity", "screenId": "himi_notifications", "title": "Notifications", "icon": "bell", "placement": "drawer", "public": true }
|
|
337
|
+
],
|
|
338
|
+
"topBar": { "actions": [
|
|
339
|
+
{ "id": "notifications", "icon": "bell", "label": "Notifications", "target": { "screen": "himi_notifications" } }
|
|
340
|
+
] }
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
With `himi_notifications` placed, the built-in Notifications row is labelled Notification settings. The page ids avoid `account` and `notifications`, which the built-in rows reserve.
|
|
344
|
+
|
|
331
345
|
The contract only places a native page. Its descriptor and worker come from the content package's own `dev/index.ts`, which checks that every placed screen is one it builds (`assertSiteNativePagesBuilt`), so `himi build`, `validate`, `render` and `push` refuse a native page whose screen is missing. The shared contract parser and the dist projection cannot see the content, so they check only the shape, the ids and the targets. Both fields survive `himi push` → `himi dist --shell brandy`: the projection keeps them with the rest of the site block, and a top-bar URL must also pass the bake-safe URL rule (https, with no query string).
|
|
332
346
|
|
|
333
347
|
- **`pageTitle`** decides where a site page's screen draws its title in the top bar. `"auto"` (the default) draws none on a page that a tab, rail or drawer row opens, because the row's label already names it. It still draws one on an `overflow` page and on the page a link opens (`site_page`, which shows the page's own document title). `"always"` draws every title, which was the only behaviour before this setting, and `"never"` draws none. Under `menuSource: "runtime"`, `"auto"` keeps every title: the live menu can drop a page's row, so the build cannot know which titles a row repeats. A page's own `showTitle: true | false` wins over the rule. A hidden title is `topBar.titleDisplay: "hidden"` on that screen: nothing is drawn and the space is collapsed, but screen readers still announce the title as the screen's name. Because a screen's own `topBar` replaces `navigation.topBarDefault`, such a screen also carries the `topBar.actions` icons, so they stay on it. Website pages in a native app (`--site-pages`) keep their titles unless the block sets `pageTitle`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1753.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": [
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"artifactId": "himalaya-cli"
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
"falconPackageHash": "
|
|
85
|
+
"falconPackageHash": "19108f681f74deefec76fc586114d4510c9443b2d300fe3ccdd257ba"
|
|
86
86
|
}
|
|
@@ -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.
|
|
@@ -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."),
|