@wix/himalaya-cli 0.1637.0 → 0.1638.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +8 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +25 -0
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{289b89dc660fa050af31f8ce5f22ffd7332a60c7b80b8ffd2b141ec074fb2e22.bin → 3361f61ce6b490c8b7b252658ea67f733d88c6e9f95906d0e31eea4827141df3.bin} +1 -1
- package/dist/browser-plane/sw.js +8 -8
- package/dist/cli.mjs +98 -74
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/android-ux.md +6 -3
- package/guides/himi-json-output.md +7 -0
- package/guides/ios-ux.md +4 -2
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +10 -0
- package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +20 -5
- package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +71 -4
- package/templates/branded-lite/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +10 -0
- package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +20 -5
- package/templates/branded-lite/tier5-src/himi-store-account/index.ts +71 -4
- package/templates/community-club/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/community-club/tier5-src/himi-store-account/index.ts +71 -4
- package/templates/events-meetups/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/events-meetups/tier5-src/himi-store-account/index.ts +71 -4
- package/templates/gym-fitness/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +10 -0
- package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +20 -5
- package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +71 -4
- package/templates/nonprofit-cause/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +71 -4
- package/templates/podcast-creator/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +71 -4
- package/templates/portfolio-creative/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +71 -4
- package/templates/restaurant/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/restaurant/tier5-src/himi-store-account/index.ts +71 -4
- package/templates/retail-store/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/retail-store/tier5-src/himi-store-account/index.ts +71 -4
- package/templates/salon-spa/dev/index.ts +16 -12
- package/templates/salon-spa/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/salon-spa/tier5-src/himi-booking-account/index.ts +12 -1
- package/templates/salon-spa/tier5-src/himi-booking-service/index.ts +10 -0
- package/templates/salon-spa/tier5-src/himi-booking-time/index.ts +20 -5
- package/templates/salon-spa/tier5-src/himi-salon-home/index.ts +17 -27
- package/templates/salon-spa/tier5-src/himi-store-account/index.ts +71 -4
- package/templates/yoga-studio/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +10 -0
- package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +20 -5
- package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +71 -4
package/dist/cli.mjs
CHANGED
|
@@ -10256,38 +10256,17 @@ globalThis.__himiDevEnv = ${JSON.stringify(pickContainedPublicEnv(publicEnv))};
|
|
|
10256
10256
|
var install = function (raw) {
|
|
10257
10257
|
var mod = raw && raw.default !== undefined ? raw.default : raw;
|
|
10258
10258
|
|
|
10259
|
-
// SHAPE FIRST, before the defaults below can hide a missing field. \`deriveAppMeta\` reads
|
|
10260
|
-
// \`m.screens.exact\` and \`createDevServer\` calls \`m.createStore(app)\`, so on the HOST arm a
|
|
10261
|
-
// module missing either dies with a TypeError \u2014 while normalising them here to an empty
|
|
10262
|
-
// registry and a stub would hand \`/v1/build\` a successful release with no screens at all
|
|
10263
|
-
// (#2578 review). Same class as everything else on this boundary: a 200 describing something
|
|
10264
|
-
// nobody chose. Only fields the host arm would CRASH on are required, so this can never be
|
|
10265
|
-
// stricter than the import it replaces.
|
|
10266
|
-
// THE RULE IS "what the host arm would CRASH on", and it is a rule rather than a judgement
|
|
10267
|
-
// because guessing at required-ness broke a supported upload the first time: an earlier version
|
|
10268
|
-
// demanded a NON-EMPTY \`homeScreenId\`, which rejected \`kind: "functions"\` packages \u2014
|
|
10269
|
-
// \`apps/functions-e2e/dev/index.ts\` ships \`homeScreenId: ""\` on purpose, and
|
|
10270
|
-
// \`buildFromLoaded\` routes them to the functions-only path before screens are read at all
|
|
10271
|
-
// (#2578 review). A false refusal is as wrong an answer as a false success, and it takes a
|
|
10272
|
-
// working customer path down.
|
|
10273
|
-
//
|
|
10274
|
-
// So: \`screens.exact\` and \`createStore\` only \u2014 \`deriveAppMeta\` does \`Object.keys(m.screens.exact)\`
|
|
10275
|
-
// and \`createDevServer\` calls \`m.createStore(app)\`, so a host import dies on either. An empty
|
|
10276
|
-
// \`exact\`, an empty \`homeScreenId\` and an absent seed are all things the host import carries
|
|
10277
|
-
// happily, so none of them is refused here.
|
|
10278
10259
|
var missing = [];
|
|
10279
10260
|
if (!mod || typeof mod !== "object") missing[missing.length] = "a default export";
|
|
10280
10261
|
else {
|
|
10262
|
+
if (!mod.config) missing[missing.length] = "config";
|
|
10263
|
+
if (typeof mod.homeScreenId !== "string") missing[missing.length] = "homeScreenId";
|
|
10281
10264
|
if (!mod.screens || typeof mod.screens !== "object" || !mod.screens.exact || typeof mod.screens.exact !== "object") {
|
|
10282
10265
|
missing[missing.length] = "screens.exact";
|
|
10283
10266
|
}
|
|
10284
|
-
if (
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
// thing this boundary may never do.
|
|
10288
|
-
if (mod.homeScreenId !== undefined && typeof mod.homeScreenId !== "string") {
|
|
10289
|
-
missing[missing.length] = "a string homeScreenId (it cannot cross the realm otherwise)";
|
|
10290
|
-
}
|
|
10267
|
+
if (!Array.isArray(mod.actions)) missing[missing.length] = "actions";
|
|
10268
|
+
if (typeof mod.createStore !== "function") missing[missing.length] = "createStore";
|
|
10269
|
+
if (!mod.seed) missing[missing.length] = "seed";
|
|
10291
10270
|
}
|
|
10292
10271
|
|
|
10293
10272
|
var screens = (mod && mod.screens) || { exact: {}, templated: [] };
|
|
@@ -10358,6 +10337,8 @@ globalThis.__himiDevEnv = ${JSON.stringify(pickContainedPublicEnv(publicEnv))};
|
|
|
10358
10337
|
// catalog fetch feeding \`screens.exact\` is the same silent loss as one inside \`seedIds\`, and
|
|
10359
10338
|
// without this it would be cleared by the first \`call\` and never reported. Captured here
|
|
10360
10339
|
// because \`install\` runs after the module's top-level code, and after \`createStore\`.
|
|
10340
|
+
meta.missingFields = mod && typeof mod === "object" ? missing : [];
|
|
10341
|
+
if (!mod || typeof mod !== "object") meta.invalidExportType = mod === null ? "null" : typeof mod;
|
|
10361
10342
|
meta.bootRefusals = refusals.slice();
|
|
10362
10343
|
refusals = [];
|
|
10363
10344
|
|
|
@@ -10628,6 +10609,27 @@ function isFunctionsOnlyConfig(config) {
|
|
|
10628
10609
|
function uiConfig(config) {
|
|
10629
10610
|
return config ?? {};
|
|
10630
10611
|
}
|
|
10612
|
+
function assertAppDevModuleShape(entry, module) {
|
|
10613
|
+
if (module === null || typeof module !== "object") {
|
|
10614
|
+
const found = module === null ? "null" : typeof module;
|
|
10615
|
+
throw new Error(`${entry} must default-export an AppDevModule (got ${found}).`);
|
|
10616
|
+
}
|
|
10617
|
+
const m2 = module;
|
|
10618
|
+
const missing3 = [];
|
|
10619
|
+
if (!m2.config) missing3.push("config");
|
|
10620
|
+
if (typeof m2.homeScreenId !== "string") missing3.push("homeScreenId");
|
|
10621
|
+
const screens = m2.screens;
|
|
10622
|
+
if (!screens || typeof screens !== "object") missing3.push("screens.exact");
|
|
10623
|
+
else if (!screens.exact || typeof screens.exact !== "object") missing3.push("screens.exact");
|
|
10624
|
+
if (!Array.isArray(m2.actions)) missing3.push("actions");
|
|
10625
|
+
if (typeof m2.createStore !== "function") missing3.push("createStore");
|
|
10626
|
+
if (!m2.seed) missing3.push("seed");
|
|
10627
|
+
if (missing3.length === 0) return;
|
|
10628
|
+
throw new Error(appDevModuleShapeMessage(entry, missing3));
|
|
10629
|
+
}
|
|
10630
|
+
function appDevModuleShapeMessage(entry, missing3) {
|
|
10631
|
+
return `${entry}: the default export is not a complete AppDevModule \u2014 missing: ${missing3.join(", ")}. Required: ${REQUIRED_APP_DEV_MODULE_FIELDS.join(", ")}. See \`himi docs tier-5-add-a-screen\`.`;
|
|
10632
|
+
}
|
|
10631
10633
|
function isMetaSiteId(v2) {
|
|
10632
10634
|
return typeof v2 === "string" && META_SITE_ID.test(v2);
|
|
10633
10635
|
}
|
|
@@ -10690,10 +10692,11 @@ function servedPush(push) {
|
|
|
10690
10692
|
const { screens: _authoringOnly, ...served } = push;
|
|
10691
10693
|
return served;
|
|
10692
10694
|
}
|
|
10693
|
-
var META_SITE_ID;
|
|
10695
|
+
var REQUIRED_APP_DEV_MODULE_FIELDS, META_SITE_ID;
|
|
10694
10696
|
var init_app_module = __esm({
|
|
10695
10697
|
"../../core/dev-server/src/app-module.ts"() {
|
|
10696
10698
|
init_define_HHP_CATALOG();
|
|
10699
|
+
REQUIRED_APP_DEV_MODULE_FIELDS = ["config", "homeScreenId", "screens.exact", "actions", "createStore", "seed"];
|
|
10697
10700
|
META_SITE_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
10698
10701
|
}
|
|
10699
10702
|
});
|
|
@@ -12905,7 +12908,9 @@ function scrollLinkedIssues(visit, sl2, at2) {
|
|
|
12905
12908
|
const where = `${at2}.scrollLinked`;
|
|
12906
12909
|
const input = sl2.inputRange;
|
|
12907
12910
|
let inputOk = false;
|
|
12908
|
-
|
|
12911
|
+
const schemaTyped = ["payload", "stickyHeader", "stickyFooter"].includes(visit.path) && input !== void 0 && !finiteNumbers(input);
|
|
12912
|
+
if (schemaTyped) {
|
|
12913
|
+
} else if (!finiteNumbers(input) || input.length < 2) {
|
|
12909
12914
|
out2.push(issue(
|
|
12910
12915
|
"error",
|
|
12911
12916
|
"prop-values",
|
|
@@ -15892,6 +15897,7 @@ function webViewOriginAllowed(url, origins) {
|
|
|
15892
15897
|
}
|
|
15893
15898
|
var init_webview_origin = __esm({
|
|
15894
15899
|
"../../core/ts/src/webview-origin.ts"() {
|
|
15900
|
+
"use strict";
|
|
15895
15901
|
init_define_HHP_CATALOG();
|
|
15896
15902
|
}
|
|
15897
15903
|
});
|
|
@@ -22536,9 +22542,15 @@ async function loadContainedDevModule(name, entry, dir) {
|
|
|
22536
22542
|
const meta = crossed[CONTAINED_DEV_MODULE_SERVICE2]?.state?.meta;
|
|
22537
22543
|
if (!meta) {
|
|
22538
22544
|
throw new ContainedDevModuleUnloadable(
|
|
22539
|
-
`${entry} was evaluated in the contained realm but published no dev module
|
|
22545
|
+
`${entry} must default-export an AppDevModule (got undefined; it was evaluated in the contained realm but published no dev module).`
|
|
22540
22546
|
);
|
|
22541
22547
|
}
|
|
22548
|
+
if (meta.invalidExportType) {
|
|
22549
|
+
throw new ContainedDevModuleUnloadable(`${entry} must default-export an AppDevModule (got ${meta.invalidExportType}).`);
|
|
22550
|
+
}
|
|
22551
|
+
if (meta.missingFields?.length) {
|
|
22552
|
+
throw new ContainedDevModuleUnloadable(appDevModuleShapeMessage(entry, meta.missingFields));
|
|
22553
|
+
}
|
|
22542
22554
|
if (meta.ok === false) {
|
|
22543
22555
|
throw new ContainedDevModuleUnloadable(`${entry} could not be described by the contained realm: ${meta.error ?? "unknown"}`);
|
|
22544
22556
|
}
|
|
@@ -22647,6 +22659,7 @@ var init_contained_dev_module = __esm({
|
|
|
22647
22659
|
init_app_assets();
|
|
22648
22660
|
init_worker_console();
|
|
22649
22661
|
init_tier5_dir();
|
|
22662
|
+
init_app_module();
|
|
22650
22663
|
TIER5_ROOT = resolve15(fileURLToPath9(new URL("../tier5-bundles", import.meta.url)));
|
|
22651
22664
|
CONTAINED_DEV_BOOT_TIMEOUT_MS = 2e4;
|
|
22652
22665
|
CONTAINED_DEV_CALL_TIMEOUT_MS = 15e3;
|
|
@@ -23077,9 +23090,7 @@ async function importDevModule(name, entry, dir, fresh = false, sourceCopy = fal
|
|
|
23077
23090
|
throw new Error("Source-copy extraction is not supported in the contained dev-module realm; refusing to harvest localized stock as source copy.");
|
|
23078
23091
|
}
|
|
23079
23092
|
const module = devModuleRealm() === "contained" ? await loadContainedDevModule(name, entry, dir) : await importHostDevModule(entry, dir, fresh || sourceCopy, sourceCopy);
|
|
23080
|
-
|
|
23081
|
-
throw new Error(`${entry} must default-export an AppDevModule (got ${typeof module}).`);
|
|
23082
|
-
}
|
|
23093
|
+
assertAppDevModuleShape(entry, module);
|
|
23083
23094
|
return { name, module, meta: deriveAppMeta(name, module, readPlatformsJson(dir), readProvisioningFacts(dir)), dir };
|
|
23084
23095
|
}
|
|
23085
23096
|
async function importHostDevModule(entry, dir, fresh, sourceCopy = false) {
|
|
@@ -29928,7 +29939,6 @@ function resolveIdiom(tokens2, ctx = {}) {
|
|
|
29928
29939
|
var IDIOM_CONTEXTS, UNSAFE_KEYS;
|
|
29929
29940
|
var init_idiom = __esm({
|
|
29930
29941
|
"../../core/ts/src/idiom.ts"() {
|
|
29931
|
-
"use strict";
|
|
29932
29942
|
init_define_HHP_CATALOG();
|
|
29933
29943
|
IDIOM_CONTEXTS = {
|
|
29934
29944
|
ios: { native: ["ios"] },
|
|
@@ -29953,18 +29963,20 @@ function controlIdiomFor(context) {
|
|
|
29953
29963
|
function idiomControls(idiom) {
|
|
29954
29964
|
return idiom != null && Object.hasOwn(IDIOM_CONTROLS, idiom) ? IDIOM_CONTROLS[idiom] : IDIOM_CONTROLS.base;
|
|
29955
29965
|
}
|
|
29956
|
-
var STOCK_ROLES, FILLED_SEGMENT_ROLES, IDIOM_CONTROLS;
|
|
29966
|
+
var STOCK_ROLES, FILLED_SEGMENT_ROLES, GROUPED_SECTION, IDIOM_CONTROLS;
|
|
29957
29967
|
var init_idiom_controls = __esm({
|
|
29958
29968
|
"../../core/web-renderer/src/idiom-controls.ts"() {
|
|
29959
29969
|
init_define_HHP_CATALOG();
|
|
29960
29970
|
STOCK_ROLES = { onThumb: null, offTrack: "surfaceTertiary", offThumb: null, outline: null };
|
|
29961
29971
|
FILLED_SEGMENT_ROLES = { outline: "border", inactive: "surfaceTertiary" };
|
|
29972
|
+
GROUPED_SECTION = { headerCase: "upper", headerColor: "textSecondary", headerSize: 12, headerWeight: 600, headerLetterSpacing: 0.4, fill: "surfacePrimary", outline: 1, radius: 12 };
|
|
29962
29973
|
IDIOM_CONTROLS = {
|
|
29963
29974
|
// The web's own look — today's values, unchanged.
|
|
29964
29975
|
base: {
|
|
29965
29976
|
font: { defaultStack: '"Wix Madefor Text", system-ui', system: null, bundled: null, faithfulOn: "any" },
|
|
29966
29977
|
switch: { width: 51, height: 31, thumbOn: 27, thumbOff: 27, outline: 0, roles: STOCK_ROLES, thumbShadow: true },
|
|
29967
29978
|
segmented: { height: 50, trackPadding: 3, trackRadius: null, segmentRadius: null, outlined: false, selectedCheck: false, roles: FILLED_SEGMENT_ROLES },
|
|
29979
|
+
section: GROUPED_SECTION,
|
|
29968
29980
|
sheet: { cornerRadius: 16, grabberWidth: 36, grabberHeight: 5 },
|
|
29969
29981
|
navBar: { rootTitle: "inline", pushedTitle: "inline", back: "chevron", inlineTitleSize: 15, largeTitleSize: 15, hideWithStickyChrome: false },
|
|
29970
29982
|
press: { button: "none", tappable: "none", highlightOpacity: 1, stateLayerOpacity: 0 },
|
|
@@ -29981,6 +29993,7 @@ var init_idiom_controls = __esm({
|
|
|
29981
29993
|
switch: { width: 51, height: 31, thumbOn: 27, thumbOff: 27, outline: 0, roles: STOCK_ROLES, thumbShadow: true },
|
|
29982
29994
|
// UISegmentedControl: 32pt tall, a 2pt-inset selected segment inside a filled track.
|
|
29983
29995
|
segmented: { height: 32, trackPadding: 2, trackRadius: 9, segmentRadius: 7, outlined: false, selectedCheck: false, roles: FILLED_SEGMENT_ROLES },
|
|
29996
|
+
section: GROUPED_SECTION,
|
|
29984
29997
|
// UISheetPresentationController: a 36×5 grabber and 10pt top corners (iOS 15–18).
|
|
29985
29998
|
sheet: { cornerRadius: 10, grabberWidth: 36, grabberHeight: 5 },
|
|
29986
29999
|
// NavigationStack: a large title on the root screen, inline once pushed, and NO bar when the
|
|
@@ -30033,6 +30046,10 @@ var init_idiom_controls = __esm({
|
|
|
30033
30046
|
selectedCheck: true,
|
|
30034
30047
|
roles: { outline: ["border", "surfaceTertiary", "surfaceSecondary", "surfacePrimary"], inactive: ["surfaceTertiary", "surfaceSecondary", "surfacePrimary"] }
|
|
30035
30048
|
},
|
|
30049
|
+
// SDUISection: a Material 3 Expressive settings group, as Android 16 Settings draws one — a
|
|
30050
|
+
// sentence-case subheader in the primary colour (titleSmall, 14sp medium) over a tonal
|
|
30051
|
+
// container (surfaceContainer → surfaceSecondary, HimalayaMaterialTheme) with no outline.
|
|
30052
|
+
section: { headerCase: "none", headerColor: "accentPrimary", headerSize: 14, headerWeight: 500, headerLetterSpacing: 0.1, fill: ["surfaceSecondary", "surfacePrimary"], outline: 0, radius: 20 },
|
|
30036
30053
|
// ModalBottomSheet + BottomSheetDefaults.DragHandle: a 32×4 handle, 28dp top corners.
|
|
30037
30054
|
sheet: { cornerRadius: 28, grabberWidth: 32, grabberHeight: 4 },
|
|
30038
30055
|
// HimalayaAppShell draws NO title bar — a floating ArrowBack IconButton, the title unused.
|
|
@@ -128501,9 +128518,11 @@ function renderInner(node3, ctx) {
|
|
|
128501
128518
|
// ───────────── structure & disclosure (RFC 0031) ─────────────
|
|
128502
128519
|
case "Section": {
|
|
128503
128520
|
const inset2 = props2.inset === true;
|
|
128521
|
+
const sec = idiomControls(ctx.idiom).section;
|
|
128522
|
+
const role = (r3) => pickRole(ctx.tokens.colors, r3);
|
|
128504
128523
|
return /* @__PURE__ */ jsxs10("div", { style: { display: "flex", flexDirection: "column", width: "100%", boxSizing: "border-box", ...wrap }, children: [
|
|
128505
|
-
props2.header != null && /* @__PURE__ */ jsx12("div", { style: { fontFamily: bodyFont(ctx), fontSize: pxToRem(
|
|
128506
|
-
/* @__PURE__ */ jsx12("div", { style: inset2 ? { background: C2(
|
|
128524
|
+
props2.header != null && /* @__PURE__ */ jsx12("div", { style: { fontFamily: bodyFont(ctx), fontSize: pxToRem(sec.headerSize), fontWeight: sec.headerWeight, letterSpacing: sec.headerLetterSpacing, textTransform: sec.headerCase === "upper" ? "uppercase" : "none", color: C2(role(sec.headerColor), "#888"), padding: inset2 ? "0 4px 6px" : "6px 16px" }, children: txt(props2.header, ctx) }),
|
|
128525
|
+
/* @__PURE__ */ jsx12("div", { style: inset2 ? { background: C2(role(sec.fill), "#fff"), ...sec.outline > 0 ? { border: `${sec.outline}px solid ${C2("border", "#e8eaed")}` } : {}, borderRadius: sec.radius, overflow: "hidden", padding: "2px 14px", boxSizing: "border-box" } : void 0, children: kids2(props2.children, ctx) }),
|
|
128507
128526
|
props2.footer != null && /* @__PURE__ */ jsx12("div", { style: { fontFamily: bodyFont(ctx), fontSize: pxToRem(12), color: C2("textSecondary", "#888"), padding: inset2 ? "6px 4px 0" : "6px 16px" }, children: txt(props2.footer, ctx) })
|
|
128508
128527
|
] });
|
|
128509
128528
|
}
|
|
@@ -138511,7 +138530,8 @@ async function reloadAppModuleNow(state, opts) {
|
|
|
138511
138530
|
await lib.buildAppEntry(entry, outfile, { confineTo: current.dir, inputs });
|
|
138512
138531
|
const mod = await import(pathToFileURL5(outfile).href);
|
|
138513
138532
|
const next = mod.default;
|
|
138514
|
-
|
|
138533
|
+
assertAppDevModuleShape(entry, next);
|
|
138534
|
+
if (Object.keys(next.screens.exact).length === 0) {
|
|
138515
138535
|
throw new Error("freshly imported module is not a valid AppDevModule");
|
|
138516
138536
|
}
|
|
138517
138537
|
const oldMeta = current.meta;
|
|
@@ -187457,48 +187477,48 @@ var init_preview_assets_generated = __esm({
|
|
|
187457
187477
|
init_define_HHP_CATALOG();
|
|
187458
187478
|
init_preview_assets_format();
|
|
187459
187479
|
PREVIEW_ASSET_MANIFEST = [
|
|
187460
|
-
{ key: "assets/DashboardHost-
|
|
187461
|
-
{ key: "assets/DevDrawer-
|
|
187462
|
-
{ key: "assets/IdiomCompare-
|
|
187463
|
-
{ key: "assets/LightboxViewer-
|
|
187464
|
-
{ key: "assets/OfflineReadingBar-
|
|
187465
|
-
{ key: "assets/PhonePreviewControl-
|
|
187466
|
-
{ key: "assets/SchemeCompare-
|
|
187467
|
-
{ key: "assets/WixFrogTelemetrySink-
|
|
187480
|
+
{ key: "assets/DashboardHost-C7NgWR_I.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2971, sha256: "0f671123b1263a1e092b422bf41cf7c1c989125a92157f22f118d438e35c0f07" },
|
|
187481
|
+
{ key: "assets/DevDrawer-DXJObZXe.js", contentType: "application/javascript; charset=utf-8", offset: 2979, length: 16783, sha256: "b630575a1a020fe22d5c77f90a023d23212566ec6d1ba9c7e8563df91968622c" },
|
|
187482
|
+
{ key: "assets/IdiomCompare-BhFyn8Hc.js", contentType: "application/javascript; charset=utf-8", offset: 19762, length: 1926, sha256: "3aa6bfad15b5d10cf8a6a5364415e7a38730834d8acc1c5a63171d07068799e5" },
|
|
187483
|
+
{ key: "assets/LightboxViewer-D3Pk5IY4.js", contentType: "application/javascript; charset=utf-8", offset: 21688, length: 8171, sha256: "455821ac6479ff0669a874daadc8a9df2a8c1284dca80d2c231bb7c45f44a75c" },
|
|
187484
|
+
{ key: "assets/OfflineReadingBar-BJl_ZZ9T.js", contentType: "application/javascript; charset=utf-8", offset: 29859, length: 1707, sha256: "9d8bd62505b74252dd89c837d76582bafc79f3b54a508319b2a43b26838b8dda" },
|
|
187485
|
+
{ key: "assets/PhonePreviewControl-jCjzwLLv.js", contentType: "application/javascript; charset=utf-8", offset: 31566, length: 37851, sha256: "844843a49db745b762e8ac3377dae5476e3e120dcc1a5a6132d26fbbb0dccdc6" },
|
|
187486
|
+
{ key: "assets/SchemeCompare-B6_C9AHk.js", contentType: "application/javascript; charset=utf-8", offset: 69417, length: 1858, sha256: "e57904ddbcbafb32bfe203489368911c42796b47d29fa75a834a53ffbe0c22d9" },
|
|
187487
|
+
{ key: "assets/WixFrogTelemetrySink-SVoH8taa.js", contentType: "application/javascript; charset=utf-8", offset: 71275, length: 4492, sha256: "380a3e1b7aab467edb8d7a1c86d179eab0e5a931c5adae2d525cedaba726cd2a" },
|
|
187468
187488
|
{ key: "assets/calendar-ics-BvfIYWjG.js", contentType: "application/javascript; charset=utf-8", offset: 75767, length: 2192, sha256: "1636167041e9829ceccd3544297b86b8475c38bd2f759c4dbc17c813dc6e9254" },
|
|
187469
187489
|
{ key: "assets/catalog-CAoUWITw.js", contentType: "application/javascript; charset=utf-8", offset: 77959, length: 26046, sha256: "4c270ca3051f77d761aef1297125e02339d48493dd2b84a0cacf0faf41aa8cb3" },
|
|
187470
|
-
{ key: "assets/catalogFontFaces-
|
|
187490
|
+
{ key: "assets/catalogFontFaces-BvWS8pXE.js", contentType: "application/javascript; charset=utf-8", offset: 104005, length: 1111, sha256: "bb7d7ac7c488caa37ab96a3d286cbfb9751b8d8c4422006aee8727fbc2cb5dfb" },
|
|
187471
187491
|
{ key: "assets/contacts-vcard-BcohPQ0m.js", contentType: "application/javascript; charset=utf-8", offset: 105116, length: 2567, sha256: "c4ff75e96cd909bbb9182c5dc78794fcebc65139fbddef2537711d774fb33ad0" },
|
|
187472
|
-
{ key: "assets/files-transfer-
|
|
187473
|
-
{ key: "assets/frogApiRules-
|
|
187492
|
+
{ key: "assets/files-transfer-d7_Fb4VG.js", contentType: "application/javascript; charset=utf-8", offset: 107683, length: 6446, sha256: "bde8a606ae1e76d1594a9113440b4672dd5e9c4af61b38ec729a8470f3026be2" },
|
|
187493
|
+
{ key: "assets/frogApiRules-CLamKfpd.js", contentType: "application/javascript; charset=utf-8", offset: 114129, length: 2207, sha256: "20b38da11e78993663e203625862b2bc5b5f6295f4528d76845de36c89439694" },
|
|
187474
187494
|
{ key: "assets/glassPreviewBrowser-DONaOehd.js", contentType: "application/javascript; charset=utf-8", offset: 116336, length: 6578, sha256: "4402c4cddd2a564e7466cdf1e12a0e0277c0400b288e1e5eda1d23e797599d31" },
|
|
187475
187495
|
{ key: "assets/image-preparation-Cj4gldm6.js", contentType: "application/javascript; charset=utf-8", offset: 122914, length: 2704, sha256: "32944ea587c2f3b84389b66b50a850437560238f1c8d33b6275973ee04eee865" },
|
|
187476
|
-
{ key: "assets/index-
|
|
187477
|
-
{ key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
187478
|
-
{ key: "assets/pdf-
|
|
187479
|
-
{ key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
187480
|
-
{ key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset:
|
|
187481
|
-
{ key: "assets/pdfDocument-
|
|
187482
|
-
{ key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
187483
|
-
{ key: "assets/webviewBridgeHost-
|
|
187484
|
-
{ key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset:
|
|
187485
|
-
{ key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset:
|
|
187486
|
-
{ key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset:
|
|
187487
|
-
{ key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset:
|
|
187488
|
-
{ key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset:
|
|
187489
|
-
{ key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset:
|
|
187490
|
-
{ key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset:
|
|
187491
|
-
{ key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset:
|
|
187492
|
-
{ key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset:
|
|
187493
|
-
{ key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset:
|
|
187494
|
-
{ key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset:
|
|
187495
|
-
{ key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset:
|
|
187496
|
-
{ key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
187497
|
-
{ key: "index.html", contentType: "text/html; charset=utf-8", offset:
|
|
187498
|
-
{ key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset:
|
|
187499
|
-
{ key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset:
|
|
187500
|
-
{ key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset:
|
|
187501
|
-
{ key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset:
|
|
187496
|
+
{ key: "assets/index-BxJfz-MQ.js", contentType: "application/javascript; charset=utf-8", offset: 125618, length: 1532402, sha256: "b6009cd79cf82014e86b747dbe63240ce582150336062a9891961852b744b011" },
|
|
187497
|
+
{ key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1658020, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
|
|
187498
|
+
{ key: "assets/pdf-Bh7e0AqI.js", contentType: "application/javascript; charset=utf-8", offset: 1665771, length: 488215, sha256: "3361f61ce6b490c8b7b252658ea67f733d88c6e9f95906d0e31eea4827141df3" },
|
|
187499
|
+
{ key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2153986, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
|
|
187500
|
+
{ key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2154076, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
|
|
187501
|
+
{ key: "assets/pdfDocument-C1YEIvpY.js", contentType: "application/javascript; charset=utf-8", offset: 3471110, length: 3470, sha256: "f152f4715d749a4a3812c1c59963611a12cb88655ccd879b10125051304bbdc0" },
|
|
187502
|
+
{ key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3474580, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
|
|
187503
|
+
{ key: "assets/webviewBridgeHost-DG1j3hvC.js", contentType: "application/javascript; charset=utf-8", offset: 3476846, length: 9888, sha256: "1e62764832280cbe7ef20510607a7154d9de9775b6825c015cc799676cbe3650" },
|
|
187504
|
+
{ key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3486734, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
|
|
187505
|
+
{ key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3491344, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
|
|
187506
|
+
{ key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3979928, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
|
|
187507
|
+
{ key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4070852, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
|
|
187508
|
+
{ key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4161836, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
|
|
187509
|
+
{ key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4252816, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
|
|
187510
|
+
{ key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4343688, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
|
|
187511
|
+
{ key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4434668, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
|
|
187512
|
+
{ key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4543304, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
|
|
187513
|
+
{ key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4652388, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
|
|
187514
|
+
{ key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4761436, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
|
|
187515
|
+
{ key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4869136, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
|
|
187516
|
+
{ key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 4957244, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
|
|
187517
|
+
{ key: "index.html", contentType: "text/html; charset=utf-8", offset: 4964062, length: 4924, sha256: "3bd9d83d34671c88e8b6c3f1ce4488d023e70c04fc31657566e8971cfd46486c" },
|
|
187518
|
+
{ key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 4968986, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
|
|
187519
|
+
{ key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 4980443, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
|
|
187520
|
+
{ key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4981614, length: 23047, sha256: "20d1459e3f896f344e478e613d0c979a0de02e81a929a45d3a0ef6a53af36441" },
|
|
187521
|
+
{ key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5004661, length: 23064, sha256: "8655cfe9c74212ec5dafecb49d2fdeb48b19f1bd8a710091e3e55631f9b4ab06" }
|
|
187502
187522
|
];
|
|
187503
187523
|
}
|
|
187504
187524
|
});
|
|
@@ -216681,7 +216701,10 @@ async function pushCommand(ctx) {
|
|
|
216681
216701
|
print(pushFailure2(corrupted ? "attestation_history_corrupt" : "attestation_stale", {
|
|
216682
216702
|
ok: false,
|
|
216683
216703
|
pushed: false,
|
|
216704
|
+
// Stable `error` key (additive, alongside `code`): callers branch on it, never on prose.
|
|
216705
|
+
error: corrupted ? "attestation_history_corrupt" : "attestation_missing",
|
|
216684
216706
|
errors: attestationErrors,
|
|
216707
|
+
...drifting.length && !corrupted ? { driftingWorkers: drifting.map((worker) => worker.bundle) } : {},
|
|
216685
216708
|
hint: corrupted ? `attestation history in .himi/attestations/ is corrupt, so the retained runs cannot be trusted \u2014 a fresh run does not remove the bad entry. Delete .himi/attestations/, re-attest with ${remedy}, then re-run \`himi push\`. Only if you intend to publish WITHOUT that evidence, \`himi push --force\`.` : `no retained attestation for this release passed live verification${drifting.length ? `. ${releaseDriftCause(drifting, "Re-attesting", "an attestation")}, then re-attest` : " \u2014 runs recorded at this commit before your latest edits describe a tree that no longer exists. Re-attest"} the CURRENT release with ${remedy}, then re-run \`himi push\`. Only if you intend to publish WITHOUT that evidence, \`himi push --force\`.`
|
|
216686
216709
|
}));
|
|
216687
216710
|
return 1;
|
|
@@ -216691,6 +216714,7 @@ async function pushCommand(ctx) {
|
|
|
216691
216714
|
print(pushFailure2("headless_run_failed", {
|
|
216692
216715
|
ok: false,
|
|
216693
216716
|
pushed: false,
|
|
216717
|
+
error: "attestation_failed",
|
|
216694
216718
|
attestation,
|
|
216695
216719
|
hint: "the latest verified headless run failed \u2014 fix it and rerun the tool, or re-run `himi push --force` to publish anyway"
|
|
216696
216720
|
}));
|
|
Binary file
|
package/guides/android-ux.md
CHANGED
|
@@ -16,12 +16,15 @@ Material 3. Three things are native without any work from you, and you should no
|
|
|
16
16
|
segmented button, `Picker`/`DatePicker`/`Menu`/`BottomSheet`/`AlertDialog` the Material ones.
|
|
17
17
|
- **Your type scale:** typography tokens are emitted in `sp` and follow the user's font scale.
|
|
18
18
|
|
|
19
|
-
One thing it **cannot** do: give Android a different layout from iPhone. Lists
|
|
20
|
-
|
|
19
|
+
One thing it **cannot** do: give Android a different layout from iPhone. Lists and cards draw the
|
|
20
|
+
same on every renderer, and a `Section` keeps its structure. Only its look follows the platform:
|
|
21
|
+
on Android the header is a sentence-case subheader in the primary colour and an `inset` group is
|
|
22
|
+
a tonal Material 3 Expressive container with no outline, as Android 16 Settings draws one. Write
|
|
23
|
+
the `header` in sentence case; iPhone uppercases it. Choose one structure and say so
|
|
21
24
|
in `MOBILE-UX.md`. Per-platform *look* — type face, corner radius, spacing — is the
|
|
22
25
|
`material` token overlay (see **Idiom overlay** in `himi docs ios-ux`), not a second screen.
|
|
23
26
|
The overlay may change type face, radius and spacing; it may not change a brand colour.
|
|
24
|
-
`himi render --platform android` changes the switch, the segmented button, and the type face.
|
|
27
|
+
`himi render --platform android` changes the switch, the segmented button, the section look, and the type face.
|
|
25
28
|
A list or a grid looks the same in the iPhone PNG. That is one descriptor, not a failed render.
|
|
26
29
|
|
|
27
30
|
## Patterns
|
|
@@ -139,6 +139,13 @@ is a positional screen ID; use `--deep=<value>` to diagnose a nonnumeric depth.
|
|
|
139
139
|
|
|
140
140
|
## Push codes
|
|
141
141
|
|
|
142
|
+
The three attestation refusals also carry a stable top-level `error` key (additive; `code`,
|
|
143
|
+
`errors`, `hint` and `attestation` are unchanged): `attestation_missing` (code `attestation_stale`),
|
|
144
|
+
`attestation_history_corrupt` (same as its code) and `attestation_failed` (code `headless_run_failed`,
|
|
145
|
+
with the `attestation` summary). `attestation_missing` adds `driftingWorkers: string[]` when
|
|
146
|
+
nondeterministic workers mean re-attesting cannot clear the refusal; each entry names the
|
|
147
|
+
worker's bundle. These names are stable.
|
|
148
|
+
|
|
142
149
|
| Code | Meaning |
|
|
143
150
|
| --- | --- |
|
|
144
151
|
| `attestation_history_corrupt` | Retained attestation history failed integrity checks. Takes precedence if stale runs are also present. |
|
package/guides/ios-ux.md
CHANGED
|
@@ -16,8 +16,10 @@ native on iPhone without any work from you, and you should not redraw them:
|
|
|
16
16
|
control, `Picker`/`DatePicker`/`Menu`/`BottomSheet`/`AlertDialog` are the system ones.
|
|
17
17
|
- **Your type scale:** typography tokens scale with Dynamic Type.
|
|
18
18
|
|
|
19
|
-
One thing it **cannot** do: give iPhone a different layout from Android. Lists
|
|
20
|
-
|
|
19
|
+
One thing it **cannot** do: give iPhone a different layout from Android. Lists and cards draw the
|
|
20
|
+
same on every renderer, and a `Section` keeps its structure; only its look follows the platform
|
|
21
|
+
(an uppercase caption over an inset group here, a Material subheader over a tonal group on
|
|
22
|
+
Android). Write the `header` in sentence case. Choose one structure and say so
|
|
21
23
|
in `MOBILE-UX.md`; do not plan "inset grouped on iPhone, full-bleed on Android", because no Himi
|
|
22
24
|
screen can deliver it. Per-platform *look* — type face, corner radius, spacing — is a token
|
|
23
25
|
overlay (see **Idiom overlay** below), not a second screen. `himi render --platform ios` changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1638.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": "79db94e5ea0c093bd4b436068deef0babc41ee596c5cd3dc2e2c1d0c"
|
|
76
76
|
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// "Open a member-only screen" (the business chat): a member goes there; a guest gets the app's
|
|
2
|
+
// sign-in first, never the screen's own guest prompt, and the screen opens once signed in
|
|
3
|
+
// (himi-store-account resumes `returnScreenId`). Salon & Spa offers it from Home and from the
|
|
4
|
+
// shared booking screens (a treatment that cannot be booked online, a Choose a Time with no times),
|
|
5
|
+
// so each of those workers runs the same rule.
|
|
6
|
+
//
|
|
7
|
+
// The tap's params:
|
|
8
|
+
// screenId the member screen
|
|
9
|
+
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
|
+
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
|
+
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
12
|
+
// the sign-in pushes the screen itself.
|
|
13
|
+
// returnTab the tab the screen opens on after a modal sign-in
|
|
14
|
+
//
|
|
15
|
+
// A modal sign-in also carries a host-held continuation (`authContinuation`, begun here for
|
|
16
|
+
// `memberScreenTarget(screenId)`). Where the account change of the sign-in replaces the sign-in
|
|
17
|
+
// worker before it can resume (Android), the replacement consumes it to open the screen, once.
|
|
18
|
+
// A route alone never opens a member screen; old hosts without the contract keep the plain sheet.
|
|
19
|
+
import { dispatch } from "@himalaya/dispatch";
|
|
20
|
+
import type { NavDirective } from "@himalaya/state";
|
|
21
|
+
import { signedInEmail } from "./himi-account.js";
|
|
22
|
+
|
|
23
|
+
/** How long a continuation call may take before the worker goes on without it. Just above the web
|
|
24
|
+
* host's own 4 s identity-read deadline (identityReader.ts), which it runs before answering: a host
|
|
25
|
+
* that answers is never cut off, and one that never answers cannot hold the sheet or the form. */
|
|
26
|
+
export const CONTINUATION_BUDGET_MS = 4_500;
|
|
27
|
+
/** The whole tap (session read, then begin) waits at most this long. On the web host each call runs
|
|
28
|
+
* its own identity read, so a hung host would otherwise cost two full deadlines (~8 s) before the
|
|
29
|
+
* sheet. The session read may use the host's whole deadline; begin then gets what is left, but at
|
|
30
|
+
* least an ordinary read's 1.5 s, so a slow host (2.5 s a read) still hands out the token. */
|
|
31
|
+
const TAP_BUDGET_MS = CONTINUATION_BUDGET_MS + 1_500;
|
|
32
|
+
const MIN_BEGIN_MS = 1_500;
|
|
33
|
+
|
|
34
|
+
/** The continuation target for a member screen, shared with himi-store-account. */
|
|
35
|
+
export const memberScreenTarget = (screenId: string): string => `member_screen:${screenId}`;
|
|
36
|
+
|
|
37
|
+
/** A host-held continuation for `screenId`, or "" (an old host, or a member already). */
|
|
38
|
+
async function beginContinuation(screenId: string): Promise<string> {
|
|
39
|
+
try {
|
|
40
|
+
const value = await dispatch("himi.wix.authContinuation", { operation: "begin", target: memberScreenTarget(screenId) }) as
|
|
41
|
+
{ supported?: unknown; token?: unknown; payload?: { supported?: unknown; token?: unknown } } | null;
|
|
42
|
+
const fields = value?.payload ?? value;
|
|
43
|
+
return fields?.supported === true && typeof fields.token === "string" ? fields.token : "";
|
|
44
|
+
} catch {
|
|
45
|
+
return "";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const strField = (arg: unknown, key: string): string => {
|
|
50
|
+
const value = (arg as Record<string, unknown> | undefined)?.[key];
|
|
51
|
+
return typeof value === "string" ? value : "";
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** `read`, or `fallback` once `ms` pass, where the engine has a timer. A bare JSContext has no
|
|
55
|
+
* timer; there it waits, as every read does. `read` must not reject. */
|
|
56
|
+
export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T> {
|
|
57
|
+
const host = globalThis as { setTimeout?: (fn: () => void, ms: number) => unknown; clearTimeout?: (timer: unknown) => void };
|
|
58
|
+
if (typeof host.setTimeout !== "function") return read;
|
|
59
|
+
return new Promise<T>((resolve) => {
|
|
60
|
+
const timer = host.setTimeout!(() => resolve(fallback), ms);
|
|
61
|
+
void read.then((value) => { host.clearTimeout?.(timer); resolve(value); });
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
|
+
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
68
|
+
if (!screenId) return null;
|
|
69
|
+
if (!signInScreenId || email) return { screenId };
|
|
70
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
const presentation = strField(arg, "signInPresentation");
|
|
72
|
+
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
|
+
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
74
|
+
return { screenId: signInScreenId, presentation, args: { ...args, modal: "1" } };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** One worker's opener. The session is asked at the tap, never read from the last load; a read
|
|
78
|
+
* that never answers counts as a guest, so the tap opens the sign-in rather than nothing. Only the
|
|
79
|
+
* newest tap navigates (no second sheet, no sheet over the screen): an older one answers null. */
|
|
80
|
+
// The session read has the continuation calls' budget: on the web host they all wait on the same
|
|
81
|
+
// identity read, so a shorter cutoff here would take a slow member for a guest and flash the sheet.
|
|
82
|
+
export function memberScreenOpener(readEmail: () => Promise<string> = () => within(signedInEmail(), CONTINUATION_BUDGET_MS, "")): (arg: unknown) => Promise<NavDirective | null> {
|
|
83
|
+
let taps = 0;
|
|
84
|
+
return async (arg) => {
|
|
85
|
+
if (!strField(arg, "screenId")) return null;
|
|
86
|
+
const mine = ++taps;
|
|
87
|
+
const tapped = Date.now();
|
|
88
|
+
const email = strField(arg, "signInScreenId") ? await readEmail() : "";
|
|
89
|
+
if (mine !== taps) return null;
|
|
90
|
+
const nav = memberScreenNav(arg, email);
|
|
91
|
+
if (!nav || !("presentation" in nav) || !nav.args?.modal) return nav;
|
|
92
|
+
// Bounded by what the tap has left (TAP_BUDGET_MS): a host that never answers still opens the
|
|
93
|
+
// plain sheet.
|
|
94
|
+
const left = Math.min(CONTINUATION_BUDGET_MS, Math.max(MIN_BEGIN_MS, TAP_BUDGET_MS - (Date.now() - tapped)));
|
|
95
|
+
const token = await within(beginContinuation(strField(arg, "screenId")), left, "");
|
|
96
|
+
if (mine !== taps) return null;
|
|
97
|
+
return token ? { ...nav, args: { ...nav.args, authContinuation: token } } : nav;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -14,6 +14,7 @@ import { getService, queryServiceAvailability, registerToWaitlist, type WixAvail
|
|
|
14
14
|
import { getMyMember } from "@himalaya/wix-members";
|
|
15
15
|
import { memberAccess, type MemberAccess } from "../_shared/member-access.js";
|
|
16
16
|
import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
|
|
17
|
+
import { memberScreenOpener } from "../_shared/member-screen.js";
|
|
17
18
|
import { placesIn, sessionControl, sessionOf, type MemberPlace, type Session, type SessionControl } from "../_shared/booking-session.js";
|
|
18
19
|
import { categoryName, courseDatesText, courseReadWindows, courseSessionsAvailability, courseWindowOpen, serviceDurationText, servicePriceLine, slotStartInstant, type BookingLabel, type ServicePriceLine } from "../_shared/himi-bookings.js";
|
|
19
20
|
import { formatServiceMoney, serviceCurrency } from "../_shared/wix-service-price.js";
|
|
@@ -910,6 +911,7 @@ function tappedIndex(arg: unknown): number {
|
|
|
910
911
|
}
|
|
911
912
|
|
|
912
913
|
const id = inputId();
|
|
914
|
+
const openMemberScreen = memberScreenOpener();
|
|
913
915
|
const svc = defineService<S, {
|
|
914
916
|
load: (s: S, arg?: unknown) => Promise<S>;
|
|
915
917
|
share: (s: S) => Promise<S>;
|
|
@@ -922,6 +924,7 @@ const svc = defineService<S, {
|
|
|
922
924
|
changeTime: (s: S) => S;
|
|
923
925
|
joinWaitlist: (s: S, arg?: unknown) => Promise<S>;
|
|
924
926
|
toggleSaved: (s: S) => S;
|
|
927
|
+
openForMember: (s: S, arg?: unknown) => Promise<S>;
|
|
925
928
|
}>("himiBookingService", {
|
|
926
929
|
// A join's outcome belongs to that visit: a cold start must not replay it from saved state.
|
|
927
930
|
notHydrated: ["sessionMessage", "sessionMessageOk", "sessionMessageFailed", "noSessionMessage", "saveMessage"],
|
|
@@ -1111,6 +1114,13 @@ const svc = defineService<S, {
|
|
|
1111
1114
|
// The footer button opens the time screen for the loaded service. A worker directive,
|
|
1112
1115
|
// not a `himi.open` with a `$service:` id param: the iOS and Android sticky footers
|
|
1113
1116
|
// dispatch their taps without resolving `$service:` params, so the id never arrived.
|
|
1117
|
+
// "Contact us" on a treatment that cannot be booked online, where the app's contact screen is
|
|
1118
|
+
// for members (Salon & Spa's chat): a guest signs in first (_shared/member-screen.ts).
|
|
1119
|
+
openForMember: async (s, arg): Promise<S> => {
|
|
1120
|
+
const nav = await openMemberScreen(arg);
|
|
1121
|
+
const current: S = svc.getState?.() ?? s;
|
|
1122
|
+
return nav ? navigate(current, nav) : current;
|
|
1123
|
+
},
|
|
1114
1124
|
chooseTime: (s) => (s.id && s.hasService ? navigate(s, { screenId: "himi_time", args: { id: s.id, ...(s.isCourse ? { course: "true" } : {}) } }) : s),
|
|
1115
1125
|
// Book the session the screen opened on: Choose Time opens with it picked — the Agenda row's
|
|
1116
1126
|
// own Book (`{ id, start, sessionId }`), so the member does not choose the time again.
|