@cccsaurora/clue-ui 1.6.0-dev.540.1 → 1.6.0-dev.543.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.
@@ -1,7 +1,13 @@
1
+ import { d as toString } from "../_baseGet-Cmp6FztG.js";
1
2
  import { u as uniqBy } from "../ClueEnrichContext-DmERFjhQ.js";
2
3
  import { useContext, useMemo, useState, useEffect } from "react";
3
4
  import { ClueDatabaseContext } from "./ClueDatabaseContext.js";
4
5
  import { f as useClueEnrichSelector } from "../ActionForm-C1D2_1Pg.js";
6
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
7
+ function escapeRegExp(string) {
8
+ string = toString(string);
9
+ return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
10
+ }
5
11
  const useAnnotations = (type, value, _classification, { skipEnrichment } = { skipEnrichment: false }) => {
6
12
  var _a;
7
13
  const database = useContext(ClueDatabaseContext);
@@ -48,7 +54,7 @@ const useAnnotations = (type, value, _classification, { skipEnrichment } = { ski
48
54
  $or: [
49
55
  {
50
56
  // Use regex instead of exact value for case-insensitivity
51
- value: { $regex: `^${value}$`, $options: "i" }
57
+ value: { $regex: `^${escapeRegExp(value)}$`, $options: "i" }
52
58
  },
53
59
  {
54
60
  value
package/package.json CHANGED
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "type": "module",
60
60
  "types": "main.d.ts",
61
- "version": "1.6.0-dev.540.1",
61
+ "version": "1.6.0-dev.543.1",
62
62
  "exports": {
63
63
  ".": "./main.js",
64
64
  "./index.css": "./index.css",