@crystaldesign/diva-navigator 26.3.0-rc.13 → 26.3.0-rc.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.
@@ -806,7 +806,10 @@ function performSearch(fuse, flatItems, query) {
806
806
  var _scoreMap$get, _result$score;
807
807
  var result = _step9.value;
808
808
  var prev = (_scoreMap$get = scoreMap.get(result.item._id)) !== null && _scoreMap$get !== void 0 ? _scoreMap$get : 0;
809
- var positionBonus = getMatchPositionScore(result) * POSITION_WEIGHT;
809
+ // getMatchPositionScore returns rank (0 best -> 2 worst). Convert to boost
810
+ // so stronger positional matches receive larger score reductions.
811
+ var positionRank = getMatchPositionScore(result);
812
+ var positionBonus = Math.max(0, 2 - Math.min(positionRank, 2)) * POSITION_WEIGHT;
810
813
  scoreMap.set(result.item._id, prev + ((_result$score = result.score) !== null && _result$score !== void 0 ? _result$score : 0) - positionBonus - MATCH_COUNT_BONUS);
811
814
  if (result.matches) {
812
815
  var _iterator10 = _createForOfIteratorHelper$2(result.matches),
@@ -1 +1 @@
1
- {"version":3,"file":"useTreeSearch.d.ts","sourceRoot":"","sources":["../../../../../src/OrgTreeSelect/useTreeSearch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAuB,OAAO,EAAE,MAAM,SAAS,CAAC;AA+NpE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE;;4BAKZ,MAAM;;6BAIL,OAAO;;;;;EAuDpD"}
1
+ {"version":3,"file":"useTreeSearch.d.ts","sourceRoot":"","sources":["../../../../../src/OrgTreeSelect/useTreeSearch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAuB,OAAO,EAAE,MAAM,SAAS,CAAC;AAkOpE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE;;4BAKZ,MAAM;;6BAIL,OAAO;;;;;EAuDpD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-navigator",
3
- "version": "26.3.0-rc.13",
3
+ "version": "26.3.0-rc.14",
4
4
  "license": "MIT",
5
5
  "devDependencies": {
6
6
  "@testing-library/jest-dom": "^6.5.0",
@@ -25,5 +25,5 @@
25
25
  },
26
26
  "module": "build/esm/index.js",
27
27
  "types": "./build/types/navigator/src/index.d.ts",
28
- "gitHead": "cfdceef9b2c0ec13c406fd247dc62de58fb75e43"
28
+ "gitHead": "1652cac38678f09e80f03c10d0f392b6e0c0f990"
29
29
  }