vite-plugin-opencode-assistant 1.0.28 → 1.0.30
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/es/core/proxy-server.js +31 -13
- package/lib/client.js +1137 -1128
- package/lib/core/proxy-server.js +31 -13
- package/package.json +4 -4
package/es/core/proxy-server.js
CHANGED
|
@@ -116,30 +116,47 @@ function generateBridgeScript(options) {
|
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
|
|
119
|
+
// === \u6700\u5C0F\u5316\u72B6\u6001\u6837\u5F0F ===
|
|
120
|
+
const minimizeStyles = \`
|
|
121
|
+
.opencode-minimized [data-dock-surface="tray"]:not([data-slot="permission-footer"]) {
|
|
122
|
+
display: none !important;
|
|
123
|
+
}
|
|
124
|
+
.opencode-minimized [data-slot="session-turn-list"] {
|
|
125
|
+
padding-bottom: 10px !important;
|
|
126
|
+
}
|
|
127
|
+
.opencode-prompt-dock-hidden [data-component="session-prompt-dock"]:not(:has([data-kind="permission"])) {
|
|
128
|
+
display: none !important;
|
|
129
|
+
}
|
|
130
|
+
\`;
|
|
131
|
+
|
|
132
|
+
function injectMinimizeStyles() {
|
|
133
|
+
if (document.getElementById('opencode-minimize-styles')) return;
|
|
134
|
+
const style = document.createElement('style');
|
|
135
|
+
style.id = 'opencode-minimize-styles';
|
|
136
|
+
style.textContent = minimizeStyles;
|
|
137
|
+
document.head.appendChild(style);
|
|
138
|
+
}
|
|
139
|
+
|
|
119
140
|
// === \u6700\u5C0F\u5316\u72B6\u6001\u5904\u7406 ===
|
|
120
141
|
let savedMinimizedState = null;
|
|
121
142
|
let savedPromptDockVisibleState = null;
|
|
122
|
-
|
|
143
|
+
|
|
123
144
|
function handleMinimizeStateChange(minimized) {
|
|
124
145
|
savedMinimizedState = minimized;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
dockSurface.style.display = minimized ? 'none' : '';
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (sessionTurnList) {
|
|
133
|
-
sessionTurnList.style.paddingBottom = minimized ? '10px' : '';
|
|
146
|
+
if (minimized) {
|
|
147
|
+
document.documentElement.classList.add('opencode-minimized');
|
|
148
|
+
} else {
|
|
149
|
+
document.documentElement.classList.remove('opencode-minimized');
|
|
134
150
|
}
|
|
135
151
|
}
|
|
136
152
|
|
|
137
153
|
// === \u5BF9\u8BDD\u6846\u663E\u793A\u72B6\u6001\u5904\u7406 ===
|
|
138
154
|
function handlePromptDockVisibilityChange(visible) {
|
|
139
155
|
savedPromptDockVisibleState = visible;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
156
|
+
if (!visible) {
|
|
157
|
+
document.documentElement.classList.add('opencode-prompt-dock-hidden');
|
|
158
|
+
} else {
|
|
159
|
+
document.documentElement.classList.remove('opencode-prompt-dock-hidden');
|
|
143
160
|
}
|
|
144
161
|
}
|
|
145
162
|
|
|
@@ -295,6 +312,7 @@ function generateBridgeScript(options) {
|
|
|
295
312
|
|
|
296
313
|
// === \u5C31\u7EEA\u901A\u77E5 ===
|
|
297
314
|
function init() {
|
|
315
|
+
injectMinimizeStyles();
|
|
298
316
|
if (window.parent !== window) {
|
|
299
317
|
window.parent.postMessage({ type: "OPENCODE_READY" }, "*");
|
|
300
318
|
}
|