@huaweidevtools/aishell-dsh-client-credentials 0.0.11 → 0.0.12

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 CHANGED
@@ -1075,20 +1075,6 @@ function CredentialRequestForm(props) {
1075
1075
  setPhase("ready");
1076
1076
  setBrowserError(void 0);
1077
1077
  }, [login]);
1078
- /** Put the sign-in URL on the clipboard when the tab did not open. */
1079
- const onCopyLink = () => {
1080
- if (login === null || login === void 0) return;
1081
- navigator.clipboard.writeText(login.loginUrl).then(
1082
- () => {
1083
- setBrowserError(void 0);
1084
- },
1085
- // A denied clipboard — no permission, or an insecure origin — leaves the
1086
- // person with nothing, so say what happened rather than failing silently.
1087
- () => {
1088
- setBrowserError(t("form.browser.copyFailed"));
1089
- }
1090
- );
1091
- };
1092
1078
  const onSubmit = async (event) => {
1093
1079
  event.preventDefault();
1094
1080
  setSaving(true);
@@ -1289,14 +1275,6 @@ function CredentialRequestForm(props) {
1289
1275
  gap: 8
1290
1276
  },
1291
1277
  children: [
1292
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1293
- style: {
1294
- fontSize: 13,
1295
- fontWeight: 500,
1296
- color: "var(--dsw-alias-label-secondary)"
1297
- },
1298
- children: t("form.browser.section")
1299
- }),
1300
1278
  phase === "running" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1301
1279
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1302
1280
  className: DIAL_CLASS,
@@ -1367,7 +1345,7 @@ function CredentialRequestForm(props) {
1367
1345
  children: t(button.label)
1368
1346
  })
1369
1347
  }),
1370
- phase === "running" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1348
+ phase === "running" && login !== null && login !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1371
1349
  style: {
1372
1350
  fontSize: 12,
1373
1351
  lineHeight: "18px",
@@ -1375,21 +1353,17 @@ function CredentialRequestForm(props) {
1375
1353
  },
1376
1354
  children: [
1377
1355
  t("form.browser.notOpened"),
1378
- " ",
1379
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1380
- type: "button",
1381
- onClick: onCopyLink,
1356
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1357
+ href: login.loginUrl,
1358
+ target: "_blank",
1359
+ rel: "noopener noreferrer",
1382
1360
  style: {
1383
- border: "none",
1384
- background: "none",
1385
- padding: 0,
1386
- font: "inherit",
1387
1361
  color: "var(--dsw-alias-button-primary-fill)",
1388
- textDecoration: "underline",
1389
- cursor: "pointer"
1362
+ textDecoration: "underline"
1390
1363
  },
1391
- children: t("form.browser.copyLink")
1392
- })
1364
+ children: t("form.browser.openHere")
1365
+ }),
1366
+ t("form.browser.openHereSuffix")
1393
1367
  ]
1394
1368
  }),
1395
1369
  browserError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
@@ -1648,9 +1622,9 @@ const zh = {
1648
1622
  "form.browser.cancelLabel": "取消登录",
1649
1623
  "form.browser.runningLabel": "登录中",
1650
1624
  "form.browser.notOpened": "若浏览器未自动打开,请",
1651
- "form.browser.copyLink": "手动复制链接到浏览器打开",
1625
+ "form.browser.openHere": "点击此处",
1626
+ "form.browser.openHereSuffix": "打开。",
1652
1627
  "form.browser.blocked": "浏览器拦截了新标签页,请允许弹出窗口后重试。",
1653
- "form.browser.copyFailed": "无法复制链接,请手动从浏览器地址栏重试。",
1654
1628
  "form.browser.failed": "浏览器登录未完成。",
1655
1629
  "form.browser.startFailed": "无法启动浏览器登录,请改用 AK/SK 或稍后重试。",
1656
1630
  "form.browser.expired": "登录超时,请重试。",
@@ -1698,10 +1672,10 @@ const en = {
1698
1672
  "form.browser.unsupported": "This environment does not support this method.",
1699
1673
  "form.browser.cancelLabel": "Cancel sign-in",
1700
1674
  "form.browser.runningLabel": "Signing in",
1701
- "form.browser.notOpened": "If the browser did not open,",
1702
- "form.browser.copyLink": "copy the link into your browser",
1675
+ "form.browser.notOpened": "If the browser did not open, ",
1676
+ "form.browser.openHere": "click here",
1677
+ "form.browser.openHereSuffix": " to open it.",
1703
1678
  "form.browser.blocked": "The browser blocked the new tab. Allow pop-ups for this page, then try again.",
1704
- "form.browser.copyFailed": "Could not copy the link. Try again from the browser address bar.",
1705
1679
  "form.browser.failed": "The browser sign-in did not complete.",
1706
1680
  "form.browser.startFailed": "Could not start the browser sign-in. Use an AK/SK instead, or try again.",
1707
1681
  "form.browser.expired": "The sign-in timed out. Try again.",
@@ -32,9 +32,9 @@ export declare const zh: {
32
32
  readonly 'form.browser.cancelLabel': "取消登录";
33
33
  readonly 'form.browser.runningLabel': "登录中";
34
34
  readonly 'form.browser.notOpened': "若浏览器未自动打开,请";
35
- readonly 'form.browser.copyLink': "手动复制链接到浏览器打开";
35
+ readonly 'form.browser.openHere': "点击此处";
36
+ readonly 'form.browser.openHereSuffix': "打开。";
36
37
  readonly 'form.browser.blocked': "浏览器拦截了新标签页,请允许弹出窗口后重试。";
37
- readonly 'form.browser.copyFailed': "无法复制链接,请手动从浏览器地址栏重试。";
38
38
  readonly 'form.browser.failed': "浏览器登录未完成。";
39
39
  readonly 'form.browser.startFailed': "无法启动浏览器登录,请改用 AK/SK 或稍后重试。";
40
40
  readonly 'form.browser.expired': "登录超时,请重试。";
@@ -82,10 +82,10 @@ export declare const en: {
82
82
  readonly 'form.browser.unsupported': "This environment does not support this method.";
83
83
  readonly 'form.browser.cancelLabel': "Cancel sign-in";
84
84
  readonly 'form.browser.runningLabel': "Signing in";
85
- readonly 'form.browser.notOpened': "If the browser did not open,";
86
- readonly 'form.browser.copyLink': "copy the link into your browser";
85
+ readonly 'form.browser.notOpened': "If the browser did not open, ";
86
+ readonly 'form.browser.openHere': "click here";
87
+ readonly 'form.browser.openHereSuffix': " to open it.";
87
88
  readonly 'form.browser.blocked': "The browser blocked the new tab. Allow pop-ups for this page, then try again.";
88
- readonly 'form.browser.copyFailed': "Could not copy the link. Try again from the browser address bar.";
89
89
  readonly 'form.browser.failed': "The browser sign-in did not complete.";
90
90
  readonly 'form.browser.startFailed': "Could not start the browser sign-in. Use an AK/SK instead, or try again.";
91
91
  readonly 'form.browser.expired': "The sign-in timed out. Try again.";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@huaweidevtools/aishell-dsh-client-credentials",
3
3
  "description": "AI Shell credentials — chip-opened web form for storing Huawei Cloud AK/SK in the credential store",
4
- "version": "0.0.11",
4
+ "version": "0.0.12",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "license": "Apache-2.0",
43
43
  "dependencies": {
44
- "@huaweidevtools/aishell-dsh-credentials-store": "0.0.11"
44
+ "@huaweidevtools/aishell-dsh-credentials-store": "0.0.12"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@deepseek-ai/cordis": "^4.0.4",