@tellescope/react-components 1.175.0 → 1.176.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellescope/react-components",
3
- "version": "1.175.0",
3
+ "version": "1.176.0",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -47,13 +47,13 @@
47
47
  "@reduxjs/toolkit": "^1.6.2",
48
48
  "@stripe/react-stripe-js": "^2.9.0",
49
49
  "@stripe/stripe-js": "^1.52.1",
50
- "@tellescope/constants": "^1.175.0",
51
- "@tellescope/sdk": "^1.175.0",
52
- "@tellescope/types-client": "^1.175.0",
53
- "@tellescope/types-models": "^1.175.0",
54
- "@tellescope/types-utilities": "^1.175.0",
55
- "@tellescope/utilities": "^1.175.0",
56
- "@tellescope/validation": "^1.175.0",
50
+ "@tellescope/constants": "^1.176.0",
51
+ "@tellescope/sdk": "^1.176.0",
52
+ "@tellescope/types-client": "^1.176.0",
53
+ "@tellescope/types-models": "^1.176.0",
54
+ "@tellescope/types-utilities": "^1.176.0",
55
+ "@tellescope/utilities": "^1.176.0",
56
+ "@tellescope/validation": "^1.176.0",
57
57
  "@typescript-eslint/eslint-plugin": "^4.33.0",
58
58
  "@typescript-eslint/parser": "^4.33.0",
59
59
  "css-to-react-native": "^3.0.0",
@@ -84,7 +84,7 @@
84
84
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
85
85
  "react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
86
86
  },
87
- "gitHead": "d4b035d1d3a40b4177169dd41b911eec7383c949",
87
+ "gitHead": "0d2bd51eb1418f968d6a11b0376c5e383dbcce34",
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  }
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useCallback, useMemo, useState, useRef } from "react"
2
2
  import { Indexable, ScoreFilter } from "@tellescope/types-utilities"
3
- import { objects_equivalent, read_local_storage, safeJSONParse, update_local_storage, user_display_name } from "@tellescope/utilities"
3
+ import { objects_equivalent, read_local_storage, safeJSONParse, to_human_readable_phone_number, update_local_storage, user_display_name } from "@tellescope/utilities"
4
4
  import { LoadFunction, LoadFunctionArguments } from "@tellescope/sdk"
5
5
  import { ALL_ACCESS, UNSEARCHABLE_FIELDS } from "@tellescope/constants"
6
6
  import { SearchAPIProps, useSearchAPI } from "./hooks"
@@ -224,6 +224,15 @@ export const filter_for_query = <T,>(query: string, getAdditionalFields?: (v: T)
224
224
  score +=1
225
225
  continue
226
226
  }
227
+ // for phone number search, replace human-readable entries which are not stored
228
+ const onlyNumbers = query.replaceAll(/[^0-9]/g, '')
229
+ if (
230
+ onlyNumbers.length >= 3 &&
231
+ value.toUpperCase().includes(onlyNumbers)
232
+ ) {
233
+ score +=1
234
+ continue
235
+ }
227
236
  }
228
237
 
229
238
  return score