dsh-supermesh 0.0.3 → 0.0.5

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/dist/client.cjs CHANGED
@@ -6416,7 +6416,10 @@ const dicts = {
6416
6416
  channelAccountDescription: "通过授权登录或 Token 验证账号,保存实际登录身份。",
6417
6417
  channelCommitName: "Git 提交名称",
6418
6418
  channelCommitEmail: "Git 提交邮箱",
6419
- channelCommitHelp: "保存 Git 提交身份;凭据与提交身份分别管理。",
6419
+ channelCommitHelp: "平台按邮箱归属提交,名字只影响显示;留空时使用渠道账号的 noreply 地址。",
6420
+ channelCommitEmailMismatchTitle: "提交邮箱不属于渠道账号",
6421
+ channelCommitEmailMismatchDescription: "{email} 归属另一个账号,提交会记到那个人名下,审计与隐私都会受影响。渠道账号的 noreply 地址是 {suggestion}。确认后仍会保存。",
6422
+ channelCommitEmailMismatchConfirm: "仍然保存",
6420
6423
  channelLoginMethod: "登录方式",
6421
6424
  channelAuthorize: "授权登录",
6422
6425
  channelAuthorizeRecommended: "推荐",
@@ -6833,7 +6836,10 @@ const dicts = {
6833
6836
  channelAccountDescription: "Specify the expected bot identity. The authenticated account must match.",
6834
6837
  channelCommitName: "Git commit name",
6835
6838
  channelCommitEmail: "Git commit email",
6836
- channelCommitHelp: "Save the Git commit identity. Credentials and commit identity are managed separately.",
6839
+ channelCommitHelp: "Commits are attributed by email; the name only affects display. Leave it empty to use the channel account noreply address.",
6840
+ channelCommitEmailMismatchTitle: "Commit email belongs to another account",
6841
+ channelCommitEmailMismatchDescription: "{email} belongs to another account, so commits are attributed to that person. The channel account noreply address is {suggestion}. Saving continues after you confirm.",
6842
+ channelCommitEmailMismatchConfirm: "Save anyway",
6837
6843
  channelLoginMethod: "Sign-in method",
6838
6844
  channelAuthorize: "Authorize",
6839
6845
  channelAuthorizeRecommended: "Recommended",
@@ -7524,8 +7530,11 @@ function GithubDetail() {
7524
7530
  const [token, setToken] = (0, react.useState)("");
7525
7531
  const [commitName, setCommitName] = (0, react.useState)(null);
7526
7532
  const [commitEmail, setCommitEmail] = (0, react.useState)(null);
7533
+ const [confirmingEmail, setConfirmingEmail] = (0, react.useState)(false);
7534
+ const suggestion = channel_0?.commitEmailSuggestion ?? "";
7527
7535
  const nameValue = commitName ?? channel_0?.commitName ?? "";
7528
- const emailValue = commitEmail ?? channel_0?.commitEmail ?? "";
7536
+ const emailValue = commitEmail ?? channel_0?.commitEmail ?? suggestion;
7537
+ const emailMismatch = Boolean(suggestion) && Boolean(emailValue.trim()) && emailValue.trim().toLowerCase() !== suggestion.toLowerCase();
7529
7538
  const hasCredential = Boolean(channel_0?.hasCredential);
7530
7539
  const identityDirty = nameValue.trim() !== (channel_0?.commitName ?? "").trim() || emailValue.trim() !== (channel_0?.commitEmail ?? "").trim();
7531
7540
  const dirty = token.length > 0 || identityDirty;
@@ -7627,10 +7636,11 @@ function GithubDetail() {
7627
7636
  setAuthNotice("");
7628
7637
  setCopyNotice("");
7629
7638
  setAuthentication(null);
7639
+ setConfirmingEmail(false);
7630
7640
  authId.current = null;
7631
7641
  };
7632
- const save = async (toggle = false) => {
7633
- if (!channel_0 || savingRequest.current || authRequest.current || (toggle ? !hasCredential : !canSave)) return;
7642
+ const commit = async (toggle) => {
7643
+ if (!channel_0 || savingRequest.current || authRequest.current) return;
7634
7644
  savingRequest.current = true;
7635
7645
  setSaving(true);
7636
7646
  setNotice("");
@@ -7653,6 +7663,14 @@ function GithubDetail() {
7653
7663
  setSaving(false);
7654
7664
  }
7655
7665
  };
7666
+ const save = async (toggle_0 = false) => {
7667
+ if (!channel_0 || savingRequest.current || authRequest.current || (toggle_0 ? !hasCredential : !canSave)) return;
7668
+ if (!toggle_0 && emailMismatch) {
7669
+ setConfirmingEmail(true);
7670
+ return;
7671
+ }
7672
+ await commit(toggle_0);
7673
+ };
7656
7674
  const openDelete = () => {
7657
7675
  if (!hasCredential || savingRequest.current || authRequest.current) return;
7658
7676
  savingRequest.current = true;
@@ -7765,17 +7783,19 @@ function GithubDetail() {
7765
7783
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
7766
7784
  id: `${id}-commit-email`,
7767
7785
  type: "email",
7768
- placeholder: "bot@example.com",
7786
+ placeholder: suggestion || "bot@example.com",
7769
7787
  value: emailValue,
7770
7788
  onChange: (event_0) => setCommitEmail(event_0.target.value),
7771
7789
  disabled: busy,
7772
7790
  maxLength: 254,
7773
7791
  autoComplete: "off",
7774
- spellCheck: false
7792
+ spellCheck: false,
7793
+ "aria-describedby": `${id}-commit-help`
7775
7794
  })]
7776
7795
  })]
7777
7796
  }),
7778
7797
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
7798
+ id: `${id}-commit-help`,
7779
7799
  className: "m-0 text-xs leading-5 text-(--dsw-alias-label-secondary)",
7780
7800
  children: t("channelCommitHelp")
7781
7801
  }),
@@ -7900,6 +7920,30 @@ function GithubDetail() {
7900
7920
  })
7901
7921
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Environment, { description: t("channelGithubWorkerIdentity") })]
7902
7922
  }),
7923
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
7924
+ open: confirmingEmail,
7925
+ onClose: () => setConfirmingEmail(false),
7926
+ title: t("channelCommitEmailMismatchTitle"),
7927
+ closeLabel: t("channelCancel"),
7928
+ description: t("channelCommitEmailMismatchDescription", {
7929
+ email: emailValue.trim(),
7930
+ suggestion
7931
+ }),
7932
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
7933
+ variant: "outline",
7934
+ disabled: saving,
7935
+ onClick: () => setConfirmingEmail(false),
7936
+ children: t("channelCancel")
7937
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
7938
+ variant: "primary",
7939
+ disabled: saving,
7940
+ onClick: () => {
7941
+ setConfirmingEmail(false);
7942
+ commit(false);
7943
+ },
7944
+ children: t("channelCommitEmailMismatchConfirm")
7945
+ })] })
7946
+ }),
7903
7947
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
7904
7948
  open: deletion !== null,
7905
7949
  onClose: closeDelete,
@@ -7943,6 +7987,10 @@ function GitlabDetail() {
7943
7987
  const [token, setToken] = (0, react.useState)("");
7944
7988
  const [commitName, setCommitName] = (0, react.useState)(channel_0?.commitName ?? "");
7945
7989
  const [commitEmail, setCommitEmail] = (0, react.useState)(channel_0?.commitEmail ?? "");
7990
+ const [confirmingEmail, setConfirmingEmail] = (0, react.useState)(false);
7991
+ const suggestion = channel_0?.commitEmailSuggestion ?? "";
7992
+ const emailValue = commitEmail.trim() || suggestion;
7993
+ const emailMismatch = Boolean(suggestion) && Boolean(emailValue.trim()) && emailValue.trim().toLowerCase() !== suggestion.toLowerCase();
7946
7994
  const [host, setHost] = (0, react.useState)(channel_0?.host ?? "https://gitlab.com");
7947
7995
  const [hostInvalid, setHostInvalid] = (0, react.useState)(false);
7948
7996
  const lifetime = (0, react.useRef)(new AbortController());
@@ -7971,9 +8019,8 @@ function GitlabDetail() {
7971
8019
  if (!saved) throw new Error("channel_reload_failed");
7972
8020
  return saved;
7973
8021
  }
7974
- const save = async () => {
8022
+ const commit = async () => {
7975
8023
  if (savingRequest.current) return;
7976
- if (!validateHost()) return;
7977
8024
  savingRequest.current = true;
7978
8025
  setSaving(true);
7979
8026
  setNotice("");
@@ -7982,7 +8029,7 @@ function GitlabDetail() {
7982
8029
  host: host.trim(),
7983
8030
  ...token.trim() && !channel_0?.hasCredential ? { enabled: true } : {},
7984
8031
  commitName: commitName.trim(),
7985
- commitEmail: commitEmail.trim(),
8032
+ commitEmail: emailValue.trim(),
7986
8033
  ...token.trim() ? { token: token.trim() } : {}
7987
8034
  }, { signal: lifetime.current.signal });
7988
8035
  if (lifetime.current.signal.aborted) return;
@@ -7998,6 +8045,15 @@ function GitlabDetail() {
7998
8045
  if (!lifetime.current.signal.aborted) setSaving(false);
7999
8046
  }
8000
8047
  };
8048
+ const save = async () => {
8049
+ if (savingRequest.current) return;
8050
+ if (!validateHost()) return;
8051
+ if (emailMismatch) {
8052
+ setConfirmingEmail(true);
8053
+ return;
8054
+ }
8055
+ await commit();
8056
+ };
8001
8057
  function reset(saved_1 = channel_0) {
8002
8058
  setHost(saved_1?.host ?? "https://gitlab.com");
8003
8059
  setCommitName(saved_1?.commitName ?? "");
@@ -8005,6 +8061,7 @@ function GitlabDetail() {
8005
8061
  setToken("");
8006
8062
  setHostInvalid(false);
8007
8063
  setNotice("");
8064
+ setConfirmingEmail(false);
8008
8065
  }
8009
8066
  const toggle = async () => {
8010
8067
  if (!channel_0?.hasCredential || savingRequest.current) return;
@@ -8093,6 +8150,30 @@ function GitlabDetail() {
8093
8150
  })
8094
8151
  ] })
8095
8152
  }),
8153
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
8154
+ open: confirmingEmail,
8155
+ onClose: () => setConfirmingEmail(false),
8156
+ title: t("channelCommitEmailMismatchTitle"),
8157
+ closeLabel: t("channelCancel"),
8158
+ description: t("channelCommitEmailMismatchDescription", {
8159
+ email: emailValue.trim(),
8160
+ suggestion
8161
+ }),
8162
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8163
+ variant: "outline",
8164
+ disabled: saving,
8165
+ onClick: () => setConfirmingEmail(false),
8166
+ children: t("channelCancel")
8167
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8168
+ variant: "primary",
8169
+ disabled: saving,
8170
+ onClick: () => {
8171
+ setConfirmingEmail(false);
8172
+ commit();
8173
+ },
8174
+ children: t("channelCommitEmailMismatchConfirm")
8175
+ })] })
8176
+ }),
8096
8177
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
8097
8178
  open: deleteConfirming,
8098
8179
  onClose: closeDelete,
@@ -8194,17 +8275,19 @@ function GitlabDetail() {
8194
8275
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
8195
8276
  id: `${id}-commit-email`,
8196
8277
  type: "email",
8197
- placeholder: "bot@example.com",
8198
- value: commitEmail,
8278
+ placeholder: suggestion || "bot@example.com",
8279
+ value: emailValue,
8199
8280
  onChange: (event_1) => setCommitEmail(event_1.target.value),
8200
8281
  disabled: busy,
8201
8282
  maxLength: 254,
8202
8283
  autoComplete: "off",
8203
- spellCheck: false
8284
+ spellCheck: false,
8285
+ "aria-describedby": `${id}-commit-help`
8204
8286
  })]
8205
8287
  })]
8206
8288
  }),
8207
8289
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8290
+ id: `${id}-commit-help`,
8208
8291
  className: "m-0 text-xs leading-5 text-(--dsw-alias-label-secondary)",
8209
8292
  children: t("channelCommitHelp")
8210
8293
  }),