@dsh-plus/web-search-services 0.1.11 → 0.1.13
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 +54 -43
- package/package.json +2 -2
package/lib/client.js
CHANGED
|
@@ -7,6 +7,54 @@ window.__ModuleLoader__.load({
|
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let react = require("react");
|
|
9
9
|
require("@deepseek-ai/dsh-client-ui-primitives");
|
|
10
|
+
//#region ../shared/src/client/fields.tsx
|
|
11
|
+
/** 卡片按钮(与 CardChrome 页脚同一套类名与视觉)。 */
|
|
12
|
+
function Button(props) {
|
|
13
|
+
const p = props.prefix ?? "dshp";
|
|
14
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
15
|
+
type: "button",
|
|
16
|
+
className: `${p}-btn ${props.variant === "primary" ? `${p}-btnPrimary` : `${p}-btnGhost`}`,
|
|
17
|
+
disabled: props.disabled === true,
|
|
18
|
+
onClick: props.onClick,
|
|
19
|
+
children: props.label
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function TextField(props) {
|
|
23
|
+
const p = props.prefix ?? "dshp";
|
|
24
|
+
const invalid = props.invalid === true;
|
|
25
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
26
|
+
className: `${p}-field`,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
29
|
+
className: `${p}-head`,
|
|
30
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
31
|
+
className: `${p}-label`,
|
|
32
|
+
htmlFor: props.id,
|
|
33
|
+
children: props.label
|
|
34
|
+
}), props.badge !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
35
|
+
className: `${p}-badge ${props.badge.set ? `${p}-badgeSet` : `${p}-badgeUnset`}`,
|
|
36
|
+
children: props.badge.text
|
|
37
|
+
}) : null]
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
40
|
+
id: props.id,
|
|
41
|
+
className: `${p}-input${invalid ? ` ${p}-inputInvalid` : ""}`,
|
|
42
|
+
type: props.password === true ? "password" : "text",
|
|
43
|
+
inputMode: props.numeric === true ? "numeric" : void 0,
|
|
44
|
+
autoComplete: props.password === true ? "off" : void 0,
|
|
45
|
+
"aria-invalid": invalid || void 0,
|
|
46
|
+
value: props.value,
|
|
47
|
+
disabled: props.disabled === true,
|
|
48
|
+
onChange: (event) => props.onEdit(event.target.value)
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
51
|
+
className: invalid ? `${p}-invalid` : `${p}-hint`,
|
|
52
|
+
children: invalid ? props.invalidLabel ?? "" : props.hint ?? ""
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
10
58
|
//#region ../shared/src/client/card.tsx
|
|
11
59
|
const IDLE_STATUS = {
|
|
12
60
|
kind: "idle",
|
|
@@ -55,12 +103,12 @@ window.__ModuleLoader__.load({
|
|
|
55
103
|
className: `${p}-status${props.status.kind === "error" ? ` ${p}-statusError` : ""}`,
|
|
56
104
|
role: "status",
|
|
57
105
|
children: props.status.text
|
|
58
|
-
}) : null, props.actions.map((action) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
106
|
+
}) : null, props.actions.map((action) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
107
|
+
prefix: p,
|
|
108
|
+
label: action.label,
|
|
109
|
+
variant: action.variant,
|
|
110
|
+
disabled: action.disabled,
|
|
111
|
+
onClick: action.onClick
|
|
64
112
|
}, action.key))]
|
|
65
113
|
})
|
|
66
114
|
]
|
|
@@ -181,43 +229,6 @@ window.__ModuleLoader__.load({
|
|
|
181
229
|
};
|
|
182
230
|
}
|
|
183
231
|
//#endregion
|
|
184
|
-
//#region ../shared/src/client/fields.tsx
|
|
185
|
-
function TextField(props) {
|
|
186
|
-
const p = props.prefix ?? "dshp";
|
|
187
|
-
const invalid = props.invalid === true;
|
|
188
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
189
|
-
className: `${p}-field`,
|
|
190
|
-
children: [
|
|
191
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
192
|
-
className: `${p}-head`,
|
|
193
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
194
|
-
className: `${p}-label`,
|
|
195
|
-
htmlFor: props.id,
|
|
196
|
-
children: props.label
|
|
197
|
-
}), props.badge !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
198
|
-
className: `${p}-badge ${props.badge.set ? `${p}-badgeSet` : `${p}-badgeUnset`}`,
|
|
199
|
-
children: props.badge.text
|
|
200
|
-
}) : null]
|
|
201
|
-
}),
|
|
202
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
203
|
-
id: props.id,
|
|
204
|
-
className: `${p}-input${invalid ? ` ${p}-inputInvalid` : ""}`,
|
|
205
|
-
type: props.password === true ? "password" : "text",
|
|
206
|
-
inputMode: props.numeric === true ? "numeric" : void 0,
|
|
207
|
-
autoComplete: props.password === true ? "off" : void 0,
|
|
208
|
-
"aria-invalid": invalid || void 0,
|
|
209
|
-
value: props.value,
|
|
210
|
-
disabled: props.disabled === true,
|
|
211
|
-
onChange: (event) => props.onEdit(event.target.value)
|
|
212
|
-
}),
|
|
213
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
214
|
-
className: invalid ? `${p}-invalid` : `${p}-hint`,
|
|
215
|
-
children: invalid ? props.invalidLabel ?? "" : props.hint ?? ""
|
|
216
|
-
})
|
|
217
|
-
]
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
//#endregion
|
|
221
232
|
//#region ../shared/src/client/i18n.ts
|
|
222
233
|
/** 卡片通用文案(save/discard/unsaved/loading 等四插件共有键)。 */
|
|
223
234
|
const commonZh = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-plus/web-search-services",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "dsh-plus service plugin: web_search 免费后端聚合——经官方 ctx.web provider 扩展点桥接 search-services skill(Tavily/Exa/OpenAI Chat 免费额度,优先级+自动回退+key 配置),官方 web_search 工具与输出格式零修改",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@dsh-plus/shared": "0.1.
|
|
35
|
+
"@dsh-plus/shared": "0.1.35"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@deepseek-ai/cordis": "^4.0.5-alpha.1",
|