@decentnetwork/beagle-ui 0.2.24 → 0.2.25

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/dist/beagle-ui.js +16 -8
  2. package/package.json +1 -1
package/dist/beagle-ui.js CHANGED
@@ -1,4 +1,4 @@
1
- export const BEAGLE_UI_VERSION = "0.2.24";
1
+ export const BEAGLE_UI_VERSION = "0.2.25";
2
2
  // src/icons.jsx
3
3
  var ICON_PATHS = {
4
4
  // ---- tab bar (the four must feel like one set) ----
@@ -1170,6 +1170,7 @@ ${cmds}
1170
1170
 
1171
1171
  ${tail}`;
1172
1172
  }
1173
+ var SKIP_NAMES_MAX = 10;
1173
1174
  var seq = 0;
1174
1175
  var asMsg = (from, text, extra) => Object.assign({
1175
1176
  id: `as-${Date.now()}-${seq++}`,
@@ -1231,22 +1232,29 @@ function useAssistant({ lang, T, muted, onToggleMute, sound, flash, setAlert, on
1231
1232
  ver: r.beagleVer || ""
1232
1233
  };
1233
1234
  };
1235
+ const skipLine = (skipped) => {
1236
+ if (!skipped.length)
1237
+ return "";
1238
+ const shown = skipped.slice(0, SKIP_NAMES_MAX).map(nameOf);
1239
+ const more = skipped.length - shown.length;
1240
+ const names = shown.join(", ") + (more > 0 ? lang === "zh" ? ` \u7B49 ${more} \u4F4D` : `, and ${more} more` : "");
1241
+ return lang === "zh" ? `
1242
+
1243
+ *\u8DF3\u8FC7\u4E86 ${skipped.length} \u4F4D\u6700\u8FD1 ${RECENT_DAYS} \u5929\u5185\u6DFB\u52A0\u7684\u597D\u53CB\uFF1A${names}\u3002*` : `
1244
+
1245
+ *Skipped ${skipped.length} added in the last ${RECENT_DAYS} days: ${names}.*`;
1246
+ };
1234
1247
  const listReply = (rows, skipped, data, title) => {
1235
1248
  if (!rows.length) {
1236
1249
  return `${title}
1237
1250
 
1238
- ${lang === "zh" ? "\u6CA1\u6709\u7B26\u5408\u7684\u597D\u53CB\u3002" : "No friends match."}
1251
+ ${lang === "zh" ? "\u6CA1\u6709\u7B26\u5408\u7684\u597D\u53CB\u3002" : "No friends match."}${skipLine(skipped)}
1239
1252
 
1240
1253
  ${sinceLine(data.historySince, lang)}`;
1241
1254
  }
1242
- const skip = skipped.length ? lang === "zh" ? `
1243
-
1244
- *\u8DF3\u8FC7\u4E86 ${skipped.length} \u4F4D\u6700\u8FD1 ${RECENT_DAYS} \u5929\u5185\u6DFB\u52A0\u7684\u597D\u53CB\u3002*` : `
1245
-
1246
- *${skipped.length} friend${skipped.length > 1 ? "s" : ""} added in the last ${RECENT_DAYS} days ${skipped.length > 1 ? "were" : "was"} skipped.*` : "";
1247
1255
  return `${title}
1248
1256
 
1249
- ${friendTable(rows, data.now, lang)}${skip}
1257
+ ${friendTable(rows, data.now, lang)}${skipLine(skipped)}
1250
1258
 
1251
1259
  ${sinceLine(data.historySince, lang)}`;
1252
1260
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/beagle-ui",
3
- "version": "0.2.24",
3
+ "version": "0.2.25",
4
4
  "description": "The Beagle chat UI, minus the machine it runs on — shared by the desktop install and the browser build.",
5
5
  "license": "MIT",
6
6
  "type": "module",