dsh-free-search 0.9.49 → 0.9.50
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/client.js +36 -19
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -733,7 +733,7 @@ window.__ModuleLoader__.load({
|
|
|
733
733
|
"cache_search",
|
|
734
734
|
"domain_search",
|
|
735
735
|
];
|
|
736
|
-
const PLUGIN_VERSION = "0.9.
|
|
736
|
+
const PLUGIN_VERSION = "0.9.50";
|
|
737
737
|
const PLUGIN_REPO_URL = "https://github.com/DDDMUC/dsh-free-search";
|
|
738
738
|
// 右侧浮动目录(#85):条目顺序即页面顺序,anchor 是页面里对应 field 的 id。
|
|
739
739
|
const NAV_ITEMS = [
|
|
@@ -745,6 +745,14 @@ window.__ModuleLoader__.load({
|
|
|
745
745
|
{ id: "performance", anchor: "dshfs-anchor-performance" },
|
|
746
746
|
{ id: "prompt", anchor: "dshfs-anchor-prompt" },
|
|
747
747
|
];
|
|
748
|
+
const sectionIdFromHash = () => {
|
|
749
|
+
const hash = String((typeof window !== "undefined" && window.location && window.location.hash) || "");
|
|
750
|
+
const parts = decodeURIComponent(hash.replace(/^#\/?/, "")).split("/").filter(Boolean);
|
|
751
|
+
const index = parts.lastIndexOf("plugins");
|
|
752
|
+
if (index >= 0) return parts[index + 2] || "";
|
|
753
|
+
if (parts[0] === "panel" && parts[1] === "dsh-free-search") return parts[2] || "";
|
|
754
|
+
return parts.length === 1 ? parts[0] : "";
|
|
755
|
+
};
|
|
748
756
|
// 目录跟着真正滚动的祖先走:DSH 页面通常不是 window 在滚。
|
|
749
757
|
const findScrollParent = (element) => {
|
|
750
758
|
let node = element && element.parentElement ? element.parentElement : null;
|
|
@@ -960,10 +968,24 @@ window.__ModuleLoader__.load({
|
|
|
960
968
|
return response.json();
|
|
961
969
|
}
|
|
962
970
|
|
|
963
|
-
//
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
971
|
+
// 侧栏入口跟随 DSH 的界面语言,而不是浏览器语言。
|
|
972
|
+
const PANEL_LABELS = {
|
|
973
|
+
zh: "免费搜索",
|
|
974
|
+
en: "Free Search",
|
|
975
|
+
ja: "無料検索",
|
|
976
|
+
es: "Búsqueda gratis",
|
|
977
|
+
fr: "Recherche gratuite",
|
|
978
|
+
de: "Kostenlose Suche",
|
|
979
|
+
ru: "Бесплатный поиск",
|
|
980
|
+
pt: "Pesquisa grátis",
|
|
981
|
+
};
|
|
982
|
+
let localeFace = null;
|
|
983
|
+
function panelLabel(active) {
|
|
984
|
+
const current = active ?? localeFace?.getLocale?.().active ?? "";
|
|
985
|
+
const id = String(current || "").trim().toLowerCase().split(/[-_]/)[0];
|
|
986
|
+
if (id) return PANEL_LABELS[id] || "Free Search";
|
|
987
|
+
const primary = typeof navigator === "undefined" ? "" : String((navigator.languages && navigator.languages[0]) || navigator.language || "").toLowerCase();
|
|
988
|
+
return PANEL_LABELS[primary.split(/[-_]/)[0]] || "Free Search";
|
|
967
989
|
}
|
|
968
990
|
|
|
969
991
|
function FreeSearchPage() {
|
|
@@ -1728,19 +1750,12 @@ window.__ModuleLoader__.load({
|
|
|
1728
1750
|
return () => window.removeEventListener("resize", place);
|
|
1729
1751
|
}, [open, state.status]);
|
|
1730
1752
|
|
|
1731
|
-
// 分区链接:地址栏里出现 #/panel/
|
|
1753
|
+
// 分区链接:地址栏里出现 #/panel/dsh-free-search/<分区>(或旧插件页 …/plugins/dsh-free-search/<分区>)就滚过去。
|
|
1732
1754
|
// 本插件**只读不写** URL —— 地址栏的唯一写者是 dsh-url-router,写这里会跟它抢。
|
|
1733
1755
|
react.useEffect(() => {
|
|
1734
1756
|
if (!pageMode) return undefined;
|
|
1735
|
-
const sectionOfHash = () => {
|
|
1736
|
-
const hash = String((typeof window !== "undefined" && window.location && window.location.hash) || "");
|
|
1737
|
-
const parts = decodeURIComponent(hash.replace(/^#\/?/, "")).split("/").filter(Boolean);
|
|
1738
|
-
const index = parts.lastIndexOf("plugins");
|
|
1739
|
-
if (index >= 0) return parts[index + 2] || "";
|
|
1740
|
-
return parts.length === 1 ? parts[0] : "";
|
|
1741
|
-
};
|
|
1742
1757
|
const apply = () => {
|
|
1743
|
-
const id =
|
|
1758
|
+
const id = sectionIdFromHash();
|
|
1744
1759
|
if (!id || !NAV_ITEMS.some((entry) => entry.id === id)) return;
|
|
1745
1760
|
const node = document.querySelector(`[data-dsh-section="${id}"]`)
|
|
1746
1761
|
|| (NAV_ITEMS.find((entry) => entry.id === id) ? document.getElementById(NAV_ITEMS.find((entry) => entry.id === id).anchor) : null);
|
|
@@ -1947,7 +1962,7 @@ window.__ModuleLoader__.load({
|
|
|
1947
1962
|
],
|
|
1948
1963
|
}, segment.key);
|
|
1949
1964
|
};
|
|
1950
|
-
const title =
|
|
1965
|
+
const title = panelLabel();
|
|
1951
1966
|
const description = t.description;
|
|
1952
1967
|
const allowlistMode = allowedEngines.length > 0;
|
|
1953
1968
|
const engineDisabled = (id) => (allowlistMode ? !allowedEngines.includes(id) : disabledEngines.includes(id));
|
|
@@ -2175,12 +2190,11 @@ window.__ModuleLoader__.load({
|
|
|
2175
2190
|
ref: railRef,
|
|
2176
2191
|
"aria-label": t.navLabel,
|
|
2177
2192
|
children: NAV_ITEMS.map((item) =>
|
|
2178
|
-
//
|
|
2179
|
-
//
|
|
2180
|
-
// 这条分区的地址,点击时浏览器自己改 hash,滚动仍由 goToSection 立即完成。
|
|
2193
|
+
// 分区链接挂在独立页自己的 #/panel/dsh-free-search/<id> 下,
|
|
2194
|
+
// 不再指到 #/panel/plugins/... 的插件行页。
|
|
2181
2195
|
react_jsx_runtime.jsx("a", {
|
|
2182
2196
|
className: "dshfs-railItem" + (railActive === item.id ? " dshfs-railItemActive" : ""),
|
|
2183
|
-
href: `#/panel/
|
|
2197
|
+
href: `#/panel/dsh-free-search/${item.id}`,
|
|
2184
2198
|
"data-dsh-fs-section": item.id,
|
|
2185
2199
|
"data-dsh-section": item.id,
|
|
2186
2200
|
onClick: () => goToSection(item.id),
|
|
@@ -3172,6 +3186,9 @@ react_jsx_runtime.jsx("div", {
|
|
|
3172
3186
|
const inject = ["slots", "commandUi"];
|
|
3173
3187
|
|
|
3174
3188
|
function apply(ctx) {
|
|
3189
|
+
ctx.inject(["locale"], (sctx) => {
|
|
3190
|
+
localeFace = sctx.get("locale") || null;
|
|
3191
|
+
});
|
|
3175
3192
|
// 挂插件页 slot:侧栏 插件 → 已安装 → free-search → 行配置页。
|
|
3176
3193
|
// rc.1 废弃了旧版设置页的插件配置 slot,只保留 plugins.row.config;
|
|
3177
3194
|
// key 规则见 ui-plugin-manager 的 rowConfigKey:<包名>#<patch 里声明的行 id>。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-free-search",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.50",
|
|
4
4
|
"description": "Free web search for DeepSeek Harness: 39 engines (Bing/DuckDuckGo/AnySearch/SearXNG/Exa/Tavily/Keenable/Firecrawl/Parallel/You.com keyless; Zhihu global/site via MCP and Perplexity/SerpBase/DeepSeek (official + native tools/search)/Baidu/Kimi/Aliyun/Doubao/Google CSE/Metaso/Yandex/Yuanbao with key; OpenAI/Gemini/Claude model built-in search, explicit-only) + auto smart routing + global engine enable/disable & fallback priority + editable zh/en language pools + multi mode (parallel full language-pool merge) + multi_search cross-source tool + failure-aware fallback (quota/auth cooldown, transient retry, fallbackOn) + time filtering + platform search + domain blocklist (blockedDomains) + web_fetch, with web settings UI, plus a standalone stdio MCP server.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|