@vite-plugin-opencode-assistant/components 1.0.36 → 1.0.38
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 +2 -0
- package/es/open-code-widget/composables/use-persist-state.js +24 -9
- package/es/open-code-widget/composables/use-split.d.ts +24 -0
- package/es/open-code-widget/composables/use-split.js +90 -0
- package/es/open-code-widget/src/components/ChatPanel-sfc.css +1 -0
- package/es/open-code-widget/src/components/ChatPanel.vue.d.ts +180 -0
- package/es/open-code-widget/src/components/ChatPanel.vue.js +288 -0
- package/es/open-code-widget/src/components/Header.vue.js +13 -8
- package/es/open-code-widget/src/components/ResizeHandle-sfc.css +1 -0
- package/es/open-code-widget/src/components/ResizeHandle.vue.d.ts +19 -0
- package/es/open-code-widget/src/components/ResizeHandle.vue.js +91 -0
- package/es/open-code-widget/src/components/SplitTrigger-sfc.css +1 -0
- package/es/open-code-widget/src/components/SplitTrigger.vue.d.ts +17 -0
- package/es/open-code-widget/src/components/SplitTrigger.vue.js +130 -0
- package/es/open-code-widget/src/context.d.ts +1 -0
- package/es/open-code-widget/src/index-sfc.css +1 -1
- package/es/open-code-widget/src/index.vue.d.ts +16 -53
- package/es/open-code-widget/src/index.vue.js +150 -140
- package/es/open-code-widget/src/types.d.ts +1 -1
- package/lib/@vite-plugin-opencode-assistant/components.cjs.js +806 -248
- package/lib/@vite-plugin-opencode-assistant/components.es.js +802 -244
- package/lib/components.css +5 -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 +2 -0
- package/lib/open-code-widget/composables/use-persist-state.js +24 -9
- package/lib/open-code-widget/composables/use-split.d.ts +24 -0
- package/lib/open-code-widget/composables/use-split.js +109 -0
- package/lib/open-code-widget/src/components/ChatPanel-sfc.css +1 -0
- package/lib/open-code-widget/src/components/ChatPanel.vue.d.ts +180 -0
- package/lib/open-code-widget/src/components/ChatPanel.vue.js +315 -0
- package/lib/open-code-widget/src/components/Header.vue.js +12 -7
- package/lib/open-code-widget/src/components/ResizeHandle-sfc.css +1 -0
- package/lib/open-code-widget/src/components/ResizeHandle.vue.d.ts +19 -0
- package/lib/open-code-widget/src/components/ResizeHandle.vue.js +108 -0
- package/lib/open-code-widget/src/components/SplitTrigger-sfc.css +1 -0
- package/lib/open-code-widget/src/components/SplitTrigger.vue.d.ts +17 -0
- package/lib/open-code-widget/src/components/SplitTrigger.vue.js +147 -0
- package/lib/open-code-widget/src/context.d.ts +1 -0
- package/lib/open-code-widget/src/index-sfc.css +1 -1
- package/lib/open-code-widget/src/index.vue.d.ts +16 -53
- package/lib/open-code-widget/src/index.vue.js +149 -139
- package/lib/open-code-widget/src/types.d.ts +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +2 -2
|
@@ -13,24 +13,24 @@ function useOpenCodeWidgetContext() {
|
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region es/open-code-widget/src/components/Frame.vue.js
|
|
16
|
-
var __defProp$
|
|
17
|
-
var __getOwnPropSymbols$
|
|
18
|
-
var __hasOwnProp$
|
|
19
|
-
var __propIsEnum$
|
|
20
|
-
var __defNormalProp$
|
|
16
|
+
var __defProp$4 = Object.defineProperty;
|
|
17
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
18
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
19
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
20
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, {
|
|
21
21
|
enumerable: true,
|
|
22
22
|
configurable: true,
|
|
23
23
|
writable: true,
|
|
24
24
|
value
|
|
25
25
|
}) : obj[key] = value;
|
|
26
|
-
var __spreadValues$
|
|
27
|
-
for (var prop in b || (b = {})) if (__hasOwnProp$
|
|
28
|
-
if (__getOwnPropSymbols$
|
|
29
|
-
for (var prop of __getOwnPropSymbols$
|
|
26
|
+
var __spreadValues$4 = (a, b) => {
|
|
27
|
+
for (var prop in b || (b = {})) if (__hasOwnProp$4.call(b, prop)) __defNormalProp$4(a, prop, b[prop]);
|
|
28
|
+
if (__getOwnPropSymbols$4) {
|
|
29
|
+
for (var prop of __getOwnPropSymbols$4(b)) if (__propIsEnum$4.call(b, prop)) __defNormalProp$4(a, prop, b[prop]);
|
|
30
30
|
}
|
|
31
31
|
return a;
|
|
32
32
|
};
|
|
33
|
-
var __vue_sfc__$
|
|
33
|
+
var __vue_sfc__$9 = /* @__PURE__ */ defineComponent({
|
|
34
34
|
__name: "Frame",
|
|
35
35
|
setup(__props, { expose: __expose }) {
|
|
36
36
|
const iframeRef = ref(null);
|
|
@@ -38,7 +38,7 @@ var __vue_sfc__$7 = /* @__PURE__ */ defineComponent({
|
|
|
38
38
|
function sendMessageToIframe(type, data) {
|
|
39
39
|
var _a;
|
|
40
40
|
if (!((_a = iframeRef.value) == null ? void 0 : _a.contentWindow)) return;
|
|
41
|
-
iframeRef.value.contentWindow.postMessage(__spreadValues$
|
|
41
|
+
iframeRef.value.contentWindow.postMessage(__spreadValues$4({ type }, data), "*");
|
|
42
42
|
}
|
|
43
43
|
onMounted(() => {
|
|
44
44
|
if (iframeRef.value) iframeRef.value.addEventListener("load", () => {
|
|
@@ -65,11 +65,11 @@ var __vue_sfc__$7 = /* @__PURE__ */ defineComponent({
|
|
|
65
65
|
return __returned__;
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
-
var _hoisted_1$
|
|
69
|
-
var _hoisted_2$
|
|
70
|
-
var _hoisted_3$
|
|
71
|
-
function __vue_render__$
|
|
72
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
68
|
+
var _hoisted_1$7 = { class: "opencode-iframe-container" };
|
|
69
|
+
var _hoisted_2$5 = { class: "opencode-empty-state-text" };
|
|
70
|
+
var _hoisted_3$5 = ["src"];
|
|
71
|
+
function __vue_render__$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
72
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
73
73
|
createElementVNode("div", { class: normalizeClass(["opencode-empty-state-overlay", { visible: $setup.showEmptyState }]) }, [renderSlot(_ctx.$slots, "empty-state", {}, () => [
|
|
74
74
|
_cache[1] || (_cache[1] = createElementVNode("div", { class: "opencode-empty-state-icon" }, [createElementVNode("svg", {
|
|
75
75
|
viewBox: "0 0 24 24",
|
|
@@ -84,7 +84,7 @@ function __vue_render__$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
84
84
|
"stroke-linejoin": "round",
|
|
85
85
|
d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 0 1-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"
|
|
86
86
|
})])], -1)),
|
|
87
|
-
createElementVNode("div", _hoisted_2$
|
|
87
|
+
createElementVNode("div", _hoisted_2$5, toDisplayString($setup.emptyStateText), 1),
|
|
88
88
|
createElementVNode("button", {
|
|
89
89
|
class: "opencode-empty-state-btn",
|
|
90
90
|
type: "button",
|
|
@@ -99,18 +99,18 @@ function __vue_render__$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
99
99
|
src: $setup.iframeSrc,
|
|
100
100
|
allow: "clipboard-write; clipboard-read",
|
|
101
101
|
referrerpolicy: "origin"
|
|
102
|
-
}, null, 8, _hoisted_3$
|
|
102
|
+
}, null, 8, _hoisted_3$5)])
|
|
103
103
|
]);
|
|
104
104
|
}
|
|
105
|
-
__vue_sfc__$
|
|
106
|
-
var Frame_vue_default = __vue_sfc__$
|
|
105
|
+
__vue_sfc__$9.render = __vue_render__$9;
|
|
106
|
+
var Frame_vue_default = __vue_sfc__$9;
|
|
107
107
|
//#endregion
|
|
108
108
|
//#region es/open-code-widget/src/components/Header.vue.js
|
|
109
|
-
var __vue_sfc__$
|
|
109
|
+
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, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleClose, handleToggleMinimize, handleTogglePromptDock } = useOpenCodeWidgetContext();
|
|
113
|
+
const { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, minimized, promptDockVisible, mode, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleClose, handleToggleMinimize, handleTogglePromptDock } = useOpenCodeWidgetContext();
|
|
114
114
|
const __returned__ = {
|
|
115
115
|
title,
|
|
116
116
|
sessionListTitle,
|
|
@@ -121,12 +121,14 @@ var __vue_sfc__$6 = /* @__PURE__ */ defineComponent({
|
|
|
121
121
|
resolvedTheme,
|
|
122
122
|
minimized,
|
|
123
123
|
promptDockVisible,
|
|
124
|
+
mode,
|
|
124
125
|
handleToggleSessionList,
|
|
125
126
|
handleToggleSelectMode,
|
|
126
127
|
handleToggleTheme,
|
|
127
128
|
handleClose,
|
|
128
129
|
handleToggleMinimize,
|
|
129
130
|
handleTogglePromptDock,
|
|
131
|
+
isSplitMode: computed(() => mode.value === "split"),
|
|
130
132
|
themeIconTitle: computed(() => {
|
|
131
133
|
return `\u4E3B\u9898: ${{
|
|
132
134
|
auto: "自动",
|
|
@@ -149,16 +151,16 @@ var __vue_sfc__$6 = /* @__PURE__ */ defineComponent({
|
|
|
149
151
|
return __returned__;
|
|
150
152
|
}
|
|
151
153
|
});
|
|
152
|
-
var _hoisted_1$
|
|
153
|
-
var _hoisted_2$
|
|
154
|
-
var _hoisted_3$
|
|
154
|
+
var _hoisted_1$6 = { class: "opencode-chat-header" };
|
|
155
|
+
var _hoisted_2$4 = { class: "opencode-chat-header-left" };
|
|
156
|
+
var _hoisted_3$4 = [
|
|
155
157
|
"title",
|
|
156
158
|
"aria-label",
|
|
157
159
|
"aria-expanded"
|
|
158
160
|
];
|
|
159
|
-
var _hoisted_4$
|
|
160
|
-
var _hoisted_5$
|
|
161
|
-
var _hoisted_6$
|
|
161
|
+
var _hoisted_4$4 = ["aria-pressed", "disabled"];
|
|
162
|
+
var _hoisted_5$4 = ["title", "aria-label"];
|
|
163
|
+
var _hoisted_6$4 = {
|
|
162
164
|
key: 0,
|
|
163
165
|
viewBox: "0 0 24 24",
|
|
164
166
|
width: "16",
|
|
@@ -178,7 +180,7 @@ var _hoisted_7$2 = {
|
|
|
178
180
|
"stroke-width": "2",
|
|
179
181
|
"aria-hidden": "true"
|
|
180
182
|
};
|
|
181
|
-
var _hoisted_8$
|
|
183
|
+
var _hoisted_8$1 = {
|
|
182
184
|
key: 2,
|
|
183
185
|
viewBox: "0 0 24 24",
|
|
184
186
|
width: "16",
|
|
@@ -188,7 +190,7 @@ var _hoisted_8$2 = {
|
|
|
188
190
|
"stroke-width": "2",
|
|
189
191
|
"aria-hidden": "true"
|
|
190
192
|
};
|
|
191
|
-
var _hoisted_9$
|
|
193
|
+
var _hoisted_9$1 = { class: "opencode-chat-header-title" };
|
|
192
194
|
var _hoisted_10$1 = { class: "opencode-chat-header-actions" };
|
|
193
195
|
var _hoisted_11 = [
|
|
194
196
|
"title",
|
|
@@ -220,9 +222,9 @@ var _hoisted_14 = {
|
|
|
220
222
|
"stroke-width": "2",
|
|
221
223
|
"aria-hidden": "true"
|
|
222
224
|
};
|
|
223
|
-
function __vue_render__$
|
|
224
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
225
|
-
createElementVNode("div", _hoisted_2$
|
|
225
|
+
function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
226
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
227
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
226
228
|
createElementVNode("button", {
|
|
227
229
|
class: normalizeClass(["opencode-header-btn session-toggle", { active: !$setup.sessionListCollapsed }]),
|
|
228
230
|
type: "button",
|
|
@@ -241,7 +243,7 @@ function __vue_render__$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
241
243
|
}, [createElementVNode("path", {
|
|
242
244
|
d: "M4 6h16M4 12h16M4 18h16",
|
|
243
245
|
"stroke-linecap": "round"
|
|
244
|
-
})], -1))])], 10, _hoisted_3$
|
|
246
|
+
})], -1))])], 10, _hoisted_3$4),
|
|
245
247
|
createElementVNode("button", {
|
|
246
248
|
class: normalizeClass(["opencode-header-btn select-btn", { active: $setup.selectMode }]),
|
|
247
249
|
type: "button",
|
|
@@ -261,18 +263,19 @@ function __vue_render__$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
261
263
|
}), createElementVNode("path", {
|
|
262
264
|
fill: "currentColor",
|
|
263
265
|
d: "M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32"
|
|
264
|
-
})], -1))])], 10, _hoisted_4$
|
|
266
|
+
})], -1))])], 10, _hoisted_4$4),
|
|
265
267
|
createElementVNode("button", {
|
|
266
268
|
class: "opencode-header-btn theme-btn",
|
|
267
269
|
type: "button",
|
|
268
270
|
title: $setup.themeIconTitle,
|
|
269
271
|
"aria-label": $setup.themeIconLabel,
|
|
270
272
|
onClick: _cache[2] || (_cache[2] = (...args) => $setup.handleToggleTheme && $setup.handleToggleTheme(...args))
|
|
271
|
-
}, [renderSlot(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? (openBlock(), createElementBlock("svg", _hoisted_6$
|
|
273
|
+
}, [renderSlot(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? (openBlock(), createElementBlock("svg", _hoisted_6$4, [..._cache[8] || (_cache[8] = [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$2, [..._cache[9] || (_cache[9] = [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$1, [..._cache[10] || (_cache[10] = [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)
|
|
272
274
|
]),
|
|
273
|
-
createElementVNode("span", _hoisted_9$
|
|
275
|
+
createElementVNode("span", _hoisted_9$1, toDisplayString($setup.title), 1),
|
|
274
276
|
createElementVNode("div", _hoisted_10$1, [
|
|
275
|
-
|
|
277
|
+
!$setup.isSplitMode ? (openBlock(), createElementBlock("button", {
|
|
278
|
+
key: 0,
|
|
276
279
|
class: "opencode-header-btn prompt-dock",
|
|
277
280
|
type: "button",
|
|
278
281
|
title: $setup.promptDockVisible ? "隐藏对话框" : "显示对话框",
|
|
@@ -287,16 +290,18 @@ function __vue_render__$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
287
290
|
stroke: "currentColor",
|
|
288
291
|
"stroke-width": "2",
|
|
289
292
|
"aria-hidden": "true"
|
|
290
|
-
}, [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_11),
|
|
291
|
-
|
|
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, _hoisted_11)) : createCommentVNode("v-if", true),
|
|
294
|
+
!$setup.isSplitMode ? (openBlock(), createElementBlock("button", {
|
|
295
|
+
key: 1,
|
|
292
296
|
class: "opencode-header-btn minimize",
|
|
293
297
|
type: "button",
|
|
294
298
|
title: $setup.minimized ? "展开" : "最小化",
|
|
295
299
|
"aria-label": $setup.minimized ? "展开面板" : "最小化面板",
|
|
296
300
|
"aria-pressed": $setup.minimized,
|
|
297
301
|
onClick: _cache[4] || (_cache[4] = (...args) => $setup.handleToggleMinimize && $setup.handleToggleMinimize(...args))
|
|
298
|
-
}, [renderSlot(_ctx.$slots, "minimize-icon", {}, () => [$setup.minimized ? (openBlock(), createElementBlock("svg", _hoisted_13, [..._cache[12] || (_cache[12] = [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_14, [..._cache[13] || (_cache[13] = [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_12),
|
|
299
|
-
|
|
302
|
+
}, [renderSlot(_ctx.$slots, "minimize-icon", {}, () => [$setup.minimized ? (openBlock(), createElementBlock("svg", _hoisted_13, [..._cache[12] || (_cache[12] = [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_14, [..._cache[13] || (_cache[13] = [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_12)) : createCommentVNode("v-if", true),
|
|
303
|
+
!$setup.isSplitMode ? (openBlock(), createElementBlock("button", {
|
|
304
|
+
key: 2,
|
|
300
305
|
class: "opencode-header-btn close",
|
|
301
306
|
type: "button",
|
|
302
307
|
title: "关闭",
|
|
@@ -310,101 +315,15 @@ function __vue_render__$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
310
315
|
stroke: "currentColor",
|
|
311
316
|
"stroke-width": "2",
|
|
312
317
|
"aria-hidden": "true"
|
|
313
|
-
}, [createElementVNode("path", { d: "M18 6L6 18M6 6l12 12" })], -1))])])
|
|
318
|
+
}, [createElementVNode("path", { d: "M18 6L6 18M6 6l12 12" })], -1))])])) : createCommentVNode("v-if", true)
|
|
314
319
|
])
|
|
315
320
|
]);
|
|
316
321
|
}
|
|
317
|
-
__vue_sfc__$
|
|
318
|
-
var Header_vue_default = __vue_sfc__$
|
|
319
|
-
//#endregion
|
|
320
|
-
//#region es/open-code-widget/src/components/SelectHint.vue.js
|
|
321
|
-
var __vue_sfc__$5 = /* @__PURE__ */ defineComponent({
|
|
322
|
-
__name: "SelectHint",
|
|
323
|
-
setup(__props, { expose: __expose }) {
|
|
324
|
-
__expose();
|
|
325
|
-
const { selectMode: visible, selectShortcutLabel: shortcutLabel } = useOpenCodeWidgetContext();
|
|
326
|
-
const __returned__ = {
|
|
327
|
-
visible,
|
|
328
|
-
shortcutLabel
|
|
329
|
-
};
|
|
330
|
-
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
331
|
-
enumerable: false,
|
|
332
|
-
value: true
|
|
333
|
-
});
|
|
334
|
-
return __returned__;
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
var _hoisted_1$4 = { class: "opencode-hint-shortcut" };
|
|
338
|
-
function __vue_render__$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
339
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(["opencode-select-mode-hint", { visible: $setup.visible }]) }, [_cache[0] || (_cache[0] = createElementVNode("span", null, "🎯 选择模式已开启 - 点击元素进行选择", -1)), createElementVNode("span", _hoisted_1$4, toDisplayString($setup.shortcutLabel), 1)], 2);
|
|
340
|
-
}
|
|
341
|
-
__vue_sfc__$5.render = __vue_render__$5;
|
|
342
|
-
var SelectHint_vue_default = __vue_sfc__$5;
|
|
343
|
-
//#endregion
|
|
344
|
-
//#region es/open-code-widget/src/components/SelectedNodes.vue.js
|
|
345
|
-
var __vue_sfc__$4 = /* @__PURE__ */ defineComponent({
|
|
346
|
-
__name: "SelectedNodes",
|
|
347
|
-
setup(__props, { expose: __expose }) {
|
|
348
|
-
__expose();
|
|
349
|
-
const { selectedElementItems: items, showClearAll, handleClickSelectedNode, handleRemoveSelectedNode, handleClearSelectedNodes } = useOpenCodeWidgetContext();
|
|
350
|
-
const __returned__ = {
|
|
351
|
-
items,
|
|
352
|
-
showClearAll,
|
|
353
|
-
handleClickSelectedNode,
|
|
354
|
-
handleRemoveSelectedNode,
|
|
355
|
-
handleClearSelectedNodes
|
|
356
|
-
};
|
|
357
|
-
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
358
|
-
enumerable: false,
|
|
359
|
-
value: true
|
|
360
|
-
});
|
|
361
|
-
return __returned__;
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
var _hoisted_1$3 = {
|
|
365
|
-
class: "opencode-selected-nodes",
|
|
366
|
-
role: "list",
|
|
367
|
-
"aria-label": "已选元素列表"
|
|
368
|
-
};
|
|
369
|
-
var _hoisted_2$2 = ["onClick"];
|
|
370
|
-
var _hoisted_3$2 = { class: "opencode-node-content" };
|
|
371
|
-
var _hoisted_4$2 = { class: "opencode-node-text" };
|
|
372
|
-
var _hoisted_5$2 = { class: "opencode-node-file" };
|
|
373
|
-
var _hoisted_6$2 = ["aria-label", "onClick"];
|
|
374
|
-
function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
375
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(["opencode-right-toolbar", { collapsed: $setup.items.length === 0 }]) }, [
|
|
376
|
-
_cache[1] || (_cache[1] = createElementVNode("div", { class: "opencode-selected-nodes-header" }, [createElementVNode("div", { class: "opencode-selected-nodes-title" }, "已选节点"), createElementVNode("div", { class: "opencode-selected-nodes-desc" }, "选中的节点会在对话时一起发送给助手")], -1)),
|
|
377
|
-
createElementVNode("div", _hoisted_1$3, [(openBlock(true), createElementBlock(Fragment, null, renderList($setup.items, (item, index) => {
|
|
378
|
-
return openBlock(), createElementBlock("div", {
|
|
379
|
-
key: item.key,
|
|
380
|
-
class: "opencode-selected-node",
|
|
381
|
-
role: "listitem",
|
|
382
|
-
onClick: ($event) => $setup.handleClickSelectedNode(item)
|
|
383
|
-
}, [createElementVNode("div", _hoisted_3$2, [createElementVNode("span", _hoisted_4$2, toDisplayString(item.description), 1), createElementVNode("span", _hoisted_5$2, toDisplayString(item.panelFileText), 1)]), createElementVNode("button", {
|
|
384
|
-
class: "opencode-node-remove",
|
|
385
|
-
type: "button",
|
|
386
|
-
"aria-label": `\u79FB\u9664\u5143\u7D20: ${item.description}`,
|
|
387
|
-
onClick: withModifiers(($event) => $setup.handleRemoveSelectedNode({
|
|
388
|
-
item,
|
|
389
|
-
index,
|
|
390
|
-
source: "panel"
|
|
391
|
-
}), ["stop"])
|
|
392
|
-
}, " × ", 8, _hoisted_6$2)], 8, _hoisted_2$2);
|
|
393
|
-
}), 128))]),
|
|
394
|
-
$setup.showClearAll && $setup.items.length > 0 ? (openBlock(), createElementBlock("button", {
|
|
395
|
-
key: 0,
|
|
396
|
-
class: "opencode-clear-all-btn",
|
|
397
|
-
type: "button",
|
|
398
|
-
"aria-label": "清空所有已选节点",
|
|
399
|
-
onClick: _cache[0] || (_cache[0] = (...args) => $setup.handleClearSelectedNodes && $setup.handleClearSelectedNodes(...args))
|
|
400
|
-
}, " 一键清空 ")) : createCommentVNode("v-if", true)
|
|
401
|
-
], 2);
|
|
402
|
-
}
|
|
403
|
-
__vue_sfc__$4.render = __vue_render__$4;
|
|
404
|
-
var SelectedNodes_vue_default = __vue_sfc__$4;
|
|
322
|
+
__vue_sfc__$8.render = __vue_render__$8;
|
|
323
|
+
var Header_vue_default = __vue_sfc__$8;
|
|
405
324
|
//#endregion
|
|
406
325
|
//#region es/open-code-widget/src/components/SessionList.vue.js
|
|
407
|
-
var __vue_sfc__$
|
|
326
|
+
var __vue_sfc__$7 = /* @__PURE__ */ defineComponent({
|
|
408
327
|
__name: "SessionList",
|
|
409
328
|
setup(__props, { expose: __expose }) {
|
|
410
329
|
__expose();
|
|
@@ -455,36 +374,36 @@ var __vue_sfc__$3 = /* @__PURE__ */ defineComponent({
|
|
|
455
374
|
return __returned__;
|
|
456
375
|
}
|
|
457
376
|
});
|
|
458
|
-
var _hoisted_1$
|
|
377
|
+
var _hoisted_1$5 = {
|
|
459
378
|
key: 0,
|
|
460
379
|
class: "opencode-session-list-header"
|
|
461
380
|
};
|
|
462
|
-
var _hoisted_2$
|
|
381
|
+
var _hoisted_2$3 = {
|
|
463
382
|
key: 2,
|
|
464
383
|
class: "opencode-session-skeleton visible"
|
|
465
384
|
};
|
|
466
|
-
var _hoisted_3$
|
|
385
|
+
var _hoisted_3$3 = {
|
|
467
386
|
class: "opencode-session-list-content",
|
|
468
387
|
role: "listbox",
|
|
469
388
|
"aria-labelledby": "opencode-session-list-title"
|
|
470
389
|
};
|
|
471
|
-
var _hoisted_4$
|
|
390
|
+
var _hoisted_4$3 = {
|
|
472
391
|
key: 0,
|
|
473
392
|
class: "opencode-session-list-loading-overlay"
|
|
474
393
|
};
|
|
475
|
-
var _hoisted_5$
|
|
476
|
-
var _hoisted_6$
|
|
394
|
+
var _hoisted_5$3 = ["aria-selected", "onClick"];
|
|
395
|
+
var _hoisted_6$3 = { class: "opencode-session-header" };
|
|
477
396
|
var _hoisted_7$1 = { class: "opencode-session-title" };
|
|
478
|
-
var _hoisted_8
|
|
397
|
+
var _hoisted_8 = {
|
|
479
398
|
key: 0,
|
|
480
399
|
class: "opencode-thinking-loading"
|
|
481
400
|
};
|
|
482
|
-
var _hoisted_9
|
|
401
|
+
var _hoisted_9 = ["aria-label", "onClick"];
|
|
483
402
|
var _hoisted_10 = { class: "opencode-session-meta" };
|
|
484
|
-
function __vue_render__$
|
|
403
|
+
function __vue_render__$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
485
404
|
return openBlock(), createElementBlock("div", { class: normalizeClass(["opencode-session-list", { collapsed: $setup.collapsed }]) }, [
|
|
486
405
|
createCommentVNode(" Header "),
|
|
487
|
-
!$setup.showSkeleton ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
406
|
+
!$setup.showSkeleton ? (openBlock(), createElementBlock("div", _hoisted_1$5, [_cache[1] || (_cache[1] = createElementVNode("span", { id: "opencode-session-list-title" }, "会话列表", -1)), createElementVNode("button", {
|
|
488
407
|
class: "opencode-new-session-btn",
|
|
489
408
|
type: "button",
|
|
490
409
|
title: "新建会话",
|
|
@@ -492,12 +411,12 @@ function __vue_render__$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
492
411
|
onClick: _cache[0] || (_cache[0] = (...args) => $setup.handleCreateSession && $setup.handleCreateSession(...args))
|
|
493
412
|
}, " + ")])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Header Skeleton "), _cache[2] || (_cache[2] = createElementVNode("div", { class: "opencode-session-header-skeleton visible" }, [createElementVNode("div", { class: "opencode-skeleton-header-title" }), createElementVNode("div", { class: "opencode-skeleton-header-btn" })], -1))], 2112)),
|
|
494
413
|
createCommentVNode(" Content Skeleton "),
|
|
495
|
-
$setup.showSkeleton ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
414
|
+
$setup.showSkeleton ? (openBlock(), createElementBlock("div", _hoisted_2$3, [(openBlock(), createElementBlock(Fragment, null, renderList(5, (i) => {
|
|
496
415
|
return createElementVNode("div", {
|
|
497
416
|
key: `skeleton-${i}`,
|
|
498
417
|
class: "opencode-skeleton-item"
|
|
499
418
|
}, [..._cache[3] || (_cache[3] = [createElementVNode("div", { class: "opencode-skeleton-title" }, null, -1), createElementVNode("div", { class: "opencode-skeleton-meta" }, null, -1)])]);
|
|
500
|
-
}), 64))])) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [createCommentVNode(" Content "), createElementVNode("div", _hoisted_3$
|
|
419
|
+
}), 64))])) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [createCommentVNode(" Content "), createElementVNode("div", _hoisted_3$3, [$setup.loadingSessionList ? (openBlock(), createElementBlock("div", _hoisted_4$3, [..._cache[4] || (_cache[4] = [createElementVNode("div", { class: "opencode-loading-spinner small" }, null, -1)])])) : createCommentVNode("v-if", true), $setup.sessions.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList($setup.sessions, (item) => {
|
|
501
420
|
return openBlock(), createElementBlock("div", {
|
|
502
421
|
key: item[$setup.sessionKey],
|
|
503
422
|
class: normalizeClass(["opencode-session-item", {
|
|
@@ -507,17 +426,503 @@ function __vue_render__$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
507
426
|
role: "option",
|
|
508
427
|
"aria-selected": item.active,
|
|
509
428
|
onClick: ($event) => $setup.handleSelectSession(item)
|
|
510
|
-
}, [createElementVNode("div", _hoisted_6$
|
|
429
|
+
}, [createElementVNode("div", _hoisted_6$3, [createElementVNode("div", _hoisted_7$1, [$setup.isSessionThinking(item.id) ? (openBlock(), createElementBlock("span", _hoisted_8)) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(item.title), 1)]), createElementVNode("button", {
|
|
511
430
|
class: "opencode-session-delete-btn",
|
|
512
431
|
type: "button",
|
|
513
432
|
"aria-label": `\u5220\u9664\u4F1A\u8BDD: ${item.title}`,
|
|
514
433
|
onClick: withModifiers(($event) => $setup.handleDeleteSession(item), ["stop"])
|
|
515
|
-
}, " × ", 8, _hoisted_9
|
|
434
|
+
}, " × ", 8, _hoisted_9)]), createElementVNode("div", _hoisted_10, toDisplayString(item.meta), 1)], 10, _hoisted_5$3);
|
|
516
435
|
}), 128)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode(" Empty State "), renderSlot(_ctx.$slots, "empty")], 64))])], 2112))
|
|
517
436
|
], 2);
|
|
518
437
|
}
|
|
438
|
+
__vue_sfc__$7.render = __vue_render__$7;
|
|
439
|
+
var SessionList_vue_default = __vue_sfc__$7;
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region es/open-code-widget/src/components/SelectedNodes.vue.js
|
|
442
|
+
var __vue_sfc__$6 = /* @__PURE__ */ defineComponent({
|
|
443
|
+
__name: "SelectedNodes",
|
|
444
|
+
setup(__props, { expose: __expose }) {
|
|
445
|
+
__expose();
|
|
446
|
+
const { selectedElementItems: items, showClearAll, handleClickSelectedNode, handleRemoveSelectedNode, handleClearSelectedNodes } = useOpenCodeWidgetContext();
|
|
447
|
+
const __returned__ = {
|
|
448
|
+
items,
|
|
449
|
+
showClearAll,
|
|
450
|
+
handleClickSelectedNode,
|
|
451
|
+
handleRemoveSelectedNode,
|
|
452
|
+
handleClearSelectedNodes
|
|
453
|
+
};
|
|
454
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
455
|
+
enumerable: false,
|
|
456
|
+
value: true
|
|
457
|
+
});
|
|
458
|
+
return __returned__;
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
var _hoisted_1$4 = {
|
|
462
|
+
class: "opencode-selected-nodes",
|
|
463
|
+
role: "list",
|
|
464
|
+
"aria-label": "已选元素列表"
|
|
465
|
+
};
|
|
466
|
+
var _hoisted_2$2 = ["onClick"];
|
|
467
|
+
var _hoisted_3$2 = { class: "opencode-node-content" };
|
|
468
|
+
var _hoisted_4$2 = { class: "opencode-node-text" };
|
|
469
|
+
var _hoisted_5$2 = { class: "opencode-node-file" };
|
|
470
|
+
var _hoisted_6$2 = ["aria-label", "onClick"];
|
|
471
|
+
function __vue_render__$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
472
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(["opencode-right-toolbar", { collapsed: $setup.items.length === 0 }]) }, [
|
|
473
|
+
_cache[1] || (_cache[1] = createElementVNode("div", { class: "opencode-selected-nodes-header" }, [createElementVNode("div", { class: "opencode-selected-nodes-title" }, "已选节点"), createElementVNode("div", { class: "opencode-selected-nodes-desc" }, "选中的节点会在对话时一起发送给助手")], -1)),
|
|
474
|
+
createElementVNode("div", _hoisted_1$4, [(openBlock(true), createElementBlock(Fragment, null, renderList($setup.items, (item, index) => {
|
|
475
|
+
return openBlock(), createElementBlock("div", {
|
|
476
|
+
key: item.key,
|
|
477
|
+
class: "opencode-selected-node",
|
|
478
|
+
role: "listitem",
|
|
479
|
+
onClick: ($event) => $setup.handleClickSelectedNode(item)
|
|
480
|
+
}, [createElementVNode("div", _hoisted_3$2, [createElementVNode("span", _hoisted_4$2, toDisplayString(item.description), 1), createElementVNode("span", _hoisted_5$2, toDisplayString(item.panelFileText), 1)]), createElementVNode("button", {
|
|
481
|
+
class: "opencode-node-remove",
|
|
482
|
+
type: "button",
|
|
483
|
+
"aria-label": `\u79FB\u9664\u5143\u7D20: ${item.description}`,
|
|
484
|
+
onClick: withModifiers(($event) => $setup.handleRemoveSelectedNode({
|
|
485
|
+
item,
|
|
486
|
+
index,
|
|
487
|
+
source: "panel"
|
|
488
|
+
}), ["stop"])
|
|
489
|
+
}, " × ", 8, _hoisted_6$2)], 8, _hoisted_2$2);
|
|
490
|
+
}), 128))]),
|
|
491
|
+
$setup.showClearAll && $setup.items.length > 0 ? (openBlock(), createElementBlock("button", {
|
|
492
|
+
key: 0,
|
|
493
|
+
class: "opencode-clear-all-btn",
|
|
494
|
+
type: "button",
|
|
495
|
+
"aria-label": "清空所有已选节点",
|
|
496
|
+
onClick: _cache[0] || (_cache[0] = (...args) => $setup.handleClearSelectedNodes && $setup.handleClearSelectedNodes(...args))
|
|
497
|
+
}, " 一键清空 ")) : createCommentVNode("v-if", true)
|
|
498
|
+
], 2);
|
|
499
|
+
}
|
|
500
|
+
__vue_sfc__$6.render = __vue_render__$6;
|
|
501
|
+
var SelectedNodes_vue_default = __vue_sfc__$6;
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region es/open-code-widget/src/components/ResizeHandle.vue.js
|
|
504
|
+
var __defProp$3 = Object.defineProperty;
|
|
505
|
+
var __defProps$3 = Object.defineProperties;
|
|
506
|
+
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
507
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
508
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
509
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
510
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
|
|
511
|
+
enumerable: true,
|
|
512
|
+
configurable: true,
|
|
513
|
+
writable: true,
|
|
514
|
+
value
|
|
515
|
+
}) : obj[key] = value;
|
|
516
|
+
var __spreadValues$3 = (a, b) => {
|
|
517
|
+
for (var prop in b || (b = {})) if (__hasOwnProp$3.call(b, prop)) __defNormalProp$3(a, prop, b[prop]);
|
|
518
|
+
if (__getOwnPropSymbols$3) {
|
|
519
|
+
for (var prop of __getOwnPropSymbols$3(b)) if (__propIsEnum$3.call(b, prop)) __defNormalProp$3(a, prop, b[prop]);
|
|
520
|
+
}
|
|
521
|
+
return a;
|
|
522
|
+
};
|
|
523
|
+
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
524
|
+
var __vue_sfc__$5 = /* @__PURE__ */ defineComponent(__spreadProps$3(__spreadValues$3({}, { name: "ResizeHandle" }), {
|
|
525
|
+
__name: "ResizeHandle",
|
|
526
|
+
props: {
|
|
527
|
+
width: {
|
|
528
|
+
type: Number,
|
|
529
|
+
required: true,
|
|
530
|
+
default: 500
|
|
531
|
+
},
|
|
532
|
+
minWidth: {
|
|
533
|
+
type: Number,
|
|
534
|
+
required: false,
|
|
535
|
+
default: 400
|
|
536
|
+
},
|
|
537
|
+
maxWidth: {
|
|
538
|
+
type: Number,
|
|
539
|
+
required: false,
|
|
540
|
+
default: 800
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
emits: [
|
|
544
|
+
"resize",
|
|
545
|
+
"resize-start",
|
|
546
|
+
"resize-end"
|
|
547
|
+
],
|
|
548
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
549
|
+
__expose();
|
|
550
|
+
const props = __props;
|
|
551
|
+
const emit = __emit;
|
|
552
|
+
const isResizing = ref(false);
|
|
553
|
+
const startX = ref(0);
|
|
554
|
+
const startWidth = ref(0);
|
|
555
|
+
const handleMouseDown = (e) => {
|
|
556
|
+
e.preventDefault();
|
|
557
|
+
isResizing.value = true;
|
|
558
|
+
startX.value = e.clientX;
|
|
559
|
+
startWidth.value = props.width;
|
|
560
|
+
emit("resize-start");
|
|
561
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
562
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
563
|
+
};
|
|
564
|
+
const handleMouseMove = (e) => {
|
|
565
|
+
if (!isResizing.value) return;
|
|
566
|
+
const deltaX = startX.value - e.clientX;
|
|
567
|
+
emit("resize", Math.max(props.minWidth, Math.min(props.maxWidth, startWidth.value + deltaX)));
|
|
568
|
+
};
|
|
569
|
+
const handleMouseUp = () => {
|
|
570
|
+
isResizing.value = false;
|
|
571
|
+
emit("resize-end");
|
|
572
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
573
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
574
|
+
};
|
|
575
|
+
const handleDoubleClick = () => {
|
|
576
|
+
emit("resize", 500);
|
|
577
|
+
};
|
|
578
|
+
onUnmounted(() => {
|
|
579
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
580
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
581
|
+
});
|
|
582
|
+
const __returned__ = {
|
|
583
|
+
props,
|
|
584
|
+
emit,
|
|
585
|
+
isResizing,
|
|
586
|
+
startX,
|
|
587
|
+
startWidth,
|
|
588
|
+
handleMouseDown,
|
|
589
|
+
handleMouseMove,
|
|
590
|
+
handleMouseUp,
|
|
591
|
+
handleDoubleClick
|
|
592
|
+
};
|
|
593
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
594
|
+
enumerable: false,
|
|
595
|
+
value: true
|
|
596
|
+
});
|
|
597
|
+
return __returned__;
|
|
598
|
+
}
|
|
599
|
+
}));
|
|
600
|
+
function __vue_render__$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
601
|
+
return openBlock(), createElementBlock("div", {
|
|
602
|
+
class: normalizeClass(["opencode-resize-handle", { resizing: $setup.isResizing }]),
|
|
603
|
+
onMousedown: $setup.handleMouseDown,
|
|
604
|
+
onDblclick: $setup.handleDoubleClick
|
|
605
|
+
}, null, 34);
|
|
606
|
+
}
|
|
607
|
+
__vue_sfc__$5.render = __vue_render__$5;
|
|
608
|
+
var ResizeHandle_vue_default = __vue_sfc__$5;
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region es/open-code-widget/src/components/ChatPanel.vue.js
|
|
611
|
+
var __defProp$2 = Object.defineProperty;
|
|
612
|
+
var __defProps$2 = Object.defineProperties;
|
|
613
|
+
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
614
|
+
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
615
|
+
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
616
|
+
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
617
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, {
|
|
618
|
+
enumerable: true,
|
|
619
|
+
configurable: true,
|
|
620
|
+
writable: true,
|
|
621
|
+
value
|
|
622
|
+
}) : obj[key] = value;
|
|
623
|
+
var __spreadValues$2 = (a, b) => {
|
|
624
|
+
for (var prop in b || (b = {})) if (__hasOwnProp$2.call(b, prop)) __defNormalProp$2(a, prop, b[prop]);
|
|
625
|
+
if (__getOwnPropSymbols$2) {
|
|
626
|
+
for (var prop of __getOwnPropSymbols$2(b)) if (__propIsEnum$2.call(b, prop)) __defNormalProp$2(a, prop, b[prop]);
|
|
627
|
+
}
|
|
628
|
+
return a;
|
|
629
|
+
};
|
|
630
|
+
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
631
|
+
var __vue_sfc__$4 = /* @__PURE__ */ defineComponent(__spreadProps$2(__spreadValues$2({}, { name: "ChatPanel" }), {
|
|
632
|
+
__name: "ChatPanel",
|
|
633
|
+
props: {
|
|
634
|
+
mode: {
|
|
635
|
+
type: String,
|
|
636
|
+
required: false,
|
|
637
|
+
default: "bubble"
|
|
638
|
+
},
|
|
639
|
+
open: {
|
|
640
|
+
type: Boolean,
|
|
641
|
+
required: false,
|
|
642
|
+
default: false
|
|
643
|
+
},
|
|
644
|
+
minimized: {
|
|
645
|
+
type: Boolean,
|
|
646
|
+
required: false,
|
|
647
|
+
default: false
|
|
648
|
+
},
|
|
649
|
+
positionStyle: {
|
|
650
|
+
type: Object,
|
|
651
|
+
required: false,
|
|
652
|
+
default: () => ({})
|
|
653
|
+
},
|
|
654
|
+
animationOrigin: {
|
|
655
|
+
type: Object,
|
|
656
|
+
required: false,
|
|
657
|
+
default: () => ({
|
|
658
|
+
x: "20px",
|
|
659
|
+
y: "20px"
|
|
660
|
+
})
|
|
661
|
+
},
|
|
662
|
+
panelWidth: {
|
|
663
|
+
type: Number,
|
|
664
|
+
required: false,
|
|
665
|
+
default: 500
|
|
666
|
+
},
|
|
667
|
+
resizable: {
|
|
668
|
+
type: Boolean,
|
|
669
|
+
required: false,
|
|
670
|
+
default: true
|
|
671
|
+
},
|
|
672
|
+
minWidth: {
|
|
673
|
+
type: Number,
|
|
674
|
+
required: false,
|
|
675
|
+
default: 400
|
|
676
|
+
},
|
|
677
|
+
maxWidth: {
|
|
678
|
+
type: Number,
|
|
679
|
+
required: false,
|
|
680
|
+
default: 800
|
|
681
|
+
},
|
|
682
|
+
noTransition: {
|
|
683
|
+
type: Boolean,
|
|
684
|
+
required: false,
|
|
685
|
+
default: false
|
|
686
|
+
},
|
|
687
|
+
dragging: {
|
|
688
|
+
type: Boolean,
|
|
689
|
+
required: false,
|
|
690
|
+
default: false
|
|
691
|
+
},
|
|
692
|
+
notificationVisible: {
|
|
693
|
+
type: Boolean,
|
|
694
|
+
required: false,
|
|
695
|
+
default: false
|
|
696
|
+
},
|
|
697
|
+
notificationMessage: {
|
|
698
|
+
type: String,
|
|
699
|
+
required: false,
|
|
700
|
+
default: ""
|
|
701
|
+
},
|
|
702
|
+
notificationMode: {
|
|
703
|
+
type: String,
|
|
704
|
+
required: false,
|
|
705
|
+
default: "widget"
|
|
706
|
+
},
|
|
707
|
+
thinking: {
|
|
708
|
+
type: Boolean,
|
|
709
|
+
required: false,
|
|
710
|
+
default: false
|
|
711
|
+
},
|
|
712
|
+
resolvedTheme: {
|
|
713
|
+
type: String,
|
|
714
|
+
required: false,
|
|
715
|
+
default: "light"
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
emits: [
|
|
719
|
+
"resize",
|
|
720
|
+
"resize-start",
|
|
721
|
+
"resize-end",
|
|
722
|
+
"toggle"
|
|
723
|
+
],
|
|
724
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
725
|
+
useCssVars((_ctx) => ({
|
|
726
|
+
"-animationOrigin.x": _ctx.animationOrigin.x,
|
|
727
|
+
"-animationOrigin.y": _ctx.animationOrigin.y
|
|
728
|
+
}));
|
|
729
|
+
const props = __props;
|
|
730
|
+
const emit = __emit;
|
|
731
|
+
const slots = useSlots();
|
|
732
|
+
const frameRef = ref(null);
|
|
733
|
+
const sendMessageToIframe = (type, data) => {
|
|
734
|
+
var _a;
|
|
735
|
+
(_a = frameRef.value) == null || _a.sendMessageToIframe(type, data);
|
|
736
|
+
};
|
|
737
|
+
__expose({
|
|
738
|
+
sendMessageToIframe,
|
|
739
|
+
frameRef
|
|
740
|
+
});
|
|
741
|
+
const handleResizeStart = () => {
|
|
742
|
+
emit("resize-start");
|
|
743
|
+
};
|
|
744
|
+
const handleResize = (width) => {
|
|
745
|
+
emit("resize", width);
|
|
746
|
+
};
|
|
747
|
+
const handleResizeEnd = () => {
|
|
748
|
+
emit("resize-end");
|
|
749
|
+
};
|
|
750
|
+
const handleToggle = () => {
|
|
751
|
+
emit("toggle");
|
|
752
|
+
};
|
|
753
|
+
const __returned__ = {
|
|
754
|
+
props,
|
|
755
|
+
emit,
|
|
756
|
+
slots,
|
|
757
|
+
frameRef,
|
|
758
|
+
sendMessageToIframe,
|
|
759
|
+
handleResizeStart,
|
|
760
|
+
handleResize,
|
|
761
|
+
handleResizeEnd,
|
|
762
|
+
handleToggle,
|
|
763
|
+
panelStyle: computed(() => {
|
|
764
|
+
if (props.mode === "split") return { width: `${props.panelWidth}px` };
|
|
765
|
+
return props.positionStyle;
|
|
766
|
+
}),
|
|
767
|
+
panelClasses: computed(() => ["opencode-chat", {
|
|
768
|
+
open: props.open,
|
|
769
|
+
minimized: props.minimized,
|
|
770
|
+
dragging: props.dragging,
|
|
771
|
+
"no-transition": props.noTransition,
|
|
772
|
+
"split-mode": props.mode === "split"
|
|
773
|
+
}]),
|
|
774
|
+
Frame: Frame_vue_default,
|
|
775
|
+
Header: Header_vue_default,
|
|
776
|
+
SessionList: SessionList_vue_default,
|
|
777
|
+
SelectedNodes: SelectedNodes_vue_default,
|
|
778
|
+
ResizeHandle: ResizeHandle_vue_default
|
|
779
|
+
};
|
|
780
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
781
|
+
enumerable: false,
|
|
782
|
+
value: true
|
|
783
|
+
});
|
|
784
|
+
return __returned__;
|
|
785
|
+
}
|
|
786
|
+
}));
|
|
787
|
+
var _hoisted_1$3 = ["aria-expanded"];
|
|
788
|
+
var _hoisted_2$1 = { class: "opencode-split-toggle-icon" };
|
|
789
|
+
var _hoisted_3$1 = {
|
|
790
|
+
key: 0,
|
|
791
|
+
viewBox: "0 0 24 24",
|
|
792
|
+
width: "16",
|
|
793
|
+
height: "16",
|
|
794
|
+
fill: "none",
|
|
795
|
+
stroke: "currentColor",
|
|
796
|
+
"stroke-width": "2"
|
|
797
|
+
};
|
|
798
|
+
var _hoisted_4$1 = {
|
|
799
|
+
key: 1,
|
|
800
|
+
viewBox: "0 0 24 24",
|
|
801
|
+
width: "16",
|
|
802
|
+
height: "16",
|
|
803
|
+
fill: "none",
|
|
804
|
+
stroke: "currentColor",
|
|
805
|
+
"stroke-width": "2"
|
|
806
|
+
};
|
|
807
|
+
var _hoisted_5$1 = {
|
|
808
|
+
key: 2,
|
|
809
|
+
class: "opencode-notification",
|
|
810
|
+
role: "alert"
|
|
811
|
+
};
|
|
812
|
+
var _hoisted_6$1 = { class: "opencode-chat-content" };
|
|
813
|
+
function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
814
|
+
return openBlock(), createElementBlock("div", {
|
|
815
|
+
class: normalizeClass($setup.panelClasses),
|
|
816
|
+
style: normalizeStyle($setup.panelStyle)
|
|
817
|
+
}, [
|
|
818
|
+
$props.mode === "split" && $props.resizable && $props.open ? (openBlock(), createBlock($setup["ResizeHandle"], {
|
|
819
|
+
key: 0,
|
|
820
|
+
width: $props.panelWidth,
|
|
821
|
+
"min-width": $props.minWidth,
|
|
822
|
+
"max-width": $props.maxWidth,
|
|
823
|
+
onResize: $setup.handleResize,
|
|
824
|
+
onResizeStart: $setup.handleResizeStart,
|
|
825
|
+
onResizeEnd: $setup.handleResizeEnd
|
|
826
|
+
}, null, 8, [
|
|
827
|
+
"width",
|
|
828
|
+
"min-width",
|
|
829
|
+
"max-width"
|
|
830
|
+
])) : createCommentVNode("v-if", true),
|
|
831
|
+
$props.mode === "split" ? (openBlock(), createElementBlock("button", {
|
|
832
|
+
key: 1,
|
|
833
|
+
type: "button",
|
|
834
|
+
class: normalizeClass(["opencode-split-toggle-btn", {
|
|
835
|
+
open: $setup.props.open,
|
|
836
|
+
thinking: $setup.props.thinking,
|
|
837
|
+
"opencode-theme-dark": $props.resolvedTheme === "dark"
|
|
838
|
+
}]),
|
|
839
|
+
"aria-expanded": $props.open,
|
|
840
|
+
"aria-label": "切换面板",
|
|
841
|
+
onClick: $setup.handleToggle
|
|
842
|
+
}, [createElementVNode("span", _hoisted_2$1, [$props.open ? (openBlock(), createElementBlock("svg", _hoisted_3$1, [..._cache[0] || (_cache[0] = [createElementVNode("path", {
|
|
843
|
+
d: "M9 18l6-6-6-6",
|
|
844
|
+
"stroke-linecap": "round",
|
|
845
|
+
"stroke-linejoin": "round"
|
|
846
|
+
}, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_4$1, [..._cache[1] || (_cache[1] = [createElementVNode("path", {
|
|
847
|
+
d: "M15 18l-6-6 6-6",
|
|
848
|
+
"stroke-linecap": "round",
|
|
849
|
+
"stroke-linejoin": "round"
|
|
850
|
+
}, null, -1)])]))])], 10, _hoisted_1$3)) : createCommentVNode("v-if", true),
|
|
851
|
+
createVNode($setup["Header"], null, createSlots({ _: 2 }, [
|
|
852
|
+
$setup.slots["session-toggle-icon"] ? {
|
|
853
|
+
name: "session-toggle-icon",
|
|
854
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "session-toggle-icon")]),
|
|
855
|
+
key: "0"
|
|
856
|
+
} : void 0,
|
|
857
|
+
$setup.slots["select-icon"] ? {
|
|
858
|
+
name: "select-icon",
|
|
859
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "select-icon")]),
|
|
860
|
+
key: "1"
|
|
861
|
+
} : void 0,
|
|
862
|
+
$setup.slots["close-icon"] ? {
|
|
863
|
+
name: "close-icon",
|
|
864
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "close-icon")]),
|
|
865
|
+
key: "2"
|
|
866
|
+
} : void 0
|
|
867
|
+
]), 1024),
|
|
868
|
+
$props.notificationVisible && $props.notificationMode === "widget" ? (openBlock(), createElementBlock("div", _hoisted_5$1, toDisplayString($props.notificationMessage), 1)) : createCommentVNode("v-if", true),
|
|
869
|
+
createElementVNode("div", _hoisted_6$1, [
|
|
870
|
+
createVNode($setup["SessionList"], null, {
|
|
871
|
+
empty: withCtx(() => [renderSlot(_ctx.$slots, "sessions-empty", {}, () => [_cache[2] || (_cache[2] = createElementVNode("div", { class: "opencode-session-empty" }, "暂无会话", -1))])]),
|
|
872
|
+
_: 3
|
|
873
|
+
}),
|
|
874
|
+
createVNode($setup["Frame"], { ref: "frameRef" }, createSlots({ _: 2 }, [
|
|
875
|
+
$setup.slots["empty-state"] ? {
|
|
876
|
+
name: "empty-state",
|
|
877
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "empty-state")]),
|
|
878
|
+
key: "0"
|
|
879
|
+
} : void 0,
|
|
880
|
+
$setup.slots.loading ? {
|
|
881
|
+
name: "loading",
|
|
882
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "loading")]),
|
|
883
|
+
key: "1"
|
|
884
|
+
} : void 0,
|
|
885
|
+
$setup.slots.error ? {
|
|
886
|
+
name: "error",
|
|
887
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "error")]),
|
|
888
|
+
key: "2"
|
|
889
|
+
} : void 0,
|
|
890
|
+
$setup.slots.content ? {
|
|
891
|
+
name: "content",
|
|
892
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "content")]),
|
|
893
|
+
key: "3"
|
|
894
|
+
} : void 0
|
|
895
|
+
]), 1536),
|
|
896
|
+
createVNode($setup["SelectedNodes"])
|
|
897
|
+
])
|
|
898
|
+
], 6);
|
|
899
|
+
}
|
|
900
|
+
__vue_sfc__$4.render = __vue_render__$4;
|
|
901
|
+
var ChatPanel_vue_default = __vue_sfc__$4;
|
|
902
|
+
//#endregion
|
|
903
|
+
//#region es/open-code-widget/src/components/SelectHint.vue.js
|
|
904
|
+
var __vue_sfc__$3 = /* @__PURE__ */ defineComponent({
|
|
905
|
+
__name: "SelectHint",
|
|
906
|
+
setup(__props, { expose: __expose }) {
|
|
907
|
+
__expose();
|
|
908
|
+
const { selectMode: visible, selectShortcutLabel: shortcutLabel } = useOpenCodeWidgetContext();
|
|
909
|
+
const __returned__ = {
|
|
910
|
+
visible,
|
|
911
|
+
shortcutLabel
|
|
912
|
+
};
|
|
913
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
914
|
+
enumerable: false,
|
|
915
|
+
value: true
|
|
916
|
+
});
|
|
917
|
+
return __returned__;
|
|
918
|
+
}
|
|
919
|
+
});
|
|
920
|
+
var _hoisted_1$2 = { class: "opencode-hint-shortcut" };
|
|
921
|
+
function __vue_render__$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
922
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(["opencode-select-mode-hint", { visible: $setup.visible }]) }, [_cache[0] || (_cache[0] = createElementVNode("span", null, "🎯 选择模式已开启 - 点击元素进行选择", -1)), createElementVNode("span", _hoisted_1$2, toDisplayString($setup.shortcutLabel), 1)], 2);
|
|
923
|
+
}
|
|
519
924
|
__vue_sfc__$3.render = __vue_render__$3;
|
|
520
|
-
var
|
|
925
|
+
var SelectHint_vue_default = __vue_sfc__$3;
|
|
521
926
|
//#endregion
|
|
522
927
|
//#region es/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.js
|
|
523
928
|
var __defProp$1 = Object.defineProperty;
|
|
@@ -1552,27 +1957,33 @@ function usePersistState(options) {
|
|
|
1552
1957
|
if (options.onRestore) options.onRestore(saved || {});
|
|
1553
1958
|
return saved;
|
|
1554
1959
|
};
|
|
1555
|
-
const getCurrentState = () =>
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1960
|
+
const getCurrentState = () => {
|
|
1961
|
+
var _a;
|
|
1962
|
+
return {
|
|
1963
|
+
open: options.open.value,
|
|
1964
|
+
minimized: options.minimized.value,
|
|
1965
|
+
promptDockVisible: options.promptDockVisible.value,
|
|
1966
|
+
bubbleOffset: options.bubbleOffset.value,
|
|
1967
|
+
theme: options.theme.value,
|
|
1968
|
+
sessionListCollapsed: options.sessionListCollapsed.value,
|
|
1969
|
+
splitPanelWidth: (_a = options.splitPanelWidth) == null ? void 0 : _a.value
|
|
1970
|
+
};
|
|
1971
|
+
};
|
|
1563
1972
|
const persistState = () => {
|
|
1564
1973
|
saveState(getCurrentState());
|
|
1565
1974
|
};
|
|
1975
|
+
const watchers = [
|
|
1976
|
+
options.open,
|
|
1977
|
+
options.minimized,
|
|
1978
|
+
options.promptDockVisible,
|
|
1979
|
+
options.bubbleOffset,
|
|
1980
|
+
options.theme,
|
|
1981
|
+
options.sessionListCollapsed
|
|
1982
|
+
];
|
|
1983
|
+
if (options.splitPanelWidth) watchers.push(options.splitPanelWidth);
|
|
1566
1984
|
onMounted(() => {
|
|
1567
1985
|
restoreState();
|
|
1568
|
-
watch(
|
|
1569
|
-
options.open,
|
|
1570
|
-
options.minimized,
|
|
1571
|
-
options.promptDockVisible,
|
|
1572
|
-
options.bubbleOffset,
|
|
1573
|
-
options.theme,
|
|
1574
|
-
options.sessionListCollapsed
|
|
1575
|
-
], () => {
|
|
1986
|
+
watch(watchers, () => {
|
|
1576
1987
|
persistState();
|
|
1577
1988
|
}, { deep: true });
|
|
1578
1989
|
});
|
|
@@ -1582,6 +1993,85 @@ function usePersistState(options) {
|
|
|
1582
1993
|
};
|
|
1583
1994
|
}
|
|
1584
1995
|
//#endregion
|
|
1996
|
+
//#region es/open-code-widget/composables/use-split.js
|
|
1997
|
+
var AUTO_MODE_THRESHOLD = 1440;
|
|
1998
|
+
function useSplitMode(options) {
|
|
1999
|
+
const windowWidth = ref(typeof window !== "undefined" ? window.innerWidth : 0);
|
|
2000
|
+
const splitConfig = computed(() => {
|
|
2001
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2002
|
+
const config = options.splitMode.value || {};
|
|
2003
|
+
return {
|
|
2004
|
+
width: (_a = config.width) != null ? _a : 500,
|
|
2005
|
+
minWidth: (_b = config.minWidth) != null ? _b : 400,
|
|
2006
|
+
maxWidth: (_c = config.maxWidth) != null ? _c : 800,
|
|
2007
|
+
resizable: (_d = config.resizable) != null ? _d : true,
|
|
2008
|
+
shrinkPage: (_e = config.shrinkPage) != null ? _e : true,
|
|
2009
|
+
defaultOpen: (_f = config.defaultOpen) != null ? _f : true
|
|
2010
|
+
};
|
|
2011
|
+
});
|
|
2012
|
+
const panelWidth = ref(splitConfig.value.width);
|
|
2013
|
+
const effectiveMode = computed(() => {
|
|
2014
|
+
if (options.displayMode.value === "bubble") return "bubble";
|
|
2015
|
+
if (options.displayMode.value === "split") return "split";
|
|
2016
|
+
return windowWidth.value >= AUTO_MODE_THRESHOLD ? "split" : "bubble";
|
|
2017
|
+
});
|
|
2018
|
+
const isSplitMode = computed(() => effectiveMode.value === "split");
|
|
2019
|
+
const handleResize = (width) => {
|
|
2020
|
+
var _a;
|
|
2021
|
+
panelWidth.value = width;
|
|
2022
|
+
(_a = options.onWidthChange) == null || _a.call(options, width);
|
|
2023
|
+
};
|
|
2024
|
+
const handleToggle = () => {
|
|
2025
|
+
var _a;
|
|
2026
|
+
const nextOpen = !options.open.value;
|
|
2027
|
+
(_a = options.onOpenChange) == null || _a.call(options, nextOpen);
|
|
2028
|
+
};
|
|
2029
|
+
const handleWindowResize = () => {
|
|
2030
|
+
if (typeof window !== "undefined") windowWidth.value = window.innerWidth;
|
|
2031
|
+
};
|
|
2032
|
+
const updateBodyClass = () => {
|
|
2033
|
+
if (typeof document === "undefined") return;
|
|
2034
|
+
if (isSplitMode.value && options.open.value && splitConfig.value.shrinkPage) {
|
|
2035
|
+
document.body.classList.add("has-opencode-split");
|
|
2036
|
+
document.body.style.setProperty("--opencode-split-width", `${panelWidth.value}px`);
|
|
2037
|
+
} else {
|
|
2038
|
+
document.body.classList.remove("has-opencode-split");
|
|
2039
|
+
document.body.style.removeProperty("--opencode-split-width");
|
|
2040
|
+
}
|
|
2041
|
+
};
|
|
2042
|
+
watch([
|
|
2043
|
+
isSplitMode,
|
|
2044
|
+
options.open,
|
|
2045
|
+
panelWidth
|
|
2046
|
+
], updateBodyClass, { immediate: true });
|
|
2047
|
+
watch(splitConfig, (config) => {
|
|
2048
|
+
if (panelWidth.value < config.minWidth) panelWidth.value = config.minWidth;
|
|
2049
|
+
if (panelWidth.value > config.maxWidth) panelWidth.value = config.maxWidth;
|
|
2050
|
+
});
|
|
2051
|
+
onMounted(() => {
|
|
2052
|
+
var _a;
|
|
2053
|
+
if (typeof window !== "undefined") {
|
|
2054
|
+
window.addEventListener("resize", handleWindowResize);
|
|
2055
|
+
if (isSplitMode.value && splitConfig.value.defaultOpen && !options.open.value) (_a = options.onOpenChange) == null || _a.call(options, true);
|
|
2056
|
+
}
|
|
2057
|
+
});
|
|
2058
|
+
onUnmounted(() => {
|
|
2059
|
+
if (typeof window !== "undefined") {
|
|
2060
|
+
window.removeEventListener("resize", handleWindowResize);
|
|
2061
|
+
document.body.classList.remove("has-opencode-split");
|
|
2062
|
+
document.body.style.removeProperty("--opencode-split-width");
|
|
2063
|
+
}
|
|
2064
|
+
});
|
|
2065
|
+
return {
|
|
2066
|
+
effectiveMode,
|
|
2067
|
+
isSplitMode,
|
|
2068
|
+
panelWidth,
|
|
2069
|
+
splitConfig,
|
|
2070
|
+
handleResize,
|
|
2071
|
+
handleToggle
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
//#endregion
|
|
1585
2075
|
//#region es/open-code-widget/src/index.vue.js
|
|
1586
2076
|
var __defProp = Object.defineProperty;
|
|
1587
2077
|
var __defProps = Object.defineProperties;
|
|
@@ -1718,6 +2208,21 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
1718
2208
|
sessionStates: {
|
|
1719
2209
|
type: Object,
|
|
1720
2210
|
required: false
|
|
2211
|
+
},
|
|
2212
|
+
displayMode: {
|
|
2213
|
+
type: String,
|
|
2214
|
+
required: false,
|
|
2215
|
+
default: "bubble"
|
|
2216
|
+
},
|
|
2217
|
+
splitMode: {
|
|
2218
|
+
type: Object,
|
|
2219
|
+
required: false,
|
|
2220
|
+
default: void 0
|
|
2221
|
+
},
|
|
2222
|
+
splitPanelWidth: {
|
|
2223
|
+
type: Number,
|
|
2224
|
+
required: false,
|
|
2225
|
+
default: 500
|
|
1721
2226
|
}
|
|
1722
2227
|
},
|
|
1723
2228
|
emits: [
|
|
@@ -1728,6 +2233,7 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
1728
2233
|
"update:selectedElements",
|
|
1729
2234
|
"update:theme",
|
|
1730
2235
|
"update:thinking",
|
|
2236
|
+
"update:splitPanelWidth",
|
|
1731
2237
|
"toggle",
|
|
1732
2238
|
"close",
|
|
1733
2239
|
"toggle-session-list",
|
|
@@ -1741,7 +2247,8 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
1741
2247
|
"clear-selected-nodes",
|
|
1742
2248
|
"empty-action",
|
|
1743
2249
|
"frame-loaded",
|
|
1744
|
-
"thinking-change"
|
|
2250
|
+
"thinking-change",
|
|
2251
|
+
"split-panel-width-change"
|
|
1745
2252
|
],
|
|
1746
2253
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1747
2254
|
useCssVars((_ctx) => ({
|
|
@@ -1794,6 +2301,7 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
1794
2301
|
const promptDockVisible = ref(true);
|
|
1795
2302
|
const isRestoring = ref(true);
|
|
1796
2303
|
const iframeLoaded = ref(false);
|
|
2304
|
+
const splitPanelWidth = ref(props.splitPanelWidth);
|
|
1797
2305
|
const syncStateToIframe = () => {
|
|
1798
2306
|
if (!iframeLoaded.value) return;
|
|
1799
2307
|
sendMessageToIframe("prompt-dock-visibility-change", { visible: promptDockVisible.value });
|
|
@@ -1812,6 +2320,9 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
1812
2320
|
watch(() => props.sessionListCollapsed, (val) => {
|
|
1813
2321
|
localSessionListCollapsed.value = val;
|
|
1814
2322
|
});
|
|
2323
|
+
watch(() => props.splitPanelWidth, (val) => {
|
|
2324
|
+
splitPanelWidth.value = val;
|
|
2325
|
+
});
|
|
1815
2326
|
const { buttonActive, containerClasses, iframeSource, sessionListTitle, resolvedTheme, handleClose, handleEmptyAction, handleToggle, handleToggleSessionList, handleToggleTheme } = useWidget({
|
|
1816
2327
|
theme: toRef(props, "theme"),
|
|
1817
2328
|
open: toRef(props, "open"),
|
|
@@ -1884,6 +2395,20 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
1884
2395
|
}
|
|
1885
2396
|
});
|
|
1886
2397
|
const bubbleOffset = ref(void 0);
|
|
2398
|
+
const { effectiveMode, isSplitMode, panelWidth, splitConfig, handleResize, handleToggle: handleSplitToggle } = useSplitMode({
|
|
2399
|
+
displayMode: toRef(props, "displayMode"),
|
|
2400
|
+
splitMode: toRef(props, "splitMode"),
|
|
2401
|
+
open: toRef(props, "open"),
|
|
2402
|
+
onOpenChange: (nextOpen) => {
|
|
2403
|
+
emit("update:open", nextOpen);
|
|
2404
|
+
emit("toggle", nextOpen);
|
|
2405
|
+
},
|
|
2406
|
+
onWidthChange: (width) => {
|
|
2407
|
+
splitPanelWidth.value = width;
|
|
2408
|
+
emit("update:splitPanelWidth", width);
|
|
2409
|
+
emit("split-panel-width-change", width);
|
|
2410
|
+
}
|
|
2411
|
+
});
|
|
1887
2412
|
usePersistState({
|
|
1888
2413
|
open: toRef(props, "open"),
|
|
1889
2414
|
minimized,
|
|
@@ -1891,6 +2416,7 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
1891
2416
|
bubbleOffset,
|
|
1892
2417
|
theme: toRef(props, "theme"),
|
|
1893
2418
|
sessionListCollapsed: localSessionListCollapsed,
|
|
2419
|
+
splitPanelWidth,
|
|
1894
2420
|
onRestore: (state) => {
|
|
1895
2421
|
if (state.open !== void 0 && state.open !== props.open) {
|
|
1896
2422
|
emit("update:open", state.open);
|
|
@@ -2007,6 +2533,12 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2007
2533
|
const handleBubbleOffsetChange = (offset) => {
|
|
2008
2534
|
bubbleOffset.value = offset;
|
|
2009
2535
|
};
|
|
2536
|
+
const handleResizeStart = () => {
|
|
2537
|
+
isDragging.value = true;
|
|
2538
|
+
};
|
|
2539
|
+
const handleResizeEnd = () => {
|
|
2540
|
+
isDragging.value = false;
|
|
2541
|
+
};
|
|
2010
2542
|
const chatAnimationOrigin = computed(() => {
|
|
2011
2543
|
switch (bubbleQuadrant.value) {
|
|
2012
2544
|
case "top-left": return {
|
|
@@ -2061,6 +2593,7 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2061
2593
|
minimized,
|
|
2062
2594
|
promptDockVisible,
|
|
2063
2595
|
bubbleOffset,
|
|
2596
|
+
mode: effectiveMode,
|
|
2064
2597
|
sessionStates: computed(() => {
|
|
2065
2598
|
var _a;
|
|
2066
2599
|
return (_a = props.sessionStates) != null ? _a : {};
|
|
@@ -2122,6 +2655,7 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2122
2655
|
promptDockVisible,
|
|
2123
2656
|
isRestoring,
|
|
2124
2657
|
iframeLoaded,
|
|
2658
|
+
splitPanelWidth,
|
|
2125
2659
|
syncStateToIframe,
|
|
2126
2660
|
handleFrameLoaded,
|
|
2127
2661
|
buttonActive,
|
|
@@ -2151,6 +2685,12 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2151
2685
|
tooltipStyle,
|
|
2152
2686
|
tooltipContent,
|
|
2153
2687
|
bubbleOffset,
|
|
2688
|
+
effectiveMode,
|
|
2689
|
+
isSplitMode,
|
|
2690
|
+
panelWidth,
|
|
2691
|
+
splitConfig,
|
|
2692
|
+
handleResize,
|
|
2693
|
+
handleSplitToggle,
|
|
2154
2694
|
handleToggleMinimize,
|
|
2155
2695
|
handleTogglePromptDock,
|
|
2156
2696
|
windowWidth,
|
|
@@ -2160,6 +2700,8 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2160
2700
|
isBubbleOnRightSide,
|
|
2161
2701
|
chatPositionStyle,
|
|
2162
2702
|
handleBubbleOffsetChange,
|
|
2703
|
+
handleResizeStart,
|
|
2704
|
+
handleResizeEnd,
|
|
2163
2705
|
chatAnimationOrigin,
|
|
2164
2706
|
isDragging,
|
|
2165
2707
|
get wasOpenBeforeDrag() {
|
|
@@ -2170,11 +2712,8 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2170
2712
|
},
|
|
2171
2713
|
handleDragStart,
|
|
2172
2714
|
handleDragEnd,
|
|
2173
|
-
|
|
2174
|
-
Header: Header_vue_default,
|
|
2715
|
+
ChatPanel: ChatPanel_vue_default,
|
|
2175
2716
|
SelectHint: SelectHint_vue_default,
|
|
2176
|
-
SelectedNodes: SelectedNodes_vue_default,
|
|
2177
|
-
SessionList: SessionList_vue_default,
|
|
2178
2717
|
Trigger: Trigger_vue_default
|
|
2179
2718
|
};
|
|
2180
2719
|
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
@@ -2184,33 +2723,28 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2184
2723
|
return __returned__;
|
|
2185
2724
|
}
|
|
2186
2725
|
}));
|
|
2187
|
-
var _hoisted_1 = {
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
};
|
|
2192
|
-
var _hoisted_2 = { class: "opencode-chat-content" };
|
|
2193
|
-
var _hoisted_3 = { class: "opencode-tooltip-tag" };
|
|
2194
|
-
var _hoisted_4 = { class: "opencode-tooltip-file" };
|
|
2195
|
-
var _hoisted_5 = {
|
|
2196
|
-
key: 0,
|
|
2726
|
+
var _hoisted_1 = { class: "opencode-tooltip-tag" };
|
|
2727
|
+
var _hoisted_2 = { class: "opencode-tooltip-file" };
|
|
2728
|
+
var _hoisted_3 = {
|
|
2729
|
+
key: 1,
|
|
2197
2730
|
class: "opencode-dialog-overlay"
|
|
2198
2731
|
};
|
|
2199
|
-
var
|
|
2732
|
+
var _hoisted_4 = {
|
|
2200
2733
|
class: "opencode-dialog",
|
|
2201
2734
|
role: "alertdialog",
|
|
2202
2735
|
"aria-modal": "true"
|
|
2203
2736
|
};
|
|
2204
|
-
var
|
|
2205
|
-
var
|
|
2206
|
-
var
|
|
2737
|
+
var _hoisted_5 = { class: "opencode-dialog-content" };
|
|
2738
|
+
var _hoisted_6 = { class: "opencode-dialog-message" };
|
|
2739
|
+
var _hoisted_7 = {
|
|
2207
2740
|
key: 0,
|
|
2208
2741
|
class: "opencode-page-notification",
|
|
2209
2742
|
role: "alert"
|
|
2210
2743
|
};
|
|
2211
2744
|
function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2212
2745
|
return openBlock(), createElementBlock("div", { class: normalizeClass($setup.containerClasses) }, [
|
|
2213
|
-
|
|
2746
|
+
!$setup.isSplitMode ? (openBlock(), createBlock($setup["Trigger"], {
|
|
2747
|
+
key: 0,
|
|
2214
2748
|
ref: "triggerRef",
|
|
2215
2749
|
onDragStart: $setup.handleDragStart,
|
|
2216
2750
|
onDragEnd: $setup.handleDragEnd
|
|
@@ -2218,64 +2752,88 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2218
2752
|
name: "default",
|
|
2219
2753
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "button-icon")]),
|
|
2220
2754
|
key: "0"
|
|
2221
|
-
} : void 0]), 1536),
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2755
|
+
} : void 0]), 1536)) : createCommentVNode("v-if", true),
|
|
2756
|
+
createVNode($setup["ChatPanel"], {
|
|
2757
|
+
ref: "frameRef",
|
|
2758
|
+
mode: $setup.effectiveMode,
|
|
2759
|
+
open: $props.open,
|
|
2760
|
+
minimized: $setup.minimized,
|
|
2761
|
+
"position-style": $setup.chatPositionStyle,
|
|
2762
|
+
"animation-origin": $setup.chatAnimationOrigin,
|
|
2763
|
+
"panel-width": $setup.panelWidth,
|
|
2764
|
+
resizable: $setup.splitConfig.resizable,
|
|
2765
|
+
"min-width": $setup.splitConfig.minWidth,
|
|
2766
|
+
"max-width": $setup.splitConfig.maxWidth,
|
|
2767
|
+
"no-transition": $setup.isRestoring,
|
|
2768
|
+
dragging: $setup.isDragging,
|
|
2769
|
+
"notification-visible": $setup.notificationVisible,
|
|
2770
|
+
"notification-message": $setup.notificationMessage,
|
|
2771
|
+
"notification-mode": $setup.notificationMode,
|
|
2772
|
+
thinking: $props.thinking,
|
|
2773
|
+
"resolved-theme": $setup.resolvedTheme,
|
|
2774
|
+
onResize: $setup.handleResize,
|
|
2775
|
+
onResizeStart: $setup.handleResizeStart,
|
|
2776
|
+
onResizeEnd: $setup.handleResizeEnd,
|
|
2777
|
+
onToggle: $setup.handleSplitToggle
|
|
2778
|
+
}, createSlots({
|
|
2779
|
+
"sessions-empty": withCtx(() => [renderSlot(_ctx.$slots, "sessions-empty", {}, () => [_cache[0] || (_cache[0] = createElementVNode("div", { class: "opencode-session-empty" }, "暂无会话", -1))])]),
|
|
2780
|
+
_: 2
|
|
2230
2781
|
}, [
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2782
|
+
$setup.slots["session-toggle-icon"] ? {
|
|
2783
|
+
name: "session-toggle-icon",
|
|
2784
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "session-toggle-icon")]),
|
|
2785
|
+
key: "0"
|
|
2786
|
+
} : void 0,
|
|
2787
|
+
$setup.slots["select-icon"] ? {
|
|
2788
|
+
name: "select-icon",
|
|
2789
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "select-icon")]),
|
|
2790
|
+
key: "1"
|
|
2791
|
+
} : void 0,
|
|
2792
|
+
$setup.slots["close-icon"] ? {
|
|
2793
|
+
name: "close-icon",
|
|
2794
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "close-icon")]),
|
|
2795
|
+
key: "2"
|
|
2796
|
+
} : void 0,
|
|
2797
|
+
$setup.slots["empty-state"] ? {
|
|
2798
|
+
name: "empty-state",
|
|
2799
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "empty-state")]),
|
|
2800
|
+
key: "3"
|
|
2801
|
+
} : void 0,
|
|
2802
|
+
$setup.slots.loading ? {
|
|
2803
|
+
name: "loading",
|
|
2804
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "loading")]),
|
|
2805
|
+
key: "4"
|
|
2806
|
+
} : void 0,
|
|
2807
|
+
$setup.slots.error ? {
|
|
2808
|
+
name: "error",
|
|
2809
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "error")]),
|
|
2810
|
+
key: "5"
|
|
2811
|
+
} : void 0,
|
|
2812
|
+
$setup.slots.content ? {
|
|
2813
|
+
name: "content",
|
|
2814
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "content")]),
|
|
2815
|
+
key: "6"
|
|
2816
|
+
} : void 0
|
|
2817
|
+
]), 1032, [
|
|
2818
|
+
"mode",
|
|
2819
|
+
"open",
|
|
2820
|
+
"minimized",
|
|
2821
|
+
"position-style",
|
|
2822
|
+
"animation-origin",
|
|
2823
|
+
"panel-width",
|
|
2824
|
+
"resizable",
|
|
2825
|
+
"min-width",
|
|
2826
|
+
"max-width",
|
|
2827
|
+
"no-transition",
|
|
2828
|
+
"dragging",
|
|
2829
|
+
"notification-visible",
|
|
2830
|
+
"notification-message",
|
|
2831
|
+
"notification-mode",
|
|
2832
|
+
"thinking",
|
|
2833
|
+
"resolved-theme",
|
|
2834
|
+
"onResize",
|
|
2835
|
+
"onToggle"
|
|
2836
|
+
]),
|
|
2279
2837
|
createVNode($setup["SelectHint"]),
|
|
2280
2838
|
withDirectives(createElementVNode("div", {
|
|
2281
2839
|
class: "opencode-element-highlight",
|
|
@@ -2284,15 +2842,15 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2284
2842
|
withDirectives(createElementVNode("div", {
|
|
2285
2843
|
class: "opencode-element-tooltip",
|
|
2286
2844
|
style: normalizeStyle($setup.tooltipStyle)
|
|
2287
|
-
}, [createElementVNode("div",
|
|
2288
|
-
$setup.dialogVisible ? (openBlock(), createElementBlock("div",
|
|
2845
|
+
}, [createElementVNode("div", _hoisted_1, toDisplayString($setup.tooltipContent.description), 1), createElementVNode("div", _hoisted_2, toDisplayString($setup.tooltipContent.fileInfo), 1)], 4), [[vShow, $setup.tooltipVisible]]),
|
|
2846
|
+
$setup.dialogVisible ? (openBlock(), createElementBlock("div", _hoisted_3, [createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [createElementVNode("div", _hoisted_6, toDisplayString($setup.dialogMessage), 1)]), createElementVNode("div", { class: "opencode-dialog-actions" }, [createElementVNode("button", {
|
|
2289
2847
|
class: "opencode-dialog-btn cancel",
|
|
2290
2848
|
onClick: $setup.handleDialogCancel
|
|
2291
2849
|
}, "取消"), createElementVNode("button", {
|
|
2292
2850
|
class: "opencode-dialog-btn confirm",
|
|
2293
2851
|
onClick: $setup.handleDialogConfirm
|
|
2294
2852
|
}, "确认")])])])) : createCommentVNode("v-if", true),
|
|
2295
|
-
(openBlock(), createBlock(Teleport, { to: "body" }, [$setup.notificationVisible && $setup.notificationMode === "page" ? (openBlock(), createElementBlock("div",
|
|
2853
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [$setup.notificationVisible && $setup.notificationMode === "page" ? (openBlock(), createElementBlock("div", _hoisted_7, toDisplayString($setup.notificationMessage), 1)) : createCommentVNode("v-if", true)]))
|
|
2296
2854
|
], 2);
|
|
2297
2855
|
}
|
|
2298
2856
|
__vue_sfc__.render = __vue_render__;
|
|
@@ -2301,7 +2859,7 @@ __vue_sfc__.render = __vue_render__;
|
|
|
2301
2859
|
var open_code_widget_default = __vue_sfc__;
|
|
2302
2860
|
//#endregion
|
|
2303
2861
|
//#region es/index.js
|
|
2304
|
-
var version = "1.0.
|
|
2862
|
+
var version = "1.0.38";
|
|
2305
2863
|
function install(app, options) {
|
|
2306
2864
|
[open_code_widget_default].forEach((item) => {
|
|
2307
2865
|
if (item.install) app.use(item, options);
|