@restregular/dsh-memory 0.25.6 → 0.25.8
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/CHANGELOG.md +13 -0
- package/README.md +4 -2
- package/lib/client.js +80 -24
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
本项目的版本记录。安装 id 与 npm 版本一一对应。
|
|
4
4
|
|
|
5
|
+
## 0.25.8 — 记忆权限浮窗不再被「回到底部」按钮盖住;本会话作用域叫「当前会话」
|
|
6
|
+
|
|
7
|
+
- **层级修正(浮窗曾被「回到底部」圆钮压住)**:宿主会话在 active 阶段给输入框所在的 composer seat 上了 `position:sticky + z-index:7`,那是一个独立的层叠上下文;浮窗写在它里面,`position:fixed` 也只在那个上下文里比较层级,永远压不过兄弟层 z-index:8 的「回到底部」按钮。现在浮窗通过 `react-dom` 的 `createPortal` 挂到 `document.body`,直接参与根层叠上下文的排序;`z-index` 从 80 提到 900(会话里的浮动件都在 100 以内,宿主自己的对话框 / 提示层是 1000 起,所以压得过前者、盖不住后者)。拿不到 `react-dom` 的宿主退回原地渲染,功能一致。
|
|
8
|
+
- **点外面关闭仍然正确**:portal 之后浮窗不再长在按钮那棵树里,outside-click 判定补了浮窗自己的 ref,点浮窗内部(搜索框、勾选框、保存)不会被当成「点外面」。
|
|
9
|
+
- **本会话作用域改名「当前会话」**:作用域列表里 `session:<本会话 id>` 那一行不再显示会话标题 + 短 id(或「会话 1a2b3c4d」),统一显示「当前会话」——面板本来就是给这个会话设权限,用户不需要对号入座。**只改本会话那一条**:目录里别的会话的 scope(有记录就会被发现)仍按标题 / 短 id 显示。搜索也走显示名,输入「当前会话」能直接筛到这一行;原始 `session:<id>` 仍留在名称的 `title` 提示里。
|
|
10
|
+
- 测试:新增「浮窗 portal 到 document.body」与「本会话作用域显示为当前会话、别的会话照旧」两个用例,并断言浮窗 `z-index:900`(高于会话浮动件 8 / 100、低于宿主弹窗 1000);改写两个受显示名与排序影响的既有断言。`source/memory-panel/test/*` 53/53 通过,全套 54 个文件里仅 `memory-local/test/multiprocess.test.ts` 因沙箱禁止 spawn 子进程失败(真机全权限可过)。
|
|
11
|
+
|
|
12
|
+
## 0.25.7 — 记忆权限里整张作用域卡片都能点选
|
|
13
|
+
|
|
14
|
+
- **卡片整体可点**:「记忆权限」浮窗的作用域列表里,以前只有 16px 的勾选框和名称文字能点,点计数或行内留白没反应。现在整张卡片都能点——点名称、记录数、留白等同点勾选框(选中 / 取消勾选),鼠标移到卡片上就是可点击形态。行内的【绑定】/【可读】/【可写】按钮与勾选框仍各管各的:按钮点击不会再把卡片切换第二次(事件冒泡被拦掉),勾选框也不会被切换两下。
|
|
15
|
+
- **配套样式**:卡片 `cursor:pointer` + `user-select:none`,拖动卡片不会误触勾选或选中文字。
|
|
16
|
+
- 测试:新增用例覆盖「点卡片空白处勾选 / 取消勾选」「点按钮冒泡上来不重复切换」「点勾选框或名称只切换一次」「点绑定按钮不改勾选」,并断言卡片的 `cursor` / `user-select`;`source/memory-panel/test/*` 全绿。
|
|
17
|
+
|
|
5
18
|
## 0.25.6 — 按钮数字实时跟着授权变;关浮窗即丢弃草稿
|
|
6
19
|
|
|
7
20
|
- **数字不再要「开一次浮窗」才对**:0.25.5 把输入框按钮的数字改成「可见范围 ∪ AI 授权」,但授权只在浮窗打开时按 3 秒轮询,浮窗关着 Agent 刚审批到的权限进不了这个数字(表现为「数字没有实时变化」,要手动打开面板才更新)。现在会话在就轮询(3 秒一次、`document.hidden` 时跳过),按钮数字与 `title` 随授权自己变;换会话时先清空上一个会话的授权快照,避免数字串台。
|
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ JSONL 落盘 · 本机向量检索 · 五个模型工具 · 自动召回 · 硬
|
|
|
47
47
|
| **自动召回** | 每轮按用户问题召回;新会话第一步注入项目 / global 摘要;发布、部署、工具失败等行为按标签触发定向召回 |
|
|
48
48
|
| **印象形态** | 每轮只给每条记忆的短摘要;模型判断相关但需要细节时再 `memory_get` 取全文,省 token 也不丢信息 |
|
|
49
49
|
| **硬性规则** | `kind: rule` 进系统提示常驻段;行首带 8 位 id,注入的是摘要,需要全文时用 `memory_get`;旧会话会收到新增 / 编辑提醒;超预算有明确警告,不静默丢弃 |
|
|
50
|
-
| **记忆权限** | 输入框旁的「记忆权限」按钮设置本会话可读的作用域 + 限制等级(绝对 / 普通 / 无限制);每个作用域一行就是一条设置:**勾选**表示本会话可访问,行内**【绑定】/【可读】/【可写】**控制工作区默认可见与读写权限——绑定到当前工作区后新会话默认可见,可读 / 可写独立影响工具读写;Agent 通过 `memory_scopes request` 申请到的范围外授权**也用勾选呈现**(名称右边挂一个「AI」气泡,样式与你自己勾选的行区分开),取消勾选只是草稿,**点「保存」才真正撤销**(0.25.4 起),且按钮数字 / 「已选」都把 AI 授权算进去(0.25.5 起)并**实时轮询**——浮窗关着,Agent 刚拿到的授权也会让按钮数字自己变(0.25.6 起);Agent 及其子 Agent 都按它检索、注入与 `memory_get` |
|
|
50
|
+
| **记忆权限** | 输入框旁的「记忆权限」按钮设置本会话可读的作用域 + 限制等级(绝对 / 普通 / 无限制);每个作用域一行就是一条设置:**勾选**表示本会话可访问,行内**【绑定】/【可读】/【可写】**控制工作区默认可见与读写权限——绑定到当前工作区后新会话默认可见,可读 / 可写独立影响工具读写;Agent 通过 `memory_scopes request` 申请到的范围外授权**也用勾选呈现**(名称右边挂一个「AI」气泡,样式与你自己勾选的行区分开),取消勾选只是草稿,**点「保存」才真正撤销**(0.25.4 起),且按钮数字 / 「已选」都把 AI 授权算进去(0.25.5 起)并**实时轮询**——浮窗关着,Agent 刚拿到的授权也会让按钮数字自己变(0.25.6 起);**整张作用域卡片都能点选**,点名称 / 计数 / 留白等同点勾选框(0.25.7 起),本会话那一行直接叫「**当前会话**」(0.25.8 起);浮窗挂在页面根层,不会被输入框上方的浮动按钮盖住(0.25.8 起);Agent 及其子 Agent 都按它检索、注入与 `memory_get` |
|
|
51
51
|
| **修正版编辑** | 面板里编辑一条记忆 = 新建一条修正版并通过 `supersedes` 指向旧记录,旧记录不原地修改;记录页「是否被修正」筛选默认隐藏旧版本,可切到全部 / 只看已修正 |
|
|
52
52
|
| **范围外审批** | 普通限制下,工具命中可见域外的记忆时会在**对应会话的输入框上方**出现审批卡(样式与系统权限审批一致):展示工具、Agent 说明、查询关键词与范围外记忆摘要,支持逐条勾选 / 全选 / 取消全选(「允许选中的 N 条」或整单「允许一次」)或「拒绝」;点记忆 ID 直接跳到面板「记录」页并展开该条 |
|
|
53
53
|
| **上下文去重** | `memory_search` / `memory_list` 返回过的条目记进会话上下文状态;同一版本再次命中只回记忆 ID(`memory_search` 的裸 ID 与带摘要条目之间空一行),并提示用 `memory_get` 取全文(内容更新后重新给摘要) |
|
|
@@ -91,7 +91,9 @@ JSONL 落盘 · 本机向量检索 · 五个模型工具 · 自动召回 · 硬
|
|
|
91
91
|
输入框工具行右侧有「记忆权限」按钮。**打开会话时就会读取这个会话的设置**,按钮上的数字是当前生效的作用域数量,边框样式表示限制等级(绝对限制 = 橙黄实线 / 普通限制 = 蓝色实线 / 无限制 = 灰色虚线;`title` 里写明「已设置 / 使用默认 / 继承父会话 + 数量 + 等级」)。点开的浮窗使用毛玻璃背景,按当前会话列出可选作用域(当前会话 / 当前项目 / global / 已有自定义作用域):
|
|
92
92
|
|
|
93
93
|
- **默认范围**:没有显式设置时(新会话)按默认设置生效 —— **当前会话 + 当前项目 + global + 已绑定的作用域** + **普通限制**;面板按同一份默认范围预选,不会出现空面板。
|
|
94
|
-
-
|
|
94
|
+
- **本会话那一行的名字**(0.25.8):本会话 `session:<id>` 那一行固定显示「**当前会话**」(原始 scope 键在 `title` 里),别的会话的 scope 仍按标题 / 短 id 显示;搜索也按显示名匹配,输入「当前会话」即可筛到这一行。
|
|
95
|
+
- **搜索与批量**:顶部可搜索作用域,支持「全选 / 取消全选」;列表最大高度受限,作用域多时在浮窗内滚动。**整张作用域卡片都能点**(0.25.7 起)——点名称、记录数或行内留白等同点勾选框,只有行内的按钮(勾选框 / 绑定 / 可读 / 可写)各管各的,点它们不会再多切换一次。
|
|
96
|
+
- **浮窗层级**(0.25.8):浮窗 portal 到 `document.body` 渲染,`z-index:900`,不会再被会话里的「回到底部」圆钮(z-index:8)之类浮动件盖住;同时仍低于宿主自己的对话框 / 提示层(1000 起)。
|
|
95
97
|
- **状态按钮(0.23.0 / 0.23.1)**:作用域列表每行有【绑定】、【可读】|【可写】。**默认范围自带的会话 + 项目 + global 显示为已绑定且不可取消**;**绑定**按钮用于把其它作用域额外并入当前工作区的默认范围(没有显式覆盖的新会话可见);**可读 / 可写**是会话级,独立控制该作用域的读取与写入(关掉可读 → 搜索 / 读取跳过并说明原因;关掉可写 → 保存 / 删除被拒绝并说明原因)。
|
|
96
98
|
- **限制等级**:
|
|
97
99
|
- **绝对限制**:可见域外的读取 / 写入 / 删除一律不执行;命中被挡住时会明确告诉 Agent 是「绝对限制」以及怎么调整(不再假装记忆不存在)。
|
package/lib/client.js
CHANGED
|
@@ -26,6 +26,25 @@ window.__ModuleLoader__.load({
|
|
|
26
26
|
const React = require('react')
|
|
27
27
|
const h = React.createElement
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* 0.25.8:把「记忆权限」浮窗挂到 document.body 用的 portal。
|
|
31
|
+
*
|
|
32
|
+
* 按钮注册在 conversation.input.right,整个输入框在宿主会话的 active 阶段是
|
|
33
|
+
* `.composerSeat{position:sticky; z-index:7}` —— 一个独立的层叠上下文。浮窗哪怕写
|
|
34
|
+
* `position:fixed` 也只能在这个上下文里排层级,永远压不过兄弟层的「回到底部」圆钮
|
|
35
|
+
* (`.toBottomSlot{z-index:8}`),表现为圆钮盖在浮窗上面。portal 到 body 之后浮窗直接
|
|
36
|
+
* 在根层叠上下文里参与排序,才真正高于 8。
|
|
37
|
+
*
|
|
38
|
+
* react-dom 由宿主的 ModuleLoader 以 seed word 提供(宿主自己与 dshmarket / rewind
|
|
39
|
+
* 等插件的 client bundle 都 require 它)。拿不到就退回原地渲染:层级受限,但不报错。
|
|
40
|
+
*/
|
|
41
|
+
const createPortal = (() => {
|
|
42
|
+
try {
|
|
43
|
+
const dom = require('react-dom')
|
|
44
|
+
return dom && typeof dom.createPortal === 'function' ? dom.createPortal : null
|
|
45
|
+
} catch { return null }
|
|
46
|
+
})()
|
|
47
|
+
|
|
29
48
|
const API = '/memory/api'
|
|
30
49
|
|
|
31
50
|
const CSS = [
|
|
@@ -496,7 +515,10 @@ window.__ModuleLoader__.load({
|
|
|
496
515
|
'.mem-scope-btn.is-absolute:hover,.mem-scope-btn.is-normal:hover,.mem-scope-btn.is-none:hover{background:var(--dsw-alias-interactive-bg-hover)}',
|
|
497
516
|
'.mem-scope-btn svg{flex:none}',
|
|
498
517
|
// 毛玻璃浮窗:半透明 + backdrop blur;不支持 backdrop-filter 时退回实心底。
|
|
499
|
-
|
|
518
|
+
// 0.25.8:z-index 80 → 900。浮窗 portal 到 body 后与宿主各层在根层叠上下文里比较:
|
|
519
|
+
// 会话层的「回到底部」按钮是 z-index:8、宿主的下拉/菜单层是 100,而宿主自己的
|
|
520
|
+
// 对话框 / 提示层是 1000 起 —— 取 900 保证压过会话里的所有浮动件,又不会盖住宿主弹窗。
|
|
521
|
+
'.mem-scope-pop{position:fixed;z-index:900;width:340px;max-height:min(520px,72vh);display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid color-mix(in srgb,var(--dsw-alias-border-l2,var(--dsw-alias-border-l1)) 60%,transparent);border-radius:14px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-1) 78%,transparent);-webkit-backdrop-filter:blur(20px) saturate(1.35);backdrop-filter:blur(20px) saturate(1.35);box-shadow:0 10px 28px rgba(0,0,0,.18);color:var(--dsw-alias-label-primary);font-size:13px;overflow:hidden}',
|
|
500
522
|
'@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.mem-scope-pop{background:var(--dsw-specific-menu,var(--dsw-alias-bg-layer-1))}}',
|
|
501
523
|
'.mem-scope-head{display:flex;align-items:center;gap:8px}',
|
|
502
524
|
'.mem-scope-head h4{margin:0;font-size:13px;font-weight:600;line-height:1.4}',
|
|
@@ -519,7 +541,7 @@ window.__ModuleLoader__.load({
|
|
|
519
541
|
'.mem-scope-list{display:flex;flex-direction:column;gap:3px;overflow:auto;min-height:0;max-height:min(220px,32vh);padding:2px 2px 2px 0;scrollbar-width:thin}',
|
|
520
542
|
'.mem-scope-list::-webkit-scrollbar{width:8px}',
|
|
521
543
|
'.mem-scope-list::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--dsw-alias-label-secondary) 35%,transparent);border-radius:999px;border:2px solid transparent;background-clip:padding-box}',
|
|
522
|
-
'.mem-scope-item{display:flex;flex-direction:column;gap:4px;padding:5px 6px;border:1px solid transparent;border-radius:10px}',
|
|
544
|
+
'.mem-scope-item{display:flex;flex-direction:column;gap:4px;padding:5px 6px;border:1px solid transparent;border-radius:10px;cursor:pointer;user-select:none}',
|
|
523
545
|
'.mem-scope-item:hover{background:var(--dsw-alias-interactive-bg-hover)}',
|
|
524
546
|
'.mem-scope-item.on{border-color:color-mix(in srgb,var(--dsw-alias-state-business-primary) 38%,var(--dsw-alias-border-l1));background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 8%,transparent)}',
|
|
525
547
|
// 0.25.5:AI 授权的勾选与用户自己勾选要能一眼分开 —— 行用虚线边框 + 中性底,
|
|
@@ -4593,14 +4615,18 @@ window.__ModuleLoader__.load({
|
|
|
4593
4615
|
const [grantBusy, setGrantBusy] = React.useState('')
|
|
4594
4616
|
const [grantError, setGrantError] = React.useState('')
|
|
4595
4617
|
const wrapRef = React.useRef(null)
|
|
4618
|
+
// 0.25.8:浮窗 portal 到 body 后不再长在 wrapRef 这棵树里,点它自己不能算「点外面」。
|
|
4619
|
+
const popRef = React.useRef(null)
|
|
4596
4620
|
|
|
4597
4621
|
React.useEffect(() => {
|
|
4598
4622
|
if (!open) return undefined
|
|
4599
4623
|
if (typeof document === 'undefined' || typeof document.addEventListener !== 'function') return undefined
|
|
4624
|
+
const inside = (node, target) => Boolean(node && typeof node.contains === 'function' && node.contains(target))
|
|
4600
4625
|
const onDown = (event) => {
|
|
4601
4626
|
try {
|
|
4602
|
-
const
|
|
4603
|
-
if (
|
|
4627
|
+
const target = event ? event.target : null
|
|
4628
|
+
if (inside(wrapRef.current, target) || inside(popRef.current, target)) return
|
|
4629
|
+
setOpen(false)
|
|
4604
4630
|
} catch { /* 关闭失败不影响页面 */ }
|
|
4605
4631
|
}
|
|
4606
4632
|
const onKey = (event) => { if (event && event.key === 'Escape') setOpen(false) }
|
|
@@ -4924,8 +4950,20 @@ window.__ModuleLoader__.load({
|
|
|
4924
4950
|
|| (grantsByScope.has(scope) && !pendingRevoke[scope])
|
|
4925
4951
|
/** 已保存状态的勾选(排序只看它,草稿改动不立刻重排)。 */
|
|
4926
4952
|
const savedChecked = (scope) => Boolean(savedEntries[scope]) || grantsByScope.has(scope)
|
|
4953
|
+
/**
|
|
4954
|
+
* 0.25.8:本会话自己的 session scope 在列表里叫「当前会话」。
|
|
4955
|
+
*
|
|
4956
|
+
* 面板是「这个会话」的权限面板,那一行就是用户正在用的会话 —— 显示
|
|
4957
|
+
* `session:<uuid>` 或「会话 1a2b3c4d」都只有实现细节,用户无从对号。
|
|
4958
|
+
* **只**改本会话那一条:目录里可能还有别的会话的 scope(它们带记录就会被发现),
|
|
4959
|
+
* 那些仍按标题 / 短 id 显示,不能跟着叫「当前会话」。
|
|
4960
|
+
*/
|
|
4961
|
+
const currentSessionScope = (typeof sessionId === 'string' && sessionId !== '') ? `session:${sessionId}` : ''
|
|
4962
|
+
const displayName = (scope, label) => (currentSessionScope !== '' && scope === currentSessionScope)
|
|
4963
|
+
? '当前会话'
|
|
4964
|
+
: String(label || scope)
|
|
4927
4965
|
const matches = (label, scope) => !needle
|
|
4928
|
-
||
|
|
4966
|
+
|| displayName(scope, label).toLowerCase().includes(needle) || String(scope).toLowerCase().includes(needle)
|
|
4929
4967
|
const visibleScopes = catalog.filter((item) => matches(item.label || item.scope, item.scope))
|
|
4930
4968
|
// 目录里已经看不到的作用域(记录删光 / 元数据没了)仍占一行,方便取消勾选撤销授权。
|
|
4931
4969
|
const catalogScopes = new Set(catalog.map((item) => item.scope))
|
|
@@ -4933,8 +4971,8 @@ window.__ModuleLoader__.load({
|
|
|
4933
4971
|
&& !catalogScopes.has(grant.scope) && matches(grant.label || grant.scope, grant.scope))
|
|
4934
4972
|
// 已勾选的排上面、未勾选的排下面,组内按名称字母排序;顺序以保存过的状态为准。
|
|
4935
4973
|
const rows = [
|
|
4936
|
-
...visibleScopes.map((item) => ({ scope: item.scope, name:
|
|
4937
|
-
...orphanGrants.map((grant) => ({ scope: grant.scope, name:
|
|
4974
|
+
...visibleScopes.map((item) => ({ scope: item.scope, name: displayName(item.scope, item.label), item })),
|
|
4975
|
+
...orphanGrants.map((grant) => ({ scope: grant.scope, name: displayName(grant.scope, grant.label), grant })),
|
|
4938
4976
|
]
|
|
4939
4977
|
rows.sort((a, b) => (Number(savedChecked(b.scope)) - Number(savedChecked(a.scope)))
|
|
4940
4978
|
|| a.name.localeCompare(b.name, 'zh-Hans-CN', { sensitivity: 'base', numeric: true })
|
|
@@ -4992,20 +5030,10 @@ window.__ModuleLoader__.load({
|
|
|
4992
5030
|
&& grant.scope !== '' && !catalogScopes.has(grant.scope) && !pendingRevoke[grant.scope]).length
|
|
4993
5031
|
const checkedCount = catalog.filter((item) => isChecked(item.scope)).length + orphanChecked
|
|
4994
5032
|
const scopeCountText = `${accessibleCount} 个作用域`
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
title: `${sourceText}记忆权限:${scopeCountText} · ${buttonLevelLabel}`,
|
|
5000
|
-
'aria-label': `${sourceText}记忆权限,${scopeCountText},${buttonLevelLabel}`,
|
|
5001
|
-
'aria-expanded': open,
|
|
5002
|
-
onMouseDown: (event) => { try { event.preventDefault() } catch { /* keepFocus */ } },
|
|
5003
|
-
onClick: toggle,
|
|
5004
|
-
},
|
|
5005
|
-
h(NavLineIcon, { size: 14 }),
|
|
5006
|
-
data === null ? null : h('span', null, String(accessibleCount)),
|
|
5007
|
-
),
|
|
5008
|
-
open ? h('div', { className: 'mem-scope-pop', style: popStyle, role: 'dialog', 'aria-label': '记忆权限' },
|
|
5033
|
+
const portalTarget = typeof document !== 'undefined' && document !== null && document.body ? document.body : null
|
|
5034
|
+
// 0.25.8:浮窗 portal 到 body(原因见文件头 createPortal 的注释)。拿不到 react-dom
|
|
5035
|
+
// 或没有 document.body 时退回原地渲染 —— 层级受限,但功能完全一致。
|
|
5036
|
+
const popover = open ? h('div', { className: 'mem-scope-pop', ref: popRef, style: popStyle, role: 'dialog', 'aria-label': '记忆权限' },
|
|
5009
5037
|
h('div', { className: 'mem-scope-head' },
|
|
5010
5038
|
h('h4', null, '记忆权限'),
|
|
5011
5039
|
h('span', { className: 'spacer' }),
|
|
@@ -5050,7 +5078,19 @@ window.__ModuleLoader__.load({
|
|
|
5050
5078
|
const checked = isChecked(row.scope)
|
|
5051
5079
|
// 只靠 AI 授权才勾上的行加 .ai:样式与用户自己勾选的行区分开。
|
|
5052
5080
|
const aiOnly = Boolean(grant) && !entries[row.scope]
|
|
5053
|
-
|
|
5081
|
+
// 0.25.7:整张卡片都可点选 —— 按钮(勾选框 / 绑定 / 可读 / 可写)自己处理点击,
|
|
5082
|
+
// 点卡片其余区域(名称、计数、留白)等同点勾选框,避免只能戳 16px 的小方块。
|
|
5083
|
+
const toggleFromCard = (event) => {
|
|
5084
|
+
const target = event && event.target
|
|
5085
|
+
if (target && typeof target.closest === 'function'
|
|
5086
|
+
&& target.closest('button,input,textarea,select,a,label')) return
|
|
5087
|
+
toggleScope(row.scope)
|
|
5088
|
+
}
|
|
5089
|
+
return h('div', {
|
|
5090
|
+
className: `mem-scope-item${checked ? ' on' : ''}${aiOnly ? ' ai' : ''}`,
|
|
5091
|
+
key: row.scope,
|
|
5092
|
+
onClick: toggleFromCard,
|
|
5093
|
+
},
|
|
5054
5094
|
h('div', { className: 'mem-scope-row' },
|
|
5055
5095
|
h('button', {
|
|
5056
5096
|
type: 'button',
|
|
@@ -5070,7 +5110,7 @@ window.__ModuleLoader__.load({
|
|
|
5070
5110
|
className: 'mem-scope-label',
|
|
5071
5111
|
title: item ? row.scope : `${row.scope}(目录中已不可见)`,
|
|
5072
5112
|
onClick: () => toggleScope(row.scope),
|
|
5073
|
-
}, item ?
|
|
5113
|
+
}, displayName(row.scope, item ? item.label : row.grant.label)),
|
|
5074
5114
|
grant ? grantTag(grant, row.scope) : null,
|
|
5075
5115
|
h('span', { className: 'cnt' }, item ? `${item.records ?? 0}` : '目录中已不可见'),
|
|
5076
5116
|
),
|
|
@@ -5131,7 +5171,23 @@ window.__ModuleLoader__.load({
|
|
|
5131
5171
|
onClick: saveDraft,
|
|
5132
5172
|
}, busy ? '保存中…' : '保存'),
|
|
5133
5173
|
),
|
|
5134
|
-
) : null
|
|
5174
|
+
) : null
|
|
5175
|
+
return h('span', { className: 'mem-scope-wrap', ref: wrapRef },
|
|
5176
|
+
h('button', {
|
|
5177
|
+
type: 'button',
|
|
5178
|
+
className: `mem-scope-btn is-${buttonLevel}`,
|
|
5179
|
+
title: `${sourceText}记忆权限:${scopeCountText} · ${buttonLevelLabel}`,
|
|
5180
|
+
'aria-label': `${sourceText}记忆权限,${scopeCountText},${buttonLevelLabel}`,
|
|
5181
|
+
'aria-expanded': open,
|
|
5182
|
+
onMouseDown: (event) => { try { event.preventDefault() } catch { /* keepFocus */ } },
|
|
5183
|
+
onClick: toggle,
|
|
5184
|
+
},
|
|
5185
|
+
h(NavLineIcon, { size: 14 }),
|
|
5186
|
+
data === null ? null : h('span', null, String(accessibleCount)),
|
|
5187
|
+
),
|
|
5188
|
+
popover === null
|
|
5189
|
+
? null
|
|
5190
|
+
: (createPortal !== null && portalTarget !== null ? createPortal(popover, portalTarget) : popover),
|
|
5135
5191
|
)
|
|
5136
5192
|
}
|
|
5137
5193
|
/**
|