@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
|
@@ -110,7 +110,7 @@ var __vue_sfc__$8 = /* @__PURE__ */ defineComponent({
|
|
|
110
110
|
__name: "Header",
|
|
111
111
|
setup(__props, { expose: __expose }) {
|
|
112
112
|
__expose();
|
|
113
|
-
const { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, minimized, promptDockVisible, mode, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleClose, handleToggleMinimize, handleTogglePromptDock } = useOpenCodeWidgetContext();
|
|
113
|
+
const { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, minimized, promptDockVisible, mode, displayMode, splitPosition, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleToggleDisplayMode, handleToggleSplitPosition, handleClose, handleToggleMinimize, handleTogglePromptDock } = useOpenCodeWidgetContext();
|
|
114
114
|
const __returned__ = {
|
|
115
115
|
title,
|
|
116
116
|
sessionListTitle,
|
|
@@ -122,9 +122,13 @@ var __vue_sfc__$8 = /* @__PURE__ */ defineComponent({
|
|
|
122
122
|
minimized,
|
|
123
123
|
promptDockVisible,
|
|
124
124
|
mode,
|
|
125
|
+
displayMode,
|
|
126
|
+
splitPosition,
|
|
125
127
|
handleToggleSessionList,
|
|
126
128
|
handleToggleSelectMode,
|
|
127
129
|
handleToggleTheme,
|
|
130
|
+
handleToggleDisplayMode,
|
|
131
|
+
handleToggleSplitPosition,
|
|
128
132
|
handleClose,
|
|
129
133
|
handleToggleMinimize,
|
|
130
134
|
handleTogglePromptDock,
|
|
@@ -142,6 +146,35 @@ var __vue_sfc__$8 = /* @__PURE__ */ defineComponent({
|
|
|
142
146
|
light: "亮色主题",
|
|
143
147
|
dark: "暗色主题"
|
|
144
148
|
}[theme.value]}`;
|
|
149
|
+
}),
|
|
150
|
+
displayModeIconTitle: computed(() => {
|
|
151
|
+
return `\u5C55\u793A\u6A21\u5F0F: ${{
|
|
152
|
+
bubble: "气泡模式",
|
|
153
|
+
split: "分屏模式",
|
|
154
|
+
auto: "自动模式"
|
|
155
|
+
}[displayMode.value]}`;
|
|
156
|
+
}),
|
|
157
|
+
displayModeIconLabel: computed(() => {
|
|
158
|
+
const displayModeLabels = {
|
|
159
|
+
bubble: "气泡模式",
|
|
160
|
+
split: "分屏模式",
|
|
161
|
+
auto: "自动模式"
|
|
162
|
+
};
|
|
163
|
+
const modes = [
|
|
164
|
+
"bubble",
|
|
165
|
+
"split",
|
|
166
|
+
"auto"
|
|
167
|
+
];
|
|
168
|
+
return `\u5207\u6362\u5C55\u793A\u6A21\u5F0F - \u4E0B\u4E00\u4E2A: ${displayModeLabels[modes[(modes.indexOf(displayMode.value) + 1) % modes.length]]}`;
|
|
169
|
+
}),
|
|
170
|
+
splitPositionIconTitle: computed(() => {
|
|
171
|
+
return `\u5206\u680F\u4F4D\u7F6E: ${{
|
|
172
|
+
left: "左侧",
|
|
173
|
+
right: "右侧"
|
|
174
|
+
}[splitPosition.value]}`;
|
|
175
|
+
}),
|
|
176
|
+
splitPositionIconLabel: computed(() => {
|
|
177
|
+
return `\u5207\u6362\u5206\u680F\u4F4D\u7F6E - \u4E0B\u4E00\u4E2A: ${splitPosition.value === "right" ? "左侧" : "右侧"}`;
|
|
145
178
|
})
|
|
146
179
|
};
|
|
147
180
|
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
@@ -170,7 +203,7 @@ var _hoisted_6$4 = {
|
|
|
170
203
|
"stroke-width": "2",
|
|
171
204
|
"aria-hidden": "true"
|
|
172
205
|
};
|
|
173
|
-
var _hoisted_7$
|
|
206
|
+
var _hoisted_7$3 = {
|
|
174
207
|
key: 1,
|
|
175
208
|
viewBox: "0 0 24 24",
|
|
176
209
|
width: "16",
|
|
@@ -180,7 +213,38 @@ var _hoisted_7$2 = {
|
|
|
180
213
|
"stroke-width": "2",
|
|
181
214
|
"aria-hidden": "true"
|
|
182
215
|
};
|
|
183
|
-
var _hoisted_8$
|
|
216
|
+
var _hoisted_8$2 = {
|
|
217
|
+
key: 2,
|
|
218
|
+
viewBox: "0 0 24 24",
|
|
219
|
+
width: "16",
|
|
220
|
+
height: "16",
|
|
221
|
+
fill: "none",
|
|
222
|
+
stroke: "currentColor",
|
|
223
|
+
"stroke-width": "2",
|
|
224
|
+
"aria-hidden": "true"
|
|
225
|
+
};
|
|
226
|
+
var _hoisted_9$1 = ["title", "aria-label"];
|
|
227
|
+
var _hoisted_10$1 = {
|
|
228
|
+
key: 0,
|
|
229
|
+
viewBox: "0 0 24 24",
|
|
230
|
+
width: "16",
|
|
231
|
+
height: "16",
|
|
232
|
+
fill: "none",
|
|
233
|
+
stroke: "currentColor",
|
|
234
|
+
"stroke-width": "2",
|
|
235
|
+
"aria-hidden": "true"
|
|
236
|
+
};
|
|
237
|
+
var _hoisted_11 = {
|
|
238
|
+
key: 1,
|
|
239
|
+
viewBox: "0 0 24 24",
|
|
240
|
+
width: "16",
|
|
241
|
+
height: "16",
|
|
242
|
+
fill: "none",
|
|
243
|
+
stroke: "currentColor",
|
|
244
|
+
"stroke-width": "2",
|
|
245
|
+
"aria-hidden": "true"
|
|
246
|
+
};
|
|
247
|
+
var _hoisted_12 = {
|
|
184
248
|
key: 2,
|
|
185
249
|
viewBox: "0 0 24 24",
|
|
186
250
|
width: "16",
|
|
@@ -190,19 +254,40 @@ var _hoisted_8$1 = {
|
|
|
190
254
|
"stroke-width": "2",
|
|
191
255
|
"aria-hidden": "true"
|
|
192
256
|
};
|
|
193
|
-
var
|
|
194
|
-
var
|
|
195
|
-
var
|
|
257
|
+
var _hoisted_13 = { class: "opencode-chat-header-title" };
|
|
258
|
+
var _hoisted_14 = { class: "opencode-chat-header-actions" };
|
|
259
|
+
var _hoisted_15 = ["title", "aria-label"];
|
|
260
|
+
var _hoisted_16 = {
|
|
261
|
+
key: 0,
|
|
262
|
+
viewBox: "0 0 24 24",
|
|
263
|
+
width: "16",
|
|
264
|
+
height: "16",
|
|
265
|
+
fill: "none",
|
|
266
|
+
stroke: "currentColor",
|
|
267
|
+
"stroke-width": "2",
|
|
268
|
+
"aria-hidden": "true"
|
|
269
|
+
};
|
|
270
|
+
var _hoisted_17 = {
|
|
271
|
+
key: 1,
|
|
272
|
+
viewBox: "0 0 24 24",
|
|
273
|
+
width: "16",
|
|
274
|
+
height: "16",
|
|
275
|
+
fill: "none",
|
|
276
|
+
stroke: "currentColor",
|
|
277
|
+
"stroke-width": "2",
|
|
278
|
+
"aria-hidden": "true"
|
|
279
|
+
};
|
|
280
|
+
var _hoisted_18 = [
|
|
196
281
|
"title",
|
|
197
282
|
"aria-label",
|
|
198
283
|
"aria-pressed"
|
|
199
284
|
];
|
|
200
|
-
var
|
|
285
|
+
var _hoisted_19 = [
|
|
201
286
|
"title",
|
|
202
287
|
"aria-label",
|
|
203
288
|
"aria-pressed"
|
|
204
289
|
];
|
|
205
|
-
var
|
|
290
|
+
var _hoisted_20 = {
|
|
206
291
|
key: 0,
|
|
207
292
|
viewBox: "0 0 24 24",
|
|
208
293
|
width: "14",
|
|
@@ -212,7 +297,7 @@ var _hoisted_13 = {
|
|
|
212
297
|
"stroke-width": "2",
|
|
213
298
|
"aria-hidden": "true"
|
|
214
299
|
};
|
|
215
|
-
var
|
|
300
|
+
var _hoisted_21 = {
|
|
216
301
|
key: 1,
|
|
217
302
|
viewBox: "0 0 24 24",
|
|
218
303
|
width: "14",
|
|
@@ -232,7 +317,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
232
317
|
"aria-label": $setup.sessionListTitle,
|
|
233
318
|
"aria-expanded": !$setup.sessionListCollapsed,
|
|
234
319
|
onClick: _cache[0] || (_cache[0] = (...args) => $setup.handleToggleSessionList && $setup.handleToggleSessionList(...args))
|
|
235
|
-
}, [renderSlot(_ctx.$slots, "session-toggle-icon", {}, () => [_cache[
|
|
320
|
+
}, [renderSlot(_ctx.$slots, "session-toggle-icon", {}, () => [_cache[8] || (_cache[8] = createElementVNode("svg", {
|
|
236
321
|
viewBox: "0 0 24 24",
|
|
237
322
|
width: "16",
|
|
238
323
|
height: "16",
|
|
@@ -252,7 +337,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
252
337
|
"aria-pressed": $setup.selectMode,
|
|
253
338
|
disabled: !$setup.selectEnabled,
|
|
254
339
|
onClick: _cache[1] || (_cache[1] = (...args) => $setup.handleToggleSelectMode && $setup.handleToggleSelectMode(...args))
|
|
255
|
-
}, [renderSlot(_ctx.$slots, "select-icon", {}, () => [_cache[
|
|
340
|
+
}, [renderSlot(_ctx.$slots, "select-icon", {}, () => [_cache[9] || (_cache[9] = createElementVNode("svg", {
|
|
256
341
|
viewBox: "0 0 1024 1024",
|
|
257
342
|
width: "16",
|
|
258
343
|
height: "16",
|
|
@@ -270,19 +355,118 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
270
355
|
title: $setup.themeIconTitle,
|
|
271
356
|
"aria-label": $setup.themeIconLabel,
|
|
272
357
|
onClick: _cache[2] || (_cache[2] = (...args) => $setup.handleToggleTheme && $setup.handleToggleTheme(...args))
|
|
273
|
-
}, [renderSlot(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? (openBlock(), createElementBlock("svg", _hoisted_6$4, [..._cache[
|
|
358
|
+
}, [renderSlot(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? (openBlock(), createElementBlock("svg", _hoisted_6$4, [..._cache[10] || (_cache[10] = [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" ? (openBlock(), createElementBlock("svg", _hoisted_7$3, [..._cache[11] || (_cache[11] = [createElementVNode("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_8$2, [..._cache[12] || (_cache[12] = [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),
|
|
359
|
+
createElementVNode("button", {
|
|
360
|
+
class: "opencode-header-btn display-mode-btn",
|
|
361
|
+
type: "button",
|
|
362
|
+
title: $setup.displayModeIconTitle,
|
|
363
|
+
"aria-label": $setup.displayModeIconLabel,
|
|
364
|
+
onClick: _cache[3] || (_cache[3] = (...args) => $setup.handleToggleDisplayMode && $setup.handleToggleDisplayMode(...args))
|
|
365
|
+
}, [renderSlot(_ctx.$slots, "display-mode-icon", {}, () => [$setup.displayMode === "bubble" ? (openBlock(), createElementBlock("svg", _hoisted_10$1, [..._cache[13] || (_cache[13] = [
|
|
366
|
+
createElementVNode("circle", {
|
|
367
|
+
cx: "12",
|
|
368
|
+
cy: "12",
|
|
369
|
+
r: "10"
|
|
370
|
+
}, null, -1),
|
|
371
|
+
createElementVNode("path", {
|
|
372
|
+
d: "M8 14s1.5 2 4 2 4-2 4-2",
|
|
373
|
+
"stroke-linecap": "round"
|
|
374
|
+
}, null, -1),
|
|
375
|
+
createElementVNode("line", {
|
|
376
|
+
x1: "9",
|
|
377
|
+
y1: "9",
|
|
378
|
+
x2: "9.01",
|
|
379
|
+
y2: "9",
|
|
380
|
+
"stroke-linecap": "round"
|
|
381
|
+
}, null, -1),
|
|
382
|
+
createElementVNode("line", {
|
|
383
|
+
x1: "15",
|
|
384
|
+
y1: "9",
|
|
385
|
+
x2: "15.01",
|
|
386
|
+
y2: "9",
|
|
387
|
+
"stroke-linecap": "round"
|
|
388
|
+
}, null, -1)
|
|
389
|
+
])])) : $setup.displayMode === "split" ? (openBlock(), createElementBlock("svg", _hoisted_11, [..._cache[14] || (_cache[14] = [createElementVNode("rect", {
|
|
390
|
+
x: "3",
|
|
391
|
+
y: "3",
|
|
392
|
+
width: "18",
|
|
393
|
+
height: "18",
|
|
394
|
+
rx: "2"
|
|
395
|
+
}, null, -1), createElementVNode("line", {
|
|
396
|
+
x1: "12",
|
|
397
|
+
y1: "3",
|
|
398
|
+
x2: "12",
|
|
399
|
+
y2: "21"
|
|
400
|
+
}, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_12, [..._cache[15] || (_cache[15] = [
|
|
401
|
+
createElementVNode("rect", {
|
|
402
|
+
x: "3",
|
|
403
|
+
y: "3",
|
|
404
|
+
width: "8",
|
|
405
|
+
height: "8",
|
|
406
|
+
rx: "1"
|
|
407
|
+
}, null, -1),
|
|
408
|
+
createElementVNode("rect", {
|
|
409
|
+
x: "15",
|
|
410
|
+
y: "3",
|
|
411
|
+
width: "6",
|
|
412
|
+
height: "8",
|
|
413
|
+
rx: "1"
|
|
414
|
+
}, null, -1),
|
|
415
|
+
createElementVNode("rect", {
|
|
416
|
+
x: "3",
|
|
417
|
+
y: "15",
|
|
418
|
+
width: "8",
|
|
419
|
+
height: "6",
|
|
420
|
+
rx: "1"
|
|
421
|
+
}, null, -1),
|
|
422
|
+
createElementVNode("circle", {
|
|
423
|
+
cx: "18",
|
|
424
|
+
cy: "18",
|
|
425
|
+
r: "3"
|
|
426
|
+
}, null, -1)
|
|
427
|
+
])]))])], 8, _hoisted_9$1)
|
|
274
428
|
]),
|
|
275
|
-
createElementVNode("span",
|
|
276
|
-
createElementVNode("div",
|
|
277
|
-
|
|
429
|
+
createElementVNode("span", _hoisted_13, toDisplayString($setup.title), 1),
|
|
430
|
+
createElementVNode("div", _hoisted_14, [
|
|
431
|
+
$setup.isSplitMode ? (openBlock(), createElementBlock("button", {
|
|
278
432
|
key: 0,
|
|
433
|
+
class: "opencode-header-btn split-position-btn",
|
|
434
|
+
type: "button",
|
|
435
|
+
title: $setup.splitPositionIconTitle,
|
|
436
|
+
"aria-label": $setup.splitPositionIconLabel,
|
|
437
|
+
onClick: _cache[4] || (_cache[4] = (...args) => $setup.handleToggleSplitPosition && $setup.handleToggleSplitPosition(...args))
|
|
438
|
+
}, [renderSlot(_ctx.$slots, "split-position-icon", {}, () => [$setup.splitPosition === "right" ? (openBlock(), createElementBlock("svg", _hoisted_16, [..._cache[16] || (_cache[16] = [createElementVNode("rect", {
|
|
439
|
+
x: "3",
|
|
440
|
+
y: "3",
|
|
441
|
+
width: "18",
|
|
442
|
+
height: "18",
|
|
443
|
+
rx: "2"
|
|
444
|
+
}, null, -1), createElementVNode("line", {
|
|
445
|
+
x1: "15",
|
|
446
|
+
y1: "3",
|
|
447
|
+
x2: "15",
|
|
448
|
+
y2: "21"
|
|
449
|
+
}, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_17, [..._cache[17] || (_cache[17] = [createElementVNode("rect", {
|
|
450
|
+
x: "3",
|
|
451
|
+
y: "3",
|
|
452
|
+
width: "18",
|
|
453
|
+
height: "18",
|
|
454
|
+
rx: "2"
|
|
455
|
+
}, null, -1), createElementVNode("line", {
|
|
456
|
+
x1: "9",
|
|
457
|
+
y1: "3",
|
|
458
|
+
x2: "9",
|
|
459
|
+
y2: "21"
|
|
460
|
+
}, null, -1)])]))])], 8, _hoisted_15)) : createCommentVNode("v-if", true),
|
|
461
|
+
!$setup.isSplitMode ? (openBlock(), createElementBlock("button", {
|
|
462
|
+
key: 1,
|
|
279
463
|
class: "opencode-header-btn prompt-dock",
|
|
280
464
|
type: "button",
|
|
281
465
|
title: $setup.promptDockVisible ? "隐藏对话框" : "显示对话框",
|
|
282
466
|
"aria-label": $setup.promptDockVisible ? "隐藏对话框" : "显示对话框",
|
|
283
467
|
"aria-pressed": $setup.promptDockVisible,
|
|
284
|
-
onClick: _cache[
|
|
285
|
-
}, [renderSlot(_ctx.$slots, "prompt-dock-icon", {}, () => [_cache[
|
|
468
|
+
onClick: _cache[5] || (_cache[5] = (...args) => $setup.handleTogglePromptDock && $setup.handleTogglePromptDock(...args))
|
|
469
|
+
}, [renderSlot(_ctx.$slots, "prompt-dock-icon", {}, () => [_cache[18] || (_cache[18] = createElementVNode("svg", {
|
|
286
470
|
viewBox: "0 0 24 24",
|
|
287
471
|
width: "14",
|
|
288
472
|
height: "14",
|
|
@@ -290,24 +474,24 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
290
474
|
stroke: "currentColor",
|
|
291
475
|
"stroke-width": "2",
|
|
292
476
|
"aria-hidden": "true"
|
|
293
|
-
}, [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,
|
|
477
|
+
}, [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)) : createCommentVNode("v-if", true),
|
|
294
478
|
!$setup.isSplitMode ? (openBlock(), createElementBlock("button", {
|
|
295
|
-
key:
|
|
479
|
+
key: 2,
|
|
296
480
|
class: "opencode-header-btn minimize",
|
|
297
481
|
type: "button",
|
|
298
482
|
title: $setup.minimized ? "展开" : "最小化",
|
|
299
483
|
"aria-label": $setup.minimized ? "展开面板" : "最小化面板",
|
|
300
484
|
"aria-pressed": $setup.minimized,
|
|
301
|
-
onClick: _cache[
|
|
302
|
-
}, [renderSlot(_ctx.$slots, "minimize-icon", {}, () => [$setup.minimized ? (openBlock(), createElementBlock("svg",
|
|
485
|
+
onClick: _cache[6] || (_cache[6] = (...args) => $setup.handleToggleMinimize && $setup.handleToggleMinimize(...args))
|
|
486
|
+
}, [renderSlot(_ctx.$slots, "minimize-icon", {}, () => [$setup.minimized ? (openBlock(), createElementBlock("svg", _hoisted_20, [..._cache[19] || (_cache[19] = [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)])])) : (openBlock(), createElementBlock("svg", _hoisted_21, [..._cache[20] || (_cache[20] = [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)) : createCommentVNode("v-if", true),
|
|
303
487
|
!$setup.isSplitMode ? (openBlock(), createElementBlock("button", {
|
|
304
|
-
key:
|
|
488
|
+
key: 3,
|
|
305
489
|
class: "opencode-header-btn close",
|
|
306
490
|
type: "button",
|
|
307
491
|
title: "关闭",
|
|
308
492
|
"aria-label": "关闭面板",
|
|
309
|
-
onClick: _cache[
|
|
310
|
-
}, [renderSlot(_ctx.$slots, "close-icon", {}, () => [_cache[
|
|
493
|
+
onClick: _cache[7] || (_cache[7] = (...args) => $setup.handleClose && $setup.handleClose(...args))
|
|
494
|
+
}, [renderSlot(_ctx.$slots, "close-icon", {}, () => [_cache[21] || (_cache[21] = createElementVNode("svg", {
|
|
311
495
|
viewBox: "0 0 24 24",
|
|
312
496
|
width: "14",
|
|
313
497
|
height: "14",
|
|
@@ -393,8 +577,8 @@ var _hoisted_4$3 = {
|
|
|
393
577
|
};
|
|
394
578
|
var _hoisted_5$3 = ["aria-selected", "onClick"];
|
|
395
579
|
var _hoisted_6$3 = { class: "opencode-session-header" };
|
|
396
|
-
var _hoisted_7$
|
|
397
|
-
var _hoisted_8 = {
|
|
580
|
+
var _hoisted_7$2 = { class: "opencode-session-title" };
|
|
581
|
+
var _hoisted_8$1 = {
|
|
398
582
|
key: 0,
|
|
399
583
|
class: "opencode-thinking-loading"
|
|
400
584
|
};
|
|
@@ -426,7 +610,7 @@ function __vue_render__$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
426
610
|
role: "option",
|
|
427
611
|
"aria-selected": item.active,
|
|
428
612
|
onClick: ($event) => $setup.handleSelectSession(item)
|
|
429
|
-
}, [createElementVNode("div", _hoisted_6$3, [createElementVNode("div", _hoisted_7$
|
|
613
|
+
}, [createElementVNode("div", _hoisted_6$3, [createElementVNode("div", _hoisted_7$2, [$setup.isSessionThinking(item.id) ? (openBlock(), createElementBlock("span", _hoisted_8$1)) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(item.title), 1)]), createElementVNode("button", {
|
|
430
614
|
class: "opencode-session-delete-btn",
|
|
431
615
|
type: "button",
|
|
432
616
|
"aria-label": `\u5220\u9664\u4F1A\u8BDD: ${item.title}`,
|
|
@@ -538,6 +722,11 @@ var __vue_sfc__$5 = /* @__PURE__ */ defineComponent(__spreadProps$3(__spreadValu
|
|
|
538
722
|
type: Number,
|
|
539
723
|
required: false,
|
|
540
724
|
default: 800
|
|
725
|
+
},
|
|
726
|
+
position: {
|
|
727
|
+
type: String,
|
|
728
|
+
required: false,
|
|
729
|
+
default: "right"
|
|
541
730
|
}
|
|
542
731
|
},
|
|
543
732
|
emits: [
|
|
@@ -563,7 +752,9 @@ var __vue_sfc__$5 = /* @__PURE__ */ defineComponent(__spreadProps$3(__spreadValu
|
|
|
563
752
|
};
|
|
564
753
|
const handleMouseMove = (e) => {
|
|
565
754
|
if (!isResizing.value) return;
|
|
566
|
-
|
|
755
|
+
let deltaX;
|
|
756
|
+
if (props.position === "right") deltaX = startX.value - e.clientX;
|
|
757
|
+
else deltaX = e.clientX - startX.value;
|
|
567
758
|
emit("resize", Math.max(props.minWidth, Math.min(props.maxWidth, startWidth.value + deltaX)));
|
|
568
759
|
};
|
|
569
760
|
const handleMouseUp = () => {
|
|
@@ -599,7 +790,10 @@ var __vue_sfc__$5 = /* @__PURE__ */ defineComponent(__spreadProps$3(__spreadValu
|
|
|
599
790
|
}));
|
|
600
791
|
function __vue_render__$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
601
792
|
return openBlock(), createElementBlock("div", {
|
|
602
|
-
class: normalizeClass(["opencode-resize-handle", {
|
|
793
|
+
class: normalizeClass(["opencode-resize-handle", {
|
|
794
|
+
resizing: $setup.isResizing,
|
|
795
|
+
"handle-left": $props.position === "left"
|
|
796
|
+
}]),
|
|
603
797
|
onMousedown: $setup.handleMouseDown,
|
|
604
798
|
onDblclick: $setup.handleDoubleClick
|
|
605
799
|
}, null, 34);
|
|
@@ -713,6 +907,11 @@ var __vue_sfc__$4 = /* @__PURE__ */ defineComponent(__spreadProps$2(__spreadValu
|
|
|
713
907
|
type: String,
|
|
714
908
|
required: false,
|
|
715
909
|
default: "light"
|
|
910
|
+
},
|
|
911
|
+
splitPosition: {
|
|
912
|
+
type: String,
|
|
913
|
+
required: false,
|
|
914
|
+
default: "right"
|
|
716
915
|
}
|
|
717
916
|
},
|
|
718
917
|
emits: [
|
|
@@ -769,7 +968,9 @@ var __vue_sfc__$4 = /* @__PURE__ */ defineComponent(__spreadProps$2(__spreadValu
|
|
|
769
968
|
minimized: props.minimized,
|
|
770
969
|
dragging: props.dragging,
|
|
771
970
|
"no-transition": props.noTransition,
|
|
772
|
-
"split-mode": props.mode === "split"
|
|
971
|
+
"split-mode": props.mode === "split",
|
|
972
|
+
"split-left": props.mode === "split" && props.splitPosition === "left",
|
|
973
|
+
"split-right": props.mode === "split" && props.splitPosition === "right"
|
|
773
974
|
}]),
|
|
774
975
|
Frame: Frame_vue_default,
|
|
775
976
|
Header: Header_vue_default,
|
|
@@ -805,11 +1006,29 @@ var _hoisted_4$1 = {
|
|
|
805
1006
|
"stroke-width": "2"
|
|
806
1007
|
};
|
|
807
1008
|
var _hoisted_5$1 = {
|
|
1009
|
+
key: 2,
|
|
1010
|
+
viewBox: "0 0 24 24",
|
|
1011
|
+
width: "16",
|
|
1012
|
+
height: "16",
|
|
1013
|
+
fill: "none",
|
|
1014
|
+
stroke: "currentColor",
|
|
1015
|
+
"stroke-width": "2"
|
|
1016
|
+
};
|
|
1017
|
+
var _hoisted_6$1 = {
|
|
1018
|
+
key: 3,
|
|
1019
|
+
viewBox: "0 0 24 24",
|
|
1020
|
+
width: "16",
|
|
1021
|
+
height: "16",
|
|
1022
|
+
fill: "none",
|
|
1023
|
+
stroke: "currentColor",
|
|
1024
|
+
"stroke-width": "2"
|
|
1025
|
+
};
|
|
1026
|
+
var _hoisted_7$1 = {
|
|
808
1027
|
key: 2,
|
|
809
1028
|
class: "opencode-notification",
|
|
810
1029
|
role: "alert"
|
|
811
1030
|
};
|
|
812
|
-
var
|
|
1031
|
+
var _hoisted_8 = { class: "opencode-chat-content" };
|
|
813
1032
|
function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
814
1033
|
return openBlock(), createElementBlock("div", {
|
|
815
1034
|
class: normalizeClass($setup.panelClasses),
|
|
@@ -820,13 +1039,15 @@ function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
820
1039
|
width: $props.panelWidth,
|
|
821
1040
|
"min-width": $props.minWidth,
|
|
822
1041
|
"max-width": $props.maxWidth,
|
|
1042
|
+
position: $props.splitPosition,
|
|
823
1043
|
onResize: $setup.handleResize,
|
|
824
1044
|
onResizeStart: $setup.handleResizeStart,
|
|
825
1045
|
onResizeEnd: $setup.handleResizeEnd
|
|
826
1046
|
}, null, 8, [
|
|
827
1047
|
"width",
|
|
828
1048
|
"min-width",
|
|
829
|
-
"max-width"
|
|
1049
|
+
"max-width",
|
|
1050
|
+
"position"
|
|
830
1051
|
])) : createCommentVNode("v-if", true),
|
|
831
1052
|
$props.mode === "split" ? (openBlock(), createElementBlock("button", {
|
|
832
1053
|
key: 1,
|
|
@@ -834,20 +1055,34 @@ function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
834
1055
|
class: normalizeClass(["opencode-split-toggle-btn", {
|
|
835
1056
|
open: $setup.props.open,
|
|
836
1057
|
thinking: $setup.props.thinking,
|
|
837
|
-
"opencode-theme-dark": $props.resolvedTheme === "dark"
|
|
1058
|
+
"opencode-theme-dark": $props.resolvedTheme === "dark",
|
|
1059
|
+
"split-left": $props.splitPosition === "left"
|
|
838
1060
|
}]),
|
|
839
1061
|
"aria-expanded": $props.open,
|
|
840
1062
|
"aria-label": "切换面板",
|
|
841
1063
|
onClick: $setup.handleToggle
|
|
842
|
-
}, [createElementVNode("span", _hoisted_2$1, [
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
"
|
|
849
|
-
|
|
850
|
-
|
|
1064
|
+
}, [createElementVNode("span", _hoisted_2$1, [
|
|
1065
|
+
$props.open && $props.splitPosition === "right" ? (openBlock(), createElementBlock("svg", _hoisted_3$1, [..._cache[0] || (_cache[0] = [createElementVNode("path", {
|
|
1066
|
+
d: "M9 18l6-6-6-6",
|
|
1067
|
+
"stroke-linecap": "round",
|
|
1068
|
+
"stroke-linejoin": "round"
|
|
1069
|
+
}, null, -1)])])) : createCommentVNode("v-if", true),
|
|
1070
|
+
!$props.open && $props.splitPosition === "right" ? (openBlock(), createElementBlock("svg", _hoisted_4$1, [..._cache[1] || (_cache[1] = [createElementVNode("path", {
|
|
1071
|
+
d: "M15 18l-6-6 6-6",
|
|
1072
|
+
"stroke-linecap": "round",
|
|
1073
|
+
"stroke-linejoin": "round"
|
|
1074
|
+
}, null, -1)])])) : createCommentVNode("v-if", true),
|
|
1075
|
+
$props.open && $props.splitPosition === "left" ? (openBlock(), createElementBlock("svg", _hoisted_5$1, [..._cache[2] || (_cache[2] = [createElementVNode("path", {
|
|
1076
|
+
d: "M15 18l-6-6 6-6",
|
|
1077
|
+
"stroke-linecap": "round",
|
|
1078
|
+
"stroke-linejoin": "round"
|
|
1079
|
+
}, null, -1)])])) : createCommentVNode("v-if", true),
|
|
1080
|
+
!$props.open && $props.splitPosition === "left" ? (openBlock(), createElementBlock("svg", _hoisted_6$1, [..._cache[3] || (_cache[3] = [createElementVNode("path", {
|
|
1081
|
+
d: "M9 18l6-6-6-6",
|
|
1082
|
+
"stroke-linecap": "round",
|
|
1083
|
+
"stroke-linejoin": "round"
|
|
1084
|
+
}, null, -1)])])) : createCommentVNode("v-if", true)
|
|
1085
|
+
])], 10, _hoisted_1$3)) : createCommentVNode("v-if", true),
|
|
851
1086
|
createVNode($setup["Header"], null, createSlots({ _: 2 }, [
|
|
852
1087
|
$setup.slots["session-toggle-icon"] ? {
|
|
853
1088
|
name: "session-toggle-icon",
|
|
@@ -865,10 +1100,10 @@ function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
865
1100
|
key: "2"
|
|
866
1101
|
} : void 0
|
|
867
1102
|
]), 1024),
|
|
868
|
-
$props.notificationVisible && $props.notificationMode === "widget" ? (openBlock(), createElementBlock("div",
|
|
869
|
-
createElementVNode("div",
|
|
1103
|
+
$props.notificationVisible && $props.notificationMode === "widget" ? (openBlock(), createElementBlock("div", _hoisted_7$1, toDisplayString($props.notificationMessage), 1)) : createCommentVNode("v-if", true),
|
|
1104
|
+
createElementVNode("div", _hoisted_8, [
|
|
870
1105
|
createVNode($setup["SessionList"], null, {
|
|
871
|
-
empty: withCtx(() => [renderSlot(_ctx.$slots, "sessions-empty", {}, () => [_cache[
|
|
1106
|
+
empty: withCtx(() => [renderSlot(_ctx.$slots, "sessions-empty", {}, () => [_cache[4] || (_cache[4] = createElementVNode("div", { class: "opencode-session-empty" }, "暂无会话", -1))])]),
|
|
872
1107
|
_: 3
|
|
873
1108
|
}),
|
|
874
1109
|
createVNode($setup["Frame"], { ref: "frameRef" }, createSlots({ _: 2 }, [
|
|
@@ -1960,7 +2195,7 @@ function usePersistState(options) {
|
|
|
1960
2195
|
return saved;
|
|
1961
2196
|
};
|
|
1962
2197
|
const getCurrentState = () => {
|
|
1963
|
-
var _a;
|
|
2198
|
+
var _a, _b, _c;
|
|
1964
2199
|
return {
|
|
1965
2200
|
open: options.open.value,
|
|
1966
2201
|
minimized: options.minimized.value,
|
|
@@ -1968,7 +2203,9 @@ function usePersistState(options) {
|
|
|
1968
2203
|
bubbleOffset: options.bubbleOffset.value,
|
|
1969
2204
|
theme: options.theme.value,
|
|
1970
2205
|
sessionListCollapsed: options.sessionListCollapsed.value,
|
|
1971
|
-
splitPanelWidth: (_a = options.splitPanelWidth) == null ? void 0 : _a.value
|
|
2206
|
+
splitPanelWidth: (_a = options.splitPanelWidth) == null ? void 0 : _a.value,
|
|
2207
|
+
displayMode: (_b = options.displayMode) == null ? void 0 : _b.value,
|
|
2208
|
+
splitPosition: (_c = options.splitPosition) == null ? void 0 : _c.value
|
|
1972
2209
|
};
|
|
1973
2210
|
};
|
|
1974
2211
|
const persistState = () => {
|
|
@@ -1983,6 +2220,8 @@ function usePersistState(options) {
|
|
|
1983
2220
|
options.sessionListCollapsed
|
|
1984
2221
|
];
|
|
1985
2222
|
if (options.splitPanelWidth) watchers.push(options.splitPanelWidth);
|
|
2223
|
+
if (options.displayMode) watchers.push(options.displayMode);
|
|
2224
|
+
if (options.splitPosition) watchers.push(options.splitPosition);
|
|
1986
2225
|
onMounted(() => {
|
|
1987
2226
|
restoreState();
|
|
1988
2227
|
watch(watchers, () => {
|
|
@@ -1998,17 +2237,20 @@ function usePersistState(options) {
|
|
|
1998
2237
|
//#region es/open-code-widget/composables/use-split.js
|
|
1999
2238
|
var AUTO_MODE_THRESHOLD = 1440;
|
|
2000
2239
|
function useSplitMode(options) {
|
|
2240
|
+
var _a, _b;
|
|
2001
2241
|
const windowWidth = ref(typeof window !== "undefined" ? window.innerWidth : 0);
|
|
2242
|
+
const localSplitPosition = ref((_b = (_a = options.splitPosition) == null ? void 0 : _a.value) != null ? _b : "right");
|
|
2002
2243
|
const splitConfig = computed(() => {
|
|
2003
|
-
var
|
|
2244
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
2004
2245
|
const config = options.splitMode.value || {};
|
|
2005
2246
|
return {
|
|
2006
|
-
width: (
|
|
2007
|
-
minWidth: (
|
|
2247
|
+
width: (_a2 = config.width) != null ? _a2 : 500,
|
|
2248
|
+
minWidth: (_b2 = config.minWidth) != null ? _b2 : 400,
|
|
2008
2249
|
maxWidth: (_c = config.maxWidth) != null ? _c : 800,
|
|
2009
2250
|
resizable: (_d = config.resizable) != null ? _d : true,
|
|
2010
2251
|
shrinkPage: (_e = config.shrinkPage) != null ? _e : true,
|
|
2011
|
-
defaultOpen: (_f = config.defaultOpen) != null ? _f : true
|
|
2252
|
+
defaultOpen: (_f = config.defaultOpen) != null ? _f : true,
|
|
2253
|
+
position: (_g = config.position) != null ? _g : localSplitPosition.value
|
|
2012
2254
|
};
|
|
2013
2255
|
});
|
|
2014
2256
|
const panelWidth = ref(splitConfig.value.width);
|
|
@@ -2018,15 +2260,22 @@ function useSplitMode(options) {
|
|
|
2018
2260
|
return windowWidth.value >= AUTO_MODE_THRESHOLD ? "split" : "bubble";
|
|
2019
2261
|
});
|
|
2020
2262
|
const isSplitMode = computed(() => effectiveMode.value === "split");
|
|
2263
|
+
const splitPosition = computed(() => splitConfig.value.position);
|
|
2021
2264
|
const handleResize = (width) => {
|
|
2022
|
-
var
|
|
2265
|
+
var _a2;
|
|
2023
2266
|
panelWidth.value = width;
|
|
2024
|
-
(
|
|
2267
|
+
(_a2 = options.onWidthChange) == null || _a2.call(options, width);
|
|
2025
2268
|
};
|
|
2026
2269
|
const handleToggle = () => {
|
|
2027
|
-
var
|
|
2270
|
+
var _a2;
|
|
2028
2271
|
const nextOpen = !options.open.value;
|
|
2029
|
-
(
|
|
2272
|
+
(_a2 = options.onOpenChange) == null || _a2.call(options, nextOpen);
|
|
2273
|
+
};
|
|
2274
|
+
const handleTogglePosition = () => {
|
|
2275
|
+
var _a2;
|
|
2276
|
+
const nextPosition = localSplitPosition.value === "right" ? "left" : "right";
|
|
2277
|
+
localSplitPosition.value = nextPosition;
|
|
2278
|
+
(_a2 = options.onPositionChange) == null || _a2.call(options, nextPosition);
|
|
2030
2279
|
};
|
|
2031
2280
|
const handleWindowResize = () => {
|
|
2032
2281
|
if (typeof window !== "undefined") windowWidth.value = window.innerWidth;
|
|
@@ -2036,31 +2285,49 @@ function useSplitMode(options) {
|
|
|
2036
2285
|
if (isSplitMode.value && options.open.value && splitConfig.value.shrinkPage) {
|
|
2037
2286
|
document.body.classList.add("has-opencode-split");
|
|
2038
2287
|
document.body.style.setProperty("--opencode-split-width", `${panelWidth.value}px`);
|
|
2288
|
+
if (splitPosition.value === "left") {
|
|
2289
|
+
document.body.classList.add("has-opencode-split-left");
|
|
2290
|
+
document.body.classList.remove("has-opencode-split-right");
|
|
2291
|
+
} else {
|
|
2292
|
+
document.body.classList.add("has-opencode-split-right");
|
|
2293
|
+
document.body.classList.remove("has-opencode-split-left");
|
|
2294
|
+
}
|
|
2039
2295
|
} else {
|
|
2040
2296
|
document.body.classList.remove("has-opencode-split");
|
|
2297
|
+
document.body.classList.remove("has-opencode-split-left");
|
|
2298
|
+
document.body.classList.remove("has-opencode-split-right");
|
|
2041
2299
|
document.body.style.removeProperty("--opencode-split-width");
|
|
2042
2300
|
}
|
|
2043
2301
|
};
|
|
2044
2302
|
watch([
|
|
2045
2303
|
isSplitMode,
|
|
2046
2304
|
options.open,
|
|
2047
|
-
panelWidth
|
|
2305
|
+
panelWidth,
|
|
2306
|
+
splitPosition
|
|
2048
2307
|
], updateBodyClass, { immediate: true });
|
|
2049
2308
|
watch(splitConfig, (config) => {
|
|
2050
2309
|
if (panelWidth.value < config.minWidth) panelWidth.value = config.minWidth;
|
|
2051
2310
|
if (panelWidth.value > config.maxWidth) panelWidth.value = config.maxWidth;
|
|
2052
2311
|
});
|
|
2312
|
+
watch(() => {
|
|
2313
|
+
var _a2;
|
|
2314
|
+
return (_a2 = options.splitPosition) == null ? void 0 : _a2.value;
|
|
2315
|
+
}, (val) => {
|
|
2316
|
+
if (val && val !== localSplitPosition.value) localSplitPosition.value = val;
|
|
2317
|
+
});
|
|
2053
2318
|
onMounted(() => {
|
|
2054
|
-
var
|
|
2319
|
+
var _a2;
|
|
2055
2320
|
if (typeof window !== "undefined") {
|
|
2056
2321
|
window.addEventListener("resize", handleWindowResize);
|
|
2057
|
-
if (isSplitMode.value && splitConfig.value.defaultOpen && !options.open.value) (
|
|
2322
|
+
if (isSplitMode.value && splitConfig.value.defaultOpen && !options.open.value) (_a2 = options.onOpenChange) == null || _a2.call(options, true);
|
|
2058
2323
|
}
|
|
2059
2324
|
});
|
|
2060
2325
|
onUnmounted(() => {
|
|
2061
2326
|
if (typeof window !== "undefined") {
|
|
2062
2327
|
window.removeEventListener("resize", handleWindowResize);
|
|
2063
2328
|
document.body.classList.remove("has-opencode-split");
|
|
2329
|
+
document.body.classList.remove("has-opencode-split-left");
|
|
2330
|
+
document.body.classList.remove("has-opencode-split-right");
|
|
2064
2331
|
document.body.style.removeProperty("--opencode-split-width");
|
|
2065
2332
|
}
|
|
2066
2333
|
});
|
|
@@ -2069,8 +2336,10 @@ function useSplitMode(options) {
|
|
|
2069
2336
|
isSplitMode,
|
|
2070
2337
|
panelWidth,
|
|
2071
2338
|
splitConfig,
|
|
2339
|
+
splitPosition,
|
|
2072
2340
|
handleResize,
|
|
2073
|
-
handleToggle
|
|
2341
|
+
handleToggle,
|
|
2342
|
+
handleTogglePosition
|
|
2074
2343
|
};
|
|
2075
2344
|
}
|
|
2076
2345
|
//#endregion
|
|
@@ -2253,6 +2522,7 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2253
2522
|
"split-panel-width-change"
|
|
2254
2523
|
],
|
|
2255
2524
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2525
|
+
var _a, _b;
|
|
2256
2526
|
useCssVars((_ctx) => ({
|
|
2257
2527
|
"-chatAnimationOrigin.x": chatAnimationOrigin.value.x,
|
|
2258
2528
|
"-chatAnimationOrigin.y": chatAnimationOrigin.value.y
|
|
@@ -2295,10 +2565,12 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2295
2565
|
const frameRef = ref(null);
|
|
2296
2566
|
const triggerRef = ref(null);
|
|
2297
2567
|
const sendMessageToIframe = (type, data) => {
|
|
2298
|
-
var
|
|
2299
|
-
(
|
|
2568
|
+
var _a2;
|
|
2569
|
+
(_a2 = frameRef.value) == null || _a2.sendMessageToIframe(type, data);
|
|
2300
2570
|
};
|
|
2301
2571
|
const localSessionListCollapsed = ref(props.sessionListCollapsed);
|
|
2572
|
+
const localDisplayMode = ref(props.displayMode);
|
|
2573
|
+
const localSplitPosition = ref((_b = (_a = props.splitMode) == null ? void 0 : _a.position) != null ? _b : "right");
|
|
2302
2574
|
const minimized = ref(false);
|
|
2303
2575
|
const promptDockVisible = ref(true);
|
|
2304
2576
|
const isRestoring = ref(true);
|
|
@@ -2320,6 +2592,17 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2320
2592
|
watch(() => props.splitPanelWidth, (val) => {
|
|
2321
2593
|
splitPanelWidth.value = val;
|
|
2322
2594
|
});
|
|
2595
|
+
watch(() => props.displayMode, (val) => {
|
|
2596
|
+
localDisplayMode.value = val;
|
|
2597
|
+
});
|
|
2598
|
+
const handleToggleDisplayMode = () => {
|
|
2599
|
+
const modes = [
|
|
2600
|
+
"bubble",
|
|
2601
|
+
"split",
|
|
2602
|
+
"auto"
|
|
2603
|
+
];
|
|
2604
|
+
localDisplayMode.value = modes[(modes.indexOf(localDisplayMode.value) + 1) % modes.length];
|
|
2605
|
+
};
|
|
2323
2606
|
const { buttonActive, containerClasses, iframeSource, sessionListTitle, resolvedTheme, handleClose, handleEmptyAction, handleToggle, handleToggleSessionList, handleToggleTheme } = useWidget({
|
|
2324
2607
|
theme: toRef(props, "theme"),
|
|
2325
2608
|
open: toRef(props, "open"),
|
|
@@ -2392,10 +2675,11 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2392
2675
|
}
|
|
2393
2676
|
});
|
|
2394
2677
|
const bubbleOffset = ref(void 0);
|
|
2395
|
-
const { effectiveMode, isSplitMode, panelWidth, splitConfig, handleResize, handleToggle: handleSplitToggle } = useSplitMode({
|
|
2396
|
-
displayMode:
|
|
2678
|
+
const { effectiveMode, isSplitMode, panelWidth, splitConfig, splitPosition, handleResize, handleToggle: handleSplitToggle, handleTogglePosition } = useSplitMode({
|
|
2679
|
+
displayMode: localDisplayMode,
|
|
2397
2680
|
splitMode: toRef(props, "splitMode"),
|
|
2398
2681
|
open: toRef(props, "open"),
|
|
2682
|
+
splitPosition: localSplitPosition,
|
|
2399
2683
|
onOpenChange: (nextOpen) => {
|
|
2400
2684
|
emit("update:open", nextOpen);
|
|
2401
2685
|
emit("toggle", nextOpen);
|
|
@@ -2404,6 +2688,9 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2404
2688
|
splitPanelWidth.value = width;
|
|
2405
2689
|
emit("update:splitPanelWidth", width);
|
|
2406
2690
|
emit("split-panel-width-change", width);
|
|
2691
|
+
},
|
|
2692
|
+
onPositionChange: (position) => {
|
|
2693
|
+
localSplitPosition.value = position;
|
|
2407
2694
|
}
|
|
2408
2695
|
});
|
|
2409
2696
|
usePersistState({
|
|
@@ -2414,6 +2701,8 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2414
2701
|
theme: toRef(props, "theme"),
|
|
2415
2702
|
sessionListCollapsed: localSessionListCollapsed,
|
|
2416
2703
|
splitPanelWidth,
|
|
2704
|
+
displayMode: localDisplayMode,
|
|
2705
|
+
splitPosition: localSplitPosition,
|
|
2417
2706
|
onRestore: (state) => {
|
|
2418
2707
|
if (state.open !== void 0 && state.open !== props.open) {
|
|
2419
2708
|
emit("update:open", state.open);
|
|
@@ -2441,6 +2730,8 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2441
2730
|
if (state.promptDockVisible !== void 0) promptDockVisible.value = state.promptDockVisible;
|
|
2442
2731
|
else if (minimized.value) promptDockVisible.value = false;
|
|
2443
2732
|
if (state.splitPanelWidth !== void 0 && state.splitPanelWidth !== props.splitPanelWidth) handleResize(state.splitPanelWidth);
|
|
2733
|
+
if (state.displayMode !== void 0 && state.displayMode !== props.displayMode) localDisplayMode.value = state.displayMode;
|
|
2734
|
+
if (state.splitPosition !== void 0) localSplitPosition.value = state.splitPosition;
|
|
2444
2735
|
nextTick(() => {
|
|
2445
2736
|
syncStateToIframe();
|
|
2446
2737
|
setTimeout(() => {
|
|
@@ -2474,12 +2765,12 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2474
2765
|
if (typeof window !== "undefined") window.removeEventListener("resize", handleWindowResize);
|
|
2475
2766
|
});
|
|
2476
2767
|
const bubbleQuadrant = computed(() => {
|
|
2477
|
-
var
|
|
2768
|
+
var _a2, _b2, _c, _d;
|
|
2478
2769
|
if (typeof window === "undefined") return "bottom-right";
|
|
2479
2770
|
const centerX = windowWidth.value / 2;
|
|
2480
2771
|
const centerY = windowHeight.value / 2;
|
|
2481
2772
|
const bubbleSize = 44;
|
|
2482
|
-
const currentOffset = (
|
|
2773
|
+
const currentOffset = (_b2 = (_a2 = triggerRef.value) == null ? void 0 : _a2.offset) != null ? _b2 : bubbleOffset.value;
|
|
2483
2774
|
const effectiveX = ((_c = currentOffset == null ? void 0 : currentOffset.x) != null ? _c : windowWidth.value - bubbleSize - 24) + bubbleSize / 2;
|
|
2484
2775
|
const effectiveY = ((_d = currentOffset == null ? void 0 : currentOffset.y) != null ? _d : windowHeight.value - bubbleSize - 24) + bubbleSize / 2;
|
|
2485
2776
|
if (effectiveX >= centerX && effectiveY >= centerY) return "bottom-right";
|
|
@@ -2492,14 +2783,14 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2492
2783
|
return quadrant === "top-right" || quadrant === "bottom-right";
|
|
2493
2784
|
});
|
|
2494
2785
|
const chatPositionStyle = computed(() => {
|
|
2495
|
-
var
|
|
2786
|
+
var _a2, _b2, _c;
|
|
2496
2787
|
if (typeof window === "undefined") return {};
|
|
2497
2788
|
const chatWidth = minimized.value ? 300 : 700;
|
|
2498
2789
|
const chatHeight = minimized.value ? 300 : Math.min(windowHeight.value * .86, windowHeight.value - 40);
|
|
2499
2790
|
const gap = 24;
|
|
2500
2791
|
const bubbleSize = 44;
|
|
2501
2792
|
const screenMargin = 20;
|
|
2502
|
-
const effectiveOffset = (_c = (
|
|
2793
|
+
const effectiveOffset = (_c = (_b2 = (_a2 = triggerRef.value) == null ? void 0 : _a2.offset) != null ? _b2 : bubbleOffset.value) != null ? _c : {
|
|
2503
2794
|
x: windowWidth.value - bubbleSize - gap,
|
|
2504
2795
|
y: windowHeight.value - bubbleSize - gap
|
|
2505
2796
|
};
|
|
@@ -2592,9 +2883,11 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2592
2883
|
promptDockVisible,
|
|
2593
2884
|
bubbleOffset,
|
|
2594
2885
|
mode: effectiveMode,
|
|
2886
|
+
displayMode: localDisplayMode,
|
|
2887
|
+
splitPosition,
|
|
2595
2888
|
sessionStates: computed(() => {
|
|
2596
|
-
var
|
|
2597
|
-
return (
|
|
2889
|
+
var _a2;
|
|
2890
|
+
return (_a2 = props.sessionStates) != null ? _a2 : {};
|
|
2598
2891
|
}),
|
|
2599
2892
|
iframeSource,
|
|
2600
2893
|
buttonActive,
|
|
@@ -2609,6 +2902,8 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2609
2902
|
handleTogglePromptDock,
|
|
2610
2903
|
handleToggleSessionList,
|
|
2611
2904
|
handleToggleTheme,
|
|
2905
|
+
handleToggleDisplayMode,
|
|
2906
|
+
handleToggleSplitPosition: handleTogglePosition,
|
|
2612
2907
|
handleEmptyAction,
|
|
2613
2908
|
handleCreateSession,
|
|
2614
2909
|
handleSelectSession,
|
|
@@ -2655,6 +2950,8 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2655
2950
|
triggerRef,
|
|
2656
2951
|
sendMessageToIframe,
|
|
2657
2952
|
localSessionListCollapsed,
|
|
2953
|
+
localDisplayMode,
|
|
2954
|
+
localSplitPosition,
|
|
2658
2955
|
minimized,
|
|
2659
2956
|
promptDockVisible,
|
|
2660
2957
|
isRestoring,
|
|
@@ -2662,6 +2959,7 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2662
2959
|
splitPanelWidth,
|
|
2663
2960
|
syncStateToIframe,
|
|
2664
2961
|
handleFrameLoaded,
|
|
2962
|
+
handleToggleDisplayMode,
|
|
2665
2963
|
buttonActive,
|
|
2666
2964
|
containerClasses,
|
|
2667
2965
|
iframeSource,
|
|
@@ -2693,8 +2991,10 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2693
2991
|
isSplitMode,
|
|
2694
2992
|
panelWidth,
|
|
2695
2993
|
splitConfig,
|
|
2994
|
+
splitPosition,
|
|
2696
2995
|
handleResize,
|
|
2697
2996
|
handleSplitToggle,
|
|
2997
|
+
handleTogglePosition,
|
|
2698
2998
|
handleToggleMinimize,
|
|
2699
2999
|
handleTogglePromptDock,
|
|
2700
3000
|
windowWidth,
|
|
@@ -2775,6 +3075,7 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2775
3075
|
"notification-mode": $setup.notificationMode,
|
|
2776
3076
|
thinking: $props.thinking,
|
|
2777
3077
|
"resolved-theme": $setup.resolvedTheme,
|
|
3078
|
+
"split-position": $setup.splitPosition,
|
|
2778
3079
|
onResize: $setup.handleResize,
|
|
2779
3080
|
onResizeStart: $setup.handleResizeStart,
|
|
2780
3081
|
onResizeEnd: $setup.handleResizeEnd,
|
|
@@ -2835,6 +3136,7 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2835
3136
|
"notification-mode",
|
|
2836
3137
|
"thinking",
|
|
2837
3138
|
"resolved-theme",
|
|
3139
|
+
"split-position",
|
|
2838
3140
|
"onResize",
|
|
2839
3141
|
"onToggle"
|
|
2840
3142
|
]),
|
|
@@ -2863,7 +3165,7 @@ __vue_sfc__.render = __vue_render__;
|
|
|
2863
3165
|
var open_code_widget_default = __vue_sfc__;
|
|
2864
3166
|
//#endregion
|
|
2865
3167
|
//#region es/index.js
|
|
2866
|
-
var version = "1.0.
|
|
3168
|
+
var version = "1.0.50";
|
|
2867
3169
|
function install(app, options) {
|
|
2868
3170
|
[open_code_widget_default].forEach((item) => {
|
|
2869
3171
|
if (item.install) app.use(item, options);
|