@vite-plugin-opencode-assistant/components 1.0.25 → 1.0.27

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.js +1 -1
  3. package/es/open-code-widget/composables/use-inspector.js +118 -79
  4. package/es/open-code-widget/composables/use-persist-state.d.ts +24 -0
  5. package/es/open-code-widget/composables/use-persist-state.js +59 -0
  6. package/es/open-code-widget/src/components/FloatingBubble/FloatingBubble-sfc.css +1 -1
  7. package/es/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.d.ts +2 -3
  8. package/es/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.js +50 -60
  9. package/es/open-code-widget/src/components/Trigger.vue.d.ts +2 -5
  10. package/es/open-code-widget/src/components/Trigger.vue.js +10 -38
  11. package/es/open-code-widget/src/context.d.ts +3 -0
  12. package/es/open-code-widget/src/index-sfc.css +1 -1
  13. package/es/open-code-widget/src/index.vue.d.ts +10 -10
  14. package/es/open-code-widget/src/index.vue.js +143 -28
  15. package/lib/@vite-plugin-opencode-assistant/components.cjs.js +359 -200
  16. package/lib/@vite-plugin-opencode-assistant/components.es.js +360 -201
  17. package/lib/components.css +2 -2
  18. package/lib/index.d.ts +1 -1
  19. package/lib/index.js +1 -1
  20. package/lib/open-code-widget/composables/use-inspector.js +118 -79
  21. package/lib/open-code-widget/composables/use-persist-state.d.ts +24 -0
  22. package/lib/open-code-widget/composables/use-persist-state.js +78 -0
  23. package/lib/open-code-widget/src/components/FloatingBubble/FloatingBubble-sfc.css +1 -1
  24. package/lib/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.d.ts +2 -3
  25. package/lib/open-code-widget/src/components/FloatingBubble/FloatingBubble.vue.js +49 -59
  26. package/lib/open-code-widget/src/components/Trigger.vue.d.ts +2 -5
  27. package/lib/open-code-widget/src/components/Trigger.vue.js +9 -37
  28. package/lib/open-code-widget/src/context.d.ts +3 -0
  29. package/lib/open-code-widget/src/index-sfc.css +1 -1
  30. package/lib/open-code-widget/src/index.vue.d.ts +10 -10
  31. package/lib/open-code-widget/src/index.vue.js +141 -26
  32. package/lib/web-types.json +1 -1
  33. package/package.json +2 -2
@@ -60,6 +60,7 @@ var import_use_selection = require("../composables/use-selection");
60
60
  var import_use_session = require("../composables/use-session");
61
61
  var import_use_widget = require("../composables/use-widget");
62
62
  var import_use_inspector = require("../composables/use-inspector");
63
+ var import_use_persist_state = require("../composables/use-persist-state");
63
64
  var import_context = require("./context");
64
65
  var import_vue3 = require("vue");
65
66
  const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProps(__spreadValues({}, {
@@ -92,6 +93,10 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
92
93
  },
93
94
  emits: ["update:open", "update:selectMode", "update:sessionListCollapsed", "update:currentSessionId", "update:selectedElements", "update:theme", "update:thinking", "toggle", "close", "toggle-session-list", "toggle-select-mode", "toggle-theme", "create-session", "select-session", "delete-session", "click-selected-node", "remove-selected-node", "clear-selected-nodes", "empty-action", "frame-loaded", "thinking-change"],
94
95
  setup(__props, { expose: __expose, emit: __emit }) {
96
+ (0, import_vue.useCssVars)((_ctx) => ({
97
+ "-chatAnimationOrigin.x": chatAnimationOrigin.value.x,
98
+ "-chatAnimationOrigin.y": chatAnimationOrigin.value.y
99
+ }));
95
100
  const props = __props;
96
101
  const emit = __emit;
97
102
  const slots = (0, import_vue2.useSlots)();
@@ -133,17 +138,26 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
133
138
  var _a;
134
139
  (_a = frameRef.value) == null ? void 0 : _a.sendMessageToIframe(type, data);
135
140
  };
141
+ const localSessionListCollapsed = (0, import_vue2.ref)(props.sessionListCollapsed);
142
+ const minimized = (0, import_vue2.ref)(false);
143
+ const promptDockVisible = (0, import_vue2.ref)(true);
144
+ const isRestoring = (0, import_vue2.ref)(true);
145
+ const iframeLoaded = (0, import_vue2.ref)(false);
146
+ const syncStateToIframe = () => {
147
+ if (!iframeLoaded.value) return;
148
+ sendMessageToIframe("prompt-dock-visibility-change", { visible: promptDockVisible.value });
149
+ sendMessageToIframe("minimize-state-change", { minimized: minimized.value });
150
+ };
136
151
  const handleFrameLoaded = () => {
137
152
  emit("frame-loaded");
153
+ iframeLoaded.value = true;
154
+ syncStateToIframe();
138
155
  };
139
156
  __expose({
140
157
  showNotification,
141
158
  showConfirmDialog,
142
159
  sendMessageToIframe
143
160
  });
144
- const localSessionListCollapsed = (0, import_vue2.ref)(props.sessionListCollapsed);
145
- const minimized = (0, import_vue2.ref)(false);
146
- const promptDockVisible = (0, import_vue2.ref)(true);
147
161
  (0, import_vue2.watch)(
148
162
  () => props.sessionListCollapsed,
149
163
  (val) => {
@@ -240,6 +254,53 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
240
254
  emit("toggle-select-mode", false);
241
255
  }
242
256
  });
257
+ const bubbleOffset = (0, import_vue2.ref)(void 0);
258
+ (0, import_use_persist_state.usePersistState)({
259
+ open: (0, import_vue2.toRef)(props, "open"),
260
+ minimized,
261
+ promptDockVisible,
262
+ bubbleOffset,
263
+ theme: (0, import_vue2.toRef)(props, "theme"),
264
+ sessionListCollapsed: localSessionListCollapsed,
265
+ onRestore: (state) => {
266
+ if (state.open !== void 0 && state.open !== props.open) {
267
+ emit("update:open", state.open);
268
+ emit("toggle", state.open);
269
+ }
270
+ if (state.minimized !== void 0) {
271
+ minimized.value = state.minimized;
272
+ }
273
+ if (state.bubbleOffset !== void 0) {
274
+ const bubbleSize = 44;
275
+ const margin = 10;
276
+ const maxX = window.innerWidth - bubbleSize - margin;
277
+ const maxY = window.innerHeight - bubbleSize - margin;
278
+ bubbleOffset.value = {
279
+ x: Math.max(margin, Math.min(state.bubbleOffset.x, maxX)),
280
+ y: Math.max(margin, Math.min(state.bubbleOffset.y, maxY))
281
+ };
282
+ }
283
+ if (state.theme !== void 0 && state.theme !== props.theme) {
284
+ emit("update:theme", state.theme);
285
+ emit("toggle-theme", state.theme);
286
+ }
287
+ if (state.sessionListCollapsed !== void 0 && state.sessionListCollapsed !== props.sessionListCollapsed) {
288
+ localSessionListCollapsed.value = state.sessionListCollapsed;
289
+ emit("update:sessionListCollapsed", state.sessionListCollapsed);
290
+ }
291
+ if (state.promptDockVisible !== void 0) {
292
+ promptDockVisible.value = state.promptDockVisible;
293
+ } else if (minimized.value) {
294
+ promptDockVisible.value = false;
295
+ }
296
+ (0, import_vue2.nextTick)(() => {
297
+ syncStateToIframe();
298
+ setTimeout(() => {
299
+ isRestoring.value = false;
300
+ }, 50);
301
+ });
302
+ }
303
+ });
243
304
  const handleToggleMinimize = () => {
244
305
  minimized.value = !minimized.value;
245
306
  promptDockVisible.value = !minimized.value;
@@ -250,41 +311,84 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
250
311
  promptDockVisible.value = !promptDockVisible.value;
251
312
  sendMessageToIframe("prompt-dock-visibility-change", { visible: promptDockVisible.value });
252
313
  };
253
- const bubbleOffset = (0, import_vue2.ref)({ x: 0, y: 0 });
314
+ const windowWidth = (0, import_vue2.ref)(typeof window !== "undefined" ? window.innerWidth : 0);
315
+ const windowHeight = (0, import_vue2.ref)(typeof window !== "undefined" ? window.innerHeight : 0);
316
+ const handleWindowResize = () => {
317
+ if (typeof window !== "undefined") {
318
+ windowWidth.value = window.innerWidth;
319
+ windowHeight.value = window.innerHeight;
320
+ }
321
+ };
322
+ (0, import_vue2.onMounted)(() => {
323
+ if (typeof window !== "undefined") {
324
+ window.addEventListener("resize", handleWindowResize);
325
+ }
326
+ });
327
+ (0, import_vue2.onUnmounted)(() => {
328
+ if (typeof window !== "undefined") {
329
+ window.removeEventListener("resize", handleWindowResize);
330
+ }
331
+ });
332
+ const bubbleQuadrant = (0, import_vue2.computed)(() => {
333
+ var _a, _b, _c, _d;
334
+ if (typeof window === "undefined") return "bottom-right";
335
+ const centerX = windowWidth.value / 2;
336
+ const centerY = windowHeight.value / 2;
337
+ const bubbleSize = 44;
338
+ const currentOffset = (_b = (_a = triggerRef.value) == null ? void 0 : _a.offset) != null ? _b : bubbleOffset.value;
339
+ const effectiveX = ((_c = currentOffset == null ? void 0 : currentOffset.x) != null ? _c : windowWidth.value - bubbleSize - 24) + bubbleSize / 2;
340
+ const effectiveY = ((_d = currentOffset == null ? void 0 : currentOffset.y) != null ? _d : windowHeight.value - bubbleSize - 24) + bubbleSize / 2;
341
+ if (effectiveX >= centerX && effectiveY >= centerY) {
342
+ return "bottom-right";
343
+ } else if (effectiveX < centerX && effectiveY >= centerY) {
344
+ return "bottom-left";
345
+ } else if (effectiveX >= centerX && effectiveY < centerY) {
346
+ return "top-right";
347
+ } else {
348
+ return "top-left";
349
+ }
350
+ });
254
351
  const isBubbleOnRightSide = (0, import_vue2.computed)(() => {
255
- if (typeof window === "undefined") return true;
256
- const centerX = window.innerWidth / 2;
257
- return bubbleOffset.value.x > centerX;
352
+ const quadrant = bubbleQuadrant.value;
353
+ return quadrant === "top-right" || quadrant === "bottom-right";
258
354
  });
259
355
  const chatPositionStyle = (0, import_vue2.computed)(() => {
356
+ var _a, _b, _c;
260
357
  if (typeof window === "undefined") return {};
261
- const windowWidth = window.innerWidth;
262
- const windowHeight = window.innerHeight;
263
358
  const chatWidth = minimized.value ? 300 : 700;
264
- const chatHeight = minimized.value ? 300 : Math.min(windowHeight * 0.86, windowHeight - 40);
359
+ const chatHeight = minimized.value ? 300 : Math.min(windowHeight.value * 0.86, windowHeight.value - 40);
265
360
  const gap = 24;
266
361
  const bubbleSize = 44;
267
362
  const screenMargin = 20;
363
+ const effectiveOffset = (_c = (_b = (_a = triggerRef.value) == null ? void 0 : _a.offset) != null ? _b : bubbleOffset.value) != null ? _c : { x: windowWidth.value - bubbleSize - gap, y: windowHeight.value - bubbleSize - gap };
268
364
  const style = {};
269
365
  if (isBubbleOnRightSide.value) {
270
- let rightPos = windowWidth - bubbleOffset.value.x + gap;
271
- const maxRight = windowWidth - chatWidth - screenMargin;
366
+ let rightPos = windowWidth.value - effectiveOffset.x + gap;
367
+ const minRight = screenMargin;
368
+ const maxRight = windowWidth.value - chatWidth - screenMargin;
272
369
  if (rightPos > maxRight) {
273
370
  rightPos = maxRight;
274
371
  }
372
+ if (rightPos < minRight) {
373
+ rightPos = minRight;
374
+ }
275
375
  style.right = `${rightPos}px`;
276
376
  style.left = "auto";
277
377
  } else {
278
- let leftPos = bubbleOffset.value.x + bubbleSize + gap;
279
- const maxLeft = windowWidth - chatWidth - screenMargin;
378
+ let leftPos = effectiveOffset.x + bubbleSize + gap;
379
+ const minLeft = screenMargin;
380
+ const maxLeft = windowWidth.value - chatWidth - screenMargin;
280
381
  if (leftPos > maxLeft) {
281
382
  leftPos = maxLeft;
282
383
  }
384
+ if (leftPos < minLeft) {
385
+ leftPos = minLeft;
386
+ }
283
387
  style.left = `${leftPos}px`;
284
388
  style.right = "auto";
285
389
  }
286
- let bottomPos = windowHeight - bubbleOffset.value.y - bubbleSize;
287
- const maxBottom = windowHeight - chatHeight - screenMargin;
390
+ let bottomPos = windowHeight.value - effectiveOffset.y - bubbleSize;
391
+ const maxBottom = windowHeight.value - chatHeight - screenMargin;
288
392
  if (bottomPos > maxBottom) {
289
393
  bottomPos = maxBottom;
290
394
  }
@@ -297,6 +401,20 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
297
401
  const handleBubbleOffsetChange = (offset) => {
298
402
  bubbleOffset.value = offset;
299
403
  };
404
+ const chatAnimationOrigin = (0, import_vue2.computed)(() => {
405
+ const quadrant = bubbleQuadrant.value;
406
+ switch (quadrant) {
407
+ case "top-left":
408
+ return { x: "-20px", y: "-20px" };
409
+ case "top-right":
410
+ return { x: "20px", y: "-20px" };
411
+ case "bottom-left":
412
+ return { x: "-20px", y: "20px" };
413
+ case "bottom-right":
414
+ default:
415
+ return { x: "20px", y: "20px" };
416
+ }
417
+ });
300
418
  const isDragging = (0, import_vue2.ref)(false);
301
419
  let wasOpenBeforeDrag = false;
302
420
  const handleDragStart = () => {
@@ -334,6 +452,7 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
334
452
  thinking: (0, import_vue2.toRef)(props, "thinking"),
335
453
  minimized,
336
454
  promptDockVisible,
455
+ bubbleOffset,
337
456
  iframeSource,
338
457
  buttonActive,
339
458
  sessionListTitle,
@@ -355,7 +474,8 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
355
474
  handleClickSelectedNode,
356
475
  handleRemoveSelectedNode: (payload) => handleRemoveSelectedNode(payload.item, payload.index, payload.source),
357
476
  handleClearSelectedNodes,
358
- handleFrameLoaded
477
+ handleFrameLoaded,
478
+ handleBubbleOffsetChange
359
479
  });
360
480
  const __returned__ = { props, emit, slots, notificationMessage, notificationVisible, notificationMode, get notificationTimer() {
361
481
  return notificationTimer;
@@ -365,7 +485,7 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)(__spreadProp
365
485
  return dialogResolve;
366
486
  }, set dialogResolve(v) {
367
487
  dialogResolve = v;
368
- }, showConfirmDialog, handleDialogConfirm, handleDialogCancel, frameRef, triggerRef, sendMessageToIframe, handleFrameLoaded, localSessionListCollapsed, minimized, promptDockVisible, buttonActive, containerClasses, iframeSource, sessionListTitle, resolvedTheme, handleClose, handleEmptyAction, handleToggle, handleToggleSessionList, handleToggleTheme, sessionItems, handleCreateSession, handleDeleteSession, handleSelectSession, bubbleVisible, hasSelectedElements, selectedElementItems, handleClearSelectedNodes, handleClickSelectedNode, handleRemoveSelectedNode, handleToggleSelectMode, highlightVisible, highlightStyle, tooltipVisible, tooltipStyle, tooltipContent, handleToggleMinimize, handleTogglePromptDock, bubbleOffset, isBubbleOnRightSide, chatPositionStyle, handleBubbleOffsetChange, isDragging, get wasOpenBeforeDrag() {
488
+ }, showConfirmDialog, handleDialogConfirm, handleDialogCancel, frameRef, triggerRef, sendMessageToIframe, localSessionListCollapsed, minimized, promptDockVisible, isRestoring, iframeLoaded, syncStateToIframe, handleFrameLoaded, buttonActive, containerClasses, iframeSource, sessionListTitle, resolvedTheme, handleClose, handleEmptyAction, handleToggle, handleToggleSessionList, handleToggleTheme, sessionItems, handleCreateSession, handleDeleteSession, handleSelectSession, bubbleVisible, hasSelectedElements, selectedElementItems, handleClearSelectedNodes, handleClickSelectedNode, handleRemoveSelectedNode, handleToggleSelectMode, highlightVisible, highlightStyle, tooltipVisible, tooltipStyle, tooltipContent, bubbleOffset, handleToggleMinimize, handleTogglePromptDock, windowWidth, windowHeight, handleWindowResize, bubbleQuadrant, isBubbleOnRightSide, chatPositionStyle, handleBubbleOffsetChange, chatAnimationOrigin, isDragging, get wasOpenBeforeDrag() {
369
489
  return wasOpenBeforeDrag;
370
490
  }, set wasOpenBeforeDrag(v) {
371
491
  wasOpenBeforeDrag = v;
@@ -409,7 +529,6 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
409
529
  $setup["Trigger"],
410
530
  {
411
531
  ref: "triggerRef",
412
- onOffsetChange: $setup.handleBubbleOffsetChange,
413
532
  onDragStart: $setup.handleDragStart,
414
533
  onDragEnd: $setup.handleDragEnd
415
534
  },
@@ -431,7 +550,7 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
431
550
  (0, import_vue3.withDirectives)((0, import_vue3.createElementVNode)(
432
551
  "div",
433
552
  {
434
- class: (0, import_vue3.normalizeClass)(["opencode-chat", { open: $props.open, minimized: $setup.minimized, dragging: $setup.isDragging }]),
553
+ class: (0, import_vue3.normalizeClass)(["opencode-chat", { open: $props.open, minimized: $setup.minimized, dragging: $setup.isDragging, "no-transition": $setup.isRestoring }]),
435
554
  style: (0, import_vue3.normalizeStyle)($setup.chatPositionStyle)
436
555
  },
437
556
  [
@@ -542,9 +661,7 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
542
661
  "div",
543
662
  {
544
663
  class: "opencode-element-highlight",
545
- style: (0, import_vue3.normalizeStyle)(__spreadValues({
546
- display: $setup.highlightVisible ? "block" : "none"
547
- }, $setup.highlightStyle))
664
+ style: (0, import_vue3.normalizeStyle)($setup.highlightStyle)
548
665
  },
549
666
  null,
550
667
  4
@@ -556,9 +673,7 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
556
673
  "div",
557
674
  {
558
675
  class: "opencode-element-tooltip",
559
- style: (0, import_vue3.normalizeStyle)(__spreadValues({
560
- display: $setup.tooltipVisible ? "block" : "none"
561
- }, $setup.tooltipStyle))
676
+ style: (0, import_vue3.normalizeStyle)($setup.tooltipStyle)
562
677
  },
563
678
  [
564
679
  (0, import_vue3.createElementVNode)(
@@ -1 +1 @@
1
- {"$schema":"https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json","framework":"vue","name":"@vite-plugin-opencode-assistant/components","version":"1.0.25","contributions":{"html":{"tags":[{"name":"open-code","attributes":[{"name":"","default":"`'bottom-right'`","description":"挂件显示的位置","value":{"type":"`'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'`","kind":"expression"}},{"name":"","default":"`false`","description":"挂件是否打开","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`'auto'`","description":"主题模式","value":{"type":"`'light' | 'dark' | 'auto'`","kind":"expression"}},{"name":"","default":"`'AI 助手'`","description":"助手头部显示的标题","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`'Ctrl+K'`","description":"快捷键提示文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`'按 ESC 或 Ctrl+P 退出'`","description":"选择模式快捷键提示文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`false`","description":"是否进入选择页面元素模式","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`true`","description":"会话列表是否折叠","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`'id'`","description":"会话列表项的唯一键字段","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`false`","description":"iframe 是否显示加载状态","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`undefined`","description":"会话列表是否加载中","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示会话列表骨架屏","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示空状态","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示错误状态","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`'当前项目暂无会话'`","description":"空状态显示的文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`'立即创建'`","description":"空状态操作按钮文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`''`","description":"Web UI 的 URL 来源","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`[]`","description":"会话列表数据","value":{"type":"`OpenCodeWidgetSession[]`","kind":"expression"}},{"name":"","default":"`null`","description":"当前选中的会话 ID","value":{"type":"`string | null`","kind":"expression"}},{"name":"","default":"`[]`","description":"已选中的元素列表","value":{"type":"`OpenCodeSelectedElement[]`","kind":"expression"}},{"name":"","default":"`true`","description":"是否显示\"一键清空\"按钮","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`true`","description":"是否启用选择模式","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示思考状态(加载中)","value":{"type":"`boolean`","kind":"expression"}}],"events":[{"name":"`update:open`","description":"当挂件打开或关闭时触发","arguments":[{"name":"open","type":"en"},{"name":"boolean"}]},{"name":"`update:selectMode`","description":"当选择模式切换时触发","arguments":[{"name":"mode","type":"de"},{"name":"boolean"}]},{"name":"`update:sessionListCollapsed`","description":"当会话列表折叠状态改变时触发","arguments":[{"name":"collapsed","type":"ed"},{"name":"boolean"}]},{"name":"`update:currentSessionId`","description":"当选中的会话 ID 改变时触发","arguments":[{"name":"sessionId","type":"Id"},{"name":"string | null"}]},{"name":"`update:selectedElements`","description":"当已选中的元素列表改变时触发","arguments":[{"name":"elements","type":"ts"},{"name":"OpenCodeSelectedElement[]"}]},{"name":"`update:theme`","description":"当主题模式改变时触发","arguments":[{"name":"theme","type":"me"},{"name":"'light' | 'dark' | 'auto'"}]},{"name":"`update:thinking`","description":"当思考状态改变时触发","arguments":[{"name":"thinking","type":"ng"},{"name":"boolean"}]},{"name":"","description":"点击触发挂件开关","arguments":[{"name":"open","type":"en"},{"name":"boolean"}]},{"name":"","description":"点击关闭按钮时触发","arguments":[]},{"name":"`toggle-session-list`","description":"点击会话列表切换按钮时触发","arguments":[{"name":"collapsed","type":"ed"},{"name":"boolean"}]},{"name":"`toggle-select-mode`","description":"点击选择模式切换按钮时触发","arguments":[{"name":"mode","type":"de"},{"name":"boolean"}]},{"name":"`toggle-theme`","description":"点击主题切换按钮时触发","arguments":[{"name":"theme","type":"me"},{"name":"'light' | 'dark' | 'auto'"}]},{"name":"`create-session`","description":"点击创建新会话时触发","arguments":[]},{"name":"`select-session`","description":"选中某个历史会话时触发","arguments":[{"name":"session","type":"on"},{"name":"OpenCodeWidgetSession"}]},{"name":"`delete-session`","description":"删除某个历史会话时触发","arguments":[{"name":"session","type":"on"},{"name":"OpenCodeWidgetSession"}]},{"name":"`click-selected-node`","description":"点击已选中的气泡或节点卡片时触发","arguments":[{"name":"element","type":"nt"},{"name":"OpenCodeSelectedElement"}]},{"name":"`remove-selected-node`","description":"删除已选中的元素时触发","arguments":[{"name":"payload","type":"ad"},{"name":"OpenCodeRemoveSelectedPayload"}]},{"name":"`clear-selected-nodes`","description":"清空所有选中元素时触发","arguments":[]},{"name":"`empty-action`","description":"点击空状态操作按钮时触发","arguments":[]},{"name":"`frame-loaded`","description":"iframe 加载完成时触发","arguments":[]},{"name":"`thinking-change`","description":"思考状态改变时触发(用于显示加载动画)","arguments":[{"name":"thinking","type":"ng"},{"name":"boolean"}]}],"slots":[{"name":"`button-icon`","description":"自定义触发按钮图标"},{"name":"`session-toggle-icon`","description":"自定义会话列表切换图标"},{"name":"`select-icon`","description":"自定义选择模式切换图标"},{"name":"`close-icon`","description":"自定义关闭按钮图标"},{"name":"`theme-icon`","description":"自定义主题切换图标"},{"name":"`sessions-empty`","description":"自定义会话列表空状态"},{"name":"`empty-state`","description":"自定义 iframe 空状态"},{"name":"","description":"自定义 iframe 加载状态"},{"name":"","description":"自定义错误状态"},{"name":"","description":"自定义 iframe 内容"}]}],"attributes":[]}},"js-types-syntax":"typescript"}
1
+ {"$schema":"https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json","framework":"vue","name":"@vite-plugin-opencode-assistant/components","version":"1.0.27","contributions":{"html":{"tags":[{"name":"open-code","attributes":[{"name":"","default":"`'bottom-right'`","description":"挂件显示的位置","value":{"type":"`'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'`","kind":"expression"}},{"name":"","default":"`false`","description":"挂件是否打开","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`'auto'`","description":"主题模式","value":{"type":"`'light' | 'dark' | 'auto'`","kind":"expression"}},{"name":"","default":"`'AI 助手'`","description":"助手头部显示的标题","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`'Ctrl+K'`","description":"快捷键提示文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`'按 ESC 或 Ctrl+P 退出'`","description":"选择模式快捷键提示文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`false`","description":"是否进入选择页面元素模式","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`true`","description":"会话列表是否折叠","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`'id'`","description":"会话列表项的唯一键字段","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`false`","description":"iframe 是否显示加载状态","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`undefined`","description":"会话列表是否加载中","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示会话列表骨架屏","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示空状态","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示错误状态","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`'当前项目暂无会话'`","description":"空状态显示的文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`'立即创建'`","description":"空状态操作按钮文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`''`","description":"Web UI 的 URL 来源","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`[]`","description":"会话列表数据","value":{"type":"`OpenCodeWidgetSession[]`","kind":"expression"}},{"name":"","default":"`null`","description":"当前选中的会话 ID","value":{"type":"`string | null`","kind":"expression"}},{"name":"","default":"`[]`","description":"已选中的元素列表","value":{"type":"`OpenCodeSelectedElement[]`","kind":"expression"}},{"name":"","default":"`true`","description":"是否显示\"一键清空\"按钮","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`true`","description":"是否启用选择模式","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示思考状态(加载中)","value":{"type":"`boolean`","kind":"expression"}}],"events":[{"name":"`update:open`","description":"当挂件打开或关闭时触发","arguments":[{"name":"open","type":"en"},{"name":"boolean"}]},{"name":"`update:selectMode`","description":"当选择模式切换时触发","arguments":[{"name":"mode","type":"de"},{"name":"boolean"}]},{"name":"`update:sessionListCollapsed`","description":"当会话列表折叠状态改变时触发","arguments":[{"name":"collapsed","type":"ed"},{"name":"boolean"}]},{"name":"`update:currentSessionId`","description":"当选中的会话 ID 改变时触发","arguments":[{"name":"sessionId","type":"Id"},{"name":"string | null"}]},{"name":"`update:selectedElements`","description":"当已选中的元素列表改变时触发","arguments":[{"name":"elements","type":"ts"},{"name":"OpenCodeSelectedElement[]"}]},{"name":"`update:theme`","description":"当主题模式改变时触发","arguments":[{"name":"theme","type":"me"},{"name":"'light' | 'dark' | 'auto'"}]},{"name":"`update:thinking`","description":"当思考状态改变时触发","arguments":[{"name":"thinking","type":"ng"},{"name":"boolean"}]},{"name":"","description":"点击触发挂件开关","arguments":[{"name":"open","type":"en"},{"name":"boolean"}]},{"name":"","description":"点击关闭按钮时触发","arguments":[]},{"name":"`toggle-session-list`","description":"点击会话列表切换按钮时触发","arguments":[{"name":"collapsed","type":"ed"},{"name":"boolean"}]},{"name":"`toggle-select-mode`","description":"点击选择模式切换按钮时触发","arguments":[{"name":"mode","type":"de"},{"name":"boolean"}]},{"name":"`toggle-theme`","description":"点击主题切换按钮时触发","arguments":[{"name":"theme","type":"me"},{"name":"'light' | 'dark' | 'auto'"}]},{"name":"`create-session`","description":"点击创建新会话时触发","arguments":[]},{"name":"`select-session`","description":"选中某个历史会话时触发","arguments":[{"name":"session","type":"on"},{"name":"OpenCodeWidgetSession"}]},{"name":"`delete-session`","description":"删除某个历史会话时触发","arguments":[{"name":"session","type":"on"},{"name":"OpenCodeWidgetSession"}]},{"name":"`click-selected-node`","description":"点击已选中的气泡或节点卡片时触发","arguments":[{"name":"element","type":"nt"},{"name":"OpenCodeSelectedElement"}]},{"name":"`remove-selected-node`","description":"删除已选中的元素时触发","arguments":[{"name":"payload","type":"ad"},{"name":"OpenCodeRemoveSelectedPayload"}]},{"name":"`clear-selected-nodes`","description":"清空所有选中元素时触发","arguments":[]},{"name":"`empty-action`","description":"点击空状态操作按钮时触发","arguments":[]},{"name":"`frame-loaded`","description":"iframe 加载完成时触发","arguments":[]},{"name":"`thinking-change`","description":"思考状态改变时触发(用于显示加载动画)","arguments":[{"name":"thinking","type":"ng"},{"name":"boolean"}]}],"slots":[{"name":"`button-icon`","description":"自定义触发按钮图标"},{"name":"`session-toggle-icon`","description":"自定义会话列表切换图标"},{"name":"`select-icon`","description":"自定义选择模式切换图标"},{"name":"`close-icon`","description":"自定义关闭按钮图标"},{"name":"`theme-icon`","description":"自定义主题切换图标"},{"name":"`sessions-empty`","description":"自定义会话列表空状态"},{"name":"`empty-state`","description":"自定义 iframe 空状态"},{"name":"","description":"自定义 iframe 加载状态"},{"name":"","description":"自定义错误状态"},{"name":"","description":"自定义 iframe 内容"}]}],"attributes":[]}},"js-types-syntax":"typescript"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-plugin-opencode-assistant/components",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Reusable OpenCode widget components built with Pagoda CLI",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "css-selector-generator": "^3.9.1",
34
- "@vite-plugin-opencode-assistant/shared": "1.0.25"
34
+ "@vite-plugin-opencode-assistant/shared": "1.0.27"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@vitejs/plugin-vue": "^6.0.5",