@servicetitan/onboarding-ui 5.2.2 → 5.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"use-scroll-to-error.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-scroll-to-error/use-scroll-to-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAEvD,eAAO,MAAM,sBAAsB,UAKlC,CAAC;AAEF,eAAO,MAAM,gBAAgB,8EAEL,IAAI,CAmB3B,CAAC"}
1
+ {"version":3,"file":"use-scroll-to-error.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-scroll-to-error/use-scroll-to-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAEvD,eAAO,MAAM,sBAAsB,UAKlC,CAAC;AAEF,eAAO,MAAM,gBAAgB,8EAEL,IAAI,CAgB3B,CAAC"}
@@ -10,15 +10,12 @@ export const useScrollToError = (errorClassNames = errorClassNamesDefault) => {
10
10
  const scrollToErrorHandler = useCallback(() => {
11
11
  setTimeout(() => {
12
12
  if (ref.current) {
13
- for (const errorClassName of errorClassNames) {
14
- const error = ref.current.querySelector(errorClassName);
15
- if (error) {
16
- error.scrollIntoView({
17
- block: 'center',
18
- behavior: 'smooth',
19
- });
20
- break;
21
- }
13
+ const error = ref.current.querySelector(errorClassNames.join(', '));
14
+ if (error) {
15
+ error.scrollIntoView({
16
+ block: 'center',
17
+ behavior: 'smooth',
18
+ });
22
19
  }
23
20
  }
24
21
  }, 0);
@@ -1 +1 @@
1
- {"version":3,"file":"use-scroll-to-error.js","sourceRoot":"","sources":["../../../src/hooks/use-scroll-to-error/use-scroll-to-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,CAAC,MAAM,sBAAsB,GAAG;I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AE;YACZ,IAAI,GAAG,CAAC,OAAO,EAAE;gBACb,MAAM,KAAK,GAAG,GAAG,CAAC,OAAQ,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;gBACrE,IAAI,KAAK,EAAE;oBACP,KAAK,CAAC,cAAc,CAAC;wBACjB,KAAK,EAAE,QAAQ;wBACf,QAAQ,EAAE,QAAQ;qBACrB,CAAC,CAAC;iBACN;aACJ;QACL,CAAC,EAAE,CAAC,CAAC,CAAC;IACV,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;AACvC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/onboarding-ui",
3
- "version": "5.2.2",
3
+ "version": "5.4.0",
4
4
  "description": "Shared components between servicetitan monolith and Onboarding",
5
5
  "repository": {
6
6
  "type": "git",
@@ -53,7 +53,7 @@
53
53
  "@contentful/rich-text-react-renderer": "^15.6.2",
54
54
  "@contentful/rich-text-types": "^15.7.0",
55
55
  "@servicetitan/contentful-proxy": "^1.1.10",
56
- "@servicetitan/react-hooks": "^2.8.0",
56
+ "@servicetitan/react-hooks": "^2.9.0",
57
57
  "@types/google.maps": "^3.45.6",
58
58
  "classnames": "~2.3.1",
59
59
  "contentful-resolve-response": "^1.3.0",
@@ -71,5 +71,5 @@
71
71
  "less": true,
72
72
  "webpack": false
73
73
  },
74
- "gitHead": "7e7249314331ad1cd1762f226b679294c0b39667"
74
+ "gitHead": "1acc525c3516017ff8dc26cfe8a3988ec76678d4"
75
75
  }
@@ -14,15 +14,12 @@ export const useScrollToError = <T extends HTMLElement>(
14
14
  const scrollToErrorHandler = useCallback(() => {
15
15
  setTimeout(() => {
16
16
  if (ref.current) {
17
- for (const errorClassName of errorClassNames) {
18
- const error = ref.current!.querySelector(errorClassName);
19
- if (error) {
20
- error.scrollIntoView({
21
- block: 'center',
22
- behavior: 'smooth',
23
- });
24
- break;
25
- }
17
+ const error = ref.current!.querySelector(errorClassNames.join(', '));
18
+ if (error) {
19
+ error.scrollIntoView({
20
+ block: 'center',
21
+ behavior: 'smooth',
22
+ });
26
23
  }
27
24
  }
28
25
  }, 0);