nodebb-plugin-mentions 4.8.1 → 4.8.2

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,6 +1,7 @@
1
1
  {
2
2
  "mentions": "提到",
3
- "user-mentioned-you-in": "<strong>%1</strong> 在 <strong>%2</strong> 中提到了你",
3
+ "user-mentioned-you-in": "<strong>%1</strong> 在 <strong>%2</strong> 中提到了您",
4
+ "user-mentioned-you-in-room": "<strong>%1</strong> 在 <strong class=\"text-nowrap\"><i class=\"fa %2\"></i>%3</strong> 中提到了您",
4
5
  "user-mentioned-group-in": "<strong>%1</strong> 在 <strong>%3</strong> 中提到了 <strong>%2</strong>",
5
- "notificationType_mention": "当有人提到你时"
6
+ "notificationType_mention": "当有人提到您时"
6
7
  }
package/library.js CHANGED
@@ -497,7 +497,7 @@ Mentions.parseRaw = async (content, type = 'default') => {
497
497
  if (type === 'markdown') {
498
498
  str = `[${match}](${nconf.get('url')}${url})`;
499
499
  } else {
500
- str = `<a class="plugin-mentions-${mentionType} plugin-mentions-a" href="${nconf.get('relative_path')}${url}">${!Mentions._settings.display ? '@' : ''}<bdi>${match}</bdi></a>`;
500
+ str = `<a class="plugin-mentions-${mentionType} plugin-mentions-a" href="${nconf.get('relative_path')}${url}" aria-label="Profile: ${match}">${!Mentions._settings.display ? '@' : ''}<bdi>${match}</bdi></a>`;
501
501
  }
502
502
 
503
503
  return plain + str;
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "nodebb-plugin-mentions",
3
- "version": "4.8.1",
3
+ "version": "4.8.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "nodebb-plugin-mentions",
9
- "version": "4.8.1",
9
+ "version": "4.8.2",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "html-entities": "^2.3.2",
@@ -17,7 +17,7 @@
17
17
  "eslint": "^9.25.1",
18
18
  "eslint-config-nodebb": "^1.1.4",
19
19
  "eslint-plugin-import": "^2.31.0",
20
- "mocha": "11.7.4"
20
+ "mocha": "11.7.5"
21
21
  }
22
22
  },
23
23
  "node_modules/@eslint-community/eslint-utils": {
@@ -61,13 +61,13 @@
61
61
  }
62
62
  },
63
63
  "node_modules/@eslint/config-array": {
64
- "version": "0.21.0",
65
- "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz",
66
- "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==",
64
+ "version": "0.21.1",
65
+ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz",
66
+ "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==",
67
67
  "dev": true,
68
68
  "license": "Apache-2.0",
69
69
  "dependencies": {
70
- "@eslint/object-schema": "^2.1.6",
70
+ "@eslint/object-schema": "^2.1.7",
71
71
  "debug": "^4.3.1",
72
72
  "minimatch": "^3.1.2"
73
73
  },
@@ -76,22 +76,22 @@
76
76
  }
77
77
  },
78
78
  "node_modules/@eslint/config-helpers": {
79
- "version": "0.4.0",
80
- "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.0.tgz",
81
- "integrity": "sha512-WUFvV4WoIwW8Bv0KeKCIIEgdSiFOsulyN0xrMu+7z43q/hkOLXjvb5u7UC9jDxvRzcrbEmuZBX5yJZz1741jog==",
79
+ "version": "0.4.2",
80
+ "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
81
+ "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
82
82
  "dev": true,
83
83
  "license": "Apache-2.0",
84
84
  "dependencies": {
85
- "@eslint/core": "^0.16.0"
85
+ "@eslint/core": "^0.17.0"
86
86
  },
87
87
  "engines": {
88
88
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
89
89
  }
90
90
  },
91
91
  "node_modules/@eslint/core": {
92
- "version": "0.16.0",
93
- "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.16.0.tgz",
94
- "integrity": "sha512-nmC8/totwobIiFcGkDza3GIKfAw1+hLiYVrh3I1nIomQ8PEr5cxg34jnkmGawul/ep52wGRAcyeDCNtWKSOj4Q==",
92
+ "version": "0.17.0",
93
+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
94
+ "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
95
95
  "dev": true,
96
96
  "license": "Apache-2.0",
97
97
  "dependencies": {
@@ -125,12 +125,11 @@
125
125
  }
126
126
  },
127
127
  "node_modules/@eslint/js": {
128
- "version": "9.37.0",
129
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.37.0.tgz",
130
- "integrity": "sha512-jaS+NJ+hximswBG6pjNX0uEJZkrT0zwpVi3BA3vX22aFGjJjmgSTSmPpZCRKmoBL5VY/M6p0xsSJx7rk7sy5gg==",
128
+ "version": "9.39.1",
129
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.1.tgz",
130
+ "integrity": "sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==",
131
131
  "dev": true,
132
132
  "license": "MIT",
133
- "peer": true,
134
133
  "engines": {
135
134
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
136
135
  },
@@ -139,9 +138,9 @@
139
138
  }
140
139
  },
141
140
  "node_modules/@eslint/object-schema": {
142
- "version": "2.1.6",
143
- "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz",
144
- "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==",
141
+ "version": "2.1.7",
142
+ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
143
+ "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
145
144
  "dev": true,
146
145
  "license": "Apache-2.0",
147
146
  "engines": {
@@ -149,13 +148,13 @@
149
148
  }
150
149
  },
151
150
  "node_modules/@eslint/plugin-kit": {
152
- "version": "0.4.0",
153
- "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.0.tgz",
154
- "integrity": "sha512-sB5uyeq+dwCWyPi31B2gQlVlo+j5brPlWx4yZBrEaRo/nhdDE8Xke1gsGgtiBdaBTxuTkceLVuVt/pclrasb0A==",
151
+ "version": "0.4.1",
152
+ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
153
+ "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
155
154
  "dev": true,
156
155
  "license": "Apache-2.0",
157
156
  "dependencies": {
158
- "@eslint/core": "^0.16.0",
157
+ "@eslint/core": "^0.17.0",
159
158
  "levn": "^0.4.1"
160
159
  },
161
160
  "engines": {
@@ -303,6 +302,7 @@
303
302
  "integrity": "sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==",
304
303
  "dev": true,
305
304
  "license": "MIT",
305
+ "peer": true,
306
306
  "engines": {
307
307
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
308
308
  },
@@ -317,7 +317,6 @@
317
317
  "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
318
318
  "dev": true,
319
319
  "license": "MIT",
320
- "peer": true,
321
320
  "bin": {
322
321
  "acorn": "bin/acorn"
323
322
  },
@@ -1089,26 +1088,24 @@
1089
1088
  }
1090
1089
  },
1091
1090
  "node_modules/eslint": {
1092
- "version": "9.37.0",
1093
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.37.0.tgz",
1094
- "integrity": "sha512-XyLmROnACWqSxiGYArdef1fItQd47weqB7iwtfr9JHwRrqIXZdcFMvvEcL9xHCmL0SNsOvF0c42lWyM1U5dgig==",
1091
+ "version": "9.39.1",
1092
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.1.tgz",
1093
+ "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==",
1095
1094
  "dev": true,
1096
1095
  "license": "MIT",
1097
- "peer": true,
1098
1096
  "dependencies": {
1099
1097
  "@eslint-community/eslint-utils": "^4.8.0",
1100
1098
  "@eslint-community/regexpp": "^4.12.1",
1101
- "@eslint/config-array": "^0.21.0",
1102
- "@eslint/config-helpers": "^0.4.0",
1103
- "@eslint/core": "^0.16.0",
1099
+ "@eslint/config-array": "^0.21.1",
1100
+ "@eslint/config-helpers": "^0.4.2",
1101
+ "@eslint/core": "^0.17.0",
1104
1102
  "@eslint/eslintrc": "^3.3.1",
1105
- "@eslint/js": "9.37.0",
1106
- "@eslint/plugin-kit": "^0.4.0",
1103
+ "@eslint/js": "9.39.1",
1104
+ "@eslint/plugin-kit": "^0.4.1",
1107
1105
  "@humanfs/node": "^0.16.6",
1108
1106
  "@humanwhocodes/module-importer": "^1.0.1",
1109
1107
  "@humanwhocodes/retry": "^0.4.2",
1110
1108
  "@types/estree": "^1.0.6",
1111
- "@types/json-schema": "^7.0.15",
1112
1109
  "ajv": "^6.12.4",
1113
1110
  "chalk": "^4.0.0",
1114
1111
  "cross-spawn": "^7.0.6",
@@ -1216,7 +1213,6 @@
1216
1213
  "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==",
1217
1214
  "dev": true,
1218
1215
  "license": "MIT",
1219
- "peer": true,
1220
1216
  "dependencies": {
1221
1217
  "@rtsao/scc": "^1.1.0",
1222
1218
  "array-includes": "^3.1.9",
@@ -1756,9 +1752,20 @@
1756
1752
  }
1757
1753
  },
1758
1754
  "node_modules/html-entities": {
1759
- "version": "2.3.2",
1760
- "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz",
1761
- "integrity": "sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ=="
1755
+ "version": "2.6.0",
1756
+ "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.6.0.tgz",
1757
+ "integrity": "sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==",
1758
+ "funding": [
1759
+ {
1760
+ "type": "github",
1761
+ "url": "https://github.com/sponsors/mdevils"
1762
+ },
1763
+ {
1764
+ "type": "patreon",
1765
+ "url": "https://patreon.com/mdevils"
1766
+ }
1767
+ ],
1768
+ "license": "MIT"
1762
1769
  },
1763
1770
  "node_modules/ignore": {
1764
1771
  "version": "5.3.2",
@@ -2234,10 +2241,11 @@
2234
2241
  }
2235
2242
  },
2236
2243
  "node_modules/js-yaml": {
2237
- "version": "4.1.0",
2238
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
2239
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
2244
+ "version": "4.1.1",
2245
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
2246
+ "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
2240
2247
  "dev": true,
2248
+ "license": "MIT",
2241
2249
  "dependencies": {
2242
2250
  "argparse": "^2.0.1"
2243
2251
  },
@@ -2385,9 +2393,9 @@
2385
2393
  }
2386
2394
  },
2387
2395
  "node_modules/mocha": {
2388
- "version": "11.7.4",
2389
- "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.4.tgz",
2390
- "integrity": "sha512-1jYAaY8x0kAZ0XszLWu14pzsf4KV740Gld4HXkhNTXwcHx4AUEDkPzgEHg9CM5dVcW+zv036tjpsEbLraPJj4w==",
2396
+ "version": "11.7.5",
2397
+ "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.5.tgz",
2398
+ "integrity": "sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==",
2391
2399
  "dev": true,
2392
2400
  "license": "MIT",
2393
2401
  "dependencies": {
@@ -2685,6 +2693,7 @@
2685
2693
  "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
2686
2694
  "dev": true,
2687
2695
  "license": "MIT",
2696
+ "peer": true,
2688
2697
  "engines": {
2689
2698
  "node": ">=12"
2690
2699
  },
@@ -3403,9 +3412,10 @@
3403
3412
  }
3404
3413
  },
3405
3414
  "node_modules/validator": {
3406
- "version": "13.7.0",
3407
- "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz",
3408
- "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==",
3415
+ "version": "13.15.23",
3416
+ "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.23.tgz",
3417
+ "integrity": "sha512-4yoz1kEWqUjzi5zsPbAS/903QXSYp0UOtHsPpp7p9rHAw/W+dkInskAE386Fat3oKRROwO98d9ZB0G4cObgUyw==",
3418
+ "license": "MIT",
3409
3419
  "engines": {
3410
3420
  "node": ">= 0.10"
3411
3421
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-mentions",
3
- "version": "4.8.1",
3
+ "version": "4.8.2",
4
4
  "description": "NodeBB Plugin that allows users to mention other users by prepending an '@' sign to their username",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -33,6 +33,6 @@
33
33
  "eslint": "^9.25.1",
34
34
  "eslint-config-nodebb": "^1.1.4",
35
35
  "eslint-plugin-import": "^2.31.0",
36
- "mocha": "11.7.4"
36
+ "mocha": "11.7.5"
37
37
  }
38
38
  }
@@ -19,16 +19,13 @@ $(document).ready(function () {
19
19
  loadCategoryList();
20
20
  }
21
21
 
22
- let slugify;
23
22
  const strategy = {
24
23
  match: /\B@([^\s\n]*)?$/,
25
24
  search: function (term, callback) {
26
- require(['composer', 'helpers', 'slugify'], function (composer, _helpers, _slugify) {
27
- slugify = _slugify;
25
+ require(['composer', 'helpers'], function (composer, _helpers) {
28
26
  helpers = _helpers;
29
27
  if (!term) {
30
- const mentions = entriesToMentions(sortEntries(localUserList), helpers);
31
- return callback(mentions);
28
+ return callback(localUserList.filter((user) => user.uid !== app.user.uid));
32
29
  }
33
30
 
34
31
  // Get composer metadata
@@ -77,9 +74,9 @@ $(document).ready(function () {
77
74
  template: entryToMention,
78
75
  replace: function (mention) {
79
76
  if (mention.uid) {
80
- return `@${mention.userslug}`;
77
+ return `@${mention.userslug} `;
81
78
  } else if (mention.cid) {
82
- return `@${utils.isNumber(mention.cid) ? mention.handle : mention.slug}`;
79
+ return `@${utils.isNumber(mention.cid) ? mention.handle : mention.slug} `;
83
80
  }
84
81
  },
85
82
  cache: true,
@@ -120,18 +117,6 @@ $(document).ready(function () {
120
117
  }
121
118
  }
122
119
 
123
- function entriesToMentions(entries, helpers) {
124
- return entries.reduce(function (carry, entry) {
125
- // Don't add current user to suggestions
126
- if (app.user.username && app.user.username === entry.username) {
127
- return carry;
128
- }
129
-
130
- carry.push(entryToMention(entry));
131
- return carry;
132
- }, []);
133
- }
134
-
135
120
  function loadTopicUsers(element) {
136
121
  require(['composer', 'alerts'], function (composer, alerts) {
137
122
  function findTid() {