@vite-plugin-opencode-assistant/components 1.0.73 → 1.0.75
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.mjs +1 -1
- package/es/open-code-widget/composables/use-split.d.ts +1 -0
- package/es/open-code-widget/composables/use-split.mjs +15 -8
- 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.mjs +9 -4
- package/es/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.mjs +11 -2
- package/es/open-code-widget/src/components/Frame-sfc.css +1 -1
- package/es/open-code-widget/src/components/Header.vue.mjs +61 -28
- 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 +1 -0
- package/es/open-code-widget/src/index.vue.mjs +137 -120
- package/lib/@vite-plugin-opencode-assistant/components.cjs.js +195 -140
- package/lib/@vite-plugin-opencode-assistant/components.es.js +196 -141
- package/lib/components.css +3 -3
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/open-code-widget/composables/use-split.cjs +15 -8
- package/lib/open-code-widget/composables/use-split.d.ts +1 -0
- package/lib/open-code-widget/src/components/ChatPanel-sfc.css +1 -1
- package/lib/open-code-widget/src/components/ChatPanel.vue.cjs +9 -4
- package/lib/open-code-widget/src/components/ChatPanel.vue.d.ts +2 -0
- package/lib/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.cjs +11 -2
- package/lib/open-code-widget/src/components/Frame-sfc.css +1 -1
- package/lib/open-code-widget/src/components/Header.vue.cjs +61 -28
- 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.cjs +136 -119
- package/lib/open-code-widget/src/index.vue.d.ts +1 -0
- package/lib/web-types.json +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, inject, nextTick, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, provide, ref, renderList, renderSlot, toDisplayString, toRef, useCssVars, useSlots, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
2
|
-
import { truncate } from "@vite-plugin-opencode-assistant/shared";
|
|
2
|
+
import { WIDGET_MSG, truncate } from "@vite-plugin-opencode-assistant/shared";
|
|
3
3
|
import getCssSelector from "css-selector-generator";
|
|
4
4
|
//#region es/open-code-widget/src/context.mjs
|
|
5
5
|
var CONTEXT_KEY = /* @__PURE__ */ Symbol("OpenCodeWidgetContext");
|
|
@@ -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, displayMode, splitPosition, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleToggleDisplayMode, handleToggleSplitPosition, 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, handleRefresh } = useOpenCodeWidgetContext();
|
|
114
114
|
const __returned__ = {
|
|
115
115
|
title,
|
|
116
116
|
sessionListTitle,
|
|
@@ -132,6 +132,7 @@ var __vue_sfc__$8 = /* @__PURE__ */ defineComponent({
|
|
|
132
132
|
handleClose,
|
|
133
133
|
handleToggleMinimize,
|
|
134
134
|
handleTogglePromptDock,
|
|
135
|
+
handleRefresh,
|
|
135
136
|
isSplitMode: computed(() => mode.value === "split"),
|
|
136
137
|
themeIconTitle: computed(() => {
|
|
137
138
|
return `\u4E3B\u9898: ${{
|
|
@@ -151,14 +152,18 @@ var __vue_sfc__$8 = /* @__PURE__ */ defineComponent({
|
|
|
151
152
|
return `\u5C55\u793A\u6A21\u5F0F: ${{
|
|
152
153
|
bubble: "气泡模式",
|
|
153
154
|
split: "分屏模式",
|
|
154
|
-
auto: "自动模式"
|
|
155
|
+
auto: "自动模式",
|
|
156
|
+
extension: "扩展模式",
|
|
157
|
+
"extension-selector": "扩展选择器模式"
|
|
155
158
|
}[displayMode.value]}`;
|
|
156
159
|
}),
|
|
157
160
|
displayModeIconLabel: computed(() => {
|
|
158
161
|
const displayModeLabels = {
|
|
159
162
|
bubble: "气泡模式",
|
|
160
163
|
split: "分屏模式",
|
|
161
|
-
auto: "自动模式"
|
|
164
|
+
auto: "自动模式",
|
|
165
|
+
extension: "扩展模式",
|
|
166
|
+
"extension-selector": "扩展选择器模式"
|
|
162
167
|
};
|
|
163
168
|
const modes = [
|
|
164
169
|
"bubble",
|
|
@@ -317,7 +322,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
317
322
|
"aria-label": $setup.sessionListTitle,
|
|
318
323
|
"aria-expanded": !$setup.sessionListCollapsed,
|
|
319
324
|
onClick: _cache[0] || (_cache[0] = (...args) => $setup.handleToggleSessionList && $setup.handleToggleSessionList(...args))
|
|
320
|
-
}, [renderSlot(_ctx.$slots, "session-toggle-icon", {}, () => [_cache[
|
|
325
|
+
}, [renderSlot(_ctx.$slots, "session-toggle-icon", {}, () => [_cache[9] || (_cache[9] = createElementVNode("svg", {
|
|
321
326
|
viewBox: "0 0 24 24",
|
|
322
327
|
width: "16",
|
|
323
328
|
height: "16",
|
|
@@ -337,7 +342,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
337
342
|
"aria-pressed": $setup.selectMode,
|
|
338
343
|
disabled: !$setup.selectEnabled,
|
|
339
344
|
onClick: _cache[1] || (_cache[1] = (...args) => $setup.handleToggleSelectMode && $setup.handleToggleSelectMode(...args))
|
|
340
|
-
}, [renderSlot(_ctx.$slots, "select-icon", {}, () => [_cache[
|
|
345
|
+
}, [renderSlot(_ctx.$slots, "select-icon", {}, () => [_cache[10] || (_cache[10] = createElementVNode("svg", {
|
|
341
346
|
viewBox: "0 0 1024 1024",
|
|
342
347
|
width: "16",
|
|
343
348
|
height: "16",
|
|
@@ -355,14 +360,15 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
355
360
|
title: $setup.themeIconTitle,
|
|
356
361
|
"aria-label": $setup.themeIconLabel,
|
|
357
362
|
onClick: _cache[2] || (_cache[2] = (...args) => $setup.handleToggleTheme && $setup.handleToggleTheme(...args))
|
|
358
|
-
}, [renderSlot(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? (openBlock(), createElementBlock("svg", _hoisted_6$4, [..._cache[
|
|
359
|
-
|
|
363
|
+
}, [renderSlot(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? (openBlock(), createElementBlock("svg", _hoisted_6$4, [..._cache[11] || (_cache[11] = [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[12] || (_cache[12] = [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[13] || (_cache[13] = [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),
|
|
364
|
+
$setup.displayMode !== "extension" ? (openBlock(), createElementBlock("button", {
|
|
365
|
+
key: 0,
|
|
360
366
|
class: "opencode-header-btn display-mode-btn",
|
|
361
367
|
type: "button",
|
|
362
368
|
title: $setup.displayModeIconTitle,
|
|
363
369
|
"aria-label": $setup.displayModeIconLabel,
|
|
364
370
|
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[
|
|
371
|
+
}, [renderSlot(_ctx.$slots, "display-mode-icon", {}, () => [$setup.displayMode === "bubble" ? (openBlock(), createElementBlock("svg", _hoisted_10$1, [..._cache[14] || (_cache[14] = [
|
|
366
372
|
createElementVNode("circle", {
|
|
367
373
|
cx: "12",
|
|
368
374
|
cy: "12",
|
|
@@ -386,7 +392,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
386
392
|
y2: "9",
|
|
387
393
|
"stroke-linecap": "round"
|
|
388
394
|
}, null, -1)
|
|
389
|
-
])])) : $setup.displayMode === "split" ? (openBlock(), createElementBlock("svg", _hoisted_11, [..._cache[
|
|
395
|
+
])])) : $setup.displayMode === "split" ? (openBlock(), createElementBlock("svg", _hoisted_11, [..._cache[15] || (_cache[15] = [createElementVNode("rect", {
|
|
390
396
|
x: "3",
|
|
391
397
|
y: "3",
|
|
392
398
|
width: "18",
|
|
@@ -397,7 +403,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
397
403
|
y1: "3",
|
|
398
404
|
x2: "12",
|
|
399
405
|
y2: "21"
|
|
400
|
-
}, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_12, [..._cache[
|
|
406
|
+
}, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_12, [..._cache[16] || (_cache[16] = [
|
|
401
407
|
createElementVNode("rect", {
|
|
402
408
|
x: "3",
|
|
403
409
|
y: "3",
|
|
@@ -424,18 +430,34 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
424
430
|
cy: "18",
|
|
425
431
|
r: "3"
|
|
426
432
|
}, null, -1)
|
|
427
|
-
])]))])], 8, _hoisted_9$1)
|
|
433
|
+
])]))])], 8, _hoisted_9$1)) : createCommentVNode("v-if", true)
|
|
428
434
|
]),
|
|
429
435
|
createElementVNode("span", _hoisted_13, toDisplayString($setup.title), 1),
|
|
430
436
|
createElementVNode("div", _hoisted_14, [
|
|
431
|
-
$setup.
|
|
437
|
+
$setup.displayMode === "extension" ? (openBlock(), createElementBlock("button", {
|
|
432
438
|
key: 0,
|
|
439
|
+
class: "opencode-header-btn refresh-btn",
|
|
440
|
+
type: "button",
|
|
441
|
+
title: "刷新面板",
|
|
442
|
+
"aria-label": "刷新面板",
|
|
443
|
+
onClick: _cache[4] || (_cache[4] = (...args) => $setup.handleRefresh && $setup.handleRefresh(...args))
|
|
444
|
+
}, [..._cache[17] || (_cache[17] = [createElementVNode("svg", {
|
|
445
|
+
viewBox: "0 0 24 24",
|
|
446
|
+
width: "16",
|
|
447
|
+
height: "16",
|
|
448
|
+
fill: "none",
|
|
449
|
+
stroke: "currentColor",
|
|
450
|
+
"stroke-width": "2",
|
|
451
|
+
"aria-hidden": "true"
|
|
452
|
+
}, [createElementVNode("polyline", { points: "23,4 23,10 17,10" }), createElementVNode("path", { d: "M20.49 15a9 9 0 1 1-2.12-9.36L23 10" })], -1)])])) : createCommentVNode("v-if", true),
|
|
453
|
+
$setup.isSplitMode && $setup.displayMode !== "extension" ? (openBlock(), createElementBlock("button", {
|
|
454
|
+
key: 1,
|
|
433
455
|
class: "opencode-header-btn split-position-btn",
|
|
434
456
|
type: "button",
|
|
435
457
|
title: $setup.splitPositionIconTitle,
|
|
436
458
|
"aria-label": $setup.splitPositionIconLabel,
|
|
437
|
-
onClick: _cache[
|
|
438
|
-
}, [renderSlot(_ctx.$slots, "split-position-icon", {}, () => [$setup.splitPosition === "right" ? (openBlock(), createElementBlock("svg", _hoisted_16, [..._cache[
|
|
459
|
+
onClick: _cache[5] || (_cache[5] = (...args) => $setup.handleToggleSplitPosition && $setup.handleToggleSplitPosition(...args))
|
|
460
|
+
}, [renderSlot(_ctx.$slots, "split-position-icon", {}, () => [$setup.splitPosition === "right" ? (openBlock(), createElementBlock("svg", _hoisted_16, [..._cache[18] || (_cache[18] = [createElementVNode("rect", {
|
|
439
461
|
x: "3",
|
|
440
462
|
y: "3",
|
|
441
463
|
width: "18",
|
|
@@ -446,7 +468,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
446
468
|
y1: "3",
|
|
447
469
|
x2: "15",
|
|
448
470
|
y2: "21"
|
|
449
|
-
}, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_17, [..._cache[
|
|
471
|
+
}, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_17, [..._cache[19] || (_cache[19] = [createElementVNode("rect", {
|
|
450
472
|
x: "3",
|
|
451
473
|
y: "3",
|
|
452
474
|
width: "18",
|
|
@@ -459,14 +481,14 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
459
481
|
y2: "21"
|
|
460
482
|
}, null, -1)])]))])], 8, _hoisted_15)) : createCommentVNode("v-if", true),
|
|
461
483
|
!$setup.isSplitMode ? (openBlock(), createElementBlock("button", {
|
|
462
|
-
key:
|
|
484
|
+
key: 2,
|
|
463
485
|
class: "opencode-header-btn prompt-dock",
|
|
464
486
|
type: "button",
|
|
465
487
|
title: $setup.promptDockVisible ? "隐藏对话框" : "显示对话框",
|
|
466
488
|
"aria-label": $setup.promptDockVisible ? "隐藏对话框" : "显示对话框",
|
|
467
489
|
"aria-pressed": $setup.promptDockVisible,
|
|
468
|
-
onClick: _cache[
|
|
469
|
-
}, [renderSlot(_ctx.$slots, "prompt-dock-icon", {}, () => [_cache[
|
|
490
|
+
onClick: _cache[6] || (_cache[6] = (...args) => $setup.handleTogglePromptDock && $setup.handleTogglePromptDock(...args))
|
|
491
|
+
}, [renderSlot(_ctx.$slots, "prompt-dock-icon", {}, () => [_cache[20] || (_cache[20] = createElementVNode("svg", {
|
|
470
492
|
viewBox: "0 0 24 24",
|
|
471
493
|
width: "14",
|
|
472
494
|
height: "14",
|
|
@@ -476,22 +498,22 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
476
498
|
"aria-hidden": "true"
|
|
477
499
|
}, [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),
|
|
478
500
|
!$setup.isSplitMode ? (openBlock(), createElementBlock("button", {
|
|
479
|
-
key:
|
|
501
|
+
key: 3,
|
|
480
502
|
class: "opencode-header-btn minimize",
|
|
481
503
|
type: "button",
|
|
482
504
|
title: $setup.minimized ? "展开" : "最小化",
|
|
483
505
|
"aria-label": $setup.minimized ? "展开面板" : "最小化面板",
|
|
484
506
|
"aria-pressed": $setup.minimized,
|
|
485
|
-
onClick: _cache[
|
|
486
|
-
}, [renderSlot(_ctx.$slots, "minimize-icon", {}, () => [$setup.minimized ? (openBlock(), createElementBlock("svg", _hoisted_20, [..._cache[
|
|
507
|
+
onClick: _cache[7] || (_cache[7] = (...args) => $setup.handleToggleMinimize && $setup.handleToggleMinimize(...args))
|
|
508
|
+
}, [renderSlot(_ctx.$slots, "minimize-icon", {}, () => [$setup.minimized ? (openBlock(), createElementBlock("svg", _hoisted_20, [..._cache[21] || (_cache[21] = [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[22] || (_cache[22] = [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),
|
|
487
509
|
!$setup.isSplitMode ? (openBlock(), createElementBlock("button", {
|
|
488
|
-
key:
|
|
510
|
+
key: 4,
|
|
489
511
|
class: "opencode-header-btn close",
|
|
490
512
|
type: "button",
|
|
491
513
|
title: "关闭",
|
|
492
514
|
"aria-label": "关闭面板",
|
|
493
|
-
onClick: _cache[
|
|
494
|
-
}, [renderSlot(_ctx.$slots, "close-icon", {}, () => [_cache[
|
|
515
|
+
onClick: _cache[8] || (_cache[8] = (...args) => $setup.handleClose && $setup.handleClose(...args))
|
|
516
|
+
}, [renderSlot(_ctx.$slots, "close-icon", {}, () => [_cache[23] || (_cache[23] = createElementVNode("svg", {
|
|
495
517
|
viewBox: "0 0 24 24",
|
|
496
518
|
width: "14",
|
|
497
519
|
height: "14",
|
|
@@ -912,6 +934,11 @@ var __vue_sfc__$4 = /* @__PURE__ */ defineComponent(__spreadProps$2(__spreadValu
|
|
|
912
934
|
type: String,
|
|
913
935
|
required: false,
|
|
914
936
|
default: "right"
|
|
937
|
+
},
|
|
938
|
+
extension: {
|
|
939
|
+
type: Boolean,
|
|
940
|
+
required: false,
|
|
941
|
+
default: false
|
|
915
942
|
}
|
|
916
943
|
},
|
|
917
944
|
emits: [
|
|
@@ -960,6 +987,7 @@ var __vue_sfc__$4 = /* @__PURE__ */ defineComponent(__spreadProps$2(__spreadValu
|
|
|
960
987
|
handleResizeEnd,
|
|
961
988
|
handleToggle,
|
|
962
989
|
panelStyle: computed(() => {
|
|
990
|
+
if (props.extension) return {};
|
|
963
991
|
if (props.mode === "split") return { width: `${props.panelWidth}px` };
|
|
964
992
|
return props.positionStyle;
|
|
965
993
|
}),
|
|
@@ -969,8 +997,9 @@ var __vue_sfc__$4 = /* @__PURE__ */ defineComponent(__spreadProps$2(__spreadValu
|
|
|
969
997
|
dragging: props.dragging,
|
|
970
998
|
"no-transition": props.noTransition,
|
|
971
999
|
"split-mode": props.mode === "split",
|
|
972
|
-
"split-left": props.mode === "split" && props.splitPosition === "left",
|
|
973
|
-
"split-right": props.mode === "split" && props.splitPosition === "right"
|
|
1000
|
+
"split-left": props.mode === "split" && props.splitPosition === "left" && !props.extension,
|
|
1001
|
+
"split-right": props.mode === "split" && props.splitPosition === "right" && !props.extension,
|
|
1002
|
+
"extension-mode": props.extension
|
|
974
1003
|
}]),
|
|
975
1004
|
Frame: Frame_vue_default,
|
|
976
1005
|
Header: Header_vue_default,
|
|
@@ -1049,7 +1078,7 @@ function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1049
1078
|
"max-width",
|
|
1050
1079
|
"position"
|
|
1051
1080
|
])) : createCommentVNode("v-if", true),
|
|
1052
|
-
$props.mode === "split" ? (openBlock(), createElementBlock("button", {
|
|
1081
|
+
$props.mode === "split" && $props.resizable ? (openBlock(), createElementBlock("button", {
|
|
1053
1082
|
key: 1,
|
|
1054
1083
|
type: "button",
|
|
1055
1084
|
class: normalizeClass(["opencode-split-toggle-btn", {
|
|
@@ -1415,9 +1444,12 @@ var __vue_sfc__$2 = /* @__PURE__ */ defineComponent(__spreadProps$1(__spreadValu
|
|
|
1415
1444
|
windowWidth,
|
|
1416
1445
|
windowHeight,
|
|
1417
1446
|
gapX,
|
|
1418
|
-
gapY
|
|
1419
|
-
|
|
1420
|
-
|
|
1447
|
+
gapY
|
|
1448
|
+
], updateState);
|
|
1449
|
+
watch(() => props.offset, (newOffset) => {
|
|
1450
|
+
if (newOffset) magneticSide.value = null;
|
|
1451
|
+
updateState();
|
|
1452
|
+
}, { deep: true });
|
|
1421
1453
|
__expose({ offset: computed(() => ({
|
|
1422
1454
|
x: state.value.x,
|
|
1423
1455
|
y: state.value.y
|
|
@@ -2248,21 +2280,24 @@ function useSplitMode(options) {
|
|
|
2248
2280
|
var _a, _b;
|
|
2249
2281
|
const windowWidth = ref(typeof window !== "undefined" ? window.innerWidth : 0);
|
|
2250
2282
|
const localSplitPosition = ref((_b = (_a = options.splitPosition) == null ? void 0 : _a.value) != null ? _b : "right");
|
|
2283
|
+
const isExtensionMode = computed(() => options.displayMode.value === "extension");
|
|
2251
2284
|
const splitConfig = computed(() => {
|
|
2252
2285
|
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
2253
2286
|
const config = options.splitMode.value || {};
|
|
2287
|
+
const isExt = isExtensionMode.value;
|
|
2254
2288
|
return {
|
|
2255
2289
|
width: (_a2 = config.width) != null ? _a2 : 500,
|
|
2256
2290
|
minWidth: (_b2 = config.minWidth) != null ? _b2 : 400,
|
|
2257
2291
|
maxWidth: (_c = config.maxWidth) != null ? _c : 800,
|
|
2258
|
-
resizable: (_d = config.resizable) != null ? _d : true,
|
|
2259
|
-
shrinkPage: (_e = config.shrinkPage) != null ? _e : true,
|
|
2260
|
-
defaultOpen: (_f = config.defaultOpen) != null ? _f : true,
|
|
2292
|
+
resizable: isExt ? false : (_d = config.resizable) != null ? _d : true,
|
|
2293
|
+
shrinkPage: isExt ? false : (_e = config.shrinkPage) != null ? _e : true,
|
|
2294
|
+
defaultOpen: isExt ? true : (_f = config.defaultOpen) != null ? _f : true,
|
|
2261
2295
|
position: (_g = config.position) != null ? _g : localSplitPosition.value
|
|
2262
2296
|
};
|
|
2263
2297
|
});
|
|
2264
2298
|
const panelWidth = ref(splitConfig.value.width);
|
|
2265
2299
|
const effectiveMode = computed(() => {
|
|
2300
|
+
if (isExtensionMode.value) return "split";
|
|
2266
2301
|
if (options.displayMode.value === "bubble") return "bubble";
|
|
2267
2302
|
if (options.displayMode.value === "split") return "split";
|
|
2268
2303
|
return windowWidth.value >= AUTO_MODE_THRESHOLD ? "split" : "bubble";
|
|
@@ -2290,6 +2325,7 @@ function useSplitMode(options) {
|
|
|
2290
2325
|
};
|
|
2291
2326
|
const updateBodyClass = () => {
|
|
2292
2327
|
if (typeof document === "undefined") return;
|
|
2328
|
+
if (isExtensionMode.value) return;
|
|
2293
2329
|
if (isSplitMode.value && options.open.value && splitConfig.value.shrinkPage) {
|
|
2294
2330
|
document.body.classList.add("has-opencode-split");
|
|
2295
2331
|
document.body.style.setProperty("--opencode-split-width", `${panelWidth.value}px`);
|
|
@@ -2327,21 +2363,24 @@ function useSplitMode(options) {
|
|
|
2327
2363
|
var _a2;
|
|
2328
2364
|
if (typeof window !== "undefined") {
|
|
2329
2365
|
window.addEventListener("resize", handleWindowResize);
|
|
2330
|
-
if (isSplitMode.value && splitConfig.value.defaultOpen && !options.open.value) (_a2 = options.onOpenChange) == null || _a2.call(options, true);
|
|
2366
|
+
if (!isExtensionMode.value && isSplitMode.value && splitConfig.value.defaultOpen && !options.open.value) (_a2 = options.onOpenChange) == null || _a2.call(options, true);
|
|
2331
2367
|
}
|
|
2332
2368
|
});
|
|
2333
2369
|
onUnmounted(() => {
|
|
2334
2370
|
if (typeof window !== "undefined") {
|
|
2335
2371
|
window.removeEventListener("resize", handleWindowResize);
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2372
|
+
if (!isExtensionMode.value) {
|
|
2373
|
+
document.body.classList.remove("has-opencode-split");
|
|
2374
|
+
document.body.classList.remove("has-opencode-split-left");
|
|
2375
|
+
document.body.classList.remove("has-opencode-split-right");
|
|
2376
|
+
document.body.style.removeProperty("--opencode-split-width");
|
|
2377
|
+
}
|
|
2340
2378
|
}
|
|
2341
2379
|
});
|
|
2342
2380
|
return {
|
|
2343
2381
|
effectiveMode,
|
|
2344
2382
|
isSplitMode,
|
|
2383
|
+
isExtensionMode,
|
|
2345
2384
|
panelWidth,
|
|
2346
2385
|
splitConfig,
|
|
2347
2386
|
splitPosition,
|
|
@@ -2502,6 +2541,11 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2502
2541
|
type: Number,
|
|
2503
2542
|
required: false,
|
|
2504
2543
|
default: 500
|
|
2544
|
+
},
|
|
2545
|
+
hideBubble: {
|
|
2546
|
+
type: Boolean,
|
|
2547
|
+
required: false,
|
|
2548
|
+
default: false
|
|
2505
2549
|
}
|
|
2506
2550
|
},
|
|
2507
2551
|
emits: [
|
|
@@ -2586,8 +2630,8 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2586
2630
|
const splitPanelWidth = ref(props.splitPanelWidth);
|
|
2587
2631
|
const syncStateToIframe = () => {
|
|
2588
2632
|
if (!iframeLoaded.value) return;
|
|
2589
|
-
sendMessageToIframe(
|
|
2590
|
-
sendMessageToIframe(
|
|
2633
|
+
sendMessageToIframe(WIDGET_MSG.PROMPT_DOCK_VISIBILITY, { visible: promptDockVisible.value });
|
|
2634
|
+
sendMessageToIframe(WIDGET_MSG.MINIMIZE_STATE, { minimized: minimized.value });
|
|
2591
2635
|
};
|
|
2592
2636
|
const handleFrameLoaded = () => {
|
|
2593
2637
|
emit("frame-loaded");
|
|
@@ -2604,6 +2648,7 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2604
2648
|
localDisplayMode.value = val;
|
|
2605
2649
|
});
|
|
2606
2650
|
const handleToggleDisplayMode = () => {
|
|
2651
|
+
if (localDisplayMode.value === "extension" || localDisplayMode.value === "extension-selector") return;
|
|
2607
2652
|
const modes = [
|
|
2608
2653
|
"bubble",
|
|
2609
2654
|
"split",
|
|
@@ -2683,7 +2728,7 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2683
2728
|
}
|
|
2684
2729
|
});
|
|
2685
2730
|
const bubbleOffset = ref(void 0);
|
|
2686
|
-
const { effectiveMode, isSplitMode, panelWidth, splitConfig, splitPosition, handleResize, handleToggle: handleSplitToggle, handleTogglePosition } = useSplitMode({
|
|
2731
|
+
const { effectiveMode, isSplitMode, isExtensionMode, panelWidth, splitConfig, splitPosition, handleResize, handleToggle: handleSplitToggle, handleTogglePosition } = useSplitMode({
|
|
2687
2732
|
displayMode: localDisplayMode,
|
|
2688
2733
|
splitMode: toRef(props, "splitMode"),
|
|
2689
2734
|
open: toRef(props, "open"),
|
|
@@ -2751,12 +2796,15 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2751
2796
|
const handleToggleMinimize = () => {
|
|
2752
2797
|
minimized.value = !minimized.value;
|
|
2753
2798
|
promptDockVisible.value = !minimized.value;
|
|
2754
|
-
sendMessageToIframe(
|
|
2755
|
-
sendMessageToIframe(
|
|
2799
|
+
sendMessageToIframe(WIDGET_MSG.PROMPT_DOCK_VISIBILITY, { visible: promptDockVisible.value });
|
|
2800
|
+
sendMessageToIframe(WIDGET_MSG.MINIMIZE_STATE, { minimized: minimized.value });
|
|
2756
2801
|
};
|
|
2757
2802
|
const handleTogglePromptDock = () => {
|
|
2758
2803
|
promptDockVisible.value = !promptDockVisible.value;
|
|
2759
|
-
sendMessageToIframe(
|
|
2804
|
+
sendMessageToIframe(WIDGET_MSG.PROMPT_DOCK_VISIBILITY, { visible: promptDockVisible.value });
|
|
2805
|
+
};
|
|
2806
|
+
const handleRefresh = () => {
|
|
2807
|
+
window.location.reload();
|
|
2760
2808
|
};
|
|
2761
2809
|
const windowWidth = ref(typeof window !== "undefined" ? window.innerWidth : 0);
|
|
2762
2810
|
const windowHeight = ref(typeof window !== "undefined" ? window.innerHeight : 0);
|
|
@@ -2921,7 +2969,8 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2921
2969
|
handleRemoveSelectedNode: (payload) => handleRemoveSelectedNode(payload.item, payload.index, payload.source),
|
|
2922
2970
|
handleClearSelectedNodes,
|
|
2923
2971
|
handleFrameLoaded,
|
|
2924
|
-
handleBubbleOffsetChange
|
|
2972
|
+
handleBubbleOffsetChange,
|
|
2973
|
+
handleRefresh
|
|
2925
2974
|
});
|
|
2926
2975
|
__expose({
|
|
2927
2976
|
showNotification,
|
|
@@ -2997,6 +3046,7 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
2997
3046
|
bubbleOffset,
|
|
2998
3047
|
effectiveMode,
|
|
2999
3048
|
isSplitMode,
|
|
3049
|
+
isExtensionMode,
|
|
3000
3050
|
panelWidth,
|
|
3001
3051
|
splitConfig,
|
|
3002
3052
|
splitPosition,
|
|
@@ -3005,6 +3055,7 @@ var __vue_sfc__ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
3005
3055
|
handleTogglePosition,
|
|
3006
3056
|
handleToggleMinimize,
|
|
3007
3057
|
handleTogglePromptDock,
|
|
3058
|
+
handleRefresh,
|
|
3008
3059
|
windowWidth,
|
|
3009
3060
|
windowHeight,
|
|
3010
3061
|
handleWindowResize,
|
|
@@ -3054,101 +3105,105 @@ var _hoisted_7 = {
|
|
|
3054
3105
|
role: "alert"
|
|
3055
3106
|
};
|
|
3056
3107
|
function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3057
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass($setup.
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
} : void 0]), 1536)) : createCommentVNode("v-if", true),
|
|
3068
|
-
createVNode($setup["ChatPanel"], {
|
|
3069
|
-
ref: "frameRef",
|
|
3070
|
-
mode: $setup.effectiveMode,
|
|
3071
|
-
open: $props.open,
|
|
3072
|
-
minimized: $setup.minimized,
|
|
3073
|
-
"position-style": $setup.chatPositionStyle,
|
|
3074
|
-
"animation-origin": $setup.chatAnimationOrigin,
|
|
3075
|
-
"panel-width": $setup.panelWidth,
|
|
3076
|
-
resizable: $setup.splitConfig.resizable,
|
|
3077
|
-
"min-width": $setup.splitConfig.minWidth,
|
|
3078
|
-
"max-width": $setup.splitConfig.maxWidth,
|
|
3079
|
-
"no-transition": $setup.isRestoring,
|
|
3080
|
-
dragging: $setup.isDragging,
|
|
3081
|
-
"notification-visible": $setup.notificationVisible,
|
|
3082
|
-
"notification-message": $setup.notificationMessage,
|
|
3083
|
-
"notification-mode": $setup.notificationMode,
|
|
3084
|
-
thinking: $props.thinking,
|
|
3085
|
-
"resolved-theme": $setup.resolvedTheme,
|
|
3086
|
-
"split-position": $setup.splitPosition,
|
|
3087
|
-
onResize: $setup.handleResize,
|
|
3088
|
-
onResizeStart: $setup.handleResizeStart,
|
|
3089
|
-
onResizeEnd: $setup.handleResizeEnd,
|
|
3090
|
-
onToggle: $setup.handleSplitToggle
|
|
3091
|
-
}, createSlots({
|
|
3092
|
-
"sessions-empty": withCtx(() => [renderSlot(_ctx.$slots, "sessions-empty", {}, () => [_cache[0] || (_cache[0] = createElementVNode("div", { class: "opencode-session-empty" }, "暂无会话", -1))])]),
|
|
3093
|
-
_: 2
|
|
3094
|
-
}, [
|
|
3095
|
-
$setup.slots["session-toggle-icon"] ? {
|
|
3096
|
-
name: "session-toggle-icon",
|
|
3097
|
-
fn: withCtx(() => [renderSlot(_ctx.$slots, "session-toggle-icon")]),
|
|
3108
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass([...$setup.containerClasses, { "extension-mode": $setup.isExtensionMode }]) }, [
|
|
3109
|
+
$props.displayMode !== "extension-selector" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3110
|
+
!$setup.isSplitMode && !$setup.props.hideBubble ? (openBlock(), createBlock($setup["Trigger"], {
|
|
3111
|
+
key: 0,
|
|
3112
|
+
ref: "triggerRef",
|
|
3113
|
+
onDragStart: $setup.handleDragStart,
|
|
3114
|
+
onDragEnd: $setup.handleDragEnd
|
|
3115
|
+
}, createSlots({ _: 2 }, [$setup.slots["button-icon"] ? {
|
|
3116
|
+
name: "default",
|
|
3117
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "button-icon")]),
|
|
3098
3118
|
key: "0"
|
|
3099
|
-
} : void 0,
|
|
3100
|
-
$setup
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
}
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3119
|
+
} : void 0]), 1536)) : createCommentVNode("v-if", true),
|
|
3120
|
+
createVNode($setup["ChatPanel"], {
|
|
3121
|
+
ref: "frameRef",
|
|
3122
|
+
mode: $setup.effectiveMode,
|
|
3123
|
+
open: $props.open,
|
|
3124
|
+
minimized: $setup.minimized,
|
|
3125
|
+
"position-style": $setup.chatPositionStyle,
|
|
3126
|
+
"animation-origin": $setup.chatAnimationOrigin,
|
|
3127
|
+
"panel-width": $setup.panelWidth,
|
|
3128
|
+
resizable: $setup.splitConfig.resizable,
|
|
3129
|
+
"min-width": $setup.splitConfig.minWidth,
|
|
3130
|
+
"max-width": $setup.splitConfig.maxWidth,
|
|
3131
|
+
"no-transition": $setup.isRestoring,
|
|
3132
|
+
dragging: $setup.isDragging,
|
|
3133
|
+
"notification-visible": $setup.notificationVisible,
|
|
3134
|
+
"notification-message": $setup.notificationMessage,
|
|
3135
|
+
"notification-mode": $setup.notificationMode,
|
|
3136
|
+
thinking: $props.thinking,
|
|
3137
|
+
"resolved-theme": $setup.resolvedTheme,
|
|
3138
|
+
"split-position": $setup.splitPosition,
|
|
3139
|
+
extension: $setup.isExtensionMode,
|
|
3140
|
+
onResize: $setup.handleResize,
|
|
3141
|
+
onResizeStart: $setup.handleResizeStart,
|
|
3142
|
+
onResizeEnd: $setup.handleResizeEnd,
|
|
3143
|
+
onToggle: $setup.handleSplitToggle
|
|
3144
|
+
}, createSlots({
|
|
3145
|
+
"sessions-empty": withCtx(() => [renderSlot(_ctx.$slots, "sessions-empty", {}, () => [_cache[0] || (_cache[0] = createElementVNode("div", { class: "opencode-session-empty" }, "暂无会话", -1))])]),
|
|
3146
|
+
_: 2
|
|
3147
|
+
}, [
|
|
3148
|
+
$setup.slots["session-toggle-icon"] ? {
|
|
3149
|
+
name: "session-toggle-icon",
|
|
3150
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "session-toggle-icon")]),
|
|
3151
|
+
key: "0"
|
|
3152
|
+
} : void 0,
|
|
3153
|
+
$setup.slots["select-icon"] ? {
|
|
3154
|
+
name: "select-icon",
|
|
3155
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "select-icon")]),
|
|
3156
|
+
key: "1"
|
|
3157
|
+
} : void 0,
|
|
3158
|
+
$setup.slots["close-icon"] ? {
|
|
3159
|
+
name: "close-icon",
|
|
3160
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "close-icon")]),
|
|
3161
|
+
key: "2"
|
|
3162
|
+
} : void 0,
|
|
3163
|
+
$setup.slots["empty-state"] ? {
|
|
3164
|
+
name: "empty-state",
|
|
3165
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "empty-state")]),
|
|
3166
|
+
key: "3"
|
|
3167
|
+
} : void 0,
|
|
3168
|
+
$setup.slots.loading ? {
|
|
3169
|
+
name: "loading",
|
|
3170
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "loading")]),
|
|
3171
|
+
key: "4"
|
|
3172
|
+
} : void 0,
|
|
3173
|
+
$setup.slots.error ? {
|
|
3174
|
+
name: "error",
|
|
3175
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "error")]),
|
|
3176
|
+
key: "5"
|
|
3177
|
+
} : void 0,
|
|
3178
|
+
$setup.slots.content ? {
|
|
3179
|
+
name: "content",
|
|
3180
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "content")]),
|
|
3181
|
+
key: "6"
|
|
3182
|
+
} : void 0
|
|
3183
|
+
]), 1032, [
|
|
3184
|
+
"mode",
|
|
3185
|
+
"open",
|
|
3186
|
+
"minimized",
|
|
3187
|
+
"position-style",
|
|
3188
|
+
"animation-origin",
|
|
3189
|
+
"panel-width",
|
|
3190
|
+
"resizable",
|
|
3191
|
+
"min-width",
|
|
3192
|
+
"max-width",
|
|
3193
|
+
"no-transition",
|
|
3194
|
+
"dragging",
|
|
3195
|
+
"notification-visible",
|
|
3196
|
+
"notification-message",
|
|
3197
|
+
"notification-mode",
|
|
3198
|
+
"thinking",
|
|
3199
|
+
"resolved-theme",
|
|
3200
|
+
"split-position",
|
|
3201
|
+
"extension",
|
|
3202
|
+
"onResize",
|
|
3203
|
+
"onToggle"
|
|
3204
|
+
]),
|
|
3205
|
+
createVNode($setup["SelectHint"])
|
|
3206
|
+
], 64)) : createCommentVNode("v-if", true),
|
|
3152
3207
|
withDirectives(createElementVNode("div", {
|
|
3153
3208
|
class: "opencode-element-highlight",
|
|
3154
3209
|
style: normalizeStyle($setup.highlightStyle)
|
|
@@ -3173,7 +3228,7 @@ __vue_sfc__.render = __vue_render__;
|
|
|
3173
3228
|
var open_code_widget_default = __vue_sfc__;
|
|
3174
3229
|
//#endregion
|
|
3175
3230
|
//#region es/index.mjs
|
|
3176
|
-
var version = "1.0.
|
|
3231
|
+
var version = "1.0.75";
|
|
3177
3232
|
function install(app, options) {
|
|
3178
3233
|
[open_code_widget_default].forEach((item) => {
|
|
3179
3234
|
if (item.install) app.use(item, options);
|