@hook-sdk/template 0.4.0 → 0.4.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 +322 -245
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +322 -245
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -458,14 +458,8 @@ function useInstallPrompt(slug) {
|
|
|
458
458
|
setIsDismissedPermanent(true);
|
|
459
459
|
track("pwa_install_permanent_dismiss", { slug, platform, prior_skip_count: skipCount });
|
|
460
460
|
}, [slug, platform, skipCount]);
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
track("pwa_install_redirect_to_safari", { slug });
|
|
464
|
-
const url = `safari-https://${location.host}${location.pathname}${location.search}${location.hash}`;
|
|
465
|
-
try {
|
|
466
|
-
window.location.href = url;
|
|
467
|
-
} catch {
|
|
468
|
-
}
|
|
461
|
+
const showIOSOtherHelp = (0, import_react5.useCallback)(() => {
|
|
462
|
+
track("pwa_install_ios_other_help_shown", { slug });
|
|
469
463
|
}, [slug]);
|
|
470
464
|
const copyLink = (0, import_react5.useCallback)(async () => {
|
|
471
465
|
if (typeof navigator === "undefined" || typeof location === "undefined") return;
|
|
@@ -505,7 +499,7 @@ function useInstallPrompt(slug) {
|
|
|
505
499
|
promptInstall,
|
|
506
500
|
dismissSession,
|
|
507
501
|
dismissPermanent,
|
|
508
|
-
|
|
502
|
+
showIOSOtherHelp,
|
|
509
503
|
copyLink,
|
|
510
504
|
reset
|
|
511
505
|
};
|
|
@@ -571,7 +565,17 @@ var INSTALL_COPY = {
|
|
|
571
565
|
ctaSecondary: "Copiar link",
|
|
572
566
|
copiedToast: "Link copiado. Cole no Safari.",
|
|
573
567
|
skip: "Continuar mesmo assim",
|
|
574
|
-
skipPermanent: "N\xE3o me pergunte mais"
|
|
568
|
+
skipPermanent: "N\xE3o me pergunte mais",
|
|
569
|
+
help: {
|
|
570
|
+
step1: {
|
|
571
|
+
title: "Toque em \u22EF ou no bot\xE3o compartilhar",
|
|
572
|
+
subtitle: "Na barra inferior ou superior do navegador"
|
|
573
|
+
},
|
|
574
|
+
step2: {
|
|
575
|
+
title: 'Escolha "Abrir no Safari"',
|
|
576
|
+
subtitle: "O app vai abrir direto no Safari"
|
|
577
|
+
}
|
|
578
|
+
}
|
|
575
579
|
},
|
|
576
580
|
inApp: {
|
|
577
581
|
instagram: {
|
|
@@ -964,22 +968,70 @@ function Step({ n, icon, children }) {
|
|
|
964
968
|
);
|
|
965
969
|
}
|
|
966
970
|
|
|
967
|
-
// src/components/InstallGate/
|
|
971
|
+
// src/components/InstallGate/Step.tsx
|
|
968
972
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
973
|
+
function Step2({
|
|
974
|
+
n,
|
|
975
|
+
title,
|
|
976
|
+
subtitle,
|
|
977
|
+
visual
|
|
978
|
+
}) {
|
|
979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
980
|
+
"div",
|
|
981
|
+
{
|
|
982
|
+
style: {
|
|
983
|
+
display: "flex",
|
|
984
|
+
alignItems: "flex-start",
|
|
985
|
+
gap: 12,
|
|
986
|
+
marginBottom: 16,
|
|
987
|
+
textAlign: "left"
|
|
988
|
+
},
|
|
989
|
+
children: [
|
|
990
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
991
|
+
"div",
|
|
992
|
+
{
|
|
993
|
+
style: {
|
|
994
|
+
width: 32,
|
|
995
|
+
height: 32,
|
|
996
|
+
borderRadius: 10,
|
|
997
|
+
background: "var(--hook-color-primary)",
|
|
998
|
+
color: "#fff",
|
|
999
|
+
display: "flex",
|
|
1000
|
+
alignItems: "center",
|
|
1001
|
+
justifyContent: "center",
|
|
1002
|
+
fontSize: 15,
|
|
1003
|
+
fontWeight: 700,
|
|
1004
|
+
flexShrink: 0
|
|
1005
|
+
},
|
|
1006
|
+
children: n
|
|
1007
|
+
}
|
|
1008
|
+
),
|
|
1009
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { flex: 1 }, children: [
|
|
1010
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: { margin: 0, fontSize: 15, fontWeight: 500, color: "#111", lineHeight: 1.3 }, children: title }),
|
|
1011
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: { margin: "4px 0 0 0", fontSize: 13, color: "#777" }, children: subtitle }),
|
|
1012
|
+
visual
|
|
1013
|
+
] })
|
|
1014
|
+
]
|
|
1015
|
+
}
|
|
1016
|
+
);
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
// src/components/InstallGate/variants/IOSafariVariant.tsx
|
|
1020
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
969
1021
|
function IOSafariVariant({
|
|
970
1022
|
state,
|
|
971
1023
|
actions
|
|
972
1024
|
}) {
|
|
973
1025
|
const copy = INSTALL_COPY.iosSafari;
|
|
974
1026
|
const showPermanent = shouldShowPermanentOption(state);
|
|
975
|
-
return /* @__PURE__ */ (0,
|
|
976
|
-
/* @__PURE__ */ (0,
|
|
1027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(InstallSplash, { title: copy.title, subtitle: copy.subtitle, children: [
|
|
1028
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
977
1029
|
Step2,
|
|
978
1030
|
{
|
|
979
1031
|
n: 1,
|
|
980
1032
|
title: copy.step1.title,
|
|
981
1033
|
subtitle: copy.step1.subtitle,
|
|
982
|
-
visual: /* @__PURE__ */ (0,
|
|
1034
|
+
visual: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
983
1035
|
"div",
|
|
984
1036
|
{
|
|
985
1037
|
style: {
|
|
@@ -991,17 +1043,17 @@ function IOSafariVariant({
|
|
|
991
1043
|
padding: "12px 0",
|
|
992
1044
|
marginTop: 8
|
|
993
1045
|
},
|
|
994
|
-
children: /* @__PURE__ */ (0,
|
|
1046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ShareIconIOS, { size: 32, style: { color: "var(--hook-color-primary)" } })
|
|
995
1047
|
}
|
|
996
1048
|
)
|
|
997
1049
|
}
|
|
998
1050
|
),
|
|
999
|
-
/* @__PURE__ */ (0,
|
|
1051
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1000
1052
|
Step2,
|
|
1001
1053
|
{
|
|
1002
1054
|
n: 2,
|
|
1003
1055
|
title: copy.step2.title,
|
|
1004
|
-
visual: /* @__PURE__ */ (0,
|
|
1056
|
+
visual: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1005
1057
|
"div",
|
|
1006
1058
|
{
|
|
1007
1059
|
style: {
|
|
@@ -1014,19 +1066,19 @@ function IOSafariVariant({
|
|
|
1014
1066
|
marginTop: 8
|
|
1015
1067
|
},
|
|
1016
1068
|
children: [
|
|
1017
|
-
/* @__PURE__ */ (0,
|
|
1018
|
-
/* @__PURE__ */ (0,
|
|
1069
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SquarePlusIcon, { size: 22, style: { color: "#555" } }),
|
|
1070
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 14, color: "#333" }, children: copy.step2.iconLabel })
|
|
1019
1071
|
]
|
|
1020
1072
|
}
|
|
1021
1073
|
)
|
|
1022
1074
|
}
|
|
1023
1075
|
),
|
|
1024
|
-
/* @__PURE__ */ (0,
|
|
1076
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1025
1077
|
Step2,
|
|
1026
1078
|
{
|
|
1027
1079
|
n: 3,
|
|
1028
1080
|
title: copy.step3.title,
|
|
1029
|
-
visual: /* @__PURE__ */ (0,
|
|
1081
|
+
visual: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1030
1082
|
"div",
|
|
1031
1083
|
{
|
|
1032
1084
|
style: {
|
|
@@ -1037,7 +1089,7 @@ function IOSafariVariant({
|
|
|
1037
1089
|
padding: "10px 14px",
|
|
1038
1090
|
marginTop: 8
|
|
1039
1091
|
},
|
|
1040
|
-
children: /* @__PURE__ */ (0,
|
|
1092
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1041
1093
|
"span",
|
|
1042
1094
|
{
|
|
1043
1095
|
style: {
|
|
@@ -1052,7 +1104,7 @@ function IOSafariVariant({
|
|
|
1052
1104
|
)
|
|
1053
1105
|
}
|
|
1054
1106
|
),
|
|
1055
|
-
/* @__PURE__ */ (0,
|
|
1107
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1056
1108
|
"button",
|
|
1057
1109
|
{
|
|
1058
1110
|
"data-testid": "install-prompt-skip-session",
|
|
@@ -1062,7 +1114,7 @@ function IOSafariVariant({
|
|
|
1062
1114
|
children: copy.skip
|
|
1063
1115
|
}
|
|
1064
1116
|
),
|
|
1065
|
-
showPermanent && /* @__PURE__ */ (0,
|
|
1117
|
+
showPermanent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1066
1118
|
"button",
|
|
1067
1119
|
{
|
|
1068
1120
|
"data-testid": "install-prompt-skip-permanent",
|
|
@@ -1074,55 +1126,10 @@ function IOSafariVariant({
|
|
|
1074
1126
|
)
|
|
1075
1127
|
] });
|
|
1076
1128
|
}
|
|
1077
|
-
function Step2({
|
|
1078
|
-
n,
|
|
1079
|
-
title,
|
|
1080
|
-
subtitle,
|
|
1081
|
-
visual
|
|
1082
|
-
}) {
|
|
1083
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1084
|
-
"div",
|
|
1085
|
-
{
|
|
1086
|
-
style: {
|
|
1087
|
-
display: "flex",
|
|
1088
|
-
alignItems: "flex-start",
|
|
1089
|
-
gap: 12,
|
|
1090
|
-
marginBottom: 16,
|
|
1091
|
-
textAlign: "left"
|
|
1092
|
-
},
|
|
1093
|
-
children: [
|
|
1094
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1095
|
-
"div",
|
|
1096
|
-
{
|
|
1097
|
-
style: {
|
|
1098
|
-
width: 32,
|
|
1099
|
-
height: 32,
|
|
1100
|
-
borderRadius: 10,
|
|
1101
|
-
background: "var(--hook-color-primary)",
|
|
1102
|
-
color: "#fff",
|
|
1103
|
-
display: "flex",
|
|
1104
|
-
alignItems: "center",
|
|
1105
|
-
justifyContent: "center",
|
|
1106
|
-
fontSize: 15,
|
|
1107
|
-
fontWeight: 700,
|
|
1108
|
-
flexShrink: 0
|
|
1109
|
-
},
|
|
1110
|
-
children: n
|
|
1111
|
-
}
|
|
1112
|
-
),
|
|
1113
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { flex: 1 }, children: [
|
|
1114
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: { margin: 0, fontSize: 15, fontWeight: 500, color: "#111", lineHeight: 1.3 }, children: title }),
|
|
1115
|
-
subtitle && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: { margin: "4px 0 0 0", fontSize: 13, color: "#777" }, children: subtitle }),
|
|
1116
|
-
visual
|
|
1117
|
-
] })
|
|
1118
|
-
]
|
|
1119
|
-
}
|
|
1120
|
-
);
|
|
1121
|
-
}
|
|
1122
1129
|
|
|
1123
1130
|
// src/components/InstallGate/variants/IOSOtherVariant.tsx
|
|
1124
1131
|
var import_react6 = require("react");
|
|
1125
|
-
var
|
|
1132
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1126
1133
|
function IOSOtherVariant({
|
|
1127
1134
|
state,
|
|
1128
1135
|
actions
|
|
@@ -1130,23 +1137,29 @@ function IOSOtherVariant({
|
|
|
1130
1137
|
const copy = INSTALL_COPY.iosOther;
|
|
1131
1138
|
const showPermanent = shouldShowPermanentOption(state);
|
|
1132
1139
|
const [copied, setCopied] = (0, import_react6.useState)(false);
|
|
1140
|
+
const [helpOpen, setHelpOpen] = (0, import_react6.useState)(false);
|
|
1133
1141
|
const handleCopy = async () => {
|
|
1134
1142
|
await actions.copyLink();
|
|
1135
1143
|
setCopied(true);
|
|
1136
1144
|
setTimeout(() => setCopied(false), 2e3);
|
|
1137
1145
|
};
|
|
1138
|
-
|
|
1139
|
-
|
|
1146
|
+
const handleShowHelp = () => {
|
|
1147
|
+
if (!helpOpen) actions.showIOSOtherHelp();
|
|
1148
|
+
setHelpOpen(true);
|
|
1149
|
+
};
|
|
1150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(InstallSplash, { title: copy.title, subtitle: copy.subtitle, children: [
|
|
1151
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1140
1152
|
"button",
|
|
1141
1153
|
{
|
|
1142
1154
|
"data-testid": "install-prompt-cta-ios-other-primary",
|
|
1143
1155
|
type: "button",
|
|
1144
|
-
onClick:
|
|
1156
|
+
onClick: handleShowHelp,
|
|
1157
|
+
"aria-expanded": helpOpen,
|
|
1145
1158
|
style: primaryButtonStyle,
|
|
1146
1159
|
children: copy.ctaPrimary
|
|
1147
1160
|
}
|
|
1148
1161
|
),
|
|
1149
|
-
/* @__PURE__ */ (0,
|
|
1162
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1150
1163
|
"button",
|
|
1151
1164
|
{
|
|
1152
1165
|
"data-testid": "install-prompt-cta-ios-other-secondary",
|
|
@@ -1156,7 +1169,71 @@ function IOSOtherVariant({
|
|
|
1156
1169
|
children: copied ? copy.copiedToast : copy.ctaSecondary
|
|
1157
1170
|
}
|
|
1158
1171
|
),
|
|
1159
|
-
/* @__PURE__ */ (0,
|
|
1172
|
+
helpOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1173
|
+
"div",
|
|
1174
|
+
{
|
|
1175
|
+
"data-testid": "install-prompt-ios-other-help",
|
|
1176
|
+
style: { marginTop: 20, textAlign: "left" },
|
|
1177
|
+
children: [
|
|
1178
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1179
|
+
Step2,
|
|
1180
|
+
{
|
|
1181
|
+
n: 1,
|
|
1182
|
+
title: copy.help.step1.title,
|
|
1183
|
+
subtitle: copy.help.step1.subtitle,
|
|
1184
|
+
visual: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1185
|
+
"div",
|
|
1186
|
+
{
|
|
1187
|
+
style: {
|
|
1188
|
+
display: "flex",
|
|
1189
|
+
justifyContent: "center",
|
|
1190
|
+
alignItems: "center",
|
|
1191
|
+
background: "#f5f5f7",
|
|
1192
|
+
borderRadius: 12,
|
|
1193
|
+
padding: "12px 0",
|
|
1194
|
+
marginTop: 8
|
|
1195
|
+
},
|
|
1196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1197
|
+
MenuDotsHorizontalIcon,
|
|
1198
|
+
{
|
|
1199
|
+
size: 28,
|
|
1200
|
+
style: { color: "var(--hook-color-primary)" }
|
|
1201
|
+
}
|
|
1202
|
+
)
|
|
1203
|
+
}
|
|
1204
|
+
)
|
|
1205
|
+
}
|
|
1206
|
+
),
|
|
1207
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1208
|
+
Step2,
|
|
1209
|
+
{
|
|
1210
|
+
n: 2,
|
|
1211
|
+
title: copy.help.step2.title,
|
|
1212
|
+
subtitle: copy.help.step2.subtitle,
|
|
1213
|
+
visual: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1214
|
+
"div",
|
|
1215
|
+
{
|
|
1216
|
+
style: {
|
|
1217
|
+
display: "flex",
|
|
1218
|
+
alignItems: "center",
|
|
1219
|
+
gap: 10,
|
|
1220
|
+
background: "#f5f5f7",
|
|
1221
|
+
borderRadius: 12,
|
|
1222
|
+
padding: "12px 14px",
|
|
1223
|
+
marginTop: 8
|
|
1224
|
+
},
|
|
1225
|
+
children: [
|
|
1226
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ExternalLinkIcon, { size: 22, style: { color: "#555" } }),
|
|
1227
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 14, color: "#333" }, children: "Abrir no Safari" })
|
|
1228
|
+
]
|
|
1229
|
+
}
|
|
1230
|
+
)
|
|
1231
|
+
}
|
|
1232
|
+
)
|
|
1233
|
+
]
|
|
1234
|
+
}
|
|
1235
|
+
),
|
|
1236
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1160
1237
|
"button",
|
|
1161
1238
|
{
|
|
1162
1239
|
"data-testid": "install-prompt-skip-session",
|
|
@@ -1166,7 +1243,7 @@ function IOSOtherVariant({
|
|
|
1166
1243
|
children: copy.skip
|
|
1167
1244
|
}
|
|
1168
1245
|
),
|
|
1169
|
-
showPermanent && /* @__PURE__ */ (0,
|
|
1246
|
+
showPermanent && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1170
1247
|
"button",
|
|
1171
1248
|
{
|
|
1172
1249
|
"data-testid": "install-prompt-skip-permanent",
|
|
@@ -1181,7 +1258,7 @@ function IOSOtherVariant({
|
|
|
1181
1258
|
|
|
1182
1259
|
// src/components/InstallGate/variants/InAppBrowserVariant.tsx
|
|
1183
1260
|
var import_react7 = require("react");
|
|
1184
|
-
var
|
|
1261
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1185
1262
|
function InAppBrowserVariant({
|
|
1186
1263
|
state,
|
|
1187
1264
|
actions
|
|
@@ -1197,10 +1274,10 @@ function InAppBrowserVariant({
|
|
|
1197
1274
|
setTimeout(() => setCopied(false), 2e3);
|
|
1198
1275
|
};
|
|
1199
1276
|
const DotsIcon = app === "facebook" || app === "telegram" ? MenuDotsVerticalIcon : MenuDotsHorizontalIcon;
|
|
1200
|
-
return /* @__PURE__ */ (0,
|
|
1201
|
-
/* @__PURE__ */ (0,
|
|
1202
|
-
/* @__PURE__ */ (0,
|
|
1203
|
-
/* @__PURE__ */ (0,
|
|
1277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(InstallSplash, { title: appCopy.title, children: [
|
|
1278
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Step3, { n: 1, icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DotsIcon, { size: 20 }), children: appCopy.step1 }),
|
|
1279
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Step3, { n: 2, icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ExternalLinkIcon, { size: 18 }), children: appCopy.step2 }),
|
|
1280
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1204
1281
|
"button",
|
|
1205
1282
|
{
|
|
1206
1283
|
"data-testid": "install-prompt-cta-inapp-copy",
|
|
@@ -1210,7 +1287,7 @@ function InAppBrowserVariant({
|
|
|
1210
1287
|
children: copied ? copy.copiedToast : copy.copy
|
|
1211
1288
|
}
|
|
1212
1289
|
),
|
|
1213
|
-
/* @__PURE__ */ (0,
|
|
1290
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1214
1291
|
"button",
|
|
1215
1292
|
{
|
|
1216
1293
|
"data-testid": "install-prompt-skip-session",
|
|
@@ -1220,7 +1297,7 @@ function InAppBrowserVariant({
|
|
|
1220
1297
|
children: copy.skip
|
|
1221
1298
|
}
|
|
1222
1299
|
),
|
|
1223
|
-
showPermanent && /* @__PURE__ */ (0,
|
|
1300
|
+
showPermanent && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1224
1301
|
"button",
|
|
1225
1302
|
{
|
|
1226
1303
|
"data-testid": "install-prompt-skip-permanent",
|
|
@@ -1237,7 +1314,7 @@ function Step3({
|
|
|
1237
1314
|
icon,
|
|
1238
1315
|
children
|
|
1239
1316
|
}) {
|
|
1240
|
-
return /* @__PURE__ */ (0,
|
|
1317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1241
1318
|
"div",
|
|
1242
1319
|
{
|
|
1243
1320
|
style: {
|
|
@@ -1251,7 +1328,7 @@ function Step3({
|
|
|
1251
1328
|
textAlign: "left"
|
|
1252
1329
|
},
|
|
1253
1330
|
children: [
|
|
1254
|
-
/* @__PURE__ */ (0,
|
|
1331
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1255
1332
|
"div",
|
|
1256
1333
|
{
|
|
1257
1334
|
style: {
|
|
@@ -1270,15 +1347,15 @@ function Step3({
|
|
|
1270
1347
|
children: n
|
|
1271
1348
|
}
|
|
1272
1349
|
),
|
|
1273
|
-
/* @__PURE__ */ (0,
|
|
1274
|
-
/* @__PURE__ */ (0,
|
|
1350
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { flex: 1, fontSize: 14, color: "#333" }, children }),
|
|
1351
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "#888", flexShrink: 0 }, children: icon })
|
|
1275
1352
|
]
|
|
1276
1353
|
}
|
|
1277
1354
|
);
|
|
1278
1355
|
}
|
|
1279
1356
|
|
|
1280
1357
|
// src/components/InstallGate/variants/DesktopVariant.tsx
|
|
1281
|
-
var
|
|
1358
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1282
1359
|
function DesktopVariant({
|
|
1283
1360
|
state,
|
|
1284
1361
|
actions
|
|
@@ -1287,21 +1364,21 @@ function DesktopVariant({
|
|
|
1287
1364
|
const copy = INSTALL_COPY.desktop;
|
|
1288
1365
|
const iconUrl = theme.icon_url || theme.logo_url || null;
|
|
1289
1366
|
if (!state.isInstallable) return null;
|
|
1290
|
-
return /* @__PURE__ */ (0,
|
|
1367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1291
1368
|
"div",
|
|
1292
1369
|
{
|
|
1293
1370
|
role: "complementary",
|
|
1294
1371
|
"aria-label": copy.title,
|
|
1295
1372
|
style: bannerStyle,
|
|
1296
1373
|
children: [
|
|
1297
|
-
iconUrl ? /* @__PURE__ */ (0,
|
|
1374
|
+
iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1298
1375
|
"img",
|
|
1299
1376
|
{
|
|
1300
1377
|
src: iconUrl,
|
|
1301
1378
|
alt: "",
|
|
1302
1379
|
style: { width: 40, height: 40, borderRadius: 10, objectFit: "cover", flexShrink: 0 }
|
|
1303
1380
|
}
|
|
1304
|
-
) : /* @__PURE__ */ (0,
|
|
1381
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1305
1382
|
"div",
|
|
1306
1383
|
{
|
|
1307
1384
|
style: {
|
|
@@ -1320,11 +1397,11 @@ function DesktopVariant({
|
|
|
1320
1397
|
children: name.charAt(0).toUpperCase()
|
|
1321
1398
|
}
|
|
1322
1399
|
),
|
|
1323
|
-
/* @__PURE__ */ (0,
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1325
|
-
/* @__PURE__ */ (0,
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1401
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 14, fontWeight: 600, color: "#111" }, children: copy.title }),
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 12, color: "#666" }, children: copy.subtitle })
|
|
1326
1403
|
] }),
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1404
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1328
1405
|
"button",
|
|
1329
1406
|
{
|
|
1330
1407
|
"data-testid": "install-prompt-cta-desktop",
|
|
@@ -1345,12 +1422,12 @@ function DesktopVariant({
|
|
|
1345
1422
|
flexShrink: 0
|
|
1346
1423
|
},
|
|
1347
1424
|
children: [
|
|
1348
|
-
/* @__PURE__ */ (0,
|
|
1425
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DownloadIcon, { size: 14 }),
|
|
1349
1426
|
copy.cta
|
|
1350
1427
|
]
|
|
1351
1428
|
}
|
|
1352
1429
|
),
|
|
1353
|
-
/* @__PURE__ */ (0,
|
|
1430
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1354
1431
|
"button",
|
|
1355
1432
|
{
|
|
1356
1433
|
"data-testid": "install-prompt-desktop-close",
|
|
@@ -1365,7 +1442,7 @@ function DesktopVariant({
|
|
|
1365
1442
|
padding: 4,
|
|
1366
1443
|
flexShrink: 0
|
|
1367
1444
|
},
|
|
1368
|
-
children: /* @__PURE__ */ (0,
|
|
1445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(XIcon, { size: 16 })
|
|
1369
1446
|
}
|
|
1370
1447
|
)
|
|
1371
1448
|
]
|
|
@@ -1389,7 +1466,7 @@ var bannerStyle = {
|
|
|
1389
1466
|
};
|
|
1390
1467
|
|
|
1391
1468
|
// src/components/InstallGate/InstallGate.tsx
|
|
1392
|
-
var
|
|
1469
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1393
1470
|
function InstallGate({ children }) {
|
|
1394
1471
|
const { slug, features_enabled } = useTemplateConfig();
|
|
1395
1472
|
const enabled = features_enabled.includes("install_prompt");
|
|
@@ -1410,35 +1487,35 @@ function InstallGate({ children }) {
|
|
|
1410
1487
|
variant: installState.variant
|
|
1411
1488
|
});
|
|
1412
1489
|
}, [shouldBlock, slug, installState.variant, installState.platform, installState.iosBrowser, installState.androidBrowser, installState.inAppApp]);
|
|
1413
|
-
if (!enabled) return /* @__PURE__ */ (0,
|
|
1414
|
-
if (installState.isInstalled) return /* @__PURE__ */ (0,
|
|
1490
|
+
if (!enabled) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children });
|
|
1491
|
+
if (installState.isInstalled) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children });
|
|
1415
1492
|
if (installState.variant === "desktop") {
|
|
1416
|
-
return /* @__PURE__ */ (0,
|
|
1493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1417
1494
|
children,
|
|
1418
|
-
/* @__PURE__ */ (0,
|
|
1495
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DesktopVariant, { state: installState, actions: installState })
|
|
1419
1496
|
] });
|
|
1420
1497
|
}
|
|
1421
|
-
if (!shouldBlock) return /* @__PURE__ */ (0,
|
|
1498
|
+
if (!shouldBlock) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children });
|
|
1422
1499
|
switch (installState.variant) {
|
|
1423
1500
|
case "android-native":
|
|
1424
|
-
return /* @__PURE__ */ (0,
|
|
1501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AndroidNativeVariant, { state: installState, actions: installState });
|
|
1425
1502
|
case "android-manual":
|
|
1426
|
-
return /* @__PURE__ */ (0,
|
|
1503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AndroidManualVariant, { state: installState, actions: installState });
|
|
1427
1504
|
case "ios-safari":
|
|
1428
|
-
return /* @__PURE__ */ (0,
|
|
1505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IOSafariVariant, { state: installState, actions: installState });
|
|
1429
1506
|
case "ios-other":
|
|
1430
|
-
return /* @__PURE__ */ (0,
|
|
1507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IOSOtherVariant, { state: installState, actions: installState });
|
|
1431
1508
|
case "in-app":
|
|
1432
|
-
return /* @__PURE__ */ (0,
|
|
1509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(InAppBrowserVariant, { state: installState, actions: installState });
|
|
1433
1510
|
case "none":
|
|
1434
1511
|
default:
|
|
1435
|
-
return /* @__PURE__ */ (0,
|
|
1512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children });
|
|
1436
1513
|
}
|
|
1437
1514
|
}
|
|
1438
1515
|
|
|
1439
1516
|
// src/defaults/ErrorBoundary.tsx
|
|
1440
1517
|
var import_react9 = require("react");
|
|
1441
|
-
var
|
|
1518
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1442
1519
|
var ErrorBoundary = class extends import_react9.Component {
|
|
1443
1520
|
state = { error: null };
|
|
1444
1521
|
static getDerivedStateFromError(error) {
|
|
@@ -1449,12 +1526,12 @@ var ErrorBoundary = class extends import_react9.Component {
|
|
|
1449
1526
|
}
|
|
1450
1527
|
render() {
|
|
1451
1528
|
if (this.state.error) {
|
|
1452
|
-
return this.props.fallback ?? /* @__PURE__ */ (0,
|
|
1453
|
-
/* @__PURE__ */ (0,
|
|
1454
|
-
/* @__PURE__ */ (0,
|
|
1529
|
+
return this.props.fallback ?? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { role: "alert", style: { padding: 24, textAlign: "center" }, children: [
|
|
1530
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h2", { children: "Algo deu errado" }),
|
|
1531
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { style: { opacity: 0.7 }, children: "Recarregue a p\xE1gina pra tentar de novo." })
|
|
1455
1532
|
] });
|
|
1456
1533
|
}
|
|
1457
|
-
return /* @__PURE__ */ (0,
|
|
1534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children: this.props.children });
|
|
1458
1535
|
}
|
|
1459
1536
|
};
|
|
1460
1537
|
|
|
@@ -1541,13 +1618,13 @@ function useLoginForm() {
|
|
|
1541
1618
|
}
|
|
1542
1619
|
|
|
1543
1620
|
// src/internal/GoogleSignInButton.tsx
|
|
1544
|
-
var
|
|
1621
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1545
1622
|
function GoogleSignInButton({
|
|
1546
1623
|
onClick,
|
|
1547
1624
|
testId = "oauth-google",
|
|
1548
1625
|
label = "Continuar com Google"
|
|
1549
1626
|
}) {
|
|
1550
|
-
return /* @__PURE__ */ (0,
|
|
1627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1551
1628
|
"button",
|
|
1552
1629
|
{
|
|
1553
1630
|
"data-testid": testId,
|
|
@@ -1570,36 +1647,36 @@ function GoogleSignInButton({
|
|
|
1570
1647
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
1571
1648
|
},
|
|
1572
1649
|
children: [
|
|
1573
|
-
/* @__PURE__ */ (0,
|
|
1650
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GoogleGlyph, {}),
|
|
1574
1651
|
label
|
|
1575
1652
|
]
|
|
1576
1653
|
}
|
|
1577
1654
|
);
|
|
1578
1655
|
}
|
|
1579
1656
|
function GoogleGlyph() {
|
|
1580
|
-
return /* @__PURE__ */ (0,
|
|
1581
|
-
/* @__PURE__ */ (0,
|
|
1657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1582
1659
|
"path",
|
|
1583
1660
|
{
|
|
1584
1661
|
d: "M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844a4.14 4.14 0 0 1-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.874 2.684-6.615z",
|
|
1585
1662
|
fill: "#4285F4"
|
|
1586
1663
|
}
|
|
1587
1664
|
),
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1665
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1589
1666
|
"path",
|
|
1590
1667
|
{
|
|
1591
1668
|
d: "M9 18c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332A8.997 8.997 0 0 0 9 18z",
|
|
1592
1669
|
fill: "#34A853"
|
|
1593
1670
|
}
|
|
1594
1671
|
),
|
|
1595
|
-
/* @__PURE__ */ (0,
|
|
1672
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1596
1673
|
"path",
|
|
1597
1674
|
{
|
|
1598
1675
|
d: "M3.964 10.71A5.41 5.41 0 0 1 3.682 9c0-.593.102-1.17.282-1.71V4.958H.957A8.996 8.996 0 0 0 0 9c0 1.452.348 2.827.957 4.042l3.007-2.332z",
|
|
1599
1676
|
fill: "#FBBC05"
|
|
1600
1677
|
}
|
|
1601
1678
|
),
|
|
1602
|
-
/* @__PURE__ */ (0,
|
|
1679
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1603
1680
|
"path",
|
|
1604
1681
|
{
|
|
1605
1682
|
d: "M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 0 0 .957 4.958L3.964 7.29C4.672 5.163 6.656 3.58 9 3.58z",
|
|
@@ -1611,7 +1688,7 @@ function GoogleGlyph() {
|
|
|
1611
1688
|
|
|
1612
1689
|
// src/internal/OAuthErrorBanner.tsx
|
|
1613
1690
|
var import_react11 = require("react");
|
|
1614
|
-
var
|
|
1691
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1615
1692
|
var ERROR_MESSAGES = {
|
|
1616
1693
|
invalid_state: "Sess\xE3o expirou, tente de novo.",
|
|
1617
1694
|
access_denied: "Voc\xEA cancelou o login com Google.",
|
|
@@ -1637,7 +1714,7 @@ function OAuthErrorBanner() {
|
|
|
1637
1714
|
}, [code]);
|
|
1638
1715
|
if (!code) return null;
|
|
1639
1716
|
const message = ERROR_MESSAGES[code] ?? "N\xE3o conseguimos conectar ao Google. Tente de novo.";
|
|
1640
|
-
return /* @__PURE__ */ (0,
|
|
1717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1641
1718
|
"div",
|
|
1642
1719
|
{
|
|
1643
1720
|
role: "alert",
|
|
@@ -1652,7 +1729,7 @@ function OAuthErrorBanner() {
|
|
|
1652
1729
|
},
|
|
1653
1730
|
children: [
|
|
1654
1731
|
message,
|
|
1655
|
-
/* @__PURE__ */ (0,
|
|
1732
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1656
1733
|
"button",
|
|
1657
1734
|
{
|
|
1658
1735
|
type: "button",
|
|
@@ -1677,16 +1754,16 @@ function OAuthErrorBanner() {
|
|
|
1677
1754
|
}
|
|
1678
1755
|
|
|
1679
1756
|
// src/defaults/DefaultLoginScreen.tsx
|
|
1680
|
-
var
|
|
1757
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1681
1758
|
function DefaultLoginScreen({ onNavigate }) {
|
|
1682
1759
|
const { name } = useTemplateConfig();
|
|
1683
1760
|
const f = useLoginForm();
|
|
1684
|
-
return /* @__PURE__ */ (0,
|
|
1685
|
-
/* @__PURE__ */ (0,
|
|
1686
|
-
/* @__PURE__ */ (0,
|
|
1687
|
-
/* @__PURE__ */ (0,
|
|
1688
|
-
/* @__PURE__ */ (0,
|
|
1689
|
-
/* @__PURE__ */ (0,
|
|
1761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("main", { style: { padding: 24, maxWidth: 360, margin: "0 auto" }, children: [
|
|
1762
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { style: { marginBottom: 8 }, children: name }),
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { style: { opacity: 0.7, marginBottom: 24 }, children: "Entre na sua conta" }),
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(OAuthErrorBanner, {}),
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(GoogleSignInButton, { onClick: f.loginWithGoogle, testId: "login-oauth-google" }),
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1690
1767
|
"div",
|
|
1691
1768
|
{
|
|
1692
1769
|
"aria-hidden": "true",
|
|
@@ -1699,19 +1776,19 @@ function DefaultLoginScreen({ onNavigate }) {
|
|
|
1699
1776
|
fontSize: 12
|
|
1700
1777
|
},
|
|
1701
1778
|
children: [
|
|
1702
|
-
/* @__PURE__ */ (0,
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: { flex: 1, height: 1, background: "rgba(0,0,0,0.1)" } }),
|
|
1703
1780
|
"ou",
|
|
1704
|
-
/* @__PURE__ */ (0,
|
|
1781
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: { flex: 1, height: 1, background: "rgba(0,0,0,0.1)" } })
|
|
1705
1782
|
]
|
|
1706
1783
|
}
|
|
1707
1784
|
),
|
|
1708
|
-
/* @__PURE__ */ (0,
|
|
1785
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("form", { onSubmit: (e) => {
|
|
1709
1786
|
e.preventDefault();
|
|
1710
1787
|
void f.submit();
|
|
1711
1788
|
}, children: [
|
|
1712
|
-
/* @__PURE__ */ (0,
|
|
1789
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { style: { display: "block", marginBottom: 12 }, children: [
|
|
1713
1790
|
"E-mail",
|
|
1714
|
-
/* @__PURE__ */ (0,
|
|
1791
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1715
1792
|
"input",
|
|
1716
1793
|
{
|
|
1717
1794
|
"data-testid": "login-email",
|
|
@@ -1721,11 +1798,11 @@ function DefaultLoginScreen({ onNavigate }) {
|
|
|
1721
1798
|
style: { display: "block", width: "100%" }
|
|
1722
1799
|
}
|
|
1723
1800
|
),
|
|
1724
|
-
f.emailError && /* @__PURE__ */ (0,
|
|
1801
|
+
f.emailError && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { style: { color: "#c00" }, children: f.emailError })
|
|
1725
1802
|
] }),
|
|
1726
|
-
/* @__PURE__ */ (0,
|
|
1803
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { style: { display: "block", marginBottom: 12 }, children: [
|
|
1727
1804
|
"Senha",
|
|
1728
|
-
/* @__PURE__ */ (0,
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1729
1806
|
"input",
|
|
1730
1807
|
{
|
|
1731
1808
|
"data-testid": "login-password",
|
|
@@ -1735,10 +1812,10 @@ function DefaultLoginScreen({ onNavigate }) {
|
|
|
1735
1812
|
style: { display: "block", width: "100%" }
|
|
1736
1813
|
}
|
|
1737
1814
|
),
|
|
1738
|
-
f.passwordError && /* @__PURE__ */ (0,
|
|
1815
|
+
f.passwordError && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { style: { color: "#c00" }, children: f.passwordError })
|
|
1739
1816
|
] }),
|
|
1740
|
-
f.error && /* @__PURE__ */ (0,
|
|
1741
|
-
/* @__PURE__ */ (0,
|
|
1817
|
+
f.error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { role: "alert", style: { color: "#c00", marginBottom: 12 }, children: f.error.message }),
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1742
1819
|
"button",
|
|
1743
1820
|
{
|
|
1744
1821
|
"data-testid": "login-submit",
|
|
@@ -1757,9 +1834,9 @@ function DefaultLoginScreen({ onNavigate }) {
|
|
|
1757
1834
|
}
|
|
1758
1835
|
)
|
|
1759
1836
|
] }),
|
|
1760
|
-
/* @__PURE__ */ (0,
|
|
1761
|
-
/* @__PURE__ */ (0,
|
|
1762
|
-
/* @__PURE__ */ (0,
|
|
1837
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { marginTop: 16, display: "flex", justifyContent: "space-between" }, children: [
|
|
1838
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { "data-testid": "login-goto-signup", type: "button", onClick: () => onNavigate("signup"), style: { background: "none", border: "none", cursor: "pointer" }, children: "Criar conta" }),
|
|
1839
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { "data-testid": "login-goto-forgot", type: "button", onClick: () => onNavigate("forgot"), style: { background: "none", border: "none", cursor: "pointer" }, children: "Esqueci senha" })
|
|
1763
1840
|
] })
|
|
1764
1841
|
] });
|
|
1765
1842
|
}
|
|
@@ -1825,16 +1902,16 @@ function useSignupForm() {
|
|
|
1825
1902
|
}
|
|
1826
1903
|
|
|
1827
1904
|
// src/defaults/DefaultSignupScreen.tsx
|
|
1828
|
-
var
|
|
1905
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1829
1906
|
function DefaultSignupScreen({ onNavigate }) {
|
|
1830
1907
|
const { name } = useTemplateConfig();
|
|
1831
1908
|
const f = useSignupForm();
|
|
1832
|
-
return /* @__PURE__ */ (0,
|
|
1833
|
-
/* @__PURE__ */ (0,
|
|
1834
|
-
/* @__PURE__ */ (0,
|
|
1835
|
-
/* @__PURE__ */ (0,
|
|
1836
|
-
/* @__PURE__ */ (0,
|
|
1837
|
-
/* @__PURE__ */ (0,
|
|
1909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("main", { style: { padding: 24, maxWidth: 360, margin: "0 auto" }, children: [
|
|
1910
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h1", { style: { marginBottom: 8 }, children: name }),
|
|
1911
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { style: { opacity: 0.7, marginBottom: 24 }, children: "Criar sua conta" }),
|
|
1912
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OAuthErrorBanner, {}),
|
|
1913
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GoogleSignInButton, { onClick: f.loginWithGoogle, testId: "signup-oauth-google" }),
|
|
1914
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1838
1915
|
"div",
|
|
1839
1916
|
{
|
|
1840
1917
|
"aria-hidden": "true",
|
|
@@ -1847,35 +1924,35 @@ function DefaultSignupScreen({ onNavigate }) {
|
|
|
1847
1924
|
fontSize: 12
|
|
1848
1925
|
},
|
|
1849
1926
|
children: [
|
|
1850
|
-
/* @__PURE__ */ (0,
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { flex: 1, height: 1, background: "rgba(0,0,0,0.1)" } }),
|
|
1851
1928
|
"ou",
|
|
1852
|
-
/* @__PURE__ */ (0,
|
|
1929
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { flex: 1, height: 1, background: "rgba(0,0,0,0.1)" } })
|
|
1853
1930
|
]
|
|
1854
1931
|
}
|
|
1855
1932
|
),
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1933
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", { onSubmit: (e) => {
|
|
1857
1934
|
e.preventDefault();
|
|
1858
1935
|
void f.submit();
|
|
1859
1936
|
}, children: [
|
|
1860
|
-
/* @__PURE__ */ (0,
|
|
1937
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { display: "block", marginBottom: 12 }, children: [
|
|
1861
1938
|
"Nome",
|
|
1862
|
-
/* @__PURE__ */ (0,
|
|
1863
|
-
f.nameError && /* @__PURE__ */ (0,
|
|
1939
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { "data-testid": "signup-name", value: f.name, onChange: (e) => f.setName(e.target.value), style: { display: "block", width: "100%" } }),
|
|
1940
|
+
f.nameError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { style: { color: "#c00" }, children: f.nameError })
|
|
1864
1941
|
] }),
|
|
1865
|
-
/* @__PURE__ */ (0,
|
|
1942
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { display: "block", marginBottom: 12 }, children: [
|
|
1866
1943
|
"E-mail",
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
1868
|
-
f.emailError && /* @__PURE__ */ (0,
|
|
1944
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { "data-testid": "signup-email", type: "email", value: f.email, onChange: (e) => f.setEmail(e.target.value), style: { display: "block", width: "100%" } }),
|
|
1945
|
+
f.emailError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { style: { color: "#c00" }, children: f.emailError })
|
|
1869
1946
|
] }),
|
|
1870
|
-
/* @__PURE__ */ (0,
|
|
1947
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { display: "block", marginBottom: 12 }, children: [
|
|
1871
1948
|
"Senha",
|
|
1872
|
-
/* @__PURE__ */ (0,
|
|
1873
|
-
f.passwordError && /* @__PURE__ */ (0,
|
|
1949
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { "data-testid": "signup-password", type: "password", value: f.password, onChange: (e) => f.setPassword(e.target.value), style: { display: "block", width: "100%" } }),
|
|
1950
|
+
f.passwordError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { style: { color: "#c00" }, children: f.passwordError })
|
|
1874
1951
|
] }),
|
|
1875
|
-
f.error && /* @__PURE__ */ (0,
|
|
1876
|
-
/* @__PURE__ */ (0,
|
|
1952
|
+
f.error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { role: "alert", style: { color: "#c00", marginBottom: 12 }, children: f.error.message }),
|
|
1953
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { "data-testid": "signup-submit", type: "submit", disabled: !f.canSubmit, style: { width: "100%", padding: 12, background: "var(--hook-color-primary)", color: "#fff", border: "none", borderRadius: 8, opacity: f.canSubmit ? 1 : 0.5 }, children: f.submitting ? "Criando..." : "Criar conta" })
|
|
1877
1954
|
] }),
|
|
1878
|
-
/* @__PURE__ */ (0,
|
|
1955
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { "data-testid": "signup-goto-login", type: "button", onClick: () => onNavigate("login"), style: { background: "none", border: "none", cursor: "pointer" }, children: "J\xE1 tem conta? Entre" }) })
|
|
1879
1956
|
] });
|
|
1880
1957
|
}
|
|
1881
1958
|
|
|
@@ -1923,33 +2000,33 @@ function useForgotForm() {
|
|
|
1923
2000
|
}
|
|
1924
2001
|
|
|
1925
2002
|
// src/defaults/DefaultForgotScreen.tsx
|
|
1926
|
-
var
|
|
2003
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1927
2004
|
function DefaultForgotScreen({ onNavigate }) {
|
|
1928
2005
|
const { name } = useTemplateConfig();
|
|
1929
2006
|
const f = useForgotForm();
|
|
1930
2007
|
if (f.sent) {
|
|
1931
|
-
return /* @__PURE__ */ (0,
|
|
1932
|
-
/* @__PURE__ */ (0,
|
|
1933
|
-
/* @__PURE__ */ (0,
|
|
1934
|
-
/* @__PURE__ */ (0,
|
|
2008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("main", { style: { padding: 24, maxWidth: 360, margin: "0 auto", textAlign: "center" }, children: [
|
|
2009
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h1", { children: "Verifique seu e-mail" }),
|
|
2010
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { style: { opacity: 0.7 }, children: "Enviamos um link pra redefinir sua senha." }),
|
|
2011
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { "data-testid": "forgot-back-login", type: "button", onClick: () => onNavigate("login"), children: "Voltar pro login" })
|
|
1935
2012
|
] });
|
|
1936
2013
|
}
|
|
1937
|
-
return /* @__PURE__ */ (0,
|
|
1938
|
-
/* @__PURE__ */ (0,
|
|
1939
|
-
/* @__PURE__ */ (0,
|
|
1940
|
-
/* @__PURE__ */ (0,
|
|
2014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("main", { style: { padding: 24, maxWidth: 360, margin: "0 auto" }, children: [
|
|
2015
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h1", { style: { marginBottom: 8 }, children: name }),
|
|
2016
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { style: { opacity: 0.7, marginBottom: 24 }, children: "Redefinir senha" }),
|
|
2017
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("form", { onSubmit: (e) => {
|
|
1941
2018
|
e.preventDefault();
|
|
1942
2019
|
void f.submit();
|
|
1943
2020
|
}, children: [
|
|
1944
|
-
/* @__PURE__ */ (0,
|
|
2021
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { display: "block", marginBottom: 12 }, children: [
|
|
1945
2022
|
"E-mail",
|
|
1946
|
-
/* @__PURE__ */ (0,
|
|
1947
|
-
f.emailError && /* @__PURE__ */ (0,
|
|
2023
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", { "data-testid": "forgot-email", type: "email", value: f.email, onChange: (e) => f.setEmail(e.target.value), style: { display: "block", width: "100%" } }),
|
|
2024
|
+
f.emailError && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("small", { style: { color: "#c00" }, children: f.emailError })
|
|
1948
2025
|
] }),
|
|
1949
|
-
f.error && /* @__PURE__ */ (0,
|
|
1950
|
-
/* @__PURE__ */ (0,
|
|
2026
|
+
f.error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { role: "alert", style: { color: "#c00", marginBottom: 12 }, children: f.error.message }),
|
|
2027
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { "data-testid": "forgot-submit", type: "submit", disabled: !f.canSubmit, style: { width: "100%", padding: 12, background: "var(--hook-color-primary)", color: "#fff", border: "none", borderRadius: 8, opacity: f.canSubmit ? 1 : 0.5 }, children: f.submitting ? "Enviando..." : "Enviar link" })
|
|
1951
2028
|
] }),
|
|
1952
|
-
/* @__PURE__ */ (0,
|
|
2029
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { "data-testid": "forgot-goto-login", type: "button", onClick: () => onNavigate("login"), style: { background: "none", border: "none", cursor: "pointer" }, children: "Voltar pro login" }) })
|
|
1953
2030
|
] });
|
|
1954
2031
|
}
|
|
1955
2032
|
|
|
@@ -2018,50 +2095,50 @@ function useResetForm() {
|
|
|
2018
2095
|
}
|
|
2019
2096
|
|
|
2020
2097
|
// src/defaults/DefaultResetScreen.tsx
|
|
2021
|
-
var
|
|
2098
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2022
2099
|
function DefaultResetScreen({ onNavigate }) {
|
|
2023
2100
|
const { name } = useTemplateConfig();
|
|
2024
2101
|
const f = useResetForm();
|
|
2025
2102
|
if (f.done) {
|
|
2026
|
-
return /* @__PURE__ */ (0,
|
|
2027
|
-
/* @__PURE__ */ (0,
|
|
2028
|
-
/* @__PURE__ */ (0,
|
|
2029
|
-
/* @__PURE__ */ (0,
|
|
2103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("main", { style: { padding: 24, maxWidth: 360, margin: "0 auto", textAlign: "center" }, children: [
|
|
2104
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h1", { children: "Senha alterada" }),
|
|
2105
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: { opacity: 0.7 }, children: "Agora \xE9 s\xF3 fazer login com a nova senha." }),
|
|
2106
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { "data-testid": "reset-back-login", type: "button", onClick: () => onNavigate("login"), children: "Ir pro login" })
|
|
2030
2107
|
] });
|
|
2031
2108
|
}
|
|
2032
2109
|
if (f.token === null) {
|
|
2033
|
-
return /* @__PURE__ */ (0,
|
|
2034
|
-
/* @__PURE__ */ (0,
|
|
2035
|
-
/* @__PURE__ */ (0,
|
|
2036
|
-
/* @__PURE__ */ (0,
|
|
2110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("main", { style: { padding: 24, maxWidth: 360, margin: "0 auto", textAlign: "center" }, children: [
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h1", { children: "Link inv\xE1lido" }),
|
|
2112
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: { opacity: 0.7 }, children: "Pe\xE7a um novo link de reset." }),
|
|
2113
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { "data-testid": "reset-goto-forgot", type: "button", onClick: () => onNavigate("forgot"), children: "Pedir novo link" })
|
|
2037
2114
|
] });
|
|
2038
2115
|
}
|
|
2039
|
-
return /* @__PURE__ */ (0,
|
|
2040
|
-
/* @__PURE__ */ (0,
|
|
2041
|
-
/* @__PURE__ */ (0,
|
|
2042
|
-
/* @__PURE__ */ (0,
|
|
2116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("main", { style: { padding: 24, maxWidth: 360, margin: "0 auto" }, children: [
|
|
2117
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h1", { style: { marginBottom: 8 }, children: name }),
|
|
2118
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: { opacity: 0.7, marginBottom: 24 }, children: "Escolha uma nova senha" }),
|
|
2119
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("form", { onSubmit: (e) => {
|
|
2043
2120
|
e.preventDefault();
|
|
2044
2121
|
void f.submit();
|
|
2045
2122
|
}, children: [
|
|
2046
|
-
/* @__PURE__ */ (0,
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { style: { display: "block", marginBottom: 12 }, children: [
|
|
2047
2124
|
"Nova senha",
|
|
2048
|
-
/* @__PURE__ */ (0,
|
|
2049
|
-
f.passwordError && /* @__PURE__ */ (0,
|
|
2125
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("input", { "data-testid": "reset-password", type: "password", value: f.password, onChange: (e) => f.setPassword(e.target.value), style: { display: "block", width: "100%" }, autoComplete: "new-password" }),
|
|
2126
|
+
f.passwordError && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("small", { style: { color: "#c00" }, children: f.passwordError })
|
|
2050
2127
|
] }),
|
|
2051
|
-
/* @__PURE__ */ (0,
|
|
2128
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { style: { display: "block", marginBottom: 12 }, children: [
|
|
2052
2129
|
"Confirmar senha",
|
|
2053
|
-
/* @__PURE__ */ (0,
|
|
2054
|
-
f.confirmError && /* @__PURE__ */ (0,
|
|
2130
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("input", { "data-testid": "reset-confirm", type: "password", value: f.confirm, onChange: (e) => f.setConfirm(e.target.value), style: { display: "block", width: "100%" }, autoComplete: "new-password" }),
|
|
2131
|
+
f.confirmError && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("small", { style: { color: "#c00" }, children: f.confirmError })
|
|
2055
2132
|
] }),
|
|
2056
|
-
f.error && /* @__PURE__ */ (0,
|
|
2057
|
-
/* @__PURE__ */ (0,
|
|
2133
|
+
f.error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { role: "alert", style: { color: "#c00", marginBottom: 12 }, children: f.error.message }),
|
|
2134
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { "data-testid": "reset-submit", type: "submit", disabled: !f.canSubmit, style: { width: "100%", padding: 12, background: "var(--hook-color-primary)", color: "#fff", border: "none", borderRadius: 8, opacity: f.canSubmit ? 1 : 0.5 }, children: f.submitting ? "Alterando..." : "Alterar senha" })
|
|
2058
2135
|
] })
|
|
2059
2136
|
] });
|
|
2060
2137
|
}
|
|
2061
2138
|
|
|
2062
2139
|
// src/defaults/DefaultPaywall.tsx
|
|
2063
2140
|
var import_react15 = require("react");
|
|
2064
|
-
var
|
|
2141
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2065
2142
|
function DefaultPaywall() {
|
|
2066
2143
|
const config = useTemplateConfig();
|
|
2067
2144
|
const { checkout, opening, error } = usePaywallState();
|
|
@@ -2069,16 +2146,16 @@ function DefaultPaywall() {
|
|
|
2069
2146
|
const [cpf, setCpf] = (0, import_react15.useState)("");
|
|
2070
2147
|
const cpfDigits = cpf.replace(/\D/g, "");
|
|
2071
2148
|
const canCheckout = cpfDigits.length === 11 && !opening;
|
|
2072
|
-
return /* @__PURE__ */ (0,
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2074
|
-
p.subtitle && /* @__PURE__ */ (0,
|
|
2075
|
-
/* @__PURE__ */ (0,
|
|
2076
|
-
/* @__PURE__ */ (0,
|
|
2077
|
-
/* @__PURE__ */ (0,
|
|
2149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("main", { style: { padding: 24, maxWidth: 440, margin: "0 auto", textAlign: "center" }, children: [
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h1", { style: { marginBottom: 8 }, children: p.title }),
|
|
2151
|
+
p.subtitle && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { style: { opacity: 0.7, marginBottom: 24 }, children: p.subtitle }),
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ul", { style: { listStyle: "none", padding: 0, textAlign: "left", marginBottom: 24 }, children: p.benefits.map((b) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("li", { style: { padding: "8px 0", display: "flex", alignItems: "center" }, children: [
|
|
2153
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { "aria-hidden": true, style: { marginRight: 8 }, children: "\u2713" }),
|
|
2154
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: b })
|
|
2078
2155
|
] }, b)) }),
|
|
2079
|
-
/* @__PURE__ */ (0,
|
|
2080
|
-
/* @__PURE__ */ (0,
|
|
2081
|
-
/* @__PURE__ */ (0,
|
|
2156
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { textAlign: "left", marginBottom: 16 }, children: [
|
|
2157
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { style: { display: "block", fontSize: 14, opacity: 0.7, marginBottom: 4 }, children: "Seu CPF (pra emiss\xE3o de recibo)" }),
|
|
2158
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2082
2159
|
"input",
|
|
2083
2160
|
{
|
|
2084
2161
|
"data-testid": "paywall-cpf",
|
|
@@ -2091,8 +2168,8 @@ function DefaultPaywall() {
|
|
|
2091
2168
|
}
|
|
2092
2169
|
)
|
|
2093
2170
|
] }),
|
|
2094
|
-
error && /* @__PURE__ */ (0,
|
|
2095
|
-
/* @__PURE__ */ (0,
|
|
2171
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { role: "alert", style: { color: "#c00", marginBottom: 12 }, children: error.message }),
|
|
2172
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2096
2173
|
"button",
|
|
2097
2174
|
{
|
|
2098
2175
|
"data-testid": "paywall-cta",
|
|
@@ -2113,13 +2190,13 @@ function DefaultPaywall() {
|
|
|
2113
2190
|
children: opening ? "Abrindo..." : p.cta
|
|
2114
2191
|
}
|
|
2115
2192
|
),
|
|
2116
|
-
p.priceHint && /* @__PURE__ */ (0,
|
|
2117
|
-
p.footerNote && /* @__PURE__ */ (0,
|
|
2193
|
+
p.priceHint && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { style: { opacity: 0.6, marginTop: 12 }, children: p.priceHint }),
|
|
2194
|
+
p.footerNote && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { style: { opacity: 0.5, marginTop: 16, fontSize: 12 }, children: p.footerNote })
|
|
2118
2195
|
] });
|
|
2119
2196
|
}
|
|
2120
2197
|
|
|
2121
2198
|
// src/AppRoot.tsx
|
|
2122
|
-
var
|
|
2199
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2123
2200
|
var BACKOFF_MS = [2e3, 5e3, 1e4, 2e4, 4e4];
|
|
2124
2201
|
function PaymentReturnHandler({ children }) {
|
|
2125
2202
|
const { subscription } = (0, import_sdk9.useHook)();
|
|
@@ -2166,7 +2243,7 @@ function PaymentReturnHandler({ children }) {
|
|
|
2166
2243
|
};
|
|
2167
2244
|
}, [runPoll]);
|
|
2168
2245
|
if (state === "confirming") {
|
|
2169
|
-
return /* @__PURE__ */ (0,
|
|
2246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2170
2247
|
"div",
|
|
2171
2248
|
{
|
|
2172
2249
|
role: "status",
|
|
@@ -2177,9 +2254,9 @@ function PaymentReturnHandler({ children }) {
|
|
|
2177
2254
|
);
|
|
2178
2255
|
}
|
|
2179
2256
|
if (state === "waiting") {
|
|
2180
|
-
return /* @__PURE__ */ (0,
|
|
2181
|
-
/* @__PURE__ */ (0,
|
|
2182
|
-
/* @__PURE__ */ (0,
|
|
2257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { role: "status", "aria-live": "polite", style: overlayStyle2, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { maxWidth: 320, textAlign: "center", lineHeight: 1.5 }, children: [
|
|
2258
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { style: { marginBottom: 16 }, children: "Pagamento aceito. Estamos confirmando com o banco \u2014 pode levar alguns minutos." }),
|
|
2259
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2183
2260
|
"button",
|
|
2184
2261
|
{
|
|
2185
2262
|
type: "button",
|
|
@@ -2190,7 +2267,7 @@ function PaymentReturnHandler({ children }) {
|
|
|
2190
2267
|
)
|
|
2191
2268
|
] }) });
|
|
2192
2269
|
}
|
|
2193
|
-
return /* @__PURE__ */ (0,
|
|
2270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children });
|
|
2194
2271
|
}
|
|
2195
2272
|
var overlayStyle2 = {
|
|
2196
2273
|
position: "fixed",
|
|
@@ -2223,9 +2300,9 @@ function AppRoot({
|
|
|
2223
2300
|
Reset = DefaultResetScreen,
|
|
2224
2301
|
Paywall = DefaultPaywall
|
|
2225
2302
|
}) {
|
|
2226
|
-
return /* @__PURE__ */ (0,
|
|
2303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PaymentReturnHandler, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TemplateConfigProvider, { config, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(InstallGate, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AuthGate, { Login, Signup, Forgot, Reset, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PersistedKeysPrefetch, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(SubscriptionGate, { Paywall, children: [
|
|
2227
2304
|
children,
|
|
2228
|
-
/* @__PURE__ */ (0,
|
|
2305
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PushPrompt, {})
|
|
2229
2306
|
] }) }) }) }) }) }) }) });
|
|
2230
2307
|
}
|
|
2231
2308
|
|
|
@@ -2287,31 +2364,31 @@ function usePush() {
|
|
|
2287
2364
|
}
|
|
2288
2365
|
|
|
2289
2366
|
// src/components/PushPrompt.tsx
|
|
2290
|
-
var
|
|
2367
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2291
2368
|
function PushPrompt2({ texts, onSubscribed, onDeclined, onInstallRequested, className }) {
|
|
2292
2369
|
const { state, subscribe } = usePush();
|
|
2293
2370
|
if (state.kind === "subscribed") return null;
|
|
2294
2371
|
if (state.kind === "ios_needs_install") {
|
|
2295
|
-
return /* @__PURE__ */ (0,
|
|
2296
|
-
/* @__PURE__ */ (0,
|
|
2297
|
-
/* @__PURE__ */ (0,
|
|
2298
|
-
onInstallRequested && texts.iosInstallCta && /* @__PURE__ */ (0,
|
|
2372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className, role: "region", "aria-label": texts.iosInstallTitle, children: [
|
|
2373
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { children: texts.iosInstallTitle }),
|
|
2374
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: texts.iosInstallBody }),
|
|
2375
|
+
onInstallRequested && texts.iosInstallCta && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { onClick: onInstallRequested, children: texts.iosInstallCta })
|
|
2299
2376
|
] });
|
|
2300
2377
|
}
|
|
2301
2378
|
if (state.kind === "denied") {
|
|
2302
|
-
return /* @__PURE__ */ (0,
|
|
2303
|
-
/* @__PURE__ */ (0,
|
|
2304
|
-
/* @__PURE__ */ (0,
|
|
2379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className, role: "region", "aria-label": texts.deniedTitle, children: [
|
|
2380
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { children: texts.deniedTitle }),
|
|
2381
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: texts.deniedBody })
|
|
2305
2382
|
] });
|
|
2306
2383
|
}
|
|
2307
2384
|
if (state.kind === "unsupported") {
|
|
2308
|
-
return /* @__PURE__ */ (0,
|
|
2385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className, role: "region", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: texts.unsupportedBody }) });
|
|
2309
2386
|
}
|
|
2310
2387
|
if (state.kind === "error") {
|
|
2311
|
-
return /* @__PURE__ */ (0,
|
|
2388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className, role: "region", "aria-label": "error", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: state.message }) });
|
|
2312
2389
|
}
|
|
2313
|
-
return /* @__PURE__ */ (0,
|
|
2314
|
-
/* @__PURE__ */ (0,
|
|
2390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className, role: "region", children: [
|
|
2391
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2315
2392
|
"button",
|
|
2316
2393
|
{
|
|
2317
2394
|
type: "button",
|
|
@@ -2325,17 +2402,17 @@ function PushPrompt2({ texts, onSubscribed, onDeclined, onInstallRequested, clas
|
|
|
2325
2402
|
children: texts.cta
|
|
2326
2403
|
}
|
|
2327
2404
|
),
|
|
2328
|
-
onDeclined && /* @__PURE__ */ (0,
|
|
2405
|
+
onDeclined && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", onClick: onDeclined, children: texts.declineCta })
|
|
2329
2406
|
] });
|
|
2330
2407
|
}
|
|
2331
2408
|
|
|
2332
2409
|
// src/defaults/EmptyState.tsx
|
|
2333
|
-
var
|
|
2410
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2334
2411
|
function EmptyState({ title, description, action }) {
|
|
2335
|
-
return /* @__PURE__ */ (0,
|
|
2336
|
-
/* @__PURE__ */ (0,
|
|
2337
|
-
description && /* @__PURE__ */ (0,
|
|
2338
|
-
action && /* @__PURE__ */ (0,
|
|
2412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { role: "status", style: { padding: 32, textAlign: "center" }, children: [
|
|
2413
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h2", { style: { marginBottom: 8 }, children: title }),
|
|
2414
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { style: { opacity: 0.7 }, children: description }),
|
|
2415
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { style: { marginTop: 16 }, children: action })
|
|
2339
2416
|
] });
|
|
2340
2417
|
}
|
|
2341
2418
|
|