@sensiblestats/widget-react 0.81.1 → 0.81.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/index.js CHANGED
@@ -5966,15 +5966,25 @@ function starClickable(group, pinnedCompetitionId) {
5966
5966
  function foldSearchText(s) {
5967
5967
  return s.replace(/İ/g, "I").replace(/ı/g, "i").normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
5968
5968
  }
5969
+ function competitionMatchesQuery(group, q) {
5970
+ if (foldSearchText(group.competitionName).includes(q)) return true;
5971
+ return !!group.competitionCountry && foldSearchText(group.competitionCountry).includes(q);
5972
+ }
5969
5973
  function matchesQuery(group, query) {
5970
5974
  const q = foldSearchText(query.trim());
5971
5975
  if (!q) return true;
5972
- if (foldSearchText(group.competitionName).includes(q)) return true;
5973
- if (group.competitionCountry && foldSearchText(group.competitionCountry).includes(q)) return true;
5976
+ if (competitionMatchesQuery(group, q)) return true;
5974
5977
  return group.matches.some(
5975
5978
  (m) => foldSearchText(m.homeTeamName).includes(q) || foldSearchText(m.awayTeamName).includes(q)
5976
5979
  );
5977
5980
  }
5981
+ function matchingFixtures(group, query) {
5982
+ const q = foldSearchText(query.trim());
5983
+ if (!q || competitionMatchesQuery(group, q)) return group.matches;
5984
+ return group.matches.filter(
5985
+ (m) => foldSearchText(m.homeTeamName).includes(q) || foldSearchText(m.awayTeamName).includes(q)
5986
+ );
5987
+ }
5978
5988
 
5979
5989
  // src/useStarTap.ts
5980
5990
  import { useCallback as useCallback13, useRef as useRef17, useState as useState27 } from "react";
@@ -6341,7 +6351,7 @@ function TodayPanel({ discovery, ui, monitor }) {
6341
6351
  ] }) : null
6342
6352
  ] })
6343
6353
  ] }),
6344
- group.matches.map((match) => /* @__PURE__ */ jsx60(
6354
+ matchingFixtures(group, query).map((match) => /* @__PURE__ */ jsx60(
6345
6355
  "div",
6346
6356
  {
6347
6357
  role: "button",