@adyen/kyc-components 2.64.0 → 2.65.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.
@@ -28943,7 +28943,7 @@ function CompanyDropinComponent({
28943
28943
  formattedDocument.forEach((doc) => {
28944
28944
  userEvents.addTaskEvent("Success", {
28945
28945
  ...associatedLeTrackingParams,
28946
- actionType: "save",
28946
+ actionType: "upload",
28947
28947
  documentType: doc.type,
28948
28948
  fileExtention: doc.attachments.map((item) => getFileExtention(item.pageName))
28949
28949
  });
@@ -32569,7 +32569,7 @@ function IndividualDropinComponent({
32569
32569
  trustedFieldsProvider,
32570
32570
  trustedRoles
32571
32571
  }) {
32572
- var _a, _b, _c, _d;
32572
+ var _a, _b, _c, _d, _e;
32573
32573
  const { accountHolder, setAccountHolder } = useCoreContext();
32574
32574
  const { i18n } = useI18nContext();
32575
32575
  const { showToast, clearToasts } = useToastContext();
@@ -32673,8 +32673,16 @@ function IndividualDropinComponent({
32673
32673
  onChange == null ? void 0 : onChange(currentState);
32674
32674
  }, [currentState, onChange]);
32675
32675
  const forms = useMemo(() => {
32676
+ var _a2;
32677
+ const formsWithUpdatedName = {
32678
+ ...individualForms,
32679
+ idDocument: {
32680
+ ...individualForms.idDocument,
32681
+ formName: ((_a2 = data.idVerificationMethod) == null ? void 0 : _a2.idVerificationMethod) === "instantVerification" ? "instantVerification" : "idDocument"
32682
+ }
32683
+ };
32676
32684
  const requiredForms = getRequiredForms(
32677
- individualForms,
32685
+ formsWithUpdatedName,
32678
32686
  derivedProps == null ? void 0 : derivedProps.requiredFields,
32679
32687
  derivedProps == null ? void 0 : derivedProps.optionalFields
32680
32688
  ).filter(
@@ -32682,20 +32690,26 @@ function IndividualDropinComponent({
32682
32690
  (form) => form.formId !== "idVerificationMethod" || Boolean(handleGetIdVerificationToken)
32683
32691
  );
32684
32692
  return addValidityToForms(requiredForms, formValidity, problems);
32685
- }, [derivedProps, formValidity, problems, handleGetIdVerificationToken]);
32693
+ }, [
32694
+ derivedProps,
32695
+ formValidity,
32696
+ problems,
32697
+ handleGetIdVerificationToken,
32698
+ (_b = data.idVerificationMethod) == null ? void 0 : _b.idVerificationMethod
32699
+ ]);
32686
32700
  const isRoleTypeTask = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER;
32687
32701
  if (isRoleTypeTask && parentLegalEntity) {
32688
32702
  roleTypes = getAllowedDecisionMakerRoles(parentLegalEntity, taskType);
32689
32703
  }
32690
32704
  if (parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) {
32691
- const associations = (_b = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _b.filter(
32705
+ const associations = (_c = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _c.filter(
32692
32706
  (ea) => ea.legalEntityId === (legalEntityResponse == null ? void 0 : legalEntityResponse.id)
32693
32707
  );
32694
32708
  if (associations && associations.length > 0) {
32695
32709
  if (isRoleTypeTask && parentLegalEntity) {
32696
- const jobTitle = (_c = associations.find(
32710
+ const jobTitle = (_d = associations.find(
32697
32711
  (association) => Boolean(association.jobTitle)
32698
- )) == null ? void 0 : _c.jobTitle;
32712
+ )) == null ? void 0 : _d.jobTitle;
32699
32713
  dataFromResponse = {
32700
32714
  ...dataFromResponse,
32701
32715
  personalDetails: {
@@ -32811,7 +32825,7 @@ function IndividualDropinComponent({
32811
32825
  parentLE,
32812
32826
  dataSubmitted
32813
32827
  }) => {
32814
- var _a2, _b2, _c2, _d2, _e, _f;
32828
+ var _a2, _b2, _c2, _d2, _e2, _f;
32815
32829
  const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER ? (_a2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _a2.role : taskType === TaskTypes.TRUST_MEMBER_INDIVIDUAL ? trustMember == null ? void 0 : trustMember.roles : null;
32816
32830
  const existingEntityAssociations = getOwnEntityAssociations(parentLE);
32817
32831
  if (newRoles && (hasRolesChanged(legalEntity, existingEntityAssociations, newRoles) || ((_b2 = dataFromResponse.personalDetails) == null ? void 0 : _b2.jobTitle) !== ((_c2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _c2.jobTitle))) {
@@ -32832,7 +32846,7 @@ function IndividualDropinComponent({
32832
32846
  };
32833
32847
  await handleUpdateLegalEntity(updatedParentLegalEntity, parentLE.id);
32834
32848
  }
32835
- if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS && (existingEntityAssociations.every((ea) => ea.legalEntityId !== legalEntity.id) || ((_d2 = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _d2.relationship) !== ((_e = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _e.relationship))) {
32849
+ if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS && (existingEntityAssociations.every((ea) => ea.legalEntityId !== legalEntity.id) || ((_d2 = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _d2.relationship) !== ((_e2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _e2.relationship))) {
32836
32850
  const newEntityAssociation = {
32837
32851
  type: "legalRepresentative",
32838
32852
  legalEntityId: legalEntity.id,
@@ -32995,7 +33009,7 @@ function IndividualDropinComponent({
32995
33009
  };
32996
33010
  const summaryOmittedKeys = [
32997
33011
  ...taskType === TaskTypes.DECISION_MAKER ? ["role"] : [],
32998
- ...((_d = data.personalDetails) == null ? void 0 : _d.idNumberExempt) ? ["idNumber"] : []
33012
+ ...((_e = data.personalDetails) == null ? void 0 : _e.idNumberExempt) ? ["idNumber"] : []
32999
33013
  ];
33000
33014
  const {
33001
33015
  handleNextClick,
@@ -34789,10 +34803,9 @@ function ServiceAgreementDropinComponent({
34789
34803
  handleHomeClick();
34790
34804
  };
34791
34805
  const handleExpandSection = (title) => {
34792
- userEvents.addEvent("Clicked accordion", {
34793
- actionLevel: "task",
34806
+ userEvents.addFieldEvent("Clicked accordion", {
34794
34807
  actionType: "open",
34795
- label: title
34808
+ field: title
34796
34809
  });
34797
34810
  };
34798
34811
  useEffect(() => {
@@ -34806,6 +34819,9 @@ function ServiceAgreementDropinComponent({
34806
34819
  const initialFormIndex = forms.length === signedForms.length ? 0 : signedForms.length;
34807
34820
  gotoForm(initialFormIndex);
34808
34821
  }, []);
34822
+ useEffect(() => {
34823
+ userEvents.updateSharedEventProperties({ page: activeForm.formName });
34824
+ }, [activeForm]);
34809
34825
  const gotoForm = (index) => {
34810
34826
  setActiveForm(forms[index]);
34811
34827
  setActiveFormIndex(index);
@@ -39633,7 +39649,7 @@ const ConfigurationApiProvider = ({
39633
39649
  }) => {
39634
39650
  const authContext = useAuthContext();
39635
39651
  const { isEmbeddedDropin, loadingContext } = authContext;
39636
- const sdkVersion = "2.64.0";
39652
+ const sdkVersion = "2.65.0";
39637
39653
  useAnalytics({
39638
39654
  onUserEvent,
39639
39655
  legalEntityId: rootLegalEntityId,
@@ -40267,7 +40283,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
40267
40283
  };
40268
40284
  const copyToClipboard = async () => {
40269
40285
  const toCopy = {
40270
- sdkVersion: "2.64.0",
40286
+ sdkVersion: "2.65.0",
40271
40287
  experiments: Object.fromEntries(allExperimentsWithValues),
40272
40288
  settings: Object.fromEntries(allSettingsWithValues)
40273
40289
  };
@@ -40332,7 +40348,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
40332
40348
  /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
40333
40349
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
40334
40350
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
40335
- /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.64.0" })
40351
+ /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.65.0" })
40336
40352
  ] }) }),
40337
40353
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
40338
40354
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "2.64.0",
3
+ "version": "2.65.0",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",
@@ -94,7 +94,7 @@
94
94
  "@commitlint/cli": "^17.7.1",
95
95
  "@commitlint/config-conventional": "^17.7.0",
96
96
  "@commitlint/prompt-cli": "^17.7.1",
97
- "@playwright/test": "1.41.0",
97
+ "@playwright/test": "^1.48.0",
98
98
  "@preact/preset-vite": "^2.8.1",
99
99
  "@storybook/addon-a11y": "^8.4.0",
100
100
  "@storybook/addon-actions": "^8.4.0",