@dsh-plus/notify-email 0.1.40 → 0.1.41

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 +77 -66
  2. package/package.json +2 -2
package/lib/client.js CHANGED
@@ -7,6 +7,77 @@ 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
+ /**
58
+ * 勾选行:自绘圆角扁平开关(switch),对齐官方 WebUI 无原生 checkbox 的
59
+ * 设计语言(官方选择类控件全走胶囊/菜单,见 cardCss 的 -switch 规则)。
60
+ * 语义保持 checkbox(无障碍树与表单语义不变),视觉自绘。
61
+ */
62
+ function CheckRow(props) {
63
+ const p = props.prefix ?? "dshp";
64
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
65
+ className: `${p}-checkRow`,
66
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
67
+ id: props.id,
68
+ type: "checkbox",
69
+ role: "switch",
70
+ "aria-checked": props.checked,
71
+ checked: props.checked,
72
+ disabled: props.disabled === true,
73
+ onChange: (event) => props.onEdit(event.target.checked)
74
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
75
+ htmlFor: props.id,
76
+ children: props.label
77
+ })]
78
+ });
79
+ }
80
+ //#endregion
10
81
  //#region ../shared/src/client/card.tsx
11
82
  const IDLE_STATUS = {
12
83
  kind: "idle",
@@ -55,12 +126,12 @@ window.__ModuleLoader__.load({
55
126
  className: `${p}-status${props.status.kind === "error" ? ` ${p}-statusError` : ""}`,
56
127
  role: "status",
57
128
  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
129
+ }) : null, props.actions.map((action) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
130
+ prefix: p,
131
+ label: action.label,
132
+ variant: action.variant,
133
+ disabled: action.disabled,
134
+ onClick: action.onClick
64
135
  }, action.key))]
65
136
  })
66
137
  ]
@@ -115,66 +186,6 @@ window.__ModuleLoader__.load({
115
186
  * @module @dsh-plus/shared/client/draft
116
187
  */
117
188
  //#endregion
118
- //#region ../shared/src/client/fields.tsx
119
- function TextField(props) {
120
- const p = props.prefix ?? "dshp";
121
- const invalid = props.invalid === true;
122
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
123
- className: `${p}-field`,
124
- children: [
125
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
126
- className: `${p}-head`,
127
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
128
- className: `${p}-label`,
129
- htmlFor: props.id,
130
- children: props.label
131
- }), props.badge !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
132
- className: `${p}-badge ${props.badge.set ? `${p}-badgeSet` : `${p}-badgeUnset`}`,
133
- children: props.badge.text
134
- }) : null]
135
- }),
136
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
137
- id: props.id,
138
- className: `${p}-input${invalid ? ` ${p}-inputInvalid` : ""}`,
139
- type: props.password === true ? "password" : "text",
140
- inputMode: props.numeric === true ? "numeric" : void 0,
141
- autoComplete: props.password === true ? "off" : void 0,
142
- "aria-invalid": invalid || void 0,
143
- value: props.value,
144
- disabled: props.disabled === true,
145
- onChange: (event) => props.onEdit(event.target.value)
146
- }),
147
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
148
- className: invalid ? `${p}-invalid` : `${p}-hint`,
149
- children: invalid ? props.invalidLabel ?? "" : props.hint ?? ""
150
- })
151
- ]
152
- });
153
- }
154
- /**
155
- * 勾选行:自绘圆角扁平开关(switch),对齐官方 WebUI 无原生 checkbox 的
156
- * 设计语言(官方选择类控件全走胶囊/菜单,见 cardCss 的 -switch 规则)。
157
- * 语义保持 checkbox(无障碍树与表单语义不变),视觉自绘。
158
- */
159
- function CheckRow(props) {
160
- const p = props.prefix ?? "dshp";
161
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
162
- className: `${p}-checkRow`,
163
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
164
- id: props.id,
165
- type: "checkbox",
166
- role: "switch",
167
- "aria-checked": props.checked,
168
- checked: props.checked,
169
- disabled: props.disabled === true,
170
- onChange: (event) => props.onEdit(event.target.checked)
171
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
172
- htmlFor: props.id,
173
- children: props.label
174
- })]
175
- });
176
- }
177
- //#endregion
178
189
  //#region ../shared/src/client/i18n.ts
179
190
  /** 卡片通用文案(save/discard/unsaved/loading 等四插件共有键)。 */
180
191
  const commonZh = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-plus/notify-email",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "description": "dsh-plus service+ui plugin: 任务结束/等待决策/出错时向指定邮箱发送邮件通知",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "nodemailer": "9.0.6",
35
- "@dsh-plus/shared": "0.1.34"
35
+ "@dsh-plus/shared": "0.1.35"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@deepseek-ai/cordis": "^4.0.5-alpha.1",