@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.
Files changed (33) hide show
  1. package/es/index.d.ts +1 -1
  2. package/es/index.mjs +1 -1
  3. package/es/open-code-widget/composables/use-split.d.ts +1 -0
  4. package/es/open-code-widget/composables/use-split.mjs +15 -8
  5. package/es/open-code-widget/src/components/ChatPanel-sfc.css +1 -1
  6. package/es/open-code-widget/src/components/ChatPanel.vue.d.ts +2 -0
  7. package/es/open-code-widget/src/components/ChatPanel.vue.mjs +9 -4
  8. package/es/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.mjs +11 -2
  9. package/es/open-code-widget/src/components/Frame-sfc.css +1 -1
  10. package/es/open-code-widget/src/components/Header.vue.mjs +61 -28
  11. package/es/open-code-widget/src/context.d.ts +1 -0
  12. package/es/open-code-widget/src/index-sfc.css +1 -1
  13. package/es/open-code-widget/src/index.vue.d.ts +1 -0
  14. package/es/open-code-widget/src/index.vue.mjs +137 -120
  15. package/lib/@vite-plugin-opencode-assistant/components.cjs.js +195 -140
  16. package/lib/@vite-plugin-opencode-assistant/components.es.js +196 -141
  17. package/lib/components.css +3 -3
  18. package/lib/index.cjs +1 -1
  19. package/lib/index.d.ts +1 -1
  20. package/lib/open-code-widget/composables/use-split.cjs +15 -8
  21. package/lib/open-code-widget/composables/use-split.d.ts +1 -0
  22. package/lib/open-code-widget/src/components/ChatPanel-sfc.css +1 -1
  23. package/lib/open-code-widget/src/components/ChatPanel.vue.cjs +9 -4
  24. package/lib/open-code-widget/src/components/ChatPanel.vue.d.ts +2 -0
  25. package/lib/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.cjs +11 -2
  26. package/lib/open-code-widget/src/components/Frame-sfc.css +1 -1
  27. package/lib/open-code-widget/src/components/Header.vue.cjs +61 -28
  28. package/lib/open-code-widget/src/context.d.ts +1 -0
  29. package/lib/open-code-widget/src/index-sfc.css +1 -1
  30. package/lib/open-code-widget/src/index.vue.cjs +136 -119
  31. package/lib/open-code-widget/src/index.vue.d.ts +1 -0
  32. package/lib/web-types.json +1 -1
  33. 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[8] || (_cache[8] = (0, vue.createElementVNode)("svg", {
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[9] || (_cache[9] = (0, vue.createElementVNode)("svg", {
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[10] || (_cache[10] = [(0, vue.createStaticVNode)("<circle cx=\"12\" cy=\"12\" r=\"5\"></circle><line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"3\"></line><line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"23\"></line><line x1=\"4.22\" y1=\"4.22\" x2=\"5.64\" y2=\"5.64\"></line><line x1=\"18.36\" y1=\"18.36\" x2=\"19.78\" y2=\"19.78\"></line><line x1=\"1\" y1=\"12\" x2=\"3\" y2=\"12\"></line><line x1=\"21\" y1=\"12\" x2=\"23\" y2=\"12\"></line><line x1=\"4.22\" y1=\"19.78\" x2=\"5.64\" y2=\"18.36\"></line><line x1=\"18.36\" y1=\"5.64\" x2=\"19.78\" y2=\"4.22\"></line>", 9)])])) : $setup.theme === "dark" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_7$3, [..._cache[11] || (_cache[11] = [(0, vue.createElementVNode)("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_8$2, [..._cache[12] || (_cache[12] = [(0, vue.createStaticVNode)("<rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" ry=\"2\"></rect><line x1=\"8\" y1=\"21\" x2=\"16\" y2=\"21\"></line><line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"21\"></line><circle cx=\"12\" cy=\"10\" r=\"3\"></circle><path d=\"M7 7l2 2M17 7l-2 2M7 13l2-2M17 13l-2-2\"></path>", 5)])]))])], 8, _hoisted_5$4),
386
- (0, vue.createElementVNode)("button", {
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[13] || (_cache[13] = [
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[14] || (_cache[14] = [(0, vue.createElementVNode)("rect", {
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[15] || (_cache[15] = [
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.isSplitMode ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
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[4] || (_cache[4] = (...args) => $setup.handleToggleSplitPosition && $setup.handleToggleSplitPosition(...args))
465
- }, [(0, vue.renderSlot)(_ctx.$slots, "split-position-icon", {}, () => [$setup.splitPosition === "right" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_16, [..._cache[16] || (_cache[16] = [(0, vue.createElementVNode)("rect", {
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[17] || (_cache[17] = [(0, vue.createElementVNode)("rect", {
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: 1,
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[5] || (_cache[5] = (...args) => $setup.handleTogglePromptDock && $setup.handleTogglePromptDock(...args))
496
- }, [(0, vue.renderSlot)(_ctx.$slots, "prompt-dock-icon", {}, () => [_cache[18] || (_cache[18] = (0, vue.createElementVNode)("svg", {
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: 2,
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[6] || (_cache[6] = (...args) => $setup.handleToggleMinimize && $setup.handleToggleMinimize(...args))
513
- }, [(0, vue.renderSlot)(_ctx.$slots, "minimize-icon", {}, () => [$setup.minimized ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_20, [..._cache[19] || (_cache[19] = [(0, vue.createElementVNode)("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" }, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_21, [..._cache[20] || (_cache[20] = [(0, vue.createElementVNode)("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" }, null, -1)])]))])], 8, _hoisted_19)) : (0, vue.createCommentVNode)("v-if", true),
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: 3,
537
+ key: 4,
516
538
  class: "opencode-header-btn close",
517
539
  type: "button",
518
540
  title: "关闭",
519
541
  "aria-label": "关闭面板",
520
- onClick: _cache[7] || (_cache[7] = (...args) => $setup.handleClose && $setup.handleClose(...args))
521
- }, [(0, vue.renderSlot)(_ctx.$slots, "close-icon", {}, () => [_cache[21] || (_cache[21] = (0, vue.createElementVNode)("svg", {
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", {
@@ -1442,9 +1471,12 @@ var __vue_sfc__$2 = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps$1(__s
1442
1471
  windowWidth,
1443
1472
  windowHeight,
1444
1473
  gapX,
1445
- gapY,
1446
- () => props.offset
1447
- ], updateState, { deep: true });
1474
+ gapY
1475
+ ], updateState);
1476
+ (0, vue.watch)(() => props.offset, (newOffset) => {
1477
+ if (newOffset) magneticSide.value = null;
1478
+ updateState();
1479
+ }, { deep: true });
1448
1480
  __expose({ offset: (0, vue.computed)(() => ({
1449
1481
  x: state.value.x,
1450
1482
  y: state.value.y
@@ -2275,21 +2307,24 @@ function useSplitMode(options) {
2275
2307
  var _a, _b;
2276
2308
  const windowWidth = (0, vue.ref)(typeof window !== "undefined" ? window.innerWidth : 0);
2277
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");
2278
2311
  const splitConfig = (0, vue.computed)(() => {
2279
2312
  var _a2, _b2, _c, _d, _e, _f, _g;
2280
2313
  const config = options.splitMode.value || {};
2314
+ const isExt = isExtensionMode.value;
2281
2315
  return {
2282
2316
  width: (_a2 = config.width) != null ? _a2 : 500,
2283
2317
  minWidth: (_b2 = config.minWidth) != null ? _b2 : 400,
2284
2318
  maxWidth: (_c = config.maxWidth) != null ? _c : 800,
2285
- resizable: (_d = config.resizable) != null ? _d : true,
2286
- shrinkPage: (_e = config.shrinkPage) != null ? _e : true,
2287
- 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,
2288
2322
  position: (_g = config.position) != null ? _g : localSplitPosition.value
2289
2323
  };
2290
2324
  });
2291
2325
  const panelWidth = (0, vue.ref)(splitConfig.value.width);
2292
2326
  const effectiveMode = (0, vue.computed)(() => {
2327
+ if (isExtensionMode.value) return "split";
2293
2328
  if (options.displayMode.value === "bubble") return "bubble";
2294
2329
  if (options.displayMode.value === "split") return "split";
2295
2330
  return windowWidth.value >= AUTO_MODE_THRESHOLD ? "split" : "bubble";
@@ -2317,6 +2352,7 @@ function useSplitMode(options) {
2317
2352
  };
2318
2353
  const updateBodyClass = () => {
2319
2354
  if (typeof document === "undefined") return;
2355
+ if (isExtensionMode.value) return;
2320
2356
  if (isSplitMode.value && options.open.value && splitConfig.value.shrinkPage) {
2321
2357
  document.body.classList.add("has-opencode-split");
2322
2358
  document.body.style.setProperty("--opencode-split-width", `${panelWidth.value}px`);
@@ -2354,21 +2390,24 @@ function useSplitMode(options) {
2354
2390
  var _a2;
2355
2391
  if (typeof window !== "undefined") {
2356
2392
  window.addEventListener("resize", handleWindowResize);
2357
- 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);
2358
2394
  }
2359
2395
  });
2360
2396
  (0, vue.onUnmounted)(() => {
2361
2397
  if (typeof window !== "undefined") {
2362
2398
  window.removeEventListener("resize", handleWindowResize);
2363
- document.body.classList.remove("has-opencode-split");
2364
- document.body.classList.remove("has-opencode-split-left");
2365
- document.body.classList.remove("has-opencode-split-right");
2366
- document.body.style.removeProperty("--opencode-split-width");
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
+ }
2367
2405
  }
2368
2406
  });
2369
2407
  return {
2370
2408
  effectiveMode,
2371
2409
  isSplitMode,
2410
+ isExtensionMode,
2372
2411
  panelWidth,
2373
2412
  splitConfig,
2374
2413
  splitPosition,
@@ -2529,6 +2568,11 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
2529
2568
  type: Number,
2530
2569
  required: false,
2531
2570
  default: 500
2571
+ },
2572
+ hideBubble: {
2573
+ type: Boolean,
2574
+ required: false,
2575
+ default: false
2532
2576
  }
2533
2577
  },
2534
2578
  emits: [
@@ -2613,8 +2657,8 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
2613
2657
  const splitPanelWidth = (0, vue.ref)(props.splitPanelWidth);
2614
2658
  const syncStateToIframe = () => {
2615
2659
  if (!iframeLoaded.value) return;
2616
- sendMessageToIframe("prompt-dock-visibility-change", { visible: promptDockVisible.value });
2617
- sendMessageToIframe("minimize-state-change", { minimized: minimized.value });
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 });
2618
2662
  };
2619
2663
  const handleFrameLoaded = () => {
2620
2664
  emit("frame-loaded");
@@ -2631,6 +2675,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
2631
2675
  localDisplayMode.value = val;
2632
2676
  });
2633
2677
  const handleToggleDisplayMode = () => {
2678
+ if (localDisplayMode.value === "extension" || localDisplayMode.value === "extension-selector") return;
2634
2679
  const modes = [
2635
2680
  "bubble",
2636
2681
  "split",
@@ -2710,7 +2755,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
2710
2755
  }
2711
2756
  });
2712
2757
  const bubbleOffset = (0, vue.ref)(void 0);
2713
- const { effectiveMode, isSplitMode, panelWidth, splitConfig, splitPosition, handleResize, handleToggle: handleSplitToggle, handleTogglePosition } = useSplitMode({
2758
+ const { effectiveMode, isSplitMode, isExtensionMode, panelWidth, splitConfig, splitPosition, handleResize, handleToggle: handleSplitToggle, handleTogglePosition } = useSplitMode({
2714
2759
  displayMode: localDisplayMode,
2715
2760
  splitMode: (0, vue.toRef)(props, "splitMode"),
2716
2761
  open: (0, vue.toRef)(props, "open"),
@@ -2778,12 +2823,15 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
2778
2823
  const handleToggleMinimize = () => {
2779
2824
  minimized.value = !minimized.value;
2780
2825
  promptDockVisible.value = !minimized.value;
2781
- sendMessageToIframe("prompt-dock-visibility-change", { visible: promptDockVisible.value });
2782
- sendMessageToIframe("minimize-state-change", { minimized: minimized.value });
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 });
2783
2828
  };
2784
2829
  const handleTogglePromptDock = () => {
2785
2830
  promptDockVisible.value = !promptDockVisible.value;
2786
- sendMessageToIframe("prompt-dock-visibility-change", { visible: promptDockVisible.value });
2831
+ sendMessageToIframe(_vite_plugin_opencode_assistant_shared.WIDGET_MSG.PROMPT_DOCK_VISIBILITY, { visible: promptDockVisible.value });
2832
+ };
2833
+ const handleRefresh = () => {
2834
+ window.location.reload();
2787
2835
  };
2788
2836
  const windowWidth = (0, vue.ref)(typeof window !== "undefined" ? window.innerWidth : 0);
2789
2837
  const windowHeight = (0, vue.ref)(typeof window !== "undefined" ? window.innerHeight : 0);
@@ -2948,7 +2996,8 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
2948
2996
  handleRemoveSelectedNode: (payload) => handleRemoveSelectedNode(payload.item, payload.index, payload.source),
2949
2997
  handleClearSelectedNodes,
2950
2998
  handleFrameLoaded,
2951
- handleBubbleOffsetChange
2999
+ handleBubbleOffsetChange,
3000
+ handleRefresh
2952
3001
  });
2953
3002
  __expose({
2954
3003
  showNotification,
@@ -3024,6 +3073,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
3024
3073
  bubbleOffset,
3025
3074
  effectiveMode,
3026
3075
  isSplitMode,
3076
+ isExtensionMode,
3027
3077
  panelWidth,
3028
3078
  splitConfig,
3029
3079
  splitPosition,
@@ -3032,6 +3082,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
3032
3082
  handleTogglePosition,
3033
3083
  handleToggleMinimize,
3034
3084
  handleTogglePromptDock,
3085
+ handleRefresh,
3035
3086
  windowWidth,
3036
3087
  windowHeight,
3037
3088
  handleWindowResize,
@@ -3081,101 +3132,105 @@ var _hoisted_7 = {
3081
3132
  role: "alert"
3082
3133
  };
3083
3134
  function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
3084
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)($setup.containerClasses) }, [
3085
- !$setup.isSplitMode ? ((0, vue.openBlock)(), (0, vue.createBlock)($setup["Trigger"], {
3086
- key: 0,
3087
- ref: "triggerRef",
3088
- onDragStart: $setup.handleDragStart,
3089
- onDragEnd: $setup.handleDragEnd
3090
- }, (0, vue.createSlots)({ _: 2 }, [$setup.slots["button-icon"] ? {
3091
- name: "default",
3092
- fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "button-icon")]),
3093
- key: "0"
3094
- } : void 0]), 1536)) : (0, vue.createCommentVNode)("v-if", true),
3095
- (0, vue.createVNode)($setup["ChatPanel"], {
3096
- ref: "frameRef",
3097
- mode: $setup.effectiveMode,
3098
- open: $props.open,
3099
- minimized: $setup.minimized,
3100
- "position-style": $setup.chatPositionStyle,
3101
- "animation-origin": $setup.chatAnimationOrigin,
3102
- "panel-width": $setup.panelWidth,
3103
- resizable: $setup.splitConfig.resizable,
3104
- "min-width": $setup.splitConfig.minWidth,
3105
- "max-width": $setup.splitConfig.maxWidth,
3106
- "no-transition": $setup.isRestoring,
3107
- dragging: $setup.isDragging,
3108
- "notification-visible": $setup.notificationVisible,
3109
- "notification-message": $setup.notificationMessage,
3110
- "notification-mode": $setup.notificationMode,
3111
- thinking: $props.thinking,
3112
- "resolved-theme": $setup.resolvedTheme,
3113
- "split-position": $setup.splitPosition,
3114
- onResize: $setup.handleResize,
3115
- onResizeStart: $setup.handleResizeStart,
3116
- onResizeEnd: $setup.handleResizeEnd,
3117
- onToggle: $setup.handleSplitToggle
3118
- }, (0, vue.createSlots)({
3119
- "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))])]),
3120
- _: 2
3121
- }, [
3122
- $setup.slots["session-toggle-icon"] ? {
3123
- name: "session-toggle-icon",
3124
- 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")]),
3125
3145
  key: "0"
3126
- } : void 0,
3127
- $setup.slots["select-icon"] ? {
3128
- name: "select-icon",
3129
- fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "select-icon")]),
3130
- key: "1"
3131
- } : void 0,
3132
- $setup.slots["close-icon"] ? {
3133
- name: "close-icon",
3134
- fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "close-icon")]),
3135
- key: "2"
3136
- } : void 0,
3137
- $setup.slots["empty-state"] ? {
3138
- name: "empty-state",
3139
- fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "empty-state")]),
3140
- key: "3"
3141
- } : void 0,
3142
- $setup.slots.loading ? {
3143
- name: "loading",
3144
- fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "loading")]),
3145
- key: "4"
3146
- } : void 0,
3147
- $setup.slots.error ? {
3148
- name: "error",
3149
- fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "error")]),
3150
- key: "5"
3151
- } : void 0,
3152
- $setup.slots.content ? {
3153
- name: "content",
3154
- fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "content")]),
3155
- key: "6"
3156
- } : void 0
3157
- ]), 1032, [
3158
- "mode",
3159
- "open",
3160
- "minimized",
3161
- "position-style",
3162
- "animation-origin",
3163
- "panel-width",
3164
- "resizable",
3165
- "min-width",
3166
- "max-width",
3167
- "no-transition",
3168
- "dragging",
3169
- "notification-visible",
3170
- "notification-message",
3171
- "notification-mode",
3172
- "thinking",
3173
- "resolved-theme",
3174
- "split-position",
3175
- "onResize",
3176
- "onToggle"
3177
- ]),
3178
- (0, vue.createVNode)($setup["SelectHint"]),
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),
3179
3234
  (0, vue.withDirectives)((0, vue.createElementVNode)("div", {
3180
3235
  class: "opencode-element-highlight",
3181
3236
  style: (0, vue.normalizeStyle)($setup.highlightStyle)
@@ -3200,7 +3255,7 @@ __vue_sfc__.render = __vue_render__;
3200
3255
  var open_code_widget_default = __vue_sfc__;
3201
3256
  //#endregion
3202
3257
  //#region es/index.mjs
3203
- var version = "1.0.73";
3258
+ var version = "1.0.75";
3204
3259
  function install(app, options) {
3205
3260
  [open_code_widget_default].forEach((item) => {
3206
3261
  if (item.install) app.use(item, options);