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 +11 -11
- package/lib/index.umd.cjs +1 -1
- package/lib/pages/SearchBar.d.ts +1 -1
- package/package.json +1 -1
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
|
|
58474
|
-
const
|
|
58475
|
-
info: i == null ? void 0 : i.tool_info[
|
|
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(
|
|
58480
|
+
if (y.push(I), !(b && !((O = x.ext) != null && O.includes(b)))) {
|
|
58481
58481
|
if (E.trim() == "") {
|
|
58482
|
-
|
|
58482
|
+
I.score = 1, I.source = _n.Default;
|
|
58483
58483
|
return;
|
|
58484
58484
|
}
|
|
58485
|
-
(
|
|
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((
|
|
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.
|
|
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 = {
|