@dsh-plus/web-cache-headers 0.1.7 → 0.1.9
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 +42 -31
- package/package.json +2 -2
package/lib/client.js
CHANGED
|
@@ -7,6 +7,42 @@ 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
|
+
/**
|
|
23
|
+
* 勾选行:自绘圆角扁平开关(switch),对齐官方 WebUI 无原生 checkbox 的
|
|
24
|
+
* 设计语言(官方选择类控件全走胶囊/菜单,见 cardCss 的 -switch 规则)。
|
|
25
|
+
* 语义保持 checkbox(无障碍树与表单语义不变),视觉自绘。
|
|
26
|
+
*/
|
|
27
|
+
function CheckRow(props) {
|
|
28
|
+
const p = props.prefix ?? "dshp";
|
|
29
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
30
|
+
className: `${p}-checkRow`,
|
|
31
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
32
|
+
id: props.id,
|
|
33
|
+
type: "checkbox",
|
|
34
|
+
role: "switch",
|
|
35
|
+
"aria-checked": props.checked,
|
|
36
|
+
checked: props.checked,
|
|
37
|
+
disabled: props.disabled === true,
|
|
38
|
+
onChange: (event) => props.onEdit(event.target.checked)
|
|
39
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
40
|
+
htmlFor: props.id,
|
|
41
|
+
children: props.label
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
10
46
|
//#region ../shared/src/client/card.tsx
|
|
11
47
|
const IDLE_STATUS = {
|
|
12
48
|
kind: "idle",
|
|
@@ -55,12 +91,12 @@ window.__ModuleLoader__.load({
|
|
|
55
91
|
className: `${p}-status${props.status.kind === "error" ? ` ${p}-statusError` : ""}`,
|
|
56
92
|
role: "status",
|
|
57
93
|
children: props.status.text
|
|
58
|
-
}) : null, props.actions.map((action) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
94
|
+
}) : null, props.actions.map((action) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
95
|
+
prefix: p,
|
|
96
|
+
label: action.label,
|
|
97
|
+
variant: action.variant,
|
|
98
|
+
disabled: action.disabled,
|
|
99
|
+
onClick: action.onClick
|
|
64
100
|
}, action.key))]
|
|
65
101
|
})
|
|
66
102
|
]
|
|
@@ -181,31 +217,6 @@ window.__ModuleLoader__.load({
|
|
|
181
217
|
};
|
|
182
218
|
}
|
|
183
219
|
//#endregion
|
|
184
|
-
//#region ../shared/src/client/fields.tsx
|
|
185
|
-
/**
|
|
186
|
-
* 勾选行:自绘圆角扁平开关(switch),对齐官方 WebUI 无原生 checkbox 的
|
|
187
|
-
* 设计语言(官方选择类控件全走胶囊/菜单,见 cardCss 的 -switch 规则)。
|
|
188
|
-
* 语义保持 checkbox(无障碍树与表单语义不变),视觉自绘。
|
|
189
|
-
*/
|
|
190
|
-
function CheckRow(props) {
|
|
191
|
-
const p = props.prefix ?? "dshp";
|
|
192
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
193
|
-
className: `${p}-checkRow`,
|
|
194
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
195
|
-
id: props.id,
|
|
196
|
-
type: "checkbox",
|
|
197
|
-
role: "switch",
|
|
198
|
-
"aria-checked": props.checked,
|
|
199
|
-
checked: props.checked,
|
|
200
|
-
disabled: props.disabled === true,
|
|
201
|
-
onChange: (event) => props.onEdit(event.target.checked)
|
|
202
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
203
|
-
htmlFor: props.id,
|
|
204
|
-
children: props.label
|
|
205
|
-
})]
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
//#endregion
|
|
209
220
|
//#region ../shared/src/client/i18n.ts
|
|
210
221
|
/** 卡片通用文案(save/discard/unsaved/loading 等四插件共有键)。 */
|
|
211
222
|
const commonZh = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-plus/web-cache-headers",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "dsh-plus service plugin: GUI 静态资源长缓存——为内容哈希的 /assets/* 响应补 `Cache-Control: immutable`(/plugins 官方已自带),消除每次刷新重复传输 ~1.4MB JS/CSS;进程级 writeHead 增量拦截,零路由注册、零 dsh 服务耦合,已有缓存头优先保证未来共存",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@dsh-plus/shared": "0.1.
|
|
34
|
+
"@dsh-plus/shared": "0.1.35"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@deepseek-ai/cordis": "^4.0.5-alpha.1",
|