@celljs/ta-notify 4.15.0 → 4.15.1

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/package.json +3 -3
  2. package/web/index.js +18 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-notify",
3
- "version": "4.15.0",
3
+ "version": "4.15.1",
4
4
  "description": "A pi package for Ta: tells the user when a conversation needs them, failed or answered, while they look elsewhere, and lets Ta ask them to decide with answers to pick",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -27,8 +27,8 @@
27
27
  "watch": "tsc -b -w --preserveWatchOutput"
28
28
  },
29
29
  "devDependencies": {
30
- "@celljs/ta-protocol": "4.15.0",
31
- "@celljs/ta-web": "4.15.0",
30
+ "@celljs/ta-protocol": "4.15.1",
31
+ "@celljs/ta-web": "4.15.1",
32
32
  "@types/react": "^19.3.0"
33
33
  },
34
34
  "publishConfig": {
package/web/index.js CHANGED
@@ -354,6 +354,19 @@ function SystemSetting({ pi }) {
354
354
  className: "ta-notify-state"
355
355
  }, state === "granted" ? words.systemOn : state === "denied" ? words.systemDenied : words.systemNone);
356
356
  }
357
+ function UnmuteButton({ pi, item, label }) {
358
+ const [busy, run] = pi.ui.useBusy();
359
+ const unmute = () => void run(() => pi.callHost("mute", item.target, false).catch((error) => pi.ui.notify(error instanceof Error ? error.message : String(error), "error")));
360
+ return /* @__PURE__ */ React.createElement("button", {
361
+ type: "button",
362
+ className: `ta-button${busy ? " ta-busy" : ""}`,
363
+ "aria-busy": busy || undefined,
364
+ disabled: busy,
365
+ onClick: unmute
366
+ }, busy && /* @__PURE__ */ React.createElement("span", {
367
+ className: "ta-spinner ta-busy-mark"
368
+ }), /* @__PURE__ */ React.createElement("span", null, label));
369
+ }
357
370
  function MutedSetting({ pi }) {
358
371
  const words = NotifyWords.of(pi.ui.language);
359
372
  const [muted] = useStored(pi, Keys.MUTED, NotifyUtil.muted);
@@ -362,7 +375,6 @@ function MutedSetting({ pi }) {
362
375
  className: "ta-notify-state"
363
376
  }, words.mutedNone);
364
377
  }
365
- const unmute = (item) => void pi.callHost("mute", item.target, false).catch((error) => pi.ui.notify(error instanceof Error ? error.message : String(error), "error"));
366
378
  return /* @__PURE__ */ React.createElement("ul", {
367
379
  className: "ta-notify-muted"
368
380
  }, muted.map((item) => /* @__PURE__ */ React.createElement("li", {
@@ -370,11 +382,11 @@ function MutedSetting({ pi }) {
370
382
  }, /* @__PURE__ */ React.createElement("span", {
371
383
  className: "ta-notify-muted-name",
372
384
  title: item.target
373
- }, item.title || words.untitled), /* @__PURE__ */ React.createElement("button", {
374
- type: "button",
375
- className: "ta-button",
376
- onClick: () => unmute(item)
377
- }, words.unmute))));
385
+ }, item.title || words.untitled), /* @__PURE__ */ React.createElement(UnmuteButton, {
386
+ pi,
387
+ item,
388
+ label: words.unmute
389
+ }))));
378
390
  }
379
391
  function notifySettings(pi) {
380
392
  const words = () => NotifyWords.of(pi.ui.language);