@vite-plugin-opencode-assistant/components 1.0.48 → 1.0.50
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/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/open-code-widget/composables/use-persist-state.d.ts +5 -1
- package/es/open-code-widget/composables/use-persist-state.js +10 -2
- package/es/open-code-widget/composables/use-split.d.ts +5 -0
- package/es/open-code-widget/composables/use-split.js +46 -12
- package/es/open-code-widget/src/components/ChatPanel-sfc.css +1 -1
- package/es/open-code-widget/src/components/ChatPanel.vue.d.ts +2 -0
- package/es/open-code-widget/src/components/ChatPanel.vue.js +60 -11
- package/es/open-code-widget/src/components/Header.vue.d.ts +8 -4
- package/es/open-code-widget/src/components/Header.vue.js +313 -27
- package/es/open-code-widget/src/components/ResizeHandle-sfc.css +1 -1
- package/es/open-code-widget/src/components/ResizeHandle.vue.d.ts +2 -0
- package/es/open-code-widget/src/components/ResizeHandle.vue.js +9 -3
- package/es/open-code-widget/src/context.d.ts +5 -1
- package/es/open-code-widget/src/index-sfc.css +1 -1
- package/es/open-code-widget/src/index.vue.d.ts +1 -1
- package/es/open-code-widget/src/index.vue.js +48 -12
- package/lib/@vite-plugin-opencode-assistant/components.cjs.js +372 -70
- package/lib/@vite-plugin-opencode-assistant/components.es.js +372 -70
- package/lib/components.css +3 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/open-code-widget/composables/use-persist-state.d.ts +5 -1
- package/lib/open-code-widget/composables/use-persist-state.js +10 -2
- package/lib/open-code-widget/composables/use-split.d.ts +5 -0
- package/lib/open-code-widget/composables/use-split.js +46 -12
- package/lib/open-code-widget/src/components/ChatPanel-sfc.css +1 -1
- package/lib/open-code-widget/src/components/ChatPanel.vue.d.ts +2 -0
- package/lib/open-code-widget/src/components/ChatPanel.vue.js +60 -11
- package/lib/open-code-widget/src/components/Header.vue.d.ts +8 -4
- package/lib/open-code-widget/src/components/Header.vue.js +313 -27
- package/lib/open-code-widget/src/components/ResizeHandle-sfc.css +1 -1
- package/lib/open-code-widget/src/components/ResizeHandle.vue.d.ts +2 -0
- package/lib/open-code-widget/src/components/ResizeHandle.vue.js +9 -3
- package/lib/open-code-widget/src/context.d.ts +5 -1
- package/lib/open-code-widget/src/index-sfc.css +1 -1
- package/lib/open-code-widget/src/index.vue.d.ts +1 -1
- package/lib/open-code-widget/src/index.vue.js +48 -12
- package/lib/web-types.json +1 -1
- package/package.json +2 -2
|
@@ -137,7 +137,7 @@ var __vue_sfc__$8 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
137
137
|
__name: "Header",
|
|
138
138
|
setup(__props, { expose: __expose }) {
|
|
139
139
|
__expose();
|
|
140
|
-
const { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, minimized, promptDockVisible, mode, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleClose, handleToggleMinimize, handleTogglePromptDock } = useOpenCodeWidgetContext();
|
|
140
|
+
const { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, minimized, promptDockVisible, mode, displayMode, splitPosition, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleToggleDisplayMode, handleToggleSplitPosition, handleClose, handleToggleMinimize, handleTogglePromptDock } = useOpenCodeWidgetContext();
|
|
141
141
|
const __returned__ = {
|
|
142
142
|
title,
|
|
143
143
|
sessionListTitle,
|
|
@@ -149,9 +149,13 @@ var __vue_sfc__$8 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
149
149
|
minimized,
|
|
150
150
|
promptDockVisible,
|
|
151
151
|
mode,
|
|
152
|
+
displayMode,
|
|
153
|
+
splitPosition,
|
|
152
154
|
handleToggleSessionList,
|
|
153
155
|
handleToggleSelectMode,
|
|
154
156
|
handleToggleTheme,
|
|
157
|
+
handleToggleDisplayMode,
|
|
158
|
+
handleToggleSplitPosition,
|
|
155
159
|
handleClose,
|
|
156
160
|
handleToggleMinimize,
|
|
157
161
|
handleTogglePromptDock,
|
|
@@ -169,6 +173,35 @@ var __vue_sfc__$8 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
169
173
|
light: "亮色主题",
|
|
170
174
|
dark: "暗色主题"
|
|
171
175
|
}[theme.value]}`;
|
|
176
|
+
}),
|
|
177
|
+
displayModeIconTitle: (0, vue.computed)(() => {
|
|
178
|
+
return `\u5C55\u793A\u6A21\u5F0F: ${{
|
|
179
|
+
bubble: "气泡模式",
|
|
180
|
+
split: "分屏模式",
|
|
181
|
+
auto: "自动模式"
|
|
182
|
+
}[displayMode.value]}`;
|
|
183
|
+
}),
|
|
184
|
+
displayModeIconLabel: (0, vue.computed)(() => {
|
|
185
|
+
const displayModeLabels = {
|
|
186
|
+
bubble: "气泡模式",
|
|
187
|
+
split: "分屏模式",
|
|
188
|
+
auto: "自动模式"
|
|
189
|
+
};
|
|
190
|
+
const modes = [
|
|
191
|
+
"bubble",
|
|
192
|
+
"split",
|
|
193
|
+
"auto"
|
|
194
|
+
];
|
|
195
|
+
return `\u5207\u6362\u5C55\u793A\u6A21\u5F0F - \u4E0B\u4E00\u4E2A: ${displayModeLabels[modes[(modes.indexOf(displayMode.value) + 1) % modes.length]]}`;
|
|
196
|
+
}),
|
|
197
|
+
splitPositionIconTitle: (0, vue.computed)(() => {
|
|
198
|
+
return `\u5206\u680F\u4F4D\u7F6E: ${{
|
|
199
|
+
left: "左侧",
|
|
200
|
+
right: "右侧"
|
|
201
|
+
}[splitPosition.value]}`;
|
|
202
|
+
}),
|
|
203
|
+
splitPositionIconLabel: (0, vue.computed)(() => {
|
|
204
|
+
return `\u5207\u6362\u5206\u680F\u4F4D\u7F6E - \u4E0B\u4E00\u4E2A: ${splitPosition.value === "right" ? "左侧" : "右侧"}`;
|
|
172
205
|
})
|
|
173
206
|
};
|
|
174
207
|
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
@@ -197,7 +230,7 @@ var _hoisted_6$4 = {
|
|
|
197
230
|
"stroke-width": "2",
|
|
198
231
|
"aria-hidden": "true"
|
|
199
232
|
};
|
|
200
|
-
var _hoisted_7$
|
|
233
|
+
var _hoisted_7$3 = {
|
|
201
234
|
key: 1,
|
|
202
235
|
viewBox: "0 0 24 24",
|
|
203
236
|
width: "16",
|
|
@@ -207,7 +240,38 @@ var _hoisted_7$2 = {
|
|
|
207
240
|
"stroke-width": "2",
|
|
208
241
|
"aria-hidden": "true"
|
|
209
242
|
};
|
|
210
|
-
var _hoisted_8$
|
|
243
|
+
var _hoisted_8$2 = {
|
|
244
|
+
key: 2,
|
|
245
|
+
viewBox: "0 0 24 24",
|
|
246
|
+
width: "16",
|
|
247
|
+
height: "16",
|
|
248
|
+
fill: "none",
|
|
249
|
+
stroke: "currentColor",
|
|
250
|
+
"stroke-width": "2",
|
|
251
|
+
"aria-hidden": "true"
|
|
252
|
+
};
|
|
253
|
+
var _hoisted_9$1 = ["title", "aria-label"];
|
|
254
|
+
var _hoisted_10$1 = {
|
|
255
|
+
key: 0,
|
|
256
|
+
viewBox: "0 0 24 24",
|
|
257
|
+
width: "16",
|
|
258
|
+
height: "16",
|
|
259
|
+
fill: "none",
|
|
260
|
+
stroke: "currentColor",
|
|
261
|
+
"stroke-width": "2",
|
|
262
|
+
"aria-hidden": "true"
|
|
263
|
+
};
|
|
264
|
+
var _hoisted_11 = {
|
|
265
|
+
key: 1,
|
|
266
|
+
viewBox: "0 0 24 24",
|
|
267
|
+
width: "16",
|
|
268
|
+
height: "16",
|
|
269
|
+
fill: "none",
|
|
270
|
+
stroke: "currentColor",
|
|
271
|
+
"stroke-width": "2",
|
|
272
|
+
"aria-hidden": "true"
|
|
273
|
+
};
|
|
274
|
+
var _hoisted_12 = {
|
|
211
275
|
key: 2,
|
|
212
276
|
viewBox: "0 0 24 24",
|
|
213
277
|
width: "16",
|
|
@@ -217,19 +281,40 @@ var _hoisted_8$1 = {
|
|
|
217
281
|
"stroke-width": "2",
|
|
218
282
|
"aria-hidden": "true"
|
|
219
283
|
};
|
|
220
|
-
var
|
|
221
|
-
var
|
|
222
|
-
var
|
|
284
|
+
var _hoisted_13 = { class: "opencode-chat-header-title" };
|
|
285
|
+
var _hoisted_14 = { class: "opencode-chat-header-actions" };
|
|
286
|
+
var _hoisted_15 = ["title", "aria-label"];
|
|
287
|
+
var _hoisted_16 = {
|
|
288
|
+
key: 0,
|
|
289
|
+
viewBox: "0 0 24 24",
|
|
290
|
+
width: "16",
|
|
291
|
+
height: "16",
|
|
292
|
+
fill: "none",
|
|
293
|
+
stroke: "currentColor",
|
|
294
|
+
"stroke-width": "2",
|
|
295
|
+
"aria-hidden": "true"
|
|
296
|
+
};
|
|
297
|
+
var _hoisted_17 = {
|
|
298
|
+
key: 1,
|
|
299
|
+
viewBox: "0 0 24 24",
|
|
300
|
+
width: "16",
|
|
301
|
+
height: "16",
|
|
302
|
+
fill: "none",
|
|
303
|
+
stroke: "currentColor",
|
|
304
|
+
"stroke-width": "2",
|
|
305
|
+
"aria-hidden": "true"
|
|
306
|
+
};
|
|
307
|
+
var _hoisted_18 = [
|
|
223
308
|
"title",
|
|
224
309
|
"aria-label",
|
|
225
310
|
"aria-pressed"
|
|
226
311
|
];
|
|
227
|
-
var
|
|
312
|
+
var _hoisted_19 = [
|
|
228
313
|
"title",
|
|
229
314
|
"aria-label",
|
|
230
315
|
"aria-pressed"
|
|
231
316
|
];
|
|
232
|
-
var
|
|
317
|
+
var _hoisted_20 = {
|
|
233
318
|
key: 0,
|
|
234
319
|
viewBox: "0 0 24 24",
|
|
235
320
|
width: "14",
|
|
@@ -239,7 +324,7 @@ var _hoisted_13 = {
|
|
|
239
324
|
"stroke-width": "2",
|
|
240
325
|
"aria-hidden": "true"
|
|
241
326
|
};
|
|
242
|
-
var
|
|
327
|
+
var _hoisted_21 = {
|
|
243
328
|
key: 1,
|
|
244
329
|
viewBox: "0 0 24 24",
|
|
245
330
|
width: "14",
|
|
@@ -259,7 +344,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
259
344
|
"aria-label": $setup.sessionListTitle,
|
|
260
345
|
"aria-expanded": !$setup.sessionListCollapsed,
|
|
261
346
|
onClick: _cache[0] || (_cache[0] = (...args) => $setup.handleToggleSessionList && $setup.handleToggleSessionList(...args))
|
|
262
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "session-toggle-icon", {}, () => [_cache[
|
|
347
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "session-toggle-icon", {}, () => [_cache[8] || (_cache[8] = (0, vue.createElementVNode)("svg", {
|
|
263
348
|
viewBox: "0 0 24 24",
|
|
264
349
|
width: "16",
|
|
265
350
|
height: "16",
|
|
@@ -279,7 +364,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
279
364
|
"aria-pressed": $setup.selectMode,
|
|
280
365
|
disabled: !$setup.selectEnabled,
|
|
281
366
|
onClick: _cache[1] || (_cache[1] = (...args) => $setup.handleToggleSelectMode && $setup.handleToggleSelectMode(...args))
|
|
282
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "select-icon", {}, () => [_cache[
|
|
367
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "select-icon", {}, () => [_cache[9] || (_cache[9] = (0, vue.createElementVNode)("svg", {
|
|
283
368
|
viewBox: "0 0 1024 1024",
|
|
284
369
|
width: "16",
|
|
285
370
|
height: "16",
|
|
@@ -297,19 +382,118 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
297
382
|
title: $setup.themeIconTitle,
|
|
298
383
|
"aria-label": $setup.themeIconLabel,
|
|
299
384
|
onClick: _cache[2] || (_cache[2] = (...args) => $setup.handleToggleTheme && $setup.handleToggleTheme(...args))
|
|
300
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_6$4, [..._cache[
|
|
385
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_6$4, [..._cache[10] || (_cache[10] = [(0, vue.createStaticVNode)("<circle cx=\"12\" cy=\"12\" r=\"5\"></circle><line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"3\"></line><line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"23\"></line><line x1=\"4.22\" y1=\"4.22\" x2=\"5.64\" y2=\"5.64\"></line><line x1=\"18.36\" y1=\"18.36\" x2=\"19.78\" y2=\"19.78\"></line><line x1=\"1\" y1=\"12\" x2=\"3\" y2=\"12\"></line><line x1=\"21\" y1=\"12\" x2=\"23\" y2=\"12\"></line><line x1=\"4.22\" y1=\"19.78\" x2=\"5.64\" y2=\"18.36\"></line><line x1=\"18.36\" y1=\"5.64\" x2=\"19.78\" y2=\"4.22\"></line>", 9)])])) : $setup.theme === "dark" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_7$3, [..._cache[11] || (_cache[11] = [(0, vue.createElementVNode)("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_8$2, [..._cache[12] || (_cache[12] = [(0, vue.createStaticVNode)("<rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" ry=\"2\"></rect><line x1=\"8\" y1=\"21\" x2=\"16\" y2=\"21\"></line><line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"21\"></line><circle cx=\"12\" cy=\"10\" r=\"3\"></circle><path d=\"M7 7l2 2M17 7l-2 2M7 13l2-2M17 13l-2-2\"></path>", 5)])]))])], 8, _hoisted_5$4),
|
|
386
|
+
(0, vue.createElementVNode)("button", {
|
|
387
|
+
class: "opencode-header-btn display-mode-btn",
|
|
388
|
+
type: "button",
|
|
389
|
+
title: $setup.displayModeIconTitle,
|
|
390
|
+
"aria-label": $setup.displayModeIconLabel,
|
|
391
|
+
onClick: _cache[3] || (_cache[3] = (...args) => $setup.handleToggleDisplayMode && $setup.handleToggleDisplayMode(...args))
|
|
392
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "display-mode-icon", {}, () => [$setup.displayMode === "bubble" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_10$1, [..._cache[13] || (_cache[13] = [
|
|
393
|
+
(0, vue.createElementVNode)("circle", {
|
|
394
|
+
cx: "12",
|
|
395
|
+
cy: "12",
|
|
396
|
+
r: "10"
|
|
397
|
+
}, null, -1),
|
|
398
|
+
(0, vue.createElementVNode)("path", {
|
|
399
|
+
d: "M8 14s1.5 2 4 2 4-2 4-2",
|
|
400
|
+
"stroke-linecap": "round"
|
|
401
|
+
}, null, -1),
|
|
402
|
+
(0, vue.createElementVNode)("line", {
|
|
403
|
+
x1: "9",
|
|
404
|
+
y1: "9",
|
|
405
|
+
x2: "9.01",
|
|
406
|
+
y2: "9",
|
|
407
|
+
"stroke-linecap": "round"
|
|
408
|
+
}, null, -1),
|
|
409
|
+
(0, vue.createElementVNode)("line", {
|
|
410
|
+
x1: "15",
|
|
411
|
+
y1: "9",
|
|
412
|
+
x2: "15.01",
|
|
413
|
+
y2: "9",
|
|
414
|
+
"stroke-linecap": "round"
|
|
415
|
+
}, null, -1)
|
|
416
|
+
])])) : $setup.displayMode === "split" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_11, [..._cache[14] || (_cache[14] = [(0, vue.createElementVNode)("rect", {
|
|
417
|
+
x: "3",
|
|
418
|
+
y: "3",
|
|
419
|
+
width: "18",
|
|
420
|
+
height: "18",
|
|
421
|
+
rx: "2"
|
|
422
|
+
}, null, -1), (0, vue.createElementVNode)("line", {
|
|
423
|
+
x1: "12",
|
|
424
|
+
y1: "3",
|
|
425
|
+
x2: "12",
|
|
426
|
+
y2: "21"
|
|
427
|
+
}, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_12, [..._cache[15] || (_cache[15] = [
|
|
428
|
+
(0, vue.createElementVNode)("rect", {
|
|
429
|
+
x: "3",
|
|
430
|
+
y: "3",
|
|
431
|
+
width: "8",
|
|
432
|
+
height: "8",
|
|
433
|
+
rx: "1"
|
|
434
|
+
}, null, -1),
|
|
435
|
+
(0, vue.createElementVNode)("rect", {
|
|
436
|
+
x: "15",
|
|
437
|
+
y: "3",
|
|
438
|
+
width: "6",
|
|
439
|
+
height: "8",
|
|
440
|
+
rx: "1"
|
|
441
|
+
}, null, -1),
|
|
442
|
+
(0, vue.createElementVNode)("rect", {
|
|
443
|
+
x: "3",
|
|
444
|
+
y: "15",
|
|
445
|
+
width: "8",
|
|
446
|
+
height: "6",
|
|
447
|
+
rx: "1"
|
|
448
|
+
}, null, -1),
|
|
449
|
+
(0, vue.createElementVNode)("circle", {
|
|
450
|
+
cx: "18",
|
|
451
|
+
cy: "18",
|
|
452
|
+
r: "3"
|
|
453
|
+
}, null, -1)
|
|
454
|
+
])]))])], 8, _hoisted_9$1)
|
|
301
455
|
]),
|
|
302
|
-
(0, vue.createElementVNode)("span",
|
|
303
|
-
(0, vue.createElementVNode)("div",
|
|
304
|
-
|
|
456
|
+
(0, vue.createElementVNode)("span", _hoisted_13, (0, vue.toDisplayString)($setup.title), 1),
|
|
457
|
+
(0, vue.createElementVNode)("div", _hoisted_14, [
|
|
458
|
+
$setup.isSplitMode ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
305
459
|
key: 0,
|
|
460
|
+
class: "opencode-header-btn split-position-btn",
|
|
461
|
+
type: "button",
|
|
462
|
+
title: $setup.splitPositionIconTitle,
|
|
463
|
+
"aria-label": $setup.splitPositionIconLabel,
|
|
464
|
+
onClick: _cache[4] || (_cache[4] = (...args) => $setup.handleToggleSplitPosition && $setup.handleToggleSplitPosition(...args))
|
|
465
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "split-position-icon", {}, () => [$setup.splitPosition === "right" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_16, [..._cache[16] || (_cache[16] = [(0, vue.createElementVNode)("rect", {
|
|
466
|
+
x: "3",
|
|
467
|
+
y: "3",
|
|
468
|
+
width: "18",
|
|
469
|
+
height: "18",
|
|
470
|
+
rx: "2"
|
|
471
|
+
}, null, -1), (0, vue.createElementVNode)("line", {
|
|
472
|
+
x1: "15",
|
|
473
|
+
y1: "3",
|
|
474
|
+
x2: "15",
|
|
475
|
+
y2: "21"
|
|
476
|
+
}, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_17, [..._cache[17] || (_cache[17] = [(0, vue.createElementVNode)("rect", {
|
|
477
|
+
x: "3",
|
|
478
|
+
y: "3",
|
|
479
|
+
width: "18",
|
|
480
|
+
height: "18",
|
|
481
|
+
rx: "2"
|
|
482
|
+
}, null, -1), (0, vue.createElementVNode)("line", {
|
|
483
|
+
x1: "9",
|
|
484
|
+
y1: "3",
|
|
485
|
+
x2: "9",
|
|
486
|
+
y2: "21"
|
|
487
|
+
}, null, -1)])]))])], 8, _hoisted_15)) : (0, vue.createCommentVNode)("v-if", true),
|
|
488
|
+
!$setup.isSplitMode ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
489
|
+
key: 1,
|
|
306
490
|
class: "opencode-header-btn prompt-dock",
|
|
307
491
|
type: "button",
|
|
308
492
|
title: $setup.promptDockVisible ? "隐藏对话框" : "显示对话框",
|
|
309
493
|
"aria-label": $setup.promptDockVisible ? "隐藏对话框" : "显示对话框",
|
|
310
494
|
"aria-pressed": $setup.promptDockVisible,
|
|
311
|
-
onClick: _cache[
|
|
312
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "prompt-dock-icon", {}, () => [_cache[
|
|
495
|
+
onClick: _cache[5] || (_cache[5] = (...args) => $setup.handleTogglePromptDock && $setup.handleTogglePromptDock(...args))
|
|
496
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "prompt-dock-icon", {}, () => [_cache[18] || (_cache[18] = (0, vue.createElementVNode)("svg", {
|
|
313
497
|
viewBox: "0 0 24 24",
|
|
314
498
|
width: "14",
|
|
315
499
|
height: "14",
|
|
@@ -317,24 +501,24 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
317
501
|
stroke: "currentColor",
|
|
318
502
|
"stroke-width": "2",
|
|
319
503
|
"aria-hidden": "true"
|
|
320
|
-
}, [(0, vue.createElementVNode)("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })], -1))])], 8,
|
|
504
|
+
}, [(0, vue.createElementVNode)("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })], -1))])], 8, _hoisted_18)) : (0, vue.createCommentVNode)("v-if", true),
|
|
321
505
|
!$setup.isSplitMode ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
322
|
-
key:
|
|
506
|
+
key: 2,
|
|
323
507
|
class: "opencode-header-btn minimize",
|
|
324
508
|
type: "button",
|
|
325
509
|
title: $setup.minimized ? "展开" : "最小化",
|
|
326
510
|
"aria-label": $setup.minimized ? "展开面板" : "最小化面板",
|
|
327
511
|
"aria-pressed": $setup.minimized,
|
|
328
|
-
onClick: _cache[
|
|
329
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "minimize-icon", {}, () => [$setup.minimized ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg",
|
|
512
|
+
onClick: _cache[6] || (_cache[6] = (...args) => $setup.handleToggleMinimize && $setup.handleToggleMinimize(...args))
|
|
513
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "minimize-icon", {}, () => [$setup.minimized ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_20, [..._cache[19] || (_cache[19] = [(0, vue.createElementVNode)("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" }, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_21, [..._cache[20] || (_cache[20] = [(0, vue.createElementVNode)("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" }, null, -1)])]))])], 8, _hoisted_19)) : (0, vue.createCommentVNode)("v-if", true),
|
|
330
514
|
!$setup.isSplitMode ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
331
|
-
key:
|
|
515
|
+
key: 3,
|
|
332
516
|
class: "opencode-header-btn close",
|
|
333
517
|
type: "button",
|
|
334
518
|
title: "关闭",
|
|
335
519
|
"aria-label": "关闭面板",
|
|
336
|
-
onClick: _cache[
|
|
337
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "close-icon", {}, () => [_cache[
|
|
520
|
+
onClick: _cache[7] || (_cache[7] = (...args) => $setup.handleClose && $setup.handleClose(...args))
|
|
521
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "close-icon", {}, () => [_cache[21] || (_cache[21] = (0, vue.createElementVNode)("svg", {
|
|
338
522
|
viewBox: "0 0 24 24",
|
|
339
523
|
width: "14",
|
|
340
524
|
height: "14",
|
|
@@ -420,8 +604,8 @@ var _hoisted_4$3 = {
|
|
|
420
604
|
};
|
|
421
605
|
var _hoisted_5$3 = ["aria-selected", "onClick"];
|
|
422
606
|
var _hoisted_6$3 = { class: "opencode-session-header" };
|
|
423
|
-
var _hoisted_7$
|
|
424
|
-
var _hoisted_8 = {
|
|
607
|
+
var _hoisted_7$2 = { class: "opencode-session-title" };
|
|
608
|
+
var _hoisted_8$1 = {
|
|
425
609
|
key: 0,
|
|
426
610
|
class: "opencode-thinking-loading"
|
|
427
611
|
};
|
|
@@ -453,7 +637,7 @@ function __vue_render__$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
453
637
|
role: "option",
|
|
454
638
|
"aria-selected": item.active,
|
|
455
639
|
onClick: ($event) => $setup.handleSelectSession(item)
|
|
456
|
-
}, [(0, vue.createElementVNode)("div", _hoisted_6$3, [(0, vue.createElementVNode)("div", _hoisted_7$
|
|
640
|
+
}, [(0, vue.createElementVNode)("div", _hoisted_6$3, [(0, vue.createElementVNode)("div", _hoisted_7$2, [$setup.isSessionThinking(item.id) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_8$1)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)(item.title), 1)]), (0, vue.createElementVNode)("button", {
|
|
457
641
|
class: "opencode-session-delete-btn",
|
|
458
642
|
type: "button",
|
|
459
643
|
"aria-label": `\u5220\u9664\u4F1A\u8BDD: ${item.title}`,
|
|
@@ -565,6 +749,11 @@ var __vue_sfc__$5 = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps$3(__s
|
|
|
565
749
|
type: Number,
|
|
566
750
|
required: false,
|
|
567
751
|
default: 800
|
|
752
|
+
},
|
|
753
|
+
position: {
|
|
754
|
+
type: String,
|
|
755
|
+
required: false,
|
|
756
|
+
default: "right"
|
|
568
757
|
}
|
|
569
758
|
},
|
|
570
759
|
emits: [
|
|
@@ -590,7 +779,9 @@ var __vue_sfc__$5 = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps$3(__s
|
|
|
590
779
|
};
|
|
591
780
|
const handleMouseMove = (e) => {
|
|
592
781
|
if (!isResizing.value) return;
|
|
593
|
-
|
|
782
|
+
let deltaX;
|
|
783
|
+
if (props.position === "right") deltaX = startX.value - e.clientX;
|
|
784
|
+
else deltaX = e.clientX - startX.value;
|
|
594
785
|
emit("resize", Math.max(props.minWidth, Math.min(props.maxWidth, startWidth.value + deltaX)));
|
|
595
786
|
};
|
|
596
787
|
const handleMouseUp = () => {
|
|
@@ -626,7 +817,10 @@ var __vue_sfc__$5 = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps$3(__s
|
|
|
626
817
|
}));
|
|
627
818
|
function __vue_render__$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
628
819
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
629
|
-
class: (0, vue.normalizeClass)(["opencode-resize-handle", {
|
|
820
|
+
class: (0, vue.normalizeClass)(["opencode-resize-handle", {
|
|
821
|
+
resizing: $setup.isResizing,
|
|
822
|
+
"handle-left": $props.position === "left"
|
|
823
|
+
}]),
|
|
630
824
|
onMousedown: $setup.handleMouseDown,
|
|
631
825
|
onDblclick: $setup.handleDoubleClick
|
|
632
826
|
}, null, 34);
|
|
@@ -740,6 +934,11 @@ var __vue_sfc__$4 = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps$2(__s
|
|
|
740
934
|
type: String,
|
|
741
935
|
required: false,
|
|
742
936
|
default: "light"
|
|
937
|
+
},
|
|
938
|
+
splitPosition: {
|
|
939
|
+
type: String,
|
|
940
|
+
required: false,
|
|
941
|
+
default: "right"
|
|
743
942
|
}
|
|
744
943
|
},
|
|
745
944
|
emits: [
|
|
@@ -796,7 +995,9 @@ var __vue_sfc__$4 = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps$2(__s
|
|
|
796
995
|
minimized: props.minimized,
|
|
797
996
|
dragging: props.dragging,
|
|
798
997
|
"no-transition": props.noTransition,
|
|
799
|
-
"split-mode": props.mode === "split"
|
|
998
|
+
"split-mode": props.mode === "split",
|
|
999
|
+
"split-left": props.mode === "split" && props.splitPosition === "left",
|
|
1000
|
+
"split-right": props.mode === "split" && props.splitPosition === "right"
|
|
800
1001
|
}]),
|
|
801
1002
|
Frame: Frame_vue_default,
|
|
802
1003
|
Header: Header_vue_default,
|
|
@@ -832,11 +1033,29 @@ var _hoisted_4$1 = {
|
|
|
832
1033
|
"stroke-width": "2"
|
|
833
1034
|
};
|
|
834
1035
|
var _hoisted_5$1 = {
|
|
1036
|
+
key: 2,
|
|
1037
|
+
viewBox: "0 0 24 24",
|
|
1038
|
+
width: "16",
|
|
1039
|
+
height: "16",
|
|
1040
|
+
fill: "none",
|
|
1041
|
+
stroke: "currentColor",
|
|
1042
|
+
"stroke-width": "2"
|
|
1043
|
+
};
|
|
1044
|
+
var _hoisted_6$1 = {
|
|
1045
|
+
key: 3,
|
|
1046
|
+
viewBox: "0 0 24 24",
|
|
1047
|
+
width: "16",
|
|
1048
|
+
height: "16",
|
|
1049
|
+
fill: "none",
|
|
1050
|
+
stroke: "currentColor",
|
|
1051
|
+
"stroke-width": "2"
|
|
1052
|
+
};
|
|
1053
|
+
var _hoisted_7$1 = {
|
|
835
1054
|
key: 2,
|
|
836
1055
|
class: "opencode-notification",
|
|
837
1056
|
role: "alert"
|
|
838
1057
|
};
|
|
839
|
-
var
|
|
1058
|
+
var _hoisted_8 = { class: "opencode-chat-content" };
|
|
840
1059
|
function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
841
1060
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
842
1061
|
class: (0, vue.normalizeClass)($setup.panelClasses),
|
|
@@ -847,13 +1066,15 @@ function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
847
1066
|
width: $props.panelWidth,
|
|
848
1067
|
"min-width": $props.minWidth,
|
|
849
1068
|
"max-width": $props.maxWidth,
|
|
1069
|
+
position: $props.splitPosition,
|
|
850
1070
|
onResize: $setup.handleResize,
|
|
851
1071
|
onResizeStart: $setup.handleResizeStart,
|
|
852
1072
|
onResizeEnd: $setup.handleResizeEnd
|
|
853
1073
|
}, null, 8, [
|
|
854
1074
|
"width",
|
|
855
1075
|
"min-width",
|
|
856
|
-
"max-width"
|
|
1076
|
+
"max-width",
|
|
1077
|
+
"position"
|
|
857
1078
|
])) : (0, vue.createCommentVNode)("v-if", true),
|
|
858
1079
|
$props.mode === "split" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
859
1080
|
key: 1,
|
|
@@ -861,20 +1082,34 @@ function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
861
1082
|
class: (0, vue.normalizeClass)(["opencode-split-toggle-btn", {
|
|
862
1083
|
open: $setup.props.open,
|
|
863
1084
|
thinking: $setup.props.thinking,
|
|
864
|
-
"opencode-theme-dark": $props.resolvedTheme === "dark"
|
|
1085
|
+
"opencode-theme-dark": $props.resolvedTheme === "dark",
|
|
1086
|
+
"split-left": $props.splitPosition === "left"
|
|
865
1087
|
}]),
|
|
866
1088
|
"aria-expanded": $props.open,
|
|
867
1089
|
"aria-label": "切换面板",
|
|
868
1090
|
onClick: $setup.handleToggle
|
|
869
|
-
}, [(0, vue.createElementVNode)("span", _hoisted_2$1, [
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
"
|
|
876
|
-
|
|
877
|
-
|
|
1091
|
+
}, [(0, vue.createElementVNode)("span", _hoisted_2$1, [
|
|
1092
|
+
$props.open && $props.splitPosition === "right" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_3$1, [..._cache[0] || (_cache[0] = [(0, vue.createElementVNode)("path", {
|
|
1093
|
+
d: "M9 18l6-6-6-6",
|
|
1094
|
+
"stroke-linecap": "round",
|
|
1095
|
+
"stroke-linejoin": "round"
|
|
1096
|
+
}, null, -1)])])) : (0, vue.createCommentVNode)("v-if", true),
|
|
1097
|
+
!$props.open && $props.splitPosition === "right" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_4$1, [..._cache[1] || (_cache[1] = [(0, vue.createElementVNode)("path", {
|
|
1098
|
+
d: "M15 18l-6-6 6-6",
|
|
1099
|
+
"stroke-linecap": "round",
|
|
1100
|
+
"stroke-linejoin": "round"
|
|
1101
|
+
}, null, -1)])])) : (0, vue.createCommentVNode)("v-if", true),
|
|
1102
|
+
$props.open && $props.splitPosition === "left" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_5$1, [..._cache[2] || (_cache[2] = [(0, vue.createElementVNode)("path", {
|
|
1103
|
+
d: "M15 18l-6-6 6-6",
|
|
1104
|
+
"stroke-linecap": "round",
|
|
1105
|
+
"stroke-linejoin": "round"
|
|
1106
|
+
}, null, -1)])])) : (0, vue.createCommentVNode)("v-if", true),
|
|
1107
|
+
!$props.open && $props.splitPosition === "left" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_6$1, [..._cache[3] || (_cache[3] = [(0, vue.createElementVNode)("path", {
|
|
1108
|
+
d: "M9 18l6-6-6-6",
|
|
1109
|
+
"stroke-linecap": "round",
|
|
1110
|
+
"stroke-linejoin": "round"
|
|
1111
|
+
}, null, -1)])])) : (0, vue.createCommentVNode)("v-if", true)
|
|
1112
|
+
])], 10, _hoisted_1$3)) : (0, vue.createCommentVNode)("v-if", true),
|
|
878
1113
|
(0, vue.createVNode)($setup["Header"], null, (0, vue.createSlots)({ _: 2 }, [
|
|
879
1114
|
$setup.slots["session-toggle-icon"] ? {
|
|
880
1115
|
name: "session-toggle-icon",
|
|
@@ -892,10 +1127,10 @@ function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
892
1127
|
key: "2"
|
|
893
1128
|
} : void 0
|
|
894
1129
|
]), 1024),
|
|
895
|
-
$props.notificationVisible && $props.notificationMode === "widget" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
896
|
-
(0, vue.createElementVNode)("div",
|
|
1130
|
+
$props.notificationVisible && $props.notificationMode === "widget" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_7$1, (0, vue.toDisplayString)($props.notificationMessage), 1)) : (0, vue.createCommentVNode)("v-if", true),
|
|
1131
|
+
(0, vue.createElementVNode)("div", _hoisted_8, [
|
|
897
1132
|
(0, vue.createVNode)($setup["SessionList"], null, {
|
|
898
|
-
empty: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "sessions-empty", {}, () => [_cache[
|
|
1133
|
+
empty: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "sessions-empty", {}, () => [_cache[4] || (_cache[4] = (0, vue.createElementVNode)("div", { class: "opencode-session-empty" }, "暂无会话", -1))])]),
|
|
899
1134
|
_: 3
|
|
900
1135
|
}),
|
|
901
1136
|
(0, vue.createVNode)($setup["Frame"], { ref: "frameRef" }, (0, vue.createSlots)({ _: 2 }, [
|
|
@@ -1987,7 +2222,7 @@ function usePersistState(options) {
|
|
|
1987
2222
|
return saved;
|
|
1988
2223
|
};
|
|
1989
2224
|
const getCurrentState = () => {
|
|
1990
|
-
var _a;
|
|
2225
|
+
var _a, _b, _c;
|
|
1991
2226
|
return {
|
|
1992
2227
|
open: options.open.value,
|
|
1993
2228
|
minimized: options.minimized.value,
|
|
@@ -1995,7 +2230,9 @@ function usePersistState(options) {
|
|
|
1995
2230
|
bubbleOffset: options.bubbleOffset.value,
|
|
1996
2231
|
theme: options.theme.value,
|
|
1997
2232
|
sessionListCollapsed: options.sessionListCollapsed.value,
|
|
1998
|
-
splitPanelWidth: (_a = options.splitPanelWidth) == null ? void 0 : _a.value
|
|
2233
|
+
splitPanelWidth: (_a = options.splitPanelWidth) == null ? void 0 : _a.value,
|
|
2234
|
+
displayMode: (_b = options.displayMode) == null ? void 0 : _b.value,
|
|
2235
|
+
splitPosition: (_c = options.splitPosition) == null ? void 0 : _c.value
|
|
1999
2236
|
};
|
|
2000
2237
|
};
|
|
2001
2238
|
const persistState = () => {
|
|
@@ -2010,6 +2247,8 @@ function usePersistState(options) {
|
|
|
2010
2247
|
options.sessionListCollapsed
|
|
2011
2248
|
];
|
|
2012
2249
|
if (options.splitPanelWidth) watchers.push(options.splitPanelWidth);
|
|
2250
|
+
if (options.displayMode) watchers.push(options.displayMode);
|
|
2251
|
+
if (options.splitPosition) watchers.push(options.splitPosition);
|
|
2013
2252
|
(0, vue.onMounted)(() => {
|
|
2014
2253
|
restoreState();
|
|
2015
2254
|
(0, vue.watch)(watchers, () => {
|
|
@@ -2025,17 +2264,20 @@ function usePersistState(options) {
|
|
|
2025
2264
|
//#region es/open-code-widget/composables/use-split.js
|
|
2026
2265
|
var AUTO_MODE_THRESHOLD = 1440;
|
|
2027
2266
|
function useSplitMode(options) {
|
|
2267
|
+
var _a, _b;
|
|
2028
2268
|
const windowWidth = (0, vue.ref)(typeof window !== "undefined" ? window.innerWidth : 0);
|
|
2269
|
+
const localSplitPosition = (0, vue.ref)((_b = (_a = options.splitPosition) == null ? void 0 : _a.value) != null ? _b : "right");
|
|
2029
2270
|
const splitConfig = (0, vue.computed)(() => {
|
|
2030
|
-
var
|
|
2271
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
2031
2272
|
const config = options.splitMode.value || {};
|
|
2032
2273
|
return {
|
|
2033
|
-
width: (
|
|
2034
|
-
minWidth: (
|
|
2274
|
+
width: (_a2 = config.width) != null ? _a2 : 500,
|
|
2275
|
+
minWidth: (_b2 = config.minWidth) != null ? _b2 : 400,
|
|
2035
2276
|
maxWidth: (_c = config.maxWidth) != null ? _c : 800,
|
|
2036
2277
|
resizable: (_d = config.resizable) != null ? _d : true,
|
|
2037
2278
|
shrinkPage: (_e = config.shrinkPage) != null ? _e : true,
|
|
2038
|
-
defaultOpen: (_f = config.defaultOpen) != null ? _f : true
|
|
2279
|
+
defaultOpen: (_f = config.defaultOpen) != null ? _f : true,
|
|
2280
|
+
position: (_g = config.position) != null ? _g : localSplitPosition.value
|
|
2039
2281
|
};
|
|
2040
2282
|
});
|
|
2041
2283
|
const panelWidth = (0, vue.ref)(splitConfig.value.width);
|
|
@@ -2045,15 +2287,22 @@ function useSplitMode(options) {
|
|
|
2045
2287
|
return windowWidth.value >= AUTO_MODE_THRESHOLD ? "split" : "bubble";
|
|
2046
2288
|
});
|
|
2047
2289
|
const isSplitMode = (0, vue.computed)(() => effectiveMode.value === "split");
|
|
2290
|
+
const splitPosition = (0, vue.computed)(() => splitConfig.value.position);
|
|
2048
2291
|
const handleResize = (width) => {
|
|
2049
|
-
var
|
|
2292
|
+
var _a2;
|
|
2050
2293
|
panelWidth.value = width;
|
|
2051
|
-
(
|
|
2294
|
+
(_a2 = options.onWidthChange) == null || _a2.call(options, width);
|
|
2052
2295
|
};
|
|
2053
2296
|
const handleToggle = () => {
|
|
2054
|
-
var
|
|
2297
|
+
var _a2;
|
|
2055
2298
|
const nextOpen = !options.open.value;
|
|
2056
|
-
(
|
|
2299
|
+
(_a2 = options.onOpenChange) == null || _a2.call(options, nextOpen);
|
|
2300
|
+
};
|
|
2301
|
+
const handleTogglePosition = () => {
|
|
2302
|
+
var _a2;
|
|
2303
|
+
const nextPosition = localSplitPosition.value === "right" ? "left" : "right";
|
|
2304
|
+
localSplitPosition.value = nextPosition;
|
|
2305
|
+
(_a2 = options.onPositionChange) == null || _a2.call(options, nextPosition);
|
|
2057
2306
|
};
|
|
2058
2307
|
const handleWindowResize = () => {
|
|
2059
2308
|
if (typeof window !== "undefined") windowWidth.value = window.innerWidth;
|
|
@@ -2063,31 +2312,49 @@ function useSplitMode(options) {
|
|
|
2063
2312
|
if (isSplitMode.value && options.open.value && splitConfig.value.shrinkPage) {
|
|
2064
2313
|
document.body.classList.add("has-opencode-split");
|
|
2065
2314
|
document.body.style.setProperty("--opencode-split-width", `${panelWidth.value}px`);
|
|
2315
|
+
if (splitPosition.value === "left") {
|
|
2316
|
+
document.body.classList.add("has-opencode-split-left");
|
|
2317
|
+
document.body.classList.remove("has-opencode-split-right");
|
|
2318
|
+
} else {
|
|
2319
|
+
document.body.classList.add("has-opencode-split-right");
|
|
2320
|
+
document.body.classList.remove("has-opencode-split-left");
|
|
2321
|
+
}
|
|
2066
2322
|
} else {
|
|
2067
2323
|
document.body.classList.remove("has-opencode-split");
|
|
2324
|
+
document.body.classList.remove("has-opencode-split-left");
|
|
2325
|
+
document.body.classList.remove("has-opencode-split-right");
|
|
2068
2326
|
document.body.style.removeProperty("--opencode-split-width");
|
|
2069
2327
|
}
|
|
2070
2328
|
};
|
|
2071
2329
|
(0, vue.watch)([
|
|
2072
2330
|
isSplitMode,
|
|
2073
2331
|
options.open,
|
|
2074
|
-
panelWidth
|
|
2332
|
+
panelWidth,
|
|
2333
|
+
splitPosition
|
|
2075
2334
|
], updateBodyClass, { immediate: true });
|
|
2076
2335
|
(0, vue.watch)(splitConfig, (config) => {
|
|
2077
2336
|
if (panelWidth.value < config.minWidth) panelWidth.value = config.minWidth;
|
|
2078
2337
|
if (panelWidth.value > config.maxWidth) panelWidth.value = config.maxWidth;
|
|
2079
2338
|
});
|
|
2339
|
+
(0, vue.watch)(() => {
|
|
2340
|
+
var _a2;
|
|
2341
|
+
return (_a2 = options.splitPosition) == null ? void 0 : _a2.value;
|
|
2342
|
+
}, (val) => {
|
|
2343
|
+
if (val && val !== localSplitPosition.value) localSplitPosition.value = val;
|
|
2344
|
+
});
|
|
2080
2345
|
(0, vue.onMounted)(() => {
|
|
2081
|
-
var
|
|
2346
|
+
var _a2;
|
|
2082
2347
|
if (typeof window !== "undefined") {
|
|
2083
2348
|
window.addEventListener("resize", handleWindowResize);
|
|
2084
|
-
if (isSplitMode.value && splitConfig.value.defaultOpen && !options.open.value) (
|
|
2349
|
+
if (isSplitMode.value && splitConfig.value.defaultOpen && !options.open.value) (_a2 = options.onOpenChange) == null || _a2.call(options, true);
|
|
2085
2350
|
}
|
|
2086
2351
|
});
|
|
2087
2352
|
(0, vue.onUnmounted)(() => {
|
|
2088
2353
|
if (typeof window !== "undefined") {
|
|
2089
2354
|
window.removeEventListener("resize", handleWindowResize);
|
|
2090
2355
|
document.body.classList.remove("has-opencode-split");
|
|
2356
|
+
document.body.classList.remove("has-opencode-split-left");
|
|
2357
|
+
document.body.classList.remove("has-opencode-split-right");
|
|
2091
2358
|
document.body.style.removeProperty("--opencode-split-width");
|
|
2092
2359
|
}
|
|
2093
2360
|
});
|
|
@@ -2096,8 +2363,10 @@ function useSplitMode(options) {
|
|
|
2096
2363
|
isSplitMode,
|
|
2097
2364
|
panelWidth,
|
|
2098
2365
|
splitConfig,
|
|
2366
|
+
splitPosition,
|
|
2099
2367
|
handleResize,
|
|
2100
|
-
handleToggle
|
|
2368
|
+
handleToggle,
|
|
2369
|
+
handleTogglePosition
|
|
2101
2370
|
};
|
|
2102
2371
|
}
|
|
2103
2372
|
//#endregion
|
|
@@ -2280,6 +2549,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2280
2549
|
"split-panel-width-change"
|
|
2281
2550
|
],
|
|
2282
2551
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2552
|
+
var _a, _b;
|
|
2283
2553
|
(0, vue.useCssVars)((_ctx) => ({
|
|
2284
2554
|
"-chatAnimationOrigin.x": chatAnimationOrigin.value.x,
|
|
2285
2555
|
"-chatAnimationOrigin.y": chatAnimationOrigin.value.y
|
|
@@ -2322,10 +2592,12 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2322
2592
|
const frameRef = (0, vue.ref)(null);
|
|
2323
2593
|
const triggerRef = (0, vue.ref)(null);
|
|
2324
2594
|
const sendMessageToIframe = (type, data) => {
|
|
2325
|
-
var
|
|
2326
|
-
(
|
|
2595
|
+
var _a2;
|
|
2596
|
+
(_a2 = frameRef.value) == null || _a2.sendMessageToIframe(type, data);
|
|
2327
2597
|
};
|
|
2328
2598
|
const localSessionListCollapsed = (0, vue.ref)(props.sessionListCollapsed);
|
|
2599
|
+
const localDisplayMode = (0, vue.ref)(props.displayMode);
|
|
2600
|
+
const localSplitPosition = (0, vue.ref)((_b = (_a = props.splitMode) == null ? void 0 : _a.position) != null ? _b : "right");
|
|
2329
2601
|
const minimized = (0, vue.ref)(false);
|
|
2330
2602
|
const promptDockVisible = (0, vue.ref)(true);
|
|
2331
2603
|
const isRestoring = (0, vue.ref)(true);
|
|
@@ -2347,6 +2619,17 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2347
2619
|
(0, vue.watch)(() => props.splitPanelWidth, (val) => {
|
|
2348
2620
|
splitPanelWidth.value = val;
|
|
2349
2621
|
});
|
|
2622
|
+
(0, vue.watch)(() => props.displayMode, (val) => {
|
|
2623
|
+
localDisplayMode.value = val;
|
|
2624
|
+
});
|
|
2625
|
+
const handleToggleDisplayMode = () => {
|
|
2626
|
+
const modes = [
|
|
2627
|
+
"bubble",
|
|
2628
|
+
"split",
|
|
2629
|
+
"auto"
|
|
2630
|
+
];
|
|
2631
|
+
localDisplayMode.value = modes[(modes.indexOf(localDisplayMode.value) + 1) % modes.length];
|
|
2632
|
+
};
|
|
2350
2633
|
const { buttonActive, containerClasses, iframeSource, sessionListTitle, resolvedTheme, handleClose, handleEmptyAction, handleToggle, handleToggleSessionList, handleToggleTheme } = useWidget({
|
|
2351
2634
|
theme: (0, vue.toRef)(props, "theme"),
|
|
2352
2635
|
open: (0, vue.toRef)(props, "open"),
|
|
@@ -2419,10 +2702,11 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2419
2702
|
}
|
|
2420
2703
|
});
|
|
2421
2704
|
const bubbleOffset = (0, vue.ref)(void 0);
|
|
2422
|
-
const { effectiveMode, isSplitMode, panelWidth, splitConfig, handleResize, handleToggle: handleSplitToggle } = useSplitMode({
|
|
2423
|
-
displayMode:
|
|
2705
|
+
const { effectiveMode, isSplitMode, panelWidth, splitConfig, splitPosition, handleResize, handleToggle: handleSplitToggle, handleTogglePosition } = useSplitMode({
|
|
2706
|
+
displayMode: localDisplayMode,
|
|
2424
2707
|
splitMode: (0, vue.toRef)(props, "splitMode"),
|
|
2425
2708
|
open: (0, vue.toRef)(props, "open"),
|
|
2709
|
+
splitPosition: localSplitPosition,
|
|
2426
2710
|
onOpenChange: (nextOpen) => {
|
|
2427
2711
|
emit("update:open", nextOpen);
|
|
2428
2712
|
emit("toggle", nextOpen);
|
|
@@ -2431,6 +2715,9 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2431
2715
|
splitPanelWidth.value = width;
|
|
2432
2716
|
emit("update:splitPanelWidth", width);
|
|
2433
2717
|
emit("split-panel-width-change", width);
|
|
2718
|
+
},
|
|
2719
|
+
onPositionChange: (position) => {
|
|
2720
|
+
localSplitPosition.value = position;
|
|
2434
2721
|
}
|
|
2435
2722
|
});
|
|
2436
2723
|
usePersistState({
|
|
@@ -2441,6 +2728,8 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2441
2728
|
theme: (0, vue.toRef)(props, "theme"),
|
|
2442
2729
|
sessionListCollapsed: localSessionListCollapsed,
|
|
2443
2730
|
splitPanelWidth,
|
|
2731
|
+
displayMode: localDisplayMode,
|
|
2732
|
+
splitPosition: localSplitPosition,
|
|
2444
2733
|
onRestore: (state) => {
|
|
2445
2734
|
if (state.open !== void 0 && state.open !== props.open) {
|
|
2446
2735
|
emit("update:open", state.open);
|
|
@@ -2468,6 +2757,8 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2468
2757
|
if (state.promptDockVisible !== void 0) promptDockVisible.value = state.promptDockVisible;
|
|
2469
2758
|
else if (minimized.value) promptDockVisible.value = false;
|
|
2470
2759
|
if (state.splitPanelWidth !== void 0 && state.splitPanelWidth !== props.splitPanelWidth) handleResize(state.splitPanelWidth);
|
|
2760
|
+
if (state.displayMode !== void 0 && state.displayMode !== props.displayMode) localDisplayMode.value = state.displayMode;
|
|
2761
|
+
if (state.splitPosition !== void 0) localSplitPosition.value = state.splitPosition;
|
|
2471
2762
|
(0, vue.nextTick)(() => {
|
|
2472
2763
|
syncStateToIframe();
|
|
2473
2764
|
setTimeout(() => {
|
|
@@ -2501,12 +2792,12 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2501
2792
|
if (typeof window !== "undefined") window.removeEventListener("resize", handleWindowResize);
|
|
2502
2793
|
});
|
|
2503
2794
|
const bubbleQuadrant = (0, vue.computed)(() => {
|
|
2504
|
-
var
|
|
2795
|
+
var _a2, _b2, _c, _d;
|
|
2505
2796
|
if (typeof window === "undefined") return "bottom-right";
|
|
2506
2797
|
const centerX = windowWidth.value / 2;
|
|
2507
2798
|
const centerY = windowHeight.value / 2;
|
|
2508
2799
|
const bubbleSize = 44;
|
|
2509
|
-
const currentOffset = (
|
|
2800
|
+
const currentOffset = (_b2 = (_a2 = triggerRef.value) == null ? void 0 : _a2.offset) != null ? _b2 : bubbleOffset.value;
|
|
2510
2801
|
const effectiveX = ((_c = currentOffset == null ? void 0 : currentOffset.x) != null ? _c : windowWidth.value - bubbleSize - 24) + bubbleSize / 2;
|
|
2511
2802
|
const effectiveY = ((_d = currentOffset == null ? void 0 : currentOffset.y) != null ? _d : windowHeight.value - bubbleSize - 24) + bubbleSize / 2;
|
|
2512
2803
|
if (effectiveX >= centerX && effectiveY >= centerY) return "bottom-right";
|
|
@@ -2519,14 +2810,14 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2519
2810
|
return quadrant === "top-right" || quadrant === "bottom-right";
|
|
2520
2811
|
});
|
|
2521
2812
|
const chatPositionStyle = (0, vue.computed)(() => {
|
|
2522
|
-
var
|
|
2813
|
+
var _a2, _b2, _c;
|
|
2523
2814
|
if (typeof window === "undefined") return {};
|
|
2524
2815
|
const chatWidth = minimized.value ? 300 : 700;
|
|
2525
2816
|
const chatHeight = minimized.value ? 300 : Math.min(windowHeight.value * .86, windowHeight.value - 40);
|
|
2526
2817
|
const gap = 24;
|
|
2527
2818
|
const bubbleSize = 44;
|
|
2528
2819
|
const screenMargin = 20;
|
|
2529
|
-
const effectiveOffset = (_c = (
|
|
2820
|
+
const effectiveOffset = (_c = (_b2 = (_a2 = triggerRef.value) == null ? void 0 : _a2.offset) != null ? _b2 : bubbleOffset.value) != null ? _c : {
|
|
2530
2821
|
x: windowWidth.value - bubbleSize - gap,
|
|
2531
2822
|
y: windowHeight.value - bubbleSize - gap
|
|
2532
2823
|
};
|
|
@@ -2619,9 +2910,11 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2619
2910
|
promptDockVisible,
|
|
2620
2911
|
bubbleOffset,
|
|
2621
2912
|
mode: effectiveMode,
|
|
2913
|
+
displayMode: localDisplayMode,
|
|
2914
|
+
splitPosition,
|
|
2622
2915
|
sessionStates: (0, vue.computed)(() => {
|
|
2623
|
-
var
|
|
2624
|
-
return (
|
|
2916
|
+
var _a2;
|
|
2917
|
+
return (_a2 = props.sessionStates) != null ? _a2 : {};
|
|
2625
2918
|
}),
|
|
2626
2919
|
iframeSource,
|
|
2627
2920
|
buttonActive,
|
|
@@ -2636,6 +2929,8 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2636
2929
|
handleTogglePromptDock,
|
|
2637
2930
|
handleToggleSessionList,
|
|
2638
2931
|
handleToggleTheme,
|
|
2932
|
+
handleToggleDisplayMode,
|
|
2933
|
+
handleToggleSplitPosition: handleTogglePosition,
|
|
2639
2934
|
handleEmptyAction,
|
|
2640
2935
|
handleCreateSession,
|
|
2641
2936
|
handleSelectSession,
|
|
@@ -2682,6 +2977,8 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2682
2977
|
triggerRef,
|
|
2683
2978
|
sendMessageToIframe,
|
|
2684
2979
|
localSessionListCollapsed,
|
|
2980
|
+
localDisplayMode,
|
|
2981
|
+
localSplitPosition,
|
|
2685
2982
|
minimized,
|
|
2686
2983
|
promptDockVisible,
|
|
2687
2984
|
isRestoring,
|
|
@@ -2689,6 +2986,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2689
2986
|
splitPanelWidth,
|
|
2690
2987
|
syncStateToIframe,
|
|
2691
2988
|
handleFrameLoaded,
|
|
2989
|
+
handleToggleDisplayMode,
|
|
2692
2990
|
buttonActive,
|
|
2693
2991
|
containerClasses,
|
|
2694
2992
|
iframeSource,
|
|
@@ -2720,8 +3018,10 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2720
3018
|
isSplitMode,
|
|
2721
3019
|
panelWidth,
|
|
2722
3020
|
splitConfig,
|
|
3021
|
+
splitPosition,
|
|
2723
3022
|
handleResize,
|
|
2724
3023
|
handleSplitToggle,
|
|
3024
|
+
handleTogglePosition,
|
|
2725
3025
|
handleToggleMinimize,
|
|
2726
3026
|
handleTogglePromptDock,
|
|
2727
3027
|
windowWidth,
|
|
@@ -2802,6 +3102,7 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2802
3102
|
"notification-mode": $setup.notificationMode,
|
|
2803
3103
|
thinking: $props.thinking,
|
|
2804
3104
|
"resolved-theme": $setup.resolvedTheme,
|
|
3105
|
+
"split-position": $setup.splitPosition,
|
|
2805
3106
|
onResize: $setup.handleResize,
|
|
2806
3107
|
onResizeStart: $setup.handleResizeStart,
|
|
2807
3108
|
onResizeEnd: $setup.handleResizeEnd,
|
|
@@ -2862,6 +3163,7 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2862
3163
|
"notification-mode",
|
|
2863
3164
|
"thinking",
|
|
2864
3165
|
"resolved-theme",
|
|
3166
|
+
"split-position",
|
|
2865
3167
|
"onResize",
|
|
2866
3168
|
"onToggle"
|
|
2867
3169
|
]),
|
|
@@ -2890,7 +3192,7 @@ __vue_sfc__.render = __vue_render__;
|
|
|
2890
3192
|
var open_code_widget_default = __vue_sfc__;
|
|
2891
3193
|
//#endregion
|
|
2892
3194
|
//#region es/index.js
|
|
2893
|
-
var version = "1.0.
|
|
3195
|
+
var version = "1.0.50";
|
|
2894
3196
|
function install(app, options) {
|
|
2895
3197
|
[open_code_widget_default].forEach((item) => {
|
|
2896
3198
|
if (item.install) app.use(item, options);
|