slicejs-web-framework 3.3.7 → 3.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,420 +1,421 @@
1
- /**
2
- * ContextManager debug panel.
3
- */
4
- export default class ContextManagerDebugger extends HTMLElement {
5
- constructor() {
6
- super();
7
- this.isOpen = false;
8
- this.filterText = '';
9
- }
10
-
11
- /**
12
- * Initialize panel UI.
13
- * @returns {Promise<void>}
14
- */
15
- async init() {
16
- this.innerHTML = this.renderTemplate();
17
- slice.stylesManager.registerComponentStyles('ContextManagerDebugger', this.renderStyles());
18
- this.cacheElements();
19
- this.bindEvents();
20
- this.makeDraggable();
21
- this.renderList();
22
- }
23
-
24
- /**
25
- * Toggle panel visibility.
26
- * @returns {void}
27
- */
28
- toggle() {
29
- this.isOpen = !this.isOpen;
30
- this.container.classList.toggle('active', this.isOpen);
31
- if (this.isOpen) {
32
- this.renderList();
33
- }
34
- }
35
-
36
- /**
37
- * Show panel.
38
- * @returns {void}
39
- */
40
- open() {
41
- this.isOpen = true;
42
- this.container.classList.add('active');
43
- this.renderList();
44
- }
45
-
46
- /**
47
- * Hide panel.
48
- * @returns {void}
49
- */
50
- close() {
51
- this.isOpen = false;
52
- this.container.classList.remove('active');
53
- }
54
-
55
- cacheElements() {
56
- this.container = this.querySelector('#context-debugger');
57
- this.header = this.querySelector('.context-header');
58
- this.list = this.querySelector('#context-list');
59
- this.filterInput = this.querySelector('#context-filter');
60
- this.countLabel = this.querySelector('#context-count');
61
- this.refreshButton = this.querySelector('#context-refresh');
62
- this.closeButton = this.querySelector('#context-close');
63
- }
64
-
65
- bindEvents() {
66
- this.refreshButton.addEventListener('click', () => this.renderList());
67
- this.closeButton.addEventListener('click', () => this.close());
68
- this.filterInput.addEventListener('input', (event) => {
69
- this.filterText = event.target.value.trim().toLowerCase();
70
- this.renderList();
71
- });
72
- }
73
-
74
- makeDraggable() {
75
- if (!this.header || !this.container) return;
76
-
77
- let offset = { x: 0, y: 0 };
78
- let isDragging = false;
79
-
80
- this.header.style.cursor = 'grab';
81
-
82
- this.header.addEventListener('mousedown', (event) => {
83
- if (event.target.closest('.btn')) return;
84
- isDragging = true;
85
- offset.x = event.clientX - this.container.getBoundingClientRect().left;
86
- offset.y = event.clientY - this.container.getBoundingClientRect().top;
87
- this.header.style.cursor = 'grabbing';
88
- });
89
-
90
- document.addEventListener('mousemove', (event) => {
91
- if (!isDragging) return;
92
- const rect = this.container.getBoundingClientRect();
93
- const maxX = window.innerWidth - rect.width;
94
- const maxY = window.innerHeight - rect.height;
95
- const x = Math.min(Math.max(event.clientX - offset.x, 0), maxX);
96
- const y = Math.min(Math.max(event.clientY - offset.y, 0), maxY);
97
- this.container.style.left = `${x}px`;
98
- this.container.style.top = `${y}px`;
99
- this.container.style.right = 'auto';
100
- this.container.style.bottom = 'auto';
101
- });
102
-
103
- document.addEventListener('mouseup', () => {
104
- if (!isDragging) return;
105
- isDragging = false;
106
- this.header.style.cursor = 'grab';
107
- });
108
- }
109
-
110
- renderList() {
111
- if (!slice?.context?.contexts) {
112
- this.list.textContent = 'ContextManager not available.';
113
- this.countLabel.textContent = '0';
114
- return;
115
- }
116
-
117
- const items = [];
118
- slice.context.contexts.forEach((value, name) => {
119
- if (this.filterText && !name.toLowerCase().includes(this.filterText)) {
120
- return;
121
- }
122
- const keys = value?.state ? Object.keys(value.state).length : 0;
123
- items.push({ name, keys, state: value?.state || {} });
124
- });
125
-
126
- items.sort((a, b) => a.name.localeCompare(b.name));
127
-
128
- this.countLabel.textContent = String(items.length);
129
- this.list.innerHTML = items.length
130
- ? items.map((item) => {
131
- const preview = JSON.stringify(item.state, null, 2);
132
- return `
133
- <div class="context-row">
134
- <div class="context-row-head">
135
- <div class="context-name">${item.name}</div>
136
- <div class="context-keys">${item.keys} keys</div>
137
- </div>
138
- <pre class="context-preview">${this.escapeHtml(preview)}</pre>
139
- </div>
140
- `;
141
- }).join('')
142
- : '<div class="empty">No contexts</div>';
143
- }
144
-
145
- escapeHtml(value) {
146
- return value
147
- .replace(/&/g, '&amp;')
148
- .replace(/</g, '&lt;')
149
- .replace(/>/g, '&gt;')
150
- .replace(/"/g, '&quot;')
151
- .replace(/'/g, '&#39;');
152
- }
153
-
154
- renderTemplate() {
155
- return `
156
- <div id="context-debugger">
157
- <div class="context-header">
158
- <div class="brand">
159
- <span class="status-dot"></span>
160
- <span class="glyph">◈</span>
161
- <span class="title">CONTEXT</span>
162
- </div>
163
- <div class="actions">
164
- <button id="context-refresh" class="btn" title="Refresh" aria-label="Refresh">⟳</button>
165
- <button id="context-close" class="btn" title="Close" aria-label="Close">✕</button>
166
- </div>
167
- </div>
168
- <div class="context-toolbar">
169
- <input id="context-filter" type="text" placeholder="filter contexts…" autocomplete="off" spellcheck="false" />
170
- <div class="count"><span id="context-count">0</span></div>
171
- </div>
172
- <div class="context-list" id="context-list"></div>
173
- </div>
174
- `;
175
- }
176
-
177
- renderStyles() {
178
- return `
179
- /* Slice Instruments — context store. All selectors scoped to the
180
- <slice-contextmanager-debugger> tag so nothing clashes with app styles. */
181
- slice-contextmanager-debugger {
182
- --si-accent: var(--primary-color, #6ee7ff);
183
- --si-accent-rgb: var(--primary-color-rgb, 110, 231, 255);
184
- --si-surface: rgba(17, 19, 28, 0.86);
185
- --si-raised: rgba(255, 255, 255, 0.035);
186
- --si-raised-2: rgba(255, 255, 255, 0.06);
187
- --si-border: rgba(255, 255, 255, 0.09);
188
- --si-text: #e8eaf2;
189
- --si-dim: #888fa6;
190
- --si-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, monospace;
191
- }
192
-
193
- slice-contextmanager-debugger #context-debugger {
194
- position: fixed;
195
- bottom: 20px;
196
- left: 20px;
197
- width: min(400px, calc(100vw - 40px));
198
- max-height: 64vh;
199
- background: var(--si-surface);
200
- border: 1px solid var(--si-border);
201
- border-radius: 14px;
202
- box-shadow:
203
- 0 24px 60px -12px rgba(0, 0, 0, 0.55),
204
- 0 0 0 1px rgba(0, 0, 0, 0.2),
205
- 0 0 38px -18px rgba(var(--si-accent-rgb), 0.55);
206
- -webkit-backdrop-filter: blur(22px) saturate(1.3);
207
- backdrop-filter: blur(22px) saturate(1.3);
208
- display: none;
209
- flex-direction: column;
210
- z-index: 10001;
211
- overflow: hidden;
212
- color: var(--si-text);
213
- font-family: var(--si-mono);
214
- }
215
-
216
- slice-contextmanager-debugger #context-debugger.active {
217
- display: flex;
218
- animation: si-context-in 0.26s cubic-bezier(0.16, 1, 0.3, 1);
219
- }
220
-
221
- @keyframes si-context-in {
222
- from { opacity: 0; transform: translateY(10px) scale(0.985); }
223
- to { opacity: 1; transform: translateY(0) scale(1); }
224
- }
225
-
226
- slice-contextmanager-debugger #context-debugger * { box-sizing: border-box; }
227
-
228
- slice-contextmanager-debugger #context-debugger::before {
229
- content: '';
230
- position: absolute;
231
- left: 0; top: 0; bottom: 0;
232
- width: 2px;
233
- background: linear-gradient(180deg, var(--si-accent), transparent 70%);
234
- opacity: 0.85;
235
- pointer-events: none;
236
- }
237
-
238
- slice-contextmanager-debugger #context-debugger > .context-header {
239
- display: flex;
240
- justify-content: space-between;
241
- align-items: center;
242
- padding: 12px 14px;
243
- background:
244
- radial-gradient(120% 140% at 0% 0%, rgba(var(--si-accent-rgb), 0.10), transparent 60%),
245
- var(--si-raised);
246
- border-bottom: 1px solid var(--si-border);
247
- user-select: none;
248
- }
249
-
250
- slice-contextmanager-debugger .brand { display: flex; align-items: center; gap: 9px; }
251
-
252
- slice-contextmanager-debugger .status-dot {
253
- width: 7px; height: 7px;
254
- border-radius: 50%;
255
- background: var(--si-accent);
256
- animation: si-pulse-ctx 2.4s ease-out infinite;
257
- }
258
-
259
- @keyframes si-pulse-ctx {
260
- 0% { box-shadow: 0 0 0 0 rgba(var(--si-accent-rgb), 0.55); }
261
- 70% { box-shadow: 0 0 0 7px rgba(var(--si-accent-rgb), 0); }
262
- 100% { box-shadow: 0 0 0 0 rgba(var(--si-accent-rgb), 0); }
263
- }
264
-
265
- slice-contextmanager-debugger .glyph { color: var(--si-accent); font-size: 12px; opacity: 0.9; }
266
-
267
- slice-contextmanager-debugger .title {
268
- font-weight: 600;
269
- font-size: 11px;
270
- letter-spacing: 0.18em;
271
- color: var(--si-text);
272
- }
273
-
274
- slice-contextmanager-debugger .actions { display: flex; gap: 6px; }
275
-
276
- slice-contextmanager-debugger .btn {
277
- width: 26px; height: 26px;
278
- display: flex; align-items: center; justify-content: center;
279
- border-radius: 7px;
280
- border: 1px solid var(--si-border);
281
- background: var(--si-raised);
282
- color: var(--si-dim);
283
- cursor: pointer;
284
- font-size: 13px;
285
- line-height: 1;
286
- transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
287
- }
288
- slice-contextmanager-debugger .btn:hover {
289
- color: var(--si-text);
290
- background: var(--si-raised-2);
291
- border-color: rgba(var(--si-accent-rgb), 0.5);
292
- }
293
- slice-contextmanager-debugger .btn:active { transform: scale(0.92); }
294
- slice-contextmanager-debugger #context-refresh:hover { color: var(--si-accent); }
295
-
296
- slice-contextmanager-debugger .context-toolbar {
297
- display: flex;
298
- gap: 10px;
299
- align-items: center;
300
- padding: 10px 12px;
301
- border-bottom: 1px solid var(--si-border);
302
- }
303
-
304
- slice-contextmanager-debugger .context-toolbar input {
305
- flex: 1;
306
- min-width: 0;
307
- padding: 7px 10px 7px 30px;
308
- border-radius: 8px;
309
- border: 1px solid var(--si-border);
310
- background:
311
- var(--si-raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23888fa6' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 10px center;
312
- color: var(--si-text);
313
- font-family: var(--si-mono);
314
- font-size: 12px;
315
- transition: border-color 0.15s ease, box-shadow 0.15s ease;
316
- }
317
- slice-contextmanager-debugger .context-toolbar input::placeholder { color: var(--si-dim); }
318
- slice-contextmanager-debugger .context-toolbar input:focus {
319
- outline: none;
320
- border-color: rgba(var(--si-accent-rgb), 0.6);
321
- box-shadow: 0 0 0 3px rgba(var(--si-accent-rgb), 0.12);
322
- }
323
-
324
- slice-contextmanager-debugger .context-toolbar .count { font-size: 11px; color: var(--si-dim); min-width: 22px; text-align: center; }
325
- slice-contextmanager-debugger .context-toolbar .count span { color: var(--si-accent); font-weight: 600; }
326
-
327
- slice-contextmanager-debugger .context-list {
328
- padding: 10px 12px 12px;
329
- overflow: auto;
330
- display: flex;
331
- flex-direction: column;
332
- gap: 9px;
333
- }
334
- slice-contextmanager-debugger .context-list::-webkit-scrollbar { width: 8px; }
335
- slice-contextmanager-debugger .context-list::-webkit-scrollbar-thumb {
336
- background: var(--si-raised-2);
337
- border-radius: 8px;
338
- border: 2px solid transparent;
339
- background-clip: padding-box;
340
- }
341
- slice-contextmanager-debugger .context-list::-webkit-scrollbar-thumb:hover { background: rgba(var(--si-accent-rgb), 0.4); background-clip: padding-box; }
342
-
343
- slice-contextmanager-debugger .context-row {
344
- border: 1px solid var(--si-border);
345
- border-left: 2px solid transparent;
346
- border-radius: 10px;
347
- background: var(--si-raised);
348
- padding: 10px 11px;
349
- display: flex;
350
- flex-direction: column;
351
- gap: 8px;
352
- transition: border-color 0.18s ease, background 0.18s ease;
353
- }
354
- slice-contextmanager-debugger .context-row:hover { background: var(--si-raised-2); border-left-color: var(--si-accent); }
355
-
356
- slice-contextmanager-debugger .context-row-head {
357
- display: flex;
358
- align-items: center;
359
- justify-content: space-between;
360
- gap: 10px;
361
- }
362
-
363
- slice-contextmanager-debugger .context-name {
364
- font-weight: 600;
365
- font-size: 12.5px;
366
- color: var(--si-text);
367
- font-family: var(--si-mono);
368
- }
369
-
370
- slice-contextmanager-debugger .context-keys {
371
- font-size: 10px;
372
- letter-spacing: 0.04em;
373
- text-transform: uppercase;
374
- color: var(--si-accent);
375
- background: rgba(var(--si-accent-rgb), 0.12);
376
- border: 1px solid rgba(var(--si-accent-rgb), 0.25);
377
- padding: 1px 8px;
378
- border-radius: 999px;
379
- white-space: nowrap;
380
- }
381
-
382
- slice-contextmanager-debugger .context-preview {
383
- background: rgba(0, 0, 0, 0.3);
384
- border-radius: 8px;
385
- padding: 10px;
386
- border: 1px solid var(--si-border);
387
- max-height: 200px;
388
- overflow: auto;
389
- font-size: 11px;
390
- line-height: 1.55;
391
- font-family: var(--si-mono);
392
- color: #c5cad8;
393
- white-space: pre;
394
- margin: 0;
395
- }
396
- slice-contextmanager-debugger .context-preview::-webkit-scrollbar { width: 8px; height: 8px; }
397
- slice-contextmanager-debugger .context-preview::-webkit-scrollbar-thumb {
398
- background: var(--si-raised-2);
399
- border-radius: 8px;
400
- border: 2px solid transparent;
401
- background-clip: padding-box;
402
- }
403
-
404
- slice-contextmanager-debugger .empty {
405
- color: var(--si-dim);
406
- font-size: 11px;
407
- letter-spacing: 0.04em;
408
- text-align: center;
409
- padding: 22px 0;
410
- }
411
-
412
- @media (prefers-reduced-motion: reduce) {
413
- slice-contextmanager-debugger #context-debugger.active { animation: none; }
414
- slice-contextmanager-debugger .status-dot { animation: none; }
415
- }
416
- `;
417
- }
418
- }
419
-
420
- customElements.define('slice-contextmanager-debugger', ContextManagerDebugger);
1
+ /**
2
+ * ContextManager debug panel.
3
+ */
4
+ export default class ContextManagerDebugger extends HTMLElement {
5
+ constructor() {
6
+ super();
7
+ this.isOpen = false;
8
+ this.filterText = '';
9
+ }
10
+
11
+ /**
12
+ * Initialize panel UI.
13
+ * @returns {Promise<void>}
14
+ */
15
+ async init() {
16
+ this.innerHTML = this.renderTemplate();
17
+ slice.stylesManager.registerComponentStyles('ContextManagerDebugger', this.renderStyles());
18
+ this.cacheElements();
19
+ this.bindEvents();
20
+ this.makeDraggable();
21
+ this.renderList();
22
+ }
23
+
24
+ /**
25
+ * Toggle panel visibility.
26
+ * @returns {void}
27
+ */
28
+ toggle() {
29
+ this.isOpen = !this.isOpen;
30
+ this.container.classList.toggle('active', this.isOpen);
31
+ if (this.isOpen) {
32
+ this.renderList();
33
+ }
34
+ }
35
+
36
+ /**
37
+ * Show panel.
38
+ * @returns {void}
39
+ */
40
+ open() {
41
+ this.isOpen = true;
42
+ this.container.classList.add('active');
43
+ this.renderList();
44
+ }
45
+
46
+ /**
47
+ * Hide panel.
48
+ * @returns {void}
49
+ */
50
+ close() {
51
+ this.isOpen = false;
52
+ this.container.classList.remove('active');
53
+ }
54
+
55
+ cacheElements() {
56
+ this.container = this.querySelector('#context-debugger');
57
+ this.header = this.querySelector('.context-header');
58
+ this.list = this.querySelector('#context-list');
59
+ this.filterInput = this.querySelector('#context-filter');
60
+ this.countLabel = this.querySelector('#context-count');
61
+ this.refreshButton = this.querySelector('#context-refresh');
62
+ this.closeButton = this.querySelector('#context-close');
63
+ }
64
+
65
+ bindEvents() {
66
+ this.refreshButton.addEventListener('click', () => this.renderList());
67
+ this.closeButton.addEventListener('click', () => this.close());
68
+ this.filterInput.addEventListener('input', (event) => {
69
+ this.filterText = event.target.value.trim().toLowerCase();
70
+ this.renderList();
71
+ });
72
+ }
73
+
74
+ makeDraggable() {
75
+ if (!this.header || !this.container) return;
76
+
77
+ let offset = { x: 0, y: 0 };
78
+ let isDragging = false;
79
+
80
+ this.header.style.cursor = 'grab';
81
+
82
+ this.header.addEventListener('mousedown', (event) => {
83
+ if (event.target.closest('.btn')) return;
84
+ isDragging = true;
85
+ offset.x = event.clientX - this.container.getBoundingClientRect().left;
86
+ offset.y = event.clientY - this.container.getBoundingClientRect().top;
87
+ this.header.style.cursor = 'grabbing';
88
+ });
89
+
90
+ document.addEventListener('mousemove', (event) => {
91
+ if (!isDragging) return;
92
+ const rect = this.container.getBoundingClientRect();
93
+ const maxX = window.innerWidth - rect.width;
94
+ const maxY = window.innerHeight - rect.height;
95
+ const x = Math.min(Math.max(event.clientX - offset.x, 0), maxX);
96
+ const y = Math.min(Math.max(event.clientY - offset.y, 0), maxY);
97
+ this.container.style.left = `${x}px`;
98
+ this.container.style.top = `${y}px`;
99
+ this.container.style.right = 'auto';
100
+ this.container.style.bottom = 'auto';
101
+ });
102
+
103
+ document.addEventListener('mouseup', () => {
104
+ if (!isDragging) return;
105
+ isDragging = false;
106
+ this.header.style.cursor = 'grab';
107
+ });
108
+ }
109
+
110
+ renderList() {
111
+ if (!slice?.context?.contexts) {
112
+ this.list.textContent = 'ContextManager not available.';
113
+ this.countLabel.textContent = '0';
114
+ return;
115
+ }
116
+
117
+ const items = [];
118
+ slice.context.contexts.forEach((value, name) => {
119
+ if (this.filterText && !name.toLowerCase().includes(this.filterText)) {
120
+ return;
121
+ }
122
+ const keys = value?.state ? Object.keys(value.state).length : 0;
123
+ items.push({ name, keys, state: value?.state || {} });
124
+ });
125
+
126
+ items.sort((a, b) => a.name.localeCompare(b.name));
127
+
128
+ this.countLabel.textContent = String(items.length);
129
+ this.list.innerHTML = items.length
130
+ ? items.map((item) => {
131
+ let preview;
132
+ try { preview = JSON.stringify(item.state, null, 2); } catch { preview = String(item.state); }
133
+ return `
134
+ <div class="context-row">
135
+ <div class="context-row-head">
136
+ <div class="context-name">${item.name}</div>
137
+ <div class="context-keys">${item.keys} keys</div>
138
+ </div>
139
+ <pre class="context-preview">${this.escapeHtml(preview)}</pre>
140
+ </div>
141
+ `;
142
+ }).join('')
143
+ : '<div class="empty">No contexts</div>';
144
+ }
145
+
146
+ escapeHtml(value) {
147
+ return value
148
+ .replace(/&/g, '&amp;')
149
+ .replace(/</g, '&lt;')
150
+ .replace(/>/g, '&gt;')
151
+ .replace(/"/g, '&quot;')
152
+ .replace(/'/g, '&#39;');
153
+ }
154
+
155
+ renderTemplate() {
156
+ return `
157
+ <div id="context-debugger">
158
+ <div class="context-header">
159
+ <div class="brand">
160
+ <span class="status-dot"></span>
161
+ <span class="glyph">◈</span>
162
+ <span class="title">CONTEXT</span>
163
+ </div>
164
+ <div class="actions">
165
+ <button id="context-refresh" class="btn" title="Refresh" aria-label="Refresh">⟳</button>
166
+ <button id="context-close" class="btn" title="Close" aria-label="Close">✕</button>
167
+ </div>
168
+ </div>
169
+ <div class="context-toolbar">
170
+ <input id="context-filter" type="text" placeholder="filter contexts…" autocomplete="off" spellcheck="false" />
171
+ <div class="count"><span id="context-count">0</span></div>
172
+ </div>
173
+ <div class="context-list" id="context-list"></div>
174
+ </div>
175
+ `;
176
+ }
177
+
178
+ renderStyles() {
179
+ return `
180
+ /* Slice Instruments context store. All selectors scoped to the
181
+ <slice-contextmanager-debugger> tag so nothing clashes with app styles. */
182
+ slice-contextmanager-debugger {
183
+ --si-accent: var(--primary-color, #6ee7ff);
184
+ --si-accent-rgb: var(--primary-color-rgb, 110, 231, 255);
185
+ --si-surface: rgba(17, 19, 28, 0.86);
186
+ --si-raised: rgba(255, 255, 255, 0.035);
187
+ --si-raised-2: rgba(255, 255, 255, 0.06);
188
+ --si-border: rgba(255, 255, 255, 0.09);
189
+ --si-text: #e8eaf2;
190
+ --si-dim: #888fa6;
191
+ --si-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, monospace;
192
+ }
193
+
194
+ slice-contextmanager-debugger #context-debugger {
195
+ position: fixed;
196
+ bottom: 20px;
197
+ left: 20px;
198
+ width: min(400px, calc(100vw - 40px));
199
+ max-height: 64vh;
200
+ background: var(--si-surface);
201
+ border: 1px solid var(--si-border);
202
+ border-radius: 14px;
203
+ box-shadow:
204
+ 0 24px 60px -12px rgba(0, 0, 0, 0.55),
205
+ 0 0 0 1px rgba(0, 0, 0, 0.2),
206
+ 0 0 38px -18px rgba(var(--si-accent-rgb), 0.55);
207
+ -webkit-backdrop-filter: blur(22px) saturate(1.3);
208
+ backdrop-filter: blur(22px) saturate(1.3);
209
+ display: none;
210
+ flex-direction: column;
211
+ z-index: 10001;
212
+ overflow: hidden;
213
+ color: var(--si-text);
214
+ font-family: var(--si-mono);
215
+ }
216
+
217
+ slice-contextmanager-debugger #context-debugger.active {
218
+ display: flex;
219
+ animation: si-context-in 0.26s cubic-bezier(0.16, 1, 0.3, 1);
220
+ }
221
+
222
+ @keyframes si-context-in {
223
+ from { opacity: 0; transform: translateY(10px) scale(0.985); }
224
+ to { opacity: 1; transform: translateY(0) scale(1); }
225
+ }
226
+
227
+ slice-contextmanager-debugger #context-debugger * { box-sizing: border-box; }
228
+
229
+ slice-contextmanager-debugger #context-debugger::before {
230
+ content: '';
231
+ position: absolute;
232
+ left: 0; top: 0; bottom: 0;
233
+ width: 2px;
234
+ background: linear-gradient(180deg, var(--si-accent), transparent 70%);
235
+ opacity: 0.85;
236
+ pointer-events: none;
237
+ }
238
+
239
+ slice-contextmanager-debugger #context-debugger > .context-header {
240
+ display: flex;
241
+ justify-content: space-between;
242
+ align-items: center;
243
+ padding: 12px 14px;
244
+ background:
245
+ radial-gradient(120% 140% at 0% 0%, rgba(var(--si-accent-rgb), 0.10), transparent 60%),
246
+ var(--si-raised);
247
+ border-bottom: 1px solid var(--si-border);
248
+ user-select: none;
249
+ }
250
+
251
+ slice-contextmanager-debugger .brand { display: flex; align-items: center; gap: 9px; }
252
+
253
+ slice-contextmanager-debugger .status-dot {
254
+ width: 7px; height: 7px;
255
+ border-radius: 50%;
256
+ background: var(--si-accent);
257
+ animation: si-pulse-ctx 2.4s ease-out infinite;
258
+ }
259
+
260
+ @keyframes si-pulse-ctx {
261
+ 0% { box-shadow: 0 0 0 0 rgba(var(--si-accent-rgb), 0.55); }
262
+ 70% { box-shadow: 0 0 0 7px rgba(var(--si-accent-rgb), 0); }
263
+ 100% { box-shadow: 0 0 0 0 rgba(var(--si-accent-rgb), 0); }
264
+ }
265
+
266
+ slice-contextmanager-debugger .glyph { color: var(--si-accent); font-size: 12px; opacity: 0.9; }
267
+
268
+ slice-contextmanager-debugger .title {
269
+ font-weight: 600;
270
+ font-size: 11px;
271
+ letter-spacing: 0.18em;
272
+ color: var(--si-text);
273
+ }
274
+
275
+ slice-contextmanager-debugger .actions { display: flex; gap: 6px; }
276
+
277
+ slice-contextmanager-debugger .btn {
278
+ width: 26px; height: 26px;
279
+ display: flex; align-items: center; justify-content: center;
280
+ border-radius: 7px;
281
+ border: 1px solid var(--si-border);
282
+ background: var(--si-raised);
283
+ color: var(--si-dim);
284
+ cursor: pointer;
285
+ font-size: 13px;
286
+ line-height: 1;
287
+ transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
288
+ }
289
+ slice-contextmanager-debugger .btn:hover {
290
+ color: var(--si-text);
291
+ background: var(--si-raised-2);
292
+ border-color: rgba(var(--si-accent-rgb), 0.5);
293
+ }
294
+ slice-contextmanager-debugger .btn:active { transform: scale(0.92); }
295
+ slice-contextmanager-debugger #context-refresh:hover { color: var(--si-accent); }
296
+
297
+ slice-contextmanager-debugger .context-toolbar {
298
+ display: flex;
299
+ gap: 10px;
300
+ align-items: center;
301
+ padding: 10px 12px;
302
+ border-bottom: 1px solid var(--si-border);
303
+ }
304
+
305
+ slice-contextmanager-debugger .context-toolbar input {
306
+ flex: 1;
307
+ min-width: 0;
308
+ padding: 7px 10px 7px 30px;
309
+ border-radius: 8px;
310
+ border: 1px solid var(--si-border);
311
+ background:
312
+ var(--si-raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23888fa6' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 10px center;
313
+ color: var(--si-text);
314
+ font-family: var(--si-mono);
315
+ font-size: 12px;
316
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
317
+ }
318
+ slice-contextmanager-debugger .context-toolbar input::placeholder { color: var(--si-dim); }
319
+ slice-contextmanager-debugger .context-toolbar input:focus {
320
+ outline: none;
321
+ border-color: rgba(var(--si-accent-rgb), 0.6);
322
+ box-shadow: 0 0 0 3px rgba(var(--si-accent-rgb), 0.12);
323
+ }
324
+
325
+ slice-contextmanager-debugger .context-toolbar .count { font-size: 11px; color: var(--si-dim); min-width: 22px; text-align: center; }
326
+ slice-contextmanager-debugger .context-toolbar .count span { color: var(--si-accent); font-weight: 600; }
327
+
328
+ slice-contextmanager-debugger .context-list {
329
+ padding: 10px 12px 12px;
330
+ overflow: auto;
331
+ display: flex;
332
+ flex-direction: column;
333
+ gap: 9px;
334
+ }
335
+ slice-contextmanager-debugger .context-list::-webkit-scrollbar { width: 8px; }
336
+ slice-contextmanager-debugger .context-list::-webkit-scrollbar-thumb {
337
+ background: var(--si-raised-2);
338
+ border-radius: 8px;
339
+ border: 2px solid transparent;
340
+ background-clip: padding-box;
341
+ }
342
+ slice-contextmanager-debugger .context-list::-webkit-scrollbar-thumb:hover { background: rgba(var(--si-accent-rgb), 0.4); background-clip: padding-box; }
343
+
344
+ slice-contextmanager-debugger .context-row {
345
+ border: 1px solid var(--si-border);
346
+ border-left: 2px solid transparent;
347
+ border-radius: 10px;
348
+ background: var(--si-raised);
349
+ padding: 10px 11px;
350
+ display: flex;
351
+ flex-direction: column;
352
+ gap: 8px;
353
+ transition: border-color 0.18s ease, background 0.18s ease;
354
+ }
355
+ slice-contextmanager-debugger .context-row:hover { background: var(--si-raised-2); border-left-color: var(--si-accent); }
356
+
357
+ slice-contextmanager-debugger .context-row-head {
358
+ display: flex;
359
+ align-items: center;
360
+ justify-content: space-between;
361
+ gap: 10px;
362
+ }
363
+
364
+ slice-contextmanager-debugger .context-name {
365
+ font-weight: 600;
366
+ font-size: 12.5px;
367
+ color: var(--si-text);
368
+ font-family: var(--si-mono);
369
+ }
370
+
371
+ slice-contextmanager-debugger .context-keys {
372
+ font-size: 10px;
373
+ letter-spacing: 0.04em;
374
+ text-transform: uppercase;
375
+ color: var(--si-accent);
376
+ background: rgba(var(--si-accent-rgb), 0.12);
377
+ border: 1px solid rgba(var(--si-accent-rgb), 0.25);
378
+ padding: 1px 8px;
379
+ border-radius: 999px;
380
+ white-space: nowrap;
381
+ }
382
+
383
+ slice-contextmanager-debugger .context-preview {
384
+ background: rgba(0, 0, 0, 0.3);
385
+ border-radius: 8px;
386
+ padding: 10px;
387
+ border: 1px solid var(--si-border);
388
+ max-height: 200px;
389
+ overflow: auto;
390
+ font-size: 11px;
391
+ line-height: 1.55;
392
+ font-family: var(--si-mono);
393
+ color: #c5cad8;
394
+ white-space: pre;
395
+ margin: 0;
396
+ }
397
+ slice-contextmanager-debugger .context-preview::-webkit-scrollbar { width: 8px; height: 8px; }
398
+ slice-contextmanager-debugger .context-preview::-webkit-scrollbar-thumb {
399
+ background: var(--si-raised-2);
400
+ border-radius: 8px;
401
+ border: 2px solid transparent;
402
+ background-clip: padding-box;
403
+ }
404
+
405
+ slice-contextmanager-debugger .empty {
406
+ color: var(--si-dim);
407
+ font-size: 11px;
408
+ letter-spacing: 0.04em;
409
+ text-align: center;
410
+ padding: 22px 0;
411
+ }
412
+
413
+ @media (prefers-reduced-motion: reduce) {
414
+ slice-contextmanager-debugger #context-debugger.active { animation: none; }
415
+ slice-contextmanager-debugger .status-dot { animation: none; }
416
+ }
417
+ `;
418
+ }
419
+ }
420
+
421
+ customElements.define('slice-contextmanager-debugger', ContextManagerDebugger);