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.
@@ -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
- const dockSurface = document.querySelector('[data-dock-surface="tray"]');
152
- const sessionTurnList = document.querySelector('[data-slot="session-turn-list"]');
153
-
154
- if (dockSurface) {
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
- const promptDock = document.querySelector('[data-component="session-prompt-dock"]');
167
- if (promptDock) {
168
- promptDock.style.display = visible ? '' : 'none';
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.28",
3
+ "version": "1.0.30",
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.28",
40
- "@vite-plugin-opencode-assistant/opencode": "1.0.28",
41
- "@vite-plugin-opencode-assistant/shared": "1.0.28"
39
+ "@vite-plugin-opencode-assistant/opencode": "1.0.30",
40
+ "@vite-plugin-opencode-assistant/shared": "1.0.30",
41
+ "@vite-plugin-opencode-assistant/components": "1.0.30"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "vite": ">=4.0.0"