@redacto.io/consent-sdk-react 10.2.2-beta.1 → 10.2.2-beta.2
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/privacy-center.d.mts +1 -1
- package/dist/privacy-center.d.ts +1 -1
- package/dist/privacy-center.js +17 -12
- package/dist/privacy-center.mjs +17 -12
- package/package.json +1 -1
package/dist/privacy-center.d.ts
CHANGED
package/dist/privacy-center.js
CHANGED
|
@@ -19604,10 +19604,7 @@ function NominationDataSection({
|
|
|
19604
19604
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
19605
19605
|
PCInput,
|
|
19606
19606
|
{
|
|
19607
|
-
label:
|
|
19608
|
-
t("nomineeEmail"),
|
|
19609
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { style: { color: getVar17("--pc-error") }, children: "*" })
|
|
19610
|
-
] }),
|
|
19607
|
+
label: t("nomineeEmail"),
|
|
19611
19608
|
placeholder: t("nomineeEmailPlaceholder"),
|
|
19612
19609
|
value: (_a = nominationData.nominee_email) != null ? _a : "",
|
|
19613
19610
|
onChange: (e) => setNominationData((prev) => ({
|
|
@@ -20417,6 +20414,9 @@ var PRODUCT_SCOPED_REQUEST_TYPES = /* @__PURE__ */ new Set([
|
|
|
20417
20414
|
"CORRECTION" /* CORRECTION */
|
|
20418
20415
|
]);
|
|
20419
20416
|
var isProductScopedRequestType = (rt) => rt !== null && PRODUCT_SCOPED_REQUEST_TYPES.has(rt);
|
|
20417
|
+
var NOMINEE_EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
20418
|
+
var NOMINEE_MOBILE_PATTERN = /^\+?\d{9,15}$/;
|
|
20419
|
+
var cleanNomineeMobile = (mobile) => (mobile != null ? mobile : "").replace(/[\s\-().]/g, "");
|
|
20420
20420
|
var extractCaseId = (response) => {
|
|
20421
20421
|
var _a, _b, _c, _d;
|
|
20422
20422
|
if (!response) {
|
|
@@ -20847,9 +20847,11 @@ function Form({
|
|
|
20847
20847
|
}));
|
|
20848
20848
|
}
|
|
20849
20849
|
if (requestType === "nomination" /* NOMINATION */) {
|
|
20850
|
+
const nomineeEmail = (_a2 = nominationData.nominee_email) == null ? void 0 : _a2.trim();
|
|
20851
|
+
const nomineeMobile = cleanNomineeMobile(nominationData.nominee_mobile);
|
|
20850
20852
|
requestDetails.nomination_data = {
|
|
20851
|
-
nominee_email:
|
|
20852
|
-
...
|
|
20853
|
+
...nomineeEmail ? { nominee_email: nomineeEmail } : {},
|
|
20854
|
+
...nomineeMobile ? { nominee_mobile: nomineeMobile } : {}
|
|
20853
20855
|
};
|
|
20854
20856
|
}
|
|
20855
20857
|
const payload = {
|
|
@@ -20905,6 +20907,7 @@ function Form({
|
|
|
20905
20907
|
}
|
|
20906
20908
|
};
|
|
20907
20909
|
const isRequestDetailsValid = (0, import_react44.useCallback)(() => {
|
|
20910
|
+
var _a2, _b2;
|
|
20908
20911
|
if (!requestType) {
|
|
20909
20912
|
return false;
|
|
20910
20913
|
}
|
|
@@ -20918,8 +20921,8 @@ function Form({
|
|
|
20918
20921
|
if (requestType === "CORRECTION" /* CORRECTION */) {
|
|
20919
20922
|
return selectedCorrectionElements.length > 0 && selectedCorrectionElements.every(
|
|
20920
20923
|
(name) => {
|
|
20921
|
-
var
|
|
20922
|
-
return ((
|
|
20924
|
+
var _a3, _b3, _c2, _d2;
|
|
20925
|
+
return ((_b3 = (_a3 = correctionValues[name]) == null ? void 0 : _a3.current) == null ? void 0 : _b3.trim()) && ((_d2 = (_c2 = correctionValues[name]) == null ? void 0 : _c2.updated) == null ? void 0 : _d2.trim());
|
|
20923
20926
|
}
|
|
20924
20927
|
);
|
|
20925
20928
|
}
|
|
@@ -20930,10 +20933,12 @@ function Form({
|
|
|
20930
20933
|
switch (requestType) {
|
|
20931
20934
|
case "grievance" /* GRIEVANCE */:
|
|
20932
20935
|
return Object.values(selectedGrievances).some(Boolean);
|
|
20933
|
-
case "nomination" /* NOMINATION */:
|
|
20934
|
-
|
|
20935
|
-
|
|
20936
|
-
);
|
|
20936
|
+
case "nomination" /* NOMINATION */: {
|
|
20937
|
+
const nomineeEmail = (_b2 = (_a2 = nominationData.nominee_email) == null ? void 0 : _a2.trim()) != null ? _b2 : "";
|
|
20938
|
+
const nomineeMobile = cleanNomineeMobile(nominationData.nominee_mobile);
|
|
20939
|
+
if (!nomineeEmail && !nomineeMobile) return false;
|
|
20940
|
+
return (!nomineeEmail || NOMINEE_EMAIL_PATTERN.test(nomineeEmail)) && (!nomineeMobile || NOMINEE_MOBILE_PATTERN.test(nomineeMobile));
|
|
20941
|
+
}
|
|
20937
20942
|
default:
|
|
20938
20943
|
return false;
|
|
20939
20944
|
}
|
package/dist/privacy-center.mjs
CHANGED
|
@@ -19499,10 +19499,7 @@ function NominationDataSection({
|
|
|
19499
19499
|
/* @__PURE__ */ jsx61(
|
|
19500
19500
|
PCInput,
|
|
19501
19501
|
{
|
|
19502
|
-
label:
|
|
19503
|
-
t("nomineeEmail"),
|
|
19504
|
-
/* @__PURE__ */ jsx61("span", { style: { color: getVar17("--pc-error") }, children: "*" })
|
|
19505
|
-
] }),
|
|
19502
|
+
label: t("nomineeEmail"),
|
|
19506
19503
|
placeholder: t("nomineeEmailPlaceholder"),
|
|
19507
19504
|
value: (_a = nominationData.nominee_email) != null ? _a : "",
|
|
19508
19505
|
onChange: (e) => setNominationData((prev) => ({
|
|
@@ -20312,6 +20309,9 @@ var PRODUCT_SCOPED_REQUEST_TYPES = /* @__PURE__ */ new Set([
|
|
|
20312
20309
|
"CORRECTION" /* CORRECTION */
|
|
20313
20310
|
]);
|
|
20314
20311
|
var isProductScopedRequestType = (rt) => rt !== null && PRODUCT_SCOPED_REQUEST_TYPES.has(rt);
|
|
20312
|
+
var NOMINEE_EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
20313
|
+
var NOMINEE_MOBILE_PATTERN = /^\+?\d{9,15}$/;
|
|
20314
|
+
var cleanNomineeMobile = (mobile) => (mobile != null ? mobile : "").replace(/[\s\-().]/g, "");
|
|
20315
20315
|
var extractCaseId = (response) => {
|
|
20316
20316
|
var _a, _b, _c, _d;
|
|
20317
20317
|
if (!response) {
|
|
@@ -20742,9 +20742,11 @@ function Form({
|
|
|
20742
20742
|
}));
|
|
20743
20743
|
}
|
|
20744
20744
|
if (requestType === "nomination" /* NOMINATION */) {
|
|
20745
|
+
const nomineeEmail = (_a2 = nominationData.nominee_email) == null ? void 0 : _a2.trim();
|
|
20746
|
+
const nomineeMobile = cleanNomineeMobile(nominationData.nominee_mobile);
|
|
20745
20747
|
requestDetails.nomination_data = {
|
|
20746
|
-
nominee_email:
|
|
20747
|
-
...
|
|
20748
|
+
...nomineeEmail ? { nominee_email: nomineeEmail } : {},
|
|
20749
|
+
...nomineeMobile ? { nominee_mobile: nomineeMobile } : {}
|
|
20748
20750
|
};
|
|
20749
20751
|
}
|
|
20750
20752
|
const payload = {
|
|
@@ -20800,6 +20802,7 @@ function Form({
|
|
|
20800
20802
|
}
|
|
20801
20803
|
};
|
|
20802
20804
|
const isRequestDetailsValid = useCallback15(() => {
|
|
20805
|
+
var _a2, _b2;
|
|
20803
20806
|
if (!requestType) {
|
|
20804
20807
|
return false;
|
|
20805
20808
|
}
|
|
@@ -20813,8 +20816,8 @@ function Form({
|
|
|
20813
20816
|
if (requestType === "CORRECTION" /* CORRECTION */) {
|
|
20814
20817
|
return selectedCorrectionElements.length > 0 && selectedCorrectionElements.every(
|
|
20815
20818
|
(name) => {
|
|
20816
|
-
var
|
|
20817
|
-
return ((
|
|
20819
|
+
var _a3, _b3, _c2, _d2;
|
|
20820
|
+
return ((_b3 = (_a3 = correctionValues[name]) == null ? void 0 : _a3.current) == null ? void 0 : _b3.trim()) && ((_d2 = (_c2 = correctionValues[name]) == null ? void 0 : _c2.updated) == null ? void 0 : _d2.trim());
|
|
20818
20821
|
}
|
|
20819
20822
|
);
|
|
20820
20823
|
}
|
|
@@ -20825,10 +20828,12 @@ function Form({
|
|
|
20825
20828
|
switch (requestType) {
|
|
20826
20829
|
case "grievance" /* GRIEVANCE */:
|
|
20827
20830
|
return Object.values(selectedGrievances).some(Boolean);
|
|
20828
|
-
case "nomination" /* NOMINATION */:
|
|
20829
|
-
|
|
20830
|
-
|
|
20831
|
-
);
|
|
20831
|
+
case "nomination" /* NOMINATION */: {
|
|
20832
|
+
const nomineeEmail = (_b2 = (_a2 = nominationData.nominee_email) == null ? void 0 : _a2.trim()) != null ? _b2 : "";
|
|
20833
|
+
const nomineeMobile = cleanNomineeMobile(nominationData.nominee_mobile);
|
|
20834
|
+
if (!nomineeEmail && !nomineeMobile) return false;
|
|
20835
|
+
return (!nomineeEmail || NOMINEE_EMAIL_PATTERN.test(nomineeEmail)) && (!nomineeMobile || NOMINEE_MOBILE_PATTERN.test(nomineeMobile));
|
|
20836
|
+
}
|
|
20832
20837
|
default:
|
|
20833
20838
|
return false;
|
|
20834
20839
|
}
|