@vite-plugin-opencode-assistant/components 1.0.74 → 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/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 +189 -137
- package/lib/@vite-plugin-opencode-assistant/components.es.js +190 -138
- 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/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
|
@@ -137,7 +137,7 @@ var __vue_sfc__$8 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
137
137
|
__name: "Header",
|
|
138
138
|
setup(__props, { expose: __expose }) {
|
|
139
139
|
__expose();
|
|
140
|
-
const { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, minimized, promptDockVisible, mode, displayMode, splitPosition, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleToggleDisplayMode, handleToggleSplitPosition, handleClose, handleToggleMinimize, handleTogglePromptDock } = useOpenCodeWidgetContext();
|
|
140
|
+
const { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, minimized, promptDockVisible, mode, displayMode, splitPosition, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleToggleDisplayMode, handleToggleSplitPosition, handleClose, handleToggleMinimize, handleTogglePromptDock, handleRefresh } = useOpenCodeWidgetContext();
|
|
141
141
|
const __returned__ = {
|
|
142
142
|
title,
|
|
143
143
|
sessionListTitle,
|
|
@@ -159,6 +159,7 @@ var __vue_sfc__$8 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
159
159
|
handleClose,
|
|
160
160
|
handleToggleMinimize,
|
|
161
161
|
handleTogglePromptDock,
|
|
162
|
+
handleRefresh,
|
|
162
163
|
isSplitMode: (0, vue.computed)(() => mode.value === "split"),
|
|
163
164
|
themeIconTitle: (0, vue.computed)(() => {
|
|
164
165
|
return `\u4E3B\u9898: ${{
|
|
@@ -178,14 +179,18 @@ var __vue_sfc__$8 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
178
179
|
return `\u5C55\u793A\u6A21\u5F0F: ${{
|
|
179
180
|
bubble: "气泡模式",
|
|
180
181
|
split: "分屏模式",
|
|
181
|
-
auto: "自动模式"
|
|
182
|
+
auto: "自动模式",
|
|
183
|
+
extension: "扩展模式",
|
|
184
|
+
"extension-selector": "扩展选择器模式"
|
|
182
185
|
}[displayMode.value]}`;
|
|
183
186
|
}),
|
|
184
187
|
displayModeIconLabel: (0, vue.computed)(() => {
|
|
185
188
|
const displayModeLabels = {
|
|
186
189
|
bubble: "气泡模式",
|
|
187
190
|
split: "分屏模式",
|
|
188
|
-
auto: "自动模式"
|
|
191
|
+
auto: "自动模式",
|
|
192
|
+
extension: "扩展模式",
|
|
193
|
+
"extension-selector": "扩展选择器模式"
|
|
189
194
|
};
|
|
190
195
|
const modes = [
|
|
191
196
|
"bubble",
|
|
@@ -344,7 +349,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
344
349
|
"aria-label": $setup.sessionListTitle,
|
|
345
350
|
"aria-expanded": !$setup.sessionListCollapsed,
|
|
346
351
|
onClick: _cache[0] || (_cache[0] = (...args) => $setup.handleToggleSessionList && $setup.handleToggleSessionList(...args))
|
|
347
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "session-toggle-icon", {}, () => [_cache[
|
|
352
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "session-toggle-icon", {}, () => [_cache[9] || (_cache[9] = (0, vue.createElementVNode)("svg", {
|
|
348
353
|
viewBox: "0 0 24 24",
|
|
349
354
|
width: "16",
|
|
350
355
|
height: "16",
|
|
@@ -364,7 +369,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
364
369
|
"aria-pressed": $setup.selectMode,
|
|
365
370
|
disabled: !$setup.selectEnabled,
|
|
366
371
|
onClick: _cache[1] || (_cache[1] = (...args) => $setup.handleToggleSelectMode && $setup.handleToggleSelectMode(...args))
|
|
367
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "select-icon", {}, () => [_cache[
|
|
372
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "select-icon", {}, () => [_cache[10] || (_cache[10] = (0, vue.createElementVNode)("svg", {
|
|
368
373
|
viewBox: "0 0 1024 1024",
|
|
369
374
|
width: "16",
|
|
370
375
|
height: "16",
|
|
@@ -382,14 +387,15 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
382
387
|
title: $setup.themeIconTitle,
|
|
383
388
|
"aria-label": $setup.themeIconLabel,
|
|
384
389
|
onClick: _cache[2] || (_cache[2] = (...args) => $setup.handleToggleTheme && $setup.handleToggleTheme(...args))
|
|
385
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_6$4, [..._cache[
|
|
386
|
-
(0, vue.
|
|
390
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_6$4, [..._cache[11] || (_cache[11] = [(0, vue.createStaticVNode)("<circle cx=\"12\" cy=\"12\" r=\"5\"></circle><line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"3\"></line><line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"23\"></line><line x1=\"4.22\" y1=\"4.22\" x2=\"5.64\" y2=\"5.64\"></line><line x1=\"18.36\" y1=\"18.36\" x2=\"19.78\" y2=\"19.78\"></line><line x1=\"1\" y1=\"12\" x2=\"3\" y2=\"12\"></line><line x1=\"21\" y1=\"12\" x2=\"23\" y2=\"12\"></line><line x1=\"4.22\" y1=\"19.78\" x2=\"5.64\" y2=\"18.36\"></line><line x1=\"18.36\" y1=\"5.64\" x2=\"19.78\" y2=\"4.22\"></line>", 9)])])) : $setup.theme === "dark" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_7$3, [..._cache[12] || (_cache[12] = [(0, vue.createElementVNode)("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_8$2, [..._cache[13] || (_cache[13] = [(0, vue.createStaticVNode)("<rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" ry=\"2\"></rect><line x1=\"8\" y1=\"21\" x2=\"16\" y2=\"21\"></line><line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"21\"></line><circle cx=\"12\" cy=\"10\" r=\"3\"></circle><path d=\"M7 7l2 2M17 7l-2 2M7 13l2-2M17 13l-2-2\"></path>", 5)])]))])], 8, _hoisted_5$4),
|
|
391
|
+
$setup.displayMode !== "extension" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
392
|
+
key: 0,
|
|
387
393
|
class: "opencode-header-btn display-mode-btn",
|
|
388
394
|
type: "button",
|
|
389
395
|
title: $setup.displayModeIconTitle,
|
|
390
396
|
"aria-label": $setup.displayModeIconLabel,
|
|
391
397
|
onClick: _cache[3] || (_cache[3] = (...args) => $setup.handleToggleDisplayMode && $setup.handleToggleDisplayMode(...args))
|
|
392
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "display-mode-icon", {}, () => [$setup.displayMode === "bubble" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_10$1, [..._cache[
|
|
398
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "display-mode-icon", {}, () => [$setup.displayMode === "bubble" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_10$1, [..._cache[14] || (_cache[14] = [
|
|
393
399
|
(0, vue.createElementVNode)("circle", {
|
|
394
400
|
cx: "12",
|
|
395
401
|
cy: "12",
|
|
@@ -413,7 +419,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
413
419
|
y2: "9",
|
|
414
420
|
"stroke-linecap": "round"
|
|
415
421
|
}, null, -1)
|
|
416
|
-
])])) : $setup.displayMode === "split" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_11, [..._cache[
|
|
422
|
+
])])) : $setup.displayMode === "split" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_11, [..._cache[15] || (_cache[15] = [(0, vue.createElementVNode)("rect", {
|
|
417
423
|
x: "3",
|
|
418
424
|
y: "3",
|
|
419
425
|
width: "18",
|
|
@@ -424,7 +430,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
424
430
|
y1: "3",
|
|
425
431
|
x2: "12",
|
|
426
432
|
y2: "21"
|
|
427
|
-
}, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_12, [..._cache[
|
|
433
|
+
}, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_12, [..._cache[16] || (_cache[16] = [
|
|
428
434
|
(0, vue.createElementVNode)("rect", {
|
|
429
435
|
x: "3",
|
|
430
436
|
y: "3",
|
|
@@ -451,18 +457,34 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
451
457
|
cy: "18",
|
|
452
458
|
r: "3"
|
|
453
459
|
}, null, -1)
|
|
454
|
-
])]))])], 8, _hoisted_9$1)
|
|
460
|
+
])]))])], 8, _hoisted_9$1)) : (0, vue.createCommentVNode)("v-if", true)
|
|
455
461
|
]),
|
|
456
462
|
(0, vue.createElementVNode)("span", _hoisted_13, (0, vue.toDisplayString)($setup.title), 1),
|
|
457
463
|
(0, vue.createElementVNode)("div", _hoisted_14, [
|
|
458
|
-
$setup.
|
|
464
|
+
$setup.displayMode === "extension" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
459
465
|
key: 0,
|
|
466
|
+
class: "opencode-header-btn refresh-btn",
|
|
467
|
+
type: "button",
|
|
468
|
+
title: "刷新面板",
|
|
469
|
+
"aria-label": "刷新面板",
|
|
470
|
+
onClick: _cache[4] || (_cache[4] = (...args) => $setup.handleRefresh && $setup.handleRefresh(...args))
|
|
471
|
+
}, [..._cache[17] || (_cache[17] = [(0, vue.createElementVNode)("svg", {
|
|
472
|
+
viewBox: "0 0 24 24",
|
|
473
|
+
width: "16",
|
|
474
|
+
height: "16",
|
|
475
|
+
fill: "none",
|
|
476
|
+
stroke: "currentColor",
|
|
477
|
+
"stroke-width": "2",
|
|
478
|
+
"aria-hidden": "true"
|
|
479
|
+
}, [(0, vue.createElementVNode)("polyline", { points: "23,4 23,10 17,10" }), (0, vue.createElementVNode)("path", { d: "M20.49 15a9 9 0 1 1-2.12-9.36L23 10" })], -1)])])) : (0, vue.createCommentVNode)("v-if", true),
|
|
480
|
+
$setup.isSplitMode && $setup.displayMode !== "extension" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
481
|
+
key: 1,
|
|
460
482
|
class: "opencode-header-btn split-position-btn",
|
|
461
483
|
type: "button",
|
|
462
484
|
title: $setup.splitPositionIconTitle,
|
|
463
485
|
"aria-label": $setup.splitPositionIconLabel,
|
|
464
|
-
onClick: _cache[
|
|
465
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "split-position-icon", {}, () => [$setup.splitPosition === "right" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_16, [..._cache[
|
|
486
|
+
onClick: _cache[5] || (_cache[5] = (...args) => $setup.handleToggleSplitPosition && $setup.handleToggleSplitPosition(...args))
|
|
487
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "split-position-icon", {}, () => [$setup.splitPosition === "right" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_16, [..._cache[18] || (_cache[18] = [(0, vue.createElementVNode)("rect", {
|
|
466
488
|
x: "3",
|
|
467
489
|
y: "3",
|
|
468
490
|
width: "18",
|
|
@@ -473,7 +495,7 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
473
495
|
y1: "3",
|
|
474
496
|
x2: "15",
|
|
475
497
|
y2: "21"
|
|
476
|
-
}, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_17, [..._cache[
|
|
498
|
+
}, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_17, [..._cache[19] || (_cache[19] = [(0, vue.createElementVNode)("rect", {
|
|
477
499
|
x: "3",
|
|
478
500
|
y: "3",
|
|
479
501
|
width: "18",
|
|
@@ -486,14 +508,14 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
486
508
|
y2: "21"
|
|
487
509
|
}, null, -1)])]))])], 8, _hoisted_15)) : (0, vue.createCommentVNode)("v-if", true),
|
|
488
510
|
!$setup.isSplitMode ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
489
|
-
key:
|
|
511
|
+
key: 2,
|
|
490
512
|
class: "opencode-header-btn prompt-dock",
|
|
491
513
|
type: "button",
|
|
492
514
|
title: $setup.promptDockVisible ? "隐藏对话框" : "显示对话框",
|
|
493
515
|
"aria-label": $setup.promptDockVisible ? "隐藏对话框" : "显示对话框",
|
|
494
516
|
"aria-pressed": $setup.promptDockVisible,
|
|
495
|
-
onClick: _cache[
|
|
496
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "prompt-dock-icon", {}, () => [_cache[
|
|
517
|
+
onClick: _cache[6] || (_cache[6] = (...args) => $setup.handleTogglePromptDock && $setup.handleTogglePromptDock(...args))
|
|
518
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "prompt-dock-icon", {}, () => [_cache[20] || (_cache[20] = (0, vue.createElementVNode)("svg", {
|
|
497
519
|
viewBox: "0 0 24 24",
|
|
498
520
|
width: "14",
|
|
499
521
|
height: "14",
|
|
@@ -503,22 +525,22 @@ function __vue_render__$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
503
525
|
"aria-hidden": "true"
|
|
504
526
|
}, [(0, vue.createElementVNode)("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })], -1))])], 8, _hoisted_18)) : (0, vue.createCommentVNode)("v-if", true),
|
|
505
527
|
!$setup.isSplitMode ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
506
|
-
key:
|
|
528
|
+
key: 3,
|
|
507
529
|
class: "opencode-header-btn minimize",
|
|
508
530
|
type: "button",
|
|
509
531
|
title: $setup.minimized ? "展开" : "最小化",
|
|
510
532
|
"aria-label": $setup.minimized ? "展开面板" : "最小化面板",
|
|
511
533
|
"aria-pressed": $setup.minimized,
|
|
512
|
-
onClick: _cache[
|
|
513
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "minimize-icon", {}, () => [$setup.minimized ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_20, [..._cache[
|
|
534
|
+
onClick: _cache[7] || (_cache[7] = (...args) => $setup.handleToggleMinimize && $setup.handleToggleMinimize(...args))
|
|
535
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "minimize-icon", {}, () => [$setup.minimized ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_20, [..._cache[21] || (_cache[21] = [(0, vue.createElementVNode)("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" }, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_21, [..._cache[22] || (_cache[22] = [(0, vue.createElementVNode)("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" }, null, -1)])]))])], 8, _hoisted_19)) : (0, vue.createCommentVNode)("v-if", true),
|
|
514
536
|
!$setup.isSplitMode ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
515
|
-
key:
|
|
537
|
+
key: 4,
|
|
516
538
|
class: "opencode-header-btn close",
|
|
517
539
|
type: "button",
|
|
518
540
|
title: "关闭",
|
|
519
541
|
"aria-label": "关闭面板",
|
|
520
|
-
onClick: _cache[
|
|
521
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "close-icon", {}, () => [_cache[
|
|
542
|
+
onClick: _cache[8] || (_cache[8] = (...args) => $setup.handleClose && $setup.handleClose(...args))
|
|
543
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "close-icon", {}, () => [_cache[23] || (_cache[23] = (0, vue.createElementVNode)("svg", {
|
|
522
544
|
viewBox: "0 0 24 24",
|
|
523
545
|
width: "14",
|
|
524
546
|
height: "14",
|
|
@@ -939,6 +961,11 @@ var __vue_sfc__$4 = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps$2(__s
|
|
|
939
961
|
type: String,
|
|
940
962
|
required: false,
|
|
941
963
|
default: "right"
|
|
964
|
+
},
|
|
965
|
+
extension: {
|
|
966
|
+
type: Boolean,
|
|
967
|
+
required: false,
|
|
968
|
+
default: false
|
|
942
969
|
}
|
|
943
970
|
},
|
|
944
971
|
emits: [
|
|
@@ -987,6 +1014,7 @@ var __vue_sfc__$4 = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps$2(__s
|
|
|
987
1014
|
handleResizeEnd,
|
|
988
1015
|
handleToggle,
|
|
989
1016
|
panelStyle: (0, vue.computed)(() => {
|
|
1017
|
+
if (props.extension) return {};
|
|
990
1018
|
if (props.mode === "split") return { width: `${props.panelWidth}px` };
|
|
991
1019
|
return props.positionStyle;
|
|
992
1020
|
}),
|
|
@@ -996,8 +1024,9 @@ var __vue_sfc__$4 = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps$2(__s
|
|
|
996
1024
|
dragging: props.dragging,
|
|
997
1025
|
"no-transition": props.noTransition,
|
|
998
1026
|
"split-mode": props.mode === "split",
|
|
999
|
-
"split-left": props.mode === "split" && props.splitPosition === "left",
|
|
1000
|
-
"split-right": props.mode === "split" && props.splitPosition === "right"
|
|
1027
|
+
"split-left": props.mode === "split" && props.splitPosition === "left" && !props.extension,
|
|
1028
|
+
"split-right": props.mode === "split" && props.splitPosition === "right" && !props.extension,
|
|
1029
|
+
"extension-mode": props.extension
|
|
1001
1030
|
}]),
|
|
1002
1031
|
Frame: Frame_vue_default,
|
|
1003
1032
|
Header: Header_vue_default,
|
|
@@ -1076,7 +1105,7 @@ function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1076
1105
|
"max-width",
|
|
1077
1106
|
"position"
|
|
1078
1107
|
])) : (0, vue.createCommentVNode)("v-if", true),
|
|
1079
|
-
$props.mode === "split" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
1108
|
+
$props.mode === "split" && $props.resizable ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
1080
1109
|
key: 1,
|
|
1081
1110
|
type: "button",
|
|
1082
1111
|
class: (0, vue.normalizeClass)(["opencode-split-toggle-btn", {
|
|
@@ -2278,21 +2307,24 @@ function useSplitMode(options) {
|
|
|
2278
2307
|
var _a, _b;
|
|
2279
2308
|
const windowWidth = (0, vue.ref)(typeof window !== "undefined" ? window.innerWidth : 0);
|
|
2280
2309
|
const localSplitPosition = (0, vue.ref)((_b = (_a = options.splitPosition) == null ? void 0 : _a.value) != null ? _b : "right");
|
|
2310
|
+
const isExtensionMode = (0, vue.computed)(() => options.displayMode.value === "extension");
|
|
2281
2311
|
const splitConfig = (0, vue.computed)(() => {
|
|
2282
2312
|
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
2283
2313
|
const config = options.splitMode.value || {};
|
|
2314
|
+
const isExt = isExtensionMode.value;
|
|
2284
2315
|
return {
|
|
2285
2316
|
width: (_a2 = config.width) != null ? _a2 : 500,
|
|
2286
2317
|
minWidth: (_b2 = config.minWidth) != null ? _b2 : 400,
|
|
2287
2318
|
maxWidth: (_c = config.maxWidth) != null ? _c : 800,
|
|
2288
|
-
resizable: (_d = config.resizable) != null ? _d : true,
|
|
2289
|
-
shrinkPage: (_e = config.shrinkPage) != null ? _e : true,
|
|
2290
|
-
defaultOpen: (_f = config.defaultOpen) != null ? _f : true,
|
|
2319
|
+
resizable: isExt ? false : (_d = config.resizable) != null ? _d : true,
|
|
2320
|
+
shrinkPage: isExt ? false : (_e = config.shrinkPage) != null ? _e : true,
|
|
2321
|
+
defaultOpen: isExt ? true : (_f = config.defaultOpen) != null ? _f : true,
|
|
2291
2322
|
position: (_g = config.position) != null ? _g : localSplitPosition.value
|
|
2292
2323
|
};
|
|
2293
2324
|
});
|
|
2294
2325
|
const panelWidth = (0, vue.ref)(splitConfig.value.width);
|
|
2295
2326
|
const effectiveMode = (0, vue.computed)(() => {
|
|
2327
|
+
if (isExtensionMode.value) return "split";
|
|
2296
2328
|
if (options.displayMode.value === "bubble") return "bubble";
|
|
2297
2329
|
if (options.displayMode.value === "split") return "split";
|
|
2298
2330
|
return windowWidth.value >= AUTO_MODE_THRESHOLD ? "split" : "bubble";
|
|
@@ -2320,6 +2352,7 @@ function useSplitMode(options) {
|
|
|
2320
2352
|
};
|
|
2321
2353
|
const updateBodyClass = () => {
|
|
2322
2354
|
if (typeof document === "undefined") return;
|
|
2355
|
+
if (isExtensionMode.value) return;
|
|
2323
2356
|
if (isSplitMode.value && options.open.value && splitConfig.value.shrinkPage) {
|
|
2324
2357
|
document.body.classList.add("has-opencode-split");
|
|
2325
2358
|
document.body.style.setProperty("--opencode-split-width", `${panelWidth.value}px`);
|
|
@@ -2357,21 +2390,24 @@ function useSplitMode(options) {
|
|
|
2357
2390
|
var _a2;
|
|
2358
2391
|
if (typeof window !== "undefined") {
|
|
2359
2392
|
window.addEventListener("resize", handleWindowResize);
|
|
2360
|
-
if (isSplitMode.value && splitConfig.value.defaultOpen && !options.open.value) (_a2 = options.onOpenChange) == null || _a2.call(options, true);
|
|
2393
|
+
if (!isExtensionMode.value && isSplitMode.value && splitConfig.value.defaultOpen && !options.open.value) (_a2 = options.onOpenChange) == null || _a2.call(options, true);
|
|
2361
2394
|
}
|
|
2362
2395
|
});
|
|
2363
2396
|
(0, vue.onUnmounted)(() => {
|
|
2364
2397
|
if (typeof window !== "undefined") {
|
|
2365
2398
|
window.removeEventListener("resize", handleWindowResize);
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2399
|
+
if (!isExtensionMode.value) {
|
|
2400
|
+
document.body.classList.remove("has-opencode-split");
|
|
2401
|
+
document.body.classList.remove("has-opencode-split-left");
|
|
2402
|
+
document.body.classList.remove("has-opencode-split-right");
|
|
2403
|
+
document.body.style.removeProperty("--opencode-split-width");
|
|
2404
|
+
}
|
|
2370
2405
|
}
|
|
2371
2406
|
});
|
|
2372
2407
|
return {
|
|
2373
2408
|
effectiveMode,
|
|
2374
2409
|
isSplitMode,
|
|
2410
|
+
isExtensionMode,
|
|
2375
2411
|
panelWidth,
|
|
2376
2412
|
splitConfig,
|
|
2377
2413
|
splitPosition,
|
|
@@ -2532,6 +2568,11 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2532
2568
|
type: Number,
|
|
2533
2569
|
required: false,
|
|
2534
2570
|
default: 500
|
|
2571
|
+
},
|
|
2572
|
+
hideBubble: {
|
|
2573
|
+
type: Boolean,
|
|
2574
|
+
required: false,
|
|
2575
|
+
default: false
|
|
2535
2576
|
}
|
|
2536
2577
|
},
|
|
2537
2578
|
emits: [
|
|
@@ -2616,8 +2657,8 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2616
2657
|
const splitPanelWidth = (0, vue.ref)(props.splitPanelWidth);
|
|
2617
2658
|
const syncStateToIframe = () => {
|
|
2618
2659
|
if (!iframeLoaded.value) return;
|
|
2619
|
-
sendMessageToIframe(
|
|
2620
|
-
sendMessageToIframe(
|
|
2660
|
+
sendMessageToIframe(_vite_plugin_opencode_assistant_shared.WIDGET_MSG.PROMPT_DOCK_VISIBILITY, { visible: promptDockVisible.value });
|
|
2661
|
+
sendMessageToIframe(_vite_plugin_opencode_assistant_shared.WIDGET_MSG.MINIMIZE_STATE, { minimized: minimized.value });
|
|
2621
2662
|
};
|
|
2622
2663
|
const handleFrameLoaded = () => {
|
|
2623
2664
|
emit("frame-loaded");
|
|
@@ -2634,6 +2675,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2634
2675
|
localDisplayMode.value = val;
|
|
2635
2676
|
});
|
|
2636
2677
|
const handleToggleDisplayMode = () => {
|
|
2678
|
+
if (localDisplayMode.value === "extension" || localDisplayMode.value === "extension-selector") return;
|
|
2637
2679
|
const modes = [
|
|
2638
2680
|
"bubble",
|
|
2639
2681
|
"split",
|
|
@@ -2713,7 +2755,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2713
2755
|
}
|
|
2714
2756
|
});
|
|
2715
2757
|
const bubbleOffset = (0, vue.ref)(void 0);
|
|
2716
|
-
const { effectiveMode, isSplitMode, panelWidth, splitConfig, splitPosition, handleResize, handleToggle: handleSplitToggle, handleTogglePosition } = useSplitMode({
|
|
2758
|
+
const { effectiveMode, isSplitMode, isExtensionMode, panelWidth, splitConfig, splitPosition, handleResize, handleToggle: handleSplitToggle, handleTogglePosition } = useSplitMode({
|
|
2717
2759
|
displayMode: localDisplayMode,
|
|
2718
2760
|
splitMode: (0, vue.toRef)(props, "splitMode"),
|
|
2719
2761
|
open: (0, vue.toRef)(props, "open"),
|
|
@@ -2781,12 +2823,15 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2781
2823
|
const handleToggleMinimize = () => {
|
|
2782
2824
|
minimized.value = !minimized.value;
|
|
2783
2825
|
promptDockVisible.value = !minimized.value;
|
|
2784
|
-
sendMessageToIframe(
|
|
2785
|
-
sendMessageToIframe(
|
|
2826
|
+
sendMessageToIframe(_vite_plugin_opencode_assistant_shared.WIDGET_MSG.PROMPT_DOCK_VISIBILITY, { visible: promptDockVisible.value });
|
|
2827
|
+
sendMessageToIframe(_vite_plugin_opencode_assistant_shared.WIDGET_MSG.MINIMIZE_STATE, { minimized: minimized.value });
|
|
2786
2828
|
};
|
|
2787
2829
|
const handleTogglePromptDock = () => {
|
|
2788
2830
|
promptDockVisible.value = !promptDockVisible.value;
|
|
2789
|
-
sendMessageToIframe(
|
|
2831
|
+
sendMessageToIframe(_vite_plugin_opencode_assistant_shared.WIDGET_MSG.PROMPT_DOCK_VISIBILITY, { visible: promptDockVisible.value });
|
|
2832
|
+
};
|
|
2833
|
+
const handleRefresh = () => {
|
|
2834
|
+
window.location.reload();
|
|
2790
2835
|
};
|
|
2791
2836
|
const windowWidth = (0, vue.ref)(typeof window !== "undefined" ? window.innerWidth : 0);
|
|
2792
2837
|
const windowHeight = (0, vue.ref)(typeof window !== "undefined" ? window.innerHeight : 0);
|
|
@@ -2951,7 +2996,8 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
2951
2996
|
handleRemoveSelectedNode: (payload) => handleRemoveSelectedNode(payload.item, payload.index, payload.source),
|
|
2952
2997
|
handleClearSelectedNodes,
|
|
2953
2998
|
handleFrameLoaded,
|
|
2954
|
-
handleBubbleOffsetChange
|
|
2999
|
+
handleBubbleOffsetChange,
|
|
3000
|
+
handleRefresh
|
|
2955
3001
|
});
|
|
2956
3002
|
__expose({
|
|
2957
3003
|
showNotification,
|
|
@@ -3027,6 +3073,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
3027
3073
|
bubbleOffset,
|
|
3028
3074
|
effectiveMode,
|
|
3029
3075
|
isSplitMode,
|
|
3076
|
+
isExtensionMode,
|
|
3030
3077
|
panelWidth,
|
|
3031
3078
|
splitConfig,
|
|
3032
3079
|
splitPosition,
|
|
@@ -3035,6 +3082,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
3035
3082
|
handleTogglePosition,
|
|
3036
3083
|
handleToggleMinimize,
|
|
3037
3084
|
handleTogglePromptDock,
|
|
3085
|
+
handleRefresh,
|
|
3038
3086
|
windowWidth,
|
|
3039
3087
|
windowHeight,
|
|
3040
3088
|
handleWindowResize,
|
|
@@ -3084,101 +3132,105 @@ var _hoisted_7 = {
|
|
|
3084
3132
|
role: "alert"
|
|
3085
3133
|
};
|
|
3086
3134
|
function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3087
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)($setup.
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
} : void 0]), 1536)) : (0, vue.createCommentVNode)("v-if", true),
|
|
3098
|
-
(0, vue.createVNode)($setup["ChatPanel"], {
|
|
3099
|
-
ref: "frameRef",
|
|
3100
|
-
mode: $setup.effectiveMode,
|
|
3101
|
-
open: $props.open,
|
|
3102
|
-
minimized: $setup.minimized,
|
|
3103
|
-
"position-style": $setup.chatPositionStyle,
|
|
3104
|
-
"animation-origin": $setup.chatAnimationOrigin,
|
|
3105
|
-
"panel-width": $setup.panelWidth,
|
|
3106
|
-
resizable: $setup.splitConfig.resizable,
|
|
3107
|
-
"min-width": $setup.splitConfig.minWidth,
|
|
3108
|
-
"max-width": $setup.splitConfig.maxWidth,
|
|
3109
|
-
"no-transition": $setup.isRestoring,
|
|
3110
|
-
dragging: $setup.isDragging,
|
|
3111
|
-
"notification-visible": $setup.notificationVisible,
|
|
3112
|
-
"notification-message": $setup.notificationMessage,
|
|
3113
|
-
"notification-mode": $setup.notificationMode,
|
|
3114
|
-
thinking: $props.thinking,
|
|
3115
|
-
"resolved-theme": $setup.resolvedTheme,
|
|
3116
|
-
"split-position": $setup.splitPosition,
|
|
3117
|
-
onResize: $setup.handleResize,
|
|
3118
|
-
onResizeStart: $setup.handleResizeStart,
|
|
3119
|
-
onResizeEnd: $setup.handleResizeEnd,
|
|
3120
|
-
onToggle: $setup.handleSplitToggle
|
|
3121
|
-
}, (0, vue.createSlots)({
|
|
3122
|
-
"sessions-empty": (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "sessions-empty", {}, () => [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("div", { class: "opencode-session-empty" }, "暂无会话", -1))])]),
|
|
3123
|
-
_: 2
|
|
3124
|
-
}, [
|
|
3125
|
-
$setup.slots["session-toggle-icon"] ? {
|
|
3126
|
-
name: "session-toggle-icon",
|
|
3127
|
-
fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "session-toggle-icon")]),
|
|
3135
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([...$setup.containerClasses, { "extension-mode": $setup.isExtensionMode }]) }, [
|
|
3136
|
+
$props.displayMode !== "extension-selector" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [
|
|
3137
|
+
!$setup.isSplitMode && !$setup.props.hideBubble ? ((0, vue.openBlock)(), (0, vue.createBlock)($setup["Trigger"], {
|
|
3138
|
+
key: 0,
|
|
3139
|
+
ref: "triggerRef",
|
|
3140
|
+
onDragStart: $setup.handleDragStart,
|
|
3141
|
+
onDragEnd: $setup.handleDragEnd
|
|
3142
|
+
}, (0, vue.createSlots)({ _: 2 }, [$setup.slots["button-icon"] ? {
|
|
3143
|
+
name: "default",
|
|
3144
|
+
fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "button-icon")]),
|
|
3128
3145
|
key: "0"
|
|
3129
|
-
} : void 0,
|
|
3130
|
-
$setup
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
}
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3146
|
+
} : void 0]), 1536)) : (0, vue.createCommentVNode)("v-if", true),
|
|
3147
|
+
(0, vue.createVNode)($setup["ChatPanel"], {
|
|
3148
|
+
ref: "frameRef",
|
|
3149
|
+
mode: $setup.effectiveMode,
|
|
3150
|
+
open: $props.open,
|
|
3151
|
+
minimized: $setup.minimized,
|
|
3152
|
+
"position-style": $setup.chatPositionStyle,
|
|
3153
|
+
"animation-origin": $setup.chatAnimationOrigin,
|
|
3154
|
+
"panel-width": $setup.panelWidth,
|
|
3155
|
+
resizable: $setup.splitConfig.resizable,
|
|
3156
|
+
"min-width": $setup.splitConfig.minWidth,
|
|
3157
|
+
"max-width": $setup.splitConfig.maxWidth,
|
|
3158
|
+
"no-transition": $setup.isRestoring,
|
|
3159
|
+
dragging: $setup.isDragging,
|
|
3160
|
+
"notification-visible": $setup.notificationVisible,
|
|
3161
|
+
"notification-message": $setup.notificationMessage,
|
|
3162
|
+
"notification-mode": $setup.notificationMode,
|
|
3163
|
+
thinking: $props.thinking,
|
|
3164
|
+
"resolved-theme": $setup.resolvedTheme,
|
|
3165
|
+
"split-position": $setup.splitPosition,
|
|
3166
|
+
extension: $setup.isExtensionMode,
|
|
3167
|
+
onResize: $setup.handleResize,
|
|
3168
|
+
onResizeStart: $setup.handleResizeStart,
|
|
3169
|
+
onResizeEnd: $setup.handleResizeEnd,
|
|
3170
|
+
onToggle: $setup.handleSplitToggle
|
|
3171
|
+
}, (0, vue.createSlots)({
|
|
3172
|
+
"sessions-empty": (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "sessions-empty", {}, () => [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("div", { class: "opencode-session-empty" }, "暂无会话", -1))])]),
|
|
3173
|
+
_: 2
|
|
3174
|
+
}, [
|
|
3175
|
+
$setup.slots["session-toggle-icon"] ? {
|
|
3176
|
+
name: "session-toggle-icon",
|
|
3177
|
+
fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "session-toggle-icon")]),
|
|
3178
|
+
key: "0"
|
|
3179
|
+
} : void 0,
|
|
3180
|
+
$setup.slots["select-icon"] ? {
|
|
3181
|
+
name: "select-icon",
|
|
3182
|
+
fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "select-icon")]),
|
|
3183
|
+
key: "1"
|
|
3184
|
+
} : void 0,
|
|
3185
|
+
$setup.slots["close-icon"] ? {
|
|
3186
|
+
name: "close-icon",
|
|
3187
|
+
fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "close-icon")]),
|
|
3188
|
+
key: "2"
|
|
3189
|
+
} : void 0,
|
|
3190
|
+
$setup.slots["empty-state"] ? {
|
|
3191
|
+
name: "empty-state",
|
|
3192
|
+
fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "empty-state")]),
|
|
3193
|
+
key: "3"
|
|
3194
|
+
} : void 0,
|
|
3195
|
+
$setup.slots.loading ? {
|
|
3196
|
+
name: "loading",
|
|
3197
|
+
fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "loading")]),
|
|
3198
|
+
key: "4"
|
|
3199
|
+
} : void 0,
|
|
3200
|
+
$setup.slots.error ? {
|
|
3201
|
+
name: "error",
|
|
3202
|
+
fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "error")]),
|
|
3203
|
+
key: "5"
|
|
3204
|
+
} : void 0,
|
|
3205
|
+
$setup.slots.content ? {
|
|
3206
|
+
name: "content",
|
|
3207
|
+
fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "content")]),
|
|
3208
|
+
key: "6"
|
|
3209
|
+
} : void 0
|
|
3210
|
+
]), 1032, [
|
|
3211
|
+
"mode",
|
|
3212
|
+
"open",
|
|
3213
|
+
"minimized",
|
|
3214
|
+
"position-style",
|
|
3215
|
+
"animation-origin",
|
|
3216
|
+
"panel-width",
|
|
3217
|
+
"resizable",
|
|
3218
|
+
"min-width",
|
|
3219
|
+
"max-width",
|
|
3220
|
+
"no-transition",
|
|
3221
|
+
"dragging",
|
|
3222
|
+
"notification-visible",
|
|
3223
|
+
"notification-message",
|
|
3224
|
+
"notification-mode",
|
|
3225
|
+
"thinking",
|
|
3226
|
+
"resolved-theme",
|
|
3227
|
+
"split-position",
|
|
3228
|
+
"extension",
|
|
3229
|
+
"onResize",
|
|
3230
|
+
"onToggle"
|
|
3231
|
+
]),
|
|
3232
|
+
(0, vue.createVNode)($setup["SelectHint"])
|
|
3233
|
+
], 64)) : (0, vue.createCommentVNode)("v-if", true),
|
|
3182
3234
|
(0, vue.withDirectives)((0, vue.createElementVNode)("div", {
|
|
3183
3235
|
class: "opencode-element-highlight",
|
|
3184
3236
|
style: (0, vue.normalizeStyle)($setup.highlightStyle)
|
|
@@ -3203,7 +3255,7 @@ __vue_sfc__.render = __vue_render__;
|
|
|
3203
3255
|
var open_code_widget_default = __vue_sfc__;
|
|
3204
3256
|
//#endregion
|
|
3205
3257
|
//#region es/index.mjs
|
|
3206
|
-
var version = "1.0.
|
|
3258
|
+
var version = "1.0.75";
|
|
3207
3259
|
function install(app, options) {
|
|
3208
3260
|
[open_code_widget_default].forEach((item) => {
|
|
3209
3261
|
if (item.install) app.use(item, options);
|