@wix/himalaya-cli 0.1876.0 → 0.1878.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/stdlib/flows/screens/src/index.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/store-invite-message.d.ts +93 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/store-invite.d.ts +31 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +258 -4
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{ce7be7eb1a1d80dc001a7518ada4fe7d09593a8b8e34eef44f8d7b135800a497.bin → 7ef1986106af7b688111a1b3775f03396def712b12d0e4620cfc758042f8157c.bin} +1 -1
- package/dist/browser-plane/sw.js +8 -8
- package/dist/cli.mjs +1877 -1368
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/one-app-to-himi-app.md +70 -95
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ export * from "./one-app-visibility.js";
|
|
|
7
7
|
export * from "./one-app-section.js";
|
|
8
8
|
export * from "./overlapping-panel-header.js";
|
|
9
9
|
export * from "./invite.js";
|
|
10
|
+
export * from "./store-invite.js";
|
|
10
11
|
export * from "./podcast.js";
|
|
11
12
|
export * from "./podcast-service.js";
|
|
12
13
|
import { entitlement } from "@wix/himalaya/checkout";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export interface StoreInviteCopy {
|
|
2
|
+
/** The intro line. `{appName}` is replaced by the app's name. */
|
|
3
|
+
intro: string;
|
|
4
|
+
appStore: string;
|
|
5
|
+
googlePlay: string;
|
|
6
|
+
/** The snackbar a tap shows when the chooser cannot open. */
|
|
7
|
+
unavailable: string;
|
|
8
|
+
}
|
|
9
|
+
/** The English copy. "App Store" and "Google Play" are the stores' own names, the same in every language. */
|
|
10
|
+
export declare const STORE_INVITE_COPY: Readonly<StoreInviteCopy>;
|
|
11
|
+
/** The translated lines in the languages this recipe ships, by primary language subtag. Any other language uses English. */
|
|
12
|
+
export declare const STORE_INVITE_TRANSLATIONS: Readonly<Record<string, Pick<StoreInviteCopy, "intro" | "unavailable">>>;
|
|
13
|
+
/** The copy for a language tag (`it`, `pt-BR`), and whether the language has its own lines (false: English was used). */
|
|
14
|
+
export declare function storeInviteCopyFor(tag: string | undefined): {
|
|
15
|
+
copy: StoreInviteCopy;
|
|
16
|
+
translated: boolean;
|
|
17
|
+
};
|
|
18
|
+
/** The numeric App Store id of a listing URL, or undefined when the URL is not a canonical App Store listing. */
|
|
19
|
+
export declare function appStoreListingId(url: unknown): string | undefined;
|
|
20
|
+
/** The package of a Google Play listing URL, or undefined when the URL is not the canonical listing form. */
|
|
21
|
+
export declare function googlePlayListingId(url: unknown): string | undefined;
|
|
22
|
+
export interface StoreInviteSource {
|
|
23
|
+
appName: string;
|
|
24
|
+
appStoreUrl?: string;
|
|
25
|
+
googlePlayUrl?: string;
|
|
26
|
+
copy?: Partial<StoreInviteCopy>;
|
|
27
|
+
}
|
|
28
|
+
/** The name as one line: trimmed, inner whitespace collapsed, no control characters, at most 100 characters. */
|
|
29
|
+
export declare function storeInviteAppName(value: unknown): string;
|
|
30
|
+
/** The shared text, or undefined when there is no name or no valid listing URL (nothing is shared then). */
|
|
31
|
+
export declare function storeInviteMessage(source: StoreInviteSource | undefined): string | undefined;
|
|
32
|
+
/** The Tier-5 action of the service: bind it to any tappable control (a Button's `action`, a row's `onTap`). */
|
|
33
|
+
export declare function storeInviteAction(service?: string): {
|
|
34
|
+
actionId: string;
|
|
35
|
+
};
|
|
36
|
+
export interface StoreInviteRowOptions {
|
|
37
|
+
/** The row's node id; the Invite button is `<id>.button`. */
|
|
38
|
+
id: string;
|
|
39
|
+
service?: string;
|
|
40
|
+
/** Source text of the label. The app's catalog translates it (the l10n row for "Invite"). */
|
|
41
|
+
label?: string;
|
|
42
|
+
/** Horizontal gutter of the row, in points (the Home's standard 16). */
|
|
43
|
+
gutter?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A horizontal row of actions: today one Invite button that fills the row. Each control takes `weight: 1`, so a second
|
|
47
|
+
* control added later gets an equal share, `spacing` apart. The button is tonal (a soft tint of the theme accent, so it
|
|
48
|
+
* reads in light and dark), with the line `share` icon before the label; its label is its accessibility name.
|
|
49
|
+
* `onAppear` runs the service's `load`, which resumes an Invite a sign-in confirmed and does nothing otherwise.
|
|
50
|
+
*/
|
|
51
|
+
export declare function storeInviteRow(opts: StoreInviteRowOptions): {
|
|
52
|
+
id: string;
|
|
53
|
+
body: {
|
|
54
|
+
package: string;
|
|
55
|
+
type: string;
|
|
56
|
+
props: {
|
|
57
|
+
spacing: number;
|
|
58
|
+
alignment: string;
|
|
59
|
+
children: {
|
|
60
|
+
id: string;
|
|
61
|
+
body: {
|
|
62
|
+
package: string;
|
|
63
|
+
type: string;
|
|
64
|
+
props: {
|
|
65
|
+
title: string;
|
|
66
|
+
style: string;
|
|
67
|
+
size: string;
|
|
68
|
+
leadingIcon: string;
|
|
69
|
+
fullWidth: boolean;
|
|
70
|
+
action: {
|
|
71
|
+
actionId: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
modifiers: {
|
|
76
|
+
weight: number;
|
|
77
|
+
};
|
|
78
|
+
}[];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
modifiers: {
|
|
82
|
+
padding: {
|
|
83
|
+
leading: number;
|
|
84
|
+
trailing: number;
|
|
85
|
+
top: number;
|
|
86
|
+
bottom: number;
|
|
87
|
+
};
|
|
88
|
+
onAppear: {
|
|
89
|
+
actionId: string;
|
|
90
|
+
params: {};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type StoreInviteSource } from "./store-invite-message.js";
|
|
2
|
+
export * from "./store-invite-message.js";
|
|
3
|
+
/** What a worker that mounts the service declares: the chooser, and the snackbar a failed tap shows. */
|
|
4
|
+
export declare const STORE_INVITE_CAPABILITIES: readonly ["share", "ui"];
|
|
5
|
+
export interface StoreInviteServiceOptions {
|
|
6
|
+
/** The service name the row's actions call (`tier5.<service>.invite` / `.load`). Default `storeInvite`. */
|
|
7
|
+
service?: string;
|
|
8
|
+
/** The bound, verified listing links and the app's name. Never take them from route parameters. */
|
|
9
|
+
source: () => StoreInviteSource | undefined | Promise<StoreInviteSource | undefined>;
|
|
10
|
+
/** The app's existing member sign-in screen. It must forward the host continuation token with signInDirect/registerDirect. */
|
|
11
|
+
signInScreenId: string;
|
|
12
|
+
}
|
|
13
|
+
/** What the last action did: the chooser opened (`shared`; not proof that anyone received it), the sign-in opened, nothing, or a failure the snackbar showed. */
|
|
14
|
+
export type StoreInviteOutcome = "idle" | "shared" | "signing-in" | "unavailable";
|
|
15
|
+
interface StoreInviteState {
|
|
16
|
+
outcome: StoreInviteOutcome;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Invite friends to the app's store listings. A tap opens the OS share chooser with the plain-text message
|
|
20
|
+
* (`storeInviteMessage`). A signed-in member shares at once. A guest's tap opens the app's member sign-in as a modal
|
|
21
|
+
* with an opaque host continuation; only that confirmed sign-in, consumed once by a later `load` (the row's
|
|
22
|
+
* `onAppear`, or a fresh worker after the account change), opens the chooser. Ordinary loads, routes, hydration,
|
|
23
|
+
* cancellation, another account and late callbacks never share. No network call is made: the links are bound.
|
|
24
|
+
*
|
|
25
|
+
* A `load` never blocks a tap: they hold separate locks, and only the chooser itself is single-flight, so a resume and a
|
|
26
|
+
* tap that race open it once.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createStoreInviteService(opts: StoreInviteServiceOptions): import("@wix/himalaya/state", { with: { "resolution-mode": "import" } }).ServiceHandle<StoreInviteState> & {
|
|
29
|
+
load: (...args: never[]) => Promise<StoreInviteState>;
|
|
30
|
+
invite: (...args: never[]) => Promise<StoreInviteState>;
|
|
31
|
+
};
|
|
@@ -2674,6 +2674,249 @@ function createInviteService(opts) {
|
|
|
2674
2674
|
return svc;
|
|
2675
2675
|
}
|
|
2676
2676
|
|
|
2677
|
+
// ../../core/sdk/ui/src/index.ts
|
|
2678
|
+
var SNACKBAR_LIMITS = {
|
|
2679
|
+
messageLines: 2,
|
|
2680
|
+
labelChars: 24,
|
|
2681
|
+
minDurationMs: 2e3,
|
|
2682
|
+
/** The floor with an action: long enough to reach it with a screen reader. */
|
|
2683
|
+
minActionDurationMs: 4e3,
|
|
2684
|
+
maxDurationMs: 1e4,
|
|
2685
|
+
/** The thumbnail's side, in pt / dp / CSS px. */
|
|
2686
|
+
imageSize: 40
|
|
2687
|
+
};
|
|
2688
|
+
function snackbarDurationMs(durationMs, hasAction) {
|
|
2689
|
+
if (typeof durationMs !== "number" || !Number.isFinite(durationMs) || durationMs <= 0) return void 0;
|
|
2690
|
+
const min = hasAction ? SNACKBAR_LIMITS.minActionDurationMs : SNACKBAR_LIMITS.minDurationMs;
|
|
2691
|
+
return Math.min(SNACKBAR_LIMITS.maxDurationMs, Math.max(min, Math.trunc(durationMs)));
|
|
2692
|
+
}
|
|
2693
|
+
function snackbarLabel(label) {
|
|
2694
|
+
const chars = Array.from(label ?? "");
|
|
2695
|
+
return chars.length <= SNACKBAR_LIMITS.labelChars ? chars.join("") : `${chars.slice(0, SNACKBAR_LIMITS.labelChars - 1).join("")}\u2026`;
|
|
2696
|
+
}
|
|
2697
|
+
async function snackbar(options) {
|
|
2698
|
+
const params = { message: options.message ?? "" };
|
|
2699
|
+
if (options.tone) params.tone = options.tone;
|
|
2700
|
+
const durationMs = snackbarDurationMs(options.durationMs, !!options.action);
|
|
2701
|
+
if (durationMs !== void 0) params.durationMs = durationMs;
|
|
2702
|
+
if (typeof options.imageUrl === "string" && options.imageUrl.trim()) params.imageUrl = options.imageUrl.trim();
|
|
2703
|
+
if (options.action) {
|
|
2704
|
+
const { label, actionId, args } = options.action;
|
|
2705
|
+
const action2 = { label: snackbarLabel(label) };
|
|
2706
|
+
if (actionId) action2.actionId = actionId;
|
|
2707
|
+
if (args !== void 0) action2.args = args;
|
|
2708
|
+
params.action = JSON.stringify(action2);
|
|
2709
|
+
}
|
|
2710
|
+
const r = await dispatch("capability.ui.snackbar", params);
|
|
2711
|
+
return { actionTapped: r?.actionTapped === true || r?.actionTapped === "true" };
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
// ../../stdlib/flows/screens/src/store-invite-message.ts
|
|
2715
|
+
var STORE_INVITE_COPY = {
|
|
2716
|
+
intro: "Check out my app, {appName}!",
|
|
2717
|
+
appStore: "App Store",
|
|
2718
|
+
googlePlay: "Google Play",
|
|
2719
|
+
unavailable: "Sharing is not available right now."
|
|
2720
|
+
};
|
|
2721
|
+
var STORE_INVITE_TRANSLATIONS = {
|
|
2722
|
+
en: { intro: STORE_INVITE_COPY.intro, unavailable: STORE_INVITE_COPY.unavailable },
|
|
2723
|
+
he: { intro: "\u05EA\u05D1\u05D3\u05E7\u05D5 \u05D0\u05EA \u05D4\u05D0\u05E4\u05DC\u05D9\u05E7\u05E6\u05D9\u05D4 \u05E9\u05DC\u05D9, {appName}!", unavailable: "\u05D0\u05D9 \u05D0\u05E4\u05E9\u05E8 \u05DC\u05E9\u05EA\u05E3 \u05DB\u05E8\u05D2\u05E2." },
|
|
2724
|
+
it: { intro: "Dai un'occhiata alla mia app, {appName}!", unavailable: "La condivisione non \xE8 disponibile al momento." },
|
|
2725
|
+
es: { intro: "\xA1Echa un vistazo a mi app, {appName}!", unavailable: "No se puede compartir en este momento." },
|
|
2726
|
+
fr: { intro: "D\xE9couvre mon app, {appName} !", unavailable: "Le partage n'est pas disponible pour le moment." },
|
|
2727
|
+
de: { intro: "Schau dir meine App an: {appName}!", unavailable: "Teilen ist gerade nicht m\xF6glich." },
|
|
2728
|
+
pt: { intro: "Confira meu app, {appName}!", unavailable: "N\xE3o \xE9 poss\xEDvel compartilhar agora." }
|
|
2729
|
+
};
|
|
2730
|
+
function storeInviteCopyFor(tag) {
|
|
2731
|
+
const language = (tag ?? "en").toLowerCase().split("-")[0];
|
|
2732
|
+
const lines = STORE_INVITE_TRANSLATIONS[language];
|
|
2733
|
+
return { copy: { ...STORE_INVITE_COPY, ...lines }, translated: lines !== void 0 };
|
|
2734
|
+
}
|
|
2735
|
+
var APP_STORE = /^https:\/\/apps\.apple\.com\/(?:[a-z]{2}\/)?app\/(?:(?:[A-Za-z0-9._~-]|%[0-9A-Fa-f]{2}){1,200}\/)?id([1-9][0-9]{0,11})$/;
|
|
2736
|
+
var GOOGLE_PLAY = /^https:\/\/play\.google\.com\/store\/apps\/details\?id=([A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*)+)$/;
|
|
2737
|
+
function appStoreListingId(url) {
|
|
2738
|
+
return typeof url === "string" && url.length <= 512 ? APP_STORE.exec(url)?.[1] : void 0;
|
|
2739
|
+
}
|
|
2740
|
+
function googlePlayListingId(url) {
|
|
2741
|
+
return typeof url === "string" && url.length <= 512 ? GOOGLE_PLAY.exec(url)?.[1] : void 0;
|
|
2742
|
+
}
|
|
2743
|
+
function storeInviteAppName(value) {
|
|
2744
|
+
if (typeof value !== "string") return "";
|
|
2745
|
+
return value.replace(/[\u0000-\u001f\u007f-\u009f\u2028\u2029]/g, " ").replace(/\s+/g, " ").trim().slice(0, 100).trim();
|
|
2746
|
+
}
|
|
2747
|
+
var line = (value, fallback) => {
|
|
2748
|
+
const text2 = storeInviteAppName(value);
|
|
2749
|
+
return text2 || fallback;
|
|
2750
|
+
};
|
|
2751
|
+
function storeInviteMessage(source) {
|
|
2752
|
+
if (!source) return void 0;
|
|
2753
|
+
const name = storeInviteAppName(source.appName);
|
|
2754
|
+
const copy = source.copy ?? {};
|
|
2755
|
+
const stores = [];
|
|
2756
|
+
if (appStoreListingId(source.appStoreUrl)) stores.push([line(copy.appStore, STORE_INVITE_COPY.appStore), source.appStoreUrl]);
|
|
2757
|
+
if (googlePlayListingId(source.googlePlayUrl)) stores.push([line(copy.googlePlay, STORE_INVITE_COPY.googlePlay), source.googlePlayUrl]);
|
|
2758
|
+
if (!name || !stores.length) return void 0;
|
|
2759
|
+
const intro = line(copy.intro, STORE_INVITE_COPY.intro);
|
|
2760
|
+
const first = intro.includes("{appName}") ? intro.split("{appName}").join(name) : `${intro} ${name}`;
|
|
2761
|
+
return [first, ...stores.flatMap(([label, url]) => ["", label, url])].join("\n");
|
|
2762
|
+
}
|
|
2763
|
+
function storeInviteAction(service = "storeInvite") {
|
|
2764
|
+
return { actionId: `tier5.${service}.invite` };
|
|
2765
|
+
}
|
|
2766
|
+
function storeInviteRow(opts) {
|
|
2767
|
+
const service = opts.service ?? "storeInvite";
|
|
2768
|
+
const gutter = opts.gutter ?? 16;
|
|
2769
|
+
return {
|
|
2770
|
+
id: opts.id,
|
|
2771
|
+
body: { package: "himalaya", type: "HStack", props: { spacing: 12, alignment: "center", children: [
|
|
2772
|
+
{
|
|
2773
|
+
id: `${opts.id}.button`,
|
|
2774
|
+
body: { package: "himalaya", type: "Button", props: {
|
|
2775
|
+
title: opts.label ?? "Invite",
|
|
2776
|
+
style: "tonal",
|
|
2777
|
+
size: "md",
|
|
2778
|
+
leadingIcon: "share",
|
|
2779
|
+
fullWidth: true,
|
|
2780
|
+
action: storeInviteAction(service)
|
|
2781
|
+
} },
|
|
2782
|
+
modifiers: { weight: 1 }
|
|
2783
|
+
}
|
|
2784
|
+
] } },
|
|
2785
|
+
modifiers: { padding: { leading: gutter, trailing: gutter, top: 16, bottom: 0 }, onAppear: { actionId: `tier5.${service}.load`, params: {} } }
|
|
2786
|
+
};
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2789
|
+
// ../../stdlib/flows/screens/src/store-invite.ts
|
|
2790
|
+
var STORE_INVITE_CAPABILITIES = ["share", "ui"];
|
|
2791
|
+
var accountOf2 = (email) => email.trim().toLowerCase();
|
|
2792
|
+
function createStoreInviteService(opts) {
|
|
2793
|
+
if (!opts.signInScreenId.trim()) throw new Error("Invite requires the app's sign-in screen.");
|
|
2794
|
+
const read2 = async () => {
|
|
2795
|
+
const source = await opts.source();
|
|
2796
|
+
const text2 = storeInviteMessage(source);
|
|
2797
|
+
if (!source || !text2) return void 0;
|
|
2798
|
+
return { source, text: text2, target: inviteTarget(JSON.stringify(["store-invite", text2])) };
|
|
2799
|
+
};
|
|
2800
|
+
const continuation2 = async (operation, target2, token = "") => {
|
|
2801
|
+
try {
|
|
2802
|
+
return await dispatch("himi.wix.authContinuation", { operation, target: target2, token });
|
|
2803
|
+
} catch {
|
|
2804
|
+
return null;
|
|
2805
|
+
}
|
|
2806
|
+
};
|
|
2807
|
+
const tell = async () => {
|
|
2808
|
+
let message = STORE_INVITE_COPY.unavailable;
|
|
2809
|
+
try {
|
|
2810
|
+
message = storeInviteAppName((await opts.source())?.copy?.unavailable) || message;
|
|
2811
|
+
} catch {
|
|
2812
|
+
}
|
|
2813
|
+
try {
|
|
2814
|
+
await snackbar({ message, tone: "danger" });
|
|
2815
|
+
} catch {
|
|
2816
|
+
}
|
|
2817
|
+
};
|
|
2818
|
+
let resuming = false, tapping = false, sharing = false;
|
|
2819
|
+
let opened = 0;
|
|
2820
|
+
const perform = async (target2, account, hostChecked, startedAt) => {
|
|
2821
|
+
if (sharing || opened !== startedAt) return "idle";
|
|
2822
|
+
sharing = true;
|
|
2823
|
+
try {
|
|
2824
|
+
if (!hostChecked && await availability() !== "full") return "unavailable";
|
|
2825
|
+
const [current, member] = await Promise.all([read2(), authState()]);
|
|
2826
|
+
if (!current || current.target !== target2 || !account || !member.signedIn || accountOf2(member.email) !== account) return "unavailable";
|
|
2827
|
+
opened++;
|
|
2828
|
+
await share({ text: current.text });
|
|
2829
|
+
return "shared";
|
|
2830
|
+
} finally {
|
|
2831
|
+
sharing = false;
|
|
2832
|
+
}
|
|
2833
|
+
};
|
|
2834
|
+
const svc = defineService(opts.service ?? "storeInvite", {
|
|
2835
|
+
state: { outcome: "idle" },
|
|
2836
|
+
notHydrated: ["outcome"],
|
|
2837
|
+
actions: {
|
|
2838
|
+
/** Resume an Invite a sign-in confirmed for this message and member, once. Anything else does nothing.
|
|
2839
|
+
* It asks the host with `claim`, which spends only this Invite's own confirmed request: another feature's pending
|
|
2840
|
+
* sign-in (a program enrol, a member screen) is never cleared, however often the Home loads. A host without `claim`
|
|
2841
|
+
* (no `claimSupported` in its answer) resumes nothing here; the guest's next tap, signed in, shares. */
|
|
2842
|
+
load: async () => {
|
|
2843
|
+
if (resuming) return void 0;
|
|
2844
|
+
resuming = true;
|
|
2845
|
+
const startedAt = opened;
|
|
2846
|
+
try {
|
|
2847
|
+
const data = await read2();
|
|
2848
|
+
if (!data) return void 0;
|
|
2849
|
+
const member = await authState();
|
|
2850
|
+
if (!member.signedIn) return void 0;
|
|
2851
|
+
const account = accountOf2(member.email);
|
|
2852
|
+
if (!account) return void 0;
|
|
2853
|
+
if (await availability() !== "full") return void 0;
|
|
2854
|
+
const permit = await continuation2("claim", data.target);
|
|
2855
|
+
if (permit?.supported !== true || permit.claimSupported !== true || permit.confirmed !== true || !permit.account || accountOf2(permit.account) !== account) return void 0;
|
|
2856
|
+
const outcome = await perform(data.target, account, true, startedAt);
|
|
2857
|
+
return outcome === "idle" ? void 0 : { outcome };
|
|
2858
|
+
} catch {
|
|
2859
|
+
return void 0;
|
|
2860
|
+
} finally {
|
|
2861
|
+
resuming = false;
|
|
2862
|
+
}
|
|
2863
|
+
},
|
|
2864
|
+
/** The Invite tap. A second tap while the first is still opening the chooser or the sign-in does nothing. */
|
|
2865
|
+
invite: async () => {
|
|
2866
|
+
if (tapping) return void 0;
|
|
2867
|
+
tapping = true;
|
|
2868
|
+
const startedAt = opened;
|
|
2869
|
+
try {
|
|
2870
|
+
const data = await read2();
|
|
2871
|
+
if (!data) {
|
|
2872
|
+
await tell();
|
|
2873
|
+
return { outcome: "unavailable" };
|
|
2874
|
+
}
|
|
2875
|
+
const member = await authState();
|
|
2876
|
+
if (member.signedIn) {
|
|
2877
|
+
if (await availability() !== "full") {
|
|
2878
|
+
await tell();
|
|
2879
|
+
return { outcome: "unavailable" };
|
|
2880
|
+
}
|
|
2881
|
+
await continuation2("claim", data.target);
|
|
2882
|
+
const outcome = await perform(data.target, accountOf2(member.email), true, startedAt);
|
|
2883
|
+
if (outcome === "unavailable") await tell();
|
|
2884
|
+
return outcome === "idle" ? void 0 : { outcome };
|
|
2885
|
+
}
|
|
2886
|
+
if (await availability() !== "full") {
|
|
2887
|
+
await tell();
|
|
2888
|
+
return { outcome: "unavailable" };
|
|
2889
|
+
}
|
|
2890
|
+
const request = await continuation2("begin", data.target);
|
|
2891
|
+
const signIn = { screenId: opts.signInScreenId, presentation: "sheet", modal: "1", mode: "signin" };
|
|
2892
|
+
if (request?.supported !== true) {
|
|
2893
|
+
await dispatch("himi.open", signIn);
|
|
2894
|
+
return { outcome: "signing-in" };
|
|
2895
|
+
}
|
|
2896
|
+
if (!request.token) {
|
|
2897
|
+
await tell();
|
|
2898
|
+
return { outcome: "unavailable" };
|
|
2899
|
+
}
|
|
2900
|
+
try {
|
|
2901
|
+
await dispatch("himi.open", { ...signIn, authContinuation: request.token });
|
|
2902
|
+
} catch (error) {
|
|
2903
|
+
await continuation2("cancel", data.target, request.token);
|
|
2904
|
+
throw error;
|
|
2905
|
+
}
|
|
2906
|
+
return { outcome: "signing-in" };
|
|
2907
|
+
} catch {
|
|
2908
|
+
await tell();
|
|
2909
|
+
return { outcome: "unavailable" };
|
|
2910
|
+
} finally {
|
|
2911
|
+
tapping = false;
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
});
|
|
2916
|
+
void svc.load();
|
|
2917
|
+
return svc;
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2677
2920
|
// ../../stdlib/flows/screens/src/podcast.ts
|
|
2678
2921
|
var PODCAST_FEED_ENDPOINT = "https://podcasts.wix.com/api/feed/graphql";
|
|
2679
2922
|
var PODCAST_EPISODES_QUERY = `
|
|
@@ -7394,7 +7637,7 @@ var PERIOD_DEFAULTS = {
|
|
|
7394
7637
|
oneTimeNoExpiry: "one-time, no expiry"
|
|
7395
7638
|
};
|
|
7396
7639
|
function period(pricing, tpl, loc) {
|
|
7397
|
-
const
|
|
7640
|
+
const line2 = (family, unit, n) => {
|
|
7398
7641
|
const u = unit.toLowerCase();
|
|
7399
7642
|
const key = family + u.charAt(0).toUpperCase() + u.slice(1);
|
|
7400
7643
|
const fallback = PERIOD_DEFAULTS[key] ?? (family === "period" ? `{count, plural, one {per ${u}} other {every # ${u}s}}` : `{count, plural, one {valid # ${u}} other {valid # ${u}s}}`);
|
|
@@ -7402,9 +7645,9 @@ function period(pricing, tpl, loc) {
|
|
|
7402
7645
|
return formatMessage(pattern, { count: n }, pattern === fallback ? "en" : loc);
|
|
7403
7646
|
};
|
|
7404
7647
|
const sub = pricing?.subscription;
|
|
7405
|
-
if (sub?.cycleDuration) return
|
|
7648
|
+
if (sub?.cycleDuration) return line2("period", String(sub.cycleDuration.unit ?? "MONTH"), sub.cycleDuration.count ?? 1);
|
|
7406
7649
|
const d = pricing?.singlePaymentForDuration;
|
|
7407
|
-
if (d) return
|
|
7650
|
+
if (d) return line2("valid", String(d.unit ?? "DAY"), d.count ?? 0);
|
|
7408
7651
|
if (pricing?.singlePaymentUnlimited) return tpl("oneTimeNoExpiry", PERIOD_DEFAULTS.oneTimeNoExpiry);
|
|
7409
7652
|
return "";
|
|
7410
7653
|
}
|
|
@@ -7833,6 +8076,10 @@ export {
|
|
|
7833
8076
|
PODCAST_EPISODES_QUERY,
|
|
7834
8077
|
PODCAST_FEED_ENDPOINT,
|
|
7835
8078
|
PODCAST_SCREEN_CAPABILITIES,
|
|
8079
|
+
STORE_INVITE_CAPABILITIES,
|
|
8080
|
+
STORE_INVITE_COPY,
|
|
8081
|
+
STORE_INVITE_TRANSLATIONS,
|
|
8082
|
+
appStoreListingId,
|
|
7836
8083
|
authScreen,
|
|
7837
8084
|
businessContactLink,
|
|
7838
8085
|
businessContactPoint,
|
|
@@ -7848,9 +8095,11 @@ export {
|
|
|
7848
8095
|
createInviteService,
|
|
7849
8096
|
createOneAppSectionService,
|
|
7850
8097
|
createPodcastService,
|
|
8098
|
+
createStoreInviteService,
|
|
7851
8099
|
decodeOneAppPage,
|
|
7852
8100
|
entitlement,
|
|
7853
8101
|
fileShareScreen,
|
|
8102
|
+
googlePlayListingId,
|
|
7854
8103
|
inviteAction,
|
|
7855
8104
|
inviteButton,
|
|
7856
8105
|
inviteScreen,
|
|
@@ -7868,6 +8117,11 @@ export {
|
|
|
7868
8117
|
podcastFeedRequest,
|
|
7869
8118
|
podcastFeedSetting,
|
|
7870
8119
|
podcastFeedUrl,
|
|
7871
|
-
podcastScreen
|
|
8120
|
+
podcastScreen,
|
|
8121
|
+
storeInviteAction,
|
|
8122
|
+
storeInviteAppName,
|
|
8123
|
+
storeInviteCopyFor,
|
|
8124
|
+
storeInviteMessage,
|
|
8125
|
+
storeInviteRow
|
|
7872
8126
|
};
|
|
7873
8127
|
//# sourceMappingURL=screens.mjs.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"files": [
|
|
3
3
|
{
|
|
4
4
|
"name": "sw.js",
|
|
5
|
-
"bytes":
|
|
5
|
+
"bytes": 2744566
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"name": "host.html",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"bytes": 24320
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"name": "preview-deferred/
|
|
24
|
+
"name": "preview-deferred/7ef1986106af7b688111a1b3775f03396def712b12d0e4620cfc758042f8157c.bin",
|
|
25
25
|
"bytes": 488215
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
],
|
|
80
80
|
"deferred": [
|
|
81
81
|
{
|
|
82
|
-
"key": "assets/pdf-
|
|
82
|
+
"key": "assets/pdf-DTQh7vir.js",
|
|
83
83
|
"contentType": "application/javascript; charset=utf-8",
|
|
84
|
-
"sha256": "
|
|
85
|
-
"file": "preview-deferred/
|
|
84
|
+
"sha256": "7ef1986106af7b688111a1b3775f03396def712b12d0e4620cfc758042f8157c",
|
|
85
|
+
"file": "preview-deferred/7ef1986106af7b688111a1b3775f03396def712b12d0e4620cfc758042f8157c.bin"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"key": "assets/pdf.worker.min-BGnVRhRG.js",
|