dsh-tiddlywiki 0.28.8 → 0.28.9
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 +2 -0
- package/docs/CHANGELOG.md +1 -0
- package/lib/client.js +60 -0
- package/package.json +1 -1
- package/src/client/styles.ts +60 -0
package/README.md
CHANGED
|
@@ -67,7 +67,9 @@ dsh plugin --profile web add dsh-tiddlywiki
|
|
|
67
67
|
|
|
68
68
|
## 🕘 版本记录
|
|
69
69
|
|
|
70
|
+
- **v0.28.9**(2026-09-28):**修「点击图标没有正常弹出」**(作者重启后实测报障)。根因:v0.28.8 的图标弹层只写了 DOM 与接线,**`styles.ts` 里一条 CSS 都没有** —— 弹层照样被 append 到 `document.body`,但它是个无宽高约束的裸块、压在页面底部,视觉上就是「点了没反应」。现在补齐 `.dsh-tw-iconpicker`(含 `position:fixed`——它挂在 body 上,用 absolute 会被页面滚动带走)、8 列网格、格子(含当前项高亮)、分页器与按钮图标位共 12 条规则。**守门一并补强**:`verify-wiki-focus.mjs` 原先只断言「TS 源码里出现过 `dsh-tw-iconpicker` 这个字符串」—— 而 class 名当然会出现在 TS 里(它是 `make()` 的参数),所以组件没样式也照样绿。现在改为**双向**断言:弹层/网格/格子/分页器必须真有 CSS 规则,且 **picker 里 `make()` 出来的每个 `dsh-tw-*` 类都必须在 `styles.ts` 里有下落**(下次再加子元素忘写 CSS 会当场变红)。新断言已反向验证(删掉那段 CSS → 红)。顺带被这条新守门抓出第二处漏写:按钮文字位 `.dsh-tw-settings-iconbtn-label` 也没样式。教训:**断言「某个类名存在」不等于断言「这个组件可用」** —— 渲染型组件的守门至少要跨两个文件,一个说"我生成了这个 DOM",一个说"这个 DOM 有样式"。
|
|
70
71
|
- **v0.28.8**(2026-09-28):**多库第五批反馈:图标真能用了、设置页分页了、新会话也能选库了 + 拆大文件**(12 条反馈一次做完)。① **图标选择器用上 DSH 官方图标系统** —— 从 8 个手绘图标扩到 **36 个官方图标**(内联的是上游 path 数据:客户端是纯 DOM、零运行时依赖)+ 8 个自绘 + 一组 emoji,弹出网格 **48 个一页**分页。② **修「选了图标立刻变回默认」** —— 根因在 `/admin/wikis` 的**读取视图漏了 `icon` 字段**:写进去了、读回来是 `undefined`,客户端拿它重渲染就回落默认,看起来完全像"没保存"。补上该字段,并加**源码级守门**钉死它(去掉修复即红)。③ **多库下设置页分页**:十几块面板挤一页既分不清"改这个库"还是"改整个插件"、改完也没有退出口 —— 现在分「**总览 / 本库配置 / 全局**」三个 tab,「插件管理 / 主题管理 / 语言管理 / 初始化」这些 per-库面板**只在点了某个库的「配置」之后**才出现,按钮变成「**退出配置**」;单库安装没有 tab 条,逐字不变。④ **新会话也能选知识库**:选择器此前只长在输入框上方(新会话还没有输入框),现在挂在预设/模式选择旁边 —— 声明感知注入 + 2 秒回落 + `blankOnly`,两种布局不会同时出现两个。⑤ **剪藏可指定落哪个库**(`bridge.wiki`,设置页下拉,留空 = 默认库)。⑥ **回复流卡片、会话「知识库」Tab 按会话作用域取数**:不这样做会出现"A 库的标题在 B 库里渲染成空白卡片"。⑦ **桌面版能起 TW 了**:`process.execPath` 在桌面版里是 Electron,TW 根本起不来 —— 现在按 `DSH_TIDDLYWIKI_NODE` → `where/which node` → `execPath` 解析并缓存,行为级守门进 `verify:unit`。⑧ **代码清理**:`tools.ts` 1913→132、`admin.ts` 1265→24、`index.ts` 1407→1001、`note-widget.ts` 1245→916、`settings-page.ts` 1815→400(全部**纯搬移**,注册顺序与装配顺序逐字保持),并新增 `scripts/lib/source-family.mjs` 让 12 个守门按「模块族」读源码 —— 以后纯搬迁不会再假红。⑨ **复核确认无需改动的两条**:注入提示词本来就是**按会话求值**的(换库后下一步即生效,且读的是那个库自己的 `prompt.*`),15 个工具在多库下全部正常(回执在可见库 >1 时标明库名)。全链路复跑:`typecheck` / `verify:static` / `verify:unit` / `verify:e2e` / `verify:large` 全绿(含真起两个 TW 子进程、3100 条大库 64s)。
|
|
72
|
+
① **图标选择器用上 DSH 官方图标系统** —— 从 8 个手绘图标扩到 **36 个官方图标**(内联的是上游 path 数据:客户端是纯 DOM、零运行时依赖)+ 8 个自绘 + 一组 emoji,弹出网格 **48 个一页**分页。② **修「选了图标立刻变回默认」** —— 根因在 `/admin/wikis` 的**读取视图漏了 `icon` 字段**:写进去了、读回来是 `undefined`,客户端拿它重渲染就回落默认,看起来完全像"没保存"。补上该字段,并加**源码级守门**钉死它(去掉修复即红)。③ **多库下设置页分页**:十几块面板挤一页既分不清"改这个库"还是"改整个插件"、改完也没有退出口 —— 现在分「**总览 / 本库配置 / 全局**」三个 tab,「插件管理 / 主题管理 / 语言管理 / 初始化」这些 per-库面板**只在点了某个库的「配置」之后**才出现,按钮变成「**退出配置**」;单库安装没有 tab 条,逐字不变。④ **新会话也能选知识库**:选择器此前只长在输入框上方(新会话还没有输入框),现在挂在预设/模式选择旁边 —— 声明感知注入 + 2 秒回落 + `blankOnly`,两种布局不会同时出现两个。⑤ **剪藏可指定落哪个库**(`bridge.wiki`,设置页下拉,留空 = 默认库)。⑥ **回复流卡片、会话「知识库」Tab 按会话作用域取数**:不这样做会出现"A 库的标题在 B 库里渲染成空白卡片"。⑦ **桌面版能起 TW 了**:`process.execPath` 在桌面版里是 Electron,TW 根本起不来 —— 现在按 `DSH_TIDDLYWIKI_NODE` → `where/which node` → `execPath` 解析并缓存,行为级守门进 `verify:unit`。⑧ **代码清理**:`tools.ts` 1913→132、`admin.ts` 1265→24、`index.ts` 1407→1001、`note-widget.ts` 1245→916、`settings-page.ts` 1815→400(全部**纯搬移**,注册顺序与装配顺序逐字保持),并新增 `scripts/lib/source-family.mjs` 让 12 个守门按「模块族」读源码 —— 以后纯搬迁不会再假红。⑨ **复核确认无需改动的两条**:注入提示词本来就是**按会话求值**的(换库后下一步即生效,且读的是那个库自己的 `prompt.*`),15 个工具在多库下全部正常(回执在可见库 >1 时标明库名)。全链路复跑:`typecheck` / `verify:static` / `verify:unit` / `verify:e2e` / `verify:large` 全绿(含真起两个 TW 子进程、3100 条大库 64s)。
|
|
71
73
|
- **v0.28.7**(2026-09-28):**会话知识库选择器改成与「快速笔记」同一行 + 单库专属配置项不再在多库下出现**(两条都是作者报障)。① **选择器"没和对话框对齐"** —— 上次的修法方向就错了:`conversation.input.dock` 是**竖向 flex 列,一个条目独占一整行**,选择器和快速笔记是**两个条目**时永远是上下两行,怎么调内边距都不可能并排。现在选择器不再是独立条目,而是由快速笔记条目通过 `scope` 参数渲染在**自己这一行里**(按钮前面),整行统一与输入框右缘对齐,一行只测一次。顺手修掉合并时的一处遗留:选择器组件里还留着上一版的 `alignDockEntry` 自测,并入同一行后会把右内边距补两遍——已移除(`wiki-scope` 也从客户端 slot 表里消失,回归由 `verify-wiki-focus.mjs` 断言"input.dock 只能有一个条目"守住)。② **「侧边栏 TW 入口显示名称」在多库下不该出现** —— 多库时侧边栏是每个库各占一行、各用自己 `wikis.json` 里的显示名,`ui.sidebarLabel` 只喂单库那一行,所以多库下它是个**改了不生效的假配置项**。现在该字段只在单库模式渲染(多库时换成一行说明"去知识库列表改各自的显示名");模式探测失败**回落成单库**(保守:宁可多给一个真能用的字段,也不要因为一次请求失败把设置项藏了),并反向断言不许写成 `!== 'single'`(那会把未知模式误判成多库)。两条守门断言都做了反向验证。
|
|
72
74
|
- **v0.28.6**(2026-09-28):**修两个多库界面的真机报障**。① **「插件管理 / 主题管理 / 语言包 / 初始化」看起来是混在一起管理的** —— 宿主侧一直是 per-request 解析目标库的(`deps.server(req)`/`config(req)`/`getClient(req)`),缺的是**客户端那一半**:设置页只有 `state`/`config`/`prompt` 三处带上了 `?wiki=`,而**插件信息与初始化 seed 的调用没带**,于是它们永远落在默认库上,「切了库、面板内容却没变」。现在 7 个 per-wiki 端点全部经 `withWiki()`,并有守门逐个断言(去掉任一处的作用域 → 红)。单库(未选库)时 `withWiki` 原样返回 URL,现有用户逐字不变。② **左侧入口点一个却三个都高亮** —— 我上一版把「面板是共享的」错解成「所有行一起高亮」,但面板一次只显示一个库(当前焦点库)。现在只有那一行点亮,并订阅焦点变化重算;单库默认行在面板打开时仍正常高亮。两条守门断言都做了反向验证。
|
|
73
75
|
- **v0.28.5**(2026-09-28):**修「多库模式下侧边栏多出一个没有库名的 `TiddlyWiki` 入口」**(作者报障)。根因是**同一个 CSS 陷阱踩了第 12 次**:`hidden` 属性在 CSS 里只是 `display:none`,而 `.dsh-tw-entry` 有显式 `display:flex` —— **显式 display 盖掉了 hidden**,于是那行让位给每库入口的默认行照样渲染。这次不再给它单独补一条规则,而是**收敃成一条全局兜底** `[hidden] { display: none !important; }`,并删掉本仓库历史上为此在不同元素上各补的 **12 条逐元素规则**(面板 iframe / 错误块 / 快速笔记 / FAB 菜单与提示 / 右侧栏 / 目标库下拉 / 草稿栏 / 最近列表…)。守门同时改为断言「全局兜底存在 + 不允许再出现逐元素版本」,并反向验证(把全局规则改成挂在类名下 → 红)。
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> 最近几个主要版本的一句话记录(完整变更见 [Releases](https://github.com/bbqisbbq/dsh-tiddlywiki/releases) / git log)。
|
|
6
6
|
|
|
7
|
+
- **v0.28.9**(2026-09-28):**修「点击图标没有正常弹出」**(作者重启后实测报障)。本版只有一个修复,但值得单独发一版:它暴露的是**守门的失效模式**,不是普通的漏写。① **现象**:设置页知识库列表里点「图标」,弹层没有出现。② **根因**:v0.28.8 的 `settings-icon-picker.ts` 生成了完整 DOM(弹层 / 网格 / 格子 / 分页器)、接线也对,**但 `styles.ts` 里一条 CSS 都没有** —— 弹层照样被 append 到 `document.body`,而它是个无宽高约束的裸块、压在页面最底部,视觉上就等于「点了没反应」。③ **修复**:补齐 12 条规则 —— `.dsh-tw-iconpicker`(含 `position:fixed`:弹层挂在 body 上,用 absolute 会被页面滚动带走、也受祖先 overflow 影响)、`min(420px, 100vw-24px)` 宽度与 `max-height` 上限、8 列网格、格子悬停与当前项高亮、名称省略(8 列必须对齐)、分页器分隔线,以及按钮的图标位与文字位。④ **守门为什么没拦住(本版最重要的部分)**:`verify-wiki-focus.mjs` 原本断言的是 `assert.match(settings, /dsh-tw-iconpicker/)` —— 检查「TS 源码里出现过这个字符串」。但**类名当然会出现在 TS 里**(它是 `make('div', 'dsh-tw-iconpicker')` 的参数),所以组件一条 CSS 都没有时这条断言照样绿。**通用教训:断言「某个类名存在」不等于断言「这个组件可用」。** 渲染型组件的守门至少要跨两个文件——一个说「我生成了这个 DOM」,一个说「这个 DOM 有样式」。⑤ **新守门(双向)**:弹层 / 网格 / 格子 / 分页器四个类必须真有 CSS 规则;并且从 picker 源码里**解析出所有 `make()` 生成的 `dsh-tw-*` 类名**,逐个要求它们在 `styles.ts` 里有下落 —— 这条通用网能拦住「下次再加子元素、又忘了写 CSS」。**已反向验证**:删掉那段 CSS → 红;恢复 → 绿。⑥ **新守门当场抓出第二处漏写**:按钮的文字位 `.dsh-tw-settings-iconbtn-label` 同样没有样式。⑦ 复核:`typecheck` / `build`(`client.bundle.js` 701305 → **704155 字节**,并确认 CSS 真进了 bundle)/ `verify:static` / `verify:unit` / `verify:e2e` / `verify:large` 全绿。
|
|
7
8
|
- **v0.28.8**(2026-09-28):**多库第五批反馈(12 条一次做完)+ 拆大文件**。① **图标选择器接上 DSH 官方图标系统**(反馈 1)—— 从 8 个手绘图标扩到 **36 个官方图标**:没有 `require` 上游的 React 图标组件(客户端是纯 DOM,那样会引入运行时依赖、还会让改名对不上),而是把**上游的 path 数据内联**进 `src/client/wiki-icon.generated.ts`(由 `scripts/gen-wiki-icons.mjs` 生成,`scripts/extract-dsh-icons.mjs` 是取图素材的开发助手);实心图标(data / plugin / settings / dark)与线性图标分两套渲染。弹出网格 **48 个一页**分页,另有 8 个自绘图标与一组 emoji。守门断言 host↔client 的图标名单**双向完全一致**(少一个即红)。② **修「选了图标立刻变回默认」**(反馈 2)—— 根因是 `/admin/wikis` 的**读取视图漏了 `icon` 字段**(`buildWikisView()` 逐字段手写,加字段时漏了一处):写进 `wikis.json` 了,读回来是 `undefined`,客户端拿它重渲染就回落默认图标 —— 症状"完全像没保存"。补上 `...(entry.icon !== undefined ? { icon: entry.icon } : {})`,并加**源码级守门**钉死该字段(去掉修复即红)。③ **多库下设置页按作用域分页**(反馈 3/4/11)—— 十几块面板挤一页,既分不清「改这个库」还是「改整个插件」,改完也找不到退出口。现在分「**总览 / 本库配置 / 全局**」三个 tab;「插件管理(自带官方插件)/ 主题管理 / 语言管理 / 初始化」这些 **per-库** 面板只在你点了某个库那一行的「配置」之后才出现(此前它们和全局项混排,看着像所有库共用一个设置);「配置」按钮变成**开关**(再点 = 退出配置),顶部「配置作用域」条一直显示正在改哪个库。**单库安装没有 tab 条**,就是原来那一页。④ **新会话也能选知识库**(反馈 9)—— 选择器此前只长在 `conversation.input.dock`(新会话还没有输入框)。现在挂在**预设/模式选择旁边**:先声明式探测 `conversation.input.selector.context`,2 秒内没等到就回落到 dock,两条路径带 `blankOnly` 互斥,不会同时出现两个。⑤ **剪藏可指定落哪个库**(反馈 8)—— 新增 `bridge.wiki` 配置与设置页下拉(留空 = 默认库)。剪藏来自浏览器书签、没有"当前会话"可以跟随,所以这里必须是**显式钉死**;填了不存在的 id 时 `/clip` 回执会带 `wiki` 字段说明实际落点,插件日志也提示一次。⑥ **回复流卡片与会话「知识库」Tab 按会话作用域取数**(反馈 7/10)—— 卡片取数 / 链接 / 缓存 key / 汇总的存在性探测与渲染全部带上会话作用域的那个库;不这样做会出现"A 库的笔记标题在 B 库里渲染成空白卡片"。工具卡片右上角还会显示库名徽标。⑦ **桌面版能起 TW**(反馈 12)—— TW 子进程需要真正的 `node`,而桌面版里 `process.execPath` 是 Electron。现在按 `DSH_TIDDLYWIKI_NODE` → `where node` / `which node` → `process.execPath` 的顺序解析并缓存,启动日志写明用了哪个;新增 `scripts/verify-desktop-node.mjs` 做**行为级**断言(进 `verify:unit`)。⑧ **复核后确认无需改动的两条**:注入提示词**本来就是按会话求值**的(`systemPrompt.section` 的 text 是函数,DSH 每次装配传入该会话的 agent,插件据此读作用域库的 `prompt.*`)—— 在输入框上方换库,**下一步**就生效,不需要重启或新开会话;15 个 `tiddlywiki_*` 工具在多库下全部正常(可见库 >1 时每条回执由一处包装统一标明库名)。单库安装两条都是逐字节不变。⑨ **代码清理**(反馈 5)—— `tools.ts` 1913→132、`admin.ts` 1265→24(barrel)、`index.ts` 1407→1001、`note-widget.ts` 1245→916、`settings-page.ts` 1815→400,**全部纯搬移**(15 个工具的注册顺序、`apply()` 的装配顺序、所有注释与字符串逐字保持)。配套新增 `scripts/lib/source-family.mjs`:`readFamily()` 把 `<base>.ts` 与 `<base>-*.ts` 拼成一份文本,12 个守门脚本改用它 —— **以后纯搬迁不再假红**(断言的是"规则"而不是"路径")。`verify-frame-guards` 的 runSwitch 断言跟着新形状更新(`disposed` → `deps.isDisposed()`),并顺手收紧成必须命中**那一条**消息(旁边 `repointDefault` 的「已取消修改」曾因前缀相同而误判通过),两条都做了反向验证。⑩ **文档**:`docs/usage.md` 补 `bridge.wiki` / 设置页分页 / 新会话选择器 / 每个库一个图标 / 桌面版 node;`docs/features.md` 补四条能力;README 顶部版本记录同步。**验证**:`npx tsc --noEmit` 全绿、`npm run build` OK(`client.bundle.js` 701305 字节 / 684.9 KB,远低于 900KB 闸门)、`verify:static` / `verify:unit`(26 个脚本)/ `verify:e2e` / `verify:large` 全绿(含 `WIKI FARM BOOT` 真起两个 TW 子进程、`LARGE WIKI` 3100 条 64s)。
|
|
8
9
|
- **v0.28.7**(2026-09-28):**会话知识库选择器改成与「快速笔记」同一行 + 单库专属配置项不再在多库下出现**(两条都是作者报障)。① **选择器"没和对话框对齐"** —— 上次的修法方向就错了:`conversation.input.dock` 是**竖向 flex 列,一个条目独占一整行**,选择器和快速笔记是**两个条目**时永远是上下两行,怎么调内边距都不可能并排。现在选择器不再是独立条目,而是由快速笔记条目通过 `scope` 参数渲染在**自己这一行里**(按钮前面),整行统一与输入框右缘对齐,一行只测一次。顺手修掉合并时的一处遗留:选择器组件里还留着上一版的 `alignDockEntry` 自测,并入同一行后会把右内边距补两遍——已移除(`wiki-scope` 也从客户端 slot 表里消失,回归由 `verify-wiki-focus.mjs` 断言"input.dock 只能有一个条目"守住)。② **「侧边栏 TW 入口显示名称」在多库下不该出现** —— 多库时侧边栏是每个库各占一行、各用自己 `wikis.json` 里的显示名,`ui.sidebarLabel` 只喂单库那一行,所以多库下它是个**改了不生效的假配置项**。现在该字段只在单库模式渲染(多库时换成一行说明"去知识库列表改各自的显示名");模式探测失败**回落成单库**(保守:宁可多给一个真能用的字段,也不要因为一次请求失败把设置项藏了),并反向断言不许写成 `!== 'single'`(那会把未知模式误判成多库)。两条守门断言都做了反向验证。
|
|
9
10
|
- **v0.28.6**(2026-09-28):**修两个多库界面的真机报障**。① **「插件管理 / 主题管理 / 语言包 / 初始化」看起来是混在一起管理的** —— 宿主侧一直是 per-request 解析目标库的(`deps.server(req)`/`config(req)`/`getClient(req)`),缺的是**客户端那一半**:设置页只有 `state`/`config`/`prompt` 三处带上了 `?wiki=`,而**插件信息与初始化 seed 的调用没带**,于是它们永远落在默认库上,「切了库、面板内容却没变」。现在 7 个 per-wiki 端点全部经 `withWiki()`,并有守门逐个断言(去掉任一处的作用域 → 红)。单库(未选库)时 `withWiki` 原样返回 URL,现有用户逐字不变。② **左侧入口点一个却三个都高亮** —— 我上一版把「面板是共享的」错解成「所有行一起高亮」,但面板一次只显示一个库(当前焦点库)。现在只有那一行点亮,并订阅焦点变化重算;单库默认行在面板打开时仍正常高亮。两条守门断言都做了反向验证。
|
package/lib/client.js
CHANGED
|
@@ -828,6 +828,66 @@ html[data-dsh-tw-active] .dshDesktopConversationSurface > :not([data-dsh-tw-view
|
|
|
828
828
|
}
|
|
829
829
|
.dsh-tw-settings-scopebar-label { font-size: 12px; font-weight: 600; color: var(--dsw-alias-label-primary, #222); }
|
|
830
830
|
.dsh-tw-settings-scopebar-exit { margin-left: auto; }
|
|
831
|
+
|
|
832
|
+
/* ── 每库图标:按钮 + 弹出式分页网格(v0.28.8,反馈 1/2)──────────────────
|
|
833
|
+
⚠️ 这一段的缺席曾是真实缺陷(见下):选择器的 DOM 与守门都到位了,唯独 CSS
|
|
834
|
+
没写 —— 于是弹层以「无样式块」的形式挂在 document.body 底部,视觉上等于
|
|
835
|
+
"点了没反应"。修复时连同守门一起补:verify-wiki-focus 现在断言本节存在,
|
|
836
|
+
而不只是断言 TS 里出现过那几个类名字符串(那正是当初漏掉的原因)。
|
|
837
|
+
|
|
838
|
+
弹层 append 到 document.body(不受祖先 overflow 裁剪),所以定位必须用
|
|
839
|
+
position:fixed —— 相对 body 的 absolute 会被页面滚动带走。 */
|
|
840
|
+
.dsh-tw-settings-iconbtn {
|
|
841
|
+
display: inline-flex; align-items: center; gap: 6px;
|
|
842
|
+
}
|
|
843
|
+
.dsh-tw-settings-iconbtn-face {
|
|
844
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
845
|
+
width: 16px; height: 16px; flex: 0 0 auto;
|
|
846
|
+
}
|
|
847
|
+
.dsh-tw-settings-iconbtn-face > svg { width: 16px; height: 16px; display: block; }
|
|
848
|
+
.dsh-tw-settings-iconbtn-label { font-size: 12px; }
|
|
849
|
+
.dsh-tw-iconpicker {
|
|
850
|
+
position: fixed; z-index: 60;
|
|
851
|
+
width: min(420px, calc(100vw - 24px));
|
|
852
|
+
max-height: min(70vh, 420px); overflow: auto;
|
|
853
|
+
padding: 10px; border-radius: 12px;
|
|
854
|
+
border: 1px solid var(--dsw-alias-border-l2, rgba(0,0,0,.18));
|
|
855
|
+
background: var(--dsw-alias-bg-layer-1, #fff);
|
|
856
|
+
color: var(--dsw-alias-label-primary, #222);
|
|
857
|
+
box-shadow: 0 8px 28px rgba(0,0,0,.22);
|
|
858
|
+
}
|
|
859
|
+
.dsh-tw-iconpicker-grid {
|
|
860
|
+
display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px;
|
|
861
|
+
}
|
|
862
|
+
.dsh-tw-iconpicker-cell {
|
|
863
|
+
display: flex; flex-direction: column; align-items: center; gap: 3px;
|
|
864
|
+
padding: 6px 2px; border-radius: 8px; cursor: pointer; font: inherit;
|
|
865
|
+
border: 1px solid transparent; background: transparent; color: inherit;
|
|
866
|
+
min-width: 0;
|
|
867
|
+
}
|
|
868
|
+
.dsh-tw-iconpicker-cell:hover {
|
|
869
|
+
background: var(--dsw-alias-interactive-bg-hover, rgba(128,128,128,.12));
|
|
870
|
+
}
|
|
871
|
+
.dsh-tw-iconpicker-cell[data-current='true'] {
|
|
872
|
+
border-color: var(--dsw-alias-border-l2, rgba(0,0,0,.3));
|
|
873
|
+
background: var(--dsw-alias-bg-layer-2, rgba(0,0,0,.06));
|
|
874
|
+
}
|
|
875
|
+
.dsh-tw-iconpicker-face {
|
|
876
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
877
|
+
width: 20px; height: 20px;
|
|
878
|
+
}
|
|
879
|
+
.dsh-tw-iconpicker-face > svg { width: 20px; height: 20px; display: block; }
|
|
880
|
+
/* 名称是第二信息:长了就省略,绝不让它把格子撑开(8 列必须对齐)。 */
|
|
881
|
+
.dsh-tw-iconpicker-name {
|
|
882
|
+
font-size: 10px; line-height: 1.2; max-width: 100%;
|
|
883
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
884
|
+
color: var(--dsw-alias-label-secondary, #666);
|
|
885
|
+
}
|
|
886
|
+
.dsh-tw-iconpicker-pager {
|
|
887
|
+
display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
|
888
|
+
margin-top: 8px; padding-top: 8px;
|
|
889
|
+
border-top: 1px solid var(--dsw-alias-border-l2, rgba(0,0,0,.12));
|
|
890
|
+
}
|
|
831
891
|
`;function d(){if(typeof document>`u`)return()=>{};let e=document.getElementById(l);e===null?(e=document.createElement(`style`),e.id=l,e.dataset.plugin=`dsh-tiddlywiki`,e.textContent=u,document.head.append(e)):e.textContent!==u&&(e.textContent=u);let t=String(Date.now())+`:`+Math.random().toString(36).slice(2);return e.dataset.instance=t,()=>{e?.dataset.instance===t&&e.remove()}}var f=class{open=!1;listeners=new Set;isOpen(){return this.open}toggle(){this.set(!this.open)}openPanel(){this.set(!0)}closePanel(){this.set(!1)}set(e){if(this.open!==e){this.open=e;for(let t of[...this.listeners])t(e)}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}};const p=`/dsh-tiddlywiki`,m=`${p}/tw/`,h=`${p}/status`,g=`${p}/get`,_=`${p}/render`,v=`${p}/note`,y=`${p}/edit`,b=`${p}/tags`,x=`${p}/recent`,S=`${p}/search`,C=`${p}/upload`,ee=`${p}/sync`,te=`${p}/restart`,ne=`${p}/session/summary`,re=`${p}/admin/state`,ie=`${p}/admin/prompt`,w=`${p}/admin/info`,ae=`${p}/admin/config`,T=`${p}/admin/restart`,E=`${p}/admin/seeds`,oe=`${p}/admin/seeds/run`,se=`${p}/admin/seeds/remove`,D=`${p}/admin/wiki/location`,ce=`${p}/admin/wiki/switch`,le=`${p}/admin/wiki/reset`,ue=`${p}/admin/wikis`,O=`${p}/session/wiki`;function de(e,t){let n=typeof location>`u`?``:location.protocol,r=typeof location>`u`?void 0:location.origin;return n!==`http:`&&n!==`https:`&&typeof t==`string`&&t.length>0?t:new URL(e,r).href}function fe(e,t,n,r){if(e!==`multi`||typeof t!=`string`||t.length===0)return{relative:n,...r===void 0?{}:{absolute:r}};let i=`${encodeURIComponent(t)}/`;return{relative:`${n}${i}`,...r===void 0?{}:{absolute:`${r}${i}`}}}function pe(e,t){return typeof t!=`string`||t.length===0?e:`${e}${e.includes(`?`)?`&`:`?`}wiki=${encodeURIComponent(t)}`}function me(e,t){if(e===null||e.ok!==!0)return{ok:!1,message:e?.error??e?.message??`HTTP ${t}`};let n=``;return typeof e.push==`string`&&e.push.length>0&&e.push!==`nothing to commit`&&(n=`(${e.push})`),e.changed===!0&&(n+=e.restarted===!0?`,TW 已重启`:`,TW 未自动重启`,typeof e.restartError==`string`&&e.restartError.length>0&&(n+=`(${e.restartError})`)),{ok:!0,message:`${e.message??`OK`}${n}`}}let he;function ge(){if(he!==void 0&&Date.now()-he.at<2e3)return he.value;let e=(async()=>{try{let e=await fetch(h,{signal:AbortSignal.timeout(8e3)});return e.ok?await e.json():null}catch{return null}})();return he={at:Date.now(),value:e},e.then(t=>{t===null&&he?.value===e&&(he=void 0)}),e}function _e(){he=void 0}const ve={showQuickNoteDock:!0,quickNoteMode:`native`,sidebarLabel:`TiddlyWiki`,tabLabel:`知识库`,showSessionTab:!0,showRightbarTab:!0,showQuickNote:!0,showPanelStatus:!0,showSyncButton:!0};let ye;const be=new Set;function xe(e){return be.add(e),()=>{be.delete(e)}}function Se(){ye=void 0,_e();for(let e of[...be])e()}function Ce(){if(ye!==void 0&&Date.now()-ye.at<15e3)return ye.value;let e=(async()=>{let e=await ge(),t=e?.ui;return e===null||t===void 0?ve:{showQuickNoteDock:t.showQuickNoteDock!==!1,quickNoteMode:t.quickNoteMode===`card`?`card`:`native`,sidebarLabel:typeof t.sidebarLabel==`string`&&t.sidebarLabel.trim().length>0?t.sidebarLabel.trim():`TiddlyWiki`,tabLabel:typeof t.tabLabel==`string`&&t.tabLabel.trim().length>0?t.tabLabel.trim():`知识库`,showSessionTab:t.showSessionTab!==!1,showRightbarTab:t.showRightbarTab!==!1,showQuickNote:t.showQuickNote!==!1,showPanelStatus:t.showPanelStatus!==!1,showSyncButton:t.showSyncButton!==!1}})();return ye={at:Date.now(),value:e},e}const we=`dsh-tiddlywiki.focusWiki`;function Te(){try{let e=window.localStorage.getItem(we);return e!==null&&e.length>0?e:void 0}catch{return}}let Ee=Te();const De=new Set;function Oe(){return Ee}function ke(e){if(e!==Ee){Ee=e;try{e===void 0?window.localStorage.removeItem(we):window.localStorage.setItem(we,e)}catch{}for(let t of[...De])t(e)}}function Ae(e){return De.add(e),()=>{De.delete(e)}}function je(e,t){return e.length===0||Ee!==void 0&&e.some(e=>e.id===Ee)?Ee:t!==void 0&&e.some(e=>e.id===t)?t:e[0]?.id}const Me=[`data`,`plugin`,`settings`,`dark`],Ne={archive:`<path d="M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 5.05228 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"/><path d="M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"/><path d="M6.5 9.5H9.5"/>`,"archive-check":`<path d="M2.95 5.7v4.8a2.9 2.9 0 0 0 2.9 2.9h4.3a2.9 2.9 0 0 0 2.9-2.9V5.7"/><path d="m6 9.35 1.4 1.4 2.6-2.6"/>`,"archive-off":`<path d="m2.2 1.3 11.6 12.8"/><path d="M2.95 5.7v4.8a2.9 2.9 0 0 0 2.9 2.9h4.3a2.9 2.9 0 0 0 2.9-2.9V5.7"/><path d="m2.2 1.3 11.6 12.8"/>`,unarchive:`<path d="M15.8659 2.05975C17.2603 2.05995 18.3913 3.19096 18.3914 4.58527V5.4874C18.3914 6.02747 18.2192 6.52672 17.9303 6.93735C17.9336 6.96524 17.9388 6.99318 17.9388 7.02195V12.8884C17.9388 13.6345 17.9395 14.2379 17.8996 14.7254C17.8642 15.1593 17.7936 15.5499 17.6373 15.9141L17.5654 16.0685C17.278 16.6328 16.8405 17.1046 16.3038 17.434L16.0679 17.5661C15.66 17.7739 15.2196 17.8598 14.7237 17.9003C14.2362 17.9401 13.6327 17.9405 12.8867 17.9405H7.11122C6.36511 17.9405 5.76171 17.9401 5.27418 17.9003C4.84051 17.8649 4.44949 17.7952 4.08545 17.6391L3.93104 17.5661C3.36673 17.2785 2.89392 16.8414 2.56465 16.3044L2.43245 16.0685C2.22473 15.6608 2.13878 15.2211 2.09825 14.7254C2.05841 14.2379 2.05912 13.6345 2.05912 12.8884V7.02195C2.05912 6.99284 2.06422 6.96449 2.06758 6.93629C1.77931 6.52592 1.60858 6.02687 1.60858 5.4874V4.58527C1.60876 3.19084 2.73962 2.05975 4.1341 2.05975H15.8659ZM16.4984 7.92936C16.296 7.98169 16.0847 8.01288 15.8659 8.01291H4.1341C3.91478 8.01291 3.70246 7.98194 3.49955 7.92936V12.8884C3.49955 13.6582 3.50053 14.1927 3.53445 14.608C3.56769 15.0146 3.62923 15.244 3.71635 15.415L3.7925 15.5514C3.98339 15.8627 4.25749 16.1165 4.58464 16.2833L4.72529 16.3435C4.88095 16.3993 5.08638 16.4402 5.39158 16.4651C5.80685 16.4991 6.34138 16.5001 7.11122 16.5001H12.8867C13.6564 16.5001 14.1911 16.499 14.6063 16.4651C15.0128 16.432 15.2423 16.3703 15.4133 16.2833L15.5508 16.2061C15.8618 16.0152 16.116 15.7419 16.2827 15.415L16.3429 15.2732C16.3985 15.1177 16.4396 14.9128 16.4645 14.608C16.4985 14.1927 16.4984 13.6583 16.4984 12.8884V7.92936ZM4.1341 3.50019C3.53511 3.50019 3.0492 3.98631 3.04902 4.58527V5.4874C3.04902 6.08649 3.535 6.57248 4.1341 6.57248H15.8659C16.4648 6.57228 16.951 6.08638 16.951 5.4874V4.58527C16.9509 3.98644 16.4647 3.50038 15.8659 3.50019H4.1341Z"/><path d="M10 14.1V10.1M7.85 12.05L10 9.9L12.15 12.05"/>`,database:`<path d="M13.1967 5.1869C13.7232 4.77378 14.0003 4.30517 14.0001 3.82819C14.0003 3.3512 13.7232 2.88259 13.1967 2.46947C12.6702 2.05635 11.9128 1.71328 11.0006 1.47475C10.0885 1.23621 9.05371 1.11062 8.00039 1.1106C6.94707 1.11057 5.9123 1.23612 5.00009 1.47461C4.08742 1.71301 3.32948 2.05604 2.80249 2.46919C2.2755 2.88235 1.99805 3.35106 1.99805 3.82819C1.99805 4.30531 2.2755 4.77402 2.80249 5.18718C3.32948 5.60033 4.08742 5.94336 5.00009 6.18176C5.9123 6.42025 6.94707 6.5458 8.00039 6.54578C9.05371 6.54575 10.0885 6.42016 11.0006 6.18163C11.9128 5.94309 12.6702 5.60002 13.1967 5.1869Z"/><path d="M2 3.80371V11.7848"/><path d="M14 3.80371V11.7848"/><path d="M2 7.81396C2 8.60524 2.63214 9.36411 3.75736 9.92363C4.88258 10.4832 6.4087 10.7975 8 10.7975C9.5913 10.7975 11.1174 10.4832 12.2426 9.92363C13.3679 9.36411 14 8.60524 14 7.81396"/><path d="M2 11.7847C2 12.6081 2.63214 13.3977 3.75736 13.98C4.88258 14.5622 6.4087 14.8893 8 14.8893C9.5913 14.8893 11.1174 14.5622 12.2426 13.98C13.3679 13.3977 14 12.6081 14 11.7847"/>`,data:`<path d="M7.8667 0.349609C8.96906 0.349634 10.0601 0.481272 11.0317 0.735352C11.9973 0.987845 12.8453 1.362 13.4644 1.84766C14.0744 2.32629 14.507 2.95539 14.5161 3.69336H14.5171V8.53516C14.0843 8.32076 13.6108 8.17679 13.1108 8.11816C13.1831 7.96848 13.2162 7.82856 13.2163 7.70312V5.76758C12.6269 6.16618 11.8739 6.47995 11.0317 6.7002C10.0602 6.95423 8.96896 7.08494 7.8667 7.08496C6.76461 7.08493 5.67411 6.95415 4.70264 6.7002C3.85994 6.48006 3.10694 6.1662 2.51709 5.76758V7.70312L2.521 7.78418C2.56374 8.19554 2.93361 8.74414 3.91357 9.23145C4.9281 9.73585 6.35004 10.0371 7.8667 10.0371C8.26373 10.0371 8.6543 10.0141 9.03271 9.97461C8.75596 10.3799 8.54664 10.8349 8.42041 11.3232C8.23666 11.3313 8.0518 11.3369 7.8667 11.3369C6.20108 11.3369 4.57025 11.01 3.33447 10.3955C3.04163 10.2499 2.76658 10.0836 2.51709 9.90039V11.6738C2.51728 12.1379 2.88589 12.7556 3.92236 13.292C4.93457 13.8157 6.35342 14.1289 7.8667 14.1289C8.12318 14.1289 8.37694 14.1161 8.62646 14.0986C8.82021 14.5535 9.08999 14.9682 9.41943 15.3271C8.91285 15.3934 8.39149 15.4287 7.8667 15.4287C6.19761 15.4287 4.56379 15.0869 3.32568 14.4463C2.11244 13.8185 1.21649 12.8562 1.21631 11.6738V3.76367C1.21595 3.74853 1.21438 3.733 1.21436 3.71777C1.21436 2.96917 1.65103 2.33053 2.26807 1.84668C2.88747 1.36112 3.73675 0.987685 4.70264 0.735352C5.67413 0.481376 6.76457 0.349636 7.8667 0.349609ZM7.8667 1.65039C6.86269 1.65042 5.88326 1.77028 5.03076 1.99316C4.17183 2.2176 3.50421 2.52956 3.06982 2.87012C2.65043 3.19909 2.52622 3.48898 2.51709 3.69336V3.74414C2.52719 3.94845 2.65185 4.23772 3.06982 4.56543C3.50425 4.90601 4.17172 5.21795 5.03076 5.44238C5.88326 5.66527 6.8627 5.78513 7.8667 5.78516C8.8707 5.78513 9.85015 5.66525 10.7026 5.44238C11.5611 5.21787 12.2286 4.9049 12.6626 4.56445C13.0982 4.22252 13.2163 3.9231 13.2163 3.71777L13.2104 3.63574C13.1818 3.43623 13.044 3.16941 12.6626 2.87012C12.2286 2.52957 11.5614 2.21773 10.7026 1.99316C9.85009 1.77025 8.8708 1.65041 7.8667 1.65039Z"/><path d="M12.8936 10.0361L13.2061 10.5566C13.2296 10.5959 13.2651 10.6562 13.3027 10.707C13.3469 10.7666 13.4148 10.8431 13.5195 10.9023C13.6244 10.9617 13.725 10.9801 13.7988 10.9873C13.8619 10.9934 13.9318 10.9932 13.9775 10.9932H14.6162L14.8896 11.4502L14.5947 11.9443C14.5698 11.9859 14.5312 12.0483 14.5029 12.1084C14.4781 12.1611 14.4514 12.2312 14.4395 12.3164L14.4326 12.4072L14.4395 12.4971C14.4514 12.5825 14.4781 12.6532 14.5029 12.7061C14.5312 12.7661 14.5689 12.8287 14.5938 12.8701L14.8896 13.3633L14.6162 13.8213H13.9775C13.9318 13.8213 13.8619 13.821 13.7988 13.8271C13.7433 13.8326 13.6728 13.8442 13.5967 13.875L13.5195 13.9121C13.4148 13.9714 13.3469 14.0478 13.3027 14.1074C13.265 14.1583 13.2296 14.2186 13.2061 14.2578L12.8936 14.7783H12.3115L11.999 14.2578C11.9755 14.2186 11.9401 14.1583 11.9023 14.1074C11.8693 14.0628 11.823 14.0083 11.7578 13.959L11.6855 13.9121L11.6074 13.875C11.5316 13.8445 11.4615 13.8325 11.4062 13.8271C11.3432 13.821 11.2733 13.8213 11.2275 13.8213H10.5889L10.3135 13.3633L10.6104 12.8701C10.6352 12.8287 10.6739 12.7661 10.7021 12.7061C10.7352 12.6357 10.7724 12.534 10.7725 12.4072C10.7724 12.2804 10.7352 12.1788 10.7021 12.1084C10.6739 12.0483 10.6353 11.9859 10.6104 11.9443L10.3135 11.4502L10.5889 10.9932H11.2275C11.2733 10.9932 11.3432 10.9934 11.4062 10.9873C11.4801 10.9801 11.5808 10.9616 11.6855 10.9023C11.7903 10.843 11.8582 10.7666 11.9023 10.707C11.94 10.6562 11.9755 10.5959 11.999 10.5566L12.3115 10.0361H12.8936Z"/>`,folder:`<path d="M12.3994 13.5986H2.04956C1.49728 13.5986 1.04956 13.1509 1.04956 12.5986V3.40137C1.04956 2.84908 1.49728 2.40137 2.04956 2.40137H4.76632C5.01016 2.40137 5.24561 2.49046 5.42836 2.6519L6.94088 3.98799C7.12364 4.14943 7.35908 4.23852 7.60293 4.23852H12.3994C12.9517 4.23852 13.3994 4.68624 13.3994 5.23852V7.16991"/><path d="M2.55911 7.93683C2.67584 7.49906 3.07229 7.19446 3.52536 7.19446H13.6491C14.3061 7.19446 14.7846 7.81725 14.6153 8.45209L13.4411 12.856C13.3244 13.2938 12.9279 13.5984 12.4748 13.5984H2.35113C1.69411 13.5984 1.21562 12.9756 1.38489 12.3407L2.55911 7.93683Z"/>`,globe:`<path d="M7.99986 14.0887C11.3626 14.0887 14.0886 11.3627 14.0886 7.99998C14.0886 4.63727 11.3626 1.91125 7.99986 1.91125C4.63715 1.91125 1.91113 4.63727 1.91113 7.99998C1.91113 11.3627 4.63715 14.0887 7.99986 14.0887Z"/><path d="M2.34619 8H13.6538"/><path d="M7.99976 14.0889C9.23509 14.0889 10.1743 11.3629 10.1743 8.00006C10.1743 4.63739 9.23509 1.91138 7.99976 1.91138"/><path d="M7.99973 14.0889C6.76445 14.0889 5.8252 11.3629 5.8252 8.00006C5.8252 4.63739 6.76445 1.91138 7.99973 1.91138"/>`,branch:`<path d="M1.01503 8.0001L5.6964 8.0001C6.41913 8.0001 6.78049 8.0001 7.12115 7.91951C7.4232 7.84804 7.71233 7.73014 7.97821 7.57C8.27809 7.38939 8.5364 7.13669 9.05303 6.63129L11.3281 4.40564"/><path d="M1.01221 7.9999L5.6964 7.9999C6.41913 7.9999 6.78049 7.9999 7.12115 8.08049C7.4232 8.15196 7.71233 8.26986 7.97821 8.43C8.27809 8.61061 8.5364 8.86331 9.05303 9.36871L11.3281 11.5944"/><circle cx="12.4502" cy="3.3079" r="1.56962"/><circle cx="12.4502" cy="12.6921" r="1.56962"/>`,list:`<path d="M4.9375 5.90295H11.0625"/><path d="M4.9375 9.02991H8.27841"/><path d="M12.5 1.32617C13.3039 1.32617 14 1.95171 14 2.77637V7.61328L13 8.68164V2.77637C13 2.55186 12.8007 2.32617 12.5 2.32617H3.5C3.1993 2.32617 3 2.55186 3 2.77637V13.2246C3.00044 13.4489 3.19963 13.6738 3.5 13.6738H8.32812L7.39258 14.6738H3.5C2.69637 14.6738 2.00042 14.0489 2 13.2246V2.77637C2 1.95171 2.69613 1.32617 3.5 1.32617H12.5Z"/><path d="M8.97212 14.3693C9.17511 14.5723 9.37811 14.7753 9.5811 14.9783C9.67012 14.8953 9.75914 14.8123 9.84815 14.7293C11.4505 13.2352 13.0528 11.7411 14.6551 10.247C14.7441 10.164 14.8331 10.081 14.9221 9.99803C14.5989 9.6748 14.2756 9.35157 13.9524 9.02834C13.8694 9.11736 13.7864 9.20637 13.7034 9.29539C12.2093 10.8977 10.7152 12.5 9.22113 14.1023C9.13813 14.1913 9.05513 14.2803 8.97212 14.3693Z"/><path d="M11.6323 13.7841C11.6323 14.0395 11.6323 14.295 11.6323 14.5504C11.6812 14.5523 11.7301 14.5543 11.779 14.5562C12.659 14.5913 13.539 14.6263 14.419 14.6614C14.4679 14.6633 14.5168 14.6653 14.5657 14.6672C14.5657 14.3339 14.5657 14.0006 14.5657 13.6672C14.5168 13.6692 14.4679 13.6711 14.419 13.6731C13.539 13.7081 12.659 13.7432 11.779 13.7783C11.7301 13.7802 11.6812 13.7821 11.6323 13.7841Z"/>`,checklist:`<path d="M3.75 6.25C4.7165 6.25 5.5 5.4665 5.5 4.5C5.5 3.5335 4.7165 2.75 3.75 2.75C2.7835 2.75 2 3.5335 2 4.5C2 5.4665 2.7835 6.25 3.75 6.25Z"/><path d="M7.5 4.5H13.5"/><path d="M3.75 13.25C4.7165 13.25 5.5 12.4665 5.5 11.5C5.5 10.5335 4.7165 9.75 3.75 9.75C2.7835 9.75 2 10.5335 2 11.5C2 12.4665 2.7835 13.25 3.75 13.25Z"/><path d="M7.5 11.5H13.5"/>`,"flat-list":`<path d="M6 3.5h7.5M6 8h7.5M6 12.5h7.5"/><path d="M2.6 3.5h.01M2.6 8h.01M2.6 12.5h.01"/>`,skill:`<path d="M4.57788 5.77124H10.7029"/><path d="M4.57788 8.89819H7.91879"/><path d="M12.1404 1.19446C12.9442 1.19446 13.6404 1.81999 13.6404 2.64465V8.89856H12.6404V2.64465C12.6404 2.42015 12.4411 2.19446 12.1404 2.19446H3.14038C2.83968 2.19446 2.64038 2.42015 2.64038 2.64465V13.0929C2.64082 13.3172 2.84001 13.5421 3.14038 13.5421H8.88159V14.5421H3.14038C2.33675 14.5421 1.6408 13.9172 1.64038 13.0929V2.64465C1.64038 1.81999 2.33651 1.19446 3.14038 1.19446H12.1404Z"/><path d="M12.0051 15.1056C12.0051 13.6395 10.8166 12.451 9.35059 12.451C10.8166 12.451 12.0051 11.2626 12.0051 9.79651C12.0051 11.2626 13.1936 12.451 14.6597 12.451C13.1936 12.451 12.0051 13.6395 12.0051 15.1056Z"/>`,goal:`<path d="M14.5001 8C14.5 9.28552 14.1188 10.5422 13.4045 11.611C12.6903 12.6799 11.6752 13.5129 10.4875 14.0049C9.29982 14.4968 7.99295 14.6255 6.73212 14.3747C5.4713 14.124 4.31314 13.505 3.4041 12.596C2.49514 11.687 1.87614 10.5288 1.62537 9.26798C1.37459 8.00716 1.50331 6.70028 1.99525 5.51261C2.48719 4.32494 3.32025 3.30981 4.3891 2.59557C5.45795 1.88134 6.71458 1.50008 8.0001 1.5"/><path d="M11.5 8C11.5001 8.69227 11.2948 9.36901 10.9102 9.94463C10.5257 10.5202 9.97901 10.9689 9.33944 11.2338C8.69986 11.4987 7.99609 11.5681 7.31712 11.433C6.63816 11.2979 6.01449 10.9645 5.52501 10.475C5.03548 9.98552 4.70209 9.36185 4.56702 8.68289C4.43195 8.00392 4.50127 7.30015 4.76619 6.66057C5.03112 6.021 5.47976 5.47436 6.05538 5.08978C6.631 4.70519 7.30774 4.49995 8.00001 4.5"/><path d="M8.00024 7.99976L11.2 4.80005"/><path d="M12.4719 5.62245C12.4246 5.66972 12.3569 5.69025 12.2913 5.67715L10.7814 5.37555C10.7022 5.35972 10.6402 5.29781 10.6244 5.2186L10.3228 3.70866C10.3097 3.6431 10.3302 3.57533 10.3775 3.52806L12.1826 1.723C12.2863 1.61929 12.4627 1.65879 12.5122 1.79684L12.9271 2.95225C12.9472 3.00847 12.9915 3.05272 13.0477 3.07291L14.2031 3.48774C14.3412 3.5373 14.3807 3.71368 14.277 3.81739L12.4719 5.62245Z"/>`,compact:`<path d="M8 14.5C11.5899 14.5 14.5 11.5899 14.5 8C14.5 4.41015 11.5899 1.5 8 1.5C4.41015 1.5 1.5 4.41015 1.5 8C1.5 11.5899 4.41015 14.5 8 14.5Z"/><path d="M8 1.5C8.85359 1.5 9.69883 1.66813 10.4874 1.99478C11.2761 2.32144 11.9926 2.80022 12.5962 3.40381C13.1998 4.00739 13.6786 4.72394 14.0052 5.51256C14.3319 6.30117 14.5 7.14641 14.5 8"/>`,clock:`<path d="M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z"/><path d="M8 4.31V8.46L11 10.08"/>`,alarm:`<path d="M4.09372 11.9895L3.11865 14.0387"/><path d="M12.1392 11.9895L13.1143 14.0387"/><path d="M8.11646 4.78442V8.03442L10.6165 9.53442"/><path d="M8.11646 13.4094C11.154 13.4094 13.6165 10.947 13.6165 7.90942C13.6165 4.87186 11.154 2.40942 8.11646 2.40942C5.07889 2.40942 2.61646 4.87186 2.61646 7.90942C2.61646 10.947 5.07889 13.4094 8.11646 13.4094Z"/><path d="M1.75952 4.74323C2.30657 3.65639 3.12646 2.73047 4.12926 2.05542"/><path d="M14.3345 4.74323C13.7874 3.65639 12.9675 2.73047 11.9647 2.05542"/>`,pin:`<path d="M9.96976 1.70572L13.1554 3.93629L10.9019 8.12317L11.5158 11.605L10.7192 12.7427L2.52767 7.00693L3.3243 5.86922L6.80612 5.25528L9.96976 1.70572Z"/><path d="M6.05285 9.47511C6.27284 9.16094 6.70586 9.08458 7.02003 9.30457C7.3342 9.52455 7.41055 9.95757 7.19057 10.2717L3.98587 14.4708L3.21223 13.9291L6.05285 9.47511Z"/>`,shield:`<path d="M6.80132 2.14853C7.70663 1.80917 8.70422 1.80919 9.60952 2.14859L14.1296 3.84317V7.11961C14.1296 11.6089 10.7615 13.5975 8.20543 14.5779C5.64931 13.5975 2.28052 11.6089 2.28052 7.11961V3.84317L6.80132 2.14853Z"/>`,api:`<path d="M3 4L7 8L3 12"/><path d="M9 12H13"/>`,code:`<path d="M6.27612 1.5L4.52612 14.5"/><path d="M11.4739 1.5L9.72388 14.5"/><path d="M2.39868 5.5H14.0681"/><path d="M1.93188 10.5H13.6013"/>`,users:`<path d="M6 8.25C7.51878 8.25 8.75 7.01878 8.75 5.5C8.75 3.98122 7.51878 2.75 6 2.75C4.48122 2.75 3.25 3.98122 3.25 5.5C3.25 7.01878 4.48122 8.25 6 8.25Z"/><path d="M1 14.5C1 11.5 3.5 10.25 6 10.25C8.5 10.25 11 11.5 11 14.5"/><path d="M10.5 2.9C11.65 3.35 12.45 4.35 12.45 5.5C12.45 6.65 11.65 7.65 10.5 8.1"/><path d="M12.4 10.6C13.9 11.3 15 12.6 15 14.5"/>`,user:`<path d="M8 8.25C9.51878 8.25 10.75 7.01878 10.75 5.5C10.75 3.98122 9.51878 2.75 8 2.75C6.48122 2.75 5.25 3.98122 5.25 5.5C5.25 7.01878 6.48122 8.25 8 8.25Z"/><path d="M2.5 14.5C2.5 11.5 5.25 10.25 8 10.25C10.75 10.25 13.5 11.5 13.5 14.5"/>`,plugin:`<path d="M3.16143 6.59068L1.75205 8.00006L3.10619 9.35419L2.39908 10.0613L0.832948 8.49517C0.559581 8.2218 0.559582 7.77831 0.832948 7.50494L2.45432 5.88357L3.16143 6.59068ZM8.49511 15.1671C8.22176 15.4405 7.77826 15.4404 7.50489 15.1671L5.93461 13.5968L6.64172 12.8897L8 14.248L9.40938 12.8386L10.1165 13.5457L8.49511 15.1671ZM15.1671 7.50494C15.4403 7.7782 15.4401 8.22179 15.1671 8.49517L13.652 10.0102L12.9449 9.30309L14.248 8.00006L12.8897 6.64178L13.5968 5.93467L15.1671 7.50494ZM9.35414 3.10624L8 1.7521L6.69696 3.05514L5.98986 2.34803L7.50489 0.833003C7.77828 0.559981 8.22186 0.559752 8.49511 0.833003L10.0612 2.39913L9.35414 3.10624Z"/><circle cx="8" cy="8" r="1.76221"/>`,pinwheel:`<path d="M7.84457 5.06199C11.6605 4.93876 14.7962 6.14848 14.8484 7.76397C14.8875 8.97461 13.1838 10.0696 10.7215 10.5942"/><path d="M5.12742 8.07731C5.00419 4.26138 6.21391 1.12568 7.8294 1.07351C9.04004 1.03441 10.135 2.73808 10.6596 5.20037"/><path d="M8.02457 10.6802C4.20865 10.8034 1.07294 9.5937 1.02077 7.97821C0.981678 6.76758 2.68535 5.67262 5.14763 5.14798"/><path d="M10.7476 7.89535C10.8708 11.7113 9.66109 14.847 8.0456 14.8991C6.83496 14.9382 5.74 13.2346 5.21536 10.7723"/>`,gauge:`<path d="M3.4041 13.096C2.49514 12.187 1.87614 11.0288 1.62537 9.76798C1.37459 8.50716 1.50331 7.20028 1.99525 6.01261C2.48719 4.82494 3.32025 3.80981 4.3891 3.09557C5.45795 2.38134 6.71458 2.00008 8.0001 2C9.28563 2.00008 10.5423 2.38134 11.6111 3.09557C12.68 3.80981 13.513 4.82494 14.005 6.01261C14.4969 7.20028 14.6256 8.50716 14.3748 9.76798C14.1241 11.0288 13.5051 12.187 12.5961 13.096"/><path d="M8 8.49994L11.6114 4.88855"/><path d="M8 9.75C8.69036 9.75 9.25 9.19036 9.25 8.5C9.25 7.80964 8.69036 7.25 8 7.25C7.30964 7.25 6.75 7.80964 6.75 8.5C6.75 9.19036 7.30964 9.75 8 9.75Z"/>`,tree:`<path d="M14 12.05c0 .8-.65 1.45-1.46 1.45H3.46C2.65 13.5 2 12.85 2 12.05v-8.1c0-.8.65-1.45 1.46-1.45h2.4c.49 0 .94.24 1.21.65l.5.73c.27.4.73.65 1.21.65h3.76c.8 0 1.46.65 1.46 1.45v6.02Z"/><path d="M8.7 8.1v3M11.2 8.1v3"/>`,personalization:`<path d="M3.25 7.16357C3.20417 7.32247 3.17778 7.48993 3.17773 7.66357C3.17773 7.83698 3.20336 8.00486 3.24902 8.16357H1.85742V7.16357H3.25ZM14.1426 8.16357H6.71484C6.76052 8.00485 6.78613 7.837 6.78613 7.66357C6.78609 7.48991 6.75971 7.32249 6.71387 7.16357H14.1426V8.16357Z"/><path d="M9.1377 11.9092C9.08596 12.0666 9.05668 12.2344 9.05664 12.4092C9.05664 12.5838 9.08606 12.7518 9.1377 12.9092H1.85742V11.9092H9.1377ZM14.1426 12.9092H12.1816C12.2332 12.7519 12.2617 12.5838 12.2617 12.4092C12.2617 12.2345 12.2333 12.0666 12.1816 11.9092H14.1426V12.9092Z"/><path d="M9.1123 3.09106C9.06138 3.24865 9.03324 3.41653 9.0332 3.59106C9.0332 3.76549 9.06148 3.93355 9.1123 4.09106H1.85742V3.09106H9.1123ZM14.1426 4.09106H12.207C12.2578 3.93358 12.2861 3.76545 12.2861 3.59106C12.2861 3.41657 12.2579 3.24862 12.207 3.09106H14.1426V4.09106Z"/><circle cx="4.97065" cy="7.66401" r="1.35151"/><circle cx="10.6596" cy="12.4091" r="1.35151"/><circle cx="10.6596" cy="3.59101" r="1.35151"/>`,link:`<path d="M6.59961 9.40051C6.82779 9.6334 7.10015 9.81842 7.40074 9.94472C7.70132 10.071 8.02409 10.1361 8.35013 10.1361C8.67618 10.1361 8.99894 10.071 9.29953 9.94472C9.60011 9.81842 9.87247 9.6334 10.1007 9.40051L12.9015 6.59967C13.3658 6.13541 13.6266 5.50572 13.6266 4.84915C13.6266 4.19258 13.3658 3.56289 12.9015 3.09863C12.4372 2.63436 11.8075 2.37354 11.151 2.37354C10.4944 2.37354 9.86472 2.63436 9.40045 3.09863L9.05034 3.44873"/><path d="M9.40051 6.59959C9.17233 6.3667 8.89997 6.18169 8.59939 6.05538C8.2988 5.92907 7.97603 5.86401 7.64999 5.86401C7.32395 5.86401 7.00118 5.92907 6.70059 6.05538C6.40001 6.18169 6.12765 6.3667 5.89946 6.59959L3.09863 9.40043C2.63436 9.8647 2.37354 10.4944 2.37354 11.151C2.37354 11.8075 2.63436 12.4372 3.09863 12.9015C3.56289 13.3657 4.19258 13.6266 4.84915 13.6266C5.50572 13.6266 6.13541 13.3657 6.59967 12.9015L6.94978 12.5514"/>`,search:`<path d="M6.58727 11.8586C9.55061 11.8586 11.9529 9.45637 11.9529 6.49304C11.9529 3.5297 9.55061 1.12744 6.58727 1.12744C3.62394 1.12744 1.22168 3.5297 1.22168 6.49304C1.22168 9.45637 3.62394 11.8586 6.58727 11.8586Z"/><path d="M10.2991 10.3933L14.7783 14.8725"/>`,settings:`<path d="M8 9.75012C8.9665 9.75012 9.75 8.96662 9.75 8.00012C9.75 7.03362 8.9665 6.25012 8 6.25012C7.0335 6.25012 6.25 7.03362 6.25 8.00012C6.25 8.96662 7.0335 9.75012 8 9.75012Z"/><path d="M13.0107 7.79377C12.9505 7.89401 12.9205 7.94413 12.9205 7.99951C12.9205 8.0549 12.9505 8.10502 13.0106 8.20528L13.9849 9.83006C14.045 9.93029 14.0751 9.9804 14.0751 10.0358C14.0751 10.0911 14.045 10.1413 13.9849 10.2415L13.0037 11.8777C12.9468 11.9726 12.9184 12.0201 12.8725 12.0461C12.8267 12.072 12.7713 12.072 12.6607 12.072H10.6704C10.5598 12.072 10.5045 12.072 10.4586 12.098C10.4128 12.1239 10.3843 12.1714 10.3274 12.2662L9.33825 13.9142C9.28133 14.009 9.25287 14.0564 9.20703 14.0823C9.16118 14.1083 9.10588 14.1083 8.99529 14.1083H7.00486C6.89426 14.1083 6.83896 14.1083 6.79312 14.0823C6.74727 14.0564 6.71881 14.009 6.6619 13.9142L5.67273 12.2662C5.61581 12.1714 5.58735 12.1239 5.54151 12.098C5.49566 12.072 5.44036 12.072 5.32977 12.072H3.33945C3.2288 12.072 3.17347 12.072 3.12761 12.0461C3.08176 12.0201 3.0533 11.9726 2.9964 11.8777L2.0152 10.2415C1.9551 10.1413 1.92505 10.0911 1.92505 10.0358C1.92505 9.9804 1.9551 9.93029 2.0152 9.83006L2.98951 8.20528C3.04963 8.10502 3.07969 8.0549 3.07969 7.99951C3.07968 7.94413 3.04961 7.89401 2.98946 7.79377L2.01529 6.17011C1.95514 6.06987 1.92507 6.01975 1.92507 5.96437C1.92506 5.90899 1.95512 5.85886 2.01524 5.7586L2.9964 4.1224C3.0533 4.0275 3.08176 3.98005 3.12761 3.95408C3.17347 3.92811 3.2288 3.92811 3.33945 3.92811H5.32977C5.44036 3.92811 5.49566 3.92811 5.54151 3.90216C5.58735 3.87621 5.61581 3.82879 5.67273 3.73397L6.6619 2.08599C6.71881 1.99116 6.74727 1.94375 6.79312 1.9178C6.83896 1.89185 6.89426 1.89185 7.00486 1.89185H8.99529C9.10588 1.89185 9.16118 1.89185 9.20703 1.9178C9.25287 1.94375 9.28133 1.99116 9.33825 2.08599L10.3274 3.73397C10.3843 3.82879 10.4128 3.87621 10.4586 3.90216C10.5045 3.92811 10.5598 3.92811 10.6704 3.92811H12.6607C12.7713 3.92811 12.8267 3.92811 12.8725 3.95408C12.9184 3.98005 12.9468 4.0275 13.0037 4.1224L13.9849 5.7586C14.045 5.85886 14.0751 5.90899 14.0751 5.96437C14.0751 6.01975 14.045 6.06987 13.9849 6.17011L13.0107 7.79377Z"/>`,sparkle:`<path d="M5.875 3C5.875 6.33333 7.54167 8 10.875 8C7.54167 8 5.875 9.66667 5.875 13C5.875 9.66667 4.20833 8 0.875 8C4.20833 8 5.875 6.33333 5.875 3Z"/><path d="M12.375 1.55823C12.375 3.39156 13.2917 4.30823 15.125 4.30823C13.2917 4.30823 12.375 5.22489 12.375 7.05823C12.375 5.22489 11.4583 4.30823 9.625 4.30823C11.4583 4.30823 12.375 3.39156 12.375 1.55823Z"/><path d="M12.375 10.4418C12.375 11.7751 13.0417 12.4418 14.375 12.4418C13.0417 12.4418 12.375 13.1084 12.375 14.4418C12.375 13.1084 11.7083 12.4418 10.375 12.4418C11.7083 12.4418 12.375 11.7751 12.375 10.4418Z"/>`,think:`<path d="M10.7554 5.24466C13.9891 8.4783 15.3769 12.3333 13.8552 13.8551C12.3335 15.3768 8.4785 13.989 5.24478 10.7553C2.01111 7.52165 0.623307 3.66664 2.14504 2.14491C3.66676 0.623189 7.52178 2.01099 10.7554 5.24466Z"/><path d="M10.7554 10.7553C7.52178 13.989 3.66676 15.3768 2.14504 13.8551C0.623307 12.3333 2.01111 8.4783 5.24478 5.24466C8.4785 2.01099 12.3335 0.623189 13.8552 2.14491C15.3769 3.66664 13.9891 7.52165 10.7554 10.7553Z"/><path d="M8.9587 8.00025C8.9587 8.52835 8.5306 8.95655 8.0024 8.95655C7.47429 8.95655 7.04614 8.52835 7.04614 8.00025C7.04614 7.47209 7.47429 7.04395 8.0024 7.04395C8.5306 7.04395 8.9587 7.47209 8.9587 8.00025Z"/>`,light:`<path d="M8.00007 11.8117C10.1052 11.8117 11.8117 10.1052 11.8117 8.00007C11.8117 5.89499 10.1052 4.18848 8.00007 4.18848C5.89499 4.18848 4.18848 5.89499 4.18848 8.00007C4.18848 10.1052 5.89499 11.8117 8.00007 11.8117Z"/><path d="M13.3899 8H15.1499"/><path d="M11.8115 11.8115L13.0556 13.0556"/><path d="M8 13.3901V15.1501"/><path d="M4.18868 11.8115L2.94458 13.0556"/><path d="M2.6101 8H0.850098"/><path d="M4.18868 4.18856L2.94458 2.94446"/><path d="M8 2.6101V0.850098"/><path d="M11.8115 4.18856L13.0556 2.94446"/>`,dark:`<path d="M14.1127 8.70663C14.2576 8.60602 14.4627 8.71355 14.4386 8.88834C14.2901 9.96567 13.8731 10.9912 13.2229 11.8692C12.479 12.8735 11.4613 13.6421 10.2917 14.0829C9.1222 14.5236 7.85038 14.6179 6.62865 14.3543C5.40692 14.0907 4.28709 13.4805 3.40332 12.5967C2.51955 11.7129 1.90931 10.5931 1.64572 9.37135C1.38212 8.14962 1.47635 6.87779 1.91711 5.70825C2.35787 4.5387 3.12647 3.52103 4.13083 2.77714C5.00878 2.12689 6.03433 1.70994 7.11166 1.5614C7.28645 1.5373 7.39397 1.74238 7.29337 1.88734C6.68703 2.76099 6.37885 3.81241 6.42313 4.88345C6.47392 6.11194 6.98471 7.27645 7.85413 8.14587C8.72355 9.01529 9.88805 9.52608 11.1166 9.57687C12.1876 9.62114 13.239 9.31296 14.1127 8.70663Z"/>`,refresh:`<path d="M14.5001 8C14.5 9.28552 14.1188 10.5422 13.4045 11.611C12.6903 12.6799 11.6752 13.5129 10.4875 14.0049C9.29982 14.4968 7.99295 14.6255 6.73212 14.3747C5.4713 14.124 4.31314 13.505 3.4041 12.596C2.49514 11.687 1.87614 10.5288 1.62537 9.26798C1.37459 8.00716 1.50331 6.70028 1.99525 5.51261C2.48719 4.32494 3.32025 3.30981 4.3891 2.59557C5.45795 1.88134 6.71458 1.50008 8.0001 1.5C9.9001 1.5 11.7001 2.3 13.0001 3.6L14.5001 5.1"/><path d="M14.4999 1.5V5.1H10.8999"/>`},Pe=`<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 2.5h8a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"/><path d="M6 6h4M6 8.5h2.5"/></svg>`;function Fe(e,t){return`<svg viewBox="0 0 16 16" width="14" height="14" ${Me.includes(e)?`fill="currentColor" stroke="none"`:`fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"`} aria-hidden="true">${t}</svg>`}const Ie={book:`<path d="M3.5 3h9v10h-9z"/><path d="M6.5 3v10"/><path d="M8.5 6h2.5M8.5 8.5h2"/>`,briefcase:`<path d="M2.5 5.5h11v7h-11z"/><path d="M6 5.5V4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1.5"/><path d="M2.5 8.5h11"/>`,home:`<path d="M2.5 7.5 8 3l5.5 4.5"/><path d="M4 7v6h8V7"/>`,notebook:`<path d="M4 2.5h7.5v11H4z"/><path d="M6 2.5v11"/><path d="M8 6h2M8 8.5h2"/>`,flask:`<path d="M6.5 2.5v4L3.5 12a1 1 0 0 0 .9 1.5h7.2A1 1 0 0 0 12.5 12L9.5 6.5v-4"/><path d="M5.5 2.5h5"/><path d="M4.8 10h6.4"/>`,star:`<path d="m8 2.5 1.7 3.6 3.8.5-2.8 2.7.7 3.9L8 11.4l-3.4 1.8.7-3.9-2.8-2.7 3.8-.5z"/>`},Le={...Object.fromEntries(Object.entries(Ne).map(([e,t])=>[e,Fe(e,t)])),...Object.fromEntries(Object.entries(Ie).map(([e,t])=>[e,Fe(e,t)]))},Re=Object.keys(Le);function ze(e){return Object.prototype.hasOwnProperty.call(Le,e)}function Be(e,t){if(t!==void 0&&ze(t)){e.innerHTML=Le[t]??`<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 2.5h8a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"/><path d="M6 6h4M6 8.5h2.5"/></svg>`,e.classList.remove(`dsh-tw-entry-emoji`);return}if(t!==void 0&&t.trim().length>0){e.textContent=t.trim(),e.classList.add(`dsh-tw-entry-emoji`);return}e.innerHTML=Pe,e.classList.remove(`dsh-tw-entry-emoji`)}function Ve(){let e=document.querySelector(`[data-pane="sidebar"], [class*="sidebarCol"], .dshDesktopUpstreamSidebar, .dshDesktopSidebarSurface`);if(e!==null)return e.querySelector(`[class*="logoRow"]`)?.parentElement??e.firstElementChild}function He(e){let t=e.querySelector(`button[class*="newSession"]`);if(t!==null)return t;for(let t of e.children)if(t instanceof HTMLButtonElement&&!t.matches(`[data-dsh-tw-entry]`))return t;let n=e.querySelector(`button[aria-label="新建会话"], button[aria-label="New Session"], button[aria-label*="新会话"], button[aria-label*="new session" i]`);return n===null?Array.from(e.querySelectorAll(`button`)).find(e=>!e.matches(`[data-dsh-tw-entry]`)&&/新会话|新建会话|new session/i.test(e.textContent??``)):n}function Ue(e,t,n,r){let i=document.createElement(`button`);i.type=`button`,i.dataset.dshTwEntry=``,i.className=`dsh-tw-entry`,n!==void 0&&(i.dataset.wiki=n),i.setAttribute(`aria-label`,`TiddlyWiki 知识库:${t}`);let a=document.createElement(`span`);a.className=`dsh-tw-entry-icon`,Be(a,r);let o=document.createElement(`span`);return o.className=`dsh-tw-entry-label`,o.textContent=t,i.append(a,o),i.addEventListener(`click`,()=>{n!==void 0&&ke(n),e.toggle()}),{entry:i,labelEl:o,iconEl:a}}function We(e,t){try{let n=He(e);if(n===void 0)return!1;if(t.parentElement!==e){let r=n.closest(`[class*="logoRow"]`),i=r!==null&&r.parentElement===e?r:n,a=Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.matches(`[data-dsh-tw-entry], [data-dsh-atb-entry], [data-dsh-taskboard-entry], [data-dsh-ssh-entry]`)),o=a.length>0?a[0]??null:i.nextElementSibling;o!==null&&o.parentElement!==e&&(o=null),e.insertBefore(t,o)}return!0}catch(e){return console.error(`[dsh-tiddlywiki] sidebar entry placement failed:`,e),!1}}function Ge(e){let t=new Map,{entry:n,labelEl:r,iconEl:i}=Ue(e,`TiddlyWiki`);t.set(``,{entry:n,labelEl:r,iconEl:i});let a=!1,o=async()=>{let e=await Ce();a||e.sidebarLabel.length===0||(r.textContent=e.sidebarLabel,n.setAttribute(`aria-label`,e.sidebarLabel))};o();let s=xe(()=>{o()}),c=async()=>{let r=await ge();if(a)return;let i=(Array.isArray(r?.wikis)?r.wikis:[]).filter(e=>e.running);if(i.length<=1){for(let[e,n]of t)e!==``&&(n.entry.remove(),t.delete(e));n.hidden=!1;return}n.hidden=!0;let o=new Set(i.map(e=>e.id));for(let[e,n]of t)e===``||o.has(e)||(n.entry.remove(),t.delete(e));for(let n of i){let a=t.get(n.id);a===void 0&&(a=Ue(e,n.label,n.id,n.icon),t.set(n.id,a)),a.labelEl.textContent=n.label,Be(a.iconEl,n.icon),a.entry.setAttribute(`aria-label`,`TiddlyWiki 知识库:${n.label}`),je(i,r?.defaultId)===n.id?a.entry.dataset.focus=`true`:delete a.entry.dataset.focus}d!==void 0&&(f=!1,v())};c();let l=Ae(()=>{c()}),u=window.setInterval(()=>{c()},1e4),d,f=!1,p,m=0,h=()=>{p!==void 0&&(clearInterval(p),p=void 0)},g=()=>{p===void 0&&(m=15,p=setInterval(()=>{v(),m--,(f||m<=0)&&h()},2e3))},_=()=>[...t.values()].map(e=>e.entry).filter(e=>!e.hidden),v=()=>{if(d!==void 0&&!d.isConnected&&(b.disconnect(),d=void 0,f=!1,g()),f){if(_().every(e=>document.body.contains(e)))return;b.disconnect(),d=void 0,f=!1,g()}if(d??=Ve(),d===void 0)return;let e=!1;for(let t of _())We(d,t)&&(e=!0);f=e,f&&(h(),b.observe(d,{childList:!0,subtree:!0}))},y=new MutationObserver(()=>{v()});y.observe(document.body,{childList:!0,subtree:!0});let b=new MutationObserver(()=>{if(d===void 0||!d.isConnected){f=!1,g(),v();return}for(let e of _())d.contains(e)||We(d,e)});g();let x=()=>{let t=je(_().map(e=>({id:e.dataset.wiki??``})).filter(e=>e.id.length>0),void 0);for(let n of _()){let r=n.dataset.wiki,i=r===void 0?_().length===1:r===t;e.isOpen()&&i?n.dataset.active=`true`:delete n.dataset.active}},S=e.subscribe(x),C=Ae(x);return x(),v(),()=>{a=!0,clearInterval(p),window.clearInterval(u),y.disconnect(),b.disconnect(),S(),s(),l(),C();for(let e of t.values())e.entry.remove();t.clear()}}const Ke=`$:/palettes/CupertinoDark`,qe=`$:/palettes/Vanilla`,Je=`data-ds-dark-theme`,Ye=`$:/palette`,Xe=new Set,Ze=new WeakSet;let Qe=``,$e=!0,et=Ke;function tt(){try{let e=document.documentElement,t=document.body;if(t!==null&&t.hasAttribute(Je))return!0;if(e!==null){let t=e.style.getPropertyValue(`color-scheme`).trim().toLowerCase();if(t===`dark`)return!0;if(t===`light`)return!1}}catch{}try{return window.matchMedia(`(prefers-color-scheme: dark)`).matches}catch{return!1}}function nt(e){try{let t=e.wiki.getTiddlerText(Ye);return typeof t==`string`&&t.trim().length>0?t.trim():qe}catch{return qe}}function rt(e){try{let t=e.wiki.getTiddler(nt(e))?.fields;return t!==void 0&&t[`color-scheme`]===`dark`}catch{return!1}}function it(e){try{let t=e.syncer;if(t?.tiddlerInfo===void 0)return;let n=e.wiki.getChangeCount(Ye),r=t.tiddlerInfo[Ye];r===void 0?t.tiddlerInfo[Ye]={changeCount:n}:r.changeCount=n}catch{}}function at(e){try{let t=e.syncer,n=t?.syncadaptor;if(t===void 0||n===void 0||Ze.has(t))return;let r=n.saveTiddler.bind(n);n.saveTiddler=(e,t)=>{if($e&&Qe.length>0&&e?.fields?.title===Ye&&e?.fields?.text===et){t(null,{},0);return}r(e,t)},Ze.add(t)}catch{}}function ot(e,t){try{if(nt(e)===t)return;e.wiki.setText(Ye,`text`,void 0,t),it(e)}catch{}}function st(e,t){let n=nt(e);if(t){if(rt(e))return;n!==et&&(Qe=n),ot(e,et)}else rt(e)&&n===et&&Qe.length>0&&ot(e,Qe)}function ct(e,t){try{let n=t.contentDocument?.documentElement;if(n==null)return;let r=rt(e)?`dark`:`light`;n.style.getPropertyValue(`color-scheme`)!==r&&n.style.setProperty(`color-scheme`,r)}catch{}}function lt(e){try{let t=e.contentWindow?.$tw;if(t===void 0||t.wiki===void 0)return;at(t),$e?st(t,tt()):st(t,!1),ct(t,e)}catch{}}function ut(e){let t=e.enabled!==!1,n=typeof e.darkPalette==`string`&&e.darkPalette.trim().length>0?e.darkPalette.trim():Ke,r=t!==$e||n!==et;if($e=t,et=n,r)for(let e of[...Xe])e()}function dt(e){if(e===null)return()=>{};let t=()=>lt(e);Xe.add(t);let n=()=>t();e.addEventListener(`load`,n);let r=window.matchMedia(`(prefers-color-scheme: dark)`),i=()=>t();try{r.addEventListener(`change`,i)}catch{r.addListener?.(i)}let a;try{a=new MutationObserver(()=>t()),document.body!==null&&a.observe(document.body,{attributes:!0,attributeFilter:[Je]}),document.documentElement!==null&&a.observe(document.documentElement,{attributes:!0,attributeFilter:[`style`]})}catch{a=void 0}let o=[150,600,1500,3e3].map(e=>window.setTimeout(t,e));return t(),()=>{Xe.delete(t),e.removeEventListener(`load`,n);for(let e of o)window.clearTimeout(e);try{r.removeEventListener(`change`,i)}catch{r.removeListener?.(i)}try{a?.disconnect()}catch{}}}const ft=`dsh-panel-activate`,pt=`dsh-tw-panel-reload`;let mt=`知识库`;function ht(e){let t=typeof e==`string`?e.trim():``;t.length>0&&(mt=t)}function gt(){return mt}async function _t(){try{return(await fetch(te,{method:`POST`,signal:AbortSignal.timeout(8e3)})).ok}catch{return!1}}function vt({size:e=16,className:t}){return c.createElement(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.3,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0},c.createElement(`path`,{d:`M4 2.5h8a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z`}),c.createElement(`path`,{d:`M6 6h4M6 8.5h2.5`}))}function yt(e){let t=e.loaded;return t===void 0||t.length===0?null:t}function bt(e,t={}){let n=!1,r=!1,i=!1,a,o,s,c,l=new Set,u=0,d=!1,f=null,p,m=()=>{c!==void 0&&(window.clearTimeout(c),c=void 0)},h=e=>{if(o===void 0||s===void 0)return;o.hidden=!0,s.hidden=!1,s.replaceChildren();let t=document.createElement(`div`);t.textContent=`TiddlyWiki 服务不可用`;let n=document.createElement(`code`);n.textContent=e;let r=document.createElement(`button`);r.type=`button`,r.textContent=`重试`,r.addEventListener(`click`,()=>{r.disabled=!0,r.textContent=`重启中…`,_t().finally(()=>{b()})}),s.append(t,n,r)},g=()=>{if(o===void 0||s===void 0)return;o.hidden=!0,s.hidden=!1,s.replaceChildren();let e=document.createElement(`div`);e.textContent=`TiddlyWiki 服务正在启动…`,s.append(e)},_=e=>{o===void 0||s===void 0||(s.hidden=!0,o.hidden=!n,o.dataset.loaded!==e&&(o.dataset.loaded=e,d=!1,o.src=e))},v=()=>{if(f===null||o===void 0||!d)return;let e=f,t=o.contentWindow;if(t===null){y(e);return}let n=r=>{if(i||f!==e)return;let a=!1;try{let e=t;a=typeof e.$tw==`object`&&e.$tw!==null}catch{y(e);return}if(!a){if(r<40){let e=window.setTimeout(()=>{l.delete(e),n(r+1)},150);l.add(e);return}y(e);return}f=null;try{t.location.hash!==e&&(t.location.hash=e)}catch{y(e)}};n(0)},y=e=>{if(i||o===void 0)return;f===e&&(f=null);let t=yt(o.dataset);if(t===null)return;let n=`${t.split(`#`)[0]}${e}`;o.src!==n&&(o.src=n)},b=async()=>{m();let e=await ge();if(!i&&n){if(e===null){h(`无法访问 /dsh-tiddlywiki/status`);return}if(e.ui!==void 0&&(ht(e.ui.tabLabel??mt),ut({enabled:e.ui.followDshTheme!==!1,darkPalette:e.ui.darkPalette})),e.status===`running`){if(u=0,typeof e.twProxy==`string`){let n=fe(e.mode,t.wikiId?.(),e.twProxy,e.twProxyAbsolute);_(de(n.relative,n.absolute))}else typeof e.url==`string`?_(e.url):h(`服务未返回编辑器地址`);return}if(e.status===`starting`){g(),u<30&&(u++,c=window.setTimeout(()=>{b()},1500));return}u=0,h(e.error??`服务状态:${e.status}`)}},x=()=>{if(o===void 0)return;let e=yt(o.dataset);e!==null&&(o.src=e)};document.addEventListener(pt,x);let S=Ae(()=>{!i&&n&&b()});return{build:()=>{if(a!==void 0)return a;let t=document.createElement(`div`);if(t.className=e.view,e.viewDataset!==void 0)for(let[n,r]of Object.entries(e.viewDataset))t.dataset[n]=r;let r=document.createElement(`div`);r.className=e.frameWrap,e.frameWrapStyle!==void 0&&(r.style.cssText=e.frameWrapStyle);let i=document.createElement(`iframe`);i.className=e.frame,i.title=`TiddlyWiki`,i.hidden=!0,r.append(i);let c=document.createElement(`div`);return c.className=e.error,c.hidden=!0,t.append(r,c),a=t,o=i,s=c,i.addEventListener(`load`,()=>{d=!0,v()}),p=dt(i),n&&b(),t},setVisible(e){i||(n=e,e&&!r&&(r=!0),o!==void 0&&(o.hidden=!e||yt(o.dataset)===null),e?b():(m(),u=0))},openTiddler(e){return i||!n?!1:(f=`#${encodeURIComponent(e)}`,r?v():(r=!0,b()),!0)},dispose(){if(!i){i=!0,document.removeEventListener(pt,x),S(),m();for(let e of l)window.clearTimeout(e);l.clear(),p?.(),a?.remove()}}}}function xt(){return{setVisible(){},openTiddler(){return!1},dispose(){}}}const St=new Set;function Ct(e){for(let t of St)if(t.openTiddler(e))return!0;return!1}function wt(){ge().then(e=>{e?.ui!==void 0&&ht(e.ui.tabLabel??mt)})}const Tt={view:`dsh-tw-rightbar-view`,frameWrap:`dsh-tw-rightbar-frame-wrap`,frame:`dsh-tw-rightbar-frame`,error:`dsh-tw-rightbar-error`};function Et(e,t){if(t.aborted)return xt();let n=bt(Tt,{wikiId:Oe});e.append(n.build());let r=!1,i=()=>a.dispose();t.addEventListener(`abort`,i,{once:!0});let a={setVisible(e){n.setVisible(e)},openTiddler(e){return n.openTiddler(e)},dispose(){r||(r=!0,St.delete(a),t.removeEventListener(`abort`,i),n.dispose())}};return St.add(a),a}const Dt=[`[class*="centerCol"]`,`[data-pane="conversation"]`,`.dshDesktopConversationSurface`],Ot=`data-dsh-tw-active`,kt=[`data-dsh-atb-active`,`data-dsh-taskboard-active`,`data-dsh-ssh-active`],At=`dsh-tiddlywiki`,jt=`[data-dsh-panel-host]`,Mt={view:`dsh-tw-view`,viewDataset:{dshTwView:``},frameWrap:`dsh-tw-panel-frame-wrap`,frameWrapStyle:`flex:1;min-height:0;display:flex;flex-direction:column`,frame:`dsh-tw-panel-frame`,error:`dsh-tw-panel-error`},Nt=`dsh-tw-open-tiddler`;function Pt(e,t){typeof document>`u`||typeof e!=`string`||e.length===0||document.dispatchEvent(new CustomEvent(Nt,{detail:typeof t==`string`&&t.length>0?{title:e,wikiId:t}:{title:e}}))}function Ft(){let e=document.querySelector(jt);if(e===null)return 40;let t=parseInt(getComputedStyle(e).zIndex,10);return Number.isFinite(t)?Math.max(20,Math.min(40,t-1)):40}function It(){for(let e of Dt){let t=document.querySelector(e);if(t!==null)return t}}function Lt(e){let t,n,r=!1,i,a=bt(Mt,{wikiId:Oe}),o=()=>{if(!e.isOpen()||t===void 0||n===void 0)return;let r=n.getBoundingClientRect();if(r.width===0&&r.height===0)return;let i=`${r.left}px`,a=`${r.top}px`,o=`${r.width}px`,s=`${r.height}px`;t.style.left!==i&&(t.style.left=i),t.style.top!==a&&(t.style.top=a),t.style.width!==o&&(t.style.width=o),t.style.height!==s&&(t.style.height=s)},s=(n=!1)=>{if(t===void 0)return;let r=document.querySelector(jt)!==null;!n&&!e.isOpen()&&r===i||(i=r,t.style.zIndex=String(Ft()),r?t.dataset.sidebarHost=`1`:delete t.dataset.sidebarHost)},c=()=>{(n===void 0||!n.isConnected)&&(n=It()),t===void 0&&n!==void 0&&(t=a.build(),t.style.position=`fixed`,s(!0),document.body.append(t),o())},l=t=>{let n=t.detail,r=typeof n?.title==`string`&&n.title.length>0?n.title:``;r.length!==0&&(Ct(r)||(e.openPanel(),a.openTiddler(r)))},u=()=>{if(e.isOpen()){for(let e of kt)document.documentElement.removeAttribute(e);document.documentElement.setAttribute(Ot,``),document.dispatchEvent(new CustomEvent(ft,{detail:At})),m()}else document.documentElement.removeAttribute(Ot);a.setVisible(e.isOpen())},d=t=>{t.detail!==At&&e.isOpen()&&e.closePanel()},f=t=>{if(!e.isOpen())return;let n=t.target;n!==null&&n.closest(`[data-dsh-tw-entry]`)===null&&n.closest(`[class*="sessionRow"], [class*="projectRow"], [class*="searchResultRow"], [class*="searchResultWorkspace"], [class*="newSession"]`)!==null&&e.closePanel()},p,m=()=>{r||p!==void 0||(p=window.requestAnimationFrame(()=>{p=void 0,!r&&(c(),o(),s())}))},h=new MutationObserver(()=>{m()});h.observe(document.body,{childList:!0,subtree:!0});let g=new ResizeObserver(()=>{m()});g.observe(document.body);let _=window.setInterval(o,2e3),v=()=>{m()};window.addEventListener(`resize`,v);let y=()=>{m()};window.addEventListener(`scroll`,y,!0),document.addEventListener(`click`,f,!0),document.addEventListener(ft,d);let b=e.subscribe(u);return c(),u(),document.addEventListener(Nt,l),()=>{r=!0,p!==void 0&&window.cancelAnimationFrame(p),p=void 0,window.clearInterval(_),window.removeEventListener(`resize`,v),window.removeEventListener(`scroll`,y,!0),g.disconnect(),document.removeEventListener(`click`,f,!0),document.removeEventListener(ft,d),document.removeEventListener(Nt,l),h.disconnect(),b(),document.documentElement.removeAttribute(Ot),a.dispose(),t?.remove()}}function k(e){let t=document.querySelector(`.dsh-tw-toast`);t===null&&(t=document.createElement(`div`),t.className=`dsh-tw-toast`,document.body.append(t)),t.textContent=e,t.classList.add(`dsh-tw-toast-show`),clearTimeout(t.__twToastTimer),t.__twToastTimer=window.setTimeout(()=>{t?.classList.remove(`dsh-tw-toast-show`)},2500)}const Rt=`dsh-tiddlywiki/editor-popup`;let A,zt,Bt,Vt,Ht,Ut;function Wt(e,t){Xt(),!(A===void 0||zt===void 0)&&(Bt!==void 0&&(Bt.textContent=`TiddlyWiki 编辑器 · ${t}`),A.style.display=``,document.dispatchEvent(new CustomEvent(ft,{detail:Rt})),(zt.dataset.loaded!==e||Kt())&&(zt.dataset.loaded=e,zt.src=e),qt())}function Gt(){return A!==void 0&&A.style.display!==`none`}function Kt(){if(zt===void 0)return!1;let e=null;try{e=zt.contentDocument}catch{return!1}if(e===null||e.readyState===`loading`)return!1;let t=e.querySelector(`.tc-story-river`);return t===null||t.querySelector(`.tc-tiddler-frame`)===null}function qt(){A!==void 0&&A.querySelector(`button, [href], input, select, textarea, iframe, [tabindex]:not([tabindex="-1"])`)?.focus()}function Jt(){A!==void 0&&(A.style.display=`none`),zt!==void 0&&(zt.dataset.loaded=``)}function Yt(){Vt?.(),Vt=void 0,Ht!==void 0&&(document.removeEventListener(`keydown`,Ht),Ht=void 0),Ut!==void 0&&(document.removeEventListener(ft,Ut),Ut=void 0),A?.remove(),A=void 0,zt=void 0,Bt=void 0}function Xt(){if(A!==void 0&&zt!==void 0)return;A=document.createElement(`div`),A.className=`dsh-tw-editor-popup`,A.style.display=`none`,A.setAttribute(`role`,`dialog`),A.setAttribute(`aria-modal`,`true`),A.setAttribute(`aria-label`,`TiddlyWiki 编辑器`);let e=document.createElement(`div`);e.className=`dsh-tw-editor-bar`,Bt=document.createElement(`span`),Bt.className=`dsh-tw-editor-title`,Bt.textContent=`TiddlyWiki 编辑器`;let t=document.createElement(`button`);t.type=`button`,t.className=`dsh-tw-editor-close`,t.textContent=`✕`,t.title=`关闭`,e.append(Bt,t),zt=document.createElement(`iframe`),zt.className=`dsh-tw-editor-frame`,zt.setAttribute(`sandbox`,`allow-scripts allow-same-origin allow-forms allow-popups`),zt.title=`TiddlyWiki 编辑器`,Vt=dt(zt);let n=document.createElement(`div`);n.className=`dsh-tw-editor-resize`,n.title=`拖拽调整大小`,A.append(e,zt,n),document.body.append(A),t.addEventListener(`click`,()=>Jt()),Ht=e=>{e.key===`Escape`&&Gt()&&Jt()},document.addEventListener(`keydown`,Ht),Ut=e=>{e.detail!==Rt&&Gt()&&Jt()},document.addEventListener(ft,Ut),e.addEventListener(`pointerdown`,n=>{if(n.button!==0||A===void 0)return;let r=n.target;if(t.contains(r))return;n.preventDefault(),e.setPointerCapture(n.pointerId);let i=A.getBoundingClientRect(),a=n.clientX,o=n.clientY,s=i.left,c=i.top,l=e=>{A!==void 0&&(A.style.left=`${s+e.clientX-a}px`,A.style.top=`${c+e.clientY-o}px`,A.style.margin=`0`,A.style.right=`auto`,A.style.bottom=`auto`)},u=()=>{e.removeEventListener(`pointermove`,l),e.removeEventListener(`pointerup`,u),e.removeEventListener(`pointercancel`,u)};e.addEventListener(`pointermove`,l),e.addEventListener(`pointerup`,u),e.addEventListener(`pointercancel`,u)}),n.addEventListener(`pointerdown`,e=>{if(e.button!==0||A===void 0)return;e.preventDefault(),e.stopPropagation(),n.setPointerCapture(e.pointerId);let t=A.getBoundingClientRect(),r=e.clientX,i=e.clientY,a=t.width,o=t.height,s=e=>{A!==void 0&&(A.style.width=`${Math.max(360,a+e.clientX-r)}px`,A.style.height=`${Math.max(260,o+e.clientY-i)}px`,A.style.right=`auto`,A.style.bottom=`auto`)},c=()=>{n.removeEventListener(`pointermove`,s),n.removeEventListener(`pointerup`,c),n.removeEventListener(`pointercancel`,c)};n.addEventListener(`pointermove`,s),n.addEventListener(`pointerup`,c),n.addEventListener(`pointercancel`,c)})}let Zt=[],Qt=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?Qt:Zt).push(n+=e[t])})();function $t(e){if(e<768)return!1;for(let t=0,n=Zt.length;;){let r=t+n>>1;if(e<Zt[r])n=r;else if(e>=Qt[r])t=r+1;else return!0;if(t==n)return!1}}function en(e){return e>=127462&&e<=127487}const tn=8205;function nn(e,t,n=!0,r=!0){return(n?rn:an)(e,t,r)}function rn(e,t,n){if(t==e.length)return t;t&&sn(e.charCodeAt(t))&&cn(e.charCodeAt(t-1))&&t--;let r=on(e,t);for(t+=ln(r);t<e.length;){let i=on(e,t);if(r==tn||i==tn||n&&$t(i))t+=ln(i),r=i;else if(en(i)){let n=0,r=t-2;for(;r>=0&&en(on(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function an(e,t,n){for(;t>1;){let r=rn(e,t-2,n);if(r<t)return r;t--}return 0}function on(e,t){let n=e.charCodeAt(t);if(!cn(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return sn(r)?(n-55296<<10)+(r-56320)+65536:n}function sn(e){return e>=56320&&e<57344}function cn(e){return e>=55296&&e<56320}function ln(e){return e<65536?1:2}var j=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=yn(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),dn.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=yn(this,e,t);let n=[];return this.decompose(e,t,n,0),dn.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new hn(this),i=new hn(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new hn(this,e)}iterRange(e,t=this.length){return new gn(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new _n(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new un(t):dn.from(un.split(t,[]))}},un=class e extends j{constructor(e,t=fn(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new vn(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(mn(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=pn(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=yn(this,t,n);let i=pn(this.text,pn(r.text,mn(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):dn.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
|
|
832
892
|
`){[e,t]=yn(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},dn=class e extends j{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=yn(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
|
|
833
893
|
`){[e,t]=yn(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new un(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof un&&c&&(n=u[u.length-1])instanceof un&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new un(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};j.empty=new un([``],0);function fn(e){let t=-1;for(let n of e)t+=n.length+1;return t}function pn(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function mn(e,t,n){return pn(e,[``],t,n)}var hn=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof un?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof un?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-tiddlywiki",
|
|
3
3
|
"description": "把 TiddlyWiki 5 变成你和 Agent 共用的本地文档中心(纯文本 + git):你在 DSH 界面里阅读、写作、记日记,Agent 用 15 个 tiddlywiki_* 工具读写同一批笔记;每条笔记都是你能读、能改、能审计、能随时带走的文件——不是自动记忆插件,不做后台抓取。可选一键发布到微信公众号草稿箱。 Turn TiddlyWiki 5 into a document center you and your agent share, in plain text under git — a knowledge base you can read, edit, audit and take with you, not an auto-memory plugin. Mounts via the official dsh plugin system; no DSH source changes.",
|
|
4
|
-
"version": "0.28.
|
|
4
|
+
"version": "0.28.9",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"dsh",
|
package/src/client/styles.ts
CHANGED
|
@@ -837,6 +837,66 @@ html[data-dsh-tw-active] .dshDesktopConversationSurface > :not([data-dsh-tw-view
|
|
|
837
837
|
}
|
|
838
838
|
.dsh-tw-settings-scopebar-label { font-size: 12px; font-weight: 600; color: var(--dsw-alias-label-primary, #222); }
|
|
839
839
|
.dsh-tw-settings-scopebar-exit { margin-left: auto; }
|
|
840
|
+
|
|
841
|
+
/* ── 每库图标:按钮 + 弹出式分页网格(v0.28.8,反馈 1/2)──────────────────
|
|
842
|
+
⚠️ 这一段的缺席曾是真实缺陷(见下):选择器的 DOM 与守门都到位了,唯独 CSS
|
|
843
|
+
没写 —— 于是弹层以「无样式块」的形式挂在 document.body 底部,视觉上等于
|
|
844
|
+
"点了没反应"。修复时连同守门一起补:verify-wiki-focus 现在断言本节存在,
|
|
845
|
+
而不只是断言 TS 里出现过那几个类名字符串(那正是当初漏掉的原因)。
|
|
846
|
+
|
|
847
|
+
弹层 append 到 document.body(不受祖先 overflow 裁剪),所以定位必须用
|
|
848
|
+
position:fixed —— 相对 body 的 absolute 会被页面滚动带走。 */
|
|
849
|
+
.dsh-tw-settings-iconbtn {
|
|
850
|
+
display: inline-flex; align-items: center; gap: 6px;
|
|
851
|
+
}
|
|
852
|
+
.dsh-tw-settings-iconbtn-face {
|
|
853
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
854
|
+
width: 16px; height: 16px; flex: 0 0 auto;
|
|
855
|
+
}
|
|
856
|
+
.dsh-tw-settings-iconbtn-face > svg { width: 16px; height: 16px; display: block; }
|
|
857
|
+
.dsh-tw-settings-iconbtn-label { font-size: 12px; }
|
|
858
|
+
.dsh-tw-iconpicker {
|
|
859
|
+
position: fixed; z-index: 60;
|
|
860
|
+
width: min(420px, calc(100vw - 24px));
|
|
861
|
+
max-height: min(70vh, 420px); overflow: auto;
|
|
862
|
+
padding: 10px; border-radius: 12px;
|
|
863
|
+
border: 1px solid var(--dsw-alias-border-l2, rgba(0,0,0,.18));
|
|
864
|
+
background: var(--dsw-alias-bg-layer-1, #fff);
|
|
865
|
+
color: var(--dsw-alias-label-primary, #222);
|
|
866
|
+
box-shadow: 0 8px 28px rgba(0,0,0,.22);
|
|
867
|
+
}
|
|
868
|
+
.dsh-tw-iconpicker-grid {
|
|
869
|
+
display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px;
|
|
870
|
+
}
|
|
871
|
+
.dsh-tw-iconpicker-cell {
|
|
872
|
+
display: flex; flex-direction: column; align-items: center; gap: 3px;
|
|
873
|
+
padding: 6px 2px; border-radius: 8px; cursor: pointer; font: inherit;
|
|
874
|
+
border: 1px solid transparent; background: transparent; color: inherit;
|
|
875
|
+
min-width: 0;
|
|
876
|
+
}
|
|
877
|
+
.dsh-tw-iconpicker-cell:hover {
|
|
878
|
+
background: var(--dsw-alias-interactive-bg-hover, rgba(128,128,128,.12));
|
|
879
|
+
}
|
|
880
|
+
.dsh-tw-iconpicker-cell[data-current='true'] {
|
|
881
|
+
border-color: var(--dsw-alias-border-l2, rgba(0,0,0,.3));
|
|
882
|
+
background: var(--dsw-alias-bg-layer-2, rgba(0,0,0,.06));
|
|
883
|
+
}
|
|
884
|
+
.dsh-tw-iconpicker-face {
|
|
885
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
886
|
+
width: 20px; height: 20px;
|
|
887
|
+
}
|
|
888
|
+
.dsh-tw-iconpicker-face > svg { width: 20px; height: 20px; display: block; }
|
|
889
|
+
/* 名称是第二信息:长了就省略,绝不让它把格子撑开(8 列必须对齐)。 */
|
|
890
|
+
.dsh-tw-iconpicker-name {
|
|
891
|
+
font-size: 10px; line-height: 1.2; max-width: 100%;
|
|
892
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
893
|
+
color: var(--dsw-alias-label-secondary, #666);
|
|
894
|
+
}
|
|
895
|
+
.dsh-tw-iconpicker-pager {
|
|
896
|
+
display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
|
897
|
+
margin-top: 8px; padding-top: 8px;
|
|
898
|
+
border-top: 1px solid var(--dsw-alias-border-l2, rgba(0,0,0,.12));
|
|
899
|
+
}
|
|
840
900
|
`
|
|
841
901
|
|
|
842
902
|
/**
|