@wix/himalaya-cli 0.1662.0 → 0.1663.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 +252 -47
- package/guides/one-app-section-mappings.md +3 -4
- package/guides/one-app-to-himi-app.md +20 -1
- package/package.json +2 -2
- package/templates/beauty-salon/recipes/announcement-card.json +72 -0
- package/templates/beauty-salon/tier5-src/_shared/announcement-section.ts +122 -0
- package/templates/branded-lite/recipes/announcement-card.json +72 -0
- package/templates/branded-lite/tier5-src/_shared/announcement-section.ts +122 -0
- package/templates/community-club/recipes/announcement-card.json +72 -0
- package/templates/community-club/tier5-src/_shared/announcement-section.ts +122 -0
- package/templates/events-meetups/recipes/announcement-card.json +72 -0
- package/templates/events-meetups/tier5-src/_shared/announcement-section.ts +122 -0
- package/templates/gym-fitness/recipes/announcement-card.json +72 -0
- package/templates/gym-fitness/tier5-src/_shared/announcement-section.ts +122 -0
- package/templates/nonprofit-cause/recipes/announcement-card.json +72 -0
- package/templates/nonprofit-cause/tier5-src/_shared/announcement-section.ts +122 -0
- package/templates/podcast-creator/recipes/announcement-card.json +72 -0
- package/templates/podcast-creator/tier5-src/_shared/announcement-section.ts +122 -0
- package/templates/portfolio-creative/recipes/announcement-card.json +72 -0
- package/templates/portfolio-creative/tier5-src/_shared/announcement-section.ts +122 -0
- package/templates/restaurant/recipes/announcement-card.json +72 -0
- package/templates/restaurant/tier5-src/_shared/announcement-section.ts +122 -0
- package/templates/retail-store/recipes/announcement-card.json +72 -0
- package/templates/retail-store/tier5-src/_shared/announcement-section.ts +122 -0
- package/templates/yoga-studio/recipes/announcement-card.json +72 -0
- package/templates/yoga-studio/tier5-src/_shared/announcement-section.ts +122 -0
package/dist/cli.mjs
CHANGED
|
@@ -30966,7 +30966,6 @@ function resolveIdiom(tokens2, ctx = {}) {
|
|
|
30966
30966
|
var IDIOM_CONTEXTS, UNSAFE_KEYS;
|
|
30967
30967
|
var init_idiom = __esm({
|
|
30968
30968
|
"../../core/ts/src/idiom.ts"() {
|
|
30969
|
-
"use strict";
|
|
30970
30969
|
init_define_HHP_CATALOG();
|
|
30971
30970
|
IDIOM_CONTEXTS = {
|
|
30972
30971
|
ios: { native: ["ios"] },
|
|
@@ -182628,6 +182627,7 @@ __export(coverage_exports, {
|
|
|
182628
182627
|
REQUIRED_CHECK: () => REQUIRED_CHECK,
|
|
182629
182628
|
SECTION_VISIBILITY_STATES: () => SECTION_VISIBILITY_STATES,
|
|
182630
182629
|
deriveRequirements: () => deriveRequirements,
|
|
182630
|
+
recordRouteTargets: () => recordRouteTargets,
|
|
182631
182631
|
requirementId: () => requirementId,
|
|
182632
182632
|
syncCoverage: () => syncCoverage,
|
|
182633
182633
|
verifiedEvidence: () => verifiedEvidence,
|
|
@@ -182893,6 +182893,29 @@ function syncCoverage(evidenceDir, contentDir2, write2 = true) {
|
|
|
182893
182893
|
if (write2 && removed.length === 0) writeFileSync37(path2, JSON.stringify(current, null, 2) + "\n");
|
|
182894
182894
|
return { coverage: current, added, removed, changed, hashesChanged, existed };
|
|
182895
182895
|
}
|
|
182896
|
+
function recordRouteTargets(evidenceDir, contentDir2, targets) {
|
|
182897
|
+
const { coverage, removed, hashesChanged } = syncCoverage(evidenceDir, contentDir2, false);
|
|
182898
|
+
if (hashesChanged) return { status: "skipped", rows: 0, reason: `the evidence changed since ${COVERAGE_FILE} was saved: run \`himi one-app coverage sync\` first, then \`generate\` again` };
|
|
182899
|
+
if (removed.length) return { status: "skipped", rows: 0, reason: `${COVERAGE_FILE} holds ${removed.length} saved row(s) that no longer match the evidence: run \`himi one-app coverage sync\` and decide them first` };
|
|
182900
|
+
const decided = new Map(targets.map((t2) => [t2.source, t2.screenId]));
|
|
182901
|
+
let rows = 0;
|
|
182902
|
+
for (const row2 of coverage.requirements) {
|
|
182903
|
+
if (row2.kind !== "route" || !decided.has(row2.source)) continue;
|
|
182904
|
+
const screenId = decided.get(row2.source);
|
|
182905
|
+
if (screenId) {
|
|
182906
|
+
if (row2.target?.screenId === screenId) continue;
|
|
182907
|
+
row2.target = { ...row2.target, screenId };
|
|
182908
|
+
} else if (row2.target) {
|
|
182909
|
+
delete row2.target;
|
|
182910
|
+
} else continue;
|
|
182911
|
+
rows++;
|
|
182912
|
+
}
|
|
182913
|
+
const path2 = join89(resolve68(contentDir2), COVERAGE_FILE);
|
|
182914
|
+
const next = JSON.stringify(coverage, null, 2) + "\n";
|
|
182915
|
+
if (existsSync88(path2) && readFileSync98(path2, "utf8") === next) return { status: "unchanged", rows: 0 };
|
|
182916
|
+
writeFileSync37(path2, next);
|
|
182917
|
+
return { status: "written", rows };
|
|
182918
|
+
}
|
|
182896
182919
|
function verifyCoverage(evidenceDir, contentDir2, releaseHash, builtScreenIds) {
|
|
182897
182920
|
const result = syncCoverage(evidenceDir, contentDir2, false);
|
|
182898
182921
|
const sourceSiteId = obj4(verifiedEvidence(resolve68(evidenceDir)).manifest.source).metaSiteId;
|
|
@@ -207482,6 +207505,8 @@ function generateScreens(input) {
|
|
|
207482
207505
|
gaps: [],
|
|
207483
207506
|
workers: {},
|
|
207484
207507
|
tabs: [],
|
|
207508
|
+
pages: [],
|
|
207509
|
+
routeRows: [],
|
|
207485
207510
|
evidence: { ...str11(raw.revision) ? { revision: str11(raw.revision) } : {}, ...str11(raw.publishedDate) ? { publishedDate: str11(raw.publishedDate) } : {} }
|
|
207486
207511
|
};
|
|
207487
207512
|
const assemble = (screenId, title, children2, uses) => {
|
|
@@ -207624,6 +207649,7 @@ function generateScreens(input) {
|
|
|
207624
207649
|
});
|
|
207625
207650
|
out2.unmapped.push(...unmapped);
|
|
207626
207651
|
if (!children2.length) {
|
|
207652
|
+
if (!unmapped.length) out2.unmapped.push({ page: label3, sectionId: "", sectionDefinitionId: "(page)", reason: "none of the page's sections produced anything to show (see the gaps), so the page has no screen" });
|
|
207627
207653
|
out2.routes.push({ layoutItemId, label: label3, kind: "unmapped" });
|
|
207628
207654
|
continue;
|
|
207629
207655
|
}
|
|
@@ -207631,7 +207657,48 @@ function generateScreens(input) {
|
|
|
207631
207657
|
for (const extra of extras) assemble(extra.screenId, extra.title, extra.children, extra.uses);
|
|
207632
207658
|
out2.routes.push({ layoutItemId, label: label3, screenId, kind: "generated" });
|
|
207633
207659
|
}
|
|
207660
|
+
const slugs = layoutSlugs(layoutItems);
|
|
207661
|
+
const hasTabBar = (str11(obj6(obj6(input.navigation).target).navKind) || "bottomTabs") === "bottomTabs";
|
|
207662
|
+
const pageOfScreen = new Map(sourceTabs.flatMap((tab) => {
|
|
207663
|
+
const first = pageItems(str11(tab.screenId))[0];
|
|
207664
|
+
return first ? [[str11(tab.screenId), first]] : [];
|
|
207665
|
+
}));
|
|
207666
|
+
for (; ; ) {
|
|
207667
|
+
const emptied = resolveRoutePlaceholders(out2, fellBack, slugs, hasTabBar, pageOfScreen, true);
|
|
207668
|
+
let demoted = 0;
|
|
207669
|
+
for (const { id: screenId, dropped } of emptied) {
|
|
207670
|
+
const route = out2.routes.find((r3) => r3.screenId === screenId && r3.kind === "generated");
|
|
207671
|
+
if (!route) continue;
|
|
207672
|
+
demoted++;
|
|
207673
|
+
for (const title of dropped) out2.gaps.push({ page: route.label, sectionId: "", sectionDefinitionId: "platform_elements_button_section", reason: `the button "${title}" links to a page that produced no screen, so the button is left out` });
|
|
207674
|
+
out2.unmapped.push({ page: route.label, sectionId: "", sectionDefinitionId: "platform_elements_button_section", reason: "its only content was a button linking to a page that produced no screen, so the page has nothing to show" });
|
|
207675
|
+
out2.routes[out2.routes.indexOf(route)] = { layoutItemId: route.layoutItemId, label: route.label, kind: "unmapped" };
|
|
207676
|
+
delete out2.screens[screenId];
|
|
207677
|
+
delete out2.workers[screenId];
|
|
207678
|
+
}
|
|
207679
|
+
if (!demoted) break;
|
|
207680
|
+
}
|
|
207634
207681
|
mergePageWorkers(out2);
|
|
207682
|
+
markSharedTemplateParams(out2);
|
|
207683
|
+
const pointerPart = (id) => id.replaceAll("~", "~0").replaceAll("/", "~1");
|
|
207684
|
+
const screenOfPage = new Map(out2.routes.filter((r3) => r3.screenId).map((r3) => [r3.layoutItemId, r3.screenId]));
|
|
207685
|
+
const mapRow = (source2, screenId) => {
|
|
207686
|
+
if (!out2.routeRows.some((row2) => row2.source === source2)) out2.routeRows.push({ source: source2, ...screenId ? { screenId } : {} });
|
|
207687
|
+
};
|
|
207688
|
+
const attempted = new Set(items);
|
|
207689
|
+
for (const sourceScreenId of Object.keys(screens0)) {
|
|
207690
|
+
const pages2 = pageItems(sourceScreenId);
|
|
207691
|
+
const first = pages2.find((id) => obj6(obj6(layoutItems[id]).settings).hideFromNavigation !== true) ?? pages2[0];
|
|
207692
|
+
if (first ? attempted.has(first) : tabScreenIds.includes(sourceScreenId)) mapRow(`/screens/${pointerPart(sourceScreenId)}`, first ? screenOfPage.get(first) : void 0);
|
|
207693
|
+
arr(obj6(obj6(screens0[sourceScreenId]).layout).items).forEach((item, index) => {
|
|
207694
|
+
const id = str11(obj6(item).layoutItemId);
|
|
207695
|
+
if (attempted.has(id)) mapRow(`/screens/${pointerPart(sourceScreenId)}/layout/items/${index}`, screenOfPage.get(id));
|
|
207696
|
+
});
|
|
207697
|
+
}
|
|
207698
|
+
for (const layoutItemId of items) {
|
|
207699
|
+
mapRow(`/screens/${pointerPart(layoutItemId)}`, screenOfPage.get(layoutItemId));
|
|
207700
|
+
mapRow(`/screens/${pointerPart(layoutItemId)}/layout/items/0`, screenOfPage.get(layoutItemId));
|
|
207701
|
+
}
|
|
207635
207702
|
const planned2 = obj6(input.navigation);
|
|
207636
207703
|
const ownTabs = sourceTabs.length > 1 && !arr(obj6(planned2.target).tabs).length ? sourceTabs.flatMap((tab) => {
|
|
207637
207704
|
const layoutItemId = pageItems(str11(tab.screenId))[0];
|
|
@@ -207643,12 +207710,22 @@ function generateScreens(input) {
|
|
|
207643
207710
|
return layoutItemId && !hidden ? [{ layoutItemId, label: str11(tab.title).trim(), icon: str11(tab.icon) }] : [];
|
|
207644
207711
|
}) : [];
|
|
207645
207712
|
addNavigation(out2, ownTabs.length ? { target: { tabs: ownTabs, overflow: ownTabs.length > BOTTOM_TABS_BEFORE_MORE + 1 } } : planned2, taken);
|
|
207646
|
-
resolveRoutePlaceholders(out2, fellBack,
|
|
207647
|
-
const first = pageItems(str11(tab.screenId))[0];
|
|
207648
|
-
return first ? [[str11(tab.screenId), first]] : [];
|
|
207649
|
-
})));
|
|
207713
|
+
resolveRoutePlaceholders(out2, fellBack, slugs, hasTabBar, pageOfScreen);
|
|
207650
207714
|
return out2;
|
|
207651
207715
|
}
|
|
207716
|
+
function markSharedTemplateParams(out2) {
|
|
207717
|
+
const users = /* @__PURE__ */ new Map();
|
|
207718
|
+
for (const route of out2.routes) if (route.kind === "template" && route.screenId) users.set(route.screenId, [...users.get(route.screenId) ?? [], route]);
|
|
207719
|
+
for (const routes of users.values()) {
|
|
207720
|
+
if (routes.length < 2) continue;
|
|
207721
|
+
for (const route of routes) {
|
|
207722
|
+
if (!route.params) continue;
|
|
207723
|
+
route.openOnly = true;
|
|
207724
|
+
const lost = Object.keys(route.params).filter((key3) => key3 !== "categoryId");
|
|
207725
|
+
if (lost.length) out2.gaps.push({ page: route.label, sectionId: "", sectionDefinitionId: "(navigation)", reason: `this page shares the ${route.screenId} screen with another page, so its ${lost.join(", ")} cannot be set on the screen and is not passed` });
|
|
207726
|
+
}
|
|
207727
|
+
}
|
|
207728
|
+
}
|
|
207652
207729
|
function layoutSlugs(layoutItems) {
|
|
207653
207730
|
const found = /* @__PURE__ */ new Map(), repeated = /* @__PURE__ */ new Set();
|
|
207654
207731
|
for (const [id, item] of Object.entries(layoutItems)) {
|
|
@@ -207660,7 +207737,7 @@ function layoutSlugs(layoutItems) {
|
|
|
207660
207737
|
for (const slug of repeated) found.delete(slug);
|
|
207661
207738
|
return found;
|
|
207662
207739
|
}
|
|
207663
|
-
function resolveRoutePlaceholders(out2, fellBack, slugs, hasTabBar, pageOfScreen) {
|
|
207740
|
+
function resolveRoutePlaceholders(out2, fellBack, slugs, hasTabBar, pageOfScreen, dryRun = false) {
|
|
207664
207741
|
const screenOf = new Map(out2.routes.filter((r3) => r3.screenId).map((r3) => [r3.layoutItemId, r3.screenId]));
|
|
207665
207742
|
const taken = /* @__PURE__ */ new Set();
|
|
207666
207743
|
const tabOfScreen = new Map((hasTabBar ? out2.tabs : []).map((tab) => [tab.screenId, tabIdFor(tab, taken)]));
|
|
@@ -207676,15 +207753,39 @@ function resolveRoutePlaceholders(out2, fellBack, slugs, hasTabBar, pageOfScreen
|
|
|
207676
207753
|
return tab ? { actionId: "himi.tab", params: { tab } } : { ...tap, params: { ...obj6(tap.params), screenId: target } };
|
|
207677
207754
|
};
|
|
207678
207755
|
const isPlaceholderTap = (v2) => !!v2 && typeof v2 === "object" && str11(obj6(obj6(v2).params).screenId).startsWith(ROUTE_PLACEHOLDER);
|
|
207679
|
-
const
|
|
207756
|
+
const isDeadButton = (v2) => {
|
|
207757
|
+
const body = obj6(obj6(v2).body);
|
|
207758
|
+
const action = obj6(body.props).action;
|
|
207759
|
+
return body.type === "Button" && isPlaceholderTap(action) && !resolve99(str11(obj6(obj6(action).params).screenId));
|
|
207760
|
+
};
|
|
207761
|
+
const DEAD = Symbol("dead");
|
|
207762
|
+
const walk2 = (value2, dropped) => {
|
|
207680
207763
|
if (typeof value2 === "string" && value2.startsWith(ROUTE_PLACEHOLDER)) return resolve99(value2);
|
|
207681
|
-
if (Array.isArray(value2)) return value2.map(walk2);
|
|
207764
|
+
if (Array.isArray(value2)) return value2.map((v2) => walk2(v2, dropped)).filter((v2) => v2 !== DEAD);
|
|
207682
207765
|
if (value2 && typeof value2 === "object") {
|
|
207683
|
-
|
|
207766
|
+
if (isDeadButton(value2)) {
|
|
207767
|
+
dropped.push(str11(obj6(obj6(obj6(value2).body).props).title));
|
|
207768
|
+
return DEAD;
|
|
207769
|
+
}
|
|
207770
|
+
const next = 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, dropped)]));
|
|
207771
|
+
const type2 = obj6(obj6(value2).body).type;
|
|
207772
|
+
const before = obj6(obj6(obj6(value2).body).props).children, after = obj6(obj6(next.body).props).children;
|
|
207773
|
+
if ((type2 === "VStack" || type2 === "HStack") && Array.isArray(before) && before.length && Array.isArray(after) && !after.length) return DEAD;
|
|
207774
|
+
return next;
|
|
207684
207775
|
}
|
|
207685
207776
|
return value2;
|
|
207686
207777
|
};
|
|
207687
|
-
|
|
207778
|
+
const emptied = [];
|
|
207779
|
+
for (const [id, screen] of Object.entries(out2.screens)) {
|
|
207780
|
+
const dropped = [];
|
|
207781
|
+
const walked = walk2(screen, dropped);
|
|
207782
|
+
if (walked.payload === DEAD) emptied.push({ id, dropped });
|
|
207783
|
+
if (dryRun) continue;
|
|
207784
|
+
out2.screens[id] = walked.payload === DEAD ? { ...walked, payload: { ...obj6(screen.payload), body: { ...obj6(obj6(screen.payload).body), props: { ...obj6(obj6(obj6(screen.payload).body).props), children: [] } } } } : walked;
|
|
207785
|
+
if (walked.payload === DEAD) out2.unmapped.push({ page: str11(screen.title) || id, sectionId: "", sectionDefinitionId: "platform_elements_button_section", reason: "its only content was a button linking to a page that produced no screen, so the page has nothing to show" });
|
|
207786
|
+
for (const title of dropped) out2.gaps.push({ page: str11(screen.title) || id, sectionId: "", sectionDefinitionId: "platform_elements_button_section", reason: `the button "${title}" links to a page that produced no screen, so the button is left out` });
|
|
207787
|
+
}
|
|
207788
|
+
return emptied;
|
|
207688
207789
|
}
|
|
207689
207790
|
function openedScreens(node3, found = []) {
|
|
207690
207791
|
if (Array.isArray(node3)) {
|
|
@@ -207700,13 +207801,15 @@ function openedScreens(node3, found = []) {
|
|
|
207700
207801
|
return found;
|
|
207701
207802
|
}
|
|
207702
207803
|
function tabsFile(result, navigation) {
|
|
207703
|
-
if (!result.tabs.length) return void 0;
|
|
207804
|
+
if (!result.tabs.length && !result.pages.length) return void 0;
|
|
207704
207805
|
const more = result.tabs.find((tab) => tab.layoutItemId === "(more)");
|
|
207705
207806
|
return {
|
|
207706
207807
|
version: 1,
|
|
207707
207808
|
navKind: str11(obj6(obj6(navigation).target).navKind) || "bottomTabs",
|
|
207708
207809
|
tabs: result.tabs,
|
|
207709
|
-
moreRows: more ? openedScreens(result.screens[more.screenId]) : []
|
|
207810
|
+
moreRows: more ? openedScreens(result.screens[more.screenId]) : [],
|
|
207811
|
+
// `apply-navigation` compares these with the navigation plan: a page with no screen must not vanish from the bar without a word.
|
|
207812
|
+
pages: result.pages
|
|
207710
207813
|
};
|
|
207711
207814
|
}
|
|
207712
207815
|
function addNavigation(out2, plan, taken) {
|
|
@@ -207715,10 +207818,13 @@ function addNavigation(out2, plan, taken) {
|
|
|
207715
207818
|
const routeOf = new Map(out2.routes.map((r3) => [r3.layoutItemId, r3]));
|
|
207716
207819
|
const overflow = obj6(plan.target).overflow === true && tabs.length > BOTTOM_TABS_BEFORE_MORE + 1;
|
|
207717
207820
|
const bottom = overflow ? tabs.slice(0, BOTTOM_TABS_BEFORE_MORE) : tabs;
|
|
207821
|
+
for (const tab of tabs) out2.pages.push({ layoutItemId: str11(tab.layoutItemId), label: str11(tab.label), ...routeOf.get(str11(tab.layoutItemId))?.screenId ? { screenId: routeOf.get(str11(tab.layoutItemId)).screenId } : {} });
|
|
207718
207822
|
for (const tab of bottom) {
|
|
207719
207823
|
const route = routeOf.get(str11(tab.layoutItemId));
|
|
207720
|
-
if (route?.screenId)
|
|
207721
|
-
|
|
207824
|
+
if (route?.screenId) {
|
|
207825
|
+
out2.tabs.push({ layoutItemId: str11(tab.layoutItemId), label: str11(tab.label), ...str11(tab.icon) ? { icon: str11(tab.icon) } : {}, screenId: route.screenId });
|
|
207826
|
+
if (route.openOnly) out2.gaps.push({ page: str11(tab.label), sectionId: "", sectionDefinitionId: "(navigation)", reason: `this tab opens the shared ${route.screenId} screen, that another page also opens, so ${JSON.stringify(route.params)} cannot be set from a tab (a More row passes it with its tap)` });
|
|
207827
|
+
} else out2.unmapped.push({ page: str11(tab.label), sectionId: "", sectionDefinitionId: "(navigation)", reason: "this tab's page has no screen to open" });
|
|
207722
207828
|
}
|
|
207723
207829
|
if (!overflow) return;
|
|
207724
207830
|
const rows = [];
|
|
@@ -207733,7 +207839,7 @@ function addNavigation(out2, plan, taken) {
|
|
|
207733
207839
|
id,
|
|
207734
207840
|
[text13(`${id}.label`, str11(tab.label), "body", { maxLines: 1 }, { weight: 1 }), chevron(id)],
|
|
207735
207841
|
12,
|
|
207736
|
-
{ ...inset(14, 14), onTap: { actionId: "himi.open", params: { screenId: route.screenId } }, accessibilityLabel: str11(tab.label) }
|
|
207842
|
+
{ ...inset(14, 14), onTap: { actionId: "himi.open", params: { screenId: route.screenId, ...route.params?.categoryId !== void 0 ? { categoryId: route.params.categoryId } : {} } }, accessibilityLabel: str11(tab.label) }
|
|
207737
207843
|
));
|
|
207738
207844
|
});
|
|
207739
207845
|
if (!rows.length) return;
|
|
@@ -207749,19 +207855,31 @@ function addNavigation(out2, plan, taken) {
|
|
|
207749
207855
|
out2.routes.push({ layoutItemId: "(more)", label: "More", screenId, kind: "generated" });
|
|
207750
207856
|
out2.tabs.push({ layoutItemId: "(more)", label: "More", screenId });
|
|
207751
207857
|
}
|
|
207752
|
-
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;
|
|
207858
|
+
var TEMPLATE_SCREEN_PARAM_KEYS, SYSTEM_ALL_PRODUCTS_ID, 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, mailUrl, BUSINESS_CHAT_SCREEN, sourceTap, HANDLERS, MERGED_PAGES_BUNDLE, chevron;
|
|
207753
207859
|
var init_generate2 = __esm({
|
|
207754
207860
|
"src/one-app/generate.ts"() {
|
|
207755
207861
|
init_define_HHP_CATALOG();
|
|
207756
207862
|
init_recipes();
|
|
207757
207863
|
init_recipes();
|
|
207758
207864
|
init_tab_ids();
|
|
207865
|
+
TEMPLATE_SCREEN_PARAM_KEYS = {
|
|
207866
|
+
himi_shop: ["categoryId"],
|
|
207867
|
+
himi_groups_feed: ["title", "groupListLabel", "pageSize"],
|
|
207868
|
+
himi_groups: ["title", "groupListLabel", "pageSize"]
|
|
207869
|
+
};
|
|
207870
|
+
SYSTEM_ALL_PRODUCTS_ID = "00000000-000000-000000-000000000001";
|
|
207759
207871
|
TEMPLATE_PARAMS = {
|
|
207760
207872
|
groups_feed_section: (_section, st2) => ({
|
|
207761
207873
|
...str11(st2.sectionTitle).trim() ? { title: str11(st2.sectionTitle).trim() } : {},
|
|
207762
207874
|
...str11(st2.openGroupListButtonText).trim() ? { groupListLabel: str11(st2.openGroupListButtonText).trim() } : {},
|
|
207763
207875
|
...Number.isInteger(st2.postNumber) ? { pageSize: st2.postNumber } : {}
|
|
207764
|
-
})
|
|
207876
|
+
}),
|
|
207877
|
+
// The source's own collection: `himi_shop` reads it as `categoryId` (its load argument or the `himi.open` input) and opens
|
|
207878
|
+
// on that category's chip. Wix's "All Products" system collection is the shop's own All chip, so it passes nothing.
|
|
207879
|
+
stores_products_grid_section: (_section, st2) => {
|
|
207880
|
+
const id = str11(obj6(st2.collection).id).trim();
|
|
207881
|
+
return id && id !== SYSTEM_ALL_PRODUCTS_ID ? { categoryId: id } : {};
|
|
207882
|
+
}
|
|
207765
207883
|
};
|
|
207766
207884
|
FALLBACK_TARGETS = {
|
|
207767
207885
|
achievements_carousel_section: { sibling: "achievements_list_section", screen: "himi_programs" },
|
|
@@ -207796,6 +207914,8 @@ var init_generate2 = __esm({
|
|
|
207796
207914
|
members: { file: "members-directory", register: "registerMembersDirectory", capabilities: ["wix_api"] },
|
|
207797
207915
|
blog: { file: "blog-list", register: "registerBlogList", capabilities: ["wix_api"] },
|
|
207798
207916
|
plans: { file: "plans-section", register: "registerPlansSection", capabilities: ["wix_api"] },
|
|
207917
|
+
// A link tapped in the rich body opens through `capability.open_url`, which the page's screen must declare too.
|
|
207918
|
+
announcements: { file: "announcement-section", register: "registerAnnouncementSection", capabilities: ["wix_api", "open_url"] },
|
|
207799
207919
|
// The module shares an event through the OS share sheet, so a page that uses it declares `share` (as the groups feed bundle does).
|
|
207800
207920
|
events: { file: "events-inline", register: "registerEventsInline", capabilities: ["wix_api", "share"] }
|
|
207801
207921
|
};
|
|
@@ -207817,11 +207937,20 @@ var init_generate2 = __esm({
|
|
|
207817
207937
|
const compact = phone.trim().replace(/[\s().-]/g, "");
|
|
207818
207938
|
return /^\+?\d{2,}$/.test(compact) ? `tel:${compact}` : "";
|
|
207819
207939
|
};
|
|
207820
|
-
|
|
207940
|
+
mailUrl = (email) => {
|
|
207941
|
+
const address = email.trim();
|
|
207942
|
+
return /^[^\s@,;?<>:]+@[^\s@,;?<>:]+\.[^\s@,;?<>:]+$/.test(address) ? `mailto:${address}` : "";
|
|
207943
|
+
};
|
|
207944
|
+
BUSINESS_CHAT_SCREEN = "himi_business_chat";
|
|
207945
|
+
sourceTap = (action, hasScreen2 = () => true) => {
|
|
207821
207946
|
if (action.type === "url" && webUrl(str11(action.url))) return openUrl2(webUrl(str11(action.url)));
|
|
207822
207947
|
if (action.type === "goToScreen" && str11(action.screenId)) return { actionId: "himi.open", params: { screenId: `${ROUTE_PLACEHOLDER}${str11(action.screenId)}|` } };
|
|
207823
207948
|
const dial = action.type === "tel" ? dialUrl(str11(action.phoneNumber)) : "";
|
|
207824
|
-
|
|
207949
|
+
if (dial) return openUrl2(dial);
|
|
207950
|
+
const mail = action.type === "mailto" ? mailUrl(str11(action.email)) : "";
|
|
207951
|
+
if (mail) return openUrl2(mail);
|
|
207952
|
+
if (action.type === "vertical" && str11(action.ctaId).startsWith("chat.") && hasScreen2(BUSINESS_CHAT_SCREEN)) return { actionId: "himi.open", params: { screenId: BUSINESS_CHAT_SCREEN } };
|
|
207953
|
+
return void 0;
|
|
207825
207954
|
};
|
|
207826
207955
|
HANDLERS = {
|
|
207827
207956
|
platform_elements_title_section: (id, _s2, st2) => {
|
|
@@ -207840,7 +207969,7 @@ var init_generate2 = __esm({
|
|
|
207840
207969
|
if (st2.onPressType === "openAsModal") {
|
|
207841
207970
|
modifiers.onTap = { actionId: "himi.lightbox", args: { images: [{ url, alt: ctx.page.label }] } };
|
|
207842
207971
|
} else {
|
|
207843
|
-
const tap = sourceTap(action);
|
|
207972
|
+
const tap = sourceTap(action, ctx.hasScreen);
|
|
207844
207973
|
if (tap) modifiers.onTap = tap;
|
|
207845
207974
|
}
|
|
207846
207975
|
return vstack(`${id}.box`, [node(id, "Image", {
|
|
@@ -207851,19 +207980,28 @@ var init_generate2 = __esm({
|
|
|
207851
207980
|
contentDescription: ctx.page.label
|
|
207852
207981
|
}, Object.keys(modifiers).length ? modifiers : void 0)], 0, inset(16, 16));
|
|
207853
207982
|
},
|
|
207854
|
-
platform_elements_button_section: (id, _s2, st2) => {
|
|
207855
|
-
const button = (label3, action, style, i2) =>
|
|
207856
|
-
|
|
207857
|
-
|
|
207858
|
-
|
|
207859
|
-
|
|
207860
|
-
|
|
207861
|
-
|
|
207862
|
-
|
|
207983
|
+
platform_elements_button_section: (id, _s2, st2, _i2, ctx, elementId) => {
|
|
207984
|
+
const button = (label3, action, style, i2) => {
|
|
207985
|
+
const tap = sourceTap(action, ctx.hasScreen);
|
|
207986
|
+
if (!tap) {
|
|
207987
|
+
ctx.gap(elementId, "platform_elements_button_section", `the button "${label3.trim()}" has a source action (${str11(action.type) || "none"}) with no equivalent here, so the button is left out`);
|
|
207988
|
+
return null;
|
|
207989
|
+
}
|
|
207990
|
+
return node(`${id}.b${i2}`, "Button", {
|
|
207991
|
+
title: label3.trim(),
|
|
207992
|
+
style: style === "outline" ? "secondary" : "primary",
|
|
207993
|
+
size: "md",
|
|
207994
|
+
// A centered source button is a centered pill, not a full-width bar.
|
|
207995
|
+
fullWidth: st2.alignment !== "center",
|
|
207996
|
+
action: tap
|
|
207997
|
+
});
|
|
207998
|
+
};
|
|
207863
207999
|
const items = [button(str11(st2.text), obj6(st2.action), st2.style, 0)];
|
|
207864
208000
|
if (st2.layout === "double") items.push(button(str11(st2.textSecond), obj6(st2.actionSecond), st2.styleSecond, 1));
|
|
208001
|
+
const shown2 = items.filter((b2) => b2 !== null);
|
|
208002
|
+
if (!shown2.length) return null;
|
|
207865
208003
|
const align = st2.alignment === "center" ? "center" : "leading";
|
|
207866
|
-
return
|
|
208004
|
+
return shown2.length > 1 ? hstack(`${id}.box`, shown2, 12, inset(16, 16), align) : vstack(`${id}.box`, shown2, 0, inset(16, 16), align);
|
|
207867
208005
|
},
|
|
207868
208006
|
media_elements_video_section: (id, _s2, st2, _index, ctx, elementId) => {
|
|
207869
208007
|
let url = str11(st2.source);
|
|
@@ -207899,7 +208037,7 @@ var init_generate2 = __esm({
|
|
|
207899
208037
|
if (item.isHidden === true) return [];
|
|
207900
208038
|
const title = str11(item.title).trim();
|
|
207901
208039
|
const url = str11(item.imageUrl);
|
|
207902
|
-
const tap = sourceTap(obj6(item.actionData));
|
|
208040
|
+
const tap = sourceTap(obj6(item.actionData), ctx.hasScreen);
|
|
207903
208041
|
if (!title && !url) return [];
|
|
207904
208042
|
const parts = [];
|
|
207905
208043
|
if (url) parts.push(node(`${id}.i${i2}.img`, "Image", {
|
|
@@ -207918,9 +208056,9 @@ var init_generate2 = __esm({
|
|
|
207918
208056
|
// The source lays its texts over the picture. They sit on the picture here too, on a plain accent band (a translucent scrim is
|
|
207919
208057
|
// not used: a web renderer paints a band with an opacity above its sibling text) so they read on any photo; the button follows
|
|
207920
208058
|
// them over the picture. With no picture the texts and the button simply stack.
|
|
207921
|
-
platform_elements_interactive_banner_section: (id, _s2, st2, _i2, ctx) => {
|
|
208059
|
+
platform_elements_interactive_banner_section: (id, _s2, st2, _i2, ctx, elementId) => {
|
|
207922
208060
|
const url = str11(st2.imageUri);
|
|
207923
|
-
const tap = sourceTap(obj6(st2.action));
|
|
208061
|
+
const tap = sourceTap(obj6(st2.action), ctx.hasScreen);
|
|
207924
208062
|
const align = st2.horizontalAlign === "center" ? "center" : st2.horizontalAlign === "right" ? "trailing" : "leading";
|
|
207925
208063
|
const picture = url ? node(`${id}.img`, "Image", {
|
|
207926
208064
|
url,
|
|
@@ -207933,8 +208071,10 @@ var init_generate2 = __esm({
|
|
|
207933
208071
|
const buttons = [];
|
|
207934
208072
|
arr(st2.items).map(obj6).forEach((item, i2) => {
|
|
207935
208073
|
if (item.isHidden === true || !str11(item.text).trim()) return;
|
|
207936
|
-
if (item.type === "button")
|
|
207937
|
-
|
|
208074
|
+
if (item.type === "button") {
|
|
208075
|
+
if (tap) buttons.push(node(`${id}.b${i2}`, "Button", { title: str11(item.text).trim(), style: "primary", size: "md", fullWidth: false, action: tap }));
|
|
208076
|
+
else ctx.gap(elementId, "platform_elements_interactive_banner_section", `the banner button "${str11(item.text).trim()}" has a source action (${str11(obj6(st2.action).type) || "none"}) with no equivalent here, so the button is left out`);
|
|
208077
|
+
} else texts.push(text13(`${id}.t${i2}`, str11(item.text).trim(), item.type === "title" ? "title3" : "body", { textAlign: align, ...picture ? { color: "textOnAccent" } : {} }, { fillMaxWidth: true }));
|
|
207938
208078
|
});
|
|
207939
208079
|
const tapped = tap ? { onTap: tap } : {};
|
|
207940
208080
|
if (!picture) {
|
|
@@ -207953,6 +208093,14 @@ var init_generate2 = __esm({
|
|
|
207953
208093
|
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");
|
|
207954
208094
|
return vstack(`${id}.box`, [node(id, "WebView", { url, height: fixed, scrollEnabled: true }, { fillMaxWidth: true, accessibilityLabel: ctx.page.label })], 0, inset(8, 8));
|
|
207955
208095
|
},
|
|
208096
|
+
// The business's latest announcement. The section has no settings: its content is read at RUNTIME, with the one read-only call the
|
|
208097
|
+
// native app makes (shared announcement module), never baked into the screen and never invented. A scaffold without the module or
|
|
208098
|
+
// the recipe reports the section as unmapped instead.
|
|
208099
|
+
platform_general_announcement_section: (id, s2, _st, index, ctx) => {
|
|
208100
|
+
const svc = ctx.uses("announcements", `announcement${index}`, {});
|
|
208101
|
+
const heading = s2.showTitle === true ? str11(s2.title).trim() : "";
|
|
208102
|
+
return vstack(`${id}.box`, [ctx.recipe("announcement-card", { svc, id, heading })], 0, { onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
|
|
208103
|
+
},
|
|
207956
208104
|
// The data of these sections is shown by a template screen; the page keeps the source's title and a link to it.
|
|
207957
208105
|
vod_carousel_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "vod_carousel_section", NO_INLINE_SECTION),
|
|
207958
208106
|
// The selected plans as cards: name, pitch, price, validity, a details button and the benefits list (unless the source hides it).
|
|
@@ -208485,12 +208633,12 @@ function inboxEntriesInConfig(configSource) {
|
|
|
208485
208633
|
if (id === "drawer_inbox" && screenId) found.push({ site: "drawer Inbox", literal: screenId });
|
|
208486
208634
|
const parent = literalOf(node3, "parentScreenId");
|
|
208487
208635
|
if (screenId?.text === "himi_chat_thread" && parent) found.push({ site: "chat thread parent", literal: parent });
|
|
208488
|
-
if (screenId?.text ===
|
|
208636
|
+
if (screenId?.text === BUSINESS_CHAT_SCREEN2 && parent?.text === "") found.push({ site: "business chat parent", literal: parent });
|
|
208489
208637
|
}
|
|
208490
208638
|
ts19.forEachChild(node3, visit);
|
|
208491
208639
|
};
|
|
208492
208640
|
visit(file2);
|
|
208493
|
-
const stale = found.filter((f2) => f2.literal.text ===
|
|
208641
|
+
const stale = found.filter((f2) => f2.literal.text === BUSINESS_CHAT_SCREEN2 || f2.site === "business chat parent");
|
|
208494
208642
|
let fixed = configSource;
|
|
208495
208643
|
for (const f2 of [...stale].sort((x2, y2) => y2.literal.getStart(file2) - x2.literal.getStart(file2))) {
|
|
208496
208644
|
fixed = `${fixed.slice(0, f2.literal.getStart(file2))}${JSON.stringify(INBOX_SCREEN)}${fixed.slice(f2.literal.getEnd())}`;
|
|
@@ -208505,7 +208653,7 @@ function reopenAsInbox(node3) {
|
|
|
208505
208653
|
}
|
|
208506
208654
|
if (!node3 || typeof node3 !== "object") return false;
|
|
208507
208655
|
const record3 = node3;
|
|
208508
|
-
if (record3.actionId === "himi.open" && obj9(record3.params).screenId ===
|
|
208656
|
+
if (record3.actionId === "himi.open" && obj9(record3.params).screenId === BUSINESS_CHAT_SCREEN2) {
|
|
208509
208657
|
record3.params = { ...obj9(record3.params), screenId: INBOX_SCREEN };
|
|
208510
208658
|
changed = true;
|
|
208511
208659
|
}
|
|
@@ -208517,7 +208665,7 @@ function provisionChatTarget(dir, memberChat, dryRun = false) {
|
|
|
208517
208665
|
const sources = readAppSources(dir);
|
|
208518
208666
|
const app = parseApp(sources.dev, sources.config);
|
|
208519
208667
|
if (!app.routes.some((r3) => r3.kind === "screen" && r3.label === INBOX_SCREEN)) {
|
|
208520
|
-
return { status: "unverified", reason: `the source allows member chat, but this scaffold has no ${INBOX_SCREEN} screen; every chat door keeps opening ${
|
|
208668
|
+
return { status: "unverified", reason: `the source allows member chat, but this scaffold has no ${INBOX_SCREEN} screen; every chat door keeps opening ${BUSINESS_CHAT_SCREEN2}` };
|
|
208521
208669
|
}
|
|
208522
208670
|
const config = inboxEntriesInConfig(sources.config);
|
|
208523
208671
|
const screens = [];
|
|
@@ -208596,14 +208744,17 @@ function parseEntry(entryText, screenId) {
|
|
|
208596
208744
|
return void 0;
|
|
208597
208745
|
}
|
|
208598
208746
|
}
|
|
208599
|
-
function applyScreenParams(dir, screenId, params, dryRun = false) {
|
|
208747
|
+
function applyScreenParams(dir, screenId, params, dryRun = false, remove = []) {
|
|
208600
208748
|
const descriptor = readEntry(dir, screenId);
|
|
208601
208749
|
const appear = descriptor ? rootOnAppear2(descriptor) : void 0;
|
|
208602
208750
|
if (!descriptor || !appear) return "absent";
|
|
208603
208751
|
const current = obj9(appear.params);
|
|
208604
|
-
|
|
208752
|
+
const stale = remove.filter((key3) => key3 in current && !(key3 in params));
|
|
208753
|
+
if (!stale.length && Object.entries(params).every(([k2, v2]) => current[k2] === v2)) return "unchanged";
|
|
208605
208754
|
if (!dryRun) {
|
|
208606
|
-
|
|
208755
|
+
const next = { ...current, ...params };
|
|
208756
|
+
for (const key3 of stale) delete next[key3];
|
|
208757
|
+
appear.params = next;
|
|
208607
208758
|
replaceScreen(dir, screenId, screenEntry(screenId, descriptor));
|
|
208608
208759
|
}
|
|
208609
208760
|
return "set";
|
|
@@ -208723,7 +208874,7 @@ async function runOneAppProvision(args, io2) {
|
|
|
208723
208874
|
return report4(io2, false, { code: "content_invalid", error: error instanceof Error ? error.message : String(error) });
|
|
208724
208875
|
}
|
|
208725
208876
|
}
|
|
208726
|
-
var obj9, PROVISION_USAGE, PROVISIONED_PARAMS, propName6, propOf, GUID2, INBOX_SCREEN,
|
|
208877
|
+
var obj9, PROVISION_USAGE, PROVISIONED_PARAMS, propName6, propOf, GUID2, INBOX_SCREEN, BUSINESS_CHAT_SCREEN2, INBOX_DOOR_SCREENS, NAME_SLOTS;
|
|
208727
208878
|
var init_provision = __esm({
|
|
208728
208879
|
"src/one-app/provision.ts"() {
|
|
208729
208880
|
init_define_HHP_CATALOG();
|
|
@@ -208746,7 +208897,7 @@ var init_provision = __esm({
|
|
|
208746
208897
|
propOf = (o2, name) => o2.properties.find((p2) => propName6(p2) === name && ts19.isPropertyAssignment(p2));
|
|
208747
208898
|
GUID2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
208748
208899
|
INBOX_SCREEN = "himi_inbox";
|
|
208749
|
-
|
|
208900
|
+
BUSINESS_CHAT_SCREEN2 = "himi_business_chat";
|
|
208750
208901
|
INBOX_DOOR_SCREENS = ["himi_account", "himi_chat_thread"];
|
|
208751
208902
|
NAME_SLOTS = /* @__PURE__ */ new Set([...DISPLAY_KEYS, "title", "text", "displayName"]);
|
|
208752
208903
|
}
|
|
@@ -208756,6 +208907,13 @@ var init_provision = __esm({
|
|
|
208756
208907
|
import { existsSync as existsSync125, readFileSync as readFileSync143 } from "node:fs";
|
|
208757
208908
|
import { join as join133 } from "node:path";
|
|
208758
208909
|
import ts20 from "typescript";
|
|
208910
|
+
function pagesWithoutScreen(plan, planned2) {
|
|
208911
|
+
const have = new Map((plan.pages ?? []).map((page) => [page.layoutItemId, page]));
|
|
208912
|
+
const missing3 = /* @__PURE__ */ new Map();
|
|
208913
|
+
for (const page of plan.pages ?? []) if (!page.screenId) missing3.set(page.layoutItemId, page.label);
|
|
208914
|
+
for (const page of planned2) if (!have.get(page.layoutItemId)?.screenId) missing3.set(page.layoutItemId, page.label);
|
|
208915
|
+
return [...missing3].map(([layoutItemId, page]) => ({ page, layoutItemId }));
|
|
208916
|
+
}
|
|
208759
208917
|
function tabIcon(source2) {
|
|
208760
208918
|
const last = (source2 ?? "").split(".").pop() ?? "";
|
|
208761
208919
|
const normalized = last.toLowerCase().replace(/[_.\s-]/g, "");
|
|
@@ -208888,6 +209046,27 @@ async function runOneAppApplyNavigation(args, io2) {
|
|
|
208888
209046
|
} catch {
|
|
208889
209047
|
return report5(io2, false, { code: "tabs_unavailable", error: `${tabsPath} is missing or unreadable: run \`himi one-app generate\` first, and \`himi template screens --upsert\` with its screens.` });
|
|
208890
209048
|
}
|
|
209049
|
+
let planned2;
|
|
209050
|
+
let hasPlan;
|
|
209051
|
+
try {
|
|
209052
|
+
const navigationPlan = readHashedEvidenceJson(options.evidenceDir, "navigation-plan.json");
|
|
209053
|
+
hasPlan = navigationPlan !== void 0;
|
|
209054
|
+
const tabs = navigationPlan?.target?.tabs;
|
|
209055
|
+
planned2 = (Array.isArray(tabs) ? tabs : []).map((tab) => ({ layoutItemId: String(tab.layoutItemId ?? ""), label: String(tab.label ?? "") }));
|
|
209056
|
+
} catch (error) {
|
|
209057
|
+
return report5(io2, false, { code: "evidence_invalid", error: error instanceof Error ? error.message : String(error) });
|
|
209058
|
+
}
|
|
209059
|
+
if (hasPlan && !plan.pages) {
|
|
209060
|
+
return report5(io2, false, { code: "tabs_unavailable", error: `${tabsPath} does not list the pages the source navigation has (it came from an older \`himi one-app generate\`): run \`himi one-app generate\` again.` });
|
|
209061
|
+
}
|
|
209062
|
+
const lost = pagesWithoutScreen(plan, planned2);
|
|
209063
|
+
if (lost.length) {
|
|
209064
|
+
return report5(io2, false, {
|
|
209065
|
+
code: "pages_without_screen",
|
|
209066
|
+
pages: lost,
|
|
209067
|
+
error: `${lost.length} page(s) of the source navigation have no screen, so the tab bar would drop them: ${lost.map((p2) => p2.page).join(", ")}. Map their sections in \`himi one-app generate\` (see its unmapped list) and run it again; nothing was written.`
|
|
209068
|
+
});
|
|
209069
|
+
}
|
|
208891
209070
|
const screens = definedScreens(contentDir2);
|
|
208892
209071
|
if (!screens) return report5(io2, false, { code: "content_invalid", error: "himalaya.content.json not found or unreadable: --content must be a Himi content package." });
|
|
208893
209072
|
const missing3 = plan.tabs.filter((tab) => !screens.has(tab.screenId)).map((tab) => ({ tab: tab.label, screenId: tab.screenId }));
|
|
@@ -208921,6 +209100,7 @@ var init_apply_navigation = __esm({
|
|
|
208921
209100
|
init_icon_catalog_generated();
|
|
208922
209101
|
init_config_source_edit();
|
|
208923
209102
|
init_progress();
|
|
209103
|
+
init_validate_topbar();
|
|
208924
209104
|
init_tab_ids();
|
|
208925
209105
|
tabsFileOf = (out2) => `${out2}.tabs.json`;
|
|
208926
209106
|
APPLY_NAVIGATION_USAGE = "himi one-app apply-navigation --evidence-dir <.himi/one-app> --content <app-dir> [--tabs <tabs.json>] [--dry-run]";
|
|
@@ -209070,14 +209250,38 @@ async function runOneAppGenerate(args, io2) {
|
|
|
209070
209250
|
const templateParams = [];
|
|
209071
209251
|
try {
|
|
209072
209252
|
for (const route of result.routes) {
|
|
209073
|
-
if (route.kind
|
|
209074
|
-
|
|
209253
|
+
if (route.kind !== "template" || !route.screenId) continue;
|
|
209254
|
+
if (route.params && !route.openOnly) {
|
|
209255
|
+
templateParams.push({ screenId: route.screenId, params: route.params, status: applyScreenParams(options.contentDir, route.screenId, route.params, false, TEMPLATE_SCREEN_PARAM_KEYS[route.screenId] ?? []) });
|
|
209256
|
+
} else if (TEMPLATE_SCREEN_PARAM_KEYS[route.screenId]) {
|
|
209257
|
+
let cleared = "absent";
|
|
209258
|
+
try {
|
|
209259
|
+
cleared = applyScreenParams(options.contentDir, route.screenId, {}, false, TEMPLATE_SCREEN_PARAM_KEYS[route.screenId]);
|
|
209260
|
+
} catch {
|
|
209261
|
+
}
|
|
209262
|
+
if (cleared === "set") templateParams.push({ screenId: route.screenId, params: {}, status: cleared });
|
|
209075
209263
|
}
|
|
209076
209264
|
}
|
|
209265
|
+
const targeted = new Set(result.routes.flatMap((route) => route.kind === "template" && route.screenId ? [route.screenId] : []));
|
|
209266
|
+
for (const [screenId, keys] of Object.entries(TEMPLATE_SCREEN_PARAM_KEYS)) {
|
|
209267
|
+
if (targeted.has(screenId)) continue;
|
|
209268
|
+
let cleared = "absent";
|
|
209269
|
+
try {
|
|
209270
|
+
cleared = applyScreenParams(options.contentDir, screenId, {}, false, keys);
|
|
209271
|
+
} catch {
|
|
209272
|
+
}
|
|
209273
|
+
if (cleared === "set") templateParams.push({ screenId, params: {}, status: "set" });
|
|
209274
|
+
}
|
|
209077
209275
|
} catch (error) {
|
|
209078
209276
|
return report6(io2, false, { code: "content_invalid", error: error instanceof Error ? error.message : String(error) });
|
|
209079
209277
|
}
|
|
209080
|
-
|
|
209278
|
+
let coverage;
|
|
209279
|
+
try {
|
|
209280
|
+
coverage = recordRouteTargets(options.evidenceDir, options.contentDir, result.routeRows);
|
|
209281
|
+
} catch (error) {
|
|
209282
|
+
return report6(io2, false, { code: "output_unwritable", error: `Could not write the route rows of ONE-APP-COVERAGE.json: ${error instanceof Error ? error.message : String(error)}` });
|
|
209283
|
+
}
|
|
209284
|
+
const body = { coverage, templateParams, screens: Object.keys(result.screens), workers: Object.values(result.workers).map((w2) => `tier5-src/${w2.bundle}/index.ts`), routes: result.routes, tabs: result.tabs, unmapped: result.unmapped, gaps: result.gaps, evidence: { ...result.evidence, ...fetchedAt ? { fetchedAt } : {} }, out: options.out };
|
|
209081
209285
|
if (result.unmapped.length) {
|
|
209082
209286
|
return report6(io2, false, {
|
|
209083
209287
|
code: "sections_unmapped",
|
|
@@ -209095,6 +209299,7 @@ var init_generate_cli = __esm({
|
|
|
209095
209299
|
init_generate2();
|
|
209096
209300
|
init_recipes();
|
|
209097
209301
|
init_provision();
|
|
209302
|
+
init_coverage();
|
|
209098
209303
|
init_apply_navigation();
|
|
209099
209304
|
GENERATE_USAGE = "himi one-app generate --evidence-dir <.himi/one-app> --content <app-dir> [--out <screens.json>]";
|
|
209100
209305
|
GENERATED_WORKER_MARKER = "// Generated by `himi one-app generate`";
|
|
@@ -22,11 +22,11 @@ Source snapshots: Catalyst `617c06d43d2a5608b6876d724553269b1e5346f0`; Himalaya
|
|
|
22
22
|
|
|
23
23
|
| Classification | Definitions |
|
|
24
24
|
| --- | ---: |
|
|
25
|
-
| Module |
|
|
25
|
+
| Module | 14 |
|
|
26
26
|
| Primitive | 7 |
|
|
27
27
|
| Composition | 9 |
|
|
28
28
|
| Partial | 25 |
|
|
29
|
-
| Empty |
|
|
29
|
+
| Empty | 22 |
|
|
30
30
|
| Total | 77 |
|
|
31
31
|
|
|
32
32
|
## Mappings by server group
|
|
@@ -221,7 +221,7 @@ carousel placement remain separate gaps; the mappings above stay Partial.
|
|
|
221
221
|
| --- | --- | --- | --- | --- | --- |
|
|
222
222
|
| `platform_general_contact_section` | `wix.platform.general.contact_section` | [Core Text/Button/Map composition](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") | Inline composition | Composition | Compose the supplied business contact/address/description and source visibility/get-in-touch settings. Wire phone/email/URL/chat actions to existing target capabilities; the Structure alone may need business contact values supplied alongside it. |
|
|
223
223
|
| `platform_general_upcoming_section` | `wix.platform.general.upcoming_section` | [My Bookings data](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/tier5-bundles-src/himi-booking-bookings/index.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") + [existing home modules](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/home-modules-screen.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Existing base; adaptation needed | Partial | Reuse real member upcoming-booking logic and compose the source strip/limit. Preserve visitor/access behavior and the original agenda CTA; this does not resolve the separate Bookings agenda gap. |
|
|
224
|
-
| `platform_general_announcement_section` | `wix.platform.general.announcement_section` |
|
|
224
|
+
| `platform_general_announcement_section` | `wix.platform.general.announcement_section` | `announcement-section` shared module + `announcement-card` recipe, mapped by `himi one-app generate` | Inline section; the content is read at runtime, never baked at migration time | Module | The latest announcement (title, rich body, creator, date) through the one read-only call the native app makes: `GET https://manage.wix.com/_api/mobile-apps-announcements/v1/announcements/latest?includeReaderData=false`, authorized with the app's own signed instance (Member when signed in, else Visitor). `includeReaderData` stays false (true needs the One App manage permission and answers 403); `AddCurrentMemberAsReader` is a write and is never called. Known server behaviour, shared with the native app: a site with no announcement gets its default welcome text saved once by this read, so do not call it during migration collection or validation. The section has no settings. The announcement `content` is a DraftJS raw state for announcements written in the app (shown as plain text) or a Ricos document (shown rich). Native hosts send the consumer credential to exactly this GET path only (the `isSupportedConsumerEndpoint` family in `WixApiCapability`, Android and Swift), so a phone shows the section from the first Player/app native release that carries that entry; the local web preview (`himi run`) needs nothing. |
|
|
225
225
|
| `platform_general_members_section` | `membersArea.MembersAboutWidget` | [Member data](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/tier5-bundles-src/wix-spaces-members/index.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") + [existing member avatars/home composition](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/home-modules-screen.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Inline composition | Composition | Reuse member rows/avatar presentation and the member-directory destination. Preserve source strip/title/count/privacy settings rather than copying seeded dashboard members. |
|
|
226
226
|
| `platform_elements_divider_section` | `wix.platform.elements.divider_section` | [Core Divider / layout modifiers](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") | Inline primitive | Primitive | Translate orientation/style/spacing from instance settings where supported and retain section margins. |
|
|
227
227
|
| `platform_elements_image_section` | `wix.platform.elements.image_section` | [Core Image](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") | Inline primitive | Primitive | Translate media URL, aspect/crop ratio, fill/fit, corner radius, alt text and configured click action; preserve sizing and accessibility. |
|
|
@@ -392,7 +392,6 @@ These are the exact definitions whose target cells above remain empty. “Not fo
|
|
|
392
392
|
| `photoalbum-section-definitions.json` | `photoAlbums_list_section` | Existing Photo Albums code is an empty-state placeholder with no album API wired. Pro Gallery uses a different data source and is not a substitute; choose an implementation explicitly. |
|
|
393
393
|
| `photoalbum-section-definitions.json` | `photoAlbums_photos_list` | Existing Photo Albums code is an empty-state placeholder with no album API wired. Pro Gallery uses a different data source and is not a substitute; choose an implementation explicitly. |
|
|
394
394
|
| `photoalbum-section-definitions.json` | `photoAlbums_carousel_section` | Existing Photo Albums code is an empty-state placeholder with no album API wired. Pro Gallery uses a different data source and is not a substitute; choose an implementation explicitly. |
|
|
395
|
-
| `platform-section-definitions.json` | `platform_general_announcement_section` | No live source business-announcement implementation was verified. The Spaces dashboard contains seeded announcement text; the Branded home uses a Blog post title; platform new-release announcements are a different entity. |
|
|
396
395
|
| `platform-section-definitions.json` | `platform_ai_generated_section` | No verified interpreter for the source AI-generated section payload/runtime was found. The presence of Tier-5 or WebView support does not establish payload compatibility. |
|
|
397
396
|
| `platform-section-definitions.json` | `platform_elements_embed_code_section` | Core WebView supports inlineHtml, but the source embed-code settings/runtime contract was not verified. Leave this mapping empty instead of assuming arbitrary source embed payloads are compatible. |
|
|
398
397
|
| `stores-section-definitions.json` | `stores_wishlist_section` | The existing himi_saved_products feature is device-local saved products, not a verified account-backed Wix Stores wishlist. Do not substitute those semantics without the user's choice. |
|