@16x/webphone-sdk 3.2.4 → 3.2.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/ui/index.js CHANGED
@@ -32,6 +32,7 @@ var e = {
32
32
  permissionBody: "Allow microphone access in the browser settings, then check again.",
33
33
  errorTitle: "Unable to continue",
34
34
  errorBody: "Check the network, origin allowlist, or agent permission, then retry.",
35
+ errorTokenUnavailable: "Could not get a sign-in token. Check that the token service is running and configured.",
35
36
  currentCall: "Current call",
36
37
  inbound: "Inbound",
37
38
  outbound: "Outbound",
@@ -83,6 +84,7 @@ var e = {
83
84
  permissionBody: "请在浏览器设置中允许本网站访问麦克风,然后重新检测。",
84
85
  errorTitle: "无法继续通话",
85
86
  errorBody: "请检查网络、域名授权或坐席权限后重试。",
87
+ errorTokenUnavailable: "无法获取登录凭证,请检查 token 服务是否启动及配置是否正确。",
86
88
  currentCall: "当前通话",
87
89
  inbound: "呼入",
88
90
  outbound: "呼出",
@@ -443,13 +445,20 @@ function A(e) {
443
445
  case "unrecoverable-error":
444
446
  case "unsupported": return p("div", {
445
447
  attrs: { part: "panel" },
446
- children: [p("div", {
447
- attrs: {
448
- role: "alert",
449
- part: "status-rail"
450
- },
451
- text: e.messages.errorTitle ?? "无法继续通话"
452
- }), p("p", { text: e.messages.errorBody ?? "请检查网络、域名授权或坐席权限后重试。" })]
448
+ children: [
449
+ p("div", {
450
+ attrs: {
451
+ role: "alert",
452
+ part: "status-rail"
453
+ },
454
+ text: e.messages.errorTitle ?? "无法继续通话"
455
+ }),
456
+ p("p", { text: e.view.kind === "unrecoverable-error" && e.view.code === "AUTH_TOKEN_UNAVAILABLE" ? e.messages.errorTokenUnavailable ?? "无法获取登录凭证,请检查 token 服务是否启动及配置是否正确。" : e.messages.errorBody ?? "请检查网络、域名授权或坐席权限后重试。" }),
457
+ ...e.view.kind === "unrecoverable-error" ? [p("code", {
458
+ attrs: { "data-error-code": e.view.code },
459
+ text: e.view.code
460
+ })] : []
461
+ ]
453
462
  });
454
463
  case "setup":
455
464
  case "connecting":
@@ -884,7 +893,7 @@ var B = ":root,:host{--ccbar-color-surface:#fff;--ccbar-color-surface-muted:#f1f
884
893
  }
885
894
  let r = e.closest("[data-action]");
886
895
  if (!(r instanceof HTMLElement) || r instanceof HTMLButtonElement && r.disabled && r.getAttribute("data-action") !== "enable-phone") return;
887
- let a = this.#e?.getActiveCall?.();
896
+ let a = this.#e?.getActiveCall?.() ?? this.#e?.getCalls?.().find((e) => e.state === "held");
888
897
  switch (r.getAttribute("data-action")) {
889
898
  case "signin":
890
899
  if (this.#e === void 0) return;
@@ -948,7 +957,7 @@ var B = ":root,:host{--ccbar-color-surface:#fff;--ccbar-color-surface-muted:#f1f
948
957
  }
949
958
  }
950
959
  async #I(e) {
951
- let t = this.#e?.getActiveCall?.();
960
+ let t = this.#e?.getActiveCall?.() ?? this.#e?.getCalls?.().find((e) => e.state === "held");
952
961
  if (t !== void 0 && (t.state === "active" || t.state === "held")) {
953
962
  await d(t, e);
954
963
  return;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.2.4";
1
+ export declare const SDK_VERSION = "3.2.5";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@16x/webphone-sdk",
3
- "version": "3.2.4",
3
+ "version": "3.2.5",
4
4
  "homepage": "https://www.npmjs.com/package/@16x/webphone-sdk",
5
5
  "private": false,
6
6
  "license": "UNLICENSED",