@wix/himalaya-cli 0.1524.0 → 0.1526.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/builder.d.ts +14 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +22 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/worker-subtree-safe-types.generated.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +5 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/cashier-charges.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +7 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +35 -9
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +14 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +34 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +13 -0
- package/dist/cli.mjs +136 -39
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/designing-himi-screens.md +43 -18
- package/guides/recipe-dynamic-list.md +7 -7
- package/guides/recipe-four-state.md +47 -41
- package/guides/recipe-search.md +1 -1
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +69 -40
- package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +9 -1
- package/templates/beauty-salon/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +153 -132
- package/templates/branded-lite/dev/index.ts +165 -88
- package/templates/branded-lite/tier5-src/business-chat/index.ts +4 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +9 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/branded-lite/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/branded-lite/tier5-src/himi-store-product/index.ts +153 -132
- package/templates/community-club/dev/index.ts +40 -21
- package/templates/community-club/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/events-meetups/dev/index.ts +36 -19
- package/templates/events-meetups/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/gym-fitness/dev/index.ts +73 -42
- package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +9 -1
- package/templates/gym-fitness/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +153 -132
- package/templates/nonprofit-cause/dev/index.ts +47 -29
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/podcast-creator/dev/index.ts +47 -29
- package/templates/podcast-creator/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/portfolio-creative/dev/index.ts +52 -27
- package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +153 -132
- package/templates/restaurant/dev/index.ts +48 -25
- package/templates/restaurant/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/retail-store/dev/index.ts +44 -23
- package/templates/retail-store/tier5-src/himi-store-account/index.ts +69 -10
- package/templates/retail-store/tier5-src/himi-store-product/index.ts +153 -132
- package/templates/yoga-studio/dev/index.ts +57 -34
- package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +9 -1
- package/templates/yoga-studio/tier5-src/himi-branded-lite-place-summary/index.ts +12 -1
- package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +69 -10
|
@@ -93,6 +93,25 @@ function productPolicyBody(product: StoreProduct, kind: "returns" | "shipping"):
|
|
|
93
93
|
* DIFFERENT product (drop the picks) from the same product coming back (keep them). */
|
|
94
94
|
let lastLoadedId: string | undefined;
|
|
95
95
|
let productLoadSequence = 0;
|
|
96
|
+
let booting = true;
|
|
97
|
+
let bootLoad: { id: string; state: Promise<S> } | undefined;
|
|
98
|
+
|
|
99
|
+
/** The host replays the screen's onAppear load right after the module-scope one: that one replay
|
|
100
|
+
* joins the boot load instead of reading the product, cart and App Store prices again. Any later
|
|
101
|
+
* entry loads afresh, since the cart, the saved flag or a purchase may have changed meanwhile. */
|
|
102
|
+
function joinedLoad(id: string, load: () => Promise<S>): Promise<S> {
|
|
103
|
+
if (booting) {
|
|
104
|
+
booting = false;
|
|
105
|
+
const current = { id, state: load() };
|
|
106
|
+
bootLoad = current;
|
|
107
|
+
const settle = () => { if (bootLoad === current) bootLoad = undefined; };
|
|
108
|
+
current.state.then(settle, settle);
|
|
109
|
+
return current.state;
|
|
110
|
+
}
|
|
111
|
+
const replayed = bootLoad;
|
|
112
|
+
bootLoad = undefined;
|
|
113
|
+
return replayed?.id === id ? replayed.state : load();
|
|
114
|
+
}
|
|
96
115
|
|
|
97
116
|
interface OptionSlots {
|
|
98
117
|
opt1Label: string; opt1Chips: OptionChip[]; opt1Selected: string[]; opt1SelectedId: string; opt1Placeholder: string; noOpt1: boolean;
|
|
@@ -576,144 +595,146 @@ const svc = defineService<S, {
|
|
|
576
595
|
purchasedNote: "",
|
|
577
596
|
}),
|
|
578
597
|
actions: {
|
|
579
|
-
load:
|
|
598
|
+
load: (s, arg): Promise<S> => {
|
|
580
599
|
stashCopy(arg);
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
const id = inputId();
|
|
585
|
-
// Storage problems must not prevent browsing or buying a product.
|
|
586
|
-
let saved = false;
|
|
587
|
-
try { saved = isProductSaved(id); } catch { /* save action reports a retryable error */ }
|
|
588
|
-
s = { ...s, saved, saveHint: "", shareHint: "", adding: false, added: false, addedSheetPresented: false, quantity: 1, showOptionErrors: false, returnPolicyExpanded: false, shippingInfoExpanded: false };
|
|
589
|
-
// A fresh navigation into the product resets any quantity left over
|
|
590
|
-
// from a previous visit to the same worker instance.
|
|
591
|
-
if (!id) {
|
|
600
|
+
return joinedLoad(inputId(), async (): Promise<S> => {
|
|
601
|
+
enterCheckout();
|
|
602
|
+
const sequence = ++productLoadSequence;
|
|
592
603
|
lastProduct = undefined;
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
604
|
+
const id = inputId();
|
|
605
|
+
// Storage problems must not prevent browsing or buying a product.
|
|
606
|
+
let saved = false;
|
|
607
|
+
try { saved = isProductSaved(id); } catch { /* save action reports a retryable error */ }
|
|
608
|
+
s = { ...s, saved, saveHint: "", shareHint: "", adding: false, added: false, addedSheetPresented: false, quantity: 1, showOptionErrors: false, returnPolicyExpanded: false, shippingInfoExpanded: false };
|
|
609
|
+
// A fresh navigation into the product resets any quantity left over
|
|
610
|
+
// from a previous visit to the same worker instance.
|
|
611
|
+
if (!id) {
|
|
612
|
+
lastProduct = undefined;
|
|
613
|
+
lastLoadedId = undefined;
|
|
614
|
+
return derive({ ...s, status: "ready", quantity: 1, optionGroups: [], selection: {}, optionsUnknown: false, descriptionJson: "", emptyText: copyParam("product.notFoundText", "Product not found.") });
|
|
615
|
+
}
|
|
616
|
+
// The cart count only feeds the top-bar badge: ask for it NOW, beside the product, instead
|
|
617
|
+
// of after it — it used to add a whole cart round trip before the page could paint.
|
|
618
|
+
const cartCount = cartItemCount();
|
|
619
|
+
// The badge must never hold the page: remember the count if it is already in, and
|
|
620
|
+
// publish it separately if it lands after the product (#3468 review).
|
|
621
|
+
let cartKnown: number | undefined;
|
|
622
|
+
void cartCount.then((n) => { cartKnown = n; }, () => {});
|
|
623
|
+
// The live product read goes out FIRST too — the local-db read below must never delay it.
|
|
624
|
+
// Settled into a value so a failure is handled where it is awaited, never unhandled.
|
|
625
|
+
// DESCRIPTION widens the default fieldset with the V3 Ricos description (a V1 catalog ignores it).
|
|
626
|
+
const live = getStoreProduct(id, ["DESCRIPTION"]).then(
|
|
627
|
+
(r) => ({ ok: true as const, r }),
|
|
628
|
+
() => ({ ok: false as const }),
|
|
629
|
+
);
|
|
630
|
+
// Paint at once from the row the list already synced (name, price, image) — the page used
|
|
631
|
+
// to sit on its skeleton for the product round trip even when the list had just shown it.
|
|
632
|
+
// The live read then fills in the description and gallery.
|
|
633
|
+
const synced = await readCachedProduct(id);
|
|
634
|
+
let painted = false;
|
|
635
|
+
if (synced && s.status === "loading") {
|
|
636
|
+
await svc.paintCached(synced);
|
|
637
|
+
painted = true;
|
|
638
|
+
}
|
|
639
|
+
const outcome = await live;
|
|
640
|
+
if (sequence !== productLoadSequence || id !== inputId()) return svc.getState() as S;
|
|
641
|
+
// Once painted the page is INTERACTIVE while the live read is on the wire: the visitor may
|
|
642
|
+
// save, change the quantity or add to cart. Build on the state as it is NOW, and keep what
|
|
643
|
+
// they did — overwriting it would untick a stored save, reset the quantity, and drop the
|
|
644
|
+
// in-flight add's `adding` guard (a second tap would add the line twice).
|
|
645
|
+
const base: S = painted ? (svc.getState() as S) : s;
|
|
646
|
+
const keep = painted
|
|
647
|
+
? { saved: base.saved, saveHint: base.saveHint, quantity: base.quantity, adding: base.adding, added: base.added, cartHint: base.cartHint }
|
|
648
|
+
: { cartHint: "", quantity: 1 };
|
|
649
|
+
const badge = (): number => {
|
|
650
|
+
if (painted && (base.adding || base.added)) return base.cartCount;
|
|
651
|
+
if (cartKnown !== undefined) return cartKnown;
|
|
652
|
+
const epoch = cartBadgeEpoch;
|
|
653
|
+
void cartCount.then((n) => { void svc.setCartCount({ count: n, epoch }); }, () => {});
|
|
654
|
+
return base.cartCount;
|
|
655
|
+
};
|
|
656
|
+
if (outcome.ok) {
|
|
657
|
+
const p = (outcome.r.product ?? (outcome.r as unknown as StoreProduct)) as StoreProduct;
|
|
658
|
+
const name = cleanTitle(p.name) || "Product";
|
|
659
|
+
const image = productImage(p, WIX_DETAIL_IMAGE);
|
|
660
|
+
lastProduct = p;
|
|
661
|
+
// A group with exactly one choice is chosen for the shopper; a real choice
|
|
662
|
+
// is left blank so the pick is deliberate.
|
|
663
|
+
const optionGroups = productOptions(p);
|
|
664
|
+
const sale = productSale(p);
|
|
665
|
+
// A pooled screen re-appearing re-runs `load`. Wiping `selection` there means a
|
|
666
|
+
// trip to the cart and back silently clears the size the shopper picked and
|
|
667
|
+
// re-disables the CTA with no explanation. Carry the picks when this is the SAME
|
|
668
|
+
// product, and only for a choice the product still offers — a stale id would
|
|
669
|
+
// resolve to no variant and block the cart just as silently.
|
|
670
|
+
const carried: StoreOptionSelection = {};
|
|
671
|
+
if (id === lastLoadedId) {
|
|
672
|
+
for (const g of optionGroups) {
|
|
673
|
+
const chosen = s.selection[g.id];
|
|
674
|
+
if (chosen && g.choices.some((c) => c.id === chosen)) carried[g.id] = chosen;
|
|
675
|
+
}
|
|
655
676
|
}
|
|
677
|
+
lastLoadedId = id;
|
|
678
|
+
return derive({
|
|
679
|
+
...base,
|
|
680
|
+
...keep,
|
|
681
|
+
status: "ready",
|
|
682
|
+
optionGroups,
|
|
683
|
+
selection: { ...defaultSelection(optionGroups), ...carried },
|
|
684
|
+
optionsUnknown: false,
|
|
685
|
+
name,
|
|
686
|
+
...sale,
|
|
687
|
+
commercePrice: sale.price,
|
|
688
|
+
skuLabel: skuOf(p) ? `SKU: ${skuOf(p)}` : "",
|
|
689
|
+
returnPolicyBody: productPolicyBody(p, "returns") || copyParam("product.returnPolicyBody", "") || copyParam("product.policyUnavailable", "Policy details have not been provided by this store."),
|
|
690
|
+
shippingInfoBody: productPolicyBody(p, "shipping") || copyParam("product.shippingInfoBody", "") || copyParam("product.policyUnavailable", "Policy details have not been provided by this store."),
|
|
691
|
+
...productBody(p),
|
|
692
|
+
image,
|
|
693
|
+
gallery: productGallery(p),
|
|
694
|
+
initial: (name[0] || "#").toUpperCase(),
|
|
695
|
+
shareUrl: productShareUrl(p),
|
|
696
|
+
cartCount: badge(),
|
|
697
|
+
emptyText: "",
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
// Offline: fall back to the last-synced cached product row before the error state.
|
|
701
|
+
if (synced) {
|
|
702
|
+
const name = String(synced.name ?? "") || "Product";
|
|
703
|
+
const image = String(synced.image ?? "");
|
|
704
|
+
// The cached list row carries no options, and guessing "none" would offer
|
|
705
|
+
// a one-tap Add to cart for a product that needs a colour and a size. So
|
|
706
|
+
// the offline detail shows no picker AND marks the options UNKNOWN, which
|
|
707
|
+
// keeps `optionsIncomplete` true: the CTA stays disabled and `addToCart`
|
|
708
|
+
// refuses. `cartHint` carries the reason, because the options card is hidden
|
|
709
|
+
// on `noOptions` and would otherwise leave a dead button unexplained.
|
|
710
|
+
lastProduct = undefined;
|
|
711
|
+
lastLoadedId = undefined;
|
|
712
|
+
return derive({
|
|
713
|
+
...base,
|
|
714
|
+
...keep,
|
|
715
|
+
status: "ready",
|
|
716
|
+
optionGroups: [],
|
|
717
|
+
selection: {},
|
|
718
|
+
optionsUnknown: true,
|
|
719
|
+
name,
|
|
720
|
+
price: String(synced.subtitle ?? ""),
|
|
721
|
+
wasPrice: "",
|
|
722
|
+
skuLabel: "",
|
|
723
|
+
returnPolicyBody: "",
|
|
724
|
+
shippingInfoBody: "",
|
|
725
|
+
description: "",
|
|
726
|
+
descriptionJson: "",
|
|
727
|
+
image,
|
|
728
|
+
initial: String(synced.initial ?? "") || (name[0] || "#").toUpperCase(),
|
|
729
|
+
cartHint: copyParam("product.cartHintOffline", "Reconnect to choose options and add this to your cart."),
|
|
730
|
+
cartCount: badge(),
|
|
731
|
+
emptyText: "",
|
|
732
|
+
});
|
|
656
733
|
}
|
|
657
|
-
lastLoadedId = id;
|
|
658
|
-
return derive({
|
|
659
|
-
...base,
|
|
660
|
-
...keep,
|
|
661
|
-
status: "ready",
|
|
662
|
-
optionGroups,
|
|
663
|
-
selection: { ...defaultSelection(optionGroups), ...carried },
|
|
664
|
-
optionsUnknown: false,
|
|
665
|
-
name,
|
|
666
|
-
...sale,
|
|
667
|
-
commercePrice: sale.price,
|
|
668
|
-
skuLabel: skuOf(p) ? `SKU: ${skuOf(p)}` : "",
|
|
669
|
-
returnPolicyBody: productPolicyBody(p, "returns") || copyParam("product.returnPolicyBody", "") || copyParam("product.policyUnavailable", "Policy details have not been provided by this store."),
|
|
670
|
-
shippingInfoBody: productPolicyBody(p, "shipping") || copyParam("product.shippingInfoBody", "") || copyParam("product.policyUnavailable", "Policy details have not been provided by this store."),
|
|
671
|
-
...productBody(p),
|
|
672
|
-
image,
|
|
673
|
-
gallery: productGallery(p),
|
|
674
|
-
initial: (name[0] || "#").toUpperCase(),
|
|
675
|
-
shareUrl: productShareUrl(p),
|
|
676
|
-
cartCount: badge(),
|
|
677
|
-
emptyText: "",
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
// Offline: fall back to the last-synced cached product row before the error state.
|
|
681
|
-
if (synced) {
|
|
682
|
-
const name = String(synced.name ?? "") || "Product";
|
|
683
|
-
const image = String(synced.image ?? "");
|
|
684
|
-
// The cached list row carries no options, and guessing "none" would offer
|
|
685
|
-
// a one-tap Add to cart for a product that needs a colour and a size. So
|
|
686
|
-
// the offline detail shows no picker AND marks the options UNKNOWN, which
|
|
687
|
-
// keeps `optionsIncomplete` true: the CTA stays disabled and `addToCart`
|
|
688
|
-
// refuses. `cartHint` carries the reason, because the options card is hidden
|
|
689
|
-
// on `noOptions` and would otherwise leave a dead button unexplained.
|
|
690
734
|
lastProduct = undefined;
|
|
691
735
|
lastLoadedId = undefined;
|
|
692
|
-
return derive({
|
|
693
|
-
|
|
694
|
-
...keep,
|
|
695
|
-
status: "ready",
|
|
696
|
-
optionGroups: [],
|
|
697
|
-
selection: {},
|
|
698
|
-
optionsUnknown: true,
|
|
699
|
-
name,
|
|
700
|
-
price: String(synced.subtitle ?? ""),
|
|
701
|
-
wasPrice: "",
|
|
702
|
-
skuLabel: "",
|
|
703
|
-
returnPolicyBody: "",
|
|
704
|
-
shippingInfoBody: "",
|
|
705
|
-
description: "",
|
|
706
|
-
descriptionJson: "",
|
|
707
|
-
image,
|
|
708
|
-
initial: String(synced.initial ?? "") || (name[0] || "#").toUpperCase(),
|
|
709
|
-
cartHint: copyParam("product.cartHintOffline", "Reconnect to choose options and add this to your cart."),
|
|
710
|
-
cartCount: badge(),
|
|
711
|
-
emptyText: "",
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
|
-
lastProduct = undefined;
|
|
715
|
-
lastLoadedId = undefined;
|
|
716
|
-
return derive({ ...s, status: "error", optionGroups: [], selection: {}, optionsUnknown: false, descriptionJson: "", emptyText: copyParam("product.errorText", "Product could not load.") });
|
|
736
|
+
return derive({ ...s, status: "error", optionGroups: [], selection: {}, optionsUnknown: false, descriptionJson: "", emptyText: copyParam("product.errorText", "Product could not load.") });
|
|
737
|
+
});
|
|
717
738
|
},
|
|
718
739
|
// The stepper fires onChange with { value } on every tap; clamp 1–99 and
|
|
719
740
|
// ignore unparsable/garbage args instead of silently zeroing the quantity.
|
|
@@ -2220,8 +2220,10 @@ const SCREENS = runtimeSetting({
|
|
|
2220
2220
|
"actionId": "himi.open",
|
|
2221
2221
|
"params": {
|
|
2222
2222
|
"screenId": "himi_sign_in",
|
|
2223
|
-
"mode": "signin"
|
|
2224
|
-
|
|
2223
|
+
"mode": "signin",
|
|
2224
|
+
"modal": "1"
|
|
2225
|
+
},
|
|
2226
|
+
"presentation": "sheet"
|
|
2225
2227
|
}
|
|
2226
2228
|
}
|
|
2227
2229
|
}
|
|
@@ -2239,8 +2241,10 @@ const SCREENS = runtimeSetting({
|
|
|
2239
2241
|
"actionId": "himi.open",
|
|
2240
2242
|
"params": {
|
|
2241
2243
|
"screenId": "himi_sign_in",
|
|
2242
|
-
"mode": "register"
|
|
2243
|
-
|
|
2244
|
+
"mode": "register",
|
|
2245
|
+
"modal": "1"
|
|
2246
|
+
},
|
|
2247
|
+
"presentation": "sheet"
|
|
2244
2248
|
}
|
|
2245
2249
|
}
|
|
2246
2250
|
}
|
|
@@ -3360,6 +3364,8 @@ const SCREENS = runtimeSetting({
|
|
|
3360
3364
|
"memberAccountLinks": "1",
|
|
3361
3365
|
"restorePurchases": "1",
|
|
3362
3366
|
"signInScreen": "himi_sign_in",
|
|
3367
|
+
"signInPresentation": "sheet",
|
|
3368
|
+
"signInReturnTab": "profile",
|
|
3363
3369
|
"pollIdentity": "1",
|
|
3364
3370
|
"copy": "{\"account.subtitle\":\"RSVPs, memberships, groups and saved content in one place.\",\"storeAccount.authBody\":\"Sign in to continue — RSVPs, memberships and groups stay with you.\",\"storeAccount.authBodyRegister\":\"Create a member account to continue — RSVPs, memberships and groups stay with you.\"}"
|
|
3365
3371
|
}
|
|
@@ -3615,8 +3621,10 @@ const SCREENS = runtimeSetting({
|
|
|
3615
3621
|
"params": {
|
|
3616
3622
|
"screenId": "himi_sign_in",
|
|
3617
3623
|
"mode": "signin",
|
|
3618
|
-
"returnScreenId": "himi_account_settings"
|
|
3619
|
-
|
|
3624
|
+
"returnScreenId": "himi_account_settings",
|
|
3625
|
+
"modal": "1"
|
|
3626
|
+
},
|
|
3627
|
+
"presentation": "sheet"
|
|
3620
3628
|
}
|
|
3621
3629
|
}
|
|
3622
3630
|
},
|
|
@@ -5526,8 +5534,7 @@ const SCREENS = runtimeSetting({
|
|
|
5526
5534
|
"style": "primary",
|
|
5527
5535
|
"fullWidth": true,
|
|
5528
5536
|
"action": {
|
|
5529
|
-
"actionId": "
|
|
5530
|
-
"presentation": "back"
|
|
5537
|
+
"actionId": "tier5.himiStoreAccount.leave"
|
|
5531
5538
|
}
|
|
5532
5539
|
}
|
|
5533
5540
|
}
|
|
@@ -5568,7 +5575,7 @@ const SCREENS = runtimeSetting({
|
|
|
5568
5575
|
"declaredCapabilities": [
|
|
5569
5576
|
"wix_api"
|
|
5570
5577
|
],
|
|
5571
|
-
"minBinaryVersion": "
|
|
5578
|
+
"minBinaryVersion": "1.7.0",
|
|
5572
5579
|
"bundleVersion": "0.0.1"
|
|
5573
5580
|
}
|
|
5574
5581
|
},
|
|
@@ -6435,8 +6442,10 @@ const SCREENS = runtimeSetting({
|
|
|
6435
6442
|
"screenId": "himi_sign_in",
|
|
6436
6443
|
"mode": "signin",
|
|
6437
6444
|
"intent": "profile",
|
|
6438
|
-
"returnScreenId": "himi_view_profile"
|
|
6439
|
-
|
|
6445
|
+
"returnScreenId": "himi_view_profile",
|
|
6446
|
+
"modal": "1"
|
|
6447
|
+
},
|
|
6448
|
+
"presentation": "sheet"
|
|
6440
6449
|
}
|
|
6441
6450
|
}
|
|
6442
6451
|
}
|
|
@@ -7501,8 +7510,10 @@ const SCREENS = runtimeSetting({
|
|
|
7501
7510
|
"screenId": "himi_sign_in",
|
|
7502
7511
|
"mode": "signin",
|
|
7503
7512
|
"intent": "wallet",
|
|
7504
|
-
"returnScreenId": "himi_wallet"
|
|
7505
|
-
|
|
7513
|
+
"returnScreenId": "himi_wallet",
|
|
7514
|
+
"modal": "1"
|
|
7515
|
+
},
|
|
7516
|
+
"presentation": "sheet"
|
|
7506
7517
|
}
|
|
7507
7518
|
}
|
|
7508
7519
|
}
|
|
@@ -7970,11 +7981,7 @@ const SCREENS = runtimeSetting({
|
|
|
7970
7981
|
"size": "sm",
|
|
7971
7982
|
"fullWidth": true,
|
|
7972
7983
|
"action": {
|
|
7973
|
-
"actionId": "
|
|
7974
|
-
"params": {
|
|
7975
|
-
"screenId": "$service:himiPlaceSummary.ctaScreenId",
|
|
7976
|
-
"mode": "$service:himiPlaceSummary.ctaMode"
|
|
7977
|
-
}
|
|
7984
|
+
"actionId": "tier5.himiPlaceSummary.openCta"
|
|
7978
7985
|
}
|
|
7979
7986
|
}
|
|
7980
7987
|
},
|
|
@@ -8015,7 +8022,8 @@ const SCREENS = runtimeSetting({
|
|
|
8015
8022
|
"onAppear": {
|
|
8016
8023
|
"actionId": "tier5.himiPlaceSummary.load",
|
|
8017
8024
|
"params": {
|
|
8018
|
-
"verticals": "[\"plans\",\"feed\",\"events\",\"blog\",\"groups\"]"
|
|
8025
|
+
"verticals": "[\"plans\",\"feed\",\"events\",\"blog\",\"groups\"]",
|
|
8026
|
+
"signInPresentation": "sheet"
|
|
8019
8027
|
}
|
|
8020
8028
|
}
|
|
8021
8029
|
}
|
|
@@ -10961,8 +10969,10 @@ const SCREENS = runtimeSetting({
|
|
|
10961
10969
|
"actionId": "himi.open",
|
|
10962
10970
|
"params": {
|
|
10963
10971
|
"screenId": "himi_sign_in",
|
|
10964
|
-
"mode": "signin"
|
|
10965
|
-
|
|
10972
|
+
"mode": "signin",
|
|
10973
|
+
"modal": "1"
|
|
10974
|
+
},
|
|
10975
|
+
"presentation": "sheet"
|
|
10966
10976
|
}
|
|
10967
10977
|
}
|
|
10968
10978
|
},
|
|
@@ -11462,8 +11472,10 @@ const SCREENS = runtimeSetting({
|
|
|
11462
11472
|
"screenId": "himi_sign_in",
|
|
11463
11473
|
"mode": "signin",
|
|
11464
11474
|
"intent": "post",
|
|
11465
|
-
"returnScreenId": "himi_feed"
|
|
11466
|
-
|
|
11475
|
+
"returnScreenId": "himi_feed",
|
|
11476
|
+
"modal": "1"
|
|
11477
|
+
},
|
|
11478
|
+
"presentation": "sheet"
|
|
11467
11479
|
}
|
|
11468
11480
|
}
|
|
11469
11481
|
}
|
|
@@ -12080,8 +12092,10 @@ const SCREENS = runtimeSetting({
|
|
|
12080
12092
|
"screenId": "himi_sign_in",
|
|
12081
12093
|
"mode": "signin",
|
|
12082
12094
|
"intent": "post",
|
|
12083
|
-
"returnScreenId": "himi_create_post"
|
|
12084
|
-
|
|
12095
|
+
"returnScreenId": "himi_create_post",
|
|
12096
|
+
"modal": "1"
|
|
12097
|
+
},
|
|
12098
|
+
"presentation": "sheet"
|
|
12085
12099
|
}
|
|
12086
12100
|
}
|
|
12087
12101
|
}
|
|
@@ -23207,8 +23221,10 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
23207
23221
|
"params": {
|
|
23208
23222
|
"screenId": "himi_sign_in",
|
|
23209
23223
|
"mode": "signin",
|
|
23210
|
-
"intent": "rsvp"
|
|
23211
|
-
|
|
23224
|
+
"intent": "rsvp",
|
|
23225
|
+
"modal": "1"
|
|
23226
|
+
},
|
|
23227
|
+
"presentation": "sheet"
|
|
23212
23228
|
}
|
|
23213
23229
|
}
|
|
23214
23230
|
},
|
|
@@ -24540,8 +24556,10 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
24540
24556
|
"intent": "join_group",
|
|
24541
24557
|
"contextName": "$service:himiBrandedGroup.name",
|
|
24542
24558
|
"returnScreenId": "himi_group",
|
|
24543
|
-
"returnId": "$service:himiBrandedGroup.id"
|
|
24544
|
-
|
|
24559
|
+
"returnId": "$service:himiBrandedGroup.id",
|
|
24560
|
+
"modal": "1"
|
|
24561
|
+
},
|
|
24562
|
+
"presentation": "sheet"
|
|
24545
24563
|
}
|
|
24546
24564
|
}
|
|
24547
24565
|
},
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// `load` is both the onAppear action and what an embed controller's `refresh()` runs (arg-less:
|
|
10
10
|
// the stashed appear params keep the verticals and the copy pack), so a host that hears
|
|
11
11
|
// `booking.created` / `booking.cancelled` re-reads the summary without a remount.
|
|
12
|
-
import { defineService } from "@himalaya/state";
|
|
12
|
+
import { defineService, navigate } from "@himalaya/state";
|
|
13
13
|
import { listMyPlanOrders, type WixPlanOrder } from "@himalaya/wix-pricing-plans";
|
|
14
14
|
import { fetchMemberBookings, type MemberBookingRow } from "../_shared/member-bookings.js";
|
|
15
15
|
import { memberAccess, assertMemberAccess, memberAccessDenied, type MemberAccess } from "../_shared/member-access.js";
|
|
@@ -52,6 +52,7 @@ const PLANS_SCREEN = "himi_plans";
|
|
|
52
52
|
const SIGN_IN_SCREEN = "himi_sign_in";
|
|
53
53
|
|
|
54
54
|
let stashedVerticals: string[] | null = null;
|
|
55
|
+
let signInPresentation: "sheet" | "full_screen" | undefined;
|
|
55
56
|
let generation = 0;
|
|
56
57
|
|
|
57
58
|
function appearVerticals(arg: unknown): string[] {
|
|
@@ -190,6 +191,8 @@ async function read(arg: unknown, again = true): Promise<PlaceSummaryState> {
|
|
|
190
191
|
* write back over the newer result. */
|
|
191
192
|
async function load(_s: PlaceSummaryState, arg?: unknown): Promise<PlaceSummaryState | undefined> {
|
|
192
193
|
stashCopy(arg);
|
|
194
|
+
const presentation = arg && typeof arg === "object" ? (arg as Record<string, unknown>).signInPresentation : undefined;
|
|
195
|
+
if (presentation === "sheet" || presentation === "full_screen") signInPresentation = presentation;
|
|
193
196
|
const mine = ++generation;
|
|
194
197
|
const next = await read(arg);
|
|
195
198
|
return mine === generation ? next : undefined;
|
|
@@ -198,11 +201,19 @@ async function load(_s: PlaceSummaryState, arg?: unknown): Promise<PlaceSummaryS
|
|
|
198
201
|
const svc = defineService<PlaceSummaryState, {
|
|
199
202
|
load: (s: PlaceSummaryState, arg?: unknown) => Promise<PlaceSummaryState | undefined>;
|
|
200
203
|
retry: (s: PlaceSummaryState) => Promise<PlaceSummaryState | undefined>;
|
|
204
|
+
openCta: (s: PlaceSummaryState) => PlaceSummaryState;
|
|
201
205
|
}>("himiPlaceSummary", {
|
|
202
206
|
state: BLANK,
|
|
203
207
|
actions: {
|
|
204
208
|
load,
|
|
205
209
|
retry: (s) => load(s),
|
|
210
|
+
openCta: (s) => {
|
|
211
|
+
if (s.hideCta || !s.ctaScreenId) return s;
|
|
212
|
+
// No return path: the tile is embedded, so the form closes over its host.
|
|
213
|
+
return navigate(s, s.ctaScreenId === SIGN_IN_SCREEN && signInPresentation
|
|
214
|
+
? { screenId: SIGN_IN_SCREEN, presentation: signInPresentation, args: { mode: "signin", modal: "1" } }
|
|
215
|
+
: { screenId: s.ctaScreenId, args: { mode: s.ctaMode } });
|
|
216
|
+
},
|
|
206
217
|
},
|
|
207
218
|
});
|
|
208
219
|
export { svc };
|