@adyen/kyc-components 2.59.0 → 2.59.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.
@@ -11972,27 +11972,6 @@ function FieldContainer(props) {
11972
11972
  }
11973
11973
  return renderField(fieldName);
11974
11974
  }
11975
- const isIntersectionObserverSupported = typeof IntersectionObserver === "function";
11976
- function useIsElementVisible(ref, fallback = true) {
11977
- const [isOnScreen, setIsOnScreen] = useState(isIntersectionObserverSupported ? false : fallback);
11978
- const observerRef = useRef();
11979
- useEffect(() => {
11980
- if (!isIntersectionObserverSupported) return;
11981
- observerRef.current = new IntersectionObserver(
11982
- ([entry]) => setIsOnScreen(entry.isIntersecting)
11983
- );
11984
- }, []);
11985
- useEffect(() => {
11986
- var _a;
11987
- if (!ref.current) return;
11988
- (_a = observerRef.current) == null ? void 0 : _a.observe(ref.current);
11989
- return () => {
11990
- var _a2;
11991
- (_a2 = observerRef.current) == null ? void 0 : _a2.disconnect();
11992
- };
11993
- }, [ref]);
11994
- return isOnScreen;
11995
- }
11996
11975
  const logger$w = createLogger("SearchAddress");
11997
11976
  const SearchAddress = ({
11998
11977
  data,
@@ -12002,8 +11981,7 @@ const SearchAddress = ({
12002
11981
  handleAddressSearch,
12003
11982
  handleFindAddress,
12004
11983
  addressType,
12005
- kompanyAddress,
12006
- kompanyPrefilled = false
11984
+ kompanyAddress
12007
11985
  }) => {
12008
11986
  const { i18n } = useI18nContext();
12009
11987
  const [items, setItems] = useState([]);
@@ -12011,21 +11989,13 @@ const SearchAddress = ({
12011
11989
  const [resetSearch, setResetSearch] = useState(false);
12012
11990
  const [searchText, setSearchText] = useState(null);
12013
11991
  const [showSearchList, setShowSearchList] = useState(false);
12014
- const searchBoxRef = useRef(null);
12015
- const isVisible = useIsElementVisible(searchBoxRef);
12016
11992
  const canAutoFillKompanyAddress = kompanyAddress && searchText !== kompanyAddress && addressType === "registrationAddress";
12017
11993
  useEffect(() => {
12018
11994
  setSearchText(kompanyAddress);
12019
11995
  if (canAutoFillKompanyAddress) {
12020
- const searchForAddress = () => getSearchItems(kompanyAddress);
12021
- searchForAddress();
11996
+ getSearchItems(kompanyAddress);
12022
11997
  }
12023
11998
  }, [kompanyAddress]);
12024
- useEffect(() => {
12025
- if (isVisible && kompanyAddress && addressType === "registrationAddress" && !kompanyPrefilled) {
12026
- setShowSearchList(true);
12027
- }
12028
- }, [isVisible, kompanyAddress, addressType, kompanyPrefilled]);
12029
11999
  useEffect(() => {
12030
12000
  setItems([]);
12031
12001
  setResetSearch(true);
@@ -12166,7 +12136,6 @@ const SearchAddress = ({
12166
12136
  name: "searchAddress",
12167
12137
  className: "adyen-kyc-u-margin-bottom-8",
12168
12138
  label: i18n.get("searchAddress"),
12169
- wrapperRef: searchBoxRef,
12170
12139
  children: (childProps) => /* @__PURE__ */ jsx(
12171
12140
  Select,
12172
12141
  {
@@ -12538,16 +12507,14 @@ function Address(props) {
12538
12507
  [dataProp == null ? void 0 : dataProp.country, i18n]
12539
12508
  );
12540
12509
  const {
12510
+ schema,
12541
12511
  data,
12542
12512
  errors,
12543
12513
  valid,
12544
12514
  isValid,
12545
12515
  fieldProblems,
12546
12516
  handleChangeFor,
12547
- triggerValidation,
12548
- resetToDefaultData,
12549
- schema,
12550
- setData
12517
+ triggerValidation
12551
12518
  } = useForm({
12552
12519
  ...props,
12553
12520
  schema: requiredFields,
@@ -12622,26 +12589,6 @@ function Address(props) {
12622
12589
  setShowAddAddressButton(false);
12623
12590
  }
12624
12591
  }, [shouldValidate]);
12625
- const canAutofillVerifiedBusinessAddress = Boolean(
12626
- (verifiedBusiness == null ? void 0 : verifiedBusiness.street) && (verifiedBusiness == null ? void 0 : verifiedBusiness.city) && (verifiedBusiness == null ? void 0 : verifiedBusiness.state) && verifiedBusiness.zipcode
12627
- );
12628
- useEffect(() => {
12629
- if (!isExperimentEnabled("EnableNewBusinessDetailsFlow")) return;
12630
- if (verifiedBusiness && canAutofillVerifiedBusinessAddress) {
12631
- setShowAutocompletedAddressFields(true);
12632
- setShowAddAddressButton(false);
12633
- setData("address", verifiedBusiness.street);
12634
- setData("city", verifiedBusiness.city);
12635
- setData("stateOrProvince", verifiedBusiness.state);
12636
- setData("postalCode", verifiedBusiness.zipcode);
12637
- return triggerValidation();
12638
- }
12639
- if (!(dataProp == null ? void 0 : dataProp.address) || !(dataProp == null ? void 0 : dataProp.city) || !(dataProp == null ? void 0 : dataProp.postalCode)) {
12640
- setShowAutocompletedAddressFields(false);
12641
- setShowAddAddressButton(true);
12642
- resetToDefaultData();
12643
- }
12644
- }, [canAutofillVerifiedBusinessAddress, verifiedBusiness]);
12645
12592
  const getComponent = (fieldName) => {
12646
12593
  if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
12647
12594
  const hideField = fieldName === "country" && hideCountry;
@@ -12729,8 +12676,7 @@ function Address(props) {
12729
12676
  legalEntityId,
12730
12677
  autocompleteAddressForm,
12731
12678
  addressType,
12732
- kompanyAddress: verifiedBusiness == null ? void 0 : verifiedBusiness.address,
12733
- kompanyPrefilled: canAutofillVerifiedBusinessAddress
12679
+ kompanyAddress: verifiedBusiness == null ? void 0 : verifiedBusiness.address
12734
12680
  }
12735
12681
  ),
12736
12682
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-search-address--below", children: [
@@ -39515,7 +39461,7 @@ const ConfigurationApiProvider = ({
39515
39461
  }) => {
39516
39462
  const authContext = useAuthContext();
39517
39463
  const { isEmbeddedDropin, loadingContext } = authContext;
39518
- const sdkVersion = "2.59.0";
39464
+ const sdkVersion = "2.59.1";
39519
39465
  useAnalytics({
39520
39466
  onUserEvent,
39521
39467
  legalEntityId: rootLegalEntityId,
@@ -40174,7 +40120,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
40174
40120
  };
40175
40121
  const copyToClipboard = async () => {
40176
40122
  const toCopy = {
40177
- sdkVersion: "2.59.0",
40123
+ sdkVersion: "2.59.1",
40178
40124
  experiments: Object.fromEntries(allExperimentsWithValues),
40179
40125
  settings: Object.fromEntries(allSettingsWithValues)
40180
40126
  };
@@ -40239,7 +40185,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
40239
40185
  /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
40240
40186
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
40241
40187
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
40242
- /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.59.0" })
40188
+ /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.59.1" })
40243
40189
  ] }) }),
40244
40190
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
40245
40191
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
@@ -1,4 +1,4 @@
1
1
  import type { JSX } from 'preact';
2
2
  import type { SearchAddressProps } from '../types';
3
- declare const SearchAddress: ({ data, legalEntityId, autocompleteAddressForm, handleChangeFor, handleAddressSearch, handleFindAddress, addressType, kompanyAddress, kompanyPrefilled, }: SearchAddressProps) => JSX.Element;
3
+ declare const SearchAddress: ({ data, legalEntityId, autocompleteAddressForm, handleChangeFor, handleAddressSearch, handleFindAddress, addressType, kompanyAddress, }: SearchAddressProps) => JSX.Element;
4
4
  export default SearchAddress;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "2.59.0",
3
+ "version": "2.59.1",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",
@@ -1,2 +0,0 @@
1
- import type { MutableRef } from 'preact/hooks';
2
- export declare function useIsElementVisible(ref: MutableRef<Element>, fallback?: boolean): boolean;