@wanji_dsh/dsh-sales 0.10.5 → 0.10.6

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.js CHANGED
@@ -7195,7 +7195,7 @@ var import_react = __toESM(require("react"), 1);
7195
7195
  // src/wechat/image-preview-geometry.ts
7196
7196
  function fitImageScale(width, height, availableWidth, availableHeight) {
7197
7197
  if (![width, height, availableWidth, availableHeight].every((v) => Number.isFinite(v) && v > 0)) return 1;
7198
- return Math.min(availableWidth / width, availableHeight / height);
7198
+ return Math.min(1, availableWidth / width, availableHeight / height);
7199
7199
  }
7200
7200
  function imageZoomRange(fit) {
7201
7201
  return { min: Math.min(0.1, fit), max: Math.max(4, fit) };
@@ -12863,6 +12863,7 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
12863
12863
  const draft = state.drafts[contact.id] ?? "";
12864
12864
  const generation = state.generations[contact.id];
12865
12865
  const running = generation?.status === "running";
12866
+ const canCopy = !frozen && Boolean(draft.trim()) && !generation?.result?.no_send;
12866
12867
  const [delivery, setDelivery] = (0, import_react11.useState)({ contactId: "", lease: "", enabled: false, available: false, baseline: "", status: "idle" });
12867
12868
  const activeChat = (0, import_react11.useRef)("");
12868
12869
  activeChat.current = JSON.stringify([selectedWorkspace, contact.id]);
@@ -12998,7 +12999,7 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
12998
12999
  setNotice("");
12999
13000
  };
13000
13001
  const copy = async () => {
13001
- if (frozen || running || !draft.trim() || generation?.result?.no_send) return;
13002
+ if (!canCopy) return;
13002
13003
  const id = contact.id;
13003
13004
  try {
13004
13005
  await navigator.clipboard.writeText(draft);
@@ -13032,7 +13033,7 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
13032
13033
  } }, t("wxAppDeny"))), /* @__PURE__ */ import_react11.default.createElement(ReplyEditor, { key: contact.id, value: draft, t, disabled: frozen, reviewedRequest: generation?.status === "done" && generation.applied ? generation.requestId : void 0, onChange: (text4) => {
13033
13034
  dispatch({ type: "edit", id: contact.id, text: text4 });
13034
13035
  setCopyResult(null);
13035
- } }), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-editor-footer" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-char-count" }, draft.length, " ", t("chars")), /* @__PURE__ */ import_react11.default.createElement("button", { className: "ws-button ws-primary", disabled: frozen || running || !draft.trim() || generation?.result?.no_send, onClick: () => {
13036
+ } }), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-editor-footer" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-char-count" }, draft.length, " ", t("chars")), /* @__PURE__ */ import_react11.default.createElement("button", { type: "button", className: "ws-button ws-primary", disabled: !canCopy, onClick: () => {
13036
13037
  void copy();
13037
13038
  } }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: copyResult?.id === contact.id && copyResult.success ? "check" : "copy", size: 15 }), copyResult?.id === contact.id && copyResult.success ? t("copied") : t("copy"))), wechatSendingEnabled && contact.wechat && /* @__PURE__ */ import_react11.default.createElement("p", { role: "status", "aria-live": "polite" }, !delivery.available ? t("wxCuaRequired") : delivery.status === "sending" ? t("wxSending") : delivery.status === "awaiting-receipt" ? t("wxAwaitReceipt") : delivery.status === "sent" ? t("wxSent") : ["unknown", "claimed", "stopped", "blocked"].includes(delivery.status) ? t("wxSendStopped") : t("wxManualNote")), state.historyErrors?.[contact.id] && /* @__PURE__ */ import_react11.default.createElement("p", { role: "status" }, state.historyErrors[contact.id]), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-notice", role: "status" }, copyResult?.id === contact.id && !copyResult.success ? t("copyError") : notice)))), contact.id && /* @__PURE__ */ import_react11.default.createElement("aside", { id: profileId, className: "ws-profile", "aria-label": t("profile") }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-profile-head" }, /* @__PURE__ */ import_react11.default.createElement("h2", null, t("profile")), /* @__PURE__ */ import_react11.default.createElement("button", { type: "button", className: "ws-icon-button ws-profile-close", ref: closeProfileButton, "aria-label": t("closeProfile"), title: t("closeProfile"), onClick: () => setProfileVisibility("closed") }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "close", size: 17 }))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-profile-person" }, /* @__PURE__ */ import_react11.default.createElement(WechatAvatar, { client: wechat, scope: JSON.stringify([selectedWorkspace, contact.wechat?.accountId]), owner: contact.wechat?.chatKey ?? contact.id, mediaId: contact.wechat?.avatarId, fallback: contact.initials, className: "ws-profile-avatar" }), /* @__PURE__ */ import_react11.default.createElement("h3", null, contact.name), /* @__PURE__ */ import_react11.default.createElement("p", null, contact.segment), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-tags" }, contact.tags.map((tag) => /* @__PURE__ */ import_react11.default.createElement("span", { key: tag }, tag)))), contact.wechat && bindWechat && /* @__PURE__ */ import_react11.default.createElement(CrmForm, { key: contact.id, contact, t, frozen, dirty: updateFormDirty, bind: (binding) => bindWechat(selectedWorkspace, contact.id, binding) }), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-profile-section" }, /* @__PURE__ */ import_react11.default.createElement("h3", null, t("interest")), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-product" }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "chat", size: 18 }), /* @__PURE__ */ import_react11.default.createElement("div", null, /* @__PURE__ */ import_react11.default.createElement("strong", null, contact.product), /* @__PURE__ */ import_react11.default.createElement("p", null, contact.wechat ? t("wxContext") : t("contextHint")))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-budget" }, /* @__PURE__ */ import_react11.default.createElement("span", null, t("budget")), /* @__PURE__ */ import_react11.default.createElement("strong", null, contact.budget))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-profile-section" }, /* @__PURE__ */ import_react11.default.createElement("h3", null, t("facts")), /* @__PURE__ */ import_react11.default.createElement("dl", null, contact.facts.map((fact) => /* @__PURE__ */ import_react11.default.createElement("div", { key: fact.label }, /* @__PURE__ */ import_react11.default.createElement("dt", null, fact.label), /* @__PURE__ */ import_react11.default.createElement("dd", null, fact.value))))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-profile-caption" }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "spark", size: 14 }), /* @__PURE__ */ import_react11.default.createElement("span", null, contact.wechat ? t("wxSources") : t("profileNote"))))));
13038
13039
  }
package/dist/host.js CHANGED
@@ -16842,7 +16842,7 @@ function registerUpdateRoutes(ctx, coordinator, clients) {
16842
16842
  }
16843
16843
 
16844
16844
  // src/update/version.ts
16845
- var RUNNING_VERSION = true ? "0.10.5" : "0.0.0-dev";
16845
+ var RUNNING_VERSION = true ? "0.10.6" : "0.0.0-dev";
16846
16846
 
16847
16847
  // src/update/integration.ts
16848
16848
  function mountUpdates(ctx, storageDir, activity, sync) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wanji_dsh/dsh-sales",
3
- "version": "0.10.5",
3
+ "version": "0.10.6",
4
4
  "type": "module",
5
5
  "description": "Sales workspace with local Windows/macOS WeChat sync, one-time CRM context, Flash drafts and filtered knowledge.",
6
6
  "engines": {
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "schema": 1,
3
- "version": "0.10.0",
3
+ "version": "0.10.6",
4
4
  "targets": {
5
5
  "win32-x64": {
6
- "url": "https://wanjidazi.com/plugins/sales-assistant/runtimes/wanji-wechat-runtime-1.0.0-win32-x64-21ca615ea5fdeb3a.tgz",
7
- "sha256": "21ca615ea5fdeb3a604d698cdeac9d0e242f58e00971dfc06dcc779c2b14e96e",
8
- "bytes": 23487520,
9
- "unpackedBytes": 50816040,
10
- "componentSha256": "f291ea53abd07fff8b7649a9cae0e8586d94e282a0d2954b29acabea5ae3251d"
6
+ "url": "https://wanjidazi.com/plugins/sales-assistant/runtimes/wanji-wechat-runtime-1.0.1-win32-x64-5a5d6835924de5cf.tgz",
7
+ "sha256": "5a5d6835924de5cf9bf88466747339592b813914d7147cafa88ab556c80bc753",
8
+ "bytes": 22904752,
9
+ "unpackedBytes": 47580242,
10
+ "componentSha256": "bfd4ca56fcc0b2ae7eb9b46cedd9ae726aa48a1232c6decffa292bfa55358f06"
11
11
  },
12
12
  "darwin-arm64": {
13
13
  "url": "https://wanjidazi.com/plugins/sales-assistant/runtimes/wanji-wechat-runtime-1.0.2-darwin-arm64-d42a8fe108a275d7.tgz",