vite-plugin-opencode-assistant 1.0.28 → 1.0.29
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/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
|
}
|
package/lib/core/proxy-server.js
CHANGED
|
@@ -142,30 +142,47 @@ function generateBridgeScript(options) {
|
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
+
// === \u6700\u5C0F\u5316\u72B6\u6001\u6837\u5F0F ===
|
|
146
|
+
const minimizeStyles = \`
|
|
147
|
+
.opencode-minimized [data-dock-surface="tray"]:not([data-slot="permission-footer"]) {
|
|
148
|
+
display: none !important;
|
|
149
|
+
}
|
|
150
|
+
.opencode-minimized [data-slot="session-turn-list"] {
|
|
151
|
+
padding-bottom: 10px !important;
|
|
152
|
+
}
|
|
153
|
+
.opencode-prompt-dock-hidden [data-component="session-prompt-dock"]:not(:has([data-kind="permission"])) {
|
|
154
|
+
display: none !important;
|
|
155
|
+
}
|
|
156
|
+
\`;
|
|
157
|
+
|
|
158
|
+
function injectMinimizeStyles() {
|
|
159
|
+
if (document.getElementById('opencode-minimize-styles')) return;
|
|
160
|
+
const style = document.createElement('style');
|
|
161
|
+
style.id = 'opencode-minimize-styles';
|
|
162
|
+
style.textContent = minimizeStyles;
|
|
163
|
+
document.head.appendChild(style);
|
|
164
|
+
}
|
|
165
|
+
|
|
145
166
|
// === \u6700\u5C0F\u5316\u72B6\u6001\u5904\u7406 ===
|
|
146
167
|
let savedMinimizedState = null;
|
|
147
168
|
let savedPromptDockVisibleState = null;
|
|
148
|
-
|
|
169
|
+
|
|
149
170
|
function handleMinimizeStateChange(minimized) {
|
|
150
171
|
savedMinimizedState = minimized;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
dockSurface.style.display = minimized ? 'none' : '';
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
if (sessionTurnList) {
|
|
159
|
-
sessionTurnList.style.paddingBottom = minimized ? '10px' : '';
|
|
172
|
+
if (minimized) {
|
|
173
|
+
document.documentElement.classList.add('opencode-minimized');
|
|
174
|
+
} else {
|
|
175
|
+
document.documentElement.classList.remove('opencode-minimized');
|
|
160
176
|
}
|
|
161
177
|
}
|
|
162
178
|
|
|
163
179
|
// === \u5BF9\u8BDD\u6846\u663E\u793A\u72B6\u6001\u5904\u7406 ===
|
|
164
180
|
function handlePromptDockVisibilityChange(visible) {
|
|
165
181
|
savedPromptDockVisibleState = visible;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
182
|
+
if (!visible) {
|
|
183
|
+
document.documentElement.classList.add('opencode-prompt-dock-hidden');
|
|
184
|
+
} else {
|
|
185
|
+
document.documentElement.classList.remove('opencode-prompt-dock-hidden');
|
|
169
186
|
}
|
|
170
187
|
}
|
|
171
188
|
|
|
@@ -321,6 +338,7 @@ function generateBridgeScript(options) {
|
|
|
321
338
|
|
|
322
339
|
// === \u5C31\u7EEA\u901A\u77E5 ===
|
|
323
340
|
function init() {
|
|
341
|
+
injectMinimizeStyles();
|
|
324
342
|
if (window.parent !== window) {
|
|
325
343
|
window.parent.postMessage({ type: "OPENCODE_READY" }, "*");
|
|
326
344
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-opencode-assistant",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "Embed OpenCode Web UI in your Vite dev server for real-time code modification and preview",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"unplugin-vue-inspector": "^2.4.0",
|
|
39
|
-
"@vite-plugin-opencode-assistant/components": "1.0.
|
|
40
|
-
"@vite-plugin-opencode-assistant/
|
|
41
|
-
"@vite-plugin-opencode-assistant/
|
|
39
|
+
"@vite-plugin-opencode-assistant/components": "1.0.29",
|
|
40
|
+
"@vite-plugin-opencode-assistant/shared": "1.0.29",
|
|
41
|
+
"@vite-plugin-opencode-assistant/opencode": "1.0.29"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"vite": ">=4.0.0"
|