dsh-notes-plugin 0.1.0
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 +128 -0
- package/cordis.patch.yml +5 -0
- package/index.mjs +1149 -0
- package/lib/client.js +882 -0
- package/lib/styles.css +312 -0
- package/package.json +57 -0
package/lib/styles.css
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/* dsh-notes-plugin 面板样式 —— Apple Notes 原生质感 */
|
|
2
|
+
/* 由 host 通过 notes-css RPC 提供给 client 注入 */
|
|
3
|
+
/* tooltip 必须作用域隔离(.dsh-nt):全局 [data-tooltip] 选择器会污染整个 DSH 页面导致卡顿 */
|
|
4
|
+
|
|
5
|
+
/* ===== 设计令牌(映射 DSH 主题 token,明暗随 DSH 主题自动切换;缺失时回退浅色兜底) ===== */
|
|
6
|
+
.dsh-notes-floating,.dsh-notes-fab{
|
|
7
|
+
/* 背景 */
|
|
8
|
+
--nbg:var(--dsw-alias-bg-overlay, #ffffff); /* 面板主背景 */
|
|
9
|
+
--nsf:var(--dsw-alias-bg-layer-1, #fbfbfd); /* 列表区背景(极浅灰) */
|
|
10
|
+
--nbg-hover:var(--dsw-alias-bg-layer-2, #f2f2f7); /* 列表项 hover */
|
|
11
|
+
--nbg-sel:var(--dsw-alias-bg-layer-2, #e5e5ea); /* 列表项选中(macOS 选中灰) */
|
|
12
|
+
--nbd:var(--dsw-alias-border-l1, #e5e5ea); /* 边框/分隔线 */
|
|
13
|
+
--nbd-soft:var(--dsw-alias-border-l1, #ececf0); /* 更柔和的分隔 */
|
|
14
|
+
/* 文字 */
|
|
15
|
+
--ntx:var(--dsw-alias-label-primary, #1c1c1e); /* 主文字 */
|
|
16
|
+
--nt2:var(--dsw-alias-label-secondary, #6c6c70); /* 次要文字(时间/来源) */
|
|
17
|
+
--nt3:var(--dsw-alias-label-secondary, #aeaeb2); /* 弱化(placeholder/图标) */
|
|
18
|
+
/* 强调 */
|
|
19
|
+
--nacc:var(--dsw-alias-brand-primary, #0a84ff); /* 蓝(交互/选中) */
|
|
20
|
+
--nacc-soft:rgba(10,132,255,.12);
|
|
21
|
+
/* kind 强调色(灰阶为主,kind 用低调色;深浅通用,保留原值) */
|
|
22
|
+
--nkind-note:#8e8e93;
|
|
23
|
+
--nkind-decision:#0a84ff;
|
|
24
|
+
--nkind-todo:#34c759;
|
|
25
|
+
--nkind-link:#5e5ce6;
|
|
26
|
+
--nkind-quote:#98989d;
|
|
27
|
+
/* 尺寸 */
|
|
28
|
+
--nr-sm:6px; --nr-md:8px; --nr-lg:10px;
|
|
29
|
+
/* 字体 */
|
|
30
|
+
--nfont:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
|
|
31
|
+
--nmono:"SF Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
|
|
32
|
+
/* 阴影(极淡,仅面板) */
|
|
33
|
+
--nshadow:0 18px 50px rgba(0,0,0,.12),0 2px 8px rgba(0,0,0,.06);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* ===== tooltip(作用域隔离) ===== */
|
|
37
|
+
.dsh-nt{position:relative}
|
|
38
|
+
.dsh-nt[data-tooltip]::after{content:attr(data-tooltip);position:fixed;background:rgba(28,28,30,.95);color:#fff;padding:5px 9px;border-radius:6px;font-size:11px;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .12s;z-index:2147483646;font-family:var(--nfont)}
|
|
39
|
+
.dsh-nt[data-tooltip]:hover::after{opacity:1}
|
|
40
|
+
|
|
41
|
+
/* ===== 会话头部入口按钮(简约图标,无文字无数量 badge) ===== */
|
|
42
|
+
.dsh-notes-hdr-btn{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;margin:0 2px;cursor:pointer;border-radius:6px;font-size:12px;line-height:1.4;color:var(--color-text-secondary,#999);background:transparent;border:1px solid var(--nbd);transition:background .15s,color .15s,border-color .15s;white-space:nowrap;vertical-align:middle;font-family:inherit}
|
|
43
|
+
.dsh-notes-hdr-btn:hover{background:var(--color-surface-hover,rgba(128,128,128,.15));color:var(--color-text-primary,#eee)}
|
|
44
|
+
.dsh-notes-hdr-btn.active{color:var(--color-accent,#0a84ff);border-color:var(--color-accent,#0a84ff)}
|
|
45
|
+
.dsh-notes-hdr-ic{font-size:13px;line-height:1;display:inline-flex;align-items:center;pointer-events:none}
|
|
46
|
+
|
|
47
|
+
/* ===== 悬浮气泡入口(圆形固定定位、可拖拽、点击展开面板) ===== */
|
|
48
|
+
.dsh-notes-fab{position:fixed;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;padding:0;margin:0;cursor:grab;background:var(--nbg);border:1px solid var(--nbd);box-shadow:0 4px 14px rgba(0,0,0,.18),0 1px 4px rgba(0,0,0,.1);color:var(--ntx);font-family:var(--nfont);z-index:2147483646;transition:box-shadow .15s,transform .12s,color .15s,border-color .15s;user-select:none;-webkit-user-select:none;touch-action:none}
|
|
49
|
+
.dsh-notes-fab:hover{box-shadow:0 6px 20px rgba(0,0,0,.22),0 2px 6px rgba(0,0,0,.12);border-color:var(--nacc);color:var(--nacc)}
|
|
50
|
+
.dsh-notes-fab:active{cursor:grabbing}
|
|
51
|
+
.dsh-notes-fab.active{color:var(--nacc);border-color:var(--nacc);box-shadow:0 6px 20px rgba(10,132,255,.25),0 2px 6px rgba(0,0,0,.12)}
|
|
52
|
+
.dsh-notes-fab-ic{font-size:18px;line-height:1;display:inline-block;transform:translateY(-1px);pointer-events:none}
|
|
53
|
+
|
|
54
|
+
/* ===== 浮空面板 ===== */
|
|
55
|
+
.dsh-notes-floating{position:fixed;background:var(--nbg);border:1px solid var(--nbd);border-radius:12px;box-shadow:var(--nshadow);display:flex;flex-direction:column;font-family:var(--nfont);color:var(--ntx);box-sizing:border-box;overflow:hidden;z-index:2147483647;-webkit-font-smoothing:antialiased}
|
|
56
|
+
.dsh-notes-resize-handle{position:absolute;bottom:0;right:0;width:18px;height:18px;cursor:nwse-resize;z-index:20;user-select:none;background:transparent;border-bottom-right-radius:12px}
|
|
57
|
+
.dsh-notes-resize-handle:hover,.dsh-notes-divider:hover{background:var(--nacc-soft)}
|
|
58
|
+
|
|
59
|
+
/* ===== 标题栏(极简:仅标题 + 主题筛选 + 关闭) ===== */
|
|
60
|
+
.dsh-notes-titlebar{display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid var(--nbd-soft);cursor:grab;user-select:none;flex-shrink:0;min-height:46px;height:46px}
|
|
61
|
+
.dsh-notes-titlebar:active{cursor:grabbing}
|
|
62
|
+
.dsh-notes-titlebar-title{font-size:13px;font-weight:600;display:flex;align-items:center;gap:8px;flex:1;letter-spacing:.2px;color:var(--ntx)}
|
|
63
|
+
.dsh-notes-titlebar-grip{color:var(--nt3);font-size:13px;letter-spacing:2px;padding:0 4px}
|
|
64
|
+
.dsh-notes-titlebar-actions{display:flex;gap:2px;flex-shrink:0}
|
|
65
|
+
.dsh-notes-titlebar-btn{background:none;border:none;color:var(--nt3);font-size:15px;cursor:pointer;padding:5px 9px;border-radius:6px;line-height:1;transition:background .15s,color .15s;font-weight:500}
|
|
66
|
+
.dsh-notes-titlebar-btn:hover{background:var(--nbg-hover);color:var(--ntx)}
|
|
67
|
+
|
|
68
|
+
/* ===== 顶栏:搜索(Spotlight 风格) ===== */
|
|
69
|
+
.dsh-notes-search{display:flex;align-items:center;gap:8px;padding:10px 14px;flex-shrink:0;border-bottom:1px solid var(--nbd-soft)}
|
|
70
|
+
.dsh-notes-search-box{flex:1;display:flex;align-items:center;gap:7px;background:var(--nbg-hover);border:1px solid transparent;border-radius:var(--nr-md);padding:7px 11px;transition:border-color .15s,background .15s}
|
|
71
|
+
.dsh-notes-search-box:focus-within{border-color:var(--nacc);background:var(--nbg)}
|
|
72
|
+
.dsh-notes-search-icon{color:var(--nt3);font-size:13px;flex-shrink:0;line-height:1}
|
|
73
|
+
.dsh-notes-search-input{flex:1;min-width:0;background:transparent;border:none;outline:none;color:var(--ntx);font-size:13px;font-family:var(--nfont);padding:0}
|
|
74
|
+
.dsh-notes-search-input::placeholder{color:var(--nt3)}
|
|
75
|
+
|
|
76
|
+
/* ===== 顶栏:图标工具栏(单行,搜索/新建内联展开) ===== */
|
|
77
|
+
.dsh-notes-toolbar{display:flex;align-items:center;gap:6px;padding:8px 14px;flex-shrink:0;border-bottom:1px solid var(--nbd-soft)}
|
|
78
|
+
.dsh-notes-tool-btn{background:transparent;border:1px solid var(--nbd);border-radius:var(--nr-md);color:var(--nt2);width:30px;height:30px;cursor:pointer;font-size:15px;line-height:1;flex-shrink:0;transition:all .15s;display:flex;align-items:center;justify-content:center;padding:0;font-family:var(--nfont)}
|
|
79
|
+
.dsh-notes-tool-btn:hover{border-color:var(--nacc);color:var(--nacc);background:var(--nacc-soft)}
|
|
80
|
+
.dsh-notes-tool-btn.on{background:var(--nacc-soft);border-color:var(--nacc);color:var(--nacc)}
|
|
81
|
+
/* 展开态输入行(搜索/记录框内联伸缩,不用时收成一行图标) */
|
|
82
|
+
.dsh-notes-expand{animation:dsh-notes-expand-in .14s ease}
|
|
83
|
+
@keyframes dsh-notes-expand-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
|
|
84
|
+
.dsh-notes-expand-close{background:transparent;border:none;color:var(--nt3);font-size:16px;cursor:pointer;padding:4px 7px;border-radius:6px;line-height:1;flex-shrink:0;transition:color .15s,background .15s}
|
|
85
|
+
.dsh-notes-expand-close:hover{color:var(--ntx);background:var(--nbg-hover)}
|
|
86
|
+
|
|
87
|
+
/* ===== kind 筛选 chips(内联进工具栏,可横向滚动) ===== */
|
|
88
|
+
.dsh-notes-kinds{flex:1;display:flex;align-items:center;gap:6px;overflow-x:auto;padding:0;border-bottom:none}
|
|
89
|
+
.dsh-notes-kind-chip{background:transparent;border:1px solid var(--nbd);border-radius:13px;color:var(--nt2);font-size:11px;padding:3px 11px;cursor:pointer;transition:all .15s;white-space:nowrap;font-weight:500}
|
|
90
|
+
.dsh-notes-kind-chip:hover{border-color:var(--nt3);color:var(--ntx)}
|
|
91
|
+
.dsh-notes-kind-chip.on{background:var(--ntx);border-color:var(--ntx);color:var(--nbg)}
|
|
92
|
+
.dsh-notes-pin-toggle{margin-left:auto;background:transparent;border:1px solid var(--nbd);border-radius:13px;color:var(--nt2);font-size:11px;padding:3px 11px;cursor:pointer;transition:all .15s;white-space:nowrap;font-weight:500;flex-shrink:0}
|
|
93
|
+
.dsh-notes-pin-toggle:hover{border-color:var(--nt3);color:var(--ntx)}
|
|
94
|
+
.dsh-notes-pin-toggle.on{background:var(--nacc-soft);border-color:var(--nacc);color:var(--nacc)}
|
|
95
|
+
|
|
96
|
+
/* ===== 列表区(两列布局) ===== */
|
|
97
|
+
.dsh-notes-content{display:flex;flex:1;overflow:hidden;min-height:0;position:relative}
|
|
98
|
+
.dsh-notes-divider{width:5px;cursor:col-resize;flex-shrink:0;background:transparent;transition:background .15s;position:relative;z-index:5}
|
|
99
|
+
.dsh-notes-list{overflow:hidden;flex-shrink:0;display:flex;flex-direction:column;background:var(--nsf);min-width:180px;max-width:400px;border-right:1px solid var(--nbd-soft)}
|
|
100
|
+
.dsh-notes-list-items{flex:1;overflow-y:auto;padding:2px 5px}
|
|
101
|
+
.dsh-notes-list-items::-webkit-scrollbar{width:8px}
|
|
102
|
+
.dsh-notes-list-items::-webkit-scrollbar-thumb{background:var(--nbd);border-radius:4px}
|
|
103
|
+
.dsh-notes-list-items::-webkit-scrollbar-thumb:hover{background:var(--nt3)}
|
|
104
|
+
|
|
105
|
+
/* 分组头(置顶 / 主题) */
|
|
106
|
+
.dsh-notes-topic-header{display:flex;align-items:center;justify-content:space-between;padding:8px 10px 3px;font-size:11px;font-weight:600;color:var(--nt3);letter-spacing:.4px;position:sticky;top:0;background:var(--nsf);z-index:2}
|
|
107
|
+
.dsh-notes-topic-count{font-size:10px;color:var(--nt3);font-weight:500}
|
|
108
|
+
|
|
109
|
+
/* ===== 笔记列表项(Apple Notes:0 圆角、无阴影、纯背景选中) ===== */
|
|
110
|
+
.dsh-note-item{padding:5px 9px;margin:0;border-radius:var(--nr-md);cursor:pointer;transition:background .12s;position:relative;background:transparent;box-shadow:none;user-select:none}
|
|
111
|
+
.dsh-note-item:hover{background:var(--nbg-hover)}
|
|
112
|
+
.dsh-note-item:hover .dsh-note-delete{opacity:1}
|
|
113
|
+
.dsh-note-item.selected{background:var(--nbg-sel)}
|
|
114
|
+
.dsh-note-item.focused{background:var(--nbg-hover)}
|
|
115
|
+
.dsh-note-item.pinned{}
|
|
116
|
+
.dsh-note-item.resolved .dsh-note-title-text{color:var(--nt2)}
|
|
117
|
+
.dsh-note-item.resolved .dsh-note-title-text{text-decoration:line-through}
|
|
118
|
+
.dsh-note-item.superseded .dsh-note-title-text{color:var(--nt3);text-decoration:line-through}
|
|
119
|
+
.dsh-note-item.flash{background:var(--nacc-soft)}
|
|
120
|
+
.dsh-note-row{display:flex;align-items:baseline;gap:6px;min-width:0}
|
|
121
|
+
.dsh-note-kind-ic{flex-shrink:0;font-size:12px;line-height:1;transform:translateY(1px);width:13px;text-align:center}
|
|
122
|
+
.dsh-note-kind-note{color:var(--nkind-note)}
|
|
123
|
+
.dsh-note-kind-decision{color:var(--nkind-decision)}
|
|
124
|
+
.dsh-note-kind-todo{color:var(--nkind-todo)}
|
|
125
|
+
.dsh-note-kind-link{color:var(--nkind-link)}
|
|
126
|
+
.dsh-note-kind-quote{color:var(--nkind-quote)}
|
|
127
|
+
.dsh-note-title{flex:1;min-width:0;font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ntx);padding-right:0}
|
|
128
|
+
.dsh-note-title-text{cursor:default}
|
|
129
|
+
.dsh-note-date{flex-shrink:0;font-size:11px;color:var(--nt3);font-weight:400}
|
|
130
|
+
.dsh-note-meta{display:flex;align-items:center;gap:6px;margin-top:1px;padding-left:19px;min-width:0;flex-wrap:wrap}
|
|
131
|
+
.dsh-note-inject{font-size:10px;color:var(--nacc);background:var(--nacc-soft);border-radius:5px;padding:0 6px;line-height:1.6;flex-shrink:0;font-weight:600;white-space:nowrap}
|
|
132
|
+
.dsh-note-meta-topic{font-size:11px;color:var(--nt2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px;flex-shrink:0}
|
|
133
|
+
.dsh-note-meta-sess{font-size:10px;color:var(--nt3);white-space:nowrap;flex-shrink:0}
|
|
134
|
+
.dsh-note-meta-tags{font-size:10px;color:var(--nt3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
|
|
135
|
+
.dsh-note-preview{display:none} /* Apple Notes 默认不显示预览,保持列表极简 */
|
|
136
|
+
.dsh-note-delete{position:absolute;right:6px;top:8px;background:var(--nbg);border:1px solid var(--nbd);color:var(--nt3);font-size:11px;cursor:pointer;padding:3px 7px;border-radius:6px;opacity:0;transition:all .12s;line-height:1;font-weight:500}
|
|
137
|
+
.dsh-note-delete:hover{color:#ff3b30;border-color:rgba(255,59,48,.4)}
|
|
138
|
+
.dsh-note-jump{display:none} /* 跳转并入 meta 里的会话,不再单独按钮 */
|
|
139
|
+
.dsh-note-topic-picker{display:none} /* 主题改到详情区编辑,列表不再内联选择器 */
|
|
140
|
+
|
|
141
|
+
/* ===== 详情区(阅读 + 编辑) ===== */
|
|
142
|
+
.dsh-notes-editor{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden;background:var(--nbg)}
|
|
143
|
+
.dsh-notes-editor-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--nt3);gap:12px;padding:30px;text-align:center;font-size:13px;background:var(--nbg)}
|
|
144
|
+
.dsh-notes-editor-empty-ic{font-size:34px;opacity:.5;line-height:1}
|
|
145
|
+
.dsh-notes-editor-empty-t{font-size:15px;font-weight:600;color:var(--nt2)}
|
|
146
|
+
.dsh-notes-editor-empty-s{font-size:12px;color:var(--nt3)}
|
|
147
|
+
|
|
148
|
+
/* 详情头部:标题 + 元信息行 */
|
|
149
|
+
.dsh-notes-ed-head{padding:16px 20px 0;flex-shrink:0}
|
|
150
|
+
.dsh-notes-editor-title{background:transparent;border:none;outline:none;color:var(--ntx);font-size:17px;font-weight:600;font-family:var(--nfont);padding:0;margin:0 0 10px;width:100%;box-sizing:border-box;letter-spacing:.2px}
|
|
151
|
+
.dsh-notes-editor-title::placeholder{color:var(--nt3)}
|
|
152
|
+
.dsh-notes-ed-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-bottom:12px;border-bottom:1px solid var(--nbd-soft)}
|
|
153
|
+
.dsh-notes-ed-meta-item{display:flex;align-items:center;gap:5px;font-size:12px;color:var(--nt2)}
|
|
154
|
+
.dsh-notes-ed-meta-label{font-size:11px;color:var(--nt3)}
|
|
155
|
+
.dsh-notes-ed-select{background:transparent;border:1px solid var(--nbd);border-radius:6px;color:var(--ntx);font-size:12px;padding:4px 8px;font-family:var(--nfont);outline:none;cursor:pointer}
|
|
156
|
+
.dsh-notes-ed-select:focus{border-color:var(--nacc)}
|
|
157
|
+
.dsh-notes-ed-topic{background:transparent;border:1px solid transparent;border-radius:6px;color:var(--nacc);font-size:12px;padding:4px 8px;font-family:var(--nfont);outline:none;max-width:140px;transition:border-color .15s,background .15s}
|
|
158
|
+
.dsh-notes-ed-topic:hover{background:var(--nbg-hover)}
|
|
159
|
+
.dsh-notes-ed-topic:focus{border-color:var(--nacc);background:var(--nbg)}
|
|
160
|
+
.dsh-notes-ed-inject{background:transparent;border:1px solid var(--nbd);border-radius:6px;color:var(--nt2);font-size:11px;padding:4px 8px;font-family:var(--nmono);outline:none;width:120px}
|
|
161
|
+
.dsh-notes-ed-inject:focus{border-color:var(--nacc);color:var(--ntx)}
|
|
162
|
+
.dsh-notes-ed-meta-right{margin-left:auto;display:flex;gap:4px;align-items:center}
|
|
163
|
+
.dsh-notes-ed-sess{font-size:11px;color:var(--nt3);font-family:var(--nmono)}
|
|
164
|
+
/* 注入控制行(独立开关按钮 + 范围多选 chips) */
|
|
165
|
+
.dsh-notes-ed-injectrow{display:flex;align-items:flex-start;gap:10px;margin-top:10px;padding-top:10px;border-top:1px dashed var(--nbd-soft);flex-wrap:wrap}
|
|
166
|
+
.dsh-notes-ed-inject-btn{background:transparent;border:1px solid var(--nbd);border-radius:6px;color:var(--nt2);font-size:12px;padding:4px 12px;cursor:pointer;transition:all .15s;font-family:var(--nfont);flex-shrink:0}
|
|
167
|
+
.dsh-notes-ed-inject-btn:hover{border-color:var(--nacc);color:var(--nacc)}
|
|
168
|
+
.dsh-notes-ed-inject-btn.on{background:var(--nacc-soft);border-color:var(--nacc);color:var(--nacc);font-weight:600}
|
|
169
|
+
/* 注入控制行(独立开关按钮 + 逐级范围浮层) */
|
|
170
|
+
.dsh-notes-ed-injectrow{display:flex;align-items:center;gap:10px;margin-top:10px;padding-top:10px;border-top:1px dashed var(--nbd-soft)}
|
|
171
|
+
.dsh-notes-ed-inject-btn{background:transparent;border:1px solid var(--nbd);border-radius:6px;color:var(--nt2);font-size:12px;padding:4px 12px;cursor:pointer;transition:all .15s;font-family:var(--nfont);flex-shrink:0}
|
|
172
|
+
.dsh-notes-ed-inject-btn:hover{border-color:var(--nacc);color:var(--nacc)}
|
|
173
|
+
.dsh-notes-ed-inject-btn.on{background:var(--nacc-soft);border-color:var(--nacc);color:var(--nacc);font-weight:600}
|
|
174
|
+
/* 范围浮层触发按钮 */
|
|
175
|
+
.dsh-notes-ed-scope-wrap{position:relative;flex:1;min-width:0}
|
|
176
|
+
.dsh-notes-scope-trigger{background:transparent;border:1px solid var(--nbd);border-radius:6px;color:var(--ntx);font-size:12px;padding:4px 10px;cursor:pointer;transition:border-color .15s;font-family:var(--nfont);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
|
|
177
|
+
.dsh-notes-scope-trigger:hover{border-color:var(--nacc)}
|
|
178
|
+
.dsh-notes-scope-caret{color:var(--nt3);font-size:10px}
|
|
179
|
+
/* 逐级浮层面板 */
|
|
180
|
+
.dsh-notes-scope-panel{position:absolute;top:calc(100% + 4px);left:0;min-width:230px;max-width:300px;max-height:280px;overflow-y:auto;background:var(--nbg);border:1px solid var(--nbd);border-radius:10px;box-shadow:var(--nshadow);padding:6px;z-index:30;font-family:var(--nfont)}
|
|
181
|
+
.dsh-notes-scope-item{display:flex;align-items:center;gap:7px;padding:6px 9px;font-size:12px;color:var(--ntx);cursor:pointer;border-radius:6px;user-select:none;transition:background .12s}
|
|
182
|
+
.dsh-notes-scope-item:hover{background:var(--nbg-hover)}
|
|
183
|
+
.dsh-notes-scope-item input{accent-color:var(--nacc);cursor:pointer;margin:0;flex-shrink:0}
|
|
184
|
+
.dsh-notes-scope-sep{font-size:10px;color:var(--nt3);padding:8px 9px 3px;font-weight:600;letter-spacing:.4px;border-top:1px solid var(--nbd-soft);margin-top:4px}
|
|
185
|
+
.dsh-notes-scope-group{margin-bottom:2px}
|
|
186
|
+
.dsh-notes-scope-ws{font-size:10px;color:var(--nt2);padding:5px 9px 2px;font-weight:600}
|
|
187
|
+
.dsh-notes-scope-sess{padding-left:20px}
|
|
188
|
+
/* ===== 派发对话框(modal) ===== */
|
|
189
|
+
.dsh-notes-dispatch-mask{position:fixed;inset:0;background:rgba(0,0,0,.28);z-index:60;display:flex;align-items:center;justify-content:center}
|
|
190
|
+
.dsh-notes-dispatch-modal{width:340px;max-width:90%;background:var(--nbg);border:1px solid var(--nbd);border-radius:14px;box-shadow:0 20px 60px rgba(0,0,0,.3);padding:16px;font-family:var(--nfont);max-height:80vh;overflow-y:auto}
|
|
191
|
+
.dsh-notes-dispatch-modal-t{font-size:14px;font-weight:700;color:var(--ntx);margin-bottom:10px}
|
|
192
|
+
.dsh-notes-dispatch-todo{background:var(--nbg-soft);border:1px solid var(--nbd-soft);border-radius:8px;padding:9px 11px;margin-bottom:10px}
|
|
193
|
+
.dsh-notes-dispatch-todo-t{font-size:12px;font-weight:600;color:var(--ntx);margin-bottom:3px}
|
|
194
|
+
.dsh-notes-dispatch-todo-b{font-size:11px;color:var(--nt3);line-height:1.5;max-height:60px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}
|
|
195
|
+
.dsh-notes-dispatch-instr{width:100%;box-sizing:border-box;background:var(--nbg);border:1px solid var(--nbd);border-radius:8px;color:var(--ntx);font-size:12px;padding:8px 10px;resize:vertical;font-family:var(--nfont);margin-bottom:10px;outline:none}
|
|
196
|
+
.dsh-notes-dispatch-instr:focus{border-color:var(--nacc)}
|
|
197
|
+
.dsh-notes-dispatch-modes{display:flex;gap:6px;margin-bottom:10px}
|
|
198
|
+
.dsh-notes-dispatch-mode{flex:1;background:transparent;border:1px solid var(--nbd);border-radius:7px;color:var(--nt2);font-size:12px;padding:6px;cursor:pointer;transition:all .15s;font-family:var(--nfont)}
|
|
199
|
+
.dsh-notes-dispatch-mode:hover{border-color:var(--nacc)}
|
|
200
|
+
.dsh-notes-dispatch-mode.on{background:var(--nacc-soft);border-color:var(--nacc);color:var(--nacc);font-weight:600}
|
|
201
|
+
.dsh-notes-dispatch-select{width:100%;box-sizing:border-box;background:var(--nbg);border:1px solid var(--nbd);border-radius:7px;color:var(--ntx);font-size:12px;padding:6px 8px;margin-bottom:8px;font-family:var(--nfont);outline:none}
|
|
202
|
+
.dsh-notes-dispatch-select:focus{border-color:var(--nacc)}
|
|
203
|
+
.dsh-notes-dispatch-select:disabled{opacity:.5;cursor:not-allowed}
|
|
204
|
+
.dsh-notes-dispatch-err{font-size:11px;color:var(--nkind-todo);margin-bottom:8px}
|
|
205
|
+
.dsh-notes-dispatch-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}
|
|
206
|
+
.dsh-notes-dispatch-cancel{background:transparent;border:1px solid var(--nbd);border-radius:7px;color:var(--nt2);font-size:12px;padding:6px 16px;cursor:pointer;font-family:var(--nfont)}
|
|
207
|
+
.dsh-notes-dispatch-cancel:hover{border-color:var(--nt3);color:var(--ntx)}
|
|
208
|
+
.dsh-notes-dispatch-ok{background:var(--nacc);border:none;border-radius:7px;color:#fff;font-size:12px;font-weight:600;padding:6px 16px;cursor:pointer;font-family:var(--nfont)}
|
|
209
|
+
.dsh-notes-dispatch-ok:hover{filter:brightness(1.08)}
|
|
210
|
+
.dsh-notes-dispatch-ok:disabled{opacity:.5;cursor:not-allowed}
|
|
211
|
+
/* ===== 派发历史(详情区) ===== */
|
|
212
|
+
.dsh-notes-dispatch-history{margin-top:10px;padding-top:10px;border-top:1px dashed var(--nbd-soft)}
|
|
213
|
+
.dsh-notes-dispatch-history-t{font-size:11px;font-weight:600;color:var(--nt2);margin-bottom:6px}
|
|
214
|
+
.dsh-notes-dispatch-rec{padding:5px 8px;border-radius:6px;background:var(--nbg-soft);margin-bottom:4px}
|
|
215
|
+
.dsh-notes-dispatch-rec-top{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
|
|
216
|
+
.dsh-notes-dispatch-rec-t{font-size:11px;font-weight:600;color:var(--nacc)}
|
|
217
|
+
.dsh-notes-dispatch-rec-m{font-size:10px;color:var(--nt3);flex-shrink:0}
|
|
218
|
+
.dsh-notes-dispatch-rec-i{font-size:10px;color:var(--nt2);margin-top:2px;line-height:1.4}
|
|
219
|
+
.dsh-notes-dispatch-rec.done{opacity:.55}
|
|
220
|
+
.dsh-notes-dispatch-rec.done .dsh-notes-dispatch-rec-t{color:var(--nt3)}
|
|
221
|
+
.dsh-notes-dispatch-done-btn{margin-top:4px;background:transparent;border:1px solid var(--nbd);border-radius:5px;color:var(--nkind-note);font-size:10px;padding:1px 8px;cursor:pointer;font-family:var(--nfont);transition:all .15s}
|
|
222
|
+
.dsh-notes-dispatch-done-btn:hover{border-color:var(--nkind-note);background:rgba(52,199,89,.1)}
|
|
223
|
+
|
|
224
|
+
/* 详情操作按钮(右上角 icon) */
|
|
225
|
+
.dsh-notes-ed-action{background:transparent;border:1px solid var(--nbd);border-radius:6px;color:var(--nt2);font-size:12px;cursor:pointer;padding:4px 10px;line-height:1;transition:all .15s;font-family:var(--nfont)}
|
|
226
|
+
.dsh-notes-ed-action:hover{background:var(--nbg-hover);color:var(--ntx)}
|
|
227
|
+
.dsh-notes-ed-action.on{background:var(--nacc-soft);border-color:var(--nacc);color:var(--nacc)}
|
|
228
|
+
.dsh-notes-ed-action.danger:hover{color:#ff3b30;border-color:rgba(255,59,48,.4);background:rgba(255,59,48,.06)}
|
|
229
|
+
|
|
230
|
+
/* 正文(无边框、宽行高、自动保存) */
|
|
231
|
+
.dsh-notes-editor-body{flex:1;min-height:0;background:transparent;border:none;outline:none;color:var(--ntx);padding:14px 20px 20px;font-size:14px;font-family:var(--nfont);line-height:1.65;resize:none;margin:0;box-sizing:border-box;letter-spacing:.1px}
|
|
232
|
+
.dsh-notes-editor-body::placeholder{color:var(--nt3)}
|
|
233
|
+
.dsh-notes-editor-body.mono{font-family:var(--nmono);font-size:13px;line-height:1.6}
|
|
234
|
+
|
|
235
|
+
/* 详情底部:轻量状态条(保存提示 + 字数) */
|
|
236
|
+
.dsh-notes-ed-foot{display:flex;align-items:center;justify-content:space-between;padding:6px 20px 10px;font-size:11px;color:var(--nt3);flex-shrink:0;border-top:1px solid var(--nbd-soft)}
|
|
237
|
+
.dsh-notes-ed-saved{opacity:0;transition:opacity .2s;color:var(--nkind-todo)}
|
|
238
|
+
.dsh-notes-ed-saved.show{opacity:1}
|
|
239
|
+
|
|
240
|
+
/* ===== 状态与反馈 ===== */
|
|
241
|
+
.dsh-notes-empty,.dsh-notes-loading{padding:40px 20px;color:var(--nt3);font-size:12px;text-align:center}
|
|
242
|
+
/* 空状态引导 */
|
|
243
|
+
.dsh-notes-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:44px 20px;text-align:center;gap:6px}
|
|
244
|
+
.dsh-notes-empty-ic{font-size:34px;opacity:.4;line-height:1;margin-bottom:4px}
|
|
245
|
+
.dsh-notes-empty-t{font-size:14px;font-weight:600;color:var(--nt2)}
|
|
246
|
+
.dsh-notes-empty-s{font-size:12px;color:var(--nt3);line-height:1.6;max-width:220px}
|
|
247
|
+
.dsh-notes-empty-btn{margin-top:10px;background:var(--nacc);color:#fff;border:none;border-radius:var(--nr-md);padding:7px 18px;font-size:12px;font-weight:500;cursor:pointer;transition:filter .15s;font-family:var(--nfont)}
|
|
248
|
+
.dsh-notes-empty-btn:hover{filter:brightness(1.06)}
|
|
249
|
+
/* 搜索高亮(琥珀色,深浅通用;明暗随 DSH 主题,不再用系统级 prefers-color-scheme) */
|
|
250
|
+
.dsh-notes-mark{background:rgba(255,213,79,.35);color:inherit;border-radius:2px;padding:0 1px}
|
|
251
|
+
.dsh-notes-more{padding:10px 14px;color:var(--nt3);font-size:11px;text-align:center;user-select:none}
|
|
252
|
+
.dsh-notes-error{padding:10px 16px;color:#ff3b30;font-size:12px}
|
|
253
|
+
.dsh-notes-toast{position:fixed;top:70px;left:50%;transform:translateX(-50%);z-index:2147483646;background:rgba(28,28,30,.96);color:#fff;border-radius:8px;padding:9px 16px;font-size:12px;box-shadow:0 8px 30px rgba(0,0,0,.3);opacity:0;transition:opacity .2s;pointer-events:none;font-family:var(--nfont)}
|
|
254
|
+
.dsh-notes-toast.show{opacity:1}
|
|
255
|
+
|
|
256
|
+
/* ===== 帮助气泡(极简) ===== */
|
|
257
|
+
.dsh-notes-help-bubble{position:absolute;top:52px;right:14px;width:290px;background:var(--nbg);border:1px solid var(--nbd);border-radius:10px;padding:14px 16px;font-size:12px;line-height:1.7;color:var(--ntx);z-index:20;box-shadow:var(--nshadow)}
|
|
258
|
+
.dsh-notes-help-bubble h4{margin:0 0 8px;font-size:13px;font-weight:600;color:var(--ntx)}
|
|
259
|
+
.dsh-notes-help-bubble ul{margin:0;padding-left:16px}
|
|
260
|
+
.dsh-notes-help-bubble li{margin-bottom:5px;color:var(--nt2)}
|
|
261
|
+
.dsh-notes-help-bubble kbd{background:var(--nbg-hover);padding:1px 5px;border-radius:4px;font-size:10px;font-family:var(--nmono);border:1px solid var(--nbd)}
|
|
262
|
+
.dsh-notes-help-close{position:absolute;top:8px;right:10px;background:none;border:none;color:var(--nt3);font-size:15px;cursor:pointer;padding:2px 6px;border-radius:5px;line-height:1}
|
|
263
|
+
.dsh-notes-help-close:hover{background:var(--nbg-hover);color:var(--ntx)}
|
|
264
|
+
|
|
265
|
+
/* ===== 选区快速记录浮动按钮 ===== */
|
|
266
|
+
/* 注意:此按钮 position:fixed 且不在 .dsh-notes-floating 内,拿不到面板的设计令牌变量,必须用具体颜色值 */
|
|
267
|
+
.dsh-notes-sel-btn{position:fixed;z-index:2147483646;background:#0a84ff;color:#fff;border:none;border-radius:8px;padding:7px 14px;font-size:12px;font-weight:600;cursor:pointer;box-shadow:0 4px 16px rgba(10,132,255,.5),0 1px 3px rgba(0,0,0,.2);line-height:1;white-space:nowrap;transition:filter .15s,transform .1s;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",system-ui,sans-serif}
|
|
268
|
+
.dsh-notes-sel-btn:hover{filter:brightness(1.08);transform:translateY(-1px)}
|
|
269
|
+
|
|
270
|
+
/* ===== T3 选区指令框(划选后弹出:预览 + 备注输入 + 记录/取消) ===== */
|
|
271
|
+
/* 浮层 position:fixed 不在 .dsh-notes-floating 内,故在此声明 --n* 令牌(映射 DSH 主题 token,明暗自动切换;缺失回退浅色) */
|
|
272
|
+
.dsh-notes-instruct-box{
|
|
273
|
+
--nbg:var(--dsw-alias-bg-overlay,#ffffff);
|
|
274
|
+
--nbd:var(--dsw-alias-border-l1,#e5e5ea);
|
|
275
|
+
--ntx:var(--dsw-alias-label-primary,#1c1c1e);
|
|
276
|
+
--nt2:var(--dsw-alias-label-secondary,#6c6c70);
|
|
277
|
+
--nt3:var(--dsw-alias-label-secondary,#aeaeb2);
|
|
278
|
+
--nacc:var(--dsw-alias-brand-primary,#0a84ff);
|
|
279
|
+
--nbg-hover:var(--dsw-alias-bg-layer-2,#f2f2f7);
|
|
280
|
+
--nr-md:8px;
|
|
281
|
+
--nfont:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
|
|
282
|
+
position:fixed;z-index:2147483646;width:320px;background:var(--nbg);border:1px solid var(--nbd);border-radius:12px;
|
|
283
|
+
box-shadow:0 18px 50px rgba(0,0,0,.12),0 2px 8px rgba(0,0,0,.06);box-sizing:border-box;font-family:var(--nfont);color:var(--ntx);overflow:hidden;padding:0
|
|
284
|
+
}
|
|
285
|
+
.dsh-notes-instruct-preview{font-size:12px;line-height:1.45;color:var(--nt2);background:var(--nbg-hover);padding:8px 11px;max-height:60px;overflow:hidden;white-space:normal;word-break:break-word;border-bottom:1px solid var(--nbd)}
|
|
286
|
+
.dsh-notes-instruct-input{width:100%;box-sizing:border-box;background:var(--nbg);border:none;border-bottom:1px solid var(--nbd);color:var(--ntx);padding:9px 11px;font-size:13px;font-family:var(--nfont);outline:none;line-height:1.5}
|
|
287
|
+
.dsh-notes-instruct-input::placeholder{color:var(--nt3)}
|
|
288
|
+
.dsh-notes-instruct-input:focus{background:var(--nbg-hover)}
|
|
289
|
+
.dsh-notes-instruct-actions{display:flex;gap:8px;padding:8px 11px;justify-content:flex-end}
|
|
290
|
+
.dsh-notes-instruct-btn{background:transparent;border:1px solid var(--nbd);border-radius:var(--nr-md);color:var(--nt2);padding:6px 14px;cursor:pointer;font-size:12px;font-weight:500;font-family:var(--nfont);line-height:1;transition:all .15s}
|
|
291
|
+
.dsh-notes-instruct-btn:hover{border-color:var(--nt3);color:var(--ntx)}
|
|
292
|
+
.dsh-notes-instruct-btn.primary{background:var(--nacc);color:#fff;border-color:var(--nacc)}
|
|
293
|
+
.dsh-notes-instruct-btn.primary:hover{filter:brightness(1.06);color:#fff}
|
|
294
|
+
|
|
295
|
+
/* ===== 旧类名兼容(已废弃,保留避免渲染期报错;后续清理 client 引用) ===== */
|
|
296
|
+
.dsh-notes-capture{padding:10px 14px;border-bottom:1px solid var(--nbd-soft);display:flex;gap:8px;background:var(--nbg);flex-shrink:0;align-items:flex-end}
|
|
297
|
+
.dsh-notes-capture-input{flex:1;min-width:0;background:var(--nbg-hover);border:1px solid transparent;border-radius:var(--nr-md);color:var(--ntx);padding:8px 11px;font-size:13px;resize:none;height:36px;min-height:36px;max-height:110px;font-family:var(--nfont);box-sizing:border-box;transition:border-color .15s,background .15s;line-height:1.5;outline:none}
|
|
298
|
+
.dsh-notes-capture-input:focus{border-color:var(--nacc);background:var(--nbg)}
|
|
299
|
+
.dsh-notes-capture-btn{background:var(--nacc);color:#fff;border:none;border-radius:var(--nr-md);padding:0 15px;height:36px;cursor:pointer;font-size:13px;font-weight:500;white-space:nowrap;flex-shrink:0;transition:filter .15s}
|
|
300
|
+
.dsh-notes-capture-btn:hover:not(:disabled){filter:brightness(1.06)}
|
|
301
|
+
.dsh-notes-capture-btn:disabled{opacity:.4;cursor:default}
|
|
302
|
+
.dsh-notes-capture-btn.saved{background:#34c759}
|
|
303
|
+
.dsh-notes-editor-row{display:flex;gap:8px;margin:0 14px 8px;flex-shrink:0}
|
|
304
|
+
.dsh-notes-editor-topic,.dsh-notes-editor-tags{background:var(--nbg-hover);border:1px solid transparent;border-radius:var(--nr-md);padding:8px 11px;font-size:12px;font-family:var(--nfont);box-sizing:border-box;outline:none;color:var(--ntx)}
|
|
305
|
+
.dsh-notes-editor-topic:focus,.dsh-notes-editor-tags:focus{border-color:var(--nacc);background:var(--nbg)}
|
|
306
|
+
.dsh-notes-editor-topic{flex:1;min-width:0}
|
|
307
|
+
.dsh-notes-editor-tags{flex:1.5;min-width:0}
|
|
308
|
+
.dsh-notes-editor-actions{padding:0 14px 14px;display:flex;gap:8px;flex-shrink:0}
|
|
309
|
+
.dsh-notes-save-btn{background:var(--nacc);color:#fff;border:none;border-radius:var(--nr-md);padding:8px 16px;cursor:pointer;font-size:13px;font-weight:500;transition:filter .15s}
|
|
310
|
+
.dsh-notes-save-btn:hover{filter:brightness(1.06)}
|
|
311
|
+
.dsh-notes-delete-btn{background:transparent;color:var(--nt3);border:1px solid var(--nbd);border-radius:var(--nr-md);padding:8px 16px;cursor:pointer;font-size:13px;font-weight:500;transition:all .15s}
|
|
312
|
+
.dsh-notes-delete-btn:hover{color:#ff3b30;border-color:rgba(255,59,48,.4)}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-notes-plugin",
|
|
3
|
+
"description": "DeepSeek Harness 会话感知本地笔记:把会话里的决策与约定沉淀成本地 Markdown 笔记,自动注入系统提示、可派发给活跃会话,解决「聊完就丢」的上下文断层",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.mjs",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"check": "node --check index.mjs && node --check lib/client.js",
|
|
9
|
+
"prepublishOnly": "node --check index.mjs && node --check lib/client.js"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./index.mjs",
|
|
13
|
+
"./client": "./lib/client.js",
|
|
14
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"dsh": {
|
|
18
|
+
"bundle": {
|
|
19
|
+
"patch": "./cordis.patch.yml"
|
|
20
|
+
},
|
|
21
|
+
"client": {
|
|
22
|
+
"inject": [
|
|
23
|
+
"@deepseek-ai/dsh-client-runtime"
|
|
24
|
+
],
|
|
25
|
+
"platform": "web"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"index.mjs",
|
|
30
|
+
"lib/client.js",
|
|
31
|
+
"lib/styles.css",
|
|
32
|
+
"cordis.patch.yml",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"keywords": [
|
|
36
|
+
"dsh",
|
|
37
|
+
"dsh-plugin",
|
|
38
|
+
"deepseek-harness",
|
|
39
|
+
"notes",
|
|
40
|
+
"markdown"
|
|
41
|
+
],
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/PPawnsir/dsh-notes-plugin.git",
|
|
45
|
+
"directory": "packages/dsh-notes"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/PPawnsir/dsh-notes-plugin#readme",
|
|
48
|
+
"bugs": "https://github.com/PPawnsir/dsh-notes-plugin/issues",
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=22"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"react": ">=18",
|
|
54
|
+
"@deepseek-ai/dsh": ">=0.1.5-rc.1 <0.2.0-0"
|
|
55
|
+
},
|
|
56
|
+
"license": "MIT"
|
|
57
|
+
}
|