zyjj-web-sdk 1.0.13 → 1.0.14

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/lib/index.js CHANGED
@@ -58467,25 +58467,25 @@ function Y2e(e) {
58467
58467
  return f(E.current), E;
58468
58468
  });
58469
58469
  }, m = ir(Km(function() {
58470
- var j;
58471
- const y = [], E = n, b = r.length > 0 && ((j = r[0].name) == null ? void 0 : j.split(".").pop()) || void 0;
58472
- console.log("[search-bar] user search", b, E), i == null || i.find_conditions.forEach((_) => {
58473
- var I, O;
58474
- const x = {
58475
- info: i == null ? void 0 : i.tool_info[_.id],
58470
+ var j, _;
58471
+ const y = [], E = n, b = r.length > 0 && ((_ = (j = r[0].name) == null ? void 0 : j.split(".").pop()) == null ? void 0 : _.toLowerCase()) || void 0;
58472
+ console.log("[search-bar] user search", b, E), i == null || i.find_conditions.forEach((x) => {
58473
+ var O, N;
58474
+ const I = {
58475
+ info: i == null ? void 0 : i.tool_info[x.id],
58476
58476
  hasFile: !!b,
58477
58477
  score: 0,
58478
58478
  source: _n.None
58479
58479
  };
58480
- if (y.push(x), !(b && !((I = _.ext) != null && I.includes(b)))) {
58480
+ if (y.push(I), !(b && !((O = x.ext) != null && O.includes(b)))) {
58481
58481
  if (E.trim() == "") {
58482
- x.score = 1, x.source = _n.Default;
58482
+ I.score = 1, I.source = _n.Default;
58483
58483
  return;
58484
58484
  }
58485
- (O = _.regex) == null || O.find((N) => N == ".*" ? (x.score = 1, x.source = _n.Regex, !0) : new RegExp(N).test(E) ? (x.score = 2, x.source = _n.Regex, !0) : !1), !(E.length > 30) && (_.name.includes(E) ? (x.score = 5, x.source = _n.Keyword) : _.ping_yin.includes(E.toLowerCase()) ? (x.score = 4, x.source = _n.PingYin) : _.ping_yin_first.includes(E.toLowerCase()) && (x.score = 3, x.source = _n.PingYinFirst));
58485
+ (N = x.regex) == null || N.find((T) => T == ".*" ? (I.score = 1, I.source = _n.Regex, !0) : new RegExp(T).test(E) ? (I.score = 2, I.source = _n.Regex, !0) : !1), !(E.length > 30) && (x.name.includes(E) ? (I.score = 5, I.source = _n.Keyword) : x.ping_yin.includes(E.toLowerCase()) ? (I.score = 4, I.source = _n.PingYin) : x.ping_yin_first.includes(E.toLowerCase()) && (I.score = 3, I.source = _n.PingYinFirst));
58486
58486
  }
58487
58487
  });
58488
- const k = y.filter((_) => _.score > 0).sort((_, x) => x.score - _.score);
58488
+ const k = y.filter((x) => x.score > 0).sort((x, I) => I.score - x.score);
58489
58489
  s({
58490
58490
  tools: k || [],
58491
58491
  current: 0
@@ -58495,7 +58495,7 @@ function Y2e(e) {
58495
58495
  m();
58496
58496
  }, [r, n]);
58497
58497
  const g = async () => {
58498
- const y = await f1(), E = await dfe("search_config"), k = JSON.parse(E.value).reduce((_, x) => (_[x.id] = x, _), {}), j = { tool_info: {}, find_conditions: [], find_config: k };
58498
+ const y = await f1(), E = await dfe("search_config"), k = JSON.parse(E.value).reduce((_, x) => (_[x.tool_id] = x, _), {}), j = { tool_info: {}, find_conditions: [], find_config: k };
58499
58499
  return y.list.forEach((_) => {
58500
58500
  j.tool_info[_.id] = _;
58501
58501
  const x = {