@wix/himalaya-cli 0.1650.0 → 0.1651.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +263 -41
- package/guides/one-app-to-himi-app.md +13 -4
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -15901,6 +15901,7 @@ function webViewOriginAllowed(url, origins) {
|
|
|
15901
15901
|
}
|
|
15902
15902
|
var init_webview_origin = __esm({
|
|
15903
15903
|
"../../core/ts/src/webview-origin.ts"() {
|
|
15904
|
+
"use strict";
|
|
15904
15905
|
init_define_HHP_CATALOG();
|
|
15905
15906
|
}
|
|
15906
15907
|
});
|
|
@@ -30002,6 +30003,7 @@ function resolveIdiom(tokens2, ctx = {}) {
|
|
|
30002
30003
|
var IDIOM_CONTEXTS, UNSAFE_KEYS;
|
|
30003
30004
|
var init_idiom = __esm({
|
|
30004
30005
|
"../../core/ts/src/idiom.ts"() {
|
|
30006
|
+
"use strict";
|
|
30005
30007
|
init_define_HHP_CATALOG();
|
|
30006
30008
|
IDIOM_CONTEXTS = {
|
|
30007
30009
|
ios: { native: ["ios"] },
|
|
@@ -179690,12 +179692,12 @@ __export(input_evidence_isolation_exports, {
|
|
|
179690
179692
|
runInputEvidenceChild: () => runInputEvidenceChild
|
|
179691
179693
|
});
|
|
179692
179694
|
async function installInputEvidenceIsolation(dir) {
|
|
179693
|
-
const { lstatSync: lstatSync30, readdirSync:
|
|
179695
|
+
const { lstatSync: lstatSync30, readdirSync: readdirSync49 } = await import("node:fs");
|
|
179694
179696
|
const { join: join145 } = await import("node:path");
|
|
179695
179697
|
const check = (path2) => {
|
|
179696
179698
|
const stat2 = lstatSync30(path2);
|
|
179697
179699
|
if (stat2.isSymbolicLink()) throw new Error("input evidence requires a content tree without symlinks");
|
|
179698
|
-
if (stat2.isDirectory()) for (const name of
|
|
179700
|
+
if (stat2.isDirectory()) for (const name of readdirSync49(path2)) check(join145(path2, name));
|
|
179699
179701
|
};
|
|
179700
179702
|
check(dir);
|
|
179701
179703
|
const { requireBuildConfinement: requireBuildConfinement2 } = await Promise.resolve().then(() => (init_build_lib(), build_lib_exports));
|
|
@@ -205596,7 +205598,29 @@ var init_recipes = __esm({
|
|
|
205596
205598
|
}
|
|
205597
205599
|
});
|
|
205598
205600
|
|
|
205601
|
+
// src/one-app/tab-ids.ts
|
|
205602
|
+
function tabIdFor(tab, taken) {
|
|
205603
|
+
const base = (tab.screenId.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "") || "tab").slice(0, 32);
|
|
205604
|
+
let id = base, n2 = 2;
|
|
205605
|
+
while (taken.has(id)) id = `${base}_${n2++}`;
|
|
205606
|
+
taken.add(id);
|
|
205607
|
+
return id;
|
|
205608
|
+
}
|
|
205609
|
+
var init_tab_ids = __esm({
|
|
205610
|
+
"src/one-app/tab-ids.ts"() {
|
|
205611
|
+
init_define_HHP_CATALOG();
|
|
205612
|
+
}
|
|
205613
|
+
});
|
|
205614
|
+
|
|
205599
205615
|
// src/one-app/generate.ts
|
|
205616
|
+
function webUrl(value2) {
|
|
205617
|
+
try {
|
|
205618
|
+
const url = new URL(value2.trim());
|
|
205619
|
+
return url.protocol === "https:" || url.protocol === "http:" ? url.href : "";
|
|
205620
|
+
} catch {
|
|
205621
|
+
return "";
|
|
205622
|
+
}
|
|
205623
|
+
}
|
|
205600
205624
|
function withoutNode(node3, id) {
|
|
205601
205625
|
const walk2 = (value2) => {
|
|
205602
205626
|
if (Array.isArray(value2)) return value2.filter((v2) => !(v2 && typeof v2 === "object" && v2.id === id)).map(walk2);
|
|
@@ -205614,14 +205638,14 @@ function composed2(id, s2, svc, nodes2) {
|
|
|
205614
205638
|
if (s2.showTitle === true && title) out2.push(vstack(`${id}.heading`, [text13(`${id}.title`, title, "title3")], 0, inset(8, 4)));
|
|
205615
205639
|
out2.push(...nodes2);
|
|
205616
205640
|
const at2 = out2.length - nodes2.length;
|
|
205617
|
-
if (nodes2.length) out2[at2] = { ...out2[at2], modifiers: { ...obj6(out2[at2].modifiers), onAppear: { actionId: `tier5.${svc}.load`, params: {
|
|
205641
|
+
if (nodes2.length) out2[at2] = { ...out2[at2], modifiers: { ...obj6(out2[at2].modifiers), onAppear: { actionId: `tier5.${svc}.load`, params: {} } } };
|
|
205618
205642
|
return out2;
|
|
205619
205643
|
}
|
|
205620
205644
|
function blogSection(id, s2, st2, index, ctx, sectionId, type2) {
|
|
205621
205645
|
const content = obj6(st2.contentSettings);
|
|
205622
205646
|
const display = obj6(st2.displayOptions);
|
|
205623
205647
|
if (content.featuredOnly === true) return ctx.unsupported(sectionId, type2, "a featured-posts-only list is not supported by the shared blog list");
|
|
205624
|
-
if (st2.postsLayout !== void 0 && st2.postsLayout !== "list")
|
|
205648
|
+
if (st2.postsLayout !== void 0 && st2.postsLayout !== "list") ctx.gap(sectionId, type2, `post layout "${String(st2.postsLayout)}" is shown as the shared blog list`);
|
|
205625
205649
|
const raw = content.postsPerCategory;
|
|
205626
205650
|
const limit = typeof raw === "string" ? /^\d+$/.test(raw) ? Number(raw) : void 0 : Number.isSafeInteger(raw) ? raw : void 0;
|
|
205627
205651
|
const base = {
|
|
@@ -205640,16 +205664,21 @@ function blogSection(id, s2, st2, index, ctx, sectionId, type2) {
|
|
|
205640
205664
|
};
|
|
205641
205665
|
const svc = ctx.uses("blog", `blog${index}`, { ...base, ...limit !== void 0 ? { limit } : {} });
|
|
205642
205666
|
const nodes2 = ctx.recipeNodes("blog-list", { svc, id, detailScreen: "himi_blog_post" });
|
|
205643
|
-
if (nodes2.length) nodes2[0] = { ...nodes2[0], modifiers: { ...obj6(nodes2[0].modifiers), onAppear: { actionId: `tier5.${svc}.load`, params: {
|
|
205667
|
+
if (nodes2.length) nodes2[0] = { ...nodes2[0], modifiers: { ...obj6(nodes2[0].modifiers), onAppear: { actionId: `tier5.${svc}.load`, params: {} } } };
|
|
205644
205668
|
const out2 = [];
|
|
205645
205669
|
const title = str11(s2.title).trim();
|
|
205646
205670
|
if (s2.showTitle === true && title) out2.push(vstack(`${id}.heading`, [text13(`${id}.title`, title, "title3")], 0, inset(8, 4)));
|
|
205671
|
+
if (obj6(st2.contributorSettings).showCreateNewPostBtn === true && !ctx.hasScreen("himi_create_post")) {
|
|
205672
|
+
ctx.gap(sectionId, type2, "the source offers a Create post button; this scaffold has no himi_create_post screen, so the button is left out");
|
|
205673
|
+
} else if (obj6(st2.contributorSettings).showCreateNewPostBtn === true) {
|
|
205674
|
+
out2.push(vstack(`${id}.create`, [node(`${id}.create.btn`, "Button", { title: "Create Post", style: "secondary", size: "md", leadingIcon: "plus", action: { actionId: "himi.open", params: { screenId: "himi_create_post" } } })], 0, inset(4, 4)));
|
|
205675
|
+
}
|
|
205647
205676
|
out2.push(...nodes2);
|
|
205648
205677
|
if (limit !== void 0) {
|
|
205649
205678
|
const allId = screenIdFor(`${ctx.page.label} all posts`, ctx.taken);
|
|
205650
205679
|
const allSvc = `himiPage_${allId}_blog0`;
|
|
205651
205680
|
const allNodes = ctx.recipeNodes("blog-list", { svc: allSvc, id: allId, detailScreen: "himi_blog_post" });
|
|
205652
|
-
if (allNodes.length) allNodes[0] = { ...allNodes[0], modifiers: { ...obj6(allNodes[0].modifiers), onAppear: { actionId: `tier5.${allSvc}.load`, params: {
|
|
205681
|
+
if (allNodes.length) allNodes[0] = { ...allNodes[0], modifiers: { ...obj6(allNodes[0].modifiers), onAppear: { actionId: `tier5.${allSvc}.load`, params: {} } } };
|
|
205653
205682
|
ctx.extraScreen(allId, ctx.page.label, allNodes, [{ module: "blog", svc: allSvc, opts: base }]);
|
|
205654
205683
|
out2.push(ctx.recipe("blog-see-all", { svc, id, detailScreen: "himi_blog_post", seeAllScreen: allId }));
|
|
205655
205684
|
}
|
|
@@ -205674,6 +205703,26 @@ function workerFor(screenId, uses) {
|
|
|
205674
205703
|
source: [`// Generated by \`himi one-app generate\`: the services the "${screenId}" page's sections bind.`, ...imports, "", ...calls, ""].join("\n")
|
|
205675
205704
|
};
|
|
205676
205705
|
}
|
|
205706
|
+
function mergePageWorkers(out2) {
|
|
205707
|
+
const owners = Object.keys(out2.workers);
|
|
205708
|
+
if (owners.length < 2) return;
|
|
205709
|
+
const sources = owners.map((owner) => out2.workers[owner].source.split("\n"));
|
|
205710
|
+
const imports = [...new Set(sources.flatMap((lines) => lines.filter((line) => line.startsWith("import "))))];
|
|
205711
|
+
const calls = sources.flatMap((lines) => lines.filter((line) => line.trim() && !line.startsWith("import ") && !line.startsWith("//")));
|
|
205712
|
+
const capabilities = [...new Set(owners.flatMap((owner) => out2.workers[owner].capabilities))];
|
|
205713
|
+
for (const owner of owners) {
|
|
205714
|
+
const screen = obj6(out2.screens[owner]);
|
|
205715
|
+
const bundle = obj6(screen.logicBundle);
|
|
205716
|
+
out2.screens[owner] = { ...screen, logicBundle: { ...bundle, url: `http://localhost:8190/v1/bundles/${MERGED_PAGES_BUNDLE}?integrity=`, declaredCapabilities: capabilities } };
|
|
205717
|
+
}
|
|
205718
|
+
out2.workers = {
|
|
205719
|
+
[MERGED_PAGES_BUNDLE]: {
|
|
205720
|
+
bundle: MERGED_PAGES_BUNDLE,
|
|
205721
|
+
capabilities,
|
|
205722
|
+
source: [`// Generated by \`himi one-app generate\`: the services every generated page's sections bind, one per section, named after the page.`, ...imports, "", ...calls, ""].join("\n")
|
|
205723
|
+
}
|
|
205724
|
+
};
|
|
205725
|
+
}
|
|
205677
205726
|
function generateScreens(input) {
|
|
205678
205727
|
const raw = input.raw;
|
|
205679
205728
|
const sections = obj6(raw.sections);
|
|
@@ -205766,7 +205815,9 @@ function generateScreens(input) {
|
|
|
205766
205815
|
placements,
|
|
205767
205816
|
page: { label: label3, screenId, layoutItemId },
|
|
205768
205817
|
taken,
|
|
205818
|
+
hasScreen: (id) => !input.takenScreenIds || input.takenScreenIds.has(id),
|
|
205769
205819
|
uses: (module, key3, opts) => {
|
|
205820
|
+
if (input.hasModule && !input.hasModule(MODULES[module].file)) throw new RecipeError(`tier5-src/_shared/${MODULES[module].file}.ts is missing: this scaffold does not ship that module, so the section keeps its title and a See All link.`);
|
|
205770
205821
|
const svc = `himiPage_${screenId}_${key3}`;
|
|
205771
205822
|
uses.push({ module, svc, opts });
|
|
205772
205823
|
return svc;
|
|
@@ -205800,7 +205851,7 @@ function generateScreens(input) {
|
|
|
205800
205851
|
unmapped.push({ page: label3, sectionId, sectionDefinitionId: type2 || "unknown", reason: "no generator mapping for this section type" });
|
|
205801
205852
|
return;
|
|
205802
205853
|
}
|
|
205803
|
-
const registered = uses.length, extra = extras.length, reported = unmapped.length;
|
|
205854
|
+
const registered = uses.length, extra = extras.length, reported = unmapped.length, gapped = out2.gaps.length;
|
|
205804
205855
|
const sectionNodeId = `${screenId}.s${sectionId.slice(0, 8)}${index}`;
|
|
205805
205856
|
let built = null;
|
|
205806
205857
|
try {
|
|
@@ -205817,6 +205868,7 @@ function generateScreens(input) {
|
|
|
205817
205868
|
const reasons = unmapped.splice(reported).map((u2) => u2.reason);
|
|
205818
205869
|
uses.length = registered;
|
|
205819
205870
|
extras.length = extra;
|
|
205871
|
+
out2.gaps.length = gapped;
|
|
205820
205872
|
const sibling = fallback.sibling ? items.find((other) => other !== layoutItemId && arr(obj6(layoutItems[other]).elements).some((e2) => str11(obj6(sections[str11(obj6(e2).elementId)]).sectionDefinitionId) === fallback.sibling)) : void 0;
|
|
205821
205873
|
fellBack.add(`${layoutItemId}|${type2}`);
|
|
205822
205874
|
const target = `${ROUTE_PLACEHOLDER}${sibling ?? ""}|${fallback.screen}|${fallback.sibling ?? ""}`;
|
|
@@ -205844,25 +205896,57 @@ function generateScreens(input) {
|
|
|
205844
205896
|
for (const extra of extras) assemble(extra.screenId, extra.title, extra.children, extra.uses);
|
|
205845
205897
|
out2.routes.push({ layoutItemId, label: label3, screenId, kind: "generated" });
|
|
205846
205898
|
}
|
|
205899
|
+
mergePageWorkers(out2);
|
|
205847
205900
|
const planned2 = obj6(input.navigation);
|
|
205848
205901
|
const ownTabs = sourceTabs.length > 1 && !arr(obj6(planned2.target).tabs).length ? sourceTabs.flatMap((tab) => {
|
|
205849
205902
|
const layoutItemId = pageItems(str11(tab.screenId))[0];
|
|
205850
|
-
|
|
205903
|
+
if (!layoutItemId) {
|
|
205904
|
+
out2.gaps.push({ page: str11(tab.title).trim() || str11(tab.screenId), sectionId: "", sectionDefinitionId: "(navigation)", reason: "this bottom tab's screen has no page, so the app has no tab for it" });
|
|
205905
|
+
return [];
|
|
205906
|
+
}
|
|
205907
|
+
const hidden = obj6(obj6(layoutItems[layoutItemId ?? ""]).settings).hideFromNavigation === true;
|
|
205908
|
+
return layoutItemId && !hidden ? [{ layoutItemId, label: str11(tab.title).trim(), icon: str11(tab.icon) }] : [];
|
|
205851
205909
|
}) : [];
|
|
205852
205910
|
addNavigation(out2, ownTabs.length ? { target: { tabs: ownTabs, overflow: ownTabs.length > BOTTOM_TABS_BEFORE_MORE + 1 } } : planned2, taken);
|
|
205853
|
-
resolveRoutePlaceholders(out2, fellBack)
|
|
205911
|
+
resolveRoutePlaceholders(out2, fellBack, layoutSlugs(layoutItems), (str11(obj6(obj6(input.navigation).target).navKind) || "bottomTabs") === "bottomTabs", new Map(sourceTabs.flatMap((tab) => {
|
|
205912
|
+
const first = pageItems(str11(tab.screenId))[0];
|
|
205913
|
+
return first ? [[str11(tab.screenId), first]] : [];
|
|
205914
|
+
})));
|
|
205854
205915
|
return out2;
|
|
205855
205916
|
}
|
|
205856
|
-
function
|
|
205917
|
+
function layoutSlugs(layoutItems) {
|
|
205918
|
+
const found = /* @__PURE__ */ new Map(), repeated = /* @__PURE__ */ new Set();
|
|
205919
|
+
for (const [id, item] of Object.entries(layoutItems)) {
|
|
205920
|
+
const slug = str11(obj6(item).slug);
|
|
205921
|
+
if (!slug) continue;
|
|
205922
|
+
if (found.has(slug)) repeated.add(slug);
|
|
205923
|
+
else found.set(slug, id);
|
|
205924
|
+
}
|
|
205925
|
+
for (const slug of repeated) found.delete(slug);
|
|
205926
|
+
return found;
|
|
205927
|
+
}
|
|
205928
|
+
function resolveRoutePlaceholders(out2, fellBack, slugs, hasTabBar, pageOfScreen) {
|
|
205857
205929
|
const screenOf = new Map(out2.routes.filter((r3) => r3.screenId).map((r3) => [r3.layoutItemId, r3.screenId]));
|
|
205930
|
+
const taken = /* @__PURE__ */ new Set();
|
|
205931
|
+
const tabOfScreen = new Map((hasTabBar ? out2.tabs : []).map((tab) => [tab.screenId, tabIdFor(tab, taken)]));
|
|
205932
|
+
const resolve99 = (value2) => {
|
|
205933
|
+
const [named, fallback, siblingType] = value2.slice(ROUTE_PLACEHOLDER.length).split("|");
|
|
205934
|
+
const source = named && !screenOf.has(named) && !pageOfScreen.has(named) ? slugs.get(named) ?? named : named;
|
|
205935
|
+
const page = source && !fellBack.has(`${source}|${siblingType}`) ? screenOf.get(source) ?? screenOf.get(pageOfScreen.get(source) ?? "") : void 0;
|
|
205936
|
+
return page || fallback || "";
|
|
205937
|
+
};
|
|
205938
|
+
const retarget = (tap) => {
|
|
205939
|
+
const target = resolve99(str11(obj6(tap.params).screenId));
|
|
205940
|
+
const tab = tabOfScreen.get(target);
|
|
205941
|
+
return tab ? { actionId: "himi.tab", params: { tab } } : { ...tap, params: { ...obj6(tap.params), screenId: target } };
|
|
205942
|
+
};
|
|
205943
|
+
const isPlaceholderTap = (v2) => !!v2 && typeof v2 === "object" && str11(obj6(obj6(v2).params).screenId).startsWith(ROUTE_PLACEHOLDER);
|
|
205858
205944
|
const walk2 = (value2) => {
|
|
205859
|
-
if (typeof value2 === "string" && value2.startsWith(ROUTE_PLACEHOLDER))
|
|
205860
|
-
const [layoutItemId, fallback, siblingType] = value2.slice(ROUTE_PLACEHOLDER.length).split("|");
|
|
205861
|
-
const sibling = layoutItemId && !fellBack.has(`${layoutItemId}|${siblingType}`) ? screenOf.get(layoutItemId) : void 0;
|
|
205862
|
-
return sibling || fallback;
|
|
205863
|
-
}
|
|
205945
|
+
if (typeof value2 === "string" && value2.startsWith(ROUTE_PLACEHOLDER)) return resolve99(value2);
|
|
205864
205946
|
if (Array.isArray(value2)) return value2.map(walk2);
|
|
205865
|
-
if (value2 && typeof value2 === "object")
|
|
205947
|
+
if (value2 && typeof value2 === "object") {
|
|
205948
|
+
return Object.fromEntries(Object.entries(value2).filter(([, v2]) => !(isPlaceholderTap(v2) && !resolve99(str11(obj6(obj6(v2).params).screenId)))).map(([k2, v2]) => [k2, isPlaceholderTap(v2) ? retarget(v2) : walk2(v2)]));
|
|
205949
|
+
}
|
|
205866
205950
|
return value2;
|
|
205867
205951
|
};
|
|
205868
205952
|
for (const [id, screen] of Object.entries(out2.screens)) out2.screens[id] = walk2(screen);
|
|
@@ -205930,12 +206014,13 @@ function addNavigation(out2, plan, taken) {
|
|
|
205930
206014
|
out2.routes.push({ layoutItemId: "(more)", label: "More", screenId, kind: "generated" });
|
|
205931
206015
|
out2.tabs.push({ layoutItemId: "(more)", label: "More", screenId });
|
|
205932
206016
|
}
|
|
205933
|
-
var TEMPLATE_PARAMS, FALLBACK_TARGETS, ROUTE_PLACEHOLDER, BOTTOM_TABS_BEFORE_MORE, TEMPLATE_VERTICALS, TEMPLATE_FALLBACKS, MODULES, obj6, arr, str11, node, text13, vstack, hstack, inset, openUrl2, youtubeIdOf, DIRECT_VIDEO_FILE, dialUrl, sourceTap, HANDLERS, chevron;
|
|
206017
|
+
var TEMPLATE_PARAMS, FALLBACK_TARGETS, NO_INLINE_SECTION, ROUTE_PLACEHOLDER, BOTTOM_TABS_BEFORE_MORE, TEMPLATE_VERTICALS, TEMPLATE_FALLBACKS, MODULES, obj6, arr, str11, node, text13, vstack, hstack, inset, openUrl2, youtubeIdOf, DIRECT_VIDEO_FILE, dialUrl, sourceTap, HANDLERS, MERGED_PAGES_BUNDLE, chevron;
|
|
205934
206018
|
var init_generate2 = __esm({
|
|
205935
206019
|
"src/one-app/generate.ts"() {
|
|
205936
206020
|
init_define_HHP_CATALOG();
|
|
205937
206021
|
init_recipes();
|
|
205938
206022
|
init_recipes();
|
|
206023
|
+
init_tab_ids();
|
|
205939
206024
|
TEMPLATE_PARAMS = {
|
|
205940
206025
|
groups_feed_section: (_section, st2) => ({
|
|
205941
206026
|
...str11(st2.sectionTitle).trim() ? { title: str11(st2.sectionTitle).trim() } : {},
|
|
@@ -205950,8 +206035,16 @@ var init_generate2 = __esm({
|
|
|
205950
206035
|
newBlog_postlist_vertical_section: { screen: "himi_blog" },
|
|
205951
206036
|
newBlog_compact_post_list_vertical_section: { screen: "himi_blog" },
|
|
205952
206037
|
member_list_section: { sibling: "member_list_section", screen: "himi_members" },
|
|
205953
|
-
bookings_services_list_section: { screen: "himi_services", needsScreen: true }
|
|
205954
|
-
|
|
206038
|
+
bookings_services_list_section: { screen: "himi_services", needsScreen: true },
|
|
206039
|
+
// Sections whose data the template already shows on a screen of its own: the page keeps the source's title and a link to it.
|
|
206040
|
+
vod_carousel_section: { screen: "himi_videos", needsScreen: true },
|
|
206041
|
+
memberships_plan_cards_carousel: { screen: "himi_plans", needsScreen: true },
|
|
206042
|
+
progallery_carousel_section: { screen: "himi_galleries", needsScreen: true },
|
|
206043
|
+
achievements_participant_carousel_section: { screen: "himi_member_programs", needsScreen: true },
|
|
206044
|
+
groups_cards_section: { screen: "himi_groups", needsScreen: true },
|
|
206045
|
+
newBlog_search_section: { screen: "himi_blog", needsScreen: true }
|
|
206046
|
+
};
|
|
206047
|
+
NO_INLINE_SECTION = "its data has no inline section yet";
|
|
205955
206048
|
ROUTE_PLACEHOLDER = "@route:";
|
|
205956
206049
|
BOTTOM_TABS_BEFORE_MORE = 4;
|
|
205957
206050
|
TEMPLATE_VERTICALS = {
|
|
@@ -205967,6 +206060,7 @@ var init_generate2 = __esm({
|
|
|
205967
206060
|
programs: { file: "programs-section", register: "registerProgramsSection", capabilities: ["wix_api", "iap", "app_info"] },
|
|
205968
206061
|
members: { file: "members-directory", register: "registerMembersDirectory", capabilities: ["wix_api"] },
|
|
205969
206062
|
blog: { file: "blog-list", register: "registerBlogList", capabilities: ["wix_api"] },
|
|
206063
|
+
plans: { file: "plans-section", register: "registerPlansSection", capabilities: ["wix_api"] },
|
|
205970
206064
|
// The module shares an event through the OS share sheet, so a page that uses it declares `share` (as the groups feed bundle does).
|
|
205971
206065
|
events: { file: "events-inline", register: "registerEventsInline", capabilities: ["wix_api", "share"] }
|
|
205972
206066
|
};
|
|
@@ -205989,7 +206083,8 @@ var init_generate2 = __esm({
|
|
|
205989
206083
|
return /^\+?\d{2,}$/.test(compact) ? `tel:${compact}` : "";
|
|
205990
206084
|
};
|
|
205991
206085
|
sourceTap = (action) => {
|
|
205992
|
-
if (action.type === "url" && str11(action.url)) return openUrl2(str11(action.url));
|
|
206086
|
+
if (action.type === "url" && webUrl(str11(action.url))) return openUrl2(webUrl(str11(action.url)));
|
|
206087
|
+
if (action.type === "goToScreen" && str11(action.screenId)) return { actionId: "himi.open", params: { screenId: `${ROUTE_PLACEHOLDER}${str11(action.screenId)}|` } };
|
|
205993
206088
|
const dial = action.type === "tel" ? dialUrl(str11(action.phoneNumber)) : "";
|
|
205994
206089
|
return dial ? openUrl2(dial) : void 0;
|
|
205995
206090
|
};
|
|
@@ -206049,7 +206144,9 @@ var init_generate2 = __esm({
|
|
|
206049
206144
|
}, { cornerRadius: 8, fillMaxWidth: true })], 0, inset(8, 8));
|
|
206050
206145
|
}
|
|
206051
206146
|
if (str11(st2.sourceType) !== "wixMedia" && !DIRECT_VIDEO_FILE.test(url)) {
|
|
206052
|
-
|
|
206147
|
+
const link = webUrl(url);
|
|
206148
|
+
if (!link) return ctx.unsupported(elementId, "media_elements_video_section", `its video link "${url}" is not an http(s) URL`);
|
|
206149
|
+
return vstack(`${id}.box`, [node(`${id}.open`, "Button", { title: "Open video", style: "primary", size: "md", action: openUrl2(link) })], 0, inset(8, 8));
|
|
206053
206150
|
}
|
|
206054
206151
|
if (!/^https?:\/\//i.test(url)) {
|
|
206055
206152
|
const ref = url.trim().replace(/^\/+/, "").replace(/^video\//, "");
|
|
@@ -206058,6 +206155,98 @@ var init_generate2 = __esm({
|
|
|
206058
206155
|
}
|
|
206059
206156
|
return vstack(`${id}.box`, [node(id, "Video", { url, controls: true, ...aspect, loop: !!st2.loop, autoplay: !!st2.autoplay }, { cornerRadius: 8, fillMaxWidth: true, accessibilityLabel: ctx.page.label })], 0, inset(8, 8));
|
|
206060
206157
|
},
|
|
206158
|
+
// A list of image cards, each with a title and the tap the source gave it. The source may lay the title over the image
|
|
206159
|
+
// (`imageOverlay`); here it sits under the image, so the image stays clear and the title stays readable.
|
|
206160
|
+
platform_elements_repeater_section: (id, _s2, st2, _i2, ctx, elementId) => {
|
|
206161
|
+
const options = obj6(st2.imageOptions);
|
|
206162
|
+
const gap = Math.min(24, Math.max(4, Number(st2.spaceBetweenItems) || 12));
|
|
206163
|
+
const cards = arr(st2.items).map(obj6).flatMap((item, i2) => {
|
|
206164
|
+
if (item.isHidden === true) return [];
|
|
206165
|
+
const title = str11(item.title).trim();
|
|
206166
|
+
const url = str11(item.imageUrl);
|
|
206167
|
+
const tap = sourceTap(obj6(item.actionData));
|
|
206168
|
+
if (!title && !url) return [];
|
|
206169
|
+
const parts = [];
|
|
206170
|
+
if (url) parts.push(node(`${id}.i${i2}.img`, "Image", {
|
|
206171
|
+
url,
|
|
206172
|
+
fillWidth: true,
|
|
206173
|
+
...typeof options.aspectRatio === "number" ? { aspectRatio: options.aspectRatio } : {},
|
|
206174
|
+
contentMode: options.imageScale === "fit" ? "fit" : "fill",
|
|
206175
|
+
contentDescription: title || ctx.page.label
|
|
206176
|
+
}, typeof options.cornerRadius === "number" ? { cornerRadius: options.cornerRadius } : void 0));
|
|
206177
|
+
if (title) parts.push(text13(`${id}.i${i2}.title`, title, "bodyEmphasis", { textAlign: "leading" }, { fillMaxWidth: true }));
|
|
206178
|
+
return [vstack(`${id}.i${i2}`, parts, 8, tap ? { onTap: tap, fillMaxWidth: true } : { fillMaxWidth: true })];
|
|
206179
|
+
});
|
|
206180
|
+
if (!cards.length) return ctx.unsupported(elementId, "platform_elements_repeater_section", "the repeater has no item with a title or an image");
|
|
206181
|
+
return vstack(`${id}.box`, cards, gap, inset(8, 8));
|
|
206182
|
+
},
|
|
206183
|
+
// The source lays its texts over the picture. They sit on the picture here too, on a plain accent band (a translucent scrim is
|
|
206184
|
+
// not used: a web renderer paints a band with an opacity above its sibling text) so they read on any photo; the button follows
|
|
206185
|
+
// them over the picture. With no picture the texts and the button simply stack.
|
|
206186
|
+
platform_elements_interactive_banner_section: (id, _s2, st2, _i2, ctx) => {
|
|
206187
|
+
const url = str11(st2.imageUri);
|
|
206188
|
+
const tap = sourceTap(obj6(st2.action));
|
|
206189
|
+
const align = st2.horizontalAlign === "center" ? "center" : st2.horizontalAlign === "right" ? "trailing" : "leading";
|
|
206190
|
+
const picture = url ? node(`${id}.img`, "Image", {
|
|
206191
|
+
url,
|
|
206192
|
+
fillWidth: true,
|
|
206193
|
+
...typeof st2.aspectRatio === "number" ? { aspectRatio: st2.aspectRatio } : {},
|
|
206194
|
+
contentMode: "fill",
|
|
206195
|
+
contentDescription: ctx.page.label
|
|
206196
|
+
}, typeof st2.cornerRadius === "number" ? { cornerRadius: st2.cornerRadius } : void 0) : null;
|
|
206197
|
+
const texts = [];
|
|
206198
|
+
const buttons = [];
|
|
206199
|
+
arr(st2.items).map(obj6).forEach((item, i2) => {
|
|
206200
|
+
if (item.isHidden === true || !str11(item.text).trim()) return;
|
|
206201
|
+
if (item.type === "button") buttons.push(node(`${id}.b${i2}`, "Button", { title: str11(item.text).trim(), style: "primary", size: "md", fullWidth: false, ...tap ? { action: tap } : {} }));
|
|
206202
|
+
else texts.push(text13(`${id}.t${i2}`, str11(item.text).trim(), item.type === "title" ? "title3" : "body", { textAlign: align, ...picture ? { color: "textOnAccent" } : {} }, { fillMaxWidth: true }));
|
|
206203
|
+
});
|
|
206204
|
+
const tapped = tap ? { onTap: tap } : {};
|
|
206205
|
+
if (!picture) {
|
|
206206
|
+
const parts = [...texts, ...buttons];
|
|
206207
|
+
return parts.length ? vstack(`${id}.box`, parts, 8, { ...inset(8, 8), ...tapped }, align === "center" ? "center" : "leading") : null;
|
|
206208
|
+
}
|
|
206209
|
+
const band = texts.length ? vstack(`${id}.band`, texts, 4, { background: { token: "accentPrimary" }, cornerRadius: 10, padding: { leading: 12, trailing: 12, top: 8, bottom: 8 } }, align) : null;
|
|
206210
|
+
const over = vstack(`${id}.over`, [...band ? [band] : [], ...buttons], 12, { fillMaxWidth: true, padding: { leading: 16, trailing: 16, top: 16, bottom: 16 } }, align === "center" ? "center" : "leading");
|
|
206211
|
+
return vstack(`${id}.box`, [node(`${id}.stack`, "ZStack", { alignment: align, children: [picture, over] }, { fillMaxWidth: true })], 0, { ...inset(8, 8), ...tapped });
|
|
206212
|
+
},
|
|
206213
|
+
// A web page inside the screen. The source sizes it to its content; a fixed height is the nearest fixed equivalent.
|
|
206214
|
+
platform_elements_web_view_section: (id, _s2, st2, _i2, ctx, elementId) => {
|
|
206215
|
+
const url = str11(st2.url);
|
|
206216
|
+
if (!/^https:\/\//i.test(url)) return ctx.unsupported(elementId, "platform_elements_web_view_section", "the web view has no https URL");
|
|
206217
|
+
const fixed = typeof st2.fixedHeight === "number" && st2.webViewHeightInDynamicLayout !== "fit_to_content" ? st2.fixedHeight : 600;
|
|
206218
|
+
if (st2.webViewHeightInDynamicLayout === "fit_to_content") ctx.gap(elementId, "platform_elements_web_view_section", "the source sizes the page to its content; the web view has a fixed 600 height");
|
|
206219
|
+
return vstack(`${id}.box`, [node(id, "WebView", { url, height: fixed, scrollEnabled: true }, { fillMaxWidth: true, accessibilityLabel: ctx.page.label })], 0, inset(8, 8));
|
|
206220
|
+
},
|
|
206221
|
+
// The data of these sections is shown by a template screen; the page keeps the source's title and a link to it.
|
|
206222
|
+
vod_carousel_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "vod_carousel_section", NO_INLINE_SECTION),
|
|
206223
|
+
// The selected plans as cards: name, pitch, price, validity, a details button and the benefits list (unless the source hides it).
|
|
206224
|
+
// A scaffold without the plans recipe keeps the title and a link to the template's plans screen, as every data section does.
|
|
206225
|
+
memberships_plan_cards_carousel: (id, s2, st2, index, ctx) => {
|
|
206226
|
+
const planIds = arr(st2.selectedPlanIds).filter((v2) => typeof v2 === "string" && !!v2);
|
|
206227
|
+
const svc = ctx.uses("plans", `plans${index}`, { planIds, showBenefits: st2.shouldDisplayBenefitsList !== false });
|
|
206228
|
+
const children2 = [];
|
|
206229
|
+
const title = str11(s2.title).trim();
|
|
206230
|
+
if (s2.showTitle === true && title) children2.push(text13(`${id}.title`, title, "title3", {}, inset(0, 0)));
|
|
206231
|
+
children2.push(ctx.recipe("plans-card", { svc, id, detailScreen: "himi_plan", detailsLabel: "View details" }));
|
|
206232
|
+
return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
|
|
206233
|
+
},
|
|
206234
|
+
progallery_carousel_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "progallery_carousel_section", NO_INLINE_SECTION),
|
|
206235
|
+
achievements_participant_carousel_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "achievements_participant_carousel_section", NO_INLINE_SECTION),
|
|
206236
|
+
groups_cards_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "groups_cards_section", NO_INLINE_SECTION),
|
|
206237
|
+
newBlog_search_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "newBlog_search_section", NO_INLINE_SECTION),
|
|
206238
|
+
// One chosen group: the title and a button that opens that group (the template's group screen takes the id).
|
|
206239
|
+
single_group_feed_section: (id, s2, st2, _i2, ctx, elementId) => {
|
|
206240
|
+
const groupId = str11(st2.groupId);
|
|
206241
|
+
if (!groupId) return ctx.unsupported(elementId, "single_group_feed_section", "the section names no group");
|
|
206242
|
+
if (!ctx.hasScreen("himi_group")) return ctx.unsupported(elementId, "single_group_feed_section", "this scaffold has no himi_group screen to open the group in");
|
|
206243
|
+
ctx.gap(elementId, "single_group_feed_section", "the group's posts are not shown inline; the section opens the group");
|
|
206244
|
+
const title = str11(s2.title).trim();
|
|
206245
|
+
const children2 = [];
|
|
206246
|
+
if (s2.showTitle !== false && title) children2.push(text13(`${id}.title`, title, "title3"));
|
|
206247
|
+
children2.push(node(`${id}.open`, "Button", { title: str11(st2.seeAllButtonText).trim() || "Open group", style: "secondary", size: "md", fullWidth: true, action: { actionId: "himi.open", params: { screenId: "himi_group", id: groupId } } }));
|
|
206248
|
+
return vstack(`${id}.box`, children2, 12, inset(16, 16));
|
|
206249
|
+
},
|
|
206061
206250
|
pages_section: (id, _s2, _st, index, ctx, elementId) => {
|
|
206062
206251
|
const placement = ctx.placements.get(`${ctx.page.layoutItemId}:${elementId}:${index}`);
|
|
206063
206252
|
if (placement?.state === "ready" && placement.component) return vstack(`${id}.box`, [placement.component], 0, inset(8, 8));
|
|
@@ -206081,7 +206270,7 @@ var init_generate2 = __esm({
|
|
|
206081
206270
|
const title = str11(s2.title).trim();
|
|
206082
206271
|
if (s2.showTitle !== false && title) children2.push(text13(`${id}.title`, title, "title3", {}, inset(0, 0)));
|
|
206083
206272
|
children2.push(ctx.recipe("programs-carousel", { svc, id, detailScreen: "himi_program" }));
|
|
206084
|
-
return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {
|
|
206273
|
+
return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
|
|
206085
206274
|
},
|
|
206086
206275
|
// The programs list: single-column full-width cards from the shared programs module (the list layout pages itself).
|
|
206087
206276
|
achievements_list_section: (id, s2, st2, index, ctx, sectionId) => {
|
|
@@ -206118,7 +206307,7 @@ var init_generate2 = __esm({
|
|
|
206118
206307
|
const title = str11(s2.title).trim();
|
|
206119
206308
|
if (s2.showTitle === true && title) children2.push(text13(`${id}.title`, title, "title3", {}, inset(0, 0)));
|
|
206120
206309
|
children2.push(card2);
|
|
206121
|
-
return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {
|
|
206310
|
+
return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
|
|
206122
206311
|
},
|
|
206123
206312
|
// The business contact section: its own title and description, and only the rows the source switches on.
|
|
206124
206313
|
platform_general_contact_section: (id, s2, st2, _i2, ctx) => {
|
|
@@ -206129,7 +206318,7 @@ var init_generate2 = __esm({
|
|
|
206129
206318
|
if (s2.showTitle !== false && title) children2.push(text13(`${id}.title`, title, "title3"));
|
|
206130
206319
|
const description = str11(profile.description).split("\n").map((l2) => l2.trim()).filter(Boolean).join("\n");
|
|
206131
206320
|
if (st2.isDescriptionVisible === true && description) children2.push(text13(`${id}.description`, description, "body"));
|
|
206132
|
-
const website = str11(obj6(ctx.business.website).publicUrl);
|
|
206321
|
+
const website = webUrl(str11(obj6(ctx.business.website).publicUrl));
|
|
206133
206322
|
if (st2.isWebSiteLinkVisible === true && website) {
|
|
206134
206323
|
children2.push(hstack(`${id}.web`, [
|
|
206135
206324
|
node(`${id}.web.icon`, "Icon", { name: "globe" }),
|
|
@@ -206143,6 +206332,7 @@ var init_generate2 = __esm({
|
|
|
206143
206332
|
return children2.length ? vstack(`${id}.box`, children2, 12, inset(16, 16)) : null;
|
|
206144
206333
|
}
|
|
206145
206334
|
};
|
|
206335
|
+
MERGED_PAGES_BUNDLE = "one-app-pages";
|
|
206146
206336
|
chevron = (id) => node(`${id}.chevron`, "Icon", { name: "chevron_right" });
|
|
206147
206337
|
}
|
|
206148
206338
|
});
|
|
@@ -206839,13 +207029,6 @@ function tabIcon(source) {
|
|
|
206839
207029
|
const filled = `${icon}_fill`;
|
|
206840
207030
|
return { icon, ...ICON_NAMES.includes(filled) ? { selectedIcon: filled } : {}, resolved: !!found };
|
|
206841
207031
|
}
|
|
206842
|
-
function tabIdFor(tab, taken) {
|
|
206843
|
-
const base = (tab.screenId.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "") || "tab").slice(0, 32);
|
|
206844
|
-
let id = base, n2 = 2;
|
|
206845
|
-
while (taken.has(id)) id = `${base}_${n2++}`;
|
|
206846
|
-
taken.add(id);
|
|
206847
|
-
return id;
|
|
206848
|
-
}
|
|
206849
207032
|
function property2(literal2, name) {
|
|
206850
207033
|
const found = lookup3(literal2, name);
|
|
206851
207034
|
return found.kind === "written" ? found.node : void 0;
|
|
@@ -206883,19 +207066,36 @@ function applyNavigationToConfig(source, plan, fileName = "config.ts") {
|
|
|
206883
207066
|
const tabOfScreen = new Map(tabs.map(({ tab, id }) => [tab.screenId, id]));
|
|
206884
207067
|
const moreRows = new Set(plan.moreRows);
|
|
206885
207068
|
const valid = new Set(tabs.map(({ id }) => id));
|
|
207069
|
+
const newScreenOf = new Map(tabs.map(({ tab, id }) => [id, tab.screenId]));
|
|
207070
|
+
const reused = new Set(items.elements.flatMap((element) => {
|
|
207071
|
+
const entry = unwrap(element);
|
|
207072
|
+
if (!ts19.isObjectLiteralExpression(entry)) return [];
|
|
207073
|
+
const id = stringOf(property2(entry, "id")), screenId = stringOf(property2(entry, "screenId"));
|
|
207074
|
+
return id && newScreenOf.has(id) && newScreenOf.get(id) !== screenId ? [id] : [];
|
|
207075
|
+
}));
|
|
206886
207076
|
let repointed = 0;
|
|
206887
207077
|
const links = property2(navigation, "linkableScreens");
|
|
206888
207078
|
const linkItems = links && unwrap(links.initializer);
|
|
206889
207079
|
if (linkItems && ts19.isArrayLiteralExpression(linkItems)) {
|
|
207080
|
+
const parentOf = /* @__PURE__ */ new Map();
|
|
207081
|
+
for (const element of linkItems.elements) {
|
|
207082
|
+
const entry = unwrap(element);
|
|
207083
|
+
if (ts19.isObjectLiteralExpression(entry)) parentOf.set(stringOf(property2(entry, "screenId")), stringOf(property2(entry, "parentScreenId")));
|
|
207084
|
+
}
|
|
207085
|
+
const ownerOf = (screenId, seen = /* @__PURE__ */ new Set()) => {
|
|
207086
|
+
if (!screenId || seen.has(screenId)) return void 0;
|
|
207087
|
+
seen.add(screenId);
|
|
207088
|
+
return tabOfScreen.get(screenId) ?? ownerOf(parentOf.get(screenId) ?? "", seen) ?? (moreId && moreRows.has(screenId) ? moreId : void 0);
|
|
207089
|
+
};
|
|
206890
207090
|
for (const element of linkItems.elements) {
|
|
206891
207091
|
const entry = unwrap(element);
|
|
206892
207092
|
if (!ts19.isObjectLiteralExpression(entry)) continue;
|
|
206893
207093
|
const tabId = property2(entry, "tabId");
|
|
206894
207094
|
const value2 = tabId && unwrap(tabId.initializer);
|
|
206895
|
-
if (!value2 || !ts19.isStringLiteralLike(value2) || value2.text === ""
|
|
206896
|
-
|
|
206897
|
-
const
|
|
206898
|
-
|
|
207095
|
+
if (!value2 || !ts19.isStringLiteralLike(value2) || value2.text === "") continue;
|
|
207096
|
+
if (valid.has(value2.text) && !reused.has(value2.text)) continue;
|
|
207097
|
+
const owner = ownerOf(stringOf(property2(entry, "screenId"))) ?? "";
|
|
207098
|
+
if (owner === value2.text) continue;
|
|
206899
207099
|
splices.push({ at: value2.getStart(file2), end: value2.end, text: JSON.stringify(owner) });
|
|
206900
207100
|
repointed++;
|
|
206901
207101
|
}
|
|
@@ -206986,6 +207186,7 @@ var init_apply_navigation = __esm({
|
|
|
206986
207186
|
init_icon_catalog_generated();
|
|
206987
207187
|
init_config_source_edit();
|
|
206988
207188
|
init_progress();
|
|
207189
|
+
init_tab_ids();
|
|
206989
207190
|
tabsFileOf = (out2) => `${out2}.tabs.json`;
|
|
206990
207191
|
APPLY_NAVIGATION_USAGE = "himi one-app apply-navigation --evidence-dir <.himi/one-app> --content <app-dir> [--tabs <tabs.json>] [--dry-run]";
|
|
206991
207192
|
SOURCE_ICON_ALIASES = {
|
|
@@ -207022,8 +207223,17 @@ var init_apply_navigation = __esm({
|
|
|
207022
207223
|
});
|
|
207023
207224
|
|
|
207024
207225
|
// src/one-app/generate-cli.ts
|
|
207025
|
-
import { mkdirSync as mkdirSync52, readFileSync as readFileSync142, rmSync as rmSync37, writeFileSync as writeFileSync57 } from "node:fs";
|
|
207226
|
+
import { existsSync as existsSync124, mkdirSync as mkdirSync52, readdirSync as readdirSync48, readFileSync as readFileSync142, rmSync as rmSync37, writeFileSync as writeFileSync57 } from "node:fs";
|
|
207026
207227
|
import { dirname as dirname64, join as join132, resolve as resolve91 } from "node:path";
|
|
207228
|
+
function removeStaleGeneratedWorkers(contentDir2, current) {
|
|
207229
|
+
const root = join132(contentDir2, "tier5-src");
|
|
207230
|
+
if (!existsSync124(root)) return;
|
|
207231
|
+
for (const name of readdirSync48(root)) {
|
|
207232
|
+
if (current.has(name) || name === "_shared") continue;
|
|
207233
|
+
const index = join132(root, name, "index.ts");
|
|
207234
|
+
if (existsSync124(index) && readFileSync142(index, "utf8").startsWith(GENERATED_WORKER_MARKER)) rmSync37(join132(root, name), { recursive: true, force: true });
|
|
207235
|
+
}
|
|
207236
|
+
}
|
|
207027
207237
|
function parseArgs4(args) {
|
|
207028
207238
|
let evidenceDir, contentDir2, out2;
|
|
207029
207239
|
for (let i2 = 0; i2 < args.length; i2++) {
|
|
@@ -207100,7 +207310,7 @@ async function runOneAppGenerate(args, io2) {
|
|
|
207100
207310
|
}
|
|
207101
207311
|
let result;
|
|
207102
207312
|
try {
|
|
207103
|
-
result = generateScreens({ raw, pages: pages2, business, navigation, takenScreenIds: taken, recipe: (name, values) => readRecipe(options.contentDir, name, values), recipeNodes: (name, values) => readRecipeNodes(options.contentDir, name, values) });
|
|
207313
|
+
result = generateScreens({ raw, pages: pages2, business, navigation, takenScreenIds: taken, recipe: (name, values) => readRecipe(options.contentDir, name, values), recipeNodes: (name, values) => readRecipeNodes(options.contentDir, name, values), hasModule: (file2) => existsSync124(join132(options.contentDir, "tier5-src", "_shared", `${file2}.ts`)) });
|
|
207104
207314
|
} catch (error) {
|
|
207105
207315
|
if (error instanceof RecipeError) return report6(io2, false, { code: "recipe_unavailable", error: error.message });
|
|
207106
207316
|
throw error;
|
|
@@ -207118,6 +207328,7 @@ async function runOneAppGenerate(args, io2) {
|
|
|
207118
207328
|
mkdirSync52(dir, { recursive: true });
|
|
207119
207329
|
writeFileSync57(join132(dir, "index.ts"), worker.source, "utf8");
|
|
207120
207330
|
}
|
|
207331
|
+
removeStaleGeneratedWorkers(options.contentDir, new Set(Object.values(result.workers).map((w2) => w2.bundle)));
|
|
207121
207332
|
} catch (error) {
|
|
207122
207333
|
return report6(io2, false, { code: "output_unwritable", error: `Could not write ${options.out}: ${error instanceof Error ? error.message : String(error)}` });
|
|
207123
207334
|
}
|
|
@@ -207141,7 +207352,7 @@ async function runOneAppGenerate(args, io2) {
|
|
|
207141
207352
|
}
|
|
207142
207353
|
return report6(io2, true, { ...body, next: `himi template screens --upsert --from ${shellArg(options.out)}` + (result.tabs.length ? ` && himi one-app apply-navigation --evidence-dir ${shellArg(options.evidenceDir)} --content ${shellArg(options.contentDir)} --tabs ${shellArg(tabsFileOf(options.out))}` : "") });
|
|
207143
207354
|
}
|
|
207144
|
-
var GENERATE_USAGE, idsFile, shellArg;
|
|
207355
|
+
var GENERATE_USAGE, GENERATED_WORKER_MARKER, idsFile, shellArg;
|
|
207145
207356
|
var init_generate_cli = __esm({
|
|
207146
207357
|
"src/one-app/generate-cli.ts"() {
|
|
207147
207358
|
init_define_HHP_CATALOG();
|
|
@@ -207151,6 +207362,7 @@ var init_generate_cli = __esm({
|
|
|
207151
207362
|
init_provision();
|
|
207152
207363
|
init_apply_navigation();
|
|
207153
207364
|
GENERATE_USAGE = "himi one-app generate --evidence-dir <.himi/one-app> --content <app-dir> [--out <screens.json>]";
|
|
207365
|
+
GENERATED_WORKER_MARKER = "// Generated by `himi one-app generate`";
|
|
207154
207366
|
idsFile = (out2) => `${out2}.ids.json`;
|
|
207155
207367
|
shellArg = (value2) => /^[\w@%+=:,./-]+$/.test(value2) ? value2 : `'${value2.replace(/'/g, `'\\''`)}'`;
|
|
207156
207368
|
}
|
|
@@ -208073,6 +208285,14 @@ function paymentReviewIssues(value2, metaSiteId) {
|
|
|
208073
208285
|
}
|
|
208074
208286
|
return issues;
|
|
208075
208287
|
}
|
|
208288
|
+
function checkoutClientOwnerStep(metaSiteId, flowIds) {
|
|
208289
|
+
return {
|
|
208290
|
+
code: "checkout_client_headless_oauth",
|
|
208291
|
+
flowIds,
|
|
208292
|
+
consent: "site owner",
|
|
208293
|
+
instruction: `The site's owner creates a Headless OAuth client for the app, in the dashboard (https://manage.wix.com/dashboard/${metaSiteId}/oauth-apps-settings) or by running \`himi site client ensure --site ${metaSiteId} --yes --write-provisioning\` with the owner's own account. Do not create it without the owner's consent. Until then, paid flows show that paying in the app is not available yet.`
|
|
208294
|
+
};
|
|
208295
|
+
}
|
|
208076
208296
|
function runPaymentReview(args, io2) {
|
|
208077
208297
|
if (args.includes("--help") || args.includes("-h")) {
|
|
208078
208298
|
io2.log(PAYMENT_REVIEW_USAGE);
|
|
@@ -208101,7 +208321,9 @@ function runPaymentReview(args, io2) {
|
|
|
208101
208321
|
flowId: flow.id,
|
|
208102
208322
|
message: "Payment setup could not be verified. Preserve the existing purchase flow with its supported checkout; do not claim payments are disconnected."
|
|
208103
208323
|
}));
|
|
208104
|
-
|
|
208324
|
+
const paidFlows = obj11(review).flows.map(obj11).filter((flow) => flow.payment === "online-paid").map((flow) => String(flow.id));
|
|
208325
|
+
const ownerSteps = paidFlows.length ? [checkoutClientOwnerStep(metaSiteId, paidFlows)] : [];
|
|
208326
|
+
io2.log(JSON.stringify({ ok: true, stage: "payment-decisions-reviewed", evidenceDir, warnings, ownerSteps, verification: "Recorded evidence and decisions checked; merchant readiness is not independently verified by this command." }));
|
|
208105
208327
|
return 0;
|
|
208106
208328
|
} catch {
|
|
208107
208329
|
return fail8("payment_review_unreadable", ["Read the collected manifest and source evidence, then prepare payment-review.json for that site."], 1);
|
|
@@ -216761,12 +216983,12 @@ async function ejectCommand(ctx) {
|
|
|
216761
216983
|
print({ ok: false, error: "eject needs a module", hint: `one of: ${EJECTABLE2.join(", ")}` });
|
|
216762
216984
|
return 2;
|
|
216763
216985
|
}
|
|
216764
|
-
const { readdirSync:
|
|
216986
|
+
const { readdirSync: readdirSync49, existsSync: fileExists } = await import("node:fs");
|
|
216765
216987
|
const { join: pathJoin3 } = await import("node:path");
|
|
216766
216988
|
const targets = [];
|
|
216767
216989
|
const t5 = pathJoin3(dir, "tier5-src");
|
|
216768
216990
|
if (fileExists(t5)) {
|
|
216769
|
-
for (const d2 of
|
|
216991
|
+
for (const d2 of readdirSync49(t5, { withFileTypes: true })) {
|
|
216770
216992
|
if (d2.isDirectory()) targets.push(pathJoin3(t5, d2.name, "index.ts"));
|
|
216771
216993
|
}
|
|
216772
216994
|
}
|
|
@@ -870,10 +870,11 @@ A source with many top-tab pages (33 in one migration) converts to this arrangem
|
|
|
870
870
|
- `appEditor.outline.*` icons with no Himi name (lightning, rocket, light bulb, megaphone,
|
|
871
871
|
brochure, content card) need a fallback icon from `himi icons`, such as `star`,
|
|
872
872
|
`bell` or `doc`. Record each fallback as an adaptation.
|
|
873
|
-
- A source `goToScreen` to a page that is now a **tab** must select that tab.
|
|
874
|
-
`himi.
|
|
875
|
-
|
|
876
|
-
in More can use
|
|
873
|
+
- A source `goToScreen` to a page that is now a **tab** must select that tab. `himi one-app generate`
|
|
874
|
+
writes it as a `himi.tab` action with the tab's id (the id `apply-navigation` gives the tab), because
|
|
875
|
+
`himi.open` would push a second copy of the page. Write the same `himi.tab` action (or a worker action that
|
|
876
|
+
calls `navigate(s, { tab: "<tabId>" })`) for a link you add by hand. A `goToScreen` to a page in More can use
|
|
877
|
+
`himi.open`. The link names its layout item by ID or by slug; a slug two items share names neither.
|
|
877
878
|
- A `goToScreen` whose layout item does not exist does nothing in the source. Keep it a
|
|
878
879
|
no-op (a worker action that returns the state unchanged) and list it as an unresolved
|
|
879
880
|
route.
|
|
@@ -1039,6 +1040,14 @@ review and the hash-verified collected source, checks decisions and site binding
|
|
|
1039
1040
|
and creates nothing. A passing check validates the recorded plan, not the truth
|
|
1040
1041
|
of merchant readiness. The review's original manifest hash describes the initial
|
|
1041
1042
|
template; edit the review without rewriting collected evidence or manifest hashes.
|
|
1043
|
+
When the review has an online-paid flow, `validate-payments` also reports an `ownerSteps`
|
|
1044
|
+
entry (`checkout_client_headless_oauth`): Wix opens its hosted checkout only for an OAuth
|
|
1045
|
+
client that is a Headless OAuth app, and the One App's own client is not one. Creating
|
|
1046
|
+
that client happens on the site owner's Wix account, so it is the owner's step (the
|
|
1047
|
+
dashboard OAuth settings, or `himi site client ensure --site <msid> --yes
|
|
1048
|
+
--write-provisioning` run with the owner's own account); the migration never creates it
|
|
1049
|
+
and an agent must not without the owner's consent. Until it exists a member who taps Join
|
|
1050
|
+
sees that paying in the app is not available yet, and no order is created on the site.
|
|
1042
1051
|
Keep the decision, resulting target controls and controlled runtime evidence in
|
|
1043
1052
|
the reconstruction plan and migration report. For all paid flows, handle the exact
|
|
1044
1053
|
structured `SITE_NOT_ACCEPTING_PAYMENTS` failure with clear recovery; unrelated
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1651.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": [
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"artifactId": "himalaya-cli"
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
"falconPackageHash": "
|
|
75
|
+
"falconPackageHash": "41b89ef5ee5070e6b64dd89983a8e26485a91b69c8c14e46c4d45677"
|
|
76
76
|
}
|