@wix/himalaya-cli 0.1396.0 → 0.1398.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/serve-runtime/src/wix-bridge.d.ts +30 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/icon-catalog.generated.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validation.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/copy.generated.d.ts +109 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/feedback.d.ts +15 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/index.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +44 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/auth.mjs +304 -18
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core/validation.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +31 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +377 -20
- package/dist/cli.mjs +1260 -540
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +2 -0
- package/guides/headless-loop.md +1 -1
- package/guides/himi-json-output.md +1 -0
- package/guides/importable-sdks.md +2 -1
- package/guides/one-app-to-himi-app.md +72 -2
- package/guides/one-app-viewer.md +8 -1
- package/guides/sdk-reference.json +92 -1
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +41 -1
- package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +90 -76
- package/templates/branded-lite/dev/index.ts +41 -1
- package/templates/branded-lite/tier5-src/himi-store-account/index.ts +90 -76
- package/templates/community-club/dev/index.ts +41 -1
- package/templates/community-club/tier5-src/himi-store-account/index.ts +90 -76
- package/templates/events-meetups/dev/index.ts +41 -1
- package/templates/events-meetups/tier5-src/himi-store-account/index.ts +90 -76
- package/templates/gym-fitness/dev/index.ts +41 -1
- package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +90 -76
- package/templates/nonprofit-cause/dev/index.ts +41 -1
- package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +90 -76
- package/templates/podcast-creator/dev/index.ts +41 -1
- package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +90 -76
- package/templates/portfolio-creative/dev/index.ts +41 -1
- package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +90 -76
- package/templates/restaurant/dev/index.ts +41 -1
- package/templates/restaurant/tier5-src/himi-store-account/index.ts +90 -76
- package/templates/retail-store/dev/index.ts +41 -1
- package/templates/retail-store/tier5-src/himi-store-account/index.ts +90 -76
- package/templates/yoga-studio/dev/index.ts +41 -1
- package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +90 -76
|
@@ -197,7 +197,7 @@ function errorMessageFor(args) {
|
|
|
197
197
|
return defaultMessage(failure, args.catalog);
|
|
198
198
|
}
|
|
199
199
|
function shouldRevealError(args) {
|
|
200
|
-
if (args.hasWorkerError) return true;
|
|
200
|
+
if (args.hasWorkerError || args.feedbackShown) return true;
|
|
201
201
|
if (args.submitAttempted) return true;
|
|
202
202
|
switch (resolveMode(args.rule)) {
|
|
203
203
|
case "live":
|
|
@@ -9373,7 +9373,7 @@ function errorMessageFor(args) {
|
|
|
9373
9373
|
return defaultMessage(failure, args.catalog);
|
|
9374
9374
|
}
|
|
9375
9375
|
function shouldRevealError(args) {
|
|
9376
|
-
if (args.hasWorkerError) return true;
|
|
9376
|
+
if (args.hasWorkerError || args.feedbackShown) return true;
|
|
9377
9377
|
if (args.submitAttempted) return true;
|
|
9378
9378
|
switch (resolveMode(args.rule)) {
|
|
9379
9379
|
case "live":
|
|
@@ -11149,6 +11149,27 @@ var ICON_CATALOG = {
|
|
|
11149
11149
|
"license": "Apache-2.0",
|
|
11150
11150
|
"libVersion": "0.45.9"
|
|
11151
11151
|
},
|
|
11152
|
+
"concealed": {
|
|
11153
|
+
"category": "status",
|
|
11154
|
+
"path": [
|
|
11155
|
+
"M15.725 13.525L14.625 12.425C15.058 11.242 14.833 10.258 13.95 9.475C13.067 8.692 12.108 8.492 11.075 8.875L9.975 7.775C10.258 7.592 10.575 7.458 10.925 7.375C11.275 7.292 11.633 7.25 12 7.25C13.183 7.25 14.188 7.663 15.013 8.488C15.838 9.313 16.25 10.317 16.25 11.5C16.25 11.867 16.204 12.229 16.113 12.588C16.021 12.946 15.892 13.258 15.725 13.525ZM18.95 16.75L17.95 15.75C18.767 15.15 19.479 14.479 20.088 13.738C20.696 12.996 21.142 12.25 21.425 11.5C20.592 9.65 19.342 8.188 17.675 7.113C16.008 6.038 14.2 5.5 12.25 5.5C11.55 5.5 10.833 5.567 10.1 5.7C9.367 5.833 8.792 5.992 8.375 6.175L7.225 5C7.808 4.733 8.554 4.5 9.463 4.3C10.371 4.1 11.258 4 12.125 4C14.508 4 16.688 4.679 18.663 6.038C20.638 7.396 22.083 9.217 23 11.5C22.567 12.567 22.008 13.542 21.325 14.425C20.642 15.308 19.85 16.083 18.95 16.75ZM20.4 22.4L16.2 18.275C15.617 18.508 14.958 18.688 14.225 18.813C13.492 18.938 12.75 19 12 19C9.567 19 7.358 18.321 5.375 16.963C3.392 15.604 1.933 13.783 1 11.5C1.333 10.633 1.796 9.788 2.388 8.963C2.979 8.138 3.7 7.35 4.55 6.6L1.4 3.45L2.45 2.375L21.375 21.3L20.4 22.4ZM5.575 7.65C4.958 8.1 4.362 8.692 3.788 9.425C3.213 10.158 2.8 10.85 2.55 11.5C3.4 13.35 4.679 14.813 6.388 15.888C8.096 16.963 10.033 17.5 12.2 17.5C12.75 17.5 13.292 17.467 13.825 17.4C14.358 17.333 14.758 17.233 15.025 17.1L13.425 15.5C13.242 15.583 13.017 15.646 12.75 15.688C12.483 15.729 12.233 15.75 12 15.75C10.833 15.75 9.833 15.342 9 14.525C8.167 13.708 7.75 12.7 7.75 11.5C7.75 11.25 7.771 11 7.813 10.75C7.854 10.5 7.917 10.275 8 10.075L5.575 7.65ZM13.2 11.2ZM10.3 12.65Z"
|
|
11156
|
+
],
|
|
11157
|
+
"style": "filled",
|
|
11158
|
+
"ios": {
|
|
11159
|
+
"sf": "eye.slash",
|
|
11160
|
+
"match": "exact"
|
|
11161
|
+
},
|
|
11162
|
+
"android": {
|
|
11163
|
+
"material": "VisibilityOff",
|
|
11164
|
+
"match": "exact"
|
|
11165
|
+
},
|
|
11166
|
+
"aliases": [
|
|
11167
|
+
"eye_slash"
|
|
11168
|
+
],
|
|
11169
|
+
"source": "material-symbols/visibility_off",
|
|
11170
|
+
"license": "Apache-2.0",
|
|
11171
|
+
"libVersion": "0.45.9"
|
|
11172
|
+
},
|
|
11152
11173
|
"cookie": {
|
|
11153
11174
|
"category": "commerce",
|
|
11154
11175
|
"path": [
|
|
@@ -12614,6 +12635,9 @@ var ICON_CATALOG = {
|
|
|
12614
12635
|
"material": "Visibility",
|
|
12615
12636
|
"match": "exact"
|
|
12616
12637
|
},
|
|
12638
|
+
"aliases": [
|
|
12639
|
+
"eye"
|
|
12640
|
+
],
|
|
12617
12641
|
"source": "material-symbols/visibility",
|
|
12618
12642
|
"license": "Apache-2.0",
|
|
12619
12643
|
"libVersion": "0.45.9"
|
|
@@ -12725,6 +12749,8 @@ var ICON_NORMALIZED_INDEX = {
|
|
|
12725
12749
|
"clock": "clock",
|
|
12726
12750
|
"close": "close",
|
|
12727
12751
|
"xmark": "close",
|
|
12752
|
+
"concealed": "concealed",
|
|
12753
|
+
"eyeslash": "concealed",
|
|
12728
12754
|
"cookie": "cookie",
|
|
12729
12755
|
"copy": "copy",
|
|
12730
12756
|
"dashboard": "dashboard",
|
|
@@ -12815,6 +12841,7 @@ var ICON_NORMALIZED_INDEX = {
|
|
|
12815
12841
|
"trash": "trash",
|
|
12816
12842
|
"undo": "undo",
|
|
12817
12843
|
"visible": "visible",
|
|
12844
|
+
"eye": "visible",
|
|
12818
12845
|
"volume": "volume",
|
|
12819
12846
|
"warning": "warning",
|
|
12820
12847
|
"wifi": "wifi",
|
|
@@ -12856,6 +12883,7 @@ var ICON_NAMES = [
|
|
|
12856
12883
|
"circle_fill",
|
|
12857
12884
|
"clock",
|
|
12858
12885
|
"close",
|
|
12886
|
+
"concealed",
|
|
12859
12887
|
"cookie",
|
|
12860
12888
|
"copy",
|
|
12861
12889
|
"dashboard",
|
|
@@ -12867,6 +12895,8 @@ var ICON_NAMES = [
|
|
|
12867
12895
|
"error",
|
|
12868
12896
|
"expand",
|
|
12869
12897
|
"external_link",
|
|
12898
|
+
"eye",
|
|
12899
|
+
"eye_slash",
|
|
12870
12900
|
"filter",
|
|
12871
12901
|
"folder",
|
|
12872
12902
|
"forward",
|
|
@@ -1,3 +1,117 @@
|
|
|
1
|
+
// ../../core/ts/src/validation.ts
|
|
2
|
+
var EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
|
|
3
|
+
var URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
|
|
4
|
+
var INTEGER_RE = /^[+-]?[0-9]+$/;
|
|
5
|
+
var NUMBER_RE = /^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;
|
|
6
|
+
function isEmail(value) {
|
|
7
|
+
if (!EMAIL_RE.test(value)) return false;
|
|
8
|
+
if (value.includes("..")) return false;
|
|
9
|
+
const local = value.slice(0, value.indexOf("@"));
|
|
10
|
+
return !local.startsWith(".") && !local.endsWith(".");
|
|
11
|
+
}
|
|
12
|
+
function isPhone(value) {
|
|
13
|
+
let s2 = "";
|
|
14
|
+
for (const ch of value) {
|
|
15
|
+
if (" -().\xA0 ".includes(ch)) continue;
|
|
16
|
+
s2 += ch;
|
|
17
|
+
}
|
|
18
|
+
if (s2.startsWith("+")) s2 = s2.slice(1);
|
|
19
|
+
if (s2.length < 7 || s2.length > 15) return false;
|
|
20
|
+
for (const ch of s2) if (ch < "0" || ch > "9") return false;
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
function isUrl(value) {
|
|
24
|
+
if (/\s/.test(value)) return false;
|
|
25
|
+
let rest = value;
|
|
26
|
+
const lower = value.toLowerCase();
|
|
27
|
+
if (lower.startsWith("http://")) rest = value.slice(7);
|
|
28
|
+
else if (lower.startsWith("https://")) rest = value.slice(8);
|
|
29
|
+
else if (value.includes("://")) return false;
|
|
30
|
+
if (rest.length === 0) return false;
|
|
31
|
+
let end = rest.length;
|
|
32
|
+
for (let i = 0; i < rest.length; i++) {
|
|
33
|
+
const c = rest[i];
|
|
34
|
+
if (c === "/" || c === "?" || c === "#") {
|
|
35
|
+
end = i;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const hostPort = rest.slice(0, end);
|
|
40
|
+
if (!URL_HOST_RE.test(hostPort)) return false;
|
|
41
|
+
const host = hostPort.split(":")[0];
|
|
42
|
+
if (host === "localhost") return true;
|
|
43
|
+
const dot = host.lastIndexOf(".");
|
|
44
|
+
if (dot < 1) return false;
|
|
45
|
+
const tld = host.slice(dot + 1);
|
|
46
|
+
if (tld.length < 2) return false;
|
|
47
|
+
for (const ch of tld) {
|
|
48
|
+
const isAlpha = ch >= "A" && ch <= "Z" || ch >= "a" && ch <= "z";
|
|
49
|
+
if (!isAlpha) return false;
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
function parseNumeric(value) {
|
|
54
|
+
if (!NUMBER_RE.test(value)) return null;
|
|
55
|
+
const n = Number(value);
|
|
56
|
+
return Number.isFinite(n) ? n : null;
|
|
57
|
+
}
|
|
58
|
+
function matchesType(type, value) {
|
|
59
|
+
switch (type) {
|
|
60
|
+
case "email":
|
|
61
|
+
return isEmail(value);
|
|
62
|
+
case "phone":
|
|
63
|
+
return isPhone(value);
|
|
64
|
+
case "url":
|
|
65
|
+
return isUrl(value);
|
|
66
|
+
case "number":
|
|
67
|
+
return NUMBER_RE.test(value);
|
|
68
|
+
case "integer":
|
|
69
|
+
return INTEGER_RE.test(value);
|
|
70
|
+
// Additive decoding: an unknown type is NOT a failure. A renderer that has
|
|
71
|
+
// not shipped a new type yet must let the value through rather than block a
|
|
72
|
+
// form it cannot understand — the server still re-validates on submit.
|
|
73
|
+
default:
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function validate(rule, rawValue) {
|
|
78
|
+
if (!rule) return null;
|
|
79
|
+
const value = rawValue ?? "";
|
|
80
|
+
if (value.length === 0) {
|
|
81
|
+
return rule.required === true ? { rule: "required" } : null;
|
|
82
|
+
}
|
|
83
|
+
if (rule.type && !matchesType(rule.type, value)) {
|
|
84
|
+
return { rule: "type", type: rule.type };
|
|
85
|
+
}
|
|
86
|
+
if (rule.regex) {
|
|
87
|
+
let ok;
|
|
88
|
+
try {
|
|
89
|
+
ok = new RegExp(`^(?:${rule.regex})$`).test(value);
|
|
90
|
+
} catch {
|
|
91
|
+
ok = true;
|
|
92
|
+
}
|
|
93
|
+
if (!ok) return { rule: "regex" };
|
|
94
|
+
}
|
|
95
|
+
if (typeof rule.minLength === "number" && rule.minLength > 0 && value.length < rule.minLength) {
|
|
96
|
+
return { rule: "minLength", limit: rule.minLength };
|
|
97
|
+
}
|
|
98
|
+
if (typeof rule.maxLength === "number" && rule.maxLength > 0 && value.length > rule.maxLength) {
|
|
99
|
+
return { rule: "maxLength", limit: rule.maxLength };
|
|
100
|
+
}
|
|
101
|
+
if (typeof rule.minValue === "number" || typeof rule.maxValue === "number") {
|
|
102
|
+
const n = parseNumeric(value);
|
|
103
|
+
if (n !== null) {
|
|
104
|
+
if (typeof rule.minValue === "number" && n < rule.minValue) {
|
|
105
|
+
return { rule: "minValue", limit: rule.minValue };
|
|
106
|
+
}
|
|
107
|
+
if (typeof rule.maxValue === "number" && n > rule.maxValue) {
|
|
108
|
+
return { rule: "maxValue", limit: rule.maxValue };
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
|
|
1
115
|
// ../../core/sdk/state/src/index.ts
|
|
2
116
|
function defineService(name, def) {
|
|
3
117
|
const himalaya = globalThis.himalaya;
|
|
@@ -9,6 +123,179 @@ function defineService(name, def) {
|
|
|
9
123
|
return himalaya.defineService(name, def);
|
|
10
124
|
}
|
|
11
125
|
|
|
126
|
+
// ../../stdlib/flows/auth/src/copy.generated.ts
|
|
127
|
+
var copy_generated_default = {
|
|
128
|
+
"auth.gate.title": "Welcome",
|
|
129
|
+
"auth.gate.subtitle": "Sign in to continue",
|
|
130
|
+
"auth.gate.signIn": "Sign In",
|
|
131
|
+
"auth.gate.createAccount": "Create account",
|
|
132
|
+
"auth.gate.resetPassword": "Reset password",
|
|
133
|
+
"auth.gate.verifyTitle": "Verify it's you",
|
|
134
|
+
"auth.gate.sendResetLink": "Send reset link",
|
|
135
|
+
"auth.gate.verify": "Verify",
|
|
136
|
+
"auth.gate.continue": "Continue",
|
|
137
|
+
"auth.gate.forgotPassword": "Forgot password?",
|
|
138
|
+
"auth.gate.backToSignIn": "Back to sign in",
|
|
139
|
+
"auth.gate.continueWith": "Continue with {provider}",
|
|
140
|
+
"auth.gate.sendCodeVia": "Send code via",
|
|
141
|
+
"auth.gate.resendCode": "Didn't get it? Resend code",
|
|
142
|
+
"auth.gate.field.code": "Verification code",
|
|
143
|
+
"auth.gate.field.email": "Email",
|
|
144
|
+
"auth.gate.field.name": "Name",
|
|
145
|
+
"auth.gate.field.password": "Password",
|
|
146
|
+
"auth.gate.field.captcha": "reCAPTCHA token (account only)",
|
|
147
|
+
"auth.gate.password.show": "Show password",
|
|
148
|
+
"auth.gate.password.hide": "Hide password",
|
|
149
|
+
"auth.gate.notice.codeResent": "A new code was sent.",
|
|
150
|
+
"auth.gate.notice.codeSentVia": "Code sent via {method}.",
|
|
151
|
+
"auth.gate.notice.resetSent": "If that email is registered, a reset link is on its way.",
|
|
152
|
+
"auth.biometric.unlockWith": "Unlock with {method}",
|
|
153
|
+
"auth.biometric.orPassword": "or sign in with your password",
|
|
154
|
+
"auth.biometric.label.faceId": "Face ID",
|
|
155
|
+
"auth.biometric.label.touchId": "Touch ID",
|
|
156
|
+
"auth.biometric.label.faceUnlock": "Face Unlock",
|
|
157
|
+
"auth.biometric.label.fingerprint": "Fingerprint",
|
|
158
|
+
"auth.biometric.label.generic": "biometrics",
|
|
159
|
+
"auth.biometric.prompt.usePassword": "Use password",
|
|
160
|
+
"auth.biometric.error.unavailable": "Biometric unlock isn't available on this device.",
|
|
161
|
+
"auth.biometric.error.cancelled": "Biometric unlock was cancelled.",
|
|
162
|
+
"auth.biometric.error.notEnrolled": "No Face ID / Touch ID is enrolled.",
|
|
163
|
+
"auth.biometric.error.failed": "Biometric unlock failed.",
|
|
164
|
+
"auth.biometric.error.invalidated": "Biometrics changed; sign in again.",
|
|
165
|
+
"auth.biometric.prompt.unlock": "Unlock your account",
|
|
166
|
+
"auth.biometric.prompt.disable": "Confirm to turn off biometric unlock",
|
|
167
|
+
"auth.biometric.enrollTitle": "Unlock with {method}?",
|
|
168
|
+
"auth.biometric.enrollMessage": "Use {method} instead of your password the next time you open the app.",
|
|
169
|
+
"auth.biometric.enrollAccept": "Use {method}",
|
|
170
|
+
"auth.biometric.enrollDecline": "Not now",
|
|
171
|
+
"auth.error.invalidCredentials": "Wrong email or password.",
|
|
172
|
+
"auth.error.accountNotFound": "We couldn't find an account for that email.",
|
|
173
|
+
"auth.error.emailInUse": "That email is already registered.",
|
|
174
|
+
"auth.error.verificationRequired": "Additional verification is required.",
|
|
175
|
+
"auth.error.verifyEmail": "Check your email to verify your account, then sign in.",
|
|
176
|
+
"auth.error.incorrectCode": "Incorrect code.",
|
|
177
|
+
"auth.error.network": "Network error.",
|
|
178
|
+
"auth.error.visitorToken": "Could not obtain a visitor token.",
|
|
179
|
+
"auth.error.noSessionToken": "Login succeeded but no session token.",
|
|
180
|
+
"auth.error.authSession": "Could not create an auth session.",
|
|
181
|
+
"auth.error.signInIncomplete": "Sign-in did not complete.",
|
|
182
|
+
"auth.error.tokenExchange": "Token exchange failed.",
|
|
183
|
+
"auth.error.noRedirect": "No auth redirect.",
|
|
184
|
+
"auth.error.registrationFailed": "Registration failed ({code}).",
|
|
185
|
+
"auth.error.twoFactorRequired": "Two-factor verification required.",
|
|
186
|
+
"auth.error.noPendingVerification": "No pending verification.",
|
|
187
|
+
"auth.error.verificationCancelled": "Verification cancelled.",
|
|
188
|
+
"auth.error.biometricSignInFirst": "Sign in before enabling biometric unlock.",
|
|
189
|
+
"auth.error.noSessionToProtect": "No session to protect.",
|
|
190
|
+
"auth.error.biometricEnableFailed": "Couldn't enable biometric unlock.",
|
|
191
|
+
"auth.error.biometricUnlockFailed": "Couldn't unlock. Sign in with your password.",
|
|
192
|
+
"auth.error.biometricsUnavailable": "Biometrics unavailable.",
|
|
193
|
+
"auth.error.noBiometricsEnrolled": "No biometrics enrolled.",
|
|
194
|
+
"auth.error.biometricNotEnabled": "Biometric unlock not enabled.",
|
|
195
|
+
"auth.error.unsupported": "Unsupported.",
|
|
196
|
+
"auth.error.methodUnavailable": "This sign-in method isn't available.",
|
|
197
|
+
"auth.error.verificationRequiredRetry": "Additional verification is required. Please try again.",
|
|
198
|
+
"auth.error.networkRetry": "Network error. Please try again.",
|
|
199
|
+
"auth.error.signInCancelled": "Sign-in was cancelled.",
|
|
200
|
+
"auth.error.genericRetry": "Something went wrong. Please try again.",
|
|
201
|
+
"auth.error.biometricLocked": "Locked: unlock with biometrics first.",
|
|
202
|
+
"auth.error.googleNoPresenter": "No presenter for Google sign-in.",
|
|
203
|
+
"auth.error.googleNoToken": "Google sign-in returned no id_token.",
|
|
204
|
+
"auth.error.appleNoToken": "Apple sign-in returned no token.",
|
|
205
|
+
"auth.error.memberSettingsUnreadable": "Could not read the site's member settings.",
|
|
206
|
+
"auth.error.memberSettingsMalformed": "Member settings response was not a JSON object.",
|
|
207
|
+
"auth.biometric.error.noCipher": "No cipher.",
|
|
208
|
+
"auth.error.unlockOvertaken": "Unlock overtaken by a sign-in or sign-out.",
|
|
209
|
+
"auth.gate.code.show": "Show code",
|
|
210
|
+
"auth.gate.code.hide": "Hide code",
|
|
211
|
+
"auth.feedback.invalid_input": "Check the highlighted fields and try again.",
|
|
212
|
+
"auth.feedback.invalid_credentials": "The email or password is incorrect. Check your details or reset your password.",
|
|
213
|
+
"auth.feedback.registration_failed": "We could not create an account. Check your details, or try signing in or resetting your password.",
|
|
214
|
+
"auth.feedback.invalid_code": "That code is invalid or has expired. Check the code or request a new one.",
|
|
215
|
+
"auth.feedback.expired_code": "That code has expired. Request a new code and try again.",
|
|
216
|
+
"auth.feedback.totp": "That code did not work. Enter the current code from your authenticator app.",
|
|
217
|
+
"auth.feedback.network": "We could not connect. Check your connection and try again.",
|
|
218
|
+
"auth.feedback.rate_limited": "Too many attempts. Wait a few minutes and try again.",
|
|
219
|
+
"auth.feedback.unavailable": "This action is not available here. Use a supported sign-in method or open the app.",
|
|
220
|
+
"auth.feedback.cancelled": "Sign-in was cancelled. Try again when you are ready.",
|
|
221
|
+
"auth.feedback.verification_required": "Complete verification to continue, then try again.",
|
|
222
|
+
"auth.feedback.unknown": "We could not complete this action. Please try again.",
|
|
223
|
+
"auth.validation.emailRequired": "Enter your email address.",
|
|
224
|
+
"auth.validation.emailInvalid": "Enter a valid email address.",
|
|
225
|
+
"auth.validation.passwordMinimum": "Use at least 8 characters for your new password.",
|
|
226
|
+
"auth.validation.passwordRequired": "Enter your password.",
|
|
227
|
+
"auth.validation.codeRequired": "Enter your verification code.",
|
|
228
|
+
"auth.validation.nameRequired": "Enter your name.",
|
|
229
|
+
"auth.feedback.busy": "Please wait\u2026",
|
|
230
|
+
"auth.gate.verify.title": "Verify your email",
|
|
231
|
+
"auth.gate.verify.body": "Enter the confirmation code sent to your email to finish signing in.",
|
|
232
|
+
"auth.gate.cancel": "Cancel",
|
|
233
|
+
"auth.gate.codePlaceholder": "Confirmation code"
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// ../../stdlib/flows/auth/src/feedback.ts
|
|
237
|
+
var failureKeys = {
|
|
238
|
+
invalid_input: "auth.feedback.invalid_input",
|
|
239
|
+
invalid_credentials: "auth.feedback.invalid_credentials",
|
|
240
|
+
registration_failed: "auth.feedback.registration_failed",
|
|
241
|
+
invalid_code: "auth.feedback.invalid_code",
|
|
242
|
+
expired_code: "auth.feedback.expired_code",
|
|
243
|
+
network: "auth.feedback.network",
|
|
244
|
+
rate_limited: "auth.feedback.rate_limited",
|
|
245
|
+
unavailable: "auth.feedback.unavailable",
|
|
246
|
+
cancelled: "auth.feedback.cancelled",
|
|
247
|
+
verification_required: "auth.feedback.verification_required",
|
|
248
|
+
unknown: "auth.feedback.unknown"
|
|
249
|
+
};
|
|
250
|
+
var codes = new Set(Object.keys(failureKeys));
|
|
251
|
+
var aliases = {
|
|
252
|
+
invalidCredentials: "invalid_credentials",
|
|
253
|
+
emailInUse: "registration_failed",
|
|
254
|
+
unsupported: "unavailable",
|
|
255
|
+
recaptchaRequired: "verification_required",
|
|
256
|
+
needsTwoFactor: "verification_required",
|
|
257
|
+
INVALID_CREDENTIALS: "invalid_credentials",
|
|
258
|
+
EMAIL_IN_USE: "registration_failed",
|
|
259
|
+
UNSUPPORTED: "unavailable",
|
|
260
|
+
NETWORK: "network",
|
|
261
|
+
CANCELLED: "cancelled",
|
|
262
|
+
RECAPTCHA_REQUIRED: "verification_required",
|
|
263
|
+
INVALID_CODE: "invalid_code",
|
|
264
|
+
EXPIRED_CODE: "expired_code",
|
|
265
|
+
TOO_MANY_REQUESTS: "rate_limited"
|
|
266
|
+
};
|
|
267
|
+
function authMessage(key, translate) {
|
|
268
|
+
const translated = translate?.(key);
|
|
269
|
+
return translated && translated !== key ? translated : copy_generated_default[key] ?? copy_generated_default["auth.feedback.unknown"];
|
|
270
|
+
}
|
|
271
|
+
function authFailure(raw, operation = "signIn", translate) {
|
|
272
|
+
const value = raw && typeof raw === "object" ? raw : {};
|
|
273
|
+
const payload = value.payload && typeof value.payload === "object" ? value.payload : value;
|
|
274
|
+
const named = payload.code ?? value.code ?? value.kind;
|
|
275
|
+
const status = value.statusCode ?? value.status;
|
|
276
|
+
let code = codes.has(named) ? named : aliases[named] ?? "unknown";
|
|
277
|
+
if (status === 429) code = "rate_limited";
|
|
278
|
+
else if ([404, 405, 501].includes(status)) code = "unavailable";
|
|
279
|
+
else if ([401, 403].includes(status) && operation === "signIn") code = "invalid_credentials";
|
|
280
|
+
else if (status === 0 || status >= 500 || value.name === "TypeError" || value.name === "TimeoutError") code = "network";
|
|
281
|
+
if (operation === "verify" && code === "invalid_credentials") code = "invalid_code";
|
|
282
|
+
if (operation === "register" && code === "invalid_credentials") code = "registration_failed";
|
|
283
|
+
return { code, reason: authMessage(failureKeys[code], translate) };
|
|
284
|
+
}
|
|
285
|
+
function identityErrors(input, operation, requireName = false) {
|
|
286
|
+
const errors = {};
|
|
287
|
+
if (operation === "verify") {
|
|
288
|
+
if (!input.code?.trim()) errors.code = "auth.validation.codeRequired";
|
|
289
|
+
return errors;
|
|
290
|
+
}
|
|
291
|
+
const email = input.email?.trim() ?? "";
|
|
292
|
+
if (!email) errors.email = "auth.validation.emailRequired";
|
|
293
|
+
else if (validate({ type: "email" }, email)) errors.email = "auth.validation.emailInvalid";
|
|
294
|
+
if ((operation === "signIn" || operation === "register") && !input.password?.length) errors.password = "auth.validation.passwordRequired";
|
|
295
|
+
if (operation === "register" && requireName && !input.name?.trim()) errors.name = "auth.validation.nameRequired";
|
|
296
|
+
return errors;
|
|
297
|
+
}
|
|
298
|
+
|
|
12
299
|
// ../../stdlib/flows/auth/src/index.ts
|
|
13
300
|
async function dispatch(handlerId, params) {
|
|
14
301
|
const fn = globalThis.himalaya?.dispatch;
|
|
@@ -23,12 +310,6 @@ function emailOf(raw) {
|
|
|
23
310
|
const email = direct?.email ?? wrapped?.payload?.email;
|
|
24
311
|
return typeof email === "string" ? email : "";
|
|
25
312
|
}
|
|
26
|
-
function reasonOf(raw, fallback) {
|
|
27
|
-
const direct = raw;
|
|
28
|
-
const wrapped = raw;
|
|
29
|
-
const err = direct?.error ?? wrapped?.payload?.error;
|
|
30
|
-
return typeof err === "string" && err ? err : fallback;
|
|
31
|
-
}
|
|
32
313
|
function reportedOk(raw) {
|
|
33
314
|
const status = raw?.status;
|
|
34
315
|
if (typeof status !== "string") return true;
|
|
@@ -49,9 +330,9 @@ async function attempt(action2, params, failureText, opts) {
|
|
|
49
330
|
try {
|
|
50
331
|
raw = await dispatch(id(opts, action2), params);
|
|
51
332
|
} catch (e) {
|
|
52
|
-
return { ok: false,
|
|
333
|
+
return { ok: false, ...authFailure(e, action2 === "registerDirect" ? "register" : "signIn") };
|
|
53
334
|
}
|
|
54
|
-
if (!reportedOk(raw)) return { ok: false,
|
|
335
|
+
if (!reportedOk(raw) || raw?.error || raw?.payload?.error) return { ok: false, ...authFailure(raw, action2 === "registerDirect" ? "register" : "signIn") };
|
|
55
336
|
const state = await authState(opts);
|
|
56
337
|
if (!state.signedIn) {
|
|
57
338
|
return { ok: false, reason: failureText };
|
|
@@ -59,24 +340,24 @@ async function attempt(action2, params, failureText, opts) {
|
|
|
59
340
|
return { ok: true, email: state.email };
|
|
60
341
|
}
|
|
61
342
|
function signInDirect(email, password, opts) {
|
|
62
|
-
if (
|
|
63
|
-
return Promise.resolve({ ok: false,
|
|
343
|
+
if (Object.keys(identityErrors({ email: email.trim(), password }, "signIn")).length) {
|
|
344
|
+
return Promise.resolve({ ok: false, code: "invalid_input", reason: authMessage("auth.feedback.invalid_input") });
|
|
64
345
|
}
|
|
65
346
|
return attempt(
|
|
66
347
|
"signInDirect",
|
|
67
|
-
{ email, password },
|
|
348
|
+
{ email: email.trim(), password },
|
|
68
349
|
"Sign-in did not complete. Please try again.",
|
|
69
350
|
opts
|
|
70
351
|
);
|
|
71
352
|
}
|
|
72
353
|
function registerMember(email, password, profile, opts) {
|
|
73
|
-
if (
|
|
74
|
-
return Promise.resolve({ ok: false,
|
|
354
|
+
if (Object.keys(identityErrors({ email: email.trim(), password }, "register")).length) {
|
|
355
|
+
return Promise.resolve({ ok: false, code: "invalid_input", reason: authMessage("auth.feedback.invalid_input") });
|
|
75
356
|
}
|
|
76
357
|
return attempt(
|
|
77
358
|
"registerDirect",
|
|
78
359
|
{
|
|
79
|
-
email,
|
|
360
|
+
email: email.trim(),
|
|
80
361
|
password,
|
|
81
362
|
...profile?.firstName ? { firstName: profile.firstName } : {},
|
|
82
363
|
...profile?.lastName ? { lastName: profile.lastName } : {}
|
|
@@ -1357,21 +1638,21 @@ function toPayment(raw, status) {
|
|
|
1357
1638
|
const ids = { paymentId: raw.id, appId: raw.appId, memberId: raw.memberId, wixTransactionId: raw.wixTransactionId };
|
|
1358
1639
|
return { ...ids, status, ...withoutUndefined(optional) };
|
|
1359
1640
|
}
|
|
1360
|
-
function classifyFailure(error, operation,
|
|
1641
|
+
function classifyFailure(error, operation, codes2) {
|
|
1361
1642
|
const message = messageOf(error);
|
|
1362
1643
|
if (BRIDGE_REFUSAL.test(message)) return failure(operation, "notEnabled");
|
|
1363
1644
|
if (PRINCIPAL_CHANGED.test(message)) return failure(operation, "sessionChanged");
|
|
1364
1645
|
const http = /^HTTP (\d{3})(?: \[([^\]]+)\])?:/.exec(message);
|
|
1365
1646
|
if (!http) return failure(operation, "unavailable");
|
|
1366
|
-
return classifyHttp({ operation, codes, httpStatus: Number(http[1]), code: http[2] ?? "" });
|
|
1647
|
+
return classifyHttp({ operation, codes: codes2, httpStatus: Number(http[1]), code: http[2] ?? "" });
|
|
1367
1648
|
}
|
|
1368
1649
|
function failure(operation, kind) {
|
|
1369
1650
|
return { status: "failed", operation, kind };
|
|
1370
1651
|
}
|
|
1371
1652
|
function classifyHttp(refusal) {
|
|
1372
|
-
const { operation, codes, httpStatus, code } = refusal;
|
|
1653
|
+
const { operation, codes: codes2, httpStatus, code } = refusal;
|
|
1373
1654
|
if (code === "PRINCIPAL_CHANGED") return failure(operation, "sessionChanged");
|
|
1374
|
-
if (isOneOf(
|
|
1655
|
+
if (isOneOf(codes2, code)) return { status: "failed", operation, kind: "application", code, httpStatus };
|
|
1375
1656
|
return { status: "failed", operation, kind: kindForStatus(httpStatus, code), httpStatus };
|
|
1376
1657
|
}
|
|
1377
1658
|
function kindForStatus(httpStatus, code) {
|
|
@@ -1400,8 +1681,8 @@ function withoutUndefined(value) {
|
|
|
1400
1681
|
}
|
|
1401
1682
|
return kept;
|
|
1402
1683
|
}
|
|
1403
|
-
function isOneOf(
|
|
1404
|
-
return
|
|
1684
|
+
function isOneOf(codes2, code) {
|
|
1685
|
+
return codes2.includes(code);
|
|
1405
1686
|
}
|
|
1406
1687
|
function ownValue(table, key) {
|
|
1407
1688
|
return typeof key === "string" && Object.prototype.hasOwnProperty.call(table, key) ? table[key] : void 0;
|
|
@@ -3230,6 +3511,81 @@ var text = (id2, value, style = "body") => node(id2, "Text", { text: value, styl
|
|
|
3230
3511
|
var vstack = (id2, children, spacing = 12, alignment = "leading") => node(id2, "VStack", { spacing, alignment, children });
|
|
3231
3512
|
var button = (id2, title, action2, style = "primary") => node(id2, "Button", { title, style, fullWidth: true, action: action2 });
|
|
3232
3513
|
var openScreen = (screenId) => ({ actionId: "himi.open", params: { screenId } });
|
|
3514
|
+
function detailedHeader(opts) {
|
|
3515
|
+
const id2 = opts.id ?? "detailed_header";
|
|
3516
|
+
const cardChildren = [];
|
|
3517
|
+
if (opts.logoUrl || opts.locationLabel) {
|
|
3518
|
+
const identity = [];
|
|
3519
|
+
if (opts.logoUrl) {
|
|
3520
|
+
identity.push(node(`${id2}.logo`, "Image", {
|
|
3521
|
+
url: opts.logoUrl,
|
|
3522
|
+
width: 56,
|
|
3523
|
+
height: 56,
|
|
3524
|
+
shape: "rounded",
|
|
3525
|
+
contentMode: "fill",
|
|
3526
|
+
contentDescription: opts.title
|
|
3527
|
+
}));
|
|
3528
|
+
}
|
|
3529
|
+
if (opts.locationLabel) {
|
|
3530
|
+
if (opts.locationAction) {
|
|
3531
|
+
identity.push(node(`${id2}.locationGroup`, "HStack", {
|
|
3532
|
+
spacing: 8,
|
|
3533
|
+
alignment: "center",
|
|
3534
|
+
children: [
|
|
3535
|
+
text(`${id2}.location`, opts.locationLabel, "caption"),
|
|
3536
|
+
node(`${id2}.location.action`, "Button", {
|
|
3537
|
+
title: opts.locationAction.label,
|
|
3538
|
+
style: opts.locationAction.style ?? "plain",
|
|
3539
|
+
fullWidth: false,
|
|
3540
|
+
action: opts.locationAction.action
|
|
3541
|
+
})
|
|
3542
|
+
]
|
|
3543
|
+
}));
|
|
3544
|
+
} else {
|
|
3545
|
+
identity.push(text(`${id2}.location`, opts.locationLabel, "caption"));
|
|
3546
|
+
}
|
|
3547
|
+
}
|
|
3548
|
+
cardChildren.push(node(`${id2}.identity`, "HStack", { spacing: 12, alignment: "center", children: identity }));
|
|
3549
|
+
}
|
|
3550
|
+
if (opts.memberCaption || opts.memberAvatarsPath || opts.memberAvatars?.length) {
|
|
3551
|
+
cardChildren.push(node(`${id2}.members`, "AvatarStrip", {
|
|
3552
|
+
size: 36,
|
|
3553
|
+
maxVisible: 5,
|
|
3554
|
+
...opts.memberCaption ? { caption: opts.memberCaption } : {},
|
|
3555
|
+
...opts.memberAvatarsPath ? { avatarsPath: opts.memberAvatarsPath } : {},
|
|
3556
|
+
...!opts.memberAvatarsPath && opts.memberAvatars ? { avatars: opts.memberAvatars } : {}
|
|
3557
|
+
}));
|
|
3558
|
+
}
|
|
3559
|
+
for (const [key, action2] of [
|
|
3560
|
+
["invite", opts.inviteAction],
|
|
3561
|
+
["primary", opts.primaryAction],
|
|
3562
|
+
["about", opts.aboutAction]
|
|
3563
|
+
]) {
|
|
3564
|
+
if (action2) cardChildren.push(button(`${id2}.${key}`, action2.label, action2.action, action2.style ?? (key === "primary" ? "primary" : "secondary")));
|
|
3565
|
+
}
|
|
3566
|
+
const card = node(`${id2}.card`, "VStack", {
|
|
3567
|
+
spacing: 14,
|
|
3568
|
+
alignment: "leading",
|
|
3569
|
+
children: cardChildren
|
|
3570
|
+
});
|
|
3571
|
+
card.modifiers = {
|
|
3572
|
+
background: { token: "surfacePrimary" },
|
|
3573
|
+
cornerRadius: 24,
|
|
3574
|
+
padding: { leading: 20, trailing: 20, top: 20, bottom: 20 },
|
|
3575
|
+
offsetY: -20,
|
|
3576
|
+
fillMaxWidth: true
|
|
3577
|
+
};
|
|
3578
|
+
const fixed = opts.collapsible === false;
|
|
3579
|
+
return node(id2, "CollapsingHeader", {
|
|
3580
|
+
...opts.imageUrl ? { imageUrl: opts.imageUrl } : {},
|
|
3581
|
+
title: opts.title,
|
|
3582
|
+
...opts.subtitle ? { subtitle: opts.subtitle } : {},
|
|
3583
|
+
expandedHeight: fixed ? opts.expandedHeight ?? 240 : opts.expandedHeight ?? 280,
|
|
3584
|
+
collapsedHeight: fixed ? opts.expandedHeight ?? 240 : opts.collapsedHeight ?? 68,
|
|
3585
|
+
children: [...cardChildren.length ? [card] : [], ...opts.content ?? []],
|
|
3586
|
+
parallaxFactor: 0.45
|
|
3587
|
+
});
|
|
3588
|
+
}
|
|
3233
3589
|
function envelope(screenId, title, root, logic) {
|
|
3234
3590
|
return {
|
|
3235
3591
|
screenId,
|
|
@@ -3807,6 +4163,7 @@ export {
|
|
|
3807
4163
|
checkoutScreen,
|
|
3808
4164
|
createAuthService,
|
|
3809
4165
|
createCheckoutService,
|
|
4166
|
+
detailedHeader,
|
|
3810
4167
|
entitlement
|
|
3811
4168
|
};
|
|
3812
4169
|
//# sourceMappingURL=screens.mjs.map
|