@decentnetwork/beagle 0.1.110 → 0.1.111

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.
@@ -1,4 +1,4 @@
1
- window.__DK_UI_VERSION="0.1.110";
1
+ window.__DK_UI_VERSION="0.1.111";
2
2
  "use strict";
3
3
  (() => {
4
4
  // packages/beagle-ui/dist/beagle-ui.js
@@ -1158,6 +1158,7 @@ ${cmds}
1158
1158
 
1159
1159
  ${tail}`;
1160
1160
  }
1161
+ var SKIP_NAMES_MAX = 10;
1161
1162
  var seq = 0;
1162
1163
  var asMsg = (from, text, extra) => Object.assign({
1163
1164
  id: `as-${Date.now()}-${seq++}`,
@@ -1219,22 +1220,29 @@ ${tail}`;
1219
1220
  ver: r.beagleVer || ""
1220
1221
  };
1221
1222
  };
1223
+ const skipLine = (skipped) => {
1224
+ if (!skipped.length)
1225
+ return "";
1226
+ const shown = skipped.slice(0, SKIP_NAMES_MAX).map(nameOf);
1227
+ const more = skipped.length - shown.length;
1228
+ const names = shown.join(", ") + (more > 0 ? lang === "zh" ? ` \u7B49 ${more} \u4F4D` : `, and ${more} more` : "");
1229
+ return lang === "zh" ? `
1230
+
1231
+ *\u8DF3\u8FC7\u4E86 ${skipped.length} \u4F4D\u6700\u8FD1 ${RECENT_DAYS} \u5929\u5185\u6DFB\u52A0\u7684\u597D\u53CB\uFF1A${names}\u3002*` : `
1232
+
1233
+ *Skipped ${skipped.length} added in the last ${RECENT_DAYS} days: ${names}.*`;
1234
+ };
1222
1235
  const listReply = (rows, skipped, data, title) => {
1223
1236
  if (!rows.length) {
1224
1237
  return `${title}
1225
1238
 
1226
- ${lang === "zh" ? "\u6CA1\u6709\u7B26\u5408\u7684\u597D\u53CB\u3002" : "No friends match."}
1239
+ ${lang === "zh" ? "\u6CA1\u6709\u7B26\u5408\u7684\u597D\u53CB\u3002" : "No friends match."}${skipLine(skipped)}
1227
1240
 
1228
1241
  ${sinceLine(data.historySince, lang)}`;
1229
1242
  }
1230
- const skip = skipped.length ? lang === "zh" ? `
1231
-
1232
- *\u8DF3\u8FC7\u4E86 ${skipped.length} \u4F4D\u6700\u8FD1 ${RECENT_DAYS} \u5929\u5185\u6DFB\u52A0\u7684\u597D\u53CB\u3002*` : `
1233
-
1234
- *${skipped.length} friend${skipped.length > 1 ? "s" : ""} added in the last ${RECENT_DAYS} days ${skipped.length > 1 ? "were" : "was"} skipped.*` : "";
1235
1243
  return `${title}
1236
1244
 
1237
- ${friendTable(rows, data.now, lang)}${skip}
1245
+ ${friendTable(rows, data.now, lang)}${skipLine(skipped)}
1238
1246
 
1239
1247
  ${sinceLine(data.historySince, lang)}`;
1240
1248
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/beagle",
3
- "version": "0.1.110",
3
+ "version": "0.1.111",
4
4
  "description": "Beagle — P2P chat, file transfer and calls for regular users, on the Decent Network. No admin privilege required.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "yargs": "^17.7.2"
36
36
  },
37
37
  "devDependencies": {
38
- "@decentnetwork/beagle-ui": "^0.2.24",
38
+ "@decentnetwork/beagle-ui": "^0.2.25",
39
39
  "@types/js-yaml": "^4.0.9",
40
40
  "@types/node": "^20.11.0",
41
41
  "@types/yargs": "^17.0.32",