@dsh-plus/access-gate 0.3.24 → 0.3.25

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.
Files changed (2) hide show
  1. package/lib/client.js +42 -31
  2. 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)("button", {
59
- type: "button",
60
- className: `${p}-btn ${action.variant === "primary" ? `${p}-btnPrimary` : `${p}-btnGhost`}`,
61
- disabled: action.disabled === true,
62
- onClick: action.onClick,
63
- children: action.label
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
  ]
@@ -115,31 +151,6 @@ window.__ModuleLoader__.load({
115
151
  * @module @dsh-plus/shared/client/draft
116
152
  */
117
153
  //#endregion
118
- //#region ../shared/src/client/fields.tsx
119
- /**
120
- * 勾选行:自绘圆角扁平开关(switch),对齐官方 WebUI 无原生 checkbox 的
121
- * 设计语言(官方选择类控件全走胶囊/菜单,见 cardCss 的 -switch 规则)。
122
- * 语义保持 checkbox(无障碍树与表单语义不变),视觉自绘。
123
- */
124
- function CheckRow(props) {
125
- const p = props.prefix ?? "dshp";
126
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
127
- className: `${p}-checkRow`,
128
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
129
- id: props.id,
130
- type: "checkbox",
131
- role: "switch",
132
- "aria-checked": props.checked,
133
- checked: props.checked,
134
- disabled: props.disabled === true,
135
- onChange: (event) => props.onEdit(event.target.checked)
136
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
137
- htmlFor: props.id,
138
- children: props.label
139
- })]
140
- });
141
- }
142
- //#endregion
143
154
  //#region ../shared/src/client/i18n.ts
144
155
  /** 卡片通用文案(save/discard/unsaved/loading 等四插件共有键)。 */
145
156
  const commonZh = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-plus/access-gate",
3
- "version": "0.3.24",
3
+ "version": "0.3.25",
4
4
  "description": "dsh-plus service+ui plugin: dsh web 全量访问围栏——与官方 browser-auth 合并:官方 cookie 为唯一凭据,可选 IP 附加围栏,未认证导航渲染 token 输入页(PWA 可恢复),loopback 管理通道",
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"
34
+ "@dsh-plus/shared": "0.1.35"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@deepseek-ai/cordis": "^4.0.5-alpha.1",