copyhub-cli 1.0.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.
@@ -0,0 +1,224 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>CopyHub</title>
7
+ <style>
8
+ :root {
9
+ --bg: #ffffff;
10
+ --surface: #f8f9fc;
11
+ --surface-hover: #f0f2f7;
12
+ --border: #e6e8ef;
13
+ --text: #1a1d26;
14
+ --text-muted: #5c6370;
15
+ --text-faint: #8b919d;
16
+ --accent: #3d5afe;
17
+ --accent-soft: rgba(61, 90, 254, 0.08);
18
+ --shadow: 0 1px 3px rgba(26, 29, 38, 0.06), 0 1px 2px rgba(26, 29, 38, 0.04);
19
+ --shadow-hover: 0 4px 14px rgba(26, 29, 38, 0.08), 0 2px 6px rgba(26, 29, 38, 0.05);
20
+ --radius: 12px;
21
+ --scrollbar-track: #f0f2f5;
22
+ --scrollbar-thumb: #c5cad6;
23
+ --scrollbar-thumb-hover: #a8afc0;
24
+ }
25
+
26
+ * { box-sizing: border-box; }
27
+
28
+ html, body {
29
+ margin: 0;
30
+ height: 100%;
31
+ overflow: hidden;
32
+ font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
33
+ background: var(--bg);
34
+ color: var(--text);
35
+ border-radius: 10px;
36
+ /* Subtle inset border for frameless window */
37
+ box-shadow: inset 0 0 0 1px var(--border);
38
+ }
39
+
40
+ body {
41
+ display: flex;
42
+ flex-direction: column;
43
+ }
44
+
45
+ /* Drag region for Electron; thin strip only — no full title bar */
46
+ #drag-strip {
47
+ flex-shrink: 0;
48
+ height: 32px;
49
+ -webkit-app-region: drag;
50
+ app-region: drag;
51
+ background: linear-gradient(180deg, #fafbfc 0%, var(--bg) 100%);
52
+ border-bottom: 1px solid var(--border);
53
+ border-radius: 10px 10px 0 0;
54
+ cursor: grab;
55
+ }
56
+
57
+ #drag-strip:active {
58
+ cursor: grabbing;
59
+ }
60
+
61
+ #list {
62
+ flex: 1;
63
+ min-height: 0;
64
+ overflow-y: auto;
65
+ overflow-x: hidden;
66
+ padding: 10px 12px 14px;
67
+ -webkit-app-region: no-drag;
68
+ app-region: no-drag;
69
+
70
+ scrollbar-width: thin;
71
+ scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
72
+ }
73
+
74
+ #list::-webkit-scrollbar {
75
+ width: 8px;
76
+ }
77
+
78
+ #list::-webkit-scrollbar-track {
79
+ background: var(--scrollbar-track);
80
+ border-radius: 100px;
81
+ margin: 6px 0;
82
+ }
83
+
84
+ #list::-webkit-scrollbar-thumb {
85
+ background: var(--scrollbar-thumb);
86
+ border-radius: 100px;
87
+ border: 2px solid var(--scrollbar-track);
88
+ background-clip: padding-box;
89
+ min-height: 40px;
90
+ }
91
+
92
+ #list::-webkit-scrollbar-thumb:hover {
93
+ background: var(--scrollbar-thumb-hover);
94
+ border-color: var(--scrollbar-track);
95
+ background-clip: padding-box;
96
+ }
97
+
98
+ #list::-webkit-scrollbar-corner {
99
+ background: transparent;
100
+ }
101
+
102
+ .row {
103
+ padding: 12px 14px;
104
+ margin-bottom: 10px;
105
+ border-radius: var(--radius);
106
+ background: var(--surface);
107
+ border: 1px solid var(--border);
108
+ box-shadow: var(--shadow);
109
+ cursor: pointer;
110
+ transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
111
+ }
112
+
113
+ .row:last-child {
114
+ margin-bottom: 2px;
115
+ }
116
+
117
+ .row:hover {
118
+ border-color: rgba(61, 90, 254, 0.35);
119
+ background: var(--surface-hover);
120
+ box-shadow: var(--shadow-hover);
121
+ }
122
+
123
+ .row:active {
124
+ transform: scale(0.995);
125
+ }
126
+
127
+ .row .ts {
128
+ font-size: 11px;
129
+ font-variant-numeric: tabular-nums;
130
+ color: var(--text-faint);
131
+ letter-spacing: 0.02em;
132
+ margin-bottom: 6px;
133
+ }
134
+
135
+ .row .txt {
136
+ white-space: pre-wrap;
137
+ word-break: break-word;
138
+ max-height: 5.2em;
139
+ overflow: hidden;
140
+ font-size: 14px;
141
+ font-weight: 500;
142
+ color: var(--text);
143
+ line-height: 1.4;
144
+ }
145
+
146
+ .row .sync {
147
+ font-size: 11px;
148
+ color: var(--accent);
149
+ margin-top: 8px;
150
+ font-weight: 500;
151
+ }
152
+
153
+ .row:not(.synced) .sync {
154
+ display: none;
155
+ }
156
+
157
+ #empty {
158
+ padding: 28px 18px;
159
+ text-align: center;
160
+ font-size: 13px;
161
+ line-height: 1.65;
162
+ color: var(--text-muted);
163
+ max-width: 320px;
164
+ margin: 0 auto;
165
+ }
166
+
167
+ #err {
168
+ color: #b71c1c;
169
+ background: #ffebee;
170
+ border: 1px solid #ffcdd2;
171
+ padding: 12px 14px;
172
+ margin: 8px 12px;
173
+ border-radius: var(--radius);
174
+ font-size: 13px;
175
+ }
176
+ </style>
177
+ </head>
178
+ <body>
179
+ <div id="drag-strip" title="Drag to move window"></div>
180
+ <div id="list"></div>
181
+ <script>
182
+ const listEl = document.getElementById('list');
183
+
184
+ async function refresh() {
185
+ listEl.innerHTML = '';
186
+ const res = await window.copyhub.getHistory();
187
+ if (res && res.error) {
188
+ const e = document.createElement('div');
189
+ e.id = 'err';
190
+ e.textContent = res.error;
191
+ listEl.appendChild(e);
192
+ return;
193
+ }
194
+ const rows = res && Array.isArray(res.items) ? res.items : [];
195
+ if (!rows.length) {
196
+ const d = document.createElement('div');
197
+ d.id = 'empty';
198
+ d.textContent =
199
+ 'No history yet — run copyhub start and copy something. Click a row to copy again; click outside or Esc to close.';
200
+ listEl.appendChild(d);
201
+ return;
202
+ }
203
+ for (const r of rows) {
204
+ const div = document.createElement('div');
205
+ div.className = 'row' + (r.synced ? ' synced' : '');
206
+ div.innerHTML =
207
+ '<div class="ts"></div><div class="txt"></div><div class="sync"></div>';
208
+ div.querySelector('.ts').textContent = r.ts || '';
209
+ div.querySelector('.txt').textContent = r.text || '';
210
+ div.querySelector('.sync').textContent = 'Synced to Sheet';
211
+ div.addEventListener('click', () => {
212
+ window.copyhub.copyPick(r.text || '');
213
+ });
214
+ listEl.appendChild(div);
215
+ }
216
+ }
217
+
218
+ window.copyhub.onOpen(() => {
219
+ void refresh();
220
+ });
221
+ void refresh();
222
+ </script>
223
+ </body>
224
+ </html>