@hook-sdk/template 0.13.0 → 0.14.1
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/index.cjs +335 -166
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -1
- package/dist/index.d.ts +34 -1
- package/dist/index.js +311 -142
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -61,6 +61,14 @@ type AppConfig = {
|
|
|
61
61
|
branding: {
|
|
62
62
|
primaryColor: string;
|
|
63
63
|
logoUrl: string;
|
|
64
|
+
/**
|
|
65
|
+
* Optional. When set, InstallSplash uses this as the app icon (vs.
|
|
66
|
+
* falling back to logoUrl, then to the "first letter of name"
|
|
67
|
+
* generic). Apps that have a distinct app-icon asset should set
|
|
68
|
+
* this; apps where logoUrl already serves both roles can leave it
|
|
69
|
+
* unset (logoUrl is used as the icon).
|
|
70
|
+
*/
|
|
71
|
+
iconUrl?: string;
|
|
64
72
|
};
|
|
65
73
|
authFlow: AuthFlowConfig;
|
|
66
74
|
paywall: PaywallConfig;
|
|
@@ -200,9 +208,15 @@ interface UseLoginFormResult {
|
|
|
200
208
|
email: string;
|
|
201
209
|
setEmail: (v: string) => void;
|
|
202
210
|
emailError: string | null;
|
|
211
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
212
|
+
markEmailTouched: () => void;
|
|
203
213
|
password: string;
|
|
204
214
|
setPassword: (v: string) => void;
|
|
205
215
|
passwordError: string | null;
|
|
216
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
217
|
+
markPasswordTouched: () => void;
|
|
218
|
+
/** True after the user has attempted submit at least once. */
|
|
219
|
+
formSubmitAttempted: boolean;
|
|
206
220
|
/**
|
|
207
221
|
* Submete o form. Retorna true se o login deu OK (cookies setados), false
|
|
208
222
|
* se validação falhou, credenciais inválidas, rate-limit ou erro de rede.
|
|
@@ -225,12 +239,20 @@ interface UseSignupFormResult {
|
|
|
225
239
|
name: string;
|
|
226
240
|
setName: (v: string) => void;
|
|
227
241
|
nameError: string | null;
|
|
242
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
243
|
+
markNameTouched: () => void;
|
|
228
244
|
email: string;
|
|
229
245
|
setEmail: (v: string) => void;
|
|
230
246
|
emailError: string | null;
|
|
247
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
248
|
+
markEmailTouched: () => void;
|
|
231
249
|
password: string;
|
|
232
250
|
setPassword: (v: string) => void;
|
|
233
251
|
passwordError: string | null;
|
|
252
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
253
|
+
markPasswordTouched: () => void;
|
|
254
|
+
/** True after the user has attempted submit at least once. */
|
|
255
|
+
formSubmitAttempted: boolean;
|
|
234
256
|
/**
|
|
235
257
|
* Submete o form. Retorna true se o signup deu OK (backend respondeu 2xx),
|
|
236
258
|
* false se validação falhou, houve erro de rede/servidor, ou email já em uso.
|
|
@@ -254,6 +276,10 @@ interface UseForgotFormResult {
|
|
|
254
276
|
email: string;
|
|
255
277
|
setEmail: (v: string) => void;
|
|
256
278
|
emailError: string | null;
|
|
279
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
280
|
+
markEmailTouched: () => void;
|
|
281
|
+
/** True after the user has attempted submit at least once. */
|
|
282
|
+
formSubmitAttempted: boolean;
|
|
257
283
|
/**
|
|
258
284
|
* Submete o form. Retorna true se o backend aceitou a requisição (email
|
|
259
285
|
* de reset foi enfileirado — sem leak de "existe esse email" por design),
|
|
@@ -274,9 +300,15 @@ interface UseResetFormResult {
|
|
|
274
300
|
password: string;
|
|
275
301
|
setPassword: (v: string) => void;
|
|
276
302
|
passwordError: string | null;
|
|
303
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
304
|
+
markPasswordTouched: () => void;
|
|
277
305
|
confirm: string;
|
|
278
306
|
setConfirm: (v: string) => void;
|
|
279
307
|
confirmError: string | null;
|
|
308
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
309
|
+
markConfirmTouched: () => void;
|
|
310
|
+
/** True after the user has attempted submit at least once. */
|
|
311
|
+
formSubmitAttempted: boolean;
|
|
280
312
|
submit: () => Promise<void>;
|
|
281
313
|
submitting: boolean;
|
|
282
314
|
canSubmit: boolean;
|
|
@@ -632,7 +664,7 @@ type Platform = 'android' | 'ios-safari' | 'ios-other' | 'in-app' | 'desktop' |
|
|
|
632
664
|
type IOSBrowser = 'safari' | 'chrome' | 'firefox' | 'edge' | 'other';
|
|
633
665
|
type AndroidBrowser = 'chrome' | 'firefox' | 'opera' | 'samsung' | 'edge' | 'other';
|
|
634
666
|
type InAppApp = 'instagram' | 'facebook' | 'tiktok' | 'whatsapp' | 'twitter' | 'linkedin' | 'telegram' | 'line' | 'snapchat' | 'pinterest' | 'wechat' | 'other';
|
|
635
|
-
type InstallVariant = 'android-native' | 'android-manual' | 'ios-safari' | 'ios-other' | 'in-app' | 'desktop' | 'none';
|
|
667
|
+
type InstallVariant = 'android-native' | 'android-manual' | 'android-pending' | 'ios-safari' | 'ios-other' | 'in-app' | 'desktop' | 'none';
|
|
636
668
|
interface BeforeInstallPromptEvent extends Event {
|
|
637
669
|
prompt: () => Promise<void>;
|
|
638
670
|
userChoice: Promise<{
|
|
@@ -765,6 +797,7 @@ declare const AppConfigSchema: z.ZodObject<{
|
|
|
765
797
|
branding: z.ZodObject<{
|
|
766
798
|
primaryColor: z.ZodString;
|
|
767
799
|
logoUrl: z.ZodString;
|
|
800
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
768
801
|
}, z.core.$strip>;
|
|
769
802
|
authFlow: z.ZodObject<{
|
|
770
803
|
minPassword: z.ZodNumber;
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,14 @@ type AppConfig = {
|
|
|
61
61
|
branding: {
|
|
62
62
|
primaryColor: string;
|
|
63
63
|
logoUrl: string;
|
|
64
|
+
/**
|
|
65
|
+
* Optional. When set, InstallSplash uses this as the app icon (vs.
|
|
66
|
+
* falling back to logoUrl, then to the "first letter of name"
|
|
67
|
+
* generic). Apps that have a distinct app-icon asset should set
|
|
68
|
+
* this; apps where logoUrl already serves both roles can leave it
|
|
69
|
+
* unset (logoUrl is used as the icon).
|
|
70
|
+
*/
|
|
71
|
+
iconUrl?: string;
|
|
64
72
|
};
|
|
65
73
|
authFlow: AuthFlowConfig;
|
|
66
74
|
paywall: PaywallConfig;
|
|
@@ -200,9 +208,15 @@ interface UseLoginFormResult {
|
|
|
200
208
|
email: string;
|
|
201
209
|
setEmail: (v: string) => void;
|
|
202
210
|
emailError: string | null;
|
|
211
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
212
|
+
markEmailTouched: () => void;
|
|
203
213
|
password: string;
|
|
204
214
|
setPassword: (v: string) => void;
|
|
205
215
|
passwordError: string | null;
|
|
216
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
217
|
+
markPasswordTouched: () => void;
|
|
218
|
+
/** True after the user has attempted submit at least once. */
|
|
219
|
+
formSubmitAttempted: boolean;
|
|
206
220
|
/**
|
|
207
221
|
* Submete o form. Retorna true se o login deu OK (cookies setados), false
|
|
208
222
|
* se validação falhou, credenciais inválidas, rate-limit ou erro de rede.
|
|
@@ -225,12 +239,20 @@ interface UseSignupFormResult {
|
|
|
225
239
|
name: string;
|
|
226
240
|
setName: (v: string) => void;
|
|
227
241
|
nameError: string | null;
|
|
242
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
243
|
+
markNameTouched: () => void;
|
|
228
244
|
email: string;
|
|
229
245
|
setEmail: (v: string) => void;
|
|
230
246
|
emailError: string | null;
|
|
247
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
248
|
+
markEmailTouched: () => void;
|
|
231
249
|
password: string;
|
|
232
250
|
setPassword: (v: string) => void;
|
|
233
251
|
passwordError: string | null;
|
|
252
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
253
|
+
markPasswordTouched: () => void;
|
|
254
|
+
/** True after the user has attempted submit at least once. */
|
|
255
|
+
formSubmitAttempted: boolean;
|
|
234
256
|
/**
|
|
235
257
|
* Submete o form. Retorna true se o signup deu OK (backend respondeu 2xx),
|
|
236
258
|
* false se validação falhou, houve erro de rede/servidor, ou email já em uso.
|
|
@@ -254,6 +276,10 @@ interface UseForgotFormResult {
|
|
|
254
276
|
email: string;
|
|
255
277
|
setEmail: (v: string) => void;
|
|
256
278
|
emailError: string | null;
|
|
279
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
280
|
+
markEmailTouched: () => void;
|
|
281
|
+
/** True after the user has attempted submit at least once. */
|
|
282
|
+
formSubmitAttempted: boolean;
|
|
257
283
|
/**
|
|
258
284
|
* Submete o form. Retorna true se o backend aceitou a requisição (email
|
|
259
285
|
* de reset foi enfileirado — sem leak de "existe esse email" por design),
|
|
@@ -274,9 +300,15 @@ interface UseResetFormResult {
|
|
|
274
300
|
password: string;
|
|
275
301
|
setPassword: (v: string) => void;
|
|
276
302
|
passwordError: string | null;
|
|
303
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
304
|
+
markPasswordTouched: () => void;
|
|
277
305
|
confirm: string;
|
|
278
306
|
setConfirm: (v: string) => void;
|
|
279
307
|
confirmError: string | null;
|
|
308
|
+
/** Wave 5 #42: call on input blur so the error becomes visible. */
|
|
309
|
+
markConfirmTouched: () => void;
|
|
310
|
+
/** True after the user has attempted submit at least once. */
|
|
311
|
+
formSubmitAttempted: boolean;
|
|
280
312
|
submit: () => Promise<void>;
|
|
281
313
|
submitting: boolean;
|
|
282
314
|
canSubmit: boolean;
|
|
@@ -632,7 +664,7 @@ type Platform = 'android' | 'ios-safari' | 'ios-other' | 'in-app' | 'desktop' |
|
|
|
632
664
|
type IOSBrowser = 'safari' | 'chrome' | 'firefox' | 'edge' | 'other';
|
|
633
665
|
type AndroidBrowser = 'chrome' | 'firefox' | 'opera' | 'samsung' | 'edge' | 'other';
|
|
634
666
|
type InAppApp = 'instagram' | 'facebook' | 'tiktok' | 'whatsapp' | 'twitter' | 'linkedin' | 'telegram' | 'line' | 'snapchat' | 'pinterest' | 'wechat' | 'other';
|
|
635
|
-
type InstallVariant = 'android-native' | 'android-manual' | 'ios-safari' | 'ios-other' | 'in-app' | 'desktop' | 'none';
|
|
667
|
+
type InstallVariant = 'android-native' | 'android-manual' | 'android-pending' | 'ios-safari' | 'ios-other' | 'in-app' | 'desktop' | 'none';
|
|
636
668
|
interface BeforeInstallPromptEvent extends Event {
|
|
637
669
|
prompt: () => Promise<void>;
|
|
638
670
|
userChoice: Promise<{
|
|
@@ -765,6 +797,7 @@ declare const AppConfigSchema: z.ZodObject<{
|
|
|
765
797
|
branding: z.ZodObject<{
|
|
766
798
|
primaryColor: z.ZodString;
|
|
767
799
|
logoUrl: z.ZodString;
|
|
800
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
768
801
|
}, z.core.$strip>;
|
|
769
802
|
authFlow: z.ZodObject<{
|
|
770
803
|
minPassword: z.ZodNumber;
|