@noob-stupid/dsh-plugin-console 0.5.93 → 0.5.94

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/README.md CHANGED
@@ -20,7 +20,7 @@ take is refused, not installed.
20
20
  [![Registry CI](https://img.shields.io/github/actions/workflow/status/Noob-stupid/dsh-plugin-gating-hub/registry.yml?label=registry%20CI&style=flat-square)](https://github.com/Noob-stupid/dsh-plugin-gating-hub/actions/workflows/registry.yml)
21
21
  [![topic: dsh-plugin](https://img.shields.io/badge/topic-dsh_plugin-4D6BFE?style=flat-square)](https://github.com/topics/dsh-plugin)
22
22
  [![npm version](https://img.shields.io/npm/v/@noob-stupid/dsh-plugin-console?style=flat-square)](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console)
23
- [![npm downloads](https://img.shields.io/npm/dm/@noob-stupid/dsh-plugin-console?style=flat-square)](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console)
23
+ [![npm downloads](https://img.shields.io/endpoint?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2FNoob-stupid%2Fdsh-plugin-gating-hub%40main%2Fbadges%2Fdownloads.json&v=1&style=flat-square)](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console) [![npm downloads total](https://img.shields.io/endpoint?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2FNoob-stupid%2Fdsh-plugin-gating-hub%40main%2Fbadges%2Fdownloads-total.json&v=1&style=flat-square)](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console)
24
24
  [![GitHub Release](https://img.shields.io/github/v/release/Noob-stupid/dsh-plugin-gating-hub?style=flat-square)](https://github.com/Noob-stupid/dsh-plugin-gating-hub/releases)[![dsh.so security](https://www.dsh.so/badge/dsh-plugin-hub.svg)](https://www.dsh.so/artifact/dsh-plugin-hub)
25
25
  [![dsh.so install · dsh 0.2.0-rc.1](https://www.dsh.so/badge/install/dsh-plugin-hub@0.2.0-rc.1.svg)](https://www.dsh.so/artifact/dsh-plugin-hub/)
26
26
 
package/README.zh.md CHANGED
@@ -19,7 +19,7 @@
19
19
  [![Registry CI](https://img.shields.io/github/actions/workflow/status/Noob-stupid/dsh-plugin-gating-hub/registry.yml?label=registry%20CI&style=flat-square)](https://github.com/Noob-stupid/dsh-plugin-gating-hub/actions/workflows/registry.yml)
20
20
  [![topic: dsh-plugin](https://img.shields.io/badge/topic-dsh_plugin-4D6BFE?style=flat-square)](https://github.com/topics/dsh-plugin)
21
21
  [![npm version](https://img.shields.io/npm/v/@noob-stupid/dsh-plugin-console?style=flat-square)](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console)
22
- [![npm downloads](https://img.shields.io/npm/dm/@noob-stupid/dsh-plugin-console?style=flat-square)](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console)
22
+ [![npm downloads](https://img.shields.io/endpoint?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2FNoob-stupid%2Fdsh-plugin-gating-hub%40main%2Fbadges%2Fdownloads.json&v=1&style=flat-square)](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console) [![npm downloads total](https://img.shields.io/endpoint?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2FNoob-stupid%2Fdsh-plugin-gating-hub%40main%2Fbadges%2Fdownloads-total.json&v=1&style=flat-square)](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console)
23
23
  [![GitHub Release](https://img.shields.io/github/v/release/Noob-stupid/dsh-plugin-gating-hub?style=flat-square)](https://github.com/Noob-stupid/dsh-plugin-gating-hub/releases)[![dsh.so security](https://www.dsh.so/badge/dsh-plugin-hub.svg)](https://www.dsh.so/artifact/dsh-plugin-hub)
24
24
  [![dsh.so install · dsh 0.2.0-rc.1](https://www.dsh.so/badge/install/dsh-plugin-hub@0.2.0-rc.1.svg)](https://www.dsh.so/artifact/dsh-plugin-hub/)
25
25
 
package/lib/client.js CHANGED
@@ -4598,7 +4598,7 @@ const RESTART_FAILED_NOTE = "重启请求失败";
4598
4598
  ).finally(() => setAnnotationBusy(null));
4599
4599
  };
4600
4600
  const userGroups = Array.isArray(annotations?.groups) ? annotations.groups : [];
4601
- /** 某个包属于哪个用户分组(一个包最多一个分组;服务端保证 assign 会自动移出旧的)。 */
4601
+ /** 某个包属于哪个用户分组(单值:取第一个命中的)。渲染请用 groupsOfPackage —— 分组允许重叠。 */
4602
4602
  const groupOfPackage = (moduleName) => {
4603
4603
  const name = String(moduleName ?? "");
4604
4604
  if (name === "") return null;
@@ -4607,6 +4607,15 @@ const RESTART_FAILED_NOTE = "重启请求失败";
4607
4607
  }
4608
4608
  return null;
4609
4609
  };
4610
+ /**
4611
+ * 某个包属于**哪些**用户分组(分组允许重叠 ⇒ 可能多个)。
4612
+ * 与 groupOfPackage 的区别:那个用于"当前选中哪个组"(单值),这个用于渲染(多值)。
4613
+ */
4614
+ const groupsOfPackage = (moduleName) => {
4615
+ const name = String(moduleName ?? "");
4616
+ if (name === "") return [];
4617
+ return userGroups.filter((group) => Array.isArray(group.packages) && group.packages.includes(name));
4618
+ };
4610
4619
  const createUserGroup = () => {
4611
4620
  const name = groupDraftName.trim();
4612
4621
  if (name === "") return;
@@ -5206,10 +5215,13 @@ const RESTART_FAILED_NOTE = "重启请求失败";
5206
5215
  const root = famRootOf(e);
5207
5216
  // ★ 用户 2026-10-26:**用户分组优先** —— 被归进自己分组的插件,卡片直接住进那个分组区块
5208
5217
  // (像全家桶一样能展开看到卡片),官方 family 区块里不再重复渲染它。
5209
- const userGroup = groupOfPackage(e.moduleName);
5210
- if (userGroup !== null) {
5211
- if (!userGroupBuckets.has(userGroup.id)) userGroupBuckets.set(userGroup.id, []);
5212
- userGroupBuckets.get(userGroup.id).push(card);
5218
+ // ★ 分组允许重叠:一个插件可以同时出现在多个分组区块里(用户 2026-10-27 定稿的规则)
5219
+ const userGroupsOf = groupsOfPackage(e.moduleName);
5220
+ if (userGroupsOf.length > 0) {
5221
+ for (const g of userGroupsOf) {
5222
+ if (!userGroupBuckets.has(g.id)) userGroupBuckets.set(g.id, []);
5223
+ userGroupBuckets.get(g.id).push(card);
5224
+ }
5213
5225
  return;
5214
5226
  }
5215
5227
  if (root === null || familySize(root) <= 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noob-stupid/dsh-plugin-console",
3
- "version": "0.5.93",
3
+ "version": "0.5.94",
4
4
  "description": "DSH 框架升级安全与插件升级门控:一键升级、失败自动回滚、升级后回滚上版、旧插件不适配自动禁用;内置多源插件市场为发现层,插件源全部可自定义,可指向公司内网私有源 / 私有索引 / 本地 Git 仓库,纯内网离线可用 | Framework upgrade safety & plugin version gating for DSH, with a customizable multi-source plugin market: point every source at internal mirrors or a local file:// repo for intranet-only, offline installs.",
5
5
  "repository": {
6
6
  "type": "git",