@vite-plugin-opencode-assistant/components 1.0.25 → 1.0.27

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.
Files changed (33) hide show
  1. package/es/index.d.ts +1 -1
  2. package/es/index.js +1 -1
  3. package/es/open-code-widget/composables/use-inspector.js +118 -79
  4. package/es/open-code-widget/composables/use-persist-state.d.ts +24 -0
  5. package/es/open-code-widget/composables/use-persist-state.js +59 -0
  6. package/es/open-code-widget/src/components/FloatingBubble/FloatingBubble-sfc.css +1 -1
  7. package/es/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.d.ts +2 -3
  8. package/es/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.js +50 -60
  9. package/es/open-code-widget/src/components/Trigger.vue.d.ts +2 -5
  10. package/es/open-code-widget/src/components/Trigger.vue.js +10 -38
  11. package/es/open-code-widget/src/context.d.ts +3 -0
  12. package/es/open-code-widget/src/index-sfc.css +1 -1
  13. package/es/open-code-widget/src/index.vue.d.ts +10 -10
  14. package/es/open-code-widget/src/index.vue.js +143 -28
  15. package/lib/@vite-plugin-opencode-assistant/components.cjs.js +359 -200
  16. package/lib/@vite-plugin-opencode-assistant/components.es.js +360 -201
  17. package/lib/components.css +2 -2
  18. package/lib/index.d.ts +1 -1
  19. package/lib/index.js +1 -1
  20. package/lib/open-code-widget/composables/use-inspector.js +118 -79
  21. package/lib/open-code-widget/composables/use-persist-state.d.ts +24 -0
  22. package/lib/open-code-widget/composables/use-persist-state.js +78 -0
  23. package/lib/open-code-widget/src/components/FloatingBubble/FloatingBubble-sfc.css +1 -1
  24. package/lib/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.d.ts +2 -3
  25. package/lib/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.js +49 -59
  26. package/lib/open-code-widget/src/components/Trigger.vue.d.ts +2 -5
  27. package/lib/open-code-widget/src/components/Trigger.vue.js +9 -37
  28. package/lib/open-code-widget/src/context.d.ts +3 -0
  29. package/lib/open-code-widget/src/index-sfc.css +1 -1
  30. package/lib/open-code-widget/src/index.vue.d.ts +10 -10
  31. package/lib/open-code-widget/src/index.vue.js +141 -26
  32. package/lib/web-types.json +1 -1
  33. package/package.json +2 -2
@@ -57,26 +57,12 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
57
57
  const props = __props;
58
58
  const emit = __emit;
59
59
  const rootRef = (0, import_vue2.ref)(null);
60
- const getInitialState = () => {
61
- if (props.offset) {
62
- return {
63
- x: props.offset.x,
64
- y: props.offset.y,
65
- width: 0,
66
- height: 0
67
- };
68
- }
69
- if (typeof window !== "undefined") {
70
- return {
71
- x: window.innerWidth - 42 - 24,
72
- y: window.innerHeight - 42 - 24,
73
- width: 0,
74
- height: 0
75
- };
76
- }
77
- return { x: 0, y: 0, width: 0, height: 0 };
78
- };
79
- const state = (0, import_vue2.ref)(getInitialState());
60
+ const state = (0, import_vue2.ref)({
61
+ x: 0,
62
+ y: 0,
63
+ width: 0,
64
+ height: 0
65
+ });
80
66
  const isObject = (val) => val !== null && typeof val === "object";
81
67
  const gapX = (0, import_vue2.computed)(
82
68
  () => isObject(props.gap) ? props.gap.x : props.gap
@@ -92,6 +78,27 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
92
78
  bottom: windowHeight.value - state.value.height - gapY.value,
93
79
  left: gapX.value
94
80
  }));
81
+ const closest = (arr, target) => {
82
+ return arr.reduce(
83
+ (pre, cur) => Math.abs(pre - target) < Math.abs(cur - target) ? pre : cur
84
+ );
85
+ };
86
+ const applyMagnetic = () => {
87
+ if (props.magnetic === "x") {
88
+ const nextX = closest(
89
+ [boundary.value.left, boundary.value.right],
90
+ state.value.x
91
+ );
92
+ state.value.x = nextX;
93
+ }
94
+ if (props.magnetic === "y") {
95
+ const nextY = closest(
96
+ [boundary.value.top, boundary.value.bottom],
97
+ state.value.y
98
+ );
99
+ state.value.y = nextY;
100
+ }
101
+ };
95
102
  const dragging = (0, import_vue2.ref)(false);
96
103
  const initialized = (0, import_vue2.ref)(false);
97
104
  const rootStyle = (0, import_vue2.computed)(() => {
@@ -99,20 +106,16 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
99
106
  const x = `${state.value.x}px`;
100
107
  const y = `${state.value.y}px`;
101
108
  style.transform = `translate3d(${x}, ${y}, 0)`;
102
- if (dragging.value) {
109
+ if (dragging.value || !initialized.value) {
103
110
  style.transition = "none";
104
111
  } else {
105
112
  style.transition = "transform 0.3s ease";
106
113
  }
107
114
  return style;
108
115
  });
109
- const show = (0, import_vue2.ref)(true);
110
116
  const updateState = () => {
111
- if (!show.value || !rootRef.value || typeof window === "undefined") return;
117
+ if (!rootRef.value || typeof window === "undefined") return;
112
118
  const rect = rootRef.value.getBoundingClientRect();
113
- if (rect.width === 0 || rect.height === 0) {
114
- return;
115
- }
116
119
  const { offset } = props;
117
120
  let x = offset ? offset.x : windowWidth.value - rect.width - gapX.value;
118
121
  let y = offset ? offset.y : windowHeight.value - rect.height - gapY.value;
@@ -122,12 +125,22 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
122
125
  if (x > maxX) x = maxX;
123
126
  if (y < gapY.value) y = gapY.value;
124
127
  if (y > maxY) y = maxY;
128
+ const oldX = state.value.x;
129
+ const oldY = state.value.y;
125
130
  state.value = {
126
131
  x,
127
132
  y,
128
133
  width: rect.width,
129
134
  height: rect.height
130
135
  };
136
+ if (!dragging.value) {
137
+ applyMagnetic();
138
+ if (state.value.x !== oldX || state.value.y !== oldY) {
139
+ const offset2 = { x: state.value.x, y: state.value.y };
140
+ emit("update:offset", offset2);
141
+ emit("offset-change", offset2);
142
+ }
143
+ }
131
144
  };
132
145
  const touch = {
133
146
  startX: (0, import_vue2.ref)(0),
@@ -166,6 +179,7 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
166
179
  dragging.value = true;
167
180
  prevX = state.value.x;
168
181
  prevY = state.value.y;
182
+ document.body.classList.add("floating-bubble-dragging");
169
183
  if (!("touches" in e)) {
170
184
  window.addEventListener("mousemove", onTouchMove, { passive: false });
171
185
  window.addEventListener("mouseup", onTouchEnd);
@@ -198,32 +212,15 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
198
212
  emit("update:offset", offset);
199
213
  }
200
214
  };
201
- const closest = (arr, target) => {
202
- return arr.reduce(
203
- (pre, cur) => Math.abs(pre - target) < Math.abs(cur - target) ? pre : cur
204
- );
205
- };
206
215
  const onTouchEnd = (e) => {
207
216
  dragging.value = false;
217
+ document.body.classList.remove("floating-bubble-dragging");
208
218
  if (e && !("touches" in e) && e.type === "mouseup") {
209
219
  window.removeEventListener("mousemove", onTouchMove);
210
220
  window.removeEventListener("mouseup", onTouchEnd);
211
221
  }
212
222
  requestAnimationFrame(() => {
213
- if (props.magnetic === "x") {
214
- const nextX = closest(
215
- [boundary.value.left, boundary.value.right],
216
- state.value.x
217
- );
218
- state.value.x = nextX;
219
- }
220
- if (props.magnetic === "y") {
221
- const nextY = closest(
222
- [boundary.value.top, boundary.value.bottom],
223
- state.value.y
224
- );
225
- state.value.y = nextY;
226
- }
223
+ applyMagnetic();
227
224
  if (!touch.isTap.value) {
228
225
  emit("drag-end");
229
226
  const offset = { x: state.value.x, y: state.value.y };
@@ -248,11 +245,9 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
248
245
  }
249
246
  };
250
247
  (0, import_vue2.onMounted)(() => {
248
+ updateState();
251
249
  requestAnimationFrame(() => {
252
- updateState();
253
- requestAnimationFrame(() => {
254
- initialized.value = true;
255
- });
250
+ initialized.value = true;
256
251
  });
257
252
  if (typeof window !== "undefined") {
258
253
  window.addEventListener("resize", handleResize);
@@ -264,6 +259,7 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
264
259
  }
265
260
  });
266
261
  (0, import_vue2.onUnmounted)(() => {
262
+ document.body.classList.remove("floating-bubble-dragging");
267
263
  if (typeof window !== "undefined") {
268
264
  window.removeEventListener("resize", handleResize);
269
265
  window.removeEventListener("mousemove", onTouchMove);
@@ -278,14 +274,10 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
278
274
  updateState,
279
275
  { deep: true }
280
276
  );
281
- const isOnRightSide = (0, import_vue2.computed)(() => {
282
- return state.value.x > windowWidth.value / 2;
283
- });
284
277
  __expose({
285
- isOnRightSide,
286
278
  offset: (0, import_vue2.computed)(() => ({ x: state.value.x, y: state.value.y }))
287
279
  });
288
- const __returned__ = { props, emit, rootRef, getInitialState, state, isObject, gapX, gapY, windowWidth, windowHeight, boundary, dragging, initialized, rootStyle, show, updateState, touch, get prevX() {
280
+ const __returned__ = { props, emit, rootRef, state, isObject, gapX, gapY, windowWidth, windowHeight, boundary, closest, applyMagnetic, dragging, initialized, rootStyle, updateState, touch, get prevX() {
289
281
  return prevX;
290
282
  }, set prevX(v) {
291
283
  prevX = v;
@@ -293,14 +285,14 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
293
285
  return prevY;
294
286
  }, set prevY(v) {
295
287
  prevY = v;
296
- }, onTouchStart, onTouchMove, closest, onTouchEnd, onClick, handleResize, isOnRightSide };
288
+ }, onTouchStart, onTouchMove, onTouchEnd, onClick, handleResize };
297
289
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
298
290
  return __returned__;
299
291
  }
300
292
  }));
301
293
  function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
302
294
  return (0, import_vue3.openBlock)(), (0, import_vue3.createBlock)(import_vue3.Teleport, { to: $props.teleport }, [
303
- (0, import_vue3.withDirectives)((0, import_vue3.createElementVNode)(
295
+ (0, import_vue3.createElementVNode)(
304
296
  "div",
305
297
  {
306
298
  ref: "rootRef",
@@ -317,9 +309,7 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
317
309
  ],
318
310
  36
319
311
  /* STYLE, NEED_HYDRATION */
320
- ), [
321
- [import_vue3.vShow, $setup.show && $setup.initialized]
322
- ])
312
+ )
323
313
  ], 8, ["to"]);
324
314
  }
325
315
  __vue_sfc__.render = __vue_render__;
@@ -4,20 +4,17 @@ type __VLS_Slots = {} & {
4
4
  default?: (props: typeof __VLS_13) => any;
5
5
  };
6
6
  declare const __VLS_component: import("vue").DefineComponent<{}, {
7
- isOnRightSide: import("vue").ComputedRef<boolean>;
8
7
  offset: import("vue").Ref<{
9
8
  x: number;
10
9
  y: number;
11
- }, FloatingBubbleOffset | {
10
+ } | undefined, FloatingBubbleOffset | {
12
11
  x: number;
13
12
  y: number;
14
- }>;
13
+ } | undefined>;
15
14
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
16
- "offset-change": (offset: FloatingBubbleOffset) => any;
17
15
  "drag-start": () => any;
18
16
  "drag-end": () => any;
19
17
  }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
20
- "onOffset-change"?: ((offset: FloatingBubbleOffset) => any) | undefined;
21
18
  "onDrag-start"?: (() => any) | undefined;
22
19
  "onDrag-end"?: (() => any) | undefined;
23
20
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -36,10 +36,9 @@ var import_vue2 = require("vue");
36
36
  var import_context = require("../context");
37
37
  var import_FloatingBubble_vue = __toESM(require("./FloatingBubble/FloatingBubble.vue.js"));
38
38
  var import_vue3 = require("vue");
39
- const STORAGE_KEY = "opencode-bubble-offset";
40
39
  const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
41
40
  __name: "Trigger",
42
- emits: ["offset-change", "drag-start", "drag-end"],
41
+ emits: ["drag-start", "drag-end"],
43
42
  setup(__props, { expose: __expose, emit: __emit }) {
44
43
  const {
45
44
  buttonActive: active,
@@ -47,50 +46,23 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
47
46
  hotkeyLabel,
48
47
  thinking,
49
48
  resolvedTheme,
50
- handleToggle
49
+ handleToggle,
50
+ bubbleOffset,
51
+ handleBubbleOffsetChange
51
52
  } = (0, import_context.useOpenCodeWidgetContext)();
52
- const loadOffset = () => {
53
- try {
54
- const saved = localStorage.getItem(STORAGE_KEY);
55
- if (saved) {
56
- const parsed = JSON.parse(saved);
57
- if (parsed && (parsed.x !== 0 || parsed.y !== 0)) {
58
- return parsed;
59
- }
60
- }
61
- } catch (e) {
62
- }
63
- return { x: 0, y: 0 };
64
- };
65
- const offset = (0, import_vue2.ref)(loadOffset());
53
+ const offset = (0, import_vue2.ref)(bubbleOffset.value);
66
54
  const emit = __emit;
67
- const saveOffset = (value) => {
68
- try {
69
- localStorage.setItem(STORAGE_KEY, JSON.stringify(value));
70
- } catch (e) {
71
- }
72
- };
73
55
  const handleOffsetChange = (value) => {
74
56
  offset.value = value;
75
- saveOffset(value);
76
- emit("offset-change", value);
57
+ handleBubbleOffsetChange(value);
77
58
  };
78
- const bubbleRef = (0, import_vue2.ref)(null);
79
- const isOnRightSide = (0, import_vue2.computed)(() => {
80
- if (typeof window === "undefined") return true;
81
- const centerX = window.innerWidth / 2;
82
- return offset.value.x > centerX;
83
- });
84
- (0, import_vue2.onMounted)(() => {
85
- if (offset.value.x !== 0 || offset.value.y !== 0) {
86
- emit("offset-change", offset.value);
87
- }
59
+ (0, import_vue2.watch)(bubbleOffset, (newOffset) => {
60
+ offset.value = newOffset;
88
61
  });
89
62
  __expose({
90
- isOnRightSide,
91
63
  offset
92
64
  });
93
- const __returned__ = { active, open, hotkeyLabel, thinking, resolvedTheme, handleToggle, STORAGE_KEY, loadOffset, offset, emit, saveOffset, handleOffsetChange, bubbleRef, isOnRightSide, FloatingBubble: import_FloatingBubble_vue.default };
65
+ const __returned__ = { active, open, hotkeyLabel, thinking, resolvedTheme, handleToggle, bubbleOffset, handleBubbleOffsetChange, offset, emit, handleOffsetChange, FloatingBubble: import_FloatingBubble_vue.default };
94
66
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
95
67
  return __returned__;
96
68
  }
@@ -1,5 +1,6 @@
1
1
  import { type Ref } from "vue";
2
2
  import type { OpenCodeWidgetSessionItem, OpenCodeSelectedElementItem, OpenCodeRemoveSelectedPayload } from "./types";
3
+ import type { FloatingBubbleOffset } from "./components/FloatingBubble/types";
3
4
  export interface OpenCodeWidgetContext {
4
5
  theme: Ref<string>;
5
6
  resolvedTheme: Ref<"light" | "dark">;
@@ -22,6 +23,7 @@ export interface OpenCodeWidgetContext {
22
23
  thinking: Ref<boolean>;
23
24
  minimized: Ref<boolean>;
24
25
  promptDockVisible: Ref<boolean>;
26
+ bubbleOffset: Ref<FloatingBubbleOffset | undefined>;
25
27
  iframeSource: Ref<string>;
26
28
  buttonActive: Ref<boolean>;
27
29
  sessionListTitle: Ref<string>;
@@ -48,6 +50,7 @@ export interface OpenCodeWidgetContext {
48
50
  }) => void;
49
51
  handleClearSelectedNodes: () => void;
50
52
  handleFrameLoaded: () => void;
53
+ handleBubbleOffsetChange: (offset: FloatingBubbleOffset | undefined) => void;
51
54
  }
52
55
  export declare function provideOpenCodeWidgetContext(context: OpenCodeWidgetContext): void;
53
56
  export declare function useOpenCodeWidgetContext(): OpenCodeWidgetContext;
@@ -1 +1 @@
1
- .opencode-widget{--oc-bg-main: #ffffff;--oc-bg-secondary: #f8f9fa;--oc-bg-tertiary: #f3f4f6;--oc-overlay-bg: rgba(255, 255, 255, .9);--oc-bg-inverse: #1e1e1e;--oc-text-primary: #282828;--oc-text-secondary: #4b5563;--oc-text-tertiary: #6b7280;--oc-text-placeholder: #9ca3af;--oc-text-inverse: #ffffff;--oc-border-primary: #e5e7eb;--oc-border-secondary: #d1d5db;--oc-primary: #3b82f6;--oc-primary-hover: #2563eb;--oc-primary-bg: rgba(59, 130, 246, .1);--oc-danger: #ef4444;--oc-danger-hover: #dc2626;--oc-danger-active: #b91c1c;--oc-success: #10b981;--oc-overlay: rgba(0, 0, 0, .5);--oc-tooltip-bg: #1e1e1e;--oc-dialog-overlay: rgba(0, 0, 0, .5);--oc-thinking-gradient-1: #10b981;--oc-thinking-gradient-2: #059669;--oc-thinking-glow: rgba(16, 185, 129, .3);--oc-thinking-glow-strong: rgba(16, 185, 129, .6);--oc-skeleton-bg: #e5e7eb;--oc-skeleton-gradient: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);--oc-shadow-sm: 0 2px 4px rgba(0, 0, 0, .1);--oc-shadow-md: 0 4px 12px rgba(0, 0, 0, .15);--oc-shadow-lg: 0 8px 32px rgba(0, 0, 0, .12);--oc-shadow-xl: 0 20px 60px rgba(0, 0, 0, .3);--oc-shadow-primary: 0 2px 4px rgba(59, 130, 246, .2);--oc-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .3);--oc-shadow-danger: 0 4px 12px rgba(239, 68, 68, .3);--oc-trigger-bg: #3b82f6;--oc-trigger-bg-hover: #2563eb;--oc-trigger-bg-active: #1d4ed8;--oc-trigger-shadow: 0 2px 8px rgba(59, 130, 246, .3);--oc-trigger-shadow-hover: 0 4px 12px rgba(59, 130, 246, .4);--oc-trigger-shadow-active: 0 4px 12px rgba(59, 130, 246, .5);position:fixed;z-index:999999;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.opencode-widget.opencode-theme-dark{--oc-bg-main: #1a1a1a;--oc-bg-secondary: #1e1e1e;--oc-bg-tertiary: #282828;--oc-overlay-bg: rgba(26, 26, 26, .9);--oc-bg-inverse: #ffffff;--oc-text-primary: #f3f4f6;--oc-text-secondary: #d1d5db;--oc-text-tertiary: #9ca3af;--oc-text-placeholder: #6b7280;--oc-text-inverse: #282828;--oc-border-primary: #282828;--oc-border-secondary: #4b5563;--oc-primary: #3b82f6;--oc-primary-hover: #2563eb;--oc-primary-bg: rgba(59, 130, 246, .15);--oc-danger: #ef4444;--oc-danger-hover: #dc2626;--oc-danger-active: #b91c1c;--oc-success: #10b981;--oc-overlay: rgba(26, 26, 26, .9);--oc-tooltip-bg: #282828;--oc-dialog-overlay: rgba(0, 0, 0, .7);--oc-thinking-gradient-1: #34d399;--oc-thinking-gradient-2: #10b981;--oc-thinking-glow: rgba(52, 211, 153, .3);--oc-thinking-glow-strong: rgba(52, 211, 153, .6);--oc-skeleton-bg: #151515;--oc-skeleton-gradient: linear-gradient(90deg, #282828 25%, #4b5563 50%, #282828 75%);--oc-shadow-sm: 0 2px 4px rgba(0, 0, 0, .3);--oc-shadow-md: 0 4px 12px rgba(0, 0, 0, .4);--oc-shadow-lg: 0 8px 32px rgba(0, 0, 0, .4);--oc-shadow-xl: 0 20px 60px rgba(0, 0, 0, .6);--oc-shadow-primary: 0 2px 4px rgba(59, 130, 246, .3);--oc-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .4);--oc-shadow-danger: 0 4px 12px rgba(239, 68, 68, .4);--oc-trigger-bg: #60a5fa;--oc-trigger-bg-hover: #3b82f6;--oc-trigger-bg-active: #2563eb;--oc-trigger-shadow: 0 2px 8px rgba(96, 165, 250, .4);--oc-trigger-shadow-hover: 0 4px 12px rgba(96, 165, 250, .5);--oc-trigger-shadow-active: 0 4px 12px rgba(96, 165, 250, .6)}.opencode-chat{position:fixed;bottom:20px;width:700px;height:86vh;max-height:calc(100vh - 40px);background:var(--oc-bg-main);border-radius:16px;box-shadow:var(--oc-shadow-lg);overflow:hidden;opacity:0;visibility:hidden;transform:translateY(20px) scale(.95);transition:all .3s ease;display:flex;flex-direction:column;z-index:99999}.opencode-chat.minimized{width:300px;height:300px}.opencode-chat.minimized .opencode-iframe-container{margin-top:-146px}.opencode-chat-content{display:flex;flex:1;overflow:hidden}.opencode-chat.open{opacity:1;visibility:visible;transform:translateY(0) scale(1)}.opencode-notification{position:absolute;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px rgba(59,130,246,.4),0 0 0 2px rgba(59,130,246,.2);animation:slideDown .3s ease;z-index:10000000;display:flex;align-items:center;gap:10px}.opencode-notification:before{content:"\1f4a1";font-size:16px}.opencode-dialog-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:var(--oc-dialog-overlay);display:flex;align-items:center;justify-content:center;z-index:9999999;animation:fadeIn .2s ease}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.opencode-dialog{background:var(--oc-bg-main);border-radius:12px;padding:24px;min-width:320px;max-width:400px;box-shadow:var(--oc-shadow-xl);animation:scaleIn .2s ease}@keyframes scaleIn{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}.opencode-dialog-content{margin-bottom:20px}.opencode-dialog-message{font-size:15px;color:var(--oc-text-primary);line-height:1.5}.opencode-dialog-actions{display:flex;gap:12px;justify-content:flex-end}.opencode-dialog-btn{padding:10px 20px;border-radius:8px;border:none;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.opencode-dialog-btn.cancel{background:var(--oc-bg-tertiary);color:var(--oc-text-primary)}.opencode-dialog-btn.cancel:hover{background:var(--oc-text-primary);color:var(--oc-bg-main)}.opencode-dialog-btn.confirm{background:var(--oc-danger);color:#fff}.opencode-dialog-btn.confirm:hover{background:var(--oc-danger-hover)}@keyframes slideDown{0%{transform:translate(-50%) translateY(-100%);opacity:0}to{transform:translate(-50%) translateY(0);opacity:1}}.opencode-page-notification{position:fixed;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px rgba(59,130,246,.4),0 0 0 2px rgba(59,130,246,.2);animation:slideDown .3s ease;z-index:2147483647;display:flex;align-items:center;gap:10px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.opencode-page-notification:before{content:"\1f4a1";font-size:16px}.opencode-element-highlight{position:fixed;pointer-events:none;z-index:999998;display:none;transition:all .1s ease;border-radius:4px}#vue-inspector-container{display:none!important}.opencode-element-tooltip{position:fixed;background:var(--oc-tooltip-bg);color:#fff;padding:8px 12px;border-radius:6px;font-size:12px;z-index:9999998;display:none;box-shadow:var(--oc-shadow-md);max-width:300px;pointer-events:none}.opencode-tooltip-tag{font-weight:500;margin-bottom:4px;word-break:break-all}.opencode-tooltip-file{font-size:11px;color:var(--oc-text-placeholder);word-break:break-all}.opencode-element-highlight-temp{position:absolute;pointer-events:none;z-index:999998;border-radius:4px;animation:highlight-pulse 2s ease-out forwards}@keyframes highlight-pulse{0%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.02)}to{opacity:0;transform:scale(1)}}@media(max-width:768px){.opencode-chat{width:calc(100vw - 40px);height:calc(100vh - 100px)}}
1
+ .opencode-widget{--oc-bg-main: #ffffff;--oc-bg-secondary: #f8f9fa;--oc-bg-tertiary: #f3f4f6;--oc-overlay-bg: rgba(255, 255, 255, .9);--oc-bg-inverse: #1e1e1e;--oc-text-primary: #282828;--oc-text-secondary: #4b5563;--oc-text-tertiary: #6b7280;--oc-text-placeholder: #9ca3af;--oc-text-inverse: #ffffff;--oc-border-primary: #e5e7eb;--oc-border-secondary: #d1d5db;--oc-primary: #3b82f6;--oc-primary-hover: #2563eb;--oc-primary-bg: rgba(59, 130, 246, .1);--oc-danger: #ef4444;--oc-danger-hover: #dc2626;--oc-danger-active: #b91c1c;--oc-success: #10b981;--oc-overlay: rgba(0, 0, 0, .5);--oc-tooltip-bg: #1e1e1e;--oc-dialog-overlay: rgba(0, 0, 0, .5);--oc-thinking-gradient-1: #10b981;--oc-thinking-gradient-2: #059669;--oc-thinking-glow: rgba(16, 185, 129, .3);--oc-thinking-glow-strong: rgba(16, 185, 129, .6);--oc-skeleton-bg: #e5e7eb;--oc-skeleton-gradient: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);--oc-shadow-sm: 0 2px 4px rgba(0, 0, 0, .1);--oc-shadow-md: 0 4px 12px rgba(0, 0, 0, .15);--oc-shadow-lg: 0 8px 32px rgba(0, 0, 0, .12);--oc-shadow-xl: 0 20px 60px rgba(0, 0, 0, .3);--oc-shadow-primary: 0 2px 4px rgba(59, 130, 246, .2);--oc-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .3);--oc-shadow-danger: 0 4px 12px rgba(239, 68, 68, .3);--oc-trigger-bg: #3b82f6;--oc-trigger-bg-hover: #2563eb;--oc-trigger-bg-active: #1d4ed8;--oc-trigger-shadow: 0 2px 8px rgba(59, 130, 246, .3);--oc-trigger-shadow-hover: 0 4px 12px rgba(59, 130, 246, .4);--oc-trigger-shadow-active: 0 4px 12px rgba(59, 130, 246, .5);position:fixed;z-index:999999;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.opencode-widget.opencode-theme-dark{--oc-bg-main: #1a1a1a;--oc-bg-secondary: #1e1e1e;--oc-bg-tertiary: #282828;--oc-overlay-bg: rgba(26, 26, 26, .9);--oc-bg-inverse: #ffffff;--oc-text-primary: #f3f4f6;--oc-text-secondary: #d1d5db;--oc-text-tertiary: #9ca3af;--oc-text-placeholder: #6b7280;--oc-text-inverse: #282828;--oc-border-primary: #282828;--oc-border-secondary: #4b5563;--oc-primary: #3b82f6;--oc-primary-hover: #2563eb;--oc-primary-bg: rgba(59, 130, 246, .15);--oc-danger: #ef4444;--oc-danger-hover: #dc2626;--oc-danger-active: #b91c1c;--oc-success: #10b981;--oc-overlay: rgba(26, 26, 26, .9);--oc-tooltip-bg: #282828;--oc-dialog-overlay: rgba(0, 0, 0, .7);--oc-thinking-gradient-1: #34d399;--oc-thinking-gradient-2: #10b981;--oc-thinking-glow: rgba(52, 211, 153, .3);--oc-thinking-glow-strong: rgba(52, 211, 153, .6);--oc-skeleton-bg: #151515;--oc-skeleton-gradient: linear-gradient(90deg, #282828 25%, #4b5563 50%, #282828 75%);--oc-shadow-sm: 0 2px 4px rgba(0, 0, 0, .3);--oc-shadow-md: 0 4px 12px rgba(0, 0, 0, .4);--oc-shadow-lg: 0 8px 32px rgba(0, 0, 0, .4);--oc-shadow-xl: 0 20px 60px rgba(0, 0, 0, .6);--oc-shadow-primary: 0 2px 4px rgba(59, 130, 246, .3);--oc-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .4);--oc-shadow-danger: 0 4px 12px rgba(239, 68, 68, .4);--oc-trigger-bg: #60a5fa;--oc-trigger-bg-hover: #3b82f6;--oc-trigger-bg-active: #2563eb;--oc-trigger-shadow: 0 2px 8px rgba(96, 165, 250, .4);--oc-trigger-shadow-hover: 0 4px 12px rgba(96, 165, 250, .5);--oc-trigger-shadow-active: 0 4px 12px rgba(96, 165, 250, .6)}.opencode-chat{position:fixed;bottom:20px;width:700px;height:86vh;max-height:calc(100vh - 40px);background:var(--oc-bg-main);border-radius:16px;box-shadow:var(--oc-shadow-lg);overflow:hidden;opacity:0;visibility:hidden;transform:translate3d(var(---chatAnimationOrigin\.x),var(---chatAnimationOrigin\.y),0) scale(.95);transition:all .3s ease;display:flex;flex-direction:column;z-index:99999}.opencode-chat.open{opacity:1;visibility:visible;transform:translateZ(0) scale(1)}.opencode-chat.no-transition,.opencode-chat.no-transition.open{transition:none!important}.opencode-chat.minimized{width:300px;height:300px}.opencode-chat.minimized .opencode-iframe-container{margin-top:-146px}.opencode-chat-content{display:flex;flex:1;overflow:hidden}.opencode-notification{position:absolute;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px rgba(59,130,246,.4),0 0 0 2px rgba(59,130,246,.2);animation:slideDown .3s ease;z-index:10000000;display:flex;align-items:center;gap:10px}.opencode-notification:before{content:"\1f4a1";font-size:16px}.opencode-dialog-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:var(--oc-dialog-overlay);display:flex;align-items:center;justify-content:center;z-index:9999999;animation:fadeIn .2s ease}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.opencode-dialog{background:var(--oc-bg-main);border-radius:12px;padding:24px;min-width:320px;max-width:400px;box-shadow:var(--oc-shadow-xl);animation:scaleIn .2s ease}@keyframes scaleIn{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}.opencode-dialog-content{margin-bottom:20px}.opencode-dialog-message{font-size:15px;color:var(--oc-text-primary);line-height:1.5}.opencode-dialog-actions{display:flex;gap:12px;justify-content:flex-end}.opencode-dialog-btn{padding:10px 20px;border-radius:8px;border:none;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.opencode-dialog-btn.cancel{background:var(--oc-bg-tertiary);color:var(--oc-text-primary)}.opencode-dialog-btn.cancel:hover{background:var(--oc-text-primary);color:var(--oc-bg-main)}.opencode-dialog-btn.confirm{background:var(--oc-danger);color:#fff}.opencode-dialog-btn.confirm:hover{background:var(--oc-danger-hover)}@keyframes slideDown{0%{transform:translate(-50%) translateY(-100%);opacity:0}to{transform:translate(-50%) translateY(0);opacity:1}}.opencode-page-notification{position:fixed;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px rgba(59,130,246,.4),0 0 0 2px rgba(59,130,246,.2);animation:slideDown .3s ease;z-index:2147483647;display:flex;align-items:center;gap:10px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.opencode-page-notification:before{content:"\1f4a1";font-size:16px}.opencode-element-highlight{position:fixed;pointer-events:none;z-index:999998;border-radius:4px}#vue-inspector-container{display:none!important}.opencode-element-tooltip{position:fixed;background:var(--oc-tooltip-bg);color:#fff;padding:8px 12px;border-radius:6px;font-size:12px;z-index:9999998;box-shadow:var(--oc-shadow-md);max-width:300px;pointer-events:none}.opencode-tooltip-tag{font-weight:500;margin-bottom:4px;word-break:break-all}.opencode-tooltip-file{font-size:11px;color:var(--oc-text-placeholder);word-break:break-all}.opencode-element-highlight-temp{position:absolute;pointer-events:none;z-index:999998;border-radius:4px;animation:highlight-pulse 2s ease-out forwards}@keyframes highlight-pulse{0%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.02)}to{opacity:0;transform:scale(1)}}@media(max-width:768px){.opencode-chat{width:calc(100vw - 40px);height:calc(100vh - 100px)}}
@@ -1,23 +1,23 @@
1
1
  import type { OpenCodeWidgetProps } from "./types";
2
- declare var __VLS_12: {}, __VLS_17: {}, __VLS_19: {}, __VLS_21: {}, __VLS_26: {}, __VLS_33: {}, __VLS_35: {}, __VLS_37: {}, __VLS_39: {};
2
+ declare var __VLS_11: {}, __VLS_16: {}, __VLS_18: {}, __VLS_20: {}, __VLS_25: {}, __VLS_32: {}, __VLS_34: {}, __VLS_36: {}, __VLS_38: {};
3
3
  type __VLS_Slots = {} & {
4
- 'button-icon'?: (props: typeof __VLS_12) => any;
4
+ 'button-icon'?: (props: typeof __VLS_11) => any;
5
5
  } & {
6
- 'session-toggle-icon'?: (props: typeof __VLS_17) => any;
6
+ 'session-toggle-icon'?: (props: typeof __VLS_16) => any;
7
7
  } & {
8
- 'select-icon'?: (props: typeof __VLS_19) => any;
8
+ 'select-icon'?: (props: typeof __VLS_18) => any;
9
9
  } & {
10
- 'close-icon'?: (props: typeof __VLS_21) => any;
10
+ 'close-icon'?: (props: typeof __VLS_20) => any;
11
11
  } & {
12
- 'sessions-empty'?: (props: typeof __VLS_26) => any;
12
+ 'sessions-empty'?: (props: typeof __VLS_25) => any;
13
13
  } & {
14
- 'empty-state'?: (props: typeof __VLS_33) => any;
14
+ 'empty-state'?: (props: typeof __VLS_32) => any;
15
15
  } & {
16
- loading?: (props: typeof __VLS_35) => any;
16
+ loading?: (props: typeof __VLS_34) => any;
17
17
  } & {
18
- error?: (props: typeof __VLS_37) => any;
18
+ error?: (props: typeof __VLS_36) => any;
19
19
  } & {
20
- content?: (props: typeof __VLS_39) => any;
20
+ content?: (props: typeof __VLS_38) => any;
21
21
  };
22
22
  declare const __VLS_component: import("vue").DefineComponent<OpenCodeWidgetProps, {
23
23
  showNotification: (message: string, options?: {